Commit b82cfced authored by 罗新东's avatar 罗新东

修改了扫码模块

parent 25f68366
<template>
<div id='content'>
<div id="content">
<van-image
width="100"
height="100"
:src="require('../../assets/result/fail.png')"
/>
<div class='text'>{{text}}</div>
<div class='button'>
<van-button block color="#52c41a" @click="$router.back()">返回</van-button>
<div class="text">{{ text }}</div>
<div class="content" v-if="content">
{{ content }}
</div>
<div class="button">
<van-button block color="#52c41a" @click="$router.back()"
>返回</van-button
>
</div>
</div>
</template>
<script>
export default {
data(){
data() {
return {
text:'操作失败'
}
text: "操作失败",
content: "",
};
},
mounted(){
let text = this.$route.query.text;
mounted() {
let {text,content} = this.$route.query;
if(text){
this.text=text
this.text=text;
this.content=content;
}
}
},
};
</script>
<style scoped>
#content{
text-align: center;
padding-top: 2rem;
}
.text{
margin-top:0.6rem;
font-size: 0.8rem;
color:#e84335
}
.button{
padding: 1rem 0.5rem;
}
#content {
text-align: center;
padding-top: 2rem;
}
.text {
margin-top: 0.6rem;
font-size: 0.8rem;
color: #e84335;
}
.button {
padding: 1rem 0.5rem;
}
.content {
font-size: 0.5rem;
color: #aaa;
padding-top: 10px;
}
</style>
\ No newline at end of file
......@@ -6,6 +6,9 @@
:src="require('../../assets/result/success.png')"
/>
<div class='text'>{{text}}</div>
<div class='content' v-if="content">
{{content}}
</div>
<div class='button'>
<van-button block color="#52c41a" @click="$router.back()">返回</van-button>
</div>
......@@ -16,13 +19,15 @@
export default {
data(){
return {
text:'操作成功'
text:'操作成功',
content:''
}
},
mounted(){
let text = this.$route.query.text;
let {text,content} = this.$route.query;
if(text){
this.text=text
this.text=text;
this.content=content;
}
}
};
......@@ -41,4 +46,9 @@ export default {
.button{
padding: 1rem 0.5rem;
}
.content{
font-size: 0.5rem;
color: #aaa;
padding-top: 10px;
}
</style>
\ No newline at end of file
<template>
<div id='content'>
<div id="content">
<van-image
width="100"
height="100"
:src="require('../../assets/result/warn.png')"
/>
<div class='text'>{{text}}</div>
<div class='button'>
<van-button block color="#52c41a" @click="$router.back()">返回</van-button>
<div class="text">{{ text }}</div>
<div class="content" v-if="content">
{{ content }}
</div>
<div class="button">
<van-button block color="#52c41a" @click="$router.back()"
>返回</van-button
>
</div>
</div>
</template>
<script>
export default {
data(){
data() {
return {
text:'警告信息'
}
text: "警告信息",
content: "",
};
},
mounted(){
let text = this.$route.query.text;
mounted() {
let {text,content} = this.$route.query;
if(text){
this.text=text
this.text=text;
this.content=content;
}
}
},
};
</script>
<style scoped>
#content{
text-align: center;
padding-top: 2rem;
}
.text{
margin-top:0.6rem;
font-size: 0.8rem;
color:#faad14
}
.button{
padding: 1rem 0.5rem;
}
#content {
text-align: center;
padding-top: 2rem;
}
.text {
margin-top: 0.6rem;
font-size: 0.8rem;
color: #faad14;
}
.button {
padding: 1rem 0.5rem;
}
.content {
font-size: 0.5rem;
color: #aaa;
padding-top: 10px;
}
</style>
\ No newline at end of file
......@@ -20,21 +20,30 @@ export default {
.then((res) => {
this.$toast.clear();
// this.$toast.success("扫码成功");
let obj ={
签到成功:'success',
签到失败:'fail',
重复签到:'warn'
}
res.data.details=res.data.details=='签到成功'?'您已签到':res.data.details;
let obj = {
您已签到: "success",
签到失败: "fail",
重复签到: "warn",
};
this.$router.replace({
name:obj[res.data.details],
query:{
text:res.data.details
}
})
name: obj[res.data.details],
query: {
text: res.data.details,
content:res.data.details=='签到失败'&&'请联系管理员'
},
});
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("扫码失败,请稍后再试");
// this.$toast.fail("扫码失败,请稍后再试");
this.$router.replace({
name: 'fail',
query: {
text: '扫码失败',
content:'请联系管理员'
},
});
});
},
},
......
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