Browse Source

细节调整

冯诚 2 years ago
parent
commit
6d1018c28b

+ 8 - 3
src/components/dialog/Dialog.vue

@@ -7,8 +7,10 @@
       @wheel.prevent
     >
       <div class="ptc-dialog">
-        <div v-if="title" class="ptc-dialog__title">{{ title }}</div>
-        <div class="ptc-dialog__content">
+        <div class="ptc-dialog__title" :class="{ alone: !content }">
+          {{ title }}
+        </div>
+        <div v-if="content" class="ptc-dialog__content">
           <slot>{{ content }}</slot>
         </div>
         <div class="ptc-dialog__footer">
@@ -32,7 +34,7 @@
 withDefaults(
   defineProps<{
     visible: boolean
-    title?: string
+    title: string
     content?: string
     showCancel?: boolean
     cancelText?: string
@@ -89,6 +91,9 @@ function onConfirm() {
     font-weight: 500;
     line-height: 44px;
     color: rgba(0, 0, 0, 0.85);
+    &.alone {
+      padding: 64px 24px;
+    }
   }
 
   &__content {

+ 2 - 2
src/components/dialog/index.ts

@@ -4,7 +4,7 @@ import { mountComponent } from '../utils/mount-component'
 
 interface DialogProps {
   visible: boolean
-  title?: string
+  title: string
   content?: string
   showCancel?: boolean
   cancelText?: string
@@ -32,7 +32,7 @@ function getInstance() {
   if (!instance) {
     instance = mountComponent<DialogExposed>({
       setup(props, { expose }) {
-        const state = reactive<DialogProps>({ visible: false })
+        const state = reactive<DialogProps>({ visible: false, title: '' })
         const attrs = {
           'onUpdate:visible': (v: boolean) => {
             state.visible = v

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

@@ -254,6 +254,7 @@ async function next() {
   &.readonly {
     display: flex;
     align-items: center;
+    padding-right: 28px;
   }
 }
 

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

@@ -59,7 +59,11 @@ if (discountType) {
   getDiscountInfo(discountType).then(
     ({ results }) =>
       (state.discount = {
-        name: ['店员折扣', '新人折扣', '多次购买折扣'][discountType - 1],
+        name: [
+          'Manager Discount', // 店员折扣
+          'Referer Discount', // 新人折扣
+          'Repeat Customer Discount', // 多次购买折扣
+        ][discountType - 1],
         discount_amount: results.amount,
       })
   )

+ 2 - 1
src/pages/invite/index.vue

@@ -105,7 +105,8 @@ export default defineComponent({
       awards: [],
       inviteUrl:
         location.origin +
-        '/fill-order?from=member&invitee=' +
+        import.meta.env.BASE_URL +
+        'fill-order?from=member&invitee=' +
         state.userInfo.id,
     }
   },

+ 10 - 1
src/pages/my-order/index.vue

@@ -70,7 +70,14 @@
               <span class="cell__value">${{ item.payment_product }}</span>
             </div>
             <div v-if="item.discount_amount" class="cell">
-              <span class="cell__label">Discount</span>
+              <span class="cell__label">{{
+                [
+                  '',
+                  'Manager Discount',
+                  'Referer Discount',
+                  'Repeat Customer Discount',
+                ][item.discount_type] || 'Discount'
+              }}</span>
               <span class="cell__value highlight"
                 >-${{ item.discount_amount }}</span
               >
@@ -109,6 +116,7 @@
 <script>
 import { defineComponent } from 'vue'
 import * as api from '@/service/order'
+import Dialog from '@/components/dialog'
 
 export default defineComponent({
   name: 'OrderList',
@@ -129,6 +137,7 @@ export default defineComponent({
     },
 
     async deleteOrder(item) {
+      await Dialog.confirm('Confirm to delete?')
       await api.deleteOrder(item.id)
       this.list.splice(this.list.indexOf(item), 1)
     },

+ 2 - 0
src/pages/repair/history.vue

@@ -81,6 +81,7 @@
 <script>
 import { defineComponent } from 'vue'
 import * as api from '@/service/repair'
+import Dialog from '@/components/dialog'
 
 export default defineComponent({
   async beforeRouteEnter(to, from, next) {
@@ -99,6 +100,7 @@ export default defineComponent({
       item.audit_status = 2
     },
     async deleteRepair(item) {
+      await Dialog.confirm('Confirm to delete?')
       await api.deleteRepair(item.id)
       this.list.splice(this.list.indexOf(item), 1)
     },