瀏覽代碼

Merge branch 'dev-4.9.3' of http://192.168.32.253:3000/Software/android-cloud-H5 into dev-4.9.3

heyang 3 年之前
父節點
當前提交
083dbcf4cf

+ 30 - 15
microserviceUserH5/static/js/vender/vue/api.js

@@ -15,9 +15,16 @@
   })
 }
 //获取活动数据
- function getActDetail(token) {
+ function getActDetail() {
   return service({
-    url: `/v4/actFissionAward/getActDetail`,
+    url: `/api/public/v4/actFissionAward/getActDetail`,
+    method: 'get',
+  })
+}
+//获取活动数据
+function getActDetailList(token) {
+  return service({
+    url: `/api/public/v4/actFissionAward/getActDetail`,
     method: 'get',
     headers:{
       'Authorization': token
@@ -27,7 +34,7 @@
 //跑马灯
 function getMarquee() {
   return service({
-    url: `/v4/actFissionAward/marquee`,
+    url: `/api/public/v4/actFissionAward/marquee`,
     method: 'get',
  
   })
@@ -35,7 +42,7 @@ function getMarquee() {
 //活动领取奖励
 function getAwardPage(token,params) {
   return service({
-    url: `/v4/actFissionAward/awardPage`,
+    url: `/api/public/v4/actFissionAward/awardPage`,
     method: 'post',
     headers:{
       'Authorization': token
@@ -43,14 +50,22 @@ function getAwardPage(token,params) {
     data: params
   })
 }
-// //活动领取校验接口
-// function getAwardPage(params) {
-//   return service({
-//     url: `/v4/actFissionAward/receiveCheck`,
-//     method: 'post',
-//     headers:{
-//       'Authorization': token
-//     },
-//     data: params
-//   })
-// }
+//活动领取校验接口
+function getCheck(token) {
+  return service({
+    url: `/api/public/v4/actFissionAward/receiveCheck`,
+    method: 'get',
+    headers:{
+      'Authorization': token
+    },
+  
+  })
+}
+//获取攻略列表
+function getStrategy() {
+  return service({
+    url: `/api/public/v4/actFissionAward/getStrategy`,
+    method: 'get',
+  
+  })
+}

+ 1 - 1
microserviceUserH5/static/js/vender/vue/config.js

@@ -4,7 +4,7 @@
 // var base_url = 'http://192.168.100.98:3001'; //测试服务器
 //var base_url = baseUrl; //测试服务器
 //http://test.androidscloud.com
-//var base_url = 'http://192.168.11.220:8017';
+var base_url = baseUrl;
 //https://www.nn-jtjt.com/app
 // var base_url = 'http://kmpark.cdwatertek.com/appwechatpay'; //测试服务器
 // var base_url = 'http://192.168.100.83:3001'; //测试服务器

文件差異過大導致無法顯示
+ 7 - 0
microserviceUserH5/static/js/vender/vue/vue-clipboard.min.js


+ 62 - 34
microserviceUserH5/vcloud/actFission.html

@@ -130,6 +130,13 @@
 			margin-bottom: 0.08rem;
 			font-family: PingFangSC-Regular, PingFang SC;
 			color: #272624;
+			width: 2.6rem;
+			display: block;
+			overflow: hidden;
+			word-break: keep-all;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+
 		}
 
 		.list-nav .user .text p+p {
@@ -276,23 +283,23 @@
 					<div class="img-box">活动奖励</div>
 				</div>
 				<div class="outer-box" v-if='rewardList&&rewardList.length>0'>
-					<van-list v-model="loading"  :finished-text="finishedText"
-						:finished="finished"    :immediate-check=false  @load="onLoad">
-					<div class="list-nav" v-for="(item,index) in rewardList" :key="index">
-						<div class="user">
-							<img :src="standarImg(item.headImgUrl)" class="tou" :onerror="defaultImg" alt="">
-							<div class="text">
-								<p>{{item.surfaceName}}</p>
-								<p>{{item.createTime}}</p>
+					<van-list v-model="loading" :finished-text="finishedText" :finished="finished"
+						:immediate-check=false @load="onLoad">
+						<div class="list-nav" v-for="(item,index) in rewardList" :key="index">
+							<div class="user">
+								<img :src="standarImg(item.headImgUrl)" class="tou" :onerror="defaultImg" alt="">
+								<div class="text">
+									<p>{{item.surfaceName}}</p>
+									<p>{{item.createTime}}</p>
+								</div>
 							</div>
-						</div>
-						<div class="right-nav">
-							<p>星动天卡</p>
-							<p class="btn" @click='goGetReward' v-if='item.receiveStatus==0'>领取</p>
-							<p class="btn isdisabled" v-if='item.receiveStatus==1'>已领取</p>
+							<div class="right-nav">
+								<p>星动天卡</p>
+								<p class="btn" @click='goGetReward(item.id)' v-if='item.receiveStatus==0'>领取</p>
+								<p class="btn isdisabled" v-if='item.receiveStatus==1'>已领取</p>
 
+							</div>
 						</div>
-					</div>
 					</van-list>
 
 				</div>
@@ -333,12 +340,11 @@
 			el: '#app',
 			data: {
 				isshow: false,
-				id: GetRequest().id ? GetRequest().id : 404,
-				topic: {},
+				token: GetRequest().token ? GetRequest().token :'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiI3MTY0OCIsImNsaWVudCI6IjAiLCJleHAiOjE2NDAzMTk5NTIsInVzZXJuYW1lIjoiYWRtaW4ifQ.PAV3biqh1JjiTHB5nyOlBjVMOk5II3Q8o4_OuYAMVCg',
 				rewardList: [],
 				queryParams: {
 					pageNum: 1,
-					pageSize: 5
+					pageSize: 10
 				},
 				isDisable: false,
 				finished: false,
@@ -350,13 +356,12 @@
 				defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
 				actStatus: 0, //0活动状态 1开始
 				marqueeList: [],
-				token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiIxNjc1OCIsImNsaWVudCI6IjAiLCJleHAiOjE2NDAyMTM3MDIsInVzZXJuYW1lIjoiYWRtaW4ifQ.3iGCT3FN0WByQHYebuiB4vSAnuuuU16znr8h0H-6jZE',
-
 			},
 			created() {
 				this.getAwardPage(); //获取奖励列表
 			},
 			mounted() {
+				this.getActDetailList();//获取活动上下架
 				this.getActDetail();
 				this.getMarquee(); //跑马灯
 
@@ -374,29 +379,38 @@
 						gotoUrl,
 						shareImg
 					} = this.shareInfo;
+					console.log({title:title,content:content,gotoUrl:gotoUrl,shareImg:shareImg});
 					if (isAndroid) {
 						window.native.share(title, content, gotoUrl, shareImg)
 					} else if (isIOS) {
-
+						window.webkit.messageHandlers.share.postMessage({title:title,content:content,gotoUrl:gotoUrl,shareImg:shareImg});
 					}
 				},
 				standarImg(id) {
 					return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
 				},
-				getActDetail() { //获取活动状态
+				getActDetail(){
+					getActDetail(this.token).then(res => {
+						if (res.status === 0) {
+							this.actStatus = res.data.actStatus;
+						} else {
+							this.$toast(res.msg);
+						}
+					})
+				},
+				getActDetailList(){ //获取活动状态
 					this.$toast.loading({
 						duration: 0,
 						message: '加载中...',
 						forbidClick: true,
 						loadingType: 'spinner',
 					});
-					getActDetail(this.token).then(res => {
-						 this.$toast.clear();
+					getActDetailList(this.token).then(res => {
+						this.$toast.clear();
 						if (res.status === 0) {
-							this.actStatus = res.data.actStatus;
 							this.shareInfo = res.data;
 						} else {
-						  this.$toast(res.msg);
+							this.$toast(res.msg);
 						}
 					})
 				},
@@ -407,7 +421,8 @@
 							let infolist = res.data.list;
 							if (infolist) {
 								this.rewardList = this.rewardList.concat(infolist);
-								if (infolist.length < this.queryParams.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+								if (infolist.length < this.queryParams
+									.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
 									this.finished = true;
 								}
 							} else {
@@ -420,15 +435,15 @@
 								this.queryParams.pageNum -= 1
 							}
 						}
-						
+
 					})
-		
+
 				},
 				//滚动加载时触发,list组件定义的方法
 				onLoad() {
 					let times = setTimeout(() => {
 						this.queryParams.pageNum += 1 //每请求一次,页面数+1
-					    this.getAwardPage();
+						this.getAwardPage();
 						clearTimeout(times)
 					}, 500)
 				},
@@ -441,12 +456,25 @@
 						}
 					})
 				},
-				goGetReward() {
-					if (isAndroid) {
-						window.native.activatePhone(1, 0)
-					} else if (isIOS) {
+				goGetReward(id) {
+					getCheck(this.token).then(res => {
+						if (res.status === 0) {
+							if (isAndroid) {
+								window.native.activatePhone(1, id)
+							} else if (isIOS) {
+								window.webkit.messageHandlers.receive.postMessage({
+									"awardId": id
+								});
+							}
+						} else if (res.status == 1) {
+							return;
+							this.$toast(res.msg);
+						} else {
+							return
+							this.$toast(res.msg);
+						}
+					})
 
-					}
 				},
 				download() {
 

+ 124 - 39
microserviceUserH5/vcloud/actFissionShare.html

@@ -104,7 +104,7 @@
 
         .top-content {
             width: 100%;
-            padding: 0.2rem 0.3rem;
+            padding-bottom: 0.3rem;
 
         }
 
@@ -121,8 +121,6 @@
 
         }
 
-
-
         .topic-info img {
             max-width: 100%;
             width: auto;
@@ -170,31 +168,54 @@
             font-family: PingFangSC-Regular, PingFang SC;
             color: #FFFFFF;
         }
+
+        .van-swipe-item p:first-of-type {
+            max-width: 2.4rem;
+            display: block;
+            overflow: hidden;
+            word-break: keep-all;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+        }
+
+        .topic-info img {
+            max-width: 100%;
+            width: auto;
+            height: auto;
+            border-radius: 0.2rem;
+            margin-bottom: 0.2rem;
+            margin-top: 0.2rem;
+        }
+
+        .topic-info p {
+            font-size: 0.3rem;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #333333;
+            letter-spacing: 0.02rem;
+
+        }
     </style>
 </head>
 
 <body>
     <div id="app" v-cloak class="container">
-        <div v-if='!isshow'>
+        <div v-if='isshow&&topic'>
 
             <div class="top-banner">
                 <van-notice-bar :scrollable="false">
                     <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
-                        <van-swipe-item>
-                            <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
-                            <p>用户昵称超长显示…</p>
-                            <p>已领取分享奖励</p>
-                        </van-swipe-item>
-                        <van-swipe-item>
-                            <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
-                            <p>用户昵称超长显示…</p>
-                            <p>已领取分享奖励</p>
+                        <van-swipe-item v-for="(item,index) in marqueeList">
+                            <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt="">
+                            <p>{{item.surfaceName}}</p>
+                            <p>已获得星动云手机套餐</p>
                         </van-swipe-item>
+
                     </van-swipe>
                 </van-notice-bar>
             </div>
-            <div class="top-content" v-if='!isshow&&topic.content'>
-                <div v-html="topic.content" class="topic-info"></div>
+            <div class="top-content">
+                <div v-html="topic" class="topic-info"></div>
 
             </div>
             <div class="footer">
@@ -203,11 +224,12 @@
                         <p>激活码:</p>
                         <p>AS4*********SD3</p>
                     </div>
-                    <div class="button-download">点击复制并下载</div>
+                    <div class="button-download copybtn" :data-clipboard-text="key"
+                         @click='createCopy()'>点击复制并下载</div>
                 </div>
             </div>
         </div>
-        <div v-if='isshow' class="hideContainer">
+        <div v-if='!isshow' class="hideContainer">
             <div>
                 <img src="../static/offImg/no-data.png" alt="" />
                 <p>活动已下架,敬请期待</p>
@@ -218,72 +240,135 @@
     <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 src="../static/js/vender/vue/vue-clipboard.min.js"></script>
 
     <script type="text/javascript">
         new Vue({
             el: '#app',
             data: {
-                isshow: false,
+                isshow: true,
                 id: GetRequest().id ? GetRequest().id : 404,
-                topic: {}
+                topic: null,
+                defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
+                marqueeList: [],
+                key: '3333',
 
             },
             created() {
                 // window.location.href = 'investigate.html'
             },
             mounted() {
+                this.getActDetail();
+
+                this.getMarquee(); //跑马灯
 
 
-                // this.getList();
 
             },
             methods: {
+                //查看活动是否下架
+                getActDetail() { //获取活动状态
+                    getActDetail().then(res => {
+                        this.$toast.clear();
+                        if (res.status === 0) {
+                            if (res.data.actStatus == 1) {
+                                this.isshow = true;
+                                this.getStrategy();
+                            } else {
+                                this.isshow = false;
+                            }
+
+                        } else {
+                            this.$toast(res.msg);
+                        }
+                    })
+                },
                 getCheck() {
                     getEvantCheck(this.id).then(res => {
                         console.log(res)
                     })
                 },
+                createCopy(){
+                    this.$toast.loading({
+                        duration: 2000,
+                        message: '加载中...',
+                        forbidClick: true,
+                        loadingType: 'spinner',
+                    });
+						var clipboard = new ClipboardJS('.copybtn') //此处为点击的dom的类名
+                       
+						console.log(232);
+						clipboard.on('success', (e)=>{
+                            this.$toast('复制成功');
+						    
+							clipboard.destroy()
+						})
+						clipboard.on('error', (e)=>{
+                            this.$toast('复制失败');
+							clipboard.destroy()
+						})
+					},
                 download() {
+
                     var u = navigator.userAgent,
                         app = navigator.appVersion;
                     var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
                     var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
                     if (isAndroid) {
                         window.location.href =
-                            'http://www.androidscloud.com/admin/attachment/download/2117e9b7f3734b16b81b9d7bb1c5a601';
+                            'http://www.androidscloud.com//suanchou';
                     } else if (isIOS) {
                         window.location.href = 'https://www.pgyer.com/gemini6';
-                    } else {
-
                     }
                 },
-                getList() {
+                standarImg(id) {
+                    return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
+                },
+                getMarquee() {
+                    getMarquee().then(res => {
+                        if (res.status === 0) {
+                            this.marqueeList = res.data;
+                        } else {
+                            this.$toast(res.msg);
+                        }
+                    })
+                },
+                getStrategy() {
                     this.$toast.loading({
                         duration: 0,
                         message: '加载中...',
                         forbidClick: true,
                         loadingType: 'spinner',
                     });
-                    // getEvantDetails(this.id).then(res => {
-                    //     this.$toast.clear();
-                    //     if (res.status == 0) {
-                    //         if (res.data) {
-                    //             this.isshow = false;
-                    //             this.topic = res.data;
-                    //         } else {
-                    //             this.isshow = true;
-
-                    //         }
-
+                    getStrategy().then(res => {
+                        this.$toast.clear();
+                        if (res.status == 0) {
+                            if (res.data) {
+                                this.isshow = true;
+                                this.topic = res.data.content;
+                                console.log(this.topic)
+                            } else {
+                                this.isshow = false;
+
+                            }
+
+                        }
+                        console.log(res)
 
-                    //     } else {
+                    })
+                },
+                onCopy() {
+                    console.log(2323);
+                    this.$toast('复制成功');
 
-                    //     }
-                    // })
-                }
 
+                },
+                onError() {
+                    this.$toast('复制失败');
 
+                },
             }
+
         })
     </script>
 </body>