import * as api from '@/api' import Storage from '@/utils/storage' const lStorage = new Storage('localStorage') export default { data() { return { TITLE: '问卷调查结果', data: { result: [] }, loading: { submit: false } }; }, created() { this.inData() }, computed: { putIsAbnormal () { try { return this.data.result.some(item => item.type === 'radio' && item.val === '是') } catch (err) { } } }, methods: { vueWatchRoute () { this.inData() }, async inData() { this.loading.data = true try { // let { result_id } = this.$route.query // let res = await api.apiGetVolumeResult({ result_id }) // let data = res.data let data = lStorage.getItem('FormResultAbnormal') this.$set(this, 'data', data) } catch (error) { console.log(error) } this.loading.data = false }, btnLinkBack() { var ua = navigator.userAgent.toLowerCase(); let { go, replace, to } = this.$route.query if (replace) { location.replace(decodeURIComponent(replace)) } else if (to) { location.href = decodeURIComponent(to) } else if (go) { this.$router.go(go) } else if (ua.match(/MicroMessenger/i) == "micromessenger") { //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器) wx.miniProgram.getEnv((res) => { if (res.miniprogram) { // 在小程序里 console.log('miniprogram') wx.miniProgram.switchTab({ url: '/pages/index/index' }) } }) } else { this.$router.go(-1) } } } }