|
@@ -2,31 +2,33 @@
|
|
|
<view class="app">
|
|
<view class="app">
|
|
|
<view class="price-box">
|
|
<view class="price-box">
|
|
|
<text>支付金额</text>
|
|
<text>支付金额</text>
|
|
|
- <text class="price">{{ money.toFixed(2) }}</text>
|
|
|
|
|
|
|
+ <text class="price">{{ money }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="pay-type-list">
|
|
<view class="pay-type-list">
|
|
|
|
|
+ <!-- #ifndef APP-PLUS -->
|
|
|
<view class="type-item b-b" @click="changePayType(1)">
|
|
<view class="type-item b-b" @click="changePayType(1)">
|
|
|
<text class="icon iconfont iconweixin"></text>
|
|
<text class="icon iconfont iconweixin"></text>
|
|
|
<view class="con">
|
|
<view class="con">
|
|
|
<text class="tit">微信支付</text>
|
|
<text class="tit">微信支付</text>
|
|
|
<text>推荐使用微信支付</text>
|
|
<text>推荐使用微信支付</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <label class="radio"><radio value="" color="#ee2f72" :checked="payType == 1"></radio></label>
|
|
|
|
|
|
|
+ <label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 1"></radio></label>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <!-- #endif -->
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
<view class="type-item b-b" @click="changePayType(2)">
|
|
<view class="type-item b-b" @click="changePayType(2)">
|
|
|
<text class="icon iconfont iconzhifubao"></text>
|
|
<text class="icon iconfont iconzhifubao"></text>
|
|
|
<view class="con"><text class="tit">支付宝支付</text></view>
|
|
<view class="con"><text class="tit">支付宝支付</text></view>
|
|
|
- <label class="radio"><radio value="" color="#ee2f72" :checked="payType == 2"></radio></label>
|
|
|
|
|
|
|
+ <label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 2"></radio></label>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
- <view class="type-item" @click="changePayType(3)" v-if="yue">
|
|
|
|
|
|
|
+ <view class="type-item" @click="changePayType(3)" v-if="isyue == 'false'">
|
|
|
<text class="icon iconfont iconyue"></text>
|
|
<text class="icon iconfont iconyue"></text>
|
|
|
<view class="con">
|
|
<view class="con">
|
|
|
<text class="tit">余额支付</text>
|
|
<text class="tit">余额支付</text>
|
|
|
<text>可用余额 ¥{{ now_money }}</text>
|
|
<text>可用余额 ¥{{ now_money }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <label class="radio"><radio value="" color="#ee2f72" :checked="payType == 3"></radio></label>
|
|
|
|
|
|
|
+ <label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
|
|
<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
|
|
@@ -36,17 +38,14 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { balance } from '@/api/wallet.js';
|
|
import { balance } from '@/api/wallet.js';
|
|
|
import { createOrderkey, computedOrderkey, orderPay } from '@/api/order.js';
|
|
import { createOrderkey, computedOrderkey, orderPay } from '@/api/order.js';
|
|
|
|
|
+import { getUserInfo } from '@/api/user.js';
|
|
|
import { mapState } from 'vuex';
|
|
import { mapState } from 'vuex';
|
|
|
|
|
+import { isIOS } from '@/utils/platform.js';
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
payType: 1, //支付类型
|
|
payType: 1, //支付类型
|
|
|
- // #ifdef H5
|
|
|
|
|
payName: 'weixin',
|
|
payName: 'weixin',
|
|
|
- // #endif
|
|
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- payName: 'weixin',
|
|
|
|
|
- // #endif
|
|
|
|
|
orderInfo: {},
|
|
orderInfo: {},
|
|
|
money: 0.0, //订单金额
|
|
money: 0.0, //订单金额
|
|
|
now_money: 0.0, //余额
|
|
now_money: 0.0, //余额
|
|
@@ -58,11 +57,7 @@ export default {
|
|
|
froms: '', //保存h5中数据来源对象
|
|
froms: '', //保存h5中数据来源对象
|
|
|
// #endif
|
|
// #endif
|
|
|
pinkid: '', //保存拼团商品id
|
|
pinkid: '', //保存拼团商品id
|
|
|
- store_id: 0,
|
|
|
|
|
- point_id: 0,
|
|
|
|
|
- shipping_type: 1,
|
|
|
|
|
- goodsType: 0,
|
|
|
|
|
- yue: false //是否开启余额抵扣
|
|
|
|
|
|
|
+ isyue: '' //是否开启零钱抵扣
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -71,57 +66,35 @@ export default {
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
- this.yue = options.isyue;
|
|
|
|
|
- if (options.store_id) {
|
|
|
|
|
- this.store_id = options.store_id;
|
|
|
|
|
- }
|
|
|
|
|
- if (options.goodstype) {
|
|
|
|
|
- this.goodsType = options.goodstype;
|
|
|
|
|
- console.log(this.goodsType, 'this.goodsTypethis.goodsTypethis.goodsType');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.isyue = options.isyue;
|
|
|
|
|
+ this.ispg = uni.getSystemInfoSync().platform;
|
|
|
|
|
+ console.log(this.ispg);
|
|
|
if (options.type == 1) {
|
|
if (options.type == 1) {
|
|
|
- console.log(options.ordid, options.money, '------------------------');
|
|
|
|
|
this.type = 1;
|
|
this.type = 1;
|
|
|
this.orderId = options.ordid;
|
|
this.orderId = options.ordid;
|
|
|
- this.money = options.money * 1;
|
|
|
|
|
|
|
+ this.money = options.money;
|
|
|
} else {
|
|
} else {
|
|
|
this.orderKey = options.key;
|
|
this.orderKey = options.key;
|
|
|
let prepage = this.$api.prePage();
|
|
let prepage = this.$api.prePage();
|
|
|
computedOrderkey({
|
|
computedOrderkey({
|
|
|
orderkey: this.orderKey,
|
|
orderkey: this.orderKey,
|
|
|
- couponId: prepage.couponChecked ? prepage.couponChecked.id : '', //优惠券编号
|
|
|
|
|
|
|
+ couponId: prepage.couponChecked.id, //优惠券编号
|
|
|
addressId: prepage.addressData.id, //地址编号
|
|
addressId: prepage.addressData.id, //地址编号
|
|
|
useIntegral: prepage.checkedPoints ? 1 : 0,
|
|
useIntegral: prepage.checkedPoints ? 1 : 0,
|
|
|
- useIntegral: prepage.checkedYue ? 1 : 0,
|
|
|
|
|
- shipping_type: prepage.shipping_type
|
|
|
|
|
|
|
+ useNowMoney: prepage.checkedYue ? 1 : 0
|
|
|
}).then(({ data }) => {
|
|
}).then(({ data }) => {
|
|
|
// 获取支付金额
|
|
// 获取支付金额
|
|
|
- console.log(data, '123456');
|
|
|
|
|
- this.money = +data.result.pay_price;
|
|
|
|
|
- //快递
|
|
|
|
|
- // if (this.shipping_type == 1) {
|
|
|
|
|
- // this.money = +data.result.pay_price + +data.result.deposit;
|
|
|
|
|
- // }
|
|
|
|
|
- //自提
|
|
|
|
|
- // if (this.shipping_type == 2) {
|
|
|
|
|
- // this.money = +data.result.pay_price + +data.result.deposit - +data.result.pay_postage;
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ this.money = data.result.pay_price;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
// 保存pinkid
|
|
// 保存pinkid
|
|
|
if (options.pinkid) {
|
|
if (options.pinkid) {
|
|
|
this.pinkid = options.pinkid;
|
|
this.pinkid = options.pinkid;
|
|
|
}
|
|
}
|
|
|
- if (options.point_id) {
|
|
|
|
|
- this.point_id = options.point_id;
|
|
|
|
|
- console.log(this.point_id, 'this.point_id+++++++++++++');
|
|
|
|
|
- }
|
|
|
|
|
- if (options.shipping_type) {
|
|
|
|
|
- this.shipping_type = options.shipping_type;
|
|
|
|
|
- }
|
|
|
|
|
// 载入余额
|
|
// 载入余额
|
|
|
- balance({}).then(({ data }) => {
|
|
|
|
|
|
|
+ getUserInfo({}).then(({ data }) => {
|
|
|
// 获取余额
|
|
// 获取余额
|
|
|
|
|
+ console.log(data, '123456');
|
|
|
this.now_money = data.now_money;
|
|
this.now_money = data.now_money;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -138,10 +111,14 @@ export default {
|
|
|
if (this.payType == 3) {
|
|
if (this.payType == 3) {
|
|
|
this.payName = 'yue';
|
|
this.payName = 'yue';
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this.payType == 4) {
|
|
|
|
|
+ this.payName = 'brokerage';
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 支付金额
|
|
// 支付金额
|
|
|
orderMoneyPay() {
|
|
orderMoneyPay() {
|
|
|
let obj = this;
|
|
let obj = this;
|
|
|
|
|
+ console.log(obj.orderId, '编号');
|
|
|
orderPay({
|
|
orderPay({
|
|
|
uni: obj.orderId,
|
|
uni: obj.orderId,
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -164,8 +141,10 @@ export default {
|
|
|
obj.$api.msg(msg);
|
|
obj.$api.msg(msg);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //#ifndef APP-PLUS
|
|
|
if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
|
let da = e.data.result.jsConfig;
|
|
let da = e.data.result.jsConfig;
|
|
|
|
|
+ console.log(da, '支付打印');
|
|
|
let data = {
|
|
let data = {
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
timestamp: da.timestamp,
|
|
timestamp: da.timestamp,
|
|
@@ -180,32 +159,92 @@ export default {
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
|
obj.paySuccessTo();
|
|
obj.paySuccessTo();
|
|
|
},
|
|
},
|
|
|
- fail: () => {
|
|
|
|
|
- uni.switchTab({
|
|
|
|
|
- url: '/pages/cart/cart?state=0'
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ fail: e => {
|
|
|
|
|
+ console.log(e, '失败');
|
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
|
+ // url: '/pages/order/order?state=0'
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
if (obj.payName == 'weixin') {
|
|
if (obj.payName == 'weixin') {
|
|
|
- obj.weichatObj.chooseWXPay(data);
|
|
|
|
|
|
|
+ console.log(obj.money, '支付金额');
|
|
|
|
|
+ if (obj.money * 1 == 0) {
|
|
|
|
|
+ obj.paySuccessTo();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ obj.weichatObj.chooseWXPay(data);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
- console.log('开始支付');
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
|
- console.log('MP-WEIXIN++++++++++');
|
|
|
|
|
- console.log(obj.payName);
|
|
|
|
|
if (obj.payName == 'weixin') {
|
|
if (obj.payName == 'weixin') {
|
|
|
- console.log('开始支付');
|
|
|
|
|
- wx.requestPayment(data);
|
|
|
|
|
|
|
+ if (obj.money * 1 == 0) {
|
|
|
|
|
+ obj.paySuccessTo();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ wx.requestPayment(data);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
}
|
|
}
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ //#ifdef APP-PLUS
|
|
|
|
|
+ if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
|
|
|
+ let da = e.data.result.jsConfig;
|
|
|
|
|
+ console.log('--da--', da);
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ appid: da.appid,
|
|
|
|
|
+ noncestr: da.noncestr,
|
|
|
|
|
+ package: da.package,
|
|
|
|
|
+ partnerid: da.partnerid,
|
|
|
|
|
+ prepayid: da.prepayid,
|
|
|
|
|
+ timestamp: da.timestamp,
|
|
|
|
|
+ sign: da.sign
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log('--data--', data);
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: 'wxpay',
|
|
|
|
|
+ orderInfo: data,
|
|
|
|
|
+ success(res) {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付成功',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ obj.paySuccessTo();
|
|
|
|
|
+ },
|
|
|
|
|
+ fail(res) {
|
|
|
|
|
+ console.log(res, '失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (obj.payName == 'ali') {
|
|
|
|
|
+ const url = e.data.result.jsConfig;
|
|
|
|
|
+ console.log(url, 'url');
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: 'alipay',
|
|
|
|
|
+ orderInfo: url,
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付成功',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ obj.paySuccessTo();
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: e => {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ },
|
|
|
|
|
+ complete: () => {}
|
|
|
|
|
+ });
|
|
|
|
|
+ obj.payLoding = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ //#endif
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
obj.payLoding = false;
|
|
obj.payLoding = false;
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
// 支付完成
|
|
// 支付完成
|
|
|
|
|
+ uni.hideLoading();
|
|
|
obj.payLoding = false;
|
|
obj.payLoding = false;
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
});
|
|
});
|
|
@@ -214,97 +253,43 @@ export default {
|
|
|
paySuccessTo() {
|
|
paySuccessTo() {
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
- url: '/pages/money/paySuccess?orderid=' + this.orderId + '&mun=' + this.money
|
|
|
|
|
|
|
+ url: '/pages/money/paySuccess?orderid=' + this.orderId
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//确认支付
|
|
//确认支付
|
|
|
confirm: async function() {
|
|
confirm: async function() {
|
|
|
let obj = this;
|
|
let obj = this;
|
|
|
- wx.getSetting({
|
|
|
|
|
- withSubscriptions: true,
|
|
|
|
|
- success(res) {
|
|
|
|
|
- if (res['utyQMQe5vfiJt1CA3-Q3JnGd2_dQ3mdyY0K44Gpaut4'] == 'accept') {
|
|
|
|
|
- console.log('订阅成功');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- if (wx.requestSubscribeMessage) {
|
|
|
|
|
- wx.requestSubscribeMessage({
|
|
|
|
|
- tmplIds: ['utyQMQe5vfiJt1CA3-Q3JnGd2_dQ3mdyY0K44Gpaut4'],
|
|
|
|
|
- success(res) {
|
|
|
|
|
- console.log(res, '订阅消息');
|
|
|
|
|
- },
|
|
|
|
|
- fail(err) {
|
|
|
|
|
- console.log(err);
|
|
|
|
|
- },
|
|
|
|
|
- complete() {
|
|
|
|
|
- // 判断是否余额不足
|
|
|
|
|
- if (obj.payName == 'yue' && +obj.now_money < obj.money) {
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: '账户余额不足!',
|
|
|
|
|
- showCancel: false,
|
|
|
|
|
- success: res => {},
|
|
|
|
|
- fail: () => {},
|
|
|
|
|
- complete: () => {}
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: '支付中',
|
|
|
|
|
- mask: true
|
|
|
|
|
- });
|
|
|
|
|
- // 支付中
|
|
|
|
|
- obj.payLoding = true;
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- // 获取当前是否为微信浏览器
|
|
|
|
|
- obj.froms = uni.getStorageSync('weichatBrowser') || '';
|
|
|
|
|
- // #endif
|
|
|
|
|
- // 判断是否为未支付订单中跳转进入
|
|
|
|
|
- if (obj.type != 1) {
|
|
|
|
|
- // 初次生成订单
|
|
|
|
|
- console.log('初次生成订单');
|
|
|
|
|
- obj.firstCreateOrder();
|
|
|
|
|
- } else {
|
|
|
|
|
- // 已经生成订单未支付
|
|
|
|
|
- console.log('已经生成订单未支付');
|
|
|
|
|
- obj.orderMoneyPay();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 判断是否余额不足
|
|
|
|
|
+ if (obj.payName == 'yue' && +obj.now_money < obj.money) {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '账户余额不足!',
|
|
|
|
|
+ showCancel: false,
|
|
|
|
|
+ success: res => {},
|
|
|
|
|
+ fail: () => {},
|
|
|
|
|
+ complete: () => {}
|
|
|
});
|
|
});
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断是否余额不足
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: '支付中',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ });
|
|
|
|
|
+ // 支付中
|
|
|
|
|
+ obj.payLoding = true;
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ // 获取当前是否为微信浏览器
|
|
|
|
|
+ obj.froms = uni.getStorageSync('weichatBrowser') || '';
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // 判断是否为未支付订单中跳转进入
|
|
|
|
|
+ if (obj.type != 1) {
|
|
|
|
|
+ // 初次生成订单
|
|
|
|
|
+ obj.firstCreateOrder();
|
|
|
} else {
|
|
} else {
|
|
|
- // 判断是否余额不足
|
|
|
|
|
- if (obj.payName == 'yue' && +obj.now_money < obj.money) {
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: '账户余额不足!',
|
|
|
|
|
- showCancel: false,
|
|
|
|
|
- success: res => {},
|
|
|
|
|
- fail: () => {},
|
|
|
|
|
- complete: () => {}
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: '支付中',
|
|
|
|
|
- mask: true
|
|
|
|
|
- });
|
|
|
|
|
- // 支付中
|
|
|
|
|
- obj.payLoding = true;
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- // 获取当前是否为微信浏览器
|
|
|
|
|
- obj.froms = uni.getStorageSync('weichatBrowser') || '';
|
|
|
|
|
- // #endif
|
|
|
|
|
- // 判断是否为未支付订单中跳转进入
|
|
|
|
|
- if (obj.type != 1) {
|
|
|
|
|
- // 初次生成订单
|
|
|
|
|
- console.log('初次生成订单');
|
|
|
|
|
- obj.firstCreateOrder();
|
|
|
|
|
- } else {
|
|
|
|
|
- // 已经生成订单未支付
|
|
|
|
|
- console.log('已经生成订单未支付');
|
|
|
|
|
- obj.orderMoneyPay();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 已经生成订单未支付
|
|
|
|
|
+ obj.orderMoneyPay();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 初次订单创建
|
|
// 初次订单创建
|
|
@@ -312,17 +297,16 @@ export default {
|
|
|
let obj = this;
|
|
let obj = this;
|
|
|
// 获取下单页面数据
|
|
// 获取下单页面数据
|
|
|
let prepage = obj.$api.prePage();
|
|
let prepage = obj.$api.prePage();
|
|
|
- console.log(obj.goodsType, 'obj.goodsType+++++++++++++++++++');
|
|
|
|
|
|
|
+
|
|
|
let data = {
|
|
let data = {
|
|
|
- free_check: obj.goodsType == '3' ? '1' : '0',
|
|
|
|
|
real_name: prepage.addressData.real_name, //联系人名称
|
|
real_name: prepage.addressData.real_name, //联系人名称
|
|
|
phone: prepage.addressData.phone, //联系人号码
|
|
phone: prepage.addressData.phone, //联系人号码
|
|
|
couponId: prepage.couponChecked.id, //优惠券编号
|
|
couponId: prepage.couponChecked.id, //优惠券编号
|
|
|
addressId: prepage.addressData.id, //支付地址id
|
|
addressId: prepage.addressData.id, //支付地址id
|
|
|
useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
|
|
useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
|
|
|
|
|
+ useNowMoney: prepage.checkedYue ? 1 : 0, //是否余额抵扣
|
|
|
payType: obj.payName, //支付类型 weixin-微信 yue-余额
|
|
payType: obj.payName, //支付类型 weixin-微信 yue-余额
|
|
|
mark: prepage.desc, //备注
|
|
mark: prepage.desc, //备注
|
|
|
- time_area: prepage.time_area, //配送时间
|
|
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
from: obj.froms ? 'weixin' : 'H5', //来源
|
|
from: obj.froms ? 'weixin' : 'H5', //来源
|
|
|
// #endif
|
|
// #endif
|
|
@@ -332,23 +316,17 @@ export default {
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
from: 'app', //来源
|
|
from: 'app', //来源
|
|
|
// #endif
|
|
// #endif
|
|
|
- shipping_type: this.shipping_type //提货方式 1 快递 2自提
|
|
|
|
|
|
|
+ shipping_type: 1 //提货方式 1 快递 2自提
|
|
|
};
|
|
};
|
|
|
- if (obj.goodsType == '3') {
|
|
|
|
|
- data.free_check = '1';
|
|
|
|
|
- data.shipping_type = '2';
|
|
|
|
|
- } else {
|
|
|
|
|
- data.store_id = obj.store_id;
|
|
|
|
|
- data.point_id = obj.point_id;
|
|
|
|
|
- }
|
|
|
|
|
- console.log(data, '888888888887777777777777');
|
|
|
|
|
// 判断是否拼团商品
|
|
// 判断是否拼团商品
|
|
|
if (obj.pinkid) {
|
|
if (obj.pinkid) {
|
|
|
data.pinkId = obj.pinkid;
|
|
data.pinkId = obj.pinkid;
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(data, '订单参数', obj.orderKey, '订单key');
|
|
|
// 生成订单
|
|
// 生成订单
|
|
|
createOrderkey(data, obj.orderKey)
|
|
createOrderkey(data, obj.orderKey)
|
|
|
.then(({ data, status, msg }) => {
|
|
.then(({ data, status, msg }) => {
|
|
|
|
|
+ console.log(data, '生成订单');
|
|
|
// 判断是否支付失败
|
|
// 判断是否支付失败
|
|
|
if (data.status == 'ORDER_EXIST') {
|
|
if (data.status == 'ORDER_EXIST') {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -364,7 +342,7 @@ export default {
|
|
|
obj.orderId = data.result.orderId;
|
|
obj.orderId = data.result.orderId;
|
|
|
// 判断是否为余额支付
|
|
// 判断是否为余额支付
|
|
|
if (obj.payName == 'yue') {
|
|
if (obj.payName == 'yue') {
|
|
|
- if (status == 200 && data.status == 'SUCCESS') {
|
|
|
|
|
|
|
+ if (status == 200) {
|
|
|
obj.paySuccessTo();
|
|
obj.paySuccessTo();
|
|
|
} else {
|
|
} else {
|
|
|
obj.$api.msg(msg);
|
|
obj.$api.msg(msg);
|
|
@@ -375,8 +353,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
obj.payLoding = false;
|
|
obj.payLoding = false;
|
|
|
- console.log(e);
|
|
|
|
|
|
|
+ console.log(e, '123456789');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -402,7 +381,6 @@ export default {
|
|
|
font-size: 50upx;
|
|
font-size: 50upx;
|
|
|
color: #303133;
|
|
color: #303133;
|
|
|
margin-top: 12upx;
|
|
margin-top: 12upx;
|
|
|
-
|
|
|
|
|
&:before {
|
|
&:before {
|
|
|
content: '¥';
|
|
content: '¥';
|
|
|
font-size: 40upx;
|
|
font-size: 40upx;
|
|
@@ -414,7 +392,6 @@ export default {
|
|
|
margin-top: 20upx;
|
|
margin-top: 20upx;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
padding-left: 60upx;
|
|
padding-left: 60upx;
|
|
|
-
|
|
|
|
|
.type-item {
|
|
.type-item {
|
|
|
height: 120upx;
|
|
height: 120upx;
|
|
|
padding: 20upx 0;
|
|
padding: 20upx 0;
|
|
@@ -430,25 +407,23 @@ export default {
|
|
|
width: 100upx;
|
|
width: 100upx;
|
|
|
font-size: 52upx;
|
|
font-size: 52upx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ .iconweixin1 {
|
|
|
|
|
+ color: #ff0000;
|
|
|
|
|
+ }
|
|
|
.iconyue {
|
|
.iconyue {
|
|
|
color: #fe8e2e;
|
|
color: #fe8e2e;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.iconweixin {
|
|
.iconweixin {
|
|
|
color: #36cb59;
|
|
color: #36cb59;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.iconzhifubao {
|
|
.iconzhifubao {
|
|
|
color: #01aaef;
|
|
color: #01aaef;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.tit {
|
|
.tit {
|
|
|
font-size: $font-lg;
|
|
font-size: $font-lg;
|
|
|
color: $font-color-dark;
|
|
color: $font-color-dark;
|
|
|
margin-bottom: 4upx;
|
|
margin-bottom: 4upx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.con {
|
|
.con {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -457,7 +432,6 @@ export default {
|
|
|
color: $font-color-light;
|
|
color: $font-color-light;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.mix-btn {
|
|
.mix-btn {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|