瀏覽代碼

Merge branch 'uat' of Software/android-cloud-H5 into master-new

heyang 3 年之前
父節點
當前提交
5a142ea965

+ 3 - 3
microserviceUserH5/static/css/anniversaryCelebrate.css

@@ -609,7 +609,7 @@ ul, li {
   margin-top: 0.6rem;
   width: 1.66rem;
   height: 1.18rem;
-  animation: mymove 0.8s;
+  animation: mymoves 0.8s;
 }
 
 .card-text{
@@ -624,7 +624,7 @@ ul, li {
 .many-card{
   width: 1.48rem;
   height: 1.1rem;
-  animation: mymove 0.8s;
+  animation: mymoves 0.8s;
 }
 
 .many-card-item:nth-child(4n){
@@ -663,7 +663,7 @@ ul, li {
   display: none;
 }
 
-@keyframes mymove {
+@keyframes mymoves {
   0%   {transform:scale(0,0);}
   100% {transform:scale(1,1);}
 }

+ 0 - 1
microserviceUserH5/vcloud/actFissionShare.html

@@ -923,7 +923,6 @@
 					if (isAndroid) {
 						window.native.share(title, content, `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?username=${result}&strategyId=${this.strategyId}&tagId=${GetRequest().tagId}`, shareImg)
 					} else if (isIOS) {
-
 						window.webkit.messageHandlers.share.postMessage({
 							title: title,
 							content: content,

+ 34 - 31
microserviceUserH5/vcloud/anniversaryCelebrate.html

@@ -297,7 +297,7 @@
 	</script>
 	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
 	<script type="text/javascript">
-        var baseUrl = 'http://192.168.31.198'
+        // var baseUrl = 'http://14.18.190.141:1280'
 	    let timer,flag = true;
 		var url = window.location.href;
 		url = url.split('/')
@@ -331,17 +331,22 @@
 		    distributionPages = 0,
 		    sliderNumber = 0,//滑块是数量,控制溢出不能滑动
 			isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
-		// 初始化数据
-		window.onload = function(){
-			if (isAndroid && window.native) {
-				window.native.enableSharePage(
-					'您的好友送你一台免费云机',
-					'您的好友送你一台免费云机',
-					`${baseUrl}/h5/microserviceUserH5/vcloud/anniversaryCelebrate.html`,
-					'https://test.androidscloud.com/file-center/fileOperate/getImage?id=215553'
-				);
-			}
+		if (ua.match(/MicroMessenger/i) == "micromessenger") {
+			//ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
+			wx.miniProgram.getEnv((res) => {
+				if (res.miniprogram) {
+					isMiniprogram = true;
+				} else {
+					isMiniprogram = false;
+				}
+			})
+		} else {
+			isMiniprogram = false;
 		}
+		if(id){
+			getPhoneNumber();
+		}
+		// 初始化数据
 		init();
 		function init() {
 			$.ajax({
@@ -656,22 +661,22 @@
 				},
 			})
 		}
-		//点击领取按钮
-		$('.light-content-list')[0].addEventListener('click',(e) => {
-			if (e.target.className === 'get-btn ') {
-				let awardId = parseInt(e.target.dataset.awardid);
-				let day = parseInt(e.target.dataset.day);
-				if (isMiniprogram) { // 小程序
-					wx.miniProgram.navigateTo({
-						url: `/packageA/activityCloudPhone/index?id=${awardId.toString()}&day=${day}`
-					})
-				} else if (isAndroid) { // 安卓
-					window.native.activatePhone(3, awardId, day);
-				} else if (isiOS) {
-					window.webkit.messageHandlers.activatePhone.postMessage({ type: 3, awardId: awardId, day: day });
-				}
-			}
-		},false);
+		// //点击领取按钮
+		// $('.light-content-list')[0].addEventListener('click',(e) => {
+		// 	if (e.target.className === 'get-btn ') {
+		// 		let awardId = parseInt(e.target.dataset.awardid);
+		// 		let day = parseInt(e.target.dataset.day);
+		// 		if (isMiniprogram) { // 小程序
+		// 			wx.miniProgram.navigateTo({
+		// 				url: `/packageA/activityCloudPhone/index?id=${awardId.toString()}&day=${day}`
+		// 			})
+		// 		} else if (isAndroid) { // 安卓
+		// 			window.native.activatePhone(3, awardId, day);
+		// 		} else if (isiOS) {
+		// 			window.webkit.messageHandlers.activatePhone.postMessage({ type: 3, awardId: awardId, day: day });
+		// 		}
+		// 	}
+		// },false);
 		//点击规则
 		$('.rule-wrap')[0].addEventListener('click',(e) => {
 			$('.rule-result-dialog').animate({top: '1.86rem'},"fast");
@@ -760,7 +765,7 @@
 				cache: false,
 				success: function (res) {
 					if (res.status === 0) {
-						let records = res.data.list;
+						let records = res.data.pageInfo.list;
 						totalRecords = [...totalRecords, ...records];
 						if(records.length === 0){
 							$('.page-row').eq(0).css('display','none');
@@ -776,8 +781,7 @@
 								len = records.length;
 							for (var i = 0; i < len; i++) {
 					            // 解决ios时间显示为NaN
-								now = '2021-11-11 12:22:22'
-								// var now = res.data.now.replace(/T/g, ' ');
+								var now = res.data.currentTime.replace(/T/g, ' ');
 					                now = now.replace(/\-/g, '/');
 								var exceptTime = records[i].exceptTime.replace(/T/g, ' ');
 								    exceptTime = exceptTime.replace(/\-/g, '/');
@@ -1087,7 +1091,6 @@
 			document.documentElement.style.overflow='auto';
 		},false);
 		//获取云机数量
-		getPhoneNumber();
 		function getPhoneNumber(){
 			$.ajax({
 				url: baseUrl + '/api/pay/v2/meal/info?phoneType=SVIP',

+ 161 - 25
microserviceUserH5/vcloud/userManual.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="zh-CN">
+<html lang="en">
   <head>
     <meta charset="UTF-8" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
@@ -10,11 +10,18 @@
     <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico" />
     <title>双子星</title>
     <link rel="stylesheet" href="../static/css/normalize-8.0.1.css" />
+    <!-- <script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/vConsole/3.12.1/vconsole.min.js"></script>
+    <script>
+      // VConsole will be exported to `window.VConsole` by default.
+      var vConsole = new window.VConsole();
+    </script> -->
+
     <script src="../static/js/vender/vue/vue.min.js"></script>
+
     <!-- <script src="https://cdn.staticfile.org/vue/2.2.2/vue.js"></script> -->
     <!-- <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"></script> -->
     <script src="../static/js/vender/config.js"></script>
-    <script src="../static/js/tailwindcss/v3.0.24/index.js"></script>
+    <!-- <script src="../static/js/tailwindcss/v3.0.24/index.js"></script>
     <script>
       tailwind.config = {
         theme: {},
@@ -22,24 +29,80 @@
           preflight: false,
         },
       };
-    </script>
-    <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
+    </script> -->
+    <!-- <script src="../static/js/vender/jquery-3.4.1.min.js"></script> -->
+
     <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css" />
     <script src="../static/js/vender/toastr/toastr.min.js"></script>
     <script>
       toastr.options.positionClass = 'toast-center-center';
     </script>
+    <style>
+      [v-cloak] {
+        display: none;
+      }
+      /* @media screen and (max-width: 750px) {
+        html {
+          font-size: calc(100vw / 7.5);
+        }
+      }
+      @media screen and (min-width: 750px) {
+        html {
+          font-size: calc(750px / 7.5);
+        }
+      } */
+      .phone-container {
+        color: #333333;
+        line-height: 1.5;
+        padding: 20px;
+      }
+      /* .user-Agreement-content {
+        font-size: 0.28rem;
+        line-height: 1.5;
+        text-align: justify;
+      }
+      h1 {
+        font-size: 0.32rem;
+      }
+      h2 {
+        font-size: 0.31rem;
+      }
+      h3 {
+        font-size: 0.3rem;
+      }
+      h4 {
+        font-size: 0.29rem;
+      }
+      h5 {
+        font-size: 0.28rem;
+      }
+      h6 {
+        font-size: 0.27rem;
+      } */
+    
+      .phone-container p {
+        /* font-size: 0.28rem; */
+      }
+      .title {
+        text-align: center;
+        font-weight: bold;
+      }
+    </style>
   </head>
   <body>
+    <noscript>
+      <div class="">noscript</div>
+    </noscript>
+    <!-- <div class="data">777</div> -->
     <div v-cloak id="app">
-      <h1 class="text-center mt-2">{{title}}</h1>
-      <div class="p-2" v-html="content"></div>
+      <!-- <h1 class="title">{{title}}</h1> -->
+      <div class="phone-container" v-html="content"></div>
     </div>
     <script src="../static/js/vender/vue/axios.min.js"></script>
     <script src="../static/js/vender/vue/config.js"></script>
     <script src="../static/js/vender/vue/api.js"></script>
 
-    <script type="text/javascript">
+    <!-- <script type="text/javascript">
       Vue.config.errorHandler = function (err, vm, info) {
         toastr.error(err.message);
         return false;
@@ -51,33 +114,106 @@
           content: '',
         },
         computed: {},
+        methods: {},
+        mounted() {
+          service
+            .get('/api/public/v5/agreementApi/content/getContentByType', {
+              params: {
+                agreementCoding: 'XYPZYHXY2004',
+                type: 1,
+              },
+            })
+            .then(
+              (response)=> {
+                this.title = response.data.agreementName;
+                this.content = response.data.content;
 
-        methods: {
-          async getUserManual() {
-            const response = await service.get(
-              '/api/public/v5/agreementApi/content/getContentByType',
-              {
-                params: {
-                  agreementCoding: 'XYPZYHXY2004',
-                  type: 1,
-                },
+                // const html = document.createElement('html');
+
+                // html.innerHTML = response.data.content;
+
+                // const phoneContainers =
+                //   html.querySelectorAll('.phone-container');
+
+                // if (phoneContainers.length > 0) {
+                //   this.content = phoneContainers.item(
+                //     phoneContainers.length - 1,
+                //   ).innerHTML;
+                // } else {
+                //   this.content = response.data.content;
+                // }
+              },
+              (error) => {
+                toastr.error(err.message);
               },
             );
-            return response.data;
-          },
-        },
-
-        async mounted() {
-          // throw new Error('失敬失敬');
-          const { agreementName: title, content } = await this.getUserManual();
-          this.title = title;
-          this.content = content;
         },
         errorCaptured(err, vm, info) {
           toastr.error(err.message);
           return false;
         },
       });
+    </script> -->
+
+    <script>
+      // console.log($('.data').html('888'));
+      new Vue({
+        el: '#app',
+        data() {
+          return {
+            title: '',
+            content: '',
+          };
+        },
+        mounted() {
+          const t = this;
+          service
+            .get('/api/public/v5/agreementApi/content/getContentByType', {
+              params: {
+                agreementCoding: 'XYPZYHXY2004',
+                type: 1,
+              },
+            })
+            .then(function (response) {
+              t.title = response.data.agreementName;
+              // t.content = response.data.content;
+              const html = document.createElement('html');
+              // console.log(html);
+              html.innerHTML = response.data.content;
+
+              const phoneContainers = html.querySelectorAll('.phone-container');
+
+              if (phoneContainers.length > 0) {
+                t.content =
+                  phoneContainers[phoneContainers.length - 1].innerHTML;
+              } else {
+                t.content = response.data.content;
+              }
+            });
+
+          // .then(
+          //   function (response) {
+          // //     console.log(response);
+          //     t.title = response.data.agreementName;
+          //     t.content = response.data.content;
+          // //     // const html = document.createElement('html');
+          // //     // html.innerHTML = response.data.content;
+          // //     // const phoneContainers =
+          // //     //   html.querySelectorAll('.phone-container');
+          // //     // if (phoneContainers.length > 0) {
+          // //     //   this.content = phoneContainers.item(
+          // //     //     phoneContainers.length - 1,
+          // //     //   ).innerHTML;
+          // //     // } else {
+          // //     //   this.content = response.data.content;
+          // //     // }
+          //   }
+          // //   // function (err) {
+          // //   //   toastr.error(err.message);
+          // //   // },
+          // );
+        },
+      });
     </script>
   </body>
 </html>