hwq 1 yıl önce
ebeveyn
işleme
f43077e2f4

+ 2 - 19
api/index.js

@@ -1,25 +1,8 @@
 import request from '@/utils/request'
-
-// 促销商品
-export function groom4(data) {
-	return request({
-		url: '/api/groom/list/4',
-		method: 'get',
-		data
-	});
-}
-// 精品推荐
-export function groom2(data) {
-	return request({
-		url: '/api/groom/list/2',
-		method: 'get',
-		data
-	});
-}
 // 新品首发
-export function groom3(data) {
+export function groom(data, id) {
 	return request({
-		url: '/api/groom/list/3',
+		url: '/api/groom/list/' + id,
 		method: 'get',
 		data
 	});

+ 10 - 2
api/wallet.js

@@ -1,9 +1,9 @@
 import request from '@/utils/request'
 
 // 获取用户消费记录
-export function spreadCommission(data,state) {
+export function spreadCommission(data, state) {
 	return request({
-		url: '/api/spread/commission/'+state,
+		url: '/api/spread/commission/' + state,
 		method: 'get',
 		data
 	});
@@ -130,3 +130,11 @@ export function setBank(data) {
 		data
 	});
 }
+
+export function getRechargePrice(data) {
+	return request({
+		url: '/api/getRechargePrice',
+		method: 'post',
+		data
+	});
+}

+ 36 - 17
pages/index/index.vue

@@ -78,9 +78,9 @@
 					</view>
 					<view class="hot-price">
 						<view class="price">
-							<text>¥{{ ls.price * 1 }}</text>
+							¥{{ ls.price * 1 }}
+							<text class="ot-price" v-if="ls.ot_price*1>ls.price*1">¥{{ls.ot_price}}</text>
 						</view>
-
 					</view>
 				</view>
 			</view>
@@ -110,7 +110,7 @@
 <script>
 	import {
 		loadIndexs,
-		groom1
+		groom
 	} from '@/api/index.js';
 	import {
 		getUserInfo,
@@ -140,12 +140,7 @@
 		data() {
 			return {
 				text: '', //客服微信
-				page: 1,
-				limitt: 20,
-				loadingType: 'more',
 				current: 0,
-				shareShow: false, //分享海报
-				pageProportion: 0, //保存页面基于750宽度的比例
 				swiperHeight: 0,
 				checkid: 0,
 				titleNViewBackground: '',
@@ -153,9 +148,9 @@
 				swiperLength: 0,
 				carouselList: [], //轮播列表
 				page: 1,
-				limit: 5,
+				limit: 100,
+				loadingType: 'more',
 				firstList: [],
-				period: 1,
 				shareImage: '',
 			};
 		},
@@ -210,7 +205,7 @@
 			return shareObj;
 		},
 		onReachBottom() {
-			console.log('到底')
+			this.getgroom();
 		},
 		onLoad: function(option) {
 			// #ifdef MP
@@ -224,8 +219,13 @@
 			// #endif
 		},
 		onShow: function() {
+			this.page = 1;
+			this.limit = 100;
+			this.loadingType = 'more';
+			this.firstList = []
 			this.loadData();
-			if (hasLogin) {
+			this.getgroom();
+			if (this.hasLogin) {
 				this.getuser()
 			}
 		},
@@ -236,14 +236,34 @@
 					.then(({
 						data
 					}) => {
-						obj.setUserInfo(data);
-
+						this.setUserInfo(data);
 					})
 					.catch(e => {
 						console.log(e);
 					});
 
 			},
+			getgroom() {
+				const obj = this
+				if (obj.loadingType == 'nomore' || obj.loadingType == 'loading') {
+					return
+				}
+				obj.loadingType = 'loading'
+				groom({
+					page: this.page,
+					limit: this.limit
+				}, 3).then(({
+					data
+				}) => {
+					console.log(data, '123456');
+					obj.firstList = obj.firstList.concat(data.list)
+					if (obj.limit == data.list.length) {
+						obj.loadingType = 'more'
+					} else {
+						obj.loadingType = 'nomore'
+					}
+				})
+			},
 			navto(url, type = 0) {
 				if (type == 1) {
 					if (!this.hasLogin) {
@@ -300,7 +320,7 @@
 						console.log(goods, '商品信息');
 						this.carouselList = data.banner;
 						this.swiperLength = this.carouselList.length;
-						this.firstList = data.info.firstList //首页商品
+						// this.firstList = data.info.firstList //首页商品
 						uni.stopPullDownRefresh();
 					})
 					.catch(e => {
@@ -688,13 +708,12 @@
 					justify-content: flex-start;
 					align-items: center;
 
-					.ot-pirce {
+					.ot-price {
 						margin-left: 7rpx;
 						font-size: 26rpx;
 						font-weight: 500;
 						text-decoration: line-through;
 						color: #999999;
-						align-self: flex-end;
 					}
 
 				}

+ 13 - 40
pages/money/recharge.vue

@@ -14,7 +14,7 @@
 			<view class="xian"></view>
 			<view class="moneyBtn-box">
 				<view class="moneyBtn" v-for="(item, index) in moneyList" :class="{ current: choose == index }"
-					:key="index" @click="changemoney(item.price, index,item.id)">{{ item.price }}元</view>
+					:key="index" @click="changemoney(item, index,item.id)">{{ item*1 }}元</view>
 			</view>
 		</view>
 
@@ -56,6 +56,7 @@
 	} from '@/utils/rocessor.js';
 	import {
 		rechargeWechat,
+		getRechargePrice
 	} from '@/api/wallet.js';
 	import {
 		mapState,
@@ -73,17 +74,7 @@
 		},
 		data() {
 			return {
-				moneyList: [{
-					price: '300'
-				}, {
-					price: '200'
-				}, {
-					price: '150'
-				}, {
-					price: '100'
-				}, {
-					price: '50'
-				}],
+				moneyList: [],
 				choose: -1,
 				// #ifdef APP-PLUS
 				type: 'weixinapp',
@@ -110,6 +101,7 @@
 			// #ifdef H5
 			this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
 			// #endif
+			this.loadData()
 		},
 		computed: {
 
@@ -130,6 +122,14 @@
 			tabRadio(e) {
 				this.type = e;
 			},
+			loadData() {
+				getRechargePrice().then(({
+					data
+				}) => {
+					console.log(data);
+					this.moneyList = data
+				})
+			},
 			// 提交
 			confirm() {
 				let obj = this;
@@ -232,36 +232,9 @@
 				})
 				this.$refs.popup.close();
 			},
-			//获取订单列表
-			loadData(source) {
-				console.log(source);
-				//这里是将订单挂载到tab列表下
-				let index = this.tabCurrentIndex;
-				let navItem = this.navList[index];
-				let state = navItem.state;
-				if (source === 'tabChange' && navItem.loaded === true) {
-					//tab切换只有第一次需要加载数据
-					return;
-				}
-				if (navItem.loadingType === 'loading') {
-					//防止重复加载
-					return;
-				}
-				navItem.loadingType = 'loading';
-				setTimeout(() => {
-					let orderList = [];
-					orderList.forEach(item => {
-						navItem.orderList.push(item);
-					});
-					//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
-					this.$set(navItem, 'loaded', true);
-					//判断是否还有数据, 有改为 more, 没有改为noMore
-					navItem.loadingType = 'more';
-				}, 600);
-			},
 			changemoney(item, index, id) {
 				this.choose = index;
-				this.money = item;
+				this.money = item * 1;
 				this.chooseId = id
 			}
 		}

+ 2 - 1
pages/product/list.vue

@@ -427,6 +427,7 @@
 		}
 
 		.price-box {
+			margin-top: 10rpx;
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
@@ -437,7 +438,7 @@
 
 		.price {
 			font-size: $font-lg;
-			color: $uni-color-primary;
+			color: $base-color;
 			line-height: 1;
 
 			&:before {

+ 2 - 2
pages/user/award.vue

@@ -73,7 +73,7 @@
 	} from 'vuex';
 	import {
 		getCommissionInfo,
-		getUser
+		getUserInfo
 	} from '@/api/user.js';
 	import {
 		getMoneyStyle
@@ -157,7 +157,7 @@
 		},
 		methods: {
 			getUserInfo() {
-				getUser({}).then(({
+				getUserInfo({}).then(({
 					data
 				}) => {
 					this.userInfo = data

+ 6 - 1
pages/user/withdrawal.vue

@@ -19,6 +19,9 @@
 				<view class="buttom" @click="withdrawal = money">全部提现</view>
 			</view>
 		</view>
+		<view class="tip" v-if="sxf*1 >0">
+			提现手续费{{sxf}}%<text v-if="withdrawal*1 !=0">,实际到账{{(withdrawal*1/100*(100-sxf*1)).toFixed(2)*1}}</text>
+		</view>
 		<view class="list">
 			<radio-group @change="tabRadio">
 				<!-- <label>
@@ -151,6 +154,7 @@
 		},
 		data() {
 			return {
+				sxf: '',
 				weixin_no: '',
 				type: 'bank', //提现方式
 				money: '0.00', //可提现金额
@@ -201,7 +205,8 @@
 				}) => {
 					console.log(data, 'data+++++++++')
 					this.minPrice = data.minPrice;
-					this.money = data.brokerage_price
+					this.money = data.brokerage_price,
+						this.sxf = data.commission
 				});
 
 			},

+ 2 - 1
pages/user/yue.vue

@@ -18,7 +18,8 @@
 				</view>
 				<view class="moneybtn-box">
 					<!-- <view class="money-btn" style="text-decoration: underline;" @click="navto('/pages/money/freeze')">冻结记录</view> -->
-					<view class="money-btn" @click="navto('/pages/user/yjzz')">转账</view>
+					<!-- <view class="money-btn" @click="navto('/pages/user/yjzz')">转账</view> -->
+					<view class="money-btn"></view>
 					<view class="money-btn" @click="navto('/pages/money/recharge')">钱包充值</view>
 				</view>
 			</view>