国赛购买成功调整

This commit is contained in:
fan 2021-01-28 17:47:43 +08:00
parent 18dee86d9c
commit b1d944c52f
4 changed files with 42 additions and 19 deletions

View File

@ -34,6 +34,7 @@ deviceState[deviceType.Switch] = {
overlapLock: 0, // 是否进路延续保护锁闭
normalPosition: 1, // 是否定位
reversePosition: 0, // 是否反位
isCiConfirm: 0, // 是否进行联锁确认
/** 定位状态*/
// locateType: {
// Default: '01', /** 道岔位置类型 - 定位(缺省值)*/

View File

@ -244,7 +244,7 @@ const socket = {
namespaced: true,
state: {
payOrder: {}, // 支付消息
payOrder: '', // 支付订单
jointRoomInfo: {}, // 受邀请房间信息
chatContent: {}, // 聊天室聊天内容
roleList: [], // 设置角色信息
@ -334,10 +334,6 @@ const socket = {
state.simulationReset = simulationReset;
},
setPayOrder: (state, payOrder) => {
state.payOrder = payOrder;
},
// (旧版可能在用,新版地图不用这个)
shiftMsgQueue: (state) => {
state.msgHead = null;
@ -421,10 +417,6 @@ const socket = {
state.message[data.key].push(data.value);
},
setPayOrder: ({ commit }) => {
commit('setPayOrder', {});
},
shiftMsgQueue: ({ commit }) => {
commit('shiftMsgQueue');
},

View File

@ -23,14 +23,14 @@
<el-col :span="16">{{ unitPrice * monthAmount + ' 元' }}</el-col>
</el-row>
<div style="text-align: center;margin: 20px;">
<el-button type="primary" size="mini" :disabled="!changeMonth" @click="orderDetermine">获取支付码</el-button>
<el-button type="primary" size="mini" :disabled="!changeMonth" @click="orderDetermine">生成订单</el-button>
<el-button type="primary" size="mini" :disabled="changeMonth" @click="changeOrder">修改订单</el-button>
</div>
<el-row style="font-size: 16px; height: 30px;line-height: 30px;">
<el-col :span="6" :offset="2">订单号</el-col>
<el-col :span="16">{{ orderCode }}</el-col>
</el-row>
<el-row style="font-size: 16px;">
<el-row style="font-size: 16px;height: 200px;">
<el-col :span="6" :offset="2">支付码</el-col>
<el-col :span="16">
<div style="width: 150px;">
@ -42,9 +42,12 @@
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div v-if="paySuccess" style="position: relative; top: -50px;color: #0B840B;z-index: 8888;font-size: 18px;text-align: center;width: 150px;">
<div>订单支付成功!</div>
<div>{{ `将在${countdown}后自动关闭` }}</div>
</div>
</el-col>
</el-row>
<!--<div>订单支付成功</div>-->
</el-dialog>
</template>
@ -62,19 +65,39 @@ export default {
loading: true,
changeMonth: true,
url: '',
orderCode: ''
orderCode: '',
paySuccess: false,
countdown: 10,
timer: null
};
},
watch: {
'$store.state.socket.payOrder':function (val) {
if (this.payOrder === val) {
this.paySuccess = true;
this.url = '';
this.timer = setInterval(() => {
this.countdown--;
if (this.countdown <= 0) {
this.handleClose();
}
}, 1000);
}
}
},
methods: {
handleClose() {
this.dialogVisible = false;
this.timer && clearInterval(this.timer);
},
doShow() {
this.loading = true;
this.dialogVisible = true;
this.monthAmount = 1;
this.countdown = 10;
this.url = '';
this.changeMonth = true;
this.paySuccess = false;
},
changeOrder() {
this.loading = true;
@ -86,7 +109,6 @@ export default {
this.loading = true;
this.changeMonth = false;
getPayQrCode(this.$route.query.mapId, this.monthAmount).then(resp => {
console.log(this.url, '===', resp.data);
this.url = resp.data.code_url;
this.orderCode = resp.data.orderCode;
this.loading = false;

View File

@ -60,12 +60,13 @@ export default {
]
};
},
watch: {
'$store.state.socket.payOrder':function (val) {
this.queryPermission();
}
},
mounted() {
queryCompetitionPracticalPermissions({mapId:this.$route.query.mapId}).then(res => {
this.hasPermission = !!res.data;
}).catch(() => {
this.$message.error('获取场景权限异常!');
});
this.queryPermission();
getCompetitionPracticalScene({pageSize:100, pageNum:1}).then(res=>{
if (res.data.list && res.data.list.length > 0) {
const list = res.data.list.sort((a, b) => {
@ -100,6 +101,13 @@ export default {
doClose() {
this.dialogVisible = false;
},
queryPermission() {
queryCompetitionPracticalPermissions({mapId:this.$route.query.mapId}).then(res => {
this.hasPermission = !!res.data;
}).catch(() => {
this.$message.error('获取场景权限异常!');
});
},
async handleLoad(row) {
this.row = row;
const response = await loadCompetitionPracticalScene(this.$route.query.group, row.id);