Jelajahi Sumber

Merge branch 'master' of http://192.168.1.218:3000/liyingqu/cyzh-SoundOfMusic-H5

 Conflicts:
	pages/activityList/activity/musicBoost.vue
梁汉强 4 tahun lalu
induk
melakukan
05c0ba15b8

+ 1 - 1
common/css/app.scss

@@ -1,6 +1,6 @@
 	.footer-fixed {
 		position: fixed;
-		z-index: 10000;
+		z-index: 999;
 		width: 100%;
 		bottom: 0;
 		left: 0;

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

@@ -39,6 +39,9 @@ let pointsUrl = {
 let boostUrl = {
 	listUrl: '/cyzh-helpRecord/helprecord/list2',
 	doHitUrl: '/cyzh-helpRecord/helprecord/doHit',
+	myBoostUrl : 'cyzh-helpRecord/helprecord/selectHelpRecordVoPage',
+	billRecordUrl: 'cyzh-billRecord/billrecord/submit',
+	doRewardUrl: 'cyzh-helpRecord/helprecord/doReward',
 }
 
 let productionUrl = {
@@ -116,6 +119,9 @@ const install = (Vue, vm) => {
 	let boost = {
 		list:(params = {}) => vm.$u.get(boostUrl.listUrl, params),
 		doHit:(params = {}) => vm.$u.post(boostUrl.doHitUrl, params),
+		myBoost:(params = {}) => vm.$u.get(boostUrl.myBoostUrl, params),
+		billRecord:(params = {}) => vm.$u.post(boostUrl.billRecordUrl, params),
+		doReward:(params = {}) => vm.$u.post(boostUrl.doRewardUrl, params),
 	}
 	
 	let production = {

+ 4 - 4
main.js

@@ -17,19 +17,19 @@ import {shareConfig} from "@/common/utils/share.js"
 Vue.prototype.$shareConfig = shareConfig
 
 // 全局注入
-import Mixin from './common/utils/mixin.js'
+import Mixin from '@/common/utils/mixin.js'
 Vue.mixin(Mixin)
 
 // 微信函数封装
-import mpi from './common/utils/mpi.js'
+import mpi from '@/common/utils/mpi.js'
 Vue.prototype.$mpi = mpi
 
 //封装提示工具
-import dialog from './common/utils/dialog.js'
+import dialog from '@/common/utils/dialog.js'
 Vue.prototype.$dialog = dialog
 
 //全局变量
-import Global from './common/utils/global.js'
+import Global from '@/common/utils/global.js'
 Vue.prototype.$global = Global
 
 App.mpType = 'app'

+ 70 - 7
pages/activityList/activity/authorBoost.vue

@@ -46,7 +46,7 @@
 		<view class="bg-white padding-sm">
 			<view class="flex justify-around">
 				<block v-for="(item,index) in boostDetail.presentList" :key="index">
-					<view class="text-center padding-top-xs" :class="current == index ? 'boder':''" @click="change(index)">
+					<view class="text-center padding-top-xs" :class="current == index ? 'boder':''" @click="change(item.id,index)">
 						<image :src="item.icon" style="width: 80upx;height: 80upx;"></image>
 						<view class="text-sm margin-tb-xs">金额: {{+item.price}}</view>
 						<view style="margin-bottom: 10upx;">
@@ -77,11 +77,11 @@
 		</view>
 		<u-popup v-model="shareShow" mode="bottom" height="460rpx" border-radius="30">
 			<view class="flex align-center justify-around" style="padding: 90upx 60upx 70upx 60upx;"> 
-				<view class="text-center">
+				<view class="text-center" @click="wxShare">
 					<image src="/static/wx-share.png" style="width: 125upx;height: 125upx;"></image>
 					<view class="text-sm">分享好友</view>
 				</view>
-				<view class="text-center">
+				<view class="text-center" @click="pyqShare">
 					<image src="/static/wx-pyq.png" style="width: 129upx;height: 124upx;"></image>
 					<view class="text-sm">分享朋友圈</view>
 				</view>
@@ -94,15 +94,38 @@
 			<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="/static/avatar.png" size="160"></u-avatar>
-				<view class="margin-top" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #323035;">你将为{{boostDetail.nickName}}增加50热力值</view>
+				<view class="margin-top" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #323035;">你将为{{boostDetail.nickName}}增加{{+boostDetail.presentList[current].hotValue}}热力值</view>
 				<view class="text-gray text-sm">公益勋章X1</view>
 				<view class="text-gray text-sm">立白助力礼包A</view>
-				<view class="text-gray text-sm">可得300积分,可用于国信商城兑换</view>
+				<view class="text-gray text-sm">可得{{+boostDetail.presentList[current].pointsValue}}积分,可用于国信商城兑换</view>
 				<view class="padding">
 					<u-button class="custom-style" shape="circle" @click="pay">去支付</u-button>
 				</view>
 			</view>
 		</u-popup>
+		<u-popup v-model="successShow" 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="/static/avatar.png" size="160"></u-avatar>
+				<view class="margin-top" style="font-size: 30upx;font-family: PingFang SC;font-weight: bold;color: #323035;">恭喜您已为{{boostDetail.nickName}}注入{{+boostDetail.presentList[current].hotValue}}热力值</view>
+				<view class="margin-tb-xs">{{+boostDetail.presentList[current].pointsValue}}已到账,可用于商城兑换消费</view>
+				<view class="text-gray text-sm">购买成功!快去我的订单兑换或捐赠</view>
+				<view class="padding">
+					<u-button class="custom-style" shape="circle" @click="successShow = false">确定</u-button>
+				</view>
+			</view>
+		</u-popup>
+		<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
+			<view class="cu-dialog">
+				<view style="height:150px;">
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">1. 先点击右上角<text class="text-bold" style="font-size: 38upx;">"···"</text></view>
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">2. 选择<text class="text-bold" style="font-size: 38upx;">"{{type}}"</text></view>
+				</view>
+				<view class="cu-bar text-green text-lg bg-white">
+					<view class="action margin-0 flex-sub  solid-left" @tap="wxShareShow = false">知道了</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -116,11 +139,15 @@
 				boostDetail: {},
 				dialogShow: false,
 				shareShow: false,
+				wxShareShow: false,
 				count: 1,
 				currentPresentSum: 0,
 				activityId: '',
 				senderId: '',
 				receiverId: '',
+				type: '',
+				presentId:'',
+				successShow: false,
 			}
 		},
 		onLoad(options) {
@@ -156,7 +183,30 @@
 					let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
 					window.location.href = authUrl(path);
 				} else {
-					
+					console.log("发起支付");
+					//支付成功后: 
+					// this.$u.api.boost.billRecord({
+					// 	userId: this.senderId,
+					// 	openId: uni.getStorageSync("openid"),
+					// 	activityId: this.activityId,
+					// 	price: this.count * this.currentPresentSum,
+					// 	presentId: this.presentId,
+					// 	presentCount: this.count,
+					//  type: 2,
+					// 	payStatus: '',
+					// }).then(res => {
+					// 	this.$u.api.boost.doReward({
+					// 		activityId: this.activityId,
+					// 		presentId: this.presentId,
+					// 		senderId: this.senderId,
+					// 		receiverId: this.receiverId,
+					// 		type: 3,
+					// 		count: this.count,
+					// 	}).then(res => {
+					// 		this.successShow = true;
+					// 	})
+					// })
+					this.successShow = true;
 				}
 			},
 			//获取助力详情
@@ -166,7 +216,8 @@
 					this.currentPresentSum = res.presentList[this.current].price;
 				})
 			},
-			change(index) {
+			change(id,index) {
+				this.presentId = id;
 				this.currentPresentSum = 0;
 				this.count = 1;
 				this.current = index;
@@ -187,6 +238,7 @@
 				let params = getUrlParams(window.location.search);
 				if (!this.$u.test.isEmpty(params.code)) {
 					let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
+					uni.setStorageSync("openid", res.openid);
 					let datas = {
 						nickName: res.nickname,
 						avatar: res.headimgurl,
@@ -203,12 +255,23 @@
 					if (result) {
 						this.senderId = result.id;
 						uni.setStorageSync("userId", result.id);
+						this.getBoostDetail(this.activityId, this.receiverId);
 					}
 				}
 			},
 			//邀请
 			invite() {
 				this.shareShow = true;
+			},
+			wxShare() {
+				this.shareShow = false;
+				this.wxShareShow = true;
+				this.type = "发送给朋友";
+			},
+			pyqShare() {
+				this.shareShow = false;
+				this.wxShareShow = true;
+				this.type = "分享到朋友圈"
 			}
 		}
 	}

+ 80 - 7
pages/activityList/activity/musicBoost.vue

@@ -41,7 +41,7 @@
 		<view class="bg-white padding-sm">
 			<view class="flex justify-around">
 				<block v-for="(item,index) in boostDetail.presentList" :key="index">
-					<view class="text-center padding-top-xs" :class="current == index ? 'boder':''" @click="change(index)">
+					<view class="text-center padding-top-xs" :class="current == index ? 'boder':''" @click="change(item.id, index)">
 						<image :src="item.icon" style="width: 80upx;height: 80upx;"></image>
 						<view class="text-sm margin-tb-xs">金额: {{+item.price}}</view>
 						<view style="margin-bottom: 10upx;">
@@ -72,11 +72,11 @@
 		</view>
 		<u-popup v-model="shareShow" mode="bottom" height="460rpx" border-radius="30">
 			<view class="flex align-center justify-around" style="padding: 90upx 60upx 70upx 60upx;"> 
-				<view class="text-center">
+				<view class="text-center" @click="wxShare">
 					<image src="/static/wx-share.png" style="width: 125upx;height: 125upx;"></image>
 					<view class="text-sm">分享好友</view>
 				</view>
-				<view class="text-center">
+				<view class="text-center" @click="pyqShare">
 					<image src="/static/wx-pyq.png" style="width: 129upx;height: 124upx;"></image>
 					<view class="text-sm">分享朋友圈</view>
 				</view>
@@ -89,15 +89,38 @@
 			<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="/static/avatar.png" size="160"></u-avatar>
-				<view class="margin-top" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #323035;">你将为{{boostDetail.title}}增加50热力值</view>
+				<view class="margin-top" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #323035;">你将为{{boostDetail.title}}增加{{+boostDetail.presentList[current].hotValue}}热力值</view>
 				<view class="text-gray text-sm">公益勋章X1</view>
 				<view class="text-gray text-sm">立白助力礼包A</view>
-				<view class="text-gray text-sm">可得300积分,可用于国信商城兑换</view>
+				<view class="text-gray text-sm">可得{{+boostDetail.presentList[current].pointsValue}}积分,可用于国信商城兑换</view>
 				<view class="padding">
 					<u-button class="custom-style" shape="circle" @click="pay">去支付</u-button>
 				</view>
 			</view>
 		</u-popup>
+		<u-popup v-model="successShow" 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="/static/avatar.png" size="160"></u-avatar>
+				<view class="margin-top" style="font-size: 30upx;font-family: PingFang SC;font-weight: bold;color: #323035;">恭喜您已为{{boostDetail.title}}注入{{+boostDetail.presentList[current].hotValue}}热力值</view>
+				<view class="margin-tb-xs">{{+boostDetail.presentList[current].pointsValue}}已到账,可用于商城兑换消费</view>
+				<view class="text-gray text-sm">购买成功!快去我的订单兑换或捐赠</view>
+				<view class="padding">
+					<u-button class="custom-style" shape="circle" @click="successShow = false">确定</u-button>
+				</view>
+			</view>
+		</u-popup>
+		<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
+			<view class="cu-dialog">
+				<view style="height:150px;">
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">1. 先点击右上角<text class="text-bold" style="font-size: 38upx;">"···"</text></view>
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">2. 选择<text class="text-bold" style="font-size: 38upx;">"{{type}}"</text></view>
+				</view>
+				<view class="cu-bar text-green text-lg bg-white">
+					<view class="action margin-0 flex-sub  solid-left" @tap="wxShareShow = false">知道了</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -109,14 +132,19 @@
 	export default {
 		data() {
 			return {
+				activityId: '',
 				current: 0,
 				boostDetail: {},
 				dialogShow: false,
 				shareShow: false,
+				wxShareShow: false,
 				count: 1,
 				currentPresentSum: 0,
 				productId: '',
 				userId: '',
+				type:'',
+				presentId: '',
+				successShow: false,
 			}
 		},
 		onLoad(options) {
@@ -185,8 +213,38 @@
 				// 	let path = 'pages/activityList/activity/musicBoost?id=' + this.productId;
 				// 	window.location.href = authUrl(path);
 				// } else {
-					
+
 				// }
+			pay() {
+				if (this.$u.test.isEmpty(this.userId)) {
+					let path = 'pages/activityList/activity/musicBoost?id=' + this.productId;
+					window.location.href = authUrl(path);
+				} else {
+					console.log("发起支付");
+					//支付成功后:
+					// this.$u.api.boost.billRecord({
+					// 	userId: this.userId,
+					// 	openId: uni.getStorageSync("openid"),
+					// 	activityId: this.boostDetail.activityId,
+					// 	price: this.count * this.currentPresentSum,
+					// 	presentId: this.presentId,
+					// 	presentCount:  this.count,
+					//  type: 1,
+					// 	payStatus: '',
+					// }).then(res => {
+					// 	this.$u.api.boost.doReward({
+					// 		activityId: this.boostDetail.activityId,
+					// 		presentId: this.presentId,
+					// 		senderId: this.userId,
+					// 		receiverId: this.boostDetail.userId,
+					// 		type: 1,
+					// 		count: this.count,
+					// 	}).then(res => {
+					// 		this.successShow = true;
+					// 	})
+					// })
+					this.successShow = true;
+				}
 			},
 			//获取助力详情
 			getBoostDetail(productId, userId) {
@@ -195,7 +253,8 @@
 					this.currentPresentSum = res.presentList[this.current].price;
 				})
 			},
-			change(index) {
+			change(id, index) {
+				this.presentId = id;
 				this.currentPresentSum = 0;
 				this.count = 1;
 				this.current = index;
@@ -216,6 +275,7 @@
 				let params = getUrlParams(window.location.search);
 				if (!this.$u.test.isEmpty(params.code)) {
 					let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
+					uni.setStorageSync("openid", res.openid);
 					let datas = {
 						nickName: res.nickname,
 						avatar: res.headimgurl,
@@ -232,6 +292,7 @@
 					if (result) {
 						this.userId = result.id;
 						uni.setStorageSync("userId", result.id);
+						this.getBoostDetail(this.productId, this.userId);
 					}
 				}
 			},
@@ -239,6 +300,18 @@
 			invite() {
 				this.shareShow = true;
 			},
+			wxShare() {
+				this.shareShow = false;
+				this.wxShareShow = true;
+				this.type = "发送给朋友";
+			},
+			pyqShare() {
+				this.shareShow = false;
+				this.wxShareShow = true;
+				this.type = "分享到朋友圈"
+			}
+		}
+			},
 			toPay(info){
 				WeixinJSBridge.invoke(
 				      'getBrandWCPayRequest',info ,

+ 1 - 0
pages/activityList/goods/detail.vue

@@ -240,6 +240,7 @@
 				let params = getUrlParams(window.location.search);
 				if (!this.$u.test.isEmpty(params.code)) {
 					let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
+					uni.setStorageSync("openid", res.openid);
 					let datas = {
 						nickName: res.nickname,
 						avatar: res.headimgurl,

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

@@ -61,6 +61,7 @@
 				let params = getUrlParams(window.location.search);
 				if (!this.$u.test.isEmpty(params.code)) {
 					let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
+					uni.setStorageSync("openid", res.openid);
 					let datas = {
 						nickName: res.nickname,
 						avatar: res.headimgurl,

+ 23 - 2
pages/activityList/mine/introduction.vue

@@ -22,8 +22,8 @@
 				<view>{{detail.introduce}}</view>
 			</view>
 			<view class="flex justify-around padding">
-				<button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;">转发好友</button>
-				<button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;">生成海报</button>
+				<button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;" @click="wxShare">转发好友</button>
+				<button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;" @click="pyqShare">生成海报</button>
 			</view>
 		</view>
 		<view class="container margin-sm">
@@ -40,6 +40,17 @@
 				</view>
 			</block>
 		</view>
+		<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
+			<view class="cu-dialog">
+				<view style="height:150px;">
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">1. 先点击右上角<text class="text-bold" style="font-size: 38upx;">"···"</text></view>
+					<view style="color: #000000;font-size: 38upx;padding: 40upx;">2. 选择<text class="text-bold" style="font-size: 38upx;">"{{type}}"</text></view>
+				</view>
+				<view class="cu-bar text-green text-lg bg-white">
+					<view class="action margin-0 flex-sub  solid-left" @tap="wxShareShow = false">知道了</view>
+				</view>
+			</view>
+		</view>
 		<view style="height: 80rpx;" v-if="status">
 			<u-divider bgColor="#f1f1f1;"  height="80">到底了</u-divider>
 		</view>
@@ -56,6 +67,8 @@
 				current: 1,
 				size: 30,
 				status: false,
+				wxShareShow: false,
+				type: '',
 			}
 		},
 		onLoad(options) {
@@ -81,6 +94,14 @@
 				this.$u.api.production.detail({id: this.productId}).then(res => {
 					this.detail = res;
 				})
+			},
+			wxShare() {
+				this.wxShareShow = true;
+				this.type = "发送给朋友";
+			},
+			pyqShare() {
+				this.wxShareShow = true;
+				this.type = "分享到朋友圈"
 			}
 		}
 	}

+ 21 - 10
pages/activityList/mine/myBoost.vue

@@ -23,19 +23,30 @@
 	export default {
 		data() {
 			return {
-				boostList: [
-					{image: '/static/avatar.png', name: '易烊千玺', time: '2021-6-7 10:28:46', type: '打榜', hotValue: '12'},
-					{image: '/static/avatar2.png', name: '许嵩', time: '2021-6-7 10:28:46', type: '礼物', hotValue: '13'},
-					{image: '/static/avatar.png', name: '林俊杰', time: '2021-6-7 10:28:46', type: '打榜', hotValue: '188'},
-					{image: '/static/avatar2.png', name: '沈以诚', time: '2021-6-7 10:28:46', type: '打榜', hotValue: '88'},
-					{image: '/static/avatar.png', name: '颜人中', time: '2021-6-7 10:28:46', type: '礼物', hotValue: '13'},
-					{image: '/static/avatar.png', name: '毛不易', time: '2021-6-7 10:28:46', type: '转发', hotValue: '1'},
-					{image: '/static/avatar2.png', name: '陈奕迅', time: '2021-6-7 10:28:46', type: '打榜', hotValue: '5'}
-				],
+				boostList: [],
+				userId: '',
+				current: 0,
+				size: 30,
+			}
+		},
+		onLoad() {
+			this.userId = uni.getStorageSync("userId") || -1;
+			this.getMyBoostList();
+		},
+		onReachBottom() {
+			if (this.boostList.length < this.current * this.size) {
+				this.status = true;
+			} else {
+				this.current += 1;
+				this.getMyBoostList();
 			}
 		},
 		methods: {
-			
+			getMyBoostList() {
+				this.$u.api.boost.myBoost({senderId: this.userId, current: this.current, size: this.size}).then(res => {
+					this.boostList = [...this.boostList,...res.records];
+				})
+			}
 		}
 	}
 </script>