lyqu 4 жил өмнө
parent
commit
ceb1f62815

+ 23 - 9
App.vue

@@ -1,19 +1,33 @@
 <script>
 	import {authUrl} from '@/common/conf/config.js';
 	export default {
-		onLaunch: function() {
-			console.log('App Launch')
-			// let userId = uni.getStorageSync("userId")
-			if (this.$isWxBrowser()) {
+		onLaunch: function(e) {
+			console.log('App Launch', e)
+			let userId = uni.getStorageSync("userId")
+			if (this.$isWxBrowser() && this.$u.test.isEmpty(e.query)) {
+				// uni.reLaunch({
+				// 	url: "/pages/index/guide"
+				// })
+				let path = 'pages/index/guide?login=1';
+				window.location.href = authUrl(path);
+			} else if (this.$isWxBrowser() && !this.$u.test.isEmpty(e.query.login)) {
 				uni.reLaunch({
-					url: "/pages/index/guide"
+					url: 'pages/index/guide'
 				})
-				// let path = 'pages/index/guide';
-				// window.location.href = authUrl(path);
-			} else {
+			} else if (this.$isWxBrowser() && !this.$u.test.isEmpty(e.query.userId)) {
 				uni.reLaunch({
-					url: "/pages/activityList/home/home?activityId=1407016573251153922"
+					url: 'pages/index/guide?userId=' + e.query.userId
 				})
+			} else {
+				if (!this.$u.test.isEmpty(e.query.userId)) {
+					uni.reLaunch({
+						url: "/pages/activityList/home/home?activityId=1407016573251153922&userId=" + e.query.userId
+					})
+				} else {
+					uni.reLaunch({
+						url: "/pages/activityList/home/home?activityId=1407016573251153922"
+					})
+				}
 			}
 		},
 		onShow: function() {

+ 2 - 0
common/http/http.api.js

@@ -42,6 +42,7 @@ let boostUrl = {
 	doHitUrl: '/cyzh-helpRecord/helprecord/doHit',
 	myBoostUrl : 'cyzh-helpRecord/helprecord/selectHelpRecordVoPage',
 	billRecordUrl: 'cyzh-billRecord/billrecord/submit',
+	billRecordDetailUrl: 'cyzh-billRecord/billrecord/detail',
 	doRewardUrl: 'cyzh-helpRecord/helprecord/doReward',
 	presentDetailUrl: 'cyzh-present/present/detail'
 }
@@ -137,6 +138,7 @@ const install = (Vue, vm) => {
 		billRecord:(params = {}) => vm.$u.post(boostUrl.billRecordUrl, params),
 		doReward:(params = {}) => vm.$u.post(boostUrl.doRewardUrl, params),
 		presentDetail:(params = {}) => vm.$u.get(boostUrl.presentDetailUrl, params),
+		billRecordDetail:(params = {}) => vm.$u.get(boostUrl.billRecordDetailUrl, params)
 	}
 	
 	let production = {

+ 53 - 53
common/utils/mixin.js

@@ -11,59 +11,59 @@ let page = {
 	
 	},
 	onLoad(options) {
-		if (!this.$u.test.isEmpty(options.activityId)) {
-			this.$u.api.activity.detail({
-				id: options.activityId
-			}).then(res => {
-				let userId = uni.getStorageSync("userId")
-				if (!this.$u.test.isEmpty(userId)) {
-					let link = window.location.href
-					if (link.indexOf("?") != -1) {
-						link = link + "&agenterId=" + userId
-					} else {
-						link = link + "?agenterId=" + userId
-					}
-					let obj = {
-						link,
-						title: res.shareTitle,
-						desc: res.shareDesc,
-						imgUrl: res.shareImg
-					}
-					console.log("**********************obj", obj);
-					this.$shareConfig(obj, this)
-				}
-				if (!this.$u.test.isEmpty(options.agenterId)) {
-					uni.setStorageSync("agenterId", options.agenterId)
-					let url = window.location.href
-					let len = url.indexOf("agenterId=") - 1
-					let tmp = url.substring(0, len)
-					window.location.href = tmp
-				}
-			})
-		} else {
-			let userId = uni.getStorageSync("userId")
-			if (!this.$u.test.isEmpty(userId)) {
-				let link = window.location.href
-				if (link.indexOf("?") != -1) {
-					link = link + "&agenterId=" + userId
-				} else {
-					link = link + "?agenterId=" + userId
-				}
-				let obj = {
-					link,
-					title: '',
-					desc: link,
-				}
-				this.$shareConfig(obj, this)
-			}
-			if (!this.$u.test.isEmpty(options.agenterId)) {
-				uni.setStorageSync("agenterId", options.agenterId)
-				let url = window.location.href
-				let len = url.indexOf("agenterId=") - 1
-				let tmp = url.substring(0, len)
-				window.location.href = tmp
-			}
-		}
+		// if (!this.$u.test.isEmpty(options.activityId)) {
+		// 	this.$u.api.activity.detail({
+		// 		id: options.activityId
+		// 	}).then(res => {
+		// 		let userId = uni.getStorageSync("userId")
+		// 		if (!this.$u.test.isEmpty(userId)) {
+		// 			let link = window.location.href
+		// 			if (link.indexOf("?") != -1) {
+		// 				link = link + "&agenterId=" + userId
+		// 			} else {
+		// 				link = link + "?agenterId=" + userId
+		// 			}
+		// 			let obj = {
+		// 				link,
+		// 				title: res.shareTitle,
+		// 				desc: res.shareDesc,
+		// 				imgUrl: res.shareImg
+		// 			}
+		// 			console.log("**********************obj", obj);
+		// 			this.$shareConfig(obj, this)
+		// 		}
+		// 		if (!this.$u.test.isEmpty(options.agenterId)) {
+		// 			uni.setStorageSync("agenterId", options.agenterId)
+		// 			let url = window.location.href
+		// 			let len = url.indexOf("agenterId=") - 1
+		// 			let tmp = url.substring(0, len)
+		// 			window.location.href = tmp
+		// 		}
+		// 	})
+		// } else {
+		// 	let userId = uni.getStorageSync("userId")
+		// 	if (!this.$u.test.isEmpty(userId)) {
+		// 		let link = window.location.href
+		// 		if (link.indexOf("?") != -1) {
+		// 			link = link + "&agenterId=" + userId
+		// 		} else {
+		// 			link = link + "?agenterId=" + userId
+		// 		}
+		// 		let obj = {
+		// 			link,
+		// 			title: '',
+		// 			desc: link,
+		// 		}
+		// 		this.$shareConfig(obj, this)
+		// 	}
+		// 	if (!this.$u.test.isEmpty(options.agenterId)) {
+		// 		uni.setStorageSync("agenterId", options.agenterId)
+		// 		let url = window.location.href
+		// 		let len = url.indexOf("agenterId=") - 1
+		// 		let tmp = url.substring(0, len)
+		// 		window.location.href = tmp
+		// 	}
+		// }
 	}
 }
 

+ 1 - 1
components/homeViews/mine-view.vue

@@ -5,7 +5,7 @@
 				<view class="padding-left">
 					<view class="text-black text-bold text-xl">
 						{{userData.nickName}}
-						<u-button @click="logout" size="mini" style="margin-left: 10rpx;">退出</u-button>
+						<!-- <u-button @click="logout" size="mini" style="margin-left: 10rpx;">退出</u-button> -->
 					</view>
 					<view class="flex align-center padding-top-sm">
 						<view>

+ 71 - 67
pages/activityList/activity/authorBoost.vue

@@ -124,6 +124,23 @@
 				</view>
 			</view>
 		</u-popup>
+		<u-popup v-model="errorShow" mode="center" width="500rpx" height="600rpx" border-radius="30">
+			<view class="bg-img text-center" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/e914f556be414767aca011a30961560a-dialogBgImg.png');height: 600rpx;">
+				<view style="height: 120upx;"></view>
+				<u-avatar :src="boostDetail.avatar" size="160"></u-avatar>
+				<view class="text-center margin-top text-lg text-bold">支付失败</view>
+				<view class="padding">
+					<u-button class="custom-style" shape="circle" @click="errorShow = false">确定</u-button>
+				</view>
+			</view>
+		</u-popup>
+		<u-popup v-model="payShow" mode="center" width="500rpx" height="320rpx" border-radius="30">
+			<view class="text-center text-lg padding">请确定支付是否已完成</view>
+			<u-line color="#c2c2c2"></u-line>
+			<view class="text-red text-center text-lg padding" @click="checkPayInterval">已完成支付</view>
+			<u-line color="#c2c2c2"></u-line>
+			<view class="text-gray text-center text-lg padding" @click="pay">支付遇到问题,重新支付</view>
+		</u-popup>
 		<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
 			<view class="cu-dialog">
 				<view style="height:150px;">
@@ -181,6 +198,9 @@
 				presentId:'',
 				successShow: false,
 				presentDetail: {},
+				errorShow: false,
+				payShow: false,
+				orderId: '',
 			}
 		},
 		onLoad(options) {
@@ -226,64 +246,45 @@
 			},
 			//礼物支付
 			async pay() {
+				this.payShow = false;
 				let _this = this;
 				
-				// if (this.$u.test.isEmpty(this.senderId)) {
-				// 	let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
-				// 	window.location.href = authUrl(path);
-				// } else {}
-				let orderId=new Date().getTime();
-				let orderInfo  = (await this.$u.api.yeePay.initOrder(
-					{
-					  "channel": "ALIPAY",
-					  "goodsName": this.boostDetail.presentList[this.current].name,
-					  "notifyUrl": "1",
-					  "orderAmount": this.count * this.currentPresentSum,
-					  "orderId": orderId,
-					  "payWay": "USER_SCAN",
-					  "scene": "OFFLINE",
-					  "userIp": "127.0.0.1"
-					}
-					// {
-					//   "appId": appId,
-					//   "channel": "WECHAT",
-					// 	"channelPromotionInfo": "",
-					// 	"channelSpecifiedInfo": "",
-					// 	"csUrl": "",
-					// 	"expiredTime": "",
-					// 	"fundProcessType": "",
-					// 	"goodsName": this.boostDetail.presentList[this.current].name,
-					// 	"memo": "",
-					// 	"notifyUrl": "https://music.nanyue6688.com/ldt/api/yeePay/notify",
-					// 	"orderAmount": this.count * this.currentPresentSum,
-					// 	"orderId": orderId,
-					// 	"payWay": "WECHAT_OFFIACCOUNT",
-					// 	"redirectUrl": "",
-					// 	"scene": "OFFLINE",
-					// 	"uniqueOrderNo": "",
-					// 	"userId": uni.getStorageSync("openid"),
-					// 	"userIp": "127.0.0.1"
-					// }
-				));
-				this.toPay(orderInfo.prePayTn);
-				//  _this.$u.api.boost.billRecord({
-				// 	userId: _this.senderId,
-				// 	orderId:orderId,
-				// 	payPath: encodeURIComponent(window.location.href),
-				// 	openId: uni.getStorageSync("openid"),
-				// 	activityId: _this.activityId,
-				// 	price: _this.count * _this.currentPresentSum,
-				// 	presentId: _this.boostDetail.presentList[_this.current].id,
-				// 	presentCount: _this.count,
-				// 	relationId: _this.receiverId,
-				// 	type: 2,
-				// 	payStatus: 0,
-				// }).then(res=>{
-				// 	if(typeof orderInfo.prePayTn != 'undefined' ){
-				// 		//调起支付
-				// 		this.toPay(JSON.parse(orderInfo.prePayTn));
-				// 	}
-				// })	
+				if (this.$u.test.isEmpty(this.senderId)) {
+					let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
+					window.location.href = authUrl(path);
+				} else {
+					this.orderId = new Date().getTime();
+					let orderInfo  = (await this.$u.api.yeePay.initOrder(
+						{
+						  "channel": "ALIPAY",
+						  "goodsName": this.boostDetail.presentList[this.current].name,
+						  "notifyUrl": "1",
+						  "orderAmount": this.count * this.currentPresentSum,
+						  "orderId": this.orderId,
+						  "payWay": "USER_SCAN",
+						  "scene": "OFFLINE",
+						  "userIp": "127.0.0.1"
+						}
+					));
+					 _this.$u.api.boost.billRecord({
+						userId: _this.senderId,
+						orderId: this.orderId,
+						payPath: encodeURIComponent(window.location.href),
+						openId: "",
+						activityId: _this.activityId,
+						price: _this.count * _this.currentPresentSum,
+						presentId: _this.boostDetail.presentList[_this.current].id,
+						presentCount: _this.count,
+						relationId: _this.receiverId,
+						type: 2,
+						payStatus: 0,
+					}).then(res=>{
+						if(typeof orderInfo.prePayTn != 'undefined' ){
+							//调起支付
+							this.toPay(orderInfo.prePayTn);
+						}
+					})	
+				}
 			},
 			//获取助力详情
 			getBoostDetail(activityId, receiverId) {
@@ -363,18 +364,21 @@
 				// this.type = "分享到朋友圈"
 			},
 			toPay(info) {
-				// console.log(info,456789);
-				// let _this = this;
-				// WeixinJSBridge.invoke('getBrandWCPayRequest', info, (res) => {
-				// 	if (res.err_msg == "get_brand_wcpay_request:ok" ) {
-				// 		_this.successShow = true;
-				// 	} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
-				// 		console.log("cancel");
-				// 	} else {
-				// 		console.log(res.err_msg);
-				// 	}
-				// });
 				location.href = `alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=${info}`;
+				this.dialogShow = false;
+				setTimeout(() => {
+					this.payShow = true;
+				}, 3000)
+			},
+			async checkPayInterval() {
+				this.payShow = false;
+				let res = await this.$u.api.boost.billRecordDetail({orderId: this.orderId})
+				if (res && res.payStatus == 1) {
+					this.successShow = true;
+					this.getBoostDetail(this.activityId, this.receiverId);
+				} else {
+					this.errorShow = true;
+				}
 			},
 			presentBoost(id) {
 				this.$u.api.boost.presentDetail({id: id}).then(res => {

+ 48 - 33
pages/activityList/activity/musicBoost.vue

@@ -126,6 +126,23 @@
 				</view>
 			</view>
 		</u-popup>
+		<u-popup v-model="errorShow" mode="center" width="500rpx" height="600rpx" border-radius="30">
+			<view class="bg-img text-center" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/e914f556be414767aca011a30961560a-dialogBgImg.png');height: 600rpx;">
+				<view style="height: 120upx;"></view>
+				<u-avatar :src="boostDetail.avatar" size="160"></u-avatar>
+				<view class="text-center margin-top text-lg text-bold">支付失败</view>
+				<view class="padding">
+					<u-button class="custom-style" shape="circle" @click="errorShow = false">确定</u-button>
+				</view>
+			</view>
+		</u-popup>
+		<u-popup v-model="payShow" mode="center" width="500rpx" height="320rpx" border-radius="30">
+			<view class="text-center text-lg padding">请确定支付是否已完成</view>
+			<u-line color="#c2c2c2"></u-line>
+			<view class="text-red text-center text-lg padding" @click="checkPayInterval">已完成支付</view>
+			<u-line color="#c2c2c2"></u-line>
+			<view class="text-gray text-center text-lg padding" @click="pay">支付遇到问题,重新支付</view>
+		</u-popup>
 		<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
 			<view class="cu-dialog">
 				<view style="height:150px;">
@@ -183,6 +200,9 @@
 				presentId: '',
 				successShow: false,
 				presentDetail: {},
+				errorShow: false,
+				payShow: false,
+				orderId: '',
 			}
 		},
 		onLoad(options) {
@@ -236,38 +256,29 @@
 			},
 			//礼物支付
 			async pay() {
+				this.payShow = false;
 				let _this = this;
 				if (this.$u.test.isEmpty(this.userId)) {
 					let path = 'pages/activityList/activity/musicBoost?id=' + this.productId;
 					window.location.href = authUrl(path);
 				} else {
-					let orderId=new Date().getTime()
+					this.orderId=new Date().getTime();
 					let orderInfo  = (await this.$u.api.yeePay.initOrder(
 						{
-						  "appId": appId,
-						  "channel": "WECHAT",
-							"channelPromotionInfo": "",
-							"channelSpecifiedInfo": "",
-							"csUrl": "",
-							"expiredTime": "",
-							"fundProcessType": "",
-							"goodsName": this.boostDetail.presentList[this.current].name,
-							"memo": "",
-							"notifyUrl": "https://music.nanyue6688.com/ldt/api/yeePay/notify",
-							"orderAmount": this.count * this.currentPresentSum,
-							"orderId": orderId,
-							"payWay": "WECHAT_OFFIACCOUNT",
-							"redirectUrl": "",
-							"scene": "OFFLINE",
-							"uniqueOrderNo": "",
-							"userId": uni.getStorageSync("openid"),
-							"userIp": "127.0.0.1"
+						  "channel": "ALIPAY",
+						  "goodsName": this.boostDetail.presentList[this.current].name,
+						  "notifyUrl": "1",
+						  "orderAmount": this.count * this.currentPresentSum,
+						  "orderId": this.orderId,
+						  "payWay": "USER_SCAN",
+						  "scene": "OFFLINE",
+						  "userIp": "127.0.0.1"
 						}
 					));
 					_this.$u.api.boost.billRecord({
 						userId: _this.userId,
-						orderId:orderId,
-						openId: uni.getStorageSync("openid"),
+						orderId:this.orderId,
+						openId: "",
 						payPath: encodeURIComponent(window.location.href),
 						activityId: _this.boostDetail.activityId,
 						price: _this.count * _this.currentPresentSum,
@@ -279,7 +290,7 @@
 					}).then(res=>{
 						if(typeof orderInfo.prePayTn != 'undefined' ){
 							//调起支付
-							this.toPay(JSON.parse(orderInfo.prePayTn));
+							this.toPay(orderInfo.prePayTn);
 						}
 					})
 				}
@@ -364,17 +375,21 @@
 				// this.type = "分享到朋友圈"
 			},
 			toPay(info) {
-				console.log(info,456789);
-				let _this = this;
-				WeixinJSBridge.invoke('getBrandWCPayRequest', info, (res) => {
-					if (res.err_msg == "get_brand_wcpay_request:ok" ) {
-						_this.successShow = true;
-					} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
-						console.log("cancel");
-					} else {
-						console.log(res.err_msg);
-					}
-				});
+				location.href = `alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=${info}`;
+				this.dialogShow = false;
+				setTimeout(() => {
+					this.payShow = true;
+				}, 3000)
+			},
+			async checkPayInterval() {
+				this.payShow = false;
+				let res = await this.$u.api.boost.billRecordDetail({orderId: this.orderId})
+				if (res && res.payStatus == 1) {
+					this.successShow = true;
+					this.getBoostDetail(this.productId, this.userId);
+				} else {
+					this.errorShow = true;
+				}
 			},
 			presentBoost(id) {
 				this.$u.api.boost.presentDetail({id: id}).then(res => {

+ 5 - 1
pages/activityList/home/home.vue

@@ -42,8 +42,12 @@
 			}
 		},
 		onLoad(options) {
+			console.log("home", options);
+			if (!this.$u.test.isEmpty(options.userId)) {
+				uni.setStorageSync("userId", options.userId);
+			}
 			this.activityId = options.activityId;
-			this.authorization(options.current);
+			// this.authorization(options.current);
 			this.addVisit(options.activityId);
 		},
 		onShow() {

+ 21 - 22
pages/index/guide.vue

@@ -23,8 +23,15 @@
 			</view>
 		</view>
 		<view style="height: 120upx;"></view>
-		<view class="footer-fixed padding" style="background-color: #ffffff;">
-			<button class="cu-btn round theme-bg-color text-white text-bold" style="width: 100%;height: 100upx;font-size: 36upx;" @click="tips">参与打榜活动</button>
+		<view class="footer-fixed" style="background-color: #ffffff;padding: 10upx 60upx;">
+			<button class="cu-btn round theme-bg-color text-white text-bold" style="width: 100%;height: 100upx;font-size: 36upx;" @click="tips">
+				<view>投票通道已启动!</view>
+				<image src="/static/index/left-arrow.png" style="width: 32upx;height: 32upx;"></image>
+			</button>
+			<view class="flex align-center justify-center">
+				<view class="theme-color text-bold margin-tb-xs" style="font-size: 36upx;">快来为爱豆和Ta的作品打Call,冲鸭</view>
+				<image src="/static/index/duck.png" style="width: 34upx;height: 34upx;"></image>
+			</view>
 		</view>
 	</view>
 </template>
@@ -36,34 +43,22 @@
 			return {
 				userId: '',
 				show: false,
-				src: 'https://music.nanyue6688.com/obsfile/445668112f384a8cb2c405dc5d514a79-poster.png'
+				src: 'https://gxsz-bucket-01.obs.cn-south-1.myhuaweicloud.com/WechatIMG62.png'
 			}
 		},
-		onLoad() {
-			this.authorization();
+		onLoad(options) {
+			if (!this.$u.test.isEmpty(options.userId)) {
+				this.userId = options.userId;
+			} else {
+				this.authorization();
+			}
 		},
 		methods: {
 			tips() {
-				console.log("userId",this.userId);
 				this.show = true;
-				this.userId = uni.getStorageSync("userId");
 				if (this.$isWxBrowser()) {
 					this.show = true;
-				} else {
-					uni.reLaunch({
-						url: "/pages/activityList/index"
-					})
 				}
-				// if (this.$isWxBrowser() && this.$u.test.isEmpty(this.userId)) {
-				// 	let path = 'pages/index/guide';
-				// 	window.location.href = authUrl(path);
-				// } else if (this.$isWxBrowser() && !this.$u.test.isEmpty(this.userId)) {
-				// 	this.show = true;
-				// } else {
-				// 	uni.reLaunch({
-				// 		url: "/pages/activityList/index"
-				// 	})
-				// }
 			},
 			async authorization() {
 				let agenterId=uni.getStorageSync("agenterId")
@@ -87,7 +82,11 @@
 					if (result) {
 						this.userId = result.id;
 						uni.setStorageSync("userId", result.id);
-						// window.location.href = 'https://music.nanyue6688.comm/vote-h5/index.html#/pages/activityList/index?userId=' + this.userId;
+						let url = window.location.href;
+						url = url + "?userId=" +  this.userId;
+						console.log(url);
+						window.location.href = url;
+						// window.location.href = 'https://music.nanyue6688.comm/vote-h5/index.html#/pages/index/guide?userId=' + this.userId + '&openId=' + res.openid;
 					}
 				}
 			},

+ 2 - 2
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<block v-if="current == 0">
+		<!-- <block v-if="current == 0">
 			<index-view></index-view>
 		</block>
 		<block v-if="current == 3">
@@ -9,7 +9,7 @@
 		<view style="height: 100upx;"></view>
 		<view class="footer-fixed">
 			<bottom-bar-index @onTap="change"></bottom-bar-index>
-		</view>
+		</view> -->
 	</view>
 </template>
 

BIN
static/index/duck.png


BIN
static/index/left-arrow.png


BIN
static/index/poster.png