hmp hace 4 años
padre
commit
bf1d5f4501

+ 10 - 7
assets/http/api.js

@@ -3,7 +3,7 @@ import {
 } from './service.js'
 
 
-const uploadFileUrl='/blade-resource/oss/endpoint/put-file'
+const uploadFileUrl = '/blade-resource/oss/endpoint/put-file'
 
 //文件上传
 const uploadFile = (p) => http.upload(uploadFileUrl, {
@@ -28,7 +28,7 @@ const platform = {
 	getPlatformParams: p => http.get('/app/platformsetting/getPlatformValueByList', {
 		params: p
 	}),
-	
+
 	getPlatformValue: p => http.get('/app/platformsetting/getPlatformValue', {
 		params: p
 	}),
@@ -69,10 +69,10 @@ const activity = {
 	getMyTotalHeat: p => http.get('/sing_active/activeproductrecord/getMyTotalHeat', {
 		params: p
 	}),
-	submitForm: p => http.post('/sing_active/activeproductrecord/submit',p),
-	mediaSave: p => http.post('/sing_active/activeproductrecord/save',{
+	submitForm: p => http.post('/sing_active/activeproductrecord/submit', p),
+	mediaSave: p => http.post('/sing_active/activeproductrecord/save', {
 		params: p
-	}), 
+	}),
 }
 
 //微信api
@@ -129,6 +129,9 @@ const CMCC = {
 	isCMCC: p => http.get('/user/login/isCMCC', {
 		params: p
 	}),
+	h5IsCMCC: p => http.get('/user/login/h5IsCMCC', {
+		params: p
+	}),
 	queryCmccPoint: p => http.post('app/cmcc/queryCmccPoint' + p),
 }
 
@@ -247,12 +250,12 @@ const census = {
 
 
 //活动列表
-const activerecord={
+const activerecord = {
 	list: p => http.get('sing_active/activerecord/list', {
 		params: p
 	}),
 	detail: p => http.get('sing_active/activerecord/detail', {
-	  params: p
+		params: p
 	}),
 }
 

+ 16 - 18
components/alert/pointAuth.vue

@@ -1,10 +1,8 @@
 <template>
 	<view>
-		<u-popup :custom-style="popupStyle"
-			close-icon-size="50"
-			:mask-close-able="false"
-			@close="close" class="auth-point" :closeable="true" close-icon-color="#fff"
-			close-icon="close-circle" v-model="show" mode="center" width="80%" height="680rpx" border-radius="16">
+		<u-popup :custom-style="popupStyle" close-icon-size="50" :mask-close-able="false" @close="close"
+			class="auth-point" :closeable="true" close-icon-color="#fff" close-icon="close-circle" v-model="show"
+			mode="center" width="80%" height="680rpx" border-radius="16">
 			<view class="">
 				<image class="auth-bg" mode="aspectFill" src="../../static/poster/bg_shouyetc.png">
 					<view class="auth-msg" style="display: flex;flex-direction: column;">
@@ -19,16 +17,17 @@
 							</view>
 						</view>
 					</view>
-					
+
 					<!-- #ifdef MP-WEIXIN -->
-					<u-button v-if="!isCopy" @click="toCopy" :custom-style="customStyle" shape="circle">点击复制授权链接</u-button>
-					<u-button  v-else :disabled="true" :custom-style="disableStyle"  shape="circle">已复制请用浏览器打开</u-button>
+					<u-button v-if="!isCopy" @click="toCopy" :custom-style="customStyle" shape="circle">点击复制授权链接
+					</u-button>
+					<u-button v-else :disabled="true" :custom-style="disableStyle" shape="circle">已复制请用浏览器打开</u-button>
 					<!-- #endif -->
-					
+
 					<!-- #ifdef H5 -->
-					<u-button  @click="toAuth" :custom-style="customStyle" shape="circle">去授权</u-button>
+					<u-button @click="toAuth" :custom-style="customStyle" shape="circle">去授权</u-button>
 					<!-- #endif -->
-					
+
 				</image>
 			</view>
 		</u-popup>
@@ -73,11 +72,11 @@
 			},
 			toCopy() {
 				uni.setClipboardData({
-				    data: this.authUrl,
+					data: this.authUrl,
 					showToast: false,
-				    success: ()=> {
-				        this.isCopy =true;
-				    }
+					success: () => {
+						this.isCopy = true;
+					}
 				});
 				// console.log(this.authUrl);
 				// this.authUrl = this.authUrl.replace(this.$config.transformDomains,this.$config.baseURL+'/phoneAuth');
@@ -88,9 +87,8 @@
 				// console.log(this.authUrl);
 				// this.$jump('/pages/webview/webview' + this.$u.queryParams(params));
 			},
-			toAuth(){
-				// console.log(decodeURIComponent(this.authUrl));
-				location.href=this.authUrl
+			toAuth() {
+				location.href = this.authUrl
 			}
 		}
 	}

+ 11 - 12
components/alert/smsAlert.vue

@@ -19,7 +19,7 @@
 				<u-button @click="$u.debounce(exchange, 500)" :custom-style="customStyle" shape="circle">确认</u-button>
 			</view>
 		</u-popup>
-		<toast ref="toast" ></toast>
+		<toast ref="toast"></toast>
 	</view>
 </template>
 
@@ -47,15 +47,15 @@
 			}
 		},
 		methods: {
-			getSeconds(){
-				let timer= setInterval(()=>{
-					this.seconds -- 
-					if (this.seconds==0) {
+			getSeconds() {
+				let timer = setInterval(() => {
+					this.seconds--
+					if (this.seconds == 0) {
 						timer
 						clearInterval(timer)
 					}
-				},1000)
-				
+				}, 1000)
+
 			},
 			async showSmsAndSend(params) {
 				this.smsParams = params
@@ -68,7 +68,6 @@
 					return;
 				}
 				this.phone = phone;
-				this.$refs.loading.hide()
 				this.show = true;
 				this.sending = false;
 				this.getSeconds()
@@ -78,7 +77,7 @@
 			},
 			async sendMessage() {
 				this.sending = true;
-				this.seconds=60
+				this.seconds = 60
 				this.getSeconds()
 				let res = await this.$api.order.sendCmccSms(this.smsParams)
 				if (!res.data.success) {
@@ -92,9 +91,9 @@
 					this.$u.toast('请输入验证码')
 					return
 				}
-				let params=this.$u.deepClone(this.smsParams)
-				params.smsCode=this.code
-				params.mobile=this.phone
+				let params = this.$u.deepClone(this.smsParams)
+				params.smsCode = this.code
+				params.mobile = this.phone
 				this.$emit("exchange", params)
 			},
 		}

+ 55 - 29
components/alert/votePopup.vue

@@ -3,7 +3,7 @@
 		<u-popup v-model="show" mode="bottom" width="100%" height="750" border-radius="15" :closeable="true">
 			<view class="padding-30">
 				<view class="padding-top-20 text-bold text-xl">投票助力</view>
-				<view 
+				<view
 					style="color: #888888;font-size: 22rpx;font-family: PingFang-SC-Medium;line-height: 36rpx;padding: 20rpx 0;">
 					{{voteContent()}}
 				</view>
@@ -12,16 +12,18 @@
 						<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>
+							<view class="gift-name text-cut-1">{{item.name}}</view>
 						</view>
 						<view style="color: #999999;font-size: 20rpx;text-align: center;padding-top: 10rpx;">
-							{{item.activeVote==0? '剩余免费次数':'剩余次数'}} {{item.remainCount}}</view>
+							{{item.activeVote==0? '剩余免费次数':'剩余次数'}} {{item.remainCount}}
+						</view>
 					</view>
 				</scroll-view>
 
 				<view class="handle-bar">
 					<view v-if="pointNum>=0" class="text-center padding-bottom-20" style="color: #0A9FEF;">您目前的移动积分:
-						{{pointNum}}</view>
+						{{pointNum}}
+					</view>
 					<view v-else class="text-center padding-bottom-20" style="color: #0A9FEF;">您目前的移动积分 <u-loading
 							style="margin: 10rpx;" mode="circle"></u-loading>
 					</view>
@@ -36,7 +38,8 @@
 				</view>
 			</view>
 		</u-popup>
-		<point-auth ref="pointAuth" ></point-auth>
+		<toast ref="toast"></toast>
+		<point-auth ref="pointAuth"></point-auth>
 		<!-- #ifdef MP-WEIXIN -->
 		<loading ref="loading" type="3" />
 		<!-- #endif -->
@@ -52,7 +55,7 @@
 		},
 		data() {
 			return {
-				productId:0,
+				productId: 0,
 				show: false,
 				selected: 0,
 				count: 0,
@@ -60,9 +63,9 @@
 				gitfs: [],
 			};
 		},
-		computed:{
-			voteContent(){
-				return data=>{
+		computed: {
+			voteContent() {
+				return data => {
 					if (this.gitfs[this.selected] && this.gitfs[this.selected].content) {
 						return this.gitfs[this.selected].content
 					}
@@ -71,7 +74,7 @@
 			}
 		},
 		methods: {
-			hideLoading(){
+			hideLoading() {
 				// #ifdef MP-WEIXIN
 				this.$refs.loading.hide()
 				// #endif
@@ -79,7 +82,7 @@
 				uni.hideLoading()
 				// #endif
 			},
-			showLoading(){
+			showLoading() {
 				// #ifdef MP-WEIXIN
 				this.$refs.loading.showLoading("礼物获取中")
 				// #endif
@@ -87,23 +90,25 @@
 				this.$dialog.showLoading('礼物获取中')
 				// #endif
 			},
-		   async pointAuthClose(){
-			   this.hideLoading()
+			async pointAuthClose() {
+				this.hideLoading()
 				await this.fetchGiftsData()
-				this.show=true
+				this.show = true
 				console.log(this.gitfs[this.selected].point);
 			},
-			async showVote(mobile,productId,activeId) {
-				this.productId=productId
-				this.activeId=activeId
+			async showVote(mobile, productId, activeId) {
+				this.productId = productId
+				this.activeId = activeId
 				this.showLoading()
 				let params = {
 					mobile
 				}
-				let isCmcc=await this.checkIsCmcc()
+				let isCmcc = await this.checkIsCmcc()
 				if (isCmcc) {
 					const queryRes = (await this.$api.CMCC.queryCmccPoint(this.$u.queryParams(params)));
 					if (queryRes.data.data.resultCode == '0001') {
+						//去授权,保存作品id,方便跳转回来
+						this.$cache.put('productId', this.productId)
 						this.$refs.pointAuth.showAuth(queryRes.data.data.data);
 						this.hideLoading()
 						return;
@@ -115,30 +120,51 @@
 				this.hideLoading()
 				this.show = true;
 			},
-			async fetchGiftsData(){
+			async checkIsCmcc() {
+				if (this.$isEmpty(this.vuex_phone)) {
+					return
+				}
+				let params = {
+					phone: this.vuex_phone
+				}
+				// #ifdef MP-WEIXIN
+				let res = await this.$api.CMCC.isCMCC(params)
+				// #endif
+
+				// #ifdef H5
+				let res = await this.$api.CMCC.h5IsCMCC(params)
+				// #endif
+
+				console.log(res, "res....");
+				return res.data.data
+			},
+			async fetchGiftsData() {
 				let data = {
-					activeId:this.activeId,
-					productId:this.productId,
+					activeId: this.activeId,
+					productId: this.productId,
 					userId: this.vuex_userId,
 				}
 				const res = await this.$api.activity.getGiftList(data);
 				this.gitfs = res.data.data;
-				console.log(this.gitfs,"/**//**/");
 			},
 			hideVote() {
 				this.show = false;
 			},
 			toVote() {
-				let item=this.gitfs[this.selected]
-				
-				if (this.pointNum==0 && item.point !=0) {
+				let item = this.gitfs[this.selected]
+
+				if (this.pointNum == 0 && item.point != 0) {
 					this.$u.toast('您无可用移动积分')
 					return
 				}
-				// if (item.remainCount == 0) {
-				// 	this.$u.toast('今天已无该道具兑换次数')
-				// 	return
-				// }
+				if (item.remainCount == 0) {
+					uni.showToast({
+						duration: 2300,
+						title: "您今日的助力票数已用完,每天0点后恢复。请继续助力您喜爱的作品!",
+						icon: "none"
+					})
+					return
+				}
 				this.$emit('toVote', this.gitfs[this.selected])
 			}
 		}

+ 3 - 0
components/login.vue

@@ -65,6 +65,9 @@
 								<u-input v-model="form.code" :clearable="false" />
 							</u-form-item>
 						</u-form>
+						<view class="text-sm text-gray margin-top-10 text-left">
+							<text style="color: #EF9944;">* 未注册过的手机号,点击登录时我们会给您创建一个新的账号</text>
+						</view>
 					</view>
 					<view class="btn-content setBtnCss "
 						style="background-color: #FFFFFF;border-radius: 20rpx;border-top: 1rpx solid #f4f4f4;">

+ 4 - 2
manifest.json

@@ -82,7 +82,8 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/h5/"
+            "base" : "/h5/",
+            "mode" : "hash"
         },
         "sdkConfigs" : {
             "maps" : {
@@ -90,6 +91,7 @@
                     "key" : "WAGBZ-EFIKU-2W2VF-4UX5F-ATB3F-HKBFU"
                 }
             }
-        }
+        },
+        "template" : ""
     }
 }

+ 5 - 3
pages.json

@@ -105,7 +105,8 @@
 			"path": "pages/auth/result",
 			"style": {
 				"navigationBarTitleText": "授权结果",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": false,
+				"navigationStyle":"custom"
 			}
 
 		}, {
@@ -142,7 +143,8 @@
 			"path": "pages/webview/auth_result",
 			"style": {
 				"navigationBarTitleText": "授权结果",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": false,
+				"navigationStyle":"custom"
 			}
 
 		}, {
@@ -242,7 +244,7 @@
 			}
 
 		}
-	],
+    ],
 	"tabBar": {
 		"color": "#555555",
 		"backgroundColor": "#FFFFFF",

+ 136 - 3
pages/activity/activityDetail.vue

@@ -41,7 +41,8 @@
 
 			<view class="footer-bar" style="z-index: 1;">
 				<u-button @click="goVote" shape="circle" :custom-style="btnText=='给ta投票'?customStyle:disabledStyle">
-					{{btnText}}</u-button>
+					{{btnText}}
+				</u-button>
 			</view>
 		</view>
 		<login ref="login" @signIn="signIn" @phoneSuccess="showVote"></login>
@@ -91,8 +92,16 @@
 			await this.fetchData()
 			//处理授权结果
 			this.handelAuthResult(props)
+
+			// #ifdef MP-WEIXIN
 			//处理创建订单结果
 			this.handelOrderResult(props)
+			// #endif
+
+			// #ifdef H5
+			this.h5CreateOrder()
+			// #endif
+
 			//处理海报参数
 			this.handelShareParams()
 			//隐藏loading
@@ -122,6 +131,8 @@
 		},
 		data() {
 			return {
+				count: 0,
+
 				//是否自定义返回,防止授权时返回到webview页面
 				isCustomBack: true,
 				defaultAvatar: 'https://vote.guosen-fumao.cn/obsfile/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
@@ -250,11 +261,13 @@
 					this.showVote()
 					return
 				}
+				// #ifdef MP-WEIXIN
 				if (this.authResult.resultCode == '9999') {
 					//授权失败
 					this.$refs.toast.error(this.authResult.message)
 					return
 				}
+				// #endif
 			},
 			handelOrderResult(options) {
 				if (options.orderPass && this.$cache.get('orderResult')) {
@@ -289,15 +302,16 @@
 					this.createOrder()
 					return
 				}
+				// #ifdef MP-WEIXIN
 				let params = {
 					url: 'https://vote.guosen-fumao.cn/order.html',
 					goodsId: this.selectGoods.id
 				}
 				this.$jump('/pages/webview/createOrder' + this.$u.queryParams(params))
+				// #endif
 			},
 			//移动积分创建订单
 			async createOrder() {
-				console.log("123456");
 				if (this.$isEmpty(this.orderResult.fingerprint) ||
 					this.$isEmpty(this.orderResult.sessionId) ||
 					this.$isEmpty(this.orderResult.goodsId)) {
@@ -314,6 +328,7 @@
 				}
 				let res = await this.$api.order.create(params)
 				if (res.data.success) {
+					console.log("orderResult", this.orderResult);
 					this.orderResult.outOrderId = res.data.data
 					this.orderResult.mobile = this.vuex_phone
 					this.$refs.smsAlert.showSmsAndSend(this.orderResult)
@@ -409,7 +424,125 @@
 				// #ifndef MP-WEIXIN
 				this.showPoster()
 				// #endif
-			}
+			},
+			// h5 创建订单 begin
+			h5CreateOrder() {
+				if (this.$cache.get('orderResult')) {
+					this.orderResult = this.$cache.get('orderResult')
+					return
+				}
+				//初始化js脚本
+				this.initScript()
+				//获取Fmopt
+				this.fetchFmopt()
+				//获取sessionId
+				this.loadScriptFunc("", this.fetchSessionId())
+				//打印数据
+				this.cacheOrderData()
+			},
+			cacheOrderData() {
+				let _this = this
+				setTimeout(() => {
+					_this.$nextTick(function() {
+						try {
+							_this.count++
+							console.log("sessionId:" + window.sessionId);
+							console.log("fingerprint:" + _fmOpt.getinfo());
+							console.log("获取成功啦");
+							_this.pushInCache(_fmOpt.getinfo(), window.sessionId)
+						} catch (e) {
+							console.log(_this.count);
+							if (_this.count < 10) {
+								_this.cacheOrderData()
+							}
+						}
+					})
+				}, 20)
+			},
+			pushInCache(fingerprint, sessionId) {
+				this.orderResult = {
+					fingerprint: encodeURIComponent(fingerprint),
+					sessionId,
+					goodsId: this.selectGoods.id
+				}
+				this.$cache.put('orderResult', this.orderResult)
+			},
+			initScript() {
+				let monitorURL = "https://static.tongdun.net/monitor/monitor.js"
+				this.loadScript(monitorURL)
+				let tfdURL = "https://j.changyoyo.com/static/js/common/tfd.js"
+				this.loadScript(tfdURL)
+				let jqueryURL = "https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"
+				this.loadScript(jqueryURL)
+			},
+
+			fetchFmopt() {
+				window._fmOpt = {
+					partner: 'changyou',
+					appName: 'changyou_web',
+					token: 'changyou' + "-" + new Date().getTime() + "-" +
+						Math.random().toString(16).substr(2),
+					fmb: true,
+					success: function(data) {
+						console.log('blackbox:	', data)
+					},
+					fpHost: "https://fp.tongdun.net"
+				};
+				var cimg = new Image(1, 1);
+				cimg.onload = function() {
+					_fmOpt.imgLoaded = true;
+				};
+				cimg.src =
+					"https://fp.tongdun.net/fp/clear.png?partnerCode=changyou&appName=changyou_web&tokenId=" +
+					_fmOpt.token;
+				var fm = document.createElement('script');
+				fm.type = 'text/javascript';
+				fm.async = true;
+				fm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
+					'static.tongdun.net/v3/fm.js?ver=0.1&t=' + (new Date().getTime() / 3600000).toFixed(0);
+				var s = document.getElementsByTagName('script')[0];
+				s.parentNode.insertBefore(fm,
+					s);
+			},
+			loadScript(src) {
+				var script = document.createElement('script');
+				script.src = src;
+				document.body.appendChild(script);
+			},
+			loadScriptFunc(url, callback) {
+				callback = typeof callback === 'function' ? callback : function() {};
+				var head = document.getElementsByTagName('head')[0];
+				var script = document.createElement('script');
+				script.type = 'text/javascript';
+				script.src = url;
+				script.onreadystatechange = function() {
+					if (this.readyState == "loaded" || this.readyState == "complete") {
+						callback();
+					}
+				}
+				script.onload = callback;
+				head.appendChild(script);
+			},
+			fetchSessionId() {
+				var url, ts, sessionId, appId, appkey;
+				if (document.domain === 'm.changyoyo.com') {
+					url = "tfd.changyoyo.com";
+				} else {
+					url = "101.132.237.10";
+				}
+				appId = "5308e20b";
+				appkey = "3daf27ea2fe840ada6af8e1ec0d7b760";
+				ts = new Date().getTime();
+				sessionId = "changyo-pc-" + ts + "-" + Math.random().toString(16).substr(2);
+				window.sessionId = sessionId;
+				[document.getElementsByTagName('script')[0].parentNode.appendChild(document.createElement('script')).src =
+					"http://" +
+					url + "/did/js/dp.js?appId=" + appId + "&appkey=" + appkey + "&sessionId=" + sessionId +
+					"&ts=" +
+					ts
+				][0];
+			},
+			//h5 创建订单end
 		},
 	}
 </script>

+ 1 - 1
pages/apply/apply.vue

@@ -19,7 +19,7 @@
 			<view v-if="activeType == 'VIDEO_TEXT'" style="margin-bottom: 64rpx;">
 				<text style="color: #010101; font-size: 28rpx; font-weight: bold;">作品封面</text>
 				<view style="padding: 5rpx 0 20rpx; border-bottom: 1rpx solid #E3E3E3;">
-					<upload-img ref="uploadImg" :count="1" :col="4" @click="uploadCover"></upload-img>
+					<upload-img ref="uploadImg" :count="1" col="4" @click="uploadCover"></upload-img>
 				</view>
 			</view>
 

+ 89 - 16
pages/auth/result.vue

@@ -1,6 +1,18 @@
 <template>
 	<view>
-		
+		<view class="content">
+			<view style="padding-top: 150rpx;">
+				<text class="cuIcon-roundcheckfill" :class="success?'text-success':'text-error'"
+					style="font-size: 150rpx;"></text>
+			</view>
+			<view class="tips">
+				<text class="title" v-text="success?'授权成功':'授权失败'"></text>
+				<text class="desc" v-text="success?'点击确认继续助力':response.message"></text>
+			</view>
+			<view class="cu-btn btn radius line-gray" @click.stop="confirm">
+				确认
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -8,30 +20,91 @@
 	export default {
 		data() {
 			return {
-				
+				response: {},
+				success: false
 			}
 		},
 		onLoad(options) {
-			let _this=this
-			var pages = getCurrentPages();
-			var page = pages[pages.length - 3];
-			let url='/'+page.route
-			let params=page.options
-			params.authResult=options.result
-			let path=url + this.$u.queryParams(params)
-			uni.reLaunch({
-				url:path,
-				success() {
-					
-				}
-			})
+			this.response = JSON.parse(decodeURIComponent(options.response))
+			console.log(this.response);
+			if (this.response.resultCode == '0000') {
+				this.success = true
+			} else {
+				this.success = false
+			}
 		},
 		methods: {
-			
+			confirm() {
+				let productId=this.$cache.get('productId')
+				if (!productId) {
+					uni.switchTab({
+						url:"../index/home"
+					})
+					return
+				}
+				let params={
+					id:productId,
+					authResult:JSON.stringify(this.response)
+				}
+				uni.reLaunch({
+					url:"/pages/activity/activityDetail"+this.$u.queryParams(params),
+					success: () => {
+						this.$cache.remove('productId')
+					}
+				})
+			},
 		}
 	}
 </script>
 
 <style>
+	page {
+		background-color: #FFFFFF;
+
+	}
+</style>
+<style lang="scss" scoped>
+	.text-success {
+		color: #19be6b;
+	}
+
+	.text-error {
+		color: #de5454;
+	}
+
+	.content {
+		display: flex;
+		flex-direction: column;
+		display: flex;
+		justify-content: center;
+		align-items: center;
 
+		image {
+			width: 150rpx;
+			height: 150rpx;
+		}
+
+		.tips {
+			margin-top: 20rpx;
+			display: flex;
+			flex-direction: column;
+			text-align: center;
+
+			.title {
+				font-size: 36rpx;
+			}
+
+			.desc {
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				color: #969696;
+			}
+		}
+
+		.btn {
+			margin-top: 40rpx;
+			width: 50%;
+			padding: 42rpx;
+		}
+	}
 </style>

+ 1 - 1
pages/endorsement/endorsement.vue

@@ -33,7 +33,7 @@
 				try {
 					let params={
 						title:'我要代言',
-						activeID:this.vuex_active_setting.defaultActiveId,
+						activeId:this.vuex_active_setting.defaultActiveId,
 						current:mescroll.num,
 						size:mescroll.size,
 					}

+ 1 - 1
pages/introduce/notice.vue

@@ -33,7 +33,7 @@
 				try {
 					let params={
 						title:'投票须知',
-						activeID:this.vuex_active_setting.defaultActiveId,
+						activeId:this.vuex_active_setting.defaultActiveId,
 						current:mescroll.num,
 						size:mescroll.size,
 					}

+ 30 - 20
pages/mine/info/info.vue

@@ -1,19 +1,19 @@
 <template>
 	<view :style="vuex_skin">
 		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar title-color="#000000"  :is-back="true" title="我的资料"></u-navbar>
+		<u-navbar title-color="#000000" :is-back="true" title="我的资料"></u-navbar>
 		<!-- #endif -->
 		<view class="bg-white margin-top-20">
 			<view class="flex padding justify-between align-center" @click="upload">
 				<view class="title">头像</view>
-				<u-avatar  :src="userData.avatar" size="80"></u-avatar>
+				<u-avatar :src="userData.avatar" size="80"></u-avatar>
 			</view>
 			<u-line color="#f1f1f1"></u-line>
 			<view class="flex padding justify-between align-center">
 				<view class="title">昵称<text class="text-red">*</text></view>
 				<view class="center">
-					<u-input :disabled="!isEdit" v-model="userData.nickName" :placeholder-style="placeholderStyle" :clearable="false"
-						inputAlign="right" placeholder="请输入昵称">
+					<u-input :disabled="!isEdit" v-model="userData.nickName" :placeholder-style="placeholderStyle"
+						:clearable="false" inputAlign="right" placeholder="请输入昵称">
 					</u-input>
 					<text class="cuIcon-right margin-left-10" style="color: #CCCCCC;"></text>
 				</view>
@@ -35,9 +35,17 @@
 				<view class="center">
 					<u-input disabled v-model="userData.phone" :placeholder-style="placeholderStyle" :clearable="false"
 						inputAlign="right" placeholder="请填写手机号码"></u-input>
-					<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="cu-btn radius u-reset-button round bg-base sm" style="padding: 8rpx 16rpx;font-size: 20rpx;margin-left: 30rpx;">
+					<!-- #ifdef MP-WEIXIN -->
+					<button open-type="getPhoneNumber" @getphonenumber="getphonenumber"
+						class="cu-btn radius u-reset-button round bg-base sm"
+						style="padding: 8rpx 16rpx;font-size: 20rpx;margin-left: 30rpx;">
 						获取手机号
 					</button>
+					<!-- #endif -->
+					
+					<!-- #ifdef H5 -->
+					<text class="cuIcon-right margin-left-10" style="color: #CCCCCC;"></text>
+					<!-- #endif -->
 				</view>
 			</view>
 		</view>
@@ -75,7 +83,9 @@
 			}
 		},
 		onLoad(options) {
+			// #ifdef MP-WEIXIN
 			this.handelSessionKey()
+			// #endif
 			this.isEdit = options.edit || false
 			if (this.isEdit) {
 				uni.setNavigationBarTitle({
@@ -85,9 +95,9 @@
 			this.getUserInfo();
 		},
 		methods: {
-			showSex(){
+			showSex() {
 				if (this.isEdit) {
-					this.sexShow=true
+					this.sexShow = true
 					return
 				}
 			},
@@ -120,8 +130,8 @@
 			},
 			logout() {
 				this.$cache.clear()
-				this.$u.vuex('vuex_userId',null)
-				this.$u.vuex('vuex_phone',null)
+				this.$u.vuex('vuex_userId', null)
+				this.$u.vuex('vuex_phone', null)
 				uni.reLaunch({
 					url: "../mine"
 				})
@@ -151,21 +161,21 @@
 			/**
 			 * 获取getSessionKey
 			 */
-			async handelSessionKey(){
-				let sessionKey= await this.getSessionKey()
-				let userInfo=this.$cache.get('userInfo')
-				userInfo.sessionKey=sessionKey
-				this.$cache.put('userInfo',userInfo)
-				this.sessionKey=sessionKey
+			async handelSessionKey() {
+				let sessionKey = await this.getSessionKey()
+				let userInfo = this.$cache.get('userInfo')
+				userInfo.sessionKey = sessionKey
+				this.$cache.put('userInfo', userInfo)
+				this.sessionKey = sessionKey
 			},
-			async getSessionKey(){
+			async getSessionKey() {
 				let respWx = await this.$mpi.wxLogin()
 				let respLogin = (await this.$api.wxApp.getOpenId({
 					code: respWx.code
 				})).data
 				return respLogin.data.session_key
 			},
-			
+
 			async getphonenumber(e) {
 				if (e.detail.errMsg != 'getPhoneNumber:ok') {
 					this.$u.toast("获取手机号失败")
@@ -176,7 +186,7 @@
 					return
 				}
 				let params = {
-					sessionKey:this.sessionKey,
+					sessionKey: this.sessionKey,
 					encryptedData: e.detail.encryptedData,
 					iv: e.detail.iv
 				}
@@ -184,8 +194,8 @@
 					if (res.data.success) {
 						let obj = JSON.parse(res.data.data)
 						let phone = obj.phoneNumber
-						this.userData.phone=phone
-					}else{
+						this.userData.phone = phone
+					} else {
 						this.$u.toast("获取手机号失败")
 					}
 				})

+ 4 - 0
pages/mine/points/pointsDetail.vue

@@ -7,6 +7,7 @@
 		<!-- #endif -->
 		<view class="">
 			<view class="bg-img flex justify-center align-center"
+				:style="'margin-top:'+marginTop"
 				style="background-image: url('https://vote.guosen-fumao.cn/obsfile/6002585ea7d548508d5f6dcce4ed1116-mingxi.png');height: 340upx;z-index: 9999999999999;">
 				<view class="text-center" style="margin-top: 150upx;">
 					<view style="font-size: 26upx;color: #FFFFFF;font-weight: 400;">可用积分</view>
@@ -44,6 +45,7 @@
 		},
 		data() {
 			return {
+				marginTop:"0",
 				userPoint: 0,
 				title: '积分明细',
 				backShow: true,
@@ -86,10 +88,12 @@
 			this.fetchUserPufaPoint()
 
 			// #ifdef MP-WEIXIN
+			this.marginTop='0'
 			this.mescroll.resetUpScroll();
 			// #endif
 
 			// #ifdef H5
+			this.marginTop='-80rpx'
 			//h5端要延时才能获取到mescroll对象
 			setTimeout(() => {
 				this.mescroll.resetUpScroll();

+ 14 - 5
pages/rank/rank.vue

@@ -1,10 +1,13 @@
 <template>
 	<view :style="vuex_skin">
 		<view class="">
+			<!-- #ifdef MP-WEIXIN -->
 			<u-navbar v-show="navbarShow" :custom-back="customBack" title-color="#fff" :border-bottom="false"
 				back-icon-color="#fff" title="排行榜" :background="{'backgroundColor': '#f03538'}"></u-navbar>
 			<back v-show="!navbarShow" :custom-back="customBack"></back>
-			<view class="bg-img flex-direction flex justify-center   "
+			<!-- #endif -->
+			<view class="bg-img flex-direction flex justify-center"
+				:style="'margin-top:'+marginTop"
 				style="background-image: url(https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/4872ea85f7e74a75a920135ce1384262-bg.png);height: 380rpx;">
 				<view class="title" style="padding: 80rpx 0 0 60rpx;">排行榜</view>
 			</view>
@@ -130,6 +133,8 @@
 		},
 		data() {
 			return {
+				marginTop:'0',
+				
 				downOption: {
 					auto: false
 				},
@@ -141,7 +146,9 @@
 				rankList: [],
 				//搜索关键字
 				keyword: '',
-				activeId: ''
+				activeId: '',
+				
+				
 			}
 		},
 		onPageScroll(res) {
@@ -154,14 +161,16 @@
 		onLoad(options) {
 			this.activeId = options.activeId
 			// #ifdef MP-WEIXIN
+			this.marginTop='0'
 			this.mescroll.resetUpScroll();
 			// #endif
-			
+
 			// #ifdef H5
+			this.marginTop='-80rpx'
 			//h5端要延时才能获取到mescroll对象
-			setTimeout(()=>{
+			setTimeout(() => {
 				this.mescroll.resetUpScroll();
-			},20)
+			}, 20)
 			// #endif
 		},
 		methods: {

+ 1 - 1
pages/rule/point.vue

@@ -33,7 +33,7 @@
 				try {
 					let params={
 						title:'积分规则',
-						activeID:this.vuex_active_setting.defaultActiveId,
+						activeId:this.vuex_active_setting.defaultActiveId,
 						current:mescroll.num,
 						size:mescroll.size,
 					}

+ 1 - 1
pages/rule/rule.vue

@@ -33,7 +33,7 @@
 				try {
 					let params={
 						title:'活动规则',
-						activeID:this.vuex_active_setting.defaultActiveId,
+						activeId:this.vuex_active_setting.defaultActiveId,
 						current:mescroll.num,
 						size:mescroll.size,
 					}

+ 116 - 26
pages/test/test.vue

@@ -1,28 +1,6 @@
 <template>
-	<view class="" :style="vuex_skin">
-		<u-popup v-model="phoneShow" mode="center" border-radius="14" width="70%" >
-			<view class="" style="padding: 30rpx 50rpx 0;">
-				<view class="center">
-					<text class="text-bold">授权手机号</text>
-				</view>
-
-				<view style="padding: 80rpx 0;">
-					<view class=" margin-bottom-20 text-sm text-center" style="line-height: 42rpx;">
-						<text style="color: #949494;">为了保证用户评选公平,大赛采用实名制投票,需要授权获取您的手机号</text>
-					</view>
-				</view>
-
-				<view class="flex justify-around">
-					<button @click="phoneShow=false" class="cu-btn  radius bg-gray " style="height: 60rpx;margin-bottom: 20rpx;font-size: 24rpx;">
-						暂不授权
-					</button>
-					<button class="cu-btn bg-base radius" style="height: 60rpx;margin-bottom: 20rpx;font-size: 24rpx;"
-						open-type="getPhoneNumber" @getphonenumber="getphonenumber">
-						确定授权
-					</button>
-				</view>
-			</view>
-		</u-popup>
+	<view class="">
+		<button @click="createOrder">创建订单 </button>
 	</view>
 </template>
 
@@ -31,12 +9,124 @@
 		name: '',
 		data() {
 			return {
-				phoneShow: true
+				count:0
 			};
 		},
-		onLoad() {
+		mounted() {
 
 		},
+		methods: {
+			createOrder() {
+				//初始化js脚本
+				this.initScript()
+				//获取Fmopt
+				this.fetchFmopt()
+				//获取sessionId
+				this.loadScriptFunc("", this.fetchSessionId())
+				//打印数据
+				this.cacheOrderData()
+			},
+			cacheOrderData() {
+				let _this = this
+				setTimeout(() => {
+					_this.$nextTick(function() {
+						try {
+							_this.count++
+							console.log("sessionId:" + window.sessionId);
+							console.log("fingerprint:" + _fmOpt.getinfo());
+							_this.cache(window.sessionId,_fmOpt.getinfo())
+						} catch (e) {
+							console.log(_this.count);
+							if (_this.count < 10) {
+								_this.cacheOrderData()
+							}
+						}
+					})
+				}, 20)
+			},
+			cache(sessionId,fingerprint){
+				let orderResult = {
+					fingerprint:encodeURIComponent(fingerprint),
+					sessionId,
+				}
+				this.$cache.put('orderResult',orderResult)
+			},
+			initScript() {
+				let monitorURL = "https://static.tongdun.net/monitor/monitor.js"
+				this.loadScript(monitorURL)
+				let tfdURL = "https://j.changyoyo.com/static/js/common/tfd.js"
+				this.loadScript(tfdURL)
+				let jqueryURL = "https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"
+				this.loadScript(jqueryURL)
+			},
+
+			fetchFmopt() {
+				window._fmOpt = {
+					partner: 'changyou',
+					appName: 'changyou_web',
+					token: 'changyou' + "-" + new Date().getTime() + "-" +
+						Math.random().toString(16).substr(2),
+					fmb: true,
+					success: function(data) {
+						console.log('blackbox:	', data)
+					},
+					fpHost: "https://fp.tongdun.net"
+				};
+				var cimg = new Image(1, 1);
+				cimg.onload = function() {
+					_fmOpt.imgLoaded = true;
+				};
+				cimg.src =
+					"https://fp.tongdun.net/fp/clear.png?partnerCode=changyou&appName=changyou_web&tokenId=" +
+					_fmOpt.token;
+				var fm = document.createElement('script');
+				fm.type = 'text/javascript';
+				fm.async = true;
+				fm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
+					'static.tongdun.net/v3/fm.js?ver=0.1&t=' + (new Date().getTime() / 3600000).toFixed(0);
+				var s = document.getElementsByTagName('script')[0];
+				s.parentNode.insertBefore(fm,
+					s);
+			},
+			loadScript(src) {
+				var script = document.createElement('script');
+				script.src = src;
+				document.body.appendChild(script);
+			},
+			loadScriptFunc(url, callback) {
+				callback = typeof callback === 'function' ? callback : function() {};
+				var head = document.getElementsByTagName('head')[0];
+				var script = document.createElement('script');
+				script.type = 'text/javascript';
+				script.src = url;
+				script.onreadystatechange = function() {
+					if (this.readyState == "loaded" || this.readyState == "complete") {
+						callback();
+					}
+				}
+				script.onload = callback;
+				head.appendChild(script);
+			},
+			fetchSessionId() {
+				var url, ts, sessionId, appId, appkey;
+				if (document.domain === 'm.changyoyo.com') {
+					url = "tfd.changyoyo.com";
+				} else {
+					url = "101.132.237.10";
+				}
+				appId = "5308e20b";
+				appkey = "3daf27ea2fe840ada6af8e1ec0d7b760";
+				ts = new Date().getTime();
+				sessionId = "changyo-pc-" + ts + "-" + Math.random().toString(16).substr(2);
+				window.sessionId = sessionId;
+				[document.getElementsByTagName('script')[0].parentNode.appendChild(document.createElement('script')).src =
+					"http://" +
+					url + "/did/js/dp.js?appId=" + appId + "&appkey=" + appkey + "&sessionId=" + sessionId +
+					"&ts=" +
+					ts
+				][0];
+			},
+		}
 	};
 </script>
 

+ 35 - 19
pages/webview/auth_result.vue

@@ -1,12 +1,13 @@
 <template>
-	<view >
-		<view class="content" >
+	<view>
+		<view class="content">
 			<view style="padding-top: 150rpx;">
-				<text class="cuIcon-roundcheckfill" :class="success?'text-success':'text-error'" style="font-size: 150rpx;"></text>
+				<text class="cuIcon-roundcheckfill" :class="success?'text-success':'text-error'"
+					style="font-size: 150rpx;"></text>
 			</view>
 			<view class="tips">
 				<text class="title" v-text="success?'授权成功':'授权失败'"></text>
-				<text class="desc" v-text="success?'请打开小程序继续助力':response.message"></text>
+				<text class="desc" v-text="success?'点击确认继续助力':response.message"></text>
 			</view>
 			<view class="cu-btn btn radius line-gray" @click.stop="confirm">
 				确认
@@ -14,28 +15,43 @@
 		</view>
 	</view>
 </template>
-
 <script>
 	export default {
 		data() {
 			return {
-				response:{},
-				success:false
+				response: {},
+				success: false
 			}
 		},
 		onLoad(options) {
 			this.response = JSON.parse(decodeURIComponent(options.response))
+			console.log(this.response);
 			if (this.response.resultCode == '0000') {
-				this.success=true
-			}else{
-				this.success=false
+				this.success = true
+			} else {
+				this.success = false
 			}
-			
 		},
 		methods: {
-			confirm(){
-				location.href = "weixin://dl/business/?t=EEIoZYi3ckf"
-			}
+			confirm() {
+				let productId = this.$cache.get('productId')
+				if (!productId) {
+					uni.switchTab({
+						url: "../index/home"
+					})
+					return
+				}
+				let params = {
+					id: productId,
+					authResult: JSON.stringify(this.response)
+				}
+				uni.reLaunch({
+					url: "/pages/activity/activityDetail" + this.$u.queryParams(params),
+					success: () => {
+						this.$cache.remove('productId')
+					}
+				})
+			},
 		}
 	}
 </script>
@@ -43,18 +59,18 @@
 <style>
 	page {
 		background-color: #FFFFFF;
-		
+
 	}
 </style>
 <style lang="scss" scoped>
-	.text-success{
+	.text-success {
 		color: #19be6b;
 	}
-	
-	.text-error{
+
+	.text-error {
 		color: #de5454;
 	}
-	
+
 	.content {
 		display: flex;
 		flex-direction: column;

+ 0 - 11
utils/mixin.js

@@ -74,17 +74,6 @@ let page = {
 				this.$refs.login.showPhoneModal()
 			}
 		},
-		async checkIsCmcc() {
-			if (this.$isEmpty(this.vuex_phone)) {
-				return
-			}
-			let params = {
-				phone: this.vuex_phone
-			}
-			let res = await this.$api.CMCC.isCMCC(params)
-			console.log(res, "res....");
-			return res.data.data
-		},
 		phoneSuccess() {
 			console.log('手机号获取成功>>>>>>>>');
 		},