소스 검색

feat: fix

Basil 2 년 전
부모
커밋
763af95bde
55개의 변경된 파일3357개의 추가작업 그리고 635개의 파일을 삭제
  1. 4 0
      components.d.ts
  2. 3 0
      src/apis/common.ts
  3. 30 3
      src/apis/model/refund.model.ts
  4. 12 0
      src/apis/order.api.ts
  5. 1 2
      src/components/CXBSkuPopup/CXBSkuPopup.vue
  6. 1 1
      src/pages.json
  7. 3 3
      src/pages/dacang/list/index.vue
  8. 10 5
      src/pages/feedback/index.vue
  9. 2 2
      src/pages/home/components/navs.vue
  10. 1 1
      src/pages/home/index.vue
  11. 2 1
      src/pages/immediate-withdrawal/index.vue
  12. 14 6
      src/pages/my-profile/index.vue
  13. 8 3
      src/pages/order/comment.vue
  14. 127 0
      src/pages/order/components/AllItemList.vue
  15. 103 0
      src/pages/order/components/ObligationOrderList.vue
  16. 111 0
      src/pages/order/components/Order2List.vue
  17. 128 0
      src/pages/order/components/Order3List.vue
  18. 128 0
      src/pages/order/components/Order4List.vue
  19. 51 23
      src/pages/order/components/OrderItem.vue
  20. 208 40
      src/pages/order/components/OrderObligationItem.vue
  21. 4 4
      src/pages/order/components/OtherOrderItem.vue
  22. 13 13
      src/pages/order/components/RefundOrderItem.vue
  23. 132 10
      src/pages/order/detail.vue
  24. 192 142
      src/pages/order/index.vue
  25. 280 0
      src/pages/order/obligation-detail.vue
  26. 16 196
      src/pages/order/test.json
  27. 179 0
      src/pages/order/third-order-temp.vue
  28. 161 101
      src/pages/order/third-order.vue
  29. 511 0
      src/pages/order_addcart/index-new.vue
  30. 67 7
      src/pages/order_addcart/index.vue
  31. 1 2
      src/pages/payment/index.vue
  32. 21 0
      src/pages/payment/success.vue
  33. 1 1
      src/pages/pension_choice_platform/index.vue
  34. 3 3
      src/pages/pension_record/detail.vue
  35. 1 1
      src/pages/pension_record/index.vue
  36. 38 4
      src/pages/pension_record/list.vue
  37. 3 1
      src/pages/refund/README.md
  38. 126 0
      src/pages/refund/components/GoodStatusPopup.vue
  39. 158 0
      src/pages/refund/components/RefundReasonPopup.vue
  40. 27 7
      src/pages/refund/detail.vue
  41. 261 0
      src/pages/refund/drawback.vue
  42. 20 11
      src/pages/refund/index.vue
  43. 110 0
      src/pages/refund/option.vue
  44. 13 1
      src/pages/search/index.vue
  45. 1 1
      src/pages/store/home/index.vue
  46. 2 2
      src/pages/store/nearby/index.vue
  47. 1 1
      src/pages/store/product/detail.vue
  48. 49 32
      src/pages/store/product/other.vue
  49. 19 5
      src/pages/user/index.vue
  50. BIN
      src/static/icon/close.png
  51. BIN
      src/static/icon/radio-off.png
  52. BIN
      src/static/icon/radio-on.png
  53. BIN
      src/static/icon/关闭@2x.png
  54. BIN
      src/static/icon/未选中 2@2x (1).png
  55. BIN
      src/static/icon/未选中 2@2x.png

+ 4 - 0
components.d.ts

@@ -43,6 +43,8 @@ declare module '@vue/runtime-core' {
43 43
     NutButton: typeof import('uniapp-nutui/components/button/button.vue')['default']
44 44
     NutCalendar: typeof import('uniapp-nutui/components/calendar/calendar.vue')['default']
45 45
     NutCascader: typeof import('uniapp-nutui/components/cascader/cascader.vue')['default']
46
+    NutCell: typeof import('uniapp-nutui/components/cell/cell.vue')['default']
47
+    NutCellGroup: typeof import('uniapp-nutui/components/cellgroup/cellgroup.vue')['default']
46 48
     NutCheckbox: typeof import('uniapp-nutui/components/checkbox/checkbox.vue')['default']
47 49
     NutDatePicker: typeof import('uniapp-nutui/components/datepicker/datepicker.vue')['default']
48 50
     NutDialog: typeof import('uniapp-nutui/components/dialog/dialog.vue')['default']
@@ -57,6 +59,8 @@ declare module '@vue/runtime-core' {
57 59
     NutOverlay: typeof import('uniapp-nutui/components/overlay/overlay.vue')['default']
58 60
     NutPicker: typeof import('uniapp-nutui/components/picker/picker.vue')['default']
59 61
     NutPopup: typeof import('uniapp-nutui/components/popup/popup.vue')['default']
62
+    NutRadio: typeof import('uniapp-nutui/components/radio/radio.vue')['default']
63
+    NutRadioGroup: typeof import('uniapp-nutui/components/radiogroup/radiogroup.vue')['default']
60 64
     NutRate: typeof import('uniapp-nutui/components/rate/rate.vue')['default']
61 65
     NutSearchbar: typeof import('uniapp-nutui/components/searchbar/searchbar.vue')['default']
62 66
     NutStep: typeof import('uniapp-nutui/components/step/step.vue')['default']

+ 3 - 0
src/apis/common.ts

@@ -78,6 +78,9 @@ export function closeAccount(phone: string) {
78 78
 
79 79
     return defHttp.post({
80 80
         url: API.USER_LOGOUT,
81
+        data: {
82
+            phone
83
+        }
81 84
     })
82 85
 }
83 86
 

+ 30 - 3
src/apis/model/refund.model.ts

@@ -1,3 +1,26 @@
1
+export interface RefundApplyRequest {
2
+    //订单商品id ---order_product_id
3
+    ids: string
4
+    // 申请说明
5
+    mark: string
6
+    // 数量
7
+    num: string
8
+    // 联系电话
9
+    phone: string
10
+    // 图片
11
+    pics: Array<string>
12
+    // 原因
13
+    refund_message: string
14
+    // 退款金额
15
+    refund_price: string
16
+    // 固定值
17
+    type: string
18
+    //1:退款 2:退款退货
19
+    refund_type: string
20
+    // 收货状态
21
+    goods: string
22
+
23
+}
1 24
 export interface RefundModel {
2 25
     refund_order_id: string
3 26
     refund_order_sn: string
@@ -31,7 +54,9 @@ export interface RefundModel {
31 54
     is_system_del: string
32 55
     after_sn: string
33 56
     refundProduct: Array<RefundProductModel>
34
-    private Merchant merchant: string
57
+    // private Merchant merchant: string
58
+    // merchant: MerchantModel
59
+    merchant: any
35 60
     take_status: string
36 61
 }
37 62
 
@@ -55,7 +80,8 @@ export interface RefundProductModel {
55 80
         refund_num: string
56 81
         is_reply: string
57 82
         product_price: string
58
-        private Cart_info cart_info: string
83
+        // private Cart_info cart_info: string
84
+        cart_info: any
59 85
         create_time: string
60 86
         type: string
61 87
     }
@@ -75,7 +101,8 @@ export interface ProductModel {
75 101
     refund_num: string
76 102
     is_reply: string
77 103
     product_price: string
78
-    private Cart_info cart_info: string
104
+    // private Cart_info cart_info: string
105
+    cart_info: any
79 106
     create_time: string
80 107
     type: string
81 108
 }

+ 12 - 0
src/apis/order.api.ts

@@ -7,6 +7,7 @@ import type {
7 7
 import type {ThirdOrderResult} from "~/apis/model/third-order.model";
8 8
 import type {CommentProductRequest} from "~/apis/model/comment-product";
9 9
 import type {AfterSalesOrderResult} from "~/apis/model/after-sales-order.model";
10
+import type {RefundApplyRequest} from "~/apis/model/refund.model";
10 11
 
11 12
 export interface CartIdRequest {
12 13
     cart_id: Array<string>
@@ -70,6 +71,17 @@ enum API {
70 71
 }
71 72
 
72 73
 /**
74
+ * 申请退款
75
+ */
76
+export function refundApply(id: string, request: RefundApplyRequest) {
77
+    return defHttp.post({
78
+        url: API.REFUND_APPLY + `/${id}`,
79
+        data: {
80
+            ...request
81
+        }
82
+    })
83
+}
84
+/**
73 85
  * 退款订单详情
74 86
  * @param id
75 87
  */

+ 1 - 2
src/components/CXBSkuPopup/CXBSkuPopup.vue

@@ -30,7 +30,6 @@ const show = ref(props.show || false)
30 30
 const showValue = computed<PopupProps['show']>({
31 31
   get: () => props.show || show.value,
32 32
   set(val) {
33
-    // console.log(val + 'xxxx')
34 33
     if (val)
35 34
       emit(OPEN_EVENT)
36 35
     else
@@ -102,7 +101,7 @@ function handleCountChange(value) {
102 101
       v-model:show="showValue"
103 102
       @close="onCancel"
104 103
       position="bottom"
105
-      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[40%] max-h-[80%]"
104
+      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe h-[60%] max-h-[80%]"
106 105
 
107 106
   >
108 107
     <div class="flex flex-col justify-between h-full">

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
src/pages.json


+ 3 - 3
src/pages/dacang/list/index.vue

@@ -147,9 +147,9 @@ function handleShowSearchPage() {
147 147
 <!--                  :current="classifyId"-->
148 148
 <!--                  @click:item="handleTabItemClick"-->
149 149
 <!--    />-->
150
-    <div class=" z-10"  >
150
+    <div class=" fixed"  :class="headerClass">
151 151
       <div :class="headerClass">
152
-        <FNavBar :fixed="true" exClass="pl-2">
152
+        <FNavBar :fixed="true" exClass="pl-2 z-10">
153 153
           <div
154 154
               @click="handleShowSearchPage"
155 155
               class="w-60% bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red"
@@ -170,7 +170,7 @@ function handleShowSearchPage() {
170 170
           </div>
171 171
 
172 172
         </FNavBar>
173
-        <FTabs :tabs="state.tabs" :current="classifyId" @click:item="handleTabItemClick"/>
173
+        <FTabs class="fixed" :tabs="state.tabs" :current="classifyId" @click:item="handleTabItemClick"/>
174 174
       </div>
175 175
 
176 176
     </div>

+ 10 - 5
src/pages/feedback/index.vue

@@ -101,12 +101,17 @@ function handleItemClick(item) {
101 101
 }
102 102
 
103 103
 function handleUploadSuccess({ data, option, fileItem }) {
104
-  console.log(data.data.path)
105
-  if (data && data.data && data.data.path) {
106
-    formData.images.push(data.data.path)
104
+  if (data && data.data) {
105
+    const resData = JSON.parse(data.data).data
106
+    const path = resData.path
107
+    formData.images.push(path)
107 108
   }
108
-
109
-  console.log(fileItem)
109
+  // console.log(data.data.path)
110
+  // if (data && data.data && data.data.path) {
111
+  //   formData.images.push(data.data.path)
112
+  // }
113
+  //
114
+  // console.log(fileItem)
110 115
 }
111 116
 
112 117
 function handleSubmit() {

+ 2 - 2
src/pages/home/components/navs.vue

@@ -60,7 +60,7 @@ const navList = ref([{
60 60
 }, {
61 61
   image: CDN_URL + '/static/home-nav/vip_img.png',
62 62
   title: '会员专区',
63
-  key: 'vip',
63
+  key: 'member',
64 64
   // key: PLATFORM_NAME.DC,
65 65
   // categoryId: '567',
66 66
 }, {
@@ -98,7 +98,7 @@ function handleItemClick(item: any) {
98 98
       break;
99 99
     }
100 100
     // 会员专区
101
-    case 'vip': {
101
+    case 'member': {
102 102
       uni.navigateTo({
103 103
         url: '/pages/vip/index'
104 104
       })

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

@@ -162,7 +162,7 @@ page {
162 162
   background-color: #f8f8f8;
163 163
 }
164 164
 </style>
165
-<route lang="yaml">
165
+<route lang="yaml" type="home">
166 166
 style:
167 167
   navigationStyle: custom
168 168
   navigationBarTitleText: 储蓄保

+ 2 - 1
src/pages/immediate-withdrawal/index.vue

@@ -28,7 +28,7 @@ onLoad(async () => {
28 28
   // 佣金信息
29 29
   userSpreadInfo.value = await getUserSpreadInfo()
30 30
 
31
-  yanglaojin.value = getUserYangLaoJin()
31
+  yanglaojin.value = await getUserYangLaoJin()
32 32
 
33 33
   // 提现配置
34 34
   widthdrawalConfig.value = await getWithdrawalConfig()
@@ -62,6 +62,7 @@ function handleInputAll() {
62 62
  * 立即提现
63 63
  */
64 64
 function handleImmediateWithdrawal() {
65
+  console.log(yanglaojin.value)
65 66
   // 1 判断是否需要实名
66 67
   if (!yanglaojin.value?.is_certification == 1) {
67 68
     return uni.navigateTo({

+ 14 - 6
src/pages/my-profile/index.vue

@@ -33,7 +33,7 @@ const showDatePicker = ref(false)
33 33
 const birthdayPopupValue = ref()
34 34
 const minDate = new Date(1900, 0, 1);
35 35
 const maxDate = new Date(2025, 10, 1);
36
-const currentDate = new Date()
36
+const currentDate = ref(new Date())
37 37
 
38 38
 const birthdayPopupConfirm = ({ selectedValue, selectedOptions }) => {
39 39
   console.log(selectedValue.join('-'))
@@ -88,13 +88,19 @@ function onChooseAvatar({ detail }) {
88 88
   })
89 89
 }
90 90
 
91
+watch(() => currentDate.value, (val) => {
92
+  if (val) {
93
+    formData.birthday = val
94
+  }
95
+})
91 96
 function handleSubmit() {
92 97
   // console.log(formData)
93 98
   updateUserInfo({
94 99
     avatar: formData.avatar,
95 100
     nickname: formData.nickname,
96 101
     sex: formData.sex,
97
-    birthday: formData.birthday,
102
+    // birthday: formData.birthday,
103
+    birthday: currentDate.value,
98 104
     mark: formData.mark
99 105
   }).then(res => {
100 106
     if (res) {
@@ -102,7 +108,9 @@ function handleSubmit() {
102 108
         title: '保存成功',
103 109
         icon: 'none'
104 110
       }).then(() => {
105
-        uni.navigateBack()
111
+        setTimeout(() => {
112
+          uni.navigateBack()
113
+        }, 500)
106 114
       })
107 115
     }
108 116
   }).catch(error => {
@@ -168,7 +176,7 @@ function handleSubmit() {
168 176
         class="bg-white rounded-md text-sm flex justify-between p-3  f-hairline-bottom">
169 177
       <div class="">生日</div>
170 178
       <div class="flex items-center" @click="showDatePicker = true">
171
-        <div>请选择</div>
179
+        <div>{{ formData.birthday ? formData.birthday : '请选择'}}</div>
172 180
         <div
173 181
             class="f-text-color-2 i-tabler-chevron-right transform transition-300"
174 182
         />
@@ -191,7 +199,7 @@ function handleSubmit() {
191 199
         class="bg-white rounded-md text-sm flex justify-between p-3  f-hairline-bottom">
192 200
       <div class="">手机号</div>
193 201
       <div class="flex items-center">
194
-        <div><input placeholder="请填写昵称" :value="formData.phone" class="text-right"/></div>
202
+        <div><input placeholder="请填写手机号" v-model="formData.phone" class="text-right"/></div>
195 203
         <div
196 204
             class="f-text-color-2 i-tabler-chevron-right transform transition-300"
197 205
         />
@@ -204,7 +212,7 @@ function handleSubmit() {
204 212
         class="bg-white rounded-md text-sm flex justify-between p-3  f-hairline-bottom">
205 213
       <div class="">签名</div>
206 214
       <div class="flex items-center">
207
-        <div><input placeholder="请填写您的人个性签名" :value="formData.mark" class="text-right"/></div>
215
+        <div><input placeholder="请填写您的人个性签名" v-model="formData.mark" class="text-right"/></div>
208 216
         <div
209 217
             class="f-text-color-2 i-tabler-chevron-right transform transition-300"
210 218
         />

+ 8 - 3
src/pages/order/comment.vue

@@ -37,10 +37,15 @@ onLoad((options) => {
37 37
 const defaultFileList = ref([])
38 38
 function handleUploadSuccess({ data, option, fileItem }) {
39 39
   // console.log(data.data.path)
40
-  if (data && data.data && data.data.path) {
41
-    formData.pics.push(data.data.path)
42
-  }
40
+  // if (data && data.data && data.data.path) {
41
+  //   formData.pics.push(data.data.path)
42
+  // }
43 43
 
44
+  if (data && data.data) {
45
+    const resData = JSON.parse(data.data).data
46
+    const path = resData.path
47
+    formData.pics.push(path)
48
+  }
44 49
   // console.log(fileItem)
45 50
 }
46 51
 

+ 127 - 0
src/pages/order/components/AllItemList.vue

@@ -0,0 +1,127 @@
1
+<script setup lang="ts">
2
+import {getAllOrder} from "~/apis/order.api";
3
+import OrderItem from "~/pages/order/components/OrderItem.vue";
4
+import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
5
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
+
7
+const state = reactive({
8
+  currentPage: 1,
9
+  pageSize: 10,
10
+  totalPage: 1,
11
+
12
+  list: []
13
+})
14
+
15
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
16
+  // console.log(state.keyword)
17
+  if (action === 'reload') {
18
+    state.currentPage = 1
19
+  }
20
+  const params = {
21
+    page: state.currentPage,
22
+    limit: state.pageSize
23
+  }
24
+  if (state.keyword) {
25
+    params.keyword = state.keyword
26
+  }
27
+
28
+  getAllOrder({
29
+    page: state.currentPage,
30
+    limit: state.pageSize
31
+  }).then(res => {
32
+    console.log(res)
33
+    if (action === 'page') {
34
+      state.list = state.list.concat(res.list)
35
+    }
36
+    if (action == 'reload') {
37
+      state.list = res.list
38
+    }
39
+    state.totalPage = Math.ceil(res.total / state.pageSize);
40
+
41
+    state.status = 'more'
42
+    if (callback) {
43
+      callback(res.list)
44
+    }
45
+  })
46
+}
47
+
48
+function handleScrollToLower() {
49
+  state.status = 'loading';
50
+  state.currentPage += 1;
51
+
52
+  if (state.currentPage > state.totalPage) {
53
+    state.status = 'noMore';
54
+  } else {
55
+    setTimeout(() => {
56
+      loadList('page')
57
+    }, 300)
58
+  }
59
+  // setTimeout(() => {
60
+  //   loadList('page', (items) => {
61
+  //     if (items.length === 0) {
62
+  //       state.status = 'noMore'
63
+  //     }
64
+  //   })
65
+  // }, 300)
66
+}
67
+
68
+// onReachBottom(() => {
69
+//   handleScrollToLower()
70
+//
71
+// })
72
+// onPullDownRefresh(() => {
73
+//   loadList('reload', items => {
74
+//     setTimeout(() => {
75
+//       uni.stopPullDownRefresh()
76
+//     }, 300)
77
+//   })
78
+// })
79
+onMounted(() => {
80
+  loadList('reload')
81
+  uni.$on('onTab0ReachBottom', () => {
82
+    console.log('alll...')
83
+    handleScrollToLower()
84
+  })
85
+  uni.$on('onTab0PullDownRefresh', () => {
86
+    loadList('reload', items => {
87
+      setTimeout(() => {
88
+        uni.stopPullDownRefresh()
89
+      }, 300)
90
+    })
91
+  })
92
+})
93
+
94
+onUnmounted(() => {
95
+  uni.$off('onTab0ReachBottom');
96
+  uni.$off('onTab0PullDownRefresh');
97
+})
98
+
99
+// onUnload(){
100
+//   uni.$off('onReachBottom');
101
+// },
102
+</script>
103
+<template>
104
+  <div class="p-3 flex flex-col">
105
+    <div v-if="state.list.length > 0" class="flex flex-col">
106
+      <div v-for="(orderItem, index) in state.list" :key="index">
107
+        <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>
108
+        <OtherOrderItem :item="orderItem" v-else/>
109
+      </div>
110
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
111
+           v-if="state.list && state.list.length > 0">
112
+        <div v-if="state.status === 'loading'">
113
+          加载中...
114
+        </div>
115
+        <div v-if="state.status === 'noMore'">
116
+          没有更多了~
117
+        </div>
118
+      </div>
119
+    </div>
120
+    <div v-else class="flex flex-col  justify-center items-center w-full">
121
+      <CXBEmpty/>
122
+
123
+    </div>
124
+  </div>
125
+
126
+
127
+</template>

+ 103 - 0
src/pages/order/components/ObligationOrderList.vue

@@ -0,0 +1,103 @@
1
+<script setup lang="ts">
2
+import {getAllOrder, getGroupOrderList} from "~/apis/order.api";
3
+import OrderItem from "~/pages/order/components/OrderItem.vue";
4
+import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
5
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
+import OrderObligationItem from "~/pages/order/components/OrderObligationItem.vue";
7
+
8
+const state = reactive({
9
+  currentPage: 1,
10
+  pageSize: 10,
11
+  totalPage: 1,
12
+
13
+  list: []
14
+})
15
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
16
+  // console.log(state.keyword)
17
+  if (action === 'reload') {
18
+    state.currentPage = 1
19
+  }
20
+  const params = {
21
+    page: state.currentPage,
22
+    limit: state.pageSize
23
+  }
24
+  if (state.keyword) {
25
+    params.keyword = state.keyword
26
+  }
27
+
28
+  getGroupOrderList({
29
+    page: state.currentPage,
30
+    limit: state.pageSize
31
+  }).then(res => {
32
+    console.log(res)
33
+    if (action === 'page') {
34
+      state.list = state.list.concat(res.list)
35
+    }
36
+    if (action == 'reload') {
37
+      state.list = res.list
38
+    }
39
+    state.totalPage = Math.ceil(res.total / state.pageSize);
40
+
41
+    state.status = 'more'
42
+    if (callback) {
43
+      callback(res.list)
44
+    }
45
+  })
46
+}
47
+
48
+function handleScrollToLower() {
49
+  state.status = 'loading';
50
+  state.currentPage += 1;
51
+
52
+  if (state.currentPage > state.totalPage) {
53
+    state.status = 'noMore';
54
+  } else {
55
+    setTimeout(() => {
56
+      loadList('page')
57
+    }, 300)
58
+  }
59
+}
60
+
61
+onMounted(() => {
62
+  loadList('reload')
63
+  uni.$on('onTab1ReachBottom', handleScrollToLower)
64
+  uni.$on('onTab1PullDownRefresh', () => {
65
+    loadList('reload', items => {
66
+      setTimeout(() => {
67
+        uni.stopPullDownRefresh()
68
+      }, 300)
69
+    })
70
+  })
71
+})
72
+
73
+onUnmounted(() => {
74
+  uni.$off('onTab1ReachBottom');
75
+  uni.$off('onTab1PullDownRefresh');
76
+})
77
+</script>
78
+<template>
79
+  <div class="p-3 flex flex-col">
80
+    <div v-if="state.list.length > 0" class="flex flex-col">
81
+      <div v-for="(orderItem, index) in state.list" :key="index">
82
+<!--        <OrderItem :order-item="orderItem" />-->
83
+<!--        <OtherOrderItem :item="orderItem" v-else/>-->
84
+        <OrderObligationItem :order-item="orderItem" />
85
+      </div>
86
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
87
+           v-if="state.list && state.list.length > 0">
88
+        <div v-if="state.status === 'loading'">
89
+          加载中...
90
+        </div>
91
+        <div v-if="state.status === 'noMore'">
92
+          没有更多了~
93
+        </div>
94
+      </div>
95
+    </div>
96
+    <div v-else class="flex flex-col  justify-center items-center w-full">
97
+      <CXBEmpty />
98
+
99
+    </div>
100
+  </div>
101
+
102
+
103
+</template>

+ 111 - 0
src/pages/order/components/Order2List.vue

@@ -0,0 +1,111 @@
1
+<script setup lang="ts">
2
+import {getOrderListFromStatus} from "~/apis/order.api";
3
+import OrderItem from "~/pages/order/components/OrderItem.vue";
4
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
+
6
+const props = defineProps({
7
+  status: {
8
+    type: String,
9
+  }
10
+})
11
+const state = reactive({
12
+  currentPage: 1,
13
+  pageSize: 10,
14
+  totalPage: 1,
15
+
16
+  list: []
17
+})
18
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
19
+  // console.log(state.keyword)
20
+  if (action === 'reload') {
21
+    state.currentPage = 1
22
+  }
23
+  const params = {
24
+    page: state.currentPage,
25
+    limit: state.pageSize
26
+  }
27
+  if (state.keyword) {
28
+    params.keyword = state.keyword
29
+  }
30
+
31
+  getOrderListFromStatus({
32
+    page: state.currentPage,
33
+    limit: state.pageSize,
34
+    status: props.status,
35
+  }).then(res => {
36
+    console.log(res)
37
+    if (action === 'page') {
38
+      state.list = state.list.concat(res.list)
39
+    }
40
+    if (action == 'reload') {
41
+      state.list = res.list
42
+    }
43
+    state.totalPage = Math.ceil(res.count / state.pageSize);
44
+
45
+    state.status = 'more'
46
+    if (callback) {
47
+      callback(res.list)
48
+    }
49
+  })
50
+}
51
+
52
+function handleScrollToLower() {
53
+  state.status = 'loading';
54
+  state.currentPage += 1;
55
+
56
+  if (state.currentPage > state.totalPage) {
57
+    state.status = 'noMore';
58
+  } else {
59
+    setTimeout(() => {
60
+      loadList('page')
61
+    }, 300)
62
+  }
63
+}
64
+
65
+onMounted(() => {
66
+  loadList('reload')
67
+
68
+  uni.$on('onTab2ReachBottom', handleScrollToLower)
69
+  uni.$on('onTab2PullDownRefresh', () => {
70
+    loadList('reload', items => {
71
+      setTimeout(() => {
72
+        uni.stopPullDownRefresh()
73
+      }, 300)
74
+    })
75
+  })
76
+})
77
+
78
+onUnmounted(() => {
79
+  uni.$off('onTab2ReachBottom');
80
+  uni.$off('onTab2PullDownRefresh');
81
+})
82
+onUnload(() => {
83
+  uni.$off('onTab2ReachBottom');
84
+  uni.$off('onTab2PullDownRefresh');
85
+})
86
+</script>
87
+<template>
88
+  <div class="p-3 flex flex-col">
89
+    <div v-if="state.list.length > 0" class="flex flex-col">
90
+      <div v-for="(orderItem, index) in state.list" :key="index">
91
+        <OrderItem :order-item="orderItem" />
92
+        <!--        <OtherOrderItem :item="orderItem" v-else/>-->
93
+      </div>
94
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
95
+           v-if="state.list && state.list.length > 0">
96
+        <div v-if="state.status === 'loading'">
97
+          加载中...
98
+        </div>
99
+        <div v-if="state.status === 'noMore'">
100
+          没有更多了~
101
+        </div>
102
+      </div>
103
+    </div>
104
+    <div v-else class="flex flex-col  justify-center items-center w-full">
105
+      <CXBEmpty />
106
+
107
+    </div>
108
+  </div>
109
+
110
+
111
+</template>

+ 128 - 0
src/pages/order/components/Order3List.vue

@@ -0,0 +1,128 @@
1
+<script setup lang="ts">
2
+import {getOrderListFromStatus} from "~/apis/order.api";
3
+import OrderItem from "~/pages/order/components/OrderItem.vue";
4
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
+
6
+const props = defineProps({
7
+  status: {
8
+    type: String,
9
+  }
10
+})
11
+const state = reactive({
12
+  currentPage: 1,
13
+  pageSize: 10,
14
+  totalPage: 1,
15
+
16
+  list: []
17
+})
18
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
19
+  // console.log(state.keyword)
20
+  if (action === 'reload') {
21
+    state.currentPage = 1
22
+  }
23
+  const params = {
24
+    page: state.currentPage,
25
+    limit: state.pageSize
26
+  }
27
+  if (state.keyword) {
28
+    params.keyword = state.keyword
29
+  }
30
+
31
+  getOrderListFromStatus({
32
+    page: state.currentPage,
33
+    limit: state.pageSize,
34
+    status: props.status,
35
+  }).then(res => {
36
+    console.log(res)
37
+    if (action === 'page') {
38
+      state.list = state.list.concat(res.list)
39
+    }
40
+    if (action == 'reload') {
41
+      state.list = res.list
42
+    }
43
+    state.totalPage = Math.ceil(res.count / state.pageSize);
44
+
45
+    state.status = 'more'
46
+    if (callback) {
47
+      callback(res.list)
48
+    }
49
+  })
50
+}
51
+
52
+function handleScrollToLower() {
53
+  state.status = 'loading';
54
+  state.currentPage += 1;
55
+
56
+  if (state.currentPage > state.totalPage) {
57
+    state.status = 'noMore';
58
+  } else {
59
+    setTimeout(() => {
60
+      loadList('page')
61
+    }, 300)
62
+  }
63
+  // setTimeout(() => {
64
+  //   loadList('page', (items) => {
65
+  //     if (items.length === 0) {
66
+  //       state.status = 'noMore'
67
+  //     }
68
+  //   })
69
+  // }, 300)
70
+}
71
+
72
+// onReachBottom(() => {
73
+//   handleScrollToLower()
74
+//
75
+// })
76
+// onPullDownRefresh(() => {
77
+//   loadList('reload', items => {
78
+//     setTimeout(() => {
79
+//       uni.stopPullDownRefresh()
80
+//     }, 300)
81
+//   })
82
+// })
83
+onMounted(() => {
84
+  loadList('reload')
85
+
86
+  uni.$on('onTab3ReachBottom', handleScrollToLower)
87
+  uni.$on('onTab3PullDownRefresh', () => {
88
+    loadList('reload', items => {
89
+      setTimeout(() => {
90
+        uni.stopPullDownRefresh()
91
+      }, 300)
92
+    })
93
+  })
94
+})
95
+onUnmounted(() => {
96
+  uni.$off('onTab3ReachBottom');
97
+  uni.$off('onTab3PullDownRefresh');
98
+})
99
+onUnload(() => {
100
+  uni.$off('onTab3ReachBottom');
101
+  uni.$off('onTab3PullDownRefresh');
102
+})
103
+</script>
104
+<template>
105
+  <div class="p-3 flex flex-col">
106
+    <div v-if="state.list.length > 0" class="flex flex-col">
107
+      <div v-for="(orderItem, index) in state.list" :key="index">
108
+        <OrderItem :order-item="orderItem" />
109
+        <!--        <OtherOrderItem :item="orderItem" v-else/>-->
110
+      </div>
111
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
112
+           v-if="state.list && state.list.length > 0">
113
+        <div v-if="state.status === 'loading'">
114
+          加载中...
115
+        </div>
116
+        <div v-if="state.status === 'noMore'">
117
+          没有更多了~
118
+        </div>
119
+      </div>
120
+    </div>
121
+    <div v-else class="flex flex-col  justify-center items-center w-full">
122
+      <CXBEmpty />
123
+
124
+    </div>
125
+  </div>
126
+
127
+
128
+</template>

+ 128 - 0
src/pages/order/components/Order4List.vue

@@ -0,0 +1,128 @@
1
+<script setup lang="ts">
2
+import {getOrderListFromStatus} from "~/apis/order.api";
3
+import OrderItem from "~/pages/order/components/OrderItem.vue";
4
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
+
6
+const props = defineProps({
7
+  status: {
8
+    type: String,
9
+  }
10
+})
11
+const state = reactive({
12
+  currentPage: 1,
13
+  pageSize: 10,
14
+  totalPage: 1,
15
+
16
+  list: []
17
+})
18
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
19
+  // console.log(state.keyword)
20
+  if (action === 'reload') {
21
+    state.currentPage = 1
22
+  }
23
+  const params = {
24
+    page: state.currentPage,
25
+    limit: state.pageSize
26
+  }
27
+  if (state.keyword) {
28
+    params.keyword = state.keyword
29
+  }
30
+
31
+  getOrderListFromStatus({
32
+    page: state.currentPage,
33
+    limit: state.pageSize,
34
+    status: props.status,
35
+  }).then(res => {
36
+    console.log(res)
37
+    if (action === 'page') {
38
+      state.list = state.list.concat(res.list)
39
+    }
40
+    if (action == 'reload') {
41
+      state.list = res.list
42
+    }
43
+    state.totalPage = Math.ceil(res.count / state.pageSize);
44
+
45
+    state.status = 'more'
46
+    if (callback) {
47
+      callback(res.list)
48
+    }
49
+  })
50
+}
51
+
52
+function handleScrollToLower() {
53
+  state.status = 'loading';
54
+  state.currentPage += 1;
55
+
56
+  if (state.currentPage > state.totalPage) {
57
+    state.status = 'noMore';
58
+  } else {
59
+    setTimeout(() => {
60
+      loadList('page')
61
+    }, 300)
62
+  }
63
+  // setTimeout(() => {
64
+  //   loadList('page', (items) => {
65
+  //     if (items.length === 0) {
66
+  //       state.status = 'noMore'
67
+  //     }
68
+  //   })
69
+  // }, 300)
70
+}
71
+
72
+// onReachBottom(() => {
73
+//   handleScrollToLower()
74
+//
75
+// })
76
+// onPullDownRefresh(() => {
77
+//   loadList('reload', items => {
78
+//     setTimeout(() => {
79
+//       uni.stopPullDownRefresh()
80
+//     }, 300)
81
+//   })
82
+// })
83
+onMounted(() => {
84
+  loadList('reload')
85
+
86
+  uni.$on('onTab4ReachBottom', handleScrollToLower)
87
+  uni.$on('onTab4PullDownRefresh', () => {
88
+    loadList('reload', items => {
89
+      setTimeout(() => {
90
+        uni.stopPullDownRefresh()
91
+      }, 300)
92
+    })
93
+  })
94
+})
95
+onUnmounted(() => {
96
+  uni.$off('onTab4ReachBottom');
97
+  uni.$off('onTab4PullDownRefresh');
98
+})
99
+onUnload(() => {
100
+  uni.$off('onTab4ReachBottom');
101
+  uni.$off('onTab4PullDownRefresh');
102
+})
103
+</script>
104
+<template>
105
+  <div class="p-3 flex flex-col">
106
+    <div v-if="state.list.length > 0" class="flex flex-col">
107
+      <div v-for="(orderItem, index) in state.list" :key="index">
108
+        <OrderItem :order-item="orderItem" />
109
+        <!--        <OtherOrderItem :item="orderItem" v-else/>-->
110
+      </div>
111
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
112
+           v-if="state.list && state.list.length > 0">
113
+        <div v-if="state.status === 'loading'">
114
+          加载中...
115
+        </div>
116
+        <div v-if="state.status === 'noMore'">
117
+          没有更多了~
118
+        </div>
119
+      </div>
120
+    </div>
121
+    <div v-else class="flex flex-col  justify-center items-center w-full">
122
+      <CXBEmpty />
123
+
124
+    </div>
125
+  </div>
126
+
127
+
128
+</template>

+ 51 - 23
src/pages/order/components/OrderItem.vue

@@ -34,12 +34,12 @@ const props = defineProps({
34 34
 //   }
35 35
 // })
36 36
 function getStatusText(orderItem: OrderListModel) {
37
-  if (props.status === 5) {
38
-    return '未支付'
39
-  }
40
-  if (props.status === 0) {
41
-    return '待发货'
42
-  }
37
+  // if (props.status === 5) {
38
+  //   return '未支付'
39
+  // }
40
+  // if (props.status === 0) {
41
+  //   return '待发货'
42
+  // }
43 43
   // switch (orderItem.status) {
44 44
   // }
45 45
   if (orderItem.status == 0) {
@@ -169,6 +169,18 @@ function handleProductItemClick(
169 169
 }
170 170
 
171 171
 
172
+function handeRefund(orderItem) {
173
+  uni.navigateTo({
174
+    // url: `/pages/refund/drawback?detail=${encodeBase64(orderItem)}`
175
+    url: `/pages/refund/option?detail=${encodeBase64(orderItem)}`
176
+  })
177
+}
178
+
179
+function handleShowObligationOrderDetail(orderItem) {
180
+  uni.navigateTo({
181
+    url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}`
182
+  })
183
+}
172 184
 </script>
173 185
 
174 186
 <template>
@@ -191,9 +203,8 @@ function handleProductItemClick(
191 203
     </div>
192 204
 
193 205
 
194
-
195
-    <div @tap.stop="handleShowOrderDetail(orderItem)">
196
-      <div v-if="orderItem.orderList">
206
+    <div>
207
+      <div v-if="orderItem.orderList" @tap.stop="handleShowObligationOrderDetail(orderItem)">
197 208
         <div v-for="(order, index) in orderItem.orderList" :key="index">
198 209
           <div v-for="(orderProduct, orderProductIndex) in order.orderProduct" :key="orderProductIndex">
199 210
             <div class="flex py-2 gap-3">
@@ -211,26 +222,41 @@ function handleProductItemClick(
211 222
               </div>
212 223
 
213 224
               <div class="flex flex-col justify-center items-center">
214
-                <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
225
+                <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
215 226
                 <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
216 227
               </div>
217 228
 
218 229
             </div>
219
-            <div class="flex justify-end gap-2" v-if="props.status === 5">
220
-              <nut-button size="small" type="default" @click="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
221
-              <nut-button size="small" plain type="primary" @click="handlePayment">立即支付</nut-button>
230
+            <div class="flex justify-end gap-2" v-if="orderProduct.type == 5">
231
+              <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
232
+              <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
222 233
 
223 234
             </div>
224
-            <div class="flex justify-end gap-2" v-if="props.status === 0">
235
+            <div class="flex justify-end gap-2" v-if="orderProduct.type == 0">
225 236
               <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery"><div class="text-black">提醒发货</div></nut-button>
226
-              <nut-button size="small" plain type="default" @click="handlePayment">申请售后</nut-button>
237
+              <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderProduct)">申请售后</nut-button>
238
+            </div>
239
+
240
+
241
+            <div class="flex justify-end gap-2" v-if="orderProduct.type == 1">
242
+              <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderProduct)">查看物流</nut-button>
243
+              <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderProduct)">申请售后</nut-button>
244
+
245
+              <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder(orderProduct)">确认收货</nut-button>
246
+
247
+            </div>
248
+
249
+            <div class="flex justify-end gap-2" v-if="orderProduct.status == 2">
250
+              <nut-button size="small" plain type="default" @tap.stop="handleProductItemClick(orderProduct)">再次购买</nut-button>
251
+              <nut-button size="small" plain type="primary" @tap.stop="handleComment(orderProduct)">去评价</nut-button>
252
+
227 253
             </div>
228 254
           </div>
229 255
         </div>
230 256
 
231 257
       </div>
232 258
 
233
-      <div v-else>
259
+      <div v-else  @tap.stop="handleShowOrderDetail(orderItem)">
234 260
         <div v-for="(orderProduct, orderProductIndex) in orderItem.orderProduct" :key="orderProductIndex">
235 261
           <div class="flex py-2 gap-3">
236 262
             <div class="flex-1 flex gap-2">
@@ -247,29 +273,31 @@ function handleProductItemClick(
247 273
             </div>
248 274
 
249 275
             <div class="flex flex-col justify-center items-center">
250
-              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
276
+<!--              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
277
+              <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
251 278
               <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
252 279
             </div>
253 280
 
254 281
           </div>
255
-          <div class="flex justify-end gap-2" v-if="props.status === 5">
282
+          <div class="flex justify-end gap-2" v-if="orderItem.status == 5">
256 283
             <nut-button size="small" type="default" @click="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
257 284
             <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
258 285
 
259 286
           </div>
260
-          <div class="flex justify-end gap-2" v-if="props.status === 0">
287
+          <div class="flex justify-end gap-2" v-if="orderItem.status == 0">
261 288
             <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery"><div class="text-black">提醒发货</div></nut-button>
262
-            <nut-button size="small" plain type="default" @tap.stop="handlePayment">申请售后</nut-button>
289
+            <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
263 290
           </div>
264 291
 
265
-          <div class="flex justify-end gap-2" v-if="props.status === 1">
292
+          <div class="flex justify-end gap-2" v-if="orderItem.status == 1">
266 293
             <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderItem)">查看物流</nut-button>
267
-            <nut-button size="small" plain type="default" @tap.stop="handlePayment">申请售后</nut-button>
294
+            <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
295
+
268 296
             <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder(orderItem)">确认收货</nut-button>
269 297
 
270 298
           </div>
271 299
 
272
-          <div class="flex justify-end gap-2" v-if="props.status === 2">
300
+          <div class="flex justify-end gap-2" v-if="orderItem.status == 2">
273 301
             <nut-button size="small" plain type="default" @tap.stop="handleProductItemClick(orderItem)">再次购买</nut-button>
274 302
             <nut-button size="small" plain type="primary" @tap.stop="handleComment(orderItem)">去评价</nut-button>
275 303
 

+ 208 - 40
src/pages/order/components/OrderObligationItem.vue

@@ -1,53 +1,45 @@
1
-<template>
2
-  <div class="flex items-center justify-between f-hairline-bottom pb-3">
3
-    <div class="flex items-center font-bold gap-2 text-sm">
4
-      <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
5
-      {{ orderItem.merchant.mer_name }}
6
-    </div>
7
-    <div class="text-primary text-sm">
8
-      {{ getStatusText(orderItem) }}
9
-    </div>
10
-  </div>
11
-
12
-  <div v-for="(orderProduct, orderProductIndex) in orderItem.orderProduct" :key="orderProductIndex">
13
-    <div class="flex p-2 gap-3">
14
-      <div class="flex-1 flex">
15
-        <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
16
-
17
-        <div class="flex flex-col">
18
-          <div class="line-clamp-2 text-[12px]">
19
-            {{ orderProduct.cart_info.product.store_name }}
20
-          </div>
21
-          <div class="text-gray-500 text-[10px]">
22
-            {{ orderProduct.cart_info.productAttr.sku }}
23
-          </div>
24
-        </div>
25
-      </div>
26
-
27
-      <div class="flex flex-col justify-center items-center">
28
-        <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
29
-        <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
30
-      </div>
31
-
32
-    </div>
33
-    <div class="flex justify-end gap-2">
34
-      <nut-button size="small" type="default">取消订单</nut-button>
35
-      <nut-button size="small" plain type="primary">立即支付</nut-button>
36
-    </div>
37
-  </div>
38
-
39
-</template>
40 1
 <script setup lang="ts">
41 2
 import FPrice from "~/components/FPrice/FPrice.vue";
42 3
 import {OrderListModel} from "~/apis/model/order.model";
4
+import {cancelOrder, takeOrder} from "~/apis/order.api";
5
+import {encodeBase64} from "~/utils/http/helper";
6
+import {deleteAddress} from "~/apis/user";
7
+import {
8
+  DyProductModel,
9
+  JdProductModel,
10
+  SuNingProductModel,
11
+  TaobaoProductThirdPartyWaresModel, VipProductModel
12
+} from "~/apis/model/product.model";
13
+import {DcProductModel} from "~/apis/model/dacang.model";
43 14
 const props = defineProps({
44 15
   orderItem: {
45 16
     type: Object,
46 17
     required: true
18
+  },
19
+  status: {
20
+    type: Number,
47 21
   }
48 22
 })
49 23
 
24
+// function detailOrderList(p) {}
25
+// const dealOrderList =computed(() => {
26
+//   if (props.orderItem) {
27
+//     const orderItem = props.orderItem
28
+//     if (orderItem?.orderList) {
29
+//       return orderItem.orderList
30
+//     }
31
+//     if (orderItem?.orderProduct) {
32
+//       return orderItem.orderProduct
33
+//     }
34
+//   }
35
+// })
50 36
 function getStatusText(orderItem: OrderListModel) {
37
+  // if (props.status === 5) {
38
+  //   return '未支付'
39
+  // }
40
+  // if (props.status === 0) {
41
+  //   return '待发货'
42
+  // }
51 43
   // switch (orderItem.status) {
52 44
   // }
53 45
   if (orderItem.status == 0) {
@@ -73,4 +65,180 @@ function getStatusText(orderItem: OrderListModel) {
73 65
   }
74 66
 }
75 67
 
76
-</script>
68
+function handleHeaderClick() {
69
+  uni.navigateTo({
70
+    url: `/pages/store/home/index?id=${props.orderItem.merchant.mer_id}`
71
+  })
72
+}
73
+
74
+/**
75
+ * 取消订单
76
+ */
77
+function handleCancelOrder() {
78
+  console.log('取消订单操作')
79
+  cancelOrder(props.orderItem.group_order_id).then(res => {
80
+    setTimeout(() => {
81
+      uni.showToast({
82
+        title: '取消成功',
83
+        icon: 'none'
84
+      })
85
+
86
+      uni.$emit('orderCancelFromList')
87
+
88
+    }, 300)
89
+
90
+  })
91
+}
92
+
93
+function handlePayment() {
94
+  const { orderItem } = props
95
+  uni.navigateTo({
96
+    url: '/pages/payment/index?' + `pay_price=${orderItem.pay_price}&order_id=${orderItem.order_id}&OrderList=${JSON.stringify(orderItem)}`
97
+    // url: `/pages/payment/index`
98
+  })
99
+}
100
+
101
+function handleShowOrderDetail(order) {
102
+  console.log(order)
103
+  uni.navigateTo({
104
+    url: '/pages/order/detail?detail=' + `${encodeBase64(order)}`
105
+  })
106
+}
107
+
108
+function handleRemindTheDelivery() {
109
+  uni.showToast({
110
+    title: '已告知商家尽快发货',
111
+    icon: 'none'
112
+  })
113
+}
114
+
115
+// 查看物流信息页
116
+function handleShowLogistics(orderItem) {
117
+  // console.log(orderItem)
118
+  // console.log('查看物流信息')
119
+  uni.navigateTo({
120
+    url: `/pages/order/logistics?id=${orderItem.order_id}`
121
+  })
122
+}
123
+
124
+// 确认收货
125
+function handleTakeOrder(orderItem) {
126
+  uni.showModal({
127
+    title: '确认收货',
128
+    content: '请确认你已收到货',
129
+    success: function (res) {
130
+      if (res.confirm) {
131
+        takeOrder(orderItem.order_id).then(res => {
132
+          // console.log(res)
133
+          uni.showToast({
134
+            title: '确认收货成功'
135
+          })
136
+          uni.$emit('orderTakeFromList')
137
+
138
+        }).catch(error => {
139
+          uni.showToast({
140
+            title: error,
141
+            icon: "none"
142
+          })
143
+        })
144
+      }
145
+    }
146
+  })
147
+}
148
+
149
+function handleComment(orderItem) {
150
+  uni.navigateTo({
151
+    url: '/pages/order/comment?detail=' + encodeBase64(orderItem)
152
+  })
153
+}
154
+
155
+function handleProductItemClick(
156
+    item
157
+) {
158
+  // function navigateToDetail(params) {
159
+  //   let otherDetailUrl = `/pages/store/product/other`
160
+  //   return uni.navigateTo({
161
+  //     url: `${otherDetailUrl}?params=${params}`
162
+  //   })
163
+  // }
164
+  console.log(item)
165
+  // 大仓
166
+  uni.navigateTo({
167
+    url: `/pages/store/product/detail?id=${item.orderProduct[0].product_id}`
168
+  })
169
+}
170
+
171
+
172
+function handeRefund(orderItem) {
173
+  uni.navigateTo({
174
+    // url: `/pages/refund/drawback?detail=${encodeBase64(orderItem)}`
175
+    url: `/pages/refund/option?detail=${encodeBase64(orderItem)}`
176
+  })
177
+}
178
+
179
+function handleShowObligationOrderDetail(orderItem) {
180
+  uni.navigateTo({
181
+    url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}`
182
+  })
183
+}
184
+</script>
185
+
186
+<template>
187
+  <div class="mb-3 bg-white rounded p-3">
188
+    <div
189
+        @click.stop="handleHeaderClick"
190
+        class="flex items-center justify-between f-hairline-bottom pb-3">
191
+      <div class="flex items-center font-bold gap-2 text-sm justify-between">
192
+        <div class="flex-1 flex items-center gap-2">
193
+          <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
194
+          {{ orderItem.merchant.mer_name }}
195
+        </div>
196
+
197
+        <div class="f-text-color-2 i-tabler-chevron-right"></div>
198
+
199
+      </div>
200
+      <div class="text-primary text-xs">
201
+        {{ getStatusText(orderItem) }}
202
+      </div>
203
+    </div>
204
+
205
+
206
+    <div>
207
+      <div v-if="orderItem.orderList" @tap.stop="handleShowObligationOrderDetail(orderItem)">
208
+        <div v-for="(order, index) in orderItem.orderList" :key="index">
209
+          <div v-for="(orderProduct, orderProductIndex) in order.orderProduct" :key="orderProductIndex">
210
+            <div class="flex py-2 gap-3">
211
+              <div class="flex-1 flex gap-2">
212
+                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
213
+
214
+                <div class="flex flex-col">
215
+                  <div class="line-clamp-2 text-[12px]">
216
+                    {{ orderProduct.cart_info.product.store_name }}
217
+                  </div>
218
+                  <div class="text-gray-500 text-[10px]">
219
+                    {{ orderProduct.cart_info.productAttr.sku }}
220
+                  </div>
221
+                </div>
222
+              </div>
223
+
224
+              <div class="flex flex-col justify-center items-center">
225
+                <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
226
+                <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
227
+              </div>
228
+
229
+            </div>
230
+            <div class="flex justify-end gap-2">
231
+              <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
232
+              <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
233
+
234
+            </div>
235
+          </div>
236
+        </div>
237
+
238
+      </div>
239
+    </div>
240
+
241
+  </div>
242
+
243
+
244
+</template>

+ 4 - 4
src/pages/order/components/OtherOrderItem.vue

@@ -49,7 +49,7 @@ function handleClick() {
49 49
   //   featured: [product.goods_img]
50 50
   // })
51 51
   console.log(product)
52
-  if (product.source === '6') {
52
+  // if (product.source == '6') {
53 53
     navigateToDetail(encodeBase64({
54 54
       platform: product.source,
55 55
       id: product.goods_id,
@@ -59,7 +59,7 @@ function handleClick() {
59 59
       price: product.goods_price,
60 60
       salePrice: product.pay_money,
61 61
     }))
62
-  }
62
+  // }
63 63
 }
64 64
 
65 65
 
@@ -71,7 +71,7 @@ function handleClick() {
71 71
       <div class="text-primary">{{ item.other_status_desc }}</div>
72 72
     </div>
73 73
 
74
-    <div class="flex  gap-2">
74
+    <div class="flex  gap-2"  @tap.stop="handleClick">
75 75
       <div class="flex">
76 76
         <image :src="item.goods_img" mode="widthFix" class="w-16 h-16 rounded"></image>
77 77
 
@@ -100,7 +100,7 @@ function handleClick() {
100 100
       </div>
101 101
     </div>
102 102
     <div class="flex justify-end items-center">
103
-      <nut-button plain type="primary" size="small" @click="handleClick">再次购买</nut-button>
103
+      <nut-button plain type="primary" size="small" @tap.stop="handleClick">再次购买</nut-button>
104 104
     </div>
105 105
   </div>
106 106
 </template>

+ 13 - 13
src/pages/order/components/RefundOrderItem.vue

@@ -181,16 +181,20 @@ function handleShowDetail(orderItem) {
181 181
     <div
182 182
         @click.stop="handleHeaderClick"
183 183
         class="flex items-center justify-between f-hairline-bottom pb-3">
184
-      <div class="flex items-center font-bold gap-2 text-sm justify-between">
185
-        <div class="flex-1 flex items-center gap-2">
184
+      <div class="flex-1 flex items-center font-bold gap-2 text-sm justify-between ">
185
+        <div class="flex-1 flex items-center gap-2 w-full">
186 186
           <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
187
-          {{ orderItem.merchant.mer_name }}
187
+          <div class="line-clamp-1 flex ">
188
+            {{ orderItem.merchant.mer_name }}
189
+          </div>
188 190
         </div>
189 191
 
190
-        <div class="f-text-color-2 i-tabler-chevron-right"></div>
192
+          <div class="f-text-color-2 i-tabler-chevron-right"></div>
191 193
 
192 194
       </div>
193
-      <div class="text-primary text-xs">
195
+      <div class=" text-xs flex w-15 justify-end"
196
+           :class="(orderItem.status == 3 || orderItem.status == -1) ? 'text-gray' : 'text-primary'"
197
+      >
194 198
         {{ getStatusText(orderItem) }}
195 199
       </div>
196 200
     </div>
@@ -220,16 +224,12 @@ function handleShowDetail(orderItem) {
220 224
                 </div>
221 225
             </div>
222 226
           </div>
223
-          <div class="flex justify-end gap-2" v-if="orderItem.status == 0 || orderItem.status == 1 || orderItem.status == 2">
227
+        </div>
228
+      <div class="flex justify-end">
229
+        <nut-button size="small" plain type="primary" @tap.stop="handleShowDetail(orderItem)">查看详情</nut-button>
224 230
 
225
-<!--            <nut-button size="small" type="default" @click="handleCancelOrder">撤销售后</nut-button>-->
226
-            <nut-button size="small" plain type="primary" @tap.stop="handleShowDetail(orderItem)">查看详情</nut-button>
227
-          </div>
231
+      </div>
228 232
 
229
-          <div class="flex justify-end gap-2" v-else>
230
-            <nut-button size="small" plain type="primary" @tap.stop="handleShowDetail(orderItem)">查看详情</nut-button>
231
-          </div>
232
-        </div>
233 233
     </div>
234 234
 
235 235
   </div>

+ 132 - 10
src/pages/order/detail.vue

@@ -4,8 +4,8 @@ import {encodePhone} from "~/utils";
4 4
 import {CDN_URL} from "~/config/app";
5 5
 import {useAddressStore} from "~/stores/addressStore";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7
-import {cancelOrder} from "~/apis/order.api";
8
-import {decodeBase64} from "~/utils/http/helper";
7
+import {cancelOrder, takeOrder} from "~/apis/order.api";
8
+import {decodeBase64, encodeBase64} from "~/utils/http/helper";
9 9
 
10 10
 const addressIcon = CDN_URL + '/static/assets/dingwi_220624.png'
11 11
 const addressStore = useAddressStore()
@@ -51,11 +51,97 @@ function handlePayment() {
51 51
   // const { orderItem } = detail.value
52 52
   // console.log(orderItem)
53 53
   uni.navigateTo({
54
-    url: '/pages/payment/index?' + `pay_price=${ detail.value.pay_price}&order_id=${ detail.value.order_id}&OrderList=${JSON.stringify( detail.value)}`
54
+    url: '/pages/payment/index?' + `pay_price=${ detail.value.pay_price}&order_id=${ detail.value.group_order_id}&OrderList=${JSON.stringify( detail.value)}`
55 55
     // url: `/pages/payment/index`
56 56
   })
57 57
 }
58 58
 
59
+function handleRemindTheDelivery() {
60
+  uni.showToast({
61
+    title: '已告知商家尽快发货',
62
+    icon: 'none'
63
+  })
64
+}
65
+
66
+function handeRefund() {
67
+  uni.navigateTo({
68
+    // url: `/pages/refund/drawback?detail=${encodeBase64(orderItem)}`
69
+    url: `/pages/refund/option?detail=${encodeBase64(detail.value)}`
70
+  })
71
+}
72
+
73
+function handleClipboard() {
74
+  uni.setClipboardData({
75
+    data: detail.value.order_sn,
76
+    success(res) {
77
+      // wx.getClipboardData({
78
+      //   success (res) {
79
+      //     console.log(res.data) // data
80
+      //   }
81
+      // })
82
+    }
83
+  })
84
+}
85
+
86
+function handleShowLogistics() {
87
+  // console.log(orderItem)
88
+  // console.log('查看物流信息')
89
+  uni.navigateTo({
90
+    url: `/pages/order/logistics?id=${detail.value.order_id}`
91
+  })
92
+}
93
+
94
+function handleTakeOrder() {
95
+  uni.showModal({
96
+    title: '确认收货',
97
+    content: '请确认你已收到货',
98
+    success: function (res) {
99
+      if (res.confirm) {
100
+        takeOrder(detail.value.order_id).then(res => {
101
+          // console.log(res)
102
+          uni.showToast({
103
+            title: '确认收货成功'
104
+          })
105
+          uni.$emit('orderTakeFromList')
106
+
107
+        }).catch(error => {
108
+          uni.showToast({
109
+            title: error,
110
+            icon: "none"
111
+          })
112
+        })
113
+      }
114
+    }
115
+  })
116
+}
117
+
118
+function handleComment() {
119
+  uni.navigateTo({
120
+    url: '/pages/order/comment?detail=' + encodeBase64(detail.value)
121
+  })
122
+}
123
+
124
+const payType = computed(() => {
125
+  // detail.pay_type
126
+  if ('0' == detail.value.pay_type) {
127
+    return '余额'
128
+  }
129
+  if ('1' == detail.value.pay_type) {
130
+    return '微信'
131
+  }
132
+  if ('2' == detail.value.pay_type) {
133
+    return '小程序'
134
+  }
135
+  if ('3' == detail.value.pay_type) {
136
+    return 'h5'
137
+  }
138
+  if ('4' == detail.value.pay_type) {
139
+    return '支付宝'
140
+  }
141
+  if ('5' == detail.value.pay_type) {
142
+    return '积分兑换'
143
+  }
144
+})
59 145
 </script>
60 146
 <template>
61 147
   <CXBBasePage>
@@ -122,7 +208,11 @@ function handlePayment() {
122 208
           </div>
123 209
         </div>
124 210
 
211
+
125 212
         <div class=" flex flex-col gap-3 p-3">
213
+          <div class="flex justify-end" v-if="detail.status == 1 || detail.status == 2 || detail.status == 3">
214
+            <nut-button size="small" plain type="default" @tap.stop="handeRefund">申请售后</nut-button>
215
+          </div>
126 216
           <div class="flex justify-between">
127 217
             <div>商品总额</div>
128 218
             <div class="text-gray">¥{{ detail.total_price }}</div>
@@ -139,18 +229,29 @@ function handlePayment() {
139 229
 
140 230
             <div>实付款</div>
141 231
             <div class="text-gray">
142
-              <FPrice :price="detail.total_price" ex-class="font-bold"></FPrice>
232
+              <FPrice :price="detail.pay_price" ex-class="font-bold text-xl"></FPrice>
143 233
             </div>
144 234
           </div>
145
-          <div class="flex justify-between">
146 235
 
236
+          <div class="h-0.2 bg-gray-100 my-2"></div>
237
+
238
+<!--          <div class="flex justify-between">-->
239
+
240
+<!--            <div>订单编号</div>-->
241
+<!--            <div class="text-gray">{{ detail.order_sn }}</div>-->
242
+<!--          </div>-->
243
+          <div class="flex justify-between">
147 244
             <div>订单编号</div>
148
-            <div class="text-gray">{{ detail.order_sn }}</div>
245
+            <div class="flex gap-2">
246
+              <div class="text-gray-400">{{ detail.order_sn }}</div>
247
+              <div @click="handleClipboard">复制</div>
248
+            </div>
149 249
           </div>
150 250
           <div class="flex justify-between">
151 251
 
152 252
             <div>支付方式</div>
153
-            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>
253
+            <div class="text-gray">{{ payType }}</div>
254
+<!--            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>-->
154 255
           </div>
155 256
           <div class="flex justify-between">
156 257
 
@@ -163,9 +264,29 @@ function handlePayment() {
163 264
     </div>
164 265
 
165 266
     <div class="fixed bottom-0 bg-white p-safe items-center  w-full">
166
-      <div class="flex justify-end gap-2 p-3">
167
-        <nut-button size="small" type="default" @click="handleCancelOrder" class="text-black"><div class="text-black">取消订单</div></nut-button>
168
-        <nut-button size="small" plain type="primary" @click="handlePayment">立即支付</nut-button>
267
+      <div class="flex justify-end gap-2 p-3"
268
+           v-if="detail.status == 5 || detail.type == 5"
269
+      >
270
+        <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
271
+        <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
272
+
273
+      </div>
274
+      <div class="flex justify-end gap-2 p-3"
275
+           v-if="detail.status == 0 || detail.type == 0"
276
+      >
277
+        <nut-button size="small" type="default"
278
+                    @tap.stop="handleRemindTheDelivery"><div class="text-black">提醒发货</div></nut-button>
279
+
280
+      </div>
281
+      <div class="flex justify-end gap-2 p-3" v-if="detail.status == 1 || detail.type == 1">
282
+        <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics">查看物流</nut-button>
283
+
284
+        <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder">确认收货</nut-button>
285
+
286
+      </div>
287
+
288
+      <div class="flex justify-end gap-2 p-3" v-if="detail.status == 2 || detail.type == 2">
289
+        <nut-button size="small" plain type="primary" @tap.stop="handleComment">去评价</nut-button>
169 290
 
170 291
       </div>
171 292
     </div>
@@ -176,3 +297,4 @@ function handlePayment() {
176 297
 style:
177 298
   navigationBarTitleText: 订单详情
178 299
 </route>
300
+

+ 192 - 142
src/pages/order/index.vue

@@ -1,59 +1,25 @@
1 1
 <template>
2 2
   <CXBBasePage>
3
-    <nut-tabs v-model="state.tabvalue">
4
-      <nut-tab-pane title="全部">
5
-
6
-        <div v-if="state.allOrderList.length > 0" class="flex flex-col gap-3">
7
-          <div v-for="(orderItem, index) in state.allOrderList" :key="index">
8
-            <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>
9
-            <OtherOrderItem :item="orderItem" v-else/>
10
-          </div>
11
-        </div>
12
-        <CXBEmpty v-else/>
13
-
14
-      </nut-tab-pane>
15
-      <nut-tab-pane title="待付款">
16
-        <div v-if="state.obligationOrderList.length > 0">
17
-          <div v-for="(orderItem, index) in state.obligationOrderList" :key="index">
18
-            <OrderItem :order-item="orderItem" :status="5"/>
19
-<!--            <OtherOrderItem :item="orderItem" v-else/>-->
20
-          </div>
21
-        </div>
22
-        <CXBEmpty v-else/>
23
-      </nut-tab-pane>
24
-      <nut-tab-pane title="待发货">
25
-        <div v-if="state.orderList.length > 0">
26
-          <div v-for="(orderItem, index) in state.orderList" :key="index">
27
-            <OrderItem :order-item="orderItem" :status="0"/>
28
-<!--            <OtherOrderItem :item="orderItem" v-else/>-->
29
-<!--            <OtherOrderItem :item="orderItem"/>-->
30
-          </div>
31
-        </div>
32
-        <CXBEmpty v-else/>
33
-
34
-      </nut-tab-pane>
35
-      <nut-tab-pane title="待收货">
36
-        <div v-if="state.orderList.length > 0">
37
-          <div v-for="(orderItem, index) in state.orderList" :key="index">
38
-            <OrderItem :order-item="orderItem" :status="1"/>
39
-<!--            <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>-->
40
-<!--            <OtherOrderItem :item="orderItem" v-else/>-->
41
-          </div>
42
-        </div>
43
-        <CXBEmpty v-else/>
44
-
45
-      </nut-tab-pane>
46
-      <nut-tab-pane title="待评价">
47
-        <div v-if="state.orderList.length > 0">
48
-          <div v-for="(orderItem, index) in state.orderList" :key="index">
49
-            <OrderItem :order-item="orderItem" :status="2"/>
50
-<!--            <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>-->
51
-<!--            <OtherOrderItem :item="orderItem" v-else/>-->
52
-          </div>
53
-        </div>
54
-        <CXBEmpty v-else/>
55
-      </nut-tab-pane>
56
-    </nut-tabs>
3
+
4
+    <!--    <nut-navbar>-->
5
+    <!--      <template #content>-->
6
+    <div class="fixed top-0 bg-white w-full z-2">
7
+      <nut-tabs v-model="state.tabvalue" class="bg-white">
8
+        <nut-tab-pane title="全部"></nut-tab-pane>
9
+        <nut-tab-pane title="待付款"></nut-tab-pane>
10
+        <nut-tab-pane title="待发货"></nut-tab-pane>
11
+        <nut-tab-pane title="待收货"></nut-tab-pane>
12
+        <nut-tab-pane title="待评价"></nut-tab-pane>
13
+      </nut-tabs>
14
+    </div>
15
+
16
+    <div class="mt-12">
17
+      <AllItemList v-if="state.tabvalue == 0"/>
18
+      <ObligationOrderList v-if="state.tabvalue == 1"/>
19
+      <Order2List v-if="state.tabvalue == 2" :status="'0'"/>
20
+      <Order3List v-if="state.tabvalue == 3" :status="'1'"/>
21
+      <Order4List v-if="state.tabvalue == 4" :status="'2'"/>
22
+    </div>
57 23
 
58 24
   </CXBBasePage>
59 25
 </template>
@@ -70,6 +36,11 @@ import amapWx from "~/libs/amap-wx";
70 36
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
71 37
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
72 38
 import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
39
+import AllItemList from "~/pages/order/components/AllItemList.vue";
40
+import ObligationOrderList from "~/pages/order/components/ObligationOrderList.vue";
41
+import Order2List from "~/pages/order/components/Order2List.vue";
42
+import Order3List from "~/pages/order/components/Order3List.vue";
43
+import Order4List from "~/pages/order/components/Order4List.vue";
73 44
 
74 45
 const state = reactive({
75 46
   tabvalue: 0,
@@ -83,102 +54,167 @@ const state = reactive({
83 54
   orderList: [],
84 55
 });
85 56
 
57
+const getStatusVal = () => {
58
+  // state.tabvalue == 2 ? '0' : state.tabvalue == 3 ? '1' : state.tabvalue == 4 ? '2' : ''
59
+  if (state.tabvalue == 2) {
60
+    return '0'
61
+  }
62
+  if (state.tabvalue == 3) {
63
+    return '1'
64
+  }
65
+  if (state.tabvalue == 4) {
66
+    return '2'
67
+  }
68
+}
86 69
 onLoad(options => {
87 70
   if (options && options.tabIndex) {
88 71
     state.tabvalue = options.tabIndex
89 72
   }
90
-  loadAllOrderList()
73
+  // loadAllOrderList()
91 74
 
92 75
   // 监听事件
93
-  uni.$on('orderCancelFromList', () => {
94
-    loadAllOrderList()
95
-    state.tabvalue = 0
96
-  })
97
-
98
-  uni.$on('orderTakeFromList', () => {
99
-    loadAllOrderList()
100
-    state.tabvalue = 3
101
-  })
76
+  // uni.$on('orderCancelFromList', () => {
77
+  //   loadAllOrderList()
78
+  //   state.tabvalue = 0
79
+  // })
80
+  //
81
+  // uni.$on('orderTakeFromList', () => {
82
+  //   loadAllOrderList()
83
+  //   state.tabvalue = 3
84
+  // })
85
+})
86
+
87
+uni.$on('orderCancelFromList', () => {
88
+  // loadAllOrderList()
89
+  state.tabvalue = 0
102 90
 })
103
-function splitArray(list, sp) {
104
-  if (typeof list != 'object') return [];
105
-  if (sp == undefined) sp = [];
106
-  for (var i = 0; i < list.length; i++) {
107
-    sp.push(list[i]);
91
+
92
+uni.$on('orderTakeFromList', () => {
93
+  // loadAllOrderList()
94
+  state.tabvalue = 3
95
+})
96
+
97
+onReachBottom(() => {
98
+  // handleScrollToLower()
99
+  if (state.tabvalue == 0) {
100
+    uni.$emit('onTab0ReachBottom')
108 101
   }
109
-  return sp;
110
-}
111
-function loadAllOrderList() {
112
-  // 获取全部订单
113
-  getAllOrder({
114
-    page: 1,
115
-    limit: 10
116
-  }).then(res => {
117
-    // console.log(res)
118
-    state.allOrderTotal = res.total
119
-    state.allOrderList = res.list
120
-    // console.log(res)
121
-  })
122
-}
123
-watch(() => state.tabvalue, (val) => {
124
-  // status: string//订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
125
-
126
-  switch (val) {
127
-    case '0': {
128
-      loadAllOrderList()
129
-      break;
130
-    }
131
-    case '1': {
132
-      getGroupOrderList({
133
-        page: 1,
134
-        limit: 10
135
-      }).then(res => {
136
-        // console.log(res)
137
-        // state.obligationOrderList = splitArray(res.list, state.obligationOrderList)
138
-        state.obligationOrderList = res.list
139
-      })
140
-      break;
141
-      // getOrderListFromStatus({
142
-      //   page: 1,
143
-      //   limit: 10,
144
-      //   status: 0
145
-      // }).then(res => {
146
-      //   state.obligationOrderList = res.list
147
-      // })
148
-    }
149
-    // 待发货
150
-    case '2': {
151
-      getOrderListFromStatus({
152
-        page: 1,
153
-        limit: 10,
154
-        status: 0
155
-      }).then(res => {
156
-        state.orderList = res.list
157
-      })
158
-      break;
159
-    }
160
-    case '3': {
161
-      getOrderListFromStatus({
162
-        page: 1,
163
-        limit: 10,
164
-        status: 1
165
-      }).then(res => {
166
-        state.orderList = res.list
167
-      })
168
-      break;
169
-    }
170
-    case '4': {
171
-      getOrderListFromStatus({
172
-        page: 1,
173
-        limit: 10,
174
-        status: 2
175
-      }).then(res => {
176
-        state.orderList = res.list
177
-      })
178
-      break;
179
-    }
102
+  if (state.tabvalue == 1) {
103
+    uni.$emit('onTab1ReachBottom')
104
+  }
105
+  if (state.tabvalue == 2) {
106
+    uni.$emit('onTab2ReachBottom')
180 107
   }
108
+  if (state.tabvalue == 3) {
109
+    uni.$emit('onTab3ReachBottom')
110
+  }
111
+  if (state.tabvalue == 4) {
112
+    uni.$emit('onTab4ReachBottom')
113
+  }
114
+})
115
+onPullDownRefresh(() => {
116
+  if (state.tabvalue == 0) {
117
+    uni.$emit('onTab0PullDownRefresh')
118
+  }
119
+  if (state.tabvalue == 1) {
120
+    uni.$emit('onTab1PullDownRefresh')
121
+  }
122
+  if (state.tabvalue == 2) {
123
+    uni.$emit('onTab2PullDownRefresh')
124
+  }
125
+  if (state.tabvalue == 3) {
126
+    uni.$emit('onTab3PullDownRefresh')
127
+  }
128
+  if (state.tabvalue == 4) {
129
+    uni.$emit('onTab4PullDownRefresh')
130
+  }
131
+  // loadList('reload', items => {
132
+  //   setTimeout(() => {
133
+  //     uni.stopPullDownRefresh()
134
+  //   }, 300)
135
+  // })
181 136
 })
137
+// function splitArray(list, sp) {
138
+//   if (typeof list != 'object') return [];
139
+//   if (sp == undefined) sp = [];
140
+//   for (var i = 0; i < list.length; i++) {
141
+//     sp.push(list[i]);
142
+//   }
143
+//   return sp;
144
+// }
145
+//
146
+// function loadAllOrderList() {
147
+//   // 获取全部订单
148
+//   getAllOrder({
149
+//     page: 1,
150
+//     limit: 10
151
+//   }).then(res => {
152
+//     // console.log(res)
153
+//     state.allOrderTotal = res.total
154
+//     state.allOrderList = res.list
155
+//     // console.log(res)
156
+//   })
157
+// }
158
+//
159
+// watch(() => state.tabvalue, (val) => {
160
+//   // status: string//订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
161
+//
162
+//   switch (val) {
163
+//     case '0': {
164
+//       loadAllOrderList()
165
+//       break;
166
+//     }
167
+//     case '1': {
168
+//       getGroupOrderList({
169
+//         page: 1,
170
+//         limit: 10
171
+//       }).then(res => {
172
+//         // console.log(res)
173
+//         // state.obligationOrderList = splitArray(res.list, state.obligationOrderList)
174
+//         state.obligationOrderList = res.list
175
+//       })
176
+//       break;
177
+//       // getOrderListFromStatus({
178
+//       //   page: 1,
179
+//       //   limit: 10,
180
+//       //   status: 0
181
+//       // }).then(res => {
182
+//       //   state.obligationOrderList = res.list
183
+//       // })
184
+//     }
185
+//       // 待发货
186
+//     case '2': {
187
+//       getOrderListFromStatus({
188
+//         page: 1,
189
+//         limit: 10,
190
+//         status: 0
191
+//       }).then(res => {
192
+//         state.orderList = res.list
193
+//       })
194
+//       break;
195
+//     }
196
+//     case '3': {
197
+//       getOrderListFromStatus({
198
+//         page: 1,
199
+//         limit: 10,
200
+//         status: 1
201
+//       }).then(res => {
202
+//         state.orderList = res.list
203
+//       })
204
+//       break;
205
+//     }
206
+//     case '4': {
207
+//       getOrderListFromStatus({
208
+//         page: 1,
209
+//         limit: 10,
210
+//         status: 2
211
+//       }).then(res => {
212
+//         state.orderList = res.list
213
+//       })
214
+//       break;
215
+//     }
216
+//   }
217
+// })
182 218
 
183 219
 
184 220
 </script>
@@ -188,8 +224,22 @@ style:
188 224
   enablePullDownRefresh: true
189 225
 </route>
190 226
 
191
-<style>
227
+<style lang="scss">
228
+//.nut-tab-pane {
229
+//  background: #f5f5f5 !important;
230
+//}
231
+//.nut-tabs {
232
+//  background: white;
233
+//}
234
+.nut-tabs__titles {
235
+  background: white !important;
236
+}
237
+
192 238
 .nut-tab-pane {
193
-  background: #f5f5f5 !important;
239
+  display: none !important;
240
+}
241
+
242
+page {
243
+  background: #f8f8f8;
194 244
 }
195 245
 </style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 280 - 0
src/pages/order/obligation-detail.vue


+ 16 - 196
src/pages/order/test.json

@@ -2,201 +2,21 @@
2 2
   "status": 200,
3 3
   "message": "success",
4 4
   "data": {
5
-    "refund_order_id": "657",
6
-    "refund_order_sn": "rwx169381561906885278",
7
-    "order_id": "3923",
8
-    "uid": "10574",
9
-    "mer_id": "321",
10
-    "extension_one": "0.00",
11
-    "extension_two": "0.00",
12
-    "delivery_type": null,
13
-    "delivery_id": null,
14
-    "delivery_mark": null,
15
-    "delivery_pics": null,
16
-    "delivery_phone": null,
17
-    "mer_delivery_user": null,
18
-    "mer_delivery_address": null,
19
-    "phone": null,
20
-    "mark": "",
21
-    "mer_mark": null,
22
-    "pics": [],
23
-    "refund_type": "1",
24
-    "refund_message": "订单信息拍错了",
25
-    "refund_price": "5200.00",
26
-    "refund_postage": "0.00",
27
-    "refund_num": "1",
28
-    "fail_message": null,
29
-    "status": "0",
30
-    "status_time": "2023-09-04 16:20:19",
31
-    "create_time": "2023-09-04 16:20:19",
32
-    "reconciliation_id": "0",
33
-    "is_del": "0",
34
-    "is_system_del": "0",
35
-    "after_sn": null,
36
-    "take_status": "未收到货",
37
-    "dhm_msg": "",
38
-    "refundProduct": [
39
-      {
40
-        "refund_product_id": "670",
41
-        "refund_order_id": "657",
42
-        "order_product_id": "4084",
43
-        "refund_num": "1",
44
-        "create_time": "2023-08-14 08:25:47",
45
-        "product": {
46
-          "order_product_id": "4084",
47
-          "order_id": "3808",
48
-          "uid": "389",
49
-          "cart_id": "9848",
50
-          "product_id": "5624",
51
-          "extension_one": "0.00",
52
-          "extension_two": "0.00",
53
-          "product_sku": "759a13446d30",
54
-          "is_refund": "1",
55
-          "product_num": "1",
56
-          "refund_num": "0",
57
-          "is_reply": "0",
58
-          "product_price": "9.90",
59
-          "cart_info": {
60
-            "product": {
61
-              "product_id": "5624",
62
-              "image": "https:\/\/img.funengscm.com\/a8dbc8f89850e7a802c3335b4c04863f",
63
-              "store_name": "拍一发二小白洗鞋神器清洗剂白鞋清洁去污去黄增白擦",
64
-              "is_show": "1",
65
-              "status": "1",
66
-              "is_del": "0",
67
-              "unit_name": "个",
68
-              "price": "9.90",
69
-              "mer_status": "1",
70
-              "temp_id": "105",
71
-              "give_coupon_ids": [],
72
-              "is_gift_bag": "0",
73
-              "is_used": "1",
74
-              "product_type": "0",
75
-              "old_product_id": "716",
76
-              "temp": {
77
-                "shipping_template_id": "105",
78
-                "name": "包邮",
79
-                "type": "0",
80
-                "appoint": "0",
81
-                "undelivery": "0",
82
-                "mer_id": "0",
83
-                "is_default": "0",
84
-                "sort": "0",
85
-                "create_time": "2020-07-13 17:30:51",
86
-                "regionAddress": null,
87
-                "undelives": null,
88
-                "freeAddress": null
89
-              }
90
-            },
91
-            "productAttr": {
92
-              "gong_mer_profit": "1.44",
93
-              "gong_pension": "0.72",
94
-              "gong_market_price": "9.90",
95
-              "cost_price": "7.01",
96
-              "product_id": "5624",
97
-              "stock": "100",
98
-              "price": "9.90",
99
-              "unique": "759a13446d30",
100
-              "sku": "拍一发二",
101
-              "volume": "0.00",
102
-              "weight": "0.00",
103
-              "ot_price": "36.00",
104
-              "dacang_price": "0.00",
105
-              "cost": "7.01",
106
-              "bc_extension_one": 0,
107
-              "bc_extension_two": 0,
108
-              "seckill": 0
109
-            },
110
-            "product_type": "0"
111
-          },
112
-          "create_time": "2023-08-04 13:24:55",
113
-          "type": "1"
114
-        }
115
-      },
116
-      {
117
-        "refund_product_id": "675",
118
-        "refund_order_id": "657",
119
-        "order_product_id": "4189",
120
-        "refund_num": "1",
121
-        "create_time": "2023-09-04 16:20:19",
122
-        "product": {
123
-          "order_product_id": "4189",
124
-          "order_id": "3923",
125
-          "uid": "10574",
126
-          "cart_id": "10121",
127
-          "product_id": "5484",
128
-          "extension_one": "0.00",
129
-          "extension_two": "0.00",
130
-          "product_sku": "cec1027208c0",
131
-          "is_refund": "1",
132
-          "product_num": "1",
133
-          "refund_num": "0",
134
-          "is_reply": "0",
135
-          "product_price": "5200.00",
136
-          "cart_info": {
137
-            "product": {
138
-              "product_id": "5484",
139
-              "image": "https:\/\/img.funengscm.com\/d4461dcc6bb88ade137410722935c8a8",
140
-              "store_name": "金六福珠宝 MY103 白钻\/1克拉 女士项链【贵重物品 顺丰到付签收】",
141
-              "is_show": "1",
142
-              "status": "1",
143
-              "is_del": "0",
144
-              "unit_name": "个",
145
-              "price": "5200.00",
146
-              "mer_status": "1",
147
-              "temp_id": "105",
148
-              "give_coupon_ids": [],
149
-              "is_gift_bag": "0",
150
-              "is_used": "1",
151
-              "product_type": "0",
152
-              "old_product_id": "657",
153
-              "temp": {
154
-                "shipping_template_id": "105",
155
-                "name": "包邮",
156
-                "type": "0",
157
-                "appoint": "0",
158
-                "undelivery": "0",
159
-                "mer_id": "0",
160
-                "is_default": "0",
161
-                "sort": "0",
162
-                "create_time": "2020-07-13 17:30:51",
163
-                "regionAddress": null,
164
-                "undelives": null,
165
-                "freeAddress": null
166
-              }
167
-            },
168
-            "productAttr": {
169
-              "gong_mer_profit": "1874.00",
170
-              "gong_pension": "937.00",
171
-              "gong_market_price": "5200.00",
172
-              "cost_price": "1452.00",
173
-              "product_id": "5484",
174
-              "stock": "100",
175
-              "price": "5200.00",
176
-              "unique": "cec1027208c0",
177
-              "sku": "金六福珠宝 MY103 白钻\/1克拉 女士项链",
178
-              "volume": "0.00",
179
-              "weight": "0.00",
180
-              "ot_price": "10999.00",
181
-              "dacang_price": "0.00",
182
-              "cost": "1452.00",
183
-              "bc_extension_one": 0,
184
-              "bc_extension_two": 0,
185
-              "seckill": 0
186
-            },
187
-            "product_type": "0"
188
-          },
189
-          "create_time": "2023-09-04 11:57:00",
190
-          "type": "5"
191
-        }
192
-      }
193
-    ],
194
-    "merchant": {
195
-      "mer_id": "321",
196
-      "mer_name": "大仓创客",
197
-      "mer_avatar": "https:\/\/app.bjtdba.com\/uploads\/def\/20220428\/d616961db8aefbe92f72972a1d7db88a.png",
198
-      "business_id": "0",
199
-      "merchant_type": "3"
200
-    }
5
+    "wechat_user_id": "oGtg_6IyBcvYku_Q10x-N7__K2gQ",
6
+    "card_id": "",
7
+    "ali_user_id": "0",
8
+    "annuity_frozen": "0.00",
9
+    "annuity_num": "3",
10
+    "annuity": "0.07",
11
+    "create_time": "2023-08-30 11:27:09",
12
+    "birthday": "2023-09-21",
13
+    "birthday60": "未实名认证",
14
+    "card_number": null,
15
+    "annuity_yiqu": "0.00",
16
+    "pay_price": "14611.79",
17
+    "can_withdraw": 0,
18
+    "is_certification": 0,
19
+    "yinghang": "中信公证处消费养老金账户",
20
+    "add_up": 0
201 21
   }
202 22
 }

+ 179 - 0
src/pages/order/third-order-temp.vue

@@ -0,0 +1,179 @@
1
+<template>
2
+  <CXBBasePage>
3
+    <nut-tabs v-model="state.tabvalue">
4
+      <nut-tab-pane title="京东">
5
+        <div v-if="state.jdOrderList && state.jdOrderList.length > 0" class="flex flex-col gap-3">
6
+          <div v-for="(item, index) in state.jdOrderList" :key="index">
7
+            <div class="bg-white rounded p-2 flex flex-col gap-2">
8
+              <div class="flex justify-between items-center text-[12px] f-hairline-bottom py-2">
9
+                <div>订单号:{{ item.order_sn }}</div>
10
+                <div class="text-primary">{{ item.other_status_desc }}</div>
11
+              </div>
12
+
13
+              <div class="flex  gap-2">
14
+                <div class="flex">
15
+                  <image :src="item.goods_img" mode="widthFix" class="w-16 h-16 rounded"></image>
16
+
17
+                </div>
18
+                <div class="flex items-center">
19
+                  <div class="flex flex-col gap-1">
20
+                    <div class="bg-primary text-[10px] rounded text-white px-1 w-fit">
21
+                      京东
22
+                    </div>
23
+                    <div class="text-[12px] line-clamp-2">
24
+                      {{ item.goods_name }}
25
+                    </div>
26
+                  </div>
27
+                  <div class="flex text-[11px] w-15 justify-end">{{ 'X' + item.goods_num }}</div>
28
+                </div>
29
+              </div>
30
+              <div class="flex justify-between text-[11px] items-center">
31
+                <div>{{ item.create_time }}</div>
32
+                <div class="flex justify-center items-center">
33
+                  预估养老金:<FPrice :price="item.yanlao"></FPrice>
34
+                  <div class="border border-solid border-1px border-gray-500 text-gray rounded">{{ item.status_name }}</div>
35
+                </div>
36
+              </div>
37
+            </div>
38
+
39
+
40
+          </div>
41
+          <!--        <div>{{ item.status_name }}</div>-->
42
+
43
+        </div>
44
+        <CXBEmpty v-else/>
45
+
46
+      </nut-tab-pane>
47
+      <nut-tab-pane title="唯品会">
48
+        <CXBEmpty />
49
+      </nut-tab-pane>
50
+      <nut-tab-pane title="苏宁易购">
51
+        <CXBEmpty />
52
+      </nut-tab-pane>
53
+      <nut-tab-pane title="淘宝">
54
+        <CXBEmpty />
55
+      </nut-tab-pane>
56
+      <nut-tab-pane title="拼多多">
57
+        <CXBEmpty />
58
+      </nut-tab-pane>
59
+      <nut-tab-pane title="抖音">
60
+        <CXBEmpty />
61
+      </nut-tab-pane>
62
+    </nut-tabs>
63
+
64
+  </CXBBasePage>
65
+</template>
66
+<script setup lang="ts">
67
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
68
+import {getThirdOrder} from "~/apis/order.api";
69
+import FPrice from "~/components/FPrice/FPrice.vue";
70
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
71
+enum TYPE {
72
+  JD = '6',
73
+  TB = '5',
74
+  PDD = '1',
75
+  DY = '9',
76
+  VIP = '2',
77
+  SU = '3'
78
+}
79
+const state = reactive({
80
+  tabvalue: '0',
81
+
82
+  allOrderTotal: 0,
83
+  allOrderList: [],
84
+
85
+  // 待付款订单列表
86
+  obligationOrderList: [],
87
+
88
+  jdOrderList: [],
89
+  tbOrderList: [],
90
+  pddOrderList: [],
91
+  dyOrderList: [],
92
+  vipOrderList: [],
93
+  suOrderList: []
94
+});
95
+
96
+onLoad(() => {
97
+  loadOrderList('6')
98
+})
99
+
100
+watch(() => state.tabvalue, (val) => {
101
+  console.log(val)
102
+  switch (val) {
103
+    case '0': {
104
+      loadOrderList(TYPE.JD)
105
+      break
106
+    }
107
+    case '1': {
108
+      loadOrderList(TYPE.VIP)
109
+      break
110
+    }
111
+    case '2': {
112
+      loadOrderList(TYPE.SU)
113
+      break
114
+    }
115
+    case '3': {
116
+      loadOrderList(TYPE.TB)
117
+      break
118
+    }
119
+    case '4': {
120
+      loadOrderList(TYPE.PDD)
121
+      break
122
+    }
123
+    case '5': {
124
+      loadOrderList(TYPE.DY)
125
+      break
126
+    }
127
+  }
128
+})
129
+function loadOrderList(type: TYPE) {
130
+
131
+  getThirdOrder({type, page: 1, limit: 10}).then(res => {
132
+    switch (type) {
133
+      case TYPE.JD: {
134
+        state.jdOrderList = res.list
135
+        break
136
+      }
137
+      case TYPE.VIP: {
138
+        state.vipOrderList = res.list
139
+        break
140
+      }
141
+      case TYPE.PDD: {
142
+        state.pddOrderList = res.list
143
+        break
144
+      }
145
+      case TYPE.DY: {
146
+        state.dyOrderList = res.list
147
+        break
148
+      }
149
+      case TYPE.SU: {
150
+        state.suOrderList = res.list
151
+        break
152
+      }
153
+      case TYPE.TB: {
154
+        state.tbOrderList = res.list
155
+        break
156
+      }
157
+    }
158
+  }).catch(error => {
159
+    if (error === '请登录') {
160
+      uni.redirectTo({
161
+        url: '/pages/user/login/index'
162
+      })
163
+    }
164
+  })
165
+}
166
+</script>
167
+
168
+<route lang="yaml">
169
+style:
170
+  navigationBarTitleText: 三方订单
171
+  enablePullDownRefresh: true
172
+</route>
173
+<style>
174
+
175
+.nut-tab-pane {
176
+  background: #f5f5f5 !important;
177
+}
178
+
179
+</style>

+ 161 - 101
src/pages/order/third-order.vue

@@ -1,73 +1,50 @@
1 1
 <template>
2
-  <CXBBasePage>
3
-    <nut-tabs v-model="state.tabvalue">
4
-      <nut-tab-pane title="京东">
5
-        <div v-if="state.jdOrderList && state.jdOrderList.length > 0" class="flex flex-col gap-3">
6
-          <div v-for="(item, index) in state.jdOrderList" :key="index">
7
-            <div class="bg-white rounded p-2 flex flex-col gap-2">
8
-              <div class="flex justify-between items-center text-[12px] f-hairline-bottom py-2">
9
-                <div>订单号:{{ item.order_sn }}</div>
10
-                <div class="text-primary">{{ item.other_status_desc }}</div>
11
-              </div>
12
-
13
-              <div class="flex  gap-2">
14
-                <div class="flex">
15
-                  <image :src="item.goods_img" mode="widthFix" class="w-16 h-16 rounded"></image>
16
-
17
-                </div>
18
-                <div class="flex items-center">
19
-                  <div class="flex flex-col gap-1">
20
-                    <div class="bg-primary text-[10px] rounded text-white px-1 w-fit">
21
-                      京东
22
-                    </div>
23
-                    <div class="text-[12px] line-clamp-2">
24
-                      {{ item.goods_name }}
25
-                    </div>
26
-                  </div>
27
-                  <div class="flex text-[11px] w-15 justify-end">{{ 'X' + item.goods_num }}</div>
28
-                </div>
29
-              </div>
30
-              <div class="flex justify-between text-[11px] items-center">
31
-                <div>{{ item.create_time }}</div>
32
-                <div class="flex justify-center items-center">
33
-                  预估养老金:<FPrice :price="item.yanlao"></FPrice>
34
-                  <div class="border border-solid border-1px border-gray-500 text-gray rounded">{{ item.status_name }}</div>
35
-                </div>
36
-              </div>
37
-            </div>
38
-
39
-
2
+  <div>
3
+    <div class="fixed top-0 bg-white w-full z-2">
4
+      <nut-tabs v-model="state.tabvalue" class="bg-white">
5
+        <nut-tab-pane title="京东"></nut-tab-pane>
6
+        <nut-tab-pane title="唯品会"></nut-tab-pane>
7
+        <nut-tab-pane title="苏宁易购"></nut-tab-pane>
8
+        <nut-tab-pane title="淘宝"></nut-tab-pane>
9
+        <nut-tab-pane title="拼多多"></nut-tab-pane>
10
+        <nut-tab-pane title="抖音"></nut-tab-pane>
11
+      </nut-tabs>
12
+    </div>
13
+
14
+    <div class="p-3 mt-12">
15
+      <div v-if="state.list && state.list.length > 0" class="flex flex-col gap-3">
16
+        <div v-for="(item, index) in state.list" :key="index">
17
+          <OtherOrderItem :item="item" />
18
+        </div>
19
+        <!--        <div>{{ item.status_name }}</div>-->
20
+        <div class=" flex justify-center items-center text-[12px] text-gray-500"
21
+             v-if="state.list && state.list.length > 0">
22
+          <div v-if="state.status === 'loading'">
23
+            加载中...
24
+          </div>
25
+          <div v-if="state.status === 'noMore'">
26
+            没有更多了~
40 27
           </div>
41
-          <!--        <div>{{ item.status_name }}</div>-->
42
-
43 28
         </div>
44
-        <CXBEmpty v-else/>
45 29
 
46
-      </nut-tab-pane>
47
-      <nut-tab-pane title="唯品会">
48
-        <CXBEmpty />
49
-      </nut-tab-pane>
50
-      <nut-tab-pane title="苏宁易购">
51
-        <CXBEmpty />
52
-      </nut-tab-pane>
53
-      <nut-tab-pane title="淘宝">
54
-        <CXBEmpty />
55
-      </nut-tab-pane>
56
-      <nut-tab-pane title="拼多多">
57
-        <CXBEmpty />
58
-      </nut-tab-pane>
59
-      <nut-tab-pane title="抖音">
30
+      </div>
31
+
32
+      <div v-else class="flex flex-col items-center pt-10">
60 33
         <CXBEmpty />
61
-      </nut-tab-pane>
62
-    </nut-tabs>
34
+      </div>
35
+    </div>
36
+
37
+
38
+  </div>
39
+
63 40
 
64
-  </CXBBasePage>
65 41
 </template>
66 42
 <script setup lang="ts">
67 43
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
68
-import {getThirdOrder} from "~/apis/order.api";
44
+import {getOrderListFromStatus, getThirdOrder} from "~/apis/order.api";
69 45
 import FPrice from "~/components/FPrice/FPrice.vue";
70 46
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
47
+import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
71 48
 enum TYPE {
72 49
   JD = '6',
73 50
   TB = '5',
@@ -78,6 +55,13 @@ enum TYPE {
78 55
 }
79 56
 const state = reactive({
80 57
   tabvalue: '0',
58
+  currentPage: 1,
59
+  pageSize: 10,
60
+  totalPage: 1,
61
+
62
+  type: TYPE.JD,
63
+
64
+  list: [],
81 65
 
82 66
   allOrderTotal: 0,
83 67
   allOrderList: [],
@@ -94,75 +78,145 @@ const state = reactive({
94 78
 });
95 79
 
96 80
 onLoad(() => {
97
-  loadOrderList('6')
81
+  // loadOrderList('6')
82
+  loadList('reload')
98 83
 })
99 84
 
100 85
 watch(() => state.tabvalue, (val) => {
101 86
   console.log(val)
102 87
   switch (val) {
103 88
     case '0': {
104
-      loadOrderList(TYPE.JD)
89
+      // loadOrderList(TYPE.JD)
90
+      state.type = TYPE.JD
105 91
       break
106 92
     }
107 93
     case '1': {
108
-      loadOrderList(TYPE.VIP)
94
+      state.type = TYPE.VIP
109 95
       break
110 96
     }
111 97
     case '2': {
112
-      loadOrderList(TYPE.SU)
98
+      state.type = TYPE.SU
113 99
       break
114 100
     }
115 101
     case '3': {
116
-      loadOrderList(TYPE.TB)
102
+      state.type = TYPE.TB
117 103
       break
118 104
     }
119 105
     case '4': {
120
-      loadOrderList(TYPE.PDD)
106
+      state.type = TYPE.PDD
121 107
       break
122 108
     }
123 109
     case '5': {
124
-      loadOrderList(TYPE.DY)
110
+      state.type = TYPE.DY
125 111
       break
126 112
     }
127 113
   }
114
+
115
+  loadList('reload')
128 116
 })
129
-function loadOrderList(type: TYPE) {
130
-
131
-  getThirdOrder({type, page: 1, limit: 10}).then(res => {
132
-    switch (type) {
133
-      case TYPE.JD: {
134
-        state.jdOrderList = res.list
135
-        break
136
-      }
137
-      case TYPE.VIP: {
138
-        state.vipOrderList = res.list
139
-        break
140
-      }
141
-      case TYPE.PDD: {
142
-        state.pddOrderList = res.list
143
-        break
144
-      }
145
-      case TYPE.DY: {
146
-        state.dyOrderList = res.list
147
-        break
148
-      }
149
-      case TYPE.SU: {
150
-        state.suOrderList = res.list
151
-        break
152
-      }
153
-      case TYPE.TB: {
154
-        state.tbOrderList = res.list
155
-        break
156
-      }
117
+// function loadOrderList(type: TYPE) {
118
+//
119
+//   getThirdOrder({type, page: 1, limit: 10}).then(res => {
120
+//     switch (type) {
121
+//       case TYPE.JD: {
122
+//         state.jdOrderList = res.list
123
+//         break
124
+//       }
125
+//       case TYPE.VIP: {
126
+//         state.vipOrderList = res.list
127
+//         break
128
+//       }
129
+//       case TYPE.PDD: {
130
+//         state.pddOrderList = res.list
131
+//         break
132
+//       }
133
+//       case TYPE.DY: {
134
+//         state.dyOrderList = res.list
135
+//         break
136
+//       }
137
+//       case TYPE.SU: {
138
+//         state.suOrderList = res.list
139
+//         break
140
+//       }
141
+//       case TYPE.TB: {
142
+//         state.tbOrderList = res.list
143
+//         break
144
+//       }
145
+//     }
146
+//   }).catch(error => {
147
+//     if (error === '请登录') {
148
+//       uni.redirectTo({
149
+//         url: '/pages/user/login/index'
150
+//       })
151
+//     }
152
+//   })
153
+// }
154
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
155
+  if (action === 'reload') {
156
+    state.currentPage = 1
157
+  }
158
+  const params = {
159
+    page: state.currentPage,
160
+    limit: state.pageSize
161
+  }
162
+  if (state.keyword) {
163
+    params.keyword = state.keyword
164
+  }
165
+
166
+  getThirdOrder({
167
+    page: state.currentPage,
168
+    limit: state.pageSize,
169
+    type: state.type,
170
+  }).then(res => {
171
+    if (action === 'page') {
172
+      state.list = state.list.concat(res.list)
157 173
     }
158
-  }).catch(error => {
159
-    if (error === '请登录') {
160
-      uni.redirectTo({
161
-        url: '/pages/user/login/index'
162
-      })
174
+    if (action == 'reload') {
175
+      state.list = res.list
176
+    }
177
+    // state.totalPage = Math.ceil(res.count / state.pageSize);
178
+
179
+    state.status = 'more'
180
+    if (callback) {
181
+      callback(res.list)
182
+    }
183
+  })
184
+}
185
+
186
+function handleScrollToLower() {
187
+  state.status = 'loading';
188
+  state.currentPage += 1;
189
+
190
+  loadList('page', (items) => {
191
+    // uni.hideLoading()
192
+    // console.log(items)
193
+    if (!items.length > 0) {
194
+      console.log('没有更多了')
195
+      state.status = 'noMore'
196
+      state.currentPage -= 1;
163 197
     }
164 198
   })
199
+  // if (state.currentPage > state.totalPage) {
200
+  //   state.status = 'noMore';
201
+  // } else {
202
+  //   setTimeout(() => {
203
+  //     loadList('page')
204
+  //   }, 300)
205
+  // }
165 206
 }
207
+
208
+onReachBottom(() => {
209
+  handleScrollToLower()
210
+})
211
+
212
+onPullDownRefresh(() => {
213
+  loadList('reload', items => {
214
+    setTimeout(() => {
215
+      uni.stopPullDownRefresh()
216
+    }, 300)
217
+  })
218
+})
219
+
166 220
 </script>
167 221
 
168 222
 <route lang="yaml">
@@ -170,10 +224,16 @@ style:
170 224
   navigationBarTitleText: 三方订单
171 225
   enablePullDownRefresh: true
172 226
 </route>
173
-<style>
227
+<style lang="scss">
228
+.nut-tabs__titles {
229
+  background: white !important;
230
+}
174 231
 
175 232
 .nut-tab-pane {
176
-  background: #f5f5f5 !important;
233
+  display: none !important;
177 234
 }
178 235
 
236
+page {
237
+  background: #f8f8f8;
238
+}
179 239
 </style>

+ 511 - 0
src/pages/order_addcart/index-new.vue

@@ -0,0 +1,511 @@
1
+<script lang="ts" setup>
2
+import {getRecommendList} from "~/apis/merchant";
3
+import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
4
+import {deleteCartItem, getCartList} from "~/apis/user";
5
+import type {ShoppingResult} from "~/apis/model/shopping.model";
6
+import FPrice from "~/components/FPrice/FPrice.vue";
7
+import FButton from "~/components/FButton/FButton.vue";
8
+import CXBYaojinTag from "~/components/CXBYaojinTag/CXBYaojinTag.vue";
9
+import {
10
+  DyProductModel, IProductDetail,
11
+  JdProductModel,
12
+  SuNingProductModel,
13
+  TaobaoProductThirdPartyWaresModel, VipProductModel
14
+} from "~/apis/model/product.model";
15
+import {DcProductModel} from "~/apis/model/dacang.model";
16
+import {encodeBase64} from "~/utils/http/helper";
17
+import {CDN_URL} from "~/config/app";
18
+import {uniq} from "lodash-es";
19
+import {cartChange} from "~/apis/order.api";
20
+const gouwucheImage = CDN_URL + '/static/assets/gouwuche.png'
21
+const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
22
+const state = reactive({
23
+  recommendList: [],
24
+  currentPage: 1,
25
+  pageSize: 10,
26
+  total: 0,
27
+  totalPage: 0,
28
+
29
+
30
+  totalCartCount: 0,
31
+  totalPrice: 0,
32
+  selectAll: false,
33
+
34
+  cart_id: [],
35
+  isManage: true,
36
+})
37
+
38
+const shopping = ref<ShoppingResult>()
39
+
40
+onShow(() => {
41
+  state.cart_id = []
42
+  loadCartList()
43
+  if (!state.isManage) {
44
+    state.isManage = true
45
+  }
46
+
47
+  loadList('reload')
48
+})
49
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
50
+  const params = {
51
+    page: state.currentPage,
52
+    limit: state.pageSize
53
+  }
54
+
55
+  if (action === 'reload') {
56
+    params.page = 1
57
+  }
58
+
59
+  getRecommendList({
60
+    ...params
61
+  }).then(res => {
62
+    if (action === 'page') {
63
+      state.recommendList = state.recommendList.concat(res.list)
64
+    }
65
+    if (action === 'reload') {
66
+      // state.list = state.list.concat(res.list)
67
+      state.recommendList = res.list
68
+    }
69
+    state.totalPage = Math.ceil(res.count / state.pageSize);
70
+    state.status = 'more'
71
+    if (callback) {
72
+      callback(res.list)
73
+    }
74
+  })
75
+}
76
+
77
+function handleScrollToLower() {
78
+  state.status = 'loading';
79
+  state.currentPage += 1;
80
+  // console.log(state.totalPage)
81
+  if (state.currentPage > state.totalPage) {
82
+    state.status = 'noMore';
83
+  } else {
84
+    setTimeout(() => {
85
+      loadList('page')
86
+    }, 300)
87
+  }
88
+}
89
+
90
+onReachBottom(() => {
91
+  handleScrollToLower()
92
+
93
+})
94
+
95
+// 加载购物车数据
96
+function loadCartList() {
97
+  getCartList().then(res => {
98
+    shopping.value = res
99
+
100
+    console.log(res)
101
+    shopping.value?.list.forEach((shopItem, index) => {
102
+      // shopItem.allCheck = true
103
+      shopItem.indeterminate = false
104
+      shopItem.allCheck = false
105
+      shopItem.list.forEach(goodItem => {
106
+        goodItem.check = false
107
+        // state.cart_id.push(goodItem.cart_id)
108
+        // if (goodItem.cart_num === 1) {}
109
+      })
110
+      console.log(shopItem)
111
+    })
112
+    // cartAllCheck("all")
113
+    // if (shopping.value) {
114
+    //   handleSelectAll()
115
+    // }
116
+  })
117
+}
118
+const hasShopping = computed(() => {
119
+  return shopping.value && shopping.value?.list.length > 0
120
+})
121
+
122
+const totalCartInfo = computed(() => {
123
+  let totalPrice = 0
124
+  let goodsNum = 0
125
+  if (shopping.value && shopping.value?.list.length > 0) {
126
+    for (let i = 0; i < shopping.value?.list.length; i++) {
127
+      for (let j = 0; j < shopping.value?.list[i].list.length; j++) {
128
+        let num = Number.parseInt(shopping.value?.list[i].list[j].cart_num);
129
+        let price = Number.parseFloat(shopping.value?.list[i].list[j].productAttr.price)
130
+        totalPrice += (num * price)
131
+        goodsNum += num
132
+      }
133
+    }
134
+  }
135
+
136
+  return {
137
+    totalPrice,
138
+    goodsNum
139
+  }
140
+})
141
+const totalMoney = ref(0)
142
+const isAllSelect = ref(false)
143
+
144
+function handleGoodsItemCheck() {
145
+  cartAllCheck('single')
146
+}
147
+
148
+function shopCheck(shopItem) {
149
+  if (shopItem.allCheck) {
150
+    console.log(shopItem)
151
+    shopItem.list.forEach((good, index) => {
152
+      good.check = true
153
+    })
154
+  } else {
155
+    shopItem.list.forEach((good, index) => {
156
+      good.check = false
157
+    })
158
+  }
159
+}
160
+function cartAllCheck(type: 'single' | 'all') {
161
+  let allArr = []
162
+  let totalMoney = 0
163
+  let totalNum = 0
164
+
165
+  shopping.value?.list.forEach((goods, index) => {
166
+    if (type === 'single') {
167
+      let tempArr = goods.list.filter(goodItem => {
168
+        // if (goodItem.check) {
169
+          return goodItem.check === true
170
+        // }
171
+      })
172
+      if (tempArr && goods.list.length === tempArr.length) {
173
+        goods.allCheck = true
174
+        allArr.push(goods)
175
+      } else {
176
+        goods.allCheck = false
177
+      }
178
+    } else {
179
+      goods.list.forEach(goodItem => {
180
+        goodItem.check = isAllSelect.value
181
+      })
182
+      goods.allCheck = isAllSelect.value
183
+      if (goods.allCheck) {
184
+        allArr.push(goods)
185
+      }
186
+    }
187
+
188
+    // 总金额|总数
189
+    goods.list.forEach(goodItem => {
190
+      if (goodItem.check) {
191
+        totalMoney += (goodItem.productAttr.price * goodItem.cart_num)
192
+        totalNum += Number.parseFloat(goodItem.cart_num)
193
+        state.cart_id.push(goodItem.cart_id)
194
+      }
195
+    })
196
+  })
197
+
198
+  isAllSelect.value = allArr.length === shopping.value?.list.length
199
+  state.totalCartCount = totalNum
200
+  state.totalPrice = totalMoney
201
+}
202
+
203
+function reTotal() {
204
+  let allArr = []
205
+  let totalMoney = 0
206
+  let totalNum = 0
207
+
208
+  shopping.value?.list.forEach((goods, index) => {
209
+    // 总金额|总数
210
+    goods.list.forEach(goodItem => {
211
+      if (goodItem.check) {
212
+        totalMoney += (goodItem.productAttr.price * goodItem.cart_num)
213
+        totalNum += Number.parseFloat(goodItem.cart_num)
214
+        // state.cart_id.push(goodItem.cart_id)
215
+      }
216
+    })
217
+  })
218
+
219
+  isAllSelect.value = allArr.length === shopping.value?.list.length
220
+  state.totalCartCount = totalNum
221
+  state.totalPrice = totalMoney
222
+}
223
+function handleSelectAll(checked: boolean) {
224
+  // console.log('000')
225
+  // isAllSelect.value = !isAllSelect.value
226
+  // isAllSelect.value = checked
227
+  // 这里需要修改 checkbox 的检查
228
+  cartAllCheck('all')
229
+}
230
+
231
+function handleManageCart() {
232
+  state.isManage = !state.isManage
233
+}
234
+
235
+function handleSubmit() {
236
+  console.log(state.isManage)
237
+
238
+  if (!state.isManage) {
239
+    handleDelete()
240
+  } else { // submit
241
+    state.cart_id = uniq(state.cart_id)
242
+
243
+    // console.log(state.cart_id)
244
+    if (state.cart_id && state.cart_id.length > 0) {
245
+      uni.navigateTo({
246
+        url: `/pages/order-confirm/index?cartId=${state.cart_id.join(',')}`
247
+      })
248
+    } else {
249
+      return uni.showToast({
250
+        title: '请选择商品',
251
+        icon: 'none'
252
+      })
253
+    }
254
+  }
255
+
256
+}
257
+
258
+function handleDelete() {
259
+  // const cart_id = <any>[]
260
+  shopping.value?.list.forEach(shopItem => {
261
+    shopItem.list.forEach(goodItem => {
262
+      if (goodItem.check) {
263
+        state.cart_id.push(goodItem.cart_id)
264
+      }
265
+    })
266
+  })
267
+  state.cart_id = uniq(state.cart_id)
268
+
269
+  // console.log(cart_id)
270
+  if (state.cart_id.length === 0) {
271
+    return uni.showToast({
272
+      title: '请选择产品',
273
+      icon: "none"
274
+    })
275
+  } else {
276
+    uni.showModal({
277
+      title: '温馨提示',
278
+      content: '确认将宝贝删除?',
279
+      success: (res) => {
280
+        if (res.confirm) {
281
+          deleteCartItem(state.cart_id).then(res => {
282
+            uni.showToast({
283
+              title: '删除成功'
284
+            })
285
+            state.isManage = true
286
+            state.cart_id = []
287
+            state.totalPrice = ''
288
+            loadCartList()
289
+          })
290
+
291
+        } else if (res.cancel) {
292
+        }
293
+      }
294
+    })
295
+  }
296
+}
297
+
298
+
299
+function handleProductItemClick(
300
+    item:
301
+        JdProductModel
302
+        & DcProductModel
303
+        & DyProductModel
304
+        & SuNingProductModel
305
+        & TaobaoProductThirdPartyWaresModel
306
+        & VipProductModel
307
+) {
308
+  // function navigateToDetail(params) {
309
+  //   let otherDetailUrl = `/pages/store/product/other`
310
+  //   return uni.navigateTo({
311
+  //     url: `${otherDetailUrl}?params=${params}`
312
+  //   })
313
+  // }
314
+  // 大仓
315
+    uni.navigateTo({
316
+      url: `/pages/store/product/detail?id=${item.product_id}`
317
+    })
318
+}
319
+
320
+function handleNumberChange(num, goodItem) {
321
+  console.log(goodItem)
322
+  uni.showLoading()
323
+  console.log(num)
324
+  cartChange(goodItem.cart_id, num).then(res => {
325
+    reTotal()
326
+    uni.hideLoading()
327
+  })
328
+  // console.log(goodItem)
329
+  // console.log(num)
330
+  // const
331
+  // goodItem.productAttr.price = goodItem.productAttr.price * num
332
+  // goodItem.productAttr.price = goodItem.productAttr.price * goodItem.cart_num
333
+}
334
+</script>
335
+<template>
336
+  <div class="">
337
+    <div
338
+        v-if="hasShopping"
339
+        class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end "
340
+    >
341
+      <div class="pr-3">
342
+        <FButton size="small"
343
+                 @click="handleManageCart"
344
+        >
345
+          <div>{{ state.isManage ? '管理' : '完成'}}</div>
346
+        </FButton>
347
+      </div>
348
+    </div>
349
+    <div
350
+        v-if="!hasShopping"
351
+        class="flex flex-col justify-center items-center bg-white rounded-lg gap-3 text-xs py-8">
352
+      <div>
353
+        <image :src="gouwucheImage" mode="widthFix" class="w-20 h-20"></image>
354
+      </div>
355
+      <div>
356
+        暂无商品,去添加喜欢的商品
357
+      </div>
358
+    </div>
359
+    <div v-else class="mt-10">
360
+
361
+      <div
362
+          v-if="shopping && shopping.list"
363
+          class="flex flex-col gap-4 p-3"
364
+      >
365
+        <div
366
+            v-for="(shopItem, index) in shopping.list"
367
+            :key="index"
368
+            class="bg-white rounded-lg  "
369
+        >
370
+
371
+<!--          <nut-cell-group>-->
372
+<!--            <nut-cell>-->
373
+<!--              <nut-checkbox :indeterminate="shopItem.indeterminate" v-model="shopItem.allCheck" @change="changeBox5">-->
374
+<!--                {{shopItem.mer_name}}-->
375
+<!--              </nut-checkbox>-->
376
+<!--            </nut-cell>-->
377
+<!--            <nut-checkbox-group v-model="checkboxgroup5" ref="group2" @change="changeBox6">-->
378
+<!--              <nut-cell><nut-checkbox label="1" style="margin: 2px 20px 0 0">组合复选框</nut-checkbox></nut-cell>-->
379
+<!--              <nut-cell><nut-checkbox label="2">组合复选框</nut-checkbox></nut-cell>-->
380
+<!--              <nut-cell><nut-checkbox label="3">组合复选框</nut-checkbox></nut-cell>-->
381
+<!--              <nut-cell><nut-checkbox label="4">组合复选框</nut-checkbox></nut-cell>-->
382
+<!--            </nut-checkbox-group>-->
383
+<!--          </nut-cell-group>-->
384
+
385
+
386
+          <div
387
+              class="f-hairline-bottom flex  items-center font-bold p-3"
388
+          >
389
+            <nut-checkbox v-model="shopItem.allCheck" @change="shopCheck(shopItem)" label="全选"
390
+                          class="!text-primary"
391
+            >
392
+              {{ shopItem.mer_name }}
393
+            </nut-checkbox>
394
+          </div>
395
+          <div v-for="(goodItem, goodIndex) in shopItem.list"
396
+               :key="goodIndex"
397
+               class="flex f-hairline-bottom p-3 gap-2"
398
+          >
399
+            <div class="flex">
400
+              <nut-checkbox v-model="goodItem.check"
401
+                            @change="handleGoodsItemCheck"
402
+                            label="单选"
403
+                            class="!text-primary"
404
+              ></nut-checkbox>
405
+              <image
406
+                  :src="goodItem.product.image"
407
+                  mode="aspectFill" class="w-18 h-18 rounded"
408
+              ></image>
409
+            </div>
410
+
411
+            <div class="flex flex-col gap-1 w-full">
412
+              <div
413
+                  @click="handleProductItemClick(goodItem)"
414
+                  class="text-overflow line-clamp-1">{{ goodItem.product.store_name }}</div>
415
+              <div class="flex flex-col justify-start gap-1">
416
+                <div
417
+                    class="text-[10px] text-gray min-w-5  p-1  items-center flex">
418
+                  {{ goodItem.productAttr.sku }}
419
+                </div>
420
+                <div class="flex">
421
+                  <CXBYaojinTag :amount="goodItem.yanglao"/>
422
+
423
+                </div>
424
+              </div>
425
+              <div class="flex  justify-between ">
426
+                <FPrice :price="goodItem.productAttr.price"
427
+                        ex-class="font-bold text-dark"
428
+                />
429
+                <nut-input-number v-model="goodItem.cart_num" @change="(num) => handleNumberChange(num, goodItem)"/>
430
+              </div>
431
+            </div>
432
+          </div>
433
+        </div>
434
+
435
+      </div>
436
+    </div>
437
+
438
+    <div class="pb-12">
439
+      <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
440
+        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
441
+        <div>
442
+          猜你喜欢
443
+        </div>
444
+        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
445
+      </div>
446
+
447
+      <div class="pb-3 px-3" v-if="state.recommendList">
448
+        <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
449
+          <div v-for="(item, index) in state.recommendList"
450
+               :key="index"
451
+               @click="handleProductItemClick(item)"
452
+          >
453
+            <MerchantProductCard :item="item" />
454
+
455
+          </div>
456
+        </grid-view>
457
+
458
+        <div class=" flex justify-center items-center text-[12px] text-gray-500"
459
+        >
460
+          <div v-if="state.status === 'loading'">
461
+            加载中...
462
+          </div>
463
+          <div v-if="state.status === 'noMore'">
464
+            没有更多了~
465
+          </div>
466
+        </div>
467
+
468
+      </div>
469
+    </div>
470
+  </div>
471
+
472
+  <div v-if="hasShopping"
473
+      class="fixed bottom-0 w-full">
474
+    <div class="bg-white h-10 flex justify-between" v-if="shopping && shopping.list">
475
+      <div class="flex justify-center items-center gap-2 pl-3">
476
+        <nut-checkbox v-model="isAllSelect"
477
+                      @change="handleSelectAll"
478
+                      label="全选"
479
+                      class="!text-primary"
480
+        >全选
481
+        </nut-checkbox>
482
+        <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div>
483
+      </div>
484
+
485
+      <div class="flex justify-center items-center gap-2 pr-3">
486
+        <div class="flex text-[12px]">
487
+          合计:
488
+          <FPrice :price="state.totalPrice"></FPrice>
489
+<!--          {{totalCartInfo.totalPrice}}-->
490
+        </div>
491
+        <FButton
492
+            @click="handleSubmit"
493
+            size="small"
494
+            :exClass="['rounded-full','!text-[14px]', 'text-white', 'bg-primary', 'w-full']"
495
+        >
496
+          {{ state.isManage? '去结算' : '删除'}}
497
+        </FButton>
498
+      </div>
499
+    </div>
500
+  </div>
501
+</template>
502
+<style>
503
+page {
504
+  background-color: #f8f8f8;
505
+}
506
+</style>
507
+<route lang="yaml">
508
+style:
509
+  navigationBarTitleText: 购物车
510
+  enablePullDownRefresh: true
511
+</route>

+ 67 - 7
src/pages/order_addcart/index.vue

@@ -21,6 +21,11 @@ const gouwucheImage = CDN_URL + '/static/assets/gouwuche.png'
21 21
 const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
22 22
 const state = reactive({
23 23
   recommendList: [],
24
+  currentPage: 1,
25
+  pageSize: 10,
26
+  total: 0,
27
+  totalPage: 0,
28
+
24 29
 
25 30
   totalCartCount: 0,
26 31
   totalPrice: 0,
@@ -38,12 +43,53 @@ onShow(() => {
38 43
   if (!state.isManage) {
39 44
     state.isManage = true
40 45
   }
46
+
47
+  loadList('reload')
48
+})
49
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
50
+  const params = {
51
+    page: state.currentPage,
52
+    limit: state.pageSize
53
+  }
54
+
55
+  if (action === 'reload') {
56
+    params.page = 1
57
+  }
58
+
41 59
   getRecommendList({
42
-    page: 1,
43
-    limit: 10
60
+    ...params
44 61
   }).then(res => {
45
-    state.recommendList = res.list
62
+    if (action === 'page') {
63
+      state.recommendList = state.recommendList.concat(res.list)
64
+    }
65
+    if (action === 'reload') {
66
+      // state.list = state.list.concat(res.list)
67
+      state.recommendList = res.list
68
+    }
69
+    state.totalPage = Math.ceil(res.count / state.pageSize);
70
+    state.status = 'more'
71
+    if (callback) {
72
+      callback(res.list)
73
+    }
46 74
   })
75
+}
76
+
77
+function handleScrollToLower() {
78
+  state.status = 'loading';
79
+  state.currentPage += 1;
80
+  // console.log(state.totalPage)
81
+  if (state.currentPage > state.totalPage) {
82
+    state.status = 'noMore';
83
+  } else {
84
+    setTimeout(() => {
85
+      loadList('page')
86
+    }, 300)
87
+  }
88
+}
89
+
90
+onReachBottom(() => {
91
+  handleScrollToLower()
92
+
47 93
 })
48 94
 
49 95
 // 加载购物车数据
@@ -118,16 +164,19 @@ function cartAllCheck(type: 'single' | 'all') {
118 164
 
119 165
   shopping.value?.list.forEach((goods, index) => {
120 166
     if (type === 'single') {
167
+      // 如果单选的情况下, 获取已选中的
121 168
       let tempArr = goods.list.filter(goodItem => {
169
+        console.log(goodItem.check)
122 170
         // if (goodItem.check) {
123 171
           return goodItem.check === true
124 172
         // }
125 173
       })
126
-      if (tempArr && goods.list.length === tempArr.length) {
174
+      console.log(tempArr)
175
+      if (goods.list.length === tempArr.length) {
127 176
         goods.allCheck = true
128 177
         allArr.push(goods)
129 178
       } else {
130
-        goods.allCheck = false
179
+        // goods.allCheck = false
131 180
       }
132 181
     } else {
133 182
       goods.list.forEach(goodItem => {
@@ -373,8 +422,8 @@ function handleNumberChange(num, goodItem) {
373 422
       </div>
374 423
     </div>
375 424
 
376
-    <div>
377
-      <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3">
425
+    <div class="pb-12">
426
+      <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
378 427
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
379 428
         <div>
380 429
           猜你喜欢
@@ -392,6 +441,17 @@ function handleNumberChange(num, goodItem) {
392 441
 
393 442
           </div>
394 443
         </grid-view>
444
+
445
+        <div class=" flex justify-center items-center text-[12px] text-gray-500"
446
+        >
447
+          <div v-if="state.status === 'loading'">
448
+            加载中...
449
+          </div>
450
+          <div v-if="state.status === 'noMore'">
451
+            没有更多了~
452
+          </div>
453
+        </div>
454
+
395 455
       </div>
396 456
     </div>
397 457
   </div>

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

@@ -82,8 +82,7 @@ function handleConfirm() {
82 82
       OrderLists: state.orderList,
83 83
       type: 'tdbaspzf'
84 84
     },
85
-    // 这个不写的话会显示开发环境,不能正常跳转,写上就能正常跳转了
86
-    envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
85
+    envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
87 86
     success(res) {
88 87
       // 打开成功
89 88
       uni.showToast({

+ 21 - 0
src/pages/payment/success.vue

@@ -0,0 +1,21 @@
1
+<script setup lang="ts">
2
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
3
+
4
+const icon = 'https://cdn.bjtdba.com/vod/image/2023-09-21/20230921160115229.png'
5
+</script>
6
+
7
+<template>
8
+<CXBBasePage>
9
+  <div class="flex flex-col h-screen w-screen items-center pt-20">
10
+
11
+    <image :src="icon" mode="widthFix" class="w-40"></image>
12
+    <div>支付成功</div>
13
+  </div>
14
+</CXBBasePage>
15
+</template>
16
+
17
+
18
+<route lang="yaml">
19
+style:
20
+  navigationBarTitleText: 支付成功
21
+</route>

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

@@ -27,7 +27,7 @@ const list = [{
27 27
   icon: CDN_URL + '/static/assets/pinduoduo_d.png'
28 28
 }, {
29 29
   type: '90',
30
-  title: '储蓄',
30
+  title: '储蓄',
31 31
   icon: CDN_URL + '/static/assets/cxb_logo_230316.png'
32 32
 }]
33 33
 

+ 3 - 3
src/pages/pension_record/detail.vue

@@ -45,11 +45,11 @@ onLoad((options) => {
45 45
         <div class="text-gray w-1/5">交易时间</div>
46 46
         <div class="w-4/5">{{ detail.create_time}}</div>
47 47
       </div>
48
-      <div class="flex gap-4">
48
+      <div class="flex gap-4" v-if="detail.other_status_desc">
49 49
         <div class="text-gray w-1/5">交易状态</div>
50 50
         <div class="4/5">{{ detail.other_status_desc }}</div>
51 51
       </div>
52
-      <div class="flex gap-4">
52
+      <div class="flex gap-4" v-if="detail.goods_name">
53 53
         <div class="text-gray w-1/5">商品名称</div>
54 54
         <div class="line-clamp-2 w-4/5">{{ detail.goods_name }}</div>
55 55
       </div>
@@ -57,7 +57,7 @@ onLoad((options) => {
57 57
         <div class="text-gray w-1/5">流水单号</div>
58 58
         <div class="w-4/5">{{ detail.order_sn }}</div>
59 59
       </div>
60
-      <div class="flex gap-4">
60
+      <div class="flex gap-4" v-if="detail.mark">
61 61
         <div class="text-gray w-1/5">备注</div>
62 62
         <div class="w-4/5">{{ detail.remark }}</div>
63 63
       </div>

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

@@ -76,7 +76,7 @@ const shitidian_yanglaojinImage = CDN_URL + '/static/assets/shitidian_yanglaojin
76 76
       <div class="flex flex-col bg-white rounded p-4 text-sm gap-3" v-if="yanglaoStatistics && yanglaoStatistics.third_party_num">
77 77
         <div class=" border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b pb-2">电商平台消费(单):{{ yanglaoStatistics.third_party_num.all_num}}</div>
78 78
         <div class="flex justify-between text-xs" v-if="yanglaoStatistics">
79
-          <div>已结算(单):{{ yanglaoStatistics.all_yanglao_a.all_num_a }}</div>
79
+          <div>已结算(单):{{ yanglaoStatistics.third_party_num_a.all_num_a }}</div>
80 80
           <div v-if="yanglaoStatistics.third_party_num_n">未结算(单):{{ yanglaoStatistics.third_party_num_n.all_num_n }}</div>
81 81
         </div>
82 82
       </div>

+ 38 - 4
src/pages/pension_record/list.vue

@@ -6,9 +6,12 @@ import CXBYaojinTag from "~/components/CXBYaojinTag/CXBYaojinTag.vue";
6 6
 import {encodeBase64} from "~/utils/http/helper";
7 7
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
8 8
 const list = ref([])
9
+const state = reactive({
10
+  type: ''
11
+})
9 12
 onLoad((options) => {
10
-  const type = options.type
11
-  if (type === '99') {
13
+  state.type = options.type
14
+  if (state.type == '99') {
12 15
     getUserYanglaoJinLogXx({
13 16
       page: 1,
14 17
       limit: 20,
@@ -24,7 +27,7 @@ onLoad((options) => {
24 27
     })
25 28
   }
26 29
 
27
-  if (type === '90') {
30
+  if (state.type == '90') {
28 31
     getYanglaoJinLogXs({
29 32
       page: 1,
30 33
       limit: 20,
@@ -40,7 +43,7 @@ onLoad((options) => {
40 43
     })
41 44
   }
42 45
 
43
-  if (type !== 90 && type !== 99) {
46
+  if (state.type != 90 && state.type !=99) {
44 47
     getThirdOrder({
45 48
       page: 1,
46 49
       limit: 20,
@@ -68,6 +71,7 @@ function handleItemClick(item) {
68 71
   <CXBBasePage>
69 72
     <div v-if="list && list.length > 0" class="flex flex-col gap-3 p-3">
70 73
       <div
74
+          v-if="state.type != 90"
71 75
           @tap="handleItemClick(item)"
72 76
           v-for="(item, index) in list" :key="index" class="bg-white rounded p-3 text-[12px]">
73 77
         <div class="flex items-center gap-3 text-[12px]">
@@ -95,6 +99,36 @@ function handleItemClick(item) {
95 99
           </div>
96 100
         </div>
97 101
       </div>
102
+      <div
103
+          v-else
104
+          @tap="handleItemClick(item)"
105
+          v-for="(item, index) in list" :key="index" class="bg-white rounded p-3 text-[12px]">
106
+        <div class="flex items-center gap-3 text-[12px]">
107
+          <image :src="item.product.product.image" mode="widthFix" class="w-15 h-15"></image>
108
+          <div class="flex flex-col">
109
+            <div class=" text-[12px] line-clamp-2 w-[90%]">{{ item.product.product.store_name }}</div>
110
+            <CXBYaojinTag :amount="item.number" />
111
+          </div>
112
+        </div>
113
+        <div class="flex text-gray text-[12px] f-hairline-bottom py-3">
114
+          订单号:{{ item.order_sn }}
115
+        </div>
116
+        <div class="flex flex-col gap-2 pt-3">
117
+          <div class="flex">
118
+            下单时间:{{ item.create_time }}
119
+          </div>
120
+          <div class="flex justify-between items-center">
121
+            <div>
122
+              养老金来源:购买商品
123
+            </div>
124
+            <div class="flex items-center text-gray">
125
+              <div>详情</div>
126
+              <div class="f-text-color-2 i-tabler-chevron-right"></div>
127
+            </div>
128
+          </div>
129
+        </div>
130
+      </div>
131
+
98 132
     </div>
99 133
 
100 134
     <CXBEmpty v-else />

+ 3 - 1
src/pages/refund/README.md

@@ -1 +1,3 @@
1
-售后管理
1
+售后管理
2
+
3
+申请退款-退款类型 option.vue

+ 126 - 0
src/pages/refund/components/GoodStatusPopup.vue

@@ -0,0 +1,126 @@
1
+<script setup lang="ts">
2
+import closeIcon from "~/static/icon/close.png";
3
+import radioOffIcon from "~/static/icon/radio-off.png";
4
+import radioOnIcon from "~/static/icon/radio-on.png";
5
+import {computed} from "vue";
6
+import {PopupProps} from "~/components/FPopup";
7
+import {CLOSE_EVENT, OPEN_EVENT, UPDATE_SHOW_EVENT} from "~/components/constants";
8
+import {CANCEL_EVENT, CONFIRM_EVENT} from "~/constants/event";
9
+import FPopup from "~/components/FPopup/FPopup.vue";
10
+
11
+const emit = defineEmits()
12
+const props = defineProps({
13
+  show: {
14
+    type: Boolean,
15
+    default: false
16
+  },
17
+  // detail: {
18
+  //   type: Object,
19
+  //   required: true
20
+  // },
21
+})
22
+const show = ref(props.show || false)
23
+
24
+const showValue = computed<PopupProps['show']>({
25
+  get: () => props.show || show.value,
26
+  set(val) {
27
+    if (val)
28
+      emit(OPEN_EVENT)
29
+    else
30
+      emit(CLOSE_EVENT)
31
+    show.value = val
32
+    emit(UPDATE_SHOW_EVENT, val)
33
+  },
34
+})
35
+
36
+const onCancel = () => {
37
+  // show.value = false
38
+  showValue.value = false
39
+
40
+  emit(CANCEL_EVENT)
41
+}
42
+
43
+function handleClose() {
44
+  showValue.value = false
45
+
46
+  emit(CLOSE_EVENT)
47
+}
48
+
49
+const onConfirm = () => {
50
+  show.value = false
51
+  showValue.value = false
52
+  console.log(showValue.value)
53
+  emit(CONFIRM_EVENT)
54
+}
55
+
56
+const radioVal = ref('')
57
+
58
+function handleFinished() {
59
+  if (radioVal.value) {
60
+    emit('selected:item', radioVal.value)
61
+    showValue.value = false
62
+    emit(CONFIRM_EVENT, radioVal.value)
63
+
64
+    console.log(radioVal.value)
65
+  } else {
66
+    uni.showToast({
67
+      title: '请选择收货状态',
68
+      icon: 'none'
69
+    })
70
+  }
71
+}
72
+</script>
73
+
74
+<template>
75
+  <FPopup
76
+      v-model:show="showValue"
77
+      @close="onCancel"
78
+      position="bottom"
79
+      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe h-80"
80
+
81
+  >
82
+    <div class="flex flex-col  h-full relative">
83
+      <div class="flex p-3 f-hairline-bottom">
84
+        <div class="w-full text-center font-bold">货物状态</div>
85
+        <div class="absolute right-3"
86
+             @tap="handleClose"
87
+        >
88
+          <image :src="closeIcon" class="w-4 h-4"></image>
89
+        </div>
90
+
91
+      </div>
92
+      <div class="p-3 flex-1 h-full">
93
+        <nut-radio-group v-model="radioVal"  text-position="left">
94
+          <nut-radio label="1">
95
+            <div class="flex flex-1">
96
+              未收到货
97
+            </div>
98
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
99
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
100
+          </nut-radio>
101
+          <div class="h-0.2 bg-gray-100 my-3"></div>
102
+          <nut-radio label="2">
103
+            已收到货
104
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
105
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
106
+          </nut-radio>
107
+        </nut-radio-group>
108
+      </div>
109
+      <div class="px-3 ">
110
+<!--        <FButton-->
111
+<!--            @click="handleFinished"-->
112
+<!--            :exClass="['!bg-primary', 'rounded-full', 'text-white']"-->
113
+<!--            block-->
114
+<!--        >-->
115
+<!--          完成-->
116
+<!--        </FButton>-->
117
+        <nut-button
118
+            @click="handleFinished"
119
+            type="primary" block>完成
120
+        </nut-button>
121
+
122
+      </div>
123
+    </div>
124
+
125
+  </FPopup>
126
+</template>

+ 158 - 0
src/pages/refund/components/RefundReasonPopup.vue

@@ -0,0 +1,158 @@
1
+<script setup lang="ts">
2
+import closeIcon from "~/static/icon/close.png";
3
+import radioOffIcon from "~/static/icon/radio-off.png";
4
+import radioOnIcon from "~/static/icon/radio-on.png";
5
+import {computed} from "vue";
6
+import {PopupProps} from "~/components/FPopup";
7
+import {CLOSE_EVENT, OPEN_EVENT, UPDATE_SHOW_EVENT} from "~/components/constants";
8
+import {CANCEL_EVENT, CONFIRM_EVENT} from "~/constants/event";
9
+import FPopup from "~/components/FPopup/FPopup.vue";
10
+
11
+const emit = defineEmits()
12
+const props = defineProps({
13
+  show: {
14
+    type: Boolean,
15
+    default: false
16
+  },
17
+  // detail: {
18
+  //   type: Object,
19
+  //   required: true
20
+  // },
21
+})
22
+const show = ref(props.show || false)
23
+
24
+const showValue = computed<PopupProps['show']>({
25
+  get: () => props.show || show.value,
26
+  set(val) {
27
+    // console.log(val + 'xxxx')
28
+    if (val)
29
+      emit(OPEN_EVENT)
30
+    else
31
+      emit(CLOSE_EVENT)
32
+    show.value = val
33
+    emit(UPDATE_SHOW_EVENT, val)
34
+  },
35
+})
36
+
37
+const onCancel = () => {
38
+  // show.value = false
39
+  showValue.value = false
40
+
41
+  emit(CANCEL_EVENT)
42
+}
43
+
44
+function handleClose() {
45
+  showValue.value = false
46
+
47
+  emit(CLOSE_EVENT)
48
+}
49
+
50
+const onConfirm = () => {
51
+  show.value = false
52
+  showValue.value = false
53
+  console.log(showValue.value)
54
+  emit(CONFIRM_EVENT)
55
+}
56
+
57
+const radioVal = ref('')
58
+
59
+function handleFinished() {
60
+  if (radioVal.value) {
61
+    // emit('selected:item', radioVal.value)
62
+    showValue.value = false
63
+    emit(CONFIRM_EVENT, radioVal.value)
64
+
65
+    console.log(radioVal.value)
66
+  } else {
67
+    uni.showToast({
68
+      title: '请选择退款原因',
69
+      icon: 'none'
70
+    })
71
+  }
72
+}
73
+</script>
74
+
75
+<template>
76
+  <FPopup
77
+      v-model:show="showValue"
78
+      @close="onCancel"
79
+      position="bottom"
80
+      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe h-100"
81
+
82
+  >
83
+    <div class="flex flex-col  h-full relative">
84
+      <div class="flex p-3 f-hairline-bottom">
85
+        <div class="w-full text-center font-bold">货物状态</div>
86
+        <div class="absolute right-3"
87
+             @tap.stop="handleClose"
88
+        >
89
+          <image :src="closeIcon" class="w-4 h-4"></image>
90
+        </div>
91
+
92
+      </div>
93
+      <div class="p-3 flex-1 h-full">
94
+        <nut-radio-group v-model="radioVal"  text-position="left">
95
+          <nut-radio label="1">
96
+            <div class="flex flex-1">
97
+              订单信息拍错了
98
+            </div>
99
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
100
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
101
+          </nut-radio>
102
+          <div class="h-0.2 bg-gray-100 my-3"></div>
103
+          <nut-radio label="2">
104
+            我不想要了
105
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
106
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
107
+          </nut-radio>
108
+          <div class="h-0.2 bg-gray-100 my-3"></div>
109
+          <nut-radio label="3">
110
+            地址/电话信息填写错误
111
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
112
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
113
+          </nut-radio>
114
+          <div class="h-0.2 bg-gray-100 my-3"></div>
115
+          <nut-radio label="4">
116
+            没用/少用优惠
117
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
118
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
119
+          </nut-radio>
120
+          <div class="h-0.2 bg-gray-100 my-3"></div>
121
+          <nut-radio label="5">
122
+            发货速度不满意
123
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
124
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
125
+          </nut-radio>
126
+          <div class="h-0.2 bg-gray-100 my-3"></div>
127
+          <nut-radio label="6">
128
+            缺货
129
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
130
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
131
+          </nut-radio>
132
+          <div class="h-0.2 bg-gray-100 my-3"></div>
133
+          <nut-radio label="7">
134
+            拍多了
135
+            <template #icon> <image :src="radioOffIcon" class="w-4 h-4" mode="widthFix"></image> </template>
136
+            <template #checkedIcon> <image :src="radioOnIcon" class="w-4 h-4" mode="widthFix"></image> </template>
137
+          </nut-radio>
138
+
139
+        </nut-radio-group>
140
+      </div>
141
+      <div class="px-3 ">
142
+        <nut-button
143
+            @click="handleFinished"
144
+            type="primary" block>完成
145
+        </nut-button>
146
+<!--        <FButton-->
147
+<!--            @click="handleFinished"-->
148
+<!--            :exClass="['!bg-primary', 'rounded-full', 'text-white']"-->
149
+<!--            block-->
150
+<!--        >-->
151
+<!--          完成-->
152
+<!--        </FButton>-->
153
+
154
+      </div>
155
+    </div>
156
+
157
+  </FPopup>
158
+</template>

+ 27 - 7
src/pages/refund/detail.vue

@@ -36,8 +36,8 @@ const state = reactive({
36 36
 })
37 37
 // const detail = ref({})
38 38
 onLoad((options) => {
39
-  // getRefundDetail(options.id).then(res => {
40
-  getRefundDetail(657).then(res => {
39
+  getRefundDetail(options.id).then(res => {
40
+  // getRefundDetail(657).then(res => {
41 41
     console.log(res)
42 42
     state.detail = res
43 43
     // res.status = -1
@@ -56,7 +56,24 @@ onLoad((options) => {
56 56
   })
57 57
 })
58 58
 
59
+function handleClipboard() {
60
+  uni.setClipboardData({
61
+    data: state.detail.refund_order_sn,
62
+    success(res) {
63
+      // wx.getClipboardData({
64
+      //   success (res) {
65
+      //     console.log(res.data) // data
66
+      //   }
67
+      // })
68
+    }
69
+  })
70
+}
59 71
 
72
+function handleHeaderClick() {
73
+  uni.navigateTo({
74
+    url: `/pages/store/home/index?id=${state.detail.merchant.mer_id}`
75
+  })
76
+}
60 77
 </script>
61 78
 <template>
62 79
 
@@ -102,7 +119,7 @@ onLoad((options) => {
102 119
               </div>
103 120
             </div>
104 121
 
105
-            <div @tap.stop="handleShowOrderDetail(orderItem)">
122
+            <div>
106 123
               <div v-for="(orderProduct, orderProductIndex) in state.detail.refundProduct" :key="orderProductIndex">
107 124
                 <div class="flex py-2 gap-3 f-hairline-bottom pb-3">
108 125
                   <div class="flex-1 flex gap-2">
@@ -120,7 +137,7 @@ onLoad((options) => {
120 137
                         <div class="text-[12px] font-bold">
121 138
                           <FPrice :price="orderProduct.product.product_price" ex-class="font-bold text-black"/>
122 139
                         </div>
123
-                        <div class="text-gray-500 text-[11px]">共{{ orderProduct.product.product_num }}件</div>
140
+                        <div class="text-gray-500 text-[11px] text-right">共{{ orderProduct.product.product_num }}件</div>
124 141
                       </div>
125 142
                     </div>
126 143
                   </div>
@@ -150,7 +167,10 @@ onLoad((options) => {
150 167
               <div class="py-3 flex flex-col gap-3">
151 168
                 <div class="flex justify-between">
152 169
                   <div>订单编号</div>
153
-                  <div class="text-gray-400">{{ state.detail.refund_order_sn }}</div>
170
+                  <div class="flex gap-2">
171
+                    <div class="text-gray-400">{{ state.detail.refund_order_sn }}</div>
172
+                   <div @click="handleClipboard">复制</div>
173
+                  </div>
154 174
                 </div>
155 175
                 <div class="flex justify-between">
156 176
                   <div>申请时间</div>
@@ -158,7 +178,7 @@ onLoad((options) => {
158 178
                 </div>
159 179
                 <div class="flex justify-between">
160 180
                   <div>备注说明</div>
161
-                  <div class="text-gray-400">{{ state.detail.take_status }}</div>
181
+                  <div class="text-gray-400">{{ state.detail.mark ? state.detail.mark : '暂无说明' }}</div>
162 182
                 </div>
163 183
 
164 184
               </div>
@@ -176,7 +196,7 @@ onLoad((options) => {
176 196
   </div>
177 197
 </template>
178 198
 
179
-<route lang="yaml" type="home">
199
+<route lang="yaml">
180 200
 style:
181 201
   navigationBarTitleText: 售后订单
182 202
 </route>

+ 261 - 0
src/pages/refund/drawback.vue

@@ -0,0 +1,261 @@
1
+<script setup lang="ts">
2
+import FPrice from "~/components/FPrice/FPrice.vue";
3
+import {UPLOAD_URL} from "~/utils/http";
4
+import GoodStatusPopup from "~/pages/refund/components/GoodStatusPopup.vue";
5
+import RefundReasonPopup from "~/pages/refund/components/RefundReasonPopup.vue";
6
+import {getToken} from "~/utils/auth";
7
+import {refundApply, takeOrder} from "~/apis/order.api";
8
+const headers = {
9
+  "Content-Type": "multipart/form-data",
10
+  'X-Token': 'Bearer ' + getToken()
11
+}
12
+const state = reactive({
13
+  showGoodStatusPopup: false,
14
+  showReasonPopup: false,
15
+  // detail: {}
16
+  total_price: '0.00',
17
+  orderId: ''
18
+
19
+})
20
+const userStore = useUserStore()
21
+
22
+const formData = reactive({
23
+  ids: '',
24
+  // 申请说明
25
+  mark: '',
26
+  num: '',
27
+  // 联系电话
28
+  phone: '',
29
+  // 图片
30
+  pics: [],
31
+  // 原因
32
+  refund_message: '',
33
+  // 退款金额
34
+  refund_price: '',
35
+  type: '',
36
+  // 1退款, 2退款退货
37
+  refund_type: '',
38
+  // 收货状态
39
+  goods: ''
40
+})
41
+const defaultFileList = ref([])
42
+
43
+const radioVal = ref(false)
44
+function handleUploadSuccess({ data, option, fileItem }) {
45
+  // console.log(data.data.path)
46
+
47
+  if (data && data.data) {
48
+    const resData = JSON.parse(data.data).data
49
+    const path = resData.path
50
+    formData.pics.push(path)
51
+  }
52
+  // if (data && data.path) {
53
+  //   formData.pics.push(data.path)
54
+  // }
55
+  //
56
+  // console.log(fileItem)
57
+}
58
+onLoad(async (options) => {
59
+  await userStore.getUserInfo()
60
+  formData.refund_type = options.refund_type
61
+  formData.ids = options.ids
62
+  formData.refund_price = options.total_price
63
+  formData.num = options.total_num
64
+  formData.phone = userStore.userInfo.phone
65
+  formData.type = options.type || 1
66
+
67
+  state.orderId = options.orderId
68
+})
69
+function handleSubmit() {
70
+  if(!formData.goods) {
71
+    return uni.showToast({
72
+      title: '请选择收货状态',
73
+      icon: "none"
74
+    })
75
+  }
76
+  if (!formData.refund_message) {
77
+    return uni.showToast({
78
+      title: '请选择退款原因',
79
+      icon: "none"
80
+    })
81
+  }
82
+  uni.showModal({
83
+    content: '您确定继续退款吗?',
84
+    confirmColor: '#FE0032',
85
+    success: function (res) {
86
+      if (res.confirm) {
87
+        refundApply(state.orderId, formData).then(res => {
88
+          // {"status":200,"message":"申请退款成功","data":{"refund_order_id":"671"}}
89
+          uni.showToast({
90
+            title: '申请退款成功'
91
+          })
92
+          setTimeout(() => {
93
+            uni.navigateTo({
94
+              url: '/pages/refund/index'
95
+            })
96
+          }, 300)
97
+        })
98
+
99
+      }
100
+    }
101
+  })
102
+  // if (state.orderId) {
103
+  // }
104
+
105
+  console.log(formData)
106
+}
107
+
108
+function handleChooseGoodStatus () {
109
+  state.showGoodStatusPopup = true
110
+}
111
+
112
+function getGoodsStatus(radioVal) {
113
+  if (radioVal == 1) {
114
+    return formData.goods = '未收到货'
115
+  }
116
+  if (radioVal == 2) {
117
+    return formData.goods = '已收到货'
118
+  }
119
+}
120
+function onGoodStatusConfirm(val) {
121
+  // console.log(val)
122
+  // formData.goods = val
123
+  getGoodsStatus(val)
124
+}
125
+
126
+function getRefundMessage(radioVal) {
127
+  if (radioVal == 1) {
128
+    return '订单信息拍错了'
129
+  }
130
+  if (radioVal == 2) {
131
+    return '我不想要了'
132
+  }
133
+  if (radioVal == 3) {
134
+    return '地址/电话信息填写错误'
135
+  }
136
+  if (radioVal == 4) {
137
+    return '没用/少用优惠'
138
+  }
139
+  if (radioVal == 5) {
140
+    return '发货速度不满意'
141
+  }
142
+  if (radioVal == 6) {
143
+    return '缺货'
144
+  }
145
+  if (radioVal == 7) {
146
+    return '拍多了'
147
+  }
148
+}
149
+function onRefundReasonConfirm(val) {
150
+  formData.refund_message = getRefundMessage(val)
151
+  console.log(formData.refund_message)
152
+}
153
+
154
+
155
+</script>
156
+<template>
157
+<div>
158
+  <nut-cell-group>
159
+    <nut-cell :desc="formData.goods == '' ? '请选择' : `${formData.goods}`" is-link @click="handleChooseGoodStatus">
160
+      <template #title>
161
+        <div class="flex font-bold gap-1 items-center">
162
+          <div>收货状态</div>
163
+          <div class="text-primary">*</div>
164
+        </div>
165
+      </template>
166
+    </nut-cell>
167
+    <nut-cell :desc="formData.refund_message == '' ? '请选择' : `${formData.refund_message}`" is-link @click="state.showReasonPopup = true">
168
+      <template #title>
169
+        <div class="flex font-bold gap-1 items-center">
170
+          <div>退款原因</div>
171
+          <div class="text-primary">*</div>
172
+        </div>
173
+      </template>
174
+    </nut-cell>
175
+    <nut-cell >
176
+      <div class="flex flex-col">
177
+        <div class="flex font-bold gap-1 items-center">
178
+          <div>退款金额</div>
179
+          <div class="text-primary">*</div>
180
+        </div>
181
+        <FPrice :price="formData.refund_price" :ex-class="['font-bold text-xl']"></FPrice>
182
+        <div class="text-gray-500 text-[12px]">
183
+          不可修改,最多¥{{ formData.refund_price }},含发货邮费¥{{state.total_price}}
184
+        </div>
185
+      </div>
186
+
187
+    </nut-cell>
188
+  </nut-cell-group>
189
+
190
+  <div class="bg-white p-3">
191
+    <div class="text-sm">
192
+      补充描述和凭证
193
+    </div>
194
+    <div class="flex flex-col my-2 gap-2 bg-gray-100">
195
+        <textarea placeholder="补充描述,有助于商家更好的处理售后问题"
196
+                  class="p-2 text-xs rounded-lg"
197
+                  v-model="formData.mark"
198
+        />
199
+      <div class="flex p-2 text-gray">
200
+        <div class="flex flex-col justify-center items-center text-xs gap-2">
201
+          <nut-uploader :url="UPLOAD_URL"
202
+                        :headers="headers"
203
+                        :name="'field'"
204
+                        :timeout="1000*50"
205
+                        :data="{ filename: 'field'}"
206
+                        v-model:file-list="defaultFileList" maximum="3"
207
+                        @success="handleUploadSuccess"
208
+          >
209
+          </nut-uploader>
210
+        </div>
211
+      </div>
212
+
213
+    </div>
214
+
215
+  </div>
216
+  <div class="fixed bottom-0 pb-safe w-full">
217
+    <div class="px-3 ">
218
+      <nut-button
219
+          @click="handleSubmit"
220
+          type="primary" block>提交
221
+      </nut-button>
222
+
223
+<!--      <FButton-->
224
+<!--          @click="handleSubmit"-->
225
+<!--          :exClass="['!bg-primary', 'rounded-full', 'text-white']"-->
226
+<!--          block-->
227
+<!--      >-->
228
+<!--        提交-->
229
+<!--      </FButton>-->
230
+      <!--        <div class="text-center text-white bg-red rounded-full text-sm p-2">-->
231
+      <!--        </div>-->
232
+    </div>
233
+
234
+  </div>
235
+
236
+  <GoodStatusPopup v-model:show="state.showGoodStatusPopup"
237
+                   @confirm="onGoodStatusConfirm"
238
+  />
239
+  <RefundReasonPopup v-model:show="state.showReasonPopup"
240
+                     @confirm="onRefundReasonConfirm"
241
+  />
242
+</div>
243
+</template>
244
+
245
+<route lang="yaml">
246
+style:
247
+  navigationBarTitleText: 售后订单
248
+</route>
249
+
250
+<style lang="scss">
251
+page {
252
+  background: #f8f8f8;
253
+}
254
+.nut-radio-group {
255
+  width: 100%;
256
+}
257
+//.nut-radio {
258
+//  display: flex !important;
259
+//  width: 100%;
260
+//}
261
+</style>

+ 20 - 11
src/pages/refund/index.vue

@@ -84,20 +84,20 @@ function handleTabChange(	{title,paneKey,disabled}) {
84 84
   <div>
85 85
     <nut-tabs v-model="state.tabvalue" @change="handleTabChange">
86 86
       <nut-tab-pane title="全部">
87
-        <div v-if="state.list.length > 0" class="flex flex-col gap-3">
88
-          <div v-for="(orderItem, index) in state.list" :key="index">
89
-            <RefundOrderItem :order-item="orderItem"/>
90
-          </div>
91
-          <div class=" flex justify-center items-center text-[12px] text-gray-500" >
92
-            <div v-if="state.status === 'loading'">
93
-              加载中...
87
+          <div v-if="state.list.length > 0" class="flex flex-col">
88
+            <div v-for="(orderItem, index) in state.list" :key="index">
89
+              <RefundOrderItem :order-item="orderItem"/>
94 90
             </div>
95
-            <div v-if="state.status === 'noMore'">
96
-              没有更多了~
91
+            <div class=" flex justify-center items-center text-[12px] text-gray-500" >
92
+              <div v-if="state.status === 'loading'">
93
+                加载中...
94
+              </div>
95
+              <div v-if="state.status === 'noMore'">
96
+                没有更多了~
97
+              </div>
97 98
             </div>
98 99
           </div>
99
-        </div>
100
-        <CXBEmpty v-else/>
100
+          <CXBEmpty v-else/>
101 101
       </nut-tab-pane>
102 102
       <nut-tab-pane title="退款中">
103 103
         <div v-if="state.list.length > 0" class="flex flex-col gap-3">
@@ -138,3 +138,12 @@ function handleTabChange(	{title,paneKey,disabled}) {
138 138
 style:
139 139
   navigationBarTitleText: 退款/售后
140 140
 </route>
141
+
142
+<style>
143
+page {
144
+  background: #f8f8f8;
145
+}
146
+.nut-tab-pane {
147
+  background: #f8f8f8 !important;
148
+}
149
+</style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 110 - 0
src/pages/refund/option.vue


+ 13 - 1
src/pages/search/index.vue

@@ -591,8 +591,17 @@ function handleScrollToLower() {
591 591
                   </div>
592 592
 
593 593
                   <div v-if="state.currentTab === PLATFORM_NAME.DC">
594
-                    <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
594
+
595
+                    <div class="flex flex-row gap-2">
596
+                      <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
597
+                      <div  class="bg-[#202020] text-[#FFDD99] rounded-t-lg rounded-br-lg text-10px leading-none px-1 flex items-center justify-center h-4">
598
+                        大仓
599
+                      </div>
600
+                    </div>
601
+
595 602
                     <FPrice :price="item.ot_price" ex-class="text-gray text-xs" need-symbol strike-through/>
603
+
604
+
596 605
                   </div>
597 606
 
598 607
                   <div v-if="state.currentTab === PLATFORM_NAME.DY">
@@ -608,7 +617,10 @@ function handleScrollToLower() {
608 617
                     <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
609 618
                     <FPrice :price="item.market_price" ex-class="text-gray text-xs" need-symbol strike-through/>
610 619
                   </div>
620
+<!--                  <div class="bg-[#202020] text-[#FFDD99] rounded-t-lg rounded-br-lg text-10px leading-none px-1 flex items-center justify-center h-4">-->
621
+
611 622
 
623
+<!--                  </div>-->
612 624
 
613 625
                 </div>
614 626
               </div>

+ 1 - 1
src/pages/store/home/index.vue

@@ -219,7 +219,7 @@ onPullDownRefresh(() => {
219 219
         <div
220 220
             @click="handleOpenSearchPage"
221 221
 
222
-            class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-gray-200"
222
+            class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-gray-200 h-8"
223 223
 
224 224
         >
225 225
 

+ 2 - 2
src/pages/store/nearby/index.vue

@@ -215,7 +215,7 @@ function handleScrollToLower() {
215 215
     </div>
216 216
 
217 217
 
218
-    <div>
218
+    <div class="w-full">
219 219
       <div class="fixed z-3 flex flex-col justify-center h-10">
220 220
         <nut-menu>
221 221
           <nut-menu-item v-model="state.menuDefaultValue"
@@ -272,7 +272,7 @@ function handleScrollToLower() {
272 272
           </div>
273 273
         </div>
274 274
       </scroll-view>
275
-      <div class="flex-1 justify-center items-center" v-else>
275
+      <div class="flex justify-center items-center w-full h-[60%]" v-else>
276 276
         <CXBEmpty/>
277 277
 
278 278
       </div>

+ 1 - 1
src/pages/store/product/detail.vue

@@ -358,7 +358,7 @@ function handleShowCustomer() {
358 358
           </swiper-item>
359 359
         </swiper>
360 360
       </div>
361
-      <div class="bg-black bg-op-30 fixed top-3  rounded-full right-3 h-6 w-6 flex flex-col justify-center items-center"
361
+      <div class="bg-black bg-op-30 fixed top-3  rounded-full right-3 h-6 w-6 flex flex-col justify-center items-center z-10"
362 362
            @click="toggleRelation"
363 363
       >
364 364
         <div class="h4 w-4"

+ 49 - 32
src/pages/store/product/other.vue

@@ -163,45 +163,62 @@ function loadProductDetail(product: Partial<IProductDetail>) {
163 163
 
164 164
 function handleBuyNow() {
165 165
   console.log(detail.value)
166
-  if (detail.value?.platform == 6 && detail.value?.spreadUrl) {
166
+  // 京东
167
+  if (detail.value?.platform == 6 && detail.value?.materialUrl) {
167 168
     // console.log(detail.value?.spreadUrl)
168 169
     console.log(detail.value)
169
-    uni.navigateToMiniProgram({
170
-      appId: 'wx91d27dbf599dff74',
171
-      // path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(detail.value?.spreadUrl),
172
-      path: 'pages/union/proxy/proxy?spreadUrl=' + detail.value.materialUrl,
173
-      extraData: {
174
-        foo: 'bar'
175
-      },
176
-      envVersion: 'release',
177
-      success(res) {
178
-        // 打开成功
179
-        console.log(res);
180
-      },
181
-      fail: (error) => {
182
-        console.log(error);
183
-      }
184
-    })
170
+    if (detail.value && detail.value.materialUrl) {
171
+      uni.navigateToMiniProgram({
172
+        appId: 'wx91d27dbf599dff74',
173
+        // path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(detail.value?.spreadUrl),
174
+        path: 'pages/union/proxy/proxy?spreadUrl=' + detail.value.materialUrl,
175
+        extraData: {
176
+          foo: 'bar'
177
+        },
178
+        envVersion: 'release',
179
+        success(res) {
180
+          // 打开成功
181
+          console.log(res);
182
+        },
183
+        fail: (error) => {
184
+          console.log(error);
185
+        }
186
+      })
187
+    } else {
188
+      return uni.showToast({
189
+        title: '跳转失败请重试',
190
+        icon: 'none'
191
+      })
192
+    }
185 193
   }
186 194
   if (detail.value?.platform == 1) {
187 195
     // console.log(detail.value)
188 196
     const pddWx = detail.value.pddlink.wx
197
+    if (pddWx) {
198
+      uni.navigateToMiniProgram({
199
+        appId: pddWx.app_id,
200
+        path: pddWx.page_path,
201
+        // extraData: {
202
+        //  foo: 'bar'
203
+        // },
204
+        envVersion: 'release',
205
+        success(res) {
206
+          // 打开成功
207
+          console.log(res);
208
+        },
209
+        fail: (error) => {
210
+          console.log(error);
211
+        }
212
+      })
213
+
214
+    } else  {
215
+      uni.showToast({
216
+        title: '跳转失败请重试',
217
+        icon: 'none'
218
+      })
219
+    }
220
+    // console.log(detail.value.pddlink)
189 221
     // console.log(pddWx)
190
-    uni.navigateToMiniProgram({
191
-      appId: pddWx.app_id,
192
-      path: pddWx.page_path,
193
-      // extraData: {
194
-      //  foo: 'bar'
195
-      // },
196
-      envVersion: 'release',
197
-      success(res) {
198
-        // 打开成功
199
-        console.log(res);
200
-      },
201
-      fail: (error) => {
202
-        console.log(error);
203
-      }
204
-    })
205 222
   }
206 223
   if (detail.value?.platform == 3) {
207 224
     // console.log('sunig')

+ 19 - 5
src/pages/user/index.vue

@@ -34,7 +34,7 @@ const myOrderList = [{
34 34
 }, {
35 35
   icon: CDN_URL + '/static/assets/after_sale_220620.png',
36 36
   text: '退款/售后',
37
-  url: ''
37
+  url: '/pages/refund/index'
38 38
 }]
39 39
 const contactUsList = [{
40 40
   type: 'customer',
@@ -216,9 +216,16 @@ function handleShowMyIntegral() {
216 216
 }
217 217
 
218 218
 function handleShowMyAllOrder(tab?: number) {
219
-  uni.navigateTo({
220
-    url: '/pages/order/index?tabIndex=' + tab
221
-  })
219
+  if (tab <= 4) {
220
+    uni.navigateTo({
221
+      url: '/pages/order/index?tabIndex=' + tab
222
+    })
223
+  }
224
+  if (tab == 5) {
225
+    uni.navigateTo({
226
+      url: '/pages/refund/index'
227
+    })
228
+  }
222 229
 }
223 230
 
224 231
 const userType = computed(() => {
@@ -350,7 +357,7 @@ function handleShowMyRulePage() {
350 357
             <div
351 358
                 @tap="handleShowMyInvitation"
352 359
                 class="w-1/3  flex flex-col justify-center items-center">
353
-              <div>{{ agentInfo.brokerage_price }}</div>
360
+              <div>{{ agentInfo.brokerage_price ? agentInfo.brokerage_price : '0.00'}}</div>
354 361
               <div class="text-xs">我的佣金</div>
355 362
             </div>
356 363
             <div
@@ -427,6 +434,13 @@ function handleShowMyRulePage() {
427 434
               >
428 435
                 {{ orderQuantity.noPostage}}
429 436
               </div>
437
+              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
438
+                   v-if="
439
+                   item.id == 'noComment' && orderQuantity && orderQuantity.noComment != '0'"
440
+
441
+              >
442
+                {{ orderQuantity.noComment}}
443
+              </div>
430 444
               <image :src="item.icon"
431 445
                      mode="widthFix"
432 446
                      class="w-7 h-7 "

BIN
src/static/icon/close.png


BIN
src/static/icon/radio-off.png


BIN
src/static/icon/radio-on.png


BIN
src/static/icon/关闭@2x.png


BIN
src/static/icon/未选中 2@2x (1).png


BIN
src/static/icon/未选中 2@2x.png