Browse Source

commit -m 呵呵商城线上支付

zhengjinyi 4 years ago
parent
commit
111aeb90b1

+ 0 - 4
pages/goods/product-activi.vue

@@ -106,10 +106,6 @@
 									<view class="content-td">品牌</view>
 									<view class="content-td">品牌</view>
 									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
 									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
 								</view>
 								</view>
-								<view class="content-tr">
-									<view class="content-td">分类</view>
-									<view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
-								</view>
 								<view class="content-tr">
 								<view class="content-tr">
 									<view class="content-td">包装规格</view> 
 									<view class="content-td">包装规格</view> 
 									<view class="content-th">{{product.unit}}</view>
 									<view class="content-th">{{product.unit}}</view>

+ 0 - 4
pages/goods/product.vue

@@ -106,10 +106,6 @@
 									<view class="content-td">品牌</view>
 									<view class="content-td">品牌</view>
 									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
 									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
 								</view>
 								</view>
-								<view class="content-tr">
-									<view class="content-td">分类</view>
-									<view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
-								</view>
 								<view class="content-tr">
 								<view class="content-tr">
 									<view class="content-td">包装规格</view> 
 									<view class="content-td">包装规格</view> 
 									<view class="content-th">{{product.unit}}</view>
 									<view class="content-th">{{product.unit}}</view>

+ 12 - 4
pages/user/order/create-order.vue

@@ -159,13 +159,21 @@
 					setTimeout(()=>{
 					setTimeout(()=>{
 						this.isSubLoading = false;
 						this.isSubLoading = false;
 					},2000)
 					},2000)
-					this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
-					// this.MiniWxPayFor(data)
+					this.MiniWxPayFor(data)
 				}).catch(error =>{
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 					this.$util.msg(error.msg,2000);
 				})
 				})
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{
@@ -193,7 +201,7 @@
 						'signType': data.signType,
 						'signType': data.signType,
 						'paySign': data.paySign,
 						'paySign': data.paySign,
 						'success':function(res){
 						'success':function(res){
-							wx.reLaunch({url: '/pages/index/index'});
+							wx.reLaunch({url: '/pages/tabBar/index/index'});
 						},
 						},
 						'fail':function(res){
 						'fail':function(res){
 							console.log(res)
 							console.log(res)

+ 11 - 3
pages/user/order/order-details.vue

@@ -237,8 +237,7 @@
 						this.handBuyAgainInfo()					
 						this.handBuyAgainInfo()					
 						break;
 						break;
 					case 'pay':
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.order.payableAmount}`)
-						// this.MiniWxPayFor(data.order)
+						this.MiniWxPayFor(data.order)
 						break;
 						break;
 				}
 				}
 			},
 			},
@@ -340,7 +339,16 @@
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
 				})
 				})
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{

+ 11 - 3
pages/user/order/order-list-retail.vue

@@ -408,8 +408,7 @@
 						this.handBuyAgainInfo()					
 						this.handBuyAgainInfo()					
 						break;
 						break;
 					case 'pay':
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.order.payableAmount}`)
-						// this.MiniWxPayFor(data.order)
+						this.MiniWxPayFor(data.order)
 						break;
 						break;
 				}
 				}
 			},
 			},
@@ -510,7 +509,16 @@
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
 				})
 				})
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{

+ 11 - 3
pages/user/order/order-list.vue

@@ -376,8 +376,7 @@
 						this.handBuyAgainInfo()					
 						this.handBuyAgainInfo()					
 						break;
 						break;
 					case 'pay':
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.order.payableAmount}`)
-						// this.MiniWxPayFor(data.order)
+						this.MiniWxPayFor(data.order)
 						break;
 						break;
 				}
 				}
 			},
 			},
@@ -478,7 +477,16 @@
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
 				})
 				})
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{

+ 1 - 1
pages/user/order/order-payment.vue

@@ -180,7 +180,7 @@
 				isPaySwitch:false,
 				isPaySwitch:false,
 				optionType:'',
 				optionType:'',
 				onlinePayFlag:'',
 				onlinePayFlag:'',
-				payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
+				payBringTitle:'线上支付功能正在维护中,请使用线下转账方式支付订单',
 				payStatusText:'使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。',
 				payStatusText:'使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。',
 				pageType:'',
 				pageType:'',
 				payType:'',
 				payType:'',

+ 11 - 3
pages/user/order/search-order.vue

@@ -369,8 +369,7 @@
 						this.handBuyAgainInfo()					
 						this.handBuyAgainInfo()					
 						break;
 						break;
 					case 'pay':
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.order.payableAmount}`)
-						// this.MiniWxPayFor(data.order)
+						this.MiniWxPayFor(data.order)
 						break;
 						break;
 				}
 				}
 			},
 			},
@@ -471,7 +470,16 @@
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
 				})
 				})
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{

+ 10 - 1
pages/user/order/success.vue

@@ -80,7 +80,16 @@
 				})
 				})
 				return systeminfo
 				return systeminfo
 			},
 			},
-			async MiniWxPayFor(data){
+			MiniWxPayFor(data){
+				this.PayService.PayOrderOnLineSwitch().then(response =>{
+					if(response.data === 1 ){
+						this.WeChatMiniWxPay(data)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
+					}
+				})
+			},
+			async WeChatMiniWxPay(data){
 				const wechatCode = await authorize.getCode('weixin')
 				const wechatCode = await authorize.getCode('weixin')
 				this.PayService.WeChatMiniWxPay(
 				this.PayService.WeChatMiniWxPay(
 					{
 					{

+ 10 - 0
services/pay.service.js

@@ -21,4 +21,14 @@ export default class PayService {
 			isLoading: true ,
 			isLoading: true ,
 		})
 		})
 	}
 	}
+	/**
+	 *小程序线上支付开关
+	 */
+	PayOrderOnLineSwitch (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/PayOrder/onLineSwitch', 
+			data, 
+			isLoading: true ,
+		})
+	}
 }
 }