Explorar el Código

余额体现改造完成

gcz hace 1 año
padre
commit
16e518e39c
Se han modificado 6 ficheros con 321 adiciones y 19 borrados
  1. 5 0
      common/apiurl.js
  2. 7 0
      pages.json
  3. 2 2
      pages/balance/index.vue
  4. 16 11
      pages/cash/index.vue
  5. 13 6
      pages/cashPrompt/index.vue
  6. 278 0
      pages/distributor/index.vue

+ 5 - 0
common/apiurl.js

@@ -69,6 +69,11 @@ const apiurl = {
 		url: '/member/marketPersons/updatePwd',
 		type: 'post'
 	},
+	// 待提现人员列表
+	distributorList: {
+		url: '/member/marketPersons/withdrawList',
+		type: 'get'
+	},
 	/**
 	 * @author ygh
 	 * @date 2023-12-14

+ 7 - 0
pages.json

@@ -31,6 +31,13 @@
 				"navigationStyle": "custom"
 			}
 		},
+		{
+			"path": "pages/distributor/index",
+			"style": {
+				"navigationBarTitleText": "选择下级分销商",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/balance/index",
 			"style": {

+ 2 - 2
pages/balance/index.vue

@@ -31,7 +31,7 @@
 							</view>
 							<!-- 去提现 -->
 							<view class="balance-userinfo-cash">
-								<view @click="navigateToFun({url: '/pages/cash/index'})">去提现</view>
+								<view @click="navigateToFun({url: '/pages/distributor/index'})">去提现</view>
 							</view>
 						</view>
 					</view>
@@ -122,7 +122,7 @@
 					
 					if(res && res.code ===200) {
 						this.withdrawInfo = res.data
-						this.monry = res.data.brokerageTotal
+						this.monry = res.data.withdrawTotal
 					} 
 				}catch(e){
 					//TODO handle the exception

+ 16 - 11
pages/cash/index.vue

@@ -30,7 +30,7 @@
 									@change="moneyAccountFun"></u--input>
 							</view>
 
-							<text class="cash-content-cash-money-all" @click="cashAll()">全部提现</text>
+							<!-- <text class="cash-content-cash-money-all" @click="cashAll()">全部提现</text> -->
 						</view>
 
 						<view class="cash-content-cash-service">
@@ -40,7 +40,7 @@
 							</view>
 							<view>
 								<text>到账金额</text>
-								<text>{{ moneyAccount }}</text>
+								<text>{{ moneyAccount }}</text>
 							</view>
 						</view>
 
@@ -120,10 +120,13 @@
 				],
 				withdrawInfo: {},
 				showModal: false,
-				password: ''
+				password: '',
+				personList:[]
 			}
 		},
-		onLoad() {
+		onLoad(page) {
+			this.moneyValue = Number(page.withdrawTotal);
+			this.personList = JSON.parse(page.personList);
 			// #ifdef H5
 			//window.addEventListener('popstate', this.browserBack)
 			// #endif
@@ -190,7 +193,8 @@
 						this.withdrawInfo = res.data
 						// this.withdrawInfo.serviceType = 1
 						// this.withdrawInfo.serviceCharge = 0
-						this.monry = res.data.withdrawTotal
+						this.monry = res.data.withdrawTotal;
+						this.moneyAccountFun();
 					}
 				} catch (e) {
 					//TODO handle the exception
@@ -262,14 +266,15 @@
 						noSign: 1,
 						userid: this.distribution_user_info.userId,
 						"withdrawType": "wechat",
-						"withdrawTotal": this.moneyValue,
-						"serviceAmount": 1,
-						"bankId": null
+						"withdrawTotal": this.moneyAccount,
+						"serviceAmount": this.withdrawInfo.serviceCharge,
+						"bankId": null,
+						personList:this.personList
 					})
 
 					if (res && res.code === 200) {
-						navigateTo('pages/cashPrompt/index',{
-							id: res.data.bankInfo.id,
+						navigateTo('/pages/cashPrompt/index',{
+							id: res.data.orderId,
 							// ...res.data.bankInfo,
 							// moneyValue: this.moneyValue,
 							// withdrawType: 'wechat',
@@ -314,7 +319,7 @@
 					let num = isNaN(num1) ? 0 : (Number(num1) / 100)
 					money = num ? this.moneyValue * num : Number(this.moneyValue)
 				}
-				this.moneyAccount = money < 0 ? '金额过小于零' : '¥' + money.toFixed(2)
+				this.moneyAccount = money < 0 ? '金额过小于零' : money.toFixed(2)
 			},
 			browserBack() {
 				console.log(1);

+ 13 - 6
pages/cashPrompt/index.vue

@@ -1,22 +1,23 @@
 <template>
 	<view class="inspage-content" :style="{'--status-bar-': statusBarHeight}">
+		<u-navbar title="提现详情" :placeholder="true" @leftClick="leftClick" :autoBack="false" :safeAreaInsetTop="true" />
 		<view class="inspage-content-info">
 			<!-- 头部主要内容 开始 -->
-			<view class="inspage-content-header">	
+		<!-- 	<view class="inspage-content-header">	
 				<customNavbar 
 				title="提示" 
 				bgColor="var(--gd-bgm-color)"
 				:contentStyle="{ color: '#fff' }"
 				:left-style="{ color: '#fff' }"
 				></customNavbar>
-			</view>
+			</view> -->
 			<!-- 头部主要内容 结束 -->
 			
 			<!-- userInfo内容 开始 -->
 			
 			<view class="inspage-content-userinfo">
 				<text>{{ withdrawStatus(retailStatistics.status) }}</text>
-				<text>¥2000</text>
+				<text>¥{{retailStatistics.withdrawPrice}}</text>
 				<view>
 					<view>
 						<text>服务费</text>
@@ -57,6 +58,12 @@
 			this.orderWithdrawSelectById()
 		},
 		methods: {
+			leftClick(e) {
+				uni.reLaunch({
+					url: '/pages/distributor/index'
+				});
+				console.log('leftClick', e);
+			},
 			/**
 			 * @author ygh
 			 * @data 2023-12-20
@@ -106,9 +113,9 @@
 			withdrawStatus(type){
 				let src = ''
 				switch(type) {
-					case '0': src="正在提现,请耐心等待!"; break;
-					case '1': src="提现成功!"; break;
-					case '2': src="提现失败!"; break;
+					case 0: src="正在提现,请耐心等待!"; break;
+					case 1: src="提现成功!"; break;
+					case 2: src="提现失败!"; break;
 				}
 				return src
 			},

+ 278 - 0
pages/distributor/index.vue

@@ -0,0 +1,278 @@
+<template>
+	<view class="" :style="{'--status-bar-': statusBarHeight}">
+		<u-navbar title="选择下级分销商" :placeholder="true" @leftClick="leftClick" :autoBack="false" :safeAreaInsetTop="true">
+		</u-navbar>
+		<view class="item-list">
+			<!-- <view class="til u-flex u-row-between" :style="{top:navHeight+'px'}">
+				<u-checkbox-group @change="allCheckboxChange">
+					<u-checkbox shape="circle" :checked="allChecked" :name="allCheckbox.name"
+						label="观影人列表"></u-checkbox>
+				</u-checkbox-group>
+			</view> -->
+			<u-checkbox-group placement="column" @change="checkboxChange">
+				<view v-for="(item,index) in dataList" :key="item.id" class="item u-flex">
+					<u-checkbox shape="circle" activeColor="#ED0000" :key="index"
+						:name="item.name" :checked="item.checked" @change="toggleCheck(index)" class="checkbox" />
+					<view class="text u-flex u-row-between" @click="toggleCheck(index)">
+						<view class="name">{{item.name}}</view>
+						<view class="withdrawTotal">可体现余额:<text class="num"> ¥ {{item.withdrawTotal}}</text></view>
+					</view>
+				</view>
+			</u-checkbox-group>
+		</view>
+		<view class="cart-bottom">
+			<view class="inner u-flex u-row-between">
+				<view class="left u-flex">
+					<view class="checkbox" @click="checkboxClick" style="padding: 10px;">
+						<u-checkbox-group @change="allCheckboxChange">
+							<u-checkbox shape="circle" :checked="allChecked" activeColor="#ED0000" :name="allCheckbox.name"
+								label="全选"></u-checkbox>
+						</u-checkbox-group>
+					</view>
+					<view class="total-price-wrap u-flex">
+						<view class="total">共{{selectGoods.length}}人</view>
+						<view class="totalPrice  u-flex">
+							合计: <text class="num"> {{totalPrice}}</text>
+						</view>
+					</view>
+				</view>
+				<view class="btn active" v-if="selectGoods.length>0&&cansubmit" @click="submitorder">确定</view>
+				<view class="btn" v-else>确定</view>
+			</view>
+		</view>
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+<script>
+	// import {
+	// 	systemInfo
+	// } from "@/mixin.js";
+	export default {
+		// mixins: [systemInfo], // 使用mixin
+		data() {
+			return {
+				statusBarHeight: 0, // 状态栏安全距离
+				orderId: '',
+				cansubmit: true,
+				staticUrl: this.$commonConfig.staticUrl,
+				allCheckbox: {
+					name: '全选'
+				},
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#FF3C3F',
+						'padding-left': '10px'
+					}
+				}],
+				// 购物车列表
+				dataList: [],
+			}
+		},
+		computed: {
+			// 是否全选
+			allChecked() {
+				return this.dataList.every(item => item.checked)
+			},
+			selectGoods() {
+				let selectGoods = [];
+				this.dataList.forEach(item => {
+					if (item.checked) {
+						selectGoods.push(item)
+					}
+				})
+				return selectGoods
+			},
+			// 合计价格
+			totalPrice() {
+				let that = this;
+				return this.dataList.reduce((total, item) => {
+					if (item.checked) {
+						let price = null;
+						total += item.withdrawTotal;
+					}
+					return total;
+				}, 0).toFixed(2);
+			}
+		},
+		onLoad(page) {
+			// this.getSystemInfo();
+			this.statusBarHeight = getApp().globalData.statusBarHeight;
+			this.orderId = page.id;
+		},
+		onShow() {
+			this.getViewers();
+		},
+		methods: {
+			leftClick(e) {
+				uni.reLaunch({
+					url: '/pages/main/index'
+				});
+				console.log('leftClick', e);
+			},
+			// 切换全选状态
+			allCheckboxChange(n) {
+				// console.log('allCheckboxChange',n[0]);
+				console.log('allCheckboxChange', n);
+				let selectAll = n[0] ? true : false;
+				this.dataList.forEach(item => {
+					item.checked = selectAll
+				})
+			},
+			checkboxClick() {
+				// console.log('checkboxClick',this.allChecked);
+				this.dataList.forEach(item => {
+					item.checked = !this.allChecked
+				})
+			},
+			checkboxChange(n) {
+				// console.log('checkboxChange',n);
+			},
+			// 切换商品选中状态
+			toggleCheck(index) {
+				// console.log('toggleCheck',index);
+				// if(this.dataList[index].status !== 3){
+				// 	uni.showToast({
+				// 		icon:'none',
+				// 		title:'该状态不能退款',
+				// 		duration:1000
+				// 	})
+				// 	return
+				// }
+				this.dataList[index].checked = !this.dataList[index].checked
+			},
+			submitorder() {
+				let personList = this.selectGoods.map(item=>{
+					return {personsId:item.id,withdrawTotal:item.withdrawTotal}
+				});
+				let params = {
+					withdrawTotal:this.totalPrice,
+					personList:JSON.stringify(personList)
+				};
+				// console.log('selectGoods', this.selectGoods);
+				uni.$u.route('/pages/cash/index', params);
+			},
+			getViewers() {
+				this.$u.api.distributorList({
+					userid: this.distribution_user_info.userId
+				}).then(res => {
+					this.dataList = res.data.list.map(item => {
+						item.checked = false;
+						return {
+							...item,
+							class: {
+							  0: 'status-0',
+							  1: 'status-1',
+							  2: 'status-2',
+							  3: 'status-3',
+							  4: 'status-4',
+							  5: 'status-5',
+							  6: 'status-6',
+							  7: 'status-7',
+							  8: 'status-8'
+							}[item.status] || ''
+						} 
+					})
+				}).catch(err => {
+					console.log('getOrderDetails', err.data);
+				})
+			},
+		}
+	}
+</script>
+<style>
+page {
+	background: #F7F7F9;
+}
+</style>
+<style lang="scss" scoped>
+.u-flex {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+}
+.u-row-between {
+	justify-content: space-between;
+}
+
+.u-row-around {
+	justify-content: space-around;
+}
+.item-list{
+	margin: 28rpx 32rpx 20rpx;
+	.item{
+		background: #FFFFFF;
+		border-radius: 20rpx;
+		padding-left: 18rpx;
+		margin-bottom: 24rpx;
+		.text{
+			margin-left: 20rpx;
+			flex: 1;
+			padding: 30rpx 32rpx;
+			box-shadow: -6rpx 0rpx 20rpx -18rpx rgba(0,0,0,0.5);
+			.name{
+				font-size: 24rpx;
+			}
+			.withdrawTotal{
+				font-size: 24rpx;
+				color: var(--gd-but-color);
+				.num{
+					font-size: 32rpx;
+				}
+			}
+		}
+	}
+}
+	.cart-bottom {
+		position: relative;
+		z-index: 1001;
+		height: 98rpx;
+
+		.inner {
+			position: fixed;
+			background-color: #fff;
+			height: 98rpx;
+			left: 0;
+			right: 0;
+			bottom: 0;
+			padding: 0 20rpx;
+			padding-left: 0;
+
+			.total-price-wrap {
+				margin-left: 30rpx;
+				.totalPrice{
+					font-size: 30rpx;
+					color: #333;
+					font-weight: 400;
+					.num{
+						font-size: 40rpx;
+						font-weight: bold;
+						color: #ED0000;
+						margin-left: 5px;
+					}
+				}
+				.total{
+					font-size: 20rpx;
+					font-weight: 400;
+					color: #999999;
+					margin-right: 16rpx;
+				}
+			}
+
+			.btn {
+				height: 80rpx;
+				line-height: 80rpx;
+				border-radius: 50rpx;
+				padding: 0 50rpx;
+				background-color: #eee;
+				color: #333;
+				text-align: center;
+
+				&.active {
+					background-color: #FF3C3F;
+					color: #fff;
+				}
+			}
+		}
+	}
+</style>