|
|
@@ -29,12 +29,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- payImgInfo,payPay
|
|
|
- } from '@/http/shop_order.js'
|
|
|
-
|
|
|
+ import {payImgInfo,payPay} from '@/http/shop_order.js';
|
|
|
+ import {memberLogin} from '@/http/member.js';
|
|
|
import tools from "@/service/tools.js";
|
|
|
-
|
|
|
import {
|
|
|
getPhoneTopHeight,
|
|
|
getNavHeight,
|
|
|
@@ -57,6 +54,8 @@
|
|
|
|
|
|
code_type: 1,
|
|
|
shop_code: '',
|
|
|
+ m_id:'',
|
|
|
+ token:'',
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -85,12 +84,12 @@
|
|
|
code: queryObj.code,
|
|
|
wx_type: 1,
|
|
|
}
|
|
|
- // await getUserInfo(from).then(async (res) => {
|
|
|
- // if (res.code === 1) {
|
|
|
- // uni.setStorageSync('m_id')
|
|
|
- // uni.setStorageSync('token')
|
|
|
- // }
|
|
|
- // })
|
|
|
+ memberLogin(from).then((res)=>{
|
|
|
+ if (res.code == 1) {
|
|
|
+ uni.setStorageSync('m_id',res.data.m_id)
|
|
|
+ uni.setStorageSync('token',res.data.token)
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
// 认证失败
|
|
|
tools.wxLogin();
|
|
|
@@ -98,9 +97,9 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(isWeiXin){
|
|
|
- tools.wxInitialize(["chooseWXPay"]);
|
|
|
- }
|
|
|
+ // if(isWeiXin){
|
|
|
+ // tools.wxInitialize(["chooseWXPay"]);
|
|
|
+ // }
|
|
|
// #endif
|
|
|
|
|
|
this.headH = getNavHeight();
|
|
|
@@ -117,6 +116,7 @@
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+
|
|
|
payImgInfo({
|
|
|
code: this.shop_code
|
|
|
}).then((res) => {
|
|
|
@@ -172,7 +172,9 @@
|
|
|
m_id:uni.getStorageSync('m_id')?uni.getStorageSync('m_id'):0,
|
|
|
token:uni.getStorageSync('token')?uni.getStorageSync('token'):''
|
|
|
}).then((res) => {
|
|
|
-
|
|
|
+ console.log(res);
|
|
|
+ return
|
|
|
+
|
|
|
if (res.code === 1) {
|
|
|
|
|
|
this.order_id = res.data.order_id
|
|
|
@@ -180,8 +182,8 @@
|
|
|
if (res.data.is_bank == 0 && res.data.is_yee == 1) {
|
|
|
if (pay_type === 1) {
|
|
|
this.isAJAX = false
|
|
|
- if (res.data.wx_pay) {
|
|
|
- this.weiXinPayH5(res.data.wx_pay);
|
|
|
+ if (res.data.pay_data) {
|
|
|
+ this.weiXinPayH5(res.data.pay_data);
|
|
|
} else {
|
|
|
tools.error("支付生成失败");
|
|
|
}
|
|
|
@@ -206,6 +208,7 @@
|
|
|
async weiXinPayH5(wxPayData) {
|
|
|
const res = await tools.weiXinPay(wxPayData);
|
|
|
if (res) {
|
|
|
+ console.log(res);
|
|
|
this.payOk(wxPayData.rs_sn);
|
|
|
}
|
|
|
},
|