hmp 4 лет назад
Родитель
Сommit
588432ebaf

+ 7 - 1
common/http/http.api.js

@@ -25,7 +25,9 @@ let userUrl = {
 	userAddressSubmit: '/cyzh-userAddress/useraddress/submit',
 	getBonus:'cyzh-userActivityStatistical/useractivitystatistical/getBonus',
 	withdrawRecords:'cyzh-withdrawRecords/withdrawrecords/list',
-	mineData:'cyzh-loginUser/loginuser/getLoginWebVO'
+	mineData:'cyzh-loginUser/loginuser/getLoginWebVO',
+	statisticalList:'cyzh-userActivityStatistical/useractivitystatistical/list2',
+	withdraw:'cyzh-userActivityStatistical/useractivitystatistical/withdraw'
 }
 
 let pointsUrl = {
@@ -92,8 +94,12 @@ const install = (Vue, vm) => {
 		userAddress:(params = {}) => vm.$u.get(userUrl.userAddress, params),
 		userAddressSubmit:(params = {}) => vm.$u.post(userUrl.userAddressSubmit, params),
 		getBonus:(params = {}) => vm.$u.get(userUrl.getBonus, params),
+		//提现 begin
 		withdrawrecords:(params = {}) => vm.$u.get(userUrl.withdrawRecords, params),
 		mineData:(params = {}) => vm.$u.get(userUrl.mineData, params),
+		statisticalList:(params = {}) => vm.$u.get(userUrl.statisticalList, params),
+		withdraw:(params = {}) => vm.$u.post(userUrl.withdraw, params),
+		//提现 end
 	}
 	
 	let points = {

+ 2 - 2
common/utils/global.js

@@ -1,6 +1,6 @@
 let global = {
-	baseUrl: 'https://vote.guosen-fumao.cn/ldt/api'
-	// baseUrl: 'http://192.168.1.168:9612'
+	// baseUrl: 'https://vote.guosen-fumao.cn/ldt/api'
+	baseUrl: 'http://192.168.1.168:9612'
 }
 
 export default global

+ 41 - 10
pages/activityList/activity/awards.vue

@@ -13,7 +13,7 @@
 					<text class="padding-left-xs"
 						style="font-size: 24upx;font-family: PingFang SC;font-weight: 800;color: #878787;">热力值</text>
 				</view>
-				<button class="cu-btn round text-white" style="background-color: #f75757;width: 140upx;">提现</button>
+				<button @click="doAwards" class="cu-btn round text-white" style="background-color: #f75757;width: 140upx;">提现</button>
 			</view>
 			<view style="margin: 10upx 20upx;">
 				<u-line color="#e0e0e0"></u-line>
@@ -34,17 +34,21 @@
 				<view class="cuIcon-text text-bold padding-right-xs" style="font-size: 38upx;"></view>
 				<view class="title">提现明细</view>
 			</view>
-			<view v-for="(item, index) in list" :key="index" class="flex align-center justify-between">
+			<view v-for="(item, index) in list" :key="index" class="flex align-center justify-between padding-sm">
 				<view class="padding-lr">
 					<view class="title">{{item.note}}</view>
-					<view style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #686868;">
+					<view class="padding-top-sm" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #686868;">
 						{{item.createTime}}</view>
 				</view>
 				<view class="padding-right">
-					<text style="font-size: 36upx;font-family: PingFang SC;font-weight: bold;color: #F3484E;">+{{ +item.hotValue}}</text>
+					<text style="font-size: 36upx;font-family: PingFang SC;font-weight: bold;color: #F3484E;">+{{ +item.cashValue}}</text>
 					<text class="text-bold padding-left-xs">元</text>
 				</view>
 			</view>
+			<view class="padding-top-sm">
+				
+			</view>
+			 <u-loadmore :status="status" />
 			<view style="padding: 20upx;">
 				<u-line color="#e0e0e0"></u-line>
 			</view>
@@ -59,14 +63,31 @@
 			return {
 				userId: '',
 				data: {},
-				list:[]
+				list:[],
+				
+				status: 'loadmore',
+				current:1
 			}
 		},
 		onLoad() {
-			this.userId = uni.getStorageSync("userId") || -1;
+			this.userId = uni.getStorageSync("userId");
+			if (!this.userId) {
+				this.$u.toast('用户未登录')
+				return
+			}
 			this.getBonus()
-			this.getList()
+			this.fetchData()
 		},
+		onReachBottom() {
+			 if(this.list.length<this.current*10){
+				this.status = 'nomore';
+				return
+			 }else{
+				 this.status = 'loading';
+				 this.current = ++ this.current;
+				 this.fetchData()
+			}
+		 },
 		methods: {
 			getBonus() {
 				this.$u.api.user.getBonus({
@@ -75,9 +96,19 @@
 					this.data = res
 				})
 			},
-			getList() {
-				this.$u.api.user.withdrawrecords({userId: this.userId}).then(res => {
-					this.list = res.records
+			fetchData() {
+				let params={
+					size:10,
+					userId: this.userId,
+					current:this.current
+				}
+				this.$u.api.user.withdrawrecords(params).then(res => {
+					this.list = [...this.list,...res.records]
+				})
+			},
+			doAwards(){
+				uni.navigateTo({
+					url:"doAwards?userId="+this.userId
 				})
 			}
 		}

+ 87 - 7
pages/activityList/activity/doAwards.vue

@@ -1,36 +1,110 @@
 <template>
 	<view>
-		<view class="card">
+		<view class="bg-img flex justify-center align-center" style="background-image: url('/static/songRank/awards.png');height: 302upx;">
+			<view class="text-white" >
+				<text class="text-lg">提现金额:</text>
+				<text style="font-size: 60rpx;">¥{{total}}</text>
+			</view>
+		</view>
+		<view v-if="list" class="card" v-for="(item,index) in list" :key="index">
 			<view class="left">
 				<view>
 					活动名称:
-					<text class="text-red">音乐之声</text>
+					<text class="text-red">{{item.activityName}}</text>
 				</view>
 				<view>
 					可用热力:
-					<text class="text-red">4562</text>
+					<text class="text-red">{{item.usableHotValue}}</text>
 				</view>
 				<view>
 					可提余额:
-					<text class="text-red">¥2000</text>
+					<text class="text-red">¥{{item.usableCash}}</text>
 				</view>
 			</view>
 			<view class="right">
-				
+				<u-number-box  v-model="withdrawList[index].totalCash"  :index="index" :min="0" :max="max(item.usableCash)"  :input-width="100" :input-height="60"></u-number-box>
+				<text  class="padding-left-sm text-red">元</text>
 			</view>
 		</view>
+		<view class="" style="height: 140rpx;"></view>
+		<view 
+			class="footer-fixed flex align-center justify-end padding bg-white"
+			style="padding: 30rpx;;border-top: 1rpx solid #e5e5e5;z-index: 9;">
+			<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;"
+				@click="withdraw">确认提现</button>
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
+		computed:{
+			max(){
+				return data=>{
+					if (this.$u.test.isEmpty(data)) {
+						return 0
+					}
+					return parseInt(data)
+				}
+			},
+			total:{
+				get(){
+					let total=0
+					this.withdrawList.forEach(item=>{
+						total+=item.totalCash
+					})
+					return total
+				}
+			}
+		},
 		data() {
 			return {
-				
+				userId:'',
+				list:[],
+				withdrawList:[]
 			}
 		},
+		onLoad(options) {
+			this.userId=options.userId
+			if (!this.userId) {
+				this.$u.toast('用户未登录')
+				return
+			}
+			this.fetchList()
+		},
 		methods: {
-			
+			fetchList(){
+				let params={
+					userId:this.userId,
+					size:500
+				}
+				this.$u.api.user.statisticalList(params).then(res=>{
+					this.list=res.records
+					this.withdrawList=[]
+					this.list.forEach(item=>{
+						let obj={
+							id:item.id,
+							userId:item.userId,
+							activityId:item.activityId,
+							totalCash:0,
+						}
+						this.withdrawList.push(obj)
+					})
+				})
+			},
+			withdraw(){
+				if (this.total<=0) {
+					this.$u.toast("兑换金额有误")
+					return
+				}
+				this.$u.api.user.withdraw(this.withdrawList).then(res=>{
+					if (res) {
+						this.$dialog.showModal("兑换成功,请耐心等待1~3个工作日",false).then(res=>{
+							this.fetchList()
+						})
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -51,5 +125,11 @@
 				padding: 7rpx 0;
 			}
 		}
+		
+		.right{
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
 	}
 </style>

+ 10 - 3
pages/activityList/mine/myGift.vue

@@ -100,13 +100,20 @@
 			}
 		},
 		onLoad() {
-			this.userId = uni.getStorageSync("userId") || -1;
-			this.getMineGiftList()
+			this.userId = uni.getStorageSync("userId");
+			this.init()
 		},
 		onShow() {
-			this.getMineGiftList()
+			this.init()
 		},
 		methods: {
+			init(){
+				if (!this.userId) {
+					this.$u.toast('用户未登录')
+					return
+				}
+				this.getMineGiftList()
+			},
 			getMineGiftList(){
 				this.$u.api.goods.getMineGoods({userId:this.userId}).then(res=>{
 					this.giftList=res.records

+ 10 - 3
pages/activityList/mine/myMusic.vue

@@ -73,11 +73,18 @@
 			}
 		},
 		onLoad() {
-			this.userId = uni.getStorageSync("userId") || -1;
-			this.fetchMineData()
-			this.fetchList()
+			this.userId = uni.getStorageSync("userId");
+			this.init()
 		},
 		methods: {
+			init(){
+				if (!this.userId) {
+					this.$u.toast('用户未登录')
+					return
+				}
+				this.fetchMineData()
+				this.fetchList()
+			},
 			fetchList() {
 				this.$u.api.production.list({userId:this.userId}).then(res=>{
 					this.list=res.records

+ 5 - 0
pages/activityList/mine/pointsGoods/comps/item.vue

@@ -75,6 +75,11 @@
 			 * @param {Object} mescroll 上拉回调
 			 */
 			upFn(mescroll) {
+				if (!this.userId) {
+					this.$u.toast('用户未登录')
+					mescroll.endErr();
+					return
+				}
 				let that = this
 				let obj = {
 					userId: this.userId,

BIN
static/songRank/awards.png