Explorar el Código

li-yi合并至master

dxz1228 hace 2 años
padre
commit
ee56bd664d
Se han modificado 83 ficheros con 6444 adiciones y 2200 borrados
  1. 15 1
      src/apis/dacang.ts
  2. 1 0
      src/apis/model/myRelationProductModel.ts
  3. 1 1
      src/apis/model/spreadInfoModel.ts
  4. 75 11
      src/apis/order.api.ts
  5. 55 2
      src/apis/user.ts
  6. 1 1
      src/components/CXBBanner/CXBBanner.vue
  7. 1 1
      src/components/CXBEmpty/CXBEmpty.vue
  8. 1 1
      src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue
  9. 7 7
      src/components/CXBSkuPopup/CXBSkuPopup.vue
  10. 1 1
      src/components/FNavBar/FNavBar.vue
  11. 25 7
      src/components/ProductCard/ProductCard.vue
  12. 11 34
      src/components/ProductList/ProductList.vue
  13. 1 1
      src/pages.json
  14. 1 1
      src/pages/accumulate-income/index.vue
  15. 4 4
      src/pages/annuity/index.vue
  16. 2 1
      src/pages/home/components/announcement.vue
  17. 3 2
      src/pages/home/components/banner.vue
  18. 1 1
      src/pages/home/components/header.vue
  19. 2 2
      src/pages/home/components/navs.vue
  20. 355 70
      src/pages/home/index.vue
  21. 240 35
      src/pages/immediate-withdrawal/index.vue
  22. 47 57
      src/pages/invite-friends/index.vue
  23. 31 4
      src/pages/message/index.vue
  24. 329 50
      src/pages/miaosha/index.vue
  25. 62 19
      src/pages/my-invitation/index.vue
  26. 1 1
      src/pages/my-profile/index.vue
  27. 214 59
      src/pages/my-relation-merchant/index.vue
  28. 232 40
      src/pages/my-relation-product/index.vue
  29. 219 178
      src/pages/my-rules/index.vue
  30. 97 111
      src/pages/order-confirm/index.vue
  31. 34 11
      src/pages/order/components/AllItemList.vue
  32. 28 9
      src/pages/order/components/ObligationOrderList.vue
  33. 19 6
      src/pages/order/components/Order2List.vue
  34. 20 7
      src/pages/order/components/Order3List.vue
  35. 17 6
      src/pages/order/components/Order4List.vue
  36. 147 22
      src/pages/order/components/OrderItem.vue
  37. 67 50
      src/pages/order/components/OrderObligationItem.vue
  38. 39 37
      src/pages/order/components/RefundOrderItem.vue
  39. 193 32
      src/pages/order/detail.vue
  40. 166 162
      src/pages/order/index.vue
  41. 110 53
      src/pages/order/logistics.vue
  42. 28 17
      src/pages/order/obligation-detail.vue
  43. 310 108
      src/pages/order_addcart/index.vue
  44. 2 0
      src/pages/payment/index.vue
  45. 1 1
      src/pages/pension_record/index.vue
  46. 1 1
      src/pages/product/integral.vue
  47. 1 1
      src/pages/product/zibuyangsheng.vue
  48. 298 131
      src/pages/red-integral/index.vue
  49. 1 1
      src/pages/refund/components/RefundReasonPopup.vue
  50. 672 123
      src/pages/refund/detail.vue
  51. 166 108
      src/pages/refund/drawback.vue
  52. 35 31
      src/pages/refund/index.vue
  53. 14 17
      src/pages/refund/option.vue
  54. 103 0
      src/pages/refund/scancode/kdlist.vue
  55. 280 0
      src/pages/refund/scancode/scancode.vue
  56. 305 0
      src/pages/refund/scancode/xsjllist.vue
  57. 7 4
      src/pages/search/index.vue
  58. 125 131
      src/pages/search/search-dacang.vue
  59. 5 98
      src/pages/store/home/components/MerchantHeader.vue
  60. 30 22
      src/pages/store/home/components/MerchantProductCard.vue
  61. 197 90
      src/pages/store/home/index.vue
  62. 157 70
      src/pages/store/home/search.vue
  63. 247 98
      src/pages/store/product/detail.vue
  64. 22 9
      src/pages/store/product/other.vue
  65. 39 31
      src/pages/user/index.vue
  66. 1 1
      src/pages/user/login/index.vue
  67. 237 0
      src/pages/user/login/invite-login.vue
  68. 42 5
      src/pages/user/login/other-phone.vue
  69. 239 2
      src/pages/user/login/register-agreement.vue
  70. 1 1
      src/pages/vip/index.vue
  71. BIN
      src/static/icon/ckgd.png
  72. BIN
      src/static/icon/guanbi.png
  73. BIN
      src/static/icon/search_ck.png
  74. BIN
      src/static/icon/title_1.png
  75. BIN
      src/static/icon/复制.png
  76. BIN
      src/static/icon/展开.png
  77. BIN
      src/static/icon/快递.png
  78. BIN
      src/static/icon/扫码.png
  79. BIN
      src/static/icon/收起.png
  80. BIN
      src/static/icon/联系商家.png
  81. BIN
      src/static/tabbar/search.png
  82. 2 0
      src/stores/userStore.ts
  83. 1 1
      src/utils/http/index.ts

+ 15 - 1
src/apis/dacang.ts

@@ -17,6 +17,8 @@ enum API {
17 17
 	DC_SECKILL_INDEX_TIME ='/api/store/product/seckill/select',
18 18
 	// 大仓商品列表
19 19
 	DC_PRODUCT_LIST = '/api/dacang/nologin/da_cang_product_lst',
20
+	// 大仓搜索商品列表
21
+	DC_SEARCH_LIST = '/gateway/wares_service/waresService/selectProductList',
20 22
 	// 大仓会员商品
21 23
 	DC_MEMBER_PRODUCT_LIST = '/api/store/product/dacang_lst',
22 24
 	// 大仓列表
@@ -82,6 +84,18 @@ export function getDcProductList(params: QueryDcProductListParams): Promise<Arra
82 84
 		}
83 85
 	})
84 86
 }
87
+/**
88
+ * 大仓搜索商品列表
89
+ *
90
+ */
91
+export function getDcSearchList(params: any): Promise<Array<any>> {
92
+	return defHttp.get({
93
+		url: API.DC_SEARCH_LIST,
94
+		data: {
95
+			...params
96
+		}
97
+	})
98
+}
85 99
 
86 100
 /**
87 101
  * 大仓秒杀商品
@@ -92,7 +106,7 @@ export function getDcSeckill(params: { page: number, limit: number }): Promise<A
92 106
 		data: {
93 107
 			...params
94 108
 		}
95
-	})
109
+	    })
96 110
 }
97 111
 
98 112
 /**

+ 1 - 0
src/apis/model/myRelationProductModel.ts

@@ -23,4 +23,5 @@ export interface MyRelationProductModel {
23 23
     care_count: string
24 24
     // 原价(划线价格)
25 25
     ot_price: string
26
+    isSelected?:boolean
26 27
 }

+ 1 - 1
src/apis/model/spreadInfoModel.ts

@@ -6,7 +6,7 @@ export interface SpreadInfoModel {
6 6
     yesterday_brokerage: number
7 7
     total_extract: number
8 8
     total_brokerage: number
9
-
9
+    member_brokerage_price:string
10 10
    // 佣金余额(可提现)
11 11
     brokerage_price: string
12 12
     now_money: string

+ 75 - 11
src/apis/order.api.ts

@@ -1,13 +1,13 @@
1
-import {defHttp, detailHttp, skuhttp} from "~/utils/http"
1
+import { defHttp, detailHttp, skuhttp } from "~/utils/http"
2 2
 
3 3
 import type {
4 4
     IntegralOrderCreateModel, OrderCheckModel, OrderCreateModel,
5 5
     OrderCreateShoppingModel, ProductSkuModel, OrderListDataModel, OrderListObligationResult, OrderListResult, OrderQuantityModel, ProductSkustatusModel
6 6
 } from "~/apis/model/order.model"
7
-import type {ThirdOrderResult} from "~/apis/model/third-order.model";
8
-import type {CommentProductRequest} from "~/apis/model/comment-product";
9
-import type {AfterSalesOrderResult} from "~/apis/model/after-sales-order.model";
10
-import type {RefundApplyRequest} from "~/apis/model/refund.model";
7
+import type { ThirdOrderResult } from "~/apis/model/third-order.model";
8
+import type { CommentProductRequest } from "~/apis/model/comment-product";
9
+import type { AfterSalesOrderResult } from "~/apis/model/after-sales-order.model";
10
+import type { RefundApplyRequest } from "~/apis/model/refund.model";
11 11
 
12 12
 export interface CartIdRequest {
13 13
     cart_id: Array<string>
@@ -59,6 +59,14 @@ enum API {
59 59
     REFUND_APPLY = '/api/refund/apply',
60 60
     // 退款订单详情
61 61
     REFUND_DETAIL = '/api/refund/detail',
62
+    //快递列表
63
+    REFUND_KDLIST = '/api/common/express',
64
+    //退货订单
65
+    REFUND_OUTDL = '/api/refund/back_goods',
66
+    //退换货物流信息
67
+    REFUND_WLLIST = '/api/refund/express',
68
+    //协商记录
69
+    REFUND_XSLIST = '/api/refund/consult_list',
62 70
     // 售后-订单列表
63 71
     REFUND_LIST = '/api/refund/list',
64 72
     // 三方订单
@@ -94,6 +102,62 @@ export function getRefundDetail(id: string) {
94 102
     })
95 103
 }
96 104
 
105
+
106
+/**
107
+ * 快递列表/api/common/express
108
+ * @param params 
109
+ * 
110
+ * @returns 
111
+ */
112
+
113
+
114
+export function getRefundKdlist() {
115
+    return defHttp.get({
116
+        url: API.REFUND_KDLIST,
117
+    })
118
+}
119
+/**
120
+ * 提交退货订单
121
+ * @param params 
122
+ * 
123
+ * @returns 
124
+ */
125
+
126
+
127
+export function getRefundOutDl(id: any, data: any) {
128
+    return defHttp.post({
129
+        url: API.REFUND_OUTDL + `/${id}`,
130
+        data: { ...data }
131
+    })
132
+}
133
+/**
134
+ * 获取退换货物流信息
135
+ * @param params 
136
+ * 
137
+ * @returns 
138
+ */
139
+
140
+
141
+export function getRefundWlList(id: any) {
142
+    return defHttp.get({
143
+        url: API.REFUND_WLLIST + `/${id}`
144
+    })
145
+}
146
+/**
147
+ * 获取协商记录
148
+ * @param params 
149
+ * 
150
+ * @returns 
151
+ */
152
+
153
+
154
+export function getRefundXSlist(id: any) {
155
+    return defHttp.post({
156
+        url: API.REFUND_XSLIST + `/${id}`
157
+    })
158
+}
159
+
160
+
97 161
 /**
98 162
  * 售后-订单列表
99 163
  */
@@ -150,7 +214,7 @@ export function totalOrderNumber(): Promise<OrderQuantityModel> {
150 214
  * 三方订单
151 215
  * @param params
152 216
  */
153
-export function getThirdOrder(params: { type: string, page: number, limit: 20 | number}): Promise<ThirdOrderResult> {
217
+export function getThirdOrder(params: { type: string, page: number, limit: 20 | number }): Promise<ThirdOrderResult> {
154 218
     return defHttp.get({
155 219
         url: API.USER_THIRD_ORDER,
156 220
         data: {
@@ -211,12 +275,12 @@ export function createShopping(params: {
211 275
 /**
212 276
  * 改变购物车商品sku
213 277
  */
214
-export function changeProdoctSku(cart_id:string,unique:string): Promise<ProductSkustatusModel> {
215
-    console.log(unique,'order的api接收的unique')
216
-    console.log(cart_id,'order的api接收的unique')
278
+export function changeProdoctSku(cart_id: string, unique: string): Promise<ProductSkustatusModel> {
279
+    console.log(unique, 'order的api接收的unique')
280
+    console.log(cart_id, 'order的api接收的unique')
217 281
     return skuhttp.post({
218
-        url:API.CHANGE_PRODUCT_SKU + `/${cart_id}?`,
219
-        data:{
282
+        url: API.CHANGE_PRODUCT_SKU + `/${cart_id}?`,
283
+        data: {
220 284
             unique
221 285
         }
222 286
     })

+ 55 - 2
src/apis/user.ts

@@ -1,4 +1,4 @@
1
-import { defHttp } from '~/utils/http'
1
+import { defHttp, detailHttp } from '~/utils/http'
2 2
 import type { UserUnionParams, UserUnionResult } from "~/apis/model/userUnionModel";
3 3
 import Cache from '~/utils/cache'
4 4
 import { EXPIRES_TIME, LOGIN_STATUS, OPEN_ID, STATE_R_KEY, USER_INFO } from "~/constants";
@@ -98,6 +98,8 @@ enum API {
98 98
     USER_RELATION_PRODUCT_LIST = '/api/user/relation/product/lst',
99 99
     // 取消收藏
100 100
     USER_RELATION_DELETE = '/api/user/relation/delete',
101
+    // 批量取消收藏
102
+    BATCH_RELATION_DELETE = '/api/user/relation/batch/delete',
101 103
     // 我关注的店铺
102 104
     USER_RELATION_MERCHANT_LIST = '/api/user/relation/merchant/lst',
103 105
 
@@ -106,7 +108,9 @@ enum API {
106 108
 
107 109
     // 红积分列表
108 110
     USER_RED_LOG = '/api/user/red_log',
109
-
111
+    //https://test.bjtdba.com/api/user/red_log?page=1&limit=20 红积分明细 
112
+    //https://test.bjtdba.com/api/user/bill?page=1&limit=20&is_red=true 红积分奖金明细
113
+    USER_BILL_LOG = '/api/user/bill',
110 114
     // 获取规则信息
111 115
     GET_RULES = '/api/notice/detail',
112 116
 
@@ -142,6 +146,7 @@ enum API {
142 146
     USER_CART_LIST = `/api/user/cart/lst`,
143 147
     // 购物车删除
144 148
     USER_CART_DELETE = `/api/user/cart/delete`,
149
+    USER_CART_REMOVE = `/api/user/relation/batch/create_remove_cart`,
145 150
     // 购物车数量
146 151
     USER_CART_COUNT = `/api/user/cart/count`,
147 152
 
@@ -297,6 +302,18 @@ export function getRedIntegralList(params: { page: number, limit: number }) {
297 302
         }
298 303
     })
299 304
 }
305
+/**
306
+ * 获取会员奖金列表
307
+ * @param params
308
+ */
309
+export function getBillIntegralList(params: any) {
310
+    return defHttp.get({
311
+        url: API.USER_BILL_LOG,
312
+        data: {
313
+            ...params
314
+        }
315
+    })
316
+}
300 317
 
301 318
 /* 关注/收藏
302 319
  */
@@ -449,6 +466,15 @@ export function deleteCartItem(cart_id: any[]) {
449 466
         }
450 467
     })
451 468
 }
469
+//移入收藏  USER_CART_REMOVE = `/api/user/relation/batch/create_remove_cart`,
470
+export function removeCartItem(type_id: any[]) {
471
+    return detailHttp.post({
472
+        url: API.USER_CART_REMOVE,
473
+        data: {
474
+            type_id
475
+        }
476
+    })
477
+}
452 478
 // 删除评论
453 479
 export function removeReply(reply_id: string) {
454 480
     return defHttp.post({
@@ -545,6 +571,18 @@ export function removeMyRelation(params: { type: number, type_id: string }) {
545 571
         }
546 572
     })
547 573
 }
574
+/**
575
+ * 批量取消我的收藏 user/relation/batch/delete
576
+ * @param type 1
577
+ */
578
+export function batchremoveMyRelation(params: { type: number, type_id:any[]}) {
579
+    return defHttp.post({
580
+        url: API.BATCH_RELATION_DELETE,
581
+        data: {
582
+            ...params
583
+        }
584
+    })
585
+}
548 586
 
549 587
 /**
550 588
  * 获取我的收藏
@@ -587,6 +625,21 @@ export function getApplicationWithdrawal(params: {
587 625
         }
588 626
     })
589 627
 }
628
+/**
629
+ * 提现申请
630
+ */
631
+export function getApplicationredWithdrawal(params: {
632
+    extract_price: string,
633
+    extract_type: string,
634
+    type:number
635
+}) {
636
+    return defHttp.post({
637
+        url: API.USER_EXTRACT_CREATE,
638
+        data: {
639
+            ...params
640
+        }
641
+    })
642
+}
590 643
 
591 644
 /**
592 645
  * 获取用户养老金信息

+ 1 - 1
src/components/CXBBanner/CXBBanner.vue

@@ -1,7 +1,7 @@
1 1
 <script lang="ts" setup>
2 2
 </script>
3 3
 <template>
4
-  <div class="flex flex-col justify-center items-center py-20">
4
+  <div class="flex flex-col justify-center items-center py-22">
5 5
     <image
6 6
         src="https://test.bjtdba.com/applet/static/home/404986b1e3aeaf4b3829efa2c2ac6bf.png"
7 7
         mode="widthFix"

+ 1 - 1
src/components/CXBEmpty/CXBEmpty.vue

@@ -14,7 +14,7 @@ const props = defineProps({
14 14
   },
15 15
   text: {
16 16
     type: String,
17
-    default: '暂无数据'
17
+    default: '暂无相关数据'
18 18
   }
19 19
 })
20 20
 

+ 1 - 1
src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue

@@ -67,7 +67,7 @@ function getPhoneNumber(e) {
67 67
               Cache.clear('SHARE_ID')
68 68
               if (redirectPageObj) {
69 69
                 if (redirectPageObj.type === 'page') {
70
-                  return uni.redirectTo({
70
+                  return uni.reLaunch({
71 71
                     url: redirectPageObj.page
72 72
                   })
73 73
                 }

+ 7 - 7
src/components/CXBSkuPopup/CXBSkuPopup.vue

@@ -121,7 +121,7 @@ function handleCountChange(value) {
121 121
 
122 122
 <template>
123 123
   <FPopup v-model:show="showValue" @close="onCancel" position="bottom"
124
-    exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[70%] max-h-[80%] h-full">
124
+    exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[55%] max-h-[70%] h-full">
125 125
     <div class="flex flex-col justify-between h-full">
126 126
       <div class="flex-1">
127 127
         <div class="p-3 flex flex-col gap-3">
@@ -142,10 +142,10 @@ function handleCountChange(value) {
142 142
                   剩余库存{{ currentSku.stock }}
143 143
                 </div>
144 144
                 <div class="flex items-end gap-2" v-if="detail.mer_id === '148'">
145
-                  {{ (currentSku.price * 30).toFixed(2) }} 积分
145
+                  {{  Math.round(currentSku.price * 30) }} 积分
146 146
                 </div>
147 147
                 <div class="flex items-end gap-2" v-else>
148
-                  <FPrice :price="currentSku.price" />
148
+                  <FPrice :price="detail.seckill_s==0? currentSku.price:currentSku.dacang" />
149 149
                   <FPrice v-if="currentSku.ot_price" :price="currentSku.ot_price"
150 150
                     :ex-class="'!text-black text-xs font-bold'" need-symbol strike-through />
151 151
                 </div>
@@ -186,7 +186,7 @@ function handleCountChange(value) {
186 186
         </div>
187 187
       </div>
188 188
 
189
-      <div class="px-3 pb-10" v-if="isTo == 1">
189
+      <div class="px-3 pb-12" v-if="isTo == 1">
190 190
         <FButton @click="handleAddCart" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
191 191
           确定
192 192
         </FButton>
@@ -210,13 +210,13 @@ function handleCountChange(value) {
210 210
         </FButton>
211 211
 
212 212
       </div>
213
-      <div class="flex box_1 flex-row justify-between text-sm text-white gap-3 " v-if="isTo == 2">
213
+      <div class="px-4 flex box_1 flex-row justify-between text-sm text-white gap-3 " v-if="isTo == 2">
214 214
         <button @click="handleJiaCart" size="small"
215
-          class="bg-[#FFA319] rounded-full w-60 flex justify-center items-center h-9 clor">
215
+          class="bg-[#FFA319] rounded-full w-50 flex justify-center items-center h-9 clor">
216 216
           加入购物车
217 217
         </button>
218 218
         <button @click="handleBuyNow" size="small"
219
-          class="bg-[#F94032] rounded-full w-60 flex justify-center items-center h-9 clor ">
219
+          class="bg-[#F94032] rounded-full w-50 flex justify-center items-center h-9 clor ">
220 220
           立即购买
221 221
         </button>
222 222
 

+ 1 - 1
src/components/FNavBar/FNavBar.vue

@@ -36,7 +36,7 @@ const {
36 36
         <div v-if="hasLeft" class="f-nav-bar-left" :class="clickableClassName" :hover-class="props.clickable ? 'f-nav-bar-clickable-hover' : ''" @click="clickLeftHandler">
37 37
           <slot v-if="$slots.left" name="left" />
38 38
           <template v-else>
39
-            <div v-if="props.leftArrow" class="f-nav-bar-icon mr-1 i-tabler-chevron-left" />
39
+            <div v-if="props.leftArrow" class="f-nav-bar-icon mr-1 "><nut-icon name="rect-left" size="20"></nut-icon></div>
40 40
             <span v-if="props.leftText" class="f-nav-bar-text">{{ props.leftText }}</span>
41 41
           </template>
42 42
         </div>

+ 25 - 7
src/components/ProductCard/ProductCard.vue

@@ -36,22 +36,29 @@ function handleClick() {
36 36
       @tap.stop="handleClick"
37 37
       class="bg-white rounded-lg"
38 38
   >
39
-    <image :src="item.image" mode="widthFix" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square" v-if="item.type == 5"></image>
40
-    <image :src="item.thumb" mode="widthFix" :fade-in="true" class="rounded-t-lg  !w-full aspect-square" v-if="item.type == 6"></image>
39
+    <image :src="item.image" style="width: 341rpx; height: 341rpx;" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square" v-if="item.type == 5"></image>
40
+    <image :src="item.thumb" style="width: 341rpx; height: 341rpx;"   :fade-in="true" class="rounded-t-lg  !w-full aspect-square" v-if="item.type == 6"></image>
41
+    <image :src="item.image" style="width: 341rpx; height: 341rpx;"   :fade-in="true" class="rounded-t-lg  !w-full aspect-square" v-if="item.type == 1 ||item.type == 14 ||item.type == 10 ||item.type == 8 ||item.type == 15 ||item.type == 16"></image>
41 42
 
42 43
     <div class="text-sm p-2 flex flex-col gap-1">
43 44
       <div v-if="item.type == 5" class="line-clamp-2">
44 45
         {{ item.store_name }}
45 46
       </div>
47
+      <div v-if="item.type == 1 ||item.type == 14 ||item.type == 10 ||item.type == 8 ||item.type == 15 ||item.type == 16" class="line-clamp-2">
48
+        {{ item.store_name }}
49
+      </div>
46 50
       <div v-if="item.type == 6" class="line-clamp-2">
47 51
         {{ item.name }}
48 52
       </div>
49 53
       <div class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
50 54
         <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
51 55
                mode="widthFix" class="!w-8 h-4"></image>
52
-        <div class="px-2 flex items-center jusitify-center">
56
+        <div class="px-2 flex items-center jusitify-center"  >
53 57
           <div v-if="item.type == 5">
54
-            养老金 ¥{{item.yanglao}}
58
+            养老金 ¥{{item.yanglao||item.yanglao_price}}
59
+          </div>
60
+          <div v-if="item.type == 1 ||item.type == 14 ||item.type == 10 ||item.type == 8 ||item.type == 15 ||item.type == 16">
61
+            养老金 ¥{{item.yanglao_price}}
55 62
           </div>
56 63
 
57 64
           <div v-if="item.type==6">
@@ -67,17 +74,25 @@ function handleClick() {
67 74
           <div v-if="item.type == 5">
68 75
             {{ item.price }}
69 76
           </div>
77
+          <div v-if="item.type == 1 ||item.type == 14 ||item.type == 10 ||item.type == 8 ||item.type == 15 ||item.type == 16">
78
+            {{ item.price }}
79
+          </div>
70 80
           <div v-if="item.type == 6">
71 81
             {{item.lowestCouponPrice}}
72 82
           </div>
73 83
         </div>
74 84
 
75
-        <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">
85
+        <div  v-if="item.type == 5" class="bg-[#202020] text-[#FFDD99] rounded-t-lg rounded-br-lg text-10px leading-none px-1 flex items-center justify-center h-4">
76 86
 
77
-          <div v-if="item.type == 5">
87
+          <div >
78 88
             大仓
79 89
           </div>
80
-          <div v-if="item.type == 6">
90
+          
91
+        </div>
92
+        <div v-if="item.type == 6"  class="bg-[#202020] text-[#FFDD99] rounded-t-lg rounded-br-lg text-10px leading-none px-1 flex items-center justify-center h-4">
93
+
94
+         
95
+          <div >
81 96
             京东
82 97
           </div>
83 98
         </div>
@@ -88,6 +103,9 @@ function handleClick() {
88 103
         <div v-if="item.type == 5">
89 104
           ¥ {{item.ot_price}}
90 105
         </div>
106
+        <div v-if="item.type == 1 ||item.type == 14 ||item.type == 10 ||item.type == 8 ||item.type == 15 ||item.type == 16">
107
+          ¥ {{item.ot_price}}
108
+        </div>
91 109
         <div v-if="item.type == 6">
92 110
           ¥ {{item.price}}
93 111
         </div>

+ 11 - 34
src/components/ProductList/ProductList.vue

@@ -2,9 +2,9 @@
2 2
 
3 3
 import ProductCard from "~/components/ProductCard/ProductCard.vue";
4 4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
-import {debounce} from "lodash-es";
6
-import {useThrottleFn} from "@vueuse/core";
7
-import {throttle} from "~/utils/throttle";
5
+import { debounce } from "lodash-es";
6
+import { useThrottleFn } from "@vueuse/core";
7
+import { throttle } from "~/utils/throttle";
8 8
 
9 9
 const props = defineProps({
10 10
   list: {
@@ -18,45 +18,22 @@ const props = defineProps({
18 18
 
19 19
 function handleClickItem(item) {
20 20
   // console.log(item)
21
-  if (item.type === 5 || item.type === '5') {
22
-  // _.debounce(() => {
23
-  // debounce(() => {
24
-  // return useThrottleFn(() => {
25
-  //   uni.navigateTo({
26
-  //     url: `/pages/store/product/detail?id=${item.product_id}`
27
-  //   })
28
-  // }, 100)
29
-  //   throttle()
21
+  uni.navigateTo({
22
+    url: `/pages/store/product/detail?id=${item.product_id}`
23
+  })
30 24
 
31
-    uni.navigateTo({
32
-      url: `/pages/store/product/detail?id=${item.product_id}`
33
-    })
34
-    // throttle(() => {
35
-    //   uni.navigateTo({
36
-    //     url: `/pages/store/product/detail?id=${item.product_id}`
37
-    //   })
38
-    // })
39
-  // }, 200)
40
-
41
-  // })
42
-
43
-  }
44
-  // uni.navigateTo({
45
-  // })
46 25
 }
47 26
 </script>
48 27
 <template>
49 28
   <!--  <scroll-view type="custom">-->
50
-  <div  class="px-3" v-if="list && list.length > 0">
51
-    <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
52
-      <div v-for="(item, index) in list"
53
-           :key="index"
54
-      >
55
-        <ProductCard  :item="item" @click:item="handleClickItem"/>
29
+  <div class="px-3" v-if="list && list.length > 0">
30
+    <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
31
+      <div v-for="(item, index) in list" :key="index">
32
+        <ProductCard :item="item" @click:item="handleClickItem" />
56 33
       </div>
57 34
     </grid-view>
58 35
 
59 36
   </div>
60
-  <CXBEmpty v-else/>
37
+  <CXBEmpty v-else />
61 38
   <!--  </scroll-view>-->
62 39
 </template>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/pages.json


+ 1 - 1
src/pages/accumulate-income/index.vue

@@ -68,7 +68,7 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
68 68
   getUserInviteProfitList({
69 69
     ...params
70 70
   }).then(res => {
71
-    accumulateIncome.value = res
71
+	      accumulateIncome.value = res
72 72
     if (action === 'page') {
73 73
       state.list = state.list.concat(res.pageInfo.list)
74 74
     }

+ 4 - 4
src/pages/annuity/index.vue

@@ -185,7 +185,7 @@ const ImgType = computed(() => {
185 185
         <div class="flex items-center w-full gap-2">
186 186
           <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar" mode="widthFix"
187 187
             class="w-9 h-9 rounded-full" />
188
-          <image v-else src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix" class="w-9 h-9 rounded-full" />
188
+          <image v-else src="https://app.bjtdba.com/uploads/logo.jpg" style="width:74rpx; height:74rpx;"  class=" rounded-full" />
189 189
           <div>
190 190
             {{ userStore.userInfo.nickname }}
191 191
           </div>
@@ -197,20 +197,20 @@ const ImgType = computed(() => {
197 197
         <div class="flex-1 flex flex-col justify-between items-center py-4 gap-4">
198 198
           <div class="flex flex-col justify-center items-center">
199 199
             <div class="text-xs">总养老金</div>
200
-            <div class="text-[#F94032] font-bold text-[28px]" v-if="yanglaoStatistics">¥{{ yanglaoStatistics.all_yanglao
200
+            <div class="text-[#F94032] font-bold text-[28px]" v-if="yanglaoStatistics">¥{{parseFloat(Number( yanglaoStatistics.all_yanglao)).toFixed(2).replace(/\.?0+$/, '')
201 201
             }}
202 202
             </div>
203 203
           </div>
204 204
           <div class=" flex justify-around w-full">
205 205
             <div class="flex flex-col justify-center items-center " v-if="yanglaoStatistics">
206 206
               <div class="font-bold">
207
-                ¥ {{ (yanglaoStatistics.all_yanglao - yanglaoStatistics.all_yanglao_a).toFixed(2) }}
207
+                ¥ {{ parseFloat(Number(yanglaoStatistics.all_yanglao - yanglaoStatistics.all_yanglao_a)).toFixed(2).replace(/\.?0+$/, '') }}
208 208
               </div>
209 209
               <div class="text-xs text-gray-400">预估养老金</div>
210 210
             </div>
211 211
 
212 212
             <div class="flex flex-col justify-center items-center pl-3" v-if="yanglaoStatistics">
213
-              <div>¥ {{ (yanglaoStatistics.all_yanglao_a).toFixed(2) }}</div>
213
+              <div>¥ {{parseFloat(Number(yanglaoStatistics.all_yanglao_a)).toFixed(2).replace(/\.?0+$/, '') }}</div>
214 214
               <div class="text-xs text-gray-400">已结算</div>
215 215
             </div>
216 216
             <div @tap="handleToCitic" class="flex flex-col justify-center items-center pl-3">

+ 2 - 1
src/pages/home/components/announcement.vue

@@ -15,7 +15,8 @@ function go(item) {
15 15
   const data = findLast(props.list, (val: any) => {
16 16
     return item === val.title
17 17
   })
18
-
18
+  console.log(data);
19
+  
19 20
   uni.navigateTo({
20 21
     url: `/pages/announcement/index?data=${encodeBase64(data)}`
21 22
   })

+ 3 - 2
src/pages/home/components/banner.vue

@@ -1,5 +1,5 @@
1 1
 <script lang="ts" setup>
2
-import {CDN_URL} from "~/config/app";
2
+import {CDM_URL, CDN_URL} from "~/config/app";
3 3
 const userStore = useUserStore()
4 4
 
5 5
 function handleGuestMemberNew() {
@@ -14,7 +14,8 @@ function handleGuestMemberNew() {
14 14
     })
15 15
   }
16 16
 }
17
-const image = CDN_URL + '/static/assets/chuxubao_huiyuan_220818.png'
17
+//https://cdn.bjtdba.com/vod/image/2023-12-08/20231208174609605.png
18
+const image = CDM_URL + '/image/2023-12-08/20231208174609605.png'
18 19
 </script>
19 20
 <template>
20 21
   <div class="px-3">

+ 1 - 1
src/pages/home/components/header.vue

@@ -77,7 +77,7 @@ function handleClickser() {
77 77
     <div class="flex">
78 78
       <div @click="handleClick" class="flex gap-2 mb-2 pl-2 flex-1">
79 79
         <image v-if="userStore && userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
80
-          mode="widthFix" class="w-9 h-9 rounded-full" />
80
+          style="width:74rpx; height:74rpx;" class="rounded-full" />
81 81
         <image v-else src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix" class="w-9 h-9 rounded-full" />
82 82
         <div class="flex flex-col ">
83 83
           <div class="text-sm" v-if="userStore.userInfo && userStore.userInfo.nickname">{{ userStore.userInfo.nickname ?

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

@@ -75,7 +75,7 @@ const navList = ref([{
75 75
 
76 76
 onBeforeMount(() => {
77 77
   getHomeQuickLink().then(res => {
78
-    console.log('res>>>>>', res);
78
+    // console.log('res>>>>>', res);
79 79
 
80 80
     if (res) {
81 81
       navList.value[12] = res[0]
@@ -109,7 +109,7 @@ function handleItemClick(item: any) {
109 109
     // 秒杀
110 110
     case 'miaosha': {
111 111
       uni.navigateTo({
112
-        url: '/pages/miaosha/index'
112
+        url: '/pages/miaosha/index?type_show=1'
113 113
       })
114 114
       break;
115 115
     }

+ 355 - 70
src/pages/home/index.vue

@@ -1,34 +1,60 @@
1 1
 <script lang="ts" setup>
2
-import {getNewSignInInfo, getUserInfo, getYanglaojinStatistics} from "~/apis/user";
3
-import {getProduct} from "~/apis/home";
2
+import { getNewSignInInfo, getUserInfo, getYanglaojinStatistics } from "~/apis/user";
3
+import { getProduct } from "~/apis/home";
4 4
 
5 5
 import Navs from "~/pages/home/components/navs.vue";
6 6
 import Announcement from "~/pages/home/components/announcement.vue";
7 7
 import Banner from "~/pages/home/components/banner.vue";
8 8
 import Header from "~/pages/home/components/header.vue";
9 9
 import ProductList from "~/pages/home/components/product-list.vue";
10
-import {getHomeBanner, getHomeQuickLink, getLocal, getNoticeList, getProductShare} from "~/apis/common";
11
-import {useUserStore} from "~/stores/userStore";
10
+import { getHomeBanner, getHomeQuickLink, getLocal, getNoticeList, getProductShare } from "~/apis/common";
11
+import { useUserStore } from "~/stores/userStore";
12 12
 import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
13 13
 import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
14
-import {CDN_URL} from "~/config/app";
14
+import { CDM_URL, CDN_URL } from "~/config/app";
15 15
 import CXBPrivacyPopup from "~/components/CXBPrivacyPopup/CXBPrivacyPopup.vue";
16
-import {getShareId} from "~/apis/product";
16
+import { getShareId } from "~/apis/product";
17 17
 // import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
18 18
 // import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
19 19
 import Cache from "~/utils/cache";
20 20
 
21 21
 import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
22
+import { getDcSeckill } from "~/apis/dacang";
22 23
 const userStore = useUserStore()
23 24
 const usePageStore = usePageStoreWidthOut()
24 25
 usePageStore.setPageConfig({
25 26
   currentPage: {
26 27
     type: 'tab',
27
-    url:  '/pages/home/index'
28
+    url: '/pages/home/index'
28 29
   }
29 30
 })
30 31
 
32
+// 限时秒杀  https://cdn.bjtdba.com/vod/image/2023-12-08/20231208174028968.png
33
+// 秒杀背景  https://cdn.bjtdba.com/vod/image/2023-12-08/20231208174007505.png
34
+// 秒杀价格  https://cdn.bjtdba.com/vod/image/2023-12-08/20231208173948533.png
31 35
 
36
+
37
+const msbkImg = CDM_URL + '/image/2023-12-08/20231208174007505.png'
38
+const xsmsImg = CDM_URL + '/image/2023-12-08/20231208174028968.png'
39
+const mspcImg = CDM_URL + '/image/2023-12-08/20231208173948533.png'
40
+
41
+
42
+
43
+const msData = reactive({
44
+  currentPage: 1,
45
+  pageSize: 10,
46
+  list: [],
47
+  duration: 60 * 60 * 1000, //秒杀活动时长
48
+})
49
+
50
+const remainingTime: any = ref({
51
+  hours: "00",
52
+  minutes: "00",
53
+  seconds: "00"
54
+})
55
+const msProductList = ref([])
56
+const msSeckillDate = ref('')
57
+const msStatus = ref('')
32 58
 // const list = ref([])
33 59
 const state = reactive({
34 60
   shareId: '',
@@ -61,7 +87,7 @@ onShow(() => {
61 87
   usePageStore.setPageConfig({
62 88
     currentPage: {
63 89
       type: 'tab',
64
-      url:  '/pages/home/index'
90
+      url: '/pages/home/index'
65 91
     }
66 92
   })
67 93
   if (!userStore.uid) {
@@ -74,6 +100,8 @@ onShow(() => {
74 100
     getYanglaojinStatistics().then(res => {
75 101
       state.all_yanglao = res.all_yanglao
76 102
     })
103
+    //加载秒杀数据
104
+    loadList('reload')
77 105
   }
78 106
 
79 107
 
@@ -81,22 +109,22 @@ onShow(() => {
81 109
 
82 110
 function checkSignIn() {
83 111
   // if (userStore.uid && state.isEject === 1) {
84
-    // 2 检查用户签到信息
85
-    getNewSignInInfo().then(res => {
86
-      // console.log(res)
87
-      const {today, day} = res
88
-      state.signToday = today
89
-      if (today === 0) {
90
-        state.isShowSignIn = true
91
-      }
92
-      state.day = day
112
+  // 2 检查用户签到信息
113
+  getNewSignInInfo().then(res => {
114
+    // console.log(res)
115
+    const { today, day } = res
116
+    state.signToday = today
117
+    if (today === 0) {
118
+      state.isShowSignIn = true
119
+    }
120
+    state.day = day
93 121
 
94
-      // // if (today === 0) {
95
-      //   2.1 弹出签到窗口
96
-      // }
97
-    }).catch(error => {
98
-      console.error(error + '->GetNewsSignInInfo')
99
-    })
122
+    // // if (today === 0) {
123
+    //   2.1 弹出签到窗口
124
+    // }
125
+  }).catch(error => {
126
+    console.error(error + '->GetNewsSignInInfo')
127
+  })
100 128
   // }
101 129
 }
102 130
 onLoad((option) => {
@@ -112,14 +140,10 @@ onLoad((option) => {
112 140
   // 加载地址数据
113 141
   // orderStore.getCurrentAddress()
114 142
   // 1加载首页数据
115
-  getHomeQuickLink().then(res => {})
116
-
117
-  getNoticeList().then(res => {
118
-    state.announcementList = res.list
119
-  })
143
+  getHomeQuickLink().then(res => { })
120 144
   state.page = 1
121 145
   loadProductList()
122
-
146
+  loadList('reload')
123 147
   getProductShare().then(res => {
124 148
     if (res) {
125 149
       userStore.setShareId(res.share_id)
@@ -153,9 +177,102 @@ onShareTimeline(() => {
153 177
 })
154 178
 
155 179
 
156
-// onShow(() => {
157
-//
158
-// })
180
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
181
+  if (action === 'reload') {
182
+    msData.currentPage = 1
183
+  }
184
+  const params = {
185
+    page: msData.currentPage,
186
+    limit: msData.pageSize
187
+  }
188
+
189
+  getDcSeckill({
190
+    ...params
191
+  }).then(res => {
192
+    console.log('秒杀', res);
193
+    // status 1 开始抢 2 即将开始 3 已结束
194
+    let status2FilterList = res.filter((val) => {
195
+      return val.status == 2
196
+    })
197
+    let status1FilterList = res.filter((val) => {
198
+      return val.status == 1
199
+    })
200
+    // console.log('秒杀', ...res);
201
+    if (status2FilterList.length > 0) {
202
+      msData.list.push(...status2FilterList)
203
+    }
204
+    if (status1FilterList.length > 0) {
205
+      msData.list.unshift(...status1FilterList)
206
+    }
207
+    if (msData.list.length > 0) {
208
+      msProductList.value = msData.list[0].product_data
209
+      msSeckillDate.value = msData.list[0].seckill_date.slice(0, 5);
210
+      msStatus.value = msData.list[0].status
211
+      // console.log(11221111, msProductList.value);
212
+      // console.log(11221111, msSeckillDate.value);
213
+    }
214
+  })
215
+}
216
+
217
+//计算秒杀
218
+function getCountdown() {
219
+  const now = new Date();
220
+  const startDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), parseHours(msSeckillDate.value), 0, 0);
221
+  // const startDate = new Date('2023-12-26 10:55:00');
222
+  const endDate = new Date(startDate.getTime() + 60 * 60 * 1000); // 结束时间为开始时间的一小时后
223
+
224
+  if (now > startDate && now < endDate) {
225
+    let milliseconds = endDate - now;
226
+
227
+    const hours = Math.floor(milliseconds / (1000 * 60 * 60));
228
+    const minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60));
229
+    const seconds = Math.floor((milliseconds % (1000 * 60)) / 1000);
230
+
231
+    // 更新数据
232
+    remainingTime.value = {
233
+      hours: hours < 10 ? '0' + hours : hours,
234
+      minutes: minutes < 10 ? '0' + minutes : minutes,
235
+      seconds: seconds < 10 ? '0' + seconds : seconds
236
+    }
237
+  } else if (now >= endDate) {
238
+    clearInterval(timer);
239
+    //加载秒杀数据
240
+    console.log('时间到,自动关闭');
241
+    // loadList('reload')
242
+    uni.reLaunch({
243
+      url: '/pages/home/index'
244
+    })
245
+  } else if (now < startDate) {
246
+    console.log(111);
247
+
248
+  } else if (now == startDate) {
249
+    clearInterval(timer);
250
+    //加载秒杀数据
251
+    console.log('时间到,自动关闭');
252
+    // loadList('reload')
253
+    uni.reLaunch({
254
+      url: '/pages/home/index'
255
+    })
256
+  }
257
+}
258
+
259
+function parseHours(time: any) {
260
+  const [hours, minutes] = time.split(":");
261
+  return parseInt(hours);
262
+}
263
+
264
+// 每秒更新剩余时间
265
+const timer = setInterval(() => {
266
+  getCountdown()
267
+}, 1000);
268
+
269
+onUnload(() => {
270
+  clearInterval(timer);
271
+  console.log('卸载关闭');
272
+})
273
+
274
+
275
+
159 276
 watch(() => state.isShowSignIn, (val) => {
160 277
   val ? uni.hideTabBar() : uni.showTabBar()
161 278
 })
@@ -165,7 +282,7 @@ onPageScroll((page) => {
165 282
   // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
166 283
   Scroll_X.value = Number(page.scrollTop.toFixed())
167 284
   // page.scrollTop
168
-  if (page.scrollTop >= 76 ) {
285
+  if (page.scrollTop >= 76) {
169 286
     headerClass.value = 'bg-white !text-gray-900'
170 287
   } else {
171 288
     headerClass.value = ''
@@ -175,6 +292,7 @@ onPageScroll((page) => {
175 292
 onPullDownRefresh(() => {
176 293
   state.page = 1
177 294
   loadProductList()
295
+  loadList('reload')
178 296
 })
179 297
 
180 298
 onReachBottom(() => {
@@ -206,18 +324,18 @@ function loadProductList() {
206 324
 const homeBanner = CDN_URL + '/static/assets/home-banner.png'
207 325
 
208 326
 function handleBannerClick(item) {
209
-  if(item.url == 'rich') {
327
+  if (item.url == 'rich') {
210 328
     uni.navigateTo({
211 329
       url: '/pages/vip/index?type=user'
212 330
     })
213 331
   }
214 332
 }
215 333
 
216
-function getIsShow(){
334
+function getIsShow() {
217 335
   //首先获取是否执行过
218 336
   uni.getStorage({
219 337
     key: 'today',
220
-    success: function(res) {
338
+    success: function (res) {
221 339
       // console.log(res.data)
222 340
       // console.log('----')
223 341
       //成功的话 说明之前执行过,再判断时间是否是当天
@@ -229,7 +347,7 @@ function getIsShow(){
229 347
         uni.setStorageSync("today", new Date().toLocaleDateString()); //把新得日期更新到本地
230 348
       }
231 349
     },
232
-    fail: function(res) {
350
+    fail: function (res) {
233 351
       // console.log(res + 'FAIL...')
234 352
       //没有执行过的话 先存一下当前的执行时间
235 353
       // console.log(res);
@@ -244,65 +362,232 @@ function getIsShow(){
244 362
 
245 363
 }
246 364
 
365
+function Tomsindex() {
366
+  uni.navigateTo({
367
+    url: '/pages/miaosha/index?type_show=2'
368
+  })
369
+  // uni.navigateTo({
370
+  //   url: `/pages/user/login/invite-login`
371
+  // })
372
+}
247 373
 
374
+//秒杀跳转详情页
375
+function handleToDeatil(product_id: any) {
376
+  uni.navigateTo({
377
+    url: `/pages/store/product/detail?id=${product_id}`
378
+  })
379
+}
248 380
 
249 381
 </script>
250 382
 <template>
251 383
   <div class="h-screen ">
252 384
     <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
253
-    <Header :yanglaojin="state.all_yanglao"
254
-            :exClass="headerClass"
255
-    />
385
+    <Header :yanglaojin="state.all_yanglao" :exClass="headerClass" />
256 386
     <div class="flex flex-col gap-3 ">
257
-<!--      <image-->
258
-<!--          @click="handleBannerClick"-->
259
-<!--          :src="homeBanner"-->
260
-<!--             mode="widthFix" class="h-60 w-full "-->
261
-<!--      ></image>-->
387
+      <!--      <image-->
388
+      <!--          @click="handleBannerClick"-->
389
+      <!--          :src="homeBanner"-->
390
+      <!--             mode="widthFix" class="h-60 w-full "-->
391
+      <!--      ></image>-->
262 392
 
263 393
       <div class="w-screen h-65">
264
-        <swiper
265
-            v-if="state.banners"
266
-            :indicator-dots="state.indicatorDots"
267
-            indicator-active-color="#e93323"
268
-            :autoplay="state.autoplay"
269
-            :circular="state.circular"
270
-            :interval="state.interval"
271
-            :duration="state.duration"
272
-            class="w-full h-full"
273
-        >
394
+        <swiper v-if="state.banners" :indicator-dots="state.indicatorDots" indicator-active-color="#e93323"
395
+          :autoplay="state.autoplay" :circular="state.circular" :interval="state.interval" :duration="state.duration"
396
+          class="w-full h-full">
274 397
           <swiper-item v-for="(item, index) in state.banners" :key="index">
275
-            <image :src="item.pic" @tap="handleBannerClick(item)" class="!w-full !h-full" mode="aspectFill"/>
398
+            <image :src="item.pic" @tap="handleBannerClick(item)" class="!w-full !h-full" mode="aspectFill" />
276 399
           </swiper-item>
277 400
         </swiper>
278 401
       </div>
402
+      <Navs />
403
+      <div class="px-3 relative " style="width: 700rpx; height: 458rpx;" v-if="msProductList.length > 0">
404
+        <!-- 秒杀大图 -->
405
+        <image lazy-load style="width: 100%;height: 100%; " :src="msbkImg"></image>
406
+        <!-- 限时秒杀 -->
407
+        <image lazy-load class="xsmsimg" style="width: 185rpx;height: 41rpx; " :src="xsmsImg"></image>
408
+        <!-- scroll 秒杀list -->
409
+        <scroll-view class="scroll-view_H" :scroll-x="true">
410
+          <div v-for="(item, index) in msProductList" :key="index" style="background-color: #FFFFFF; position: relative; "
411
+            class="scroll-view-item_H">
412
+            <!-- img  -->
413
+            <div @click="handleToDeatil(item.product_id)">
414
+              <div class="scroll-view-item_O">
415
+                <div style="width: 202rpx; height: 202rpx; margin-bottom: 23rpx; border-radius: 16rpx; ">
416
+                  <image :src="item.image" style="border-radius: 16rpx; width: 100%; height: 100%; "></image>
417
+                </div>
418
+                <div class="px-1">
419
+                  <div class="text_image_d mt-1 ">
420
+                    {{ item.store_name }}
421
+                  </div>
422
+                  <div
423
+                    class="mt-1 border border-solid border-1 border-red rounded flex  items-center text-[#FE0032] w-fit">
424
+                    <image src="https://cdn.bjtdba.com/vod/image/2023-12-11/20231211115513936.png" mode="widthFix"
425
+                      style="width: 46rpx; height: 28rpx;"></image>
426
+                    <div class="ylj_d flex items-center jusitify-center">
427
+                      <div>
428
+                        养老金 ¥{{ item.yanglao }}
429
+                      </div>
430
+                    </div>
431
+                  </div>
432
+                </div>
433
+
434
+              </div>
435
+              <!-- 价格 -->
436
+              <div class="jg_img" :style="{ background: 'url(' + mspcImg + ')', backgroundSize: 'cover' }">
437
+                <div class="jg_price">¥{{ item.seckill_price }}</div>
438
+              </div>
439
+            </div>
440
+
441
+          </div>
442
+
443
+        </scroll-view>
444
+        <!-- 倒计时 -->
445
+        <div class="ms_time" v-if="msStatus == '1'">
446
+          <span class="ms_span">{{ remainingTime.hours }}</span> :
447
+          <span class="ms_span">{{ remainingTime.minutes }}</span> :
448
+          <span class="ms_span">{{ remainingTime.seconds }}</span>
449
+        </div>
450
+        <div class="ckgdtext" @click="Tomsindex">
451
+          查看更多
452
+          <span>
453
+            <image style="width: 10rpx; height: 17rpx; " src="../../static/icon/ckgd.png"></image>
454
+          </span>
455
+        </div>
279 456
 
280
-      <Navs/>
281 457
 
282
-      <Announcement :list="state.announcementList"/>
283
-<!--      {{userStore.userInfo}}-->
284 458
 
285
-      <Banner/>
459
+      </div>
460
+      <!-- <Announcement :list="state.announcementList" /> -->
461
+      <!--      {{userStore.userInfo}}-->
286 462
 
287
-      <ProductList :list="state.productList"/>
463
+      <Banner />
464
+
465
+      <ProductList :list="state.productList" />
288 466
     </div>
289 467
 
290 468
   </div>
291
-  <CXBDialogSIgnIn
292
-      :show="state.isShowSignIn"
293
-      :today="state.signToday"
294
-      :day="state.day"
295
-
296
-      @confirm="state.isShowSignIn = false"
297
-      @close="state.isShowSignIn = false"
298
-  />
469
+  <CXBDialogSIgnIn :show="state.isShowSignIn" :today="state.signToday" :day="state.day"
470
+    @confirm="state.isShowSignIn = false" @close="state.isShowSignIn = false" />
299 471
 
300 472
   <CXBPrivacyPopup />
301 473
 </template>
302
-<style>
474
+<style  >
303 475
 page {
304 476
   background-color: #f8f8f8;
305 477
 }
478
+
479
+.xsmsimg {
480
+  position: absolute;
481
+  top: 27rpx;
482
+  left: 56rpx;
483
+  z-index: 2;
484
+}
485
+
486
+
487
+
488
+.scroll-view_H {
489
+  white-space: nowrap;
490
+  width: 700rpx;
491
+  overflow: hidden;
492
+  position: absolute;
493
+  top: 96rpx;
494
+  left: 24rpx;
495
+  z-index: 1;
496
+}
497
+
498
+
499
+.ckgdtext {
500
+  position: absolute;
501
+  top: 28rpx;
502
+  left: 588rpx;
503
+  color: #FFFFFF;
504
+  height: 40rpx;
505
+  font-size: 22rpx;
506
+  font-family: PingFangSC, PingFang SC;
507
+  font-weight: 400;
508
+  line-height: 40rpx
509
+}
510
+
511
+.jg_img {
512
+  position: absolute;
513
+  bottom: 0;
514
+  left: 50%;
515
+  margin-left: -65rpx;
516
+  z-index: 2;
517
+  min-width: 129rpx;
518
+  height: 38rpx;
519
+}
520
+
521
+.jg_price {
522
+  height: 38rpx;
523
+  line-height: 38rpx;
524
+  margin-left: 42rpx;
525
+  font-size: 20rpx;
526
+  font-family: PingFangSC, PingFang SC;
527
+  font-weight: 500;
528
+  color: #FFFFFF;
529
+}
530
+
531
+.scroll-view-item_H {
532
+  margin-top: 5rpx;
533
+  display: inline-block;
534
+  font-size: 36rpx;
535
+  width: 202rpx;
536
+  height: 342rpx;
537
+  margin-left: 24rpx;
538
+}
539
+
540
+.ms_time {
541
+  position: absolute;
542
+  top: 20rpx;
543
+  left: 260rpx
544
+}
545
+
546
+.ms_span {
547
+  display: inline-block;
548
+  height: 36rpx;
549
+  width: 36rpx;
550
+  text-align: center;
551
+  border-radius: 8rpx;
552
+  font-size: 20rpx;
553
+  line-height: 36rpx;
554
+  background: #333333;
555
+  color: white
556
+}
557
+
558
+.text_image_d {
559
+  height: 33rpx;
560
+  font-size: 24rpx;
561
+  font-family: PingFangSC, PingFang SC;
562
+  font-weight: 400;
563
+  color: #333333;
564
+  line-height: 33rpx;
565
+  white-space: nowrap;
566
+  /* 防止文本换行 */
567
+  overflow: hidden;
568
+  /* 隐藏超出的部分 */
569
+  text-overflow: ellipsis;
570
+  /* 显示省略号 */
571
+}
572
+
573
+.ylj_d {
574
+  height: 25rpx;
575
+  font-size: 18rpx;
576
+  font-family: PingFangSC, PingFang SC;
577
+  font-weight: 400;
578
+  color: #FE0032;
579
+  line-height: 25rpx;
580
+  padding-left: 6rpx;
581
+  padding-right: 6rpx;
582
+}
583
+
584
+.scroll-view-item_O {
585
+  height: 323rpx;
586
+  width: 100%;
587
+  border: 1rpx soild;
588
+  border-radius: 16rpx;
589
+  box-shadow: 2rpx 2rpx 12rpx 2rpx #FFC8CE;
590
+}
306 591
 </style>
307 592
 <route lang="yaml"   type="home">
308 593
 style:

+ 240 - 35
src/pages/immediate-withdrawal/index.vue

@@ -1,5 +1,6 @@
1 1
 <script setup lang="ts">
2 2
 import {
3
+  getApplicationredWithdrawal,
3 4
   getApplicationWithdrawal,
4 5
   getBandAccountInfo,
5 6
   getUserSpreadInfo,
@@ -25,10 +26,20 @@ const yanglaojin = ref<UserYanglaoJinModel>()
25 26
 const widthdrawalConfig = ref({})
26 27
 
27 28
 const cashWithdrawalAmount = ref()
28
-
29
+const isshow = ref(0)
29 30
 const isDisabled = ref(true)
30 31
 const userBrokeragePrice = ref(0)
32
+const member_brokerage_price = ref(0)
31 33
 // userSpreadInfo.value.brokerage_price
34
+onLoad((options) => {
35
+  if (options && options.type) {
36
+    if (options.type == 1) {
37
+      isshow.value = 1
38
+    } else if (options.type == 2) {
39
+      isshow.value = 2
40
+    }
41
+  }
42
+})
32 43
 onShow(async () => {
33 44
   cashWithdrawalAmount.value = null
34 45
   getBandAccountInfo({ type: '1' }).then(res => {
@@ -72,6 +83,7 @@ onShow(async () => {
72 83
   await userStore.getUserInfo()
73 84
   // 佣金信息
74 85
   userSpreadInfo.value = await getUserSpreadInfo()
86
+  console.log(99999, userSpreadInfo.value);
75 87
 
76 88
   yanglaojin.value = await getUserYangLaoJin()
77 89
 
@@ -81,15 +93,29 @@ onShow(async () => {
81 93
   console.log(widthdrawalConfig.value)
82 94
   userBrokeragePrice.value = userSpreadInfo.value?.brokerage_price ? parseFloat(userSpreadInfo.value?.brokerage_price) : 0
83 95
   console.log(userBrokeragePrice.value)
96
+  member_brokerage_price.value = userSpreadInfo.value?.member_brokerage_price ? parseFloat(userSpreadInfo.value?.member_brokerage_price) : 0
97
+  console.log(member_brokerage_price.value)
84 98
   // if (userSpreadInfo.value?.brokerage_price) {
85
-  if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
86
-    isDisabled.value = true
87
-    return uni.showToast({
88
-      title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
89
-      icon: 'none'
90
-    })
99
+  if (isshow.value == 1) {
100
+    if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
101
+      isDisabled.value = true
102
+      return uni.showToast({
103
+        title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
104
+        icon: 'none'
105
+      })
106
+    }
107
+  } else if (isshow.value == 2) {
108
+
109
+    if (member_brokerage_price.value < widthdrawalConfig.value.withdrawal_money) {
110
+      isDisabled.value = true
111
+      return uni.showToast({
112
+        title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
113
+        icon: 'none'
114
+      })
115
+    }
91 116
   }
92 117
 
118
+
93 119
   // }
94 120
 })
95 121
 
@@ -113,24 +139,27 @@ function Tochecked() {
113 139
   if (iswxshow.value == true) {
114 140
     Accountbind({ openid: userStore.openid, wx_type: '1' }).then(resg => {
115 141
       console.log('我是resg', resg);
142
+      setTimeout(() => {
143
+        uni.showToast({
144
+          title: '绑定成功',
145
+          icon: 'none'
146
+        })
147
+      }, 300)
116 148
 
117
-      uni.showToast({
118
-        title: '绑定成功',
119
-        icon: 'none'
120
-      })
121 149
       iswxshow.value = true
122 150
     }).catch((error) => {
123
-      uni.showToast({
124
-        title: error,
125
-        icon: 'none'
126
-      })
127
-      if(error=='此微信已绑定其他账户'){
128
-        iswxshow.value=false
129
-      }
151
+      setTimeout(() => {
152
+        uni.showToast({
153
+          title: error,
154
+          icon: 'none'
155
+        })
156
+      }, 300)
157
+
158
+      iswxshow.value = false
130 159
     })
131
-  }else{
160
+  } else {
132 161
     console.log(111);
133
-    
162
+
134 163
   }
135 164
 }
136 165
 
@@ -140,21 +169,33 @@ function Tochecked() {
140 169
 
141 170
 function handleInputAll() {
142 171
   // console.log(userSpreadInfo.value?.brokerage_price)
143
-  if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && userSpreadInfo.value?.brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
144
-    cashWithdrawalAmount.value = userSpreadInfo.value.brokerage_price
145
-  } else {
146
-    uni.showToast({
147
-      title: '可用余额太少,未满足提现要求',
148
-      icon: 'none'
149
-    })
172
+  if (isshow.value == 1) {
173
+    if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && userSpreadInfo.value?.brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
174
+      cashWithdrawalAmount.value = userSpreadInfo.value.brokerage_price
175
+    } else {
176
+      uni.showToast({
177
+        title: '可用余额太少,未满足提现要求',
178
+        icon: 'none'
179
+      })
180
+    }
181
+  } else if (isshow.value == 2) {
182
+    if (userSpreadInfo.value && userSpreadInfo.value.member_brokerage_price && userSpreadInfo.value?.member_brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
183
+      cashWithdrawalAmount.value = userSpreadInfo.value.member_brokerage_price
184
+    } else {
185
+      uni.showToast({
186
+        title: '可用余额太少,未满足提现要求',
187
+        icon: 'none'
188
+      })
189
+    }
150 190
   }
191
+
151 192
 }
152 193
 
153 194
 /**
154 195
  * 立即提现
155 196
  */
156 197
 function handleImmediateWithdrawal() {
157
-  
198
+
158 199
   if (isDisabled.value) {
159 200
     return
160 201
   }
@@ -213,7 +254,7 @@ function handleImmediateWithdrawal() {
213 254
     })
214 255
   }
215 256
 
216
-  if(iswxshow.value==false){
257
+  if (iswxshow.value == false) {
217 258
     uni.showToast({
218 259
       title: '请先勾选提现方式',
219 260
       icon: 'none'
@@ -243,6 +284,99 @@ function handleImmediateWithdrawal() {
243 284
   // if (yanglaojin.value) {
244 285
   // }
245 286
 }
287
+/**
288
+ * 立即提现
289
+ */
290
+function handleImmediateredWithdrawal() {
291
+
292
+  if (isDisabled.value) {
293
+    return
294
+  }
295
+  if (widthdrawalConfig.value.withdrawal_status == '0') {
296
+    isDisabled.value = true
297
+    return uni.showToast({
298
+      title: '提现功能关闭',
299
+      icon: 'none'
300
+    })
301
+  }
302
+  if (widthdrawalConfig.value.withdrawal_wchat == '0') {
303
+    isDisabled.value = true
304
+
305
+    return uni.showToast({
306
+      title: '微信提现功能关闭',
307
+      icon: 'none'
308
+    })
309
+  }
310
+
311
+  // 1.用户可提现余额≤最低提现额
312
+  if (member_brokerage_price.value < widthdrawalConfig.value.withdrawal_money) {
313
+    return uni.showToast({
314
+      title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
315
+      icon: 'none'
316
+    })
317
+  }
318
+
319
+  // 2 当输入金额≤可提现余额<最低提现额度
320
+  if (Number.parseFloat(cashWithdrawalAmount.value) <= Number.parseFloat(member_brokerage_price.value) && Number.parseFloat(cashWithdrawalAmount.value) < widthdrawalConfig.value.withdrawal_money) {
321
+    // 1 判断是否需要实名
322
+    if (!yanglaojin.value?.is_certification == 1) {
323
+      return uni.navigateTo({
324
+        url: '/pages/real-name-authentication/index'
325
+      })
326
+    }
327
+
328
+    return uni.showToast({
329
+      title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
330
+      icon: 'none'
331
+    })
332
+  }
333
+
334
+  // 当输入金额>可提现余额且输入金额≥最低提现额度
335
+  if ((Number.parseFloat(cashWithdrawalAmount.value) > Number.parseFloat(member_brokerage_price.value)) && (Number.parseFloat(cashWithdrawalAmount.value) >= widthdrawalConfig.value.withdrawal_money)) {
336
+    // 1 判断是否需要实名
337
+    if (!yanglaojin.value?.is_certification == 1) {
338
+      return uni.navigateTo({
339
+        url: '/pages/real-name-authentication/index'
340
+      })
341
+    }
342
+
343
+
344
+    return uni.showToast({
345
+      title: '输入金额超过可提现余额',
346
+      icon: 'none'
347
+    })
348
+  }
349
+
350
+  if (iswxshow.value == false) {
351
+    uni.showToast({
352
+      title: '请先勾选提现方式',
353
+      icon: 'none'
354
+    })
355
+    return
356
+  }
357
+
358
+  getApplicationredWithdrawal({ extract_price: cashWithdrawalAmount.value, extract_type: "1", type: 2 }).then(res => {
359
+
360
+    uni.showToast({
361
+      title: '提现已申请',
362
+      icon: 'none'
363
+    })
364
+    setTimeout(() => {
365
+      uni.navigateTo({
366
+        url: '/pages/withdrawal-record/index'
367
+      })
368
+    }, 300)
369
+  }).catch(error => {
370
+    uni.showToast({
371
+      title: error,
372
+      icon: 'none'
373
+    })
374
+  })
375
+
376
+
377
+  // if (yanglaojin.value) {
378
+  // }
379
+}
246 380
 
247 381
 function handleWithdrawalRecord() {
248 382
   uni.navigateTo({
@@ -257,7 +391,8 @@ function handleShowAgreement(type) {
257 391
 }
258 392
 </script>
259 393
 <template>
260
-  <div class="p-3 flex flex-col gap-3">
394
+  <!-- 佣金提现 -->
395
+  <div class="p-3 flex flex-col gap-3" v-if="isshow == 1">
261 396
     <div class="flex justify-end">
262 397
       <div class=" text-sm" @tap="handleWithdrawalRecord">提现记录</div>
263 398
     </div>
@@ -294,8 +429,8 @@ function handleShowAgreement(type) {
294 429
             <div>微信</div>
295 430
           </div>
296 431
           <div>
297
-            <radio :checked="true" v-if="iswxshow==true" />
298
-            <radio :checked="false"  v-if="iswxshow==false" @click="Tochecked"  />
432
+            <radio :checked="true" v-if="iswxshow == true" />
433
+            <radio :checked="false" v-if="iswxshow == false" @click="Tochecked" />
299 434
           </div>
300 435
         </div>
301 436
 
@@ -321,9 +456,79 @@ function handleShowAgreement(type) {
321 456
 
322 457
       <div class="flex flex-col text-sm text-gray leading-8 py-4">
323 458
         <div>详细说明</div>
324
-        <div>平台服务费 {{ withdrawalCal.service }}</div>
325
-        <div>本次提取将扣除服务费 ¥{{ withdrawalCal.service_money }}</div>
326
-        <div>本次提取实际到账额度 ¥{{ withdrawalCal.money }}</div>
459
+        <div>平台服务费 {{ cashWithdrawalAmount ? withdrawalCal.service : '0' }}</div>
460
+        <div>本次提取将扣除服务费 ¥{{ cashWithdrawalAmount ? withdrawalCal.service_money : '0.00' }}</div>
461
+        <div>本次提取实际到账额度 ¥{{ cashWithdrawalAmount ? withdrawalCal.money : '0.00' }}</div>
462
+      </div>
463
+
464
+    </div>
465
+
466
+  </div>
467
+  <!-- 红积分提现 -->
468
+  <div class="p-3 flex flex-col gap-3" v-if="isshow == 2">
469
+    <div class="bg-white rounded-lg text-sm p-3 flex flex-col gap-4">
470
+      <div class="flex justify-between">
471
+        <div class="font-bold">提现金额</div>
472
+        <div class="text-xs text-gray" @click="handleShowAgreement(6)">提现规则</div>
473
+      </div>
474
+      <div class="flex justify-center items-center pt-4 f-hairline-bottom">
475
+        <div class="text-lg font-bold">¥</div>
476
+        <div class="flex-1">
477
+          <input placeholder="请输入金额" class="w-full" type="digit" v-model="cashWithdrawalAmount" />
478
+        </div>
479
+        <div class="text-xs text-red" @click="handleInputAll">全部提现</div>
480
+      </div>
481
+      <div class="flex text-gray items-center gap-3 text-sm">
482
+        <div v-if="userSpreadInfo">
483
+          可用余额¥:{{ userStore.userInfo.member_brokerage_price }}
484
+        </div>
485
+        <div v-if="userStore.userInfo">
486
+          可用红积分:{{ parseFloat(Number(userStore.userInfo.red)).toFixed(2).replace(/\.?0+$/, '') }}
487
+        </div>
488
+      </div>
489
+
490
+    </div>
491
+    <div class="bg-white rounded-lg text-sm p-3 flex flex-col">
492
+      <div class="flex f-hairline-bottom font-bold text-sm pb-2">
493
+        提现至
494
+      </div>
495
+      <div>
496
+        <div class="flex items-center justify-between py-3">
497
+          <div class="flex items-center gap-2">
498
+            <image :src="wx_logoImage" mode="widthFix" class="w-8 h-8"></image>
499
+            <div>微信</div>
500
+          </div>
501
+          <div>
502
+            <radio :checked="true" v-if="iswxshow == true" />
503
+            <radio :checked="false" v-if="iswxshow == false" @click="Tochecked" />
504
+          </div>
505
+        </div>
506
+
507
+        <!--        <div class="flex items-center justify-between py-3">-->
508
+        <!--          <div class="flex items-center gap-2">-->
509
+        <!--            <image :src="zfb_logoImage" mode="widthFix" class="w-8 h-8"></image>-->
510
+        <!--            <div>支付宝支付</div>-->
511
+        <!--            </div>-->
512
+        <!--            <div>-->
513
+        <!--              <radio />-->
514
+        <!--            </div>-->
515
+        <!--          </div>-->
516
+      </div>
517
+    </div>
518
+
519
+    <div class="flex flex-col">
520
+      <div class=" flex rounded-full bg-red-300">
521
+        <nut-button type="primary" block :disabled="isDisabled" :class="isDisabled && 'bg-gray-800'"
522
+          @tap="handleImmediateredWithdrawal">
523
+          立即提现
524
+        </nut-button>
525
+      </div>
526
+
527
+      <div class="flex flex-col text-sm text-gray leading-8 py-4">
528
+        <div>详细说明</div>
529
+        <div>平台服务费 {{ cashWithdrawalAmount ? withdrawalCal.service : '0' }}</div>
530
+        <div>本次提取将扣除服务费 ¥{{ cashWithdrawalAmount ? withdrawalCal.service_money : '0.00' }}</div>
531
+        <div>本次提取实际到账额度 ¥{{ cashWithdrawalAmount ? withdrawalCal.money : '0.00' }}</div>
327 532
       </div>
328 533
 
329 534
     </div>

+ 47 - 57
src/pages/invite-friends/index.vue

@@ -4,11 +4,11 @@ import {
4 4
   getUserSharePostersClassifyList,
5 5
   getUserSharePostersImagesList,
6 6
 } from "~/apis/user";
7
-import type {SharePosterImageResult, SharePostersClassify} from "~/apis/model/inviteFriendsModel";
7
+import type { SharePosterImageResult, SharePostersClassify } from "~/apis/model/inviteFriendsModel";
8 8
 import ProductCard from "~/components/ProductCard/ProductCard.vue";
9
-import {call} from "dayjs";
9
+import { call } from "dayjs";
10 10
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
11
-import {CDN_URL} from "~/config/app";
11
+import { CDN_URL } from "~/config/app";
12 12
 const state = reactive<any>({
13 13
   // 列表高度
14 14
   scrollHeight: 0,
@@ -97,6 +97,9 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
97 97
 
98 98
   getUserSharePostersImagesList(params).then(res => {
99 99
     state.triggered = false
100
+    console.log(action);
101
+    console.log(res);
102
+    state.totalPage = Math.ceil(res.pageInfo.total / state.pageSize);
100 103
     // sharePosterImageResult.value = res
101 104
     if (action === 'page') {
102 105
       state.list = state.list.concat(res.pageInfo.list)
@@ -104,8 +107,10 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
104 107
     if (action === 'reload') {
105 108
       state.list = res.pageInfo.list
106 109
     }
110
+    setTimeout(() => {
111
+      state.triggered = false
112
+    }, 300)
107 113
 
108
-    state.totalPage = Math.ceil(res.pageInfo.total / state.pageSize);
109 114
     state.status = 'more'
110 115
     if (callback) {
111 116
       callback(res.pageInfo.list)
@@ -115,12 +120,13 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
115 120
 
116 121
 function handleCategoryItemClick(item) {
117 122
   state.currentCategoryId = item.id
123
+  state.scrollTop = 0
118 124
   loadList('reload')
119 125
 }
126
+// 下拉刷新被下拉
120 127
 const onRefresherPulling = e => {
121 128
   state.triggered = true;
122 129
   loadList('reload')
123
-
124 130
 };
125 131
 // 下拉刷新被复位
126 132
 const onRefresherRestore = e => {
@@ -140,7 +146,7 @@ function handleScrollToLower() {
140 146
 
141 147
   state.status = 'loading';
142 148
   state.currentPage += 1;
143
-  if (state.currentPage >= state.totalPage) {
149
+  if (state.currentPage > state.totalPage) {
144 150
     state.status = 'noMore';
145 151
   } else {
146 152
     // queryFavorites('page');
@@ -150,6 +156,7 @@ function handleScrollToLower() {
150 156
 
151 157
 function loadAll() {
152 158
   state.currentCategoryId = 0
159
+  state.scrollTop = 0
153 160
   loadList('reload')
154 161
 }
155 162
 function handleItemClick(item) {
@@ -164,7 +171,7 @@ function handleItemClick(item) {
164 171
     uid: userStore.uid,
165 172
     imgId: item.id
166 173
   }).then(res => {
167
-    console.log(res)
174
+    console.log('生成的二维码', res)
168 175
     if (res && res.shareImgs) {
169 176
       state.currentImg = res.shareImgs
170 177
     }
@@ -206,26 +213,18 @@ function handleClose() {
206 213
 <template>
207 214
   <div class="flex">
208 215
     <!-- 左侧 -->
209
-    <scroll-view
210
-        :scroll-y="true"
211
-        :style="{ height: `${state.scrollHeight}px` }"
212
-        class="flex w-25 h-full bg-[#f8f8f8]"
213
-    >
214
-      <div
215
-          @tap="loadAll"
216
-          :class="state.currentCategoryId == 0 ? 'bg-white font-bold' : ''"
217
-          class="relative w-25 h-15 block text-sm flex justify-center items-center">
216
+    <scroll-view :scroll-y="true" :style="{ height: `${state.scrollHeight}px` }" class="flex w-25 h-full bg-[#f8f8f8]">
217
+      <div @tap="loadAll" :class="state.currentCategoryId == 0 ? 'bg-white font-bold' : ''"
218
+        class="relative w-25 h-15 block text-sm flex justify-center items-center">
218 219
         <div class="flex items-center gap-1">
219 220
           <div class="h-4 bg-primary w-1" v-if="state.currentCategoryId == 0"></div>
220 221
           <div>推荐</div>
221 222
         </div>
222 223
 
223 224
       </div>
224
-      <div v-for="(item, index) in categoryList" :key="index"
225
-           @click="handleCategoryItemClick(item)"
226
-           :class="state.currentCategoryId == item.id ? 'bg-white font-bold' : ''"
227
-           class="relative h-15 block text-sm flex justify-center items-center"
228
-      >
225
+      <div v-for="(item, index) in categoryList" :key="index" @click="handleCategoryItemClick(item)"
226
+        :class="state.currentCategoryId == item.id ? 'bg-white font-bold' : ''"
227
+        class="relative h-15 block text-sm flex justify-center items-center">
229 228
         <div class="flex items-center gap-1">
230 229
           <div class="h-4 bg-primary w-1" v-if="state.currentCategoryId == item.id"></div>
231 230
           <div>{{ item.name }}</div>
@@ -233,34 +232,25 @@ function handleClose() {
233 232
 
234 233
       </div>
235 234
     </scroll-view>
236
-    <scroll-view
237
-        :scroll-top="true"
238
-        :scroll-y="true"
239
-        :style="{ height: `${state.scrollHeight}px` }"
240
-        class="flex flex-1  flex-col h-full  p-3 gap-3 pb-safe"
241
-        :refresher-enabled="true"
242
-        refresher-background="#f5f5f5"
243
-        refresher-default-style="black"
244
-        :refresher-triggered="state.triggered"
245
-        @scrolltolower="handleScrollToLower"
246
-        @refresherPulling="onRefresherPulling"
247
-        @refresherRestore="onRefresherRestore"
248
-        @refresherAbort="onRefresherAbort"
249
-        @refresherrefresh="onRefresherRefresh"
250
-        v-if="state.list && state.list.length > 0"
251
-    >
252
-      <grid-view
253
-          type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px"
254
-      >
255
-        <div v-for="(item, index) in state.list"
256
-             :key="index"
257
-             @click="handleItemClick(item)"
258
-        >
259
-          <image
260
-              :src="item.image_fake"
261
-              mode="widthFix" class="w-30 h-full rounded-lg"></image>
235
+    <scroll-view :scroll-y="true" :scroll-top="state.scrollTop" :style="{ height: `${state.scrollHeight}px` }"
236
+      class="flex flex-1  flex-col h-full  p-3 gap-3 pb-safe" :refresher-enabled="true" refresher-background="#f5f5f5"
237
+      refresher-default-style="black" :refresher-triggered="state.triggered" @scrolltolower="handleScrollToLower"
238
+      @refresherPulling="onRefresherPulling" @refresherRestore="onRefresherRestore" @refresherAbort="onRefresherAbort"
239
+       @refresherrefresh="onRefresherRefresh" v-if="state.list && state.list.length > 0">
240
+      <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
241
+        <div v-for="(item, index) in state.list" :key="index" @click="handleItemClick(item)">
242
+          <image :src="item.image_fake" mode="widthFix" class="w-30 h-full rounded-lg"></image>
262 243
         </div>
244
+        <!-- <div class=" flex justify-center items-center text-[12px] text-gray-500">
245
+          <div v-if="state.status === 'loading'">
246
+            加载中...
247
+          </div>
248
+          <div v-if="state.status === 'noMore'">
249
+            没有更多了~
250
+          </div>
251
+        </div> -->
263 252
       </grid-view>
253
+
264 254
     </scroll-view>
265 255
     <div class="flex flex-col justify-center items-center w-full" v-else>
266 256
       <CXBEmpty />
@@ -269,14 +259,13 @@ function handleClose() {
269 259
   </div>
270 260
 
271 261
   <nut-overlay v-model:visible="show" :lock-scroll="true">
272
-<!--    <image src="https://cdn.bjtdba.com/vod/image/2023-09-16/20230916070524825.png"-->
273
-<!--           mode="widthFix" class="absolute top-0 right-0"-->
274
-<!--           @tap.stop="handleClose"-->
275
-<!--           v-if="state.showTip"-->
276
-<!--    ></image>-->
277
-
278
-    <div class="flex flex-col justify-center items-center w-full h-full"
279
-    >
262
+    <!--    <image src="https://cdn.bjtdba.com/vod/image/2023-09-16/20230916070524825.png"-->
263
+    <!--           mode="widthFix" class="absolute top-0 right-0"-->
264
+    <!--           @tap.stop="handleClose"-->
265
+    <!--           v-if="state.showTip"-->
266
+    <!--    ></image>-->
267
+
268
+    <div class="flex flex-col justify-center items-center w-full h-full">
280 269
       <div class="bg-white">
281 270
         <image :src="state.currentImg" mode="widthFix" class="w-60"></image>
282 271
         <div class="bg-white p-3 flex justify-around gap-3">
@@ -284,7 +273,7 @@ function handleClose() {
284 273
             <image :src="wechatImg" mode="widthFix" class="w-8 h-8"></image>
285 274
             <div>微信</div>
286 275
           </div>
287
-<!--          <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
276
+          <!--          <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
288 277
             <image :src="pyqImg" mode="widthFix" class="w-8 h-8"></image>
289 278
             <div>朋友圈</div>
290 279
           </div>-->
@@ -306,10 +295,11 @@ style:
306 295
 
307 296
 </route>
308 297
 <style>
309
-
310 298
 page {
299
+  /* height: 100%; */
311 300
   overflow: hidden;
312 301
 }
302
+
313 303
 image {
314 304
 
315 305
   image-rendering: -moz-crisp-edges;

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

@@ -1,12 +1,30 @@
1 1
 <script setup lang="ts">
2
-import {CDN_URL} from "~/config/app";
2
+import { findLast } from "lodash-es";
3
+import { getNoticeList } from "~/apis/common";
4
+import { encodeBase64 } from "~/utils/http/helper";
3 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
+const announcementList = ref()
7
+onLoad(async (options) => {
8
+  let res = await getNoticeList()
9
+  console.log(res);
10
+  announcementList.value = res.list
11
+})
12
+
13
+function go(item: any) {
14
+  uni.navigateTo({
15
+    url: `/pages/announcement/index?data=${encodeBase64(item)}`
16
+  })
17
+}
4 18
 
5
-const icon = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
6 19
 </script>
7 20
 <template>
8
-  <div class="h-screen w-screen flex flex-col justify-center items-center">
9
-    <CXBEmpty type="message"/>
21
+  <div class="px-3" v-if="announcementList != undefined">
22
+    <div v-for="(item, index) in announcementList" :key="index">
23
+      <div @click="go(item)" class="py-2 text_gg " style="border-bottom: 1rpx solid #c0c4cc;">{{ item.title }}</div>
24
+    </div>
25
+  </div>
26
+  <div v-else class="h-screen w-screen flex flex-col justify-center items-center">
27
+    <CXBEmpty type="message" />
10 28
   </div>
11 29
 </template>
12 30
 
@@ -14,3 +32,12 @@ const icon = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
14 32
 style:
15 33
   navigationBarTitleText: 消息
16 34
 </route>
35
+<style scoped>
36
+.text_gg {
37
+  height: 42rpx;
38
+  font-size: 30rpx;
39
+  font-family: PingFangSC, PingFang SC;
40
+  font-weight: 400;
41
+  color: #333333;
42
+}
43
+</style>

+ 329 - 50
src/pages/miaosha/index.vue

@@ -1,21 +1,41 @@
1 1
 <script setup lang="ts">
2
-import {getDcSeckill} from "~/apis/dacang";
3
-import {DcSeckillModel} from "~/apis/model/dacang.model";
2
+import { getDcSeckill } from "~/apis/dacang";
3
+import { DcSeckillModel } from "~/apis/model/dacang.model";
4 4
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
5 5
 import CXBYaojinTag from "~/components/CXBYaojinTag/CXBYaojinTag.vue";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7 7
 import FButton from "~/components/FButton/FButton.vue";
8 8
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
9
-import {CDN_URL} from "~/config/app";
10
-import {filter, orderBy} from "lodash-es";
11
-const currentSeckillDate = ref()
9
+import { CDM_URL, CDN_URL } from "~/config/app";
10
+import { filter, orderBy } from "lodash-es";
11
+
12 12
 const status1Icon = CDN_URL + '/static/assets/mashangqiang.png'
13 13
 const status2Icon = CDN_URL + '/static/assets/jijiangkaiqiang.png'
14 14
 const status3Icon = CDN_URL + '/static/assets/miaosha_yijieshu_220908.png'
15 15
 const userStore = useUserStore()
16 16
 // const list = ref<Array<DcSeckillModel>>()
17 17
 const currentProductList = ref([])
18
+const currentstatus = ref(0)
19
+const currentSeckillDate = ref(null)
20
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222162545839.png 
21
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222162527655.png 
22
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222162507598.png 
23
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222162442860.png 
24
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222162410289.png
25
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222181803737.png
26
+const myshowcimg = CDM_URL + '/image/2023-12-22/20231222181803737.png'  // 秒杀back
27
+const ms_backimg = CDM_URL + '/image/2023-12-22/20231222162410289.png'  // 秒杀back
28
+const ms_titleimg = CDM_URL + '/image/2023-12-22/20231222162442860.png'  //秒杀title
29
+const jjksimg = CDM_URL + '/image/2023-12-22/20231222162507598.png '    //即将开始
30
+const xsgimg = CDM_URL + '/image/2023-12-22/20231222162527655.png '    //限时购
31
+const ms_textimg = CDM_URL + '/image/2023-12-22/20231222162545839.png'   //小喇叭
32
+
18 33
 
34
+const remainingTime: any = ref({
35
+  hours: "00",
36
+  minutes: "00",
37
+  seconds: "00"
38
+})
19 39
 const state = reactive({
20 40
   currentPage: 1,
21 41
   pageSize: 10,
@@ -26,7 +46,25 @@ const state = reactive({
26 46
 })
27 47
 
28 48
 onLoad((options) => {
29
-  loadList('reload')
49
+  if (options.type_show == 1) {
50
+    if (!userStore.uid) {
51
+      userStore.setRedirectPage(`/pages/miaosha/index`, 'page')
52
+      return uni.redirectTo({
53
+        url: '/pages/user/login/index?key=4'
54
+      })
55
+
56
+    }
57
+    loadList('reload')
58
+  } else {
59
+    loadList('reload')
60
+  }
61
+  if (state.list.length > 0) {
62
+    uni.setNavigationBarStyle({
63
+      backgroundColor: '#00BFFF', // 北极颜色
64
+      color: '#ffffff', // 导航栏文字颜色,可根据实际需求调整
65
+    });
66
+  }
67
+
30 68
 })
31 69
 
32 70
 
@@ -41,10 +79,10 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
41 79
 
42 80
   getDcSeckill({
43 81
     ...params
44
-  }).then( res => {
82
+  }).then(res => {
45 83
     if (action === 'reload') {
46 84
       if (res && res.length > 0) {
47
-        console.log('秒杀>>>',res)
85
+        console.log('秒杀>>>', res)
48 86
         const resList = res
49 87
         // const status3List = orderBy(list.value, (val) => {
50 88
         //   return val.status == 3
@@ -78,14 +116,69 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
78 116
           // list.value = orderBy(list.value, )
79 117
           currentSeckillDate.value = state.list[0].seckill_date
80 118
           currentProductList.value = state.list[0].product_data
119
+          currentstatus.value = state.list[0].status
81 120
         }
82 121
       }
83 122
     }
84 123
   })
85 124
 }
125
+
126
+
127
+//计算秒杀
128
+function getCountdown() {
129
+  if (currentSeckillDate.value) {
130
+    const now = new Date();
131
+    const startDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), parseHours(currentSeckillDate.value.slice(0, 5)), 0, 0);
132
+    const endDate = new Date(startDate.getTime() + 60 * 60 * 1000);
133
+    // 结束时间为开始时间的一小时后
134
+
135
+    if (now < endDate) {
136
+      let milliseconds = endDate - now;
137
+
138
+      const hours = Math.floor(milliseconds / (1000 * 60 * 60));
139
+      const minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60));
140
+      const seconds = Math.floor((milliseconds % (1000 * 60)) / 1000);
141
+
142
+      // 更新数据
143
+      remainingTime.value = {
144
+        hours: hours < 10 ? '0' + hours : hours,
145
+        minutes: minutes < 10 ? '0' + minutes : minutes,
146
+        seconds: seconds < 10 ? '0' + seconds : seconds
147
+      }
148
+    }
149
+  }
150
+
151
+}
152
+
153
+function parseHours(time: any) {
154
+  const [hours, minutes] = time.split(":");
155
+  return parseInt(hours);
156
+}
157
+
158
+// 每秒更新剩余时间
159
+const timer = setInterval(() => {
160
+  if (remainingTime.hours <= 0 && remainingTime.minutes <= 0 && remainingTime.seconds <= 0) {
161
+    // 达到设定时间,执行关闭操作,你可以在这里添加你的关闭逻辑
162
+    clearInterval(timer);
163
+    //加载秒杀数据
164
+    console.log('自动关闭');
165
+    loadList('reload')
166
+
167
+  }
168
+  getCountdown()
169
+}, 1000);
170
+
171
+onUnload(() => {
172
+  clearInterval(timer);
173
+  console.log('卸载关闭');
174
+})
175
+
176
+
177
+
86 178
 function handleSeckillDateClick(seckill) {
87 179
   currentProductList.value = seckill.product_data
88 180
   currentSeckillDate.value = seckill.seckill_date
181
+  currentstatus.value = seckill.status
89 182
 }
90 183
 
91 184
 function handleItemClick(seckillItem) {
@@ -99,41 +192,50 @@ function handleItemClick(seckillItem) {
99 192
     url: `/pages/store/product/detail?id=${seckillItem.product_id}`
100 193
   })
101 194
 }
195
+
196
+// 下拉刷新
197
+onPullDownRefresh(() => {
198
+  // uni.reLaunch({
199
+  //     url: '/pages/miaosha/index',
200
+  //   })
201
+  state.list = []
202
+  currentProductList.value = []
203
+  currentstatus.value = 0
204
+  currentSeckillDate.value = null
205
+  loadList('reload')
206
+  uni.stopPullDownRefresh();
207
+
208
+})
209
+
210
+function onClickLeft() {
211
+  const pages = getCurrentPages()
212
+  if (pages.length > 1) {
213
+    uni.navigateBack()
214
+  }
215
+  else {
216
+    uni.switchTab({
217
+      url: '/pages/home/index',
218
+    })
219
+  }
220
+}
102 221
 </script>
103 222
 <template>
104
-  <CXBBasePage>
105
-    <div
106
-        v-if="state.list && state.list.length > 0"
107
-
108
-    >
109
-      <scroll-view
110
-          class=" whitespace-nowrap  w-screen  text-sm py-3"
111
-          :scroll-with-animation="true"
112
-          :scroll-x="true"
113
-          :show-scrollbar="false"
114
-      >
115
-        <div
116
-            @tap="handleSeckillDateClick(item)"
117
-            v-for="(item, index) in state.list"
118
-            :key="index"
119
-            class="flex inline-flex items-center justify-center relative pl-5"
120
-            :class="currentSeckillDate === item.seckill_date ? 'text-[#fe0032]' : ''"
121
-        >
122
-          {{item.seckill_date}}
223
+  <!-- <CXBBasePage>
224
+    <div v-if="state.list && state.list.length > 0">
225
+      <scroll-view class=" whitespace-nowrap  w-screen  text-sm py-3" :scroll-with-animation="true" :scroll-x="true"
226
+        :show-scrollbar="false">
227
+        <div @tap="handleSeckillDateClick(item)" v-for="(item, index) in state.list" :key="index"
228
+          class="flex inline-flex items-center justify-center relative pl-5"
229
+          :class="currentSeckillDate === item.seckill_date ? 'text-[#fe0032]' : ''">
230
+          {{ item.seckill_date }}
123 231
         </div>
124
-        <!--      </div>-->
232
+        
125 233
       </scroll-view>
126 234
       <div class="p-3 pb-safe">
127 235
         <div class="flex flex-col gap-3">
128
-          <div
129
-              @tap="handleItemClick(seckillItem)"
130
-              v-for="(seckillItem, itemIndex) in currentProductList"
131
-              :key="itemIndex"
132
-              class="bg-white rounded p-3"
133
-          >
134
-            <div
135
-                class="bg-white flex gap-3"
136
-            >
236
+          <div @tap="handleItemClick(seckillItem)" v-for="(seckillItem, itemIndex) in currentProductList" :key="itemIndex"
237
+            class="bg-white rounded p-3">
238
+            <div class="bg-white flex gap-3">
137 239
               <div>
138 240
                 <image :src="seckillItem.image" mode="widthFix" class="w-30"></image>
139 241
               </div>
@@ -143,20 +245,14 @@ function handleItemClick(seckillItem) {
143 245
                   {{ seckillItem.store_name }}
144 246
                 </div>
145 247
                 <div class="text-gray text-xs">
146
-                  即将恢复原价¥{{ seckillItem.ot_price}}
248
+                  即将恢复原价¥{{ seckillItem.ot_price }}
147 249
                 </div>
148 250
                 <CXBYaojinTag :amount="Number.parseFloat(seckillItem.yanglao)" />
149 251
                 <div class="flex items-center justify-between">
150
-                  <FPrice :price="seckillItem.seckill_price"/>
151
-                  <image
152
-                      v-if="seckillItem.status == 1"
153
-                      :src="status1Icon" mode="widthFix" class="w-16 h-7" ></image>
154
-                  <image
155
-                      v-if="seckillItem.status == 2"
156
-                      :src="status2Icon" mode="widthFix" class="w-16 h-7" ></image>
157
-                  <image
158
-                      v-if="seckillItem.status == 3"
159
-                      :src="status3Icon" mode="widthFix" class="w-16 h-7" ></image>
252
+                  <FPrice :price="seckillItem.seckill_price" />
253
+                  <image v-if="seckillItem.status == 1" :src="status1Icon" mode="widthFix" class="w-16 h-7"></image>
254
+                  <image v-if="seckillItem.status == 2" :src="status2Icon" mode="widthFix" class="w-16 h-7"></image>
255
+                  <image v-if="seckillItem.status == 3" :src="status3Icon" mode="widthFix" class="w-16 h-7"></image>
160 256
                 </div>
161 257
               </div>
162 258
 
@@ -166,17 +262,200 @@ function handleItemClick(seckillItem) {
166 262
         </div>
167 263
       </div>
168 264
     </div>
169
-    <CXBEmpty v-else/>
265
+    <CXBEmpty v-else />
170 266
 
171
-  </CXBBasePage>
267
+  </CXBBasePage> -->
268
+  <FNavBar title="" :left-arrow="true" fixed placeholder z-index="999" ex-class="bg-transparent w-screen"
269
+    @click-left="onClickLeft" />
270
+  <div v-if="state.list && state.list.length > 0" style="position: relative;">
271
+    <div style="width: 750rpx; height: 490rpx;position: relative; ">
272
+      <image style="width: 100%;height: 100%;" :src="ms_backimg"></image>
273
+      <image class="ms_titleimg" :src="ms_titleimg"></image>
274
+    </div>
275
+    <div class="pb-safe list_d ">
276
+      <!-- <scroll-view class=" whitespace-nowrap  w-screen  text-sm py-3" :scroll-with-animation="true" :scroll-x="true"
277
+        :show-scrollbar="false">
278
+        <div @tap="handleSeckillDateClick(item)" v-for="(item, index) in state.list" :key="index"
279
+          class="flex inline-flex flex-col items-center justify-center relative pl-5 text-[#FFFFFF]">
280
+          <div>{{ item.seckill_date?.slice(0, 5) }}</div>
281
+          <div style="padding: 1rpx 16rpx;" :class="currentSeckillDate === item.seckill_date ? 'broder_s' : ''">{{
282
+            item.seckill_date?.slice(5) }}</div>
283
+        </div>
284
+
285
+      </scroll-view> -->
286
+      <scroll-view class=" whitespace-nowrap  w-screen  text-sm py-3" :scroll-with-animation="true" :scroll-x="true"
287
+        :show-scrollbar="false">
288
+        <div class="flex  items-center justify-center ">
289
+          <div @tap="handleSeckillDateClick(item)" v-for="(item, index) in state.list" :key="index"
290
+            class="basis-1/3   relative px-3 text-[#FFFFFF]" style="text-align: center;">
291
+            <div>{{ item.seckill_date?.slice(0, 5) }}</div>
292
+            <div style="padding: 1rpx 32rpx; ">
293
+              <div style="width: 100%;height: 100%;" :class="currentSeckillDate === item.seckill_date ? 'broder_s' : ''">
294
+                {{ item.seckill_date?.slice(5) }}</div>
295
+            </div>
296
+          </div>
297
+        </div>
172 298
 
299
+
300
+      </scroll-view>
301
+      <div class=" bg-white flex flex-col gap-3 mx-3 rounded">
302
+        <div v-if="currentstatus == 1" class="ms_title_gg mx-3 flex flex-1 justify-between">
303
+          <div>距本场结束
304
+            <span class="ms_span">{{ remainingTime.hours }}</span> :
305
+            <span class="ms_span">{{ remainingTime.minutes }}</span> :
306
+            <span class="ms_span">{{ remainingTime.seconds }}</span>
307
+          </div>
308
+          <div class="flex items-center justify-center">
309
+            <image style="width: 36rpx;height: 36rpx;margin-right:12rpx " :src="ms_textimg"></image>
310
+            <span style="height: 36rpx;line-height: 36rpx; color: #999999;">抓紧时间抢购哦~</span>
311
+          </div>
312
+        </div>
313
+        <div v-if="currentstatus == 2" class="ms_title_gg mx-3 flex flex-1 justify-between">
314
+          <div>
315
+            秒杀即将开始,请耐心等待~
316
+          </div>
317
+
318
+        </div>
319
+        <div @tap="handleItemClick(seckillItem)" v-for="(seckillItem, itemIndex) in currentProductList" :key="itemIndex"
320
+          class="bg-white  mx-3 p-3">
321
+          <div class="bg-white flex gap-3">
322
+            <div>
323
+              <image :src="seckillItem.image" style="width: 240rpx; height: 240rpx;"></image>
324
+            </div>
325
+            <div class="flex-1 flex flex-col gap-2 justify-between">
326
+              <div class="text-ellipsis">
327
+                {{ seckillItem.store_name }}
328
+              </div>
329
+              <CXBYaojinTag :amount="Number.parseFloat(seckillItem.yanglao)" />
330
+              <div class="flex items-center justify-between">
331
+                <div style="color: red;">¥{{ seckillItem.seckill_price }}</div>
332
+                <div class="line-through text-xs font-bold flex text-gray-600">
333
+                  ¥{{ seckillItem.ot_price }}
334
+                </div>
335
+                <image v-if="seckillItem.status == 1" :src="xsgimg" mode="widthFix" class="w-16 h-7"></image>
336
+                <image v-if="seckillItem.status == 2" :src="jjksimg" mode="widthFix" class="w-16 h-7"></image>
337
+              </div>
338
+            </div>
339
+
340
+          </div>
341
+        </div>
342
+
343
+      </div>
344
+    </div>
345
+  </div>
346
+  <div v-else>
347
+    <div style="width: 750rpx; height: 176rpx;background-color: #ffffff;">
348
+      <div class="un_title">限时秒杀</div>
349
+    </div>
350
+    <div class="h-full unshowsc  flex flex-col justify-between items-center"
351
+      style="margin-top:115rpx ;  background-color: #f8f8f8;">
352
+      <div class="img_d mb-2">
353
+        <image :src="myshowcimg" style="width: 100%; height: 100%;"></image>
354
+      </div>
355
+      <div class="text_t">
356
+        暂未开放,敬请期待
357
+      </div>
358
+    </div>
359
+  </div>
173 360
 </template>
174 361
 <route lang="yaml">
175 362
 style:
176 363
   navigationBarTitleText: 限时秒杀
364
+  navigationStyle: custom
365
+  enablePullDownRefresh: true
177 366
 </route>
178 367
 <style>
179 368
 page {
180 369
   background: #f8f8f8;
181 370
 }
371
+
372
+.un_title {
373
+  width: 144rpx;
374
+  height: 50rpx;
375
+  font-size: 26rpx;
376
+  font-family: PingFangSC, PingFang SC;
377
+  font-weight: 500;
378
+  color: #333333;
379
+  line-height: 50rpx;
380
+  position: absolute;
381
+  top: 107rpx;
382
+  left: 50%;
383
+  margin-left: -72rpx;
384
+}
385
+
386
+.ms_titleimg {
387
+  width: 182rpx;
388
+  height: 48rpx;
389
+  position: absolute;
390
+  top: 20%;
391
+  left: 284rpx;
392
+}
393
+
394
+.list_d {
395
+  position: absolute;
396
+  z-index: 2;
397
+  top: 200rpx;
398
+}
399
+
400
+.ms_title_gg {
401
+  height: 90rpx;
402
+  border-bottom: 1rpx solid #E5E5E5;
403
+  line-height: 90rpx;
404
+  font-size: 26rpx;
405
+  font-family: PingFangSC, PingFang SC;
406
+  font-weight: 400;
407
+  color: #333333;
408
+}
409
+
410
+.text-ellipsis {
411
+  display: -webkit-box;
412
+  -webkit-box-orient: vertical;
413
+  overflow: hidden;
414
+  -webkit-line-clamp: 2;
415
+  /* 设置显示的行数 */
416
+  text-overflow: ellipsis;
417
+}
418
+
419
+.ms_span {
420
+  display: inline-block;
421
+  height: 36rpx;
422
+  width: 36rpx;
423
+  text-align: center;
424
+  border-radius: 19rpx;
425
+  font-size: 20rpx;
426
+  line-height: 36rpx;
427
+  background: #fe0a3e;
428
+  color: white
429
+}
430
+
431
+.broder_s {
432
+  color: #fe0a3e;
433
+  background-color: #ffffff;
434
+  border-radius: 22rpx;
435
+}
436
+
437
+.unshowsc {
438
+  width: 350rpx;
439
+  height: 350rpx;
440
+  position: absolute;
441
+  top: 25%;
442
+  left: 50%;
443
+  margin-left: -175rpx;
444
+  text-align: center;
445
+}
446
+
447
+.img_d {
448
+  width: 206rpx;
449
+  height: 206rpx;
450
+}
451
+
452
+.text_t {
453
+  width: 300rpx;
454
+  height: 30rpx;
455
+  font-size: 30rpx;
456
+  font-family: PingFangSC, PingFang SC;
457
+  font-weight: 400;
458
+  color: #333333;
459
+  line-height: 30rpx;
460
+}
182 461
 </style>

+ 62 - 19
src/pages/my-invitation/index.vue

@@ -1,7 +1,7 @@
1 1
 <script setup lang="ts">
2 2
 import FCellGroup from "~/components/FCellGroup/FCellGroup.vue";
3 3
 import FCell from "~/components/FCell/FCell.vue";
4
-import {getAgentInfo, getSelectUserInviteProfit, getUserUnionId} from "~/apis/user";
4
+import { getAgentInfo, getSelectUserInviteProfit, getUserUnionId } from "~/apis/user";
5 5
 const userStore = useUserStore()
6 6
 const list = [{
7 7
   title: '邀请伙伴',
@@ -16,9 +16,6 @@ const list = [{
16 16
   title: '累计收益',
17 17
   url: '/pages/accumulate-income/index'
18 18
 }, {
19
-  title: '去提现',
20
-  url: '/pages/immediate-withdrawal/index'
21
-},{
22 19
   title: '支付平台绑定',
23 20
   url: '/pages/third_party_binding/index'
24 21
 }]
@@ -33,15 +30,15 @@ const data = ref({
33 30
   // state.extract = res.extract
34 31
   nickname: '',
35 32
   avatar: '',
36
-  brokerage_price: '' ,
37
-  yesterday: '' ,
38
-  cumulative: '' ,
33
+  brokerage_price: '',
34
+  yesterday: '',
35
+  cumulative: '',
39 36
   extract: ''
40 37
 })
41 38
 
42 39
 const userInviteProfit = reactive({
43 40
   numberSun: '',
44
-  UserUnsettledInviteProfit: '' ,
41
+  UserUnsettledInviteProfit: '',
45 42
   UserYesterdayInviteProfit: ''
46 43
 })
47 44
 onLoad(() => {
@@ -90,6 +87,37 @@ function handleClick(item: { url: string, title: string }) {
90 87
   })
91 88
 }
92 89
 
90
+function handleClickTomo() {
91
+  if (userStore.userInfo.is_ertification == 1) {
92
+    uni.navigateTo({
93
+      url: '/pages/immediate-withdrawal/index?type=1'
94
+    })
95
+  } else {
96
+    setTimeout(() => {
97
+      uni.showModal({
98
+        title: '温馨提示',
99
+        content: '实名认证后才可提现',
100
+        cancelText: "取消", // 取消按钮的文字
101
+        confirmText: "去认证", // 确认按钮的文字
102
+        showCancel: true, // 是否显示取消按钮,默认为 true
103
+        confirmColor: '#f55850',
104
+        success: (res) => {
105
+          if (res.confirm) {
106
+            console.log('comfirm') //点击确定之后执行的代码
107
+            setTimeout(() => {
108
+              uni.navigateTo({
109
+                url: '/pages/real-name-authentication/index'
110
+              })
111
+            }, 300);
112
+          } else {
113
+            console.log('cancel') //点击取消之后执行的代码
114
+          }
115
+        }
116
+      })
117
+    }, 300);
118
+  }
119
+}
120
+
93 121
 function handleShowAgreement() {
94 122
   uni.navigateTo({
95 123
     url: '/pages/webview/agreement?type=6'
@@ -104,7 +132,7 @@ function handleShowAgreement() {
104 132
       <div class="text-sm">规则</div>
105 133
     </div>
106 134
     <div class="bg-white rounded-lg p-4 flex flex-col gap-4 ">
107
-      <div class="flex justify-around">
135
+      <div class="flex justify-between">
108 136
         <div class="flex flex-col justify-center items-center gap-2">
109 137
           <div class="text-xs text-gray">
110 138
             当前收益(元)
@@ -112,21 +140,22 @@ function handleShowAgreement() {
112 140
           <div class="font-bold text-[28px]">
113 141
             {{ data.brokerage_price ? data.brokerage_price : '0.00' }}
114 142
           </div>
143
+          <div class="text-xs text-gray">昨日收益 <span class="text-red">+ {{ data.yesterday }}</span></div>
115 144
         </div>
116
-        <div class="flex flex-col justify-center items-center gap-2">
117
-          <div class="text-xs text-gray">
118
-            未结算(元)
119
-          </div>
120
-          <div class="font-bold text-[28px]">
121
-            {{ userInviteProfit.UserUnsettledInviteProfit ? userInviteProfit.UserUnsettledInviteProfit : '0.00' }}
122
-          </div>
145
+        <div  class="flex flex-col justify-center items-center gap-2">
146
+          <div @click="handleClickTomo" class="text_qtx">去提现</div>
123 147
         </div>
124 148
       </div>
125 149
       <div class="flex justify-around">
126 150
         <div class="flex-1 flex flex-col justify-center items-center gap-2">
127
-          <div class="text-xs text-gray">昨日收益(元)</div>
128
-          <div class="font-bold text-red">{{ data.yesterday }}</div>
151
+          <div class="text-xs text-gray">未结算(元)</div>
152
+          <div class="font-bold">{{ userInviteProfit.UserUnsettledInviteProfit ?
153
+            userInviteProfit.UserUnsettledInviteProfit : '0' }}</div>
129 154
         </div>
155
+        <!-- {
156
+                title: '去提现',
157
+                  url: '/pages/immediate-withdrawal/index?type=1'
158
+        },-->
130 159
 
131 160
         <div class="flex-1 flex flex-col justify-center items-center gap-2">
132 161
           <div class="text-xs text-gray">累计收益(元)</div>
@@ -143,7 +172,8 @@ function handleShowAgreement() {
143 172
 
144 173
     <div class="bg-white  ">
145 174
       <FCellGroup divider arrow :ex-class="['rounded-xl']">
146
-        <FCell v-for="(item, index) in list" :key="index" :title="item.title" exClass="text-sm font-bold" @click="handleClick(item)"/>
175
+        <FCell v-for="(item, index) in list" :key="index" :title="item.title" exClass="text-sm font-bold"
176
+          @click="handleClick(item)" />
147 177
       </FCellGroup>
148 178
     </div>
149 179
 
@@ -155,6 +185,19 @@ page {
155 185
   background: #f8f8f8;
156 186
   overflow: hidden;
157 187
 }
188
+
189
+.text_qtx {
190
+  width: 168rpx;
191
+  height: 63rpx;
192
+  background: linear-gradient(179deg, #FE7577 0%, #FE0032 100%);
193
+  border-radius: 32rpx;
194
+  line-height: 63rpx;
195
+  font-size: 28rpx;
196
+  font-family: PingFangSC, PingFang SC;
197
+  font-weight: 500;
198
+  color: #FFFFFF;
199
+  text-align: center;
200
+}
158 201
 </style>
159 202
 <route lang="yaml">
160 203
 style:

+ 1 - 1
src/pages/my-profile/index.vue

@@ -131,7 +131,7 @@ function handleSubmit() {
131 131
       <div class="">头像</div>
132 132
       <div class="flex items-center">
133 133
         <button class="btn-normal" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
134
-          <image :src="formData.avatar ? formData.avatar : 'https://app.bjtdba.com/mp/zjx_image/logo.png'" mode="widthFix" class="w-9 h-9 rounded-full" />
134
+          <image :src="formData.avatar ? formData.avatar : 'https://app.bjtdba.com/mp/zjx_image/logo.png'" class=" rounded-full"  style="width:74rpx; height:74rpx;"/>
135 135
         </button>
136 136
         <div
137 137
             class="f-text-color-2 i-tabler-chevron-right transform transition-300"

+ 214 - 59
src/pages/my-relation-merchant/index.vue

@@ -1,14 +1,27 @@
1 1
 <script setup lang="ts">
2 2
 import FSearch from "~/components/FSearch/FSearch.vue";
3
-import {getMyRelationMerchantList, removeMyRelation} from "~/apis/user";
3
+import { batchremoveMyRelation, getMyRelationMerchantList, removeMyRelation } from "~/apis/user";
4 4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
+import { CDM_URL } from "~/config/app";
5 6
 const list = ref<any[]>()
7
+//https://cdn.bjtdba.com/vod/image/2023-12-22/20231222142806941.png
8
+const myshowcimg = CDM_URL + "/image/2023-12-22/20231222142806941.png"
6 9
 onShow(() => {
10
+  uni.showLoading({
11
+    title: '加载中',
12
+    icon: 'none'
13
+  })
7 14
   loadMyRelationMerchantList()
15
+  uni.hideLoading()
8 16
 
9 17
 })
10 18
 const searchValue = ref('')
11
-
19
+const state = reactive({
20
+  isManage: false,
21
+  totalNum: 0
22
+})
23
+let type_ids = ref<string[]>([])
24
+const isAllSelect = ref(false)
12 25
 function loadMyRelationMerchantList(keywords = '') {
13 26
   getMyRelationMerchantList({
14 27
     page: 1,
@@ -21,90 +34,162 @@ function loadMyRelationMerchantList(keywords = '') {
21 34
     }
22 35
   })
23 36
 }
24
-function handleRemoveMyRelation(item: any, index: number) {
37
+
38
+
39
+function handleItemClick(item) {
25 40
   console.log(item)
41
+  uni.navigateTo({
42
+    url: '/pages/store/home/index?id=' + item.mer_id
43
+  })
44
+}
45
+
46
+function handleTodacang() {
47
+  uni.reLaunch({
48
+    url: '/pages/store/nearby/index' // tabBar 页面路径
49
+  });
50
+}
51
+
52
+function handleManage() {
53
+  state.isManage = !state.isManage
54
+  state.totalNum = 0
55
+  isAllSelect.value = false
56
+  // 如果单选的情况下, 获取已选中的
57
+  list.value.map(item => ({ ...item, isSelected: false }))
58
+  console.log(list.value);
59
+  type_ids.value = []
60
+  console.log(list.value);
61
+  console.log(type_ids.value);
62
+
63
+}
64
+
65
+function handleSelectAll(checked: boolean) {
66
+
67
+  cartAllCheck('all')
68
+
69
+}
70
+function cartAllCheck(type: 'single' | 'all') {
71
+  let totalNum = 0
72
+  if (type === 'single') {
73
+    // 如果单选的情况下, 获取已选中的
74
+    let tempArr = list.value.filter(Item => {
75
+      // if (goodItem.check) {
76
+      return Item.isSelected === true
77
+      // }
78
+    })
79
+    // console.log(tempArr)
80
+    type_ids.value = tempArr?.map((item) => item.type_id) || [];
81
+    if (list.value.length === tempArr.length) {
82
+      isAllSelect.value = true
83
+      // goods.indeterminate = false
84
+    }
85
+    if (tempArr.length < list.value.length) {
86
+      isAllSelect.value = false
87
+    }
88
+    if (tempArr.length <= 0) {
89
+      isAllSelect.value = false
90
+    }
91
+
92
+  } else {
93
+    list.value.forEach(goodItem => {
94
+      goodItem.isSelected = isAllSelect.value
95
+    })
96
+    if (isAllSelect.value) {
97
+      type_ids.value = list.value?.map((item) => item.type_id) || [];
98
+      console.log(type_ids.value);
99
+
100
+
101
+    }
102
+  }
103
+
104
+  // 总金额|总数
105
+  list.value.filter(goodItem => {
106
+    if (goodItem.isSelected) {
107
+      totalNum += 1
108
+    }
109
+  })
110
+
111
+  state.totalNum = totalNum
112
+  // console.log(type_ids);
113
+  // console.log(state.totalNum);
114
+
115
+}
116
+//批量取消收藏
117
+function handleBatch() {
118
+  console.log(type_ids.value);
119
+  // batchremoveMyRelation
26 120
   uni.showModal({
27 121
     title: '提示',
28
-    content: '确定取消收藏吗?',
29
-    success: (res) =>  {
122
+    content: `确定取消关注这${state.totalNum}家店铺吗?`,
123
+    success: (res) => {
30 124
       if (res.confirm) {
31
-        removeMyRelation({
125
+        batchremoveMyRelation({
32 126
           type: 10,
33
-          type_id: item.type_id
127
+          type_id: type_ids.value
34 128
         }).then(delRes => {
35
-          loadMyRelationMerchantList()
36
-
37
-          uni.showToast({
38
-            title: '取消收藏成功',
129
+          return uni.showToast({
130
+            title: '取消关注成功',
39 131
             icon: 'success'
40 132
           }).then(() => {
133
+            loadMyRelationMerchantList()
41 134
             // if (list) {
42 135
             //   list.value.splice(index, 1)
43 136
             // }
44 137
           })
45
-
46
-        }).catch(error => {
47
-          uni.showToast({
48
-            title: error,
49
-            icon: 'none'
50
-          })
51 138
         })
52 139
       }
53 140
     }
54 141
   })
55 142
 }
56 143
 
57
-function handleItemClick(item) {
58
-  console.log(item)
59
-  uni.navigateTo({
60
-    url: '/pages/store/home/index?id=' + item.mer_id
61
-  })
144
+//单选添加type_id
145
+function handleGoodsItemCheck(type_id: any) {
146
+  cartAllCheck('single')
62 147
 }
148
+
149
+onPullDownRefresh(() => {
150
+  uni.showLoading({
151
+    title: '加载中',
152
+    icon: 'none'
153
+  })
154
+  loadMyRelationMerchantList()
155
+  uni.stopPullDownRefresh()
156
+  uni.hideLoading()
157
+})
63 158
 </script>
64 159
 
65 160
 <template>
66
-  <div>
67
-    <div class="bg-white p-3 mb-3">
68
-      <nut-searchbar
69
-          class="absolute top-0"
70
-          v-model="searchValue" @search="loadMyRelationMerchantList( searchValue)" @clear="loadMyRelationMerchantList( '')">
71
-        <template v-slot:rightout>
72
-          <div @tap="loadMyRelationMerchantList(searchValue)">
73
-            搜索
74
-          </div>
75
-        </template>
76
-      </nut-searchbar>
77
-      <!--      <FSearch />-->
161
+  <div v-if="list && list.length > 0">
162
+    <div class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end ">
163
+      <div class="pr-3">
164
+        <FButton size="small" @click="handleManage">
165
+          <div>{{ state.isManage ? '完成' : '管理' }}</div>
166
+        </FButton>
167
+      </div>
78 168
     </div>
79
-    <div v-if="list && list.length > 0" class="flex flex-col gap-3 ">
80
-      <div class="bg-white flex p-3 " v-for="(item, index) in list" :key="index"
81
-           @tap="handleItemClick(item)"
82
-      >
169
+    <div style="background-color: #f8f8f8;" class="mt-14 flex flex-col gap-3 ">
170
+      <div class="bg-white flex p-3 " v-for="(item, index) in list" :key="index">
171
+
83 172
         <div class="flex w-full">
84 173
           <div class="flex flex-1 w-full">
85
-            <div>
86
-              <image :src="item.mer_avatar" mode="widthFix" class="w-15 h-15 rounded "></image>
87
-            </div>
88
-            <div class="flex flex-col text-sm  justify-between w-full">
89
-              <div class="flex flex-col px-3 gap-2 flex-1">
90
-                <div>
91
-                  {{ item.mer_name }}
92
-                </div>
93
-                <div class="text-xs text-gray">
94
-                  {{ item.care_count }} 人关注
95
-                </div>
174
+            <nut-checkbox v-if="state.isManage == true" v-model="item.isSelected" @change="handleGoodsItemCheck(item)"
175
+              label="单选" class="!text-primary"></nut-checkbox>
176
+            <div class="flex flex-1 " @tap="handleItemClick(item)">
177
+              <div>
178
+                <image :src="item.mer_avatar" mode="widthFix" class="w-15 h-15 rounded "></image>
96 179
               </div>
97
-
98
-              <!--
99
-              <div class="flex items-center justify-end">
100
-                <div
101
-                    @tap="handleRemoveMyRelation(item, index)"
102
-                    class="border border-solid border-red rounded-full px-2 text-[10px] text-red">
103
-                  取消收藏
180
+              <div class="flex flex-col text-sm  justify-between w-full">
181
+                <div class="flex flex-col px-3 gap-2 flex-1">
182
+                  <div>
183
+                    {{ item.mer_name }}
184
+                  </div>
185
+                  <div class="text-xs text-gray">
186
+                    {{ item.care_count }} 人关注
187
+                  </div>
104 188
                 </div>
105 189
               </div>
106
-              -->
190
+
107 191
             </div>
192
+
108 193
           </div>
109 194
           <div class="list-bg ">
110 195
           </div>
@@ -113,8 +198,35 @@ function handleItemClick(item) {
113 198
       </div>
114 199
 
115 200
     </div>
116
-    <div v-else>
117
-      <CXBEmpty />
201
+    <div v-if="state.isManage == true" class="bg-white fixed bottom-0 w-full z-3 pb-10">
202
+      <div class="bg-white h-10 flex justify-between">
203
+        <div class="flex justify-center items-center gap-2 pl-3" @click="handleSelectAll">
204
+          <nut-checkbox v-model="isAllSelect" label="全选" class="!text-primary">全选
205
+          </nut-checkbox>
206
+          <!-- <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div> -->
207
+        </div>
208
+
209
+        <div class="flex justify-center items-center gap-2 pr-3">
210
+          <div class="flex text-[12px]" v-if="state.isManage">
211
+            <span v-if="state.totalNum != 0 && state.isManage">已选{{ state.totalNum }}家店铺</span>
212
+          </div>
213
+          <FButton :disabled="state.totalNum == 0" @click="handleBatch" size="small"
214
+            :exClass="['rounded-full', '!text-[14px]', 'text-white', 'bg-primary', 'w-full']">
215
+            取消关注
216
+          </FButton>
217
+        </div>
218
+      </div>
219
+    </div>
220
+  </div>
221
+  <div v-else class="unshowsc  flex flex-col justify-between items-center">
222
+    <div class="img_d mb-2">
223
+      <image :src="myshowcimg" style="width: 100%; height: 100%;"></image>
224
+    </div>
225
+    <div class="text_t">
226
+      您还没有关注任何店铺
227
+    </div>
228
+    <div @click="handleTodacang" class="mt-6 button_t ">
229
+      去逛逛
118 230
     </div>
119 231
   </div>
120 232
 </template>
@@ -123,6 +235,7 @@ function handleItemClick(item) {
123 235
 page {
124 236
   background-color: #f8f8f8;
125 237
 }
238
+
126 239
 .list-bg {
127 240
   width: 124rpx;
128 241
   height: 124rpx;
@@ -130,8 +243,50 @@ page {
130 243
   background-size: 100% 100%;
131 244
 }
132 245
 
246
+page {
247
+  background-color: #f8f8f8;
248
+}
249
+
250
+.unshowsc {
251
+  width: 350rpx;
252
+  height: 350rpx;
253
+  position: absolute;
254
+  top: 25%;
255
+  left: 50%;
256
+  margin-left: -175rpx;
257
+  text-align: center;
258
+}
259
+
260
+.img_d {
261
+  width: 206rpx;
262
+  height: 206rpx;
263
+}
264
+
265
+.text_t {
266
+  width: 300rpx;
267
+  height: 30rpx;
268
+  font-size: 30rpx;
269
+  font-family: PingFangSC, PingFang SC;
270
+  font-weight: 400;
271
+  color: #333333;
272
+  line-height: 30rpx;
273
+}
274
+
275
+.button_t {
276
+  width: 350rpx;
277
+  height: 82rpx;
278
+  background: linear-gradient(179deg, #FE7577 0%, #FE0032 100%);
279
+  border-radius: 42rpx;
280
+  font-size: 32rpx;
281
+  font-family: PingFangSC, PingFang SC;
282
+  font-weight: 400;
283
+  color: #FFFFFF;
284
+  line-height: 82rpx;
285
+  text-align: center;
286
+}
133 287
 </style>
134 288
 <route lang="yaml">
135 289
 style:
136 290
   navigationBarTitleText: 我的关注
291
+  enablePullDownRefresh: true
137 292
 </route>

+ 232 - 40
src/pages/my-relation-product/index.vue

@@ -1,21 +1,35 @@
1 1
 <script setup lang="ts">
2 2
 import FSearch from "~/components/FSearch/FSearch.vue";
3
-import {getMyRelationProduct, removeMyRelation} from "~/apis/user";
4
-import type {MyRelationProductModel} from "~/apis/model/myRelationProductModel";
3
+import { getMyRelationProduct, removeMyRelation, batchremoveMyRelation } from "~/apis/user";
4
+import type { MyRelationProductModel } from "~/apis/model/myRelationProductModel";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
+import { CDM_URL } from "~/config/app";
6 7
 const list = ref<MyRelationProductModel[]>()
7 8
 onLoad((option: any) => {
9
+  uni.showLoading({
10
+    title: '加载中',
11
+    icon: 'none'
12
+  })
8 13
   loadMyFavorite()
14
+  uni.hideLoading()
9 15
 })
10
-
16
+//https://cdn.bjtdba.com/vod/image/2023-12-21/20231221100048578.png
11 17
 const searchValue = ref('')
12
-function loadMyFavorite(keywords= '') {
18
+const myshowcimg = CDM_URL + '/image/2023-12-21/20231221100048578.png'
19
+const state = reactive({
20
+  isManage: false,
21
+  totalNum: 0
22
+})
23
+let type_ids = ref<string[]>([])
24
+const isAllSelect = ref(false)
25
+function loadMyFavorite(keywords = '') {
13 26
   getMyRelationProduct({
14 27
     page: 1,
15 28
     limit: 10,
16 29
     keywords,
17 30
   }).then(res => {
18 31
     if (res) {
32
+      console.log(res);
19 33
       list.value = res.list
20 34
     }
21 35
   })
@@ -27,12 +41,12 @@ function handleShowDetail(item) {
27 41
     url: `/pages/store/product/detail?id=${item.product_id}`
28 42
   })
29 43
 }
30
-function handleRemoveMyRelationProduct(item: MyRelationProductModel, index: number) {
44
+function handleRemoveMyRelationProduct(item: any, index: number) {
31 45
   console.log(item)
32 46
   uni.showModal({
33 47
     title: '提示',
34 48
     content: '确定取消收藏吗?',
35
-    success: (res) =>  {
49
+    success: (res) => {
36 50
       if (res.confirm) {
37 51
         removeMyRelation({
38 52
           type: 1,
@@ -52,45 +66,184 @@ function handleRemoveMyRelationProduct(item: MyRelationProductModel, index: numb
52 66
     }
53 67
   })
54 68
 }
69
+
70
+function handleManage() {
71
+  state.isManage = !state.isManage
72
+  state.totalNum = 0
73
+  isAllSelect.value = false
74
+  // 如果单选的情况下, 获取已选中的
75
+  list.value.map(item => ({ ...item, isSelected: false }))
76
+  console.log(list.value);
77
+  type_ids.value = []
78
+  console.log(list.value);
79
+  console.log(type_ids.value);
80
+
81
+}
82
+
83
+function handleTodacang() {
84
+  uni.reLaunch({
85
+    url: '/pages/dacang/list/index' // tabBar 页面路径
86
+  });
87
+}
88
+
89
+function handleSelectAll(checked: boolean) {
90
+
91
+  cartAllCheck('all')
92
+
93
+}
94
+function cartAllCheck(type: 'single' | 'all') {
95
+  let totalNum = 0
96
+  if (type === 'single') {
97
+    // 如果单选的情况下, 获取已选中的
98
+    let tempArr = list.value.filter(Item => {
99
+      // if (goodItem.check) {
100
+      return Item.isSelected === true
101
+      // }
102
+    })
103
+    // console.log(tempArr)
104
+    type_ids.value = tempArr?.map((item) => item.type_id) || [];
105
+    if (list.value.length === tempArr.length) {
106
+      isAllSelect.value = true
107
+      // goods.indeterminate = false
108
+    }
109
+    if (tempArr.length < list.value.length) {
110
+      isAllSelect.value = false
111
+    }
112
+    if (tempArr.length <= 0) {
113
+      isAllSelect.value = false
114
+    }
115
+
116
+  } else {
117
+    list.value.forEach(goodItem => {
118
+      goodItem.isSelected = isAllSelect.value
119
+    })
120
+    if (isAllSelect.value) {
121
+      type_ids.value = list.value?.map((item) => item.type_id) || [];
122
+      console.log(type_ids.value);
123
+
124
+
125
+    }
126
+  }
127
+
128
+  // 总金额|总数
129
+  list.value.filter(goodItem => {
130
+    if (goodItem.isSelected) {
131
+      totalNum += 1
132
+    }
133
+  })
134
+
135
+  state.totalNum = totalNum
136
+  // console.log(type_ids);
137
+  // console.log(state.totalNum);
138
+
139
+}
140
+//批量取消收藏
141
+function handleBatch() {
142
+  console.log(type_ids.value);
143
+  // batchremoveMyRelation
144
+  uni.showModal({
145
+    title: '提示',
146
+    content: `确定取消收藏这${state.totalNum}种商品吗?`,
147
+    success: (res) => {
148
+      if (res.confirm) {
149
+        batchremoveMyRelation({
150
+          type: 1,
151
+          type_id: type_ids.value
152
+        }).then(delRes => {
153
+          return uni.showToast({
154
+            title: '取消收藏成功',
155
+            icon: 'success'
156
+          }).then(() => {
157
+            loadMyFavorite()
158
+            // if (list) {
159
+            //   list.value.splice(index, 1)
160
+            // }
161
+          })
162
+        })
163
+      }
164
+    }
165
+  })
166
+}
167
+
168
+//单选添加type_id
169
+function handleGoodsItemCheck(type_id: any) {
170
+  cartAllCheck('single')
171
+}
172
+
173
+
174
+// 下拉刷新
175
+onPullDownRefresh(() => {
176
+  uni.showLoading({
177
+    title: '加载中',
178
+    icon: 'none'
179
+  })
180
+  loadMyFavorite()
181
+  uni.stopPullDownRefresh()
182
+  uni.hideLoading()
183
+})
184
+
55 185
 </script>
56 186
 
57 187
 <template>
58
-  <div>
59
-    <div class="bg-white ">
60
-<!--      <FSearch />-->
61
-      <nut-searchbar
62
-          class="absolute top-0"
63
-          v-model="searchValue" @search="loadMyFavorite( searchValue)" @clear="loadMyFavorite( '')">
64
-        <template v-slot:rightout>
65
-          <div @tap="loadMyFavorite(searchValue)">
66
-            搜索
188
+  <div v-if="list && list.length > 0">
189
+    <div class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end ">
190
+      <div class="pr-3">
191
+        <FButton size="small" @click="handleManage">
192
+          <div>{{ state.isManage ? '完成' : '管理' }}</div>
193
+        </FButton>
194
+      </div>
195
+    </div>
196
+    <div style="background-color: #f8f8f8;" class="mt-14">
197
+      <div class="bg-white flex  p-3" v-for="(item, index) in list" :key="index">
198
+        <div class="w-full flex">
199
+          <nut-checkbox v-if="state.isManage == true" v-model="item.isSelected" @change="handleGoodsItemCheck(item)"
200
+            label="单选" class="!text-primary"></nut-checkbox>
201
+          <div>
202
+            <image :src="item.image" mode="widthFix" class="w-15 h-15 rounded "></image>
203
+          </div>
204
+          <div class="flex flex-col text-sm px-3 justify-between w-full">
205
+            <div @click="handleShowDetail(item)">{{ item.store_name }}</div>
206
+            <div class="flex items-center justify-between">
207
+              <div class=" text-red font-bold">¥{{parseFloat(Number(item.price)).toFixed(2).replace(/\.?0+$/, '')  }}</div>
208
+              <div v-if="state.isManage == false" @tap="handleRemoveMyRelationProduct(item, index)"
209
+                class="border border-solid border-red rounded-full px-2 text-[10px] text-red">
210
+                取消收藏
211
+              </div>
212
+            </div>
67 213
           </div>
68
-        </template>
69
-      </nut-searchbar>
214
+        </div>
215
+
216
+      </div>
217
+    </div>
218
+    <div v-if="state.isManage == true" class="bg-white fixed bottom-0 w-full z-3 pb-10">
219
+      <div class="bg-white h-10 flex justify-between">
220
+        <div class="flex justify-center items-center gap-2 pl-3" @click="handleSelectAll">
221
+          <nut-checkbox v-model="isAllSelect" label="全选" class="!text-primary">全选
222
+          </nut-checkbox>
223
+          <!-- <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div> -->
224
+        </div>
225
+
226
+        <div class="flex justify-center items-center gap-2 pr-3">
227
+          <div class="flex text-[12px]" v-if="state.isManage">
228
+            <span v-if="state.totalNum != 0 && state.isManage">已选{{ state.totalNum }}件</span>
229
+          </div>
230
+          <FButton :disabled="state.totalNum == 0" @click="handleBatch" size="small"
231
+            :exClass="['rounded-full', '!text-[14px]', 'text-white', 'bg-primary', 'w-full']">
232
+            取消收藏
233
+          </FButton>
234
+        </div>
235
+      </div>
236
+    </div>
237
+  </div>
238
+  <div v-else class="unshowsc  flex flex-col justify-between items-center">
239
+    <div class="img_d mb-2">
240
+      <image :src="myshowcimg" style="width: 100%; height: 100%;"></image>
70 241
     </div>
71
-    <div v-if="list && list.length > 0">
72
-     <div class="bg-white flex p-3" v-for="(item, index) in list" :key="index">
73
-       <div class="w-full flex">
74
-         <div>
75
-           <image :src="item.image" mode="widthFix" class="w-15 h-15 rounded "></image>
76
-         </div>
77
-         <div class="flex flex-col text-sm px-3 justify-between w-full">
78
-           <div @click="handleShowDetail(item)">{{ item.store_name }}</div>
79
-           <div class="flex items-center justify-between">
80
-             <div class=" text-red font-bold">¥{{ item.price }}</div>
81
-             <div
82
-                 @tap="handleRemoveMyRelationProduct(item, index)"
83
-                 class="border border-solid border-red rounded-full px-2 text-[10px] text-red">
84
-               取消收藏
85
-             </div>
86
-           </div>
87
-         </div>
88
-       </div>
89
-
90
-     </div>
242
+    <div class="text_t">
243
+      您还没有收藏任何商品
91 244
     </div>
92
-    <div v-else>
93
-      <CXBEmpty />
245
+    <div @click="handleTodacang" class="mt-6 button_t ">
246
+      去逛逛
94 247
     </div>
95 248
   </div>
96 249
 </template>
@@ -99,8 +252,47 @@ function handleRemoveMyRelationProduct(item: MyRelationProductModel, index: numb
99 252
 page {
100 253
   background-color: #f8f8f8;
101 254
 }
255
+
256
+.unshowsc {
257
+  width: 350rpx;
258
+  height: 350rpx;
259
+  position: absolute;
260
+  top: 25%;
261
+  left: 50%;
262
+  margin-left: -175rpx;
263
+  text-align: center;
264
+}
265
+
266
+.img_d {
267
+  width: 206rpx;
268
+  height: 206rpx;
269
+}
270
+
271
+.text_t {
272
+  width: 300rpx;
273
+  height: 30rpx;
274
+  font-size: 30rpx;
275
+  font-family: PingFangSC, PingFang SC;
276
+  font-weight: 400;
277
+  color: #333333;
278
+  line-height: 30rpx;
279
+}
280
+
281
+.button_t {
282
+  width: 350rpx;
283
+  height: 82rpx;
284
+  background: linear-gradient(179deg, #FE7577 0%, #FE0032 100%);
285
+  border-radius: 42rpx;
286
+  font-size: 32rpx;
287
+  font-family: PingFangSC, PingFang SC;
288
+  font-weight: 400;
289
+  color: #FFFFFF;
290
+  line-height: 82rpx;
291
+  text-align: center;
292
+}
102 293
 </style>
103 294
 <route lang="yaml">
104 295
 style:
105 296
   navigationBarTitleText: 我的收藏
106
-</route>
297
+  enablePullDownRefresh: true
298
+</route>

+ 219 - 178
src/pages/my-rules/index.vue

@@ -4,6 +4,7 @@ import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
4 4
 
5 5
 import { encodePhone } from "../../utils";
6 6
 import { getAgentInfo, getRules, getUserInfo } from "~/apis/user";
7
+import { CDM_URL } from '~/config/app';
7 8
 
8 9
 const userStore = useUserStore()
9 10
 const ruleDetail = ref<{
@@ -15,123 +16,29 @@ const ruleDetail = ref<{
15 16
   status: string
16 17
   title: string
17 18
 }>()
19
+const nextRuleDetail = ref<{
20
+  admin_id: string
21
+  content: string
22
+  create_time: string
23
+  is_del: string
24
+  notice_id: string
25
+  status: string
26
+  title: string
27
+}>()
18 28
 
19
-const currentType = ref<any>([])
20
-
21
-const showUpgradeInfo = ref(false)
22
-
23
-// const userType = computed(() => {
24
-//   const userRichType = userStore.userInfo?.user_rich_type
25
-//   // console.log(userStore.userInfo)
26
-//   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
27
-//   // 创始人
28
-//   if (userRichType == 3) {
29
-//     if (bangfu) {
30
-//       return ['创始人', bangfu]
31
-//     }
32
-//     return ['创始人']
33
-//     // return [].push()
34
-//   }
35
-//   // 普通用户
36
-//   if (userRichType == 0) {
37
-//     if (bangfu) {
38
-//       return ['用户', bangfu]
39
-//     }
40
-//     return ['用户']
41
-//   }
42
-//   // 会员
43
-//   if (userRichType == 1) {
44
-//     if (bangfu) {
45
-//       return ['会员', bangfu]
46
-//     }
47
-//     return ['会员']
29
+const backImg = CDM_URL + '/image/2023-12-13/20231213140615288.png'
30
+const vipicon = CDM_URL + '/image/2023-12-13/20231213140633462.png '
31
+// https://cdn.bjtdba.com/vod/image/2023-12-13/20231213140615288.png  卡片
32
+// https://cdn.bjtdba.com/vod/image/2023-12-13/20231213140633462.png  卡片
33
+const showUpgradeInfo = ref(true)
48 34
 
49
-//   }
50
-//   if (userRichType == 3) {
51
-//     if (bangfu) {
52
-//       return ['创始人', bangfu]
53
-//     }
54
-//     return ['创始人']
55
-//   }
56
-//   // 合伙人
57
-//   if (userRichType == 4) {
58
-//     // return '高级会员'
59
-//     if (bangfu) {
60
-//       return ['VIP', bangfu]
61
-//     }
62
-//     return ['VIP']
63
-//   }
64
-//   if (userRichType == 5) {
65
-//     if (bangfu) {
66
-//       return ['初始级合伙人', bangfu]
67
-//     }
68
-//     return ['初始级合伙人']
69
-//   }
70
-//   if (userRichType == 6) {
71
-//     if (bangfu) {
72
-//       return ['中级合伙人', bangfu]
73
-//     }
74
-//     return ['中级合伙人']
75
-//   }
76
-//   if (userRichType == 7) {
77
-//     if (bangfu) {
78
-//       return ['高级合伙人', bangfu]
79
-//     }
80
-//     return ['高级合伙人']
81
-//   }
82
-//   if (!userRichType) {
83
-//     if (bangfu) {
84
-//       return ['用户', bangfu]
85
-//     }
86
-//     return ['用户']
87
-//   }
88
-// })
89
-// /*
90
-// const userType = computed(() => {
91
-//   const userRichType = userStore.userInfo?.user_rich_type
92
-
93
-//   // 创始人
94
-//   if (userRichType == 3) {
95
-//     return '创始人'
96
-//   }
97
-//   // 普通用户
98
-//   if (userRichType == 0) {
99
-//     return '用户'
100
-//   }
101
-//   // 会员
102
-//   if (userRichType == 1) {
103
-//     return '会员'
104
-//   }
105
-//   if (userRichType == 3) {
106
-//     return '创始人'
107
-//   }
108
-//   // 合伙人
109
-//   if (userRichType == 4) {
110
-//     // return '合伙人(VIP)'
111
-//     return 'VIP'
112
-//   }
113
-//   if (userRichType == 5) {
114
-//     return '初始级合伙人'
115
-//   }
116
-//   if (userRichType == 6) {
117
-//     return '中级合伙人'
118
-//   }
119
-//   if (userRichType == 7) {
120
-//     return '高级合伙人'
121
-//   }
122
-//   if (!userRichType) {
123
-//     return '用户'
124
-//   }
125
-// })
126
-// */
127 35
 
128
-//0:普通用户 1:会员  3:创始人 4:高级会员  8合伙人 9联合创始人
129 36
 const userType = computed(() => {
130 37
   const userRichType = userStore.userInfo?.user_rich_type
131 38
   // console.log('我是大哥',userStore.userInfo)
132 39
   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
133 40
   // console.log('我是帮扶',bangfu);
134
-  
41
+
135 42
   // 普通用户
136 43
   if (userRichType == 0) {
137 44
     // if (bangfu) {
@@ -147,7 +54,7 @@ const userType = computed(() => {
147 54
     return ['../../static/img-hy/会员.png']
148 55
 
149 56
   }
150
-    // 创始人
57
+  // 创始人
151 58
   if (userRichType == 3) {
152 59
     // if (bangfu) {
153 60
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
@@ -181,6 +88,7 @@ const userType = computed(() => {
181 88
     return ['']
182 89
   }
183 90
 })
91
+
184 92
 //0:普通用户 1:股东
185 93
 // const AlholderType = computed(() => {
186 94
 //   const stockholder = userStore.userInfo?.stockholder
@@ -193,7 +101,7 @@ const userType = computed(() => {
193 101
 //   if (stockholder == 1) {
194 102
 //     return ['../../static/img-hy/股东.png']
195 103
 //   }
196
-  
104
+
197 105
 // })
198 106
 // '':普通用户 district-区/县代 city-市代',
199 107
 // const areaType = computed(() => {
@@ -211,10 +119,11 @@ const userType = computed(() => {
211 119
 //   if(!areamanage){
212 120
 //     return['']
213 121
 //   }
214
-  
122
+
215 123
 // })
216 124
 
217 125
 
126
+const showValue = ref(false)  //标识展示下一等级
218 127
 
219 128
 onLoad(async () => {
220 129
 
@@ -252,9 +161,10 @@ function handleShowAnnuityDetail() {
252 161
 const ruleId = computed(() => {
253 162
   const userRichType = userStore.userInfo?.user_rich_type
254 163
 
255
-  console.log('我是》》》',userRichType)
164
+  console.log('我是》》》', userRichType)
256 165
   // 创始人
257 166
   if (userRichType == 3) {
167
+    showUpgradeInfo.value = false
258 168
     return 21
259 169
   }
260 170
   // 用户
@@ -262,7 +172,7 @@ const ruleId = computed(() => {
262 172
     return 18
263 173
   }
264 174
   // 会员
265
-  if (userRichType ==1) {
175
+  if (userRichType == 1) {
266 176
     return 19
267 177
   }
268 178
   // 高级会员
@@ -270,14 +180,16 @@ const ruleId = computed(() => {
270 180
     return 20
271 181
   }
272 182
   // 合伙人
273
-  if (userRichType == 8 ) {
183
+  if (userRichType == 8) {
184
+    showUpgradeInfo.value = false
274 185
     return 24
275 186
   }
276 187
   //联合创始人
277
-  if (userRichType == 9 ) {
188
+  if (userRichType == 9) {
189
+    showUpgradeInfo.value = false
278 190
     return 22
279 191
   }
280
-  
192
+
281 193
 })
282 194
 const agentInfo = ref({})
283 195
 
@@ -286,8 +198,8 @@ onShow(() => {
286 198
   if (ruleId.value) {
287 199
     // console.log(ruleId.value)
288 200
     getRules(ruleId.value).then(res => {
289
-      console.log(1111111222,res);
290
-      
201
+      console.log(1111111222, res);
202
+
291 203
       ruleDetail.value = res
292 204
     }).catch(error => {
293 205
       uni.showToast({
@@ -303,71 +215,78 @@ onShow(() => {
303 215
 })
304 216
 
305 217
 function handleUserUpgrade() {
306
-  console.log('ruleid',ruleId.value);
307
-  
218
+  showValue.value = true
219
+  console.log('ruleid', ruleId.value);
220
+
308 221
   if (ruleId.value < 20) {
309 222
     const id = ruleId.value + 1
310 223
     getRules(id).then(res => {
311
-      console.log('woshi111',res);
312
-      
313
-      ruleDetail.value = res
314
-      showUpgradeInfo.value = true
224
+      console.log('woshi111', res);
225
+
226
+      nextRuleDetail.value = res
315 227
     })
316
-  }else if(ruleId.value = 20){
228
+  } else if (ruleId.value = 20) {
317 229
     const id = ruleId.value + 4
318 230
     getRules(id).then(res => {
319
-      console.log('我是合伙人',res);
320
-      
321
-      ruleDetail.value = res
322
-      showUpgradeInfo.value = true
231
+      console.log('我是合伙人', res);
232
+
233
+      nextRuleDetail.value = res
323 234
     })
324 235
   }
325 236
 }
326 237
 
327 238
 function handleToVipPage() {
328 239
   uni.navigateTo({
329
-    url: '/pages/vip/index'
240
+    url: '/pages/vip/index?type=user'
330 241
   })
331 242
 }
243
+
244
+
245
+
246
+//关闭弹框
247
+function onCancel() {
248
+  // show.value = false
249
+
250
+  // console.log(showValue.value);
251
+
252
+  showValue.value = false
253
+  // console.log(showValue.value);
254
+}
255
+
256
+
332 257
 </script>
333 258
 <template>
334 259
   <div>
335
-    <div class="bg-[#FD1642] h-25 w-full absolute top-0 left-0"></div>
336
-    <div class="flex flex-col gap-4 relative px-3 pb-safe">
337
-      <div class="pt-5 ">
338
-        <div class="flex gap-2 mb-2 text-white mb-6">
339
-          <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar" mode="widthFix"
340
-            class="w-9 h-9 rounded-full"></image>
260
+
261
+    <div class="flex flex-col gap-4 relative  pb-safe">
262
+      <div class="">
263
+        <!-- 头像 -->
264
+        <div class="flex gap-2 mb-2 px-3 mb-6">
265
+          <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
266
+            class=" rounded-full" style="width: 102rpx; height: 102rpx;"></image>
341 267
 
342 268
           <div class="flex">
343
-            <div class="flex flex-col">
269
+            <div class="flex flex-col justify-between ">
344 270
               <div class="text-sm">
345
-                <div class="text-sm" v-if="userStore.userInfo">
271
+                <div class="text_sm" v-if="userStore.userInfo">
346 272
                   {{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录' }}
347 273
                 </div>
348 274
               </div>
349
-              <div class="text-xs" v-if="userStore.userInfo && userStore.userInfo.phone">
275
+              <div class="text_xs" v-if="userStore.userInfo && userStore.userInfo.phone">
350 276
                 {{ encodePhone(userStore.userInfo.phone) }}
351 277
               </div>
352 278
             </div>
353
-            <div class="flex gap-1 items-center px-1">
354
-              <div class="flex rounded-full  text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">
355
-                <image class="vip_img" :src="userType" v-if="userType"></image>
356
-                <!-- <image class="vip_img" :src="AlholderType" v-if="AlholderType
357
-                  "></image>
358
-                <image class="vip_img" :src="areaType" v-if="areaType"></image> -->
359
-              </div>
279
+            <div class="flex gap-1  px-1">
280
+              <image class="vip_img" :src="userType" v-if="userType"></image>
360 281
             </div>
361
-            <!--            <div-->
362
-            <!--                class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">-->
363
-            <!--              {{ userType }}-->
364
-            <!--            </div>-->
365 282
           </div>
366 283
 
367 284
 
368 285
         </div>
369
-        <div class="bg-white rounded flex flex-col gap-6 py-4 text-xl">
370
-          <div v-if="userStore.userInfo" class="flex flex-wrap">
286
+        <!-- 权益图 -->
287
+        <div style="width: 750rpx; height: 366rpx;" class="rounded flex flex-col gap-6  text-xl"
288
+          :style="{ background: 'url(' + backImg + ')', backgroundSize: 'cover' }">
289
+          <!-- <div v-if="userStore.userInfo" class="flex flex-wrap">
371 290
             <div @tap="handleShowAnnuityDetail" class="w-1/3 flex flex-col justify-center items-center">
372 291
               <div>{{ userStore.yanglao.all_yanglao }}</div>
373 292
               <div class="text-xs">养老金</div>
@@ -390,36 +309,81 @@ function handleToVipPage() {
390 309
               <div>{{ userStore.userInfo.team_number }}</div>
391 310
               <div class="text-xs">团队人数</div>
392 311
             </div>
312
+          </div> -->
313
+          <div v-if="userStore.userInfo" class="flex " style="padding-top: 60rpx; color: #ffffff; ">
314
+            <div @tap="handleShowAnnuityDetail" class="w-1/2 flex flex-col justify-center" style="padding-left: 68rpx;">
315
+              <div class="text-xs">养老金</div>
316
+              <div>{{ userStore.yanglao.all_yanglao }}</div>
317
+            </div>
318
+            <div @tap="handleShowMyInvitation" class="w-1/2  flex flex-col justify-center " style="padding-left: 48rpx;">
319
+              <div class="text-xs">我的佣金</div>
320
+              <div>{{ agentInfo.brokerage_price }}</div>
321
+            </div>
322
+          </div>
323
+          <div v-if="userStore.userInfo" class="flex" style="padding-top: 30rpx; color: #ffffff; ">
324
+            <div @tap="handleShowMyIntegral" class="w-1/3  flex flex-col justify-center " style="padding-left: 68rpx;">
325
+              <div class="text-xs">我的积分</div>
326
+              <div>{{ userStore.userInfo.score }}</div>
327
+            </div>
328
+            <div class="icon_d"></div>
329
+            <div @click="handleToRedIntegral" class="w-1/3 flex flex-col justify-center " style="padding-left: 48rpx;">
330
+              <div class="text-xs">红积分提现</div>
331
+              <div>{{ userStore.userInfo.member_brokerage_price }}</div>
332
+            </div>
333
+            <div class="icon_d"></div>
334
+            <div class="w-1/3 flex flex-col  justify-center" style="padding-left: 48rpx;">
335
+              <div class="text-xs">团队人数</div>
336
+              <div>{{ userStore.userInfo.team_number }}</div>
337
+            </div>
393 338
           </div>
394
-
395 339
         </div>
396 340
 
397 341
       </div>
398
-
399
-      <div v-if="ruleDetail && ruleDetail.content && !showUpgradeInfo" class="p-3 bg-white text-sm text-gray-500">
400
-        <mpHtml :content="ruleDetail.content"></mpHtml>
401
-      </div>
402
-      <div v-else class="p-3 bg-white text-sm text-gray-500">
403
-        <mpHtml :content="ruleDetail.content" v-if="ruleDetail && ruleDetail.content"></mpHtml>
404
-
405
-        <div class="flex justify-center items-center">
406
-          <nut-button @click="handleToVipPage" type="primary" size="small">立即开通</nut-button>
407
-
342
+      <div class="px-4 p_abls " style="border-radius: 16rpx; background: #f8f3f3;">
343
+        <div v-if="ruleDetail && ruleDetail.content" class="p-3 bg-white text-sm text-gray-500"
344
+          style="border-radius: 16rpx;">
345
+          <mpHtml :content="ruleDetail.content"></mpHtml>
346
+        </div>
347
+        <div class="text_more px-3 bg-white text-sm flex flex-col" style="margin-top: 26rpx; padding-top: 40rpx;"
348
+          v-if="showUpgradeInfo == true">
349
+          <div class="font-jlqy " style="margin-bottom: 30rpx;">更多奖励权益</div>
350
+          <div class="flex justify-between">
351
+            <div class="flex">
352
+              <div style="width: 78rpx; height: 78rpx;">
353
+                <image style="width: 100%;height: 100%;" :src="vipicon"></image>
354
+              </div>
355
+              <div>
356
+                <div class="viplevel">会员权益升级</div>
357
+                <div class="viplevels">享受福利翻倍</div>
358
+              </div>
359
+            </div>
360
+            <div @click="handleUserUpgrade" class="rewards">
361
+              了解更多
362
+            </div>
363
+          </div>
408 364
         </div>
409 365
       </div>
366
+      <FPopup v-if="showValue==true" v-model:show="showValue" @close="onCancel" position="bottom"
367
+        exClass="rounded-rt-xl rounded-lt-xl  min-h-[55%] max-h-[70%] h-full">
368
+        <div v-if="nextRuleDetail && nextRuleDetail.content" class="flex flex-col flex-1 justify-between px-3 h-full ">
369
+          <div>
370
+            <div class="pt-2 pr-1 flex justify-end flex-1">
371
+              <div style=" text-align: center; width: 42rpx; height: 42rpx;" @click="onCancel">
372
+                <image style="width: 100%; height: 100%" src="../../static/icon/guanbi.png"></image>
373
+              </div>
374
+            </div>
375
+            <div class="mt-6" v-html="nextRuleDetail.content"></div>
376
+          </div>
410 377
 
378
+          <div class="px-3 pb-10">
379
+            <FButton @click="handleToVipPage" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
380
+              立即升级
381
+            </FButton>
411 382
 
412
-
413
-      <div class="p-3 bg-white text-sm flex flex-col" v-if="!showUpgradeInfo">
414
-        <div class="font-bold">还有更多奖励权益</div>
415
-        <div class="flex justify-end">
416
-
417
-          <div @click="handleUserUpgrade"
418
-            class="text-[12px] border border-solid border-1px rounded px-1 border-gray text-gray-600">了解更多奖励</div>
383
+          </div>
419 384
         </div>
420
-      </div>
421
-
422 385
 
386
+      </FPopup>
423 387
 
424 388
     </div>
425 389
   </div>
@@ -427,10 +391,9 @@ function handleToVipPage() {
427 391
 
428 392
 <route lang="yaml">
429 393
 style:
430
-  navigationBarBackgroundColor: "#FD1642"
394
+  navigationBarBackgroundColor: "#f8f3f3"
431 395
   navigationBarTitleText: 储蓄保
432
-  enablePullDownRefresh: true
433
-  navigationBarTextStyle: "white"
396
+  enablePullDownRefresh: false
434 397
 
435 398
 </route>
436 399
 
@@ -439,9 +402,87 @@ page {
439 402
   background: #f5f5f5;
440 403
 }
441 404
 
405
+.text_sm {
406
+  height: 45rpx;
407
+  font-size: 32rpx;
408
+  font-family: PingFangSC, PingFang SC;
409
+  font-weight: 500;
410
+  color: #333333;
411
+  line-height: 45rpx
412
+}
413
+
414
+.text_xs {
415
+  height: 33rpx;
416
+  font-size: 24rpx;
417
+  font-family: PingFangSC, PingFang SC;
418
+  font-weight: 400;
419
+  color: #333333;
420
+  line-height: 33rpx;
421
+}
422
+
423
+.p_abls {
424
+  position: absolute;
425
+  top: 468rpx;
426
+}
427
+
442 428
 .vip_img {
443
-  width: 48px;
444
-  height: 24px;
429
+  width: 124rpx;
430
+  height: 56rpx;
445 431
   margin-left: 2px;
446 432
 }
433
+
434
+.icon_d {
435
+  width: 1rpx;
436
+  height: 40rpx;
437
+  background: rgba(255, 255, 255, 0.4);
438
+  ;
439
+}
440
+
441
+
442
+.text_more {
443
+  height: 202rpx;
444
+  background: #FFFFFF;
445
+  box-shadow: 0rpx 7rpx 33rpx 0rpx rgba(229, 183, 183, 0.34);
446
+  border-radius: 16rpx;
447
+}
448
+
449
+.font-jlqy {
450
+  height: 30rpx;
451
+  font-size: 30rpx;
452
+  font-family: PingFangSC, PingFang SC;
453
+  font-weight: 700;
454
+  color: #333333;
455
+  line-height: 30rpx;
456
+}
457
+
458
+.viplevel {
459
+  height: 30rpx;
460
+  font-size: 30rpx;
461
+  font-family: PingFangSC, PingFang SC;
462
+  font-weight: 400;
463
+  color: #333333;
464
+  line-height: 30rpx;
465
+}
466
+
467
+.viplevels {
468
+  height: 30rpx;
469
+  font-size: 25rpx;
470
+  font-family: PingFangSC, PingFang SC;
471
+  font-weight: 400;
472
+  color: #666666;
473
+  line-height: 30rpx;
474
+}
475
+
476
+.rewards {
477
+  width: 148rpx;
478
+  height: 58rpx;
479
+  border-radius: 30rpx;
480
+  border: 1rpx solid #FE0032;
481
+  color: #FE0032;
482
+  line-height: 58rpx;
483
+  font-size: 26rpx;
484
+  font-family: PingFangSC, PingFang SC;
485
+  font-weight: 400;
486
+  text-align: center;
487
+}
447 488
 </style>

+ 97 - 111
src/pages/order-confirm/index.vue

@@ -1,15 +1,15 @@
1 1
 <script setup lang="ts">
2
-import {getUserAddressDetail, getUserAddressList, getUserVipInfo} from "~/apis/user";
3
-import {reactive} from "vue";
4
-import {cartChange, checkProductDaCang, CreateOrderRequest, orderCheck, orderCreate} from "~/apis/order.api";
2
+import { getUserAddressDetail, getUserAddressList, getUserVipInfo } from "~/apis/user";
3
+import { reactive } from "vue";
4
+import { cartChange, checkProductDaCang, CreateOrderRequest, orderCheck, orderCreate } from "~/apis/order.api";
5 5
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7 7
 import CXBYaojinTag from "~/components/CXBYaojinTag/CXBYaojinTag.vue";
8 8
 import FCell from "~/components/FCell/FCell.vue";
9
-import {encodePhone} from "~/utils";
10
-import {CDN_URL} from "~/config/app";
11
-import {useAddressStore} from "~/stores/addressStore";
12
-import {useThrottle} from "@vueuse/core";
9
+import { encodePhone } from "~/utils";
10
+import { CDN_URL } from "~/config/app";
11
+import { useAddressStore } from "~/stores/addressStore";
12
+import { useThrottle } from "@vueuse/core";
13 13
 import FField from "~/components/FField/FField.vue";
14 14
 const addressIcon = CDN_URL + '/static/assets/dingwi_220624.png'
15 15
 // const addressInfo = ref({})
@@ -60,7 +60,7 @@ onLoad(async (options) => {
60 60
   //   })
61 61
   // }
62 62
   const res = await getUserAddressList()
63
-  console.log('我可是res啊',res)
63
+  console.log('我可是res啊', res)
64 64
   if (res.list && res.list.length > 0) {
65 65
     data.addressInfo = res.list[0]
66 66
     data.addressId = res.list[0].address_id
@@ -90,7 +90,7 @@ onLoad(async (options) => {
90 90
     cart_id: data.cartId.split(','),
91 91
     address_id: data.addressId
92 92
   }).then(res => {
93
-    console.log(res)
93
+    console.log(15999999, res)
94 94
     data.is_dacang_vip_product = res.is_dacang_vip_product
95 95
     data.cartOrder = res.order
96 96
     data.totalPrice = res.order_price
@@ -147,9 +147,9 @@ function handleSubmit() {
147 147
     // 优惠券
148 148
     // coupon:
149 149
     // pay_type;//支付方式:0: 余额;1: 微信;2: 小程序;4: 支付宝;5: 特殊商户积分
150
-    pay_type:  data.type && data.type == '3' ? '5' : '2',
150
+    pay_type: data.type && data.type == '3' ? '5' : '2',
151 151
     // pay_type: data.type,
152
-    mer_id: data.type && data.type == '3' ? '148': '',
152
+    mer_id: data.type && data.type == '3' ? '148' : '',
153 153
     // 用户留言
154 154
     mark: data.mark,
155 155
     // take: [],
@@ -189,8 +189,8 @@ function payment(createOrderData: CreateOrderRequest) {
189 189
           }, 500)
190 190
         })
191 191
         // uni.navigateTo({
192
-          //   // url: '/pages/payment/index?' + `cardId=${data.cartId}&type=1&product_id=${data.productId}`
193
-          // url: '/pages/payment/index?' + `pay_price=${res.groupOrder.pay_price}&order_id=${res.order_id}&OrderList=${JSON.stringify(res.groupOrder)}`
192
+        //   // url: '/pages/payment/index?' + `cardId=${data.cartId}&type=1&product_id=${data.productId}`
193
+        // url: '/pages/payment/index?' + `pay_price=${res.groupOrder.pay_price}&order_id=${res.order_id}&OrderList=${JSON.stringify(res.groupOrder)}`
194 194
         // })
195 195
       }
196 196
     }).catch(err => {
@@ -247,12 +247,12 @@ function reTotal() {
247 247
     cart_id: data.cartId.split(','),
248 248
     address_id: data.addressId
249 249
   }).then(res => {
250
-    console.log('我可是res啊',res)
250
+    console.log('我可是res啊', res)
251 251
     data.is_dacang_vip_product = res.is_dacang_vip_product
252 252
     data.cartOrder = res.order
253
-    console.log('data.cartOrder',data.cartOrder);
254
-    
255
-    
253
+    console.log('data.cartOrder', data.cartOrder);
254
+
255
+
256 256
     data.totalPrice = res.order_price
257 257
     data.orderStatus = res.status
258 258
     // data.proPrice = res.proPrice
@@ -287,124 +287,110 @@ function reTotal() {
287 287
 }
288 288
 </script>
289 289
 <template>
290
-    <div class="p-3 flex flex-col gap-3 pb-safe">
291
-      <div
292
-          @click="handleAddressSelect"
293
-          class="rounded bg-white p-3 flex">
294
-        <div class="flex flex-col flex-1 gap-2">
295
-          <div class="flex items-center gap-2">
296
-            <div class="flex text-sm text-gray-500 justify-between items-center w-full">
297
-              <div class="flex-1 flex items-center gap-2">
298
-                <div class="w-fit flex">
299
-                  <image :src="addressIcon" mode="aspectFit" class="w-4 h-4"></image>
300
-                </div>
301
-                <div class="flex-1 flex" v-if="data.addressId">
302
-                  {{ data.addressInfo.province + ' ' + data.addressInfo.city + ' ' + data.addressInfo.district + ' ' + data.addressInfo.detail }}
303
-                </div>
304
-                <div v-else class="flex-1 flex">
305
-                  请选择收货地址
306
-                </div>
290
+  <div class="p-3 flex flex-col gap-3 pb-safe">
291
+    <div @click="handleAddressSelect" class="rounded bg-white p-3 flex">
292
+      <div class="flex flex-col flex-1 gap-2">
293
+        <div class="flex items-center gap-2">
294
+          <div class="flex text-sm text-gray-500 justify-between items-center w-full">
295
+            <div class="flex-1 flex items-center gap-2">
296
+              <div class="w-fit flex">
297
+                <image :src="addressIcon" mode="aspectFit" class="w-4 h-4"></image>
298
+              </div>
299
+              <div class="flex-1 flex" v-if="data.addressId">
300
+                {{ data.addressInfo.province + ' ' + data.addressInfo.city + ' ' + data.addressInfo.district + ' ' +
301
+                  data.addressInfo.detail }}
307 302
               </div>
303
+              <div v-else class="flex-1 flex">
304
+                请选择收货地址
305
+              </div>
306
+            </div>
308 307
 
309
-              <div class="w-4 flex i-tabler-chevron-right text-gray"></div>
308
+            <div class="w-4 flex i-tabler-chevron-right text-gray"></div>
310 309
 
311
-            </div>
312 310
           </div>
313
-<!--          <div class="flex text-sm font-bold">{{ data.addressInfo.detail }}</div>-->
314
-          <div class="flex gap-2 items-center text-xs text-gray-500">
315
-            <div>
316
-              {{ data.addressInfo.real_name }}
317
-            </div>
318
-            <div v-if="data.addressInfo && data.addressInfo.phone">
319
-              {{ encodePhone(data.addressInfo.phone) }}
320
-            </div>
311
+        </div>
312
+        <!--          <div class="flex text-sm font-bold">{{ data.addressInfo.detail }}</div>-->
313
+        <div class="flex gap-2 items-center text-xs text-gray-500">
314
+          <div>
315
+            {{ data.addressInfo.real_name }}
316
+          </div>
317
+          <div v-if="data.addressInfo && data.addressInfo.phone">
318
+            {{ encodePhone(data.addressInfo.phone) }}
321 319
           </div>
322 320
         </div>
323 321
       </div>
322
+    </div>
324 323
 
325
-      <div class="pb-15">
326
-        <div v-for="(item, index) in data.cartOrder" :key="index"
327
-             class=" bg-white rounded"
328
-        >
329
-          <div class="flex items-center gap-2 text-sm font-bold f-hairline-bottom p-3">
330
-            <image :src="item.mer_avatar" mode="widthFix" class="w-5 h-5"></image>
331
-            <div>{{ item.mer_name }}</div>
332
-<!--            <div>{{ item.mer_id}}</div>-->
333
-          </div>
334
-
335
-          <div v-for="(orderProductItem, orderProductItemIndex) in item.list" :key="orderProductItemIndex">
336
-            <div class="p-3 flex gap-3 f-hairline-bottom">
337
-              <div>
338
-                <image :src="orderProductItem.product.image" mode="aspectFit" class="rounded w-20 h-20"></image>
324
+    <div class="pb-15">
325
+      <div v-for="(item, index) in data.cartOrder" :key="index" class=" bg-white rounded">
326
+        <div class="flex items-center gap-2 text-sm font-bold f-hairline-bottom p-3">
327
+          <image :src="item.mer_avatar" mode="widthFix" class="w-5 h-5"></image>
328
+          <div>{{ item.mer_name }}</div>
329
+          <!--            <div>{{ item.mer_id}}</div>-->
330
+        </div>
339 331
 
340
-              </div>
341
-              <div class="flex flex-col w-full">
342
-                <div class="flex flex-col ">
343
-                  <div class="line-clamp-1 text-xs">
344
-                    {{ orderProductItem.product.store_name }}
345
-                  </div>
346
-                  <div class="text-[11px] text-gray-500">{{ orderProductItem.productAttr.sku }}</div>
347
-                </div>
348
-                <div class="flex">
349
-                  <CXBYaojinTag :amount="orderProductItem.yanglao" v-if="item.mer_id != '148'"/>
332
+        <div v-for="(orderProductItem, orderProductItemIndex) in item.list" :key="orderProductItemIndex">
333
+          <div class="p-3 flex gap-3 f-hairline-bottom">
334
+            <div>
335
+              <image :src="orderProductItem.product.image" mode="aspectFit" class="rounded w-20 h-20"></image>
350 336
 
337
+            </div>
338
+            <div class="flex flex-col w-full">
339
+              <div class="flex flex-col ">
340
+                <div class="line-clamp-1 text-xs">
341
+                  {{ orderProductItem.product.store_name }}
351 342
                 </div>
352
-                <div class="flex justify-between ">
353
-                  <FPrice :price="orderProductItem.productAttr.price" v-if="item.mer_id != '148'"></FPrice>
354
-                  <FPrice :price="orderProductItem.productAttr.price * 30" v-if="item.mer_id == '148'"  symbol="积分" position="after"></FPrice>
355
-                  <nut-input-number v-model="orderProductItem.cart_num" @change="(num) => handleNumberChange(num, orderProductItem)"/>
343
+                <div class="text-[11px] text-gray-500">{{ orderProductItem.productAttr.sku }}</div>
344
+              </div>
345
+              <div class="flex">
346
+                <CXBYaojinTag :amount="orderProductItem.yanglao" v-if="item.mer_id != '148'" />
356 347
 
357
-                </div>
358 348
               </div>
349
+              <div class="flex justify-between ">
350
+                <div v-if="item.mer_id != '148'" style="color:#fa4032">¥{{ orderProductItem.productAttr.price }}</div>
351
+                <div v-if="item.mer_id == '148'" style="color:#fa4032">{{ Math.round(orderProductItem.productAttr.price *
352
+                  30) }}积分</div>
353
+                <nut-input-number v-model="orderProductItem.cart_num"
354
+                  @change="(num) => handleNumberChange(num, orderProductItem)" />
359 355
 
356
+              </div>
360 357
             </div>
361 358
 
362 359
           </div>
363
-          <div>
364
-            <!-- 优惠券数据 先写死 -->
365
-            <FCell
366
-                v-if="item.mer_id != '148'"
367
-                title="优惠劵"
368
-                :value="item.order.youhui_price!=0 ? item.order.youhui_price : '暂无优惠券'"
369
-                arrow
370
-                @click="gotoCoupon"
371
-            ></FCell>
372
-            <FCell
373
-                v-if="item.mer_id == '148'"
374
-                title="积分"
375
-                :value="userStore.userInfo.score!='0' ? userStore.userInfo.score : '暂无积分'"
376
-                arrow
377
-            ></FCell>
378
-            <FCell
379
-                title="运费"
380
-                :value="item.order.postage_price > 0 ? item.order.postage_price : '免运费'"
381
-                arrow
382
-            ></FCell>
383
-<!--            <FCell-->
384
-<!--                title="留言"-->
385
-<!--                value="建议留言前先与商家沟通确认"-->
386
-<!--                arrow-->
387
-<!--            ></FCell>-->
388
-            <FField label="留言" placeholder="建议留言前先与商家沟通确认" v-model="data.mark" :exClass="['text-right']"/>
389
-          </div>
390 360
 
391 361
         </div>
362
+        <div>
363
+          <!-- 优惠券数据 先写死 -->
364
+          <FCell v-if="item.mer_id != '148'" title="优惠劵"
365
+            :value="item.order.youhui_price != 0 ? item.order.youhui_price : '暂无优惠券'" arrow @click="gotoCoupon"></FCell>
366
+          <FCell v-if="item.mer_id == '148'" title="积分"
367
+            :value="userStore.userInfo.score != '0' ? userStore.userInfo.score : '暂无积分'" arrow></FCell>
368
+          <FCell title="运费" :value="item.order.postage_price > 0 ? item.order.postage_price : '免运费'" arrow></FCell>
369
+          <!--            <FCell-->
370
+          <!--                title="留言"-->
371
+          <!--                value="建议留言前先与商家沟通确认"-->
372
+          <!--                arrow-->
373
+          <!--            ></FCell>-->
374
+          <FField label="留言" placeholder="建议留言前先与商家沟通确认" v-model="data.mark" :exClass="['text-right']" />
375
+        </div>
376
+
392 377
       </div>
393 378
     </div>
379
+  </div>
394 380
 
395
-    <div class="fixed bottom-0 pb-safe w-full bg-white">
396
-      <div class="flex justify-between items-center p-3">
397
-        <div class="flex-1 flex text-sm font-bold">
398
-          应付金额:
399
-          <FPrice v-if="data.type && data.type == '3'" :price="data.totalPrice * 30" symbol="积分" position="after"></FPrice>
400
-         <FPrice  v-else :price="data.totalPrice"></FPrice>
401
-        </div>
402
-        <div class="flex">
403
-          <nut-button type="primary" @click="handleSubmit">提交订单</nut-button>
404
-        </div>
381
+  <div class="fixed bottom-0 pb-safe w-full bg-white">
382
+    <div class="flex justify-between items-center p-3">
383
+      <div class="flex-1 flex text-sm font-bold">
384
+        应付金额:
385
+        <div style="color:#fa4032" v-if="data.type && data.type == '3'">{{  Math.round(data.totalPrice * 30) }}积分</div>
386
+        <div style="color:#fa4032" v-else>¥{{ data.totalPrice }}</div>
387
+      </div>
388
+      <div class="flex">
389
+        <nut-button type="primary" @click="handleSubmit">提交订单</nut-button>
405 390
       </div>
406
-
407 391
     </div>
392
+
393
+  </div>
408 394
 </template>
409 395
 
410 396
 <route lang="yaml">

+ 34 - 11
src/pages/order/components/AllItemList.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {getAllOrder} from "~/apis/order.api";
2
+import { getAllOrder } from "~/apis/order.api";
3 3
 import OrderItem from "~/pages/order/components/OrderItem.vue";
4 4
 import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
@@ -14,7 +14,8 @@ const state = reactive({
14 14
   currentPage: 1,
15 15
   pageSize: 10,
16 16
   totalPage: 1,
17
-  list: []
17
+  list: [],
18
+  status: ''
18 19
 })
19 20
 
20 21
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -34,7 +35,15 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
34 35
     page: state.currentPage,
35 36
     limit: state.pageSize
36 37
   }).then(res => {
37
-    console.log('>>>>>',res)
38
+    console.log('>>>>>', res)
39
+    if (res.list.length <= 0) {
40
+      uni.$emit('changeShowLike')
41
+      console.log('没有数据');
42
+      return
43
+    }
44
+    if(res.count< state.pageSize){
45
+      uni.$emit('changeShowLike')
46
+    }
38 47
     if (action === 'page') {
39 48
       state.list = state.list.concat(res.list)
40 49
     }
@@ -42,13 +51,19 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
42 51
       state.list = res.list
43 52
     }
44 53
     state.totalPage = Math.ceil(res.total / state.pageSize);
45
-
46 54
     state.status = 'more'
47 55
     if (callback) {
48 56
       callback(res.list)
49 57
     }
50 58
   })
51 59
 }
60
+watch(() => state.status, (newStatus, oldStatus) => {
61
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
62
+
63
+  if (newStatus === 'noMore') {
64
+    uni.$emit('changeShowLike');
65
+  }
66
+});
52 67
 
53 68
 function handleScrollToLower() {
54 69
   state.status = 'loading';
@@ -56,6 +71,7 @@ function handleScrollToLower() {
56 71
 
57 72
   if (state.currentPage > state.totalPage) {
58 73
     state.status = 'noMore';
74
+
59 75
   } else {
60 76
     setTimeout(() => {
61 77
       loadList('page')
@@ -82,6 +98,9 @@ function handleScrollToLower() {
82 98
 //   })
83 99
 // })
84 100
 onMounted(() => {
101
+  uni.showLoading({
102
+    title: '加载中'
103
+  });
85 104
   loadList('reload')
86 105
   uni.$on('orderCancelFromList', () => {
87 106
     // loadAllOrderList()
@@ -101,6 +120,13 @@ onMounted(() => {
101 120
       }, 300)
102 121
     })
103 122
   })
123
+  uni.$on('AllreloadList', () => {
124
+    console.log('收到事件 reloadList');
125
+    // 在这里可以执行你的逻辑,比如调用 loadList 函数
126
+    // 请注意,这里的 this 指向当前页面实例
127
+    loadList('reload');
128
+  });
129
+  uni.hideLoading()
104 130
 })
105 131
 
106 132
 onUnmounted(() => {
@@ -116,11 +142,10 @@ onUnmounted(() => {
116 142
   <div class="p-3 flex flex-col">
117 143
     <div v-if="state.list.length > 0" class="flex flex-col gap-3">
118 144
       <div v-for="(orderItem, index) in state.list" :key="index">
119
-        <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>
120
-        <OtherOrderItem :item="orderItem" v-else/>
145
+        <OrderItem :receivegoods="0" :order-item="orderItem" v-if="orderItem.source == 7" />
146
+        <OtherOrderItem :item="orderItem" v-else />
121 147
       </div>
122
-      <div class=" flex justify-center items-center text-[12px] text-gray-500"
123
-           v-if="state.list && state.list.length > 0">
148
+      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
124 149
         <div v-if="state.status === 'loading'">
125 150
           加载中...
126 151
         </div>
@@ -130,10 +155,8 @@ onUnmounted(() => {
130 155
       </div>
131 156
     </div>
132 157
     <div v-else class="flex flex-col  justify-center items-center w-full">
133
-      <CXBEmpty/>
158
+      <CXBEmpty />
134 159
 
135 160
     </div>
136 161
   </div>
137
-
138
-
139 162
 </template>

+ 28 - 9
src/pages/order/components/ObligationOrderList.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {getAllOrder, getGroupOrderList} from "~/apis/order.api";
2
+import { getAllOrder, getGroupOrderList } from "~/apis/order.api";
3 3
 import OrderItem from "~/pages/order/components/OrderItem.vue";
4 4
 import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
@@ -14,7 +14,7 @@ const state = reactive({
14 14
   currentPage: 1,
15 15
   pageSize: 10,
16 16
   totalPage: 1,
17
-  status: 'noMore',
17
+  status: '',
18 18
 
19 19
   list: []
20 20
 })
@@ -35,6 +35,15 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
35 35
     page: state.currentPage,
36 36
     limit: state.pageSize
37 37
   }).then(res => {
38
+    console.log('>>>>>>111', res);
39
+    if (res.list.length <= 0) {
40
+      uni.$emit('changeShowLike')
41
+      console.log('没有数据');
42
+      return
43
+    }
44
+    if(res.count< state.pageSize){
45
+      uni.$emit('changeShowLike')
46
+    }
38 47
     if (action === 'page') {
39 48
       state.list = state.list.concat(res.list)
40 49
     }
@@ -49,6 +58,13 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
49 58
     }
50 59
   })
51 60
 }
61
+watch(() => state.status, (newStatus, oldStatus) => {
62
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
63
+
64
+  if (newStatus === 'noMore') {
65
+    uni.$emit('changeShowLike');
66
+  }
67
+});
52 68
 
53 69
 function handleScrollToLower() {
54 70
   state.status = 'loading';
@@ -80,6 +96,12 @@ onMounted(() => {
80 96
       }, 300)
81 97
     })
82 98
   })
99
+  uni.$on('dfkreloadList', () => {
100
+    console.log('收到事件 reloadList');
101
+    // 在这里可以执行你的逻辑,比如调用 loadList 函数
102
+    // 请注意,这里的 this 指向当前页面实例
103
+    loadList('reload');
104
+  });
83 105
 })
84 106
 
85 107
 onUnmounted(() => {
@@ -91,12 +113,11 @@ onUnmounted(() => {
91 113
   <div class="p-3 flex flex-col">
92 114
     <div v-if="state.list.length > 0" class="flex flex-col">
93 115
       <div v-for="(orderItem, index) in state.list" :key="index">
94
-<!--        <OrderItem :order-item="orderItem" />-->
95
-<!--        <OtherOrderItem :item="orderItem" v-else/>-->
96
-        <OrderObligationItem :order-item="orderItem" :tab-value="props.tabValue"/>
116
+        <!--        <OrderItem :order-item="orderItem" />-->
117
+        <!--        <OtherOrderItem :item="orderItem" v-else/>-->
118
+        <OrderObligationItem :order-item="orderItem" :tab-value="props.tabValue" />
97 119
       </div>
98
-      <div class=" flex justify-center items-center text-[12px] text-gray-500"
99
-           v-if="state.list && state.list.length > 0">
120
+      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
100 121
         <div v-if="state.status === 'loading'">
101 122
           加载中...
102 123
         </div>
@@ -110,6 +131,4 @@ onUnmounted(() => {
110 131
 
111 132
     </div>
112 133
   </div>
113
-
114
-
115 134
 </template>

+ 19 - 6
src/pages/order/components/Order2List.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {getOrderListFromStatus} from "~/apis/order.api";
2
+import { getOrderListFromStatus } from "~/apis/order.api";
3 3
 import OrderItem from "~/pages/order/components/OrderItem.vue";
4 4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5 5
 
@@ -12,7 +12,7 @@ const state = reactive({
12 12
   currentPage: 1,
13 13
   pageSize: 10,
14 14
   totalPage: 1,
15
-
15
+  status: '',
16 16
   list: []
17 17
 })
18 18
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -34,6 +34,14 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
34 34
     status: props.status,
35 35
   }).then(res => {
36 36
     console.log(res)
37
+    if (res.list.length <= 0) {
38
+      uni.$emit('changeShowLike')
39
+      console.log('没有数据');
40
+      return
41
+    }
42
+    if(res.count< state.pageSize){
43
+      uni.$emit('changeShowLike')
44
+    }
37 45
     if (action === 'page') {
38 46
       state.list = state.list.concat(res.list)
39 47
     }
@@ -49,6 +57,14 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
49 57
   })
50 58
 }
51 59
 
60
+watch(() => state.status, (newStatus, oldStatus) => {
61
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
62
+
63
+  if (newStatus === 'noMore') {
64
+    uni.$emit('changeShowLike');
65
+  }
66
+});
67
+
52 68
 function handleScrollToLower() {
53 69
   state.status = 'loading';
54 70
   state.currentPage += 1;
@@ -91,8 +107,7 @@ onUnload(() => {
91 107
         <OrderItem :order-item="orderItem" />
92 108
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->
93 109
       </div>
94
-      <div class=" flex justify-center items-center text-[12px] text-gray-500"
95
-           v-if="state.list && state.list.length > 0">
110
+      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
96 111
         <div v-if="state.status === 'loading'">
97 112
           加载中...
98 113
         </div>
@@ -106,6 +121,4 @@ onUnload(() => {
106 121
 
107 122
     </div>
108 123
   </div>
109
-
110
-
111 124
 </template>

+ 20 - 7
src/pages/order/components/Order3List.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {getOrderListFromStatus} from "~/apis/order.api";
2
+import { getOrderListFromStatus } from "~/apis/order.api";
3 3
 import OrderItem from "~/pages/order/components/OrderItem.vue";
4 4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5 5
 
@@ -12,7 +12,7 @@ const state = reactive({
12 12
   currentPage: 1,
13 13
   pageSize: 10,
14 14
   totalPage: 1,
15
-
15
+  status: '',
16 16
   list: []
17 17
 })
18 18
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -34,6 +34,14 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
34 34
     status: props.status,
35 35
   }).then(res => {
36 36
     console.log(res)
37
+    if (res.list.length <= 0) {
38
+      uni.$emit('changeShowLike')
39
+      console.log('没有数据');
40
+      return
41
+    }
42
+    if(res.count< state.pageSize){
43
+      uni.$emit('changeShowLike')
44
+    }
37 45
     if (action === 'page') {
38 46
       state.list = state.list.concat(res.list)
39 47
     }
@@ -69,6 +77,14 @@ function handleScrollToLower() {
69 77
   // }, 300)
70 78
 }
71 79
 
80
+watch(() => state.status, (newStatus, oldStatus) => {
81
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
82
+
83
+  if (newStatus === 'noMore') {
84
+    uni.$emit('changeShowLike');
85
+  }
86
+});
87
+
72 88
 // onReachBottom(() => {
73 89
 //   handleScrollToLower()
74 90
 //
@@ -105,11 +121,10 @@ onUnload(() => {
105 121
   <div class="p-3 flex flex-col">
106 122
     <div v-if="state.list.length > 0" class="flex flex-col gap-3">
107 123
       <div v-for="(orderItem, index) in state.list" :key="index">
108
-        <OrderItem :order-item="orderItem" />
124
+        <OrderItem :receivegoods="3" :order-item="orderItem" />
109 125
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->
110 126
       </div>
111
-      <div class=" flex justify-center items-center text-[12px] text-gray-500"
112
-           v-if="state.list && state.list.length > 0">
127
+      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
113 128
         <div v-if="state.status === 'loading'">
114 129
           加载中...
115 130
         </div>
@@ -123,6 +138,4 @@ onUnload(() => {
123 138
 
124 139
     </div>
125 140
   </div>
126
-
127
-
128 141
 </template>

+ 17 - 6
src/pages/order/components/Order4List.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {getOrderListFromStatus} from "~/apis/order.api";
2
+import { getOrderListFromStatus } from "~/apis/order.api";
3 3
 import OrderItem from "~/pages/order/components/OrderItem.vue";
4 4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5 5
 
@@ -12,7 +12,7 @@ const state = reactive({
12 12
   currentPage: 1,
13 13
   pageSize: 10,
14 14
   totalPage: 1,
15
-
15
+  status: "",
16 16
   list: []
17 17
 })
18 18
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -34,6 +34,14 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
34 34
     status: props.status,
35 35
   }).then(res => {
36 36
     console.log(res)
37
+    if (res.list.length <= 0) {
38
+      uni.$emit('changeShowLike')
39
+      console.log('没有数据');
40
+      return
41
+    }
42
+    if(res.count< state.pageSize){
43
+      uni.$emit('changeShowLike')
44
+    }
37 45
     if (action === 'page') {
38 46
       state.list = state.list.concat(res.list)
39 47
     }
@@ -48,7 +56,13 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
48 56
     }
49 57
   })
50 58
 }
59
+watch(() => state.status, (newStatus, oldStatus) => {
60
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
51 61
 
62
+  if (newStatus === 'noMore') {
63
+    uni.$emit('changeShowLike');
64
+  }
65
+});
52 66
 function handleScrollToLower() {
53 67
   state.status = 'loading';
54 68
   state.currentPage += 1;
@@ -113,8 +127,7 @@ onUnload(() => {
113 127
         <OrderItem :order-item="orderItem" />
114 128
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->
115 129
       </div>
116
-      <div class=" flex justify-center items-center text-[12px] text-gray-500"
117
-           v-if="state.list && state.list.length > 0">
130
+      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
118 131
         <div v-if="state.status === 'loading'">
119 132
           加载中...
120 133
         </div>
@@ -128,6 +141,4 @@ onUnload(() => {
128 141
 
129 142
     </div>
130 143
   </div>
131
-
132
-
133 144
 </template>

+ 147 - 22
src/pages/order/components/OrderItem.vue

@@ -11,7 +11,7 @@ import {
11 11
   TaobaoProductThirdPartyWaresModel, VipProductModel
12 12
 } from "~/apis/model/product.model";
13 13
 import { DcProductModel } from "~/apis/model/dacang.model";
14
-import { error } from "console";
14
+import { error, log } from "console";
15 15
 const props = defineProps({
16 16
   orderItem: {
17 17
     type: Object,
@@ -23,6 +23,10 @@ const props = defineProps({
23 23
   tabValue: {
24 24
     type: Number,
25 25
     default: 0
26
+  },
27
+  receivegoods: {
28
+    type: Number,
29
+    default: 0
26 30
   }
27 31
 
28 32
 })
@@ -58,19 +62,19 @@ function getStatusText(orderItem: OrderListModel) {
58 62
     return '待收货'
59 63
   }
60 64
   if (orderItem.status == 2) {
61
-    return '已完成, 待评价'
65
+    return '待评价'
62 66
   }
63 67
   if (orderItem.status == 3) {
64 68
     return '已完成'
65 69
   }
66 70
   if (orderItem.status == -1) {
67
-    return '已退款'
71
+    return '已完成'
68 72
   }
69 73
   if (orderItem.status == 4) {
70
-    return '已申请退款'
74
+    return '售后中'
71 75
   }
72 76
   if (orderItem.status === 5) {
73
-    return '已取消订单'
77
+    return '已取消'
74 78
   }
75 79
   if (orderItem.status === '5') {
76 80
     return '待付款'
@@ -128,10 +132,18 @@ function handlePayment() {
128 132
 }
129 133
 
130 134
 function handleShowOrderDetail(order) {
131
-  console.log(order)
135
+  console.log(111212121, order)
132 136
   uni.navigateTo({
133
-    url: '/pages/order/detail?detail=' + `${encodeBase64(order)}&type=${order.status}`
137
+    url: '/pages/order/detail?detail=' + `${encodeBase64(order)}`
134 138
   })
139
+  // if (order.status === '5') {
140
+  //   uni.navigateTo({
141
+  //     url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(order)}&type=1`
142
+  //   })
143
+  // } else {
144
+
145
+  // }
146
+
135 147
 }
136 148
 
137 149
 function handleRemindTheDelivery() {
@@ -159,10 +171,19 @@ function handleTakeOrder(orderItem) {
159 171
       if (res.confirm) {
160 172
         takeOrder(orderItem.order_id).then(res => {
161 173
           // console.log(res)
174
+
162 175
           uni.showToast({
163 176
             title: '确认收货成功'
164 177
           })
165
-          uni.$emit('orderTakeFromList')
178
+          if (props.receivegoods == 0) {
179
+            console.log('全部订单');
180
+
181
+            uni.$emit('AllreloadList')
182
+          } else if (props.receivegoods == 3) {
183
+            console.log('待收货订单');
184
+            uni.$emit('onTab3PullDownRefresh')
185
+          }
186
+
166 187
 
167 188
         }).catch(error => {
168 189
           uni.showToast({
@@ -199,7 +220,7 @@ function handleProductItemClick(
199 220
 
200 221
 
201 222
 function handeRefund(orderItem) {
202
-  console.log('申请售后', orderItem);
223
+  console.log('售后详情', orderItem);
203 224
 
204 225
   uni.navigateTo({
205 226
     // url: `/pages/refund/drawback?detail=${encodeBase64(orderItem)}`
@@ -207,11 +228,76 @@ function handeRefund(orderItem) {
207 228
   })
208 229
 }
209 230
 
231
+function handeDetail(orderItem: any) {
232
+  uni.navigateTo({
233
+    url: '/pages/refund/detail?id=' + orderItem.refund_order_id
234
+  })
235
+}
210 236
 function handleShowObligationOrderDetail(orderItem) {
237
+  console.log("hhhhhhhh", orderItem)
211 238
   uni.navigateTo({
212 239
     url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}`
213 240
   })
214 241
 }
242
+
243
+const remainingTime: any = ref({
244
+  hours: "00",
245
+  minutes: "00",
246
+  seconds: "00"
247
+})
248
+//计算取消时间
249
+function updateRemainingTime(detail: any) {
250
+  if (props.orderItem.status === '5') {
251
+    const currentTime = new Date().getTime();
252
+    const endTime = new Date(detail.close_time).getTime();
253
+    const timeDifference = endTime - currentTime;
254
+
255
+    if (timeDifference > 0) {
256
+      // 计算剩余时间
257
+      const hours = Math.floor(timeDifference / (1000 * 60 * 60));
258
+      const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
259
+      const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
260
+
261
+      // 更新数据
262
+
263
+      remainingTime.value = {
264
+        hours: hours < 10 ? '0' + hours : hours,
265
+        minutes: minutes < 10 ? '0' + minutes : minutes,
266
+        seconds: seconds < 10 ? '0' + seconds : seconds
267
+      }
268
+    } else {
269
+      clearInterval(timer);
270
+      remainingTime.value = {
271
+        hours: "00",
272
+        minutes: "00",
273
+        seconds: "00"
274
+      }
275
+      //   //重新刷新页面
276
+      uni.$emit('AllreloadList')
277
+      console.log('自动关闭>>>');
278
+    }
279
+  }
280
+
281
+}
282
+
283
+
284
+// 每秒更新剩余时间
285
+const timer = setInterval(() => {
286
+  updateRemainingTime(props.orderItem)
287
+}, 1000);
288
+
289
+onUnload(() => {
290
+  clearInterval(timer);
291
+  console.log('卸载关闭');
292
+})
293
+
294
+function handleShowDetail(orderItem: any) {
295
+  console.log(orderItem)
296
+  uni.navigateTo({
297
+    url: '/pages/refund/detail?id=' + orderItem.refund_order_id
298
+  })
299
+}
300
+
215 301
 </script>
216 302
 
217 303
 <template>
@@ -254,7 +340,9 @@ function handleShowObligationOrderDetail(orderItem) {
254 340
               </div>
255 341
 
256 342
               <div class="flex flex-col justify-center items-center">
257
-                <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
343
+                <!-- <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice> -->
344
+                <div class="font-bold text-[12px] !text-[#000]"> ¥{{
345
+                  parseInt(parseFloat(orderProduct.product_price)) }}</div>
258 346
                 <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
259 347
               </div>
260 348
 
@@ -299,8 +387,8 @@ function handleShowObligationOrderDetail(orderItem) {
299 387
           class="flex flex-col gap-3">
300 388
           <div class="flex py-2 gap-3">
301 389
             <div class="flex-1 flex gap-2">
302
-              <div class="flex w-20">
303
-                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
390
+              <div class="flex w-20 h-20">
391
+                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20"></image>
304 392
 
305 393
               </div>
306 394
               <div class="flex flex-col">
@@ -315,22 +403,36 @@ function handleShowObligationOrderDetail(orderItem) {
315 403
 
316 404
             <div class="flex flex-col justify-center items-center">
317 405
               <!--              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
318
-              <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
406
+              <div class="font-bold text-[12px] !text-[#000]" v-if="orderItem.pay_type==5"> 积分{{
407
+                Math.round(parseFloat(orderProduct.product_price).toFixed(2).replace(/\.?0+$/, '')*30)  }}</div>
408
+              <div class="font-bold text-[12px] !text-[#000]" v-if="orderItem.pay_type!=5" > ¥{{
409
+                parseFloat(orderProduct.product_price).toFixed(2).replace(/\.?0+$/, '') }}</div>
319 410
               <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
320 411
             </div>
321 412
 
322 413
           </div>
323 414
 
324 415
         </div>
325
-
326
-        <div class="flex justify-end gap-2" v-if="orderItem.status === '5'">
327
-          <!-- <div class="title-line">09:02:00后订单将关闭</div> -->
416
+        <!-- 待支付 -->
417
+        <div class="flex flex-1 justify-between" v-if="orderItem.status === '5'">
418
+          <div class="title-line"><span style="color: #FE0032;">{{ remainingTime.hours }}:{{ remainingTime.minutes }}:{{
419
+            remainingTime.seconds }}</span> 后订单将关闭
420
+          </div>
421
+          <div class="flex justify-end gap-2" style="margin-top: 4rpx;">
422
+            <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
423
+              <div class="text-black">取消订单</div>
424
+            </nut-button>
425
+            <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
426
+          </div>
427
+        </div>
428
+        <!-- <div class="flex justify-end gap-2" v-if="orderItem.status === '5'">
429
+          <div class="title-line"><span>09:02:00</span>后订单将关闭</div>
328 430
           <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
329 431
             <div class="text-black">取消订单</div>
330 432
           </nut-button>
331 433
           <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
332 434
 
333
-        </div>
435
+        </div> -->
334 436
         <div class="flex justify-end gap-2" v-if="orderItem.status === 5">
335 437
 
336 438
 
@@ -339,22 +441,43 @@ function handleShowObligationOrderDetail(orderItem) {
339 441
           <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery">
340 442
             <div class="text-black">提醒发货</div>
341 443
           </nut-button>
342
-          <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
444
+          
445
+          <div v-if="orderItem.refund_order_id &&orderItem.pay_type!=5">
446
+            <nut-button size="small" plain type="default" @tap.stop="handeDetail(orderItem)">售后详情</nut-button>
447
+          </div>
448
+          <div v-else-if="!orderItem.refund_order_id &&orderItem.pay_type!=5">
449
+            <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
450
+          </div>
451
+
343 452
         </div>
344 453
 
345 454
         <div class="flex justify-end gap-2" v-if="orderItem.status == 1">
346 455
           <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderItem)">查看物流</nut-button>
347
-          <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
456
+          <div v-if="orderItem.refund_order_id &&orderItem.pay_type!=5">
457
+            <nut-button size="small" plain type="default" @tap.stop="handeDetail(orderItem)">售后详情</nut-button>
458
+          </div>
459
+          <div v-else-if="!orderItem.refund_order_id &&orderItem.pay_type!=5">
460
+            <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
461
+          </div>
348 462
 
349 463
           <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder(orderItem)">确认收货</nut-button>
350 464
 
351 465
         </div>
352 466
 
353 467
         <div class="flex justify-end gap-2" v-if="orderItem.status == 2">
468
+          <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderItem)">查看物流</nut-button>
354 469
           <nut-button size="small" plain type="default" @tap.stop="handleProductItemClick(orderItem)">再次购买</nut-button>
355 470
           <nut-button size="small" plain type="primary" @tap.stop="handleComment(orderItem)">去评价</nut-button>
356 471
 
357 472
         </div>
473
+        <div class="flex justify-end gap-2" v-if="orderItem.status == 4">
474
+          <nut-button size="small" plain type="default" @tap.stop="handleShowDetail(orderItem)">售后详情</nut-button>
475
+
476
+        </div>
477
+        <div class="flex justify-end gap-2" v-if="orderItem.status == 3">
478
+          <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderItem)">查看物流</nut-button>
479
+          <nut-button size="small" plain type="default" @tap.stop="handleProductItemClick(orderItem)">再次购买</nut-button>
480
+        </div>
358 481
       </div>
359 482
     </div>
360 483
 
@@ -362,10 +485,12 @@ function handleShowObligationOrderDetail(orderItem) {
362 485
 </template>
363 486
 <style  scoped>
364 487
 .title-line {
365
-  font-size: 24rpx;
366
-  /* 字体大小 */
367 488
   color: #333;
368 489
   line-height: 56rpx;
369
-  margin-right: 80rpx;
490
+  width: 262rpx;
491
+  height: 56rpx;
492
+  font-size: 25rpx;
493
+  font-family: PingFangSC, PingFang SC;
494
+  font-weight: 400;
370 495
 }
371 496
 </style> 

+ 67 - 50
src/pages/order/components/OrderObligationItem.vue

@@ -55,7 +55,7 @@ function getStatusText(orderItem: OrderListModel) {
55 55
     return '待收货'
56 56
   }
57 57
   if (orderItem.status == 2) {
58
-    return '已完成, 待评价'
58
+    return '待评价'
59 59
   }
60 60
   if (orderItem.status == 3) {
61 61
     return '已完成'
@@ -208,45 +208,55 @@ function handleShowObligationOrderDetail(orderItem) {
208 208
 
209 209
 
210 210
 
211
-// const remainingTime: any = ref({
212
-//   hours: 0,
213
-//   minutes: 0,
214
-//   seconds: 0
215
-// })
216
-// //计算取消时间
217
-// function updateRemainingTime(detail: any) {
218
-//   const currentTime = new Date().getTime();
219
-//   const endTime = new Date(detail.close_time).getTime();
220
-//   const timeDifference = endTime - currentTime;
221
-
222
-//   // 计算剩余时间
223
-//   const hours = Math.floor(timeDifference / (1000 * 60 * 60));
224
-//   const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
225
-//   const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
226
-
227
-//   // 更新数据
228
-//   remainingTime.value = {
229
-//     hours: hours < 10 ? '0' + hours : hours,
230
-//     minutes: minutes < 10 ? '0' + minutes : minutes,
231
-//     seconds: seconds < 10 ? '0' + seconds : seconds
232
-//   }
233
-// }
211
+const remainingTime: any = ref({
212
+  hours: "00",
213
+  minutes: "00",
214
+  seconds: "00"
215
+})
216
+//计算取消时间
217
+function updateRemainingTime(detail: any) {
218
+  const currentTime = new Date().getTime();
219
+  const endTime = new Date(detail.close_time).getTime();
220
+  const timeDifference = endTime - currentTime;
221
+
222
+  if (timeDifference > 0) {
223
+    // 计算剩余时间
224
+    const hours = Math.floor(timeDifference / (1000 * 60 * 60));
225
+    const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
226
+    const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
227
+
228
+    // 更新数据
229
+
230
+    remainingTime.value = {
231
+      hours: hours < 10 ? '0' + hours : hours,
232
+      minutes: minutes < 10 ? '0' + minutes : minutes,
233
+      seconds: seconds < 10 ? '0' + seconds : seconds
234
+    }
235
+  } else {
236
+    clearInterval(timer);
237
+    remainingTime.value = {
238
+      hours: "00",
239
+      minutes: "00",
240
+      seconds: "00"
241
+    }
242
+    //   //重新刷新页面
243
+    uni.$emit('dfkreloadList')
244
+    console.log('自动关闭>>>');
245
+  }
246
+}
234 247
 
235 248
 
236
-// // 每秒更新剩余时间
237
-// const timer = setInterval(() => {
238
-//   if (remainingTime.hours <= 0 && remainingTime.minutes <= 0) {
239
-//     // 达到设定时间,执行关闭操作,你可以在这里添加你的关闭逻辑
240
-//     clearInterval(timer);
241
-//     console.log('自动关闭');
242
-//   }
243
-//   updateRemainingTime(props.orderItem)
244
-// }, 1000);
249
+// 每秒更新剩余时间
250
+const timer = setInterval(() => {
245 251
 
246
-// onUnload(() => {
247
-//   clearInterval(timer);
248
-//   console.log('卸载关闭');
249
-// })
252
+  updateRemainingTime(props.orderItem)
253
+}, 1000);
254
+
255
+
256
+onUnload(() => {
257
+  clearInterval(timer);
258
+  console.log('卸载关闭');
259
+})
250 260
 
251 261
 
252 262
 
@@ -278,7 +288,7 @@ function handleShowObligationOrderDetail(orderItem) {
278 288
               <div class="flex-1 flex gap-2">
279 289
                 <div class="flex w-20 h-20">
280 290
 
281
-                  <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
291
+                  <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" ></image>
282 292
                 </div>
283 293
                 <div class="flex flex-col">
284 294
                   <div class="line-clamp-2 text-[12px]">
@@ -291,7 +301,9 @@ function handleShowObligationOrderDetail(orderItem) {
291 301
               </div>
292 302
 
293 303
               <div class="flex flex-col justify-center items-center">
294
-                <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
304
+                <!-- <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice> -->
305
+                <div class="font-bold text-[12px] !text-[#000]"> ¥{{
306
+                  parseFloat(orderProduct.product_price).toFixed(2).replace(/\.?0+$/, '') }}</div>
295 307
                 <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
296 308
               </div>
297 309
 
@@ -299,16 +311,19 @@ function handleShowObligationOrderDetail(orderItem) {
299 311
 
300 312
           </div>
301 313
         </div>
302
-        <div class="flex justify-end gap-2">
303
-          <!-- <div class="title-line">{{ remainingTime.hours }}:{{ remainingTime.minutes }}:{{ remainingTime.seconds }}后订单将关闭
304
-          </div> -->
305
-          <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
306
-            <div class="text-black">取消订单</div>
307
-          </nut-button>
308
-          <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
309
-
314
+        <div class="flex flex-1 justify-between">
315
+          <div v-if="props.orderItem" class="title-line"><span style="color: #FE0032;">{{ remainingTime.hours }}:{{
316
+            remainingTime.minutes }}:{{ remainingTime.seconds }}</span> 后订单将关闭
317
+          </div>
318
+          <div class="flex justify-end gap-2" style="margin-top: 4rpx;">
319
+            <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
320
+              <div class="text-black">取消订单</div>
321
+            </nut-button>
322
+            <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
323
+          </div>
310 324
         </div>
311 325
 
326
+
312 327
       </div>
313 328
     </div>
314 329
 
@@ -317,10 +332,12 @@ function handleShowObligationOrderDetail(orderItem) {
317 332
 
318 333
 <style scoped>
319 334
 .title-line {
320
-  font-size: 24rpx;
321
-  /* 字体大小 */
322 335
   color: #333;
323 336
   line-height: 56rpx;
324
-  margin-right: 80rpx;
337
+  width: 262rpx;
338
+  height: 56rpx;
339
+  font-size: 25rpx;
340
+  font-family: PingFangSC, PingFang SC;
341
+  font-weight: 400;
325 342
 }
326 343
 </style>

+ 39 - 37
src/pages/order/components/RefundOrderItem.vue

@@ -1,16 +1,16 @@
1 1
 <script setup lang="ts">
2 2
 import FPrice from "~/components/FPrice/FPrice.vue";
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";
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 7
 import {
8 8
   DyProductModel,
9 9
   JdProductModel,
10 10
   SuNingProductModel,
11 11
   TaobaoProductThirdPartyWaresModel, VipProductModel
12 12
 } from "~/apis/model/product.model";
13
-import {DcProductModel} from "~/apis/model/dacang.model";
13
+import { DcProductModel } from "~/apis/model/dacang.model";
14 14
 const props = defineProps({
15 15
   orderItem: {
16 16
     type: Object,
@@ -42,20 +42,27 @@ function getStatusText(orderItem) {
42 42
   // }
43 43
   // switch (orderItem.status) {
44 44
   // }
45
-  if (orderItem.status == -1) {
46
-    // return '审核未通过'
45
+  console.log(orderItem);
46
+  
47
+  if (orderItem.status == -1 && orderItem.refund_type == 2) {
48
+    // return '退款失败'
49
+    return '审核未通过'
50
+  }
51
+  if (orderItem.status == -1 && orderItem.refund_type == 1) {
47 52
     return '退款失败'
53
+
48 54
   }
55
+
49 56
   if (orderItem.status == 0) {
50 57
     // return '待审核'
51 58
     return '审核中'
52 59
   }
53 60
   if (orderItem.status == 1) {
54 61
     // return '待退货'
55
-    return '审核中'
62
+    return '待退货'
56 63
   }
57 64
   if (orderItem.status == 2) {
58
-    return '审核中'
65
+    return '退货中'
59 66
     // return '待收货'
60 67
   }
61 68
   if (orderItem.status == 3) {
@@ -152,7 +159,7 @@ function handleComment(orderItem) {
152 159
 }
153 160
 
154 161
 function handleProductItemClick(
155
-    item
162
+  item
156 163
 ) {
157 164
   // function navigateToDetail(params) {
158 165
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -178,9 +185,7 @@ function handleShowDetail(orderItem) {
178 185
 
179 186
 <template>
180 187
   <div class="mb-3 bg-white rounded p-3" v-if="orderItem">
181
-    <div
182
-        @click.stop="handleHeaderClick"
183
-        class="flex items-center justify-between f-hairline-bottom pb-3">
188
+    <div @click.stop="handleHeaderClick" class="flex items-center justify-between f-hairline-bottom pb-3">
184 189
       <div class="flex-1 flex items-center font-bold gap-2 text-sm justify-between ">
185 190
         <div class="flex-1 flex items-center gap-2 w-full">
186 191
           <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
@@ -189,12 +194,10 @@ function handleShowDetail(orderItem) {
189 194
           </div>
190 195
         </div>
191 196
 
192
-          <div class="f-text-color-2 i-tabler-chevron-right"></div>
197
+        <div class="f-text-color-2 i-tabler-chevron-right"></div>
193 198
 
194 199
       </div>
195
-      <div class=" text-xs flex w-15 justify-end  'text-primary'"
196
-           
197
-      >
200
+      <div class=" text-xs flex w-15 justify-end  'text-primary'">
198 201
         {{ getStatusText(orderItem) }}
199 202
       </div>
200 203
     </div>
@@ -202,29 +205,30 @@ function handleShowDetail(orderItem) {
202 205
 
203 206
 
204 207
     <div @tap.stop="handleShowDetail(orderItem)">
205
-        <div v-for="(orderProduct, orderProductIndex) in orderItem.refundProduct" :key="orderProductIndex">
206
-          <div class="flex py-2 gap-3">
207
-            <div class="flex-1 flex gap-2">
208
-              <image :src="orderProduct.product.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
209
-              <div class="flex flex-col flex-1">
210
-                <div class="line-clamp-2 text-[12px]">
211
-                  {{ orderProduct.product.cart_info.product.store_name }}
212
-                </div>
213
-                <div class="text-gray-500 text-[10px]">
214
-                  {{ orderProduct.product.cart_info.productAttr.sku }}
215
-                </div>
208
+      <div v-for="(orderProduct, orderProductIndex) in orderItem.refundProduct" :key="orderProductIndex">
209
+        <div class="flex py-2 gap-3">
210
+          <div class="flex-1 flex gap-2">
211
+            <image :src="orderProduct.product.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
212
+            <div class="flex flex-col flex-1">
213
+              <div class="line-clamp-2 text-[12px]">
214
+                {{ orderProduct.product.cart_info.product.store_name }}
216 215
               </div>
217
-                <div class="justify-end flex">
218
-                  <div class="flex flex-col ">
219
-                    <div class="text-[12px] font-bold">
220
-                      <FPrice :price="orderProduct.product.product_price" ex-class="font-bold text-black"/>
221
-                    </div>
222
-                    <div class="text-gray-500 text-[11px]">共{{ orderProduct.product.product_num }}件</div>
223
-                  </div>
216
+              <div class="text-gray-500 text-[10px]">
217
+                {{ orderProduct.product.cart_info.productAttr.sku }}
218
+              </div>
219
+            </div>
220
+            <div class="justify-end flex">
221
+              <div class="flex flex-col ">
222
+                <div class="text-[12px] font-bold">
223
+                  <!-- <FPrice :price="orderProduct.product.product_price" ex-class="font-bold text-black" /> -->
224
+                  <span>¥{{ parseFloat(Number(orderProduct.product.product_price)).toFixed(2).replace(/\.?0+$/, '') }}</span>
224 225
                 </div>
226
+                <div class="text-gray-500 text-[11px]">共{{ orderProduct.product.product_num }}件</div>
227
+              </div>
225 228
             </div>
226 229
           </div>
227 230
         </div>
231
+      </div>
228 232
       <div class="flex justify-end">
229 233
         <nut-button size="small" plain type="primary" @tap.stop="handleShowDetail(orderItem)">查看详情</nut-button>
230 234
 
@@ -233,6 +237,4 @@ function handleShowDetail(orderItem) {
233 237
     </div>
234 238
 
235 239
   </div>
236
-
237
-
238 240
 </template>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 193 - 32
src/pages/order/detail.vue


+ 166 - 162
src/pages/order/index.vue

@@ -1,41 +1,9 @@
1
-<template>
2
-<!--  <CXBBasePage>-->
3
-  <div class="bg-white">
4
-  <FNavBar
5
-      title="我的订单" :left-arrow="true" fixed placeholder z-index="999"
6
-      ex-class="bg-white w-screen"
7
-      @click-left="onClickLeft"
8
-  />
9
-
10
-
11
-  <!--    <nut-navbar>-->
12
-    <!--      <template #content>-->
13
-    <div class="fixed top-18 bg-white w-full z-2">
14
-      <nut-tabs v-model="state.tabvalue" class="bg-white">
15
-        <nut-tab-pane title="全部"></nut-tab-pane>
16
-        <nut-tab-pane title="待付款"></nut-tab-pane>
17
-        <nut-tab-pane title="待发货"></nut-tab-pane>
18
-        <nut-tab-pane title="待收货"></nut-tab-pane>
19
-        <nut-tab-pane title="待评价"></nut-tab-pane>
20
-      </nut-tabs>
21
-    </div>
22
-
23
-    <div class="mt-30  pb-safe bg-[#f8f8f8]">
24
-      <AllItemList v-if="state.tabvalue == 0" :tab-value="0"/>
25
-      <ObligationOrderList v-if="state.tabvalue == 1" :tab-value="1"/>
26
-      <Order2List v-if="state.tabvalue == 2" :status="'0'"/>
27
-      <Order3List v-if="state.tabvalue == 3" :status="'1'"/>
28
-      <Order4List v-if="state.tabvalue == 4" :status="'2'"/>
29
-    </div>
30
-</div>
31
-<!--  </CXBBasePage>-->
32
-</template>
33 1
 <script lang="ts" setup>
34 2
 // import { reactive } from 'vue';
35 3
 // export default {
36 4
 //   setup() {
37
-import {getOrderListFromStatus, getAllOrder, getGroupOrderList} from "~/apis/order.api";
38
-import type {OrderListModel} from "~/apis/model/order.model";
5
+import { getOrderListFromStatus, getAllOrder, getGroupOrderList } from "~/apis/order.api";
6
+import type { OrderListModel } from "~/apis/model/order.model";
39 7
 import FPrice from "~/components/FPrice/FPrice.vue";
40 8
 import FButton from "~/components/FButton/FButton.vue";
41 9
 import OrderItem from "~/pages/order/components/OrderItem.vue";
@@ -45,13 +13,23 @@ import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
45 13
 import OtherOrderItem from "~/pages/order/components/OtherOrderItem.vue";
46 14
 import AllItemList from "~/pages/order/components/AllItemList.vue";
47 15
 import ObligationOrderList from "~/pages/order/components/ObligationOrderList.vue";
16
+import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
48 17
 import Order2List from "~/pages/order/components/Order2List.vue";
49 18
 import Order3List from "~/pages/order/components/Order3List.vue";
50 19
 import Order4List from "~/pages/order/components/Order4List.vue";
20
+import {
21
+  DyProductModel,
22
+  JdProductModel,
23
+  SuNingProductModel,
24
+  TaobaoProductThirdPartyWaresModel, VipProductModel
25
+} from "~/apis/model/product.model";
26
+import { DcProductModel } from "~/apis/model/dacang.model";
51 27
 import FNavBar from "~/components/FNavBar/FNavBar.vue";
28
+import { CDN_URL } from "~/config/app";
29
+import { getRecommendList } from "~/apis/merchant";
52 30
 const pageStore = usePageStoreWidthOut()
53 31
 
54
-
32
+const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
55 33
 const state = reactive({
56 34
   tabvalue: 0,
57 35
 
@@ -62,23 +40,19 @@ const state = reactive({
62 40
   obligationOrderList: [],
63 41
 
64 42
   orderList: [],
65
-  from: null
43
+  from: null,
44
+  currentPage: 1,
45
+  pageSize: 10,
46
+  total: 0,
47
+  totalPage: 0,
48
+  list: [],
49
+  statusLike: '',
66 50
 });
67 51
 
68
-const getStatusVal = () => {
69
-  // state.tabvalue == 2 ? '0' : state.tabvalue == 3 ? '1' : state.tabvalue == 4 ? '2' : ''
70
-  if (state.tabvalue == 2) {
71
-    return '0'
72
-  }
73
-  if (state.tabvalue == 3) {
74
-    return '1'
75
-  }
76
-  if (state.tabvalue == 4) {
77
-    return '2'
78
-  }
79
-}
52
+const nomore = ref('')
53
+const toshow = ref(false)
80 54
 onLoad(options => {
81
-  console.log('我是options》》',options)
55
+  console.log('我是options》》', options)
82 56
   if (options && options.tabIndex) {
83 57
     state.tabvalue = options.tabIndex
84 58
   }
@@ -86,35 +60,58 @@ onLoad(options => {
86 60
     state.from = options.from
87 61
   }
88 62
   // loadAllOrderList()
89
-
90
-  // 监听事件
91
-  // uni.$on('orderCancelFromList', () => {
92
-  //   loadAllOrderList()
93
-  //   state.tabvalue = 0
94
-  // })
95
-  //
96
-  // uni.$on('orderTakeFromList', () => {
97
-  //   loadAllOrderList()
98
-  //   state.tabvalue = 3
99
-  // })
63
+  loadList('reload')
100 64
 })
101 65
 
102
-// uni.$on('orderCancelFromList', (tabValue) => {
103
-//   if (!tabValue) {
104
-//     state.tabvalue = 0
105
-//   } else {
106
-//     state.tabvalue = tabValue
107
-//   }
108
-//   // loadAllOrderList()
109
-// })
66
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
67
+  const params = {
68
+    page: state.currentPage,
69
+    limit: state.pageSize
70
+  }
71
+
72
+  if (action === 'reload') {
73
+    params.page = 1
74
+  }
75
+
76
+  getRecommendList({
77
+    ...params
78
+  }).then(res => {
79
+    if (action === 'page') {
80
+      state.list = state.list.concat(res.list)
81
+    }
82
+    if (action === 'reload') {
83
+      // state.list = state.list.concat(res.list)
84
+      state.list = res.list
85
+    }
86
+    state.totalPage = Math.ceil(res.count / state.pageSize);
87
+    state.statusLike = 'more'
88
+    if (callback) {
89
+      callback(res.list)
90
+    }
91
+  })
92
+}
110 93
 
111
-// uni.$on('orderTakeFromList', () => {
112
-//   state.tabvalue = 3
113
-// })
114
-//
115
-// uni.$on('orderComment', () => {
116
-//   state.tabvalue = 4
117
-// })
94
+
95
+function handleProductItemClick(
96
+  item:
97
+    JdProductModel
98
+    & DcProductModel
99
+    & DyProductModel
100
+    & SuNingProductModel
101
+    & TaobaoProductThirdPartyWaresModel
102
+    & VipProductModel
103
+) {
104
+  // function navigateToDetail(params) {
105
+  //   let otherDetailUrl = `/pages/store/product/other`
106
+  //   return uni.navigateTo({
107
+  //     url: `${otherDetailUrl}?params=${params}`
108
+  //   })
109
+  // }
110
+  // 大仓
111
+  uni.navigateTo({
112
+    url: `/pages/store/product/detail?id=${item.product_id}`
113
+  })
114
+}
118 115
 
119 116
 onReachBottom(() => {
120 117
   // handleScrollToLower()
@@ -133,7 +130,11 @@ onReachBottom(() => {
133 130
   if (state.tabvalue == 4) {
134 131
     uni.$emit('onTab4ReachBottom')
135 132
   }
133
+  if (toshow.value == true) {
134
+    handleScrollToLower()
135
+  }
136 136
 })
137
+
137 138
 onPullDownRefresh(() => {
138 139
   if (state.tabvalue == 0) {
139 140
     uni.$emit('onTab0PullDownRefresh')
@@ -150,94 +151,44 @@ onPullDownRefresh(() => {
150 151
   if (state.tabvalue == 4) {
151 152
     uni.$emit('onTab4PullDownRefresh')
152 153
   }
154
+  if (nomore.value == 'nomore') {
155
+    handleScrollToLower()
156
+  }
153 157
   // loadList('reload', items => {
154 158
   //   setTimeout(() => {
155 159
   //     uni.stopPullDownRefresh()
156 160
   //   }, 300)
157 161
   // })
158 162
 })
159
-// function splitArray(list, sp) {
160
-//   if (typeof list != 'object') return [];
161
-//   if (sp == undefined) sp = [];
162
-//   for (var i = 0; i < list.length; i++) {
163
-//     sp.push(list[i]);
164
-//   }
165
-//   return sp;
166
-// }
167
-//
168
-// function loadAllOrderList() {
169
-//   // 获取全部订单
170
-//   getAllOrder({
171
-//     page: 1,
172
-//     limit: 10
173
-//   }).then(res => {
174
-//     // console.log(res)
175
-//     state.allOrderTotal = res.total
176
-//     state.allOrderList = res.list
177
-//     // console.log(res)
178
-//   })
179
-// }
180
-//
181
-// watch(() => state.tabvalue, (val) => {
182
-//   // status: string//订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
183
-//
184
-//   switch (val) {
185
-//     case '0': {
186
-//       loadAllOrderList()
187
-//       break;
188
-//     }
189
-//     case '1': {
190
-//       getGroupOrderList({
191
-//         page: 1,
192
-//         limit: 10
193
-//       }).then(res => {
194
-//         // console.log(res)
195
-//         // state.obligationOrderList = splitArray(res.list, state.obligationOrderList)
196
-//         state.obligationOrderList = res.list
197
-//       })
198
-//       break;
199
-//       // getOrderListFromStatus({
200
-//       //   page: 1,
201
-//       //   limit: 10,
202
-//       //   status: 0
203
-//       // }).then(res => {
204
-//       //   state.obligationOrderList = res.list
205
-//       // })
206
-//     }
207
-//       // 待发货
208
-//     case '2': {
209
-//       getOrderListFromStatus({
210
-//         page: 1,
211
-//         limit: 10,
212
-//         status: 0
213
-//       }).then(res => {
214
-//         state.orderList = res.list
215
-//       })
216
-//       break;
217
-//     }
218
-//     case '3': {
219
-//       getOrderListFromStatus({
220
-//         page: 1,
221
-//         limit: 10,
222
-//         status: 1
223
-//       }).then(res => {
224
-//         state.orderList = res.list
225
-//       })
226
-//       break;
227
-//     }
228
-//     case '4': {
229
-//       getOrderListFromStatus({
230
-//         page: 1,
231
-//         limit: 10,
232
-//         status: 2
233
-//       }).then(res => {
234
-//         state.orderList = res.list
235
-//       })
236
-//       break;
237
-//     }
238
-//   }
239
-// })
240 163
 
164
+watch(() => state.tabvalue, (newStatus, oldStatus) => {
165
+  console.log('state.tabvalue,新状态:', newStatus, '旧状态:', oldStatus);
166
+  if (newStatus != oldStatus) {
167
+    uni.pageScrollTo({
168
+      scrollTop: 0,
169
+    });
170
+    toshow.value=false
171
+  }
172
+});
173
+
174
+function handleScrollToLower() {
175
+  state.statusLike = 'loading';
176
+  state.currentPage += 1;
177
+  // console.log(state.totalPage)
178
+  if (state.currentPage > state.totalPage) {
179
+    state.statusLike = 'noMore';
180
+  } else {
181
+    setTimeout(() => {
182
+      loadList('page')
183
+    }, 300)
184
+  }
185
+}
186
+onMounted(() => {
187
+  uni.$on('changeShowLike', () => {
188
+    console.log('触发');
189
+    toshow.value = true
190
+  })
191
+})
241 192
 function onClickLeft() {
242 193
 
243 194
   if (state.tabvalue == 1 && state.from && state.from == 'payment') {
@@ -264,6 +215,65 @@ function onClickLeft() {
264 215
   }
265 216
 }
266 217
 </script>
218
+
219
+<template>
220
+  <!--  <CXBBasePage>-->
221
+  <div class="bg-white">
222
+    <FNavBar title="我的订单" :left-arrow="true" fixed placeholder z-index="999" ex-class="bg-white w-screen"
223
+      @click-left="onClickLeft" />
224
+
225
+
226
+    <!--    <nut-navbar>-->
227
+    <!--      <template #content>-->
228
+    <div class="fixed top-18 bg-white w-full z-2">
229
+      <nut-tabs v-model="state.tabvalue" class="bg-white">
230
+        <nut-tab-pane title="全部"></nut-tab-pane>
231
+        <nut-tab-pane title="待付款"></nut-tab-pane>
232
+        <nut-tab-pane title="待发货"></nut-tab-pane>
233
+        <nut-tab-pane title="待收货"></nut-tab-pane>
234
+        <nut-tab-pane title="待评价"></nut-tab-pane>
235
+      </nut-tabs>
236
+    </div>
237
+
238
+    <div class="mt-30  pb-safe bg-[#f8f8f8]">
239
+      <AllItemList v-if="state.tabvalue == 0" :tab-value="0" />
240
+      <ObligationOrderList v-if="state.tabvalue == 1" :tab-value="1" />
241
+      <Order2List v-if="state.tabvalue == 2" :status="'0'" />
242
+      <Order3List v-if="state.tabvalue == 3" :status="'1'" />
243
+      <Order4List v-if="state.tabvalue == 4" :status="'2'" />
244
+    </div>
245
+    <!-- 商品推荐 -->
246
+    <div v-if="toshow == true">
247
+      <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3">
248
+        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
249
+        <div>
250
+          精品推荐
251
+        </div>
252
+        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
253
+      </div>
254
+      <div class="pb-3 px-3 pb-safe" v-if="state.list">
255
+        <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
256
+          <div v-for="(item, index) in state.list" :key="index" @click="handleProductItemClick(item)">
257
+            <MerchantProductCard :item="item" />
258
+
259
+          </div>
260
+        </grid-view>
261
+
262
+        <div class=" flex justify-center items-center text-[12px] text-gray-500">
263
+          <div v-if="state.statusLike === 'loading'">
264
+            加载中...
265
+          </div>
266
+          <div v-if="state.statusLike === 'noMore'">
267
+            没有更多了~
268
+          </div>
269
+        </div>
270
+      </div>
271
+
272
+    </div>
273
+  </div>
274
+  <!--  </CXBBasePage>-->
275
+</template>
276
+
267 277
 <route lang="yaml">
268 278
 style:
269 279
   navigationStyle: custom
@@ -272,12 +282,6 @@ style:
272 282
 </route>
273 283
 
274 284
 <style lang="scss">
275
-//.nut-tab-pane {
276
-//  background: #f5f5f5 !important;
277
-//}
278
-//.nut-tabs {
279
-//  background: white;
280
-//}
281 285
 .nut-tabs__titles {
282 286
   background: white !important;
283 287
 }

+ 110 - 53
src/pages/order/logistics.vue

@@ -1,6 +1,6 @@
1 1
 <script setup lang="ts">
2
-import {CDN_URL} from "~/config/app";
3
-import {getRecommendList} from "~/apis/merchant";
2
+import { CDN_URL } from "~/config/app";
3
+import { getRecommendList } from "~/apis/merchant";
4 4
 import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
5 5
 import {
6 6
   DyProductModel,
@@ -8,12 +8,12 @@ import {
8 8
   SuNingProductModel,
9 9
   TaobaoProductThirdPartyWaresModel, VipProductModel
10 10
 } from "~/apis/model/product.model";
11
-import {DcProductModel} from "~/apis/model/dacang.model";
12
-import {getLogistics} from "~/apis/order.api";
13
-import {encodePhone} from "../../utils";
11
+import { DcProductModel } from "~/apis/model/dacang.model";
12
+import { getLogistics } from "~/apis/order.api";
13
+import { encodePhone } from "../../utils";
14 14
 
15 15
 const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
16
-
16
+const takeshow = ref(false)
17 17
 const state = reactive({
18 18
   currentPage: 1,
19 19
   pageSize: 10,
@@ -30,20 +30,20 @@ onLoad((options) => {
30 30
     icon: 'none'
31 31
   })
32 32
   if (options && options.id) {
33
-  getLogistics(options.id).then(res => {
34
-  // getLogistics(4127).then(res => {
35
-    console.log(res)
36
-    if (res && res.order) {
37
-      state.orderDetail = res.order
38
-    }
39
-    if (res && res.express) {
40
-      state.express = res.express
41
-    }
33
+    getLogistics(options.id).then(res => {
34
+      // getLogistics(4127).then(res => {
35
+      console.log(res)
36
+      if (res && res.order) {
37
+        state.orderDetail = res.order
38
+      }
39
+      if (res && res.express) {
40
+        state.express = res.express
41
+      }
42 42
 
43
-    uni.hideLoading()
44
-  })
43
+      uni.hideLoading()
44
+    })
45 45
 
46
-}
46
+  }
47 47
   // }
48 48
 })
49 49
 onShow(() => {
@@ -79,13 +79,13 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
79 79
 }
80 80
 
81 81
 function handleProductItemClick(
82
-    item:
83
-        JdProductModel
84
-        & DcProductModel
85
-        & DyProductModel
86
-        & SuNingProductModel
87
-        & TaobaoProductThirdPartyWaresModel
88
-        & VipProductModel
82
+  item:
83
+    JdProductModel
84
+    & DcProductModel
85
+    & DyProductModel
86
+    & SuNingProductModel
87
+    & TaobaoProductThirdPartyWaresModel
88
+    & VipProductModel
89 89
 ) {
90 90
   // function navigateToDetail(params) {
91 91
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -135,34 +135,49 @@ function handleMakePhoneCall() {
135 135
     phoneNumber: state.orderDetail.user_phone
136 136
   })
137 137
 }
138
+
139
+const statusimg = computed(() => {
140
+  if (takeshow.value == false) {
141
+    return '../../static/icon/展开.png'
142
+  } else {
143
+    return '../../static/icon/收起.png'
144
+  }
145
+})
146
+const statustext = computed(() => {
147
+  if (takeshow.value == false) {
148
+    return '展开'
149
+  } else {
150
+    return '收起'
151
+  }
152
+})
153
+function transformStatus() {
154
+  takeshow.value = !takeshow.value
155
+  if (takeshow.value == false) {
156
+    uni.pageScrollTo({
157
+      scrollTop: 0,
158
+    });
159
+  }
160
+}
138 161
 </script>
139 162
 
140 163
 <template>
141
-
142
-
143 164
   <div>
144 165
 
145
-    <div
146
-        v-if="state.orderDetail"
147
-        class="flex flex-col text-[12px] p-3 ">
166
+    <div v-if="state.orderDetail" class="flex flex-col text-[12px] p-3 ">
148 167
       <div class=" rounded-lg bg-white p-3 flex flex-col gap-4">
149 168
         <div>
150
-          <div class="text-gray-400">物流公司:{{ state.orderDetail.delivery_name }}</div>
151 169
           <div class="flex justify-between items-center ">
152
-            <div class="flex">
153
-              快递单号:{{ state.orderDetail.delivery_id }}
170
+            <div class="flex" style="line-height: 38rpx;">
171
+              <image style="width: 38rpx;height: 38rpx; margin-right: 17rpx;" src="../../static/icon/快递.png"></image>
172
+              {{ state.orderDetail.delivery_name }} {{ state.orderDetail.delivery_id }}
154 173
             </div>
155 174
             <div class="flex gap-2 items-center">
156
-              <div
157
-                  @click="handleClipboard"
158
-                  class="flex items-center border border-solid border-gray-200 text-[12px] rounded min-w-6 text-center  max-w-fit px-2 bg-white"
159
-              >
175
+              <div @click="handleClipboard"
176
+                class="flex items-center border border-solid border-gray-200 text-[12px] rounded min-w-6 text-center  max-w-fit px-2 bg-white">
160 177
                 复制
161 178
               </div>
162
-              <div
163
-                  @tap="handleMakePhoneCall"
164
-                  class="flex items-center border border-solid border-gray-200 text-[12px] rounded min-w-6 text-center  max-w-fit px-2 bg-white"
165
-              >
179
+              <div @tap="handleMakePhoneCall"
180
+                class="flex items-center border border-solid border-gray-200 text-[12px] rounded min-w-6 text-center  max-w-fit px-2 bg-white">
166 181
                 电话
167 182
               </div>
168 183
               <!--          <nut-button size="mini" type="default">复制</nut-button>-->
@@ -173,11 +188,43 @@ function handleMakePhoneCall() {
173 188
 
174 189
         <div class="flex items-center gap-2 ">
175 190
           <div class="rounded-full w-4 h-4 bg-gray-400 text-white flex flex-col justify-center items-center">收</div>
176
-          <div class="text-gray-400">{{ state.orderDetail.user_address + ' ' + state.orderDetail.real_name + ' ' + encodePhone(state.orderDetail.user_phone)}}</div>
191
+          <div class="text-gray-400">{{ state.orderDetail.user_address + ' ' + state.orderDetail.real_name + ' ' +
192
+            encodePhone(state.orderDetail.user_phone) }}</div>
177 193
         </div>
178 194
 
179 195
         <!-- 物流动态 -->
180
-        <div class="logis-detail" v-if="state.express && state.express.length > 0">
196
+        <div class="text_div mb-2 w-full " style="color: #333333;" v-if="state.express.length > 0">
197
+          <nut-steps v-if="takeshow == true" :current="1" progress-dot direction="vertical">
198
+            <nut-step v-for="(item, index) in state.express" :key="index" style="width: 578rpx;" :title="item?.status"
199
+              :content="item.time">
200
+              <template #title>
201
+                <div :style="{ color: index === 0 ? '#333' : '#999' }" class="mt-2 custom-title">{{ item?.status }}
202
+                </div>
203
+              </template>
204
+              <template #content>
205
+                <div class="custom-content">{{ item.time }}</div>
206
+              </template>
207
+            </nut-step>
208
+          </nut-steps>
209
+          <nut-steps v-if="takeshow == false" :current="1" progress-dot direction="vertical">
210
+            <nut-step style="width: 578rpx;" :title="state.express[0].status" :content="state.express[0].time">
211
+              <template #title>
212
+                <div :style="{ color: '#333' }" class="mt-2 custom-title">{{ state.express[0].status }}</div>
213
+              </template>
214
+              <template #content>
215
+                <div class="custom-content">{{ state.express[0].time }}</div>
216
+              </template>
217
+            </nut-step>
218
+          </nut-steps>
219
+        </div>
220
+        <div class="flex w-full" @click="transformStatus"
221
+          style="height:36rpx;  justify-content: center; align-items: center; ">
222
+          <div class="text_dew">{{ statustext }}</div>
223
+          <div style="width: 36rpx; height: 36rpx; ">
224
+            <image style="width: 36rpx; height: 36rpx;" :src="statusimg"></image>
225
+          </div>
226
+        </div>
227
+        <!-- <div class="logis-detail" v-if="state.express && state.express.length > 0">
181 228
           <div class="logis-item" :class="{ first: index === 0 }" v-for="(item, index) in state.express" :key="index">
182 229
             <div class="logis-item-content">
183 230
               <div class="logis-item-content__describe">
@@ -188,7 +235,7 @@ function handleMakePhoneCall() {
188 235
               </div>
189 236
             </div>
190 237
           </div>
191
-        </div>
238
+        </div> -->
192 239
       </div>
193 240
     </div>
194 241
     <!-- 商品推荐 -->
@@ -202,17 +249,13 @@ function handleMakePhoneCall() {
202 249
       </div>
203 250
       <div class="pb-3 px-3 pb-safe" v-if="state.list">
204 251
         <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
205
-          <div v-for="(item, index) in state.list"
206
-               :key="index"
207
-               @click="handleProductItemClick(item)"
208
-          >
209
-            <MerchantProductCard :item="item"/>
252
+          <div v-for="(item, index) in state.list" :key="index" @click="handleProductItemClick(item)">
253
+            <MerchantProductCard :item="item" />
210 254
 
211 255
           </div>
212 256
         </grid-view>
213 257
 
214
-        <div class=" flex justify-center items-center text-[12px] text-gray-500"
215
-        >
258
+        <div class=" flex justify-center items-center text-[12px] text-gray-500">
216 259
           <div v-if="state.status === 'loading'">
217 260
             加载中...
218 261
           </div>
@@ -225,17 +268,17 @@ function handleMakePhoneCall() {
225 268
     </div>
226 269
 
227 270
   </div>
228
-
229 271
 </template>
230 272
 <route lang="yaml" >
231 273
 style:
232
-  navigationBarTitleText: 已发货
274
+  navigationBarTitleText: 物流信息
233 275
 </route>
234 276
 
235 277
 <style lang="scss">
236 278
 page {
237 279
   background: #f8f8f8;
238 280
 }
281
+
239 282
 .nut-tab-pane {
240 283
   background: #f5f5f5 !important;
241 284
 }
@@ -300,4 +343,18 @@ page {
300 343
   }
301 344
 }
302 345
 
346
+.text_div {
347
+  font-size: 26rpx;
348
+  color: #666;
349
+}
350
+.custom-title {
351
+  // 设置 title 的宽度样式
352
+  text-align: left;
353
+  width: 578rpx; // 你可以根据需要设置宽度值
354
+}
355
+
356
+.custom-content {
357
+  width: 578rpx; // 你可以根据需要设置宽度值
358
+  font-size: 26rpx;
359
+}
303 360
 </style>

+ 28 - 17
src/pages/order/obligation-detail.vue

@@ -59,28 +59,36 @@ function updateRemainingTime(detail: any) {
59 59
   const currentTime = new Date().getTime();
60 60
   const endTime = new Date(detail.close_time).getTime();
61 61
   const timeDifference = endTime - currentTime;
62
-
63
-  // 计算剩余时间
64
-  const hours = Math.floor(timeDifference / (1000 * 60 * 60));
65
-  const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
66
-  const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
67
-
68
-  // 更新数据
69
-  remainingTime.value = {
70
-    hours: hours < 10 ? '0' + hours : hours,
71
-    minutes: minutes < 10 ? '0' + minutes : minutes,
72
-    seconds: seconds < 10 ? '0' + seconds : seconds
62
+  if (timeDifference > 0) {
63
+    // 计算剩余时间
64
+    const hours = Math.floor(timeDifference / (1000 * 60 * 60));
65
+    const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
66
+    const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
67
+
68
+    // 更新数据
69
+    remainingTime.value = {
70
+      hours: hours < 10 ? '0' + hours : hours,
71
+      minutes: minutes < 10 ? '0' + minutes : minutes,
72
+      seconds: seconds < 10 ? '0' + seconds : seconds
73
+    }
74
+  } else {
75
+    // 达到设定时间,执行关闭操作,你可以在这里添加你的关闭逻辑
76
+    clearInterval(timer);
77
+    uni.showToast({
78
+      title: '已自动取消订单',
79
+      icon: 'none'
80
+    })
81
+    setTimeout(() => {
82
+      uni.navigateBack()
83
+    }, 300)
84
+    console.log('自动关闭');
73 85
   }
86
+
74 87
 }
75 88
 
76 89
 
77 90
 // 每秒更新剩余时间
78 91
 const timer = setInterval(() => {
79
-  if (remainingTime.hours <= 0 && remainingTime.minutes <= 0) {
80
-    // 达到设定时间,执行关闭操作,你可以在这里添加你的关闭逻辑
81
-    clearInterval(timer);
82
-    console.log('自动关闭');
83
-  }
84 92
   updateRemainingTime(detail.value)
85 93
 }, 60000);
86 94
 
@@ -88,6 +96,8 @@ onUnload(() => {
88 96
   clearInterval(timer);
89 97
   console.log('卸载关闭');
90 98
 })
99
+
100
+
91 101
 function handlePayment() {
92 102
   // const {detail: orderItem} = props
93 103
   // const { orderItem } = detail.value
@@ -257,7 +267,8 @@ function handleProductItemClick(
257 267
 
258 268
             <div class="flex flex-col justify-center items-center">
259 269
               <!--                <FPrice :price="orderProduct.cart_info.productAttr.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
260
-              <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
270
+              <div class="font-bold text-[12px] !text-[#000]"> ¥{{
271
+                parseFloat(orderProduct.product_price).toFixed(2).replace(/\.?0+$/, '') }}</div>
261 272
               <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
262 273
             </div>
263 274
 

+ 310 - 108
src/pages/order_addcart/index.vue

@@ -1,7 +1,8 @@
1 1
 <script lang="ts" setup>
2
+import { ref } from 'vue';
2 3
 import { getRecommendList, getProductDetail } from "~/apis/merchant";
3 4
 import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
4
-import { deleteCartItem, getCartCount, getCartList, xcxBanding } from "~/apis/user";
5
+import { deleteCartItem, getCartCount, getCartList, removeCartItem, xcxBanding } from "~/apis/user";
5 6
 import type { ShoppingResult } from "~/apis/model/shopping.model";
6 7
 import FPrice from "~/components/FPrice/FPrice.vue";
7 8
 import FButton from "~/components/FButton/FButton.vue";
@@ -16,7 +17,7 @@ import { DcProductModel } from "~/apis/model/dacang.model";
16 17
 import { createShopping, changeProdoctSku } from "~/apis/order.api";
17 18
 import { encodeBase64 } from "~/utils/http/helper";
18 19
 import { CDN_URL } from "~/config/app";
19
-import { uniq } from "lodash-es";
20
+import { uniq, values } from "lodash-es";
20 21
 import { cartChange } from "~/apis/order.api";
21 22
 import type CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
22 23
 import CXBSkuPopup from "~/components/CXBSkuPopup/CXBSkuPopup.vue";
@@ -24,7 +25,7 @@ const gouwucheImage = CDN_URL + '/static/assets/gouwuche.png'
24 25
 const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
25 26
 const pageStore = usePageStoreWidthOut()
26 27
 const userStore = useUserStore()
27
-
28
+const u_id = ref('')
28 29
 const state = reactive({
29 30
   recommendList: [],
30 31
   currentPage: 1,
@@ -34,9 +35,10 @@ const state = reactive({
34 35
 
35 36
 
36 37
   totalCartCount: 0,
37
-  totalPrice: '',
38
+  totalPrice: 0,
39
+  totalNum: 0,
38 40
   selectAllIndeterminate: false,
39
-
41
+  product_id: [],
40 42
   cart_id: [],
41 43
   changeSkuCart_id: '0',
42 44
   isManage: true,
@@ -117,6 +119,8 @@ function handleCountChange(val) {
117 119
   // console.log(val)
118 120
   // detail.value.
119 121
   // if (val > 0) {
122
+  console.log(val);
123
+
120 124
   state.cartNum = val
121 125
   // }
122 126
 }
@@ -131,32 +135,50 @@ onBeforeMount(() => {
131 135
 onLoad((options) => {
132 136
 
133 137
   if (!userStore.uid) {
138
+    pageStore.setPageConfig({
139
+      currentPage: {
140
+        type: 'tab',
141
+        url: '/pages/home/index'
142
+      }
143
+    })
134 144
     return uni.redirectTo({
135 145
       url: '/pages/user/login/index'
136 146
     })
137 147
   }
148
+
138 149
   uni.$on('cart-reload', () => {
139 150
     // console.log('新商品添加...')
140 151
     state.recommendList = []
141 152
     state.cart_id = []
142 153
     loadCartList()
143 154
   })
144
-
155
+  u_id.value = userStore.uid
145 156
   state.cart_id = []
146 157
   loadCartList()
147 158
 })
148 159
 onShow(() => {
149
-  // pageStore.setPageConfig({
150
-  //   orderBack: {
151
-  //     type: 'tab',
152
-  //     url:  '/pages/order_addcart/index'
153
-  //   }
154
-  // })
160
+  Buttonshow.value = null
161
+  if (!userStore.uid) {
162
+    pageStore.setPageConfig({
163
+      currentPage: {
164
+        type: 'tab',
165
+        url: '/pages/home/index'
166
+      }
167
+    })
168
+    return uni.redirectTo({
169
+      url: '/pages/user/login/index'
170
+    })
171
+  }
155 172
   if (!state.isManage) {
156 173
     state.isManage = true
157 174
   }
175
+
176
+  if (u_id.value != userStore.uid) {
177
+    u_id.value = userStore.uid
178
+    loadCartList()
179
+
180
+  }
158 181
   loadCartCount()
159
-  loadCartList()
160 182
   loadList('reload')
161 183
 })
162 184
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -369,7 +391,7 @@ function cartAllCheck(type: 'single' | 'all') {
369 391
   })
370 392
 
371 393
   isAllSelect.value = allArr.length === shopping.value?.list.length
372
-  // state.totalCartCount = totalNum
394
+  state.totalNum = totalNum
373 395
   state.totalPrice = totalMoney
374 396
 }
375 397
 
@@ -395,6 +417,8 @@ function reTotal() {
395 417
   // state.totalCartCount = totalNum
396 418
   loadCartCount()
397 419
   state.totalPrice = totalMoney
420
+  state.totalNum = totalNum
421
+
398 422
 }
399 423
 function handleSelectAll(checked: boolean) {
400 424
 
@@ -428,6 +452,9 @@ function loadCartCount() {
428 452
 function handleManageCart() {
429 453
   state.isManage = !state.isManage
430 454
 }
455
+// function handleromoveCollect() {
456
+//   state.isManage = !state.isManage
457
+// }
431 458
 
432 459
 function handleSubmit() {
433 460
   // console.log(state.isManage)
@@ -439,6 +466,12 @@ function handleSubmit() {
439 466
 
440 467
     // console.log(state.cart_id)
441 468
     if (state.cart_id && state.cart_id.length > 0) {
469
+      pageStore.setPageConfig({
470
+        orderBack: {
471
+          type: 'tab',
472
+          url: '/pages/order_addcart/index'
473
+        }
474
+      })
442 475
       uni.navigateTo({
443 476
         url: `/pages/order-confirm/index?cartId=${state.cart_id.join(',')}`
444 477
       })
@@ -491,6 +524,51 @@ function handleDelete() {
491 524
     })
492 525
   }
493 526
 }
527
+//收藏功能
528
+function handleromoveCollect() {
529
+  // const cart_id = <any>[]
530
+  shopping.value?.list.forEach(shopItem => {
531
+    shopItem.list.forEach(goodItem => {
532
+      if (goodItem.check) {
533
+        state.product_id.push(goodItem.product_id)
534
+      }
535
+    })
536
+  })
537
+  state.product_id = uniq(state.product_id)
538
+
539
+  // console.log(cart_id)
540
+  if (state.cart_id.length === 0) {
541
+    return uni.showToast({
542
+      title: '请选择产品',
543
+      icon: "none"
544
+    })
545
+  } else {
546
+    uni.showModal({
547
+      title: '温馨提示',
548
+      content: '确认将宝贝移入收藏吗?',
549
+      success: (res) => {
550
+        if (res.confirm) {
551
+          console.log(state.product_id);
552
+          removeCartItem(state.product_id).then(res => {
553
+            console.log(res);
554
+            uni.showToast({
555
+              title: '收藏成功'
556
+            })
557
+            state.isManage = true
558
+            state.product_id = []
559
+            state.totalPrice = ''
560
+            loadCartList()
561
+          }).catch(error => {
562
+            console.log('error>>>', error);
563
+
564
+          })
565
+
566
+        } else if (res.cancel) {
567
+        }
568
+      }
569
+    })
570
+  }
571
+}
494 572
 
495 573
 
496 574
 function handleProductItemClick(
@@ -585,129 +663,209 @@ onUnload(() => {
585 663
   state.recommendList = []
586 664
   state.cart_id = []
587 665
 })
666
+function handleoneCollect(goodItem: any) {
667
+  console.log(goodItem);
668
+  uni.showModal({
669
+    title: '温馨提示',
670
+    content: '确认将宝贝移入收藏吗?',
671
+    success: (res) => {
672
+      if (res.confirm) {
673
+        console.log(goodItem.product_id);
674
+        removeCartItem([goodItem.product_id]).then(res => {
675
+          console.log(res);
676
+          uni.showToast({
677
+            title: '收藏成功'
678
+          })
679
+          Buttonshow.value = null
680
+          loadCartList()
681
+        }).catch(error => {
682
+          console.log('error>>>', error);
683
+
684
+        })
685
+
686
+      } else if (res.cancel) {
687
+      }
688
+    }
689
+  })
588 690
 
691
+}
692
+function handleoneDelete(goodItem: any) {
693
+  console.log(goodItem);
694
+
695
+  uni.showModal({
696
+    title: '温馨提示',
697
+    content: '确认将宝贝删除?',
698
+    success: (res) => {
699
+      if (res.confirm) {
700
+        deleteCartItem([goodItem.cart_id]).then(res => {
701
+          uni.showToast({
702
+            title: '删除成功'
703
+          })
704
+          Buttonshow.value = null
705
+          loadCartList()
706
+        })
707
+
708
+      } else if (res.cancel) {
709
+      }
710
+    }
711
+  })
712
+}
713
+// 暴露给模板的方法
714
+const Buttonshow = ref(null)
715
+const showButtons = (goodItem) => {
716
+  // 设置当前项的 showButtons 为 true,显示按钮
717
+  Buttonshow.value = goodItem;
718
+  goodItem.check = true
719
+};
720
+
721
+function handlePageClick() {
722
+  if (Buttonshow.value) {
723
+    Buttonshow.value = null;
724
+  } else {
725
+    return
726
+  }
727
+
728
+}
589 729
 </script>
590 730
 <template>
591
-  <div class="">
592
-    <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
593
-    <div v-if="hasShopping" class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end ">
594
-      <div class="pr-3">
595
-        <FButton size="small" @click="handleManageCart">
596
-          <div>{{ state.isManage ? '管理' : '完成' }}</div>
597
-        </FButton>
598
-      </div>
599
-    </div>
600
-    <div v-if="!hasShopping" class="flex flex-col justify-center items-center bg-white rounded-lg gap-3 text-xs py-8">
601
-      <div>
602
-        <image :src="gouwucheImage" mode="widthFix" class="w-20 h-20"></image>
731
+  <div @tap="handlePageClick">
732
+    <div class="">
733
+      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
734
+      <div v-if="hasShopping" class="bg-white h-10 fixed top-0 w-full z-999 flex justify-end ">
735
+        <div class="pr-3">
736
+          <FButton size="small" @click="handleManageCart">
737
+            <div>{{ state.isManage ? '管理' : '完成' }}</div>
738
+          </FButton>
739
+        </div>
603 740
       </div>
604
-      <div>
605
-        暂无商品,去添加喜欢的商品
741
+      <div v-if="!hasShopping" class="flex flex-col justify-center items-center bg-white rounded-lg gap-3 text-xs py-8">
742
+        <div>
743
+          <image :src="gouwucheImage" mode="widthFix" class="w-20 h-20"></image>
744
+        </div>
745
+        <div>
746
+          暂无商品,去添加喜欢的商品
747
+        </div>
606 748
       </div>
607
-    </div>
608
-    <div v-else class="mt-10 pb-10 ">
749
+      <div v-else class="mt-10 pb-10 ">
609 750
 
610
-      <div v-if="shopping && shopping.list" class="flex flex-col gap-4 px-3 pt-3 pb-8 ">
611
-        <div v-for="(shopItem, index) in shopping.list" :key="index" class="bg-white rounded-lg  ">
612
-          <div class="f-hairline-bottom flex  items-center font-bold p-3">
613
-            <div @tap.stop="handleShopTitleClick(shopItem)">
751
+        <div v-if="shopping && shopping.list" class="flex flex-col gap-4 px-3 pt-3 pb-8 ">
752
+          <div v-for="(shopItem, index) in shopping.list" :key="index" class="bg-white rounded-lg  ">
753
+            <div class="f-hairline-bottom flex  items-center font-bold p-3">
754
+              <div @tap.stop="handleShopTitleClick(shopItem)">
614 755
 
615
-              <nut-checkbox v-model="shopItem.allCheck" @change="(checked) => shopCheck(shopItem)" label="全选"
616
-                class="!text-primary">
617
-                {{ shopItem.mer_name }}
618
-              </nut-checkbox>
619
-            </div>
756
+                <nut-checkbox v-model="shopItem.allCheck" @change="(checked) => shopCheck(shopItem)" label="全选"
757
+                  class="!text-primary">
758
+                  {{ shopItem.mer_name }}
759
+                </nut-checkbox>
760
+              </div>
620 761
 
621
-          </div>
622
-          <div v-for="(goodItem, goodIndex) in shopItem.list" :key="goodIndex" class="flex f-hairline-bottom p-3 gap-2">
623
-            <div class="flex">
624
-              <nut-checkbox v-model="goodItem.check" @change="handleGoodsItemCheck" label="单选"
625
-                class="!text-primary"></nut-checkbox>
626
-              <image @click="handleProductItemClick(goodItem)" :src="goodItem.productAttr.image" mode="aspectFill"
627
-                class="w-18 h-18 rounded"></image>
628 762
             </div>
763
+            <div v-for="(goodItem, goodIndex) in shopItem.list" :key="goodIndex">
764
+              <div @longpress="showButtons(goodItem)" class="flex f-hairline-bottom p-3 gap-2"
765
+                :style="Buttonshow === goodItem ? { backgroundColor: '#919191' } : {}">
629 766
 
630
-            <div class="flex flex-col gap-1 w-full">
631
-              <div @click="handleProductItemClick(goodItem)" class="  text-overflow line-clamp-1 text-xs">{{
632
-                goodItem.product.store_name }}</div>
633
-              <div class="flex flex-col justify-start gap-1">
634
-                <div class="text-[10px] text-gray min-w-5  p-1  items-center flex " v-if="goodItem.productAttr.sku"
635
-                  @click="openTestLog(goodItem)">
636
-                  <div class="skushadow">
637
-                    <span class="m-live">
638
-                      {{ goodItem.productAttr.sku }}
639
-                    </span>
640
-                    <span class="m-lift">
641
-                      <img class="thumbnail_1" referrerpolicy="no-referrer" src="../../static/icon/下拉.png" />
642
-                    </span>
767
+                <div class="flex">
768
+                  <nut-checkbox v-model="goodItem.check" @change="handleGoodsItemCheck" label="单选"
769
+                    class="!text-primary"></nut-checkbox>
770
+                  <image @click="handleProductItemClick(goodItem)" :src="goodItem.productAttr.image" mode="aspectFill"
771
+                    class="w-18 h-18 rounded"></image>
772
+                </div>
773
+                <div class="flex flex-col gap-1 flex-1">
774
+                  <div @click="handleProductItemClick(goodItem)" class="  text-overflow line-clamp-1 text-xs">{{
775
+                    goodItem.product.store_name }}</div>
776
+                  <div class="flex flex-col justify-start gap-1">
777
+                    <div class="text-[10px] text-gray min-w-5  p-1  items-center flex " v-if="goodItem.productAttr.sku"
778
+                      @click="openTestLog(goodItem)">
779
+                      <div class="skushadow">
780
+                        <span class="m-live">
781
+                          {{ goodItem.productAttr.sku }}
782
+                        </span>
783
+                        <span class="m-lift">
784
+                          <img class="thumbnail_1" referrerpolicy="no-referrer" src="../../static/icon/下拉.png" />
785
+                        </span>
786
+                      </div>
787
+                    </div>
788
+                    <div class="flex">
789
+                      <CXBYaojinTag :amount="goodItem.yanglao" />
790
+
791
+                    </div>
792
+                  </div>
793
+                  <div class="flex  justify-between ">
794
+                    <div class="font-bold text-dark">¥{{ goodItem.productAttr.price }}</div>
795
+                    <nut-input-number v-model="goodItem.cart_num" @change="(num) => handleNumberChange(num, goodItem)" />
643 796
                   </div>
644 797
                 </div>
645
-                <div class="flex">
646
-                  <CXBYaojinTag :amount="goodItem.yanglao" />
647
-
798
+                <div class="del_sc" v-if="Buttonshow == goodItem">
799
+                  <div class="collect-btn" @click.stop="handleoneCollect(goodItem)">
800
+                    移入收藏
801
+                  </div>
802
+                  <div class="delete-btn" @click.stop="handleoneDelete(goodItem)">
803
+                    删除
804
+                  </div>
648 805
                 </div>
649
-              </div>
650
-              <div class="flex  justify-between ">
651
-                <!-- <FPrice :price="goodItem.productAttr.price" ex-class="font-bold text-dark" /> -->
652
-                <div class="font-bold text-dark" >¥{{ goodItem.productAttr.price }}</div>
653
-                <nut-input-number v-model="goodItem.cart_num" @change="(num) => handleNumberChange(num, goodItem)" />
806
+
807
+
654 808
               </div>
655 809
             </div>
810
+
656 811
           </div>
657
-        </div>
658 812
 
813
+        </div>
659 814
       </div>
660
-    </div>
661 815
 
662
-    <div class="pb-12" v-if="!hasShopping">
663
-      <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
664
-        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
665
-        <div>
666
-          精品推荐
816
+      <div class="pb-12" >
817
+        <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
818
+          <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
819
+          <div>
820
+            精品推荐
821
+          </div>
822
+          <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
667 823
         </div>
668
-        <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
669
-      </div>
670 824
 
671
-      <div class="pb-3 px-3" v-if="state.recommendList">
672
-        <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
673
-          <div v-for="(item, index) in state.recommendList" :key="index" @click="handleProductItemClick(item)">
674
-            <MerchantProductCard :item="item" />
825
+        <div class="pb-3 px-3" v-if="state.recommendList">
826
+          <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
827
+            <div v-for="(item, index) in state.recommendList" :key="index" @click="handleProductItemClick(item)">
828
+              <MerchantProductCard :item="item" />
675 829
 
676
-          </div>
677
-        </grid-view>
830
+            </div>
831
+          </grid-view>
678 832
 
679
-        <div class=" flex justify-center items-center text-[12px] text-gray-500">
680
-          <div v-if="state.status === 'loading'">
681
-            加载中...
682
-          </div>
683
-          <div v-if="state.status === 'noMore'">
684
-            没有更多了~
833
+          <div class=" flex justify-center items-center text-[12px] text-gray-500">
834
+            <div v-if="state.status === 'loading'">
835
+              加载中...
836
+            </div>
837
+            <div v-if="state.status === 'noMore'">
838
+              没有更多了~
839
+            </div>
685 840
           </div>
686
-        </div>
687 841
 
842
+        </div>
688 843
       </div>
689 844
     </div>
690
-  </div>
691
-  <CXBSkuPopup :isTo=1 v-model:show="state.isShowSku" :detail="detail" @selected:item="onSelectedSku"
692
-    @submit="handleCreateShopping" @count-change="handleCountChange" />
693
-  <div v-if="hasShopping" class="fixed bottom-0 w-full z-3">
694
-    <div class="bg-white h-10 flex justify-between" v-if="shopping && shopping.list">
695
-      <div class="flex justify-center items-center gap-2 pl-3" @tap.stop="handleSelectAll">
696
-        <nut-checkbox v-model="isAllSelect" label="全选" class="!text-primary">全选
697
-        </nut-checkbox>
698
-        <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div>
699
-      </div>
845
+    <CXBSkuPopup :isTo=1 v-model:show="state.isShowSku" :detail="detail" @selected:item="onSelectedSku"
846
+      @submit="handleCreateShopping" @count-change="handleCountChange" />
847
+    <div v-if="hasShopping" class="fixed bottom-0 w-full z-3">
848
+      <div class="bg-white h-10 flex justify-between" v-if="shopping && shopping.list">
849
+        <div class="flex justify-center items-center gap-2 pl-3" @tap.stop="handleSelectAll">
850
+          <nut-checkbox v-model="isAllSelect" label="全选" class="!text-primary">全选
851
+          </nut-checkbox>
852
+          <!-- <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div> -->
853
+        </div>
700 854
 
701
-      <div class="flex justify-center items-center gap-2 pr-3">
702
-        <div class="flex text-[12px]" v-if="state.isManage">
703
-          合计:
704
-          <FPrice :price="state.totalPrice"></FPrice>
705
-          <!--          {{totalCartInfo.totalPrice}}-->
855
+        <div class="flex justify-center items-center gap-2 pr-3">
856
+          <div class="flex text-[12px]" v-if="state.isManage">
857
+            <span v-if="state.totalNum != 0 && state.isManage">已选{{ state.totalNum }}件,</span>合计:<span
858
+              style="color: red;">¥{{ parseFloat(Number(state.totalPrice)).toFixed(2).replace(/\.?0+$/, '') }}</span>
859
+          </div>
860
+          <button v-if="!state.isManage" @click="handleromoveCollect"
861
+            class="['rounded-full', '!text-[14px]', 'text-black',remove_sc]">
862
+            移入收藏
863
+          </button>
864
+          <FButton @click="handleSubmit" size="small"
865
+            :exClass="['rounded-full', '!text-[14px]', 'text-white', 'bg-primary', 'w-full']">
866
+            {{ state.isManage ? '去结算' : '删除' }}
867
+          </FButton>
706 868
         </div>
707
-        <FButton @click="handleSubmit" size="small"
708
-          :exClass="['rounded-full', '!text-[14px]', 'text-white', 'bg-primary', 'w-full']">
709
-          {{ state.isManage ? '去结算' : '删除' }}
710
-        </FButton>
711 869
       </div>
712 870
     </div>
713 871
   </div>
@@ -749,6 +907,50 @@ page {
749 907
   height: 7rpx;
750 908
   margin-bottom: 6rpx;
751 909
 }
910
+
911
+
912
+.remove_sc {
913
+  background-color: #ffffff;
914
+  border: 1rpx solid #b7b7b7;
915
+  height: 64rpx;
916
+  line-height: 64rpx;
917
+  text-align: center;
918
+}
919
+
920
+
921
+/* 1111 */
922
+.del_sc {
923
+  position: absolute;
924
+  top: 50%;
925
+  margin-top: -60rpx;
926
+  left: 50%;
927
+  margin-left: -150rpx;
928
+  bottom: 0;
929
+  display: flex;
930
+}
931
+
932
+.delete-btn,
933
+.collect-btn {
934
+  width: 120rpx;
935
+  /* 调整按钮宽度 */
936
+  height: 120rpx;
937
+  border-radius: 60rpx;
938
+  display: flex;
939
+  align-items: center;
940
+  justify-content: center;
941
+  background-color: #ff4d4f;
942
+  /* 删除按钮背景色 */
943
+  color: #fff;
944
+  font-size: 14px;
945
+  z-index: 1;
946
+}
947
+
948
+.collect-btn {
949
+  margin-right: 60rpx;
950
+  background-color: #ffa319;
951
+  /* 移入收藏按钮背景色 */
952
+  /* 调整移入收藏按钮位置 */
953
+}
752 954
 </style>
753 955
 <route lang="yaml">
754 956
 style:

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

@@ -140,6 +140,8 @@ function onClickLeft() {
140 140
         // if (usePageStore.orderBack) {
141 141
         //   url += `&from=${usePageStore.orderBack}`
142 142
         // }
143
+        console.log(state.tabIndex);
144
+        
143 145
         if (state.tabIndex) {
144 146
           pageStore.setPageConfig({
145 147
             orderBack: {

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

@@ -51,7 +51,7 @@ const shitidian_yanglaojinImage = CDN_URL + '/static/assets/shitidian_yanglaojin
51 51
             <div class="flex justify-around w-full divide-gray divide-gray-1 h-15">
52 52
               <div class="flex flex-col justify-center items-center ">
53 53
                 <div class="text-xs text-light-100">
54
-                  未结算(补贴)养老金:
54
+                  未结算(预估)养老金:
55 55
                 </div>
56 56
                 <div class="font-bold flex " v-if="yanglaoStatistics">
57 57
                   <div>¥</div>

+ 1 - 1
src/pages/product/integral.vue

@@ -111,7 +111,7 @@ function handleItemClick(item) {
111 111
                     {{ item.store_name }}
112 112
                   </div>
113 113
                   <div class="text-[#fe0032] flex items-end gap-2">
114
-                    <div class="text-[20px]">{{ Number(item.price * 30).toFixed(2) }}</div>
114
+                    <div class="text-[20px]">{{  Math.round(item.price * 30)}}</div>
115 115
                     <div class="text-xs">积分</div>
116 116
                   </div>
117 117
                 </div>

+ 1 - 1
src/pages/product/zibuyangsheng.vue

@@ -114,7 +114,7 @@ onPullDownRefresh(() => {
114 114
                   </div>
115 115
                   <CXBYaojinTag :amount="item.yanglao" />
116 116
                   <div class="text-[#fe0032] flex items-end gap-2">
117
-                    <div class="text-[20px]">{{ Number(item.price).toFixed(2) }}</div>
117
+                    <div class="text-[20px]">{{parseFloat(Number(item.price)).toFixed(2).replace(/\.?0+$/, '') }}</div>
118 118
 <!--                    <div class="text-xs">积分</div>-->
119 119
                   </div>
120 120
                   <div class="line-through text-xs font-bold text-gray-400 flex ">

+ 298 - 131
src/pages/red-integral/index.vue

@@ -1,150 +1,93 @@
1 1
 <script setup lang="ts">
2
-import {useUserStore} from "~/stores/userStore";
3
-import {encodePhone} from "../../utils";
2
+import { useUserStore } from "~/stores/userStore";
3
+import { CDM_URL, CDN_URL } from "~/config/app";
4
+import { encodePhone } from "../../utils";
4 5
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
5
-import {getRedIntegralList} from "~/apis/user";
6
+import { getRedIntegralList, getBillIntegralList } from "~/apis/user";
6 7
 import dayjs from "dayjs";
7
-
8
+//https://cdn.bjtdba.com/vod/image/2023-12-11/20231211164924523.png
9
+//https://cdn.bjtdba.com/chuxubao/static/assets/search_zanwuxiangguan_220617.png
8 10
 const userStore = useUserStore();
9 11
 const data = ref([])
10
-
12
+//css颜色
13
+const activeTab = ref('bonus')
14
+const hjfImg = CDM_URL + '/image/2023-12-11/20231211164924523.png'
15
+const undataImg = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
11 16
 onLoad((options) => {
12 17
   userStore.getUserInfo()
13
-  getRedIntegralList({page: 1, limit: 20}).then(res => {
18
+  let params = {
19
+    page: 1,
20
+    limit: 20,
21
+    is_red: true
22
+  }
23
+  getBillIntegralList(params).then(res => {
14 24
     console.log(res)
15
-    if (res && res.length > 0) {
16
-      for (let item of res) {
17
-        // data.value = res
18
-        console.log(item.red)
19
-        data.value.push({
20
-          red: item.red,
21
-          mark: item.mark,
22
-          time: dayjs.unix(item.time).format('YYYY-MM-DD')
23
-        })
24
-      }
25
-    }
25
+    data.value = res.list
26 26
   })
27 27
 })
28
-// const userType = computed(() => {
29
-//   const userRichType = userStore.userInfo.user_rich_type
30
-//   // 创始人
31
-//   if (userRichType === 3) {
32
-//     return '创始人'
33
-//   }
34
-//   // 普通用户
35
-//   if (userRichType === 0) {
36
-//     return '用户'
37
-//   }
38
-//   // 会员
39
-//   if (userRichType === 1) {
40
-//     return '会员'
41
-//   }
42
-//   // 合伙人
43
-//   if (userRichType === 2) {
44
-//     return '合伙人'
45
-//   }
46
-//   if (!userRichType) {
47
-//     return '用户'
48
-//   }
49
-//
50
-//
51
-// })
52
-const userType = computed(() => {
53
-  const userRichType = userStore.userInfo?.user_rich_type
54
-  console.log(userStore.userInfo)
55
-  const bangfu = userStore.userInfo.is_bangfu ? '帮扶中心 ' : ''
56
-  // 创始人
57
-  if (userRichType == 3) {
58
-    if (bangfu) {
59
-      return ['创始人', bangfu]
60
-    }
61
-    return ['创始人']
62
-    // return [].push()
63
-  }
64
-  // 普通用户
65
-  if (userRichType == 0) {
66
-    if (bangfu) {
67
-      return ['用户', bangfu]
68
-    }
69
-    return ['用户']
70
-  }
71
-  // 会员
72
-  if (userRichType == 1) {
73
-    if (bangfu) {
74
-      return ['会员', bangfu]
75
-    }
76
-    return ['会员']
77 28
 
78
-  }
79
-  if (userRichType == 3) {
80
-    if (bangfu) {
81
-      return ['创始人', bangfu]
82
-    }
83
-    return ['创始人']
84
-  }
85
-  // 合伙人
86
-  if (userRichType == 4) {
87
-    // return '高级会员'
88
-    if (bangfu) {
89
-      return ['VIP', bangfu]
90
-    }
91
-    return ['VIP']
92
-  }
93
-  if (userRichType == 5) {
94
-    if (bangfu) {
95
-      return ['初始级合伙人', bangfu]
96
-    }
97
-    return ['初始级合伙人']
98
-  }
99
-  if (userRichType == 6) {
100
-    if (bangfu) {
101
-      return ['中级合伙人', bangfu]
102
-    }
103
-    return ['中级合伙人']
104
-  }
105
-  if (userRichType == 7) {
106
-    if (bangfu) {
107
-      return ['高级合伙人', bangfu]
108
-    }
109
-    return ['高级合伙人']
110
-  }
111
-  if (!userRichType) {
112
-    if (bangfu) {
113
-      return ['用户', bangfu]
29
+function changeTab(tab: any) {
30
+  activeTab.value = tab;
31
+  data.value = []
32
+  if (activeTab.value == 'bonus') {
33
+    let params = {
34
+      page: 1,
35
+      limit: 20,
36
+      is_red: true
114 37
     }
115
-    return ['用户']
38
+    getBillIntegralList(params).then(res => {
39
+      console.log(res)
40
+      data.value = res.list
41
+    })
42
+  } else if (activeTab.value == 'points') {
43
+    getRedIntegralList({ page: 1, limit: 20 }).then(res => {
44
+      console.log(res)
45
+      data.value = res
46
+    })
116 47
   }
117
-})
118
-
119
-const state = reactive({
120
-  striped: false,
121
-  columns: [{
122
-    title: '消耗积分数',
123
-    key: 'red'
124
-  }, {
125
-    title: '说明',
126
-    key: 'mark'
127
-  }, {
128
-    title: '时间',
129
-    key: 'time'
130
-  }]
131
-})
48
+}
132 49
 
133 50
 function handleToVipPage() {
134 51
   uni.navigateTo({
135
-    url: '/pages/vip/index'
52
+    url: '/pages/vip/index?type=user'
136 53
   })
137 54
 }
138 55
 
139 56
 function handleImmediateWithdrawal() {
140
-  uni.navigateTo({
141
-    url: '/pages/immediate-withdrawal/index'
142
-  })
57
+  if (userStore.userInfo.is_ertification == 1) {
58
+    uni.navigateTo({
59
+      url: '/pages/immediate-withdrawal/index?type=2'
60
+    })
61
+  }else{
62
+    setTimeout(() => {
63
+        uni.showModal({
64
+          title: '温馨提示',
65
+          content: '实名认证后才可提现',
66
+          cancelText: "取消", // 取消按钮的文字
67
+          confirmText: "去认证", // 确认按钮的文字
68
+          showCancel: true, // 是否显示取消按钮,默认为 true
69
+          confirmColor: '#f55850',
70
+          success: (res) => {
71
+            if (res.confirm) {
72
+              console.log('comfirm') //点击确定之后执行的代码
73
+              setTimeout(() => {
74
+                uni.navigateTo({
75
+                  url: '/pages/real-name-authentication/index'
76
+                })
77
+              }, 300);
78
+            } else {
79
+              console.log('cancel') //点击取消之后执行的代码
80
+            }
81
+          }
82
+        })
83
+      }, 300);
84
+  }
85
+
143 86
 }
144 87
 </script>
145 88
 
146 89
 <template>
147
-  <CXBBasePage>
90
+  <!-- <CXBBasePage>
148 91
     <div class="bg-[#FD1642] h-25 w-full absolute top-0 left-0"></div>
149 92
 
150 93
     <div class="flex flex-col gap-4 relative px-3">
@@ -166,9 +109,6 @@ function handleImmediateWithdrawal() {
166 109
                   <div class="text-sm" v-if="userStore.userInfo">
167 110
                     {{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录' }}
168 111
                   </div>
169
-<!--                  <div class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-fit h-5 justify-center items-center px-2">-->
170
-<!--                    {{userType}}-->
171
-<!--                  </div>-->
172 112
                   <div class="flex gap-1 items-center px-1">
173 113
                     <div
174 114
                         v-for="(item, index) in userType"
@@ -221,17 +161,244 @@ function handleImmediateWithdrawal() {
221 161
       </div>
222 162
 
223 163
     </div>
224
-    </CXBBasePage>
164
+    </CXBBasePage> -->
165
+
166
+  <div class="card_d" :style="{ background: 'url(' + hjfImg + ')', backgroundSize: 'cover' }">
167
+    <div class="flex p_gps flex-col justify-center ">
168
+      <div class="text_jjye">奖金余额</div>
169
+      <div class="jj_num">{{ userStore.userInfo.member_brokerage_price }}</div>
170
+    </div>
171
+    <div @click="handleImmediateWithdrawal" class="flex p_tx justify-center">
172
+      <div class="text_tx">提现</div>
173
+    </div>
174
+    <div class="flex p_hjf flex-col justify-center ">
175
+      <div class="text_hjf">红积分</div>
176
+      <div class="hjf_num">{{ parseFloat(Number(userStore.userInfo.red)).toFixed(2).replace(/\.?0+$/, '') }}</div>
177
+    </div>
178
+    <div @click="handleToVipPage" class="flex p_add justify-center">
179
+      <div class="text_add">复购增加红积分</div>
180
+    </div>
181
+  </div>
182
+  <div class="px-3">
183
+
184
+    <div>
185
+      <div class="flex justify-around  flex-1  items-center" style="padding-top: 10rpx; padding-bottom: 10rpx">
186
+        <div class="text_jl" :class="{ 'selected': activeTab === 'bonus' }" @click="changeTab('bonus')">会员奖金记录</div>
187
+        <div class="text_jl" :class="{ 'selected': activeTab === 'points' }" @click="changeTab('points')">红积分记录</div>
188
+      </div>
189
+      <!-- 会员奖金记录 -->
190
+      <div class="px-4" style="border-radius: 16rpx; background-color: #ffffff;"
191
+        v-if="activeTab === 'bonus' && data.length > 0">
192
+        <div class="flex justify-between flex-1 py-4 " style=" border-bottom: 1rpx solid #f0f0f0;"
193
+          v-for="(item, index) in data" :key="index">
194
+          <div>
195
+            <div class="text_mark" style="margin-bottom: 12rpx;">{{ item.mark }}</div>
196
+            <div class="text_c_time">{{ item.create_time }}</div>
197
+          </div>
198
+          <div class="text_price" :class="{ 'add_price': item.pm == '1' }">
199
+            {{ item.pm == 1 ? '+' : '-' }}{{ item.number }}
200
+          </div>
201
+        </div>
202
+      </div>
203
+      <div v-if="activeTab === 'bonus' && data.length <= 0" class=" flex flex-1 justify-center items-center ">
204
+        <div>
205
+          <div style="width: 206rpx; height:206rpx; margin-top: 206rpx;  margin-bottom: 60rpx;">
206
+            <image :src="undataImg" style="width: 100%; height: 100%;"></image>
207
+          </div>
208
+          <div class="none_data">暂无相关数据</div>
209
+        </div>
210
+
211
+
212
+      </div>
213
+
214
+      <!-- 红积分记录 -->
215
+      <div class="px-4" style="border-radius: 16rpx; background-color: #ffffff;"
216
+        v-if="activeTab === 'points' && data.length > 0">
217
+
218
+        <div class="flex justify-between flex-1 py-4 " style=" border-bottom: 1rpx solid #f0f0f0;"
219
+          v-for="(item, index) in data" :key="index">
220
+          <div>
221
+            <div class="text_mark" style="margin-bottom: 12rpx;">{{ item.mark }}</div>
222
+            <div class="text_c_time">{{ item.create_time }}</div>
223
+          </div>
224
+          <div class="text_price" :class="{ 'add_price': item.pm == '1' }">
225
+            {{ item.pm == 1 ? '+' : '-' }}{{ item.red }}
226
+          </div>
227
+        </div>
228
+      </div>
229
+      <div v-if="activeTab === 'points' && data.length <= 0" class=" flex flex-1 justify-center items-center ">
230
+        <div>
231
+          <div style="width: 206rpx; height:206rpx; margin-top: 206rpx;  margin-bottom: 60rpx;">
232
+            <image :src="undataImg" style="width: 100%; height: 100%;"></image>
233
+          </div>
234
+          <div class="none_data">暂无相关数据</div>
235
+        </div>
236
+      </div>
237
+    </div>
238
+  </div>
225 239
 </template>
226 240
 <route lang="yaml">
227 241
 style:
228
-  navigationBarTitleText: ""
242
+  navigationBarTitleText: 红积分提现
229 243
   enablePullDownRefresh: false
230
-  navigationBarBackgroundColor: "#fe0032"
231
-  navigationBarTextStyle: "white"
232 244
 </route>
233 245
 <style>
234 246
 page {
235
-  --nut-table-border-color: none
247
+  background-color: #f8f8f8;
248
+}
249
+
250
+.card_d {
251
+  width: 750rpx;
252
+  height: 366rpx;
253
+}
254
+
255
+.p_gps {
256
+  position: absolute;
257
+  top: 66rpx;
258
+  left: 68rpx;
259
+}
260
+
261
+.p_hjf {
262
+  position: absolute;
263
+  top: 214rpx;
264
+  left: 68rpx;
265
+}
266
+
267
+.text_jjye {
268
+  height: 26rpx;
269
+  font-size: 26rpx;
270
+  font-family: PingFangSC, PingFang SC;
271
+  font-weight: 400;
272
+  color: #FFFFFF;
273
+  line-height: 26rpx;
274
+}
275
+
276
+.text_hjf {
277
+  width: 78rpx;
278
+  height: 26rpx;
279
+  font-size: 26rpx;
280
+  font-family: PingFangSC, PingFang SC;
281
+  font-weight: 400;
282
+  color: #FFFFFF;
283
+  line-height: 26rpx;
284
+}
285
+
286
+.jj_num {
287
+  height: 75rpx;
288
+  font-size: 54rpx;
289
+  font-family: PingFangSC, PingFang SC;
290
+  font-weight: 500;
291
+  color: #FFFFFF;
292
+  line-height: 75rpx;
293
+}
294
+
295
+.hjf_num {
296
+  width: 89rpx;
297
+  height: 42rpx;
298
+  font-size: 30rpx;
299
+  font-family: PingFangSC, PingFang SC;
300
+  font-weight: 500;
301
+  color: #FFFFFF;
302
+  line-height: 42rpx;
303
+}
304
+
305
+
306
+.p_tx {
307
+  position: absolute;
308
+  top: 88rpx;
309
+  right: 80rpx;
310
+  width: 141rpx;
311
+  height: 63rpx;
312
+  background: linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.29) 100%);
313
+  border-radius: 32rpx;
314
+  text-align: center;
315
+}
316
+
317
+.p_add {
318
+  position: absolute;
319
+  top: 225rpx;
320
+  right: 66rpx;
321
+  width: 210rpx;
322
+  height: 47rpx;
323
+  background: linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.29) 100%);
324
+  border-radius: 24rpx;
325
+  text-align: center;
326
+}
327
+
328
+.text_tx {
329
+  height: 63rpx;
330
+  font-size: 28rpx;
331
+  font-family: PingFangSC, PingFang SC;
332
+  font-weight: 500;
333
+  color: #FFFFFF;
334
+  line-height: 63rpx;
335
+}
336
+
337
+.text_add {
338
+  width: 168rpx;
339
+  height: 47rpx;
340
+  font-size: 24rpx;
341
+  font-family: PingFangSC, PingFang SC;
342
+  font-weight: 400;
343
+  color: #FFFFFF;
344
+  line-height: 47rpx;
345
+}
346
+
347
+
348
+.text_jl {
349
+  text-align: center;
350
+  height: 50rpx;
351
+  font-size: 30rpx;
352
+  font-family: PingFangSC, PingFang SC;
353
+  font-weight: 500;
354
+  color: #333333;
355
+  line-height: 50rpx;
356
+}
357
+
358
+.selected {
359
+  color: #FE0032;
360
+  border-bottom: 6rpx solid #FE0032;
361
+  ;
362
+}
363
+
364
+.text_mark {
365
+  height: 30rpx;
366
+  font-size: 30rpx;
367
+  font-family: PingFangSC, PingFang SC;
368
+  font-weight: 400;
369
+  color: #333333;
370
+  line-height: 30rpx;
371
+}
372
+
373
+.text_c_time {
374
+  height: 26rpx;
375
+  font-size: 26rpx;
376
+  font-family: PingFangSC, PingFang SC;
377
+  font-weight: 400;
378
+  color: #999999;
379
+  line-height: 26rpx
380
+}
381
+
382
+.text_price {
383
+  height: 30rpx;
384
+  font-size: 30rpx;
385
+  font-family: PingFangSC, PingFang SC;
386
+  font-weight: 400;
387
+  color: #333333;
388
+  line-height: 30rpx;
389
+}
390
+
391
+.add_price {
392
+  color: #FE0032;
393
+}
394
+
395
+.none_data {
396
+  height: 30rpx;
397
+  font-size: 30rpx;
398
+  font-family: PingFangSC, PingFang SC;
399
+  font-weight: 400;
400
+  color: #999999;
401
+  line-height: 30rpx;
402
+  text-align: center;
236 403
 }
237 404
 </style>

+ 1 - 1
src/pages/refund/components/RefundReasonPopup.vue

@@ -82,7 +82,7 @@ function handleFinished() {
82 82
   >
83 83
     <div class="flex flex-col  h-full relative">
84 84
       <div class="flex p-3 f-hairline-bottom">
85
-        <div class="w-full text-center font-bold">货物状态</div>
85
+        <div class="w-full text-center font-bold">退款原因</div>
86 86
         <div class="absolute right-3"
87 87
              @tap.stop="handleClose"
88 88
         >

+ 672 - 123
src/pages/refund/detail.vue

@@ -1,64 +1,200 @@
1 1
 <script setup lang="ts">
2
-import {CDN_URL} from "~/config/app";
3
-import {getRefundDetail} from "~/apis/order.api";
2
+import { CDN_URL } from "~/config/app";
3
+import { getRefundDetail, getRefundWlList } from "~/apis/order.api";
4 4
 import FPrice from "~/components/FPrice/FPrice.vue";
5 5
 
6
-// const bgImg = CDN_URL + '/static/assets/shouhoudingdanbeijing.png'
7
-const getStatusText = computed(() => {
8
-  // 商家已处理
9
-  // 退款成功, 系统已退款
10
-  const status = state.detail.status
11
-  // const status = -1
12
-  if (status == 0) {
13
-    return ['提交退款申请', '提交退款申请成功,等待处理']
14
-  }
15
-  if (status == -1) {
16
-    return ['退款失败', '请联系商家']
17
-  }
18
-  // 待退货
19
-  if (status == 1) {
20
-    return ['商家处理中', '72小时内商家未处理将自动退款']
21
-  }
22
-  // 待收货
23
-  if (status == 2) {
24
-    return ['商家处理中', '72小时内商家未处理将自动退款']
25
-  }
26
-  // 已退款
27
-  if (status == 3) {
28
-    return ['退款成功', '系统已退款']
29
-
30
-  }
31
-})
32 6
 const state = reactive({
7
+  refund_id: '',
33 8
   currentStep: 1,
34 9
   currentStepTitle: '退款申请',
35
-  detail: null
10
+  detail: {}
36 11
 })
12
+// const bgImg = CDN_URL + '/static/assets/shouhoudingdanbeijing.png'
13
+
14
+const isshow = ref(false)
15
+const takeshow = ref(false)
16
+const wldata = ref([])
17
+
37 18
 // const detail = ref({})
38 19
 onLoad((options) => {
39
-  getRefundDetail(options.id).then(res => {
40
-  // getRefundDetail(657).then(res => {
20
+  if (options && options.id) {
21
+    // refundDetail(options.id)
22
+    // refundWlList(options.id)
23
+    state.refund_id = options.id
24
+  }
25
+})
26
+
27
+function refundDetail(id: any) {
28
+  getRefundDetail(id).then(res => {
29
+    // getRefundDetail(657).then(res => {
41 30
     console.log(res)
42 31
     state.detail = res
43 32
     // res.status = -1
44
-    if (res.status == 0) {
45
-      state.currentStep = 1
46
-    }
47
-    if (res.status == 1 || res.status == 2) {
48
-      state.currentStep = 2
33
+    //三步骤
34
+    if (res.refund_type == 1) {
35
+      if (res.status == 0) {
36
+        state.currentStep = 1
37
+      }
38
+      if (res.status == 1) {
39
+        state.currentStep = 2
40
+      }
41
+      if (res.status == 3) {
42
+        state.currentStep = 3
43
+      }
49 44
     }
50
-    if (res.status == 3) {
51
-      state.currentStep = 3
45
+    if (res.refund_type == 2) {
46
+      if (res.status == 0) {
47
+        state.currentStep = 1
48
+      }
49
+      if (res.status == 1) {
50
+        state.currentStep = 2
51
+      }
52
+      if (res.status == 2) {
53
+        state.currentStep = 3
54
+      }
55
+      if (res.status == 3) {
56
+        state.currentStep = 4
57
+      }
52 58
     }
53
-    if (res.status == -1) {
54
-      state.currentStep = 2
59
+
60
+
61
+  })
62
+}
63
+function refundWlList(id: any) {
64
+  getRefundWlList(id).then((res) => {
65
+    // getRefundDetail(657).then(res => {
66
+    console.log(res)
67
+    if (res.length > 0) {
68
+      wldata.value = res
69
+    } else {
70
+      wldata.value = [{
71
+        status: '运输中',
72
+        time: state.detail.create_time
73
+      }]
55 74
     }
75
+
76
+
56 77
   })
78
+}
79
+onShow(() => {
80
+  if (state.refund_id) {
81
+    refundDetail(state.refund_id)
82
+    refundWlList(state.refund_id)
83
+
84
+  }
85
+})
86
+const getStatusshow = computed(() => {
87
+  // 商家已处理
88
+  // 退款成功, 系统已退款
89
+  if (state.detail.refund_status) {
90
+    const status = state.detail.refund_status
91
+    // const status = -1
92
+    //待审核
93
+    if (status != 2 || status != 1 || status != 0) {
94
+      return false
95
+    } else {
96
+      return true
97
+    }
98
+  }
99
+
100
+})
101
+
102
+const getshowKd = computed(() => {
103
+  if (state.detail.refund_type == 2) {
104
+    if (state.detail.refund_status) {
105
+      const status = state.detail.refund_status
106
+      // const status = -1
107
+      //待审核
108
+      if (status == 3 || status == 5 || status == 2) {
109
+        return true
110
+      } else {
111
+        return false
112
+      }
113
+    }
114
+  } else if (state.detail.refund_type == 1) {
115
+    return false
116
+  }
117
+
118
+
119
+})
120
+
121
+const getStatusText = computed(() => {
122
+  // 商家已处理
123
+  // 退款成功, 系统已退款
124
+  if (state.detail.refund_status) {
125
+    const status = state.detail.refund_status
126
+    // const status = -1
127
+    //待审核
128
+    if (status == 0) {
129
+      return ['审核中', '售后申请已提交,请耐心等待']
130
+    }
131
+
132
+    // 待退货
133
+    if (status == 1) {
134
+      return ['待退货', '72小时内未寄回,将自动取消申请']
135
+    }
136
+    // 待收货
137
+    if (status == 2) {
138
+      return ['退货中', '商品已寄出,请等待商家处理']
139
+    }
140
+    // 已退款
141
+    if (status == 3 || status == 5) {
142
+      return ['退款成功', '退货服务已完成,如有疑问请联系商家']
143
+
144
+    }
145
+    // 超时
146
+    if (status == 6) {
147
+      return ['超时未发货,申请已取消', '因您超时未发货,申请已自动取消,若有问题请联系商家']
148
+
149
+    }
150
+    //退款失败
151
+    if (status == -1 && state.detail.refund_type == 1) {
152
+      return ['退款失败', '退款失败,请联系商家', '查看失败原因']
153
+    }
154
+    // 审核未通过
155
+    if (status == -1 && state.detail.refund_type == 2) {
156
+      return ['审核未通过', '您的售后申请未通过,若有问题请联系商家', '查看原因']
157
+
158
+    }
159
+  }
160
+
57 161
 })
58 162
 
59 163
 function handleClipboard() {
60 164
   uni.setClipboardData({
61
-    data: state.detail.refund_order_sn,
165
+    data: state.detail.order.order_sn,
166
+    success(res) {
167
+      // wx.getClipboardData({
168
+      //   success (res) {
169
+      //     console.log(res.data) // data
170
+      //   }
171
+      // })
172
+    }
173
+  })
174
+}
175
+//收件人信息复制
176
+function handleCopy1() {
177
+  let copyData = state.detail.mer_delivery_user + ' ' + state.detail.phone + ' ' + state.detail.mer_delivery_address
178
+  console.log(copyData);
179
+
180
+  uni.setClipboardData({
181
+    data: copyData,
182
+    success(res) {
183
+      // wx.getClipboardData({
184
+      //   success (res) {
185
+      //     console.log(res.data) // data
186
+      //   }
187
+      // })
188
+    }
189
+  })
190
+}
191
+//退货快递信息复制
192
+function handleCopy2() {
193
+  let copyData = state.detail.delivery_id
194
+  console.log(copyData);
195
+
196
+  uni.setClipboardData({
197
+    data: copyData,
62 198
     success(res) {
63 199
       // wx.getClipboardData({
64 200
       //   success (res) {
@@ -74,134 +210,419 @@ function handleHeaderClick() {
74 210
     url: `/pages/store/home/index?id=${state.detail.merchant.mer_id}`
75 211
   })
76 212
 }
213
+
214
+
215
+function handleTosCancode() {
216
+  uni.navigateTo({
217
+    url: `/pages/refund/scancode/scancode?refund_order_id=${state.detail.refund_order_id}&&phone=${state.detail.phone}`
218
+  })
219
+}
220
+function handleTophone() {
221
+
222
+  if (state.detail.order.douhuomall == 1) {
223
+    uni.openCustomerServiceChat({
224
+      extInfo: {
225
+        url: 'https://work.weixin.qq.com/kfid/kfc8bd3f11a28aa81db'
226
+      },
227
+      corpId: 'wwaeb55681929a37ae',
228
+      success: (res => {
229
+        console.log(res)
230
+      }),
231
+      fail: (res => {
232
+        console.log(res)
233
+      })
234
+    })
235
+  } else {
236
+    const phone = state.detail.merchant.service_phone
237
+    uni.makePhoneCall({
238
+      phoneNumber: phone, // 替换成实际的电话号码
239
+      success: function () {
240
+        console.log('拨打电话成功');
241
+      },
242
+      fail: function (err) {
243
+        console.log('拨打电话失败', err);
244
+      },
245
+    });
246
+
247
+  }
248
+}
249
+
250
+function toShowValue() {
251
+  isshow.value = true
252
+}
253
+function onCancel() {
254
+  isshow.value = false
255
+}
256
+
257
+function transformStatus() {
258
+  takeshow.value = !takeshow.value
259
+  if (takeshow.value == false) {
260
+    uni.pageScrollTo({
261
+      scrollTop: 0,
262
+    });
263
+  }
264
+}
265
+
266
+
267
+//去协商记录
268
+function toXSlist() {
269
+  uni.navigateTo({
270
+    url: `/pages/refund/scancode/xsjllist?refund_order_id=${state.detail.refund_order_id}`
271
+  })
272
+}
273
+
274
+const statusimg = computed(() => {
275
+  if (takeshow.value == false) {
276
+    return '../../static/icon/展开.png'
277
+  } else {
278
+    return '../../static/icon/收起.png'
279
+  }
280
+})
281
+const statustext = computed(() => {
282
+  if (takeshow.value == false) {
283
+    return '展开'
284
+  } else {
285
+    return '收起'
286
+  }
287
+})
77 288
 </script>
78 289
 <template>
290
+  <div v-if="getStatusText != undefined">
291
+    <div class="px-3 pt-3 relative h-full"
292
+      v-if="state.detail.refund_status == -1 || state.detail.refund_status == 4 || state.detail.refund_status == 6">
293
+      <div class="bg-white  rounded-lg p-3 flex justify-center items-center ">
294
+        <div class="w-full">
295
+          <div class="items-center">
296
+            <div class="flex items-center font-bold gap-2 text-sm mb-3 w-full">
297
+              <div class="flex-1 flex items-center gap-2 ">
298
+                <div class="line-clamp-1 text_font ">
299
+                  {{ getStatusText[0] }}
300
+                </div>
301
+              </div>
302
+              <div v-if="state.detail.refund_status != 6" class="line_hei " @click="toShowValue">
303
+                <span class="text_lok">{{ getStatusText[2] }}</span>
304
+                <span class="f-text-color-2 i-tabler-chevron-right"></span>
305
+              </div>
79 306
 
80
-    <div class=" ">
81
-      <div class="top-bg relative">
82
-        <div class="text-white p-3">
83
-          <div class="text-md">{{ getStatusText[0]}}</div>
84
-          <div class="text-[12px] text-gray-50">{{ getStatusText[1]}}</div>
307
+            </div>
308
+            <div class="text_dis">
309
+              {{ getStatusText[1] }}
310
+            </div>
311
+          </div>
85 312
         </div>
313
+      </div>
314
+    </div>
315
+    <div class="top-bg relative" v-else>
316
+      <div class="text-white p-3">
317
+        <div class="text-md">{{ getStatusText[0] }}</div>
318
+        <div class="text-[12px] text-gray-50">{{ getStatusText[1] }}</div>
319
+      </div>
320
+      <div class="p-3">
321
+        <div class="bg-white rounded-lg h-18 flex justify-center items-center w-full ">
322
+          <div class="w-full">
323
+            <nut-steps :current="state.currentStep" progress-dot v-if="state.detail.refund_type == 2">
324
+              <nut-step title="退款申请">
325
+
326
+                <template #title>退款申请</template>
327
+              </nut-step>
328
+              <nut-step title="商家处理">
329
+
330
+                <template #title>商家处理</template>
331
+              </nut-step>
332
+              <nut-step title="商品寄回">
333
+
334
+                <template #title>商品寄回</template>
335
+              </nut-step>
336
+              <nut-step title="退款成功">
86 337
 
87
-        <div class="p-3">
88
-          <div class="bg-white rounded-lg h-18 flex justify-center items-center w-full ">
89
-            <div class="w-full">
90
-              <nut-steps :current="state.currentStep" progress-dot  v-if="state.detail.status == -1">
91
-                <nut-step title="退款申请"></nut-step>
92
-                <nut-step title="商家处理"></nut-step>
93
-                <nut-step title="退款失败"></nut-step>
338
+                <template #title>退款成功</template>
339
+              </nut-step>
340
+            </nut-steps>
341
+            <nut-steps :current="state.currentStep" progress-dot v-if="state.detail.refund_type == 1">
342
+              <nut-step title="售后申请">
343
+
344
+                <template #title>售后申请</template>
345
+              </nut-step>
346
+              <nut-step title="商家处理">
347
+                <template #title>商家处理</template>
348
+              </nut-step>
349
+              <nut-step title="退款成功">
350
+
351
+                <template #title>退款成功</template>
352
+              </nut-step>
353
+            </nut-steps>
354
+          </div>
355
+
356
+        </div>
357
+      </div>
358
+    </div>
359
+
360
+    <!-- 退款商品详情 -->
361
+    <div class="p-3 relative h-full" style="padding-bottom:160rpx;">
362
+      <!-- 物流信息 -->
363
+      <div class="bg-white mb-3 rounded-lg p-3 flex justify-center items-center " v-if="getshowKd">
364
+        <div class="w-full">
365
+          <div class="items-center mb-3">
366
+            <div class="flex items-center  gap-2 text-sm w-full">
367
+              <div class="flex-1 flex justify-between items-center gap-2 ">
368
+                <div class="text_box">
369
+                  快递公司
370
+                </div>
371
+                <div class="text_box">
372
+                  {{ state.detail.delivery_type }}
373
+                </div>
374
+              </div>
375
+            </div>
376
+          </div>
377
+          <div class="">
378
+            <div class="justify-between flex-1 flex items-center gap-2 ">
379
+              <div class="text_box">
380
+                快递单号
381
+              </div>
382
+              <div style="color: #999999; font-size: 28rpx; display: flex; " @click="handleCopy2">
383
+                <div>{{ state.detail.delivery_id }}</div>
384
+                <div style="font-size: 26rpx; margin-left: 26rpx; ">复制</div>
385
+              </div>
386
+            </div>
387
+            <div class="justify-between mt-2 flex-1 flex items-center gap-2 ">
388
+              <div style="24rpx" class="rounded-full w-4 h-4 bg-gray-400 text-white flex flex-col justify-center items-center">收</div>
389
+              <div class="text_div flex-1 ">
390
+                {{ state.detail.mer_delivery_address + ' ' + state.detail.mer_delivery_user + ' ' + state.detail.phone }}
391
+              </div>
392
+            </div>
393
+            <div class="text_div mb-2 w-full " style="color: #333333;" v-if="wldata.length > 0">
394
+              <nut-steps v-if="takeshow == true" :current="1" progress-dot direction="vertical">
395
+                <nut-step v-for="(item, index) in wldata" :key="index" style="width: 578rpx;" :title="item?.status"
396
+                  :content="item.time">
397
+                  <template #title>
398
+                    <div :style="{ color: index === 0 ? '#333' : '#999' }" class="mt-2 custom-title">{{ item?.status }}
399
+                    </div>
400
+                  </template>
401
+                  <template #content>
402
+                    <div class="custom-content">{{ item.time }}</div>
403
+                  </template>
404
+                </nut-step>
94 405
               </nut-steps>
95
-              <nut-steps :current="state.currentStep" progress-dot  v-else>
96
-                <nut-step title="退款申请"></nut-step>
97
-                <nut-step title="商家处理"></nut-step>
98
-                <nut-step title="退款成功"></nut-step>
406
+              <nut-steps v-if="takeshow == false" :current="1" progress-dot direction="vertical">
407
+                <nut-step style="width: 578rpx;" :title="wldata[0].status" :content="wldata[0].time">
408
+                  <template #title>
409
+                    <div :style="{ color: '#333' }" class="mt-2 custom-title">{{ wldata[0].status }}</div>
410
+                  </template>
411
+                  <template #content>
412
+                    <div class="custom-content">{{ wldata[0].time }}</div>
413
+                  </template>
414
+                </nut-step>
99 415
               </nut-steps>
100 416
             </div>
417
+            <div class="flex w-full" @click="transformStatus"
418
+              style="height:36rpx;  justify-content: center; align-items: center; ">
419
+              <div class="text_dew">{{ statustext }}</div>
420
+              <div style="width: 36rpx; height: 36rpx; ">
421
+                <image style="width: 36rpx; height: 36rpx;" :src="statusimg"></image>
422
+              </div>
423
+            </div>
424
+          </div>
425
+        </div>
426
+      </div>
427
+      <!-- 商家收件信息 -->
428
+      <div class="bg-white mb-3 rounded-lg p-3 flex justify-center items-center " v-if="state.detail.refund_status == 1">
429
+        <div class="w-full">
430
+          <div class="items-center mb-3 pb-3 f-hairline-bottom">
431
+            <div class="flex items-center font-bold gap-2 text-sm w-full">
432
+              <div class="flex-1 flex items-center gap-2 ">
433
+                <div class="text_div">
434
+                  请填写快递单号,请勿邮寄到付
435
+                </div>
436
+              </div>
437
+            </div>
438
+          </div>
439
+          <div class="">
440
+            <div class="justify-between flex-1 flex items-center gap-2 ">
441
+              <div class="line-clamp-1 font-bold text-sm">
442
+                商家收件信息
443
+              </div>
444
+              <div style="color: #333; font-size: 26rpx; display: flex; " @click="handleCopy1">
445
+                <div class="copy_img">
446
+                  <image src="../../static/icon/复制.png"></image>
447
+                </div>
448
+                <div>复制</div>
449
+              </div>
450
+            </div>
451
+            <div class="justify-between mt-2 flex-1 flex items-center gap-2 ">
452
+              <div class="text_div">{{ state.detail.mer_delivery_user }}</div>
453
+              <div class="text_div">{{ state.detail.phone }}</div>
454
+            </div>
455
+            <div class="text_div my-2 ">
456
+              {{ state.detail.mer_delivery_address }}
457
+            </div>
458
+          </div>
459
+        </div>
460
+      </div>
461
+      <!-- 退货需知  -->
462
+      <div class="bg-white mb-3 rounded-lg p-3 flex justify-center items-center " v-if="getStatusshow">
463
+        <div class="w-full">
464
+          <div class="items-center">
465
+            <div class="flex items-center font-bold gap-2 text-sm w-full">
466
+              <div class="flex-1 flex items-center gap-2 ">
467
+                <div class="line-clamp-1">
468
+                  退货需知
469
+                </div>
470
+              </div>
471
+            </div>
472
+            <div class="text_div">
473
+              请确保商品不影响二次销售 (质量问题除外)
474
+            </div>
475
+          </div>
476
+        </div>
101 477
 
478
+
479
+      </div>
480
+
481
+      <!-- 协商记录 -->
482
+      <div @click="toXSlist" class="bg-white mb-3 rounded-lg p-3 flex justify-center items-center ">
483
+        <div class="w-full">
484
+          <div class="flex items-center  ">
485
+            <div class="flex items-center font-bold gap-2 text-sm w-full">
486
+              <div class="flex-1 flex items-center gap-2 ">
487
+                <div class="line-clamp-1">
488
+                  协商记录
489
+                </div>
490
+              </div>
491
+              <div class="f-text-color-2 i-tabler-chevron-right"></div>
492
+            </div>
102 493
           </div>
103 494
         </div>
104 495
       </div>
105 496
 
106
-      <!-- 退款商品详情 -->
107
-      <div class="p-3 relative h-full">
108
-        <div class="bg-white rounded-lg p-3 flex justify-center items-center ">
109
-          <div class="w-full">
110
-            <div
111
-                @click.stop="handleHeaderClick"
112
-                class="flex items-center f-hairline-bottom pb-3 px-3">
113
-              <div class="flex items-center font-bold gap-2 text-sm w-full">
114
-                <div class="flex-1 flex items-center gap-2 ">
115
-                  <image :src="state.detail.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
116
-                  <div class="line-clamp-1">
117
-                    {{ state.detail.merchant.mer_name }}
118
-                  </div>
497
+      <div class="bg-white rounded-lg p-3 flex justify-center items-center ">
498
+        <div class="w-full">
499
+          <div class="flex items-center f-hairline-bottom  pb-3 px-3">
500
+            <div class="flex items-center font-bold gap-2 text-sm w-full">
501
+              <div class="flex-1 flex items-center gap-2 ">
502
+                <image :src="state.detail.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
503
+                <div class="line-clamp-1">
504
+                  {{ state.detail.merchant.mer_name }}
119 505
                 </div>
506
+              </div>
120 507
 
121
-                <div class="f-text-color-2 i-tabler-chevron-right"></div>
508
+              <!-- <div class="f-text-color-2 i-tabler-chevron-right"></div> -->
122 509
 
123
-              </div>
124 510
             </div>
511
+          </div>
125 512
 
126
-            <div>
127
-              <div v-for="(orderProduct, orderProductIndex) in state.detail.refundProduct" :key="orderProductIndex">
128
-                <div class="flex py-2 gap-3 f-hairline-bottom pb-3">
129
-                  <div class="flex-1 flex gap-2">
130
-                    <image :src="orderProduct.product.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
131
-                    <div class="flex flex-col flex-1">
132
-                      <div class="line-clamp-2 text-[12px]">
133
-                        {{ orderProduct.product.cart_info.product.store_name }}
134
-                      </div>
135
-                      <div class="text-gray-500 text-[10px]">
136
-                        {{ orderProduct.product.cart_info.productAttr.sku }}
137
-                      </div>
513
+          <div>
514
+            <div v-for="(orderProduct, orderProductIndex) in state.detail.refundProduct" :key="orderProductIndex">
515
+              <div class="flex py-2 gap-3 f-hairline-bottom pb-3">
516
+                <div class="flex-1 flex gap-2">
517
+                  <image :src="orderProduct.product.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
518
+                  <div class="flex flex-col flex-1">
519
+                    <div class="line-clamp-2 text-[12px]">
520
+                      {{ orderProduct.product.cart_info.product.store_name }}
138 521
                     </div>
139
-                    <div class="justify-end flex">
140
-                      <div class="flex flex-col ">
141
-                        <div class="text-[12px] font-bold">
142
-                          <FPrice :price="orderProduct.product.product_price" ex-class="font-bold text-black"/>
143
-                        </div>
144
-                        <div class="text-gray-500 text-[11px] text-right">共{{ orderProduct.product.product_num }}件</div>
522
+                    <div class="text-gray-500 text-[10px]">
523
+                      {{ orderProduct.product.cart_info.productAttr.sku }}
524
+                    </div>
525
+                  </div>
526
+                  <div class="justify-end flex">
527
+                    <div class="flex flex-col ">
528
+                      <div class="text-[12px] font-bold">
529
+                        <FPrice :price="orderProduct.product.product_price" ex-class="font-bold text-black" />
145 530
                       </div>
531
+                      <div class="text-gray-500 text-[11px] text-right">共{{ orderProduct.product.product_num }}件</div>
146 532
                     </div>
147 533
                   </div>
148 534
                 </div>
149 535
               </div>
150 536
             </div>
537
+          </div>
151 538
 
152
-            <div class="pt-3 flex flex-col justify-end text-[14px]">
539
+          <div class="pt-3 flex flex-col justify-end text-[14px]">
153 540
 
154
-              <div class="f-hairline-bottom py-3 flex flex-col gap-3">
155
-                <div class="flex justify-between">
156
-                  <div>退款总额</div>
157
-                  <div>
158
-                    <FPrice :price="state.detail.refund_price" :ex-class="['text-gray-400']"></FPrice>
159
-                  </div>
160
-                </div>
161
-                <div class="flex justify-between">
162
-                  <div>申请件数</div>
163
-                  <div class="text-gray-400">{{ state.detail.refund_num }}</div>
164
-                </div>
165
-                <div class="flex justify-between">
166
-                  <div>收货状态</div>
167
-                  <div class="text-gray-400">{{ state.detail.take_status }}</div>
541
+            <div class="f-hairline-bottom py-3 flex flex-col gap-3">
542
+              <div class="flex justify-between">
543
+                <div>退款金额</div>
544
+                <div>
545
+                  <FPrice :price="state.detail.refund_price" :ex-class="['text-gray-400']"></FPrice>
168 546
                 </div>
169 547
               </div>
548
+              <!-- <div class="flex justify-between">
549
+                <div>申请件数</div>
550
+                <div class="text-gray-400">{{ state.detail.refund_num }}</div>
551
+              </div> -->
552
+              <div class="flex justify-between">
553
+                <div>退货原因</div>
554
+                <div class="text-gray-400">{{ state.detail.refund_message }}</div>
555
+              </div>
556
+            </div>
170 557
 
171
-              <div class="py-3 flex flex-col gap-3">
172
-                <div class="flex justify-between">
173
-                  <div>订单编号</div>
174
-                  <div class="flex gap-2">
175
-                    <div class="text-gray-400">{{ state.detail.refund_order_sn }}</div>
176
-                   <div @click="handleClipboard">复制</div>
177
-                  </div>
178
-                </div>
179
-                <div class="flex justify-between">
180
-                  <div>申请时间</div>
181
-                  <div class="text-gray-400">{{ state.detail.create_time }}</div>
182
-                </div>
183
-                <div class="flex justify-between">
184
-                  <div>备注说明</div>
185
-                  <div class="text-gray-400">{{ state.detail.mark ? state.detail.mark : '暂无说明' }}</div>
558
+            <div class="py-3 flex flex-col gap-3">
559
+              <div class="flex justify-between">
560
+                <div>订单编号</div>
561
+                <div class="flex gap-2">
562
+                  <div class="text-gray-400">{{ state.detail.order.order_sn }}</div>
563
+                  <div @click="handleClipboard">复制</div>
186 564
                 </div>
187
-
188 565
               </div>
566
+              <div class="flex justify-between">
567
+                <div>申请时间</div>
568
+                <div class="text-gray-400">{{ state.detail.create_time }}</div>
569
+              </div>
570
+              <!-- <div class="flex justify-between">
571
+                <div>备注说明</div>
572
+                <div class="text-gray-400">{{ state.detail.mark ? state.detail.mark : '暂无说明' }}</div>
573
+              </div> -->
189 574
 
190 575
             </div>
191 576
 
192 577
           </div>
193 578
 
194
-
195 579
         </div>
196 580
 
581
+
197 582
       </div>
583
+    </div>
584
+    <!-- 查看失效原因 -->
585
+    <FPopup v-model:show="isshow" position="bottom"
586
+      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[70%] max-h-[80%] h-full">
587
+      <div class="section_1">
588
+        <div class="flex_mar">
589
+          <div class="text_span1">{{ getStatusText[0] }}原因</div>
590
+        </div>
591
+      </div>
592
+      <div class="img_box" @click="onCancel">
593
+        <image class="label_img" src="../../static/icon/close.png" />
594
+      </div>
595
+      <div class="text1_2 px-4 ">
596
+        {{ state.detail.fail_message }}
597
+      </div>
598
+    </FPopup>
599
+  </div>
600
+  <!-- 待退货,跳转退货快递单号页面 -->
601
+  <div class="flexd_div  " v-if="state.detail.refund_status == 1">
602
+    <div class="flexd_box">
603
+      <button @click="handleTosCancode" style="width: 686rpx;
604
+height: 82rpx;font-size: 30rpx; " class="['!bg-primary', 'rounded-full', 'text-white']">
605
+        我已退回,填写快递单号
606
+      </button>
607
+    </div>
198 608
 
609
+  </div>
610
+  <!-- 待退货,跳转退货快递单号页面 -->
611
+  <div class="flexd_div  " v-if="state.detail.refund_status == -1 && state.detail.refund_type == 1">
612
+    <div class="flexd_box">
613
+      <button @click="handleTophone" style="width: 686rpx;
614
+height: 82rpx;font-size: 30rpx; " class="['!bg-primary', 'rounded-full', 'text-white']">
615
+        <image style="width: 30rpx; height: 30rpx; vertical-align: middle;" src="../../static/icon/联系商家.png"></image>
616
+        <span style="vertical-align: middle; margin-left: 8rpx; ">联系商家</span>
617
+      </button>
199 618
     </div>
619
+
620
+  </div>
200 621
 </template>
201 622
 
202 623
 <route lang="yaml">
203 624
 style:
204
-  navigationBarTitleText: 售后订单
625
+  navigationBarTitleText: 售后详情                                                                                                                         
205 626
 </route>
206 627
 
207 628
 <style lang="scss">
@@ -217,9 +638,137 @@ page {
217 638
   --nut-steps-base-title-font-size: 12px;
218 639
   background: #f8f8f8;
219 640
 }
641
+
220 642
 .nut-step-title {
221 643
   min-width: 100rpx;
222 644
   width: 100rpx;
223 645
   text-align: center;
224 646
 }
647
+
648
+.text_font {
649
+  font-size: 36rpx;
650
+  color: #333333;
651
+}
652
+
653
+.text_div {
654
+  font-size: 26rpx;
655
+  color: #666;
656
+}
657
+
658
+.text_box {
659
+  font-size: 28rpx;
660
+  color: #333333;
661
+}
662
+
663
+.text_dis {
664
+  font-size: 28rpx;
665
+  color: #666;
666
+}
667
+
668
+.text_dew {
669
+  width: 48rpx;
670
+  height: 36rpx;
671
+  font-size: 24rpx;
672
+  font-family: PingFangSC, PingFang SC;
673
+  font-weight: 400;
674
+  color: #666666;
675
+  line-height: 36rpx;
676
+}
677
+
678
+.text_lok {
679
+  font-size: 26rpx;
680
+  color: #FE0032;
681
+  height: 1.2em;
682
+}
683
+
684
+.line_hei {
685
+  height: 1.2em;
686
+}
687
+
688
+.section_1 {
689
+  margin: 40rpx 0;
690
+  display: flex;
691
+  flex-direction: column;
692
+  justify-content: center;
693
+  /* 垂直居中 */
694
+  align-items: center;
695
+  /* 水平居中 */
696
+}
697
+
698
+.flex_mar {
699
+  display: flex;
700
+}
701
+
702
+.text_span1 {
703
+  font-size: 36rpx;
704
+  color: #333333;
705
+}
706
+
707
+.img_box {
708
+  position: fixed;
709
+  top: 40rpx;
710
+  left: 682rpx;
711
+  width: 36rpx;
712
+  height: 36rpx;
713
+  line-height: 48rpx;
714
+}
715
+
716
+.label_img {
717
+  width: 100%;
718
+  height: 100%;
719
+  margin-top: 6rpx;
720
+}
721
+
722
+
723
+
724
+.text1_2 {
725
+  font-size: 30rpx;
726
+}
727
+
728
+.copy_img {
729
+  margin-top: 5rpx;
730
+  margin-right: 6rpx;
731
+  width: 24rpx;
732
+  height: 24rpx;
733
+}
734
+
735
+.copy_img image {
736
+  width: 100%;
737
+  height: 100%;
738
+}
739
+
740
+.flexd_div {
741
+  border-top: 2rpx solid rgba(170, 171, 172, 0.5);
742
+  bottom: 0;
743
+  left: 0;
744
+  width: 100%;
745
+  height: 161rpx;
746
+  position: fixed;
747
+  background: #FFFFFF;
748
+  justify-content: center;
749
+}
750
+
751
+.flexd_box {
752
+
753
+  width: 686rpx;
754
+  margin-top: 12rpx;
755
+  margin-left: 32rpx;
756
+}
757
+
758
+.custom-title {
759
+  // 设置 title 的宽度样式
760
+  text-align: left;
761
+  width: 578rpx; // 你可以根据需要设置宽度值
762
+}
763
+
764
+.custom-content {
765
+  width: 578rpx; // 你可以根据需要设置宽度值
766
+  font-size: 24rpx;
767
+}
768
+
769
+
770
+.custom-icon-color .nut-step-icon {
771
+  background-color: white;
772
+  /* 将小圆点的背景颜色设置为白色 */
773
+}
225 774
 </style>

+ 166 - 108
src/pages/refund/drawback.vue

@@ -1,10 +1,13 @@
1 1
 <script setup lang="ts">
2 2
 import FPrice from "~/components/FPrice/FPrice.vue";
3
-import {UPLOAD_URL} from "~/utils/http";
3
+import closeIcon from "~/static/icon/close.png";
4
+import radioOffIcon from "~/static/icon/radio-off.png";
5
+import radioOnIcon from "~/static/icon/radio-on.png";
6
+import { UPLOAD_URL } from "~/utils/http";
4 7
 import GoodStatusPopup from "~/pages/refund/components/GoodStatusPopup.vue";
5 8
 import RefundReasonPopup from "~/pages/refund/components/RefundReasonPopup.vue";
6
-import {getToken} from "~/utils/auth";
7
-import {refundApply, takeOrder} from "~/apis/order.api";
9
+import { getToken } from "~/utils/auth";
10
+import { refundApply, takeOrder } from "~/apis/order.api";
8 11
 const headers = {
9 12
   "Content-Type": "multipart/form-data",
10 13
   'X-Token': 'Bearer ' + getToken()
@@ -33,14 +36,16 @@ const formData = reactive({
33 36
   refund_message: '',
34 37
   // 退款金额
35 38
   refund_price: '',
39
+  pay_price: '',
36 40
   type: '',
37 41
   // 1退款, 2退款退货
38 42
   refund_type: '',
39 43
   // 收货状态
40
-  goods: ''
44
+  goods: '',
45
+  delivery_type: ''
41 46
 })
42 47
 const defaultFileList = ref([])
43
-
48
+const radioValue = ref('')
44 49
 const radioVal = ref(false)
45 50
 function handleUploadSuccess({ data, option, fileItem }) {
46 51
   // console.log(data.data.path)
@@ -61,17 +66,31 @@ onLoad(async (options) => {
61 66
     state.from = options.from
62 67
   }
63 68
   await userStore.getUserInfo()
69
+  if (options.refund_type == '1') {
70
+    uni.setNavigationBarTitle({
71
+      title: '申请退款'
72
+    })
73
+  }
74
+  if (options.refund_type == '2') {
75
+    uni.setNavigationBarTitle({
76
+      title: '申请退货退款'
77
+    })
78
+    formData.goods = '已收到货'
79
+  }
64 80
   formData.refund_type = options.refund_type
65 81
   formData.ids = options.ids
66 82
   formData.refund_price = options.total_price
83
+  formData.pay_price = options.pay_price
67 84
   formData.num = options.total_num
68 85
   formData.phone = userStore.userInfo.phone
69 86
   formData.type = options.type || 1
70
-
87
+  formData.delivery_type = options.delivery_type
71 88
   state.orderId = options.orderId
89
+
90
+  console.log('>>>>>>>>', formData);
72 91
 })
73 92
 function handleSubmit() {
74
-  if(!formData.goods) {
93
+  if (!formData.goods) {
75 94
     return uni.showToast({
76 95
       title: '请选择收货状态',
77 96
       icon: "none"
@@ -90,38 +109,38 @@ function handleSubmit() {
90 109
       if (res.confirm) {
91 110
         refundApply(state.orderId.toString(), formData).then(res => {
92 111
           // {"status":200,"message":"申请退款成功","data":{"refund_order_id":"671"}}
93
-          console.log('申请退款成功',res);
94
-          
95
-          if(res.status===200){
96
-             uni.showToast({
97
-            title: '申请退款成功',
98
-            icon: 'none'
99
-          })
100
-          setTimeout(() => {
101
-            uni.navigateTo({
102
-              url: `/pages/refund/index?from=${state.from}`
112
+          console.log('申请退款成功', res);
113
+
114
+          if (res.status === 200) {
115
+            uni.showToast({
116
+              title: '申请退款成功',
117
+              icon: 'none'
103 118
             })
104
-          }, 300)
105
-          }else{
119
+            setTimeout(() => {
120
+              uni.navigateTo({
121
+                url: `/pages/refund/index?from=${state.from}`
122
+              })
123
+            }, 300)
124
+          } else {
106 125
             uni.showToast({
107
-            title: res.message,
108
-            icon: 'none'
109
-          })
110
-          setTimeout(() => {
111
-            uni.navigateTo({
112
-              url: `/pages/refund/index?from=${state.from}`
126
+              title: res.message,
127
+              icon: 'none'
113 128
             })
114
-          }, 300)
129
+            setTimeout(() => {
130
+              uni.navigateTo({
131
+                url: `/pages/refund/index?from=${state.from}`
132
+              })
133
+            }, 300)
115 134
           }
116
-         
135
+
117 136
         })
118 137
 
119 138
       }
120 139
     },
121 140
     fail: function (error) {
122
-    // 模态框显示失败,可能是因为参数不合法等原因
123
-    console.log('模态框显示失败', error);
124
-  }
141
+      // 模态框显示失败,可能是因为参数不合法等原因
142
+      console.log('模态框显示失败', error);
143
+    }
125 144
   })
126 145
   // if (state.orderId) {
127 146
   // }
@@ -129,8 +148,13 @@ function handleSubmit() {
129 148
   console.log(formData)
130 149
 }
131 150
 
132
-function handleChooseGoodStatus () {
133
-  state.showGoodStatusPopup = true
151
+function handleChooseGoodStatus() {
152
+  if (formData.refund_type == '1') {
153
+    state.showGoodStatusPopup = true
154
+    console.log(111);
155
+  } else {
156
+    return
157
+  }
134 158
 }
135 159
 
136 160
 function getGoodsStatus(radioVal) {
@@ -174,110 +198,144 @@ function onRefundReasonConfirm(val) {
174 198
   formData.refund_message = getRefundMessage(val)
175 199
   console.log(formData.refund_message)
176 200
 }
201
+const allowPopup = ref(true)
202
+function handleTextareaInput(event) {
203
+  // 在输入时禁止调起其他组件
204
+  console.log('Textarea input:', event.target.value);
205
+  state.showReasonPopup = false
206
+  allowPopup.value = false;
207
+}
208
+function handleshowReasonPopup() {
209
+  state.showReasonPopup = true
210
+}
211
+
212
+
213
+
177 214
 
178 215
 
179 216
 </script>
180 217
 <template>
181
-<div>
182
-  <nut-cell-group>
183
-    <nut-cell :desc="formData.goods == '' ? '请选择' : `${formData.goods}`" is-link @click="handleChooseGoodStatus">
184
-      <template #title>
185
-        <div class="flex font-bold gap-1 items-center">
186
-          <div>收货状态</div>
187
-          <div class="text-primary">*</div>
188
-        </div>
189
-      </template>
190
-    </nut-cell>
191
-    <nut-cell :desc="formData.refund_message == '' ? '请选择' : `${formData.refund_message}`" is-link @click="state.showReasonPopup = true">
192
-      <template #title>
193
-        <div class="flex font-bold gap-1 items-center">
194
-          <div>退款原因</div>
195
-          <div class="text-primary">*</div>
196
-        </div>
197
-      </template>
198
-    </nut-cell>
199
-    <nut-cell >
200
-      <div class="flex flex-col">
201
-        <div class="flex font-bold gap-1 items-center">
202
-          <div>退款金额</div>
203
-          <div class="text-primary">*</div>
204
-        </div>
205
-        <FPrice :price="formData.refund_price" :ex-class="['font-bold text-xl']"></FPrice>
206
-        <div class="text-gray-500 text-[12px]">
207
-          不可修改,最多¥{{ formData.refund_price }},含发货邮费¥{{state.total_price}}
218
+  <div>
219
+    <nut-cell-group>
220
+      <nut-cell>
221
+        <template #title>
222
+          <div class="flex_div">
223
+            <div class="flex font-bold gap-1 items-center">
224
+              <div>申请类型</div>
225
+              <div class="text-primary">*</div>
226
+            </div>
227
+            <div style="color: #cccccc;">{{ formData.refund_type == '1' ? '我要退款(无需退货)' : '我要退货退款' }}</div>
228
+          </div>
229
+        </template>
230
+      </nut-cell>
231
+
232
+      <nut-cell :desc="formData.goods == '' ? '请选择' : `${formData.goods}`"
233
+        :is-link="formData.refund_type == '1' ? true : false" @click="handleChooseGoodStatus">
234
+        <template #title>
235
+          <div class="flex font-bold gap-1 items-center">
236
+            <div>收货状态</div>
237
+            <div class="text-primary">*</div>
238
+          </div>
239
+        </template>
240
+      </nut-cell>
241
+
242
+      <nut-cell :desc="formData.refund_message == '' ? '请选择' : `${formData.refund_message}`" is-link
243
+        @click.stop="handleshowReasonPopup">
244
+        <template #title>
245
+          <div class="flex font-bold gap-1 items-center">
246
+            <div>退款原因</div>
247
+            <div class="text-primary">*</div>
248
+          </div>
249
+        </template>
250
+      </nut-cell>
251
+      <nut-cell>
252
+        <div class="flex flex-col">
253
+          <div class="flex flex-1 justify-between ">
254
+            <div class="flex font-bold  gap-1 items-center">
255
+              <div>退款金额</div>
256
+              <div class="text-primary">*</div>
257
+            </div>
258
+            <div class="['font-bold text-xl']" style="color: rgb(253, 33, 76);">
259
+              ¥ {{ parseFloat(formData.delivery_type !== 'null' ? formData.refund_price :
260
+                formData.pay_price).toFixed(2).replace(/\.?0+$/, '') }}
261
+            </div>
262
+          </div>
263
+
264
+          <div class="text-gray-500 text-[12px]">
265
+            <div>退款金额说明</div>
266
+            <div>1.未发货的订单发起退款,退款金额=支付金额</div>
267
+            <div>2.已发货的订单发起退款,根据收货地址不同,可能会产生不同金额的快递拦截费,以实际情况未准;</div>
268
+            <div>退款金额=支付金额-快递拦截费或运费</div>
269
+          </div>
208 270
         </div>
209
-      </div>
210 271
 
211
-    </nut-cell>
212
-  </nut-cell-group>
272
+      </nut-cell>
273
+    </nut-cell-group>
213 274
 
214
-  <div class="bg-white p-3">
215
-    <div class="text-sm">
216
-      补充描述和凭证
217
-    </div>
218
-    <div class="flex flex-col my-2 gap-2 bg-gray-100">
219
-        <textarea placeholder="补充描述,有助于商家更好的处理售后问题"
220
-                  class="p-2 text-xs rounded-lg"
221
-                  v-model="formData.mark"
222
-        />
223
-      <div class="flex p-2 text-gray">
224
-        <div class="flex flex-col justify-center items-center text-xs gap-2">
225
-          <nut-uploader :url="UPLOAD_URL"
226
-                        :headers="headers"
227
-                        :name="'field'"
228
-                        :timeout="1000*50"
229
-                        :data="{ filename: 'field'}"
230
-                        v-model:file-list="defaultFileList" maximum="3"
231
-                        @success="handleUploadSuccess"
232
-          >
233
-          </nut-uploader>
275
+    <div class="bg-white p-3">
276
+      <div class="text-sm">
277
+        补充描述和凭证
278
+      </div>
279
+      <div class="flex flex-col my-2 gap-2 bg-gray-100">
280
+        <textarea @input="handleTextareaInput" placeholder="您填写的信息越详细,问题越可有效解决哦~" class="p-2 text-xs rounded-lg"
281
+          v-model="formData.mark"></textarea>
282
+        <div class="flex p-2 text-gray">
283
+          <div class="flex flex-col justify-center items-center text-xs gap-2">
284
+            <nut-uploader :url="UPLOAD_URL" :headers="headers" :name="'field'" :timeout="1000 * 50"
285
+              :data="{ filename: 'field' }" v-model:file-list="defaultFileList" maximum="3"
286
+              @success="handleUploadSuccess">
287
+            </nut-uploader>
288
+          </div>
234 289
         </div>
290
+
235 291
       </div>
236 292
 
237 293
     </div>
294
+    <div class="fixed bottom-0 pb-safe w-full">
295
+      <div class="px-3 ">
296
+        <nut-button @click="handleSubmit" type="primary" block>提交
297
+        </nut-button>
298
+
299
+        <!--      <FButton-->
300
+        <!--          @click="handleSubmit"-->
301
+        <!--          :exClass="['!bg-primary', 'rounded-full', 'text-white']"-->
302
+        <!--          block-->
303
+        <!--      >-->
304
+        <!--        提交-->
305
+        <!--      </FButton>-->
306
+        <!--        <div class="text-center text-white bg-red rounded-full text-sm p-2">-->
307
+        <!--        </div>-->
308
+      </div>
238 309
 
239
-  </div>
240
-  <div class="fixed bottom-0 pb-safe w-full">
241
-    <div class="px-3 ">
242
-      <nut-button
243
-          @click="handleSubmit"
244
-          type="primary" block>提交
245
-      </nut-button>
246
-
247
-<!--      <FButton-->
248
-<!--          @click="handleSubmit"-->
249
-<!--          :exClass="['!bg-primary', 'rounded-full', 'text-white']"-->
250
-<!--          block-->
251
-<!--      >-->
252
-<!--        提交-->
253
-<!--      </FButton>-->
254
-      <!--        <div class="text-center text-white bg-red rounded-full text-sm p-2">-->
255
-      <!--        </div>-->
256 310
     </div>
257 311
 
258
-  </div>
312
+    <GoodStatusPopup v-model:show="state.showGoodStatusPopup" @confirm="onGoodStatusConfirm" />
313
+    <RefundReasonPopup v-model:show="state.showReasonPopup" @confirm="onRefundReasonConfirm" />
259 314
 
260
-  <GoodStatusPopup v-model:show="state.showGoodStatusPopup"
261
-                   @confirm="onGoodStatusConfirm"
262
-  />
263
-  <RefundReasonPopup v-model:show="state.showReasonPopup"
264
-                     @confirm="onRefundReasonConfirm"
265
-  />
266
-</div>
315
+  </div>
267 316
 </template>
268 317
 
269 318
 <route lang="yaml">
270 319
 style:
271
-  navigationBarTitleText: 售后订单
320
+  navigationBarTitleText: 储蓄保
272 321
 </route>
273 322
 
274 323
 <style lang="scss">
275 324
 page {
276 325
   background: #f8f8f8;
277 326
 }
327
+
278 328
 .nut-radio-group {
279 329
   width: 100%;
280 330
 }
331
+
332
+.flex_div {
333
+  display: flex;
334
+  justify-content: space-between;
335
+  align-items: center;
336
+
337
+}
338
+
281 339
 //.nut-radio {
282 340
 //  display: flex !important;
283 341
 //  width: 100%;

+ 35 - 31
src/pages/refund/index.vue

@@ -1,5 +1,5 @@
1 1
 <script setup lang="ts">
2
-import {refundList} from "~/apis/order.api";
2
+import { refundList } from "~/apis/order.api";
3 3
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
4 4
 import RefundOrderItem from "~/pages/order/components/RefundOrderItem.vue";
5 5
 import FNavBar from "~/components/FNavBar/FNavBar.vue";
@@ -27,7 +27,7 @@ onLoad((options) => {
27 27
 })
28 28
 
29 29
 
30
-function loadList(action: 'page' | 'reload',  callback?: (items) => void) {
30
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
31 31
   if (action == 'reload') {
32 32
     state.list = []
33 33
   }
@@ -68,8 +68,16 @@ onReachBottom(() => {
68 68
   handleScrollToLower()
69 69
 
70 70
 })
71
+onPullDownRefresh(() => {
72
+   uni.showLoading({
73
+    title: '加载中'
74
+  })
75
+  loadList('reload');
76
+  uni.hideLoading()
77
+  uni.stopPullDownRefresh();
78
+})
71 79
 // watch(() => state.t)
72
-function handleTabChange(	{title,paneKey,disabled}) {
80
+function handleTabChange({ title, paneKey, disabled }) {
73 81
 
74 82
   console.log(paneKey)
75 83
   if (paneKey == 0) {
@@ -101,44 +109,42 @@ function onClickLeft() {
101 109
 }
102 110
 </script>
103 111
 <template>
104
-  <FNavBar
105
-      title="我的订单" :left-arrow="true" fixed placeholder z-index="999"
106
-      ex-class="bg-white w-screen"
107
-      @click-left="onClickLeft"
108
-  />
109
-  <div class="fixed top-18 bg-white w-screen z-2">
110
-    <nut-tabs v-model="state.tabvalue" class="bg-white" @change="handleTabChange">
111
-      <nut-tab-pane title="全部"></nut-tab-pane>
112
-      <nut-tab-pane title="退款中"></nut-tab-pane>
113
-      <nut-tab-pane title="退款完成"></nut-tab-pane>
114
-    </nut-tabs>
115
-  </div>
116
-  <div v-if="state.list.length > 0" class="mt-30 flex flex-col p-3">
117
-    <div v-for="(orderItem, index) in state.list" :key="index">
118
-      <RefundOrderItem :order-item="orderItem"/>
112
+  <div class="bg-white">
113
+    <FNavBar title="我的订单" :left-arrow="true" fixed placeholder z-index="999" ex-class="bg-white w-screen"
114
+      @click-left="onClickLeft" />
115
+    <div class="fixed top-18 bg-white w-screen z-2">
116
+      <nut-tabs v-model="state.tabvalue" class="bg-white" @change="handleTabChange">
117
+        <nut-tab-pane title="全部"></nut-tab-pane>
118
+        <nut-tab-pane title="处理中"></nut-tab-pane>
119
+        <nut-tab-pane title="已完成"></nut-tab-pane>
120
+      </nut-tabs>
119 121
     </div>
120
-    <div class=" flex justify-center items-center text-[12px] text-gray-500" >
121
-      <div v-if="state.status === 'loading'">
122
-        加载中...
122
+    <div v-if="state.list.length > 0" class="mt-30 flex flex-col p-3" style="background-color: #f8f8f8;">
123
+      <div v-for="(orderItem, index) in state.list" :key="index">
124
+        <RefundOrderItem :order-item="orderItem" />
123 125
       </div>
124
-      <div v-if="state.status === 'noMore'">
125
-        没有更多了~
126
+      <div class=" flex justify-center items-center text-[12px] text-gray-500">
127
+        <div v-if="state.status === 'loading'">
128
+          加载中...
129
+        </div>
130
+        <div v-if="state.status === 'noMore'">
131
+          没有更多了~
132
+        </div>
126 133
       </div>
127 134
     </div>
135
+    <div class="flex h-full flex-col pt-50" v-else>
136
+      <CXBEmpty />
137
+    </div>
128 138
   </div>
129
-  <div class="flex h-full flex-col pt-50" v-else>
130
-    <CXBEmpty />
131
-  </div>
132
-
133 139
 </template>
134 140
 <route lang="yaml">
135 141
 style:
136 142
   navigationBarTitleText: 退款/售后
137 143
   navigationStyle: custom
138
-
144
+  enablePullDownRefresh: true
139 145
 </route>
140 146
 
141
-<style>
147
+<style  >
142 148
 page {
143 149
   background: #f8f8f8;
144 150
 }
@@ -150,6 +156,4 @@ page {
150 156
 .nut-tab-pane {
151 157
   display: none !important;
152 158
 }
153
-
154
-
155 159
 </style>

+ 14 - 17
src/pages/refund/option.vue

@@ -1,6 +1,6 @@
1 1
 <script setup lang="ts">
2
-import {CDN_URL} from "~/config/app";
3
-import {decodeBase64} from "~/utils/http/helper";
2
+import { CDN_URL } from "~/config/app";
3
+import { decodeBase64 } from "~/utils/http/helper";
4 4
 import FPrice from "~/components/FPrice/FPrice.vue";
5 5
 
6 6
 const woyaotuikuanIcon = CDN_URL + '/static/assets/woyaotuikuan.png'
@@ -19,14 +19,14 @@ onLoad((options) => {
19 19
   state.detail = JSON.parse(decodeBase64(options.detail))
20 20
   // state.detail = JSON.parse(decodeBase64(base64Detail))
21 21
   console.log(state.detail)
22
-  {{state.detail.orderProduct}}
22
+  { { state.detail.orderProduct } }
23 23
 })
24 24
 //1:退款 2:退款退货
25 25
 
26 26
 const getProductIds = computed(() => {
27 27
   const ids = []
28 28
   if (state.detail && state.detail.orderProduct) {
29
-    for(let item of state.detail.orderProduct) {
29
+    for (let item of state.detail.orderProduct) {
30 30
       ids.push(item.order_product_id)
31 31
     }
32 32
   }
@@ -36,7 +36,7 @@ const getProductIds = computed(() => {
36 36
 function handleChooseType(refund_type) {
37 37
   // console.log(getProductIds.value)
38 38
   uni.navigateTo({
39
-    url: `/pages/refund/drawback?orderId=${state.detail.order_id}&refund_type=${refund_type}&ids=${getProductIds.value.toString()}&total_price=${state.detail.total_price}&total_postage=${state.detail.total_postage}&total_num=${state.detail.total_num}&type=${getProductIds.value.length > 1 ? 2 : 1}&from=${state.from}`
39
+    url: `/pages/refund/drawback?orderId=${state.detail.order_id}&refund_type=${refund_type}&ids=${getProductIds.value.toString()}&total_price=${state.detail.total_price}&total_postage=${state.detail.total_postage}&total_num=${state.detail.total_num}&type=${getProductIds.value.length > 1 ? 2 : 1}&from=${state.from}&&pay_price=${state.detail.pay_price}&&delivery_type=${state.detail.delivery_type}`
40 40
   })
41 41
 }
42 42
 </script>
@@ -45,13 +45,12 @@ function handleChooseType(refund_type) {
45 45
     <div class="p-3 flex flex-col gap-3">
46 46
       <div class="bg-white rounded-lg flex p-3 flex flex-col" v-if="state.detail && state.detail.orderProduct">
47 47
         <div class="font-bold">退款商品</div>
48
-        <div v-for="(orderProduct, orderProductIndex) in state.detail.orderProduct"
49
-             :key="orderProductIndex">
48
+        <div v-for="(orderProduct, orderProductIndex) in state.detail.orderProduct" :key="orderProductIndex">
50 49
           <div class="flex py-2 gap-3">
51 50
             <div class="flex-1 flex gap-2">
52
-<!--              <div class="flex">-->
53
-                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20 rounded" mode="widthFix"></image>
54
-<!--              </div>-->
51
+              <!--              <div class="flex">-->
52
+              <image :src="orderProduct.cart_info.product.image" class="w-20 h-20 rounded" mode="widthFix"></image>
53
+              <!--              </div>-->
55 54
 
56 55
               <div class="flex flex-col flex-1">
57 56
                 <div class="line-clamp-2 text-[14px]">
@@ -64,7 +63,9 @@ function handleChooseType(refund_type) {
64 63
             </div>
65 64
 
66 65
             <div class="flex flex-col justify-center items-center">
67
-              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[14px] !text-[#000]"></FPrice>
66
+              <!-- <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[14px] !text-[#000]"></FPrice> -->
67
+              <div class="font-bold text-[14px] !text-[#000]">¥{{
68
+                parseFloat(orderProduct.product_price).toFixed(2).replace(/\.?0+$/, '') }}</div>
68 69
               <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
69 70
             </div>
70 71
 
@@ -75,9 +76,7 @@ function handleChooseType(refund_type) {
75 76
       <div class="bg-white rounded-lg flex flex-col text-[14px] p-3">
76 77
         <div class="font-bold py-3">选择服务类型</div>
77 78
         <div class="flex flex-col gap-3">
78
-          <div
79
-              @click="handleChooseType(1)"
80
-              class="flex items-center gap-3">
79
+          <div @click="handleChooseType(1)" class="flex items-center gap-3">
81 80
             <image :src="woyaotuikuanIcon" mode="widthFix" class="w-5 h-5"></image>
82 81
             <div>
83 82
               <div class="font-bold">我要退款(无需退货)</div>
@@ -85,9 +84,7 @@ function handleChooseType(refund_type) {
85 84
             </div>
86 85
           </div>
87 86
 
88
-          <div
89
-              @click="handleChooseType(2)"
90
-              class="flex items-center gap-3">
87
+          <div @click="handleChooseType(2)" class="flex items-center gap-3">
91 88
             <image :src="woyaotuihuotuikuanIcon" mode="widthFix" class="w-5 h-5"></image>
92 89
             <div>
93 90
               <div class="font-bold">我要退货退款</div>

+ 103 - 0
src/pages/refund/scancode/kdlist.vue

@@ -0,0 +1,103 @@
1
+<template>
2
+	<div class="pt-3">
3
+		<div v-for="(item, index) in kdlist" :key="index">
4
+			<div @click="handleToscan(item.value)"
5
+				class="bg-white  rounded-lg p-3 flex justify-center f-hairline-bottom items-center ">
6
+				<div class="w-full">
7
+					<div class="flex items-center  ">
8
+						<div class="flex items-center font-bold gap-2 text-sm w-full">
9
+							<div class="flex-1 flex items-center gap-2 ">
10
+								<div class="line-clamp-1">
11
+									{{ item.label }}
12
+								</div>
13
+							</div>
14
+						</div>
15
+					</div>
16
+				</div>
17
+			</div>
18
+		</div>
19
+	</div>
20
+</template>
21
+
22
+<script setup lang="ts">
23
+import { getRefundKdlist } from "~/apis/order.api";
24
+const emit = defineEmits()
25
+//快递列表
26
+const kdlist = ref([])
27
+const state = reactive({
28
+	orderId: '',
29
+	refund_order_id: '',
30
+
31
+})
32
+
33
+onLoad((options) => {
34
+	//id
35
+	if (options && options.refund_order_id !== '') {
36
+		state.refund_order_id = options.refund_order_id
37
+	}
38
+	getRefundKdlist().then((res) => {
39
+		console.log(res);
40
+		kdlist.value = res
41
+	})
42
+})
43
+
44
+function handleToscan(value: any) {
45
+
46
+
47
+	// 通过 $emit 发送自定义事件,并传递数据
48
+	// 注意:在 Vue 3 中,通过 $emit 传递事件需要使用 `emit` 函数
49
+	if (value) {
50
+        if (value == "31") {
51
+            value = '中国邮政'
52
+        }
53
+        if (value == "188") {
54
+            value = '顺丰速运'
55
+        }
56
+        if (value == "221") {
57
+            value = '天天快递'
58
+        }
59
+        if (value == "243") {
60
+            value = '圆通快递'
61
+        }
62
+        if (value == "252") {
63
+            value = '中通快递'
64
+        }
65
+        if (value == "254") {
66
+            value = 'EMS'
67
+        }
68
+        if (value == "266") {
69
+            value = '申通快递'
70
+        }
71
+        if (value == "286") {
72
+            value = '韵达快运'
73
+        }
74
+        if (value == "290") {
75
+            value = '快捷速递'
76
+        }
77
+        if (value == "428") {
78
+            value = '重磅快递'
79
+        }
80
+        if (value == "429") {
81
+            value = '众邦快递'
82
+        }
83
+    }
84
+	uni.$emit('send-data-to-b', value);
85
+	uni.navigateBack({
86
+		delta: 1 // 返回上一层页面
87
+	})
88
+
89
+}
90
+
91
+
92
+</script>
93
+
94
+<style>
95
+page {
96
+
97
+	background: #F8F8F8;
98
+}
99
+</style>
100
+<route lang="yaml">
101
+style:
102
+  navigationBarTitleText: 快递公司
103
+</route>

+ 280 - 0
src/pages/refund/scancode/scancode.vue

@@ -0,0 +1,280 @@
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 { getRefundOutDl } 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
+    refund_order_id: '',
19
+
20
+})
21
+const userStore = useUserStore()
22
+
23
+let formData = reactive({
24
+
25
+    delivery_type: '',  //快递名称
26
+    // 申请说明
27
+    delivery_id: '', //快递单号
28
+    delivery_mark: '', //快递备注
29
+    // 联系电话
30
+    delivery_phone: '',
31
+    // 图片
32
+    delivery_pics: [], //图片
33
+})
34
+const defaultFileList = ref([])
35
+
36
+const radioVal = ref(false)
37
+function handleUploadSuccess({ data, option, fileItem }) {
38
+    // console.log(data)
39
+
40
+    if (data && data.data) {
41
+        const resData = JSON.parse(data.data).data
42
+        const path = resData.path
43
+        formData.delivery_pics.push(path)
44
+    }
45
+    console.log(formData.delivery_pics);
46
+
47
+    // if (data && data.path) {
48
+    //   formData.pics.push(data.path)
49
+    // }
50
+    //
51
+    // console.log(fileItem)
52
+}
53
+onLoad(async (options) => {
54
+    await userStore.getUserInfo()
55
+    //手机号
56
+     if (options && options.phone !== '') {
57
+        formData.delivery_phone = options.phone
58
+    }
59
+    console.log(formData.delivery_phone);
60
+    //refund_order_id
61
+   
62
+    //refund_order_id
63
+    if (options && options.refund_order_id !== '') {
64
+        state.refund_order_id = options.refund_order_id
65
+    }
66
+    console.log(state.refund_order_id);
67
+    //delivery_type
68
+
69
+})
70
+onShow((options) => {
71
+    uni.$on('send-data-to-b', handleReceivedData)
72
+})
73
+//提交
74
+function handleSubmit() {
75
+    console.log(formData)
76
+    if (!formData.delivery_id) {
77
+        return uni.showToast({
78
+            title: '快递单号不能为空',
79
+            icon: "none"
80
+        })
81
+    }
82
+    if (!formData.delivery_type) {
83
+        return uni.showToast({
84
+            title: '请选择物流公司',
85
+            icon: "none"
86
+        })
87
+    }
88
+    getRefundOutDl(state.refund_order_id,formData).then((res) => {
89
+        uni.showToast({
90
+            title: '提交成功',
91
+            icon: "none"
92
+        })
93
+
94
+    }).catch((error)=>{
95
+        uni.showToast({
96
+            title: error,
97
+            icon: "none"
98
+        })
99
+    })
100
+    uni.navigateBack({
101
+		delta: 1 // 返回上一层页面
102
+	})
103
+
104
+}
105
+
106
+
107
+
108
+// 定义处理接收到数据的方法
109
+const handleReceivedData = (value: any) => {
110
+    // 处理接收到的数据
111
+    formData.delivery_type = value;
112
+};
113
+
114
+
115
+function handleTokdList() {
116
+
117
+    uni.navigateTo({
118
+        url: `/pages/refund/scancode/kdlist?refund_order_id=${state.refund_order_id}`
119
+    })
120
+}
121
+//扫描二维码
122
+function showScancode() {
123
+
124
+    // 调起条码扫描
125
+    uni.scanCode({
126
+        scanType: ['barCode'],
127
+        success: function (res) {
128
+            console.log('res:' + res);
129
+            console.log('条码类型:' + res.scanType);
130
+            console.log('条码内容:' + res.result);
131
+            formData.delivery_id = res.result
132
+        }
133
+    });
134
+}
135
+
136
+</script>
137
+<template>
138
+    <div class="px-3">
139
+        <div style="border-radius: 16rpx;">
140
+            <nut-cell-group>
141
+                <nut-cell>
142
+                    <template #title>
143
+                        <div class="flex_div">
144
+                            <div class="flex font-bold gap-1 items-center">
145
+                                <div style="font-size: 30rpx; color: #333333;">填写物流信息</div>
146
+                            </div>
147
+                        </div>
148
+                    </template>
149
+                </nut-cell>
150
+                <nut-cell>
151
+                    <template #title>
152
+                        <div style="line-height: 42rpx;" class="flex font-bold gap-1 justify-between">
153
+                            <div class="font-bold">物流单号</div>
154
+
155
+                            <input class="flex-1" type="number" v-model="formData.delivery_id" placeholder="点击填写或扫码退货快递单号">
156
+
157
+                            <div @click="showScancode" style="width: 42rpx; height: 42rpx;">
158
+                                <image class="image_sm" src="../../../static/icon/扫码.png"></image>
159
+                            </div>
160
+                        </div>
161
+                    </template>
162
+                </nut-cell>
163
+                <nut-cell>
164
+                    <template #title>
165
+                        <div class="flex font-bold gap-1 justify-between">
166
+                            <div>物流公司</div>
167
+
168
+                            <div @click="handleTokdList()" class="flex-1"
169
+                                :class="formData.delivery_type == '' ? 'col_9' : 'col_3'">
170
+                                {{ formData.delivery_type == '' ? '请选择物流公司' : formData.delivery_type }}
171
+                            </div>
172
+                            <div class="f-text-color-2 i-tabler-chevron-right"></div>
173
+
174
+
175
+                        </div>
176
+
177
+                    </template>
178
+                </nut-cell>
179
+
180
+            </nut-cell-group>
181
+        </div>
182
+        <!-- 退货留言 -->
183
+        <div class="bg-white p-3 mb-3" style="border-radius: 16rpx;">
184
+            <div class="text-sm">
185
+                退货留言
186
+            </div>
187
+            <div class="flex flex-col my-2 gap-2 bg-gray-50">
188
+                <textarea :maxlength="200" style="height: 150rpx;" placeholder="请详细填写您的退货留言" class="p-2 text-xs rounded-lg"
189
+                    v-model="formData.delivery_mark" />
190
+            </div>
191
+
192
+        </div>
193
+        <!-- 上传凭证 -->
194
+        <div class="bg-white p-3" style="border-radius: 16rpx;">
195
+            <div class="text-sm">
196
+                上传凭证
197
+            </div>
198
+            <div class="flex p-2 text-gray">
199
+                <div class="flex flex-col justify-center items-center text-xs gap-2">
200
+                    <nut-uploader :url="UPLOAD_URL" :headers="headers" :name="'field'" :timeout="1000 * 50"
201
+                        :data="{ filename: 'field' }" v-model:file-list="defaultFileList" maximum="3"
202
+                        @success="handleUploadSuccess">
203
+                    </nut-uploader>
204
+                </div>
205
+            </div>
206
+
207
+        </div>
208
+
209
+
210
+        <!-- <div class="fixed bottom-0 pb-safe w-full">
211
+            <div class="">
212
+                <nut-button @click="handleSubmit" type="primary" block>提交
213
+                </nut-button>
214
+            </div>
215
+        </div> -->
216
+        <div class="flexd_div f-hairline-top ">
217
+            <div class="flexd_box">
218
+                <button style="font-size: 30rpx; width: 686rpx;height: 82rpx;" @click="handleSubmit"
219
+                    class="['!bg-primary',  'rounded-full', 'text-white']">
220
+                    提交
221
+                </button>
222
+            </div>
223
+
224
+        </div>
225
+
226
+    </div>
227
+</template>
228
+
229
+<route lang="yaml">
230
+style:
231
+  navigationBarTitleText: 填写退货快递单号
232
+</route>
233
+
234
+<style >
235
+page {
236
+    background: #f8f8f8;
237
+}
238
+
239
+.nut-radio-group {
240
+    width: 100%;
241
+}
242
+
243
+.flex_div {
244
+    display: flex;
245
+    justify-content: space-between;
246
+    align-items: center;
247
+
248
+}
249
+
250
+.image_sm {
251
+    width: 100%;
252
+    height: 100%;
253
+}
254
+
255
+.col_3 {
256
+    color: #333333
257
+}
258
+
259
+.col_9 {
260
+    color: #999999
261
+}
262
+
263
+
264
+.flexd_div {
265
+    bottom: 0;
266
+    left: 0;
267
+    width: 100%;
268
+    height: 161rpx;
269
+    position: fixed;
270
+    background: #FFFFFF;
271
+    z-index: 999;
272
+    justify-content: center;
273
+}
274
+
275
+.flexd_box {
276
+    width: 686rpx;
277
+    margin-top: 12rpx;
278
+    margin-left: 32rpx;
279
+}
280
+</style>

+ 305 - 0
src/pages/refund/scancode/xsjllist.vue

@@ -0,0 +1,305 @@
1
+<template>
2
+	<div class="px-3 pt-3 pb-10 relative h-full" v-if="state.length > 0">
3
+		<!-- 申请已取消-->
4
+		<div v-for="(item, index) in state" :key="index">
5
+			<div class="bg-white  mb-3 rounded-lg p-3 flex justify-center items-center" v-if="item.type == 6 ">
6
+				<div class="w-full">
7
+					<div class="items-center">
8
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
9
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
10
+							<div class="flex-1 flex items-center gap-2 ">
11
+								<div class="line-clamp-1" style="font-size: 30rpx;" >
12
+									{{ item.title }}
13
+								</div>
14
+							</div>
15
+							<div>
16
+								<span class="text_lok">{{ item.time }}</span>
17
+							</div>
18
+
19
+						</div>
20
+						<div class="text_dis mt-3 ">
21
+							<div>{{ item.fail_message }}</div>
22
+						</div>
23
+					</div>
24
+				</div>
25
+			</div>
26
+		</div>
27
+		<!-- 商户拒绝仅退款-->
28
+		<div v-for="(item, index) in state" :key="index">
29
+			<div class="bg-white  mb-3 rounded-lg p-3 flex justify-center items-center" v-if="item.type==2">
30
+				<div class="w-full">
31
+					<div class="items-center">
32
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
33
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
34
+							<div class="flex-1 flex items-center gap-2 ">
35
+								<div class="line-clamp-1" style="font-size: 30rpx;" >
36
+									{{ item.title }}
37
+								</div>
38
+							</div>
39
+							<div>
40
+								<span class="text_lok">{{ item.time }}</span>
41
+							</div>
42
+
43
+						</div>
44
+						<div class="text_dis mt-3 ">
45
+							<div>拒绝原因:{{ item.fail_message }}</div>
46
+						</div>
47
+					</div>
48
+				</div>
49
+			</div>
50
+		</div>
51
+		<!-- 退款成功 5 -->
52
+		<div v-for="(item, index) in state" :key="index">
53
+			<div class="bg-white  mb-3 rounded-lg p-3 flex justify-center items-center " v-if="item.type == 5">
54
+				<div class="w-full">
55
+					<div class="items-center">
56
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
57
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
58
+							<div class="flex-1 flex items-center gap-2 ">
59
+								<div class="line-clamp-1"   style="font-size: 30rpx;">
60
+									{{ item.title }}
61
+								</div>
62
+							</div>
63
+							<div>
64
+								<span class="text_lok">{{ item.time }}</span>
65
+							</div>
66
+
67
+						</div>
68
+						<div class="text_dis mt-3 ">
69
+							<div>退款金额:¥{{ item.refund_price }}</div>
70
+						</div>
71
+					</div>
72
+				</div>
73
+			</div>
74
+		</div>
75
+
76
+		<!-- 买家寄出商品 4 -->
77
+		<div v-for="(item, index) in state" :key="index">
78
+			<div class="bg-white  mb-3 rounded-lg p-3 flex justify-center items-center "
79
+				v-if="item.type == 4 && item.refund_type == 2">
80
+				<div class="w-full">
81
+					<div class="items-center">
82
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
83
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
84
+							<div class="flex-1 flex items-center gap-2 ">
85
+								<div class=" line-clamp-1"   style="font-size: 30rpx;">
86
+									{{ item.title }}
87
+								</div>
88
+							</div>
89
+							<div>
90
+								<span class="text_lok">{{ item.time }}</span>
91
+							</div>
92
+
93
+						</div>
94
+						<div class="text_dis mt-3 ">
95
+							<div>商家收件信息:{{ item.delivery_type }}</div>
96
+						</div>
97
+						<div class="text_dis mt-3 flex ">
98
+							<div>快递单号:</div>
99
+							<div style="color: #333; font-size: 26rpx; display: flex; ">
100
+								<div style="border-right: 1rpx solid #D8D8D8; padding-right: 12rpx; margin-right: 13rpx;">
101
+									{{ item.delivery_id }}
102
+								</div>
103
+								<div @click="handleCopy1(item)">复制</div>
104
+							</div>
105
+						</div>
106
+					</div>
107
+				</div>
108
+			</div>
109
+		</div>
110
+
111
+		<!-- 商家同意退货 3 -->
112
+		<div v-for="(item, index) in state" :key="index">
113
+			<div class="bg-white  mb-3 rounded-lg p-3 flex justify-center items-center "
114
+				v-if="item.type == 3 && item.refund_type == 2">
115
+				<div class="w-full">
116
+					<div class="items-center">
117
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
118
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
119
+							<div class="flex-1 flex items-center gap-2 ">
120
+								<div class="line-clamp-1 "   style="font-size: 30rpx;">
121
+									{{ item.title }}
122
+								</div>
123
+							</div>
124
+							<div>
125
+								<span class="text_lok">{{ item.time }}</span>
126
+							</div>
127
+
128
+						</div>
129
+						<div class="text_dis mt-3 flex">
130
+							<div>商家收件信息</div>
131
+							<div style=" margin-left: 12rpx; color: #333; font-size: 26rpx; display: flex; "
132
+								@click="handleCopy2(item)">
133
+								<div class="copy_img">
134
+									<image src="../../static/icon/复制.png"></image>
135
+								</div>
136
+								<div>复制</div>
137
+							</div>
138
+						</div>
139
+						<div class="text_dis mt-3 ">
140
+							{{ item.mer_delivery_user }} {{ item.mer_delivery_phone }}
141
+						</div>
142
+						<div class="text_dis mt-3 ">
143
+							{{ item.mer_delivery_address }}
144
+						</div>
145
+
146
+					</div>
147
+				</div>
148
+			</div>
149
+		</div>
150
+
151
+		<!-- 用户申请退款退货 1-->
152
+		<div v-for="(item, index) in state" :key="index">
153
+			<div class="bg-white mb-3 rounded-lg p-3 flex justify-center items-center " v-if="item.type == 1" >
154
+				<div class="w-full">
155
+					<div class="items-center">
156
+						<div style="border-bottom: 1rpx solid #e6e6e6;"
157
+							class=" items-center font-bold gap-2 text-sm pb-3 w-full">
158
+							<div class="flex-1 flex items-center gap-2 ">
159
+								<div class="line-clamp-1 "   style="font-size: 30rpx;">
160
+									{{ item.title }}
161
+								</div>
162
+							</div>
163
+							<div>
164
+								<span class="text_lok">{{ item.time }}</span>
165
+							</div>
166
+
167
+						</div>
168
+						<div class="text_dis mt-3 ">
169
+							退款金额:¥{{ item.refund_price }}
170
+						</div>
171
+						<div class="text_dis mt-3 ">
172
+							退款原因:{{ item.refund_message }}
173
+						</div>
174
+						<div class="text_dis mt-3 ">
175
+							联系方式:{{ item.refund_phone }}
176
+						</div>
177
+						<div class="text_dis mt-3 ">
178
+							问题描述:{{ item.refund_mark }}
179
+						</div>
180
+						<div class="flex mt-3" v-if="item.refund_pics.length>0" >
181
+							<div class="text_image mr-2 "  v-for="(i,k) in item.refund_pics" :key="k"  >
182
+								<image lazy-load style="width: 100%; height: 100%; "  :src="i" ></image>
183
+							</div>
184
+						</div>
185
+					</div>
186
+				</div>
187
+			</div>
188
+		</div>
189
+
190
+	</div>
191
+</template>
192
+
193
+<script lang="ts" setup >
194
+import { getRefundXSlist } from "~/apis/order.api";
195
+
196
+onLoad((options) => {
197
+	if (options && options.refund_order_id) {
198
+		getRefundXSlist(options.refund_order_id).then(res => {
199
+			console.log(res);
200
+			if (res.length > 0) {
201
+				state.value = res
202
+			} else {
203
+
204
+			}
205
+		})
206
+	}
207
+})
208
+
209
+//存储
210
+
211
+const state = ref([])
212
+
213
+//复制商家收件信息
214
+function handleCopy2(item:any) {
215
+	let copyData = item.mer_delivery_user + ' ' + item.mer_delivery_phone + ' ' + item.mer_delivery_address
216
+
217
+	console.log(copyData);
218
+
219
+	uni.setClipboardData({
220
+		data: copyData,
221
+		success(res) {
222
+			// wx.getClipboardData({
223
+			//   success (res) {
224
+			//     console.log(res.data) // data
225
+			//   }
226
+			// })
227
+		}
228
+	})
229
+}
230
+
231
+//复制快递单号00
232
+function handleCopy1(item:any) {
233
+	let copyData = item.delivery_id
234
+	console.log(copyData);
235
+
236
+	uni.setClipboardData({
237
+		data: copyData,
238
+		success(res) {
239
+			// wx.getClipboardData({
240
+			//   success (res) {
241
+			//     console.log(res.data) // data
242
+			//   }
243
+			// })
244
+		}
245
+	})
246
+}
247
+
248
+
249
+</script>
250
+
251
+<style>
252
+page {
253
+	background: #f8f8f8;
254
+}
255
+
256
+.text_font {
257
+	height: 42rpx;
258
+	font-size: 30rpx;
259
+	font-family: PingFangSC, PingFang SC;
260
+	font-weight: 500;
261
+	color: #333333;
262
+	line-height: 42rpx;
263
+}
264
+
265
+.text_lok {
266
+	height: 28rpx;
267
+	font-size: 24rpx;
268
+	font-family: PingFangSC, PingFang SC;
269
+	font-weight: 400;
270
+	color: #999999;
271
+	line-height: 28rpx;
272
+}
273
+
274
+.text_dis {
275
+	font-size: 28rpx;
276
+	font-family: PingFangSC, PingFang SC;
277
+	font-weight: 400;
278
+	color: #333333;
279
+	line-height: 40rpx;
280
+	word-wrap: break-word;
281
+}
282
+
283
+
284
+.copy_img {
285
+	margin-top: 5rpx;
286
+	margin-right: 6rpx;
287
+	width: 24rpx;
288
+	height: 24rpx;
289
+}
290
+
291
+.copy_img image {
292
+	width: 100%;
293
+	height: 100%;
294
+}
295
+
296
+.text_image{
297
+	width:80rpx ;
298
+	height:80rpx ;
299
+}
300
+
301
+</style>
302
+<route lang="yaml">
303
+style:
304
+  navigationBarTitleText: 协商记录
305
+</route>

+ 7 - 4
src/pages/search/index.vue

@@ -383,7 +383,10 @@ function handleProductItemClick(
383 383
         & TaobaoProductThirdPartyWaresModel
384 384
         & VipProductModel
385 385
 ) {
386
+console.log(5);
387
+console.log("5");
386 388
 
389
+console.log(item.type);
387 390
 
388 391
   function navigateToDetail(params) {
389 392
     let otherDetailUrl = `/pages/store/product/other`
@@ -392,7 +395,7 @@ function handleProductItemClick(
392 395
     })
393 396
   }
394 397
   // 大仓
395
-  if (state.currentTab === PLATFORM_NAME.DC && item.type === '5') {
398
+  if (state.currentTab === PLATFORM_NAME.DC && item.type === 5) {
396 399
     uni.navigateTo({
397 400
       url: `/pages/store/product/detail?id=${item.product_id}`
398 401
     })
@@ -417,8 +420,8 @@ function handleProductItemClick(
417 420
     }
418 421
     return navigateToDetail(encodeBase64(productParams))
419 422
   }
420
-  // 淘宝
421
-  if (item.type === 5) {
423
+  // 淘宝PLATFORM_NAME.TB
424
+  if ( state.currentTab === PLATFORM_NAME.TB && item.type === 5) {
422 425
     const productParams: Partial<IProductDetail> = {
423 426
       platform: item.type,
424 427
       id: item.id,
@@ -643,7 +646,7 @@ onReachBottom(() => {
643 646
         <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
644 647
           <div v-for="(item, index) in list"
645 648
                :key="index"
646
-               @tap="handleProductItemClick(item)"
649
+               @click="handleProductItemClick(item)"
647 650
           >
648 651
             <div class="bg-white rounded-lg text-dark">
649 652
               <image :src="item.image"

+ 125 - 131
src/pages/search/search-dacang.vue

@@ -1,19 +1,20 @@
1 1
 <script setup lang="ts">
2
-import {CDN_URL} from "~/config/app";
3
-import {getHotkeyWord} from "~/apis/common";
2
+import { CDN_URL } from "~/config/app";
3
+import { getHotkeyWord } from "~/apis/common";
4 4
 import ProductList from "~/components/ProductList/ProductList.vue";
5
-import {getDcProductList} from "~/apis/dacang";
6
-import {useDacangStore} from "~/stores/dacangStore";
5
+import { getDcProductList, getDcSearchList } from "~/apis/dacang";
6
+import { searchProductList } from "~/apis/product";
7
+import { useDacangStore } from "~/stores/dacangStore";
7 8
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
8
-import {StoreParams, StoreResult} from "~/apis/model/storeModel";
9
-import {USER_LATITUDE, USER_LONGITUDE} from "~/constants";
10
-import {getSelectMerchant} from "~/apis/merchant";
11
-import {remove, uniq} from "lodash-es";
9
+import { StoreParams, StoreResult } from "~/apis/model/storeModel";
10
+import { USER_LATITUDE, USER_LONGITUDE } from "~/constants";
11
+import { getSelectMerchant } from "~/apis/merchant";
12
+import { remove, uniq } from "lodash-es";
12 13
 
13 14
 const deleteIcon = CDN_URL + '/static/assets/search_del_220616.png'
14 15
 const upDefaultImg = CDN_URL + '/static/assets/tuijian_shangla.png'
15 16
 const downDefaultImg = CDN_URL + '/static/assets/tuijian_xiala.png'
16
-
17
+const undataImg = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
17 18
 const downRedImg = CDN_URL + '/static/assets/tuijian_xiala_red.png'
18 19
 const upRedImg = CDN_URL + '/static/assets/search_red_shangla_220617.png'
19 20
 const searchValue = ref()
@@ -67,7 +68,7 @@ const state = reactive({
67 68
   currentKeyword: '',
68 69
   order: false,
69 70
   keyword: '',
70
-  currentSelected: 1,
71
+  currentSelected: 0,
71 72
   status: 'noMore',
72 73
   priceType: NaN,
73 74
   sales: NaN,
@@ -86,6 +87,7 @@ const classifyId = computed(() => {
86 87
 
87 88
 
88 89
 onLoad(async () => {
90
+  state.currentSelected = 1
89 91
   loadProductList('reload')
90 92
   const historyKeywords = await uni.getStorageSync('HISTORY_KEYWORDS')
91 93
   if (historyKeywords) {
@@ -104,34 +106,19 @@ watch(() => state.tabvalue, (val) => {
104 106
   }
105 107
 })
106 108
 
107
-function handleProductTypeChange(typeValue) {
108
-  state.currentSelected = typeValue
109
-  if (typeValue === 3) {
110
-    state.sales = NaN
111
-    state.is_new = 0
112
-  } else if (typeValue === 2) {
113
-    state.sales = 0
114
-  } else {
115
-    state.type = typeValue
116
-  }
117
-  loadProductList('reload')
118
-}
119 109
 
120 110
 
121 111
 function loadProductList(action: 'page' | 'reload', callback?: (items) => void) {
122 112
   const params = {
123
-    page: state.currentPage,
124
-    limit: state.pageSize,
125
-    // classify: state.currentClassify,
126
-    // classify: classifyId.value,
127
-    // keyword: state.keyword
113
+    pageNum: state.currentPage,
114
+    pageSize: state.pageSize,
128 115
   }
129 116
   if (action === 'reload') {
130 117
     state.currentPage = 1
131
-    params.page = 1
118
+    params.pageNum = 1
132 119
   }
133 120
   if (searchValue.value) {
134
-    params.keyword = searchValue.value
121
+    params.mer_keyword = searchValue.value
135 122
   }
136 123
   // if (state.currentSelected === 2) {
137 124
   //   params.sales = state.sales
@@ -139,32 +126,35 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
139 126
   // if (state.currentSelected === 3) {
140 127
   //   params.is_new = state.is_new
141 128
   // }
142
-  if (state.sales === 0) {
129
+  if (state.sales == 0) {
143 130
     params.sales = state.sales
144 131
   }
145
-  if (state.is_new === 0) {
132
+  if (state.is_new == 0) {
146 133
     params.is_new = state.is_new
147 134
   }
148
-  if (state.priceType) {
135
+  if (state.priceType==0||state.priceType==1) {
149 136
     params.priceType = state.priceType
150 137
   }
138
+  console.log('我是params', params);
151 139
 
152
-  getDcProductList({
140
+  searchProductList({
153 141
     ...params
154
-    // page: state.currentPage,
155
-    // limit: state.pageSize,
156
-    // classify,
157
-    // keyword: ''
142
+
158 143
   }).then(res => {
144
+    console.log('>>>>>>>>', res.pageInfo);
145
+    if (state.totalPage != res.pageInfo.total) {
146
+      state.totalPage = res.pageInfo.total
147
+    }
148
+
159 149
     if (action === 'page') {
160
-      state.productList = state.productList.concat(res)
150
+      state.productList = state.productList.concat(res.pageInfo.list)
161 151
     }
162 152
     if (action === 'reload') {
163
-      state.productList = res
153
+      state.productList = res.pageInfo.list
164 154
     }
165 155
 
166 156
     if (callback) {
167
-      callback(res)
157
+      callback(res.pageInfo.list)
168 158
     }
169 159
     // state.productList = res
170 160
   }).catch(error => {
@@ -250,9 +240,34 @@ onShow(() => {
250 240
     state.hotkeyWords = res
251 241
   })
252 242
 })
243
+function handleProductTypeChange(typeValue) {
244
+  console.log('单击传进来的', typeValue);
245
+  uni.pageScrollTo({
246
+    scrollTop: 0,
247
+    duration: 300
248
+  })
249
+  //综合上新 1 3   销量2
250
+  state.currentSelected = typeValue
251
+  state.order = false
252
+  state.sales = NaN
253
+  state.is_new = NaN
254
+  state.priceType =NaN
255
+  if (typeValue == 3 || typeValue == 1) {
256
+    state.is_new = 0
257
+  } else if (typeValue == 2) {
258
+    state.sales = 0
259
+  }
260
+  console.log(state);
261
+  loadProductList('reload')
262
+}
253 263
 
254 264
 function handleOrderPrice(val) {
255 265
   // state.order = !state.order
266
+  console.log('价格传进来的', val);
267
+  uni.pageScrollTo({
268
+    scrollTop: 0,
269
+    duration: 300
270
+  })
256 271
   state.currentSelected = NaN
257 272
   state.order = true
258 273
   if (val === 0) {
@@ -260,14 +275,17 @@ function handleOrderPrice(val) {
260 275
   } else {
261 276
     state.priceType = 0
262 277
   }
263
-  emit('order-change', state.priceType)
278
+  // console.log(state);
279
+
280
+  loadProductList('reload')
264 281
 }
265 282
 
266 283
 function handleScrollToLower() {
267 284
   state.status = 'loading';
268 285
   state.currentPage += 1;
269
-  // console.log(state.totalPage)
270
-  if (state.currentPage > state.totalPage) {
286
+  console.log(state.currentPage)
287
+  console.log(state.totalPage)
288
+  if ((state.currentPage-1)*10 > state.totalPage) {
271 289
     state.status = 'noMore';
272 290
   } else {
273 291
     setTimeout(() => {
@@ -321,12 +339,12 @@ async function handleRemoveAllKeyword() {
321 339
 async function handleHistoryKeywordSearch(keywordItem) {
322 340
   // keywordItem.keyword
323 341
   // if (keywordItem.keyword) {
324
-    searchValue.value = keywordItem
325
-    // state.historyKeyWords.push(searchValue.value)
326
-    // state.historyKeyWords = uniq(state.historyKeyWords)
327
-    // await uni.setStorageSync('HISTORY_KEYWORDS', state.historyKeyWords)
328
-    loadProductList('reload')
329
-    isSearchMode.value = true
342
+  searchValue.value = keywordItem
343
+  // state.historyKeyWords.push(searchValue.value)
344
+  // state.historyKeyWords = uniq(state.historyKeyWords)
345
+  // await uni.setStorageSync('HISTORY_KEYWORDS', state.historyKeyWords)
346
+  loadProductList('reload')
347
+  isSearchMode.value = true
330 348
   // }
331 349
 }
332 350
 async function handleKeywordSearch(keywordItem) {
@@ -351,8 +369,7 @@ function handleShowMerchant(merchant) {
351 369
 <template>
352 370
   <div>
353 371
     <div class="fixed  h-fit z-1 bg-white top-0 w-full">
354
-      <nut-searchbar
355
-          v-model="searchValue" @search="handleSearch" @clear="handleSearch">
372
+      <nut-searchbar v-model="searchValue" @search="handleSearch" @clear="handleSearch">
356 373
         <template v-slot:rightout>
357 374
           <div @tap="handleSearch">
358 375
             搜索
@@ -376,9 +393,7 @@ function handleShowMerchant(merchant) {
376 393
               <div class="text-gray-300">|</div>
377 394
               <div @click="state.isDel = false" class="text-primary">完成</div>
378 395
             </div>
379
-            <image
380
-                v-else
381
-                :src="deleteIcon" @click="state.isDel = !state.isDel" mode="widthFix" class="w-3 h-3"></image>
396
+            <image v-else :src="deleteIcon" @click="state.isDel = !state.isDel" mode="widthFix" class="w-3 h-3"></image>
382 397
 
383 398
           </div>
384 399
 
@@ -386,12 +401,9 @@ function handleShowMerchant(merchant) {
386 401
         <!--tags -->
387 402
         <div class="flex gap-3  flex-wrap">
388 403
           <div v-for="(tagItem, index) in state.historyKeyWords" :key="index"
389
-               class="flex justify-center items-center border border-solid border-gray-200 text-[12px] rounded-full min-w-6 text-center  max-w-fit px-2 py-1 bg-white"
390
-               :class="state.isDel ? 'gap-2': ''"
391
-          >
392
-            <div class="flex-1"
393
-                 @click="handleHistoryKeywordSearch(tagItem)"
394
-            >
404
+            class="flex justify-center items-center border border-solid border-gray-200 text-[12px] rounded-full min-w-6 text-center  max-w-fit px-2 py-1 bg-white"
405
+            :class="state.isDel ? 'gap-2' : ''">
406
+            <div class="flex-1" @click="handleHistoryKeywordSearch(tagItem)">
395 407
               {{ tagItem }}
396 408
             </div>
397 409
             <div class="flex" v-if="state.isDel" @click="handleRemoveKeyword(tagItem)">
@@ -405,10 +417,8 @@ function handleShowMerchant(merchant) {
405 417
         <div class="font-bold">热门搜索</div>
406 418
         <!--tags -->
407 419
         <div class="flex gap-3">
408
-          <div v-for="(tagItem, index) in state.hotkeyWords" :key="index"
409
-               @click="handleKeywordSearch(tagItem)"
410
-               class="flex items-center border border-solid border-gray-200 text-[12px] rounded-full min-w-6 text-center  max-w-fit px-2 bg-white py-1"
411
-          >
420
+          <div v-for="(tagItem, index) in state.hotkeyWords" :key="index" @click="handleKeywordSearch(tagItem)"
421
+            class="flex items-center border border-solid border-gray-200 text-[12px] rounded-full min-w-6 text-center  max-w-fit px-2 bg-white py-1">
412 422
             <div>
413 423
               {{ tagItem.keyword }}
414 424
             </div>
@@ -418,52 +428,23 @@ function handleShowMerchant(merchant) {
418 428
     </div>
419 429
 
420 430
     <div v-if="isSearchMode">
421
-      <div class="fixed top-10 z-3 w-full">
431
+      <div class="fixed top-11 z-3 w-full">
422 432
         <nut-tabs v-model="state.tabvalue">
423 433
           <nut-tab-pane title="商品" class="bg-gray-50">
424 434
             <div class="text-[14px]">
425 435
               <div class="flex flex-row items-center">
426
-                <div class="basis-1/4 text-left ">
427
-                  <div
428
-                      @click="handleProductTypeChange(1)"
429
-
430
-                      class="flex flex-row justify-center items-center gap-1">
431
-                    <div
432
-
433
-                        :class="state.currentSelected === 1 ? 'text-primary font-bold' : ''"
434
-                    >
435
-                      综合
436
-                    </div>
437
-                    <div class="flex flex-col justify-center items-center">
438
-                      <div v-if="state.currentSelected !== 1 " class="h-fit flex flex-col items-center">
439
-                        <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
440
-                      </div>
441
-                      <div v-if="state.currentSelected === 1" class="h-fit flex flex-col items-center">
442
-                        <image :src="downRedImg" mode="widthFix" class="w-2 h-2"></image>
443
-                      </div>
444
-
445
-                    </div>
446
-                  </div>
447
-
436
+                <div @click="handleProductTypeChange(1)" class="basis-1/4 text-center"
437
+                  :class="state.currentSelected === 1 ? 'text-primary font-bold' : ''">综合
448 438
                 </div>
449
-                <div
450
-                    @click="handleProductTypeChange(2)"
451
-                    class="basis-1/4 text-center"
452
-                    :class="state.currentSelected === 2 ? 'text-primary font-bold' : ''"
453
-                >销量
439
+                <div @click="handleProductTypeChange(2)" class="basis-1/4 text-center"
440
+                  :class="state.currentSelected === 2 ? 'text-primary font-bold' : ''">销量
454 441
                 </div>
455
-                <div
456
-                    @click="handleProductTypeChange(3)"
457
-                    :class="state.currentSelected === 3 ? 'text-primary font-bold' : ''"
458
-                    class="basis-1/4 text-center">上新
442
+                <div @click="handleProductTypeChange(3)"
443
+                  :class="state.currentSelected === 3 ? 'text-primary font-bold' : ''" class="basis-1/4 text-center">上新
459 444
                 </div>
460
-                <div
461
-                    @click="handleOrderPrice(state.priceType)"
462
-                    class="basis-1/4 text-right">
445
+                <div @click="handleOrderPrice(state.priceType)" class="basis-1/4 text-right">
463 446
                   <div class="flex flex-row justify-center items-center gap-1">
464
-                    <div
465
-                        :class="state.order ? 'text-primary font-bold' : ''"
466
-                    >
447
+                    <div :class="state.order ? 'text-primary font-bold' : ''">
467 448
                       价格
468 449
                     </div>
469 450
                     <div class="flex flex-col justify-center items-center">
@@ -472,10 +453,10 @@ function handleShowMerchant(merchant) {
472 453
                         <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
473 454
                       </div>
474 455
                       <div v-if="state.order" class="h-fit flex flex-col items-center">
475
-                        <image :src="upRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType === 1"></image>
456
+                        <image :src="upRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 1"></image>
476 457
                         <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
477 458
 
478
-                        <image :src="downRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType === 0"></image>
459
+                        <image :src="downRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 0"></image>
479 460
                         <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
480 461
 
481 462
                       </div>
@@ -492,26 +473,20 @@ function handleShowMerchant(merchant) {
492 473
               <div class="flex flex-row items-center">
493 474
                 <div class="basis-1/3 text-left ">
494 475
                   <div class="flex flex-row justify-center items-center gap-1">
495
-                    <div
496
-                        :class="merchantState.currentSelected === 0 ? 'text-primary font-bold' : ''"
497
-                        @click="handleMerchantTabChange(0)"
498
-                    >
476
+                    <div :class="merchantState.currentSelected === 0 ? 'text-primary font-bold' : ''"
477
+                      @click="handleMerchantTabChange(0)">
499 478
                       距离
500 479
                     </div>
501 480
                   </div>
502 481
 
503 482
                 </div>
504
-                <div
505
-                    @click="handleMerchantTabChange(1)"
506
-                    class="basis-1/3 text-center"
507
-                    :class="merchantState.currentSelected === 1 ? 'text-primary font-bold' : ''"
508
-                >
483
+                <div @click="handleMerchantTabChange(1)" class="basis-1/3 text-center"
484
+                  :class="merchantState.currentSelected === 1 ? 'text-primary font-bold' : ''">
509 485
                   人气
510 486
                 </div>
511
-                <div
512
-                    @click="handleMerchantTabChange(2)"
513
-                    :class="merchantState.currentSelected === 2 ? 'text-primary font-bold' : ''"
514
-                    class="basis-1/3 text-center">最新
487
+                <div @click="handleMerchantTabChange(2)"
488
+                  :class="merchantState.currentSelected === 2 ? 'text-primary font-bold' : ''"
489
+                  class="basis-1/3 text-center">最新
515 490
                 </div>
516 491
               </div>
517 492
             </div>
@@ -524,9 +499,9 @@ function handleShowMerchant(merchant) {
524 499
       <!-- 商品列表 -->
525 500
       <div class="mt-40 pb-10" v-if="state.tabvalue == 0">
526 501
         <div v-if="state.productList.length > 0">
527
-          <ProductList :list="state.productList"/>
502
+          <ProductList :list="state.productList" />
528 503
           <div class=" flex justify-center items-center text-[12px] text-gray-500"
529
-               v-if="state.productList && state.productList.length > 0">
504
+            v-if="state.productList && state.productList.length > 0">
530 505
             <div v-if="state.status === 'loading'">
531 506
               加载中...
532 507
             </div>
@@ -535,22 +510,23 @@ function handleShowMerchant(merchant) {
535 510
             </div>
536 511
           </div>
537 512
         </div>
538
-        <CXBEmpty v-else/>
539
-
513
+        <!-- <CXBEmpty v-else/> -->
514
+        <div v-else class=" flex flex-1 justify-center items-center ">
515
+          <div>
516
+            <div style="width: 206rpx; height:206rpx; margin-top: 206rpx;  margin-bottom: 60rpx;">
517
+              <image :src="undataImg" style="width: 100%; height: 100%;"></image>
518
+            </div>
519
+            <div class="none_data">没有搜索到相关内容</div>
520
+          </div>
521
+        </div>
540 522
       </div>
541 523
       <!-- 店铺列表 -->
542 524
       <div class="mt-40 pb-10" v-if="state.tabvalue == 1">
543 525
         <div v-if="merchantState.list.length > 0" class="p-3 bg-white">
544
-          <div
545
-              v-for="(item, index) in merchantState.list" :key="index"
546
-              @click="handleShowMerchant(item)"
547
-              class="mb-3 ">
526
+          <div v-for="(item, index) in merchantState.list" :key="index" @click="handleShowMerchant(item)" class="mb-3 ">
548 527
             <div class="flex">
549 528
               <div class="flex ">
550
-                <image :src="item.mer_avatar"
551
-                       mode="aspectFill"
552
-                       class="w-20 h-20 rounded-lg"
553
-                ></image>
529
+                <image :src="item.mer_avatar" mode="aspectFill" class="w-20 h-20 rounded-lg"></image>
554 530
               </div>
555 531
 
556 532
               <div class="flex flex-col justify-between px-2">
@@ -577,8 +553,15 @@ function handleShowMerchant(merchant) {
577 553
             </div>
578 554
           </div>
579 555
         </div>
580
-        <CXBEmpty v-else/>
581
-
556
+        <!-- <CXBEmpty v-else/> -->
557
+        <div v-else class=" flex flex-1 justify-center items-center ">
558
+          <div>
559
+            <div style="width: 206rpx; height:206rpx; margin-top: 206rpx;  margin-bottom: 60rpx;">
560
+              <image :src="undataImg" style="width: 100%; height: 100%;"></image>
561
+            </div>
562
+            <div class="none_data">没有搜索到相关内容</div>
563
+          </div>
564
+        </div>
582 565
 
583 566
       </div>
584 567
 
@@ -603,6 +586,17 @@ page {
603 586
   --nut-menu-item-active-text-color: #FE0032;
604 587
   --nut-white: #fff;
605 588
 }
589
+
590
+
591
+.none_data {
592
+  height: 30rpx;
593
+  font-size: 24rpx;
594
+  font-family: PingFangSC, PingFang SC;
595
+  font-weight: 400;
596
+  color: #999999;
597
+  line-height: 30rpx;
598
+  text-align: center;
599
+}
606 600
 </style>
607 601
 
608 602
 <route lang="yaml">

+ 5 - 98
src/pages/store/home/components/MerchantHeader.vue

@@ -1,9 +1,9 @@
1 1
 <template>
2
-  <div class="bg-[#ededed] rounded-lg p-4 text-sm flex flex-col gap-4">
2
+  <div class="bg-[#f8f8f8] rounded-lg p-4 text-sm flex flex-col gap-4 mt-9">
3 3
     <div v-if="!isSearchHome" class="flex flex-row justify-between items-center">
4 4
       <div class="flex flex-row gap-3">
5
-        <div class="rounded bg-white w-8 h-8">
6
-          <image :src="model.mer_avatar" mode="widthFix" class="w-full"></image>
5
+        <div class="rounded bg-white " style="width: 80rpx;height:80rpx;">
6
+          <image :src="model.mer_avatar" style="width: 100%;height:100%;"></image>
7 7
         </div>
8 8
         <div class="flex flex-col justify-between">
9 9
           <div>
@@ -31,59 +31,7 @@
31 31
       <!--        关注-->
32 32
       <!--      </CXBButton>-->
33 33
     </div>
34
-    <div class="flex flex-row items-center"
35
-         v-if="isCategory"
36
-    >
37
-      <div class="basis-1/4 text-left cx-menu">
38
-        <nut-menu>
39
-          <template #icon>
40
-            <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
41
-          </template>
42
-          <nut-menu-item v-model="state.menuDefaultValue"
43
-                         :options="state.options"
44
-                         @change="handleProductTypeChange"
45
-          >
46
-
47
-          </nut-menu-item>
48
-        </nut-menu>
49
-      </div>
50
-        <div
51
-            @click="handleProductTypeChange(2)"
52
-            class="basis-1/4 text-center"
53
-            :class="state.currentSelected === 2 ? 'text-primary font-bold' : ''"
54
-        >销量</div>
55
-        <div
56
-            @click="handleProductTypeChange(3)"
57
-            :class="state.currentSelected === 3 ? 'text-primary font-bold' : ''"
58
-            class="basis-1/4 text-center">上新</div>
59
-        <div
60
-            @click="handleOrderPrice(state.priceType)"
61
-            class="basis-1/4 text-right">
62
-          <div class="flex flex-row justify-center items-center gap-1">
63
-            <div
64
-                :class="state.order ? 'text-primary font-bold' : ''"
65
-            >
66
-              价格
67
-            </div>
68
-            <div class="flex flex-col justify-center items-center">
69
-              <div v-if="!state.order"  class="h-fit flex flex-col items-center">
70
-                <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2"></image>
71
-                <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
72
-              </div>
73
-              <div v-if="state.order"  class="h-fit flex flex-col items-center">
74
-                <image :src="upRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType === 1"></image>
75
-                <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
76
-
77
-                <image :src="downRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType === 0"></image>
78
-                <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
79
-
80
-              </div>
81
-
82
-            </div>
83
-          </div>
84
-
85
-        </div>
86
-    </div>
34
+    
87 35
 
88 36
   </div>
89 37
 </template>
@@ -96,11 +44,7 @@ import {relation, removeMyRelation} from "~/apis/user";
96 44
 import amapWx from "~/libs/amap-wx";
97 45
 import {getMerchantDetail} from "~/apis/merchant";
98 46
 import {CDN_URL} from "~/config/app";
99
-const upDefaultImg = CDN_URL + '/static/assets/tuijian_shangla.png'
100
-const downDefaultImg = CDN_URL + '/static/assets/tuijian_xiala.png'
101 47
 
102
-const downRedImg = CDN_URL + '/static/assets/tuijian_xiala_red.png'
103
-const upRedImg = CDN_URL + '/static/assets/search_red_shangla_220617.png'
104 48
 
105 49
 const emit = defineEmits<{
106 50
   (e: 'change', value: boolean): void,
@@ -126,39 +70,6 @@ if (props.model && props.model.care) {
126 70
   isCare.value = props.model.care
127 71
 }
128 72
 
129
-const state = reactive({
130
-  options: [{
131
-    text: '推荐',
132
-    value: 1
133
-  }, {
134
-    text: '大仓商品',
135
-    value: 7,
136
-  }, {
137
-    text: '平台商品',
138
-    value: 6,
139
-  }],
140
-  menuDefaultValue: 1,
141
-  currentSelected: 1,
142
-  order: false,
143
-  priceType: 0
144
-})
145
-function handleOrderPrice(val) {
146
-  // state.order = !state.order
147
-  state.currentSelected = NaN
148
-  state.order = true
149
-  if (val === 0) {
150
-    state.priceType = 1
151
-  } else {
152
-    state.priceType = 0
153
-  }
154
-  emit('order-change', state.priceType)
155
-}
156
-function handleProductTypeChange(value) {
157
-  state.order = false
158
-
159
-  state.currentSelected = value
160
-  emit('product-type-change', value)
161
-}
162 73
 watch(() => props.model, (val) => {
163 74
   // console.log(val)
164 75
   isCare.value = val.care
@@ -209,11 +120,7 @@ function handleRemoveRelation() {
209 120
 //  background-color: #008be8 !important;
210 121
 //}
211 122
 //
212
-:deep(.nut-menu__bar) {
213
-  --nut-white: none;
214
-  background: none;
215
-  background-color: transparent !important;
216
-}
123
+
217 124
 
218 125
 page {
219 126
 

+ 30 - 22
src/pages/store/home/components/MerchantProductCard.vue

@@ -1,14 +1,14 @@
1 1
 <script lang="ts" setup>
2
-import type {PropType} from "vue";
3
-import {useCustomClassProp, useCustomStyleProp} from "~/composables";
2
+import type { PropType } from "vue";
3
+import { useCustomClassProp, useCustomStyleProp } from "~/composables";
4 4
 import {
5 5
   DyProductModel, IProductDetail,
6 6
   JdProductModel,
7 7
   SuNingProductModel,
8 8
   TaobaoProductThirdPartyWaresModel, VipProductModel
9 9
 } from "~/apis/model/product.model";
10
-import {DcProductModel} from "~/apis/model/dacang.model";
11
-import {encodeBase64} from "~/utils/http/helper";
10
+import { DcProductModel } from "~/apis/model/dacang.model";
11
+import { encodeBase64 } from "~/utils/http/helper";
12 12
 
13 13
 interface ProductDetail {
14 14
   mer_id: '',
@@ -46,32 +46,30 @@ const is148Merchant = computed(() => {
46 46
 </script>
47 47
 
48 48
 <template>
49
-  <div class="bg-white rounded-lg text-dark"
50
-       :class="[ props.exClass]"
51
-       :style="[ props.exStyle]"
52
-  >
49
+  <div class="bg-white rounded-lg text-dark" :class="[props.exClass]" :style="[props.exStyle]">
53 50
 
54
-    <image :src="item.image" mode="widthFix" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square" ></image>
51
+    <image :src="item.image" class="rounded-t-lg" style="width: 342rpx;height: 342rpx;" :fade-in="true"></image>
55 52
 
56 53
     <div class="text-sm p-2 flex flex-col gap-1">
57
-      <div class="line-clamp-2">
58
-        {{item.store_name}}
54
+      <div class=" text_unshow">
55
+        {{ item.store_name }}
59 56
       </div>
60
-      <div v-if="item.type!=15" >
61
-        <div v-if="!is148Merchant" class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
62
-        <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
63
-               mode="widthFix" class="!w-8.5"></image>
64
-        <div class="px-2 flex items-center jusitify-center text-xs"  >
65
-          <div>
66
-            养老金 ¥{{item.yanglao || item.yanglao_price}}
57
+      <div v-if="item.type != 15">
58
+        <div v-if="!is148Merchant"
59
+          class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
60
+          <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix" class="!w-8.5">
61
+          </image>
62
+          <div class="px-2 flex items-center jusitify-center text-xs">
63
+            <div>
64
+              养老金 ¥{{ item.yanglao || item.yanglao_price }}
65
+            </div>
67 66
           </div>
68 67
         </div>
69 68
       </div>
70
-      </div>
71
-      
69
+
72 70
       <div class="flex flex-row items-center gap-2">
73 71
         <div v-if="is148Merchant && item.price" class="flex justify-end items-end gap-2 text-[#FE0032]">
74
-          <div class="!text-[24px]">{{ Number.parseFloat(item.price * 30).toFixed(2) }} </div>
72
+          <div class="!text-[24px]">{{  Math.round(item.price * 30) }} </div>
75 73
           <div class="text-sm">积分</div>
76 74
         </div>
77 75
         <div class="flex text-[#FE0032] font-bold text-lg" v-else>
@@ -85,10 +83,20 @@ const is148Merchant = computed(() => {
85 83
 
86 84
       </div>
87 85
       <div class="line-through text-xs font-bold flex " v-if="item.ot_price && !is148Merchant">
88
-        ¥ {{item.ot_price}}
86
+        ¥ {{ item.ot_price }}
89 87
       </div>
90 88
 
91 89
 
92 90
     </div>
93 91
   </div>
94 92
 </template>
93
+<style scoped>
94
+.text_unshow {
95
+  white-space: nowrap;
96
+  /* 禁止换行 */
97
+  overflow: hidden;
98
+  /* 隐藏溢出内容 */
99
+  text-overflow: ellipsis;
100
+  /* 显示省略号 */
101
+}
102
+</style>

+ 197 - 90
src/pages/store/home/index.vue

@@ -1,22 +1,27 @@
1 1
 <script lang="ts" setup>
2
-import {getMerchantCategory, getMerchantDetail} from "~/apis/merchant";
3
-import type {MerchantModel} from "~/apis/model/storeModel";
4
-import type {Ref} from "vue";
2
+import { getMerchantCategory, getMerchantDetail } from "~/apis/merchant";
3
+import type { MerchantModel } from "~/apis/model/storeModel";
4
+import type { Ref } from "vue";
5 5
 import MerchantHeader from "~/pages/store/home/components/MerchantHeader.vue";
6 6
 import MerchantProductList from "~/pages/store/home/components/MerchantProductList.vue";
7
-import type {MerchantCategoryModel} from "~/apis/model/storeModel";
7
+import type { MerchantCategoryModel } from "~/apis/model/storeModel";
8 8
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
9
-import {searchProductList} from "~/apis/product";
9
+import { searchProductList } from "~/apis/product";
10 10
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
11 11
 import FSearch from "~/components/FSearch/FSearch.vue";
12
-import {usePageStoreWidthOut} from "~/stores/page";
13
-import {getProductShare} from "~/apis/common";
14
-import {useUserStore} from "~/stores/userStore";
12
+import { usePageStoreWidthOut } from "~/stores/page";
13
+import { getProductShare } from "~/apis/common";
14
+import { useUserStore } from "~/stores/userStore";
15 15
 import Cache from "~/utils/cache";
16
+import { CDN_URL } from "~/config/app";
16 17
 const usePageStore = usePageStoreWidthOut()
17 18
 const userStore = useUserStore()
18 19
 
20
+const upDefaultImg = CDN_URL + '/static/assets/tuijian_shangla.png'
21
+const downDefaultImg = CDN_URL + '/static/assets/tuijian_xiala.png'
19 22
 
23
+const downRedImg = CDN_URL + '/static/assets/tuijian_xiala_red.png'
24
+const upRedImg = CDN_URL + '/static/assets/search_red_shangla_220617.png'
20 25
 let merchant: Ref<MerchantModel> = ref<MerchantModel>({
21 26
   mer_id: NaN,
22 27
   mer_name: '',
@@ -44,7 +49,23 @@ const state = reactive({
44 49
   type: NaN,
45 50
   currentPage: 1,
46 51
   pageSize: 10,
47
-  totalPage: 1
52
+  totalPage: 1,
53
+  options: [{
54
+    text: '全部',
55
+    value: 0,
56
+  }, {
57
+    text: '推荐',
58
+    value: 1,
59
+  }, {
60
+    text: '大仓',
61
+    value: 7,
62
+  }, {
63
+    text: '平台',
64
+    value: 6,
65
+  }],
66
+  menuDefaultValue: 0,
67
+  currentSelected: 1,
68
+  order: false,
48 69
 })
49 70
 const id = ref('')
50 71
 let productList = ref<any>([])
@@ -61,7 +82,7 @@ onLoad((options: any) => {
61 82
     // console.log(options.id)
62 83
     id.value = options.id
63 84
     getMerchantDetail(id.value).then((res: any) => {
64
-      merchant.value = {...res}
85
+      merchant.value = { ...res }
65 86
       // console.log(res)
66 87
     })
67 88
 
@@ -150,10 +171,16 @@ const is148Merchant = computed(() => {
150 171
 // }
151 172
 //
152 173
 
153
-function handleProductTypeChange(typeValue) {
174
+function handleProductTypeChange(typeValue: any) {
175
+  console.log('传入的值', typeValue);
176
+  state.order = false
177
+  state.currentSelected = typeValue
178
+  if (typeValue == 0) {
179
+    state.params = {}
180
+  }
154 181
   if (typeValue == 1) {
155 182
     state.params = {
156
-      is_best: 0
183
+      is_good: 1
157 184
     }
158 185
   }
159 186
   if (typeValue == 2) {
@@ -198,12 +225,17 @@ function handleProductTypeChange(typeValue) {
198 225
   // }
199 226
   loadList('reload')
200 227
 }
201
-function handleOrderChange(priceType) {
202
-  // console.log(priceType)
203
-  state.priceType = priceType
204
-
228
+function handleOrderChange(priceType: any) {
229
+  console.log(priceType)
230
+  state.currentSelected = NaN
231
+  state.order = true
232
+  if (priceType == 0) {
233
+    state.priceType = 1
234
+  } else {
235
+    state.priceType = 0
236
+  }
205 237
   state.params = {
206
-    priceType,
238
+    priceType: state.priceType,
207 239
   }
208 240
   // reset
209 241
   // state.sales = NaN
@@ -282,7 +314,7 @@ function handleNavItemClick(navItemId: any) {
282 314
 
283 315
 function handleFavoriteChange() {
284 316
   getMerchantDetail(id.value).then((res: any) => {
285
-    merchant.value = {...res}
317
+    merchant.value = { ...res }
286 318
   })
287 319
 }
288 320
 
@@ -324,101 +356,158 @@ onPullDownRefresh(() => {
324 356
     }, 300)
325 357
   })
326 358
 })
359
+
360
+
361
+function handleItemClick(item) {
362
+  uni.navigateTo({
363
+    url: `/pages/store/product/detail?id=${item.product_id}`
364
+  })
365
+}
327 366
 </script>
328 367
 <template>
329
-    <div class="fixed top-0 w-full bg-white z-1">
330
-      <div class="p-3">
331
-        <div
332
-            @click="handleOpenSearchPage"
368
+  <div class="fixed top-0 w-full bg-white z-1">
369
+    <div class="flex flex-row items-center pt-2 pb-1">
370
+      <div class="basis-2/9 text-left cx-menu">
371
+        <nut-menu class="custom-menu">
372
+          <template #icon>
373
+            <image :src="downDefaultImg" mode="widthFix" class="w-1 h-1"></image>
374
+          </template>
375
+          <nut-menu-item v-model="state.menuDefaultValue" :options="state.options" @change="handleProductTypeChange">
376
+
377
+          </nut-menu-item>
378
+        </nut-menu>
379
+      </div>
380
+      <div @click="handleProductTypeChange(2)" class="basis-2/9 text-center"
381
+        :class="state.currentSelected == 2 ? 'text-primary font-bold' : ''" style="font-size: 28rpx;">销量</div>
382
+      <div @click="handleProductTypeChange(3)" style="font-size: 28rpx;"
383
+        :class="state.currentSelected == 3 ? 'text-primary font-bold' : ''" class="basis-2/9 text-center">上新</div>
384
+      <div @click="handleOrderChange(state.priceType)" style="font-size: 28rpx;" class="basis-2/9 text-right">
385
+        <div class="flex flex-row justify-center items-center gap-1">
386
+          <div :class="state.order ? 'text-primary font-bold' : ''">
387
+            价格
388
+          </div>
389
+          <div class="flex flex-col justify-center items-center">
390
+            <div v-if="!state.order" class="h-fit flex flex-col items-center">
391
+              <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2"></image>
392
+              <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
393
+            </div>
394
+            <div v-if="state.order" class="h-fit flex flex-col items-center">
395
+              <image :src="upRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 1"></image>
396
+              <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
333 397
 
334
-            class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-gray-200 h-8"
398
+              <image :src="downRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 0"></image>
399
+              <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
335 400
 
336
-        >
401
+            </div>
337 402
 
338
-          <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png"
339
-                 mode="widthFix"
340
-                 class="w-4 h-4  pl-2 py-1"
341
-          ></image>
342
-          <div class="flex flex-1 w-100%">
343
-            <div class="flex-1"></div>
344 403
           </div>
404
+        </div>
345 405
 
346
-
406
+      </div>
407
+      <div class="basis-1/9 text-center">
408
+        <div @click="handleOpenSearchPage">
409
+          <image src="../../../static/icon/search_ck.png" mode="widthFix"
410
+            style="width: 36rpx;height: 36rpx; margin-top: 6rpx;"></image>
347 411
         </div>
348 412
 
349 413
       </div>
350
-<!--      <nut-searchbar-->
351
-<!--          v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant( 'reload')">-->
352
-<!--        <template v-slot:rightout>-->
353
-<!--          <div @tap="loadSelectMerchant('reload')">-->
354
-<!--            搜索-->
355
-<!--          </div>-->
356
-<!--        </template>-->
357
-<!--      </nut-searchbar>-->
358 414
     </div>
359
-
360
-    <div class="px-3 pb-25 mt-15 flex flex-col gap-3">
361
-      <MerchantHeader
362
-          :model="merchant"
363
-          @change="handleFavoriteChange"
364
-          @product-type-change="handleProductTypeChange"
365
-          @order-change="handleOrderChange"
366
-          :is-category="  currentItemId === 1"
367
-      />
368
-      <div
369
-          v-if="currentItemId === 1"
370
-
371
-      >
372
-        <MerchantProductList
373
-            :list="productList"
374
-            v-if="productList.length > 0"
375
-        />
376
-        <CXBEmpty v-else/>
377
-
378
-        <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="productList && productList.length > 0">
379
-          <div v-if="state.status === 'loading'">
380
-            加载中...
381
-          </div>
382
-          <div v-if="state.status === 'noMore'">
383
-            没有更多了~
415
+  </div>
416
+  <MerchantHeader :model="merchant" @change="handleFavoriteChange" @product-type-change="handleProductTypeChange"
417
+    @order-change="handleOrderChange" :is-category="currentItemId === 1" />
418
+  <div class="px-5 pb-25 mt-3 flex flex-col gap-3">
419
+    <div v-if="currentItemId === 1">
420
+      <!-- <MerchantProductList :list="productList" v-if="productList.length > 0" /> -->
421
+      <div class="" v-if="productList && productList.length > 0">
422
+        <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
423
+          <div v-for="(item, index) in productList" :key="index" @tap="handleItemClick(item)">
424
+            <!-- <MerchantProductCard :item="item" /> -->
425
+            <!-- 11111 -->
426
+            <div class="bg-white rounded-lg text-dark">
427
+
428
+              <image :src="item.image" class="rounded-t-lg" style="width: 324rpx;height: 324rpx;" :fade-in="true"></image>
429
+
430
+              <div class="text-sm p-2 flex flex-col gap-1">
431
+                <div class=" text_unshow">
432
+                  {{ item.store_name }}
433
+                </div>
434
+                <div v-if="item.type != 15">
435
+                  <div v-if="!is148Merchant"
436
+                    class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
437
+                    <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix"
438
+                      class="!w-8.5">
439
+                    </image>
440
+                    <div class="px-2 flex items-center jusitify-center text-xs">
441
+                      <div>
442
+                        养老金 ¥{{ item.yanglao || item.yanglao_price }}
443
+                      </div>
444
+                    </div>
445
+                  </div>
446
+                </div>
447
+
448
+                <div class="flex flex-row items-center gap-2 " >
449
+                  <div v-if="is148Merchant && item.price" class="flex justify-end items-end gap-2 text-[#FE0032] ">
450
+                    <div class="!text-[24px]">{{ Math.round(item.price * 30) }} </div>
451
+                    <div class="text-sm">积分</div>
452
+                  </div>
453
+                  <div class="flex text-[#FE0032] font-bold text-lg" v-else>
454
+                    <div>
455
+                      ¥
456
+                    </div>
457
+                    <div>
458
+                      {{ item.price }}
459
+                    </div>
460
+                  </div>
461
+
462
+                </div>
463
+                <div class="line-through text-xs font-bold flex " v-if="item.ot_price && !is148Merchant">
464
+                  ¥ {{ item.ot_price }}
465
+                </div>
466
+
467
+
468
+              </div>
469
+            </div>
470
+            <!-- 2222 -->
384 471
           </div>
385
-        </div>
472
+        </grid-view>
473
+
386 474
       </div>
475
+      <CXBEmpty v-else />
387 476
 
388
-      <div v-if="currentItemId === 2"
389
-           class="w-full gap-3"
390
-      >
391
-        <div v-for="(categoryItem, index) in categoryList" :key="index"
392
-             @click="handleOpenSearchPage(categoryItem)"
393
-             class="flex items-center gap-1 text-sm font-bold bg-white p-3 mb-3 rounded"
394
-        >
395
-          <div class=" bg-gradient-to-b from-[#fe7577] to-[#fe0032] w-1 h-4 rounded"></div>
396
-          {{ categoryItem.cate_name }}
477
+      <div class=" flex justify-center items-center text-[12px] text-gray-500"
478
+        v-if="productList && productList.length > 0">
479
+        <div v-if="state.status === 'loading'">
480
+          加载中...
481
+        </div>
482
+        <div v-if="state.status === 'noMore'">
483
+          没有更多了~
397 484
         </div>
398 485
       </div>
399
-
400 486
     </div>
401 487
 
402
-
403
-    <div class="fixed bottom-0 bg-white w-full">
404
-      <div class="pb-safe pt-1 shadow flex justify-around text-gray">
405
-        <div
406
-            @tap="handleNavItemClick(item.id)"
407
-            v-for="(item, index) in navList"
408
-            :key="item.id"
409
-            class="flex flex-col justify-center items-center gap-1"
410
-            :class="item.id === currentItemId ? '!text-[#fe0032]' : ''"
411
-        >
412
-          <div :class="item.icon"></div>
413
-          <div class="text-xs">
414
-            {{ item.text }}
415
-          </div>
416
-        </div>
488
+    <div v-if="currentItemId === 2" class="w-full gap-3">
489
+      <div v-for="(categoryItem, index) in categoryList" :key="index" @click="handleOpenSearchPage(categoryItem)"
490
+        class="flex items-center gap-1 text-sm font-bold bg-white p-3 mb-3 rounded">
491
+        <div class=" bg-gradient-to-b from-[#fe7577] to-[#fe0032] w-1 h-4 rounded"></div>
492
+        {{ categoryItem.cate_name }}
417 493
       </div>
418 494
     </div>
419 495
 
496
+  </div>
420 497
 
421 498
 
499
+  <div class="fixed bottom-0 bg-white w-full">
500
+    <div class="pb-safe pt-1 shadow flex justify-around text-gray">
501
+      <div @tap="handleNavItemClick(item.id)" v-for="(item, index) in navList" :key="item.id"
502
+        class="flex flex-col justify-center items-center gap-1"
503
+        :class="item.id === currentItemId ? '!text-[#fe0032]' : ''">
504
+        <div :class="item.icon"></div>
505
+        <div class="text-xs">
506
+          {{ item.text }}
507
+        </div>
508
+      </div>
509
+    </div>
510
+  </div>
422 511
 </template>
423 512
 <route lang="yaml">
424 513
 style:
@@ -434,4 +523,22 @@ page {
434 523
   --nut-searchbar-input-box-shadow: none;
435 524
 }
436 525
 
526
+:deep(.nut-menu__bar) {
527
+  --nut-white: none;
528
+  background: none;
529
+  background-color: transparent !important;
530
+}
531
+
532
+.custom-menu {
533
+  background-color: #ffffff;
534
+}
535
+
536
+.text_unshow {
537
+  white-space: nowrap;
538
+  /* 禁止换行 */
539
+  overflow: hidden;
540
+  /* 隐藏溢出内容 */
541
+  text-overflow: ellipsis;
542
+  /* 显示省略号 */
543
+}
437 544
 </style>

+ 157 - 70
src/pages/store/home/search.vue

@@ -7,9 +7,14 @@
7 7
 import MerchantHeader from "~/pages/store/home/components/MerchantHeader.vue";
8 8
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
9 9
 import MerchantProductList from "~/pages/store/home/components/MerchantProductList.vue";
10
-import {getMerchantCategory, getMerchantDetail} from "~/apis/merchant";
11
-import {searchProductList} from "~/apis/product";
10
+import { getMerchantCategory, getMerchantDetail } from "~/apis/merchant";
11
+import { searchProductList } from "~/apis/product";
12
+import { CDN_URL } from "~/config/app";
13
+const upDefaultImg = CDN_URL + '/static/assets/tuijian_shangla.png'
14
+const downDefaultImg = CDN_URL + '/static/assets/tuijian_xiala.png'
12 15
 
16
+const downRedImg = CDN_URL + '/static/assets/tuijian_xiala_red.png'
17
+const upRedImg = CDN_URL + '/static/assets/search_red_shangla_220617.png'
13 18
 const state = reactive({
14 19
   category_id: '',
15 20
   mer_keyword: '',
@@ -19,17 +24,31 @@ const state = reactive({
19 24
   priceType: NaN,
20 25
   sales: NaN,
21 26
   is_new: NaN,
22
-  type: 1,
27
+  type: NaN,
23 28
   currentPage: 1,
24 29
   pageSize: 10,
25 30
   totalPage: 1,
26 31
   params: {},
27 32
   // priceType: NaN,
28 33
   is_best: NaN,
29
-  // sales: NaN,
30
-  // is_new: NaN,
31
-  // type: NaN,
32
-  searchValue: ''
34
+
35
+  searchValue: '',
36
+  options: [{
37
+    text: '全部',
38
+    value: 0,
39
+  }, {
40
+    text: '推荐',
41
+    value: 1,
42
+  }, {
43
+    text: '大仓',
44
+    value: 7,
45
+  }, {
46
+    text: '平台',
47
+    value: 6,
48
+  }],
49
+  menuDefaultValue: 0,
50
+  currentSelected: 1,
51
+  order: false,
33 52
 })
34 53
 
35 54
 let productList = ref<any>([])
@@ -55,53 +74,10 @@ onLoad((options) => {
55 74
 
56 75
 })
57 76
 
58
-function loadList(action: 'page' | 'reload', callback?: (items) => void) {
59
-  const params = {
60
-    mer_id: id.value,
61
-    // mer_keyword: '',
62
-    pageNum: state.currentPage,
63
-    pageSize: state.pageSize,
64
-    // mer_id?: string
65
-    // mer_keyword?: string
66
-    // pageNum: number
67
-    // pageSize: number
68
-    // order: ORDER
69
-    //请求类别,推荐:1;销量:2;上新3;价格升序4,价格降序5;平台商品6;大仓商品7;
70
-    // is_best?: number
71
-    // sales?: number
72
-    // is_new?: number
73
-    // priceType?: number
74
-    // type?: number
75
-    // category_id?: string
76
-  }
77
-  if (state.searchValue) {
78
-    params.mer_keyword = state.searchValue
79
-  }
80
-  if (action === 'reload') {
81
-    params.pageNum = 1
82
-  }
83 77
 
84
-  searchProductList({
85
-    ...params,
86
-    ...state.params
87
-  }).then(res => {
88
-    state.triggered = false
89
-    if (action === 'page') {
90
-      productList.value = productList.value.concat(res.pageInfo.list)
91
-    }
92
-    if (action === 'reload') {
93
-      productList.value = res.pageInfo.list
94
-    }
95
-    console.log(res.pageInfo)
96
-    state.totalPage = Math.ceil(res.pageInfo.total / state.pageSize);
97
-    state.status = 'more'
98 78
 
99 79
 
100
-    if (callback) {
101
-      callback(res.pageInfo.list)
102
-    }
103
-  })
104
-}
80
+
105 81
 
106 82
 function handleScrollToLower() {
107 83
   state.status = 'loading';
@@ -129,10 +105,16 @@ onPullDownRefresh(() => {
129 105
   })
130 106
 })
131 107
 
132
-function handleProductTypeChange(typeValue) {
108
+function handleProductTypeChange(typeValue: any) {
109
+  console.log('传入的值', typeValue);
110
+  state.order = false
111
+  state.currentSelected = typeValue
112
+  if (typeValue == 0) {
113
+    state.params = {}
114
+  }
133 115
   if (typeValue == 1) {
134 116
     state.params = {
135
-      is_best: 0
117
+      is_good: 1
136 118
     }
137 119
   }
138 120
   if (typeValue == 2) {
@@ -161,21 +143,33 @@ function handleProductTypeChange(typeValue) {
161 143
     }
162 144
   }
163 145
   // if (typeValue === 3) {
146
+  //   state.priceType = NaN
164 147
   //   state.sales = NaN
165 148
   //   state.is_new = 0
166 149
   // }
167 150
   // else if (typeValue === 2) {
151
+  //   state.priceType = NaN
152
+  //   state.is_new = NaN
168 153
   //   state.sales = 0
169 154
   // } else {
170 155
   //   state.type = typeValue
156
+  //   state.priceType = NaN
157
+  //   state.is_new = NaN
158
+  //   state.sales = NaN
171 159
   // }
172 160
   loadList('reload')
173 161
 }
174
-function handleOrderChange(priceType) {
175
-  state.priceType = priceType
176
-
162
+function handleOrderChange(priceType: any) {
163
+  console.log(priceType)
164
+  state.currentSelected = NaN
165
+  state.order = true
166
+  if (priceType == 0) {
167
+    state.priceType = 1
168
+  } else {
169
+    state.priceType = 0
170
+  }
177 171
   state.params = {
178
-    priceType,
172
+    priceType: state.priceType,
179 173
   }
180 174
   // reset
181 175
   // state.sales = NaN
@@ -183,31 +177,116 @@ function handleOrderChange(priceType) {
183 177
 
184 178
   loadList('reload')
185 179
 }
180
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
181
+  const params = {
182
+    mer_id: id.value,
183
+    // mer_keyword: '',
184
+    pageNum: state.currentPage,
185
+    pageSize: state.pageSize,
186
+  }
187
+  if (state.searchValue) {
188
+    params.mer_keyword = state.searchValue
189
+  }
190
+  // if (state.type) {
191
+  //   params.type = state.type
192
+  // }
193
+  // if (state.sales === 0) {
194
+  //   params.sales = state.sales
195
+  // }
196
+  // // console.log(state.is_new)
197
+  // if (state.is_new === 0) {
198
+  //   params.is_new = state.is_new
199
+  // }
200
+  // if (state.priceType === 1 || state.priceType === 0) {
201
+  //   params.priceType = state.priceType
202
+  // }
203
+  if (action === 'reload') {
204
+    params.pageNum = 1
205
+  }
206
+  searchProductList({
207
+    ...params,
208
+    ...state.params
209
+  }).then(res => {
210
+    // console.log(res)
211
+    if (res && res.pageInfo) {
212
+      state.triggered = false
213
+      if (action === 'page') {
214
+        productList.value = productList.value.concat(res.pageInfo.list)
215
+      }
216
+      if (action === 'reload') {
217
+        productList.value = res.pageInfo.list
218
+      }
219
+      // console.log(res.pageInfo)
220
+      state.totalPage = Math.ceil(res.pageInfo.total / state.pageSize);
221
+      state.status = 'more'
222
+
223
+
224
+      if (callback) {
225
+        callback(res.pageInfo.list)
226
+      }
227
+    }
228
+  }).catch(error => {
229
+    uni.showToast({
230
+      title: error,
231
+      icon: "none"
232
+    })
233
+  })
234
+}
186 235
 </script>
187 236
 <template>
188 237
   <div class="fixed top-0 w-full bg-white z-1">
189
-    <nut-searchbar
190
-        v-model="state.searchValue" @search="loadList('reload')" @clear="loadList( 'reload')">
238
+    <nut-searchbar v-model="state.searchValue" @search="loadList('reload')" @clear="loadList('reload')">
191 239
       <template v-slot:rightout>
192 240
         <div @tap="loadList('reload')">
193 241
           搜索
194 242
         </div>
195 243
       </template>
196 244
     </nut-searchbar>
197
-  </div>
245
+    <div class="flex flex-row items-center" >
246
+      <div class="basis-1/4 text-center cx-menu">
247
+        <nut-menu class="custom-menu">
248
+          <template #icon>
249
+            <image :src="downDefaultImg" mode="widthFix" class="w-1 h-1"></image>
250
+          </template>
251
+          <nut-menu-item v-model="state.menuDefaultValue" :options="state.options" @change="handleProductTypeChange">
252
+
253
+          </nut-menu-item>
254
+        </nut-menu>
255
+      </div>
256
+      <div @click="handleProductTypeChange(2)" class="basis-1/4 text-center"
257
+        :class="state.currentSelected == 2 ? 'text-primary font-bold' : ''" style="font-size: 28rpx;">销量</div>
258
+      <div @click="handleProductTypeChange(3)" style="font-size: 28rpx;"
259
+        :class="state.currentSelected == 3 ? 'text-primary font-bold' : ''" class="basis-1/4 text-center">上新</div>
260
+      <div @click="handleOrderChange(state.priceType)" style="font-size: 28rpx;" class="basis-1/4 text-right">
261
+        <div class="flex flex-row justify-center items-center gap-1">
262
+          <div :class="state.order ? 'text-primary font-bold' : ''">
263
+            价格
264
+          </div>
265
+          <div class="flex flex-col justify-center items-center">
266
+            <div v-if="!state.order" class="h-fit flex flex-col items-center">
267
+              <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2"></image>
268
+              <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2"></image>
269
+            </div>
270
+            <div v-if="state.order" class="h-fit flex flex-col items-center">
271
+              <image :src="upRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 1"></image>
272
+              <image :src="upDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
198 273
 
199
-  <div class="p-3 pb-25 mt-15 flex flex-col gap-3">
200
-<!--    <MerchantHeader -->
201
-    <MerchantHeader :is-search-home="true"
274
+              <image :src="downRedImg" mode="widthFix" class="w-2 h-2" v-if="state.priceType == 0"></image>
275
+              <image :src="downDefaultImg" mode="widthFix" class="w-2 h-2" v-else></image>
276
+            </div>
277
+          </div>
278
+        </div>
279
+      </div>
280
+    </div>
281
+  </div>
282
+  <div class="p-3 pb-25 mt-21 flex flex-col gap-3">
283
+    <!--    <MerchantHeader -->
284
+    <!-- <MerchantHeader :is-search-home="true"
202 285
                     @product-type-change="handleProductTypeChange"
203 286
                     @order-change="handleOrderChange"
204
-    />
205
-    <MerchantProductList
206
-        :list="productList"
207
-        v-if="productList.length > 0"
208
-
209
-    />
210
-    <CXBEmpty v-else/>
287
+    /> -->
288
+    <MerchantProductList :list="productList" v-if="productList.length > 0" />
289
+    <CXBEmpty v-else />
211 290
   </div>
212 291
 </template>
213 292
 
@@ -225,4 +304,12 @@ page {
225 304
   --nut-searchbar-input-box-shadow: none;
226 305
 }
227 306
 
307
+:deep(.nut-menu__bar) {
308
+  --nut-white: none;
309
+  background: none;
310
+  background-color: transparent !important;
311
+}
312
+.custom-menu {
313
+  background: white;
314
+}
228 315
 </style>

+ 247 - 98
src/pages/store/product/detail.vue

@@ -70,6 +70,15 @@ const state = reactive({
70 70
 const detail: any = ref(null)
71 71
 const isTo = ref(3)
72 72
 let isShow = ref(false)
73
+
74
+//展开收起
75
+const isExpanded = ref(false)
76
+
77
+const remainingTime: any = ref({
78
+  hours: "00",
79
+  minutes: "00",
80
+  seconds: "00"
81
+})
73 82
 onShow(() => {
74 83
   uni.showLoading({
75 84
     title: '数据加载中',
@@ -137,15 +146,16 @@ onLoad((option: any) => {
137 146
     userStore.setShareId(fromShareId)
138 147
 
139 148
     userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${fromShareId}`, 'page')
149
+    getShareId({ pid: state.id, type: 1 }).then(res => {
150
+      state.shareId = res.share_id
151
+      userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
152
+
153
+    })
140 154
 
141 155
   }
142 156
 
143 157
 
144
-  getShareId({ pid: state.id, type: 1 }).then(res => {
145
-    state.shareId = res.share_id
146
-    userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
147 158
 
148
-  })
149 159
 
150 160
 
151 161
 
@@ -166,7 +176,7 @@ function loadProductDetail() {
166 176
           detail.value.price = detail.value.price * 30
167 177
         }
168 178
       }
169
-      state.isRelation = res.isRelation
179
+      state.isRelation = detail.value.isRelation
170 180
       if (res.merchant_type == 2) {
171 181
         xcxBanding({
172 182
           mer_id: res.mer_id,
@@ -205,11 +215,15 @@ onShareAppMessage(async () => {
205 215
     icon: 'none'
206 216
   })
207 217
   return await getShareId({ pid: state.id, type: 1 }).then(res => {
218
+    console.log(99999999, res);
208 219
     if (res) {
220
+
221
+
209 222
       state.shareId = res.share_id
210 223
       uni.hideLoading()
211 224
       return {
212 225
         title: `${detail.value.store_name}`,
226
+        imageUrl: res.url,
213 227
         path: `pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`
214 228
       }
215 229
     }
@@ -347,7 +361,7 @@ function previewImage(index: number) {
347 361
   //uniapp预览轮播图
348 362
   uni.previewImage({
349 363
     current: index, // 预览图片的下标
350
-    urls: state.detail.imgUrls // 预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以
364
+    urls: detail.value.slider_image // 预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以
351 365
   })
352 366
 }
353 367
 
@@ -360,7 +374,7 @@ function handleShowMerchant(merId: string) {
360 374
 }
361 375
 
362 376
 function handleShowShopCart() {
363
-  uni.switchTab({
377
+  uni.reLaunch({
364 378
     url: `/pages/order_addcart/index`
365 379
   })
366 380
 }
@@ -391,7 +405,7 @@ function handleCreateShopping() {
391 405
     // product_attr_unique: JSON.stringify(state.currentSku),
392 406
     product_attr_unique: state.currentSku.unique,
393 407
     cart_num: state.cartNum,
394
-    is_new: (state.flag === '1' || state.flag === '3'|| state.flag == '5') ? '1' : '0'
408
+    is_new: (state.flag === '1' || state.flag === '3' || state.flag == '5') ? '1' : '0'
395 409
   }).then(res => {
396 410
     console.log('resres', res)
397 411
 
@@ -416,30 +430,7 @@ function handleCreateShopping() {
416 430
       }
417 431
     }
418 432
   }).catch(error => {
419
-    // if (error === '会员礼包不能加入购物车') {
420
-    //   return uni.showToast({
421
-    //     title: error,
422
-    //     icon: 'none'
423
-    //   })
424
-    // } else if (error === '库存不足') {
425
-    //   return uni.showToast({
426
-    //     title: error,
427
-    //     icon: 'none'
428
-    //   })
429
-    // }
430
-    // else if(error==='您已是高级会员,分红满额后可再次购买~') {
431
-    //   uni.showToast({
432
-    //         title: error,
433
-    //         icon: 'none'
434
-    //       })
435
-
436
-    // }else{
437
-    //   console.log('我是error>>>',error);
438
-    //   uni.showToast({
439
-    //         title: error,
440
-    //         icon: 'none'
441
-    //       })
442
-    // }
433
+
443 434
     console.log('我是error>>>', error);
444 435
     userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
445 436
     if (error === '请登录') {
@@ -448,7 +439,7 @@ function handleCreateShopping() {
448 439
         icon: 'none'
449 440
       })
450 441
       setTimeout(() => {
451
-        uni.redirectTo({
442
+        uni.navigateTo({
452 443
           url: '/pages/user/login/index?key=4'
453 444
         })
454 445
       }, 500)
@@ -478,22 +469,7 @@ function handleBuyshow() {
478 469
       })
479 470
     }
480 471
   }).catch(error => {
481
-    // if (error === '会员礼包不能加入购物车') {
482
-    //   return uni.showToast({
483
-    //     title: error,
484
-    //     icon: 'none'
485
-    //   })
486
-    // } else if (error === '库存不足') {
487
-    //   return uni.showToast({
488
-    //     title: error,
489
-    //     icon: 'none'
490
-    //   })
491
-    // }
492
-    // else {
493
-    //   return uni.navigateTo({
494
-    //     url: '/pages/user/login/index'
495
-    //   })
496
-    // }
472
+
497 473
     console.log('我是error>>>', error);
498 474
     userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
499 475
     if (error === '请登录') {
@@ -502,7 +478,7 @@ function handleBuyshow() {
502 478
         icon: 'none'
503 479
       })
504 480
       setTimeout(() => {
505
-        uni.redirectTo({
481
+        uni.navigateTo({
506 482
           url: '/pages/user/login/index?key=4'
507 483
         })
508 484
       }, 500)
@@ -539,22 +515,7 @@ function handleAddshow() {
539 515
       state.isShowSku = false
540 516
     }
541 517
   }).catch(error => {
542
-    // if (error === '会员礼包不能加入购物车') {
543
-    //   return uni.showToast({
544
-    //     title: error,
545
-    //     icon: 'none'
546
-    //   })
547
-    // } else if (error === '库存不足') {
548
-    //   return uni.showToast({
549
-    //     title: error,
550
-    //     icon: 'none'
551
-    //   })
552
-    // }
553
-    // else {
554
-    //   return uni.navigateTo({
555
-    //     url: '/pages/user/login/index'
556
-    //   })
557
-    // }
518
+
558 519
     console.log('我是error>>>', error);
559 520
     userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
560 521
     if (error === '请登录') {
@@ -564,7 +525,7 @@ function handleAddshow() {
564 525
         icon: 'none'
565 526
       })
566 527
       setTimeout(() => {
567
-        uni.redirectTo({
528
+        uni.navigateTo({
568 529
           url: '/pages/user/login/index?key=4'
569 530
         })
570 531
       }, 500)
@@ -590,10 +551,13 @@ function notStarted() {
590 551
 
591 552
 // 规格显示双按钮
592 553
 function handleTwobtn() {
554
+  console.log(state.currentSku);
593 555
   isTo.value = 2
594 556
   state.isShowSku = !state.isShowSku
595 557
 }
596 558
 function handleQgbtn() {
559
+  console.log(state.currentSku);
560
+
597 561
   isTo.value = 4
598 562
   state.isShowSku = !state.isShowSku
599 563
 }
@@ -613,9 +577,9 @@ function handleOrderConfirm(flag: '1' | '2' | '3' | '5') {
613 577
         icon: 'none'
614 578
       }).then(() => {
615 579
         setTimeout(() => {
616
-          uni.redirectTo({
617
-          url: '/pages/user/login/index?key=4'
618
-        })
580
+          uni.navigateTo({
581
+            url: '/pages/user/login/index?key=4'
582
+          })
619 583
         }, 500)
620 584
 
621 585
       })
@@ -729,6 +693,15 @@ function handleShowCustomer() {
729 693
   })
730 694
 }
731 695
 
696
+//查看更多》
697
+function handleTomoreProduct(merId: string) {
698
+  console.log(merId)
699
+  uni.navigateTo({
700
+    url: `/pages/store/home/index?id=${merId}`
701
+  })
702
+}
703
+
704
+
732 705
 // 距离顶部距离
733 706
 let Scroll_X = ref(0)
734 707
 
@@ -744,6 +717,57 @@ onPageScroll((page) => {
744 717
     headerClass.value = ''
745 718
   }
746 719
 })
720
+
721
+function handleisExpanded() {
722
+  isExpanded.value = !isExpanded.value
723
+}
724
+
725
+//计算秒杀
726
+function getCountdown() {
727
+  if (detail.value.seckill_date_end) {
728
+    const now = new Date();
729
+    const endDate = new Date(detail.value.seckill_date_end).getTime();
730
+    console.log(endDate);
731
+
732
+    if (now < endDate) {
733
+      let milliseconds = endDate - now;
734
+
735
+      const hours = Math.floor(milliseconds / (1000 * 60 * 60));
736
+      const minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60));
737
+      const seconds = Math.floor((milliseconds % (1000 * 60)) / 1000);
738
+
739
+      // 更新数据
740
+      remainingTime.value = {
741
+        hours: hours < 10 ? '0' + hours : hours,
742
+        minutes: minutes < 10 ? '0' + minutes : minutes,
743
+        seconds: seconds < 10 ? '0' + seconds : seconds
744
+      }
745
+    } else {
746
+      clearInterval(timer);
747
+      //加载秒杀数据
748
+      console.log('自动关闭');
749
+      loadProductDetail()
750
+      console.log(111);
751
+
752
+    }
753
+  }
754
+
755
+}
756
+
757
+
758
+// 每秒更新剩余时间
759
+const timer = setInterval(() => {
760
+  getCountdown()
761
+}, 1000);
762
+
763
+onUnload(() => {
764
+  clearInterval(timer);
765
+  console.log('卸载关闭');
766
+})
767
+
768
+
769
+
770
+
747 771
 </script>
748 772
 
749 773
 <template>
@@ -755,29 +779,30 @@ onPageScroll((page) => {
755 779
           indicator-active-color="#e93323" :autoplay="state.autoplay" :circular="state.circular"
756 780
           :interval="state.interval" :duration="state.duration" class="w-full h-94">
757 781
           <swiper-item v-for="(item, index) in detail.slider_image" :key="index">
758
-            <image :src="item" @tap="previewImage(index)" class="!w-full !h-full" mode="aspectFill" />
782
+            <image :src="item" @tap="previewImage(index)" style="width: 750rpx; height:750rpx;"  />
759 783
           </swiper-item>
760 784
         </swiper>
761 785
       </div>
762
-      <div class="bg-gradient-to-r from-[#fe7577] to-[#fe0032] h-20 mt-3 flex items-center p-3 justify-between"
786
+      <div class="bg-gradient-to-r from-[#fe7577] to-[#fe0032] h-20  flex items-center p-3 justify-between"
763 787
         v-if="detail.seckill == 1">
764
-        <div class="flex flex-col">
788
+        <div class="flex justify-center items-center">
765 789
           <div class="flex gap-2 items-center text-white">
766 790
             <div class="text-[30px] font-bold">
767 791
               <text class="text-[20px]">¥</text>{{ detail.seckill_s == 0 ? detail.price : detail.dc_price }}
768 792
             </div>
769
-            <image :src="miaoshaIcon" mode="widthFix" class="w-10"></image>
770 793
           </div>
771
-          <div class="text-white text-xs">
772
-            即将恢复原价 ¥{{ detail.ot_price }}
794
+          <div style="font-size: 24rpx;" class="ml-3 text-white text-xs line-through  font-bold flex text-gray-600">
795
+            ¥{{ detail.ot_price }}
773 796
           </div>
774 797
         </div>
775 798
         <div class="flex flex-col items-center gap-2 justify-center">
776 799
           <image :src="xiaoshimiaoshaIcon" class="w-17 h-4" model="widthFix"></image>
777 800
           <div class="text-white " v-if="detail.seckill_s == 1">
778
-            <div class="text-xs">
779
-              距秒杀结束</div>
780
-            <nut-countdown :end-time="new Date(detail.seckill_date_end).getTime() + 60 * 1000"></nut-countdown>
801
+            <!-- <div class="text-xs"></div> -->
802
+            <!-- <nut-countdown :end-time="new Date(detail.seckill_date_end).getTime() + 60 * 1000"></nut-countdown> -->
803
+            <span class="ms_span">{{ remainingTime.hours }}</span> :
804
+            <span class="ms_span">{{ remainingTime.minutes }}</span> :
805
+            <span class="ms_span">{{ remainingTime.seconds }}</span>
781 806
           </div>
782 807
           <div class="text-white" v-if="detail.seckill_s == 2">
783 808
             <div class="">
@@ -798,9 +823,9 @@ onPageScroll((page) => {
798 823
       </div>
799 824
 
800 825
       <div class="flex flex-col p-3 gap-3">
801
-        <div class="flex flex-row  items-center text-[#FE0032] font-bold text-lg gap-2">
826
+        <div v-if="detail.seckill_s == 0" class="flex flex-row  items-center text-[#FE0032] font-bold text-lg gap-2">
802 827
           <div v-if="is148Merchant && detail.price" class="flex justify-end items-end gap-2">
803
-            <div class="!text-[24px]">{{ Number.parseFloat(detail.price).toFixed(2) }} </div>
828
+            <div class="!text-[24px]">{{  Math.round(detail.price * 30) }} </div>
804 829
             <div class="text-sm">积分</div>
805 830
           </div>
806 831
           <div v-else>
@@ -832,13 +857,26 @@ onPageScroll((page) => {
832 857
             <div class="flex bg-primary text-white rounded text-[10px] text-center" v-if="detail.type == 5">
833 858
               <div class=" h-4 w-4 ">仓</div>
834 859
             </div>
835
-            <div class=" justify-center items-center" v-html="detail.store_name">
860
+            <div class="text-ellipsis justify-center items-center" v-html="detail.store_name">
836 861
             </div>
837 862
           </div>
838 863
           <div v-if="detail.store_info" class="text-gray-600 text-sm w-fit px-1"
839 864
             :class="is148Merchant ? 'border border-solid border-gray' : ''">
840
-            {{ detail.store_info }}
865
+            <div v-if="isExpanded == false">
866
+              {{ detail.store_info.length <= 50 ? detail.store_info : detail.store_info.slice(0, 50) + '...' }} <span
867
+                @click="handleisExpanded" v-if="detail.store_info.length > 50" style="color:red">
868
+                展开
869
+                </span>
870
+            </div>
871
+            <div v-else-if="isExpanded == true">
872
+              {{ detail.store_info }}
873
+              <span @click="handleisExpanded" style="color:red">
874
+                收起
875
+              </span>
876
+            </div>
877
+
841 878
           </div>
879
+
842 880
         </div>
843 881
 
844 882
         <div class="flex gap-3 text-[12px]">
@@ -902,12 +940,16 @@ onPageScroll((page) => {
902 940
       </div>
903 941
 
904 942
     </div>
905
-    <div class="flex flex-col bg-white" v-if="detail.merchant.recommend.length>=3" >
943
+    <!-- v-if="detail.merchant.recommend.length>=3" -->
944
+    <div class="flex flex-col bg-white" v-if="detail.merchant.recommend.length >= 3">
906 945
       <div class="p-3">
907
-        <div
908
-          class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-600 before:rounded relative inline-block">
909
-          <div class="pl-2">
910
-            店铺推荐
946
+        <div class="flex flex-1 justify-between items-center ">
947
+          <div class="" style="vertical-align:bottom">
948
+            <image style="width:7rpx ;height: 28rpx; margin-right: 8rpx;" src="../../../static/icon/title_1.png"></image>
949
+            <span class="text_dptj">店铺推荐</span>
950
+          </div>
951
+          <div class="text_ckgd" @click="handleTomoreProduct(detail.mer_id)">
952
+            查看更多 >
911 953
           </div>
912 954
         </div>
913 955
       </div>
@@ -915,9 +957,54 @@ onPageScroll((page) => {
915 957
         <scroll-view class=" whitespace-nowrap  w-screen  text-white text-sm" :scroll-with-animation="true"
916 958
           :scroll-x="true" :show-scrollbar="false">
917 959
           <div class="pl-3" v-if="detail && detail.merchant">
918
-            <div v-for="(item, index) in detail.merchant.recommend" :key="index" @click="handleProductItemClick(item)"
960
+            <div v-for="(item, index) in detail.merchant.recommend" :key="index"
919 961
               class="flex inline-flex items-center justify-center relative ">
920
-              <MerchantProductCard :item="item" exClass="w-40 border border-solid border-gray-200 mr-3" />
962
+              <!-- <MerchantProductCard :item="item" exClass="w-30 border border-solid border-gray-200 mr-3" /> -->
963
+              <div @click="handleProductItemClick(item)" style="width: 233rpx;" class="bg-white rounded-lg text-dark">
964
+
965
+                <image :src="item.image" style="width: 202rpx;height: 202rpx;border-radius: 16rpx; " :fade-in="true">
966
+                </image>
967
+
968
+                <div class="text-sm p-2 flex flex-col gap-1">
969
+                  <div class="text-hidden">
970
+                    {{ item.store_name }}
971
+                  </div>
972
+                  <div v-if="item.type != 15">
973
+                    <div v-if="!is148Merchant"
974
+                      class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
975
+                      <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix"
976
+                        style="width: 46rpx; height: 28rpx;">
977
+                      </image>
978
+                      <div class="ylj_d flex items-center jusitify-center ">
979
+                        <div>
980
+                          养老金 ¥{{ item.yanglao || item.yanglao_price }}
981
+                        </div>
982
+                      </div>
983
+                    </div>
984
+                  </div>
985
+
986
+                  <div class="flex flex-row items-center gap-2">
987
+                    <div v-if="is148Merchant && item.price" class="flex justify-end items-end gap-2 text-[#FE0032]">
988
+                      <div class="!text-[24px]">{{  Math.round(item.price * 30) }} </div>
989
+                      <div class="text-sm">积分</div>
990
+                    </div>
991
+                    <div class="flex text-[#FE0032] font-bold text-lg" v-else>
992
+                      <div>
993
+                        ¥
994
+                      </div>
995
+                      <div>
996
+                        {{ item.price }}
997
+                      </div>
998
+                    </div>
999
+
1000
+                  </div>
1001
+                  <div class="line-through text-xs font-bold flex " v-if="item.ot_price && !is148Merchant">
1002
+                    ¥ {{ item.ot_price }}
1003
+                  </div>
1004
+
1005
+
1006
+                </div>
1007
+              </div>
921 1008
             </div>
922 1009
 
923 1010
           </div>
@@ -928,10 +1015,10 @@ onPageScroll((page) => {
928 1015
 
929 1016
     <div class="flex flex-col justify-center bg-white">
930 1017
       <div class="p-3">
931
-        <div
932
-          class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-800 before:rounded relative inline-block">
933
-          <div class="pl-2">
934
-            图文详情
1018
+        <div class="flex flex-1 justify-start items-center ">
1019
+          <div class="" style="vertical-align:bottom">
1020
+            <image style="width:7rpx ;height: 28rpx; margin-right: 8rpx;" src="../../../static/icon/title_1.png"></image>
1021
+            <span class="text_dptj">图片详情</span>
935 1022
           </div>
936 1023
         </div>
937 1024
       </div>
@@ -946,10 +1033,10 @@ onPageScroll((page) => {
946 1033
 
947 1034
     <div class="flex flex-col pb-safe gap-3">
948 1035
       <div class="p-3 bg-white">
949
-        <div
950
-          class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-600 before:rounded relative inline-block">
951
-          <div class="pl-2">
952
-            精品推荐
1036
+        <div class="flex flex-1 justify-start items-center ">
1037
+          <div class="" style="vertical-align:bottom">
1038
+            <image style="width:7rpx ;height: 28rpx; margin-right: 8rpx;" src="../../../static/icon/title_1.png"></image>
1039
+            <span class="text_dptj">精品推荐</span>
953 1040
           </div>
954 1041
         </div>
955 1042
       </div>
@@ -1165,6 +1252,68 @@ button::after {
1165 1252
 .out-conter {
1166 1253
   text-align: center;
1167 1254
 }
1255
+
1256
+.text_dptj {
1257
+  height: 28rpx;
1258
+  font-size: 28rpx;
1259
+  font-family: PingFangSC, PingFang SC;
1260
+  font-weight: 600;
1261
+  color: #333333;
1262
+  line-height: 28rpx;
1263
+}
1264
+
1265
+.text_ckgd {
1266
+  height: 22rpx;
1267
+  font-size: 24rpx;
1268
+  font-family: PingFangSC, PingFang SC;
1269
+  font-weight: 400;
1270
+  color: #999999;
1271
+  line-height: 22rpx;
1272
+}
1273
+
1274
+
1275
+.text-hidden {
1276
+  overflow: hidden;
1277
+  white-space: nowrap;
1278
+  text-overflow: ellipsis;
1279
+}
1280
+
1281
+.ylj_d {
1282
+  height: 25rpx;
1283
+  font-size: 18rpx;
1284
+  font-family: PingFangSC, PingFang SC;
1285
+  font-weight: 400;
1286
+  color: #FE0032;
1287
+  line-height: 25rpx;
1288
+  padding-left: 6rpx;
1289
+  padding-right: 6rpx;
1290
+}
1291
+
1292
+.text-container {
1293
+  overflow: hidden;
1294
+}
1295
+
1296
+.clamp-expanded {
1297
+  overflow: visible;
1298
+}
1299
+
1300
+
1301
+.text-ellipsis {
1302
+  display: -webkit-box;
1303
+  -webkit-box-orient: vertical;
1304
+  overflow: hidden;
1305
+  text-overflow: ellipsis;
1306
+  -webkit-line-clamp: 2;
1307
+  /* 控制显示行数 */
1308
+}
1309
+
1310
+.ms_span {
1311
+  width: 40rpx;
1312
+  height: 36rpx;
1313
+  background: #FFFFFF;
1314
+  border-radius: 6rpx;
1315
+  color: #FE0032;
1316
+}
1168 1317
 </style>
1169 1318
 <route lang="yaml">
1170 1319
 style:

+ 22 - 9
src/pages/store/product/other.vue

@@ -28,7 +28,7 @@ import { debounce, merge } from "lodash-es";
28 28
 
29 29
 import { useDebounceFn } from '@vueuse/core';
30 30
 import dayjs from "dayjs";
31
-import { decodeBase64 } from "~/utils/http/helper";
31
+import { decodeBase64, encodeBase64 } from "~/utils/http/helper";
32 32
 import { CDN_URL, CDM_URL } from "~/config/app";
33 33
 import { getRecommendList } from "~/apis/merchant";
34 34
 import type { DcProductModel } from "~/apis/model/dacang.model";
@@ -74,8 +74,8 @@ const detailclone = ref<IProductDetail>()
74 74
 onLoad((options: any) => {
75 75
 
76 76
   const data: Partial<IProductDetail> = JSON.parse(decodeBase64(options.params))
77
-  // console.log('我是options数据', data)
78
-
77
+  // console.log('我是options数据', data)  url: `/pages/store/product/other?platform=${item.type}&id=${item.id}`
78
+  userStore.setRedirectPage(`/pages/store/product/other?params=${encodeBase64(data)}`, 'page')
79 79
   // if (options.platform && options.id) {
80 80
   uni.showLoading({
81 81
     title: '数据加载中',
@@ -104,12 +104,25 @@ function YouLike() {
104 104
 
105 105
 //商品不存在详情
106 106
 function soldOut() {
107
-  isShow.value = true
108
-  uni.setNavigationBarTitle({
109
-    title: '商品下架不存在'
110
-  })
111
-  loadList('reload')
112
-  uni.hideLoading()
107
+  if (userStore.uid) {
108
+    isShow.value = true
109
+    uni.setNavigationBarTitle({
110
+      title: '商品下架不存在'
111
+    })
112
+    loadList('reload')
113
+    uni.hideLoading()
114
+  } else {
115
+    uni.showToast({
116
+      title: '请登录',
117
+      icon: 'none'
118
+    })
119
+    setTimeout(() => {
120
+      uni.redirectTo({
121
+        url: '/pages/user/login/index?key=4'
122
+      })
123
+    }, 500)
124
+  }
125
+
113 126
 }
114 127
 
115 128
 function mergeProductDetail(data: Partial<IProductDetail> = {}) {

+ 39 - 31
src/pages/user/index.vue

@@ -2,7 +2,7 @@
2 2
 import { useUserStore } from "~/stores/userStore";
3 3
 import CXBAuthorize from "~/components/CXBAuthorize/CXBAuthorize.vue";
4 4
 import { getAgentInfo, getUserInfo } from "~/apis/user";
5
-import { CDN_URL,CDM_URL } from "~/config/app";
5
+import { CDN_URL, CDM_URL } from "~/config/app";
6 6
 import Routine from "~/libs/routine";
7 7
 import { totalOrderNumber } from "~/apis/order.api";
8 8
 import type { OrderQuantityModel } from "~/apis/model/order.model";
@@ -10,6 +10,7 @@ import FPopup from "~/components/FPopup/FPopup.vue";
10 10
 import { CANCEL_EVENT, OPEN_EVENT } from "~/constants/event";
11 11
 import type { Ref } from "vue";
12 12
 const pageStore = usePageStoreWidthOut()
13
+const userStore = useUserStore();
13 14
 const currentType = ref('')
14 15
 const myOrderList = [{
15 16
   id: 'noPay',
@@ -90,9 +91,9 @@ const myServiceList = [{
90 91
   url: '/pages/invite-friends/index'
91 92
 }, {
92 93
   icon: CDN_URL + '/static/assets/dianpuruzhu_220620.png',
93
-  text: '商铺入驻',
94
+  text: userStore.userInfo?.is_merchant=="-1"?'商铺入驻':'我的商铺',
94 95
   url: ''
95
-},  {
96
+}, {
96 97
   icon: CDN_URL + '/static/assets/mine_setting_220620.png',
97 98
   text: '设置',
98 99
   url: '/pages/setting/index'
@@ -100,7 +101,7 @@ const myServiceList = [{
100 101
 const state = reactive({
101 102
   isLogin: false
102 103
 })
103
-const userStore = useUserStore();
104
+
104 105
 const orderQuantity: Ref<OrderQuantityModel> = ref()
105 106
 // const orderQuantity =reactive({
106 107
 //   noComment: '',
@@ -180,7 +181,7 @@ function handleService(item: {
180 181
   text: string
181 182
   url: string
182 183
 }) {
183
-  if (item.text === '商铺入驻') {
184
+  if (item.text === '商铺入驻'||item.text === '我的店铺') {
184 185
     return uni.navigateToMiniProgram({
185 186
       appId: 'wx9a3e4ab07f8a9ba2',
186 187
       path: 'pages/index/index',
@@ -239,7 +240,7 @@ function handleShowMyAllOrder(tab?: number) {
239 240
 
240 241
 const userType = computed(() => {
241 242
   const userRichType = userStore.userInfo?.user_rich_type
242
- 
243
+
243 244
   // console.log(userStore.userInfo)
244 245
   // 普通用户
245 246
   if (userRichType == 0) {
@@ -325,11 +326,11 @@ const backImg = computed(() => {
325 326
     const areamanage = userStore.userInfo?.area_manage_type
326 327
     // 县/区代理
327 328
     if (areamanage == 'district') {
328
-      return CDM_URL+'/image/2023-11-24/20231124154421388.png'
329
+      return CDM_URL + '/image/2023-11-24/20231124154421388.png'
329 330
     }
330 331
     // 市代理
331 332
     if (areamanage == 'city') {
332
-      return CDM_URL+'/image/2023-11-24/20231124154612477.png'
333
+      return CDM_URL + '/image/2023-11-24/20231124154612477.png'
333 334
     }
334 335
   }
335 336
 
@@ -391,9 +392,9 @@ function handleShowMyRulePage() {
391 392
       <div class="pt-15 ">
392 393
         <div class="flex gap-2 mb-2 text-white mb-6">
393 394
           <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
394
-            @click="handleShowMyProfile" mode="widthFix" class="w-9 h-9 rounded-full"></image>
395
-          <image v-else @click="checkAuth" src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix"
396
-            class="w-9 h-9 rounded-full" />
395
+            @click="handleShowMyProfile" style="width:74rpx; height:74rpx;" class="rounded-full"></image>
396
+          <image v-else @click="checkAuth" src="https://app.bjtdba.com/uploads/logo.jpg" 
397
+            class="rounded-full" style="width:74rpx; height:74rpx;" />
397 398
           <div class="flex flex-col">
398 399
             <div class="flex">
399 400
               <div class="text-sm">
@@ -412,21 +413,19 @@ function handleShowMyRulePage() {
412 413
                 <image mode="heightFix" lazy-load class="vip_img" :src="userType"></image>
413 414
               </div>
414 415
               <!-- 市区县代理 -->
415
-              <div @click="openPopup" v-if="areaType"
416
-                class="flex rounded-full  text-[12px] text-white w-12 h-5  w-fit ">
416
+              <div @click="openPopup" v-if="areaType" class="flex rounded-full  text-[12px] text-white w-12 h-5  w-fit ">
417 417
                 <image mode="heightFix" lazy-load class="vip_img" :src="areaType"></image>
418 418
               </div>
419 419
               <!-- 股东 -->
420
-              <div v-if="AlholderType" 
421
-                class="flex rounded-full  text-[12px] text-white w-12 h-5   w-fit">
420
+              <div v-if="AlholderType" class="flex rounded-full  text-[12px] text-white w-12 h-5   w-fit">
422 421
                 <image mode="heightFix" lazy-load class="vip_img" :src="AlholderType"></image>
423 422
               </div>
424 423
             </div>
425 424
           </div>
426 425
           <FPopup v-model:show="showValue" position="center" exClass="box_2 ">
427 426
             <div class="box_2 flex-row">
428
-              <div class="box_2" v-if="backImg" >
429
-                <image  lazy-load class="img_1" :src="backImg"></image>
427
+              <div class="box_2" v-if="backImg">
428
+                <image lazy-load class="img_1" :src="backImg"></image>
430 429
               </div>
431 430
               <div class="group_2 flex-col lolr ">
432 431
                 <div class="div_box pong1 ">
@@ -458,29 +457,31 @@ function handleShowMyRulePage() {
458 457
           </FPopup>
459 458
 
460 459
         </div>
461
-        <div class="bg-white rounded flex flex-col gap-6 py-4 text-xl">
462
-          <div v-if="userStore.userInfo" class="flex flex-wrap">
463
-            <div @tap="handleShowAnnuityDetail" class="w-1/3 flex flex-col justify-center items-center">
464
-              <div>{{ userStore.yanglao.all_yanglao }}</div>
460
+        <div style="border-radius: 16rpx;" class="bg-white flex flex-col gap-6 py-4 text-xl">
461
+          <div v-if="userStore.userInfo" class="flex ">
462
+            <div @tap="handleShowAnnuityDetail" class="w-1/2 flex flex-col justify-center" style="padding-left: 48rpx;">
465 463
               <div class="text-xs">养老金</div>
464
+              <div>{{ userStore.yanglao.all_yanglao }}</div>
466 465
             </div>
467
-            <div @tap="handleShowMyInvitation" class="w-1/3  flex flex-col justify-center items-center">
468
-              <div>{{ agentInfo.brokerage_price}}</div>
466
+            <div @tap="handleShowMyInvitation" class="w-1/2  flex flex-col justify-center " style="padding-left: 48rpx;">
469 467
               <div class="text-xs">我的佣金</div>
470
-            </div>
471
-            <div @tap="handleShowMyIntegral" class="w-1/3  flex flex-col justify-center items-center">
472
-              <div>{{ userStore.userInfo.score }}</div>
473
-              <div class="text-xs">我的积分</div>
468
+              <div>{{ agentInfo.brokerage_price }}</div>
474 469
             </div>
475 470
           </div>
476 471
           <div v-if="userStore.userInfo" class="flex">
477
-            <div @click="handleToRedIntegral" class="w-1/2 flex flex-col justify-center items-center">
478
-              <div>{{ userStore.userInfo.member_brokerage_price}}</div>
472
+            <div @tap="handleShowMyIntegral" class="w-1/3  flex flex-col justify-center " style="padding-left: 48rpx;">
473
+              <div class="text-xs">我的积分</div>
474
+              <div>{{ userStore.userInfo.score }}</div>
475
+            </div>
476
+            <div class="icon_d"></div>
477
+            <div @click="handleToRedIntegral" class="w-1/3 flex flex-col justify-center " style="padding-left: 48rpx;">
479 478
               <div class="text-xs">红积分提现</div>
479
+              <div>{{ userStore.userInfo.member_brokerage_price }}</div>
480 480
             </div>
481
-            <div class="w-1/2 flex flex-col  justify-center items-center">
482
-              <div>{{ userStore.userInfo.team_number }}</div>
481
+            <div class="icon_d"></div>
482
+            <div class="w-1/3 flex flex-col  justify-center" style="padding-left: 48rpx;">
483 483
               <div class="text-xs">团队人数</div>
484
+              <div>{{ userStore.userInfo.team_number }}</div>
484 485
             </div>
485 486
           </div>
486 487
 
@@ -680,6 +681,13 @@ page {
680 681
   position: absolute;
681 682
   top: 447rpx
682 683
 }
684
+
685
+
686
+.icon_d {
687
+  width: 1rpx;
688
+  height: 40rpx;
689
+  background: #D8D8D8;
690
+}
683 691
 </style>
684 692
 <route lang="yaml">
685 693
 style:

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

@@ -84,7 +84,7 @@ async function handleWexinLogin() {
84 84
                 if (redirectPageObj) {
85 85
                   console.log('我存在吗333',redirectPageObj);
86 86
                   if (redirectPageObj.type === 'page') {
87
-                    return uni.redirectTo({
87
+                    return uni.reLaunch({
88 88
                       url: redirectPageObj.page
89 89
                     })
90 90
                   }

+ 237 - 0
src/pages/user/login/invite-login.vue

@@ -0,0 +1,237 @@
1
+<template>
2
+	<div v-if="showPage == true">
3
+		<div class="page_title">手机号登录</div>
4
+		<div class="flex flex-col justify-center items-center py-25">
5
+			<image src="https://test.bjtdba.com/applet/static/home/404986b1e3aeaf4b3829efa2c2ac6bf.png" mode="widthFix"
6
+				class="w-35 h-35"></image>
7
+		</div>
8
+
9
+		<nut-input v-model="state.phone" placeholder="请输入手机号" type="number">
10
+			<template #right>
11
+				<nut-button type='primary' size="small" @click="handleGetCode" :loading="state.isAuthVerify">
12
+					{{ state.buttonText }}
13
+				</nut-button>
14
+			</template>
15
+		</nut-input>
16
+		<nut-input v-model="state.code" placeholder="请输入验证码" clearable type="number">
17
+		</nut-input>
18
+
19
+		<div class="flex w-full">
20
+			<div class="p-3 w-full">
21
+				<nut-button type="primary" @click="handleLogin" block :disabled="!isFormVerify">登录</nut-button>
22
+				<!--        <div class="text-xs text-gray flex flex-col justify-center items-center p-3">-->
23
+				<!--          <div>-->
24
+				<!--            我已阅读并同意<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span-->
25
+				<!--              class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>-->
26
+				<!--          </div>-->
27
+				<!--        </div>-->
28
+
29
+			</div>
30
+
31
+		</div>
32
+
33
+	</div>
34
+</template>
35
+<script setup lang="ts">
36
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
37
+import CXBBanner from "~/components/CXBBanner/CXBBanner.vue";
38
+import { authSmsLogin, authVerify } from "~/apis/auth.api";
39
+import Cache from "~/utils/cache";
40
+import { getUserUnionId } from "~/apis/user";
41
+const userStore = useUserStore()
42
+const pageStore = usePageStoreWidthOut()
43
+const state = reactive({
44
+	phone: '',
45
+	code: '',
46
+	spread: '',
47
+	isAuthVerify: false,
48
+	buttonText: '获取验证码',
49
+})
50
+const showPage = ref(false)
51
+onLoad((options: any) => {
52
+	uni.showLoading({
53
+		title: '加载中',
54
+	});
55
+	console.log(userStore.uid);
56
+	pageStore.setPageConfig({
57
+		currentPage: {
58
+			type: 'tab',
59
+			url: '/pages/home/index'
60
+		}
61
+	})
62
+	if (userStore.uid) {
63
+		uni.hideLoading()
64
+		return uni.switchTab({
65
+			url: '/pages/home/index'
66
+		})
67
+	}
68
+	showPage.value = true
69
+	console.log(options);
70
+	uni.setNavigationBarTitle({
71
+		title: '手机登录'
72
+	})
73
+	if (options.scene) {
74
+		let queryString = decodeURIComponent(options.scene)
75
+		console.log(queryString);
76
+
77
+		// 将字符串按 '&' 分割成数组
78
+		state.spread = queryString.split('=')[1];
79
+		console.log(state.spread);
80
+	}
81
+	uni.hideLoading()
82
+})
83
+function sendCode() {
84
+	if (state.isAuthVerify) return
85
+	// if (this.disabled) return;
86
+	// this.disabled = true;
87
+	state.isAuthVerify = true
88
+	let n = 60;
89
+	state.buttonText = "剩余 " + n + "s";
90
+	const run = setInterval(() => {
91
+		n = n - 1;
92
+		if (n < 0) {
93
+			clearInterval(run);
94
+			n = 0
95
+		}
96
+		state.buttonText = "剩余 " + n + "s";
97
+		if (state.buttonText === "剩余 " + 0 + "s") {
98
+			state.isAuthVerify = false;
99
+			state.buttonText = "重新获取";
100
+		}
101
+	}, 1000);
102
+}
103
+
104
+const isFormVerify = computed(() => {
105
+	if (state.phone !== '' && state.code !== '') {
106
+		return true
107
+	}
108
+})
109
+function handleGetCode() {
110
+	if (!state.phone) {
111
+		return uni.showToast({
112
+			title: '请填写手机号码',
113
+			icon: 'none'
114
+		})
115
+	}
116
+	if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(state.phone)) {
117
+		return uni.showToast({
118
+			title: '请输入正确的手机号码',
119
+			icon: 'none'
120
+		})
121
+	}
122
+
123
+	state.isAuthVerify = true
124
+	authVerify(state.phone).then(res => {
125
+		state.isAuthVerify = false
126
+		sendCode()
127
+	}).catch(res => {
128
+	})
129
+}
130
+function handleViewXieyi(type: number) {
131
+	uni.navigateTo({
132
+		url: `/pages/user/login/user-agreement?type=${type}`
133
+	})
134
+}
135
+
136
+function handleLogin() {
137
+	uni.showLoading({
138
+		title: '登录中'
139
+	});
140
+	const shareId = Cache.get('SHARE_ID')
141
+	// uni.login({
142
+	//   provider: 'weixin',
143
+	//   univerifyStyle: {
144
+	//     fullScreen: true
145
+	//   },
146
+	//   success: result => {
147
+	//     // console.log(result)
148
+	//     getUserUnionId({
149
+	//       code: result.code,
150
+	//       source: 'cxb'
151
+	//     }).then(unionRes => {
152
+	//       console.log(111111, unionRes)
153
+	//       // const shareId = Cache.get('SHARE_ID')
154
+	//       //存储openid
155
+	//       userStore.setOpenid(unionRes.openid)
156
+	//     })
157
+	//   }
158
+	// })
159
+	let params = {
160
+		phone: state.phone,
161
+		sms_code: state.code,
162
+		// share_id:
163
+	}
164
+	if (shareId && shareId !== '') {
165
+		params.share_id = shareId
166
+	}
167
+	if (state.spread && state.spread !== '' && state.spread != '0') {
168
+		params.spread = state.spread
169
+	}
170
+	authSmsLogin({
171
+		...params
172
+	}).then(authRes => {
173
+		console.log(111111, authRes)
174
+		userStore.login(authRes.token, authRes.exp)
175
+		userStore.setUID(authRes.user.uid)
176
+		userStore.setUserInfo(authRes.user)
177
+		uni.hideLoading();
178
+		uni.showToast({
179
+			title: '登录成功',
180
+			icon: 'none'
181
+		})
182
+		Cache.clear('SHARE_ID')
183
+		state.isAuthVerify = false
184
+		let redirectPageObj: { page: string, type: 'page' | 'tab' }
185
+		if (Cache.get('SHARE_REDIRECT_PAGE')) {
186
+			redirectPageObj = JSON.parse(Cache.get('SHARE_REDIRECT_PAGE'))
187
+		}
188
+		setTimeout(() => {
189
+			if (redirectPageObj) {
190
+				if (redirectPageObj.type === 'page') {
191
+					return uni.redirectTo({
192
+						url: redirectPageObj.page
193
+					})
194
+				}
195
+				if (redirectPageObj.type === 'tab') {
196
+					return uni.switchTab({
197
+						url: redirectPageObj.page
198
+					})
199
+				}
200
+			} else {
201
+				uni.switchTab({
202
+					url: '/pages/home/index'
203
+				})
204
+			}
205
+		}, 200)
206
+
207
+
208
+	}).catch((errorMsg) => {
209
+		console.log(errorMsg)
210
+		uni.showToast({
211
+			title: errorMsg,
212
+			icon: 'none'
213
+		})
214
+	})
215
+}
216
+</script>
217
+  
218
+<route lang="yaml">
219
+style:
220
+  navigationBarTitleText: 手机号登录
221
+  navigationStyle: custom
222
+  enablePullDownRefresh: false
223
+</route>
224
+  
225
+<style>
226
+page {
227
+	background: #f8f8f8;
228
+}
229
+
230
+.page_title {
231
+	width: 182rpx;
232
+	height: 48rpx;
233
+	position: absolute;
234
+	top: 20%;
235
+	left: 284rpx;
236
+}
237
+</style>

+ 42 - 5
src/pages/user/login/other-phone.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div>
2
+  <div v-if="showPage == true">
3 3
     <CXBBanner />
4 4
 
5 5
     <nut-input v-model="state.phone" placeholder="请输入手机号" type="number">
@@ -35,15 +35,49 @@ import { authSmsLogin, authVerify } from "~/apis/auth.api";
35 35
 import Cache from "~/utils/cache";
36 36
 import { getUserUnionId } from "~/apis/user";
37 37
 const userStore = useUserStore()
38
-
38
+const pageStore = usePageStoreWidthOut()
39 39
 const state = reactive({
40 40
   phone: '',
41 41
   code: '',
42
-
42
+  spread: '',
43 43
   isAuthVerify: false,
44 44
   buttonText: '获取验证码',
45 45
 })
46
+const showPage = ref(false)
47
+onLoad((options: any) => {
48
+  uni.showLoading({
49
+    title: '加载中',
50
+  });
51
+
52
+  console.log(userStore.uid);
53
+
54
+  if (userStore.uid) {
55
+    pageStore.setPageConfig({
56
+      currentPage: {
57
+        type: 'tab',
58
+        url: '/pages/home/index'
59
+      }
60
+    })
61
+    uni.hideLoading()
62
+    return uni.switchTab({
63
+      url: '/pages/home/index'
64
+    })
65
+  }
66
+  showPage.value = true
67
+  console.log(options);
68
+  uni.setNavigationBarTitle({
69
+    title: '手机登录'
70
+  })
71
+  if (options.scene) {
72
+    let queryString = decodeURIComponent(options.scene)
73
+    console.log(queryString);
46 74
 
75
+    // 将字符串按 '&' 分割成数组
76
+    state.spread = queryString.split('=')[1];
77
+    console.log(state.spread);
78
+  }
79
+  uni.hideLoading()
80
+})
47 81
 function sendCode() {
48 82
   if (state.isAuthVerify) return
49 83
   // if (this.disabled) return;
@@ -128,6 +162,9 @@ function handleLogin() {
128 162
   if (shareId && shareId !== '') {
129 163
     params.share_id = shareId
130 164
   }
165
+  if (state.spread && state.spread !== '' && state.spread != '0') {
166
+    params.spread = state.spread
167
+  }
131 168
   authSmsLogin({
132 169
     ...params
133 170
   }).then(authRes => {
@@ -149,7 +186,7 @@ function handleLogin() {
149 186
     setTimeout(() => {
150 187
       if (redirectPageObj) {
151 188
         if (redirectPageObj.type === 'page') {
152
-          return uni.redirectTo({
189
+          return uni.reLaunch({
153 190
             url: redirectPageObj.page
154 191
           })
155 192
         }
@@ -178,7 +215,7 @@ function handleLogin() {
178 215
 
179 216
 <route lang="yaml">
180 217
 style:
181
-  navigationBarTitleText: 手机登录
218
+  navigationBarTitleText: 储蓄保
182 219
 </route>
183 220
 
184 221
 <style>

+ 239 - 2
src/pages/user/login/register-agreement.vue

@@ -1,2 +1,239 @@
1
-<script lang="ts" setup></script>
2
-<template></template>
1
+<template>
2
+	<div v-if="showPage == true">
3
+		<div class="page_title">手机号登录</div>
4
+		<div class="flex flex-col justify-center items-center py-25">
5
+			<image src="https://test.bjtdba.com/applet/static/home/404986b1e3aeaf4b3829efa2c2ac6bf.png" mode="widthFix"
6
+				class="w-35 h-35"></image>
7
+		</div>
8
+
9
+		<nut-input v-model="state.phone" placeholder="请输入手机号" type="number">
10
+			<template #right>
11
+				<nut-button type='primary' size="small" @click="handleGetCode" :loading="state.isAuthVerify">
12
+					{{ state.buttonText }}
13
+				</nut-button>
14
+			</template>
15
+		</nut-input>
16
+		<nut-input v-model="state.code" placeholder="请输入验证码" clearable type="number">
17
+		</nut-input>
18
+
19
+		<div class="flex w-full">
20
+			<div class="p-3 w-full">
21
+				<nut-button type="primary" @click="handleLogin" block :disabled="!isFormVerify">登录</nut-button>
22
+				<!--        <div class="text-xs text-gray flex flex-col justify-center items-center p-3">-->
23
+				<!--          <div>-->
24
+				<!--            我已阅读并同意<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span-->
25
+				<!--              class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>-->
26
+				<!--          </div>-->
27
+				<!--        </div>-->
28
+
29
+			</div>
30
+
31
+		</div>
32
+
33
+	</div>
34
+</template>
35
+<script setup lang="ts">
36
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
37
+import CXBBanner from "~/components/CXBBanner/CXBBanner.vue";
38
+import { authSmsLogin, authVerify } from "~/apis/auth.api";
39
+import Cache from "~/utils/cache";
40
+import { getUserUnionId } from "~/apis/user";
41
+const userStore = useUserStore()
42
+const pageStore = usePageStoreWidthOut()
43
+const state = reactive({
44
+	phone: '',
45
+	code: '',
46
+	spread: '',
47
+	isAuthVerify: false,
48
+	buttonText: '获取验证码',
49
+})
50
+const showPage = ref(false)
51
+onLoad((options: any) => {
52
+	uni.showLoading({
53
+		title: '加载中',
54
+	});
55
+	console.log(userStore.uid);
56
+	pageStore.setPageConfig({
57
+		currentPage: {
58
+			type: 'tab',
59
+			url: '/pages/home/index'
60
+		}
61
+	})
62
+	if (userStore.uid) {
63
+		uni.hideLoading()
64
+		return uni.switchTab({
65
+			url: '/pages/home/index'
66
+		})
67
+	}
68
+	showPage.value = true
69
+	console.log(options);
70
+	uni.setNavigationBarTitle({
71
+		title: '手机登录'
72
+	})
73
+	if (options.scene) {
74
+		let queryString = decodeURIComponent(options.scene)
75
+		console.log(queryString);
76
+
77
+		// 将字符串按 '&' 分割成数组
78
+		state.spread = queryString.split('=')[1];
79
+		console.log(state.spread);
80
+	}
81
+	uni.hideLoading()
82
+})
83
+function sendCode() {
84
+	if (state.isAuthVerify) return
85
+	// if (this.disabled) return;
86
+	// this.disabled = true;
87
+	state.isAuthVerify = true
88
+	let n = 60;
89
+	state.buttonText = "剩余 " + n + "s";
90
+	const run = setInterval(() => {
91
+		n = n - 1;
92
+		if (n < 0) {
93
+			clearInterval(run);
94
+			n = 0
95
+		}
96
+		state.buttonText = "剩余 " + n + "s";
97
+		if (state.buttonText === "剩余 " + 0 + "s") {
98
+			state.isAuthVerify = false;
99
+			state.buttonText = "重新获取";
100
+		}
101
+	}, 1000);
102
+}
103
+
104
+const isFormVerify = computed(() => {
105
+	if (state.phone !== '' && state.code !== '') {
106
+		return true
107
+	}
108
+})
109
+function handleGetCode() {
110
+	if (!state.phone) {
111
+		return uni.showToast({
112
+			title: '请填写手机号码',
113
+			icon: 'none'
114
+		})
115
+	}
116
+	if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(state.phone)) {
117
+		return uni.showToast({
118
+			title: '请输入正确的手机号码',
119
+			icon: 'none'
120
+		})
121
+	}
122
+
123
+	state.isAuthVerify = true
124
+	authVerify(state.phone).then(res => {
125
+		state.isAuthVerify = false
126
+		sendCode()
127
+	}).catch(res => {
128
+	})
129
+}
130
+function handleViewXieyi(type: number) {
131
+	uni.navigateTo({
132
+		url: `/pages/user/login/user-agreement?type=${type}`
133
+	})
134
+}
135
+
136
+function handleLogin() {
137
+	uni.showLoading({
138
+		title: '登录中'
139
+	});
140
+	const shareId = Cache.get('SHARE_ID')
141
+	// uni.login({
142
+	//   provider: 'weixin',
143
+	//   univerifyStyle: {
144
+	//     fullScreen: true
145
+	//   },
146
+	//   success: result => {
147
+	//     // console.log(result)
148
+	//     getUserUnionId({
149
+	//       code: result.code,
150
+	//       source: 'cxb'
151
+	//     }).then(unionRes => {
152
+	//       console.log(111111, unionRes)
153
+	//       // const shareId = Cache.get('SHARE_ID')
154
+	//       //存储openid
155
+	//       userStore.setOpenid(unionRes.openid)
156
+	//     })
157
+	//   }
158
+	// })
159
+	let params = {
160
+		phone: state.phone,
161
+		sms_code: state.code,
162
+		// share_id:
163
+	}
164
+	if (shareId && shareId !== '') {
165
+		params.share_id = shareId
166
+	}
167
+	if (state.spread && state.spread !== '' && state.spread != '0') {
168
+		params.spread = state.spread
169
+	}
170
+	authSmsLogin({
171
+		...params
172
+	}).then(authRes => {
173
+		console.log(111111, authRes)
174
+		userStore.login(authRes.token, authRes.exp)
175
+		userStore.setUID(authRes.user.uid)
176
+		userStore.setUserInfo(authRes.user)
177
+		uni.hideLoading();
178
+		uni.showToast({
179
+			title: '登录成功',
180
+			icon: 'none'
181
+		})
182
+		Cache.clear('SHARE_ID')
183
+		state.isAuthVerify = false
184
+		let redirectPageObj: { page: string, type: 'page' | 'tab' }
185
+		if (Cache.get('SHARE_REDIRECT_PAGE')) {
186
+			redirectPageObj = JSON.parse(Cache.get('SHARE_REDIRECT_PAGE'))
187
+		}
188
+		setTimeout(() => {
189
+			if (redirectPageObj) {
190
+				if (redirectPageObj.type === 'page') {
191
+					return uni.redirectTo({
192
+						url: redirectPageObj.page
193
+					})
194
+				}
195
+				if (redirectPageObj.type === 'tab') {
196
+					return uni.switchTab({
197
+						url: redirectPageObj.page
198
+					})
199
+				}
200
+			} else {
201
+				uni.switchTab({
202
+					url: '/pages/home/index'
203
+				})
204
+			}
205
+		}, 200)
206
+
207
+
208
+	}).catch((errorMsg) => {
209
+		console.log(errorMsg)
210
+		uni.showToast({
211
+			title: errorMsg,
212
+			icon: 'none'
213
+		})
214
+	})
215
+}
216
+</script>
217
+  
218
+<route lang="yaml">
219
+style:
220
+  navigationBarTitleText: 手机号登录
221
+  navigationStyle: custom
222
+  enablePullDownRefresh: false
223
+</route>
224
+  
225
+<style>
226
+page {
227
+	background: #f8f8f8;
228
+}
229
+
230
+.page_title {
231
+	width: 180rpx;
232
+	height: 48rpx;
233
+	position: absolute;
234
+	margin-top: 110rpx;
235
+	left: 50%;
236
+    text-align: center;
237
+    margin-left: -90rpx;
238
+}
239
+</style>

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

@@ -43,7 +43,7 @@
43 43
       <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
44 44
         <div v-for="(item, index) in list" :key="index" @click="handleItemClick(item)">
45 45
           <div class="bg-white rounded-lg">
46
-            <image :src="item.image" mode="widthFix" :fade-in="true" class="rounded-t-lg  !w-full aspect-square"></image>
46
+            <image :src="item.image" style="width: 340rpx; height: 340rpx; " :fade-in="true" class="rounded-t-lg aspect-square"></image>
47 47
 
48 48
             <div class="text-sm p-2 flex flex-col gap-1">
49 49
               <div class="line-clamp-1">

BIN
src/static/icon/ckgd.png


BIN
src/static/icon/guanbi.png


BIN
src/static/icon/search_ck.png


BIN
src/static/icon/title_1.png


BIN
src/static/icon/复制.png


BIN
src/static/icon/展开.png


BIN
src/static/icon/快递.png


BIN
src/static/icon/扫码.png


BIN
src/static/icon/收起.png


BIN
src/static/icon/联系商家.png


BIN
src/static/tabbar/search.png


+ 2 - 0
src/stores/userStore.ts

@@ -57,6 +57,8 @@ export const useUserStore = defineStore('userStore', {
57 57
         async getUserInfo() {
58 58
             try {
59 59
                 this.userInfo = await getUserInfo();
60
+                console.log(this.userInfo);
61
+                
60 62
 
61 63
             } catch (error) {
62 64
                 uni.navigateTo({

+ 1 - 1
src/utils/http/index.ts

@@ -10,7 +10,7 @@ function createRequest(options?: any) {
10 10
     return new VRequest(deepMerge(
11 11
         {
12 12
             url: '',
13
-            timeout: 5 * 1000,
13
+            timeout: 20 * 1000,
14 14
             authenticationScheme: 'Bearer',
15 15
             authenticationHeader: 'X-Token',
16 16
             // authenticationHeader: 'Authorization',