hmp преди 4 години
родител
ревизия
061c6efaa9
променени са 7 файла, в които са добавени 77 реда и са изтрити 36 реда
  1. 1 1
      components/alert/pointAuth.vue
  2. 4 5
      components/alert/votePopup.vue
  3. 1 0
      main.js
  4. 54 27
      pages/activity/activityDetail.vue
  5. 1 0
      pages/auth/auth.vue
  6. 15 2
      pages/auth/result.vue
  7. 1 1
      pages/webview/webview.vue

+ 1 - 1
components/alert/pointAuth.vue

@@ -3,7 +3,7 @@
 		<u-popup :custom-style="popupStyle" class="auth-point" v-model="show" mode="center" width="80%" border-radius="18" >
 			<image class="auth-bg" mode="aspectFill" src="../../static/poster/bg_shouyetc.png">
 				<view class="auth-msg">
-					<view v-for="item in vuex_active_setting.helpExplainList" >
+					<view v-for="(item,index) in vuex_active_setting.helpExplainList" :key="index">
 						{{item.helpExplain}}
 					</view>
 				</view>

+ 4 - 5
components/alert/votePopup.vue

@@ -8,7 +8,7 @@
 					人助力和{{vuex_active_setting.voteAndPointRate*gitfs[selected].activeVote}}个普法积分(可用于积分商城兑换商品),快为喜爱的作品加油助力吧
 				</view>
 				<scroll-view style="white-space: nowrap;" :scroll-x="true">
-					<view v-for="(item,index) in gitfs" class="gift-item">
+					<view v-for="(item,index) in gitfs" :key="index" class="gift-item">
 						<view @click.stop="selected = index;count = index" class="padding-20" :class="{'icon-box': true,'selected': index ==  selected}" >
 							<image mode="aspectFit" class="gift-img" :src="item.imgUrl"></image>
 							<view class="gift-name">{{item.name}}</view>
@@ -18,7 +18,7 @@
 				</scroll-view>
 				
 				<view class="handle-bar">
-					<view class="text-center padding-bottom-20" style="color: #0A9FEF;">您目前的移动积分</view>
+					<view class="text-center padding-bottom-20" style="color: #0A9FEF;font-size: 28rpx;">您目前的移动积分</view>
 					<view class="button-bar">
 						<view class="button-r">
 							<u-count-to v-if="show" color="#E72226" start-val="0" :end-val="gitfs[selected].point" :duration="500"></u-count-to>
@@ -46,11 +46,10 @@
 				gitfs: [],
 			};
 		},
-		
 		methods: {
 			async showVote(){
 				let params = {
-					mobile: '13126058204'
+					mobile: '15016450036'
 				}
 				const queryRes = (await this.$api.CMCC.queryCmccPoint(this.$u.queryParams(params)));
 				if(queryRes.data.data.resultCode == '0001' ){
@@ -61,7 +60,7 @@
 				this.gitfs = res.data.data.records;
 				this.show = true;
 			},
-			hideVote(){
+			hideVote(){			
 				this.show = false;
 			}
 		}

+ 1 - 0
main.js

@@ -25,6 +25,7 @@ Vue.component('loading',loading)
 
 import pointAuth from '@/components/alert/pointAuth.vue'
 Vue.component('pointAuth',pointAuth)
+
 // util begin
 //缓存
 import simpleCache from "@/utils/cache.js"

+ 54 - 27
pages/activity/activityDetail.vue

@@ -1,37 +1,40 @@
 <template>
 	<view>
-		<video class="works-video" :src="activity.videoUrl"></video>
-		<view style="padding: 20rpx 30rpx 50rpx 30rpx;background: white;">
-			<view class="title" style="border-bottom: 1rpx solid #EEEEEE ;">
-				<span class="bg-red work-no"> {{activity.productNo}}号</span> 
-				<span class="work-title">{{activity.title}}</span>
-				<view class="work-info-box">
-					<image class="remen-icon" src="../../static/icon/remen.png"></image>
-					<span class="vote-count">{{activity.voteCount}}</span>
-					<span class="work-rank">排行榜第{{activity.rank}}名</span>
+		<view class="" v-show="!loading">
+			<video class="works-video" :src="activity.videoUrl"></video>
+			<view style="padding: 20rpx 30rpx 50rpx 30rpx;background: white;">
+				<view class="title" style="border-bottom: 1rpx solid #EEEEEE ;">
+					<span class="bg-red work-no"> {{activity.productNo}}号</span> 
+					<span class="work-title">{{activity.title}}</span>
+					<view class="work-info-box">
+						<image class="remen-icon" src="../../static/icon/remen.png"></image>
+						<span class="vote-count">{{activity.voteCount}}</span>
+						<span class="work-rank">排行榜第{{activity.rank}}名</span>
+					</view>
+				</view>
+				<view style="font-size: 24rpx;color: #888888;padding: 30rpx 10rpx 20rpx 10rpx;">
+					<u-parse :html="content"></u-parse>
 				</view>
 			</view>
-			<view style="font-size: 24rpx;color: #888888;padding: 30rpx 10rpx 20rpx 10rpx;">
-				<u-parse :html="content"></u-parse>
-			</view>
-		</view>
-		
-		<view class="bg-white padding-30 margin-top-30 flex">
-			<view class="basis-xs">
-				<image style="width: 84rpx;height: 84rpx;" src="../../static/icon/ic_zhuanfa.png"></image>
+			
+			<view class="bg-white padding-30 margin-top-30 flex">
+				<view class="basis-xs">
+					<image style="width: 84rpx;height: 84rpx;" src="../../static/icon/ic_zhuanfa.png"></image>
+				</view>
+				<view class="basis-lg flex flex-direction">
+					<view style="font-size: 28rpx;color: #353535;">转发邀请投票</view>
+					<view style="font-size: 22rpx;color: #AEACAF;padding-top: 10rpx;">成功邀请一位好友投票,获得{{vuex_active_setting.voteAndHeatRate}}热力值</view>
+				</view>
+				<view class="flex justify-center align-center" style="color: #666666;flex-basis: 20%;">去邀请 ></view>
 			</view>
-			<view class="basis-lg flex flex-direction">
-				<view style="font-size: 28rpx;color: #353535;">转发邀请投票</view>
-				<view style="font-size: 22rpx;color: #AEACAF;padding-top: 10rpx;">成功邀请一位好友投票,获得{{vuex_active_setting.voteAndHeatRate}}热力值</view>
+			
+			<view class="footer-bar">
+				<u-button  @click="login" shape="circle" :custom-style="customStyle">给ta投票</u-button>
 			</view>
-			<view class="flex justify-center align-center" style="color: #666666;flex-basis: 20%;">去邀请 ></view>
-		</view>
-		
-		<view class="footer-bar">
-			<u-button  @click="login" shape="circle" :custom-style="customStyle">给ta投票</u-button>
 		</view>
-	
 		<login ref="login" @signIn="signIn" @phoneSuccess="showVote"></login>
+		<toast ref="toast" ></toast>
+		<loading ref="loading" type="3" theme="2"/>
 		<vote-popup ref="votePopup"></vote-popup>
 	</view>
 </template>
@@ -41,11 +44,15 @@
 	export default {
 		components:{ votePopup },
 		onLoad(props) {
+			this.$refs.loading.showLoading()
 			const { id } = props;
 			this.$api.activity.getWorksDetail(id).then(res=> {
 				this.activity = res.data.data;
-				console.log(this.activity);
+				this.$refs.loading.hide()
+				this.loading=false
 			})
+			//处理授权结果
+			this.handelAuthResult(props)
 		},
 		computed:{
 			content(){
@@ -54,6 +61,9 @@
 		},
 		data() {
 			return {
+				loading:false,
+				authResult:{},
+				
 				activity: {},
 				customStyle: {
 					color: 'white',
@@ -65,6 +75,23 @@
 			}
 		},
 		methods: {
+			handelAuthResult(options){
+				if (options.result==undefined) {
+					return
+				}
+				this.authResult=JSON.parse(options.result)
+				if (this.authResult.resultCode == '0000') {
+					//授权成功,直接弹出礼物框
+					this.$refs.toast.info('积分授权成功')
+					this.showVote()
+					return
+				}
+				if (this.authResult.resultCode=='9999') {
+					//授权失败
+					this.$refs.toast.error(this.authResult.message)
+					return
+				}
+			},
 			async showVote(){
 				this.$refs.votePopup.showVote();
 			},

+ 1 - 0
pages/auth/auth.vue

@@ -14,6 +14,7 @@
 		},
 		onLoad(options) {
 			this.src = decodeURIComponent(options.url);
+			console.log(this.src,"4555555555555");
 		},
 		methods: {
 			

+ 15 - 2
pages/auth/result.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<text>授权结果页</text>
+		<loading ref="loading" type="3"/>
 	</view>
 </template>
 
@@ -12,7 +12,20 @@
 			}
 		},
 		onLoad(options) {
-			console.log(options);
+			let _this=this
+			_this.$refs.loading.showLoading()
+			var pages = getCurrentPages();
+			var page = pages[pages.length - 3];
+			let url='/'+page.route
+			let params=page.options
+			params.result=options.result
+			let path=url + this.$u.queryParams(params)
+			uni.reLaunch({
+				url:path,
+				success() {
+					_this.$refs.loading.hide()
+				}
+			})
 		},
 		methods: {
 			

+ 1 - 1
pages/webview/webview.vue

@@ -8,7 +8,7 @@
 	export default {
 		data() {
 			return {
-				url: ''
+				url: 'https://test-m-stg.ppppoints.com/event/2019/blankPage/index.html?interCode=CYS0001&character=00&ipAddress=139.198.72.31&partnerId=S9990141&requestId=a6d7ee7f-b2fe-4959-93eb-b97cdedb4980_KB_001&reqTime=20211118185759&signType=MD5&type=mobile&version=1.0.0&mobile=15016450076&outTokenId=15016450076_out&outType=00&callbackUrl=https%3A%2F%2Fldt.guosen-fumao.cn%2Fwapp%2Fauth.html&channelSource=02000000&reserved1=&reserved2=&hmac=ed48086fd9a99d09c0edcfbd62f5aea5'
 			}
 		},
 		onLoad(options) {