|
@@ -34,19 +34,18 @@
|
|
|
|
|
|
<script>
|
|
|
import { defineComponent } from 'vue'
|
|
|
-import { getOrderInfo, unsubscribe } from '@/service/order'
|
|
|
+import { unsubscribe } from '@/service/order'
|
|
|
+import { state, getCurrentOrder } from '@/store'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'Renewal',
|
|
|
- async beforeRouteEnter(to, from, next) {
|
|
|
- const { results } = await getOrderInfo(to.query.id)
|
|
|
- next(vm => (vm.info = results))
|
|
|
+ async beforeRouteEnter(to) {
|
|
|
+ return await getCurrentOrder(to.query.id)
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- /** @type {any} */
|
|
|
- info: null,
|
|
|
- }
|
|
|
+ computed: {
|
|
|
+ info() {
|
|
|
+ return state.currentOrder
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
async unsubscribe() {
|
|
@@ -59,6 +58,8 @@ export default defineComponent({
|
|
|
})
|
|
|
const { message } = await unsubscribe(this.$route.query.id)
|
|
|
this.$toast(message)
|
|
|
+ state.currentOrder.id = -1
|
|
|
+ this.$router.back()
|
|
|
},
|
|
|
},
|
|
|
})
|