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