Commit 6b424068 authored by 杨梦雪's avatar 杨梦雪

11

parent 31c22665
...@@ -9,16 +9,18 @@ ...@@ -9,16 +9,18 @@
@close="cancelBtn()" @close="cancelBtn()"
> >
<div class="pay_code"> <div class="pay_code">
<div v-if="isShowqr"> <div v-if="isShowqr == 1">
<!-- <div class="pay_time">支付剩余时间<span>15分30秒</span></div> --> <!-- <div class="pay_time">支付剩余时间<span>15分30秒</span></div> -->
<div class="money">{{ has_amount }}</div> <div class="money">{{ has_amount }}</div>
<div class="img_qr"> <div class="img_qr">
<div class="qrcode" ref="qrCodeUrl"></div> <div class="qrcode" ref="qrCodeUrl"></div>
</div> </div>
<div>请使用<span>微信</span>扫一扫,扫描二维码支付</div> <div>请使用<span>微信</span>扫一扫,扫描二维码支付</div>
<div>付款码为动态码,仅支持通过本页面进行扫描付款操作,不支持另存图片后扫描支付。</div> <div>
付款码为动态码,仅支持通过本页面进行扫描付款操作,不支持另存图片后扫描支付。
</div> </div>
<div v-if="!isShowqr"> </div>
<div v-if="isShowqr == 2">
<div class="info_2" style="color: #000; font-size: 18px"> <div class="info_2" style="color: #000; font-size: 18px">
<i class="el-icon-warning"></i>{{ message }} <i class="el-icon-warning"></i>{{ message }}
</div> </div>
...@@ -35,7 +37,6 @@ ...@@ -35,7 +37,6 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import Cookie from "js-cookie"
import { getWxConfig } from "r/index/pay"; import { getWxConfig } from "r/index/pay";
import { SERVER_WS_URL } from "config/server"; import { SERVER_WS_URL } from "config/server";
import QRCode from "qrcodejs2"; import QRCode from "qrcodejs2";
...@@ -48,7 +49,7 @@ export default { ...@@ -48,7 +49,7 @@ export default {
return { return {
dialogVisible: this.confirmSignUpDialogFu, dialogVisible: this.confirmSignUpDialogFu,
message: "", message: "",
isShowqr: true, // 展示支付二维码 isShowqr: 0, // 展示支付二维码
token: "", token: "",
websocket: null, //websocket连接 websocket: null, //websocket连接
lockReconnect: false, //是否真正建立连接 lockReconnect: false, //是否真正建立连接
...@@ -60,15 +61,18 @@ export default { ...@@ -60,15 +61,18 @@ export default {
}; };
}, },
created() { created() {
this.token = window.localStorage.getItem("index-token"+this.$store.state.indexIdentity); this.token = window.localStorage.getItem(
this.has_amount = window.localStorage.getItem("has_amount"+this.$store.state.indexIdentity); "index-token" + this.$store.state.indexIdentity
);
this.has_amount = window.localStorage.getItem(
"has_amount" + this.$store.state.indexIdentity
);
}, },
methods: { methods: {
async confirm() { async confirm() {
// console.log(SERVER_WS_URL); // console.log(SERVER_WS_URL);
let { data: res } = await getWxConfig({ let { data: res } = await getWxConfig({
// exam_uuid: this.examuuid, pay_type: 3,
pay_type: 1,
}); });
// console.log(res); // console.log(res);
...@@ -76,11 +80,12 @@ export default { ...@@ -76,11 +80,12 @@ export default {
if (res.code == 400801) { if (res.code == 400801) {
return this.cancelBtn(); return this.cancelBtn();
} }
this.isShowqr = 2;
this.message = res.message; this.message = res.message;
this.isShowqr = false;
return; return;
} }
this.isShowqr = true; this.isShowqr = 1;
this.createQrCode(res.code_url); this.createQrCode(res.code_url);
//初始化 websocket 链接 //初始化 websocket 链接
this.initWebSocket(); this.initWebSocket();
...@@ -130,9 +135,9 @@ export default { ...@@ -130,9 +135,9 @@ export default {
} else if (!this.dialogVisible) { } else if (!this.dialogVisible) {
return; return;
} else { } else {
let code=this.$store.state.indexIdentity let code = this.$store.state.indexIdentity;
if (!this.token || this.token == "") { if (!this.token || this.token == "") {
this.token = window.localStorage.getItem("index-token"+code); this.token = window.localStorage.getItem("index-token" + code);
} }
let token = this.token; let token = this.token;
const wssURL = SERVER_WS_URL + "/order?token=" + token + "&channel=pc"; const wssURL = SERVER_WS_URL + "/order?token=" + token + "&channel=pc";
...@@ -217,8 +222,12 @@ export default { ...@@ -217,8 +222,12 @@ export default {
websocketSend() { websocketSend() {
//数据发送 //数据发送
let sendData = { let sendData = {
order_no: window.localStorage.getItem("order_no"+this.$store.state.indexIdentity), order_no: window.localStorage.getItem(
cam_id: window.localStorage.getItem("campsite_id"+this.$store.state.indexIdentity), "order_no" + this.$store.state.indexIdentity
),
cam_id: window.localStorage.getItem(
"campsite_id" + this.$store.state.indexIdentity
),
token: this.token, token: this.token,
}; };
this.websocket.send(JSON.stringify(sendData)); this.websocket.send(JSON.stringify(sendData));
...@@ -238,7 +247,7 @@ export default { ...@@ -238,7 +247,7 @@ export default {
// status=6,跳转到报名成功页面 // status=6,跳转到报名成功页面
// this.$emit("getstatus", res.data.status.status); // this.$emit("getstatus", res.data.status.status);
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/success?code="+code); this.$router.push("/signUp/success?code=" + code);
} else { } else {
//收到服务器信息,心跳重置 //收到服务器信息,心跳重置
this.reset(); this.reset();
......
...@@ -133,10 +133,10 @@ export default { ...@@ -133,10 +133,10 @@ export default {
} }
}, },
toWeichat() { toWeichat() {
this.dialogChoose = false; // this.dialogChoose = false;
this.confirmSignUpDialogFu = true; this.confirmSignUpDialogFu = true;
// getWxConfig({ // getWxConfig({
// pay_type: 1, // pay_type: 3,
// }).then((res) => { // }).then((res) => {
// console.log(res, "getWxConfig"); // console.log(res, "getWxConfig");
// if (res.data.code != 200) { // if (res.data.code != 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment