|
@@ -3,7 +3,7 @@
|
|
|
<div class="ptc-inner">
|
|
|
<div class="alert">
|
|
|
<i class="alert-icon"></i>
|
|
|
- <p class="alert-message">Monday, October 10 9:00 -9:30</p>
|
|
|
+ <p class="alert-message">{{ formattedTime }}</p>
|
|
|
</div>
|
|
|
<div class="action">
|
|
|
<i class="icon-calendar"></i><strong>Add to calendar ></strong>
|
|
@@ -18,43 +18,41 @@
|
|
|
<div class="detail">
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Store:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <span class="cell-value">{{ state.detail.shop_name }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
- <span class="cell-label">Phone Brand:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <strong class="primary">Navigation></strong>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
- <strong class="primary">Navigation></strong>
|
|
|
+ <span class="cell-label">Phone Brand:</span>
|
|
|
+ <span class="cell-value">{{ state.detail.phone_brand }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Phone Model:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <span class="cell-value">{{ state.detail.phone_model }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Phone Number:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <span class="cell-value">{{ state.detail.phone_number }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">IMEI:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <span class="cell-value">{{ state.detail.phone_imei }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Service:</span>
|
|
|
- <span class="cell-value">xxxxxxxxxx</span>
|
|
|
+ <span class="cell-value">{{ state.detail.fix_name }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Member Price:</span>
|
|
|
- <span class="cell-value">$35</span>
|
|
|
+ <span class="cell-value">${{ state.detail.price }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ptc-button-group mg0">
|
|
|
<div class="ptc-inner">
|
|
|
- <button class="ptc-button" @click="state.step = 1">
|
|
|
- Reselect time
|
|
|
- </button>
|
|
|
- <button class="ptc-button ptc-button--stroke">
|
|
|
+ <button class="ptc-button" @click="reselect">Reselect time</button>
|
|
|
+ <button class="ptc-button ptc-button--stroke" @click="applyCancel">
|
|
|
Cancel appointment
|
|
|
</button>
|
|
|
</div>
|
|
@@ -63,6 +61,30 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
import { state } from '../store'
|
|
|
import { cancelRepair } from '@/service/repair'
|
|
|
+import Toast from '@/components/toast'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+const formattedTime = (() => {
|
|
|
+ const _ = dayjs(state.date, 'YYYY-MM-DD')
|
|
|
+ return `${_.format('dddd')},${_.format('MMMM')} ${_.format('DD')} ${
|
|
|
+ state.uiPeriod
|
|
|
+ }`
|
|
|
+})()
|
|
|
+
|
|
|
+function reselect() {
|
|
|
+ state.rightId
|
|
|
+ ? router.replace({ path: '', query: { id: state.repairId } })
|
|
|
+ : (state.step = 1)
|
|
|
+}
|
|
|
+
|
|
|
+async function applyCancel() {
|
|
|
+ const { message } = await cancelRepair(+state.repairId)
|
|
|
+ Toast(message)
|
|
|
+ setTimeout(() => router.push('/repaire/history'), 500)
|
|
|
+}
|
|
|
</script>
|