Browse Source

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

hwq 3 năm trước cách đây
mục cha
commit
96aa0e63b4
3 tập tin đã thay đổi với 532 bổ sung434 xóa
  1. 498 425
      pages/money/pay.vue
  2. 31 7
      pages/order/createOrder.vue
  3. 3 2
      pages/prefecture/detail.vue

+ 498 - 425
pages/money/pay.vue

@@ -1,426 +1,499 @@
-<template>
-	<view class="app">
-		<view class="price-box">
-			<text>支付金额</text>
-			<text class="price">{{ money }}</text>
-		</view>
-		<view class="pay-type-list">
-			<view class="type-item b-b" @click="changePayType(1)">
-				<text class="icon iconfont iconweixin"></text>
-				<view class="con">
-					<text class="tit">微信支付</text>
-					<text>推荐使用微信支付</text>
-				</view>
-				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 1"></radio></label>
-			</view>
-			<!-- <view class="type-item b-b" @click="changePayType(2)">
-				<text class="icon iconfont iconzhifubao"></text>
-				<view class="con"><text class="tit">支付宝支付</text></view>
-				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 2"></radio></label>
-			</view> -->
-			<view class="type-item" @click="changePayType(3)" v-show="goodsType === 0">
-				<text class="icon iconfont iconyue"></text>
-				<view class="con">
-					<text class="tit">余额支付</text>
-					<text>可用余额 ¥{{ now_money }}</text>
-				</view>
-				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
-			</view>
-			<view class="type-item" @click="changePayType(4)" v-show="goodsType === 0">
-				<text class="icon iconfont" style="color:#00BCD4;">&#xe65d;</text>
-				<view class="con">
-					<text class="tit">消费券</text>
-					<text>可用余额 ¥{{ consumer }}</text>
-				</view>
-				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 4"></radio></label>
-			</view>
-		</view>
-		<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
-	</view>
-</template>
-
-<script>
-import { computedOrderkey, balance, createOrderkey, orderPay } from '@/api/money.js';
-import { mapState } from 'vuex';
-export default {
-	data() {
-		return {
-			payType: 1, //支付类型
-			// #ifdef H5
-			payName: 'weixin',
-			// #endif
-			// #ifdef MP-WEIXIN
-			payName: 'routine',
-			// #endif
-			// #ifdef APP-PLUS
-			payName: 'weixin',
-			// #endif
-			orderInfo: {},
-			money: 0.0, //订单金额
-			now_money: 0.0, //余额
-			consumer:0.0,//消费券
-			orderKey: '',
-			orderId: '', //保存订单id
-			payLoding: false, //判断是否支付中
-			type: '', //判断是否从订单中进入
-			// #ifdef H5
-			froms: '', //保存h5中数据来源对象
-			// #endif
-			pinkid: '', //保存拼团商品id
-			checkedPoints: '', //保存是否用积分抵扣商品
-			goodsType: 0 //商品类型1秒杀商品0为普通商品2为拼团商品
-		};
-	},
-	computed: {
-		// #ifdef H5
-		...mapState(['weichatObj'])
-		// #endif
-	},
-	onLoad(options) {
-		console.log(uni.getStorageSync('token'));
-		this.goodsType = +options.goodsType || 0;
-		//判断是否为新订单
-		if (options.type == 1) {
-			this.type = 1;
-			this.orderId = options.ordid;
-			this.money = options.money;
-			// 判断支付类型
-			if (options.payType == 1) {
-				this.checkedPoints = true;
-			}
-		} else {
-			this.orderKey = options.key;
-			let prepage = this.$api.prePage();
-			this.checkedPoints = prepage.checkedPoints;
-			computedOrderkey({
-				orderkey: this.orderKey,
-				addressId: prepage.addressData.id, //地址编号
-				useIntegral: prepage.checkedPoints ? 1 : 0,
-				is_change: prepage.is_change ? 1 : 0, //判断是否全额抵扣0为否1为是
-				shipping_type: prepage.tabCurrentIndex + 1 //提货方式 1 快递 2自提
-			}).then(({ data }) => {
-				// 获取支付金额
-				this.money = data.result.pay_price;
-			});
-			// 保存pinkid
-			if (options.pinkid) {
-				this.pinkid = options.pinkid;
-			}
-		}
-		balance({}).then(({ data }) => {
-			// 获取余额
-			this.now_money = data.now_money;
-			this.consumer = data.consumer
-		});
-	},
-	methods: {
-		//选择支付方式
-		changePayType(type) {
-			this.payType = type;
-			if (this.payType == 1) {
-				// #ifdef H5
-				this.payName = 'weixin';
-				// #endif
-				// #ifdef MP-WEIXIN
-				this.payName = 'routine';
-				// #endif
-				// #ifdef APP-PLUS
-				this.payName = 'weixin';
-				// #endif
-			}
-			if (this.payType == 2) {
-				this.payName = 'ali';
-			}
-			if (this.payType == 3) {
-				this.payName = 'yue';
-			}
-			if (this.payType == 4) {
-				this.payName = 'consumer';
-			}
-		},
-		// 支付金额
-		orderMoneyPay() {
-			let obj = this;
-			const data = {
-				uni: obj.orderId,
-				// #ifdef H5
-				from: obj.froms ? 'weixin' : 'H5', //来源
-				// #endif
-				// #ifdef MP-WEIXIN
-				from: 'routine', //来源
-				// #endif
-				// #ifdef APP-PLUS
-				from: 'weixinapp', //来源
-				// #endif
-				paytype: obj.payName //支付类型  weixin-微信 yue-余额
-			};
-			console.log(data);
-			orderPay(data)
-				.then(e => {
-					console.log(e);
-					// 判断是否为余额支付
-					if (obj.payName == 'yue') {
-						if (e.status == 200 && e.data.status == 'SUCCESS') {
-							obj.paySuccessTo();
-						} else {
-							obj.$api.msg(msg);
-						}
-					}
-					// #ifdef H5
-					if (obj.payName == 'weixin') {
-						let da = e.data.result.jsConfig;
-						obj.weichatObj.chooseWXPay({
-							timestamp: da.timestamp,
-							nonceStr: da.nonceStr,
-							package: da.package,
-							signType: da.signType,
-							paySign: da.paySign,
-							success: function(res) {
-								obj.paySuccessTo();
-							}
-						});
-					}
-					// #endif
-					// #ifdef MP-WEIXIN
-					if (obj.payName == 'routine') {
-						let da = e.data.result.jsConfig;
-						wx.requestPayment({
-							timeStamp: da.timestamp,
-							nonceStr: da.nonceStr,
-							package: da.package,
-							signType: da.signType,
-							paySign: da.paySign,
-							success: function(res) {
-								obj.paySuccessTo();
-							}
-						});
-					}
-					// #endif
-					// #ifdef APP-PLUS
-					if (obj.payName == 'weixin') {
-						let da = e.data.result.jsConfig;
-						uni.requestPayment({
-							provider:'wxpay',
-							orderInfo:da,
-							success:function () {
-								obj.paySuccessTo();
-							}
-						})
-					}
-					// #endif
-					obj.payLoding = false;
-				})
-				.catch(e => {
-					// 支付完成
-					obj.payLoding = false;
-					console.log(e);
-				});
-		},
-		// 支付成功跳转
-		paySuccessTo() {
-			uni.redirectTo({
-				url: '/pages/money/paySuccess?orderid=' + this.orderId
-			});
-		},
-		//确认支付
-		confirm: async function() {
-			let obj = this;
-			// 判断账户余额是否充足
-			if (obj.payName == 'yue' && +obj.now_money < obj.money) {
-				uni.showModal({
-					title: '提示',
-					content: '账户余额不足!',
-					showCancel: false,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-				return;
-			}
-			// 判断消费券
-			if (obj.payName == 'consumer' && +obj.consumer < obj.money) {
-				uni.showModal({
-					title: '提示',
-					content: '账户消费券不足!',
-					showCancel: false,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-				return;
-			}
-			// 支付中
-			obj.payLoding = true;
-			// #ifdef H5
-			// 获取当前是否为微信浏览器
-			obj.froms = uni.getStorageSync('weichatBrowser') || '';
-			// #endif
-			// 判断是否为未支付订单中跳转进入
-			if (obj.type != 1) {
-				// 初次生成订单
-				obj.firstCreateOrder();
-			} else {
-				// 已经生成订单未支付
-				obj.orderMoneyPay();
-			}
-		},
-		// 初次订单创建
-		firstCreateOrder() {
-			let obj = this;
-			// 获取下单页面数据
-			let prepage = obj.$api.prePage();
-			let data = {
-				real_name: prepage.addressData.real_name, //联系人名称
-				phone: prepage.addressData.phone, //联系人号码
-				// couponId: prepage.couponChecked.id, //优惠券编号
-				addressId: prepage.addressData.id, //支付地址id
-				useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
-				payType: obj.payName, //支付类型  weixin-微信 yue-余额
-				mark: prepage.desc, //备注
-				// #ifdef H5
-				from: obj.froms ? 'weixin' : 'H5', //来源
-				// #endif
-				// #ifdef MP-WEIXIN
-				from: 'routine', //来源
-				// #endif
-				// #ifdef APP-PLUS
-				from: 'weixinapp', //来源
-				// #endif
-				shipping_type: prepage.tabCurrentIndex + 1, //提货方式 1 快递 2自提
-				is_change: prepage.is_change ? 1 : 0, //判断是否全额抵扣0为否1为是
-				store_id: prepage.tabCurrentIndex == 1 ? prepage.shopAddress.id : ''
-			};
-			console.log(data);
-			console.log( obj.payName);
-			// 判断是否拼团商品
-			if (obj.pinkid) {
-				data.pinkId = obj.pinkid;
-			}
-			// 生成订单
-			createOrderkey(data, obj.orderKey)
-				.then(({ data, status, msg }) => {
-					// 判断是否支付成功
-					// 判断是否支付失败
-					if (data.status == 'ORDER_EXIST') {
-						uni.showModal({
-							title: '提示',
-							content: msg,
-							showCancel: false
-						});
-						obj.payLoding = false;
-						return;
-					}
-
-					// 保存订单号
-					obj.orderId = data.result.orderId;
-					// 判断是否微信支付成功
-					if (data.status == 'SUCCESS' && obj.payName == 'weixin' && msg == '微信支付成功') {
-						obj.paySuccessTo();
-						return;
-					}
-					// 判断是否为余额支付
-					if (obj.payName == 'yue'||obj.payName == 'consumer') {
-						if (status == 200) {
-							obj.paySuccessTo();
-						} else {
-							obj.payLoding = false;
-							obj.$api.msg(msg);
-						}
-					} else {
-						// 立即支付
-						obj.orderMoneyPay();
-					}
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-.app {
-	width: 100%;
-}
-
-.price-box {
-	background-color: #fff;
-	height: 265upx;
-	display: flex;
-	flex-direction: column;
-	justify-content: center;
-	align-items: center;
-	font-size: 28upx;
-	color: #909399;
-
-	.price {
-		font-size: 50upx;
-		color: #303133;
-		margin-top: 12upx;
-		&:before {
-			content: '¥';
-			font-size: 40upx;
-		}
-	}
-}
-
-.pay-type-list {
-	margin-top: 20upx;
-	background-color: #fff;
-	padding-left: 60upx;
-	.type-item {
-		height: 120upx;
-		padding: 20upx 0;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		padding-right: 60upx;
-		font-size: 30upx;
-		position: relative;
-	}
-
-	.icon {
-		width: 100upx;
-		font-size: 52upx;
-	}
-	.iconyue {
-		color: #fe8e2e;
-	}
-	.iconweixin {
-		color: #36cb59;
-	}
-	.iconzhifubao {
-		color: #01aaef;
-	}
-	.tit {
-		font-size: $font-lg;
-		color: $font-color-dark;
-		margin-bottom: 4upx;
-	}
-	.con {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		font-size: $font-sm;
-		color: $font-color-light;
-	}
-}
-.mix-btn {
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	width: 630upx;
-	height: 80upx;
-	margin: 80upx auto 30upx;
-	font-size: $font-lg;
-	color: #fff;
-	background-color: $base-color;
-	border-radius: 10upx;
-	/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
-}
-
-.clickbg {
-	background-color: $color-gray !important;
-}
+<template>
+	<view class="app">
+		<view class="price-box">
+			<text>支付金额</text>
+			<text class="price" v-if="is_consumer == 0">{{ money }}</text>
+			<text class="price1" v-if="is_consumer == 1">
+				<image src="../../static/icon/xfq.png" mode=""></image>{{ money }}
+			</text>
+		</view>
+		<view class="pay-type-list">
+			<template v-if="is_consumer == 0">
+				<view class="type-item b-b" @click="changePayType(1)">
+					<text class="icon iconfont iconweixin"></text>
+					<view class="con">
+						<text class="tit">微信支付</text>
+						<text>推荐使用微信支付</text>
+					</view>
+					<label class="radio">
+						<radio value="" color="#5dbc7c" :checked="payType == 1"></radio>
+					</label>
+				</view>
+				<!-- <view class="type-item b-b" @click="changePayType(2)">
+					<text class="icon iconfont iconzhifubao"></text>
+					<view class="con"><text class="tit">支付宝支付</text></view>
+					<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 2"></radio></label>
+				</view> -->
+				<view class="type-item" @click="changePayType(3)" v-show="goodsType === 0">
+					<text class="icon iconfont iconyue"></text>
+					<view class="con">
+						<text class="tit">余额支付</text>
+						<text>可用余额 ¥{{ now_money }}</text>
+					</view>
+					<label class="radio">
+						<radio value="" color="#5dbc7c" :checked="payType == 3"></radio>
+					</label>
+				</view>
+			</template> 
+			<template v-if="is_consumer == 1">
+				<view class="type-item" @click="changePayType(4)" v-show="goodsType === 0">
+					<!-- <text class="icon iconfont" style="color:#00BCD4;">&#xe65d;</text> -->
+					<image src="../../static/icon/dhq.png" mode=""></image>
+					<view class="con">
+						<text class="tit">消费券</text>
+						<text>可用余额 {{ consumer }}</text>
+					</view>
+					<label class="radio">
+						<radio value="" color="#5dbc7c" :checked="payType == 4"></radio>
+					</label>
+				</view>
+			</template>
+			
+		</view>
+		<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
+	</view>
+</template>
+
+<script>
+	import { getUserInfo } from '@/api/login.js';
+	import {
+		computedOrderkey,
+		balance,
+		createOrderkey,
+		orderPay
+	} from '@/api/money.js';
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				payType: 1, //支付类型
+				// #ifdef H5
+				payName: 'weixin',
+				// #endif
+				// #ifdef MP-WEIXIN
+				payName: 'routine',
+				// #endif
+				// #ifdef APP-PLUS
+				payName: 'weixin',
+				// #endif
+				orderInfo: {},
+				money: 0.0, //订单金额
+				now_money: 0.0, //余额
+				consumer: 0.0, //消费券
+				orderKey: '',
+				orderId: '', //保存订单id
+				payLoding: false, //判断是否支付中
+				type: '', //判断是否从订单中进入
+				// #ifdef H5
+				froms: '', //保存h5中数据来源对象
+				// #endif
+				pinkid: '', //保存拼团商品id
+				checkedPoints: '', //保存是否用积分抵扣商品
+				goodsType: 0, //商品类型1秒杀商品0为普通商品2为拼团商品
+				is_consumer: 0,
+			};
+		},
+		computed: {
+			// #ifdef H5
+			...mapState(['weichatObj'])
+			// #endif
+		},
+		onLoad(options) {
+			console.log(uni.getStorageSync('token'));
+			this.goodsType = +options.goodsType || 0;
+			this.getConsumerNum()
+			if (options.consumer) {
+				this.is_consumer = options.consumer
+				this.payType = 4
+				this.payName = 'consumer'
+			}
+			//判断是否为新订单
+			if (options.type == 1) {
+				this.type = 1;
+				this.orderId = options.ordid;
+				this.money = options.money;
+				// 判断支付类型
+				if (options.payType == 1) {
+					this.checkedPoints = true;
+				}
+			} else {
+				this.orderKey = options.key;
+				let prepage = this.$api.prePage();
+				this.checkedPoints = prepage.checkedPoints;
+				computedOrderkey({
+					orderkey: this.orderKey,
+					addressId: prepage.addressData.id, //地址编号
+					useIntegral: prepage.checkedPoints ? 1 : 0,
+					is_change: prepage.is_change ? 1 : 0, //判断是否全额抵扣0为否1为是
+					shipping_type: prepage.tabCurrentIndex + 1, //提货方式 1 快递 2自提
+					is_consumer: this.is_consumer
+				}).then(({
+					data
+				}) => {
+					// 获取支付金额
+					this.money = data.result.pay_price;
+				});
+				// 保存pinkid
+				if (options.pinkid) {
+					this.pinkid = options.pinkid;
+				}
+			}
+			balance({}).then(({
+				data
+			}) => {
+				// 获取余额
+				this.now_money = data.now_money;
+				// this.consumer = data.consumer
+			});
+		},
+		methods: {
+			// 获取消费券余额
+			getConsumerNum() {
+				getUserInfo().then(({data}) => {
+					this.consumer = data.consumer
+				})
+			},
+			//选择支付方式
+			changePayType(type) {
+				this.payType = type;
+				if (this.payType == 1) {
+					// #ifdef H5
+					this.payName = 'weixin';
+					// #endif
+					// #ifdef MP-WEIXIN
+					this.payName = 'routine';
+					// #endif
+					// #ifdef APP-PLUS
+					this.payName = 'weixin';
+					// #endif
+				}
+				if (this.payType == 2) {
+					this.payName = 'ali';
+				}
+				if (this.payType == 3) {
+					this.payName = 'yue';
+				}
+				if (this.payType == 4) {
+					this.payName = 'consumer';
+				}
+			},
+			// 支付金额
+			orderMoneyPay() {
+				let obj = this;
+				const data = {
+					uni: obj.orderId,
+					// #ifdef H5
+					from: obj.froms ? 'weixin' : 'H5', //来源
+					// #endif
+					// #ifdef MP-WEIXIN
+					from: 'routine', //来源
+					// #endif
+					// #ifdef APP-PLUS
+					from: 'weixinapp', //来源
+					// #endif
+					paytype: obj.payName //支付类型  weixin-微信 yue-余额
+				};
+				console.log(data);
+				orderPay(data)
+					.then(e => {
+						console.log(e);
+						// 判断是否为余额支付
+						if (obj.payName == 'yue') {
+							if (e.status == 200 && e.data.status == 'SUCCESS') {
+								obj.paySuccessTo();
+							} else {
+								obj.$api.msg(msg);
+							}
+						}
+						// #ifdef H5
+						if (obj.payName == 'weixin') {
+							let da = e.data.result.jsConfig;
+							obj.weichatObj.chooseWXPay({
+								timestamp: da.timestamp,
+								nonceStr: da.nonceStr,
+								package: da.package,
+								signType: da.signType,
+								paySign: da.paySign,
+								success: function(res) {
+									obj.paySuccessTo();
+								}
+							});
+						}
+						// #endif
+						// #ifdef MP-WEIXIN
+						if (obj.payName == 'routine') {
+							let da = e.data.result.jsConfig;
+							wx.requestPayment({
+								timeStamp: da.timestamp,
+								nonceStr: da.nonceStr,
+								package: da.package,
+								signType: da.signType,
+								paySign: da.paySign,
+								success: function(res) {
+									obj.paySuccessTo();
+								}
+							});
+						}
+						// #endif
+						// #ifdef APP-PLUS
+						if (obj.payName == 'weixin') {
+							let da = e.data.result.jsConfig;
+							uni.requestPayment({
+								provider: 'wxpay',
+								orderInfo: da,
+								success: function() {
+									obj.paySuccessTo();
+								}
+							})
+						}
+						// #endif
+						obj.payLoding = false;
+					})
+					.catch(e => {
+						// 支付完成
+						obj.payLoding = false;
+						console.log(e);
+					});
+			},
+			// 支付成功跳转
+			paySuccessTo() {
+				uni.redirectTo({
+					url: '/pages/money/paySuccess?orderid=' + this.orderId
+				});
+			},
+			//确认支付
+			confirm: async function() {
+				let obj = this;
+				// 判断账户余额是否充足
+				if (obj.payName == 'yue' && +obj.now_money < obj.money) {
+					uni.showModal({
+						title: '提示',
+						content: '账户余额不足!',
+						showCancel: false,
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+					return;
+				}
+				// 判断消费券
+				if (obj.payName == 'consumer' && +obj.consumer < obj.money) {
+					uni.showModal({
+						title: '提示',
+						content: '账户消费券不足!',
+						showCancel: false,
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+					return;
+				}
+				// 支付中
+				obj.payLoding = true;
+				// #ifdef H5
+				// 获取当前是否为微信浏览器
+				obj.froms = uni.getStorageSync('weichatBrowser') || '';
+				// #endif
+				// 判断是否为未支付订单中跳转进入
+				if (obj.type != 1) {
+					// 初次生成订单
+					obj.firstCreateOrder();
+				} else {
+					// 已经生成订单未支付
+					obj.orderMoneyPay();
+				}
+			},
+			// 初次订单创建
+			firstCreateOrder() {
+				let obj = this;
+				// 获取下单页面数据
+				let prepage = obj.$api.prePage();
+				let data = {
+					real_name: prepage.addressData.real_name, //联系人名称
+					phone: prepage.addressData.phone, //联系人号码
+					// couponId: prepage.couponChecked.id, //优惠券编号
+					addressId: prepage.addressData.id, //支付地址id
+					useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
+					payType: obj.payName, //支付类型  weixin-微信 yue-余额
+					mark: prepage.desc, //备注
+					// #ifdef H5
+					from: obj.froms ? 'weixin' : 'H5', //来源
+					// #endif
+					// #ifdef MP-WEIXIN
+					from: 'routine', //来源
+					// #endif
+					// #ifdef APP-PLUS
+					from: 'weixinapp', //来源
+					// #endif
+					shipping_type: prepage.tabCurrentIndex + 1, //提货方式 1 快递 2自提
+					is_change: prepage.is_change ? 1 : 0, //判断是否全额抵扣0为否1为是
+					store_id: prepage.tabCurrentIndex == 1 ? prepage.shopAddress.id : '',
+					is_consumer: obj.is_consumer
+				};
+				console.log(data);
+				console.log(obj.payName);
+				// 判断是否拼团商品
+				if (obj.pinkid) {
+					data.pinkId = obj.pinkid;
+				}
+				// 生成订单
+				createOrderkey(data, obj.orderKey)
+					.then(({
+						data,
+						status,
+						msg
+					}) => {
+						// 判断是否支付成功
+						// 判断是否支付失败
+						if (data.status == 'ORDER_EXIST') {
+							uni.showModal({
+								title: '提示',
+								content: msg,
+								showCancel: false
+							});
+							obj.payLoding = false;
+							return;
+						}
+
+						// 保存订单号
+						obj.orderId = data.result.orderId;
+						// 判断是否微信支付成功
+						if (data.status == 'SUCCESS' && obj.payName == 'weixin' && msg == '微信支付成功') {
+							obj.paySuccessTo();
+							return;
+						}
+						// 判断是否为余额支付
+						if (obj.payName == 'yue' || obj.payName == 'consumer') {
+							if (status == 200) {
+								obj.paySuccessTo();
+							} else {
+								obj.payLoding = false;
+								obj.$api.msg(msg);
+							}
+						} else {
+							// 立即支付
+							obj.orderMoneyPay();
+						}
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.app {
+		width: 100%;
+	}
+
+	.price-box {
+		background-color: #fff;
+		height: 265upx;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		font-size: 28upx;
+		color: #909399;
+
+		.price {
+			font-size: 50upx;
+			color: #303133;
+			margin-top: 12upx;
+
+			&:before {
+				content: '¥';
+				font-size: 40upx;
+			}
+		}
+
+		.price1 {
+			font-size: 50upx;
+			color: #303133;
+			margin-top: 12upx;
+
+			image {
+
+				width: 32rpx;
+				height: 32rpx;
+				margin-right: 8rpx;
+
+			}
+		}
+	}
+
+	.pay-type-list {
+		margin-top: 20upx;
+		background-color: #fff;
+		padding-left: 60upx;
+
+		.type-item {
+			height: 120upx;
+			padding: 20upx 0;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding-right: 60upx;
+			font-size: 30upx;
+			position: relative;
+			image {
+				width: 52rpx;
+				height: 52rpx;
+				margin-right: 52rpx;
+			}
+		}
+
+		.icon {
+			width: 100upx;
+			font-size: 52upx;
+		}
+
+		.iconyue {
+			color: #fe8e2e;
+		}
+
+		.iconweixin {
+			color: #36cb59;
+		}
+
+		.iconzhifubao {
+			color: #01aaef;
+		}
+
+		.tit {
+			font-size: $font-lg;
+			color: $font-color-dark;
+			margin-bottom: 4upx;
+		}
+
+		.con {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			font-size: $font-sm;
+			color: $font-color-light;
+		}
+	}
+
+	.mix-btn {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 630upx;
+		height: 80upx;
+		margin: 80upx auto 30upx;
+		font-size: $font-lg;
+		color: #fff;
+		background-color: $base-color;
+		border-radius: 10upx;
+		/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
+	}
+
+	.clickbg {
+		background-color: $color-gray !important;
+	}
 </style>

+ 31 - 7
pages/order/createOrder.vue

@@ -118,7 +118,12 @@
 		<view class="yt-list">
 			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">商品金额</text>
-				<text class="cell-tip">¥{{ payAllMoney }}</text>
+				<text class="cell-tip" v-if="is_consumer == 0">¥{{ payAllMoney }}</text>
+				<text class="cell-tip" v-if="is_consumer == 1">
+					<image src="../../static/icon/xfq.png" mode="" class="cell-tip-1"></image>
+				{{ payAllMoney }}
+				</text>
+				<!-- <text class="cell-tip">¥{{ payAllMoney }}</text> -->
 			</view>
 			<view class="yt-list-cell b-b" v-if="(checkedPoints || is_change) && integralShow">
 				<text class="cell-tit clamp">扣除积分</text>
@@ -134,7 +139,8 @@
 		<view class="footer">
 			<view class="price-content">
 				<text>实付款</text>
-				<text class="price-tip">¥</text>
+				<text class="price-tip" v-if="is_consumer == 0">¥</text>
+				<image src="../../static/icon/xfq.png" mode="" v-if="is_consumer == 1" class="price-top-1"></image>
 				<text class="price">{{ payPrice }}</text>
 			</view>
 			<text class="submit" :class="{ submitNo: !payType }" @click="payType ? submit() : ''">提交订单</text>
@@ -234,12 +240,16 @@ export default {
 			pinkid: '', //保存拼团商品id
 			is_change: false, //判断是否全额抵扣0为否1为是
 			inte_top: 0, //积分抵扣上限
-			goodsType: 0 //0为普通商品2为拼团1为秒杀
+			goodsType: 0, //0为普通商品2为拼团1为秒杀
+			is_consumer: 0, //1为消费券商品
 		};
 	},
 	onLoad(option) {
 		this.goodsType = option.goodsType || 0;
-		// 判断是否为拼团商品
+		// 判断是否为拼团商品
+		if(option.consumer) {
+			this.is_consumer = option.consumer
+		}
 		if (option.type == 'pink') {
 			this.pinkid = option.pinkId;
 			this.goodsType = 2;
@@ -334,7 +344,8 @@ export default {
 					is_change: this.is_change ? 1 : 0,
 					latitude: this.addressData.latitude,
 					longitude: this.addressData.longitude,
-					addressId: this.addressData.id
+					addressId: this.addressData.id,
+					is_consumer: this.is_consumer
 				})
 					.then(({ data }) => {
 						this.payType = true;
@@ -430,7 +441,10 @@ export default {
 				obj.addressData.real_name = obj.pickUpInfo.real_name;
 				obj.addressData.phone = obj.pickUpInfo.phone;
 			}
-			let url = '/pages/money/pay?key=' + obj.orderKey + '&goodsType=' + obj.goodsType;
+			let url = '/pages/money/pay?key=' + obj.orderKey + '&goodsType=' + obj.goodsType;
+			if(obj.is_consumer == 1) {
+				url += '&consumer=1'
+			}
 			if (obj.pinkid) {
 				url += '&pinkid=' + obj.pinkid;
 			}
@@ -691,7 +705,11 @@ page {
 			color: $base-color;
 		}
 	}
-
+	.cell-tip-1 {
+		width: 28rpx;
+		height: 28rpx;
+		margin-right: 10rpx;
+	}
 	&.desc-cell {
 		.cell-tit {
 			max-width: 90rpx;
@@ -765,6 +783,12 @@ page {
 	.price-tip {
 		color: $font-color-base;
 		margin-left: 8rpx;
+	}
+	.price-top-1 {
+		margin-left: 8rpx;
+		height: 32rpx;
+		width: 32rpx;
+		margin-right: 8rpx;
 	}
 	.price {
 		font-size: 36rpx;

+ 3 - 2
pages/prefecture/detail.vue

@@ -410,7 +410,8 @@ export default {
 				cartNum: obj.goodsNumber, //商品数量
 				uniqueId: obj.uniqueId, //商品标签
 				new: '1', //商品是否新增加到购物车1为不加入0为加入
-				mer_id: obj.shopId
+				mer_id: obj.shopId,
+				is_consumer: 1,
 			};
 			if (obj.type == 2) {
 				data.new = 0;
@@ -442,7 +443,7 @@ export default {
 					if (obj.type == 1) {
 						// 跳转到支付页
 						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType
+							url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType + '&consumer=1'
 						});
 					}
 					if (obj.type == 2) {