Basil лет назад: 3
Родитель
Сommit
fef92f9bfb
83 измененных файлов с 4136 добавлено и 934 удалено
  1. 7 1
      src/apis/auth.api.ts
  2. 2 0
      src/apis/common.ts
  3. 6 0
      src/apis/dacang.ts
  4. 19 2
      src/apis/user.ts
  5. 0 4
      src/components/CXBAuthorize/CXBAuthorize.vue
  6. 32 8
      src/components/CXBDialogSignIn/CXBDialogSIgnIn.vue
  7. 47 13
      src/components/CXBDialogSignIn/SignRedPacket.vue
  8. 10 3
      src/components/CXBDyLive/CXBDyLiveRecommend.vue
  9. 6 0
      src/components/CXBEmpty/CXBEmpty.vue
  10. 34 32
      src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue
  11. 1 1
      src/components/CXBSkuPopup/CXBSkuPopup.vue
  12. 3 3
      src/components/FSearch/FSearch.vue
  13. 4 4
      src/libs/login.ts
  14. 1 1
      src/pages.json
  15. 8 1
      src/pages/account-cancel/index.vue
  16. 24 10
      src/pages/accumulate-income/index.vue
  17. 1 1
      src/pages/annuity/index.vue
  18. 38 10
      src/pages/dacang/list/components/dacang-header.vue
  19. 41 86
      src/pages/dacang/list/index.vue
  20. 403 0
      src/pages/dacang/test.json
  21. 8 2
      src/pages/guest_member_new/index.vue
  22. 11 3
      src/pages/home/components/banner.vue
  23. 40 22
      src/pages/home/components/header.vue
  24. 1 1
      src/pages/home/components/navs.vue
  25. 16 1
      src/pages/home/index.vue
  26. 74 33
      src/pages/immediate-withdrawal/index.vue
  27. 67 13
      src/pages/invite-friends/index.vue
  28. 27 10
      src/pages/invite-partners/index.vue
  29. 16 0
      src/pages/message/index.vue
  30. 64 11
      src/pages/miaosha/index.vue
  31. 18 12
      src/pages/my-integral/index.vue
  32. 34 15
      src/pages/my-integral/user-invation.vue
  33. 4 1
      src/pages/my-invitation/index.vue
  34. 44 17
      src/pages/my-relation-merchant/index.vue
  35. 19 12
      src/pages/order-confirm/index.vue
  36. 5 2
      src/pages/order/comment.vue
  37. 1 1
      src/pages/order/components/AllItemList.vue
  38. 1 1
      src/pages/order/components/ObligationOrderList.vue
  39. 1 1
      src/pages/order/components/Order2List.vue
  40. 1 1
      src/pages/order/components/Order3List.vue
  41. 7 7
      src/pages/order/components/Order4List.vue
  42. 10 5
      src/pages/order/components/OrderItem.vue
  43. 8 3
      src/pages/order/components/OrderObligationItem.vue
  44. 81 27
      src/pages/order/detail.vue
  45. 45 6
      src/pages/order/index.vue
  46. 39 22
      src/pages/order/obligation-detail.vue
  47. 125 176
      src/pages/order/test.json
  48. 642 0
      src/pages/order_addcart/index-bak.vue
  49. 102 160
      src/pages/order_addcart/index.vue
  50. 71 1
      src/pages/payment/index.vue
  51. 7 6
      src/pages/pension_record/detail.vue
  52. 1 1
      src/pages/pension_record/index.vue
  53. 78 19
      src/pages/product/integral.vue
  54. 2 4
      src/pages/product/zibuyangsheng.vue
  55. 3 2
      src/pages/real-name-authentication/index.vue
  56. 2 2
      src/pages/red-integral/index.vue
  57. 1 1
      src/pages/refund/option.vue
  58. 3 0
      src/pages/revenue-sharing/index.vue
  59. 655 0
      src/pages/search/index-bak.vue
  60. 151 47
      src/pages/search/index.vue
  61. 35 22
      src/pages/share-the-product/index.vue
  62. 6 0
      src/pages/store/home/index.vue
  63. 50 27
      src/pages/store/home/search.vue
  64. 321 0
      src/pages/store/nearby/index-bak.vue
  65. 51 20
      src/pages/store/nearby/index.vue
  66. 132 0
      src/pages/store/product/detail.json
  67. 64 12
      src/pages/store/product/detail.vue
  68. 45 9
      src/pages/store/product/other.vue
  69. 74 0
      src/pages/store/product/test.json
  70. 97 5
      src/pages/third_party_binding/index.vue
  71. 6 2
      src/pages/user/address/index.vue
  72. 5 1
      src/pages/user/index.vue
  73. 47 2
      src/pages/user/login/index.vue
  74. 8 3
      src/pages/user/login/other-phone.vue
  75. 2 0
      src/pages/withdrawal-record/index.vue
  76. BIN
      src/static/icon/message-dark.png
  77. BIN
      src/static/icon/message.png
  78. BIN
      src/static/icon/playing.gif
  79. BIN
      src/static/mine_following_mark.png
  80. 5 1
      src/stores/dacangStore.ts
  81. 14 0
      src/stores/page.ts
  82. 1 1
      src/utils/product-page.ts
  83. 1 1
      theme.ts

+ 7 - 1
src/apis/auth.api.ts

@@ -23,9 +23,15 @@ enum API {
23 23
 }
24 24
 
25 25
 
26
-export function getUpdateAccount(): Promise<{wechat_user_id: string, ali_user_id: string}> {
26
+/**
27
+ * 更新绑定微信或支付宝账号
28
+ */
29
+export function getUpdateAccount(params: { type: string, openid: string, nickname: string, avatar: string }): Promise<{wechat_user_id: string, ali_user_id: string}> {
27 30
     return defHttp.post({
28 31
         url: API.USER_UPDATE_ACCOUNT,
32
+        data: {
33
+            ...params
34
+        }
29 35
     })
30 36
 }
31 37
 /**

+ 2 - 0
src/apis/common.ts

@@ -81,6 +81,8 @@ export function closeAccount(phone: string) {
81 81
         data: {
82 82
             phone
83 83
         }
84
+    }, {
85
+        withToken: false
84 86
     })
85 87
 }
86 88
 

+ 6 - 0
src/apis/dacang.ts

@@ -14,6 +14,7 @@ enum API {
14 14
 	DC_HOME_MERCHANT = '/api/dacang/nologin/dc_home_merchant',
15 15
 	// 大仓秒杀商品
16 16
 	DC_SECKILL = '/api/dacang/nologin/seckill',
17
+	DC_SECKILL_INDEX_TIME ='/api/store/product/seckill/select',
17 18
 	// 大仓商品列表
18 19
 	DC_PRODUCT_LIST = '/api/dacang/nologin/da_cang_product_lst',
19 20
 	// 大仓会员商品
@@ -29,6 +30,11 @@ enum API {
29 30
 }
30 31
 
31 32
 
33
+export function getSeckillIndexTime() {
34
+	return defHttp.get({
35
+		url: API.DC_SECKILL_INDEX_TIME
36
+	})
37
+}
32 38
 /**
33 39
  * 大仓 banner 列表
34 40
  */

+ 19 - 2
src/apis/user.ts

@@ -57,7 +57,7 @@ enum API {
57 57
     GET_USER_UNION_ID = '/api/userMp/getUserUnionid',
58 58
     WECHAT_CHECK = '/api/wechat/check',
59 59
     AUTH_APPLET_PHONE = '/api/auth/applet_phone',
60
-    BIND_PHONE = '/api/thrid/binding',
60
+    BIND_PHONE = '/api/third/binding',
61 61
     AUTH_MP = '/api/auth/mp',
62 62
 
63 63
     // 提现服务费计算
@@ -169,10 +169,24 @@ enum API {
169 169
     SPREAD_IMAGE = '/api/user/spread_image?type=wechat'
170 170
 }
171 171
 
172
+/**
173
+ * 生成用户图片
174
+ * @param params
175
+ */
176
+export function getGenerateImage(params: {uid: string, img_id: string}) {
177
+    return defHttp.post({
178
+        url: API.POSTER_SERVICE_IMAGES,
179
+        data: {
180
+            ...params
181
+        }
182
+    }, {
183
+        withToken: false
184
+    })
185
+}
172 186
 export function getSpreadImage() {
173 187
     return defHttp.get({
188
+        timeout: 50 * 1000,
174 189
         url: API.SPREAD_IMAGE,
175
-
176 190
     })
177 191
 }
178 192
 /**
@@ -802,6 +816,9 @@ export function bindPhone(params: {
802 816
 }) {
803 817
     return defHttp.get({
804 818
         url: API.BIND_PHONE,
819
+        data: {
820
+            ...params
821
+        }
805 822
     })
806 823
 }
807 824
 

+ 0 - 4
src/components/CXBAuthorize/CXBAuthorize.vue

@@ -83,10 +83,6 @@ const setUserInfo = () => {
83 83
   //   title: '正在登录中'
84 84
   // })
85 85
   Routine.getCode().then( (code: string) => {
86
-    // uni.navigateTo({
87
-    //   url: '/pages/users/login/index?key=3'
88
-    // })
89
-    // console.log(code)
90 86
     getUserInfo(code)
91 87
   }).catch( res => {
92 88
     uni.hideLoading()

+ 32 - 8
src/components/CXBDialogSignIn/CXBDialogSIgnIn.vue

@@ -92,7 +92,7 @@ function getScoreText(day: number) {
92 92
 }
93 93
 
94 94
 const signInFor = computed(() => {
95
-  if (props.today === 0) {
95
+  if (props.today == 0) {
96 96
     return getScoreText(props.day)
97 97
   }
98 98
 })
@@ -101,7 +101,10 @@ function closeHandler(evt: MouseEvent) {
101 101
   show.value = false
102 102
   emit(CLOSE_EVENT, evt)
103 103
 }
104
-function confirmHandler() {
104
+function confirmHandler(evt) {
105
+  show.value = false
106
+  emit(CLOSE_EVENT, evt)
107
+
105 108
   // 执行签到
106 109
   getNewSignIn().then(res => {
107 110
     // res.score
@@ -127,12 +130,25 @@ function handleSignInSucceedClose() {
127 130
              class="absolute "
128 131
       ></image>
129 132
       <div class="flex flex-col justify-around items-center relative top-10 gap-3 ">
130
-        <div class="flex gap-4 mb-4 ">
131
-          <SignRedPacket
132
-              v-for="item in 6"
133
-              :key="item"
134
-              :day="item"
135
-          />
133
+        <div class="flex gap-2 justify-center items-center mb-4 " v-if="props.day <=6 ">
134
+          <template v-if="props.day > 0">
135
+
136
+            <SignRedPacket
137
+                v-for="item in props.day"
138
+                :key="item"
139
+                :day="item"
140
+                :text="'已签'"
141
+            />
142
+
143
+          </template>
144
+          <template v-if="(6 - props.day) > 0">
145
+
146
+            <SignRedPacket
147
+                v-for="item in (6 - props.day)"
148
+                :key="item"
149
+                :day="item + props.day"
150
+            />
151
+          </template>
136 152
         </div>
137 153
         <div class=" px-4 flex mb-4 ">
138 154
           <div class="flex gap-3 ">
@@ -145,6 +161,7 @@ function handleSignInSucceedClose() {
145 161
         </div>
146 162
 
147 163
         <div
164
+            v-if="props.today == 0"
148 165
             @click.stop="confirmHandler"
149 166
             class="relative h-13 flex justify-center items-center">
150 167
           <image :src="signInBtnImage" mode="widthFix"
@@ -154,6 +171,13 @@ function handleSignInSucceedClose() {
154 171
             <div class="text-[#ffe980]">{{ signInFor }}</div>
155 172
           </div>
156 173
         </div>
174
+        <div v-else
175
+             class="relative h-10 flex justify-center items-center rounded-full bg-gray-400">
176
+          <div class=" flex w-full text-white px-3">
177
+            明日再来签到吧
178
+          </div>
179
+
180
+        </div>
157 181
       </div>
158 182
     </div>
159 183
     <div

+ 47 - 13
src/components/CXBDialogSignIn/SignRedPacket.vue

@@ -1,26 +1,60 @@
1 1
 <script setup lang="ts">
2 2
 import {CDN_URL} from "~/config/app";
3 3
 
4
-const signInRedPacketImage = CDN_URL + '/static/assets/sign_in_red_packet.png'
4
+const signInRedPacketImage = CDN_URL + 'https://cdn.bjtdba.com/chuxubao/static/assets/sign_in_red_packet.png'
5 5
 const props = defineProps({
6 6
   day: {
7 7
     type: Number,
8 8
     required: true
9
+  },
10
+  text: {
11
+    type: String,
12
+  }
13
+})
14
+
15
+const getScore =computed(() => {
16
+  if (props.day == 1) {
17
+    return '+2'
18
+  } else if (props.day == 2) {
19
+    return '+4'
20
+  } else if (props.day == 3) {
21
+    return '+6'
22
+  } else if (props.day == 4) {
23
+    return '+10'
24
+  } else if (props.day == 5) {
25
+    return '+14'
26
+  } else if (props.day == 6) {
27
+    return '+20'
9 28
   }
10 29
 })
11 30
 </script>
12 31
 <template>
13
-  <div class="flex ">
14
-    <div class="flex flex-col gap-1">
15
-      <div class="relative flex flex-col h-13 w-full justify-end items-center text-white text-xs">
16
-        <image :src="signInRedPacketImage"
17
-               mode="widthFix"
18
-               class="absolute w-9 h-10"
19
-        ></image>
20
-        <div class="relative text-[11px] mb-1">+2</div>
32
+   <div class=" flex flex-col   items-center  text-xs gap-2" >
33
+        <div class=" flex flex-col items-center justify-end "
34
+             :class="text ? 'activeBg' : 'defaultBg'"
35
+        >
36
+          <div class="text-[11px] text-white mb-1">{{ getScore }}</div>
37
+        </div>
38
+        <div>
39
+          <div class="relative text-[10px]" v-if="text"> {{ text}} </div>
40
+          <div class="relative text-[10px]" v-else> 第 {{ props.day }} 天</div>
41
+        </div>
42
+
21 43
       </div>
22
-      <div class="relative text-[10px]">第 {{ props.day }} 天</div>
23
-    </div>
24
-  </div>
25 44
 
26
-</template>
45
+</template>
46
+
47
+<style>
48
+.defaultBg {
49
+  width: 80rpx;
50
+  height: 116rpx;
51
+  background-image: url('https://cdn.bjtdba.com/chuxubao/static/assets/sign_in_red_packet.png');
52
+  background-size: 100% 100%;
53
+}
54
+.activeBg {
55
+  width: 80rpx;
56
+  height: 116rpx;
57
+  background-image: url('https://cdn.bjtdba.com/chuxubao/static/assets/hb_yiqiandao_220908.png');
58
+  background-size: 100% 100%;
59
+}
60
+</style>

+ 10 - 3
src/components/CXBDyLive/CXBDyLiveRecommend.vue

@@ -35,10 +35,17 @@ function handleItemClick(item: DyLiveModel) {
35 35
     >
36 36
       <div v-for="(item,index) in list" :key="index"
37 37
            @tap="handleItemClick(item)"
38
-           class="flex inline-flex pl-2 items-center justify-center relative"
38
+           class="flex inline-flex pl-2 items-center justify-center"
39 39
       >
40
-          <image :src="item.authorPic" mode="widthFix" class="w-20 h-20 rounded"></image>
41
-      </div>
40
+        <div class=" relative">
41
+          <div class="bg-primary absolute top-0 left-0 w-6 h-6  rounded-br-md rounded-tl-md flex flex-col justify-center items-center">
42
+            <image src="/static/icon/playing.gif" mode="widthFIx" class="w-3 h-3"></image>
43
+
44
+          </div>
45
+          <image :src="item.authorPic" mode="widthFix" class="w-20 h-20 rounded  border border-solid border-1px border-primary"></image>
46
+        </div>
47
+        </div>
48
+
42 49
     </scroll-view>
43 50
   </div>
44 51
 </template>

+ 6 - 0
src/components/CXBEmpty/CXBEmpty.vue

@@ -3,6 +3,9 @@ import {CDN_URL} from "~/config/app";
3 3
 
4 4
 const searchEmptyImg = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
5 5
 const addressEmptyImg = CDN_URL + '/static/assets/no_address_bg_220624.png'
6
+
7
+const messageEmptyImg = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
8
+
6 9
 // search
7 10
 const props = defineProps({
8 11
   type: {
@@ -24,6 +27,9 @@ const emptyImage = computed(() => {
24 27
     case 'address': {
25 28
       return addressEmptyImg
26 29
     }
30
+    case 'message': {
31
+      return messageEmptyImg
32
+    }
27 33
   }
28 34
 })
29 35
 </script>

+ 34 - 32
src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue

@@ -44,40 +44,42 @@ function getPhoneNumber(e) {
44 44
             }).then(bindRes => {
45 45
               console.log('已绑定手机')
46 46
               console.log(bindRes)
47
+
48
+              // 跳转
49
+              switch (props.key) {
50
+                case '10':
51
+                  uni.switchTab({
52
+                    url: '/pages/user/index'
53
+                  })
54
+                  break;
55
+                case '4':
56
+                  uni.navigateBack({
57
+                    delta: 2
58
+                  })
59
+                  break;
60
+                case '1':
61
+                  uni.switchTab({
62
+                    url: '/pages/order_addcart/index'
63
+                  })
64
+                  break;
65
+                case undefined:
66
+                  uni.switchTab({
67
+                    url: '/pages/user/index'
68
+                  })
69
+                  break;
70
+                case '30':
71
+                  uni.switchTab({
72
+                    url: '/pages/home/index'
73
+                  })
74
+                  break;
75
+                default:
76
+                  uni.switchTab({
77
+                    url: '/pages/home/index'
78
+                  })
79
+              }
47 80
             })
48 81
 
49
-            // 跳转
50
-            switch (props.key) {
51
-              case '10':
52
-                uni.switchTab({
53
-                  url: '/pages/user/index'
54
-                })
55
-                break;
56
-              case '4':
57
-                uni.navigateBack({
58
-                  delta: 2
59
-                })
60
-                break;
61
-              case '1':
62
-                uni.switchTab({
63
-                  url: '/pages/order_addcart/index'
64
-                })
65
-                break;
66
-              case undefined:
67
-                uni.switchTab({
68
-                  url: '/pages/user/index'
69
-                })
70
-                    break;
71
-              case '30':
72
-                uni.switchTab({
73
-                  url: '/pages/home/index'
74
-                })
75
-                    break;
76
-              default:
77
-                uni.switchTab({
78
-                  url: '/pages/home/index'
79
-                })
80
-            }
82
+
81 83
             // console.log(authRes)
82 84
             // authRes.token
83 85
           })

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

@@ -176,7 +176,7 @@ function handleCountChange(value) {
176 176
         </div>
177 177
       </div>
178 178
 
179
-      <div class="px-3 ">
179
+      <div class="px-3 pb-10">
180 180
         <FButton
181 181
             @click="handleAddCart"
182 182
             size="small"

+ 3 - 3
src/components/FSearch/FSearch.vue

@@ -32,18 +32,18 @@ function handleClick() {
32 32
       <div
33 33
           @click="handleClick"
34 34
 
35
-          class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red"
35
+          class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red h-8"
36 36
 
37 37
       >
38 38
 
39 39
           <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png"
40 40
                  mode="widthFix"
41
-                 class="w-4 h-4  pl-2 py-1"
41
+                 class="w-5 h-5  pl-2 py-1"
42 42
           ></image>
43 43
         <div class="flex flex-1 w-100%">
44 44
           <div class="flex-1"></div>
45 45
           <div
46
-              class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center py-1 my-0.5 mr-0.5 "
46
+              class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center p-1.5  mr-0.5 "
47 47
           >
48 48
             搜索
49 49
           </div>

+ 4 - 4
src/libs/login.ts

@@ -32,7 +32,7 @@ export function easyToLogin(push, pathLogin) {
32 32
 		
33 33
 		
34 34
 	if(!pathLogin)
35
-		pathLogin = '/pages/users/login/index'
35
+		pathLogin = '/pages/user/login/index'
36 36
 	Cache.set('login_back_url',path);
37 37
 	// #ifdef H5 || APP-PLUS
38 38
 	// if (isWeixin()) {
@@ -40,9 +40,9 @@ export function easyToLogin(push, pathLogin) {
40 40
 	// } else {
41 41
 		if (path !== pathLogin) {
42 42
 		 push ? uni.navigateTo({
43
-		 	url:'/pages/users/login/index'
43
+		 	url:'/pages/user/login/index'
44 44
 		 }) : uni.navigateTo({
45
-		 	url: '/pages/users/login/index'
45
+		 	url: '/pages/user/login/index'
46 46
 		 });
47 47
 		}
48 48
 	//}
@@ -70,7 +70,7 @@ export function toLogin(push, pathLogin) {
70 70
 		// #endif
71 71
 		
72 72
 	if(!pathLogin)
73
-		pathLogin = '/pages/users/login/index'
73
+		pathLogin = '/pages/user/login/index'
74 74
 	Cache.set('login_back_url',path);
75 75
 	// #ifdef H5 || APP-PLUS
76 76
 	// if (isWeixin()) {

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
src/pages.json


+ 8 - 1
src/pages/account-cancel/index.vue

@@ -19,7 +19,14 @@ function handleCancel() {
19 19
 
20 20
 function onOk() {
21 21
   closeAccount(userStore.userInfo.phone).then(res => {
22
-    reLogin()
22
+    uni.showToast({
23
+      title: '注销成功',
24
+      icon: 'none'
25
+    }).then(() => {
26
+      setTimeout(() => {
27
+        reLogin()
28
+      }, 500)
29
+    })
23 30
   })
24 31
 }
25 32
 </script>

+ 24 - 10
src/pages/accumulate-income/index.vue

@@ -3,6 +3,7 @@ import {getUserInviteProfitList} from "~/apis/user";
3 3
 import {useUserStore} from "~/stores/userStore";
4 4
 import type {AccumulateIncomeModel} from "~/apis/model/accumulateIncomeModel";
5 5
 import {Ref} from "vue";
6
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6 7
 const userStore = useUserStore()
7 8
 const accumulateIncome: Ref<AccumulateIncomeModel | undefined> = ref<AccumulateIncomeModel>()
8 9
 const state = reactive({
@@ -22,8 +23,11 @@ const state = reactive({
22 23
     // title: '分享收益',
23 24
     // createTime: '202020'
24 25
   }],
25
-})
26
+  scrollHeight: 0,
26 27
 
28
+})
29
+const {windowHeight} = uni.getSystemInfoSync()
30
+state.scrollHeight = windowHeight - 320
27 31
 onLoad((option: any) => {
28 32
   if (userStore.uid) {
29 33
     getUserInviteProfitList({
@@ -89,19 +93,25 @@ onLoad((option: any) => {
89 93
     </div>
90 94
 
91 95
     <div class="pb-safe">
92
-      <div v-if="state.list && state.list.length > 0" class="text-[12px]">
93
-        <div v-for="(item, index) in state.list" :key="index" class="bg-white p-3 f-hairline-bottom">
94
-          <div class="flex items-center">
95
-            <div class="flex flex-col gap-3 flex-1">
96
-              <div>{{ item.title }}</div>
97
-              <div class="text-gray">{{ item.createTime }}</div>
96
+      <scroll-view
97
+          v-if="state.list && state.list.length > 0"
98
+          :scroll-y="true"
99
+          :style="{ height: `${state.scrollHeight}px` }">
100
+        <div class="text-[12px]">
101
+          <div v-for="(item, index) in state.list" :key="index" class="bg-white p-3 f-hairline-bottom">
102
+            <div class="flex items-center">
103
+              <div class="flex flex-col gap-3 flex-1">
104
+                <div>{{ item.title }}</div>
105
+                <div class="text-gray">{{ item.createTime }}</div>
106
+              </div>
107
+              <div class="text-sm">+{{ item.number }}</div>
98 108
             </div>
99
-            <div class="text-sm">+{{ item.number }}</div>
109
+
100 110
           </div>
101 111
 
102 112
         </div>
113
+      </scroll-view>
103 114
 
104
-      </div>
105 115
         <CXBEmpty v-else/>
106 116
     </div>
107 117
 
@@ -113,7 +123,9 @@ page {
113 123
   background: #f8f8f8;
114 124
   --nut-menu-item-font-size: 12px;
115 125
   --nut-menu-bar-line-height: 24px;
116
-  --nut-menu-bar-box-shadow: none
126
+  --nut-menu-bar-box-shadow: none;
127
+  overflow: hidden;
128
+
117 129
 }
118 130
 </style>
119 131
 <route lang="yaml">
@@ -121,4 +133,6 @@ style:
121 133
   navigationBarBackgroundColor: "#FD1642"
122 134
   navigationBarTextStyle: "white"
123 135
   navigationBarTitleText: 累计收益
136
+  enablePullDownRefresh: false
137
+
124 138
 </route>

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

@@ -238,7 +238,7 @@ page {
238 238
 <route lang="yaml">
239 239
 style:
240 240
   navigationBarTitleText: 我的养老金
241
-  enablePullDownRefresh: true
241
+  enablePullDownRefresh: false
242 242
   navigationBarBackgroundColor: "#fe0032"
243 243
   navigationBarTextStyle: "white"
244 244
 </route>

+ 38 - 10
src/pages/dacang/list/components/dacang-header.vue

@@ -3,8 +3,10 @@ import {computed, PropType} from "vue";
3 3
 import FSearch from "~/components/FSearch/FSearch.vue";
4 4
 import type {UserInfoModel} from "~/apis/model/userInfoModel";
5 5
 import {useUserStore} from "~/stores/userStore";
6
+import {useDacangStore} from "~/stores/dacangStore";
6 7
 // import {useUserStore} from "~/stores/userStore";
7 8
 const userStore = useUserStore()
9
+const dacangStore = useDacangStore()
8 10
 
9 11
 const systemInfo = uni.getSystemInfoSync()
10 12
 const statusBarHeight = systemInfo.statusBarHeight ?? 0
@@ -45,9 +47,17 @@ const props = defineProps({
45 47
     default: NaN
46 48
   },
47 49
   current: {
48
-    type: String
50
+    type: String,
51
+    default: '-1'
49 52
   }
50 53
 })
54
+
55
+const tabValue = ref(dacangStore.currentClassify)
56
+
57
+
58
+watch(() => dacangStore.currentClassify, (val) => {
59
+  tabValue.value = val
60
+})
51 61
 function handleClick() {
52 62
   if (userStore.userInfo) {
53 63
     uni.navigateTo({
@@ -67,24 +77,27 @@ const emit = defineEmits<{
67 77
   (e: 'click:item', value:string): void
68 78
 }>()
69 79
 function handleTabItemClick(currentTab) {
70
-  emit('click:item', currentTab)
80
+  emit('click:item', tabValue.value)
81
+}
82
+function handleShowSearchPage() {
83
+  uni.navigateTo({
84
+    url: '/pages/search/search-dacang'
85
+  })
71 86
 }
72
-
73 87
 </script>
74 88
 <template>
75
-  <div class="home-header fixed w-screen text-white z-10 w-full h-32"
89
+  <div class="dacang-header fixed w-screen text-white z-10 w-full h-20"
90
+       :style="navBarStyle"
76 91
        :class="exClass"
77 92
   >
78
-    <div class="pl-2 pt-2"
79
-         :style="navBarStyle"
80
-    >
93
+    <div class="pl-2 pt-2">
81 94
       <div class="w-60% bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red">
82 95
 
83 96
         <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png"
84 97
                mode="widthFix"
85 98
                class="w-4 h-4  pl-2 py-1"
86 99
         ></image>
87
-        <div class="flex flex-1 items-center w-100%">
100
+        <div class="flex flex-1 items-center w-100%" @tap.stop="handleShowSearchPage">
88 101
           <div class="flex-1 pl-2 text-gray">搜索商品关键词</div>
89 102
           <div class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center py-1 my-0.5 mr-0.5 ">
90 103
             搜索
@@ -97,11 +110,26 @@ function handleTabItemClick(currentTab) {
97 110
     </div>
98 111
 
99 112
 <!--    <div class="p-3">-->
100
-      <div class=" mr-6 mb-3">
101
-        <FTabs :tabs="tabs" :ex-class="exClass" @click:item="handleTabItemClick"/>
113
+      <div class=" ">
114
+       <nut-tabs v-model="tabValue" title-scroll title-gutter="10" name="catePanel" @change="handleTabItemClick">
115
+<!--         <nut-tab-panel :title="全部"></nut-tab-panel>-->
116
+          <nut-tab-pane v-for="item in tabs" :title="item.cate_name"
117
+                        :pane-key="item.store_category_id"
118
+                        :key="item.store_category_id"
119
+          >
120
+          </nut-tab-pane>
121
+       </nut-tabs>
102 122
 
103 123
       </div>
104 124
 <!--    </div>-->
105 125
 
106 126
   </div>
107 127
 </template>
128
+<style>
129
+.dacang-header {
130
+  --nut-tabs-horizontal-tab-line-color: #fff;
131
+  --nut-tabs-titles-background-color: none;
132
+  --nut-tabs-titles-item-color: #fff;
133
+  --nut-tabs-titles-item-active-color: #fff;
134
+}
135
+</style>

+ 41 - 86
src/pages/dacang/list/index.vue

@@ -8,9 +8,11 @@ import {useDacangStore} from "~/stores/dacangStore";
8 8
 import {CDN_URL} from "~/config/app";
9 9
 import DacangHeader from "~/pages/dacang/list/components/dacang-header.vue";
10 10
 const headerImage = CDN_URL + `/static/assets/banner-dacang.png`
11
+const usePageStore = usePageStoreWidthOut()
12
+
11 13
 
12 14
 const state = reactive({
13
-  tabs: [],
15
+  tabs: [{store_category_id: '-1', cate_name: '全部'}],
14 16
   productList: <Array<DcProductModel>>[],
15 17
 
16 18
   currentClassify: '',
@@ -25,52 +27,44 @@ const state = reactive({
25 27
 
26 28
 const dacangStore = useDacangStore()
27 29
 
28
-const currentTab = ref()
29
-const classifyId = computed(() => {
30
-  return useDacangStore().$state.currentClassify
31
-})
32
-
33
-watch(() => classifyId.value, (val) => {
34
-  // currentTab.value = val
35
-  // state.currentClassify = val
36
-  // loadDcProductList(classifyId.value)
37
-  loadList('reload')
30
+onLoad(async () => {
31
+  state.tabs = [{store_category_id: '-1', cate_name: '全部'}]
32
+  const classifyRes = await getDcProductClassify()
33
+  state.tabs.push(...classifyRes)
34
+  usePageStore.setPageConfig({
35
+    currentPage: {
36
+      type: 'tab',
37
+      url:  '/pages/dacang/list/index'
38
+    }
39
+  })
38 40
 })
39
-onShow((options) => {
40
-  // console.log(classifyId.value)
41
-
42
-  // if (options.id) {
43
-  // if (!classifyId.value) {
44
-    // loadDcProductList(dacangStore.currentClassify)
45
-    loadList('reload')
46
-  // }
47
-  // } else {
48
-  // }
49
-  getDcProductClassify().then(res => {
50
-    // console.log(res)
51
-    state.tabs = res
41
+onShow(async (options) => {
42
+  usePageStore.setPageConfig({
43
+    currentPage: {
44
+      type: 'tab',
45
+      url:  '/pages/dacang/list/index'
46
+    }
52 47
   })
53
-
48
+  loadList('reload')
54 49
 })
55 50
 
56 51
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
57
-  const params = {
52
+
53
+  let params: any = {
58 54
     page: state.currentPage,
59 55
     limit: state.pageSize,
60
-    // classify: state.currentClassify,
61
-    classify: classifyId.value,
62 56
     keyword: state.keyword
63 57
   }
58
+  if (dacangStore.currentClassify !== '-1') {
59
+    params.classify = dacangStore.currentClassify
60
+  }
61
+
64 62
   if (action === 'reload') {
65 63
     params.page = 1
66 64
   }
67 65
 
68 66
   getDcProductList({
69 67
     ...params
70
-    // page: state.currentPage,
71
-    // limit: state.pageSize,
72
-    // classify,
73
-    // keyword: ''
74 68
   }).then(res => {
75 69
     if (action === 'page') {
76 70
       state.productList = state.productList.concat(res)
@@ -82,16 +76,15 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
82 76
     if (callback) {
83 77
       callback(res)
84 78
     }
85
-    // state.productList = res
86 79
   })
87 80
 }
88 81
 
89
-function handleTabItemClick(tabItem) {
90
-  state.currentClassify = tabItem
91
-  // if (!currentTab || currentTab == '') {
92
-  //   loadList(tabItem)
93
-  dacangStore.setClassify(tabItem)
94
-  loadList('reload')
82
+function handleTabItemClick(classifyId) {
83
+  state.currentClassify = classifyId
84
+  dacangStore.setClassify(classifyId)
85
+  setTimeout(() => {
86
+    loadList('reload')
87
+  }, 300)
95 88
   // }
96 89
 }
97 90
 
@@ -107,12 +100,7 @@ onPageScroll((page) => {
107 100
 })
108 101
 
109 102
 onReachBottom(() => {
110
-  console.log(classifyId)
111 103
   uni.showLoading()
112
-  console.log(state.currentClassify)
113
-  if (!state.currentClassify) {
114
-    state.currentClassify = classifyId
115
-  }
116 104
 
117 105
   state.status = 'loading'
118 106
   state.currentPage += 1
@@ -133,53 +121,14 @@ onPullDownRefresh(() => {
133 121
   })
134 122
 })
135 123
 
136
-function handleShowSearchPage() {
137
-  uni.navigateTo({
138
-    url: '/pages/search/search-dacang'
139
-  })
140
-}
124
+
141 125
 </script>
142 126
 <template>
143 127
   <div class="h-screen">
144
-<!--    <DacangHeader fixed-->
145
-<!--                  :tabs="state.tabs"-->
146
-<!--                  :ex-class="headerClass"-->
147
-<!--                  :current="classifyId"-->
148
-<!--                  @click:item="handleTabItemClick"-->
149
-<!--    />-->
150
-    <div class=" fixed"  :class="headerClass">
151
-      <div :class="headerClass">
152
-        <FNavBar :fixed="true" exClass="pl-2 z-10">
153
-          <div
154
-              @click="handleShowSearchPage"
155
-              class="w-60% bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red"
156
-          >
157
-
158
-            <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png"
159
-                   mode="widthFix"
160
-                   class="w-4 h-4  pl-2 py-1"
161
-            ></image>
162
-            <div class="flex flex-1 items-center w-100%">
163
-              <div class="flex-1 pl-2 text-gray">搜索商品关键词</div>
164
-              <div class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center py-1 my-0.5 mr-0.5 ">
165
-                搜索
166
-              </div>
167
-            </div>
168
-
169
-
170
-          </div>
171
-
172
-        </FNavBar>
173
-        <FTabs class="fixed" :tabs="state.tabs" :current="classifyId" @click:item="handleTabItemClick"/>
174
-      </div>
128
+    <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick"/>
175 129
 
176
-    </div>
177
-
178
-<!--    <FSearch :fixed="true"/>-->
179 130
     <div class="flex flex-col gap-2 ">
180 131
       <image :src="headerImage" mode="widthFix" class="w-full h-50"></image>
181
-
182
-
183 132
     <ProductList :list="state.productList" />
184 133
       <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500" v-if="state.productList.length > 0">
185 134
         <div v-if="state.status === 'loading'">
@@ -197,8 +146,14 @@ function handleShowSearchPage() {
197 146
 page {
198 147
   background-color: #f8f8f8;
199 148
 }
149
+
150
+.nut-tab-pane {
151
+  display: none !important;
152
+}
153
+
154
+
200 155
 </style>
201
-<route lang="yaml">
156
+<route lang="yaml" >
202 157
 style:
203 158
   navigationStyle: custom
204 159
   navigationBarTitleText: 储蓄保

+ 403 - 0
src/pages/dacang/test.json

@@ -0,0 +1,403 @@
1
+{
2
+  "status": 200,
3
+  "message": "success",
4
+  "data": {
5
+    "count": 17,
6
+    "list": [
7
+      {
8
+        "product_id": "5463",
9
+        "mer_id": "430",
10
+        "brand_id": "0",
11
+        "unit_name": "瓶",
12
+        "rate": "5",
13
+        "reply_count": "0",
14
+        "store_info": "每份含:维生素E                                        20.00毫克α-生育酚当量(mg α-TE)                                        \n维生素C(抗坏血酸)                                100.0毫克(mg)\n烟酸(烟酰胺)                                   20.00毫克(mg) 虾青素48   ",
15
+        "cate_id": "461",
16
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/2be1e202305181552239523.jpg",
17
+        "slider_image": [
18
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/23944202305181552315169.jpg",
19
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/ae50b202305181552314235.jpg",
20
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/cf414202305181552313904.jpg",
21
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/442a2202305181552317781.jpg",
22
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/2be1e202305181552239523.jpg"
23
+        ],
24
+        "store_name": "江中维生素C维生素E雨生红球藻片   ",
25
+        "keyword": "",
26
+        "sort": "0",
27
+        "is_show": "1",
28
+        "sales": 100,
29
+        "price": "29.90",
30
+        "refusal": null,
31
+        "cost": "14.00",
32
+        "ot_price": "29.90",
33
+        "stock": "2997",
34
+        "is_gift_bag": "0",
35
+        "care_count": null,
36
+        "status": "1",
37
+        "is_used": "1",
38
+        "create_time": "2023-05-18 15:57:07",
39
+        "seckill": "0",
40
+        "plate_mer_profit": null,
41
+        "type": "1",
42
+        "yanglao": "2.99",
43
+        "special_merchant": "beishengtang",
44
+        "issetCoupon": null
45
+      },
46
+      {
47
+        "product_id": "5462",
48
+        "mer_id": "430",
49
+        "brand_id": "0",
50
+        "unit_name": "瓶",
51
+        "rate": "5",
52
+        "reply_count": "0",
53
+        "store_info": "江中 DHA藻油核桃油",
54
+        "cate_id": "461",
55
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/cfd36202305181548281151.jpg",
56
+        "slider_image": [
57
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/88694202305181548455604.jpg",
58
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/bcd3c202305181548453014.jpg",
59
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/90a15202305181548452855.jpg",
60
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/e180e202305181548451652.jpg",
61
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/cfd36202305181548281151.jpg"
62
+        ],
63
+        "store_name": "江中 DHA藻油核桃油",
64
+        "keyword": "",
65
+        "sort": "0",
66
+        "is_show": "1",
67
+        "sales": 100,
68
+        "price": "59.90",
69
+        "refusal": null,
70
+        "cost": "21.00",
71
+        "ot_price": "59.90",
72
+        "stock": "2997",
73
+        "is_gift_bag": "0",
74
+        "care_count": null,
75
+        "status": "1",
76
+        "is_used": "1",
77
+        "create_time": "2023-05-18 15:51:59",
78
+        "seckill": "0",
79
+        "plate_mer_profit": null,
80
+        "type": "1",
81
+        "yanglao": "5.99",
82
+        "special_merchant": "beishengtang",
83
+        "issetCoupon": null
84
+      },
85
+      {
86
+        "product_id": "5461",
87
+        "mer_id": "430",
88
+        "brand_id": "0",
89
+        "unit_name": "瓶",
90
+        "rate": "5",
91
+        "reply_count": "0",
92
+        "store_info": "【原料】乳酸亚铁,叶酸\n【辅料】麦芽糊精,微晶纤维素,硬脂酸镁",
93
+        "cate_id": "0",
94
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/a5049202305181527302560.png",
95
+        "slider_image": [
96
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/d860f202305181527404017.png",
97
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/37b2c20230518152740881.png",
98
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/3c3b2202305181527405170.png",
99
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/a5049202305181527302560.png",
100
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/0a3bf202305181527409706.png"
101
+        ],
102
+        "store_name": "博客健牌铁叶酸片",
103
+        "keyword": "",
104
+        "sort": "0",
105
+        "is_show": "1",
106
+        "sales": 100,
107
+        "price": "32.90",
108
+        "refusal": null,
109
+        "cost": "12.00",
110
+        "ot_price": "35.90",
111
+        "stock": "2997",
112
+        "is_gift_bag": "0",
113
+        "care_count": null,
114
+        "status": "1",
115
+        "is_used": "1",
116
+        "create_time": "2023-05-18 15:35:02",
117
+        "seckill": "0",
118
+        "plate_mer_profit": null,
119
+        "type": "1",
120
+        "yanglao": "3.29",
121
+        "special_merchant": "beishengtang",
122
+        "issetCoupon": null
123
+      },
124
+      {
125
+        "product_id": "5460",
126
+        "mer_id": "430",
127
+        "brand_id": "0",
128
+        "unit_name": "瓶",
129
+        "rate": "5",
130
+        "reply_count": "0",
131
+        "store_info": "【标志性成分及含量】每粒含维生素E:10.5mg",
132
+        "cate_id": "461",
133
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/0aa9e202305181108113656.jpg",
134
+        "slider_image": [
135
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/95c20202305181108224720.png",
136
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/7f6d5202305181108225737.png",
137
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/90182202305181108221266.png",
138
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/be54d202305181108223169.png",
139
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/0aa9e202305181108113656.jpg"
140
+        ],
141
+        "store_name": "比博牌维生素E软胶囊",
142
+        "keyword": "",
143
+        "sort": "0",
144
+        "is_show": "1",
145
+        "sales": 100,
146
+        "price": "33.90",
147
+        "refusal": null,
148
+        "cost": "14.00",
149
+        "ot_price": "36.90",
150
+        "stock": "2997",
151
+        "is_gift_bag": "0",
152
+        "care_count": null,
153
+        "status": "1",
154
+        "is_used": "1",
155
+        "create_time": "2023-05-18 11:12:05",
156
+        "seckill": "0",
157
+        "plate_mer_profit": null,
158
+        "type": "1",
159
+        "yanglao": "3.39",
160
+        "special_merchant": "beishengtang",
161
+        "issetCoupon": null
162
+      },
163
+      {
164
+        "product_id": "5459",
165
+        "mer_id": "430",
166
+        "brand_id": "0",
167
+        "unit_name": "瓶",
168
+        "rate": "5",
169
+        "reply_count": "0",
170
+        "store_info": "【标志性成分及含量】每片含钙200mg,铁4.4mg,锌5.1mg,维生素c50mg,维生素e30mg",
171
+        "cate_id": "461",
172
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/b0795202305181103352751.png",
173
+        "slider_image": [
174
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/3c0fa2023051811035627.png",
175
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/790cd202305181103563016.png",
176
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/cd12c202305181103564928.png",
177
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/fc98e202305181103559052.png",
178
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/463a1202305181103564472.png",
179
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/062ef202305181103566221.png",
180
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/b0795202305181103352751.png"
181
+        ],
182
+        "store_name": "多种维生素矿物质片 ",
183
+        "keyword": "",
184
+        "sort": "0",
185
+        "is_show": "1",
186
+        "sales": 100,
187
+        "price": "33.90",
188
+        "refusal": null,
189
+        "cost": "13.00",
190
+        "ot_price": "39.90",
191
+        "stock": "2997",
192
+        "is_gift_bag": "0",
193
+        "care_count": null,
194
+        "status": "1",
195
+        "is_used": "1",
196
+        "create_time": "2023-05-18 11:07:44",
197
+        "seckill": "0",
198
+        "plate_mer_profit": null,
199
+        "type": "1",
200
+        "yanglao": "3.39",
201
+        "special_merchant": "beishengtang",
202
+        "issetCoupon": null
203
+      },
204
+      {
205
+        "product_id": "5458",
206
+        "mer_id": "430",
207
+        "brand_id": "0",
208
+        "unit_name": "瓶",
209
+        "rate": "5",
210
+        "reply_count": "0",
211
+        "store_info": "【标志性成分及含量】每100g含:大豆异黄酮7.0mg",
212
+        "cate_id": "461",
213
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/fc269202305181059314928.png",
214
+        "slider_image": [
215
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/65130202305181059511565.png",
216
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/fc9c7202305181059515423.png",
217
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/6b355202305181059514033.png",
218
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/f9e85202305181059513551.png",
219
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/fc269202305181059314928.png"
220
+        ],
221
+        "store_name": "大豆异黄酮维E软胶囊",
222
+        "keyword": "",
223
+        "sort": "0",
224
+        "is_show": "1",
225
+        "sales": 100,
226
+        "price": "69.90",
227
+        "refusal": null,
228
+        "cost": "23.00",
229
+        "ot_price": "69.90",
230
+        "stock": "2997",
231
+        "is_gift_bag": "0",
232
+        "care_count": null,
233
+        "status": "1",
234
+        "is_used": "1",
235
+        "create_time": "2023-05-18 11:03:05",
236
+        "seckill": "0",
237
+        "plate_mer_profit": null,
238
+        "type": "1",
239
+        "yanglao": "6.99",
240
+        "special_merchant": "beishengtang",
241
+        "issetCoupon": null
242
+      },
243
+      {
244
+        "product_id": "5457",
245
+        "mer_id": "430",
246
+        "brand_id": "0",
247
+        "unit_name": "瓶",
248
+        "rate": "5",
249
+        "reply_count": "0",
250
+        "store_info": "【原料】葛根提取物、苦瓜提取物、吡啶甲酸铭\n【辅料】硬脂酸镁\n",
251
+        "cate_id": "461",
252
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/9d4d120230518105519520.png",
253
+        "slider_image": [
254
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/e3fba202305181055524789.png",
255
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/883d5202305181055527554.png",
256
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/8ba3d202305181055528062.png",
257
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/cd18a202305181055526984.png",
258
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/45045202305181055528969.png",
259
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/dff8b20230518105552436.png",
260
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/9d4d120230518105519520.png"
261
+        ],
262
+        "store_name": "金奥力牌葛根苦瓜铬胶囊",
263
+        "keyword": "",
264
+        "sort": "0",
265
+        "is_show": "1",
266
+        "sales": 100,
267
+        "price": "66.90",
268
+        "refusal": null,
269
+        "cost": "23.00",
270
+        "ot_price": "69.90",
271
+        "stock": "2997",
272
+        "is_gift_bag": "0",
273
+        "care_count": null,
274
+        "status": "1",
275
+        "is_used": "1",
276
+        "create_time": "2023-05-18 10:59:00",
277
+        "seckill": "0",
278
+        "plate_mer_profit": null,
279
+        "type": "1",
280
+        "yanglao": "6.69",
281
+        "special_merchant": "beishengtang",
282
+        "issetCoupon": null
283
+      },
284
+      {
285
+        "product_id": "5456",
286
+        "mer_id": "430",
287
+        "brand_id": "0",
288
+        "unit_name": "瓶",
289
+        "rate": "5",
290
+        "reply_count": "0",
291
+        "store_info": "主要原料】蜂胶、聚乙二醇400、甘油、明胶、纯净水",
292
+        "cate_id": "461",
293
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/ffe5e202305181050185807.png",
294
+        "slider_image": [
295
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/4eeb7202305181050443996.png",
296
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/48f57202305181050442235.png",
297
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/9d884202305181050442685.png",
298
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/ffe5e202305181050185807.png"
299
+        ],
300
+        "store_name": "蜂胶胶囊",
301
+        "keyword": "",
302
+        "sort": "0",
303
+        "is_show": "1",
304
+        "sales": 100,
305
+        "price": "66.90",
306
+        "refusal": null,
307
+        "cost": "32.00",
308
+        "ot_price": "69.90",
309
+        "stock": "2997",
310
+        "is_gift_bag": "0",
311
+        "care_count": null,
312
+        "status": "1",
313
+        "is_used": "1",
314
+        "create_time": "2023-05-18 10:54:44",
315
+        "seckill": "0",
316
+        "plate_mer_profit": null,
317
+        "type": "1",
318
+        "yanglao": "6.69",
319
+        "special_merchant": "beishengtang",
320
+        "issetCoupon": null
321
+      },
322
+      {
323
+        "product_id": "5455",
324
+        "mer_id": "430",
325
+        "brand_id": "0",
326
+        "unit_name": "瓶",
327
+        "rate": "5",
328
+        "reply_count": "0",
329
+        "store_info": "【原料】左旋肉城酒石酸盐、绿茶提取物\n【辅料】二氧化硅、硬脂酸镁\n",
330
+        "cate_id": "461",
331
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/e8aa5202305181044387021.png",
332
+        "slider_image": [
333
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/c19c1202305181044485542.png",
334
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/f9bc5202305181044485264.png",
335
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/74b93202305181044484139.png",
336
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/c521920230518104448649.png",
337
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/e8aa5202305181044387021.png"
338
+        ],
339
+        "store_name": "美林康牌左旋肉碱绿茶胶囊",
340
+        "keyword": "",
341
+        "sort": "0",
342
+        "is_show": "1",
343
+        "sales": 100,
344
+        "price": "66.00",
345
+        "refusal": null,
346
+        "cost": "24.00",
347
+        "ot_price": "69.00",
348
+        "stock": "2997",
349
+        "is_gift_bag": "0",
350
+        "care_count": null,
351
+        "status": "1",
352
+        "is_used": "1",
353
+        "create_time": "2023-05-18 10:48:47",
354
+        "seckill": "0",
355
+        "plate_mer_profit": null,
356
+        "type": "1",
357
+        "yanglao": "6.60",
358
+        "special_merchant": "beishengtang",
359
+        "issetCoupon": null
360
+      },
361
+      {
362
+        "product_id": "5454",
363
+        "mer_id": "430",
364
+        "brand_id": "0",
365
+        "unit_name": "瓶",
366
+        "rate": "5",
367
+        "reply_count": "0",
368
+        "store_info": "【原料】纳豆、红曲粉\n【辅料】硬脂酸镁",
369
+        "cate_id": "461",
370
+        "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/896bb202305181040075571.png",
371
+        "slider_image": [
372
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/b7667202305181040166080.png",
373
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/9ad59202305181040166801.png",
374
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/d7899202305181040166781.png",
375
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/d8d6d202305181040165060.png",
376
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/1c44820230518104016981.png",
377
+          "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-05-18\/896bb202305181040075571.png"
378
+        ],
379
+        "store_name": "金奥力牌纳豆红曲胶囊",
380
+        "keyword": "",
381
+        "sort": "0",
382
+        "is_show": "1",
383
+        "sales": 100,
384
+        "price": "76.00",
385
+        "refusal": null,
386
+        "cost": "23.00",
387
+        "ot_price": "79.00",
388
+        "stock": "2997",
389
+        "is_gift_bag": "0",
390
+        "care_count": null,
391
+        "status": "1",
392
+        "is_used": "1",
393
+        "create_time": "2023-05-18 10:44:02",
394
+        "seckill": "0",
395
+        "plate_mer_profit": null,
396
+        "type": "1",
397
+        "yanglao": "7.60",
398
+        "special_merchant": "beishengtang",
399
+        "issetCoupon": null
400
+      }
401
+    ]
402
+  }
403
+}

+ 8 - 2
src/pages/guest_member_new/index.vue

@@ -39,7 +39,12 @@ const chuangkeList = [{
39 39
   title: "推广引流",
40 40
   icon: CDN_URL + '/static/assets/tgyl_221013.png'
41 41
 }]
42
-
42
+const isMerchant = ref(0)
43
+onLoad((options) => {
44
+  if (options && options.is_merchant) {
45
+    isMerchant.value = options.is_merchant
46
+  }
47
+})
43 48
 function handleToShopApplet() {
44 49
   uni.navigateToMiniProgram({
45 50
     appId: 'wx9a3e4ab07f8a9ba2',
@@ -82,7 +87,8 @@ function handleToShopApplet() {
82 87
             @tap="handleToShopApplet"
83 88
             class="w-full flex flex-col justify-center items-center py-4"
84 89
         >
85
-          <image :src="immediately_available_221013Image" mode="widthFix" class="w-50"></image>
90
+          <nut-button type="primary" v-if="isMerchant == '1'">我的创客店</nut-button>
91
+          <image v-else :src="immediately_available_221013Image" mode="widthFix" class="w-50"></image>
86 92
         </div>
87 93
       </div>
88 94
     </div>

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

@@ -1,10 +1,18 @@
1 1
 <script lang="ts" setup>
2 2
 import {CDN_URL} from "~/config/app";
3
+const userStore = useUserStore()
3 4
 
4 5
 function handleGuestMemberNew() {
5
-  uni.navigateTo({
6
-    url: '/pages/guest_member_new/index'
7
-  })
6
+  console.log(userStore.userInfo)
7
+  if (userStore.uid) {
8
+    uni.navigateTo({
9
+      url: `/pages/guest_member_new/index?is_merchant=${userStore.userInfo.is_merchant}`
10
+    })
11
+  } else {
12
+    uni.navigateTo({
13
+      url: '/pages/user/login/index'
14
+    })
15
+  }
8 16
 }
9 17
 const image = CDN_URL + '/static/assets/chuxubao_huiyuan_220818.png'
10 18
 </script>

+ 40 - 22
src/pages/home/components/header.vue

@@ -8,6 +8,8 @@ const userStore = useUserStore()
8 8
 
9 9
 const systemInfo = uni.getSystemInfoSync()
10 10
 const statusBarHeight = systemInfo.statusBarHeight ?? 0
11
+const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
12
+
11 13
 const navBarHeight = computed(() => {
12 14
   // const propsHeight = Number(props.height)
13 15
   let defaultHeight = 44
@@ -16,6 +18,7 @@ const navBarHeight = computed(() => {
16 18
   const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
17 19
   const menuHeight = menuButtonInfo.height
18 20
   const menuTop = menuButtonInfo.top
21
+  // console.log(menuButtonInfo)
19 22
   defaultHeight = (menuTop - statusBarHeight) * 2 + menuHeight
20 23
   // }
21 24
   // #endif
@@ -57,37 +60,52 @@ function handleClick() {
57 60
 // function handleShowSearchPage() {
58 61
 //
59 62
 // }
63
+
64
+function handleShowMessage() {
65
+  uni.navigateTo({
66
+    url: '/pages/message/index'
67
+  })
68
+}
60 69
 </script>
61 70
 <template>
62 71
   <div class="home-header fixed w-screen text-white z-10"
63 72
        :style="navBarStyle"
64 73
        :class="exClass"
65 74
   >
66
-    <div
67
-        @click="handleClick"
68
-        class="flex gap-2 mb-2 pl-2"
69
-    >
70
-      <image v-if="userStore && userStore.userInfo && userStore.userInfo.avatar"
71
-             :src="userStore.userInfo.avatar"
72
-             mode="widthFix"
73
-             class="w-9 h-9 rounded-full"
74
-      />
75
-      <image
76
-          v-else
77
-          src="https://app.bjtdba.com/uploads/logo.jpg"
78
-             mode="widthFix"
79
-             class="w-9 h-9 rounded-full"
80
-      />
81
-      <div class="flex flex-col ">
82
-        <div class="text-sm" v-if="userStore.userInfo && userStore.userInfo.nickname">{{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录'}}</div>
83
-        <div class="text-sm" v-else>登录</div>
84
-        <div class="text-xs" v-if="!isNaN(yanglaojin) && userStore.userInfo">{{ yanglaojin }}元养老金</div>
85
-        <div v-else class="text-xs">
86
-          领取养老金
75
+    <div class="flex">
76
+      <div
77
+          @click="handleClick"
78
+          class="flex gap-2 mb-2 pl-2 flex-1"
79
+      >
80
+        <image v-if="userStore && userStore.userInfo && userStore.userInfo.avatar"
81
+               :src="userStore.userInfo.avatar"
82
+               mode="widthFix"
83
+               class="w-9 h-9 rounded-full"
84
+        />
85
+        <image
86
+            v-else
87
+            src="https://app.bjtdba.com/uploads/logo.jpg"
88
+            mode="widthFix"
89
+            class="w-9 h-9 rounded-full"
90
+        />
91
+        <div class="flex flex-col ">
92
+          <div class="text-sm" v-if="userStore.userInfo && userStore.userInfo.nickname">{{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录'}}</div>
93
+          <div class="text-sm" v-else>登录</div>
94
+          <div class="text-xs" v-if="!isNaN(yanglaojin) && userStore.userInfo">{{ yanglaojin }}元养老金</div>
95
+          <div v-else class="text-xs">
96
+            领取养老金
97
+          </div>
87 98
         </div>
99
+
100
+      </div>
101
+      <div class=" right-26 flex flex-col text-[10px] justify-center items-center " @tap.stop="handleShowMessage" :style="{marginRight: `${menuButtonInfo.width + 15}px`}">
102
+        <image src="/static/icon/message-dark.png" mode="widthFix" class="w-4 h-4" v-if="exClass"></image>
103
+        <image src="/static/icon/message.png" mode="widthFix" class="w-4 h-4" v-else></image>
104
+        <div>消息</div>
88 105
       </div>
89
-    </div>
90 106
 
107
+
108
+    </div>
91 109
     <div class="p-3">
92 110
       <FSearch />
93 111
 

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

@@ -6,7 +6,7 @@ import {CDN_URL} from "~/config/app";
6 6
 
7 7
 const navList = ref([{
8 8
   image: CDN_URL + '/static/home-nav/home_dacang_220614.png',
9
-  title: '城中大仓',
9
+  title: '大仓',
10 10
   key: PLATFORM_NAME.DC
11 11
 }, {
12 12
   image: CDN_URL + '/static/home-nav/home_xianshimiaosha_220614.png',

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

@@ -15,6 +15,14 @@ import {CDN_URL} from "~/config/app";
15 15
 // import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
16 16
 // import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
17 17
 const userStore = useUserStore()
18
+const usePageStore = usePageStoreWidthOut()
19
+usePageStore.setPageConfig({
20
+  currentPage: {
21
+    type: 'tab',
22
+    url:  '/pages/home/index'
23
+  }
24
+})
25
+console.log(usePageStore.currentPage)
18 26
 
19 27
 // const list = ref([])
20 28
 const state = reactive({
@@ -34,6 +42,12 @@ const state = reactive({
34 42
   announcementList: []
35 43
 })
36 44
 onShow(() => {
45
+  usePageStore.setPageConfig({
46
+    currentPage: {
47
+      type: 'tab',
48
+      url:  '/pages/home/index'
49
+    }
50
+  })
37 51
   if (!userStore.uid) {
38 52
     state.closeMoney = ''
39 53
     state.openMoney = ''
@@ -45,6 +59,7 @@ onShow(() => {
45 59
       state.all_yanglao = res.all_yanglao
46 60
     })
47 61
   }
62
+
48 63
 })
49 64
 onLoad(() => {
50 65
   getLocal()
@@ -162,7 +177,7 @@ page {
162 177
   background-color: #f8f8f8;
163 178
 }
164 179
 </style>
165
-<route lang="yaml"  type="home">
180
+<route lang="yaml" >
166 181
 style:
167 182
   navigationStyle: custom
168 183
   navigationBarTitleText: 储蓄保

+ 74 - 33
src/pages/immediate-withdrawal/index.vue

@@ -11,6 +11,7 @@ import {SpreadInfoModel} from "~/apis/model/spreadInfoModel";
11 11
 import type {UserYanglaoJinModel} from "~/apis/model/userYanglaoJinModel";
12 12
 import {CDN_URL} from "~/config/app";
13 13
 import {isNumber} from "~/utils";
14
+
14 15
 const zfb_logoImage = CDN_URL + '/static/assets/zfb_logo.png'
15 16
 const wx_logoImage = CDN_URL + '/static/assets/wx_logo.png'
16 17
 const userStore = useUserStore()
@@ -24,6 +25,7 @@ const widthdrawalConfig = ref({})
24 25
 const cashWithdrawalAmount = ref()
25 26
 
26 27
 const isDisabled = ref(true)
28
+const userBrokeragePrice = ref(0)
27 29
 // userSpreadInfo.value.brokerage_price
28 30
 onLoad(async () => {
29 31
   await userStore.getUserInfo()
@@ -34,6 +36,19 @@ onLoad(async () => {
34 36
 
35 37
   // 提现配置
36 38
   widthdrawalConfig.value = await getWithdrawalConfig()
39
+
40
+  console.log(widthdrawalConfig.value)
41
+  userBrokeragePrice.value = userSpreadInfo.value?.brokerage_price ? parseFloat(userSpreadInfo.value?.brokerage_price) : 0
42
+  console.log(userBrokeragePrice.value)
43
+  // if (userSpreadInfo.value?.brokerage_price) {
44
+    if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
45
+      isDisabled.value = true
46
+      return uni.showToast({
47
+        title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
48
+        icon: 'none'
49
+      })
50
+    }
51
+  // }
37 52
 })
38 53
 
39 54
 watch(() => cashWithdrawalAmount.value, (val) => {
@@ -49,9 +64,10 @@ watch(() => cashWithdrawalAmount.value, (val) => {
49 64
     withdrawalCal.value = {}
50 65
   }
51 66
 })
67
+
52 68
 function handleInputAll() {
53 69
   // console.log(userSpreadInfo.value?.brokerage_price)
54
-  if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && Number.parseFloat(userSpreadInfo.value?.brokerage_price) >= 100 ) {
70
+  if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && Number.parseFloat(userSpreadInfo.value?.brokerage_price) >= widthdrawalConfig.value.widthdrawal_money) {
55 71
     cashWithdrawalAmount.value = userSpreadInfo.value.brokerage_price
56 72
   } else {
57 73
     uni.showToast({
@@ -60,6 +76,7 @@ function handleInputAll() {
60 76
     })
61 77
   }
62 78
 }
79
+
63 80
 /**
64 81
  * 立即提现
65 82
  */
@@ -67,13 +84,6 @@ function handleImmediateWithdrawal() {
67 84
   if (isDisabled.value) {
68 85
     return
69 86
   }
70
-  // 1 判断是否需要实名
71
-  if (!yanglaojin.value?.is_certification == 1) {
72
-    return uni.navigateTo({
73
-      url: '/pages/real-name-authentication/index'
74
-    })
75
-  }
76
-
77 87
   if (widthdrawalConfig.value.withdrawal_status == '0') {
78 88
     isDisabled.value = true
79 89
     return uni.showToast({
@@ -89,29 +99,48 @@ function handleImmediateWithdrawal() {
89 99
       icon: 'none'
90 100
     })
91 101
   }
92
-  if (Number.parseFloat(cashWithdrawalAmount.value) > Number.parseFloat(userSpreadInfo.value?.brokerage_price) ) {
93
-    isDisabled.value = true
102
+
103
+    if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
104
+      return uni.showToast({
105
+        title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
106
+        icon: 'none'
107
+      })
108
+    }
109
+
110
+  if (Number.parseFloat(cashWithdrawalAmount.value) <= Number.parseFloat(userBrokeragePrice.value) < widthdrawalConfig.value.withdrawal_money) {
111
+    // 1 判断是否需要实名
112
+    if (!yanglaojin.value?.is_certification == 1) {
113
+      return uni.navigateTo({
114
+        url: '/pages/real-name-authentication/index'
115
+      })
116
+    }
117
+
118
+
94 119
     return uni.showToast({
95
-      title: '输入金额超过可提现余额',
120
+      title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
96 121
       icon: 'none'
97 122
     })
98 123
   }
99 124
 
100
-  if (userSpreadInfo.value?.brokerage_price) {
101
-    if (userSpreadInfo.value?.brokerage_price < widthdrawalConfig.value.withdrawal_money) {
102
-      isDisabled.value = true
103
-      return uni.showToast({
104
-        title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现',
105
-        icon: 'none'
125
+  if (Number.parseFloat(cashWithdrawalAmount.value) >= Number.parseFloat(userBrokeragePrice.value) >= widthdrawalConfig.value.withdrawal_money) {
126
+    // 1 判断是否需要实名
127
+    if (!yanglaojin.value?.is_certification == 1) {
128
+      return uni.navigateTo({
129
+        url: '/pages/real-name-authentication/index'
106 130
       })
107 131
     }
108
-  } else {
109
-    return
132
+
133
+
134
+    return uni.showToast({
135
+      title: '输入金额超过可提现余额',
136
+      icon: 'none'
137
+    })
110 138
   }
111 139
 
112 140
 
113 141
 
114
-  getApplicationWithdrawal({ extract_price: cashWithdrawalAmount.value, extract_type: 1}).then(res => {
142
+
143
+  getApplicationWithdrawal({extract_price: cashWithdrawalAmount.value, extract_type: 1}).then(res => {
115 144
     // uni.showToast({
116 145
     //   title: res,
117 146
     //   icon: 'none'
@@ -124,6 +153,11 @@ function handleImmediateWithdrawal() {
124 153
         url: '/pages/immediate-withdrawal/index'
125 154
       })
126 155
     })
156
+  }).catch(error => {
157
+    uni.showToast({
158
+      title: error,
159
+      icon: 'none'
160
+    })
127 161
   })
128 162
 
129 163
 
@@ -151,7 +185,7 @@ function handleShowAgreement(type) {
151 185
     <div class="bg-white rounded-lg text-sm p-3 flex flex-col gap-4">
152 186
       <div class="flex justify-between">
153 187
         <div class="font-bold">提现金额</div>
154
-        <div class="text-xs text-gray" @click="handleShowAgreement(12)">提现规则</div>
188
+        <div class="text-xs text-gray" @click="handleShowAgreement(6)">提现规则</div>
155 189
       </div>
156 190
       <div class="flex justify-center items-center pt-4 f-hairline-bottom">
157 191
         <div class="text-lg font-bold">¥</div>
@@ -165,7 +199,7 @@ function handleShowAgreement(type) {
165 199
       </div>
166 200
       <div class="flex text-gray items-center gap-3 text-sm">
167 201
         <div v-if="userSpreadInfo">
168
-          可用余额¥:{{ userSpreadInfo.brokerage_price }}
202
+          可用余额¥:{{ userBrokeragePrice }}
169 203
         </div>
170 204
         <div v-if="userStore.userInfo">
171 205
           可用积分:{{ userStore.userInfo.score }}
@@ -188,15 +222,15 @@ function handleShowAgreement(type) {
188 222
           </div>
189 223
         </div>
190 224
 
191
-<!--        <div class="flex items-center justify-between py-3">-->
192
-<!--          <div class="flex items-center gap-2">-->
193
-<!--            <image :src="zfb_logoImage" mode="widthFix" class="w-8 h-8"></image>-->
194
-<!--            <div>支付宝支付</div>-->
195
-<!--            </div>-->
196
-<!--            <div>-->
197
-<!--              <radio />-->
198
-<!--            </div>-->
199
-<!--          </div>-->
225
+        <!--        <div class="flex items-center justify-between py-3">-->
226
+        <!--          <div class="flex items-center gap-2">-->
227
+        <!--            <image :src="zfb_logoImage" mode="widthFix" class="w-8 h-8"></image>-->
228
+        <!--            <div>支付宝支付</div>-->
229
+        <!--            </div>-->
230
+        <!--            <div>-->
231
+        <!--              <radio />-->
232
+        <!--            </div>-->
233
+        <!--          </div>-->
200 234
       </div>
201 235
     </div>
202 236
 
@@ -204,7 +238,8 @@ function handleShowAgreement(type) {
204 238
       <div class=" flex rounded-full bg-red-300">
205 239
         <nut-button type="primary" block
206 240
                     :disabled="isDisabled"
207
-             @tap="handleImmediateWithdrawal"
241
+                    :class="isDisabled && 'bg-gray-800'"
242
+                    @tap="handleImmediateWithdrawal"
208 243
         >
209 244
           立即提现
210 245
         </nut-button>
@@ -214,7 +249,7 @@ function handleShowAgreement(type) {
214 249
         <div>详细说明</div>
215 250
         <div>平台服务费 {{ withdrawalCal.service }}</div>
216 251
         <div>本次提取将扣除服务费 ¥{{ withdrawalCal.service_money }}</div>
217
-        <div>本次提取实际到账额度 ¥{{ withdrawalCal.money}}</div>
252
+        <div>本次提取实际到账额度 ¥{{ withdrawalCal.money }}</div>
218 253
       </div>
219 254
 
220 255
     </div>
@@ -224,13 +259,19 @@ function handleShowAgreement(type) {
224 259
 <style>
225 260
 page {
226 261
   background: #f8f8f8;
262
+  --nut-button-disabled-opacity: 0.3;
263
+  overflow: hidden;
227 264
 }
265
+
228 266
 .wx-radio-input {
229 267
   height: 16px !important;
230 268
   width: 16px !important;
231 269
 }
270
+
232 271
 </style>
233 272
 <route lang="yaml">
234 273
 style:
235 274
   navigationBarTitleText: 立即提现
275
+  enablePullDownRefresh: false
276
+
236 277
 </route>

+ 67 - 13
src/pages/invite-friends/index.vue

@@ -1,5 +1,6 @@
1 1
 <script setup lang="ts">
2 2
 import {
3
+  getGenerateImage,
3 4
   getUserSharePostersClassifyList,
4 5
   getUserSharePostersImagesList,
5 6
 } from "~/apis/user";
@@ -26,6 +27,8 @@ const state = reactive<any>({
26 27
 
27 28
   showTip: false,
28 29
   list: [],
30
+
31
+  currentImg: ''
29 32
   // merchantCategory: [],
30 33
   // merchantList: [],
31 34
   // merchantPageNum: 1,
@@ -36,6 +39,8 @@ const state = reactive<any>({
36 39
   // merchantPageInfo: {}
37 40
 })
38 41
 
42
+const userStore = useUserStore()
43
+
39 44
 const show = ref(false)
40 45
 const currentItem = ref({})
41 46
 const { windowHeight } = uni.getSystemInfoSync()
@@ -77,13 +82,17 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
77 82
   // if (state.categoryId == 0) {
78 83
   //   state.currentCategoryId = 0
79 84
   // }
85
+  if (action === 'reload') {
86
+    state.currentPage = 1
87
+  }
80 88
   const params = {
81 89
     pageNum: state.currentPage,
82 90
     pageSize: state.pageSize,
83
-    type: '1'
84 91
   }
85 92
   if (state.currentCategoryId > 0) {
86 93
     params.classify = state.currentCategoryId
94
+  } else {
95
+    params.type = 1
87 96
   }
88 97
 
89 98
   getUserSharePostersImagesList(params).then(res => {
@@ -144,19 +153,44 @@ function loadAll() {
144 153
   loadList('reload')
145 154
 }
146 155
 function handleItemClick(item) {
156
+  state.currentImg = ''
147 157
   currentItem.value = item
148
-  show.value = true
158
+  console.log(item)
159
+  uni.showLoading({
160
+    title: '数据加载中',
161
+    icon: 'none'
162
+  })
163
+  getGenerateImage({
164
+    uid: userStore.uid,
165
+    imgId: item.id
166
+  }).then(res => {
167
+    console.log(res)
168
+    if (res && res.shareImgs) {
169
+      state.currentImg = res.shareImgs
170
+    }
171
+    show.value = true
172
+
173
+    uni.hideLoading()
174
+  }).catch(error => {
175
+    uni.showToast({
176
+      title: error,
177
+      icon: 'none'
178
+    })
179
+  })
149 180
 }
150 181
 
151 182
 function shareImage() {
152
-  wx.downloadFile({
153
-    url: currentItem.value.image_fake,
154
-    success: (res) => {
155
-      wx.showShareImageMenu({
156
-        path: res.tempFilePath
157
-      })
158
-    }
159
-  })
183
+  if (state.currentImg) {
184
+    uni.downloadFile({
185
+      // url: currentItem.value.image_fake,
186
+      url: state.currentImg,
187
+      success: (res) => {
188
+        uni.showShareImageMenu({
189
+          path: res.tempFilePath
190
+        })
191
+      }
192
+    })
193
+  }
160 194
 }
161 195
 
162 196
 function shareTimeline() {
@@ -244,16 +278,16 @@ function handleClose() {
244 278
     <div class="flex flex-col justify-center items-center w-full h-full"
245 279
     >
246 280
       <div class="bg-white">
247
-        <image :src="currentItem.image_fake" mode="widthFix" class="w-60"></image>
281
+        <image :src="state.currentImg" mode="widthFix" class="w-60"></image>
248 282
         <div class="bg-white p-3 flex justify-around gap-3">
249 283
           <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
250 284
             <image :src="wechatImg" mode="widthFix" class="w-8 h-8"></image>
251 285
             <div>微信</div>
252 286
           </div>
253
-          <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
287
+<!--          <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
254 288
             <image :src="pyqImg" mode="widthFix" class="w-8 h-8"></image>
255 289
             <div>朋友圈</div>
256
-          </div>
290
+          </div>-->
257 291
           <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">
258 292
             <image :src="bctpImg" mode="widthFix" class="w-8 h-8"></image>
259 293
             <div>保存图片</div>
@@ -268,4 +302,24 @@ function handleClose() {
268 302
 <route lang="yaml">
269 303
 style:
270 304
   navigationBarTitleText: 邀请好友
305
+  enablePullDownRefresh: false
306
+
271 307
 </route>
308
+<style>
309
+
310
+page {
311
+  overflow: hidden;
312
+}
313
+image {
314
+
315
+  image-rendering: -moz-crisp-edges;
316
+
317
+  image-rendering: -o-crisp-edges;
318
+
319
+  image-rendering: -webkit-optimize-contrast;
320
+
321
+  image-rendering: crisp-edges;
322
+
323
+  -ms-interpolation-mode: nearest-neighbor;
324
+}
325
+</style>

+ 27 - 10
src/pages/invite-partners/index.vue

@@ -6,6 +6,14 @@ import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6 6
 import {encodePhone} from "../../utils";
7 7
 const userStore = useUserStore()
8 8
 const invitePartnerModel: Ref<InvitePartnerModel | undefined> = ref<InvitePartnerModel>() || undefined
9
+const state = reactive({
10
+  // 列表高度
11
+  scrollHeight: 0,
12
+})
13
+
14
+const {windowHeight} = uni.getSystemInfoSync()
15
+state.scrollHeight = windowHeight - 320
16
+
9 17
 onLoad(() => {
10 18
   getUserInviteList({
11 19
     uid: userStore.uid ? userStore.uid : '',
@@ -72,17 +80,23 @@ function handleSearch() {
72 80
         <div>身份</div>
73 81
         <div class="text-right">加入时间</div>
74 82
       </div>
75
-      <div v-if="invitePartnerModel && invitePartnerModel.userInviteVoList">
76
-        <div class="grid grid-cols-3 text-center text-sm p-2 bg-white text-gray-500" v-for="(item, index) in invitePartnerModel.userInviteVoList.list" :key="index">
77
-          <div class="flex flex-col">
78
-            <div class="text-left">{{ item.nickname || '无昵称' }}</div>
79
-            <div class="text-left text-[11px] text-gray-500">{{ item.phone ? encodePhone(item.phone) : '' }}</div>
80
-          </div>
83
+      <scroll-view
84
+          :scroll-y="true"
85
+          :style="{ height: `${state.scrollHeight}px` }"
86
+          v-if="invitePartnerModel && invitePartnerModel.userInviteVoList">
87
+        <div>
88
+          <div class="grid grid-cols-3 text-center text-sm p-2 bg-white text-gray-500" v-for="(item, index) in invitePartnerModel.userInviteVoList.list" :key="index">
89
+            <div class="flex flex-col">
90
+              <div class="text-left">{{ item.nickname || '无昵称' }}</div>
91
+              <div class="text-left text-[11px] text-gray-500">{{ item.phone ? encodePhone(item.phone) : '' }}</div>
92
+            </div>
81 93
 
82
-          <div>{{ item.statusType }}</div>
83
-          <div class="text-right">{{ item.promoterTime }}</div>
94
+            <div>{{ item.statusType }}</div>
95
+            <div class="text-right">{{ item.promoterTime }}</div>
96
+          </div>
84 97
         </div>
85
-      </div>
98
+
99
+      </scroll-view>
86 100
       <div v-else>
87 101
         <CXBEmpty />
88 102
       </div>
@@ -92,11 +106,14 @@ function handleSearch() {
92 106
 <style>
93 107
 page {
94 108
   background: #f8f8f8;
109
+  overflow: hidden;
95 110
 }
96 111
 </style>
97 112
 <route lang="yaml">
98 113
 style:
99 114
   navigationBarBackgroundColor: "#FD1642"
100 115
   navigationBarTextStyle: "white"
101
-  navigationBarTitleText: 邀请伙伴
116
+  navigationBarTitleText: 邀请伙伴a
117
+  enablePullDownRefresh: false
118
+
102 119
 </route>

+ 16 - 0
src/pages/message/index.vue

@@ -0,0 +1,16 @@
1
+<script setup lang="ts">
2
+import {CDN_URL} from "~/config/app";
3
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
4
+
5
+const icon = CDN_URL + '/static/assets/search_zanwuxiangguan_220617.png'
6
+</script>
7
+<template>
8
+  <div class="h-screen w-screen flex flex-col justify-center items-center">
9
+    <CXBEmpty type="message"/>
10
+  </div>
11
+</template>
12
+
13
+<route lang="yaml">
14
+style:
15
+  navigationBarTitleText: 消息
16
+</route>

+ 64 - 11
src/pages/miaosha/index.vue

@@ -1,26 +1,76 @@
1 1
 <script setup lang="ts">
2
-import {getDcSeckill} from "~/apis/dacang";
2
+import {getDcSeckill, getSeckillIndexTime} from "~/apis/dacang";
3 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";
9 10
 const currentSeckillDate = ref()
11
+const status1Icon = CDN_URL + '/static/assets/mashangqiang.png'
12
+const status2Icon = CDN_URL + '/static/assets/jijiangkaiqiang.png'
13
+const status3Icon = CDN_URL + '/static/assets/miaosha_yijieshu_220908.png'
10 14
 
11 15
 const list = ref<Array<DcSeckillModel>>()
12 16
 const currentProductList = ref([])
17
+
18
+const state = reactive({
19
+  // seckillTime
20
+  timeList: [],
21
+  // seckillTimeIndex
22
+  endTime: '',
23
+  // 倒计时
24
+  //seckillEndTime
25
+  active: '',
26
+
27
+  scrollLeft: 0,
28
+  loading: false,
29
+
30
+  seckillList: [],
31
+  page: 1,
32
+  limit: 10,
33
+  status: ''
34
+})
13 35
 onLoad((options) => {
36
+  getSeckillIndexTime().then(res => {
37
+    console.log(res)
38
+    state.timeList = res.seckillTime
39
+    state.active = res.seckillTimeIndex
40
+    state.endTime = res.seckillEndTime
41
+
42
+    let time
43
+    state.timeList.map((item) => {
44
+      time = item.start_time > 9 ? item.start_time + ':00' : '0' + item.start_time + ':00';
45
+      item.time = time;
46
+    })
47
+
48
+    if (state.timeList.length) {
49
+      state.scrollLeft = (state.active = 1.37) * 100
50
+      setTimeout(() => {
51
+        state.loading = true
52
+      }, 2000)
53
+
54
+      state.seckillList = []
55
+      state.page = 1
56
+      state.status = state.timeList[state.active].status
57
+      loadSeckillList()
58
+
59
+    }
60
+  })
61
+
62
+})
63
+
64
+function loadSeckillList() {
14 65
   getDcSeckill().then(res => {
15 66
     list.value = res
16 67
     if (list.value && list.value?.length > 0) {
17 68
       currentSeckillDate.value = list.value[0].seckill_date
18 69
       currentProductList.value = list.value[0].product_data
19
-
20 70
     }
21
-  })
22
-})
23 71
 
72
+  })
73
+}
24 74
 function handleSeckillDateClick(seckill) {
25 75
   currentProductList.value = seckill.product_data
26 76
   currentSeckillDate.value = seckill.seckill_date
@@ -80,12 +130,15 @@ function handleItemClick(seckillItem) {
80 130
                 <CXBYaojinTag :amount="Number.parseFloat(seckillItem.yanglao)" />
81 131
                 <div class="flex items-center justify-between">
82 132
                   <FPrice :price="seckillItem.seckill_price"/>
83
-                  <FButton
84
-                      size="mini"
85
-                      :exClass="['rounded', 'text-white', 'bg-gradient-to-r', 'from-[#fe7577]', 'to-[#fe0032]']"
86
-                  >
87
-                    马上抢
88
-                  </FButton>
133
+                  <image
134
+                      v-if="seckillItem.status == 1"
135
+                      :src="status1Icon" mode="widthFix" class="w-16 h-7" ></image>
136
+                  <image
137
+                      v-if="seckillItem.status == 2"
138
+                      :src="status2Icon" mode="widthFix" class="w-16 h-7" ></image>
139
+                  <image
140
+                      v-if="seckillItem.status == 3"
141
+                      :src="status3Icon" mode="widthFix" class="w-16 h-7" ></image>
89 142
                 </div>
90 143
               </div>
91 144
 
@@ -100,7 +153,7 @@ function handleItemClick(seckillItem) {
100 153
   </CXBBasePage>
101 154
 
102 155
 </template>
103
-<route lang="yaml">
156
+<route lang="yaml" type="home">
104 157
 style:
105 158
   navigationBarTitleText: 限时秒杀
106 159
 </route>

+ 18 - 12
src/pages/my-integral/index.vue

@@ -10,6 +10,7 @@ const state = reactive({
10 10
   isLogin: false,
11 11
   signToday: NaN,
12 12
   isShowSignIn: false,
13
+  day: 0
13 14
 })
14 15
 
15 16
 onShow(() => {
@@ -27,10 +28,12 @@ function loadSignInInfo() {
27 28
   getNewSignInInfo().then(res => {
28 29
     console.log(res)
29 30
     const {today, day} = res
30
-    state.signToday = day
31
+    state.signToday = today
32
+    console.log(res)
31 33
     if (today == 0) {
32 34
       state.isShowSignIn = true
33 35
     }
36
+    state.day = day
34 37
     // // if (today === 0) {
35 38
     //   2.1 弹出签到窗口
36 39
     // }
@@ -63,15 +66,15 @@ if (userStore.userInfo) {
63 66
 
64 67
 
65 68
 function handleSign() {
66
-  console.log(state.signToday)
67
-  if (state.signToday == 0)  {
69
+  // console.log(state.signToday)
70
+  // if (state.signToday == 0)  {
68 71
     state.isShowSignIn = true
69
-  } else {
70
-    return uni.showToast({
71
-      title: '今日已签到过',
72
-      icon: 'none'
73
-    })
74
-  }
72
+  // } else {
73
+  //   return uni.showToast({
74
+  //     title: '今日已签到过',
75
+  //     icon: 'none'
76
+  //   })
77
+  // }
75 78
 }
76 79
 function handleShowIntegralDetail() {
77 80
   uni.navigateTo({
@@ -81,7 +84,9 @@ function handleShowIntegralDetail() {
81 84
 
82 85
 function handleToZibuyangsheng() {
83 86
   uni.navigateTo({
84
-    url: '/pages/product/zibuyangsheng?id=430'
87
+    // url: '/pages/product/zibuyangsheng?id=430'
88
+    // url: '/pages/product/zibuyangsheng?id=430'
89
+    url: '/pages/product/integral'
85 90
   })
86 91
 }
87 92
 
@@ -114,7 +119,7 @@ function handleShowAgreement() {
114 119
     </div>
115 120
 
116 121
     <div class="bg-white rounded-md text-sm flex justify-between p-3">
117
-      <div class="">滋补保健 {{ userStore.userInfo.score_beishengtang}}</div>
122
+      <div class="">积分通兑</div>
118 123
       <FButton
119 124
           @tap="handleToZibuyangsheng"
120 125
           size="mini"
@@ -147,7 +152,7 @@ function handleShowAgreement() {
147 152
               size="mini"
148 153
               :exClass="['rounded-full','!text-[12px]', 'text-white', `${state.signToday === 0 ? 'bg-primary' : 'bg-gray' }`, 'w-full']"
149 154
           >
150
-            {{ !state.isShowSignIn ? '已签到' : '去签到' }}
155
+            {{ state.signToday === 0 ? '去签到' : '已签到' }}
151 156
           </FButton>
152 157
         </div>
153 158
         <div class="flex  justify-between items-center">
@@ -174,6 +179,7 @@ function handleShowAgreement() {
174 179
   <CXBDialogSIgnIn
175 180
       :show="state.isShowSignIn"
176 181
       :today="state.signToday"
182
+      :day="state.day"
177 183
       @confirm="state.isShowSignIn = false"
178 184
       @close="state.isShowSignIn = false"
179 185
   />

+ 34 - 15
src/pages/my-integral/user-invation.vue

@@ -90,33 +90,52 @@ function shareWeixin() {
90 90
   uni.showLoading({
91 91
     title: '数据加载中'
92 92
   })
93
-  wx.downloadFile({
93
+   uni.downloadFile({
94 94
     url: spreadData.value.wap_poster,
95 95
     success: (res) => {
96
-      uni.hideLoading()
97
-      wx.showShareImageMenu({
96
+      uni.showShareImageMenu({
98 97
         path: res.tempFilePath
99 98
       })
100
-    }
99
+
100
+      uni.hideLoading()
101
+
102
+    },
103
+     fail: (error) => {
104
+       uni.showToast({
105
+         title: error,
106
+         icon: 'none'
107
+       })
108
+     }
101 109
   })
102 110
 }
103
-function shareImage() {
111
+async function shareImage() {
104 112
   if (!spreadData.value) {
105
-    uni.showLoading({
113
+    await uni.showLoading({
106 114
       title: '二维码获取中'
107 115
     })
108
-    getSpreadImage().then(res => {
116
+   let res = await getSpreadImage()
117
+    // console.log(res)
118
+    // uni.showToast({
119
+    //   title: res,
120
+    //   icon: 'none'
121
+    // })
122
+    if (res) {
109 123
       spreadData.value = res[0]
110 124
       console.log(spreadData.value)
111 125
       shareWeixin()
112
-      uni.hideLoading()
113
-    }).catch(error => {
114
-      uni.showToast({
115
-        title: error,
116
-        icon: 'none'
117
-      })
118
-      uni.hideLoading()
119
-    })
126
+    }
127
+    //    .then(res => {
128
+    //   spreadData.value = res[0]
129
+    //   console.log(spreadData.value)
130
+    //   shareWeixin()
131
+    //   uni.hideLoading()
132
+    // }).catch(error => {
133
+    //   console.error(error)
134
+    //   uni.showToast({
135
+    //     title: error,
136
+    //     icon: 'none'
137
+    //   })
138
+    // })
120 139
   } else {
121 140
     shareWeixin()
122 141
   }

+ 4 - 1
src/pages/my-invitation/index.vue

@@ -89,7 +89,7 @@ function handleShowAgreement() {
89 89
             当前收益(元)
90 90
           </div>
91 91
           <div class="font-bold text-[28px]">
92
-            {{ data.brokerage_price }}
92
+            {{ data.brokerage_price ? data.brokerage_price : '0.00' }}
93 93
           </div>
94 94
         </div>
95 95
         <div class="flex flex-col justify-center items-center gap-2">
@@ -132,6 +132,7 @@ function handleShowAgreement() {
132 132
 <style>
133 133
 page {
134 134
   background: #f8f8f8;
135
+  overflow: hidden;
135 136
 }
136 137
 </style>
137 138
 <route lang="yaml">
@@ -139,4 +140,6 @@ style:
139 140
   navigationBarBackgroundColor: "#FD1642"
140 141
   navigationBarTextStyle: "white"
141 142
   navigationBarTitleText: 我的邀请
143
+  enablePullDownRefresh: false
144
+
142 145
 </route>

+ 44 - 17
src/pages/my-relation-merchant/index.vue

@@ -52,6 +52,13 @@ function handleRemoveMyRelation(item: any, index: number) {
52 52
     }
53 53
   })
54 54
 }
55
+
56
+function handleItemClick(item) {
57
+  console.log(item)
58
+  uni.navigateTo({
59
+    url: '/pages/store/home/index?id=' + item.mer_id
60
+  })
61
+}
55 62
 </script>
56 63
 
57 64
 <template>
@@ -68,29 +75,42 @@ function handleRemoveMyRelation(item: any, index: number) {
68 75
       </nut-searchbar>
69 76
       <!--      <FSearch />-->
70 77
     </div>
71
-    <div v-if="list && list.length > 0" class="flex flex-col gap-3">
72
-      <div class="bg-white flex p-3" v-for="(item, index) in list" :key="index">
73
-        <div>
74
-          <image :src="item.mer_avatar" mode="widthFix" class="w-15 h-15 rounded "></image>
75
-        </div>
76
-        <div class="flex flex-col text-sm  justify-between w-full">
77
-          <div class="flex flex-col px-3 gap-2">
78
+    <div v-if="list && list.length > 0" class="flex flex-col gap-3 ">
79
+      <div class="bg-white flex p-3 " v-for="(item, index) in list" :key="index"
80
+           @tap="handleItemClick(item)"
81
+      >
82
+        <div class="flex w-full">
83
+          <div class="flex flex-1 w-full">
78 84
             <div>
79
-              {{ item.mer_name }}
85
+              <image :src="item.mer_avatar" mode="widthFix" class="w-15 h-15 rounded "></image>
80 86
             </div>
81
-            <div class="text-xs text-gray">
82
-              {{ item.care_count }} 人关注
87
+            <div class="flex flex-col text-sm  justify-between w-full">
88
+              <div class="flex flex-col px-3 gap-2 flex-1">
89
+                <div>
90
+                  {{ item.mer_name }}
91
+                </div>
92
+                <div class="text-xs text-gray">
93
+                  {{ item.care_count }} 人关注
94
+                </div>
95
+              </div>
96
+
97
+              <!--
98
+              <div class="flex items-center justify-end">
99
+                <div
100
+                    @tap="handleRemoveMyRelation(item, index)"
101
+                    class="border border-solid border-red rounded-full px-2 text-[10px] text-red">
102
+                  取消收藏
103
+                </div>
104
+              </div>
105
+              -->
83 106
             </div>
84 107
           </div>
85
-          <div class="flex items-center justify-end">
86
-            <div
87
-                @tap="handleRemoveMyRelation(item, index)"
88
-                class="border border-solid border-red rounded-full px-2 text-[10px] text-red">
89
-              取消收藏
90
-            </div>
108
+          <div class="list-bg ">
91 109
           </div>
92 110
         </div>
111
+
93 112
       </div>
113
+
94 114
     </div>
95 115
     <div v-else>
96 116
       <CXBEmpty />
@@ -98,10 +118,17 @@ function handleRemoveMyRelation(item: any, index: number) {
98 118
   </div>
99 119
 </template>
100 120
 
101
-<style>
121
+<style lang="scss">
102 122
 page {
103 123
   background-color: #f8f8f8;
104 124
 }
125
+.list-bg {
126
+  width: 124rpx;
127
+  height: 124rpx;
128
+  background-image: url('https://cdn.bjtdba.com/vod/image/2023-09-23/20230923192915366.png');
129
+  background-size: 100% 100%;
130
+}
131
+
105 132
 </style>
106 133
 <route lang="yaml">
107 134
 style:

+ 19 - 12
src/pages/order-confirm/index.vue

@@ -10,6 +10,7 @@ import {encodePhone} from "~/utils";
10 10
 import {CDN_URL} from "~/config/app";
11 11
 import {useAddressStore} from "~/stores/addressStore";
12 12
 import {watchThrottled} from "@vueuse/core";
13
+import FField from "~/components/FField/FField.vue";
13 14
 const addressIcon = CDN_URL + '/static/assets/dingwi_220624.png'
14 15
 // const addressInfo = ref({})
15 16
 const addressStore = useAddressStore()
@@ -29,6 +30,7 @@ const data = reactive({
29 30
   is_dacang_vip_product: '',
30 31
   totalPrice: '',
31 32
   orderStatus: '',
33
+  mark: ''
32 34
   // 商品总价?
33 35
   // proPrice: ''
34 36
 })
@@ -45,7 +47,7 @@ onLoad(async (options) => {
45 47
     data.productId = options.product_id
46 48
   }
47 49
 
48
-  console.log(data)
50
+  // console.log(data)
49 51
   // if (options && options.addressId) {
50 52
   //   // getUserAddressDetail(options.addressId).then(res => {
51 53
   //   //   data.addressInfo = res
@@ -145,10 +147,11 @@ function handleSubmit() {
145 147
     // 优惠券
146 148
     // coupon:
147 149
     // pay_type;//支付方式:0: 余额;1: 微信;2: 小程序;4: 支付宝;5: 特殊商户积分
148
-    pay_type:  data.type && data.type == '3' ? '5' : 'weixin',
150
+    // pay_type:  data.type && data.type == '3' ? '5' : 'weixin',
151
+    pay_type: data.type,
149 152
     mer_id: data.type && data.type == '3' ? '148': '',
150 153
     // 用户留言
151
-    mark: '',
154
+    mark: data.mark,
152 155
     // take: [],
153 156
     // share_id: '',
154 157
     // dacang_id:
@@ -169,7 +172,7 @@ function payment(createOrderData: CreateOrderRequest) {
169 172
 
170 173
   orderCreate(createOrderData).then(res => {
171 174
     if (res) {
172
-      console.log('order_create')
175
+      // console.log('order_create')
173 176
       console.log(res)
174 177
       uni.hideLoading()
175 178
       uni.navigateTo({
@@ -254,9 +257,12 @@ function reTotal() {
254 257
                 <div class="w-fit flex">
255 258
                   <image :src="addressIcon" mode="aspectFit" class="w-4 h-4"></image>
256 259
                 </div>
257
-                <div class="flex-1 flex">
260
+                <div class="flex-1 flex" v-if="data.addressId">
258 261
                   {{ data.addressInfo.province + ' ' + data.addressInfo.city + ' ' + data.addressInfo.district + ' ' + data.addressInfo.detail }}
259 262
                 </div>
263
+                <div v-else class="flex-1 flex">
264
+                  请选择收货地址
265
+                </div>
260 266
               </div>
261 267
 
262 268
               <div class="w-4 flex i-tabler-chevron-right text-gray"></div>
@@ -291,7 +297,7 @@ function reTotal() {
291 297
                 <image :src="orderProductItem.product.image" mode="aspectFit" class="rounded w-20 h-20"></image>
292 298
 
293 299
               </div>
294
-              <div class="flex flex-col ">
300
+              <div class="flex flex-col w-full">
295 301
                 <div class="flex flex-col ">
296 302
                   <div class="line-clamp-2 text-xs">
297 303
                     {{ orderProductItem.product.store_name }}
@@ -302,7 +308,7 @@ function reTotal() {
302 308
                   <CXBYaojinTag :amount="orderProductItem.yanglao" v-if="item.mer_id != '148'"/>
303 309
 
304 310
                 </div>
305
-                <div class="flex justify-between">
311
+                <div class="flex justify-between ">
306 312
                   <FPrice :price="orderProductItem.productAttr.price" v-if="item.mer_id != '148'"></FPrice>
307 313
                   <FPrice :price="orderProductItem.productAttr.price * 30" v-if="item.mer_id == '148'"></FPrice>
308 314
                   <nut-input-number v-model="orderProductItem.cart_num" @change="(num) => handleNumberChange(num, orderProductItem)"/>
@@ -331,11 +337,12 @@ function reTotal() {
331 337
                 :value="item.order.postage_price > 0 ? item.order.postage_price : '免运费'"
332 338
                 arrow
333 339
             ></FCell>
334
-            <FCell
335
-                title="留言"
336
-                value="建议留言前先与商家沟通确认"
337
-                arrow
338
-            ></FCell>
340
+<!--            <FCell-->
341
+<!--                title="留言"-->
342
+<!--                value="建议留言前先与商家沟通确认"-->
343
+<!--                arrow-->
344
+<!--            ></FCell>-->
345
+            <FField label="留言" placeholder="建议留言前先与商家沟通确认" v-model="data.mark" :exClass="['text-right']"/>
339 346
           </div>
340 347
 
341 348
         </div>

+ 5 - 2
src/pages/order/comment.vue

@@ -31,7 +31,7 @@ onLoad((options) => {
31 31
     // console.log(options.detail)
32 32
     detail.value = JSON.parse(decodeBase64(options.detail))
33 33
     // detail.value = JSON.parse(decodeBase64(base64Detail))
34
-  console.log(detail.value)
34
+  // console.log(detail.value)
35 35
   // }
36 36
 })
37 37
 const defaultFileList = ref([])
@@ -84,11 +84,14 @@ function handleSubmit() {
84 84
     product_score: formData.product_score,
85 85
     service_score: formData.service_score
86 86
   }).then(res => {
87
-    console.log(res)
87
+    console.log('评价完成')
88
+    uni.$emit('orderComment')
89
+
88 90
     uni.showToast({
89 91
       title: '评价成功',
90 92
       icon: 'none'
91 93
     }).then(() => {
94
+
92 95
       setTimeout(() => {
93 96
         uni.navigateBack()
94 97
       }, 500)

+ 1 - 1
src/pages/order/components/AllItemList.vue

@@ -115,7 +115,7 @@ onUnmounted(() => {
115 115
 </script>
116 116
 <template>
117 117
   <div class="p-3 flex flex-col">
118
-    <div v-if="state.list.length > 0" class="flex flex-col">
118
+    <div v-if="state.list.length > 0" class="flex flex-col gap-3">
119 119
       <div v-for="(orderItem, index) in state.list" :key="index">
120 120
         <OrderItem :order-item="orderItem" v-if="orderItem.source == 7"/>
121 121
         <OtherOrderItem :item="orderItem" v-else/>

+ 1 - 1
src/pages/order/components/ObligationOrderList.vue

@@ -93,7 +93,7 @@ onUnmounted(() => {
93 93
       <div v-for="(orderItem, index) in state.list" :key="index">
94 94
 <!--        <OrderItem :order-item="orderItem" />-->
95 95
 <!--        <OtherOrderItem :item="orderItem" v-else/>-->
96
-        <OrderObligationItem :order-item="orderItem" />
96
+        <OrderObligationItem :order-item="orderItem" :tab-value="props.tabValue"/>
97 97
       </div>
98 98
       <div class=" flex justify-center items-center text-[12px] text-gray-500"
99 99
            v-if="state.list && state.list.length > 0">

+ 1 - 1
src/pages/order/components/Order2List.vue

@@ -86,7 +86,7 @@ onUnload(() => {
86 86
 </script>
87 87
 <template>
88 88
   <div class="p-3 flex flex-col">
89
-    <div v-if="state.list.length > 0" class="flex flex-col">
89
+    <div v-if="state.list.length > 0" class="flex flex-col gap-3">
90 90
       <div v-for="(orderItem, index) in state.list" :key="index">
91 91
         <OrderItem :order-item="orderItem" />
92 92
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->

+ 1 - 1
src/pages/order/components/Order3List.vue

@@ -103,7 +103,7 @@ onUnload(() => {
103 103
 </script>
104 104
 <template>
105 105
   <div class="p-3 flex flex-col">
106
-    <div v-if="state.list.length > 0" class="flex flex-col">
106
+    <div v-if="state.list.length > 0" class="flex flex-col gap-3">
107 107
       <div v-for="(orderItem, index) in state.list" :key="index">
108 108
         <OrderItem :order-item="orderItem" />
109 109
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->

+ 7 - 7
src/pages/order/components/Order4List.vue

@@ -82,7 +82,11 @@ function handleScrollToLower() {
82 82
 // })
83 83
 onMounted(() => {
84 84
   loadList('reload')
85
-
85
+  uni.$on('orderComment', () => {
86
+    // loadAllOrderList()
87
+    // state.tabvalue = 4
88
+    loadList('reload')
89
+  })
86 90
   uni.$on('onTab4ReachBottom', handleScrollToLower)
87 91
   uni.$on('onTab4PullDownRefresh', () => {
88 92
     loadList('reload', items => {
@@ -93,11 +97,7 @@ onMounted(() => {
93 97
   })
94 98
 })
95 99
 onUnmounted(() => {
96
-  uni.$on('orderComment', () => {
97
-    // loadAllOrderList()
98
-    // state.tabvalue = 4
99
-    loadList('reload')
100
-  })
100
+
101 101
   uni.$off('onTab4ReachBottom');
102 102
   uni.$off('onTab4PullDownRefresh');
103 103
 })
@@ -108,7 +108,7 @@ onUnload(() => {
108 108
 </script>
109 109
 <template>
110 110
   <div class="p-3 flex flex-col">
111
-    <div v-if="state.list.length > 0" class="flex flex-col">
111
+    <div v-if="state.list.length > 0" class="flex flex-col gap-3">
112 112
       <div v-for="(orderItem, index) in state.list" :key="index">
113 113
         <OrderItem :order-item="orderItem" />
114 114
         <!--        <OtherOrderItem :item="orderItem" v-else/>-->

+ 10 - 5
src/pages/order/components/OrderItem.vue

@@ -99,7 +99,7 @@ function handleCancelOrder() {
99 99
 function handlePayment() {
100 100
   const { orderItem } = props
101 101
   uni.navigateTo({
102
-    url: '/pages/payment/index?' + `pay_price=${orderItem.pay_price}&order_id=${orderItem.group_order_id}`
102
+    url: '/pages/payment/index?' + `pay_price=${orderItem.pay_price}&order_id=${orderItem.group_order_id}&tabIndex=${props.tabValue}`
103 103
     // url: `/pages/payment/index`
104 104
   })
105 105
 }
@@ -107,7 +107,7 @@ function handlePayment() {
107 107
 function handleShowOrderDetail(order) {
108 108
   console.log(order)
109 109
   uni.navigateTo({
110
-    url: '/pages/order/detail?detail=' + `${encodeBase64(order)}`
110
+    url: '/pages/order/detail?detail=' + `${encodeBase64(order)}&type=${order.status}`
111 111
   })
112 112
 }
113 113
 
@@ -190,7 +190,7 @@ function handleShowObligationOrderDetail(orderItem) {
190 190
 </script>
191 191
 
192 192
 <template>
193
-  <div class="mb-3 bg-white rounded p-3">
193
+  <div class="bg-white rounded p-3">
194 194
     <div
195 195
         @stop.stop="handleHeaderClick"
196 196
         class="flex items-center justify-between f-hairline-bottom pb-3">
@@ -215,7 +215,10 @@ function handleShowObligationOrderDetail(orderItem) {
215 215
           <div v-for="(orderProduct, orderProductIndex) in order.orderProduct" :key="orderProductIndex">
216 216
             <div class="flex py-2 gap-3">
217 217
               <div class="flex-1 flex gap-2">
218
-                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
218
+                <div class="flex w-20 h-20">
219
+                  <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
220
+
221
+                </div>
219 222
 
220 223
                 <div class="flex flex-col">
221 224
                   <div class="line-clamp-2 text-[12px]">
@@ -266,8 +269,10 @@ function handleShowObligationOrderDetail(orderItem) {
266 269
         <div v-for="(orderProduct, orderProductIndex) in orderItem.orderProduct" :key="orderProductIndex">
267 270
           <div class="flex py-2 gap-3">
268 271
             <div class="flex-1 flex gap-2">
269
-              <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
272
+              <div class="flex w-20 h-20">
273
+                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
270 274
 
275
+              </div>
271 276
               <div class="flex flex-col">
272 277
                 <div class="line-clamp-2 text-[12px]">
273 278
                   {{ orderProduct.cart_info.product.store_name }}

+ 8 - 3
src/pages/order/components/OrderObligationItem.vue

@@ -18,6 +18,9 @@ const props = defineProps({
18 18
   },
19 19
   status: {
20 20
     type: Number,
21
+  },
22
+  tabValue: {
23
+    type: Number,
21 24
   }
22 25
 })
23 26
 
@@ -93,7 +96,7 @@ function handleCancelOrder() {
93 96
 function handlePayment() {
94 97
   const { orderItem } = props
95 98
   uni.navigateTo({
96
-    url: '/pages/payment/index?' + `pay_price=${orderItem.pay_price}&order_id=${orderItem.group_order_id}&OrderList=${JSON.stringify(orderItem)}`
99
+    url: '/pages/payment/index?' + `pay_price=${orderItem.pay_price}&order_id=${orderItem.group_order_id}&OrderList=${JSON.stringify(orderItem)}&tabIndex=${props.tabValue}`
97 100
     // url: `/pages/payment/index`
98 101
   })
99 102
 }
@@ -178,7 +181,7 @@ function handeRefund(orderItem) {
178 181
 
179 182
 function handleShowObligationOrderDetail(orderItem) {
180 183
   uni.navigateTo({
181
-    url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}`
184
+    url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}&type=1`
182 185
   })
183 186
 }
184 187
 </script>
@@ -209,8 +212,10 @@ function handleShowObligationOrderDetail(orderItem) {
209 212
           <div v-for="(orderProduct, orderProductIndex) in order.orderProduct" :key="orderProductIndex">
210 213
             <div class="flex py-2 gap-3">
211 214
               <div class="flex-1 flex gap-2">
212
-                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
215
+                <div class="flex w-20 h-20">
213 216
 
217
+                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
218
+                </div>
214 219
                 <div class="flex flex-col">
215 220
                   <div class="line-clamp-2 text-[12px]">
216 221
                     {{ orderProduct.cart_info.product.store_name }}

Разница между файлами не показана из-за своего большого размера
+ 81 - 27
src/pages/order/detail.vue


+ 45 - 6
src/pages/order/index.vue

@@ -1,9 +1,15 @@
1 1
 <template>
2
-  <CXBBasePage>
2
+<!--  <CXBBasePage>-->
3
+  <FNavBar
4
+      title="我的订单" :left-arrow="true" fixed placeholder z-index="999"
5
+      ex-class="bg-white w-screen"
6
+      @click-left="onClickLeft"
7
+  />
3 8
 
4
-    <!--    <nut-navbar>-->
9
+
10
+  <!--    <nut-navbar>-->
5 11
     <!--      <template #content>-->
6
-    <div class="fixed top-0 bg-white w-full z-2">
12
+    <div class="fixed top-20 bg-white w-full z-2">
7 13
       <nut-tabs v-model="state.tabvalue" class="bg-white">
8 14
         <nut-tab-pane title="全部"></nut-tab-pane>
9 15
         <nut-tab-pane title="待付款"></nut-tab-pane>
@@ -13,15 +19,15 @@
13 19
       </nut-tabs>
14 20
     </div>
15 21
 
16
-    <div class="mt-12">
22
+    <div class="mt-32  pb-safe">
17 23
       <AllItemList v-if="state.tabvalue == 0" :tab-value="0"/>
18
-      <ObligationOrderList v-if="state.tabvalue == 1"/>
24
+      <ObligationOrderList v-if="state.tabvalue == 1" :tab-value="1"/>
19 25
       <Order2List v-if="state.tabvalue == 2" :status="'0'"/>
20 26
       <Order3List v-if="state.tabvalue == 3" :status="'1'"/>
21 27
       <Order4List v-if="state.tabvalue == 4" :status="'2'"/>
22 28
     </div>
23 29
 
24
-  </CXBBasePage>
30
+<!--  </CXBBasePage>-->
25 31
 </template>
26 32
 <script lang="ts" setup>
27 33
 // import { reactive } from 'vue';
@@ -41,6 +47,9 @@ import ObligationOrderList from "~/pages/order/components/ObligationOrderList.vu
41 47
 import Order2List from "~/pages/order/components/Order2List.vue";
42 48
 import Order3List from "~/pages/order/components/Order3List.vue";
43 49
 import Order4List from "~/pages/order/components/Order4List.vue";
50
+import FNavBar from "~/components/FNavBar/FNavBar.vue";
51
+const pageStore = usePageStoreWidthOut()
52
+
44 53
 
45 54
 const state = reactive({
46 55
   tabvalue: 0,
@@ -52,6 +61,7 @@ const state = reactive({
52 61
   obligationOrderList: [],
53 62
 
54 63
   orderList: [],
64
+  from: null
55 65
 });
56 66
 
57 67
 const getStatusVal = () => {
@@ -67,9 +77,13 @@ const getStatusVal = () => {
67 77
   }
68 78
 }
69 79
 onLoad(options => {
80
+  console.log(options)
70 81
   if (options && options.tabIndex) {
71 82
     state.tabvalue = options.tabIndex
72 83
   }
84
+  if (options && options.from) {
85
+    state.from = options.from
86
+  }
73 87
   // loadAllOrderList()
74 88
 
75 89
   // 监听事件
@@ -223,10 +237,35 @@ onPullDownRefresh(() => {
223 237
 //   }
224 238
 // })
225 239
 
240
+function onClickLeft() {
226 241
 
242
+  if (state.tabvalue == 1 && state.from && state.from == 'payment') {
243
+    if (pageStore && pageStore.orderBack) {
244
+      console.log(pageStore.orderBack)
245
+      if (pageStore.orderBack.type === 'tab') {
246
+        uni.switchTab({
247
+          url: pageStore.orderBack.url
248
+        })
249
+      } else {
250
+        uni.reLaunch({
251
+          url: pageStore.orderBack.url
252
+        })
253
+      }
254
+    } else {
255
+      uni.navigateBack()
256
+    }
257
+  } else {
258
+    // uni.navigateBack({
259
+    // })
260
+    uni.switchTab({
261
+      url: '/pages/user/index'
262
+    })
263
+  }
264
+}
227 265
 </script>
228 266
 <route lang="yaml">
229 267
 style:
268
+  navigationStyle: custom
230 269
   navigationBarTitleText: 我的订单
231 270
   enablePullDownRefresh: true
232 271
 </route>

+ 39 - 22
src/pages/order/obligation-detail.vue

@@ -22,7 +22,7 @@ onLoad((options) => {
22 22
   // console.log(options.detail)
23 23
   if (options.detail) {
24 24
     detail.value = JSON.parse(decodeBase64(options.detail))
25
-    console.log(detail.value)
25
+    // console.log(detail.value)
26 26
   // detail.value = JSON.parse(decodeBase64(base64Json))
27 27
   }
28 28
 })
@@ -124,29 +124,38 @@ function handleComment() {
124 124
 
125 125
 const payType = computed(() => {
126 126
   // detail.pay_type
127
-  if ('0' == detail.value.pay_type) {
128
-    return '余额'
129
-  }
130
-  if ('1' == detail.value.pay_type) {
131
-    return '微信'
132
-  }
133
-  if ('2' == detail.value.pay_type) {
134
-    return '小程序'
135
-  }
136
-  if ('3' == detail.value.pay_type) {
137
-    return 'h5'
138
-  }
127
+  // if ('0' == detail.value.pay_type) {
128
+  //   return '余额'
129
+  // }
130
+  // if ('1' == detail.value.pay_type) {
131
+  //   return '微信'
132
+  // }
133
+  // if ('2' == detail.value.pay_type) {
134
+  //   return '小程序'
135
+  // }
136
+  // if ('3' == detail.value.pay_type) {
137
+  //   return 'h5'
138
+  // }
139 139
   if ('4' == detail.value.pay_type) {
140 140
     return '支付宝'
141 141
   }
142
-  if ('5' == detail.value.pay_type) {
142
+  else if ('5' == detail.value.pay_type) {
143 143
     return '积分兑换'
144
+  } else {
145
+    return '微信支付'
144 146
   }
145 147
 })
146
-
148
+function handleProductItemClick(
149
+    item
150
+) {
151
+  console.log(item.product_id)
152
+  // 大仓
153
+  uni.navigateTo({
154
+    url: `/pages/store/product/detail?id=${item.product_id}`
155
+  })
156
+}
147 157
 </script>
148 158
 <template>
149
-  <CXBBasePage>
150 159
     <div class="p-3 flex flex-col gap-3 pb-safe text-[12px]" v-if="detail">
151 160
       <div
152 161
           class="rounded bg-white p-3 flex">
@@ -186,11 +195,13 @@ const payType = computed(() => {
186 195
         <div v-for="(order, index) in detail.orderList" :key="index">
187 196
           <div v-for="(orderProduct, orderProductIndex) in order.orderProduct" :key="orderProductIndex">
188 197
             <div class="flex py-2 gap-3">
189
-              <div class="flex-1 flex gap-2">
198
+              <div class="flex-1 flex gap-2"  @tap.stop="handleProductItemClick(orderProduct)">
190 199
                 <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
191 200
 
192 201
                 <div class="flex flex-col">
193
-                  <div class="line-clamp-2 text-[12px]">
202
+                  <div class="line-clamp-2 text-[12px]"
203
+                       @tap.stop="handleProductItemClick(orderProduct)"
204
+                  >
194 205
                     {{ orderProduct.cart_info.product.store_name }}
195 206
                   </div>
196 207
                   <div class="text-gray-500 text-[10px]">
@@ -200,7 +211,8 @@ const payType = computed(() => {
200 211
               </div>
201 212
 
202 213
               <div class="flex flex-col justify-center items-center">
203
-                <FPrice :price="orderProduct.cart_info.productAttr.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
214
+<!--                <FPrice :price="orderProduct.cart_info.productAttr.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
215
+                <FPrice :price="detail.total_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
204 216
                 <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
205 217
               </div>
206 218
 
@@ -230,6 +242,7 @@ const payType = computed(() => {
230 242
             <div>实付款</div>
231 243
             <div class="text-gray">
232 244
               <FPrice :price="detail.pay_price" ex-class="font-bold text-xl"></FPrice>
245
+
233 246
             </div>
234 247
           </div>
235 248
 <!--          <div class="flex justify-between">-->
@@ -250,6 +263,7 @@ const payType = computed(() => {
250 263
 <!--            private String pay_type;//支付方式 0余额 1微信 2小程序 4支付宝 5特殊商户积分-->
251 264
 
252 265
             <div>支付方式</div>
266
+
253 267
             <div class="text-gray">{{ payType }}</div>
254 268
 <!--            <div class="text-gray">{{ detail.pay_type === '1' ? '微信' : '支付宝' }}</div>-->
255 269
           </div>
@@ -271,11 +285,14 @@ const payType = computed(() => {
271 285
 
272 286
       </div>
273 287
     </div>
274
-  </CXBBasePage>
275 288
 </template>
276 289
 
277 290
 <route lang="yaml">
278 291
 style:
279
-  navigationBarTitleText: 订单详情
292
+  navigationBarTitleText: 待付款
280 293
 </route>
281
-
294
+<style>
295
+page {
296
+  background: #f8f8f8;
297
+}
298
+</style>

+ 125 - 176
src/pages/order/test.json

@@ -1,199 +1,148 @@
1 1
 {
2
-  "status": 200,
3
-  "message": "success",
4 2
   "data": {
5
-    "express": [
3
+    "thirdPartyWaresList": [
6 4
       {
7
-        "time": "2023-09-20 19:06:01",
8
-        "status": "【廊坊市】 您的快递已签收,签收人在【廊坊三河燕郊四季花都店】取件。如有疑问请联系业务员:15103369570,代理点电话:18133879513,投诉电话:0316-6840606。感谢使用中通快递,期待再次为您服务!"
5
+        "thumb": "https://img.alicdn.com/imgextra/i4/2214949670367/O1CN01bb9Lai1Ea89vEl5O9_!!2214949670367.jpg",
6
+        "price": 29.9,
7
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=10239350485908651&activityId=f88383df63cf460b9955b669da1474c1",
8
+        "name": "【10瓶礼盒装】轻上椰汁椰泰集团椰子汁椰奶椰乳生椰植物蛋白饮料",
9
+        "coupon_money": 30,
10
+        "market_price": 59.9,
11
+        "commission": "3.74",
12
+        "commission_rate": 25.01,
13
+        "id": "egX63bsDtqgabxs84VCzt0-nJAVXpdHxAaDAM9nCB",
14
+        "type": 5,
15
+        "commission_type": 3,
16
+        "sales": 61
9 17
       },
10 18
       {
11
-        "time": "2023-09-20 11:59:15",
12
-        "status": "【廊坊市】 快件已在 快递超市 的【廊坊三河燕郊四季花都店】暂放,【取件地址:四季花都一期底商华联超市里】,请及时取件。如有疑问请联系业务员:15103369570,代理点电话:18133879513,投诉电话:0316-6840606"
19
+        "thumb": "https://img.alicdn.com/imgextra/i2/4032980305/O1CN01Xy0vAd1E7jYf2qFuJ_!!4032980305.png",
20
+        "price": 55,
21
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=261209468136787584&activityId=f354d32ff85f4a96ac988683b6ceead8",
22
+        "name": "舒比奇维E敏感肌拉拉裤XL尿不湿L-3XL大码婴儿纸尿裤超薄透气夏季",
23
+        "coupon_money": 29,
24
+        "market_price": 84,
25
+        "commission": "5.50",
26
+        "commission_rate": 20,
27
+        "id": "0orG64I7tz4MgMi0VWS2t6-eQGMq6ACGGmdZXq6Uj",
28
+        "type": 5,
29
+        "commission_type": 3,
30
+        "sales": 96
13 31
       },
14 32
       {
15
-        "time": "2023-09-20 08:22:21",
16
-        "status": "【廊坊市】东燕郊 的业务员【5区承包区王田祥,15103369570】正在第2次派件(95720为中通快递员外呼专属号码,请放心接听,如有问题可联系网点:0316-6840606,投诉电话:0316-6840606)"
33
+        "thumb": "https://img.alicdn.com/imgextra/i1/2256668114/O1CN01Sj3Ujm29oGSPN2nRE_!!2256668114.jpg",
34
+        "price": 59.9,
35
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=1986899349&activityId=d34051f5ba4d45e09a042df69e898278",
36
+        "name": "【顺丰包邮】杜蕾斯避孕安全套男用超薄女螺纹情趣官方旗舰店正品",
37
+        "coupon_money": 20,
38
+        "market_price": 79.9,
39
+        "commission": "5.09",
40
+        "commission_rate": 17,
41
+        "id": "gx0Xagh3tYrD0Msowpiatr-9za58Xohq46x8mpfrX",
42
+        "type": 5,
43
+        "commission_type": 3,
44
+        "sales": 345
17 45
       },
18 46
       {
19
-        "time": "2023-09-20 03:03:24",
20
-        "status": "【廊坊市】 快件已到达 东燕郊"
47
+        "thumb": "https://img.alicdn.com/i3/2215128201652/O1CN01bPbo0I1O4f6QkO66Y_!!2215128201652.png",
48
+        "price": 9.9,
49
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=4765056360938372755&activityId=44d8968be5ba43798a9c45e4baf7f58e",
50
+        "name": "幸棉安睡裤臻柔卫生巾安心裤女经期用防漏姨妈裤亲肤夜安裤产后用",
51
+        "coupon_money": 10,
52
+        "market_price": 19.9,
53
+        "commission": "1.49",
54
+        "commission_rate": 30.01,
55
+        "id": "GB7kQef8tGzeO9iYxgTQtJ-YJGeOZNHB6Qd5Kxzhb",
56
+        "type": 5,
57
+        "commission_type": 3,
58
+        "sales": 359
21 59
       },
22 60
       {
23
-        "time": "2023-09-19 14:46:55",
24
-        "status": "【保定市】 快件已发往 东燕郊"
61
+        "thumb": "https://gw.alicdn.com/bao/uploaded/i2/880734502/O1CN01wRV5mu1j7xuGomAM1_!!880734502.png",
62
+        "price": 14.9,
63
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=4827930842443574424&activityId=f3ad10dfc39246eeb147e82d63b40b28",
64
+        "name": "【三只松鼠_纯奶手撕面包480g】吐司包早餐蛋糕健康零食代餐整箱",
65
+        "coupon_money": 2,
66
+        "market_price": 16.9,
67
+        "commission": "0.82",
68
+        "commission_rate": 11.05,
69
+        "id": "pb0ZAPtxt4J9vmueAjHptm-pBx2XAdIRgJOR5gBuq8",
70
+        "type": 5,
71
+        "commission_type": 3,
72
+        "sales": 38
25 73
       },
26 74
       {
27
-        "time": "2023-09-19 14:38:48",
28
-        "status": "【保定市】 快件已到达 京南转运中心"
75
+        "thumb": "https://img.alicdn.com/i2/1998320687/O1CN01HcGJAc1Gwgxdowm6y_!!1998320687.png",
76
+        "price": 19,
77
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=1998320687&activityId=d98c94119e034af792a8500ba4b41757",
78
+        "name": "泰国正品皇家秘方止痒膏全身体皮肤适用大人婴儿天然草本防叮驱蚊",
79
+        "coupon_money": 80,
80
+        "market_price": 99,
81
+        "commission": "3.80",
82
+        "commission_rate": 40,
83
+        "id": "DAJMkXiDtzDwrPfQpAhjtn-6RmxkGoIyJqjMGM6Cz",
84
+        "type": 5,
85
+        "commission_type": 3,
86
+        "sales": 0
29 87
       },
30 88
       {
31
-        "time": "2023-09-18 08:13:02",
32
-        "status": "【广州市】 快件已发往 京南转运中心"
89
+        "thumb": "https://img.alicdn.com/imgextra/i2/1715621442/O1CN01B8U3Pj1MWTw3u9g0S_!!1715621442.jpg",
90
+        "price": 9.9,
91
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=4756012865041860746&activityId=ff8c18028ee246e7a6d5c6a78e40ff55",
92
+        "name": "【超值12片试用】全棉时代奈丝公主日用卫生巾纯棉姨妈巾10+2片",
93
+        "coupon_money": 10,
94
+        "market_price": 19.9,
95
+        "commission": "0.50",
96
+        "commission_rate": 10,
97
+        "id": "n5bG3mSMtgVNxKFkQet0tP-mPkBXe3U75bj7z2kcBg",
98
+        "type": 5,
99
+        "commission_type": 3,
100
+        "sales": 56
33 101
       },
34 102
       {
35
-        "time": "2023-09-18 08:09:19",
36
-        "status": "【广州市】 快件已到达 广州中心"
103
+        "thumb": "https://img.alicdn.com/imgextra/i3/1015383959/O1CN01WzrUEq1f7GrAUkvLr_!!1015383959.png",
104
+        "price": 29.9,
105
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=225181641373589649&activityId=73683b83fcd0404b916271af8446ed82",
106
+        "name": "【狂暑购不停】福派电动牙刷成人充电自动声波软毛情侣款套装男女",
107
+        "coupon_money": 56,
108
+        "market_price": 85.9,
109
+        "commission": "2.99",
110
+        "commission_rate": 20,
111
+        "id": "jOb5A4t0t698o5CBezfJte-26VpOQjCOndP5zoDs3n",
112
+        "type": 5,
113
+        "commission_type": 3,
114
+        "sales": 155
37 115
       },
38 116
       {
39
-        "time": "2023-09-18 04:00:18",
40
-        "status": "【广州市】 快件已发往 京南转运中心"
117
+        "thumb": "https://img.alicdn.com/imgextra/i2/2212514663/O1CN019p84kk1kJhgYKBUjJ_!!2212514663.png",
118
+        "price": 4.9,
119
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=b32cce093396421facde31ee495e8861",
120
+        "name": "喵满分原木浆茶香纯品抽纸3包/提",
121
+        "coupon_money": 2,
122
+        "market_price": 6.9,
123
+        "commission": "0.21",
124
+        "commission_rate": 8.5,
125
+        "id": "zRomg2FetpJN5nfv8aUdt4-RgG3Qn8cVK8vp2Q9fYK",
126
+        "type": 5,
127
+        "commission_type": 3,
128
+        "sales": 119
41 129
       },
42 130
       {
43
-        "time": "2023-09-17 23:07:14",
44
-        "status": "【广州市】 广州夏茅(020-22505305)陈美玲(15397525882) 已揽收"
131
+        "thumb": "https://img.alicdn.com/i3/705235443/O1CN01qX8n971q4wcAlmvBh_!!705235443.jpg",
132
+        "price": 35.6,
133
+        "coupon_share_url": "https://uland.taobao.com/quan/detail?sellerId=154248287510213289&activityId=6c4c5a8c6b3f49099370eec50063b894",
134
+        "name": "老金磨方无糖黑芝麻丸老金磨坊正品官方旗舰店代餐早餐五黑芝麻球",
135
+        "coupon_money": 120,
136
+        "market_price": 155.6,
137
+        "commission": "3.56",
138
+        "commission_rate": 20,
139
+        "id": "PDJm7ds3tOwrgZtv9wFPt6-nJAVXpdHQ4KPGNkDCP",
140
+        "type": 5,
141
+        "commission_type": 3,
142
+        "sales": 292
45 143
       }
46
-    ],
47
-    "order": {
48
-      "order_id": "4265",
49
-      "group_order_id": "4659",
50
-      "order_sn": "wx1695261950701957251",
51
-      "uid": "10753",
52
-      "real_name": "测试",
53
-      "user_phone": "18513112593",
54
-      "user_address": "北京顺义区光明街道 测试",
55
-      "user_address_ids": "1,35,493,0",
56
-      "area_manage_address_ids": "",
57
-      "cart_id": "11517",
58
-      "total_num": "1",
59
-      "total_price": "600.00",
60
-      "total_postage": "10.00",
61
-      "pay_price": "610.00",
62
-      "pay_postage": "10.00",
63
-      "extension_one": "59.64",
64
-      "extension_two": "0.00",
65
-      "commission_rate": "2.0000",
66
-      "coupon_id": "",
67
-      "coupon_price": "0.00",
68
-      "order_type": "0",
69
-      "paid": "1",
70
-      "pay_time": "2023-09-21 10:31:32",
71
-      "pay_type": "5",
72
-      "create_time": "2023-09-21 10:05:51",
73
-      "status": "1",
74
-      "delivery_type": "1",
75
-      "delivery_name": "中通快递",
76
-      "delivery_id": "78367406471357",
77
-      "mark": "",
78
-      "remark": null,
79
-      "admin_mark": null,
80
-      "verify_code": null,
81
-      "verify_time": null,
82
-      "verify_service_id": "0",
83
-      "mer_id": "465",
84
-      "reconciliation_id": "0",
85
-      "cost": "300.00",
86
-      "is_del": "0",
87
-      "is_system_del": "0",
88
-      "remind": "0",
89
-      "remind_time": null,
90
-      "gzc": "0",
91
-      "trade_no": "",
92
-      "channel_trade_no": "",
93
-      "alipay_no": "",
94
-      "weixin_no": "",
95
-      "table_id": "0",
96
-      "mer_money": "549.00",
97
-      "last_status": null,
98
-      "share_id": "0",
99
-      "pay_mer_id": null,
100
-      "is_split_to_tomorrow": "0",
101
-      "service_money": "361.00",
102
-      "test_order": "0",
103
-      "dacang_id": "0",
104
-      "distribution_mode": "0",
105
-      "da_cang_profit": "0.00",
106
-      "recommended_merchants": "0.00",
107
-      "mer_fanyong": "61.00",
108
-      "is_dacang": "0",
109
-      "cost_price": null,
110
-      "douhuomall": null,
111
-      "douhuomall_status": null,
112
-      "douhuomall_msg": null,
113
-      "address_id": "289",
114
-      "douhuomall_order_no": null,
115
-      "supply_type": null,
116
-      "seckill": "0",
117
-      "orderProduct": [
118
-        {
119
-          "order_product_id": "4535",
120
-          "order_id": "4265",
121
-          "uid": "10753",
122
-          "cart_id": "11517",
123
-          "product_id": "6101",
124
-          "extension_one": "0.00",
125
-          "extension_two": "0.00",
126
-          "product_sku": "4fdae5562b10",
127
-          "is_refund": "0",
128
-          "product_num": "1",
129
-          "refund_num": "1",
130
-          "is_reply": "0",
131
-          "product_price": "600.00",
132
-          "cart_info": {
133
-            "product": {
134
-              "product_id": "6101",
135
-              "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-09-04\/782c3202309041605416214.png",
136
-              "store_name": "头层牛皮女粗高跟骑士靴2023年秋冬款绑带休闲靴薄绒长筒靴女",
137
-              "is_show": "1",
138
-              "status": "1",
139
-              "is_del": "0",
140
-              "unit_name": "双",
141
-              "price": "500.00",
142
-              "mer_status": "1",
143
-              "temp_id": "257",
144
-              "give_coupon_ids": [],
145
-              "is_gift_bag": "0",
146
-              "is_used": "1",
147
-              "product_type": "0",
148
-              "old_product_id": "0",
149
-              "temp": {
150
-                "shipping_template_id": "257",
151
-                "name": "有运费的模板",
152
-                "type": "0",
153
-                "appoint": "0",
154
-                "undelivery": "0",
155
-                "mer_id": "465",
156
-                "is_default": "0",
157
-                "sort": "10",
158
-                "create_time": "2023-09-09 09:22:39",
159
-                "regionAddress": {
160
-                  "shipping_template_region_id": "609",
161
-                  "temp_id": "257",
162
-                  "city_id": "0",
163
-                  "first": "1.00",
164
-                  "first_price": "10.00",
165
-                  "continue": "1.00",
166
-                  "continue_price": "5.00"
167
-                },
168
-                "undelives": null,
169
-                "freeAddress": null
170
-              }
171
-            },
172
-            "productAttr": {
173
-              "gong_mer_profit": null,
174
-              "gong_pension": null,
175
-              "gong_market_price": null,
176
-              "cost_price": null,
177
-              "product_id": "6101",
178
-              "stock": "7",
179
-              "price": "600.00",
180
-              "unique": "4fdae5562b10",
181
-              "sku": "黄,36",
182
-              "volume": "0.00",
183
-              "weight": "0.00",
184
-              "ot_price": "8000.00",
185
-              "dacang_price": "0.00",
186
-              "cost": "300.00",
187
-              "bc_extension_one": 0,
188
-              "bc_extension_two": 0,
189
-              "seckill": 0
190
-            },
191
-            "product_type": "0"
192
-          },
193
-          "create_time": "2023-09-21 10:05:50",
194
-          "type": "1"
195
-        }
196
-      ]
197
-    }
198
-  }
144
+    ]
145
+  },
146
+  "message": "成功",
147
+  "status": 200
199 148
 }

+ 642 - 0
src/pages/order_addcart/index-bak.vue

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

+ 102 - 160
src/pages/order_addcart/index.vue

@@ -1,7 +1,7 @@
1 1
 <script lang="ts" setup>
2 2
 import {getRecommendList} from "~/apis/merchant";
3 3
 import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
4
-import {deleteCartItem, getCartList} from "~/apis/user";
4
+import {deleteCartItem, getCartCount, getCartList} from "~/apis/user";
5 5
 import type {ShoppingResult} from "~/apis/model/shopping.model";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7 7
 import FButton from "~/components/FButton/FButton.vue";
@@ -19,6 +19,9 @@ import {uniq} from "lodash-es";
19 19
 import {cartChange} from "~/apis/order.api";
20 20
 const gouwucheImage = CDN_URL + '/static/assets/gouwuche.png'
21 21
 const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
22
+const pageStore = usePageStoreWidthOut()
23
+
24
+
22 25
 const state = reactive({
23 26
   recommendList: [],
24 27
   currentPage: 1,
@@ -39,13 +42,27 @@ const state = reactive({
39 42
 
40 43
 const shopping = ref<ShoppingResult>()
41 44
 
42
-onShow(() => {
45
+onLoad((options) => {
46
+  uni.$on('cart-reload', () => {
47
+    // console.log('新商品添加...')
48
+    state.cart_id = []
49
+    loadCartList()
50
+  })
51
+
43 52
   state.cart_id = []
44 53
   loadCartList()
54
+})
55
+onShow(() => {
56
+  // pageStore.setPageConfig({
57
+  //   orderBack: {
58
+  //     type: 'tab',
59
+  //     url:  '/pages/order_addcart/index'
60
+  //   }
61
+  // })
45 62
   if (!state.isManage) {
46 63
     state.isManage = true
47 64
   }
48
-
65
+  loadCartCount()
49 66
   loadList('reload')
50 67
 })
51 68
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -96,10 +113,11 @@ onReachBottom(() => {
96 113
 
97 114
 // 加载购物车数据
98 115
 function loadCartList() {
116
+  // state.totalCartCount = 0
99 117
   getCartList().then(res => {
100 118
     shopping.value = res
101 119
 
102
-    console.log(res)
120
+    // console.log(res)
103 121
     shopping.value?.list.forEach((shopItem, index) => {
104 122
       // shopItem.allCheck = true
105 123
 
@@ -109,7 +127,7 @@ function loadCartList() {
109 127
         goodItem.check = false
110 128
         // state.cart_id.push(goodItem.cart_id)
111 129
         // if (goodItem.cart_num === 1) {}
112
-        state.totalCartCount += Number.parseInt(goodItem.cart_num)
130
+        // state.totalCartCount += Number.parseInt(goodItem.cart_num)
113 131
       })
114 132
       // console.log(shopItem)
115 133
 
@@ -147,26 +165,37 @@ const totalMoney = ref(0)
147 165
 const isAllSelect = ref(false)
148 166
 
149 167
 function handleGoodsItemCheck(check) {
150
-  // console.log('good item check....')
151
-  // console.log(check)
152
-  // if (isAllSelect.value) {return}
153
-  // cartAllCheck('single')
154
-  _singleCheck()
168
+  cartAllCheck('single')
155 169
 }
156 170
 
157 171
 function shopCheck(shopItem) {
158
-  console.log('shop check...')
159
-  console.log(shopItem)
160
-  if (shopItem.allCheck && !shopItem.indeterminate) {
161
-    console.log(shopItem)
162
-    shopItem.list.forEach((good, index) => {
163
-      good.check = true
164
-    })
172
+  // console.log('shoo...')
173
+  // if (type === 'active') {
174
+  //   console.log('shooo...')
175
+  //   if (shopItem.allCheck) {
176
+  //     console.log(shopItem)
177
+  //     shopItem.list.forEach((good, index) => {
178
+  //       good.check = true
179
+  //     })
180
+  //     // cartAllCheck('single')
181
+  //
182
+  //   } else {
183
+  //     shopItem.list.forEach((good, index) => {
184
+  //       good.check = false
185
+  //     })
186
+  //   }
187
+  // }
188
+}
165 189
 
190
+function handleShopTitleClick(shopItem) {
191
+  if (shopItem.allCheck) {
192
+        shopItem.list.forEach((good, index) => {
193
+          good.check = true
194
+        })
166 195
   } else {
167
-    shopItem.list.forEach((good, index) => {
168
-      good.check = false
169
-    })
196
+        shopItem.list.forEach((good, index) => {
197
+          good.check = false
198
+        })
170 199
   }
171 200
 }
172 201
 function cartAllCheck(type: 'single' | 'all') {
@@ -175,125 +204,34 @@ function cartAllCheck(type: 'single' | 'all') {
175 204
   let totalNum = 0
176 205
   state.currentType = type
177 206
 
178
-  console.log(type)
207
+  // console.log(type)
179 208
   shopping.value?.list.forEach((goods, index) => {
180 209
     if (type === 'single') {
181 210
       // 如果单选的情况下, 获取已选中的
182 211
       let tempArr = goods.list.filter(goodItem => {
183 212
         // if (goodItem.check) {
184
-          return goodItem.check === true
213
+        return goodItem.check === true
185 214
         // }
186 215
       })
187
-      console.log(goods.list.length + '购物车长度')
216
+      // console.log(tempArr)
188 217
       if (goods.list.length === tempArr.length) {
189
-        console.log('这里是全选状态了。。。。')
190 218
         goods.allCheck = true
191 219
         allArr.push(goods)
192
-        goods.indeterminate = false
193
-        return
194
-      }
195
-
196
-      console.log(tempArr.length + '---当长长度')
197
-      if (tempArr.length > 0) {
198
-        goods.indeterminate = true
199
-        return
220
+        // goods.indeterminate = false
200 221
       }
201
-      if (tempArr.length <= 0) {
222
+      if (tempArr.length < goods.list.length) {
202 223
         goods.allCheck = false
203
-        state.currentType = 'all'
204
-        state.indeterminate = false
205
-        return
206
-      }
207
-    } else {
208
-      console.log('alll type......')
209
-      goods.list.forEach(goodItem => {
210
-        goodItem.check = isAllSelect.value
211
-      })
212
-      goods.allCheck = isAllSelect.value
213
-      if (goods.allCheck) {
214
-        allArr.push(goods)
215
-      }
216
-    }
217
-
218
-    // 总金额|总数
219
-    goods.list.forEach(goodItem => {
220
-      if (goodItem.check) {
221
-        totalMoney += (goodItem.productAttr.price * goodItem.cart_num)
222
-        totalNum += Number.parseFloat(goodItem.cart_num)
223
-        state.cart_id.push(goodItem.cart_id)
224
-      }
225
-    })
226
-  })
227
-
228
-  isAllSelect.value = allArr.length === shopping.value?.list.length
229
-  // state.totalCartCount = totalNum
230
-  state.totalPrice = totalMoney
231
-}
232
-
233
-function _singleCheck() {
234
-  state.currentType = 'single'
235
-  let allArr = []
236
-  let totalMoney = 0
237
-  let totalNum = 0
238
-  state.cart_id = []
239
-  shopping.value?.list.forEach((goods, index) => {
240
-      // 如果单选的情况下, 获取已选中的
241
-      let tempArr = goods.list.filter(goodItem => {
242
-        // if (goodItem.check) {
243
-        return goodItem.check === true
244
-        // }
245
-      })
246
-      if (goods.list.length === tempArr.length) {
247
-        goods.allCheck = true
248
-        allArr.push(goods)
249
-        goods.indeterminate = false
250 224
       }
251 225
 
252
-      if (tempArr.length > 0) {
253
-        goods.indeterminate = true
254
-      }
226
+      // if (tempArr.length > 0) {
227
+      //   goods.indeterminate = true
228
+      // }
255 229
       if (tempArr.length <= 0) {
256
-        console.log('没有选中的了。。。')
257 230
         goods.allCheck = false
258
-        state.currentType = 'all'
259
-        goods.indeterminate = false
231
+        // state.currentType = 'all'
232
+        // state.indeterminate = false
260 233
       }
261
-
262
-    // 总金额|总数
263
-    goods.list.forEach(goodItem => {
264
-      if (goodItem.check) {
265
-        console.log(goodItem)
266
-
267
-        totalMoney += (goodItem.productAttr.price * goodItem.cart_num)
268
-        console.log(totalMoney)
269
-        totalNum += Number.parseFloat(goodItem.cart_num)
270
-        state.cart_id.push(goodItem.cart_id)
271
-      }
272
-    })
273
-  })
274
-  if (allArr.length === shopping.value?.list.length) {
275
-    isAllSelect.value = true
276
-    state.currentType = 'all'
277
-  } else if (allArr.length > 0){
278
-    state.selectAllIndeterminate = true
279
-  } else {
280
-    isAllSelect.value = false
281
-
282
-  }
283
-  state.totalPrice = totalMoney
284
-}
285
-function _selectAll() {
286
-  // if current == single 说明刚才操作的置为多选是从这里来的?
287
-  console.log(state.currentType)
288
-  state.currentType = 'all'
289
-  let allArr = []
290
-  let totalMoney = 0
291
-  let totalNum = 0
292
-  // state.currentType = type
293
-  //
294
-  // console.log(type)
295
-  shopping.value?.list.forEach((goods, index) => {
296
-
234
+    } else {
297 235
       goods.list.forEach(goodItem => {
298 236
         goodItem.check = isAllSelect.value
299 237
       })
@@ -301,6 +239,7 @@ function _selectAll() {
301 239
       if (goods.allCheck) {
302 240
         allArr.push(goods)
303 241
       }
242
+    }
304 243
 
305 244
     // 总金额|总数
306 245
     goods.list.forEach(goodItem => {
@@ -317,11 +256,6 @@ function _selectAll() {
317 256
   state.totalPrice = totalMoney
318 257
 }
319 258
 
320
-// watch(() => isAllSelect.value, (val) => {
321
-//   if (!val) {
322
-//     state.cart_id = []
323
-//   }
324
-// })
325 259
 
326 260
 function reTotal() {
327 261
   let allArr = []
@@ -333,45 +267,51 @@ function reTotal() {
333 267
     goods.list.forEach(goodItem => {
334 268
       if (goodItem.check) {
335 269
         totalMoney += (goodItem.productAttr.price * goodItem.cart_num)
336
-        totalNum += Number.parseFloat(goodItem.cart_num)
337 270
         // state.cart_id.push(goodItem.cart_id)
338 271
       }
272
+      totalNum += Number.parseFloat(goodItem.cart_num)
273
+
339 274
     })
340 275
   })
341 276
 
342 277
   // isAllSelect.value = allArr.length === shopping.value?.list.length
343 278
   // state.totalCartCount = totalNum
279
+  loadCartCount()
344 280
   state.totalPrice = totalMoney
345 281
 }
346 282
 function handleSelectAll(checked: boolean) {
347
-  // 如何区分是由当前的 checkbox 发起的?要区
348
-  // console.log(state.currentType + '这里是当前类型。。。。')
349 283
 
350
-  if (state.currentType === 'single') {
351
-    return
352
-  //   _singleCheck()
353
-  }
354
-  _selectAll()
355
-  // if (state.currentType == 'single') {
356
-  //   return
357
-  // }
358
-  // console.log(isAllSelect.value)
359
-  // if (isAllSelect.value) {
360
-  // cartAllCheck('all')
284
+  cartAllCheck('all')
361 285
 
362
-  // }
363
-  // console.log('000')
364
-  // isAllSelect.value = !isAllSelect.value
365
-  // isAllSelect.value = checked
366
-  // 这里需要修改 checkbox 的检查
367 286
 }
287
+function loadCartCount() {
288
+  getCartCount().then(res => {
289
+    // console.log(res)
290
+    // state.cartCount = res[0].count
291
+    state.totalCartCount = res[0].count
292
+
293
+  }).catch(error => {
294
+    // console.log(error)
295
+    if (error === '请登录') {
296
+      // uni.showToast({
297
+      //   title: '请登录',
298
+      //   icon: 'none'
299
+      // })
300
+      setTimeout(() => {
301
+        uni.navigateTo({
302
+          url: '/pages/user/login/index?key=4'
303
+        })
304
+      }, 500)
368 305
 
306
+    }
307
+  })
308
+}
369 309
 function handleManageCart() {
370 310
   state.isManage = !state.isManage
371 311
 }
372 312
 
373 313
 function handleSubmit() {
374
-  console.log(state.isManage)
314
+  // console.log(state.isManage)
375 315
 
376 316
   if (!state.isManage) {
377 317
     handleDelete()
@@ -450,15 +390,15 @@ function handleProductItemClick(
450 390
   //   })
451 391
   // }
452 392
   // 大仓
453
-    uni.navigateTo({
454
-      url: `/pages/store/product/detail?id=${item.product_id}`
455
-    })
393
+  uni.navigateTo({
394
+    url: `/pages/store/product/detail?id=${item.product_id}`
395
+  })
456 396
 }
457 397
 
458 398
 function handleNumberChange(num, goodItem) {
459
-  console.log(goodItem)
399
+  // console.log(goodItem)
460 400
   uni.showLoading()
461
-  console.log(num)
401
+  // console.log(num)
462 402
   cartChange(goodItem.cart_id, num).then(res => {
463 403
     reTotal()
464 404
     uni.hideLoading()
@@ -508,14 +448,17 @@ function handleNumberChange(num, goodItem) {
508 448
           <div
509 449
               class="f-hairline-bottom flex  items-center font-bold p-3"
510 450
           >
451
+            <div @tap.stop="handleShopTitleClick(shopItem)">
452
+
511 453
             <nut-checkbox v-model="shopItem.allCheck"
512
-                          @change="shopCheck(shopItem)"
513
-                          :indeterminate="shopItem.indeterminate"
454
+                          @change="(checked) => shopCheck( shopItem)"
514 455
                           label="全选"
515 456
                           class="!text-primary"
516 457
             >
517 458
               {{ shopItem.mer_name }}
518 459
             </nut-checkbox>
460
+            </div>
461
+
519 462
           </div>
520 463
           <div v-for="(goodItem, goodIndex) in shopItem.list"
521 464
                :key="goodIndex"
@@ -528,6 +471,7 @@ function handleNumberChange(num, goodItem) {
528 471
                             class="!text-primary"
529 472
               ></nut-checkbox>
530 473
               <image
474
+                  @click="handleProductItemClick(goodItem)"
531 475
                   :src="goodItem.product.image"
532 476
                   mode="aspectFill" class="w-18 h-18 rounded"
533 477
               ></image>
@@ -595,12 +539,10 @@ function handleNumberChange(num, goodItem) {
595 539
   </div>
596 540
 
597 541
   <div v-if="hasShopping"
598
-      class="fixed bottom-0 w-full z-3">
542
+       class="fixed bottom-0 w-full z-3">
599 543
     <div class="bg-white h-10 flex justify-between" v-if="shopping && shopping.list">
600
-      <div class="flex justify-center items-center gap-2 pl-3">
544
+      <div class="flex justify-center items-center gap-2 pl-3" @tap.stop="handleSelectAll">
601 545
         <nut-checkbox v-model="isAllSelect"
602
-                      @change="handleSelectAll"
603
-                      :indeterminate="state.selectAllIndeterminate"
604 546
                       label="全选"
605 547
                       class="!text-primary"
606 548
         >全选
@@ -612,7 +554,7 @@ function handleNumberChange(num, goodItem) {
612 554
         <div class="flex text-[12px]" v-if="state.isManage">
613 555
           合计:
614 556
           <FPrice :price="state.totalPrice"></FPrice>
615
-<!--          {{totalCartInfo.totalPrice}}-->
557
+          <!--          {{totalCartInfo.totalPrice}}-->
616 558
         </div>
617 559
         <FButton
618 560
             @click="handleSubmit"
@@ -633,5 +575,5 @@ page {
633 575
 <route lang="yaml">
634 576
 style:
635 577
   navigationBarTitleText: 购物车
636
-  enablePullDownRefresh: true
578
+  enablePullDownRefresh: false
637 579
 </route>

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

@@ -1,5 +1,10 @@
1 1
 <template>
2
-    <div class="w-full">
2
+  <FNavBar
3
+      title="支付方式" :left-arrow="true" fixed placeholder z-index="999"
4
+      ex-class="bg-white w-screen"
5
+      @click-left="onClickLeft"
6
+  />
7
+    <div class="w-full mt-20">
3 8
       <div class=" flex flex-col gap-3 p-3">
4 9
         <div class="flex flex-col justify-center items-center bg-white rounded p-4">
5 10
           <div class="text-xs text-gray-500">支付金额</div>
@@ -34,6 +39,16 @@ import FPrice from "~/components/FPrice/FPrice.vue";
34 39
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
35 40
 import {CDN_URL} from "~/config/app";
36 41
 import {checkGroupOrder} from "~/apis/order.api";
42
+import FNavBar from "~/components/FNavBar/FNavBar.vue";
43
+
44
+// usePageStore.setPageConfig({
45
+//   orderBack: {
46
+//     type: 'page',
47
+//     url: '/pages/store/product/detail?id=' + state.id
48
+//   }
49
+// })
50
+
51
+const pageStore = usePageStoreWidthOut()
37 52
 
38 53
 const wxLogoImage = CDN_URL + '/static/assets/wx_logo.png'
39 54
 const state = reactive({
@@ -42,6 +57,8 @@ const state = reactive({
42 57
   orderId: '',
43 58
   code: '',
44 59
   memberType: 0,
60
+
61
+  tabIndex: NaN,
45 62
 })
46 63
 onLoad((options) => {
47 64
   if (options) {
@@ -49,6 +66,11 @@ onLoad((options) => {
49 66
     state.payPrice = options.pay_price
50 67
     state.orderId = options.order_id
51 68
 
69
+    console.log(options)
70
+    if (options.tabIndex) {
71
+      state.tabIndex = options.tabIndex
72
+    }
73
+
52 74
     // uni.login({
53 75
     //   success: (res) => {
54 76
     //     state.code = res.code
@@ -95,10 +117,58 @@ function handleConfirm() {
95 117
   })
96 118
 
97 119
 }
120
+
121
+function onClickLeft() {
122
+  uni.showModal({
123
+    title: '确认要离开收银台?',
124
+    content: '您的订单在24小时内未支付将被取消,请尽快完成支付。',
125
+    confirmColor: '#FE0032',
126
+    confirmText: '继续支付',
127
+    cancelText: '确认离开',
128
+    success: (res) =>  {
129
+      if (res.confirm) {
130
+        handleConfirm()
131
+        uni.$emit('cart-reload')
132
+
133
+      }
134
+      if (res.cancel) {
135
+        // uni.navigateBack()
136
+        uni.$emit('cart-reload')
137
+        // let url = '/pages/order/index?tabIndex=1'
138
+        // if (usePageStore.orderBack) {
139
+        //   url += `&from=${usePageStore.orderBack}`
140
+        // }
141
+        if (state.tabIndex) {
142
+          pageStore.setPageConfig({
143
+            orderBack: {
144
+              url: '/pages/user/index',
145
+              type: 'tab'
146
+            }
147
+          })
148
+        }
149
+        setTimeout(() => {
150
+          if (state.tabIndex) {
151
+            uni.navigateTo({
152
+              url: `/pages/order/index?tabIndex=${state.tabIndex}&from=payment`,
153
+            })
154
+          } else {
155
+            uni.navigateTo({
156
+              url: `/pages/order/index?tabIndex=1&from=payment`,
157
+            })
158
+          }
159
+          // const tabIndex =
160
+
161
+        }, 300)
162
+
163
+      }
164
+    },
165
+  })
166
+}
98 167
 </script>
99 168
 
100 169
 <route lang="yaml">
101 170
 style:
171
+  navigationStyle: custom
102 172
   navigationBarTitleText: 支付方式
103 173
 </route>
104 174
 

+ 7 - 6
src/pages/pension_record/detail.vue

@@ -20,6 +20,7 @@ const detail = ref({
20 20
 onLoad((options) => {
21 21
   if (options.detail) {
22 22
     detail.value = JSON.parse(decodeBase64(options.detail))
23
+    console.log(detail.value)
23 24
     if (detail.value && detail.value.tradeType) {
24 25
       uni.setNavigationBarTitle({
25 26
         title: '推广佣金获取详情'
@@ -33,7 +34,7 @@ onLoad((options) => {
33 34
   <div>
34 35
     <div class="flex flex-col f-hairline-bottom py-4 justify-center items-center text-[12px] gap-3">
35 36
       <div>金额</div>
36
-      <FPrice :price="detail.yanglao" ex-class="text-xl font-bold !text-black"></FPrice>
37
+      <FPrice :price="detail.number || detail.yanglao" ex-class="text-xl font-bold !text-black"></FPrice>
37 38
     </div>
38 39
 
39 40
     <div class="flex flex-col text-[12px] p-4 gap-3">
@@ -45,13 +46,13 @@ onLoad((options) => {
45 46
         <div class="text-gray w-1/5">交易时间</div>
46 47
         <div class="w-4/5">{{ detail.create_time}}</div>
47 48
       </div>
48
-      <div class="flex gap-4" v-if="detail.other_status_desc">
49
+      <div class="flex gap-4" v-if="detail.other_status_desc || detail.status">
49 50
         <div class="text-gray w-1/5">交易状态</div>
50
-        <div class="4/5">{{ detail.other_status_desc }}</div>
51
+        <div class="4/5">{{ detail.other_status_desc || (detail.status == '0' ? '待确定' : detail.status == '1' ? '有效' : '无效')}}</div>
51 52
       </div>
52
-      <div class="flex gap-4" v-if="detail.goods_name">
53
+      <div class="flex gap-4" v-if="detail.goods_name || (detail.product && detail.product.product.store_name)">
53 54
         <div class="text-gray w-1/5">商品名称</div>
54
-        <div class="line-clamp-2 w-4/5">{{ detail.goods_name }}</div>
55
+        <div class="line-clamp-2 w-4/5">{{ detail.goods_name || detail.product.product.store_name }}</div>
55 56
       </div>
56 57
       <div class="flex gap-4">
57 58
         <div class="text-gray w-1/5">流水单号</div>
@@ -59,7 +60,7 @@ onLoad((options) => {
59 60
       </div>
60 61
       <div class="flex gap-4" v-if="detail.mark">
61 62
         <div class="text-gray w-1/5">备注</div>
62
-        <div class="w-4/5">{{ detail.remark }}</div>
63
+        <div class="w-4/5">{{ detail.mark || detail.remark }}</div>
63 64
       </div>
64 65
     </div>
65 66
 

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

@@ -120,5 +120,5 @@ page {
120 120
 <route lang="yaml">
121 121
 style:
122 122
   navigationBarTitleText: 养老金记录
123
-  enablePullDownRefresh: true
123
+  enablePullDownRefresh: false
124 124
 </route>

+ 78 - 19
src/pages/product/integral.vue

@@ -4,38 +4,100 @@ import ProductCard from "~/components/ProductCard/ProductCard.vue";
4 4
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
5 5
 import {login, reLogin} from "~/apis/user";
6 6
 const list = ref()
7
+const state = reactive({
8
+  status: 'noMore',
9
+
10
+  currentPage: 1,
11
+  pageSize: 10,
12
+  totalPage: 1,
13
+  list: []
14
+})
7 15
 onLoad(() => {
8
-  getEntropyProductList({
16
+  // getEntropyProductList({
17
+  //   mer_id: 148,
18
+  //   cate_id: '',
19
+  //   page: 1,
20
+  //   limit: 10
21
+  // }).then(res => {
22
+  //   list.value = res
23
+  // }).catch(error => {
24
+  //   if (error === '请登录') {
25
+  //     return login('30')
26
+  //   }
27
+  // })
28
+  loadList('reload')
29
+})
30
+
31
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
32
+  if (action == 'reload') {
33
+    state.currentPage = 1
34
+  }
35
+  const params = {
9 36
     mer_id: 148,
10
-    cate_id: '',
11
-    page: 1,
12
-    limit: 10
37
+    // mer_keyword: '',
38
+    page: state.currentPage,
39
+    limit: state.pageSize,
40
+  }
41
+
42
+  getEntropyProductList({
43
+    ...params
13 44
   }).then(res => {
14
-    list.value = res
15
-  }).catch(error => {
16
-    if (error === '请登录') {
17
-      return login('30')
45
+    if (action === 'page') {
46
+      state.list = state.list.concat(res)
47
+    }
48
+    if (action === 'reload') {
49
+      state.list = res
50
+    }
51
+    if (callback) {
52
+      callback(res)
18 53
     }
54
+  }).catch(error => {
55
+    uni.showToast({
56
+      title: error,
57
+      icon: 'none'
58
+    })
19 59
   })
60
+}
61
+function handleScrollToLower() {
62
+  state.status = "loading";
63
+  state.currentPage += 1;
64
+  loadList("page", (items) => {
65
+    if (!items.length > 0) {
66
+      console.log("没有更多了");
67
+      state.status = "noMore";
68
+      state.currentPage -= 1;
69
+    }
70
+  });
71
+}
72
+
73
+onReachBottom(() => {
74
+  console.log('到底了。。。')
75
+
76
+  handleScrollToLower()
77
+
20 78
 })
21 79
 
80
+onPullDownRefresh(() => {
81
+  loadList('reload', items => {
82
+    setTimeout(() => {
83
+      uni.stopPullDownRefresh()
84
+    }, 300)
85
+  })
86
+})
22 87
 function handleItemClick(item) {
88
+  console.log(item)
23 89
   uni.navigateTo({
24 90
     url: `/pages/store/product/detail?id=${item.product_id}&mer_id=148`
25 91
   })
26 92
 }
27 93
 </script>
28 94
 <template>
29
-  <CXBBasePage>
30
-    <scroll-view>
31 95
       <div class="p-3">
32
-        <div
33
-            v-for="(item, index) in list" :key="index"
34
-            @tap="handleItemClick(item)"
35
-        >
36
-          <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
37
-            <div v-for="(item, index) in list"
96
+        <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
97
+            <div v-for="(item, index) in state.list"
38 98
                  :key="index"
99
+                 @tap="handleItemClick(item)"
100
+
39 101
             >
40 102
               <div class="bg-white rounded-lg">
41 103
                 <image :src="item.image" mode="widthFix" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square" />
@@ -51,10 +113,7 @@ function handleItemClick(item) {
51 113
               </div>
52 114
             </div>
53 115
           </grid-view>
54
-        </div>
55 116
       </div>
56
-    </scroll-view>
57
-  </CXBBasePage>
58 117
 </template>
59 118
 <route lang="yaml">
60 119
 style:

+ 2 - 4
src/pages/product/zibuyangsheng.vue

@@ -22,12 +22,10 @@ function handleItemClick(item) {
22 22
   <CXBBasePage>
23 23
     <scroll-view>
24 24
       <div class="p-3">
25
-        <div
26
-            v-for="(item, index) in list" :key="index"
27
-            @tap="handleItemClick(item)"
28
-        >
25
+        <div>
29 26
           <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
30 27
             <div v-for="(item, index) in list"
28
+                 @tap="handleItemClick(item)"
31 29
                  :key="index"
32 30
             >
33 31
 

+ 3 - 2
src/pages/real-name-authentication/index.vue

@@ -224,7 +224,7 @@ function formatName (str) {
224 224
   <AuthenticationSuccess v-if="state.isCertified"/>
225 225
 
226 226
   <div class="flex flex-col pt-3 gap-3 pb-safe text-sm">
227
-    <div class="bg-white flex flex-col w-full px-3">
227
+    <div class="bg-white flex flex-col  px-3">
228 228
       <div class="f-hairline-bottom py-3 flex">
229 229
         <div>真实姓名:</div>
230 230
         <input v-model="formData.user_name"
@@ -255,7 +255,7 @@ function formatName (str) {
255 255
 
256 256
     </div>
257 257
 
258
-    <div class="bg-white flex flex-col w-full p-3 gap-3">
258
+    <div class="bg-white flex flex-col  p-3 gap-3">
259 259
       <div class="flex flex-col gap-3 ">
260 260
         <div>身份证人像面图:</div>
261 261
         <div class="flex justify-center items-center">
@@ -302,6 +302,7 @@ function formatName (str) {
302 302
 <style>
303 303
 page {
304 304
   background: #f8f8f8;
305
+  overflow: hidden;
305 306
 }
306 307
 
307 308
 .wx-radio-input {

+ 2 - 2
src/pages/red-integral/index.vue

@@ -186,8 +186,8 @@ function handleImmediateWithdrawal() {
186 186
 </template>
187 187
 <route lang="yaml">
188 188
 style:
189
-  navigationBarTitleText: 储蓄保
190
-  enablePullDownRefresh: true
189
+  navigationBarTitleText: ""
190
+  enablePullDownRefresh: false
191 191
   navigationBarBackgroundColor: "#fe0032"
192 192
   navigationBarTextStyle: "white"
193 193
 </route>

+ 1 - 1
src/pages/refund/option.vue

@@ -100,7 +100,7 @@ function handleChooseType(refund_type) {
100 100
 
101 101
 <route lang="yaml" >
102 102
 style:
103
-  navigationBarTitleText: 售后订单
103
+  navigationBarTitleText: 选择售后类型
104 104
 </route>
105 105
 
106 106
 <style>

+ 3 - 0
src/pages/revenue-sharing/index.vue

@@ -265,9 +265,12 @@ style:
265 265
   navigationBarBackgroundColor: "#FD1642"
266 266
   navigationBarTextStyle: "white"
267 267
   navigationBarTitleText: 分享收益
268
+  enablePullDownRefresh: false
269
+
268 270
 </route>
269 271
 <style>
270 272
 page {
271 273
   background: #f8f8f8;
274
+  overflow: hidden;
272 275
 }
273 276
 </style>

+ 655 - 0
src/pages/search/index-bak.vue

@@ -0,0 +1,655 @@
1
+<script setup lang="ts">
2
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
3
+import {
4
+  getDyLiveList,
5
+  getDyProductList,
6
+  getJdProductList,
7
+  getPddProductList,
8
+  getSuProductList,
9
+  getTaobaoProductList,
10
+  getVipProductList,
11
+  searchDyProduct,
12
+  searchJdProduct,
13
+  searchPddProduct,
14
+  searchSuProduct, searchVipProduct
15
+} from "~/apis/product";
16
+import type {
17
+  DyProductModel,
18
+  IProductDetail,
19
+  JdProductModel,
20
+  SuNingProductModel,
21
+  TaobaoProductThirdPartyWaresModel,
22
+  VipProductModel
23
+} from "~/apis/model/product.model";
24
+import {getDcProductList} from "~/apis/dacang";
25
+import type {DcProductModel} from "~/apis/model/dacang.model";
26
+import FPrice from "~/components/FPrice/FPrice.vue";
27
+import {encodeBase64} from "~/utils/http/helper";
28
+import CXBDyLiveRecommend from "~/components/CXBDyLive/CXBDyLiveRecommend.vue";
29
+import {PLATFORM_NAME} from "~/apis/model/common.model";
30
+import {CDN_URL} from "~/config/app";
31
+
32
+const dyLeftImage = CDN_URL + '/static/assets/dy_zuo_230321.png'
33
+const dyRightImage = CDN_URL + '/static/assets/dy_you_230321.png'
34
+
35
+interface TabItem {
36
+  id: PLATFORM_NAME,
37
+  text: string,
38
+  iconPath: string,
39
+  selectedIconPath: string
40
+}
41
+
42
+const tabList = <Array<TabItem>>[{
43
+  id: PLATFORM_NAME.JD,
44
+  text: '京东',
45
+  iconPath: CDN_URL + '/static/assets/jingdong_x.png',
46
+  selectedIconPath: CDN_URL + '/static/assets/jingdong_d.png',
47
+}, {
48
+  id: PLATFORM_NAME.TB,
49
+  text: '淘宝',
50
+  iconPath: CDN_URL + '/static/assets/taobaoyanglao_x.png',
51
+  selectedIconPath: CDN_URL + '/static/assets/taobaoyanglao_d.png',
52
+}, {
53
+  id: PLATFORM_NAME.PDD,
54
+  text: '拼多多',
55
+  iconPath: CDN_URL + '/static/assets/pinduoduo_x.png',
56
+  selectedIconPath: CDN_URL + '/static/assets/pinduoduo_d.png',
57
+}, {
58
+  id: PLATFORM_NAME.DC,
59
+  text: '大仓',
60
+  iconPath: CDN_URL + '/static/assets/dacang_x_220914.png',
61
+  selectedIconPath: CDN_URL + '/static/assets/dacang_d_220914.png',
62
+}, {
63
+  id: PLATFORM_NAME.DY,
64
+  text: '抖音',
65
+  iconPath: CDN_URL + '/static/assets/douyin_x_230313.png',
66
+  selectedIconPath: CDN_URL + '/static/assets/douyin_d_230313.png',
67
+}, {
68
+  id: PLATFORM_NAME.VIP,
69
+  text: '唯品会',
70
+  iconPath: CDN_URL + '/static/assets/weipinhui_x.png',
71
+  selectedIconPath: CDN_URL + '/static/assets/weipinhui_d.png',
72
+}, {
73
+  id: PLATFORM_NAME.SU,
74
+  text: '苏宁',
75
+  iconPath: CDN_URL + '/static/assets/suningyigou_x.png',
76
+  selectedIconPath: CDN_URL + '/static/assets/suningyigou_d.png',
77
+}]
78
+const state = reactive({
79
+  currentTab: PLATFORM_NAME.JD,
80
+  // 列表高度
81
+  scrollHeight: 0,
82
+  triggered: false,
83
+  status: 'none',
84
+  currentPage: 1,
85
+  totalPage: 1
86
+})
87
+const { windowHeight } = uni.getSystemInfoSync()
88
+state.scrollHeight = windowHeight - 195
89
+const searchValue = ref('')
90
+
91
+onLoad((options) => {
92
+  const platform = options.platform
93
+  if (platform) {
94
+    state.currentTab = platform
95
+  }
96
+  loadProductList('reload')
97
+
98
+})
99
+const list = ref<Array<
100
+    JdProductModel
101
+    | DcProductModel
102
+    | DyProductModel
103
+    | SuNingProductModel
104
+    | TaobaoProductThirdPartyWaresModel
105
+    | VipProductModel
106
+    | any
107
+>>()
108
+
109
+const dyLiveList = ref<Array<DyProductModel>>()
110
+
111
+function searchProduct() {
112
+  switch (state.currentTab) {
113
+    case PLATFORM_NAME.JD: {
114
+      searchJdProduct({keyword: searchValue.value, page: 1, limit: 20}).then(res => {
115
+        list.value = res
116
+      })
117
+      break;
118
+    }
119
+    case PLATFORM_NAME.DC: {
120
+      getDcProductList({
121
+        page: 1,
122
+        limit: 10,
123
+        classify: '',
124
+        keyword: searchValue.value
125
+      }).then(res => {
126
+        list.value = res
127
+      })
128
+      break;
129
+    }
130
+    case PLATFORM_NAME.DY: {
131
+      searchDyProduct({keyword: searchValue.value, page: 1, limit: 10}).then(res => {
132
+        list.value = res
133
+      })
134
+      break;
135
+    }
136
+    case PLATFORM_NAME.PDD: {
137
+      searchPddProduct({ keyword: searchValue.value, page: 1, limit: 10}).then(res => {
138
+        list.value = res
139
+      })
140
+      break;
141
+    }
142
+    case PLATFORM_NAME.SU: {
143
+      searchSuProduct({ keyword: searchValue.value, page: 1, limit: 10}).then(res => {
144
+        list.value = res
145
+      })
146
+      break;
147
+    }
148
+    case PLATFORM_NAME.TB: {
149
+      getTaobaoProductList({
150
+        pageNum: `1`,
151
+        pageSize: '10',
152
+        title: searchValue.value
153
+      }).then(res => {
154
+        list.value = res.thirdPartyWaresList
155
+      })
156
+      break;
157
+    }
158
+    case PLATFORM_NAME.VIP: {
159
+      searchVipProduct({ keyword: searchValue.value, page: 1, limit: 10}).then(res => {
160
+        list.value = res
161
+      })
162
+      break;
163
+    }
164
+  }
165
+}
166
+function loadProductList(action: 'page' | 'reload', callback?: (items) => void) {
167
+
168
+  switch (state.currentTab) {
169
+    case PLATFORM_NAME.JD: {
170
+      getJdProductList({
171
+        page: state.currentPage,
172
+        limit: 10
173
+      }).then(res => {
174
+        state.triggered = false
175
+
176
+        // list.value = res
177
+        if (action === 'page') {
178
+          list.value = list.value.concat(res)
179
+        }
180
+        if (action === 'reload') {
181
+          list.value = res
182
+        }
183
+        // state.totalPage = Math.ceil()
184
+        // res[0].
185
+        // console.log(res)
186
+      }).catch(error => {
187
+        uni.showToast({
188
+          title: error,
189
+          icon: "none"
190
+        })
191
+      })
192
+      break;
193
+    }
194
+    case PLATFORM_NAME.DC: {
195
+      getDcProductList({
196
+        page: state.currentPage,
197
+        limit: 10,
198
+        classify: '',
199
+        keyword: ''
200
+      }).then(res => {
201
+        list.value = res
202
+        state.triggered = false
203
+
204
+      })
205
+      break;
206
+    }
207
+    case PLATFORM_NAME.DY: {
208
+      getDyLiveList({
209
+        page: state.currentPage,
210
+        limit: 4,
211
+        // keyword: ''
212
+      }).then(res => {
213
+        // console.log(res)
214
+        // console.log(res.authorPic)
215
+      })
216
+      getDyLiveList({page: 1,limit: 4})
217
+          .then(res => {
218
+            // console.log(res)
219
+            if (res) {
220
+              dyLiveList.value = res
221
+            }
222
+          })
223
+      getDyProductList({
224
+        page: state.currentPage,
225
+        limit: 10,
226
+      }).then(res => {
227
+        list.value = res
228
+        state.triggered = false
229
+
230
+      })
231
+      break;
232
+    }
233
+    case PLATFORM_NAME.PDD: {
234
+      getPddProductList({
235
+        page: state.currentPage,
236
+        limit: 10
237
+      }).then(res => {
238
+        list.value = res
239
+      })
240
+      break;
241
+    }
242
+    case PLATFORM_NAME.SU: {
243
+      getSuProductList({
244
+        page: state.currentPage,
245
+        limit: 10
246
+      }).then(res => {
247
+        list.value = res
248
+        console.log(res)
249
+        state.triggered = false
250
+
251
+
252
+      })
253
+      break;
254
+    }
255
+    case PLATFORM_NAME.TB: {
256
+      getTaobaoProductList({
257
+        pageNum: `${state.currentPage}`,
258
+        pageSize: '10'
259
+      }).then(res => {
260
+        list.value = res.thirdPartyWaresList
261
+      })
262
+      break;
263
+    }
264
+    case PLATFORM_NAME.VIP: {
265
+      getVipProductList({
266
+        page: state.currentPage,
267
+        limit: 10
268
+      }).then(res => {
269
+        list.value = res
270
+        state.triggered = false
271
+
272
+
273
+      })
274
+      break;
275
+    }
276
+    // default: {
277
+    //   getJdProductList({
278
+    //     page: 1,
279
+    //     limit: 10
280
+    //   }).then(res => {
281
+    //     list.value = res
282
+    //   })
283
+    // }
284
+  }
285
+
286
+
287
+}
288
+
289
+function handleCategoryItemClick(item: TabItem) {
290
+  state.currentTab = item.id
291
+  loadProductList(item.id)
292
+}
293
+
294
+function handleProductItemClick(
295
+    item:
296
+        JdProductModel
297
+        & DcProductModel
298
+        & DyProductModel
299
+        & SuNingProductModel
300
+        & TaobaoProductThirdPartyWaresModel
301
+        & VipProductModel
302
+) {
303
+
304
+
305
+  function navigateToDetail(params) {
306
+    let otherDetailUrl = `/pages/store/product/other`
307
+    return uni.navigateTo({
308
+      url: `${otherDetailUrl}?params=${params}`
309
+    })
310
+  }
311
+  // 大仓
312
+  if (state.currentTab === PLATFORM_NAME.DC && item.type === '5') {
313
+    uni.navigateTo({
314
+      url: `/pages/store/product/detail?id=${item.product_id}`
315
+    })
316
+  }
317
+  // 京东
318
+  if (item.type === 6) {
319
+    // productParams.id = item.skuId
320
+    const productParams: Partial<IProductDetail> = {
321
+      platform: item.type,
322
+      id: item.skuId,
323
+      title: item.name,
324
+      featured: [item.thumb],
325
+      allowance: item.commission,
326
+      salePrice: item.lowestCouponPrice,
327
+      price: item.price,
328
+      coupon: {
329
+        amount: item.coupon_money[0].discount,
330
+        startTime: item.coupon_money[0].getStartTime,
331
+        endTime: item.coupon_money[0].getEndTime
332
+      },
333
+      spreadUrl: item.coupon_link
334
+    }
335
+    return navigateToDetail(encodeBase64(productParams))
336
+  }
337
+  // 淘宝
338
+  if (item.type === 5) {
339
+    const productParams: Partial<IProductDetail> = {
340
+      platform: item.type,
341
+      id: item.id,
342
+      title: item.name,
343
+      featured: [item.thumb],
344
+      allowance: item.commission,
345
+      salePrice: item.price,
346
+      // 原价
347
+      price: item.market_price,
348
+      coupon: {
349
+        amount: item.coupon_money
350
+        // amount: item.coupon_money[0].discount,
351
+        // startTime: item.coupon_money[0].getStartTime,
352
+        // endTime: item.coupon_money[0].getEndTime
353
+      },
354
+      spreadUrl: item.coupon_share_url
355
+    }
356
+
357
+    return navigateToDetail(encodeBase64(productParams))
358
+    // uni.navigateTo({
359
+    //   url: `/pages/store/product/other?platform=${item.type}&id=${item.id}`
360
+    // })
361
+  }
362
+
363
+  // 拼多多
364
+  if (item.type === 1) {
365
+    const productParams: Partial<IProductDetail> = {
366
+      platform: item.type,
367
+      id: item.id,
368
+      title: item.name,
369
+      featured: [item.thumb],
370
+      allowance: item.commission,
371
+      salePrice: item.price,
372
+      // 原价
373
+      price: item.market_price,
374
+      coupon: {
375
+        amount: item.coupon_money
376
+        // amount: item.coupon_money[0].discount,
377
+        // startTime: item.coupon_money[0].getStartTime,
378
+        // endTime: item.coupon_money[0].getEndTime
379
+      },
380
+      // spreadUrl: item.coupon_share_url
381
+    }
382
+    return navigateToDetail(encodeBase64(productParams))
383
+    // uni.navigateTo({
384
+    //   url: `/pages/store/product/other?platform=${item.type}&id=${item.id}&allowance=${item.commission}`
385
+    // })
386
+  }
387
+  // 唯品会
388
+  if (item.type === 2) {
389
+    const productParams: Partial<IProductDetail> = {
390
+      platform: item.type,
391
+      id: item.id,
392
+      title: item.name,
393
+      featured: [item.thumb],
394
+      allowance: item.commission,
395
+      salePrice: item.price,
396
+      // 原价
397
+      price: item.market_price,
398
+      // coupon: {
399
+        // amount: item.coupon_money
400
+      // },
401
+    }
402
+    return navigateToDetail(encodeBase64(productParams))
403
+  }
404
+
405
+  // 苏宁
406
+  if (item.type === 3) {
407
+    const productParams: Partial<IProductDetail> = {
408
+      platform: item.type,
409
+      id: item.id,
410
+      title: item.name,
411
+      featured: [item.thumb],
412
+      allowance: item.commission,
413
+      salePrice: item.price,
414
+      // 原价
415
+      price: item.market_price,
416
+      // coupon: {
417
+      //   amount: item.coupon_money
418
+      // },
419
+    }
420
+    return navigateToDetail(encodeBase64(productParams))
421
+  //
422
+  }
423
+
424
+  // 抖音 9
425
+  if (item.type === 9) {
426
+    console.log(item)
427
+    const productParams: Partial<IProductDetail> = {
428
+      platform: item.type,
429
+      id: item.id,
430
+      title: item.name,
431
+      featured: [item.thumb],
432
+      allowance: item.commission,
433
+      salePrice: item.price,
434
+      // 原价
435
+      price: item.market_price,
436
+      // coupon: {
437
+      //   amount: item.coupon_money
438
+      // },
439
+    }
440
+    return navigateToDetail(encodeBase64(productParams))
441
+  }
442
+}
443
+
444
+function handleLiveRecommendTitleClick() {
445
+  uni.navigateTo({
446
+    url: `/pages/store/product/dy-live`
447
+  })
448
+}
449
+
450
+// 下拉刷新被下拉
451
+const onRefresherPulling = e => {
452
+  state.triggered = true;
453
+};
454
+// 下拉刷新被复位
455
+const onRefresherRestore = e => {
456
+  state.triggered = false;
457
+};
458
+// 下拉刷新被中止
459
+const onRefresherAbort = e => {
460
+  state.triggered = false;
461
+}
462
+
463
+const onRefresherRefresh = e => {
464
+  loadProductList('reload')
465
+};
466
+
467
+function handleScrollToLower() {
468
+  state.status = 'loading';
469
+  state.currentPage += 1;
470
+  // if (state.currentPage > state.totalPage) {
471
+  //   state.status = 'noMore';
472
+  // } else {
473
+  //   // queryFavorites('page');
474
+  //   // loadSelectMerchant('page')
475
+  //   loadProductList(state.currentTab)
476
+  //
477
+  // }
478
+}
479
+</script>
480
+<template>
481
+
482
+    <div class="flex flex-col overflow-hidden fixed  h-fit z-1 bg-white">
483
+      <nut-searchbar
484
+          v-model="searchValue" @search="searchProduct" @clear="loadProductList('reload')">
485
+        <template v-slot:rightout>
486
+          <div @tap="searchProduct">
487
+            搜索
488
+          </div>
489
+        </template>
490
+      </nut-searchbar>
491
+      <div class="py-3">
492
+        <scroll-view
493
+            class="flex flex-row w-full gap-2 overflow-x whitespace-nowrap w-screen"
494
+            :scroll-with-animation="true"
495
+            :scroll-x="true"
496
+        >
497
+          <div
498
+              @tap="handleCategoryItemClick(item)"
499
+              v-for="(item, index) in tabList"
500
+              :key="index"
501
+              class="flex inline-flex pl-4 items-center justify-center relative "
502
+          >
503
+            <div class="flex flex-col justify-center items-center text-xs gap-2">
504
+              <image :src="item.id === state.currentTab ? item.selectedIconPath : item.iconPath" mode="widthFix"
505
+                     class="w-9 h-9"></image>
506
+              <div>{{ item.text }}</div>
507
+            </div>
508
+
509
+          </div>
510
+        </scroll-view>
511
+      </div>
512
+    </div>
513
+    <div class="pt-36 ">
514
+      <scroll-view
515
+          :scroll-y="true"
516
+          :style="{ height: `${state.scrollHeight}px` }"
517
+          scroll-with-animation
518
+          :refresher-enabled="true"
519
+          refresher-background="#f5f5f5"
520
+          refresher-default-style="black"
521
+          :refresher-triggered="state.triggered"
522
+          @scrolltolower="handleScrollToLower"
523
+          @refresherPulling="onRefresherPulling"
524
+          @refresherRestore="onRefresherRestore"
525
+          @refresherAbort="onRefresherAbort"
526
+          @refresherrefresh="onRefresherRefresh"
527
+
528
+      >
529
+      <div
530
+          v-if="state.currentTab === PLATFORM_NAME.DY"
531
+      >
532
+
533
+      <div
534
+          class="pb-4"
535
+      >
536
+        <CXBDyLiveRecommend :list="dyLiveList" v-if="dyLiveList" @title-click="handleLiveRecommendTitleClick"/>
537
+      </div>
538
+      <div class="flex justify-center items-center w-full pb-3">
539
+        <div class="flex justify-center items-center gap-2">
540
+          <image :src="dyLeftImage" mode="widthFix" class="w-12 h-2"></image>
541
+          <div class="font-bold">抖音好物</div>
542
+          <image :src="dyRightImage" mode="widthFix" class="w-12 h-2"></image>
543
+        </div>
544
+      </div>
545
+      </div>
546
+
547
+      <div class="px-3">
548
+        <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
549
+          <div v-for="(item, index) in list"
550
+               :key="index"
551
+               @tap="handleProductItemClick(item)"
552
+          >
553
+            <div class="bg-white rounded-lg text-dark">
554
+              <image :src="item.image"
555
+                     v-if="state.currentTab === PLATFORM_NAME.DC"
556
+                     mode="widthFix" :fade-in="true"
557
+                     class="rounded-t-lg  !w-full aspect-square" />
558
+              <image
559
+                  v-else
560
+                  :src="item.thumb"
561
+                  mode="widthFix" :fade-in="true"
562
+                  class="rounded-t-lg  !w-full aspect-square" />
563
+              <div class="text-sm p-2 flex flex-col gap-1">
564
+                <div class="line-clamp-2">
565
+                  <div v-if="state.currentTab === PLATFORM_NAME.DC">
566
+                    {{ item.store_name }}
567
+                  </div>
568
+                  <div v-else>
569
+                    {{ item.name }}
570
+                  </div>
571
+                </div>
572
+                <div
573
+                    class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
574
+                  <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
575
+                         mode="widthFix" class="!w-8.5"></image>
576
+                  <div class="px-2 flex items-center jusitify-center text-xs">
577
+                    <div>
578
+                      养老金 ¥{{ item.commission }}
579
+                    </div>
580
+                  </div>
581
+                </div>
582
+                <div class="flex flex-col justify-center gap-2">
583
+                  <div v-if="state.currentTab === PLATFORM_NAME.JD">
584
+                    <FPrice :price="item.lowestCouponPrice" ex-class="text-[20px]" need-symbol/>
585
+                    <FPrice :price="item.price" ex-class="text-gray text-xs" need-symbol strike-through/>
586
+                  </div>
587
+                  <div v-if="state.currentTab === PLATFORM_NAME.TB">
588
+                    <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
589
+                    <FPrice :price="item.market_price" ex-class="text-gray text-xs" need-symbol strike-through/>
590
+                  </div>
591
+
592
+                  <div v-if="state.currentTab === PLATFORM_NAME.PDD">
593
+                    <FPrice :price="item.market_price" ex-class="text-[20px]" need-symbol/>
594
+                    <FPrice :price="item.price" ex-class="text-gray text-xs" need-symbol strike-through/>
595
+                  </div>
596
+
597
+                  <div v-if="state.currentTab === PLATFORM_NAME.DC">
598
+
599
+                    <div class="flex flex-row gap-2">
600
+                      <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
601
+                      <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">
602
+                        大仓
603
+                      </div>
604
+                    </div>
605
+
606
+                    <FPrice :price="item.ot_price" ex-class="text-gray text-xs" need-symbol strike-through/>
607
+
608
+
609
+                  </div>
610
+
611
+                  <div v-if="state.currentTab === PLATFORM_NAME.DY">
612
+                    <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
613
+                  </div>
614
+
615
+                  <div v-if="state.currentTab === PLATFORM_NAME.VIP">
616
+                    <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
617
+                    <FPrice :price="item.market_price" ex-class="text-gray text-xs" need-symbol strike-through/>
618
+                  </div>
619
+
620
+                  <div v-if="state.currentTab === PLATFORM_NAME.SU">
621
+                    <FPrice :price="item.price" ex-class="text-[20px]" need-symbol/>
622
+                    <FPrice :price="item.market_price" ex-class="text-gray text-xs" need-symbol strike-through/>
623
+                  </div>
624
+<!--                  <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">-->
625
+
626
+
627
+<!--                  </div>-->
628
+
629
+                </div>
630
+              </div>
631
+
632
+            </div>
633
+          </div>
634
+        </grid-view>
635
+
636
+      </div>
637
+
638
+      </scroll-view>
639
+    </div>
640
+
641
+</template>
642
+
643
+<route lang="yaml">
644
+style:
645
+  navigationBarTitleText: 搜索
646
+  disableScroll: true
647
+</route>
648
+
649
+<style lang="scss">
650
+page {
651
+  //overflow: hidden;
652
+  //position: fixed;
653
+  background: #f8f8f8;
654
+}
655
+</style>

+ 151 - 47
src/pages/search/index.vue

@@ -28,6 +28,7 @@ import {encodeBase64} from "~/utils/http/helper";
28 28
 import CXBDyLiveRecommend from "~/components/CXBDyLive/CXBDyLiveRecommend.vue";
29 29
 import {PLATFORM_NAME} from "~/apis/model/common.model";
30 30
 import {CDN_URL} from "~/config/app";
31
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
31 32
 
32 33
 const dyLeftImage = CDN_URL + '/static/assets/dy_zuo_230321.png'
33 34
 const dyRightImage = CDN_URL + '/static/assets/dy_you_230321.png'
@@ -56,7 +57,7 @@ const tabList = <Array<TabItem>>[{
56 57
   selectedIconPath: CDN_URL + '/static/assets/pinduoduo_d.png',
57 58
 }, {
58 59
   id: PLATFORM_NAME.DC,
59
-  text: '城中大仓',
60
+  text: '大仓',
60 61
   iconPath: CDN_URL + '/static/assets/dacang_x_220914.png',
61 62
   selectedIconPath: CDN_URL + '/static/assets/dacang_d_220914.png',
62 63
 }, {
@@ -96,6 +97,10 @@ onLoad((options) => {
96 97
   loadProductList('reload')
97 98
 
98 99
 })
100
+
101
+// onShow(() => {
102
+//
103
+// })
99 104
 const list = ref<Array<
100 105
     JdProductModel
101 106
     | DcProductModel
@@ -134,6 +139,7 @@ function searchProduct() {
134 139
       break;
135 140
     }
136 141
     case PLATFORM_NAME.PDD: {
142
+
137 143
       searchPddProduct({ keyword: searchValue.value, page: 1, limit: 10}).then(res => {
138 144
         list.value = res
139 145
       })
@@ -164,7 +170,9 @@ function searchProduct() {
164 170
   }
165 171
 }
166 172
 function loadProductList(action: 'page' | 'reload', callback?: (items) => void) {
167
-
173
+  if (action == 'reload') {
174
+    state.currentPage = 1
175
+  }
168 176
   switch (state.currentTab) {
169 177
     case PLATFORM_NAME.JD: {
170 178
       getJdProductList({
@@ -180,6 +188,11 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
180 188
         if (action === 'reload') {
181 189
           list.value = res
182 190
         }
191
+        uni.hideLoading()
192
+
193
+        if (callback) {
194
+          callback(res)
195
+        }
183 196
         // state.totalPage = Math.ceil()
184 197
         // res[0].
185 198
         // console.log(res)
@@ -198,9 +211,19 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
198 211
         classify: '',
199 212
         keyword: ''
200 213
       }).then(res => {
201
-        list.value = res
214
+        // list.value = res
202 215
         state.triggered = false
216
+        if (action === 'page') {
217
+          list.value = list.value.concat(res)
218
+        }
219
+        if (action === 'reload') {
220
+          list.value = res
221
+        }
222
+        uni.hideLoading()
203 223
 
224
+        if (callback) {
225
+          callback(res)
226
+        }
204 227
       })
205 228
       break;
206 229
     }
@@ -218,24 +241,47 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
218 241
             // console.log(res)
219 242
             if (res) {
220 243
               dyLiveList.value = res
244
+
221 245
             }
222 246
           })
223 247
       getDyProductList({
224 248
         page: state.currentPage,
225 249
         limit: 10,
226 250
       }).then(res => {
227
-        list.value = res
251
+        // list.value = res
228 252
         state.triggered = false
253
+        if (action === 'page') {
254
+          list.value = list.value.concat(res)
255
+        }
256
+        if (action === 'reload') {
257
+          list.value = res
258
+        }
259
+        uni.hideLoading()
229 260
 
261
+        if (callback) {
262
+          callback(res)
263
+        }
230 264
       })
231 265
       break;
232 266
     }
233 267
     case PLATFORM_NAME.PDD: {
268
+
234 269
       getPddProductList({
235 270
         page: state.currentPage,
236 271
         limit: 10
237 272
       }).then(res => {
238
-        list.value = res
273
+        // list.value = res
274
+        if (action === 'page') {
275
+          list.value = list.value.concat(res)
276
+        }
277
+        if (action === 'reload') {
278
+          list.value = res
279
+        }
280
+        uni.hideLoading()
281
+
282
+        if (callback) {
283
+          callback(res)
284
+        }
239 285
       })
240 286
       break;
241 287
     }
@@ -244,10 +290,20 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
244 290
         page: state.currentPage,
245 291
         limit: 10
246 292
       }).then(res => {
247
-        list.value = res
248
-        console.log(res)
249
-        state.triggered = false
293
+        // list.value = res
294
+        // console.log(res)
295
+        // state.triggered = false
296
+        if (action === 'page') {
297
+          list.value = list.value.concat(res)
298
+        }
299
+        if (action === 'reload') {
300
+          list.value = res
301
+        }
302
+        uni.hideLoading()
250 303
 
304
+        if (callback) {
305
+          callback(res)
306
+        }
251 307
 
252 308
       })
253 309
       break;
@@ -257,7 +313,18 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
257 313
         pageNum: `${state.currentPage}`,
258 314
         pageSize: '10'
259 315
       }).then(res => {
260
-        list.value = res.thirdPartyWaresList
316
+        // list.value = res.thirdPartyWaresList
317
+        if (action === 'page') {
318
+          list.value = list.value.concat(res.thirdPartyWaresList)
319
+        }
320
+        if (action === 'reload') {
321
+          list.value = res.thirdPartyWaresList
322
+        }
323
+        uni.hideLoading()
324
+
325
+        if (callback) {
326
+          callback(res.thirdPartyWaresList)
327
+        }
261 328
       })
262 329
       break;
263 330
     }
@@ -266,9 +333,19 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
266 333
         page: state.currentPage,
267 334
         limit: 10
268 335
       }).then(res => {
269
-        list.value = res
270
-        state.triggered = false
336
+        // list.value = res
337
+        // state.triggered = false
338
+        if (action === 'page') {
339
+          list.value = list.value.concat(res)
340
+        }
341
+        if (action === 'reload') {
342
+          list.value = res
343
+        }
344
+        uni.hideLoading()
271 345
 
346
+        if (callback) {
347
+          callback(res)
348
+        }
272 349
 
273 350
       })
274 351
       break;
@@ -287,8 +364,14 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
287 364
 }
288 365
 
289 366
 function handleCategoryItemClick(item: TabItem) {
367
+  list.value = []
290 368
   state.currentTab = item.id
291
-  loadProductList(item.id)
369
+  // loadProductList(item.id)
370
+  uni.showLoading({
371
+    title: '数据加载中',
372
+    icon: 'none'
373
+  })
374
+  loadProductList('reload')
292 375
 }
293 376
 
294 377
 function handleProductItemClick(
@@ -463,24 +546,49 @@ const onRefresherAbort = e => {
463 546
 const onRefresherRefresh = e => {
464 547
   loadProductList('reload')
465 548
 };
466
-
549
+onPullDownRefresh(() => {
550
+  uni.showLoading({
551
+    title: '数据加载中',
552
+    icon: 'none'
553
+  })
554
+  loadProductList('reload', items => {
555
+    setTimeout(() => {
556
+      uni.stopPullDownRefresh()
557
+      uni.hideLoading()
558
+    }, 300)
559
+  })
560
+})
467 561
 function handleScrollToLower() {
562
+  uni.showLoading({
563
+    title: '数据加载中',
564
+    icon: 'none'
565
+  })
566
+
468 567
   state.status = 'loading';
469 568
   state.currentPage += 1;
470
-  // if (state.currentPage > state.totalPage) {
471
-  //   state.status = 'noMore';
472
-  // } else {
473
-  //   // queryFavorites('page');
474
-  //   // loadSelectMerchant('page')
475
-  //   loadProductList(state.currentTab)
476
-  //
477
-  // }
569
+
570
+  setTimeout(() => {
571
+    loadProductList('page', (items) => {
572
+      uni.hideLoading()
573
+      // uni.hideLoading()
574
+      if (!items.length > 0) {
575
+        console.log('没有更多了')
576
+        state.status = 'noMore'
577
+        state.currentPage -= 1;
578
+      }
579
+    })
580
+  }, 300)
581
+
478 582
 }
583
+
584
+onReachBottom(() => {
585
+  handleScrollToLower()
586
+
587
+})
479 588
 </script>
480 589
 <template>
481
-  <CXBBasePage>
482 590
 
483
-    <div class="flex flex-col overflow-hidden fixed  h-fit z-1 bg-white">
591
+    <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white">
484 592
       <nut-searchbar
485 593
           v-model="searchValue" @search="searchProduct" @clear="loadProductList('reload')">
486 594
         <template v-slot:rightout>
@@ -511,22 +619,8 @@ function handleScrollToLower() {
511 619
         </scroll-view>
512 620
       </div>
513 621
     </div>
514
-    <div class="pt-36 ">
515
-      <scroll-view
516
-          :scroll-y="true"
517
-          :style="{ height: `${state.scrollHeight}px` }"
518
-          scroll-with-animation
519
-          :refresher-enabled="true"
520
-          refresher-background="#f5f5f5"
521
-          refresher-default-style="black"
522
-          :refresher-triggered="state.triggered"
523
-          @scrolltolower="handleScrollToLower"
524
-          @refresherPulling="onRefresherPulling"
525
-          @refresherRestore="onRefresherRestore"
526
-          @refresherAbort="onRefresherAbort"
527
-          @refresherrefresh="onRefresherRefresh"
622
+    <div class="pt-36 pb-safe " v-if="list && list.length > 0">
528 623
 
529
-      >
530 624
       <div
531 625
           v-if="state.currentTab === PLATFORM_NAME.DY"
532 626
       >
@@ -545,7 +639,7 @@ function handleScrollToLower() {
545 639
       </div>
546 640
       </div>
547 641
 
548
-      <div class="px-3">
642
+      <div class="px-3" >
549 643
         <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
550 644
           <div v-for="(item, index) in list"
551 645
                :key="index"
@@ -633,25 +727,35 @@ function handleScrollToLower() {
633 727
             </div>
634 728
           </div>
635 729
         </grid-view>
636
-
730
+        <div class=" flex justify-center items-center text-[12px] text-gray-500"
731
+             v-if="list && list.length > 0">
732
+          <div v-if="state.status === 'loading'">
733
+            加载中...
734
+          </div>
735
+          <div v-if="state.status === 'noMore'">
736
+            没有更多了~
737
+          </div>
738
+        </div>
637 739
       </div>
638 740
 
639
-      </scroll-view>
640 741
     </div>
641
-  </CXBBasePage>
742
+  <div class="pt-36 flex flex-col justify-center items-center" v-else>
743
+    <CXBEmpty ></CXBEmpty>
744
+
745
+  </div>
642 746
 
643 747
 </template>
644 748
 
645 749
 <route lang="yaml">
646 750
 style:
647 751
   navigationBarTitleText: 搜索
648
-  disableScroll: true
752
+  enablePullDownRefresh: true
649 753
 </route>
650 754
 
651
-<style>
755
+<style lang="scss">
652 756
 page {
653
-  overflow: hidden;
654
-  position: fixed;
655
-
757
+  //overflow: hidden;
758
+  //position: fixed;
759
+  background: #f8f8f8;
656 760
 }
657 761
 </style>

+ 35 - 22
src/pages/share-the-product/index.vue

@@ -32,9 +32,12 @@ const state = reactive({
32 32
   // showPicker: false,
33 33
   date: [],
34 34
   isVisible: false,
35
-  currentDate: dayjs().format('YYYY-MM-DD')
36
-})
35
+  currentDate: dayjs().format('YYYY-MM-DD'),
36
+  scrollHeight: 0,
37 37
 
38
+})
39
+const {windowHeight} = uni.getSystemInfoSync()
40
+state.scrollHeight = windowHeight - 320
38 41
 const openSwitch = param => {
39 42
   state[`${param}`] = true;
40 43
   state.date = [
@@ -98,6 +101,7 @@ function loadList(start_time: string, end_time: string) {
98 101
 <template>
99 102
   <div class="bg-[#FD1642] h-20 rounded-bottom-full w-full absolute top-0 left-0 z--1"></div>
100 103
 
104
+
101 105
   <div class="px-3 py-3 flex flex-col gap-3">
102 106
     <div class="bg-white rounded-lg p-2 flex flex-col gap-4 ">
103 107
       <div class="flex justify-around py-8">
@@ -153,26 +157,34 @@ function loadList(start_time: string, end_time: string) {
153 157
       </nut-date-picker>
154 158
     </nut-popup>
155 159
     <div class="pb-safe">
156
-<!--      <div class="flex justify-around bg-white rounded-tl-lg rounded-tr-lg text-center text-[11px] p-3">-->
157
-<!--        <div class="">日期</div>-->
158
-<!--        <div>好友分享</div>-->
159
-<!--        <div class="">朋友圈分享</div>-->
160
-<!--        <div class="">商品点击</div>-->
161
-<!--        <div class="">商品购买</div>-->
162
-<!--      </div>-->
163
-<!--      <div v-if="invitePartnerModel && invitePartnerModel.userInviteVoList">-->
164
-<!--        <div class="grid grid-cols-3 text-center text-sm p-2 bg-white text-gray-500" v-for="(item, index) in invitePartnerModel.userInviteVoList.list" :key="index">-->
165
-<!--          <div class="text-left">{{ item.nickname || '无昵称' }}</div>-->
166
-<!--          <div>{{ item.statusType }}</div>-->
167
-<!--          <div class="text-right">{{ item.promoterTime }}</div>-->
168
-<!--        </div>-->
169
-<!--      </div>-->
170
-      <div class="bg-white p-3" v-if="state.data && state.data.length > 0">
171
-        <nut-table :columns="state.columns"
172
-                   :data="state.data"
173
-                   :bordered="true"
174
-        ></nut-table>
160
+      <div class=""  v-if="state.data && state.data.length">
161
+        <div class="grid grid-cols-5 text-center text-[12px] bg-white text-gray-600 py-2">
162
+          <div class="">日期</div>
163
+          <div>好友分享</div>
164
+          <div class="">朋友圈分享</div>
165
+          <div class="">商品点击</div>
166
+          <div class="">商品购买</div>
167
+        </div>
168
+        <scroll-view
169
+            :scroll-y="true"
170
+            :style="{ height: `${state.scrollHeight}px` }"
171
+        >
172
+          <div class="grid grid-cols-5 text-center text-[11px] bg-white text-gray-600 py-2" v-for="(item, index) in state.data" :key="index">
173
+            <div class="text-center">{{ item.ctime }}</div>
174
+            <div class="text-center">{{ item.friendsSum }}</div>
175
+            <div class="text-center">{{ item.momentsSum }}</div>
176
+            <div class="text-center">{{ item.clickNum }}</div>
177
+            <div class="text-center">{{ item.buyNum }}</div>
178
+          </div>
179
+        </scroll-view>
175 180
       </div>
181
+
182
+<!--      <div class="bg-white p-3" v-if="state.data && state.data.length > 0">-->
183
+<!--        <nut-table :columns="state.columns"-->
184
+<!--                   :data="state.data"-->
185
+<!--                   :bordered="true"-->
186
+<!--        ></nut-table>-->
187
+<!--      </div>-->
176 188
       <div v-else>
177 189
         <CXBEmpty />
178 190
       </div>
@@ -184,7 +196,8 @@ function loadList(start_time: string, end_time: string) {
184 196
 
185 197
 page {
186 198
   background: #f8f8f8;
187
-  --nut-table-cols-padding: 2px
199
+  --nut-table-cols-padding: 2px;
200
+  overflow: hidden;
188 201
 }
189 202
 .nut-table {
190 203
   font-size: 12px !important;

+ 6 - 0
src/pages/store/home/index.vue

@@ -9,6 +9,9 @@ import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
9 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
+const usePageStore = usePageStoreWidthOut()
14
+
12 15
 
13 16
 let merchant: Ref<MerchantModel> = ref<MerchantModel>({
14 17
   mer_id: NaN,
@@ -68,6 +71,9 @@ onLoad((options: any) => {
68 71
   }
69 72
 })
70 73
 
74
+// onShow(() => {
75
+//
76
+// })
71 77
 
72 78
 // function searchProduct() {
73 79
 //   searchProductList({

+ 50 - 27
src/pages/store/home/search.vue

@@ -23,7 +23,12 @@ const state = reactive({
23 23
   currentPage: 1,
24 24
   pageSize: 10,
25 25
   totalPage: 1,
26
-
26
+  params: {},
27
+  // priceType: NaN,
28
+  is_best: NaN,
29
+  // sales: NaN,
30
+  // is_new: NaN,
31
+  // type: NaN,
27 32
   searchValue: ''
28 33
 })
29 34
 
@@ -69,22 +74,6 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
69 74
     // type?: number
70 75
     // category_id?: string
71 76
   }
72
-  if (state.type) {
73
-    params.type = state.type
74
-  }
75
-  if (state.sales === 0) {
76
-    params.sales = state.sales
77
-  }
78
-  if (state.is_new === 0) {
79
-    params.is_new = state.is_new
80
-  }
81
-  if (state.priceType) {
82
-    params.priceType = state.priceType
83
-  }
84
-  if (state.category_id) {
85
-    params.category_id = state.category_id
86
-  }
87
-
88 77
   if (state.searchValue) {
89 78
     params.mer_keyword = state.searchValue
90 79
   }
@@ -93,7 +82,8 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
93 82
   }
94 83
 
95 84
   searchProductList({
96
-    ...params
85
+    ...params,
86
+    ...state.params
97 87
   }).then(res => {
98 88
     state.triggered = false
99 89
     if (action === 'page') {
@@ -140,23 +130,56 @@ onPullDownRefresh(() => {
140 130
 })
141 131
 
142 132
 function handleProductTypeChange(typeValue) {
143
-  if (typeValue === 3) {
144
-    state.sales = NaN
145
-    state.is_new = 0
133
+  if (typeValue == 1) {
134
+    state.params = {
135
+      is_best: 0
136
+    }
146 137
   }
147
-  else if (typeValue === 2) {
148
-    state.sales = 0
149
-  } else {
150
-    state.type = typeValue
138
+  if (typeValue == 2) {
139
+    state.params = {
140
+      sales: 0
141
+    }
142
+  }
143
+  if (typeValue == 3) {
144
+    state.params = {
145
+      is_new: 0
146
+    }
147
+  }
148
+  // if (typeValue == 4) {
149
+  //   state.params = {
150
+  //     priceType: 1
151
+  //   }
152
+  // }
153
+  if (typeValue == 6) {
154
+    state.params = {
155
+      type: 1
156
+    }
157
+  }
158
+  if (typeValue == 7) {
159
+    state.params = {
160
+      type: 5
161
+    }
151 162
   }
163
+  // if (typeValue === 3) {
164
+  //   state.sales = NaN
165
+  //   state.is_new = 0
166
+  // }
167
+  // else if (typeValue === 2) {
168
+  //   state.sales = 0
169
+  // } else {
170
+  //   state.type = typeValue
171
+  // }
152 172
   loadList('reload')
153 173
 }
154 174
 function handleOrderChange(priceType) {
155 175
   state.priceType = priceType
156 176
 
177
+  state.params = {
178
+    priceType,
179
+  }
157 180
   // reset
158
-  state.sales = NaN
159
-  state.is_new =NaN
181
+  // state.sales = NaN
182
+  // state.is_new =NaN
160 183
 
161 184
   loadList('reload')
162 185
 }

+ 321 - 0
src/pages/store/nearby/index-bak.vue

@@ -0,0 +1,321 @@
1
+<script lang="ts" setup>
2
+import {getMerchantCategory, getSelectMerchant, getSelectMerchantSort} from "~/apis/merchant";
3
+import type {StoreResult} from "~/apis/model/storeModel";
4
+import {StoreParams} from "~/apis/model/storeModel";
5
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
+import {USER_LATITUDE, USER_LONGITUDE} from "~/constants";
7
+const triggered = ref(true)
8
+const state = reactive({
9
+  // 列表高度
10
+  scrollHeight: 0,
11
+  // 一级分类:指针
12
+  curIndex: 0,
13
+  // 内容区垂直滚动条位置
14
+  scrollTop: 0,
15
+
16
+  tabCurrent: 0,
17
+  status: 'loading',
18
+  currentPage: 1,
19
+  totalPage: 1,
20
+  total: 1,
21
+  pageSize: 10,
22
+  triggered: true,
23
+
24
+  category_id: 0,
25
+  merchantCategory: [],
26
+  merchantList: [],
27
+  merchantPageNum: 1,
28
+  merchantPageSize: 10,
29
+  merchantKeyword: '',
30
+  lat: '',
31
+  lng: '',
32
+
33
+  currentMerchantCategoryId: 0,
34
+
35
+  options: [{
36
+    text: '智能推荐',
37
+    value: 1,
38
+  }, {
39
+    text: '距离优先',
40
+    value: 2
41
+  }],
42
+  menuDefaultValue: 1
43
+  // merchantPageInfo: {}
44
+})
45
+const searchValue = ref('')
46
+
47
+const {windowHeight} = uni.getSystemInfoSync()
48
+state.scrollHeight = windowHeight - 45
49
+
50
+onLoad(() => {
51
+  // getMerchantCategory()
52
+  getSelectMerchantSort().then(res => {
53
+    state.merchantCategory = res.merchantCategory
54
+  })
55
+
56
+  // loadSelectMerchant('reload')
57
+})
58
+
59
+onShow(() => {
60
+  loadAll()
61
+})
62
+
63
+function loadAll() {
64
+  state.category_id = 0
65
+  loadSelectMerchant('reload')
66
+}
67
+
68
+function handleCategoryChange(category) {
69
+  console.log(category)
70
+  state.currentMerchantCategoryId = category.merchant_category_id
71
+  // console.log(category)
72
+  // loadSelectMerchant()
73
+  state.category_id = category.merchant_category_id
74
+  loadSelectMerchant('reload')
75
+}
76
+
77
+function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => void) {
78
+  if (state.category_id == 0) {
79
+    state.currentMerchantCategoryId = state.category_id
80
+  }
81
+  let params: StoreParams = {
82
+    pageNum: state.currentPage,
83
+    pageSize: state.pageSize,
84
+    mer_keyword: searchValue.value,
85
+    // mer_keyword: mer_keyword,
86
+    // lat: '',
87
+    // lng: '',
88
+
89
+  }
90
+  if (state.category_id !== 0) {
91
+    // params.category_id = category_id
92
+    params = Object.assign({}, params, {
93
+      category_id: state.category_id
94
+    })
95
+  }
96
+  if (state.menuDefaultValue === 2) {
97
+    params = Object.assign({}, params, {
98
+      distanceAsc: 0,
99
+      lat: uni.getStorageSync(USER_LATITUDE),
100
+      lng: uni.getStorageSync(USER_LONGITUDE)
101
+    })
102
+  }
103
+
104
+  getSelectMerchant(params).then((res: StoreResult) => {
105
+    console.log(state.triggered)
106
+    state.triggered = false
107
+
108
+    state.total = res.total
109
+    state.totalPage = Math.ceil(state.total / state.pageSize);
110
+    console.log(state.totalPage)
111
+    // state.merchantList = res.list
112
+    if (action === 'page') {
113
+      state.merchantList = state.merchantList.concat(res.list)
114
+    }
115
+    if (action === 'reload') {
116
+      state.merchantList = res.list
117
+    }
118
+    // state.totalPage = Math.ceil(totalItems / state.pageSize);
119
+
120
+    state.status = 'more'
121
+
122
+    if (callback) {
123
+      callback(res.list)
124
+    }
125
+  })
126
+}
127
+
128
+function handleShowMerchant(merchant) {
129
+  console.log(merchant)
130
+  uni.navigateTo({
131
+    url: '/pages/store/home/index?id=' + merchant.mer_id
132
+  })
133
+}
134
+
135
+
136
+function change() {
137
+}
138
+
139
+function onChange() {
140
+}
141
+
142
+// 下拉刷新被下拉
143
+const onRefresherPulling = e => {
144
+
145
+  // state.triggered = true;
146
+  triggered.value = true
147
+};
148
+// 下拉刷新被复位
149
+const onRefresherRestore = e => {
150
+  // state.triggered = false;
151
+  triggered.value = false
152
+};
153
+// 下拉刷新被中止
154
+const onRefresherAbort = e => {
155
+  // state.triggered = false;
156
+  triggered.value = false
157
+}
158
+// 下拉刷新被触发
159
+const onRefresherRefresh = e => {
160
+  // state.triggered = false
161
+  triggered.value = false
162
+
163
+  loadSelectMerchant('reload')
164
+};
165
+
166
+function handleScrollToLower() {
167
+  state.status = 'loading';
168
+  state.currentPage += 1;
169
+  if (state.currentPage > state.totalPage) {
170
+    state.status = 'noMore';
171
+  } else {
172
+    // queryFavorites('page');
173
+    loadSelectMerchant('page')
174
+  }
175
+}
176
+
177
+</script>
178
+<template>
179
+  <!--  <nut-category :category="state.merchantCategory" @change="change">-->
180
+  <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange">-->
181
+  <!--    </nut-category-pane>-->
182
+  <!--  </nut-category>-->
183
+  <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white">
184
+
185
+    <nut-searchbar
186
+        v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant( 'reload')">
187
+      <template v-slot:rightout>
188
+        <div @tap="loadSelectMerchant('reload')">
189
+          搜索
190
+        </div>
191
+      </template>
192
+    </nut-searchbar>
193
+
194
+
195
+  </div>
196
+  <div class="flex pt-10 "
197
+  >
198
+    <!-- 左侧 一级分类 -->
199
+    <div class="w-1/4">
200
+      <scroll-view
201
+          :scroll-y="true"
202
+          :style="{ height: `${state.scrollHeight}px` }"
203
+          class="w-full h-full bg-[#f8f8f8]"
204
+      >
205
+        <div
206
+            @tap="loadAll()"
207
+            :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
208
+            class="relative w-25 h-12 block text-sm flex justify-center items-center">
209
+          <div class="flex items-center gap-1">
210
+            <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == 0"></div>
211
+            <div>全部</div>
212
+          </div>
213
+
214
+        </div>
215
+        <div v-for="(item, index) in state.merchantCategory" :key="index"
216
+             @tap="handleCategoryChange(item)"
217
+             :class="state.currentMerchantCategoryId == item.merchant_category_id ? 'bg-white font-bold' : ''"
218
+             class="relative h-12 block text-sm flex justify-center items-center gap-1 w-25"
219
+        >
220
+          <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == item.merchant_category_id"></div>
221
+
222
+          <div>
223
+            {{ item.category_name }}
224
+
225
+          </div>
226
+
227
+        </div>
228
+      </scroll-view>
229
+
230
+    </div>
231
+
232
+
233
+    <div class="w-3/4 ">
234
+      <div class="fixed z-3 flex flex-col justify-center h-10 pl-3 top-10">
235
+        <nut-menu>
236
+          <nut-menu-item v-model="state.menuDefaultValue"
237
+                         :options="state.options"
238
+                         @change="loadSelectMerchant('reload')"
239
+          >
240
+
241
+          </nut-menu-item>
242
+        </nut-menu>
243
+      </div>
244
+
245
+      <scroll-view
246
+          :scroll-y="true"
247
+          :style="{ height: `${state.scrollHeight - 50}px` }"
248
+          scroll-with-animation
249
+          class="flex flex-1  flex-col   p-3 gap-3 mt-10"
250
+          :refresher-enabled="true"
251
+          refresher-background="#f5f5f5"
252
+          refresher-default-style="black"
253
+          :refresher-triggered="state.triggered"
254
+          @scrolltolower="handleScrollToLower"
255
+          @refresherpulling="onRefresherPulling"
256
+          @refresherrestore="onRefresherRestore"
257
+          @refresherabort="onRefresherAbort"
258
+          @refresherrefresh="onRefresherRefresh"
259
+          v-if="state.merchantList && state.merchantList.length > 0"
260
+
261
+      >
262
+        <div
263
+            v-for="(item, index) in state.merchantList" :key="index"
264
+            @click="handleShowMerchant(item)"
265
+            class="mb-3 ">
266
+          <div class="flex">
267
+            <div class="flex ">
268
+              <image :src="item.mer_avatar"
269
+                     mode="aspectFill"
270
+                     class="w-20 h-20 rounded-lg"
271
+              ></image>
272
+            </div>
273
+
274
+            <div class="flex flex-col justify-between px-2">
275
+              <div class="flex flex-col gap-2">
276
+                <div class="truncate w-40 ">
277
+                  {{ item.mer_name }}
278
+                </div>
279
+                <div class="text-xs text-gray">
280
+                  {{ item.care_count }} 人关注
281
+                </div>
282
+              </div>
283
+
284
+              <div class="text-xs">{{ (item.distance / 100).toFixed(1) }}km</div>
285
+            </div>
286
+
287
+          </div>
288
+        </div>
289
+      </scroll-view>
290
+      <div class="flex justify-center items-center w-full h-[60%]" v-else>
291
+        <CXBEmpty/>
292
+
293
+      </div>
294
+    </div>
295
+
296
+  </div>
297
+</template>
298
+<route lang="yaml">
299
+style:
300
+  navigationBarTitleText: 储蓄保
301
+  enablePullDownRefresh: false
302
+</route>
303
+
304
+<style lang="scss">
305
+page {
306
+  overflow: hidden;
307
+  --nut-menu-item-font-size: 14px;
308
+  --nut-menu-bar-line-height: 24px;
309
+  --nut-menu-bar-box-shadow: none;
310
+  --nut-menu-item-active-text-color: #FE0032;
311
+
312
+  .nut-menu {
313
+    background: none !important;
314
+  }
315
+  .nut-menu__bar {
316
+    box-shadow: none !important;
317
+    border: 1px solid #FE0032;
318
+    border-radius: 4px;
319
+  }
320
+}
321
+</style>

+ 51 - 20
src/pages/store/nearby/index.vue

@@ -4,8 +4,10 @@ import type {StoreResult} from "~/apis/model/storeModel";
4 4
 import {StoreParams} from "~/apis/model/storeModel";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6 6
 import {USER_LATITUDE, USER_LONGITUDE} from "~/constants";
7
+const usePageStore = usePageStoreWidthOut()
7 8
 
8
-const state = reactive<any>({
9
+
10
+const state = reactive({
9 11
   // 列表高度
10 12
   scrollHeight: 0,
11 13
   // 一级分类:指针
@@ -19,7 +21,7 @@ const state = reactive<any>({
19 21
   totalPage: 1,
20 22
   total: 1,
21 23
   pageSize: 10,
22
-  triggered: false,
24
+  triggered: true,
23 25
 
24 26
   category_id: 0,
25 27
   merchantCategory: [],
@@ -45,7 +47,7 @@ const state = reactive<any>({
45 47
 const searchValue = ref('')
46 48
 
47 49
 const {windowHeight} = uni.getSystemInfoSync()
48
-state.scrollHeight = windowHeight - 70
50
+state.scrollHeight = windowHeight - 45
49 51
 
50 52
 onLoad(() => {
51 53
   // getMerchantCategory()
@@ -57,7 +59,14 @@ onLoad(() => {
57 59
 })
58 60
 
59 61
 onShow(() => {
62
+  usePageStore.setPageConfig({
63
+    currentPage: {
64
+      type: 'tab',
65
+      url:  '/pages/store/nearby/index'
66
+    }
67
+  })
60 68
   loadAll()
69
+
61 70
 })
62 71
 
63 72
 function loadAll() {
@@ -100,7 +109,10 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
100 109
       lng: uni.getStorageSync(USER_LONGITUDE)
101 110
     })
102 111
   }
112
+
103 113
   getSelectMerchant(params).then((res: StoreResult) => {
114
+    console.log(state.triggered)
115
+
104 116
     state.total = res.total
105 117
     state.totalPage = Math.ceil(state.total / state.pageSize);
106 118
     console.log(state.totalPage)
@@ -112,6 +124,9 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
112 124
       state.merchantList = res.list
113 125
     }
114 126
     // state.totalPage = Math.ceil(totalItems / state.pageSize);
127
+    setTimeout(() => {
128
+      state.triggered = false
129
+    }, 300)
115 130
 
116 131
     state.status = 'more'
117 132
 
@@ -149,7 +164,8 @@ const onRefresherAbort = e => {
149 164
 }
150 165
 // 下拉刷新被触发
151 166
 const onRefresherRefresh = e => {
152
-  loadSelectMerchant(0)
167
+
168
+  loadSelectMerchant('reload')
153 169
 };
154 170
 
155 171
 function handleScrollToLower() {
@@ -169,17 +185,21 @@ function handleScrollToLower() {
169 185
   <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange">-->
170 186
   <!--    </nut-category-pane>-->
171 187
   <!--  </nut-category>-->
172
-  <nut-searchbar
173
-      class="absolute top-0"
174
-      v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant( 'reload')">
175
-    <template v-slot:rightout>
176
-      <div @tap="loadSelectMerchant('reload')">
177
-        搜索
178
-      </div>
179
-    </template>
180
-  </nut-searchbar>
188
+  <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white w-full">
181 189
 
182
-  <div class="flex ">
190
+    <nut-searchbar
191
+        v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant( 'reload')">
192
+      <template v-slot:rightout>
193
+        <div @tap="loadSelectMerchant('reload')">
194
+          搜索
195
+        </div>
196
+      </template>
197
+    </nut-searchbar>
198
+
199
+
200
+  </div>
201
+  <div class="flex pt-10 "
202
+  >
183 203
     <!-- 左侧 一级分类 -->
184 204
     <div class="w-1/4">
185 205
       <scroll-view
@@ -215,8 +235,8 @@ function handleScrollToLower() {
215 235
     </div>
216 236
 
217 237
 
218
-    <div class="w-3/4">
219
-      <div class="fixed z-3 flex flex-col justify-center h-10 pl-3">
238
+    <div class="w-3/4 ">
239
+      <div class="fixed z-3 flex flex-col justify-center h-10 pl-3 top-10">
220 240
         <nut-menu>
221 241
           <nut-menu-item v-model="state.menuDefaultValue"
222 242
                          :options="state.options"
@@ -229,15 +249,15 @@ function handleScrollToLower() {
229 249
 
230 250
       <scroll-view
231 251
           :scroll-y="true"
232
-          :style="{ height: `${state.scrollHeight}px` }"
252
+          :style="{ height: `${state.scrollHeight -60}px` }"
233 253
           scroll-with-animation
234
-          class="flex flex-1  flex-col h-full w-full  p-3 gap-3 mt-8"
254
+          class="flex flex-1  flex-col   p-3 gap-3 mt-10"
235 255
           :refresher-enabled="true"
236 256
           refresher-background="#f5f5f5"
237 257
           refresher-default-style="black"
238 258
           :refresher-triggered="state.triggered"
239 259
           @scrolltolower="handleScrollToLower"
240
-          @refresherPulling="onRefresherPulling"
260
+          @refresherpulling="onRefresherPulling"
241 261
           @refresherRestore="onRefresherRestore"
242 262
           @refresherAbort="onRefresherAbort"
243 263
           @refresherrefresh="onRefresherRefresh"
@@ -271,6 +291,16 @@ function handleScrollToLower() {
271 291
 
272 292
           </div>
273 293
         </div>
294
+
295
+        <div class=" flex justify-center items-center text-[12px] text-gray-500"
296
+        >
297
+          <div v-if="state.status === 'loading'">
298
+            加载中...
299
+          </div>
300
+          <div v-if="state.status === 'noMore'">
301
+            没有更多了~
302
+          </div>
303
+        </div>
274 304
       </scroll-view>
275 305
       <div class="flex justify-center items-center w-full h-[60%]" v-else>
276 306
         <CXBEmpty/>
@@ -283,11 +313,12 @@ function handleScrollToLower() {
283 313
 <route lang="yaml">
284 314
 style:
285 315
   navigationBarTitleText: 储蓄保
286
-  enablePullDownRefresh: true
316
+  enablePullDownRefresh: false
287 317
 </route>
288 318
 
289 319
 <style lang="scss">
290 320
 page {
321
+  overflow: hidden;
291 322
   --nut-menu-item-font-size: 14px;
292 323
   --nut-menu-bar-line-height: 24px;
293 324
   --nut-menu-bar-box-shadow: none;

+ 132 - 0
src/pages/store/product/detail.json

@@ -0,0 +1,132 @@
1
+{
2
+  "status": 200,
3
+  "message": "success",
4
+  "data": {
5
+    "product_id": "4858",
6
+    "mer_id": "321",
7
+    "image": "https:\/\/img.yunzhonghe.com\/image\/1594102082351snWdknfIaZ.jpg",
8
+    "slider_image": [
9
+      "https:\/\/img.yunzhonghe.com\/image\/1594102082351snWdknfIaZ.jpg"
10
+    ],
11
+    "store_name": "壳子妃子玫瑰红葡萄干235gS011 香槟黄 香槟黄",
12
+    "store_info": "1",
13
+    "unit_name": "个",
14
+    "price": "29.10",
15
+    "cost": "26.46",
16
+    "ot_price": "67.00",
17
+    "stock": "1000",
18
+    "sales": 100,
19
+    "video_link": "",
20
+    "product_type": "0",
21
+    "type": "5",
22
+    "dc_price": "29.90",
23
+    "seckill": "1",
24
+    "isRelation": false,
25
+    "sku": {
26
+      "默认": {
27
+        "sku": "默认",
28
+        "price": "29.10",
29
+        "stock": "100",
30
+        "image": "https:\/\/img.yunzhonghe.com\/image\/1594102082351snWdknfIaZ.jpg",
31
+        "bar_code": "",
32
+        "weight": "0.00",
33
+        "volume": "0.00",
34
+        "ot_price": "67.00",
35
+        "unique": "6b0753bbacf0",
36
+        "dacang": "29.90"
37
+      }
38
+    },
39
+    "replayData": {
40
+      "best": 0,
41
+      "rate": "",
42
+      "count": 0
43
+    },
44
+    "unique": "6b0753bbacf0",
45
+    "attr": [
46
+      {
47
+        "product_id": "4858",
48
+        "attr_name": "规格",
49
+        "attr_values": [
50
+          "默认"
51
+        ],
52
+        "type": "0",
53
+        "attr_id": null,
54
+        "attr_value": [
55
+          {
56
+            "attr": "默认",
57
+            "check": false
58
+          }
59
+        ]
60
+      }
61
+    ],
62
+    "yanglao": "1.49",
63
+    "product_count": 89,
64
+    "merchant_type": "3",
65
+    "seckill_date_end": "2023-08-22 18:00:00",
66
+    "seckill_s": 0,
67
+    "content": {
68
+      "product_id": "4858",
69
+      "content": "<img src='https:\/\/img.yunzhonghe.com\/image\/1594102142038jrPEvcMTXF.jpg'>",
70
+      "type": "0"
71
+    },
72
+    "topReply": null,
73
+    "merchant": {
74
+      "mer_id": "321",
75
+      "mer_name": "大仓创客",
76
+      "mer_avatar": "https:\/\/app.bjtdba.com\/uploads\/def\/20220428\/d616961db8aefbe92f72972a1d7db88a.png",
77
+      "product_score": "3.8",
78
+      "service_score": "3.6",
79
+      "postage_score": "3.6",
80
+      "service_phone": "13260336036",
81
+      "care_count": "11",
82
+      "business_id": "0",
83
+      "sxy_submerchant_id": "895152791",
84
+      "im": {
85
+        "im": "0",
86
+        "im_uuid": null,
87
+        "account": "12222222222"
88
+      },
89
+      "recommend": [
90
+        {
91
+          "mer_id": "321",
92
+          "product_id": "6183",
93
+          "store_name": "苏泊尔(SUPOR)ZMD安心系列 智能电饭煲电饭锅 5L容量 球釜内胆 多功能智能预约 香槟金色CFXB50FC59-75",
94
+          "image": "https:\/\/img13.360buyimg.com\/n12\/jfs\/t1\/52232\/37\/17532\/79491\/63282471Ec5d2ca36\/7c12d780f0be4a38.jpg",
95
+          "price": "240.79",
96
+          "is_show": "1",
97
+          "status": "1",
98
+          "is_gift_bag": "0",
99
+          "is_good": "0",
100
+          "ot_price": "279.00",
101
+          "yanglao": "5.47"
102
+        },
103
+        {
104
+          "mer_id": "321",
105
+          "product_id": "6193",
106
+          "store_name": "瑞士宾爵手表钟表高端绿面钢带防水配饰女表B1530L",
107
+          "image": "https:\/\/oss-hxq-prod.szbaoly.com\/bjsc\/goods\/16396d71ec8e4552a5530b33f517a344.jpg",
108
+          "price": "251.55",
109
+          "is_show": "1",
110
+          "status": "1",
111
+          "is_gift_bag": "0",
112
+          "is_good": "0",
113
+          "ot_price": "1217.00",
114
+          "yanglao": "5.71"
115
+        },
116
+        {
117
+          "mer_id": "321",
118
+          "product_id": "6201",
119
+          "store_name": "瑞士宾爵手表钟表小方表轻奢时尚配饰女表B1020L",
120
+          "image": "https:\/\/oss-hxq-prod.szbaoly.com\/bjsc\/goods\/1d66a54c8c454ece98e1b042adf093f3.jpg",
121
+          "price": "247.56",
122
+          "is_show": "1",
123
+          "status": "1",
124
+          "is_gift_bag": "0",
125
+          "is_good": "0",
126
+          "ot_price": "2980.00",
127
+          "yanglao": "5.62"
128
+        }
129
+      ]
130
+    }
131
+  }
132
+}

+ 64 - 12
src/pages/store/product/detail.vue

@@ -15,12 +15,17 @@ import {
15 15
 } from "~/apis/model/product.model";
16 16
 import {DcProductModel} from "~/apis/model/dacang.model";
17 17
 import {CDN_URL} from "~/config/app";
18
+import {debounce} from "lodash-es";
19
+
20
+const usePageStore = usePageStoreWidthOut()
18 21
 
19 22
 const shangpinxiangqing_dianpu = CDN_URL + '/static/assets/shangpinxiangqing_dianpu.png'
20 23
 const shangpinxiangqing_kefu = CDN_URL + '/static/assets/shangpinxiangqing_kefu.png'
21 24
 const shangpinxiangqing_gouwuche = CDN_URL + '/static/assets/shangpinxiangqing_gouwuche.png'
22 25
 const wx_shareImg = CDN_URL + '/static/assets/wx_share_221121.png'
23 26
 const pyqImg = CDN_URL + '/static/assets/pyq_221121.png'
27
+const miaoshaIcon = CDN_URL + '/static/assets/miaoshajia_220805.png'
28
+const userStore = useUserStore()
24 29
 
25 30
 const shareShowTips = ref(false)
26 31
 const state = reactive({
@@ -32,7 +37,7 @@ const state = reactive({
32 37
   autoplay: true,
33 38
   interval: 5000,
34 39
   duration: 500,
35
-  currents: "1",
40
+  currents: "0",
36 41
   controls: true,
37 42
 
38 43
   recommendList: [],
@@ -50,11 +55,17 @@ const state = reactive({
50 55
   isNew: '0',
51 56
   cartNum: 1,
52 57
 
53
-  cartCount: 10,
58
+  cartCount: NaN,
54 59
 })
55 60
 const detail: any = ref(null)
56 61
 
57 62
 onShow(() => {
63
+  usePageStore.setPageConfig({
64
+    orderBack: {
65
+      type: 'page',
66
+      url: '/pages/store/product/detail?id=' + state.id
67
+    }
68
+  })
58 69
   loadCartCount()
59 70
 
60 71
 })
@@ -64,8 +75,9 @@ uni.showShareMenu({
64 75
   menus: ['shareAppMessage', 'shareTimeline']
65 76
 })
66 77
 onLoad((option: any) => {
67
-  // const id = '5491'
68
-  state.id = option.id
78
+  // const id = '4858'
79
+  // state.id = option.id
80
+  state.id = 4858
69 81
 
70 82
 
71 83
   getRecommendList({
@@ -119,15 +131,23 @@ onShareTimeline(() => {
119 131
 
120 132
 
121 133
 function loadCartCount() {
134
+  state.cartCount = NaN
122 135
   getCartCount().then(res => {
123 136
     console.log(res)
124 137
     state.cartCount = res[0].count
125 138
   }).catch(error => {
126 139
     console.log(error)
127 140
     if (error === '请登录') {
128
-      uni.navigateTo({
129
-        url: '/pages/user/login/index?key=4'
141
+      uni.showToast({
142
+        title: '请登录',
143
+        icon: 'none'
130 144
       })
145
+      // setTimeout(() => {
146
+      //   uni.navigateTo({
147
+      //     url: '/pages/user/login/index?key=4'
148
+      //   })
149
+      // }, 500)
150
+
131 151
     }
132 152
   })
133 153
 }
@@ -185,8 +205,8 @@ function handleAddCart() {
185 205
 }
186 206
 
187 207
 function handleCreateShopping() {
188
-  console.log(state.flag)
189
-  console.log(state.currentSku.unique)
208
+  // console.log(state.flag)
209
+  // console.log(state.currentSku.unique)
190 210
   createShopping({
191 211
     product_id: detail.value.product_id,
192 212
     // product_attr_unique: JSON.stringify(state.currentSku),
@@ -194,14 +214,16 @@ function handleCreateShopping() {
194 214
     cart_num: state.cartNum,
195 215
     is_new: (state.flag === '1' || state.flag === '3') ? '1': '0'
196 216
   }).then(res => {
197
-    console.log(res)
217
+    // console.log(res)
198 218
     if (res.cart_id) {
199
-      console.log(state.flag)
219
+      // console.log(state.flag)
200 220
       if (state.flag == '1' || state.flag == '3') {
201 221
         uni.navigateTo({
202 222
           url: `/pages/order-confirm/index?cartId=${res.cart_id}&type=${state.flag}&product_id=${detail.value.product_id}`
203 223
         })
204 224
       } else {
225
+        uni.$emit('cart-reload')
226
+
205 227
         uni.showToast({
206 228
           title: '添加购物车成功',
207 229
           icon: 'none'
@@ -236,6 +258,25 @@ function handleCreateShopping() {
236 258
  * @param flag //1表示立即购买;2表示加入购物车,3表示立即兑换
237 259
  */
238 260
 function handleOrderConfirm(flag: '1' | '2'| '3') {
261
+  debounce(() => {
262
+    if (!userStore.uid) {
263
+      return uni.showToast({
264
+        title: '请登录',
265
+        icon: 'none'
266
+      }).then(() => {
267
+        setTimeout(() => {
268
+          return uni.navigateTo({
269
+            url: '/pages/user/login/index'
270
+          })
271
+        }, 500)
272
+
273
+      })
274
+    }
275
+  }, 150,  {
276
+    'leading': true,
277
+    'trailing': false
278
+  })
279
+
239 280
   state.flag = flag
240 281
   state.isShowSku = true
241 282
   // if (is148Merchant.value) {
@@ -301,7 +342,7 @@ function handleRelation() {
301 342
 }
302 343
 
303 344
 function handleRemoveRelation() {
304
-  console.log('on....')
345
+  // console.log('on....')
305 346
   removeMyRelation({type: 1, type_id: state.id}).then(res => {
306 347
     // isCare.value = false
307 348
     state.isRelation = false
@@ -360,6 +401,17 @@ function handleShowCustomer() {
360 401
           </swiper-item>
361 402
         </swiper>
362 403
       </div>
404
+      <div class="bg-gradient-to-r from-[#fe7577] to-[#fe0032] h-25 mt-3" v-if="detail.seckill == 1">
405
+       <div class="flex gap-2 items-center text-white">
406
+           <div class="text-[24px]">
407
+             <text class="text-[20px]">¥</text>{{ detail.price }}
408
+           </div>
409
+           <image :src="miaoshaIcon" mode="widthFix" class="w-10"></image>
410
+       </div>
411
+        <div class="text-white">
412
+          即将恢复原价
413
+        </div>
414
+      </div>
363 415
       <div class="bg-black bg-op-30 fixed top-3  rounded-full right-3 h-6 w-6 flex flex-col justify-center items-center z-10"
364 416
            @click="toggleRelation"
365 417
       >
@@ -373,7 +425,7 @@ function handleShowCustomer() {
373 425
           class="flex flex-col p-3 gap-3">
374 426
         <div class="flex flex-row  items-center text-[#FE0032] font-bold text-lg gap-2">
375 427
           <div v-if="is148Merchant && detail.price" class="flex justify-end items-end gap-2">
376
-            <div class="!text-[24px]">{{ detail.price }} </div>
428
+            <div class="!text-[24px]">{{ Number.parseFloat(detail.price).toFixed(2) }} </div>
377 429
             <div class="text-sm">积分</div>
378 430
           </div>
379 431
           <div v-else>

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

@@ -18,13 +18,19 @@ import type {
18 18
 import FPrice from "~/components/FPrice/FPrice.vue";
19 19
 import FButton from "~/components/FButton/FButton.vue";
20 20
 import CXBButton from "~/components/CXBButton/CXBButton.vue";
21
-import {merge} from "lodash-es";
21
+import {debounce, merge} from "lodash-es";
22
+
23
+import { useDebounceFn } from '@vueuse/core';
24
+
22 25
 import dayjs from "dayjs";
23 26
 import {decodeBase64} from "~/utils/http/helper";
24 27
 import {CDN_URL} from "~/config/app";
25 28
 const discount_coupon_bg_220804Image = CDN_URL + '/static/assets/discount_coupon_bg_220804.png'
26 29
 const productId = ref('')
27 30
 //
31
+
32
+const userStore = useUserStore()
33
+const isSubmit = ref(false)
28 34
 const productType = ref(-1)
29 35
 // 优惠券劵信息
30 36
 const coupon = ref({
@@ -53,6 +59,10 @@ onLoad((options: any) => {
53 59
   loadProductDetail(data)
54 60
   // }
55 61
 })
62
+onShow(() => {
63
+  isSubmit.value = false
64
+
65
+})
56 66
 
57 67
 function mergeProductDetail(data: Partial<IProductDetail> = {}) {
58 68
   detail.value = merge(detail.value, data)
@@ -162,9 +172,30 @@ function loadProductDetail(product: Partial<IProductDetail>) {
162 172
     })
163 173
   }
164 174
 }
165
-
166 175
 function handleBuyNow() {
167
-  console.log(detail.value)
176
+  if (isSubmit.value) return
177
+  if(!userStore.uid) {
178
+    isSubmit.value = true
179
+
180
+    uni.navigateTo({
181
+      url: '/pages/user/login/index'
182
+    })
183
+  }
184
+    // debounce(() => {
185
+    //   console.log('debounce.....')
186
+    // }, 300)
187
+    // _debounce(() => {
188
+    //   return uni.navigateTo({
189
+    //     url: '/pages/user/login/index'
190
+    //   })
191
+    // }, 300)
192
+
193
+    // console.log('没登录')
194
+    // return _debounce(() => {
195
+    //     return uni.navigateTo({
196
+    //       url: '/pages/user/login/index'
197
+    //     })
198
+    // }, 300)
168 199
   // 京东
169 200
   if (detail.value?.platform == 6 && detail.value?.materialUrl) {
170 201
     // console.log(detail.value?.spreadUrl)
@@ -193,7 +224,7 @@ function handleBuyNow() {
193 224
       })
194 225
     }
195 226
   }
196
-  if (detail.value?.platform == 1) {
227
+  else if (detail.value?.platform == 1) {
197 228
     // console.log(detail.value)
198 229
     const pddWx = detail.value.pddlink.wx
199 230
     if (pddWx) {
@@ -222,9 +253,14 @@ function handleBuyNow() {
222 253
     // console.log(detail.value.pddlink)
223 254
     // console.log(pddWx)
224 255
   }
256
+  else {
257
+    return uni.showToast({
258
+      title: '商品维护中,请稍后再试',
259
+      icon: 'none'
260
+    })
261
+  }
262
+  /*
225 263
   if (detail.value?.platform == 3) {
226
-    // console.log('sunig')
227
-    // console.log(detail.value)
228 264
   }
229 265
 
230 266
   if (detail.value?.platform == 9) {
@@ -232,7 +268,7 @@ function handleBuyNow() {
232 268
   }
233 269
   if (detail.value?.platform == 2) {
234 270
     console.log(detail.value)
235
-  }
271
+  }*/
236 272
 }
237 273
 
238 274
 /**
@@ -319,7 +355,7 @@ const hasCoupon = computed(() => {
319 355
               <FPrice :price="detail.allowance" need-symbol ex-class="text-[20px] font-bold"/>
320 356
             </div>
321 357
             <div>
322
-              <nut-button type="primary" @tap="handleBuyNow">
358
+              <nut-button type="primary" @tap="handleBuyNow" :disabled="isSubmit">
323 359
                 立即购买
324 360
               </nut-button>
325 361
             </div>
@@ -333,6 +369,6 @@ const hasCoupon = computed(() => {
333 369
 
334 370
 <route lang="yaml">
335 371
 style:
336
-  navigationBarTitleText: 储蓄保
372
+  navigationBarTitleText: 商品详情
337 373
   enablePullDownRefresh: true
338 374
 </route>

+ 74 - 0
src/pages/store/product/test.json

@@ -0,0 +1,74 @@
1
+{
2
+  "status": 200,
3
+  "message": "success",
4
+  "data": [
5
+    {
6
+      "seckill_date": "22日17:00已结束",
7
+      "ctime": "2023-02-15 01:00:00",
8
+      "product_id": "4508",
9
+      "status": "1",
10
+      "product_data": [
11
+        {
12
+          "mer_id": "321",
13
+          "product_id": "4508",
14
+          "store_name": "韩后熬夜甜睡修护面膜135ml 免洗睡眠面膜补水保湿深层滋养男女可用",
15
+          "image": "https:\/\/img13.360buyimg.com\/n12\/jfs\/t1\/219531\/21\/20940\/41092\/6311db6bE054cabee\/ed882adff197adfb.jpg",
16
+          "ot_price": "109.00",
17
+          "seckill_price": "24.80",
18
+          "yanglao": "1.24",
19
+          "status": 3,
20
+          "img_text": "已结束"
21
+        },
22
+        {
23
+          "mer_id": "321",
24
+          "product_id": "4858",
25
+          "store_name": "壳子妃子玫瑰红葡萄干235gS011 香槟黄 香槟黄",
26
+          "image": "https:\/\/img.yunzhonghe.com\/image\/1594102082351snWdknfIaZ.jpg",
27
+          "ot_price": "67.00",
28
+          "seckill_price": "29.90",
29
+          "yanglao": "1.49",
30
+          "status": 3,
31
+          "img_text": "已结束"
32
+        }
33
+      ]
34
+    },
35
+    {
36
+      "seckill_date": "22日21:00已结束",
37
+      "ctime": "2023-02-14 01:00:00",
38
+      "product_id": "4957",
39
+      "status": 3,
40
+      "product_data": [
41
+        {
42
+          "mer_id": "321",
43
+          "product_id": "4957",
44
+          "store_name": "云南白药清逸堂携爽舒缓棒(简装)  黑  ",
45
+          "image": "https:\/\/img.yunzhonghe.com\/image\/1649999225845LKCOiTiTOm.jpg",
46
+          "ot_price": "59.00",
47
+          "seckill_price": "28.90",
48
+          "yanglao": "1.44",
49
+          "status": 3,
50
+          "img_text": "已结束"
51
+        }
52
+      ]
53
+    },
54
+    {
55
+      "seckill_date": "14日14:00已结束",
56
+      "ctime": "2023-09-14 14:28:33",
57
+      "product_id": "6103",
58
+      "status": "1",
59
+      "product_data": [
60
+        {
61
+          "mer_id": "465",
62
+          "product_id": "6103",
63
+          "store_name": "测试001商品",
64
+          "image": "https:\/\/cdn.bjtdba.com\/chuxubao\/images\/2023-09-09\/3e1a8202309091612417658.jpg",
65
+          "ot_price": "200.00",
66
+          "seckill_price": "10.00",
67
+          "yanglao": "0.50",
68
+          "status": 3,
69
+          "img_text": "已结束"
70
+        }
71
+      ]
72
+    }
73
+  ]
74
+}

+ 97 - 5
src/pages/third_party_binding/index.vue

@@ -1,14 +1,23 @@
1 1
 <script lang="ts" setup>
2 2
 import {CDN_URL} from "~/config/app";
3
-import {getBindingState} from "~/apis/user";
4
-import {findLast} from "lodash-es";
3
+import {getBindingState, getUserUnionId, wechatCheck} from "~/apis/user";
4
+import {findLast, union} from "lodash-es";
5
+import {getUpdateAccount} from "~/apis/auth.api";
5 6
 
6 7
 const zfbImage = CDN_URL + '/static/assets/zfb_sf_220908.png'
7 8
 const wxImage = CDN_URL + '/static/assets/wx_sf_220908.png'
8 9
 
9 10
 const bindState = ref([])
11
+import {useUserStore} from "~/stores/userStore";
12
+
13
+const userStore = useUserStore()
14
+
10 15
 
11 16
 onLoad(() => {
17
+  loadBindingState()
18
+})
19
+
20
+function loadBindingState() {
12 21
   getBindingState().then(res => {
13 22
     console.log(res)
14 23
     if (res) {
@@ -20,8 +29,7 @@ onLoad(() => {
20 29
       icon: 'none'
21 30
     })
22 31
   })
23
-})
24
-
32
+}
25 33
 function getBindState(type) {
26 34
   if (bindState.value) {
27 35
     return findLast(bindState.value, (value) => {
@@ -35,6 +43,87 @@ function getBindState(type) {
35 43
     // })
36 44
   }
37 45
 }
46
+
47
+function updateAccount(type, info: {unionId: string, nickName: string, avatarUrl: string}) {
48
+  uni.showLoading({
49
+    title: '绑定中',
50
+    icon: 'none'
51
+  })
52
+  getUpdateAccount({
53
+    type,
54
+    openid: info.unionId,
55
+    nickname: info.nickName,
56
+    // 这里接收的单词有误
57
+    avater: info.avatarUrl
58
+  }).then(res => {
59
+    // console.log(res)
60
+    // if (res) {
61
+      uni.showToast({
62
+        title: '绑定成功',
63
+        icon: "none"
64
+      })
65
+    loadBindingState()
66
+
67
+    uni.hideLoading()
68
+
69
+    // }
70
+  }).catch(error => {
71
+    uni.showToast({
72
+      title: error,
73
+      icon: 'none'
74
+    })
75
+  })
76
+
77
+}
78
+function getUserInfo() {
79
+  if (!getBindState('1')) {
80
+    uni.login({
81
+      provider: 'weixin',
82
+      univerifyStyle: {
83
+        fullScreen: true
84
+      },
85
+      success: (result) => {
86
+        getUserUnionId({
87
+          code: result.code,
88
+          source: 'cxb'
89
+        }).then(unionRes => {
90
+          console.log(userStore.userInfo)
91
+          console.log(unionRes)
92
+          updateAccount(1, {
93
+            unionId: unionRes.unionid,
94
+            nickName: userStore.userInfo.nickname,
95
+            avatarUrl: userStore.userInfo.avatar
96
+          })
97
+              // wechatCheck(unionRes.unionid).then(checkRes => {
98
+              //   userStore.login(checkRes.token, checkRes.exp)
99
+              //   userStore.setUID(checkRes.user.uid)
100
+              //   userStore.setUserInfo(checkRes.user)
101
+              //   console.log(checkRes)
102
+              //
103
+              //   setTimeout(() => {
104
+              //     uni.showToast({
105
+              //       title: '登录成功'
106
+              //     })
107
+              //   }, 1000);
108
+              //   uni.hideLoading();
109
+              // })
110
+        })
111
+        // uni.getUserInfo({
112
+        //   provider: 'weixin',
113
+        //   success: (infoRes) => {
114
+        //     updateAccount(1, infoRes.userInfo);
115
+        //   },
116
+        //   fail: (err) => {
117
+        //     console.log(err)
118
+        //   }
119
+        // });
120
+      },
121
+      fail: (error) => {
122
+        console.log(error)
123
+      }
124
+    });
125
+  }
126
+}
38 127
 </script>
39 128
 <template>
40 129
   <div class="flex flex-col">
@@ -47,12 +136,14 @@ function getBindState(type) {
47 136
         </div>
48 137
       </div>
49 138
       <div class="border border-solid rounded-full  text-xs px-2 h-4"
139
+           @tap="getUserInfo"
50 140
            :class="getBindState('1') ? 'text-red' : 'text-gray border-gray'"
51 141
       >
52
-        {{ getBindState('1') ? '已授权' : '未授权' }}
142
+        {{ getBindState('1') ? '已授权' : '去授权' }}
53 143
       </div>
54 144
     </div>
55 145
   </div>
146
+  <!--
56 147
   <div class="flex flex-row  justify-between bg-white p-4">
57 148
     <div class="flex-1 flex text-sm items-center gap-2">
58 149
       <image :src="zfbImage" mode="widthFix" class="w-4 h-4"></image>
@@ -67,6 +158,7 @@ function getBindState(type) {
67 158
 
68 159
     </div>
69 160
   </div>
161
+  -->
70 162
 </template>
71 163
 
72 164
 <style>

+ 6 - 2
src/pages/user/address/index.vue

@@ -20,7 +20,7 @@
20 20
               <div>
21 21
                 {{ item.real_name }}
22 22
               </div>
23
-              <div>{{ item.phone }}</div>
23
+              <div>{{ encodePhone(item.phone) }}</div>
24 24
             </div>
25 25
           </div>
26 26
           <div
@@ -34,6 +34,7 @@
34 34
         </div>
35 35
 
36 36
       </div>
37
+      <CXBEmpty text="您还没有收货地址" type="address" v-else/>
37 38
 
38 39
       <div class="fixed bottom-0 p-safe w-full bg-white ">
39 40
         <div class="px-3">
@@ -49,10 +50,13 @@ import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
49 50
 import {encodeBase64} from "~/utils/http/helper";
50 51
 import type {AddressModel} from "~/apis/model/address.model";
51 52
 import {useAddressStore} from "~/stores/addressStore";
53
+import {encodePhone} from "../../../utils";
54
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
52 55
 
53 56
 
54 57
 export default {
55
-  components: {CXBBasePage},
58
+  methods: {encodePhone},
59
+  components: {CXBEmpty, CXBBasePage},
56 60
   setup() {
57 61
     const data = ref([]);
58 62
     const addressStore = useAddressStore()

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

@@ -7,6 +7,7 @@ import Routine from "~/libs/routine";
7 7
 import {totalOrderNumber} from "~/apis/order.api";
8 8
 import type {OrderQuantityModel} from "~/apis/model/order.model";
9 9
 import type {Ref} from "vue";
10
+const pageStore = usePageStoreWidthOut()
10 11
 
11 12
 const myOrderList = [{
12 13
   id: 'noPay',
@@ -112,6 +113,9 @@ const orderQuantity: Ref<OrderQuantityModel> = ref()
112 113
 const agentInfo = ref({})
113 114
 // onLoad(() => {})
114 115
 onShow(async () => {
116
+  // pageStore.setPageConfig({
117
+  //   orderBack: null
118
+  // })
115 119
   uni.showLoading({
116 120
     title: '登录中',
117 121
   })
@@ -506,5 +510,5 @@ page {
506 510
 style:
507 511
   navigationStyle: custom
508 512
   navigationBarTitleText: 储蓄保
509
-  enablePullDownRefresh: true
513
+  enablePullDownRefresh: false
510 514
 </route>

+ 47 - 2
src/pages/user/login/index.vue

@@ -4,7 +4,13 @@ import CXBBanner from "~/components/CXBBanner/CXBBanner.vue";
4 4
 import CXBPhoneLoginButton from "~/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue";
5 5
 import CXBNotLoginButton from "~/components/CXBNotLoginButton/CXBNotLoginButton.vue";
6 6
 import {useUserStore} from "~/stores/userStore";
7
-
7
+import FNavBar from "~/components/FNavBar/FNavBar.vue";
8
+// usePageStore.setPageConfig({
9
+//   currentPage: {
10
+//     type: 'tab',
11
+//     url:  '/pages/order_addcart/index'
12
+//   }
13
+// })
8 14
 const userStore = useUserStore()
9 15
 
10 16
 const state = reactive({
@@ -16,6 +22,7 @@ onLoad((option: any) => {
16 22
   state.qrcode = option.type
17 23
   state.uid = option.uid
18 24
   state.key = option.key
25
+
19 26
 })
20 27
 
21 28
 function getPhoneNumber(e) {
@@ -41,10 +48,12 @@ async function handleWexinLogin() {
41 48
       fullScreen: true
42 49
     },
43 50
     success: result => {
51
+      console.log(result)
44 52
       getUserUnionId({
45 53
         code: result.code,
46 54
         source: 'cxb'
47 55
       }).then(unionRes => {
56
+        console.log(unionRes)
48 57
         wechatCheck(unionRes.unionid).then(checkRes => {
49 58
           // console.log(checkRes)
50 59
           userStore.login(checkRes.token, checkRes.exp)
@@ -116,9 +125,44 @@ async function handleWexinLogin() {
116 125
   })
117 126
   // 换取Code
118 127
 }
128
+
129
+function onClickLeft() {
130
+  const pageStore = usePageStoreWidthOut()
131
+
132
+  if (pageStore && pageStore.currentPage) {
133
+    if (pageStore.currentPage.type === 'tab') {
134
+      uni.switchTab({
135
+        url: pageStore.currentPage.url
136
+      })
137
+    } else {
138
+      uni.navigateTo({
139
+        url: pageStore.currentPage.url
140
+      })
141
+    }
142
+  } else {
143
+    uni.navigateBack()
144
+  }
145
+  // uni.showModal({
146
+  //   content: '您确定退出评价吗?',
147
+  //   confirmColor: '#FE0032',
148
+  //   success: (res) =>  {
149
+  //     if (res.confirm) {
150
+  //       uni.navigateBack()
151
+  //     }
152
+  //   },
153
+  // })
154
+
155
+}
119 156
 </script>
120 157
 <template>
121 158
   <div>
159
+    <FNavBar
160
+        title="" :left-arrow="true" fixed placeholder z-index="999"
161
+        ex-class="bg-white w-screen"
162
+        @click-left="onClickLeft"
163
+    />
164
+
165
+
122 166
     <CXBBanner/>
123 167
 
124 168
     <div class="px-3 flex flex-col gap-3">
@@ -151,7 +195,8 @@ async function handleWexinLogin() {
151 195
 
152 196
 <route lang="yaml">
153 197
 style:
154
-enablePullDownRefresh: true
198
+  enablePullDownRefresh: false
199
+  navigationStyle: custom
155 200
 </route>
156 201
 <style>
157 202
 button {

+ 8 - 3
src/pages/user/login/other-phone.vue

@@ -1,11 +1,10 @@
1 1
 <template>
2
-  <CXBBasePage>
2
+  <div>
3 3
     <CXBBanner/>
4 4
 
5 5
     <nut-input
6 6
         v-model="state.phone"
7 7
         placeholder="请输入手机号"
8
-        clearable
9 8
     >
10 9
       <template #right>
11 10
         <nut-button type='primary' size="small" @click="handleGetCode" :loading="state.isAuthVerify">
@@ -34,7 +33,7 @@
34 33
 
35 34
     </div>
36 35
 
37
-  </CXBBasePage>
36
+  </div>
38 37
 </template>
39 38
 <script setup lang="ts">
40 39
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
@@ -139,3 +138,9 @@ function handleLogin() {
139 138
 style:
140 139
   navigationBarTitleText: 手机登录
141 140
 </route>
141
+
142
+<style>
143
+page {
144
+  background: #f8f8f8;
145
+}
146
+</style>

+ 2 - 0
src/pages/withdrawal-record/index.vue

@@ -52,4 +52,6 @@ page {
52 52
 <route lang="yaml">
53 53
 style:
54 54
   navigationBarTitleText: 提现记录
55
+  enablePullDownRefresh: false
56
+
55 57
 </route>

BIN
src/static/icon/message-dark.png


BIN
src/static/icon/message.png


BIN
src/static/icon/playing.gif


BIN
src/static/mine_following_mark.png


+ 5 - 1
src/stores/dacangStore.ts

@@ -2,11 +2,15 @@ import {defineStore} from "pinia";
2 2
 
3 3
 export const useDacangStore = defineStore('dacangStore', {
4 4
     state: () => ({
5
-        currentClassify: ''
5
+        currentClassify: '-1'
6 6
     }),
7 7
     actions: {
8 8
         setClassify(classify: string) {
9
+            console.log('class' + classify)
9 10
             this.currentClassify = classify
11
+        },
12
+        loadList() {
13
+
10 14
         }
11 15
     }
12 16
 })

+ 14 - 0
src/stores/page.ts

@@ -6,6 +6,14 @@ interface PageConfig {
6 6
     showBackAction?: boolean
7 7
     showCustomAction?: boolean
8 8
     pageTitle?: string
9
+    currentPage?: {
10
+        type: string,
11
+        url: string
12
+    },
13
+    orderBack?: {
14
+        type: string,
15
+        url: string
16
+    }
9 17
 }
10 18
 
11 19
 export const usePageStore = defineStore('page', () => {
@@ -13,6 +21,8 @@ export const usePageStore = defineStore('page', () => {
13 21
     const showBackAction = ref(false)
14 22
     const showCustomAction = ref(false)
15 23
     const pageTitle = ref('')
24
+    const currentPage = ref<any>()
25
+    const orderBack = ref<any>()
16 26
     // const notifyRef = ref<{ showNotify: (options: NotifyOptions) => {} }>()
17 27
 
18 28
     const setPageConfig = (config: PageConfig = {}) => {
@@ -20,6 +30,8 @@ export const usePageStore = defineStore('page', () => {
20 30
         showBackAction.value = config.showBackAction ?? false
21 31
         showCustomAction.value = config.showCustomAction ?? false
22 32
         pageTitle.value = config.pageTitle ?? ''
33
+        currentPage.value = config.currentPage ?? null
34
+        orderBack.value = config.orderBack?? null
23 35
     }
24 36
 
25 37
     // const showNotify = (options: NotifyOptions) =>
@@ -39,6 +51,8 @@ export const usePageStore = defineStore('page', () => {
39 51
         pageTitle,
40 52
         showBackAction,
41 53
         showCustomAction,
54
+        currentPage,
55
+        orderBack,
42 56
         // notifyRef,
43 57
         // showNotify,
44 58
         pageReset,

+ 1 - 1
src/utils/product-page.ts

@@ -43,7 +43,7 @@ const tabList = <Array<TabItem>>[{
43 43
     selectedIconPath: CDN_URL + '/static/assets/pinduoduo_d.png',
44 44
 }, {
45 45
     id: PLATFORM_NAME.DC,
46
-    text: '城中大仓',
46
+    text: '大仓',
47 47
     iconPath: CDN_URL + '/static/assets/dacang_x_220914.png',
48 48
     selectedIconPath: CDN_URL + '/static/assets/dacang_d_220914.png',
49 49
 }, {

+ 1 - 1
theme.ts

@@ -19,7 +19,7 @@ export const theme: Theme = {
19 19
     fGray7: '#646566',
20 20
     fGray8: '#323233',
21 21
 
22
-    lightBg: '#F3F4F6',
22
+    lightBg: '#f8f8f8',
23 23
     darkBg: '#373739',
24 24
     placeholder: '#DCDCDC',
25 25
     grayBg: '#484849',