wenjie преди 9 месеца
родител
ревизия
b3d8b9c713
променени са 1 файла, в които са добавени 39 реда и са изтрити 16 реда
  1. 39 16
      detail/goodsDetail/index.vue

+ 39 - 16
detail/goodsDetail/index.vue

@@ -242,22 +242,45 @@
 				if(!this.info.realStockNum || this.loading) return
 					let that = this
 				if (uni.getStorageSync('token')) {
-					this.loading = true							
-					valid({goodsId:that.info.goodsId,userId:JSON.parse(uni.getStorageSync('userInfo')).userId}).then(res=>{
-						this.loading = false
-						if(res.content){
-							this.noticeContent = res.content.join().replace(/,/g,'、')
-							this.show = true
-						}else{
-							uni.navigateTo({
-								url:`/pay/pay`,
-								  success: function(res) {
-									// 通过eventChannel向被打开页面传送数据
-									res.eventChannel.emit('pay', that.info)
-								  }
-							})
-						}
-					})
+					if(JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0){
+						// this.loading = true
+						// valid({goodsId:that.info.goodsId,userId:JSON.parse(uni.getStorageSync('userInfo')).userId}).then(res=>{
+						// 	this.loading = false
+						// 	if(res.content){
+						// 		this.noticeContent = res.content.join().replace(/,/g,'、')
+						// 		this.show = true
+						// 	}else{
+						// 		uni.navigateTo({
+						// 			url:`/pay/pay`,
+						// 			  success: function(res) {
+						// 				// 通过eventChannel向被打开页面传送数据
+						// 				res.eventChannel.emit('pay', that.info)
+						// 			  }
+						// 		})
+						// 	}
+						// })
+						uni.navigateTo({
+							url:`/pay/pay`,
+							  success: function(res) {
+								// 通过eventChannel向被打开页面传送数据
+								res.eventChannel.emit('pay', that.info)
+							  }
+						})
+					}else{
+						uni.showModal({
+							title:'此商品需要开通会员才能购买',
+							cancelText:'下次再说',
+							confirmText:'立即开通',
+							success(res) {
+								if(res.confirm){
+									uni.navigateTo({
+										url:'/my/memberCenter/index'
+									})
+								}
+							}
+						})
+					}
+					
 				} else {
 					uni.showModal({
 						title:'请登录',