|
@@ -17,10 +17,31 @@ export default {
|
|
|
});
|
|
|
return new Promise(r => {
|
|
|
$http.post("/client/wechat/pay",obj)
|
|
|
- .then(res=>{
|
|
|
- //#ifdef H5
|
|
|
- $wxApi.JSAPI(res.data).then(r);
|
|
|
- //#endif
|
|
|
+ // 区分包月支付和普通支付
|
|
|
+ if (res.data.needPay && !res.data.monthId) {
|
|
|
+ //#ifdef H5
|
|
|
+ $wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
|
|
|
+ //#endif
|
|
|
+ } else if (res.data.monthId) {
|
|
|
+ //#ifdef H5
|
|
|
+ $wxApi.JSAPI(res.data.wx, jumpUrl).then(r);
|
|
|
+ //#endif
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "无需支付",
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(() =>{
|
|
|
+ //#ifdef H5
|
|
|
+ if (jumpUrl) {
|
|
|
+ window.location.href = jumpUrl;
|
|
|
+ } else {
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ //#endif
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
this.payError(res);
|
|
|
}).catch(err =>{
|
|
|
// alert(err.msg);
|