修改支付的问题
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1147,6 +1147,7 @@ page {
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
|
||||
.index .header .logo {
|
||||
@ -1162,7 +1163,8 @@ page {
|
||||
}
|
||||
|
||||
.index .header .search {
|
||||
width: 100%;
|
||||
// width: 100%;
|
||||
flex:1;
|
||||
box-sizing: border-box;
|
||||
height: 0.64*100rpx;
|
||||
background-color: #f7f7f7;
|
||||
@ -1172,6 +1174,19 @@ page {
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.index .header .qr{
|
||||
width:0.34*150rpx;
|
||||
height:0.34*150rpx;
|
||||
font-size: 0.34*100rpx;
|
||||
margin-left: 0.16*100rpx;
|
||||
margin-right: 0.16*100rpx;
|
||||
}
|
||||
.index .header .qr image{
|
||||
width:0.34*150rpx;
|
||||
height:0.34*150rpx;
|
||||
}
|
||||
|
||||
|
||||
.index .header .search .iconfont {
|
||||
font-size: 0.34*100rpx;
|
||||
margin-right: 0.16*100rpx;
|
||||
|
@ -10,7 +10,7 @@
|
||||
<view class="start" :class="'star' + item.star"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">{{ dataFormat(item.addTime) }} {{ item.suk }}</view>
|
||||
<view class="time">{{ dataFormat(item.addTime) }} {{ item.suk||'' }}</view>
|
||||
<view class="evaluate-infor">{{ item.comment }}</view>
|
||||
<view class="imgList acea-row">
|
||||
<view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
|
||||
|
@ -4,44 +4,48 @@ import { getProvider } from "@/utils";
|
||||
export const weappPay = (option) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 吊起微信支付
|
||||
getProvider().then(provider => {
|
||||
// getProvider('payment').then(provider => {
|
||||
let orderInfo = {
|
||||
...option,
|
||||
timeStamp: option.timestamp + '',
|
||||
appid: option.appid,
|
||||
noncestr: option.noncestr,
|
||||
package: option.package,
|
||||
partnerid: option.partnerid,
|
||||
prepayid: option.prepayid,
|
||||
sign: option.sign,
|
||||
timestamp: option.timestamp + '',
|
||||
}
|
||||
console.log({
|
||||
provider: provider,
|
||||
signType: "MD5",
|
||||
timeStamp: orderInfo.timestamp,
|
||||
nonceStr: orderInfo.noncestr,
|
||||
package: orderInfo.prepayid,
|
||||
signType: "MD5",
|
||||
paySign: orderInfo.sign,
|
||||
provider: 'wxpay',
|
||||
// signType: "MD5",
|
||||
// timeStamp: orderInfo.timeStamp,
|
||||
// nonceStr: orderInfo.noncestr,
|
||||
// package: orderInfo.prepayid,
|
||||
// signType: "MD5",
|
||||
// paySign: orderInfo.sign,
|
||||
orderInfo,
|
||||
},'发起支付')
|
||||
}, '发起支付')
|
||||
// 调用登录接口
|
||||
uni.requestPayment({
|
||||
provider: provider,
|
||||
signType: "MD5",
|
||||
timeStamp: orderInfo.timeStamp,
|
||||
nonceStr: orderInfo.noncestr,
|
||||
package: orderInfo.prepayid,
|
||||
signType: "MD5",
|
||||
paySign: orderInfo.sign,
|
||||
provider: 'wxpay',
|
||||
// timeStamp: orderInfo.timeStamp,
|
||||
// nonceStr: orderInfo.noncestr,
|
||||
// package: orderInfo.prepayid,
|
||||
// signType: "MD5",
|
||||
// paySign: orderInfo.sign,
|
||||
orderInfo,
|
||||
success: (success) => {
|
||||
console.log(error)
|
||||
console.log(success)
|
||||
uni.showToast({
|
||||
title: '支付成功', icon: 'success', duration: 2000
|
||||
title: JSON.stringify(success), icon: 'success', duration: 5000
|
||||
});
|
||||
resolve(success)
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error)
|
||||
uni.showToast({ title: '支付失败', icon: 'none', duration: 2000 });
|
||||
uni.showToast({ title: JSON.stringify(error), icon: 'none', duration: 5000 });
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
})
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
@ -57,23 +57,24 @@
|
||||
"sdkConfigs" : {
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appsecret" : "",
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"appsecret" : "c47ef66d3311194da44e60387d5c1abd",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"ad" : {}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
BIN
myappSignKey.keystore
Normal file
BIN
myappSignKey.keystore
Normal file
Binary file not shown.
@ -5,6 +5,7 @@
|
||||
<text class="iconfont icon-xiazai5"></text>
|
||||
搜索商品
|
||||
</view>
|
||||
<view class="qr" @click="startQr()"><image src="@/static/images/qr.png" /></view>
|
||||
</view>
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true" v-if="banner.length > 0">
|
||||
@ -253,7 +254,15 @@ export default {
|
||||
goGoodsPromotion() {
|
||||
this.$yrouter.push('/pages/shop/GoodsPromotion/index');
|
||||
},
|
||||
setOpenShare: function() {}
|
||||
setOpenShare: function() {},
|
||||
startQr:function(){
|
||||
uni.scanCode({
|
||||
success:function(res){
|
||||
console.log(JSON.stringify(res));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -327,6 +327,7 @@
|
||||
},
|
||||
mounted: function() {
|
||||
let that = this;
|
||||
this.$store.dispatch('USERINFO', true)
|
||||
that.getCartInfo();
|
||||
if (that.$yroute.query.pinkid !== undefined)
|
||||
that.pinkId = that.$yroute.query.pinkid;
|
||||
@ -535,6 +536,7 @@
|
||||
});
|
||||
break;
|
||||
case "WECHAT_H5_PAY":
|
||||
// H5支付
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
@ -546,6 +548,17 @@
|
||||
}, 100);
|
||||
break;
|
||||
case "WECHAT_PAY":
|
||||
// 小程序支付
|
||||
weappPay(data.result.jsConfig).then(res => {
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: data.result.orderId
|
||||
}
|
||||
});
|
||||
});
|
||||
case "WECHAT_APP_PAY":
|
||||
// APP支付
|
||||
weappPay(data.result.jsConfig).then(res => {
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
|
BIN
static/images/qr.png
Normal file
BIN
static/images/qr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
@ -145,11 +145,11 @@ export const replaceLogin = (msg) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getProvider = () => {
|
||||
export const getProvider = (service) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: 'oauth',
|
||||
service: service || 'oauth',
|
||||
success: function (res) {
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
|
Reference in New Issue
Block a user