Pārlūkot izejas kodu

添加ios联调

ymm 3 gadi atpakaļ
vecāks
revīzija
7f7800623e

+ 23 - 18
microserviceUserH5/static/js/vender/vue/api.js

@@ -15,19 +15,16 @@
   })
 }
 //获取活动数据
- function getActDetail(token) {
+ function getActDetail() {
   return service({
-    url: `/v4/actFissionAward/getActDetail`,
+    url: `/api/public/v4/actFissionAward/getActDetail`,
     method: 'get',
-    headers:{
-      'Authorization': token
-    },
   })
 }
 //跑马灯
 function getMarquee() {
   return service({
-    url: `/v4/actFissionAward/marquee`,
+    url: `/api/public/v4/actFissionAward/marquee`,
     method: 'get',
  
   })
@@ -35,7 +32,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 +40,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'; //测试服务器

+ 50 - 31
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,12 @@
 			el: '#app',
 			data: {
 				isshow: false,
-				id: GetRequest().id ? GetRequest().id : 404,
+				token: GetRequest().token ? GetRequest().token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiI1MTc5OSIsImNsaWVudCI6IjAiLCJleHAiOjE2NDAyMzY0NjQsInVzZXJuYW1lIjoiYWRtaW4ifQ.M8qTMKfMQjKjQ1uAu1M-ty8HRRmWJgq7ED1Kbhu4p4Q',
 				topic: {},
 				rewardList: [],
 				queryParams: {
 					pageNum: 1,
-					pageSize: 5
+					pageSize: 10
 				},
 				isDisable: false,
 				finished: false,
@@ -350,8 +357,7 @@
 				defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
 				actStatus: 0, //0活动状态 1开始
 				marqueeList: [],
-				token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kb20iOiIxNjc1OCIsImNsaWVudCI6IjAiLCJleHAiOjE2NDAyMTM3MDIsInVzZXJuYW1lIjoiYWRtaW4ifQ.3iGCT3FN0WByQHYebuiB4vSAnuuuU16znr8h0H-6jZE',
-
+			
 			},
 			created() {
 				this.getAwardPage(); //获取奖励列表
@@ -377,7 +383,7 @@
 					if (isAndroid) {
 						window.native.share(title, content, gotoUrl, shareImg)
 					} else if (isIOS) {
-
+						window.webkit.messageHandlers.share.postMessage(type);
 					}
 				},
 				standarImg(id) {
@@ -390,13 +396,13 @@
 						forbidClick: true,
 						loadingType: 'spinner',
 					});
-					getActDetail(this.token).then(res => {
-						 this.$toast.clear();
+					getActDetail().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 +413,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 +427,15 @@
 								this.queryParams.pageNum -= 1
 							}
 						}
-						
+
 					})
-		
+
 				},
 				//滚动加载时触发,list组件定义的方法
 				onLoad() {
 					let times = setTimeout(() => {
 						this.queryParams.pageNum += 1 //每请求一次,页面数+1
-					    this.getAwardPage();
+						this.getAwardPage();
 						clearTimeout(times)
 					}, 500)
 				},
@@ -441,13 +448,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() {
 
 				},

+ 97 - 22
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,52 @@
             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">
@@ -207,7 +226,7 @@
                 </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>
@@ -223,21 +242,42 @@
         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:[],
 
             },
             created() {
                 // window.location.href = 'investigate.html'
             },
             mounted() {
-
-
-                // this.getList();
+                this.getActDetail();
+             
+                this.getMarquee(); //跑马灯
+                
+               
 
             },
             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)
@@ -257,6 +297,9 @@
 
                     }
                 },
+                standarImg(id) {
+					return `${fileCenterApi}/file-center/fileOperate/getImage?id=${id}`;
+				},
                 getList() {
                     this.$toast.loading({
                         duration: 0,
@@ -280,8 +323,40 @@
 
                     //     }
                     // })
-                }
+                },
+                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',
+					});
+                    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)
 
+                    })
+                }
 
             }
         })