|
@@ -1,29 +1,69 @@
|
|
|
<template>
|
|
|
- <div class="p-renewal">
|
|
|
+ <div v-if="info" class="p-renewal">
|
|
|
<h3 class="ptc-title">Renewal management</h3>
|
|
|
<div class="ptc-wrapper">
|
|
|
<div class="ptc-block">
|
|
|
<div class="ptc-inner">
|
|
|
<div class="cell">
|
|
|
<span class="cell__label">Product Name:</span>
|
|
|
- <span class="cell__value">Lite</span>
|
|
|
+ <span class="cell__value">{{ info.product_name }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell__label">Subscription method:</span>
|
|
|
- <span class="cell__value">Annual</span>
|
|
|
+ <span class="cell__value">{{
|
|
|
+ info.subscribe_type > 1 ? 'Annual' : 'Monthly'
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="cell">
|
|
|
+ <strong class="cell__label primary" @click="unsubscribe"
|
|
|
+ >Unsubscribe ></strong
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div class="primary">Unsubscribe ></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ptc-button-group">
|
|
|
<div class="ptc-inner">
|
|
|
- <button class="ptc-button ptc-button--stroke">BACK</button>
|
|
|
+ <button class="ptc-button ptc-button--stroke" @click="$router.back()">
|
|
|
+ BACK
|
|
|
+ </button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+<script>
|
|
|
+import { defineComponent } from 'vue'
|
|
|
+import { getOrderInfo, unsubscribe } from '@/service/order'
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ name: 'Renewal',
|
|
|
+ async beforeRouteEnter(to, from, next) {
|
|
|
+ const { results } = await getOrderInfo(to.query.id)
|
|
|
+ next(vm => (vm.info = results))
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ /** @type {any} */
|
|
|
+ info: null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async unsubscribe() {
|
|
|
+ await this.$dialog({
|
|
|
+ title: 'TIPS',
|
|
|
+ content:
|
|
|
+ 'Are you sure you want to close the subscription?\nAfter closing the subscription, if you want to use the membership service, you need to re-subscribe',
|
|
|
+ confirmText: 'CLOSE',
|
|
|
+ showCancel: true,
|
|
|
+ })
|
|
|
+ const { message } = await unsubscribe(this.$route.query.id)
|
|
|
+ this.$toast(message)
|
|
|
+ },
|
|
|
+ },
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
<style lang="scss">
|
|
|
.p-renewal {
|
|
|
.cell {
|
|
@@ -38,10 +78,5 @@
|
|
|
color: #333;
|
|
|
}
|
|
|
}
|
|
|
- .primary {
|
|
|
- margin-top: 8px;
|
|
|
- font-weight: bold;
|
|
|
- font-size: 32px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|