|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="cardSecretBuy"> |
|
|
<div class="cardSecretBuy"> |
|
|
<login :page="login_page" :mckey="mckey" @loaded="loginLoaded"></login> |
|
|
<login :page="login_page"></login> |
|
|
|
|
|
|
|
|
<div v-if="prompt" class="prompt-alert">{{ prompt }}</div> |
|
|
<div v-if="prompt" class="prompt-alert">{{ prompt }}</div> |
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ |
|
|
<div @click="toOrderSample()" class="card-order">订单编号指引</div> |
|
|
<div @click="toOrderSample()" class="card-order">订单编号指引</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="search-input"> |
|
|
<div class="search-input"> |
|
|
<input type="text" placeholder="请输入订单编号" v-model="inputValue"> |
|
|
<input type="text" placeholder="请输入订单编号" v-model="inputValue" @keyup.enter="search()"> |
|
|
<div @click="search()">搜索</div> |
|
|
<div @click="search()">搜索</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -51,12 +51,10 @@ import Login from './common/Login.vue' |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
prompt: '', |
|
|
|
|
|
agent_url: "", |
|
|
|
|
|
|
|
|
|
|
|
islogin:false, |
|
|
|
|
|
login_page: "cardSecretBuy", |
|
|
login_page: "cardSecretBuy", |
|
|
mckey: this.$route.query.mckey, |
|
|
|
|
|
|
|
|
prompt: '', |
|
|
|
|
|
agent_url: localStorage.getItem('agent_url'), |
|
|
|
|
|
|
|
|
tab: 0, |
|
|
tab: 0, |
|
|
card_type_list: [], |
|
|
card_type_list: [], |
|
@ -66,9 +64,6 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
loginLoaded(){ |
|
|
|
|
|
this.islogin = true |
|
|
|
|
|
}, |
|
|
|
|
|
promptshow(content) { |
|
|
promptshow(content) { |
|
|
this.prompt = content; |
|
|
this.prompt = content; |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
@ -89,21 +84,18 @@ export default { |
|
|
}, |
|
|
}, |
|
|
toTab: function (tab) { |
|
|
toTab: function (tab) { |
|
|
this.tab = tab; |
|
|
this.tab = tab; |
|
|
localStorage.setItem('cardSecretBuyTab', tab) |
|
|
|
|
|
}, |
|
|
}, |
|
|
search: function () { |
|
|
search: function () { |
|
|
this.tid = this.inputValue; |
|
|
if (this.inputValue == '') { |
|
|
if (this.tid == '') { |
|
|
|
|
|
this.promptshow('请输入订单编号'); |
|
|
this.promptshow('请输入订单编号'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
this.$http.post(this.agent_url + "/h5_get_card_secret", { |
|
|
this.$http.post(this.agent_url + "/h5_get_card_secret", { |
|
|
orderid: this.tid, |
|
|
orderid: this.inputValue, |
|
|
}).then(response => { |
|
|
}).then(response => { |
|
|
if (response.data.status) { |
|
|
if (response.data.status) { |
|
|
this.is_buy = false; |
|
|
localStorage.setItem('cardSecretBuyTab', 1) |
|
|
this.inputValue = ""; |
|
|
this.toCardSecretQuery(this.inputValue); |
|
|
this.toCardSecretQuery(); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.promptshow(response.data.info); |
|
|
this.promptshow(response.data.info); |
|
|
} |
|
|
} |
|
@ -162,9 +154,9 @@ export default { |
|
|
"paySign": data.paySign |
|
|
"paySign": data.paySign |
|
|
}, (res) => { |
|
|
}, (res) => { |
|
|
//此处需要转化为字符串 |
|
|
//此处需要转化为字符串 |
|
|
if (res.errMsg.indexOf('ok') > -1) { |
|
|
if (res.err_msg.indexOf('ok') > -1) { |
|
|
this.checkpayresult(); |
|
|
this.checkpayresult(); |
|
|
} else if (res.errMsg.indexOf('cancel') > -1) { |
|
|
} else if (res.err_msg.indexOf('cancel') > -1) { |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.promptshow('支付失败'); |
|
|
this.promptshow('支付失败'); |
|
@ -178,7 +170,7 @@ export default { |
|
|
pay_type: paytype |
|
|
pay_type: paytype |
|
|
}).then(response => { |
|
|
}).then(response => { |
|
|
if (response.data.status) { |
|
|
if (response.data.status) { |
|
|
this.toCardSecretQuery(); |
|
|
this.toCardSecretQuery(this.tid); |
|
|
} else { |
|
|
} else { |
|
|
this.promptshow(response.data.info); |
|
|
this.promptshow(response.data.info); |
|
|
} |
|
|
} |
|
@ -187,20 +179,18 @@ export default { |
|
|
this.promptshow("网络错误,请重试"); |
|
|
this.promptshow("网络错误,请重试"); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
toCardSecretQuery() { |
|
|
toCardSecretQuery(orderid) { |
|
|
location.href = "#/cardSecretQuery/?orderid=" + this.tid; |
|
|
location.href = "#/cardSecretQuery/?orderid=" + orderid; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
Login |
|
|
Login |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
if(this.islogin){ |
|
|
|
|
|
this.agent_url = localStorage.getItem('agent_url'); |
|
|
|
|
|
this.getCardSecretTypes(); |
|
|
this.getCardSecretTypes(); |
|
|
} |
|
|
if (localStorage.getItem('cardSecretBuyTab') >=0 ) { |
|
|
if(localStorage.getItem('cardSecretBuyTab') != null){ |
|
|
|
|
|
this.tab = localStorage.getItem('cardSecretBuyTab') |
|
|
this.tab = localStorage.getItem('cardSecretBuyTab') |
|
|
|
|
|
localStorage.setItem('cardSecretBuyTab', 0) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|