Kaynağa Gözat

Merge branch 'master' of http://git.liuniu946.com/lhl/duck

Lina 3 yıl önce
ebeveyn
işleme
da127ad866

+ 154 - 146
api/order.js

@@ -1,146 +1,154 @@
-import request from '@/utils/request'
-import {upFilse} from '@/utils/request'
-// 订单确认
-export function confirm(data) {
-	return request({
-		url: '/api/order/confirm',
-		method: 'post',
-		data
-	});
-}
-//获取可使用优惠券
-export function couponsOrder(data,price) {
-	return request({
-		url: '/api/coupons/order/'+price,
-		method: 'get',
-		data
-	});
-}
-//获取优惠券列表
-export function getCouponsList(data,types) {
-	//优惠券状态 0全部 1未使用 2已使用
-	return request({
-		url: '/api/coupons/user/'+types,
-		method: 'get',
-		data
-	});
-}
-//提交评论
-export function order_comment(data) {
-	return request({
-		url: '/api/order/comment',
-		method: 'post',
-		data
-	});
-}
-//订单产品信息
-export function product(data) {
-	return request({
-		url: '/api/order/product',
-		method: 'post',
-		data
-	});
-}
-// 快递查询
-export function express_query(data) {
-	return request({
-		url: '/api/order/express_query',
-		method: 'get',
-		data
-	});
-}
-//上传图片
-export function upload(data) {
-	return upFilse({
-		url: '/api/upload/image',
-		method: 'post',
-		data
-	});
-}
-// 订单列表
-export function orderList(data) {
-	return request({
-		url: '/api/order/list',
-		method: 'get',
-		data
-	});
-}
-// 订单详细
-export function orderDetail(data,orderid) {
-	return request({
-		url: '/api/order/detail/'+orderid,
-		method: 'get',
-		data
-	});
-}
-
-// 取消订单
-export function orderCancel(data) {
-	return request({
-		url: '/api/order/cancel',
-		method: 'post',
-		data
-	});
-}
-
-// 删除订单
-export function orderDel(data) {
-	return request({
-		url: '/api/order/del',
-		method: 'get',
-		data
-	});
-}
-// 申请退款
-export function refund(data) {
-	return request({
-		url: '/api/order/refund/verify',
-		method: 'post',
-		data
-	});
-}
-// 退款理由列表
-export function refundReason(data) {
-	return request({
-		url: '/api/order/refund/reason',
-		method: 'get',
-		data
-	});
-}
-
-// 确认收货
-export function orderTake(data) {
-	return request({
-		url: '/api/order/take',
-		method: 'post',
-		data
-	});
-}
-
-// 订单支付
-export function orderPay(data) {
-	return request({
-		url: '/api/order/pay',
-		method: 'post',
-		data
-	});
-}
-
-// 创建订单
-export function createOrderkey(data,key) {
-	return request({
-		url: '/api/order/create/'+key,
-		method: 'post',
-		data
-	});
-}
-
-// 统计订单金额
-export function computedOrderkey(data) {
-	return request({
-		url: '/api/order/computed/'+data.orderkey,
-		method: 'post',
-		data
-	});
-}
-
+import request from '@/utils/request'
+import {upFilse} from '@/utils/request'
+// 订单确认
+// export function confirm(data) {
+// 	return request({
+// 		url: '/api/order/confirm',
+// 		method: 'post',
+// 		data
+// 	});
+// }
+// 订单确认new
+export function confirm(data) {
+	return request({
+		url: '/api/order/check',
+		method: 'post',
+		data
+	});
+}
+//获取可使用优惠券
+export function couponsOrder(data,price) {
+	return request({
+		url: '/api/coupons/order/'+price,
+		method: 'get',
+		data
+	});
+}
+//获取优惠券列表
+export function getCouponsList(data,types) {
+	//优惠券状态 0全部 1未使用 2已使用
+	return request({
+		url: '/api/coupons/user/'+types,
+		method: 'get',
+		data
+	});
+}
+//提交评论
+export function order_comment(data) {
+	return request({
+		url: '/api/order/comment',
+		method: 'post',
+		data
+	});
+}
+//订单产品信息
+export function product(data) {
+	return request({
+		url: '/api/order/product',
+		method: 'post',
+		data
+	});
+}
+// 快递查询
+export function express_query(data) {
+	return request({
+		url: '/api/order/express_query',
+		method: 'get',
+		data
+	});
+}
+//上传图片
+export function upload(data) {
+	return upFilse({
+		url: '/api/upload/image',
+		method: 'post',
+		data
+	});
+}
+// 订单列表
+export function orderList(data) {
+	return request({
+		url: '/api/order/list',
+		method: 'get',
+		data
+	});
+}
+// 订单详细
+export function orderDetail(data,orderid) {
+	return request({
+		url: '/api/order/detail/'+orderid,
+		method: 'get',
+		data
+	});
+}
+
+// 取消订单
+export function orderCancel(data) {
+	return request({
+		url: '/api/order/cancel',
+		method: 'post',
+		data
+	});
+}
+
+// 删除订单
+export function orderDel(data) {
+	return request({
+		url: '/api/order/del',
+		method: 'get',
+		data
+	});
+}
+// 申请退款
+export function refund(data) {
+	return request({
+		url: '/api/order/refund/verify',
+		method: 'post',
+		data
+	});
+}
+// 退款理由列表
+export function refundReason(data) {
+	return request({
+		url: '/api/order/refund/reason',
+		method: 'get',
+		data
+	});
+}
+
+// 确认收货
+export function orderTake(data) {
+	return request({
+		url: '/api/order/take',
+		method: 'post',
+		data
+	});
+}
+
+// 订单支付
+export function orderPay(data) {
+	return request({
+		url: '/api/order/pay',
+		method: 'post',
+		data
+	});
+}
+
+// 创建订单
+export function createOrderkey(data,key) {
+	return request({
+		url: '/api/order/create/'+key,
+		method: 'post',
+		data
+	});
+}
+
+// 统计订单金额
+export function computedOrderkey(data) {
+	return request({
+		url: '/api/order/computed/'+data.orderkey,
+		method: 'post',
+		data
+	});
+}
+

+ 43 - 13
api/product.js

@@ -164,9 +164,9 @@ export function getCombinationPoster(data) {
  */
 export function getSeckillIndexTime(data) {
 	return request({
-			url: '/api/store/product/seckill/select',
-			methods: 'get',
-			data
+		url: '/api/store/product/seckill/select',
+		methods: 'get',
+		data
 	});
 }
 // 获取秒杀分类
@@ -211,17 +211,47 @@ export function getStoreDetail(id, data) {
 		url: '/api/store/merchant/detail/' + id,
 		method: 'get',
 		data
-	})
+	})
 }
-/**
- * 获取秒杀商品详情
- * @param int id
- * 
- */
-export function getSeckillProductDetail(data,id) {
+/**
+ * 获取秒杀商品详情
+ * @param int id
+ * 
+ */
+export function getSeckillProductDetail(data, id) {
 	return request({
-		url:'/api/store/product/seckill/detail/'+id,
-		method:'get',
+		url: '/api/store/product/seckill/detail/' + id,
+		method: 'get',
 		data
-	})
+	})
+}
+
+//获取普通商品
+export function getProductslist(data) {
+	if (data.brand_id && Array.isArray(data.brand_id)) {
+		data = {
+			...data
+		}
+		data.brand_id = data.brand_id.toString()
+	}
+	// return request.get('product/spu/lst', data, {
+	// 	noAuth: true
+	// });
+	return request({
+		url: '/product/spu/lst',
+		method: 'get',
+		data
+	})
+}
+//
+export function getProductHot(data) {
+	let dataa = {
+		page: data.page === undefined ? 1 : page,
+		limit: data.limit === undefined ? 10 : limit
+	}
+	return request({
+		url: '/api/product/spu/recommend',
+		method: 'get',
+		data
+	})
 }

+ 29 - 13
api/user.js

@@ -4,7 +4,7 @@ import { upFilse} from '@/utils/request';
 // 订单统计信息
 export function orderData(data) {
 	return request({
-		url: '/api/order/data',
+		url: '/api/order/number',
 		method: 'get',
 		data
 	});
@@ -43,7 +43,7 @@ export function spreadBanner(data) {
 // 获取地址列表
 export function getAddressList(data) {
 	return request({
-		url: '/api/address/list',
+		url: '/api/user/address/lst',
 		method: 'get',
 		data
 	});
@@ -51,23 +51,23 @@ export function getAddressList(data) {
 // 修改地址
 export function addressEdit(data) {
 	return request({
-		url: '/api/address/edit',
+		url: '/api/user/address/create',
 		method: 'post',
 		data
 	});
 }
 // 删除地址
-export function addressDel(data) {
+export function addressDel(data,id) {
 	return request({
-		url: '/api/address/del',
+		url: '/api/user/address/delete/'+id,
 		method: 'post',
 		data
 	});
 }
 // 设为默认地址
-export function setAddressDefault(data) {
+export function setAddressDefault(data,id) {
 	return request({
-		url: '/api/address/default/set',
+		url: '/api/user/address/update/' + id,
 		method: 'post',
 		data
 	});
@@ -75,16 +75,16 @@ export function setAddressDefault(data) {
 // 购物车列表
 export function getCartList(data) {
 	return request({
-		url: '/api/cart/list',
+		url: '/api/user/cart/lst',
 		method: 'get',
 		data
 	});
 }
 
 // 修改购物车数量
-export function getCartNum(data) {
+export function getCartNum(cart_id,data) {
 	return request({
-		url: '/api/cart/num',
+		url: '/api/user/cart/change/' + cart_id,
 		method: 'post',
 		data
 	});
@@ -92,7 +92,7 @@ export function getCartNum(data) {
 //删除购物车
 export function cartDel(data) {
 	return request({
-		url: '/api/cart/del',
+		url: '/api/user/cart/delete',
 		method: 'post',
 		data
 	});
@@ -123,8 +123,6 @@ export function getExtensionData(data) {
 		data
 	})
 }
-
-
 export function uploads(data){
 	return upFilse({
 		url:'/api/upload/image',
@@ -138,4 +136,22 @@ export function edit(data){
 		method:'post',
 		data
 	});
+}
+// 获取佣金记录
+export function brokerage_list(data) {
+	// return request.get("user/spread_info");
+	return request({
+		url: '/api/user/brokerage_list',
+		method: 'get',
+		data
+	})
+}
+//佣金数据
+export function spreadInfo(data) {
+	return request({
+		url: '/api/user/spread_info',
+		method: 'get',
+		data
+	})
+	// return request.get("user/spread_info");
 }

+ 2 - 2
api/wallet.js

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

+ 64 - 89
pages/cart/cart.vue

@@ -15,12 +15,12 @@
 		<view v-else>
 			<!-- 列表 -->
 			<view class="cart-list">
-				<block v-for="(item, index) in cartList" :key="item.id">
+				<block v-for="(item, index) in cartList">
 					<view class="cart-item" :class="{ 'b-b': index !== cartList.length - 1 }">
 						<view class="image-wrapper">
 							<image
-								:src="item.productInfo.image"
-								:class="[item.loaded]"
+								:src="item.ActiveSku.image"
+								class="loaded"
 								mode="aspectFill"
 								lazy-load
 								@load="onImageLoad('cartList', index)"
@@ -29,27 +29,26 @@
 							<view class="iconfont iconroundcheckfill checkbox" :class="{ checked: item.checked }" @click="check('item', index)"></view>
 						</view>
 						<view class="item-right">
-							<text class="clamp title">{{ item.productInfo.store_name }}</text>
+							<text class="clamp title">{{ item.product.store_name }}</text>
 							<!-- <text class="attr">{{ item.attr_val }}</text> -->
 							<view class="ex-addr">
 								<image src="../../static/img/shop.png" mode="" class="name-img"></image>
-								子臣台州旗舰店
+								{{item.mer_name}}
 								<image src="../../static/img/point.png" mode="" class="point-img"></image>
 								200m
 							</view>
-							<text class="price">¥{{ item.productInfo.price }} <text class="oldprice">¥{{item.productInfo.oldPrice}}</text></text>
+							<text class="price">¥{{ item.ActiveSku.price }} <text class="oldprice">¥{{item.ActiveSku.ot_price}}</text></text>
 							<uni-number-box
 								class="step"
 								:min="1"
-								:max="item.productInfo.stock"
-								:value="item.cart_num > item.productInfo.stock ? item.productInfo.stock : item.cart_num"
-								:isMax="item.cart_num >= item.productInfo.stock ? true : false"
+								:max="item.ActiveSku.stock"
+								:value="item.cart_num > item.ActiveSku.stock ? item.ActiveSku.stock : item.cart_num"
+								:isMax="item.cart_num >= item.ActiveSku.stock ? true : false"
 								:isMin="item.cart_num === 1"
 								:index="index"
 								@eventChange="numberChange"
 							></uni-number-box>
 							<text class="del-btn iconfont iconclose" @click="deleteCartItem(index)"></text>
-							
 						</view>
 						<!-- <text class="del-btn iconfont iconclose" @click="deleteCartItem(index)"></text> -->
 					</view>
@@ -90,56 +89,7 @@ export default {
 			total: 0, //总价格
 			allChecked: false, //全选状态  true|false
 			empty: false, //空白页现实  true|false
-			cartList: [
-				{
-					id: '11',
-					productInfo: {
-						image: '###',
-						store_name: '鸭子总店',
-						price: 99,
-						stock: 99,
-						oldPrice: 199
-						
-					},
-					loaded: 'loaded',
-					checked: false,
-					attr_val: 1,
-					cart_num: 1
-					
-				},
-				{
-					id: '11',
-					productInfo: {
-						image: '###',
-						store_name: '鸭子总店',
-						price: 99,
-						stock: 99,
-						oldPrice: 199
-						
-					},
-					loaded: 'loaded',
-					checked: false,
-					attr_val: 1,
-					cart_num: 1
-					
-				},
-				{
-					id: '11',
-					productInfo: {
-						image: '###',
-						store_name: '鸭子总店',
-						price: 99,
-						stock: 99,
-						oldPrice: 199
-						
-					},
-					loaded: 'loaded',
-					checked: false,
-					attr_val: 1,
-					cart_num: 1
-					
-				},
-			]
+			cartList: []
 		};
 	},
 	onShow() {
@@ -165,26 +115,39 @@ export default {
 		async loadData() {
 			let obj = this;
 			getCartList({})
-				.then(function(e) {
+				.then(function(e) {
+					console.log(e.data.list)
+					let list = []
+					e.data.list.forEach( item => {
+						for(let i = 0 ; i < item.list.length; i++){
+							let newList = item.list[i]
+							newList.mer_name = item.mer_name
+							newList.checked = true
+							item.loaded = 'loaded';
+							list.push(newList)
+						}
+					})
+					console.log(list,"处理后的list")
+					obj.cartList = list
 					// 获取当前购物车物品增加数量
-					let nub = obj.cartList.length;
+					// let nub = obj.cartList.length;
 					// 获取之前对象数组
-					let aArray = obj.cartList.reverse();
+					// let aArray = obj.cartList.reverse();
 					// 获取返回数据对象数组
-					let bArray = e.data.valid.reverse();
-					obj.cartList = bArray
-						.map((item, ind) => {
-							// 设置返回数据默认为勾选状态
-							item.checked = true;
-							// 获取相同数组之前对象的数据
-							let carlist = aArray[ind];
-							// 判断之前是否已经加载完毕
-							if (carlist && carlist.loaded == 'loaded') {
-								item.loaded = 'loaded';
-							}
-							return item;
-						})
-						.reverse();
+					// let bArray = e.data.valid.reverse();
+					// obj.cartList = bArray
+					// 	.map((item, ind) => {
+					// 		// 设置返回数据默认为勾选状态
+					// 		item.checked = true;
+					// 		// 获取相同数组之前对象的数据
+					// 		let carlist = aArray[ind];
+					// 		// 判断之前是否已经加载完毕
+					// 		if (carlist && carlist.loaded == 'loaded') {
+					// 			item.loaded = 'loaded';
+					// 		}
+					// 		return item;
+					// 	})
+					// 	.reverse();
 					obj.calcTotal(); //计算总价
 				})
 				.catch(function(e) {
@@ -193,7 +156,8 @@ export default {
 		},
 		//监听image加载完成
 		onImageLoad(key, index) {
-			// 修改载入完成后图片class样式
+			// 修改载入完成后图片class样式
+			console.log("ok")
 			this.$set(this[key][index], 'loaded', 'loaded');
 		},
 		//监听image加载失败
@@ -222,10 +186,11 @@ export default {
 			this.calcTotal(type);
 		},
 		//数量
-		numberChange(data) {
+		numberChange(data) {
+			console.log(data)
 			let arr = this.cartList[data.index];
 			arr.cart_num = data.number;
-			getCartNum({ id: arr.id, number: data.number })
+			getCartNum( arr.cart_id, {cart_num: data.number })
 				.then(e => {
 					console.log(e);
 				})
@@ -237,10 +202,12 @@ export default {
 		//删除
 		deleteCartItem(index) {
 			let list = this.cartList;
-			let row = list[index];
-			let id = row.id;
+			let row = list[index];
+			let delList = []
+			delList.push(row.cart_id)
+			// let id = row.id;
 			cartDel({
-				ids: id
+				cart_id: delList
 			});
 			this.cartList.splice(index, 1);
 			uni.hideLoading();
@@ -251,12 +218,17 @@ export default {
 			uni.showModal({
 				content: '清空购物车?',
 				success: e => {
-					if (e.confirm) {
-						let st = this.cartList.map(e => {
-							return e.id;
-						});
+					if (e.confirm) {
+						let list = []
+						this.cartList.forEach(item => {
+							list.push(item.cart_id)
+						})
+						// let st = this.cartList.map(e => {
+						// 	return e.cart_id;
+						// });
+						// console.log(st.join(','))
 						cartDel({
-							ids: st.join(',')
+							cart_id: list
 						}).then(e => {
 							console.log(e);
 						});
@@ -276,7 +248,7 @@ export default {
 			let checked = true;
 			list.forEach(item => {
 				if (item.checked === true) {
-					total += item.productInfo.price * item.cart_num;
+					total += item.ActiveSku.price * item.cart_num;
 				} else if (checked === true) {
 					checked = false;
 				}
@@ -407,6 +379,9 @@ export default {
 				display: inline-block;
 				padding-left: 10rpx;
 			}
+		}
+		.title {
+			width: 350rpx;
 		}
 		.attr {
 			font-size: $font-sm + 2rpx;

+ 4 - 7
pages/index/index.vue

@@ -199,7 +199,7 @@ import { setCoupons } from '@/api/functionalUnit.js';
 // import { getBargainList } from '@/api/product.js';
 import { interceptor } from '@/utils/loginUtils';
 import { mapState } from 'vuex';
-import { getCombinationList } from '@/api/product.js';
+import { getCombinationList, getProductslist, getProductHot } from '@/api/product.js';
 
 export default {
 	components: {
@@ -306,12 +306,6 @@ export default {
 			});
 		}
 		// #endif
-		// uni.request({
-		// 	complete(res) {
-		// 		console.log(res);
-		// 	},
-		// 	url: 'http://base.liuniu946.com/api/index'
-		// });
 	},
 	onShow: function() {
 		// 判断是否强制登录
@@ -506,6 +500,9 @@ export default {
 				this.swiperLength = this.carouselList.length;
 				this.menusList = data.menu;
 			})
+			getProductHot({page:1,limit:1}).then( ({data})=> {
+				console.log(data,"data+++++++++--------------")
+			} )
 		},
 		//轮播图切换修改背景色
 		swiperChange(e) {

+ 13 - 17
pages/money/wallet.vue

@@ -3,7 +3,7 @@
 		<view class="content-money">
 			<view class="money-box">
 				<!-- <view class="text">可提现金额(元)</view> -->
-				<view class="money"><text class="money-icon">¥</text>{{ money | getMoneyStyle }}</view>
+				<view class="money"><text class="money-icon">¥</text>{{ userInfo.now_money | getMoneyStyle }}</view>
 			</view>
 			<!-- <view class="moneyTx" @click="navto('/pages/money/recharge')">充值</view>
 			<view class="flex buttom-box">
@@ -34,7 +34,7 @@
 								<text>{{ item.title }}</text>
 							</view>
 							<view class="time">
-								<text>{{ item.add_time }}</text>
+								<text>{{ item.create_time }}</text>
 							</view>
 						</view>
 						<view class="money">
@@ -51,6 +51,7 @@
 </template>
 
 <script>
+import { mapState, mapMutations } from 'vuex';
 import { spreadCommission, userBalance } from '@/api/wallet.js';
 import { getMoneyStyle } from '@/utils/rocessor.js';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
@@ -87,14 +88,6 @@ export default {
 			maxheight:'',
 			tabCurrentIndex: 1,
 			navList: [
-				{
-					state: 0,
-					text: '全部',
-					loadingType: 'more',
-					orderList: [],
-					page: 1, //当前页数
-					limit: 10 //每次信息条数
-				},
 				{
 					state: 1,
 					text: '支出',
@@ -119,13 +112,14 @@ export default {
 			money: ''
 		};
 	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
 	onLoad(options) {},
 	onShow() {
 		this.loadData();
 		// 获取用户余额
-		userBalance({}).then(({ data }) => {
-			this.money = data.now_money;
-		});
+		
 	},
 	methods: {
 		// 页面跳转
@@ -154,13 +148,15 @@ export default {
 			spreadCommission(
 				{
 					page: navItem.page,
-					limit: navItem.limit
+					limit: navItem.limit,
+					type: state
 				},
-				state
+				
 			)
 				.then(({ data }) => {
-					if (data.length > 0) {
-						navItem.orderList = navItem.orderList.concat(data[0].list);
+					console.log(data);
+					if (data.count > 0) {
+						navItem.orderList = navItem.orderList.concat(data.list);
 						console.log(navItem.orderList);
 						navItem.page++;
 					}

+ 12 - 5
pages/money/withdrawal.vue

@@ -97,6 +97,7 @@
 import { getMoneyStyle } from '@/utils/rocessor.js';
 import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
 import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
+import { spreadInfo } from '@/api/user.js'
 export default {
 	filters: {
 		getMoneyStyle
@@ -148,11 +149,17 @@ export default {
 		},
 		// 加载余额信息
 		async loadData() {
-			extractBank({}).then(({ data }) => {
-				this.money = data.moneyCount;//可提现余额
-				this.minPrice = data.minPrice;//最小提现
-				this.freeze =data.inmoneyCount//提现中的余额
-			});
+			spreadInfo().then( ({data}) => {
+				console.log(data,"spreadInfo++++++++++++++++++")
+				this.money = data.brokerage_price//可提现余额
+				this.minPrice = data.user_extract_min//最小提现
+				this.freeze = data.lock_brokerage//冻结金额
+			})
+			// extractBank({}).then(({ data }) => {
+			// 	this.money = data.moneyCount;//可提现余额
+			// 	this.minPrice = data.minPrice;//最小提现
+			// 	this.freeze =data.inmoneyCount//提现中的余额
+			// });
 		},
 		// 跳转
 		navTo(url) {

+ 5 - 2
pages/order/createOrder.vue

@@ -401,7 +401,8 @@ export default {
 		},
 		loadData() {
 			let obj = this;
-			confirm({ cartId: obj.cartId+'' }).then(({ data }) => {
+			confirm({ cart_id: obj.cartId+'' }).then(({ data }) => {
+				console.log(data,'+++++++++++++++++++++++Cartinfo')
 				obj.addressData = data.addressInfo || {};
 				obj.shopList = data.cartInfo; //商品列表
 				obj.moneyAll = data.priceGroup; //金额数据
@@ -437,7 +438,9 @@ export default {
 			uni.navigateTo({
 				url
 			});
-		}
+		},
+		// 获订单确认获取订单详细信息
+		
 	}
 };
 </script>

+ 18 - 11
pages/product/groupBooking/productGroup.vue

@@ -362,8 +362,9 @@
 					obj.buys_show = true;
 					obj.buys_shows = false;
 					obj.actionPrice = obj.productValue[str].price;
-					obj.goodsNumberMax = obj.productValue[str].stock;
+					// obj.goodsNumberMax = obj.productValue[str].stock;
 					obj.actionImage = obj.productValue[str].image;
+					console.log(obj.actionImage)
 					obj.uniqueId = obj.productValue[str].unique;
 					obj.goodsStore = obj.productValue[str].stock;
 					// if (obj.goodsType == 2) {
@@ -389,13 +390,15 @@
 				console.log(obj.goodsNumber)
 				let data = {
 					// cartNum: obj.goodsNumber, //商品数量
-					cartNum: obj.chooseGoodsNumber, //商品数量
-					uniqueId: obj.uniqueId, //商品标签
-					new: 1, //商品是否新增加到购物车1为不加入0为加入
-					mer_id: obj.shopId,
-					combinationId: obj.goodsid, //拼团编号
-					productId: obj.goodsObjact.product_id, //商品编号
+					cart_num: obj.goodsNumber, //商品数量
+					product_attr_unique: obj.uniqueId, //商品标签
+					is_new: 1, //商品是否新增加到购物车1为不加入0为加入
+					// mer_id: obj.shopId,
+					// combinationId: obj.goodsid, //拼团编号
+					product_id: obj.groupInfo.product_id, //商品编号
+					product_type: 4
 				};
+				console.log(data)
 				this.specClass = 'none';
 				cartAdd(data)
 					.then(function(e) {
@@ -404,7 +407,7 @@
 						if (obj.type == 1) {
 							// 跳转到支付页
 							uni.navigateTo({
-								url: '/pages/order/createOrder?id=' + da.cartId + '&goodsType=' + obj.goodsType
+								url: '/pages/order/createOrder?id=' + da.cart_id + '&goodsType=' + 'pink'
 							});
 						}
 						if (obj.type == 2) {
@@ -463,7 +466,8 @@
 						people:data.buying_count_num,
 						count: data.yet_buying_num ||0,
 						title: data.product.store_name,
-						stock: data.stock
+						stock: data.stock,
+						product_id: data.product_group_id
 					}
 					console.log(obj.goodsObjact, 88)
 					console.log(Array.isArray(data.productValue), 99)
@@ -488,7 +492,10 @@
 						}
 						let str = obj.specSelected.join(',');
 						console.log(str)
-						
+						obj.actionPrice = obj.productValue[str].price;
+						obj.actionImage = obj.productValue[str].image;
+						obj.uniqueId = obj.productValue[str].unique;
+						obj.goodsStore = obj.productValue[str].stock;
 					}else {
 						console.log("单规格")
 						obj.many = 1;
@@ -513,7 +520,7 @@
 					// 	obj.goodsNumberMax = obj.productValue[str].stock;
 					// 	obj.actionImage = obj.productValue[str].image;
 					// 	obj.uniqueId = obj.productValue[str].unique;
-					// 	obj.goodsStore = obj.productValue[str].quota;
+					// 	obj.goodsStore = obj.productValue[str].stock;
 					// } else {
 					// 	obj.many = 1;
 					// }

+ 11 - 16
pages/product/product.vue

@@ -170,7 +170,7 @@ export default {
 			actionPrice: 0, //默认选中商品价格
 			actionImage: '', //默认选中图片
 			good_list: '', //猜你喜欢列表
-			goodsNumberMax: 0, //最大可购买数量
+			goodsNumberMax: 1, //最大可购买数量
 			// 倒计时数据保存
 			seckillObj: {
 				stopTime: 0, //结束时间
@@ -259,14 +259,7 @@ export default {
 		// #endif
 	},
 	computed: {
-		...mapState(['weichatObj', 'baseURL', 'urlFile']),
-		choNum() {
-			let a = [];
-			for (let i = 1; i <= this.goodsNumberMax; i++) {
-				a.push(i);
-			}
-			return a;
-		}
+		...mapState(['weichatObj', 'baseURL', 'urlFile'])
 	},
 	// 分享
 	onShareAppMessage(options) {
@@ -496,12 +489,16 @@ export default {
 			// 	productId: goodId, //商品编号
 			// 	uniqueId: obj.uniqueId
 			// };
+			let is_new = 0
+			if(obj.type == 1){
+				is_new = 1
+			}
 			let data = {
 				product_id: goodId,
 				product_attr_unique: obj.uniqueId,
 				cart_num: obj.goodsNumber,
 				product_type: obj.product_type,
-				is_new: 1 
+				is_new: is_new
 			}
 			console.log("立即购买++++++",data);
 			if (obj.type == 2) {
@@ -509,11 +506,12 @@ export default {
 			}
 			cartAdd(data)
 				.then(function(e) {
+					console.log(e,"立即购买++++++fanhui")
 					let da = e.data;
 					if (obj.type == 1) {
 						// 跳转到支付页
 						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + da.cartId
+							url: '/pages/order/createOrder?id=' + da.cart_id
 						});
 					}
 					if (obj.type == 2) {
@@ -523,7 +521,7 @@ export default {
 							duration: 2000,
 							icon: 'none'
 						});
-						obj.goodsDetail();
+						obj.getGoodsDetails();
 					}
 					obj.toggleSpec();
 				})
@@ -554,8 +552,6 @@ export default {
 				obj.sckillGoodInfo.price = data.price; //保存商品展示价格
 				obj.sckillGoodInfo.ot_price = data.ot_price; //保存商品市场价
 				obj.stopTimes = timeComputed(data.stop * 1000); //设置结束时间
-				obj.shopInfo.name = data.merchant.mer_name; //保存店铺名称
-				obj.shopInfo.logo = data.merchant.mer_avatar; //保存店铺logo
 				obj.product_type = data.product_type//保存商品类型
 				//小程序商品详情图超出屏幕问题
 				if (data.content.content !== null) {
@@ -600,7 +596,6 @@ export default {
 					// obj.shopId = data.mer_id; //保存商店id
 					obj.goodsStore = data.stock
 					obj.uniqueId = obj.productValue.unique
-					
 					console.log(obj.uniqueId)
 					
 				}
@@ -888,7 +883,7 @@ page {
 		width: 90rpx;
 		height: 90rpx;
 		border-radius: 50%;
-		background-color: red;
+		// background-color: red;
 		// overflow: hidden;
 		image {
 			width: 90rpx;

+ 4 - 7
pages/set/address.vue

@@ -52,7 +52,8 @@ export default {
 				page: 1,
 				limit: 100
 			}).then(({ data }) => {
-				this.addressList = data;
+				console.log(data)
+				this.addressList = data.list;
 			});
 		},
 		// 设为默认地址
@@ -62,9 +63,7 @@ export default {
 				return e
 			})
 			this.addressList[ind].is_default=1
-			setAddressDefault({
-				id: data.id
-			}).then(({ data }) => {
+			setAddressDefault({},data.address_id).then(({ data }) => {
 				this.loadAddress();
 			}).catch((e) => {
 				console.log(e);
@@ -72,9 +71,7 @@ export default {
 		},
 		//删除地址
 		delAddress(item) {
-			addressDel({
-				id:item.id
-			}).then(({data})=>{
+			addressDel({},item.address_id).then(({data})=>{
 				this.$api.msg('删除成功')
 			})
 			let s = this.addressList.indexOf(item);

+ 35 - 40
pages/set/addressManage.vue

@@ -10,7 +10,7 @@
 		</view>
 		<view class="row b-b">
 			<text class="tit">地址</text>
-			<pickerAddress class="input" @change="onCityClick">{{addressDetail||'请选择地址'}}</pickerAddress>
+			<pickerAddress class="input" @change="onCityClick">{{ addressDetail || '请选择地址' }}</pickerAddress>
 			<text class="iconfont iconlocation"></text>
 		</view>
 		<view class="row b-b">
@@ -28,9 +28,7 @@
 				@switchChange="switchChange"
 			></uni-list-item>
 		</uni-list>
-    <view class="del-btn" v-if="showDel">
-      <text @click="delAddr">删除地址</text>
-    </view>
+		<view class="del-btn" v-if="showDel"><text @click="delAddr">删除地址</text></view>
 		<button class="add-btn" @click="confirm">提交</button>
 	</view>
 </template>
@@ -39,7 +37,7 @@
 import uniList from '@/components/uni-list/uni-list.vue';
 import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
 import uniPopup from '@/components/uni-popup/uni-popup.vue';
-import  pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
+import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
 import { addressEdit, addressDel } from '@/api/user.js';
 export default {
 	components: {
@@ -61,19 +59,19 @@ export default {
 				},
 				area: '',
 				default: false,
-        showDel: false
+				showDel: false
 			}
 		};
 	},
 	onLoad(option) {
-    this.showDel = false
+		this.showDel = false;
 		let title = '新增收货地址';
 		if (option.type === 'edit') {
 			title = '编辑收货地址';
 			let data = JSON.parse(option.data);
 			console.log(data);
-      
-      this.showDel = true
+
+			this.showDel = true;
 			this.addressData = {
 				name: data.real_name,
 				mobile: data.phone,
@@ -84,7 +82,7 @@ export default {
 				},
 				area: data.detail,
 				default: data.is_default == 1,
-				id: data.id
+				id: data.address_id
 			};
 			this.addressDetail = data.province + data.city + data.district;
 		}
@@ -95,7 +93,7 @@ export default {
 	},
 	methods: {
 		// 选中城市切换
-		onCityClick({data}) {
+		onCityClick({ data }) {
 			let address = this.addressData.address;
 			address.province = data[0];
 			address.city = data[1];
@@ -116,17 +114,16 @@ export default {
 		switchChange(e) {
 			this.addressData.default = e.value;
 		},
-    //删除地址
-    delAddr() {
-      addressDel({id:this.addressData.id}).then(({data})=>{
-				this.$api.msg('删除成功')
-        setTimeout(()=>{
-          uni.redirectTo({url:'/pages/set/address'})
-        },1000)
-        
-			})
-      console.log('删除')
-    },
+		//删除地址
+		delAddr() {
+			addressDel({},this.addressData.id).then(({ data }) => {
+				this.$api.msg('删除成功');
+				setTimeout(() => {
+					uni.redirectTo({ url: '/pages/set/address' });
+				}, 1000);
+			});
+			console.log('删除');
+		},
 		//提交
 		confirm() {
 			let obj = this;
@@ -152,20 +149,18 @@ export default {
 			addressEdit({
 				real_name: data.name,
 				phone: data.mobile,
-				address: {
-					province: data.address.province,
-					city: data.address.city,
-					district: data.address.district
-				},
+				province: data.address.province,
+				city: data.address.city,
+				district: data.address.district,
 				detail: data.area,
 				is_default: data.default,
-				id: data.id||"",
-				type:1
+				address_id: data.id || '',
+				type: 1
 			}).then(function(e) {
 				obj.$api.prePage().refreshList();
 				uni.showToast({
-					title:'提交成功',
-					duration:2000
+					title: '提交成功',
+					duration: 2000
 				});
 				setTimeout(function() {
 					uni.navigateBack();
@@ -216,15 +211,15 @@ page {
 	}
 }
 .del-btn {
-  width: 750rpx;
-  height: 99rpx;
-  margin-top: 28rpx;
-  font-size: 30rpx;
-  font-weight: 500;
-  color: #901B21;
-  background-color: #fff;
-  line-height: 99rpx;
-  padding-left: 42rpx;
+	width: 750rpx;
+	height: 99rpx;
+	margin-top: 28rpx;
+	font-size: 30rpx;
+	font-weight: 500;
+	color: #901b21;
+	background-color: #fff;
+	line-height: 99rpx;
+	padding-left: 42rpx;
 }
 .add-btn {
 	display: flex;

+ 14 - 8
pages/user/award.vue

@@ -54,7 +54,8 @@ import { spreadCommission, userBalance } from '@/api/wallet.js';
 import { mapState, mapMutations } from 'vuex';
 import { getMoneyStyle } from '@/utils/rocessor.js';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-import empty from '@/components/empty';
+import empty from '@/components/empty';
+import { brokerage_list } from '@/api/user.js'
 export default {
 	filters: {
 		getMoneyStyle
@@ -110,9 +111,13 @@ export default {
 	onShow() {
 		this.loadData();
 		//获取用户余额
-		userBalance({}).then(({ data }) => {
-			this.money = data.commissionCount;
-		});
+		// userBalance({}).then(({ data }) => {
+		// 	this.money = data.commissionCount;
+		// });
+		//获取用户佣金
+		brokerage_list().then(({data}) => {
+			console.log(data,"获取用户佣金")
+		})
 	},
 	methods: {
 		navto(e) {
@@ -215,18 +220,19 @@ page {
 .money-box {
 	background-color: $base-color;
 	padding-top: var(--status-bar-height);
-	height: 368rpx;
+	height: 265rpx;
 	color: #ffffff;
 	text-align: center;
   background-image: url(../../static/img/wallertbg.png);
-  background-size: 100%;
+  background-size: 100%;
+  background-position: bottom;
 
 	.text {
-		padding-top: 147rpx;
+		padding-top: 100rpx;
 		font-size: $font-sm;
 	}
 	.money {
-    padding-top: 147rpx;
+    padding-top: 100rpx;
 		font-size: 56rpx;
     text {
       display: inline-block;

+ 3 - 0
pages/user/user.vue

@@ -257,6 +257,7 @@ export default {
 			userIdentity: false,
 			text: 'ch125221',
 			isUser: 0,
+			integral:'',//积分获取
 			// userInfo: {},
 			// is_promoter: {},
 			// extension_status: {}
@@ -328,6 +329,7 @@ export default {
 					orderData({})
 						.then(({ data }) => {
 							this.setOrderInfo(data);
+							console.log(this.orderInfo);
 						})
 						.catch(e => {
 							this.setOrderInfo({
@@ -342,6 +344,7 @@ export default {
 				.catch(e => {
 					console.log(e);
 				});
+			
 		},
 		/**
 		 * 统一跳转接口,拦截未登录路由

+ 2 - 2
utils/request.js

@@ -32,9 +32,9 @@ service.interceptors.response(
 						}
 					})
 				} else {
-					if (res.msg != '系统出现异常') {
+					if (res.message != '系统出现异常') {
 						uni.showToast({
-							title: res.msg,
+							title: res.message,
 							duration: 1500,
 							mask: false,
 							icon: 'none',