瀏覽代碼

1. 调整提现

MONSTER-ygh 1 年之前
父節點
當前提交
26aff8e33e
共有 3 個文件被更改,包括 511 次插入124 次删除
  1. 11 1
      common/apiurl.js
  2. 55 48
      pages/cash/index.vue
  3. 445 75
      pages/distributor/index.vue

+ 11 - 1
common/apiurl.js

@@ -71,9 +71,19 @@ const apiurl = {
 	},
 	// 待提现人员列表
 	distributorList: {
-		url: '/member/marketPersons/withdrawList',
+		url: '/member/marketPersons/withdrawPageList',
 		type: 'get'
 	},
+	// 获取提现结算信息(新)
+	getSettlement: {
+		url: '/member/marketPersons/getSettlement',
+		type: 'post'
+	}, 
+	// 获取提现结算信息 (新)
+	withdrawApply: {
+		url: '/member/marketPersons/withdrawApply',
+		type: 'post'
+	},
 	/**
 	 * @author ygh
 	 * @date 2023-12-14

+ 55 - 48
pages/cash/index.vue

@@ -8,14 +8,14 @@
 
 				<!--  余额 开始  -->
 				<view class="cash-content-money">
-					<text>可提现余额(元)</text>
+					<!-- <text>可提现余额(元)</text>
 					<view class="cash-content-money-num">
 						<text>
 							<text class="inspage-userinfo-util">¥</text>
 							<u-count-to :decimals="2" :startVal="0" :endVal="monry" color="#fff" />
 							<text class="balance-userinfo-util">元</text>
 						</text>
-					</view>
+					</view> -->
 				</view>
 				<!--  余额 结束  -->
 
@@ -35,23 +35,25 @@
 
 						<view class="cash-content-cash-service">
 							<view>
-								<text>服务费</text>
-								<text>{{ setServiceType(withdrawInfo)}}</text>
+								<text>提现手续费</text>
+								<!-- <text>{{ setServiceType(withdrawInfo)}}</text> -->
+								<text>¥{{ this.withdrawInfo.serviceCharge }}</text>
 							</view>
 							<view>
-								<text>到账金额</text>
-								<text>¥ {{ moneyAccount }}</text>
+								<text>合计提现</text>
+								<!-- <text>¥ {{ moneyAccount }}</text> -->
+								<text>¥{{ this.withdrawInfo.realAmount }}</text>
 							</view>
 						</view>
 
-						<view class="cash-content-cash-card">
+						<!-- <view class="cash-content-cash-card">
 							<u-cell-group :border="false">
 								<u-cell :border="false" title="提现至" :isLink="false" :value="'微信钱包'"
 									@click="openPopup()"></u-cell>
 							</u-cell-group>
-						</view>
+						</view> -->
 
-						<view v-if="withdrawInfo.allowWithdraw == 1 " class="cash-content-cash-submit">
+						<view class="cash-content-cash-submit">
 							<view @click="openModal">提现</view>
 						</view>
 					</view>
@@ -72,7 +74,10 @@
 						<view>提现</view>
 						<view>¥{{ moneyValue }}</view>
 						<view>
-							<u-code-input @finish="marketPersons" v-model="password" :focus="true"></u-code-input>
+							<u-code-input 
+							@finish="marketPersons" 
+							dot
+							v-model="password" :focus="true"></u-code-input>
 						</view>
 						<text @click="clearOverlay"><u-icon name="close-circle" size="30"></u-icon></text>
 					</view>
@@ -95,18 +100,6 @@
 				monry: 0,
 				moneyValue: null,
 				moneyAccount: '',
-				tool: [ // 我的工具
-					{
-						title: "支付设置",
-						icon: this.$commonConfig.staticUrl + 'balance/zhifu.png',
-						url: '/pages/invitationStatistics/index'
-					},
-					{
-						title: "余额提现",
-						icon: this.$commonConfig.staticUrl + 'balance/mingxi.png',
-						url: '/pages/balance/index'
-					},
-				],
 				show: false,
 				columns: [
 					[{
@@ -186,17 +179,24 @@
 			 */
 			async getWithdrawInfo() {
 				try {
-					let res = await this.$u.api.withdrawInfo({
+					let list = []
+					this.personList.forEach((item,index)=> {
+						list.push(item.personsId)
+					})
+					let res = await this.$u.api.getSettlement({
 						noSign: 1,
-						userid: this.distribution_user_info.userId
+						userid: this.distribution_user_info.userId,
+						withdrawAmount: this.moneyValue,
+						withdrawList: list
 					})
 
 					if (res && res.code === 200) {
 						this.withdrawInfo = res.data
 						// this.withdrawInfo.serviceType = 1
 						// this.withdrawInfo.serviceCharge = 0
-						this.monry = res.data.withdrawTotal;
-						this.moneyAccountFun();
+						this.moneyValue = this.withdrawInfo.totalAmount
+						// this.monry = res.data.withdrawTotal;
+						// this.moneyAccountFun();
 					}
 				} catch (e) {
 					//TODO handle the exception
@@ -204,20 +204,20 @@
 				}
 			},
 			openModal() {
-				if (!this.moneyValue || this.moneyValue < this.withdrawInfo.minAmount) {
-					uni.showToast({
-						title: '最小提现金额' + this.withdrawInfo.minAmount,
-						icon: 'none'
-					});
-					return
-				}
-				if(this.moneyValue > this.monry) {
-					uni.showToast({
-						title: '总金额不能大于用户可提现金额',
-						icon: 'none'
-					});
-					return
-				}
+				// if (!this.moneyValue || this.moneyValue < this.withdrawInfo.minAmount) {
+				// 	uni.showToast({
+				// 		title: '最小提现金额' + this.withdrawInfo.minAmount,
+				// 		icon: 'none'
+				// 	});
+				// 	return
+				// }
+				// if(this.moneyValue > this.monry) {
+				// 	uni.showToast({
+				// 		title: '总金额不能大于用户可提现金额',
+				// 		icon: 'none'
+				// 	});
+				// 	return
+				// }
 				// uni.showModal({
 				//   title: '提示',
 				//   content: '确定提现余额吗?',
@@ -264,14 +264,19 @@
 			 */
 			async orderWithdraw() {
 				try {
-					let res = await this.$u.api.orderWithdraw({
+					let list = []
+					this.personList.forEach((item,index)=> {
+						list.push(item.personsId)
+					})
+					let res = await this.$u.api.withdrawApply({
 						noSign: 1,
 						userid: this.distribution_user_info.userId,
-						"withdrawType": "wechat",
-						"withdrawTotal": this.moneyAccount,
-						"serviceAmount": this.withdrawInfo.serviceCharge,
-						"bankId": null,
-						personList:this.personList
+						// "withdrawType": "wechat",
+						// "withdrawTotal": this.moneyAccount,
+						// "serviceAmount": this.withdrawInfo.serviceCharge,
+						// "bankId": null,
+						//personList:this.personList
+						withdrawList: list
 					})
 
 					if (res && res.code === 200) {
@@ -289,11 +294,13 @@
 							title: res.msg,
 							icon: 'none'
 						})
+						this.password = ''
 					}
 					this.showModal = false
 				} catch (e) {
 					//TODO handle the exception
 					console.error("e===", e)
+					this.password = ''
 					this.showModal = false
 					uni.showToast({
 						title: "提交失败",
@@ -362,7 +369,7 @@
 		flex-direction: column;
 		align-items: center;
 		justify-content: center;
-		--header-h: 620rpx;
+		--header-h: 420rpx;
 
 		.cash-content-info {
 			width: 100%;
@@ -486,7 +493,7 @@
 					width: 100%;
 					box-sizing: border-box;
 					padding: 20rpx 0;
-					border-bottom: 2rpx solid #EEEEEE;
+					//border-bottom: 2rpx solid #EEEEEE;
 
 					>view {
 						width: 100%;

+ 445 - 75
pages/distributor/index.vue

@@ -1,26 +1,60 @@
 <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 class="consume-content" :style="{'--status-bar-': statusBarHeight}">
+		<view class="consume-content-info">
+			<!-- 头部主要内容 开始 -->
+			<view class="consume-content-header">
+				<customNavbar title="提现" bgColor="var(--gd-bgm-color)" :customNavbarInfo="{}" :contentStyle="{}"
+					:leftStyle="{color: '#fff'}"></customNavbar>
+				<!--  tab 开始 -->
+				<u-tabs 
+				:list="list1" 
+				@click="clickTabs" 
+				lineColor="var(--gd-bgm-color)"
+				:activeStyle="{ color: 'rgba(127, 127, 127, 1)' }"
+				:inactiveStyle="{ color: 'rgba(127, 127, 127, 1)' }"
+				:scrollable="false"
+				></u-tabs>
+				<!--  tab 结束 -->
+			</view>
+			<!-- 头部主要内容 结束 -->
+			
+			<!--  收支列表 开始  -->
+			<view class="consume-content-list">
+				<customScrollList
+				ref="customScrollList" 
+				@load="load"
+				@paging="paging"
+				@refresh="refresh"
+				 >
+					<view v-if="dataList.length>0" style="width: 100%;padding: 10rpx 30rpx 0;box-sizing: border-box;" class="item-list">
+						<u-checkbox-group placement="column" @change="checkboxChange">
+							<view v-for="(item,index) in dataList" :key="item.id" class="item u-flex">
+								<u-checkbox v-if="serialType==0" shape="circle" activeColor="#ED0000" :key="index"
+									:name="item.name" :checked="item.checked" @change="toggleCheck(index)" class="checkbox" />
+								<view class="item-box">
+									<view class="text u-flex u-row-between text-order">
+										<view class="name">订单号:{{item.orderId}}</view>
+									</view>
+									<view class="text u-flex u-row-between text-title">
+										<view class="name">《{{item.performName}}》</view>
+									</view>
+									<view class="text u-flex u-row-between text-perform">
+										<view class="name">{{item.performDate}} {{item.performTimeStart}}~{{item.performTimeEnd}}</view>
+										<view class="name">{{ item.seatTypeName }}</view>
+									</view>
+									<view class="text u-flex u-row-between">
+										<view class="name">核销数量:{{ item.wipeNum }}</view>
+										<view class="withdrawTotal">获得佣金:<text class="num"> ¥ {{item.totalPrice}}</text></view>
+									</view>
+								</view>
+							</view>
+						</u-checkbox-group>
 					</view>
-				</view>
-			</u-checkbox-group>
+				</customScrollList>
+			</view>
+			<!--  收支列表 结束  -->
 		</view>
-		<view class="cart-bottom">
+		<view class="cart-bottom" v-if="serialType==0">
 			<view class="inner u-flex u-row-between">
 				<view class="left u-flex">
 					<view class="checkbox" @click="checkboxClick" style="padding: 10px;">
@@ -43,15 +77,37 @@
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
+
 <script>
-	// import {
-	// 	systemInfo
-	// } from "@/mixin.js";
+	import {
+		navigateTo
+	} from "@/utils/util.js"
 	export default {
-		// mixins: [systemInfo], // 使用mixin
 		data() {
 			return {
+				title: '提现',
 				statusBarHeight: 0, // 状态栏安全距离
+				monry: 0,
+				moneyValue: null,
+				list1: [
+					{
+						name: '待提现',
+						key: 0,
+					}, 
+					{
+						name: '提现中',
+						key: 3,
+					},
+					{
+						name: '提现成功',
+						key: 1,
+					},
+					{
+						name: '提现失败',
+						key: 2,
+					},
+				],
+				serialType: '',
 				orderId: '',
 				cansubmit: true,
 				staticUrl: this.$commonConfig.staticUrl,
@@ -89,27 +145,154 @@
 				return this.dataList.reduce((total, item) => {
 					if (item.checked) {
 						let price = null;
-						total += item.withdrawTotal;
+						total += item.totalPrice;
 					}
 					return total;
 				}, 0).toFixed(2);
 			}
 		},
 		onLoad(page) {
-			// this.getSystemInfo();
-			this.statusBarHeight = getApp().globalData.statusBarHeight;
 			this.orderId = page.id;
 		},
 		onShow() {
-			this.getViewers();
+			this.statusBarHeight = getApp().globalData.statusBarHeight
+			this.$refs.customScrollList.refresh()
 		},
 		methods: {
-			leftClick(e) {
-				uni.reLaunch({
-					url: '/pages/main/index'
-				});
-				console.log('leftClick', e);
+			/**
+			 * @author ygh
+			 * @data 2023-12-20
+			 */
+			navigateToFun() {
+				navigateTo('/pages/cash/index')
+			},
+			/**
+			 * 选择tabs
+			 */
+			clickTabs(item) {
+				console.log('item', item);
+				if(this.serialType == item.key) return
+				this.serialType = item.key
+				this.dataList = []
+				this.$refs.customScrollList.refresh()
+			},
+			/**
+			 * 获取数据
+			 */
+			async load(paging) {
+				try{
+					this.$refs.customScrollList.showPullUp = true
+					let res = await this.$u.api.distributorList({
+						noSign: 1,
+						userid: this.distribution_user_info.userId,
+						pageNum: 1,
+						pageSize: 10,
+						status: this.serialType
+					})
+					
+					if(res && res.code ===200) {
+						if(res.data.rows){
+							this.dataList = res.data.rows.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] || ''
+								} 
+							})
+						}else {
+							this.dataList = []
+						}
+						this.$refs.customScrollList.loadSuccess({
+							list: this.dataList,
+							total: this.dataList.length
+						})
+					} else {
+						this.$refs.customScrollList.loadSuccess({
+							list: [],
+							total: res.data.total || this.dataList.length
+						})
+					}
+					
+				}catch(e){
+					//TODO handle the exception
+					console.error("e===",e)
+					this.$refs.customScrollList.loadSuccess({
+						list: [],
+						total: this.dataList.length
+					})
+				}
+			},
+			paging(paging){
+				console.log("下拉  加载数据")
 			},
+			/**
+			 * 下拉触底
+			 */
+			async refresh(paging){
+				console.log("上拉  加载数据")
+				//this.$refs.customScrollList.showEmpty = true
+				try{
+					//this.$refs.customScrollList.showPullUp = true
+					let res = await this.$u.api.distributorList({
+						pageNum: paging.page,
+						pageSize: paging.size,
+						userid: this.distribution_user_info.userId,
+						status: this.serialType
+					})
+					if(res && res.code ===200) {
+						if(res.data.rows){
+							this.dataList = [].concat(res.data.rows.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] || ''
+								} 
+							}))
+						}else {
+							this.dataList = []
+						}
+						// this.marketPersonsSerialList = null
+						this.$refs.customScrollList.refreshSuccess({
+							list: this.dataList,
+							total: this.dataList.length
+						})
+					} else {
+						this.$refs.customScrollList.refreshSuccess({
+							list: [],
+							total: res.data.total || this.dataList.length
+						})
+					}
+				}catch(e){
+					//TODO handle the exception
+					console.error("e===",e)
+					this.$refs.customScrollList.refreshSuccess({
+						list: [],
+						total: this.dataList.length
+					})
+				}
+			},
+			
+			/**  选择了提现数据  */
 			// 切换全选状态
 			allCheckboxChange(n) {
 				// console.log('allCheckboxChange',n[0]);
@@ -180,64 +363,251 @@
 		}
 	}
 </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;
-}
+	.consume-content {
+		width: 100%;
+		height: 100%;
+		--header-h: 90rpx;
+
+		.consume-content-info {
+			width: 100%;
+			height: 100%;
+			display: flex;
+			flex-direction: column;
+			box-sizing: border-box;
+		}
+	}
 
-.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{
+	/** 头部主要内容 开始 */
+	.consume-content-header {
+		width: 100%;
+		//height: var(--header-h);
+		box-sizing: border-box;
+		position: relative;
+
+		::v-deep .u-search {
+			padding: 0 30rpx !important;
+		}
+
+		::v-deep .u-search__action {
+			color: #fff !important;
+		}
+
+		/**  余额 开始  */
+		.consume-content-money {
+			width: 100%;
+			box-sizing: border-box;
+			margin-top: 50rpx;
+			padding-left: 66rpx;
+			color: #fff;
+
+			>text {
 				font-size: 24rpx;
 			}
-			.withdrawTotal{
-				font-size: 24rpx;
-				color: var(--gd-but-color);
-				.num{
-					font-size: 32rpx;
+
+			.consume-content-money-num {
+				display: flex;
+				justify-content: center;
+				align-items: flex-start;
+				flex-direction: column;
+				margin-top: 24rpx;
+
+				>text:nth-child(1) {
+					.balance-userinfo-util {
+						font-size: 24rpx;
+						margin-left: 5rpx;
+					}
+
+					::v-deep .u-count-num {
+						font-weight: bold !important;
+						font-size: 48rpx !important;
+					}
+				}
+
+				>text:nth-child(2) {
+					margin-top: 20rpx;
+					font-size: 24rpx;
+				}
+			}
+		}
+
+		/**  余额 结束  */
+
+		/**  提现 开始  */
+		.consume-content-cash {
+			width: 100%;
+			box-sizing: border-box;
+			position: absolute;
+			top: 100%;
+			transform: translateY(-50%);
+			padding: 0 12rpx;
+
+			.consume-content-consume-box {
+				width: 100%;
+				height: 100%;
+				background-color: #fff;
+				box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221, 221, 221, 0.5);
+				border-radius: 20rpx;
+				box-sizing: border-box;
+				padding: 34rpx 30rpx 38rpx;
+
+				>text {
+					font-size: 28rpx;
+					color: #363636;
+				}
+
+				.consume-content-consume-money {
+					width: 100%;
+					display: flex;
+					align-items: center;
+					padding: 40rpx 0 20rpx;
+					border-bottom: 2rpx solid #EEEEEE;
+
+					::v-deep .u-cell__body {
+						padding: 20rpx 0 !important;
+					}
+
+					.consume-content-consume-input {
+						width: 100%;
+						padding: 0 10rpx;
+					}
+
+					>text {
+						flex-shrink: 0;
+						flex-wrap: nowrap;
+						white-space: nowrap;
+					}
+
+					.consume-content-consume-money-icon {
+						font-size: 32rpx;
+					}
+
+					.consume-content-consume-money-all {
+						color: var(--gd-but-color);
+						font-size: 24rpx;
+						cursor: pointer;
+					}
+				}
+
+				.consume-content-consume-card {
+					width: 100%;
+
+					::v-deep .u-cell__body {
+						padding: 20rpx 0 !important;
+					}
+				}
+
+				.consume-content-consume-submit {
+					width: 100%;
+					height: 92rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					box-sizing: border-box;
+					padding: 0 80rpx 0;
+					margin-top: 70rpx;
+
+					>view {
+						width: 100%;
+						height: 100%;
+						border-radius: 46rpx;
+						color: #fff;
+						background-color: var(--gd-but-color);
+						font-size: 28rpx;
+						font-family: SourceHanSansCN, SourceHanSansCN;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
 				}
 			}
 		}
+
+		/**  提现 结束  */
+	}
+
+	/** 头部主要内容 结束  **/
+	
+	/** 收支列表 开始  */
+	.consume-content-list {
+		width: 100%;
+		height: 100%;
+		background: #F7F7F9;
+		// overflow: hidden;
+	}
+	/** 收支列表 结束  */
+	
+	
+	.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{
+		.item{
+			width: 100%;
+			background: #FFFFFF;
+			border-radius: 10rpx;
+			padding-left: 18rpx;
+			margin-bottom: 24rpx;
+			.item-box {
+				width: 100%;
+				box-shadow: -6rpx 0rpx 20rpx -18rpx rgba(0,0,0,0.5);
+				padding: 10rpx 10rpx 15rpx;
+			}
+			
+			.text{
+				flex: 1;
+				color: #999;
+				.name{
+					font-size: 24rpx;
+				}
+				.withdrawTotal{
+					font-size: 24rpx;
+					color: var(--gd-but-color);
+					.num{
+						font-size: 32rpx;
+					}
+				}
+			}
+			.text-order {
+				padding: 10rpx 0;
+				border-bottom: 1px solid rgba(204, 204, 204, 0.5);
+			}
+			.text-title {
+				color: #000;
+				font-weight: 600;
+				padding: 10rpx 0;
+			}
+			.text-perform {
+				padding: 10rpx 0 20rpx;
+			}
+		}
 	}
-}
 	.cart-bottom {
-		position: relative;
+		position: fixed;
 		z-index: 1001;
 		height: 98rpx;
-
+		left: 0;
+		right: 0;
+		bottom: 0;
 		.inner {
-			position: fixed;
 			background-color: #fff;
-			height: 98rpx;
+			height: 100%;
 			left: 0;
 			right: 0;
 			bottom: 0;
 			padding: 0 20rpx;
 			padding-left: 0;
-
+	
 			.total-price-wrap {
 				margin-left: 30rpx;
 				.totalPrice{
@@ -258,7 +628,7 @@ page {
 					margin-right: 16rpx;
 				}
 			}
-
+	
 			.btn {
 				height: 80rpx;
 				line-height: 80rpx;
@@ -267,7 +637,7 @@ page {
 				background-color: #eee;
 				color: #333;
 				text-align: center;
-
+	
 				&.active {
 					background-color: #FF3C3F;
 					color: #fff;