This commit is contained in:
liuye
2024-10-21 16:41:32 +08:00
parent 59e072ed47
commit 137891332a

View File

@@ -27,11 +27,12 @@
</div> </div>
<u-modal v-model="confirmShow" content="您确认要核销该条订单吗?" :show-cancel-button="true" :mask-close-able="true" <u-modal v-model="confirmShow" content="您确认要核销该条订单吗?" :show-cancel-button="true" :mask-close-able="true"
:show-title="false" @confirm="confirm"></u-modal> :show-title="false" @confirm="confirm"></u-modal>
<AiLogin ref="login" @success="getAuth()"/>
</div> </div>
</template> </template>
<script> <script>
import {mapState} from "vuex"; import {mapActions, mapState} from "vuex";
export default { export default {
name: 'Detail', name: 'Detail',
@@ -44,16 +45,21 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user', 'token']),
}, },
onLoad(option) { onLoad(option) {
this.id = option.id this.id = option.id
if (decodeURIComponent(option.scene) != 'undefined') { if (decodeURIComponent(option.scene) != 'undefined') {
this.id = decodeURIComponent(option.scene) this.id = decodeURIComponent(option.scene)
} }
this.getDetail() if (!this.token) {
this.$refs.login.show();
}else {
this.getDetail()
}
}, },
methods: { methods: {
...mapActions(['getUserInfo']),
getDetail() { getDetail() {
this.$instance.post(`/app/appintegralsupermarketorder/queryDetailById?id=${this.id}`).then(res => { this.$instance.post(`/app/appintegralsupermarketorder/queryDetailById?id=${this.id}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
@@ -79,6 +85,13 @@ export default {
} }
}) })
}, },
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo().then(() => {
this.getDetail()
})
})
}
}, },
} }
</script> </script>