冯诚 3 gadi atpakaļ
vecāks
revīzija
1ec867e844

+ 1 - 0
src/components/radio/Radio.vue

@@ -42,6 +42,7 @@ function onClick() {
   border-radius: 8px;
   border: 2px solid #d9d9d9;
   color: #666;
+  cursor: pointer;
   &--checked {
     border-color: $primary-color;
     color: $primary-color;

+ 4 - 2
src/pages/benefits/index.vue

@@ -13,8 +13,10 @@
         <p class="l4">
           <button class="ptc-button ptc-button--stroke">Renewal</button>
         </p>
-        <p class="l5" @click="$router.push(`/renewal?id=${$route.params.id}`)">
-          Renewal management >
+        <p class="l5">
+          <router-link :to="`/renewal?id=${$route.params.id}`">
+            Renewal management >
+          </router-link>
         </p>
       </div>
     </div>

+ 2 - 0
src/pages/fill-order/StepOne.vue

@@ -127,6 +127,8 @@ function reviseDiscount() {
 }
 
 async function next() {
+  if (!state.form.subscribe_type)
+    return Toast('Please choose a subscription method')
   if (!state.brandList.length) await getBrandList()
   emit('go')
   if (!state.discount) state.form.discount_code = ''

+ 1 - 0
src/pages/fill-order/index.vue

@@ -67,6 +67,7 @@ function go(delta = 1) {
       font-size: 32px;
       font-weight: bold;
       color: $primary-color;
+      cursor: pointer;
     }
   }
 }

+ 31 - 4
src/pages/imei/index.vue

@@ -1,23 +1,31 @@
 <template>
   <div v-if="action === 'bind'" class="p-imei">
     <h3 class="ptc-title">
-      You have a Lite version of membership service to be bound
+      You have a {{ $route.query.v }} version of membership service to be bound
     </h3>
     <div class="ptc-wrapper">
       <div class="ptc-block">
         <div class="ptc-inner">
           <p class="label">IMEI</p>
           <p class="control">
-            <input class="ptc-input" placeholder="please enter" />
+            <input
+              v-model="imei"
+              class="ptc-input"
+              placeholder="please enter"
+            />
           </p>
           <p class="tip">
-            <span @click="$router.push('view')">How to view IMEI?</span>
+            <span class="pointer" @click="$router.push('view')"
+              >How to view IMEI?</span
+            >
           </p>
         </div>
       </div>
       <div class="ptc-button-group">
         <div class="ptc-inner">
-          <button class="ptc-button">BIND IMEI</button>
+          <button class="ptc-button" :loading="loading" @click="applyBind">
+            BIND IMEI
+          </button>
         </div>
       </div>
     </div>
@@ -38,7 +46,26 @@
 </template>
 
 <script setup lang="ts">
+import { ref } from 'vue'
+import { useRoute } from 'vue-router'
+import { bindIMEI } from '@/service/order'
+import Toast from '@/components/toast'
+
 defineProps<{ action: 'bind' | 'view' }>()
+
+const imei = ref('')
+const loading = ref(false)
+const { id } = useRoute().query as any
+
+async function applyBind() {
+  if (!imei.value) return Toast('Please enter IMEI')
+  loading.value = true
+  try {
+    const { message } = await bindIMEI({ id, imei: imei.value })
+    Toast(message)
+  } catch {}
+  loading.value = false
+}
 </script>
 
 <style lang="scss">

+ 45 - 10
src/pages/pay-result/index.vue

@@ -10,26 +10,40 @@
       <div class="info">
         <p class="info-item">
           <span class="info-label">Version: </span>
-          <span class="info-value">xxxxx</span>
+          <span class="info-value">{{ info.product_name }}</span>
         </p>
         <p class="info-item">
           <span class="info-label">Duration: </span>
-          <span class="info-value">xxxxx</span>
+          <span class="info-value"
+            >{{ info.start_time }}-{{ info.end_time }}</span
+          >
         </p>
         <p class="info-item">
           <span class="info-label">Phone brand: </span>
-          <span class="info-value">xxxxx</span>
+          <span class="info-value">{{ info.phone_info.split(' ')[0] }}</span>
         </p>
         <p class="info-item">
           <span class="info-label">Phone model: </span>
-          <span class="info-value">xxxxx</span>
+          <span class="info-value">{{ phoneModel }}</span>
         </p>
       </div>
       <div class="button-group">
-        <button class="ptc-button" @click="$router.push('/imei/bind')">
+        <button
+          class="ptc-button"
+          @click="
+            $router.push(
+              `/imei/bind?id=${$route.query.id}&v=${info.product_name}`
+            )
+          "
+        >
           BIND IMEI
         </button>
-        <button class="ptc-button ptc-button--stroke">CHECK ORDER</button>
+        <button
+          class="ptc-button ptc-button--stroke"
+          @click="$router.push(`/order/${$route.query.id}`)"
+        >
+          CHECK ORDER
+        </button>
         <button class="ptc-button ptc-button--stroke">HOMEPAGE</button>
       </div>
     </div>
@@ -48,12 +62,33 @@
   </div>
 </template>
 
-<script setup lang="ts">
+<script>
+import { defineComponent } from 'vue'
+import { getOrderInfo } from '@/service/order'
 import { state } from '@/store'
 
-defineProps<{ status: 'success' | 'fail' }>()
-
-state.bgWhite = true
+export default defineComponent({
+  name: 'PayResult',
+  props: ['status'], // 'success' | 'fail'
+  async beforeRouteEnter(to, from, next) {
+    const { results } = await getOrderInfo(to.query.id)
+    next(vm => {
+      vm.info = results
+      state.bgWhite = true
+    })
+  },
+  data() {
+    return {
+      /** @type {any} */
+      info: {},
+    }
+  },
+  computed: {
+    phoneModel() {
+      return (this.info.phone_info || '').split(' ').slice(1).join(' ')
+    },
+  },
+})
 </script>
 
 <style lang="scss">

+ 1 - 1
src/pages/renewal/index.vue

@@ -15,7 +15,7 @@
             }}</span>
           </div>
           <div class="cell">
-            <strong class="cell__label primary" @click="unsubscribe"
+            <strong class="cell__label primary pointer" @click="unsubscribe"
               >Unsubscribe ></strong
             >
           </div>

+ 6 - 3
src/pages/repaire/index.scss

@@ -45,10 +45,12 @@
     padding: 48px 0 40px;
     font-size: 32px;
     color: #1a1a1a;
+    cursor: pointer;
     @include thin-border(bottom);
-    // &:active {
-    //   background: #f2f5fb;
-    // }
+    &:hover,
+    &:active {
+      background: #f2f5fb;
+    }
   }
 
   .tip {
@@ -341,6 +343,7 @@
     font-size: 32px;
     font-weight: 600;
     color: $primary-color;
+    cursor: pointer;
     &.hidden {
       visibility: hidden;
     }

+ 2 - 1
src/pages/repaire/steps/StepOne.vue

@@ -22,6 +22,7 @@
           v-for="(item, index) of suggestions"
           :key="index"
           class="suggestion"
+          @click="selectShop(item)"
         >
           {{ item.name }}
         </div>
@@ -40,7 +41,7 @@
               v-for="(item, index) of list"
               :key="index"
               class="shop-item border-bottom"
-              @click="item.can_appointment && selectShop(item)"
+              @click="selectShop(item)"
             >
               <div class="shop-name">
                 <span>{{ item.name }}</span>

+ 1 - 0
src/pages/repaire/steps/StepTwo.vue

@@ -26,6 +26,7 @@
               :key="index"
               class="date"
               :value="item.fullDate"
+              :disabled="!state.shop.can_appointment"
               >{{ item.day }},{{ item.date }}</PtcRadio
             >
           </PtcRadioGroup>