123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <view class="skip">
- <view class="bg">
- </view>
- <view class="text">
- {{ tip }}
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from "vuex";
- import Base64 from "../../util/base64.js"
- import Parse from "../../util/parse.js"
- export default {
- data() {
- return {
- tip: "跳转中,请稍后..."
- }
- },
- computed: {
- // ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
- // "userInfo"
- // ]),
- },
- created() {
- uni.showLoading({
- title: '跳转中...',
- mask: true
- });
- },
- async onLoad(e) {
- console.log(e)
- // #ifdef MP-WEIXIN
- const res = decodeURIComponent(e.q)
- // #endif
- // #ifdef MP-ALIPAY
- const res = e.qrCode
- // #endif
- const parse = new Parse.getInstance();
- const info = await parse.parseCode(res).catch((e) => {
- uni.hideLoading()
- return parse.scanCode(true, {
- title: '( •̀ ω •́ )✧',
- showCancel: false,
- content: '亲,您扫的码不对哦~',
- confirmText: '重新扫码',
- })
- })
- this.goIndex();
- },
- methods: {
- ...mapMutations(["updateStationId", "updateLabelId", "updateEmployeeId"]),
- goIndex() {
- uni.hideLoading();
- uni.redirectTo({
- url: "/pages/index/index"
- })
- },
- goList() {
- uni.hideLoading();
- uni.redirectTo({
- url: "/pages/list/list"
- })
- },
- async parseCode(msg) {
- const showModalPro = await uni.showModal({
- title: '( •̀ ω •́ )✧',
- showCancel: false,
- content: '亲,扫码错误哦~',
- confirmText: '重新扫码',
- })
- const scanCodePro = await uni.scanCode({
- onlyFromCamera: true
- })
- // try {
- // const parse = new Parse.getInstance();
- // const info = await parse.start(res)
- // return Promise.resolve(info)
- // } catch (e) {
- // const showModalPro = await uni.showModal({
- // title: '(~ ̄▽ ̄)~',
- // showCancel: false,
- // content: '您扫的二维码错误~',
- // confirmText: '重新扫码',
- // })
- // const scanCodePro = await uni.scanCode({
- // onlyFromCamera: true
- // })
- // this.scanCode();
- // }
- },
- async scanCode() {
- const showModalPro = await uni.showModal({
- title: '(~ ̄▽ ̄)~',
- showCancel: !!this.stationId,
- content: msg || '此站点只能扫码进入~',
- cancelText: '返回',
- confirmText: '立刻扫码',
- })
- const parse = Parse.getInstance()
- if (showModalPro[1].cancel) {
- uni.navigateBack({
- delta: 1
- })
- } else if (showModalPro[1].confirm) {
- const parse = Parse.getInstance()
- return parse.scanCode().catch((err) => {
- return this.scanCode(err)
- });
- }
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- .skip {
- position: relative;
- .bg {
- // background: url(../../static/icon/1_b01_down.2x.png) no-repeat 0px 0px;
- background: url(../../static/icon/goto.png) no-repeat 0px 0px;
- background-size: 100% 100%;
- width: 182rpx;
- height: 216rpx;
- position: absolute;
- top: 238rpx;
- left: 270rpx;
- }
- .text {
- font-size: 40rpx;
- width: 750rpx;
- text-align: center;
- font-weight: 550;
- color: #000000;
- line-height: 56rpx;
- position: absolute;
- top: 522rpx;
- }
- }
- }
- </style>
|