Commit 83f3fa75 by 杨北旺

添加支付

1 parent 37c44a10
......@@ -15,12 +15,6 @@ const request = (params = {}, target, method = RequestMethods.POST, noSignAttr =
let { sessionId } = sessionStorage.getItem('GL_EQUITY_USER_INFO') ? JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')) : store.state
if (sessionId) params.sessionId = sessionId
const url = window.$baseConfig.axios.baseURL
// let url = window.$baseConfig.axios.baseURL
// if (params.isLogin) {
// url = window.$baseConfig.axios.baseURL
// } else {
// url = 'http://192.168.3.208:8110/rop-scrm-coupon/router'
// }
if (method == 'post') {
return axios({
url,
......
......@@ -129,38 +129,38 @@ export default {
this.showToast(message)
}
})
console.log(payData,'----------');
this.buyCard(payData)
},
async buyCard() {
this.showLoading();
let payMannerId;
let orderSource = 3
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 5; //6
orderSource = 3
}else {
payMannerId = 6; //2
orderSource = 2
}
let para = {
merchantId: this.merchantId,
orderCode: this.orderCode,
payMannerId: payMannerId,
orderSource: orderSource,
sessionId: this.sessionId,
}
let payData = await cardRoll.getCardBuy(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
return data
} else {
this.showToast(message)
}
})
async buyCard(payData) {
// this.showLoading();
// let payMannerId;
// let orderSource = 3
// if (ua.match(/MicroMessenger/i) == 'micromessenger') {
// payMannerId = 5; //6
// orderSource = 3
// }else {
// payMannerId = 6; //2
// orderSource = 2
// }
// let para = {
// merchantId: this.merchantId,
// orderCode: this.orderCode,
// payMannerId: payMannerId,
// orderSource: orderSource,
// sessionId: this.sessionId,
// }
// let payData = await cardRoll.getCardBuy(para).then(res => {
// this.hideLoading()
// let { code, data, message } = res
// if (code == 0) {
// return data
// } else {
// this.showToast(message)
// }
// })
const { timeStamp,nonceStr, packages, signType, paySign } = payData;
const self = this;
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.chooseWXPay(timeStamp,nonceStr, packages, signType, paySign).then(res => {
console.log(res);
......@@ -183,7 +183,6 @@ export default {
window.myjs.jumpNativeApp(JSON.stringify({ type: 7, homePage: 'equity' }))
}
}else{
// self.setLocalStorage('reLoadIndex',self.sessionId)
if (self.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 1, reloadView: 'equity' }))
} else {
......
......@@ -53,7 +53,8 @@ export default {
document.querySelector("body").setAttribute("style", "background:#F5F5F5");
},
mounted() {
document.title = '广汇门店'
let merchantInfo = JSON.parse(sessionStorage.getItem('MERCHANT_INFO'))
document.title = merchantInfo.name
let options = this.$route.query
this.getDetailInfo(options.id)
this.getPaySource()
......@@ -73,6 +74,7 @@ export default {
},
// 获取门店套餐详情
getDetailInfo(id){
this.showLoading();
let para = {
id
}
......@@ -86,8 +88,7 @@ export default {
})
},
// 购买套餐
toBuyPackage(){
//先获取门店订单编号---在发起请求
async toBuyPackage(){
this.showLoading();
let { sessionId} = this.$store.state;
let para = {
......@@ -97,14 +98,19 @@ export default {
sessionId:sessionId
}
console.log(para);
commodity.createStoreOrder(para).then(res=>{
console.log(res,'.............');
let payData = await commodity.createStoreOrder(para).then(res=>{
const {code,data,message} = res
if(code==0){
return data
} else {
this.showToast(message)
}
this.hideLoading();
})
const { timeStamp,nonceStr, packages, signType, paySign } = payData;
},
// 获取门店单号
getOrderCode(){
this.showLoading();
commodity.getStoreOrderCode().then(res=>{
const {code,data,message} = res
if(code==0){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!