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

11

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