Loading src/views/common/fail.vue +35 −24 Original line number Diff line number Diff line <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> Loading @@ -17,15 +21,17 @@ 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; } }, }; </script> Loading @@ -37,9 +43,14 @@ export default { .text { margin-top: 0.6rem; font-size: 0.8rem; color:#e84335 color: #e84335; } .button { padding: 1rem 0.5rem; } .content { font-size: 0.5rem; color: #aaa; padding-top: 10px; } </style> No newline at end of file src/views/common/success.vue +13 −3 Original line number Diff line number Diff line Loading @@ -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> Loading @@ -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; } } }; Loading @@ -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 src/views/common/warn.vue +35 −24 Original line number Diff line number Diff line <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> Loading @@ -17,15 +21,17 @@ 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; } }, }; </script> Loading @@ -37,9 +43,14 @@ export default { .text { margin-top: 0.6rem; font-size: 0.8rem; color:#faad14 color: #faad14; } .button { padding: 1rem 0.5rem; } .content { font-size: 0.5rem; color: #aaa; padding-top: 10px; } </style> No newline at end of file src/views/scan/index.vue +20 −11 Original line number Diff line number Diff line Loading @@ -20,21 +20,30 @@ export default { .then((res) => { this.$toast.clear(); // this.$toast.success("扫码成功"); res.data.details=res.data.details=='签到成功'?'您已签到':res.data.details; let obj = { 签到成功:'success', 签到失败:'fail', 重复签到:'warn' } 您已签到: "success", 签到失败: "fail", 重复签到: "warn", }; this.$router.replace({ name: obj[res.data.details], query: { text:res.data.details } }) 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:'请联系管理员' }, }); }); }, }, Loading Loading
src/views/common/fail.vue +35 −24 Original line number Diff line number Diff line <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> Loading @@ -17,15 +21,17 @@ 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; } }, }; </script> Loading @@ -37,9 +43,14 @@ export default { .text { margin-top: 0.6rem; font-size: 0.8rem; color:#e84335 color: #e84335; } .button { padding: 1rem 0.5rem; } .content { font-size: 0.5rem; color: #aaa; padding-top: 10px; } </style> No newline at end of file
src/views/common/success.vue +13 −3 Original line number Diff line number Diff line Loading @@ -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> Loading @@ -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; } } }; Loading @@ -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
src/views/common/warn.vue +35 −24 Original line number Diff line number Diff line <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> Loading @@ -17,15 +21,17 @@ 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; } }, }; </script> Loading @@ -37,9 +43,14 @@ export default { .text { margin-top: 0.6rem; font-size: 0.8rem; color:#faad14 color: #faad14; } .button { padding: 1rem 0.5rem; } .content { font-size: 0.5rem; color: #aaa; padding-top: 10px; } </style> No newline at end of file
src/views/scan/index.vue +20 −11 Original line number Diff line number Diff line Loading @@ -20,21 +20,30 @@ export default { .then((res) => { this.$toast.clear(); // this.$toast.success("扫码成功"); res.data.details=res.data.details=='签到成功'?'您已签到':res.data.details; let obj = { 签到成功:'success', 签到失败:'fail', 重复签到:'warn' } 您已签到: "success", 签到失败: "fail", 重复签到: "warn", }; this.$router.replace({ name: obj[res.data.details], query: { text:res.data.details } }) 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:'请联系管理员' }, }); }); }, }, Loading