Compare commits
1 Commits
gaohao2.0.
...
gh1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
919350c2c0 |
@@ -8,8 +8,10 @@ const proxyApi = "/api"
|
|||||||
// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试
|
// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试
|
||||||
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||||
const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布
|
// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布
|
||||||
const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布
|
// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布
|
||||||
|
const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 预发布
|
||||||
|
const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 预发布
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
|||||||
@@ -267,28 +267,28 @@ const getUserInfo = function (successCallback, failCallback) {
|
|||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
my.getAuthCode({
|
my.getAuthCode({
|
||||||
scopes: 'auth_user',
|
scopes: 'auth_base',
|
||||||
success: (data) => {
|
success: async (data) => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
// 支付宝小程序环境
|
// 支付宝小程序环境
|
||||||
my.getAuthUserInfo({
|
// my.getAuthUserInfo({
|
||||||
success: async (infoRes) => {
|
// success: async (infoRes) => {
|
||||||
let res = await Api.userwxlogin({
|
let res = await Api.userwxlogin({
|
||||||
code: data.authCode, //临时登录凭证
|
code: data.authCode, //临时登录凭证
|
||||||
rawData: JSON.stringify(infoRes),
|
// rawData: JSON.stringify(infoRes),
|
||||||
source: 'alipay'
|
source: 'alipay'
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
}
|
}
|
||||||
},
|
// },
|
||||||
fail: (err) => {}
|
// fail: (err) => {}
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,6 +315,7 @@
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
console.log(this.amount)
|
||||||
if (this.amount == null || this.amount == '') {
|
if (this.amount == null || this.amount == '') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '金额不能为空',
|
title: '金额不能为空',
|
||||||
@@ -331,15 +332,21 @@
|
|||||||
}
|
}
|
||||||
let res = await this.api.paymemeberIn({
|
let res = await this.api.paymemeberIn({
|
||||||
shopId: this.shopId, // 判断显示哪家的作品,
|
shopId: this.shopId, // 判断显示哪家的作品,
|
||||||
amount: this.amount // 判断显示哪家的作品,
|
amount: this.amount ,// 判断显示哪家的作品,
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
payType: 'wechatPay',
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
payType: 'aliPay',
|
||||||
|
// #endif
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
provider: 'wxpay', //支付类型-固定值
|
provider: 'wxpay', //支付类型-固定值
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
partnerid: res.data.appId, // 微信支付商户号
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||||
@@ -347,26 +354,53 @@
|
|||||||
package: res.data.package, // 固定值
|
package: res.data.package, // 固定值
|
||||||
signType: res.data.signType, //固定值
|
signType: res.data.signType, //固定值
|
||||||
paySign: res.data.paySign, //签名
|
paySign: res.data.paySign, //签名
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
provider: 'alipay', //支付类型-固定值
|
||||||
|
orderInfo: res.data.tradeNo, // 微信支付商户号
|
||||||
|
// #endif
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "支付成功"
|
title: "支付成功"
|
||||||
})
|
})
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
let pages = getCurrentPages()
|
let pages = getCurrentPages()
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||||
complete() {
|
complete() {
|
||||||
if ( pages.length > 1) {
|
if ( _this.type && _this.type == "topUpActivity") {
|
||||||
_this.shopInfo()
|
uni.pro.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
setTimeout(res => {
|
if ( pages.length > 1) {
|
||||||
uni.switchTab({
|
_this.shopInfo()
|
||||||
url: '/pages/index/index'
|
} else {
|
||||||
})
|
setTimeout(res => {
|
||||||
}, 500)
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if ( _this.type && _this.type == "topUpActivity") {
|
||||||
|
uni.pro.navigateBack()
|
||||||
|
} else {
|
||||||
|
if ( pages.length > 1) {
|
||||||
|
_this.shopInfo()
|
||||||
|
} else {
|
||||||
|
setTimeout(res => {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -376,7 +410,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
loginEvent: async () => {
|
loginEvent: async () => {
|
||||||
|
console.log(2)
|
||||||
let res = await uni.utils.getUserInfo();
|
let res = await uni.utils.getUserInfo();
|
||||||
|
console.log(res)
|
||||||
uni.cache.set('token', res.data.token);
|
uni.cache.set('token', res.data.token);
|
||||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
.miniAppOpenId)
|
.miniAppOpenId)
|
||||||
|
|||||||
Reference in New Issue
Block a user