Browse Source

2024-2-19

cmy 1 year ago
parent
commit
437fe891bf
4 changed files with 222 additions and 126 deletions
  1. 3 4
      api/user.js
  2. 101 21
      pages/users/user_order/index.vue
  3. 87 79
      pages/users/user_payment/index.vue
  4. 31 22
      pages/users/user_spread_money/index.vue

+ 3 - 4
api/user.js

@@ -766,8 +766,9 @@ export function getGqList(data) {
 	return request.get('recordList',data);
 }
 
+// 获取员工信息
 export function getStaffInfo(data) {
-	return request.get('member',data);
+	return request.get('getOneMember',data);
 }
 
 //股权提现
@@ -775,13 +776,11 @@ export function equityWithdrawal(data) {
 	return request.post('equityWithdrawal',data);
 }
 
+// 佣金列表
 export function getYjList(data) {
 	return request.get('getPerformanceList',data);
 }
 //阶梯
 export function getJt(data) {
 	return request.get('group_data',data);
-}
-export function getmember(data) {
-	return request.get('member',data);
 }

+ 101 - 21
pages/users/user_order/index.vue

@@ -2,25 +2,58 @@
 	<view class="content">
 		<view class="dyquan-wrap" v-for="(item,index) in list" :key="index">
 			<view class="showtime flex">
-				<text>{{ item.card_name|| '' }}</text>
+				<text class="line2">{{ item.card_name|| '' }}</text>
 				<text class="money">¥{{item.servicecard.card_price}}</text>
 			</view>
 			<view class="item-info" v-for="good in item.card" @click="goGoods(good)">
-				<image class="tip" :src="good.product.image" mode=""></image>
-				<view class="info-info">
+				<view class="img-box">
+					<image class="tip" :src="good.product.image" mode=""></image>
+					<view class="good-type" v-if="good.type==2">
+						月卡
+					</view>
+				</view>
+				<view class="info-info" v-if="good.type==1">
+					<view class="line2">
+						{{good.product.store_name || ''}}
+					</view>
+					<view class="info-cs">
+						<view>
+							原价:{{good.product.price|| ''}}
+						</view>
+					</view>
+					<view class="info-cs">
+						<view>
+							剩余:{{good.repertory || 0}}次
+						</view>
+					</view>
+				</view>
+				<view class="info-info" v-if="good.type==2">
 					<view class="line2">
 						{{good.product.store_name || ''}}
 					</view>
-					<view class="info-cs clamp2">
-						原价:{{good.product.price|| ''}}
+					<view class="info-cs">
+						<view>
+							原价:{{good.product.price|| ''}}
+						</view>
+						<view>
+							剩余:{{good.repertory || 0}}次
+						</view>
 					</view>
 					<view class="info-cs">
-						剩余使用次数:{{good.repertory || 0}}
+						<view>
+							{{good.end_time_text}}继续得{{good.month_repertory}}次
+						</view>
+						<view>
+							{{good.card_end_time_text}}到期
+						</view>
 					</view>
 				</view>
 			</view>
+			<view class="good-time">
+				购买时间:{{item.update_time}}
+			</view>
 		</view>
-		
+
 		<view v-if="list.length == 0 && loadingType=='nomore'">
 			<emptyPage title="暂无订单信息~"></emptyPage>
 		</view>
@@ -28,7 +61,9 @@
 </template>
 
 <script>
-	import { getMyServeList} from "@/api/user.js";
+	import {
+		getMyServeList
+	} from "@/api/user.js";
 	import emptyPage from '@/components/emptyPage.vue';
 	export default {
 		components: {
@@ -59,12 +94,16 @@
 			goGoods(item) {
 				console.log(item)
 				uni.navigateTo({
-					url:'/pages/goods_details/index?id=' + item.product_id
+					url: '/pages/goods_details/index?id=' + item.product_id
 				})
 			},
 			tabClick(item, index) {
 				this.tabCurrentIndex = index;
 			},
+			// 获取时间字符串
+			getTimeText(res) {
+				return (new Date(res*1000)).toLocaleString().split(" ")[0];
+			},
 			getList(type) {
 				let that = this
 				if (type == 'reload') {
@@ -86,7 +125,21 @@
 				}).then(({
 					data
 				}) => {
-					that.list = that.list.concat(data.list)
+					let ar = data.list.map(
+						(res) => {
+							for (let i = 0; i < res.card.length; i++) {
+								const car = res.card[i];
+								if(car.type==2){
+									car.card_end_time_text  = that.getTimeText(car.card_end_time);
+									car.card_start_time_text  = that.getTimeText(car.card_start_time);
+									car.end_time_text  = that.getTimeText(car.end_time);
+									car.start_time_text  = that.getTimeText(car.start_time);
+								}
+							}
+							return res
+						}
+					)
+					that.list = that.list.concat(ar)
 					that.page++
 					if (data.length == that.pageSize) {
 						that.loadingType = 'more'
@@ -102,41 +155,64 @@
 
 <style lang="scss">
 	.content {
-		background-color:#f8f6f6 ;
+		background-color: #f8f6f6;
 		height: auto;
 		min-height: 100%;
 		padding-top: 30rpx;
-		
+
 	}
+
 	.dyquan-wrap {
 		padding: 30rpx;
 		background-color: #fff;
 		margin: 0 30rpx;
 		margin-bottom: 30rpx;
 		border-radius: 20rpx;
+		.good-time{
+			margin-top: 20rpx;
+			color:#999999;
+			font-size: $uni-font-size-sm;
+		}
 		.showtime {
 			padding-bottom: 20rpx;
 			border-bottom: 1px solid #f8f6f6;
 			font-size: 30rpx;
 			font-weight: bold;
 			justify-content: space-between;
-			.money{
+
+			.money {
 				flex-shrink: 0;
 				color: $uni-color-warning;
 			}
 		}
+
 		.item-info {
 			display: flex;
 			justify-content: flex-start;
 			align-items: stretch;
 			padding-top: 20rpx;
-			.tip {
-				width: 160rpx;
-				height: 160rpx;
-				margin-right: 20rpx;
-				border-radius: 10rpx;
-				flex-shrink: 0;
+			.img-box{
+				position: relative;
+				.good-type{
+					position: absolute;
+					top: 0;
+					left: 0;
+					background-color: $uni-color-error;
+					padding: 5rpx 20rpx;
+					font-size: 20rpx;
+					border-top-left-radius: 20rpx;
+					border-bottom-right-radius: 20rpx;
+					color: rgba(255, 255, 255, 0.7);
+				}
+				.tip {
+					width: 160rpx;
+					height: 160rpx;
+					margin-right: 20rpx;
+					border-radius: 20rpx;
+					flex-shrink: 0;
+				}
 			}
+			
 
 			.info-info {
 				font-size: 30rpx;
@@ -145,8 +221,12 @@
 				display: flex;
 				flex-direction: column;
 				justify-content: space-between;
-				align-items: flex-start;
+				align-items: stretch;
+				flex-grow: 1;
+
 				.info-cs {
+					display: flex;
+					justify-content: space-between;
 					font-size: 26rpx;
 					font-weight: 500;
 					color: #999999;
@@ -154,4 +234,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 87 - 79
pages/users/user_payment/index.vue

@@ -10,7 +10,7 @@
 			<view class="payment-top acea-row row-column row-center-wrapper" v-else>
 				<span class="name">我的股权</span>
 				<view class="pic">
-					<span class="pic-font">{{ staffInfo.shareholding || 0 }}</span>
+					<span class="pic-font">{{ staffInfo.shareholding*1 || 0 }}</span>
 				</view>
 			</view>
 			<view class="payment">
@@ -18,66 +18,75 @@
 					<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index"
 						@click="navRecharges(index)">{{item}}</view>
 				</view>
-					<view class='tip picList' v-if='!active'>
-						<view class="pic-box pic-box-color acea-row row-center-wrapper row-column"
-							:class="activePic == index ? 'pic-box-color-active' : ''" v-for="(item, index) in picList"
-							:key="index" @click="picCharge(index, item)" v-if="item.price">
-							<view class="pic-number-pic">
-								{{ item.price }}<span class="pic-number"> 元</span>
-							</view>
-							<view class="pic-number">赠送:{{ item.give_money }} 元</view>
+				<view class='tip picList' v-if='!active'>
+					<view class="pic-box pic-box-color acea-row row-center-wrapper row-column"
+						:class="activePic == index ? 'pic-box-color-active' : ''" v-for="(item, index) in picList"
+						:key="index" @click="picCharge(index, item)" v-if="item.price">
+						<view class="pic-number-pic">
+							{{ item.price }}<span class="pic-number"> 元</span>
 						</view>
-						<view class="pic-box pic-box-color acea-row row-center-wrapper"
-							:class="activePic == picList.length ? 'pic-box-color-active' : ''"
-							@click="picCharge(picList.length)">
-							<input type="digit" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic"
-								:class="activePic == picList.length ? 'pic-box-color-active' : ''" />
+						<view class="pic-number">赠送:{{ item.give_money }} 元</view>
+					</view>
+					<view class="pic-box pic-box-color acea-row row-center-wrapper"
+						:class="activePic == picList.length ? 'pic-box-color-active' : ''"
+						@click="picCharge(picList.length)">
+						<input type="digit" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic"
+							:class="activePic == picList.length ? 'pic-box-color-active' : ''" />
+					</view>
+
+					<view class="flex share-user">
+						<view class="title">
+							邀请人:
 						</view>
-					
-						<view class="flex share-user">
-							<view class="title">
-								邀请人:
-							</view>
-							<view class="input-box">
-								<input type="text" placeholder="请输入邀请人会员码" v-model="verify_code" class="input-user" />
-							</view>
-							<!-- #ifdef H5 -->
-							<view class="iconfont icon-saoma" @click="scanCode"></view>
-							<!-- #endif -->
-							<!-- #ifdef MP || MP-WEIXIN || APP -->
-							<view class="iconfont icon-saoma" @click="scanCode">
-							</view>
-							<!-- #endif -->
+						<view class="input-box">
+							<input type="text" placeholder="请输入邀请人会员码" v-model="verify_code" class="input-user" />
 						</view>
-						<view class="tips-box">
-							<view class="tips mt-30">注意事项:</view>
-							<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
-								{{ item }}
-							</view>
+						<!-- #ifdef H5 -->
+						<view class="iconfont icon-saoma" @click="scanCode"></view>
+						<!-- #endif -->
+						<!-- #ifdef MP || MP-WEIXIN || APP -->
+						<view class="iconfont icon-saoma" @click="scanCode">
+						</view>
+						<!-- #endif -->
+					</view>
+					<view class="tips-box">
+						<view class="tips mt-30">注意事项:</view>
+						<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
+							{{ item }}
 						</view>
 					</view>
-					<view class="tip" v-else>
-						<view class='input' v-if="is_gq != 1"><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
-								placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
-								name="number"></input></view>
-						<view class='input' v-else><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
-								placeholder="0" type='number' placeholder-class='placeholder' :value="number"
-								name="number"></input></view>
-						<view class="tips-title" v-if="is_gq != 1">
-							<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
-							<view style="margin-top: 10rpx;">当前可转入佣金为 <text
-									class='font-color'>¥{{userinfo.commissionCount || 0}}</text>,冻结佣金为<text
-									class='font-color'>¥{{userinfo.broken_commission}}</text></view>
+				</view>
+				<view class="tip" v-else>
+					<view class='input' v-if="is_gq != 1">
+						<text>¥</text>
+						<input @input='inputNum'
+							:maxlength="moneyMaxLeng" placeholder="0.00" type='digit' placeholder-class='placeholder'
+							:value="number" name="number"></input>
+					</view>
+					<view class='input' v-else>
+						<input @input='inputNum' :maxlength="moneyMaxLeng"
+							placeholder="0" type='number' placeholder-class='placeholder' :value="number"
+							name="number"></input>
+						<text>股</text>
+					</view>
+					<view class="tips-title" v-if="is_gq != 1">
+						<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
+						<view style="margin-top: 10rpx;">
+							当前可转入佣金为 
+							<text class='font-color'>¥{{userinfo.commissionCount || 0}}</text>,
+							冻结佣金为
+							<text class='font-color'>¥{{userinfo.broken_commission}}</text>
 						</view>
-						<view class="tips-box" v-if="is_gq != 1">
-							<view class="tips mt-30">注意事项:</view>
-							<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
-								{{ item }}
-							</view>
+					</view>
+					<view class="tips-box" v-if="is_gq != 1">
+						<view class="tips mt-30">注意事项:</view>
+						<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
+							{{ item }}
 						</view>
 					</view>
-					<button class='but bg-color' formType="submit" v-if="is_gq != 1"> {{active ? '立即转入': '立即充值' }}</button>
-					<button class='but bg-color' formType="submit" v-else>提现</button>
+				</view>
+				<button class='but bg-color' formType="submit" v-if="is_gq != 1"> {{active ? '立即转入': '立即充值' }}</button>
+				<button class='but bg-color' formType="submit" v-else>提现</button>
 			</view>
 		</form>
 		<payment :payMode="payMode" :pay_close="pay_close" :is-call="true" @changePayType="changePayType"
@@ -133,7 +142,7 @@
 				number: '',
 				userinfo: {},
 				placeholder: "0.00",
-				verify_code:'',//邀请会员码
+				verify_code: '', //邀请会员码
 				from: '',
 				isAuto: false, //没有授权的不会自动授权
 				isShowAuth: false, //是否隐藏授权
@@ -199,7 +208,7 @@
 			} else {
 				toLogin();
 			}
-			if(options.is_gq) {
+			if (options.is_gq) {
 				this.is_gq = options.is_gq
 				this.active = 1
 			}
@@ -228,8 +237,8 @@
 					scanType: ["qrCode", "barCode"]
 				}).then(res => {
 					let result = res.resultStr;
-					if(result.includes(',')){
-						 result = result.split(",")[1]
+					if (result.includes(',')) {
+						result = result.split(",")[1]
 					}
 					this.verify_code = result
 				});
@@ -322,22 +331,17 @@
 				let that = this;
 				getUserInfo().then(res => {
 					that.$set(that, 'userinfo', res.data);
-					if(that.is_gq == 1) {
+					if (that.is_gq == 1) {
 						that.getStaffInfo()
 					}
 				})
 			},
 			getStaffInfo() {
-				let that =this
+				let that = this
 				getStaffInfo({
 					uid: that.userinfo.uid
 				}).then(res => {
-					// that.staffInfo = res.data.list[0]
-					res.data.list.forEach(item => {
-						if(item.uid == that.userinfo.uid) {
-							that.staffInfo = item
-						}
-					})
+					that.staffInfo = res.data;
 				})
 			},
 			changePayType: function(e) {
@@ -390,7 +394,7 @@
 					type: 0,
 					rechar_id: this.rechar_id,
 					from: this.payType === 'alipay' ? 'alipay' : 'routine',
-					bar_code:this.verify_code
+					bar_code: this.verify_code
 				}).then(res => {
 					uni.hideLoading();
 					let data = res.data.data;
@@ -451,7 +455,7 @@
 					// from: this.payType == '' ? this.$wechat.isWeixin() ? 'weixin' :'weixinh5' : this.payType,
 					from: this.payType,
 					rechar_id: that.rechar_id,
-					bar_code:that.verify_code
+					bar_code: that.verify_code
 				}).then(res => {
 					let data = res.data;
 					if (data.type == "weixinh5") {
@@ -500,25 +504,25 @@
 			submitSub: function(e) {
 				let that = this
 				let value = e.detail.value.number;
-				if(that.is_gq == 1) {
+				if (that.is_gq == 1) {
 					console.log(value)
 					if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
 						return that.$util.Tips({
 							title: '请输入金额'
 						});
 					}
-					if(parseFloat(value)%1 !== 0) {
+					if (parseFloat(value) % 1 !== 0) {
 						return that.$util.Tips({
 							title: '请输入整数'
 						});
 					}
-					if(parseFloat(value) >parseFloat(that.staffInfo.shareholding)) {
+					if (parseFloat(value) > parseFloat(that.staffInfo.shareholding)) {
 						return that.$util.Tips({
 							title: '您当前的股权不足'
 						});
 					}
 					equityWithdrawal({
-						shareholding:value,
+						shareholding: value,
 						uid: that.userinfo.uid
 					}).then(res => {
 						that.$util.Tips({
@@ -527,7 +531,7 @@
 						})
 						that.getStaffInfo()
 					})
-				}else {
+				} else {
 					// 转入余额
 					if (that.active) {
 						if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
@@ -535,7 +539,7 @@
 								title: '请输入金额'
 							});
 						}
-						
+
 						uni.showModal({
 							title: '转入余额',
 							content: '转入余额后无法再次转出,确认是否转入余额',
@@ -545,7 +549,7 @@
 									rechargeRoutine({
 										price: parseFloat(value),
 										type: 1,
-										bar_code:that.verify_code
+										bar_code: that.verify_code
 									})
 									// #endif
 									// #ifdef H5
@@ -553,7 +557,7 @@
 											price: parseFloat(value),
 											from: that.from,
 											type: 1,
-											bar_code:that.verify_code
+											bar_code: that.verify_code
 										})
 										// #endif
 										.then(res => {
@@ -587,7 +591,7 @@
 						this.totalPrice = this.rechar_id == 0 ? parseFloat(this.money) : parseFloat(this.numberPic);
 					}
 				}
-				
+
 			}
 		}
 	}
@@ -620,20 +624,24 @@
 			border-bottom: 1px solid #f3f3f3;
 			padding-top: 20rpx;
 			padding-bottom: 10rpx;
-			.iconfont{
-				&.icon-saoma{
+
+			.iconfont {
+				&.icon-saoma {
 					font-size: 50rpx;
 				}
 			}
+
 			.title {
 				font-size: 30rpx;
 				color: #656565;
 				font-weight: 800;
 				flex-shrink: 0;
 			}
+
 			.input-box {
 				flex-grow: 1;
-				.input-user{
+
+				.input-user {
 					width: 100%;
 					height: 50rpx;
 					font-size: 28rpx;

+ 31 - 22
pages/users/user_spread_money/index.vue

@@ -40,10 +40,12 @@
 					当前完成预约订单:{{staffInfo.service_count || 0}}
 				</view>
 				<view class="top_num top_num_2" v-if="recordType == 5">
-					当前股权:{{staffInfo.shareholding}}
-					<view class="tx" @click="navto('/pages/users/user_payment/index?is_gq=1')">
-						提现
-					</view>
+					<text>
+						当前股权:{{staffInfo.shareholding*1}}
+					</text>
+					<text>
+					 总股权:{{staffInfo.total_shareholding}}
+					 </text>
 				</view>
 				<view class="box" v-if="recordType !=7">
 					<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
@@ -101,10 +103,10 @@
 											</view>
 											<view>
 												<view>
-												1. 奖励{{item.shareholding}}股权
+													1. 奖励{{item.shareholding}}股权
 												</view>
 												<view>
-												2. 提升{{item.ratio}}%提成比
+													2. 提升{{item.ratio}}%提成比
 												</view>
 											</view>
 										</view>
@@ -124,6 +126,12 @@
 				</view>
 			</view>
 		</view>
+		<view style="height: 120rpx;"  v-if="recordType == 5">
+			
+		</view>
+		<view class="tx" @click="navto('/pages/users/user_payment/index?is_gq=1')"  v-if="recordType == 5">
+			立即提现
+		</view>
 		<home v-if="navigation"></home>
 		<!-- #ifdef MP -->
 		<!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
@@ -227,15 +235,13 @@
 				});
 				this.recordType = 5;
 				this.name = '股权明细';
-
-				this.getStaffInfo()
+				this.getStaffInfo();
 			} else if (type == 6) {
 				uni.setNavigationBarTitle({
 					title: "业绩记录"
 				});
 				this.recordType = 6;
 				this.name = '业绩明细';
-
 				this.getStaffInfo()
 				// this.getYjList()
 			} else if (type == 7) {
@@ -279,7 +285,6 @@
 					page: 1,
 					limit: 100
 				}).then(res => {
-					console.log(res)
 					this.recordList = res.data.list
 				})
 			},
@@ -448,12 +453,7 @@
 					getStaffInfo({
 						uid: res.data.uid
 					}).then(ress => {
-
-						ress.data.list.forEach(item => {
-							if (item.uid == res.data.uid) {
-								that.staffInfo = item
-							}
-						})
+						that.staffInfo = ress.data;
 						if (that.recordType == 6) {
 							that.getYjList()
 						}
@@ -576,7 +576,7 @@
 	}
 
 	.sign-record {
-		margin-top: 20rpx;
+		// margin-top: 20rpx;
 	}
 
 	.commission-details {
@@ -595,21 +595,29 @@
 	}
 
 	.top_num {
-		padding: 10rpx 30rpx 30rpx 30rpx;
+		padding: 30rpx;
 		font-size: 26rpx;
 		color: #666;
 	}
 
 	.top_num_2 {
 		display: flex;
-		justify-content: space-between;
+		justify-content: space-around;
+		position: sticky;
+		top: 0;
+		background-color: rgba(245, 245, 245, 1);
 	}
 
 	.tx {
-		padding: 5rpx 15rpx;
 		background-color: #1890FF;
 		color: #fff;
-		border-radius: 10rpx;
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: $uni-font-size-lg;
 	}
 
 	.radius15 {
@@ -628,7 +636,8 @@
 						.flex-g {
 							flex-grow: 1;
 							padding-right: 30rpx;
-							.status{
+
+							.status {
 								font-size: 28rpx;
 							}
 						}