gcz пре 4 година
родитељ
комит
e8eeefb652

+ 1 - 1
pages/confirmorder/confirmorder.vue

@@ -124,7 +124,7 @@
 						orderId:orderId,
 						payType:payType,
 						openid:userInfo.wxUsers.openid,
-						// "tradeType":"test"
+						"tradeType":"test"
 					}
 					this.$pay.wxPay(params).then(res =>{
 						console.log('payres',res);

+ 32 - 6
pages/product/product.vue

@@ -137,8 +137,7 @@
 				modal: {
 					visibleModal: false
 				},
-				
-				
+				addrsList:[],
 			}
 		},
 		onShow() {
@@ -200,6 +199,7 @@
 			}).catch(err => {
 				console.log(err)
 			});
+			this.getAddrs();
 
 		},
 		methods: {
@@ -275,7 +275,24 @@
 				done()
 			},
 			buy(item){
-				console.log('item',item);
+				// console.log('item',item);
+				console.log('this.addrsList',this.addrsList);
+				if(this.addrsList.length <=0){
+					uni.showToast({
+					 	title:"您还未设置收货地址,将跳到设置页!",
+					 	icon:"none",
+					 	duration:2000
+					});
+					setTimeout(i=>{
+						uni.navigateTo({
+							url: '/pages/usercenter/addrs/addrs',
+							fail:function(err){
+								console.log(err)
+							}
+						});
+					},2000);
+					return;
+				}				
 				if(!this.product.price){
 					uni.showToast({
 						icon:'none',
@@ -288,9 +305,18 @@
 				this.modal.visibleModal = true;
 				this.$nextTick(res => {
 					this.$refs.quickBuy.openPop();
-				});
-				
-			}
+				});				
+			},
+			getAddrs(){
+				// console.log('this.token',this.token);
+				let thetoken = this.params.tokenhead + this.params.token;
+				this.$api.http.get(this.config.apiBaseurl + '/member/address/list',{header: {Authorization:thetoken}}).then(res => {
+					// console.log('getAddrList', res.data.data);
+					this.addrsList = res.data.data;
+				}).catch(err => {
+					// console.log('err', err)
+				})
+			},
 
 		}
 	}

+ 6 - 0
pages/usercenter/addrs/addrs.vue

@@ -294,6 +294,7 @@
 				if (!this.rules[key].rule.test(this.params[key])) {
 					//提示信息
 					uni.showToast({
+						icon:"none",
 						title: this.rules[key].msg,
 					})
 					//取反
@@ -362,6 +363,11 @@
 					_this.params.province = rs.addressComponents.province;
 					_this.params.city = rs.addressComponents.city;
 					_this.params.region = rs.addressComponents.district;
+					uni.showToast({
+					 	title:"选择成功!",
+					 	icon:"none",
+					 	duration:800
+					});
 					// _this.params.detailAddress = rs.address;
 				});
 				//转为高德坐标

+ 1 - 1
pages/usercenter/myorder/myorder.vue

@@ -250,7 +250,7 @@
 						orderId:item.id,
 						payType:item.payType,
 						openid:userInfo.wxUsers.openid,
-						// "tradeType":"test"
+						"tradeType":"test"
 					}
 					this.$pay.wxPay(params).then(res =>{
 						this.downCallback();

+ 1 - 1
pages/usercenter/myorder/orderdetails/orderdetails.vue

@@ -230,7 +230,7 @@
 						orderId:this.item.id,
 						payType:this.item.payType,
 						openid:userInfo.wxUsers.openid,
-						// "tradeType":"test"
+						"tradeType":"test"
 					}
 					this.$pay.wxPay(params).then(res =>{
 						this.getdetails();

+ 12 - 1
wxapi.js

@@ -82,7 +82,18 @@ export default {
 		});
 	},
 	hideMenu() {
-		// wx.hideAllNonBaseMenuItem();
+		wx.hideAllNonBaseMenuItem();
+		wx.hideMenuItems({		
+		    menuList: [
+				"menuItem:share:appMessage",
+				"menuItem:profile",
+				"menuItem:addContact",
+				"menuItem:dayMode",
+				"menuItem:nightMode",
+				"menuItem:share:timeline",
+				"menuItem:favorite"				
+			] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3		
+		});
 	},
 	showMenu() {
 		wx.showMenuItems({