Browse Source

最后一波bug

冯诚 1 year ago
parent
commit
25103f0244

BIN
public/favicon.png


+ 1 - 1
src/App.vue

@@ -40,7 +40,7 @@ onMounted(getLocation)
 <style lang="scss">
 .main-container {
   min-height: 100vh;
-  padding-bottom: 48px;
+  padding-bottom: 160px;
   background: #f7f7f7;
   overflow: hidden;
   &:first-child {

+ 7 - 9
src/components/nav-bar/index.vue

@@ -18,16 +18,14 @@
           </div>
           <div class="nav-menu-body">
             <ul class="nav-links-inner">
-              <!-- <li class="nav-link">
-                <router-link to="/repair/appointment"
-                  >REPAIR BOOKING</router-link
-                >
-              </li> -->
               <li class="nav-link">
-                <a href="https://www.ptcshop.com.au/">ONLINE SHOP</a>
+                <a href="https://www.ptc.net.au/booking/">REPAIR BOOKING</a>
               </li>
               <li class="nav-link">
-                <a href="https://www.ptc.net.au/">PTC Care Plus</a>
+                <a href="https://www.ptcshop.com.au/">ONLINE SHOP</a>
+              </li>
+              <li class="nav-link active">
+                <a href="/care/">Care Plus</a>
               </li>
               <li class="nav-link">
                 <a href="https://www.ptc.net.au/store-locator/"
@@ -53,8 +51,8 @@
       <div class="contact">
         <i class="icon-phone"></i>
         <div>
-          <p class="tel">400-100-100</p>
-          <p class="time">Mon-Fri &nbsp;9:00-17:00</p>
+          <p class="tel">1300 000 349</p>
+          <p class="time">Mon-Fri &nbsp;9:00-16:00</p>
         </div>
       </div>
     </div>

+ 1 - 3
src/pages/login/index.vue

@@ -114,9 +114,7 @@ async function handleLogin() {
   const { need_change } = await getUserInfo()
   ;+need_change
     ? router.push('/password/change')
-    : from
-    ? router.replace(from)
-    : location.replace('/care/')
+    : router.replace(from || '/account')
 }
 </script>
 

+ 9 - 1
src/pages/repair/appointment.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, watch, onUnmounted } from 'vue'
+import { computed, watch, onMounted, onUnmounted } from 'vue'
 import { useRouter, useRoute } from 'vue-router'
 import StepOne from './steps/StepOne.vue'
 import StepTwo from './steps/StepTwo.vue'
@@ -14,6 +14,7 @@ import StepThree from './steps/StepThree.vue'
 import StepFive from './steps/StepFive.vue'
 import { state, resetState } from './store'
 import { state as rootState } from '@/store'
+import { getRepairInfo } from '@/service/repair'
 
 const Component = computed(
   () => [StepOne, StepTwo, StepThree, StepFive][state.step]
@@ -23,6 +24,13 @@ const { id, right_id } = useRoute().query as any
 id && (state.repairId = id)
 right_id && (state.rightId = right_id)
 
+onMounted(async () => {
+  if (id) {
+    const res = (await getRepairInfo(+id)).results
+    state.phoneNumber = res.phone_number
+    state.remark = res.remark
+  }
+})
 onUnmounted(() => resetState())
 
 watch(

+ 1 - 1
src/pages/repair/history.vue

@@ -43,7 +43,7 @@
             <span class="cell-value">${{ item.price }}</span>
           </div>
           <div class="cell mt48">
-            <span class="cell-label">Postcript:</span>
+            <span class="cell-label">Postscript:</span>
             <span class="cell-value">{{ item.remark }}</span>
           </div>
         </div>

+ 12 - 8
src/pages/repair/steps/StepFive.vue

@@ -25,7 +25,7 @@
           <span class="cell-value">{{ state.detail.shop_name }}</span>
         </div>
         <div class="cell">
-          <strong class="primary" @click="navigate">Navigation></strong>
+          <strong class="primary pointer" @click="navigate">Navigation></strong>
         </div>
         <div class="cell">
           <span class="cell-label">Phone Brand:</span>
@@ -65,6 +65,7 @@
 </template>
 
 <script setup lang="ts">
+import { onMounted } from 'vue'
 import { useRouter } from 'vue-router'
 import { state } from '../store'
 import { cancelRepair } from '@/service/repair'
@@ -73,6 +74,11 @@ import dayjs from 'dayjs'
 import getLocation from '@/utils/getLocation'
 
 const router = useRouter()
+let coords: GeolocationCoordinates | undefined
+
+onMounted(async () => {
+  coords = (await getLocation({ timeout: 800 }))?.coords
+})
 
 const formattedTime = (() => {
   const _ = dayjs(state.date, 'YYYY-MM-DD')
@@ -94,12 +100,10 @@ async function applyCancel() {
   setTimeout(() => router.push('/repair/history'), 500)
 }
 
-async function navigate() {
-  const { coords } = (await getLocation({ timeout: 800 })) || {}
-  window.open(
-    `https://maps.google.com/maps?${
-      coords ? `saddr=${coords.latitude},${coords.longitude}&` : ''
-    }daddr=${state.shop.coordinates || ''}`
-  )
+function navigate() {
+  const url = `https://maps.google.com/maps?${
+    coords ? `saddr=${coords.latitude},${coords.longitude}&` : ''
+  }daddr=${state.shop.coordinates || ''}`
+  window.open(url)
 }
 </script>

+ 1 - 7
src/pages/repair/steps/StepThree.vue

@@ -61,18 +61,12 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted } from 'vue'
+import { ref } from 'vue'
 import { state } from '../store'
 import * as api from '@/service/repair'
 import Toast from '@/components/toast'
 import NProgress from 'nprogress'
 
-onMounted(async () => {
-  if (state.repairId) {
-    state.phoneNumber = (await api.getRepairPhone()).results
-  }
-})
-
 const submitted = ref(false)
 const loading = ref(false)
 

+ 3 - 0
src/style/normalize.scss

@@ -69,6 +69,9 @@ textarea {
   font-family: inherit;
   background: none;
 }
+button {
+  cursor: pointer;
+}
 
 textarea {
   resize: none;