Bladeren bron

2021-11-3

hwq 3 jaren geleden
bovenliggende
commit
ef3fa898f6

+ 1 - 1
pages.json

@@ -430,7 +430,7 @@
 		{
 			"path": "pages/money/integralShopping",
 			"style": {
-				"navigationBarTitleText": "我的购物积分",
+				"navigationBarTitleText": "货款",
 				"app-plus": {
 					"titleNView": false
 				}

+ 41 - 2
pages/conversion/candy.vue

@@ -18,18 +18,57 @@
 		<view class="code">
 			
 		</view>
-		<view class="btn">
+		<view class="btn" @click="buy()">
 			提交申请
 		</view>
 	</view>
 </template>
 
 <script>
+import { wallet } from '@/api/finance.js';
 export default {
 	data(){
 		return{
-			money: 1000,
+			money: 0,
 			withdrawal:'',
+			buying: false,
+		}
+	},
+	onLoad() {
+		wallet({}).then(({ data }) => {
+			const obj = this
+			const arr = Object.keys(data.back);
+			arr.forEach(e => {
+				if(e == 'USDC'){
+					obj.money = (data.back[e].money.money*1)
+				}
+			});
+		});
+	},
+	methods:{
+		all(){
+			this.withdrawal = this.money
+		},
+		buy(){
+			if (this.buying) {
+			
+			} else {
+				this.buying = true
+				shan({
+					origin_money_type: this.moneyType[this.index].name,
+					money_type: this.add.name,
+					num: this.pushMoney,
+				}).then(({
+					data
+				}) => {
+					console.log(data)
+					this.buying = false
+					this.$api.msg("闪兑成功")
+				}).catch(e => {
+					this.buying = false
+					console.log(e)
+				})
+			}
 		}
 	}
 }

+ 14 - 1
pages/conversion/transfers.vue

@@ -19,13 +19,26 @@
 </template>
 
 <script>
+import { moneyLog, recharge, wallet } from '@/api/finance.js';
 export default {
 	data() {
 		return {
-			jf: 360, //可转账购物积分
+			jf: 0, //可转账购物积分
 			uid: '', //收款人账户
 			num: '' //转账数量
 		};
+	},
+	onLoad() {
+		wallet({}).then(({ data }) => {
+			const obj = this
+			const arr = Object.keys(data.back);
+			console.log(arr);
+			arr.forEach(e => {
+				if(e == 'USDC'){
+					obj.jf = (data.back[e].money.money*1)
+				}
+			});
+		});
 	}
 };
 </script>

+ 22 - 14
pages/money/award.vue

@@ -8,7 +8,7 @@
 			</view>
 			<view class="content-bg"><image src="../../static/img/user-award.png" mode=""></image></view>
 			<view class="money-box">
-				<view class="money">100</view>
+				<view class="money">{{ money || 0 }}</view>
 			</view>
 		</view>
 		<view class="navbar">
@@ -31,7 +31,7 @@
 							</view>
 						</view>
 						<view class="money">
-							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
+							<text>{{ (item.pm == 0 ? '-' : '+') + item.number * 1 }}</text>
 						</view>
 					</view>
 					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
@@ -45,7 +45,7 @@
 </template>
 
 <script>
-import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { moneyLog, recharge, wallet } from '@/api/finance.js';
 import { mapState, mapMutations } from 'vuex';
 import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
 import empty from '@/uview-ui/components/u-empty/u-empty.vue';
@@ -75,7 +75,7 @@ export default {
 			tabCurrentIndex: 0,
 			navList: [
 				{
-					state: 0,
+					state: 1,
 					text: '收入',
 					loadingType: 'more',
 					orderList: [],
@@ -83,7 +83,7 @@ export default {
 					limit: 10 //每次信息条数
 				},
 				{
-					state: 1,
+					state: 0,
 					text: '支出',
 					loadingType: 'more',
 					orderList: [],
@@ -96,11 +96,18 @@ export default {
 	},
 	onLoad(options) {},
 	onShow() {
+		wallet({}).then(({ data }) => {
+			const obj = this
+			const arr = Object.keys(data.back);
+			console.log(arr);
+			arr.forEach(e => {
+				if(e == 'LALA'){
+					obj.money = (data.back[e].money.money*1).toFixed(0)
+				}
+			});
+		});
 		this.loadData();
 		//获取用户余额
-		userBalance({}).then(({ data }) => {
-			this.money = data.commissionCount;
-		});
 	},
 	methods: {
 		navto(e) {
@@ -130,16 +137,17 @@ export default {
 			//修改当前对象状态为加载中
 			navItem.loadingType = 'loading';
 
-			spreadCommission(
+			moneyLog(
 				{
 					page: navItem.page,
-					limit: navItem.limit
-				},
-				state
+					limit: navItem.limit,
+					pm:navItem.state
+				},'LALA'
 			)
 				.then(({ data }) => {
-					if (data.length > 0) {
-						navItem.orderList = navItem.orderList.concat(data[0].list);
+					console.log(data)
+					if (data.list.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data.list);
 						console.log(navItem.orderList);
 						navItem.page++;
 					}

+ 21 - 14
pages/money/integralP.vue

@@ -7,7 +7,7 @@
 				<view class="header">我的拼团积分</view>
 			</view>
 			<view class="content-bg"><image src="../../static/img/user-integralP.png" mode=""></image></view>
-			<view class="money-box"><view class="money">100</view></view>
+			<view class="money-box"><view class="money">{{ integral || 0 }}</view></view>
 			<view class="rule" @click="open()">转赠规则</view>
 		</view>
 		<view class="btn flex">
@@ -61,7 +61,7 @@
 </template>
 
 <script>
-import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { moneyLog, recharge, wallet } from '@/api/finance.js';
 import { mapState, mapMutations } from 'vuex';
 import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
 import empty from '@/uview-ui/components/u-empty/u-empty.vue';
@@ -88,12 +88,13 @@ export default {
 	},
 	data() {
 		return {
+			integral: 0,//我的积分
 			// 头部图高度
 			maxheight: '',
 			tabCurrentIndex: 0,
 			navList: [
 				{
-					state: 0,
+					state: 1,
 					text: '收入',
 					loadingType: 'more',
 					orderList: [],
@@ -101,7 +102,7 @@ export default {
 					limit: 10 //每次信息条数
 				},
 				{
-					state: 1,
+					state: 0,
 					text: '支出',
 					loadingType: 'more',
 					orderList: [],
@@ -109,16 +110,21 @@ export default {
 					limit: 10 //每次信息条数
 				}
 			],
-			money: 0,
 		};
 	},
 	onLoad(options) {},
 	onShow() {
-		this.loadData();
-		//获取用户余额
-		userBalance({}).then(({ data }) => {
-			this.money = data.commissionCount;
+		wallet({}).then(({ data }) => {
+			const obj = this
+			const arr = Object.keys(data.back);
+			console.log(arr);
+			arr.forEach(e => {
+				if(e == 'USDC'){
+					obj.integral = (data.back[e].money.money*1)
+				}
+			});
 		});
+		this.loadData();
 	},
 	methods: {
 		navto(e) {
@@ -146,16 +152,17 @@ export default {
 			//修改当前对象状态为加载中
 			navItem.loadingType = 'loading';
 
-			spreadCommission(
+			moneyLog(
 				{
 					page: navItem.page,
-					limit: navItem.limit
+					limit: navItem.limit,
+					pm:navItem.state
 				},
-				state
+				'USDC'
 			)
 				.then(({ data }) => {
-					if (data.length > 0) {
-						navItem.orderList = navItem.orderList.concat(data[0].list);
+					if (data.list.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data.list);
 						console.log(navItem.orderList);
 						navItem.page++;
 					}

+ 2 - 2
pages/money/integralShopping.vue

@@ -4,7 +4,7 @@
 		<view class="content-money">
 			<view class="body-title">
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
-				<view class="header">我的拼团积分</view>
+				<view class="header">货款</view>
 			</view>
 			<view class="content-bg"><image src="../../static/img/user-integralP.png" mode=""></image></view>
 			<view class="money-box"><view class="money">100</view></view>
@@ -12,7 +12,7 @@
 		</view>
 		<view class="btn flex">
 			<view class="btn-item" @click="navto('/pages/conversion/candy')">转换为糖果</view>
-			<view class="btn-item" @click="navto('/pages/conversion/transfers')">积分转赠</view>
+			<view class="btn-item" @click="navto('/pages/conversion/transfers')">货款转赠</view>
 		</view>
 		<view class="navbar">
 			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>

+ 5 - 1
pages/money/wallet.vue

@@ -8,7 +8,7 @@
 			</view>
 			<view class="content-bg"><image src="../../static/img/user-award.png" mode=""></image></view>
 			<view class="money-box">
-				<view class="money"><text>¥</text>100</view>
+				<view class="money"><text>¥</text>{{userInfo.brokerage_price}}</view>
 			</view>
 		</view>
 		<view class="navbar">
@@ -47,12 +47,16 @@
 <script>
 import { spreadCommission, userBalance } from '@/api/wallet.js';
 import { getMoneyStyle } from '@/utils/rocessor.js';
+import { mapState, mapMutations } from 'vuex';
 import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
 import empty from '@/uview-ui/components/u-empty/u-empty.vue';
 export default {
 	filters: {
 		getMoneyStyle
 	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
 	components: {
 		empty,
 		uniLoadMore

+ 33 - 19
pages/user/user.vue

@@ -11,7 +11,7 @@
 					<view class="name">{{ userInfo.nickname }}</view>
 					<view class="phone">{{ userInfo.phone }}</view>
 					<view class="vip-box">
-						<view class="vip">会员等级LV.5</view>
+						<view class="vip">会员等级LV.{{ userInfo.level }}</view>
 						<view class="pintuan">拼团等级LV.2</view>
 					</view>
 				</view>
@@ -20,22 +20,22 @@
 		<view class="box">
 			<view class="sweets-box">
 				<view class="sweets" @click="nav('/pages/money/award')">
-					<view class="limit">111</view>
+					<view class="limit">{{ candy || 0 }}</view>
 					<view class="sweets-name">糖果</view>
 				</view>
 				<view class="jiange"></view>
 				<view class="sweets" @click="nav('/pages/money/integralP')">
-					<view class="limit">111</view>
+					<view class="limit">{{ jf || 0 }}</view>
 					<view class="sweets-name">拼团积分</view>
 				</view>
 				<view class="jiange"></view>
 				<view class="sweets" @click="nav('/pages/money/integralShopping')">
-					<view class="limit">111</view>
-					<view class="sweets-name">购物积分</view>
+					<view class="limit">{{ userInfo.now_money*1 }}</view>
+					<view class="sweets-name">货款</view>
 				</view>
 				<view class="jiange"></view>
 				<view class="sweets" @click="nav('/pages/money/wallet')">
-					<view class="limit">111</view>
+					<view class="limit">{{userInfo.brokerage_price * 1}}</view>
 					<view class="sweets-name">佣金</view>
 				</view>
 			</view>
@@ -46,21 +46,15 @@
 				</view>
 				<view class="order-section">
 					<view class="order-item" @click="nav('/pages/order/order?state=0')" hover-class="common-hover" :hover-stay-time="50">
-						<view class=" icon1 position-relative">
-							<image class="icon-img" src="/static/user/user01.png" mode="aspectFit"></image>
-						</view>
+						<view class=" icon1 position-relative"><image class="icon-img" src="/static/user/user01.png" mode="aspectFit"></image></view>
 						<text>待付款</text>
 					</view>
 					<view class="order-item" @click="nav('/pages/order/order?state=1')" hover-class="common-hover" :hover-stay-time="50">
-						<view class="icon1 position-relative">
-							<image class="icon-img" src="/static/user/user02.png" mode="aspectFit"></image>
-						</view>
+						<view class="icon1 position-relative"><image class="icon-img" src="/static/user/user02.png" mode="aspectFit"></image></view>
 						<text>待发货</text>
 					</view>
 					<view class="order-item" @click="nav('/pages/order/order?state=2')" hover-class="common-hover" :hover-stay-time="50">
-						<view class="icon1 position-relative">
-							<image class="icon-img" src="/static/user/user03.png" mode="aspectFit"></image>
-						</view>
+						<view class="icon1 position-relative"><image class="icon-img" src="/static/user/user03.png" mode="aspectFit"></image></view>
 						<text>待收货</text>
 					</view>
 					<view class="order-item" @click="nav('/pages/order/order?state=4')" hover-class="common-hover" :hover-stay-time="50">
@@ -157,6 +151,7 @@
 	</view>
 </template>
 <script>
+import { wallet } from '@/api/finance.js';
 import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
 import { mapState, mapMutations } from 'vuex';
 import uniList from '@/components/uni-list/uni-list.vue';
@@ -173,7 +168,10 @@ export default {
 	data() {
 		return {
 			erweima: '',
-			weixin: ''
+			weixin: '',
+			wallet: '',
+			candy:'',//糖果数量
+			jf:'',//拼团积分
 		};
 	},
 	onShow() {
@@ -209,6 +207,22 @@ export default {
 				this.erweima = data.service_qr;
 				this.weixin = data.service_wechat;
 			});
+			wallet({}).then(({ data }) => {
+				const obj = this
+				const arr = Object.keys(data.back);
+				console.log(arr);
+				let ar = [];
+				arr.forEach(e => {
+					console.log(e,'11111')
+					if(e == 'LALA'){
+						obj.candy = (data.back[e].money.money*1).toFixed(0)
+					}
+					if(e == 'USDC'){
+						obj.jf = (data.back[e].money.money*1)
+					}
+					ar.push(data.back[e]);
+				});
+			});
 		},
 		server() {
 			this.$refs.popup.open();
@@ -290,7 +304,7 @@ page,
 .content {
 	height: auto;
 	min-height: 100%;
-	background-color: #FFFFFF;
+	background-color: #ffffff;
 	padding-bottom: 44rpx;
 }
 .top {
@@ -434,7 +448,7 @@ page,
 			font-weight: bold;
 			color: #666666;
 		}
- 
+
 		.sweets-name {
 			font-size: 28rpx;
 			font-family: PingFang SC;
@@ -461,7 +475,7 @@ page,
 	background-color: #ffffff;
 	line-height: 1;
 	padding: 26rpx 34rpx 20rpx;
-	border-bottom: 1px solid #F5F5F5;;
+	border-bottom: 1px solid #f5f5f5;
 
 	.title1 {
 		font-size: 30rpx;