李战雷 2 years ago
parent
commit
80dbc77930

+ 1 - 1
src/apis/common.ts

@@ -111,7 +111,7 @@ export function getLocal() {
111
     uni.getLocation({
111
     uni.getLocation({
112
         type: 'wgs84',
112
         type: 'wgs84',
113
         success(res) {
113
         success(res) {
114
-            // console.log(res)
114
+            console.log('location', res)
115
             uni.setStorageSync(USER_LATITUDE, res.latitude)
115
             uni.setStorageSync(USER_LATITUDE, res.latitude)
116
             uni.setStorageSync(USER_LONGITUDE, res.longitude)
116
             uni.setStorageSync(USER_LONGITUDE, res.longitude)
117
             // getRegeo(res.latitude, res.longitude);
117
             // getRegeo(res.latitude, res.longitude);

+ 14 - 0
src/apis/product.ts

@@ -312,6 +312,7 @@ export function getPddProductDetail(goodsId: string): Promise<PDDProductDetailMo
312
         }
312
         }
313
     })
313
     })
314
 }
314
 }
315
+
315
 /**
316
 /**
316
  * 拼多多商品搜索
317
  * 拼多多商品搜索
317
  * @param params
318
  * @param params
@@ -384,4 +385,17 @@ export function getDyProductDetail(goodsId: string): Promise<DyProductDetailsMod
384
             goodsId
385
             goodsId
385
         }
386
         }
386
     })
387
     })
388
+}
389
+
390
+/**
391
+ * 抖音商品详情 - 未登录
392
+ * @param goodsId
393
+ */
394
+export function getDyProductDetailUnlogin(goodsId: string): Promise<DyProductDetailsModel> {
395
+    return detailHttp.get({
396
+        url: API.DY_DETAIL,
397
+        data: {
398
+            goodsId
399
+        }
400
+    })
387
 }
401
 }

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

@@ -4,13 +4,14 @@ const userStore = useUserStore()
4
 
4
 
5
 function handleGuestMemberNew() {
5
 function handleGuestMemberNew() {
6
   // console.log(userStore.userInfo)
6
   // console.log(userStore.userInfo)
7
+  
7
   if (userStore.uid) {
8
   if (userStore.uid) {
8
     uni.navigateTo({
9
     uni.navigateTo({
9
       url: `/pages/guest_member_new/index?is_merchant=${userStore.userInfo.is_merchant}`
10
       url: `/pages/guest_member_new/index?is_merchant=${userStore.userInfo.is_merchant}`
10
     })
11
     })
11
   } else {
12
   } else {
12
     uni.navigateTo({
13
     uni.navigateTo({
13
-      url: '/pages/user/login/index'
14
+      url: '/pages/guest_member_new/index'
14
     })
15
     })
15
   }
16
   }
16
 }
17
 }

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

@@ -7,7 +7,7 @@ import Announcement from "~/pages/home/components/announcement.vue";
7
 import Banner from "~/pages/home/components/banner.vue";
7
 import Banner from "~/pages/home/components/banner.vue";
8
 import Header from "~/pages/home/components/header.vue";
8
 import Header from "~/pages/home/components/header.vue";
9
 import ProductList from "~/pages/home/components/product-list.vue";
9
 import ProductList from "~/pages/home/components/product-list.vue";
10
-import { getHomeBanner, getHomeQuickLink, getNoticeList, getProductShare } from "~/apis/common";
10
+import { getHomeBanner, getHomeQuickLink, getNoticeList, getProductShare, getLocal} from "~/apis/common";
11
 import { useUserStore } from "~/stores/userStore";
11
 import { useUserStore } from "~/stores/userStore";
12
 import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
12
 import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
13
 import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
13
 import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
@@ -131,6 +131,7 @@ onLoad((option) => {
131
   if (option && option.shareId) {
131
   if (option && option.shareId) {
132
     userStore.setShareId(option.shareId)
132
     userStore.setShareId(option.shareId)
133
   }
133
   }
134
+  // getLocal()
134
   getIsShow()
135
   getIsShow()
135
   getHomeBanner().then(res => {
136
   getHomeBanner().then(res => {
136
     // console.log(res)
137
     // console.log(res)

+ 47 - 46
src/pages/order/components/ObligationOrderList.vue

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

+ 42 - 41
src/pages/order/components/Order4List.vue

@@ -1,75 +1,77 @@
1
 <script setup lang="ts">
1
 <script setup lang="ts">
2
-import { getOrderListFromStatus } from "~/apis/order.api";
3
-import OrderItem from "~/pages/order/components/OrderItem.vue";
4
-import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
2
+import { getOrderListFromStatus } from '~/apis/order.api'
3
+import OrderItem from '~/pages/order/components/OrderItem.vue'
4
+import CXBEmpty from '~/components/CXBEmpty/CXBEmpty.vue'
5
 
5
 
6
 const props = defineProps({
6
 const props = defineProps({
7
   status: {
7
   status: {
8
     type: String,
8
     type: String,
9
-  }
9
+  },
10
 })
10
 })
11
 const state = reactive({
11
 const state = reactive({
12
   currentPage: 1,
12
   currentPage: 1,
13
   pageSize: 10,
13
   pageSize: 10,
14
   totalPage: 1,
14
   totalPage: 1,
15
-  status: "",
16
-  list: []
15
+  status: '',
16
+  list: [],
17
 })
17
 })
18
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
18
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
19
   // console.log(state.keyword)
19
   // console.log(state.keyword)
20
-  if (action === 'reload') {
20
+  if (action === 'reload')
21
     state.currentPage = 1
21
     state.currentPage = 1
22
-  }
22
+
23
   const params = {
23
   const params = {
24
     page: state.currentPage,
24
     page: state.currentPage,
25
-    limit: state.pageSize
25
+    limit: state.pageSize,
26
   }
26
   }
27
-  if (state.keyword) {
27
+  if (state.keyword)
28
     params.keyword = state.keyword
28
     params.keyword = state.keyword
29
-  }
30
 
29
 
31
   getOrderListFromStatus({
30
   getOrderListFromStatus({
32
     page: state.currentPage,
31
     page: state.currentPage,
33
     limit: state.pageSize,
32
     limit: state.pageSize,
34
     status: props.status,
33
     status: props.status,
35
-  }).then(res => {
34
+  }).then((res) => {
36
     console.log(res)
35
     console.log(res)
37
     if (res.list.length <= 0) {
36
     if (res.list.length <= 0) {
38
       uni.$emit('changeShowLike')
37
       uni.$emit('changeShowLike')
39
-      console.log('没有数据');
38
+      console.log('没有数据')
39
+	  state.list = res.list
40
+	  if (callback)
41
+	    callback(res.list)
42
+
40
       return
43
       return
41
     }
44
     }
42
-    if(res.count< state.pageSize){
45
+    if (res.count < state.pageSize)
43
       uni.$emit('changeShowLike')
46
       uni.$emit('changeShowLike')
44
-    }
45
-    if (action === 'page') {
47
+
48
+    if (action === 'page')
46
       state.list = state.list.concat(res.list)
49
       state.list = state.list.concat(res.list)
47
-    }
48
-    if (action == 'reload') {
50
+
51
+    if (action == 'reload')
49
       state.list = res.list
52
       state.list = res.list
50
-    }
51
-    state.totalPage = Math.ceil(res.count / state.pageSize);
53
+
54
+    state.totalPage = Math.ceil(res.count / state.pageSize)
52
 
55
 
53
     state.status = 'more'
56
     state.status = 'more'
54
-    if (callback) {
57
+    if (callback)
55
       callback(res.list)
58
       callback(res.list)
56
-    }
57
   })
59
   })
58
 }
60
 }
59
 watch(() => state.status, (newStatus, oldStatus) => {
61
 watch(() => state.status, (newStatus, oldStatus) => {
60
-  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus);
62
+  console.log('状态变化。新状态:', newStatus, '旧状态:', oldStatus)
61
 
63
 
62
-  if (newStatus === 'noMore') {
63
-    uni.$emit('changeShowLike');
64
-  }
65
-});
64
+  if (newStatus === 'noMore')
65
+    uni.$emit('changeShowLike')
66
+})
66
 function handleScrollToLower() {
67
 function handleScrollToLower() {
67
-  state.status = 'loading';
68
-  state.currentPage += 1;
68
+  state.status = 'loading'
69
+  state.currentPage += 1
69
 
70
 
70
   if (state.currentPage > state.totalPage) {
71
   if (state.currentPage > state.totalPage) {
71
-    state.status = 'noMore';
72
-  } else {
72
+    state.status = 'noMore'
73
+  }
74
+  else {
73
     setTimeout(() => {
75
     setTimeout(() => {
74
       loadList('page')
76
       loadList('page')
75
     }, 300)
77
     }, 300)
@@ -103,7 +105,7 @@ onMounted(() => {
103
   })
105
   })
104
   uni.$on('onTab4ReachBottom', handleScrollToLower)
106
   uni.$on('onTab4ReachBottom', handleScrollToLower)
105
   uni.$on('onTab4PullDownRefresh', () => {
107
   uni.$on('onTab4PullDownRefresh', () => {
106
-    loadList('reload', items => {
108
+    loadList('reload', (items) => {
107
       setTimeout(() => {
109
       setTimeout(() => {
108
         uni.stopPullDownRefresh()
110
         uni.stopPullDownRefresh()
109
       }, 300)
111
       }, 300)
@@ -111,23 +113,23 @@ onMounted(() => {
111
   })
113
   })
112
 })
114
 })
113
 onUnmounted(() => {
115
 onUnmounted(() => {
114
-
115
-  uni.$off('onTab4ReachBottom');
116
-  uni.$off('onTab4PullDownRefresh');
116
+  uni.$off('onTab4ReachBottom')
117
+  uni.$off('onTab4PullDownRefresh')
117
 })
118
 })
118
 onUnload(() => {
119
 onUnload(() => {
119
-  uni.$off('onTab4ReachBottom');
120
-  uni.$off('onTab4PullDownRefresh');
120
+  uni.$off('onTab4ReachBottom')
121
+  uni.$off('onTab4PullDownRefresh')
121
 })
122
 })
122
 </script>
123
 </script>
124
+
123
 <template>
125
 <template>
124
   <div class="p-3 flex flex-col">
126
   <div class="p-3 flex flex-col">
125
     <div v-if="state.list.length > 0" class="flex flex-col gap-3">
127
     <div v-if="state.list.length > 0" class="flex flex-col gap-3">
126
       <div v-for="(orderItem, index) in state.list" :key="index">
128
       <div v-for="(orderItem, index) in state.list" :key="index">
127
         <OrderItem :order-item="orderItem" />
129
         <OrderItem :order-item="orderItem" />
128
-        <!--        <OtherOrderItem :item="orderItem" v-else/>-->
130
+        <!--        <OtherOrderItem :item="orderItem" v-else/> -->
129
       </div>
131
       </div>
130
-      <div class=" flex justify-center items-center text-[12px] text-gray-500" v-if="state.list && state.list.length > 0">
132
+      <div v-if="state.list && state.list.length > 0" class=" flex justify-center items-center text-[12px] text-gray-500">
131
         <div v-if="state.status === 'loading'">
133
         <div v-if="state.status === 'loading'">
132
           加载中...
134
           加载中...
133
         </div>
135
         </div>
@@ -138,7 +140,6 @@ onUnload(() => {
138
     </div>
140
     </div>
139
     <div v-else class="flex flex-col  justify-center items-center w-full">
141
     <div v-else class="flex flex-col  justify-center items-center w-full">
140
       <CXBEmpty />
142
       <CXBEmpty />
141
-
142
     </div>
143
     </div>
143
   </div>
144
   </div>
144
-</template>
145
+</template>

+ 3 - 0
src/pages/order_addcart/index.vue

@@ -169,10 +169,13 @@ onShow(() => {
169
       url: '/pages/user/login/index'
169
       url: '/pages/user/login/index'
170
     })
170
     })
171
   }
171
   }
172
+  
173
+  // 是否是管理 不是则 设置成是
172
   if (!state.isManage) {
174
   if (!state.isManage) {
173
     state.isManage = true
175
     state.isManage = true
174
   }
176
   }
175
 
177
 
178
+	// 是否是同一个人的id 不是就重新请求数据
176
   if (u_id.value != userStore.uid) {
179
   if (u_id.value != userStore.uid) {
177
     u_id.value = userStore.uid
180
     u_id.value = userStore.uid
178
     loadCartList()
181
     loadCartList()

+ 76 - 70
src/pages/payment/index.vue

@@ -1,45 +1,8 @@
1
-<template>
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">
8
-    <div class=" flex flex-col gap-3 p-3">
9
-      <div class="flex flex-col justify-center items-center bg-white rounded p-4">
10
-        <div class="text-xs text-gray-500">支付金额</div>
11
-        <FPrice :price="state.payPrice" ex-class="!text-xl font-bold"></FPrice>
12
-      </div>
13
-      <div class="bg-white rounded-lg text-sm p-3 flex flex-col">
14
-        <div class="flex f-hairline-bottom text-sm pb-2">
15
-          支付方式
16
-        </div>
17
-        <div>
18
-          <div class="flex items-center justify-between py-3">
19
-            <div class="flex items-center gap-2">
20
-              <image :src="wxLogoImage" mode="widthFix" class="w-8 h-8"></image>
21
-              <div>微信支付</div>
22
-            </div>
23
-          </div>
24
-        </div>
25
-      </div>
26
-    </div>
27
-
28
-
29
-    <div class="fixed bottom-0 pb-safe  w-full">
30
-      <div class="p-4">
31
-        <nut-button block type="primary" @click="handleConfirm">立即支付</nut-button>
32
-      </div>
33
-
34
-    </div>
35
-  </div>
36
-</template>
37
 <script setup lang="ts">
1
 <script setup lang="ts">
38
-import FPrice from "~/components/FPrice/FPrice.vue";
39
-import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
40
-import {CDN_URL} from "~/config/app";
41
-import {checkGroupOrder} from "~/apis/order.api";
42
-import FNavBar from "~/components/FNavBar/FNavBar.vue";
2
+import FPrice from '~/components/FPrice/FPrice.vue'
3
+import { CDN_URL } from '~/config/app'
4
+import { checkGroupOrder } from '~/apis/order.api'
5
+import FNavBar from '~/components/FNavBar/FNavBar.vue'
43
 
6
 
44
 // usePageStore.setPageConfig({
7
 // usePageStore.setPageConfig({
45
 //   orderBack: {
8
 //   orderBack: {
@@ -50,7 +13,7 @@ import FNavBar from "~/components/FNavBar/FNavBar.vue";
50
 
13
 
51
 const pageStore = usePageStoreWidthOut()
14
 const pageStore = usePageStoreWidthOut()
52
 
15
 
53
-const wxLogoImage = CDN_URL + '/static/assets/wx_logo.png'
16
+const wxLogoImage = `${CDN_URL}/static/assets/wx_logo.png`
54
 const state = reactive({
17
 const state = reactive({
55
   orderList: [],
18
   orderList: [],
56
   payPrice: '',
19
   payPrice: '',
@@ -58,27 +21,27 @@ const state = reactive({
58
   code: '',
21
   code: '',
59
   memberType: 0,
22
   memberType: 0,
60
 
23
 
61
-  tabIndex: NaN,
24
+  tabIndex: Number.NaN,
62
 })
25
 })
63
 onLoad((options) => {
26
 onLoad((options) => {
64
-	// console.log('我是options',options)
27
+  // console.log('我是options',options)
65
   if (options) {
28
   if (options) {
66
     state.orderList = options.OrderList
29
     state.orderList = options.OrderList
67
     state.payPrice = options.pay_price
30
     state.payPrice = options.pay_price
68
     state.orderId = options.order_id
31
     state.orderId = options.order_id
69
 
32
 
33
+    console.log('options')
70
     console.log(options)
34
     console.log(options)
71
-    if (options.tabIndex) {
35
+    if (options.tabIndex)
72
       state.tabIndex = options.tabIndex
36
       state.tabIndex = options.tabIndex
73
-    }
74
 
37
 
75
     uni.login({
38
     uni.login({
76
       success: (res) => {
39
       success: (res) => {
77
         state.code = res.code
40
         state.code = res.code
78
-      }
41
+      },
79
     })
42
     })
80
 
43
 
81
-    checkGroupOrder(state.orderId).then(res => {
44
+    checkGroupOrder(state.orderId).then((res) => {
82
       state.memberType = res.message
45
       state.memberType = res.message
83
     })
46
     })
84
   }
47
   }
@@ -88,7 +51,7 @@ function handleConfirm() {
88
   uni.showToast({
51
   uni.showToast({
89
     title: '支付中',
52
     title: '支付中',
90
     icon: 'loading',
53
     icon: 'loading',
91
-    duration: 3000
54
+    duration: 3000,
92
   })
55
   })
93
   uni.navigateToMiniProgram({
56
   uni.navigateToMiniProgram({
94
     // appid  写你要跳转的小程序的 appid
57
     // appid  写你要跳转的小程序的 appid
@@ -100,24 +63,23 @@ function handleConfirm() {
100
     extraData: {
63
     extraData: {
101
       oid: state.orderId,
64
       oid: state.orderId,
102
       OrderLists: state.orderList,
65
       OrderLists: state.orderList,
103
-      type: 'tdbaspzf'
66
+      type: 'tdbaspzf',
104
     },
67
     },
105
-    // envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
106
-    envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
68
+    envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
69
+    // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
107
     success(res) {
70
     success(res) {
108
       // 打开成功
71
       // 打开成功
109
       uni.showToast({
72
       uni.showToast({
110
-        title: '跳转成功'
73
+        title: '跳转成功',
111
       })
74
       })
112
     },
75
     },
113
     fail(err) {
76
     fail(err) {
114
       // 打开失败/取消
77
       // 打开失败/取消
115
       uni.showToast({
78
       uni.showToast({
116
-        title: '跳转不成功'
79
+        title: '跳转不成功',
117
       })
80
       })
118
-    }
81
+    },
119
   })
82
   })
120
-
121
 }
83
 }
122
 
84
 
123
 function onClickLeft() {
85
 function onClickLeft() {
@@ -131,7 +93,6 @@ function onClickLeft() {
131
       if (res.confirm) {
93
       if (res.confirm) {
132
         handleConfirm()
94
         handleConfirm()
133
         uni.$emit('cart-reload')
95
         uni.$emit('cart-reload')
134
-
135
       }
96
       }
136
       if (res.cancel) {
97
       if (res.cancel) {
137
         // uni.navigateBack()
98
         // uni.navigateBack()
@@ -140,42 +101,87 @@ function onClickLeft() {
140
         // if (usePageStore.orderBack) {
101
         // if (usePageStore.orderBack) {
141
         //   url += `&from=${usePageStore.orderBack}`
102
         //   url += `&from=${usePageStore.orderBack}`
142
         // }
103
         // }
143
-        console.log(state.tabIndex);
144
-        
104
+        console.log(state.tabIndex)
105
+
145
         if (state.tabIndex) {
106
         if (state.tabIndex) {
146
           pageStore.setPageConfig({
107
           pageStore.setPageConfig({
147
             orderBack: {
108
             orderBack: {
148
               url: '/pages/user/index',
109
               url: '/pages/user/index',
149
-              type: 'tab'
150
-            }
110
+              type: 'tab',
111
+            },
151
           })
112
           })
152
         }
113
         }
153
         // setTimeout(() => {
114
         // setTimeout(() => {
154
         if (state.tabIndex == 0) {
115
         if (state.tabIndex == 0) {
155
           uni.navigateTo({
116
           uni.navigateTo({
156
-            url: '/pages/order/index'
117
+            url: '/pages/order/index',
157
           })
118
           })
158
         }
119
         }
159
         if (state.tabIndex > 0) {
120
         if (state.tabIndex > 0) {
160
-
161
-          uni.navigateTo({
162
-            url: `/pages/order/index?tabIndex=${state.tabIndex}&from=payment`,
163
-          })
164
-        } else {
121
+          if (state.tabIndex == 1) {
122
+            uni.navigateBack({
123
+              delta: 1,
124
+            })
125
+          }
126
+          else {
127
+            uni.navigateTo({
128
+				  url: `/pages/order/index?tabIndex=${state.tabIndex}&from=payment`,
129
+            })
130
+          }
131
+        }
132
+        else {
165
           uni.navigateTo({
133
           uni.navigateTo({
166
-            url: `/pages/order/index?tabIndex=1&from=payment`,
134
+            url: '/pages/order/index?tabIndex=1&from=payment',
167
           })
135
           })
168
         }
136
         }
169
         // const tabIndex =
137
         // const tabIndex =
170
 
138
 
171
         // }, 300)
139
         // }, 300)
172
-
173
       }
140
       }
174
     },
141
     },
175
   })
142
   })
176
 }
143
 }
177
 </script>
144
 </script>
178
 
145
 
146
+<template>
147
+  <FNavBar
148
+    title="支付方式" :left-arrow="true" fixed placeholder z-index="999"
149
+    ex-class="bg-white w-screen"
150
+    @click-left="onClickLeft"
151
+  />
152
+  <div class="w-full mt-20">
153
+    <div class=" flex flex-col gap-3 p-3">
154
+      <div class="flex flex-col justify-center items-center bg-white rounded p-4">
155
+        <div class="text-xs text-gray-500">
156
+          支付金额
157
+        </div>
158
+        <FPrice :price="state.payPrice" ex-class="!text-xl font-bold" />
159
+      </div>
160
+      <div class="bg-white rounded-lg text-sm p-3 flex flex-col">
161
+        <div class="flex f-hairline-bottom text-sm pb-2">
162
+          支付方式
163
+        </div>
164
+        <div>
165
+          <div class="flex items-center justify-between py-3">
166
+            <div class="flex items-center gap-2">
167
+              <image :src="wxLogoImage" mode="widthFix" class="w-8 h-8" />
168
+              <div>微信支付</div>
169
+            </div>
170
+          </div>
171
+        </div>
172
+      </div>
173
+    </div>
174
+
175
+    <div class="fixed bottom-0 pb-safe  w-full">
176
+      <div class="p-4">
177
+        <nut-button block type="primary" @click="handleConfirm">
178
+          立即支付
179
+        </nut-button>
180
+      </div>
181
+    </div>
182
+  </div>
183
+</template>
184
+
179
 <route lang="yaml">
185
 <route lang="yaml">
180
 style:
186
 style:
181
   navigationStyle: custom
187
   navigationStyle: custom
@@ -186,4 +192,4 @@ style:
186
 page {
192
 page {
187
   background: #f8f8f8;
193
   background: #f8f8f8;
188
 }
194
 }
189
-</style>
195
+</style>

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

@@ -56,11 +56,11 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
56
       title: error,
56
       title: error,
57
       icon: 'none'
57
       icon: 'none'
58
     })
58
     })
59
-    if (error == '请登录') {
60
-      uni.navigateTo({
61
-        url: '/pages/user/login/index'
62
-      })
63
-    }
59
+    // if (error == '请登录') {
60
+    //   uni.navigateTo({
61
+    //     url: '/pages/user/login/index'
62
+    //   })
63
+    // }
64
   })
64
   })
65
 }
65
 }
66
 function handleScrollToLower() {
66
 function handleScrollToLower() {

+ 153 - 121
src/pages/store/nearby/index.vue

@@ -1,16 +1,15 @@
1
 <script lang="ts" setup>
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
-import { getProductShare, getLocal } from "~/apis/common";
8
-import { useUserStore } from "~/stores/userStore";
9
-import Cache from "~/utils/cache";
2
+import { getSelectMerchant, getSelectMerchantSort } from '~/apis/merchant'
3
+import type { StoreParams, StoreResult } from '~/apis/model/storeModel'
4
+import CXBEmpty from '~/components/CXBEmpty/CXBEmpty.vue'
5
+import { USER_LATITUDE, USER_LONGITUDE } from '~/constants'
6
+import { getLocal, getProductShare } from '~/apis/common'
7
+import { useUserStore } from '~/stores/userStore'
8
+import Cache from '~/utils/cache'
9
+
10
 const usePageStore = usePageStoreWidthOut()
10
 const usePageStore = usePageStoreWidthOut()
11
 const userStore = useUserStore()
11
 const userStore = useUserStore()
12
 
12
 
13
-
14
 const state = reactive({
13
 const state = reactive({
15
   // 列表高度
14
   // 列表高度
16
   scrollHeight: 0,
15
   scrollHeight: 0,
@@ -43,39 +42,40 @@ const state = reactive({
43
     value: 1,
42
     value: 1,
44
   }, {
43
   }, {
45
     text: '距离优先',
44
     text: '距离优先',
46
-    value: 2
45
+    value: 2,
47
   }],
46
   }],
48
-  menuDefaultValue: 1
49
-  // merchantPageInfo: {}
47
+  menuDefaultValue: 1,
48
+  loadType: 'page',
50
 })
49
 })
51
-//返回顶部标识
52
-let flag = ref(false)
50
+// 返回顶部标识
51
+const flag = ref(false)
53
 
52
 
54
 const searchValue = ref('')
53
 const searchValue = ref('')
55
 
54
 
56
 const { windowHeight } = uni.getSystemInfoSync()
55
 const { windowHeight } = uni.getSystemInfoSync()
57
 state.scrollHeight = windowHeight - 45
56
 state.scrollHeight = windowHeight - 45
58
 
57
 
59
-onLoad((option) => {
60
-	
61
-	getLocal()
62
-	
63
-  if (option && option.shareId) {
58
+onLoad(async (option) => {
59
+  console.log('11', uni.getSystemInfoSync())
60
+  console.log('12', state.scrollHeight)
61
+
62
+  await getLocal()
63
+  if (option && option.shareId)
64
     userStore.setShareId(option.shareId)
64
     userStore.setShareId(option.shareId)
65
-  }
65
+
66
   // getMerchantCategory()
66
   // getMerchantCategory()
67
-  getSelectMerchantSort().then(res => {
67
+  getSelectMerchantSort().then((res) => {
68
     state.merchantCategory = res.merchantCategory
68
     state.merchantCategory = res.merchantCategory
69
+    // state.merchantCategory = state.merchantCategory.concat(res.merchantCategory)
69
   })
70
   })
70
   loadAll()
71
   loadAll()
71
-  getProductShare().then(res => {
72
-    if (res) {
72
+  getProductShare().then((res) => {
73
+    if (res)
73
       userStore.setShareId(res.share_id)
74
       userStore.setShareId(res.share_id)
74
-    }
75
-  }).catch(message => {
75
+  }).catch((message) => {
76
     // console.log(message)
76
     // console.log(message)
77
   })
77
   })
78
-  userStore.setRedirectPage(`/pages/store/nearby/index`, 'tab')
78
+  userStore.setRedirectPage('/pages/store/nearby/index', 'tab')
79
 
79
 
80
   // loadSelectMerchant('reload')
80
   // loadSelectMerchant('reload')
81
 })
81
 })
@@ -84,9 +84,9 @@ onShareAppMessage(() => {
84
 
84
 
85
   // const shareId = userStore.shareId
85
   // const shareId = userStore.shareId
86
   return {
86
   return {
87
-    title: `消费储蓄 保障未来`,
87
+    title: '消费储蓄 保障未来',
88
     path: `/pages/store/nearby/index?shareId=${shareId}`,
88
     path: `/pages/store/nearby/index?shareId=${shareId}`,
89
-    imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-09/20231009202402136.png'
89
+    imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-09/20231009202402136.png',
90
   }
90
   }
91
 })
91
 })
92
 
92
 
@@ -94,9 +94,9 @@ onShareTimeline(() => {
94
   const shareId = Cache.get('SHARE_ID')
94
   const shareId = Cache.get('SHARE_ID')
95
 
95
 
96
   return {
96
   return {
97
-    title: `消费储蓄 保障未来`,
97
+    title: '消费储蓄 保障未来',
98
     imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-11/20231011062523504.png',
98
     imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-11/20231011062523504.png',
99
-    query: `from=share&shareId=${shareId}`
99
+    query: `from=share&shareId=${shareId}`,
100
 
100
 
101
     // imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-09/20231009202402136.png'
101
     // imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-09/20231009202402136.png'
102
   }
102
   }
@@ -105,12 +105,15 @@ onShow(() => {
105
   usePageStore.setPageConfig({
105
   usePageStore.setPageConfig({
106
     currentPage: {
106
     currentPage: {
107
       type: 'tab',
107
       type: 'tab',
108
-      url: '/pages/store/nearby/index'
109
-    }
108
+      url: '/pages/store/nearby/index',
109
+    },
110
   })
110
   })
111
   // console.log('onshow...')
111
   // console.log('onshow...')
112
-  loadSelectMerchant('reload')
113
 
112
 
113
+  if (state.loadType) {
114
+	  loadSelectMerchant(state.loadType)
115
+  }
116
+	
114
 })
117
 })
115
 
118
 
116
 function loadAll() {
119
 function loadAll() {
@@ -121,16 +124,18 @@ function loadAll() {
121
 function handleCategoryChange(category) {
124
 function handleCategoryChange(category) {
122
   // console.log(category)
125
   // console.log(category)
123
   state.currentMerchantCategoryId = category.merchant_category_id
126
   state.currentMerchantCategoryId = category.merchant_category_id
124
-  // console.log(category)
125
-  // loadSelectMerchant()
127
+
126
   state.category_id = category.merchant_category_id
128
   state.category_id = category.merchant_category_id
129
+  state.currentPage = 1
127
   loadSelectMerchant('reload')
130
   loadSelectMerchant('reload')
128
 }
131
 }
129
 
132
 
130
 function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => void) {
133
 function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => void) {
131
-  if (state.category_id == 0) {
134
+  state.loadType = action
135
+
136
+  if (state.category_id == 0)
132
     state.currentMerchantCategoryId = state.category_id
137
     state.currentMerchantCategoryId = state.category_id
133
-  }
138
+
134
   let params: StoreParams = {
139
   let params: StoreParams = {
135
     pageNum: state.currentPage,
140
     pageNum: state.currentPage,
136
     pageSize: state.pageSize,
141
     pageSize: state.pageSize,
@@ -140,20 +145,44 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
140
     // lng: '',
145
     // lng: '',
141
 
146
 
142
   }
147
   }
148
+
149
+  if (userStore.userInfo) {
150
+	  params = Object.assign({}, params, {
151
+	    uid: userStore.userInfo.uid,
152
+	  })
153
+  }
154
+
143
   if (state.category_id !== 0) {
155
   if (state.category_id !== 0) {
144
     // params.category_id = category_id
156
     // params.category_id = category_id
145
     params = Object.assign({}, params, {
157
     params = Object.assign({}, params, {
146
-      category_id: state.category_id
158
+      category_id: state.category_id,
147
     })
159
     })
148
   }
160
   }
149
-  
161
+
150
   if (uni.getStorageSync(USER_LATITUDE)) {
162
   if (uni.getStorageSync(USER_LATITUDE)) {
163
+	  if (state.menuDefaultValue === 2) {
164
+	    params = Object.assign({}, params, {
165
+	      distanceAsc: 0,
166
+	      lat: uni.getStorageSync(USER_LATITUDE),
167
+	      lng: uni.getStorageSync(USER_LONGITUDE),
168
+	    })
169
+	  }
170
+    else {
171
+		  params = Object.assign({}, params, {
172
+		    // distanceAsc: null,
173
+		    lat: uni.getStorageSync(USER_LATITUDE),
174
+		    lng: uni.getStorageSync(USER_LONGITUDE),
175
+		  })
176
+	  }
177
+  }
178
+  else {
151
 	  params = Object.assign({}, params, {
179
 	  params = Object.assign({}, params, {
152
-	    distanceAsc: 0,
153
-	    lat: uni.getStorageSync(USER_LATITUDE),
154
-	    lng: uni.getStorageSync(USER_LONGITUDE)
180
+	    // distanceAsc: 0,
181
+	    // lat: null,
182
+	    // lng: null
155
 	  })
183
 	  })
156
   }
184
   }
185
+
157
   // if (state.menuDefaultValue === 2) {
186
   // if (state.menuDefaultValue === 2) {
158
   //   params = Object.assign({}, params, {
187
   //   params = Object.assign({}, params, {
159
   //     distanceAsc: 0,
188
   //     distanceAsc: 0,
@@ -161,20 +190,20 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
161
   //     lng: uni.getStorageSync(USER_LONGITUDE)
190
   //     lng: uni.getStorageSync(USER_LONGITUDE)
162
   //   })
191
   //   })
163
   // }
192
   // }
164
-
193
+  console.log('********')
165
   getSelectMerchant(params).then((res: StoreResult) => {
194
   getSelectMerchant(params).then((res: StoreResult) => {
166
     // console.log(state.triggered)
195
     // console.log(state.triggered)
167
 
196
 
168
     state.total = res.total
197
     state.total = res.total
169
-    state.totalPage = Math.ceil(state.total / state.pageSize);
198
+    state.totalPage = Math.ceil(state.total / state.pageSize)
170
     // console.log(state.totalPage)
199
     // console.log(state.totalPage)
171
     // state.merchantList = res.list
200
     // state.merchantList = res.list
172
-    if (action === 'page') {
201
+    if (action === 'page')
173
       state.merchantList = state.merchantList.concat(res.list)
202
       state.merchantList = state.merchantList.concat(res.list)
174
-    }
175
-    if (action === 'reload') {
203
+
204
+    if (action === 'reload')
176
       state.merchantList = res.list
205
       state.merchantList = res.list
177
-    }
206
+
178
     // state.totalPage = Math.ceil(totalItems / state.pageSize);
207
     // state.totalPage = Math.ceil(totalItems / state.pageSize);
179
     setTimeout(() => {
208
     setTimeout(() => {
180
       state.triggered = false
209
       state.triggered = false
@@ -182,20 +211,20 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
182
 
211
 
183
     state.status = 'more'
212
     state.status = 'more'
184
 
213
 
185
-    if (callback) {
214
+    if (callback)
186
       callback(res.list)
215
       callback(res.list)
187
-    }
216
+
217
+    console.log('数量', state.merchantList.length)
188
   })
218
   })
189
 }
219
 }
190
 
220
 
191
 function handleShowMerchant(merchant) {
221
 function handleShowMerchant(merchant) {
192
   // console.log(merchant)
222
   // console.log(merchant)
193
   uni.navigateTo({
223
   uni.navigateTo({
194
-    url: '/pages/store/home/index?id=' + merchant.mer_id
224
+    url: `/pages/store/home/index?id=${merchant.mer_id}`,
195
   })
225
   })
196
 }
226
 }
197
 
227
 
198
-
199
 function change() {
228
 function change() {
200
 }
229
 }
201
 
230
 
@@ -203,126 +232,126 @@ function onChange() {
203
 }
232
 }
204
 
233
 
205
 // 下拉刷新被下拉
234
 // 下拉刷新被下拉
206
-const onRefresherPulling = e => {
207
-  state.triggered = true;
208
-};
235
+function onRefresherPulling(e) {
236
+  state.triggered = true
237
+}
209
 // 下拉刷新被复位
238
 // 下拉刷新被复位
210
-const onRefresherRestore = e => {
211
-  state.triggered = false;
212
-};
239
+function onRefresherRestore(e) {
240
+  state.triggered = false
241
+}
213
 // 下拉刷新被中止
242
 // 下拉刷新被中止
214
-const onRefresherAbort = e => {
215
-  state.triggered = false;
243
+function onRefresherAbort(e) {
244
+  state.triggered = false
216
 }
245
 }
217
 // 下拉刷新被触发
246
 // 下拉刷新被触发
218
-const onRefresherRefresh = e => {
219
-
247
+function onRefresherRefresh(e) {
248
+  state.currentPage = 1
220
   loadSelectMerchant('reload')
249
   loadSelectMerchant('reload')
221
-};
250
+}
222
 
251
 
223
-//小火箭滚动事件
224
-const onscroll = e => {
252
+// 小火箭滚动事件
253
+function onscroll(e) {
225
   state.scrollTop = e.detail.scrollTop
254
   state.scrollTop = e.detail.scrollTop
226
 }
255
 }
227
 
256
 
228
 function handleScrollToLower() {
257
 function handleScrollToLower() {
229
-  state.status = 'loading';
230
-  state.currentPage += 1;
258
+  state.status = 'loading'
259
+  state.currentPage += 1
231
   if (state.currentPage > state.totalPage) {
260
   if (state.currentPage > state.totalPage) {
232
-    state.status = 'noMore';
233
-  } else {
261
+    state.status = 'noMore'
262
+  }
263
+  else {
234
     // queryFavorites('page');
264
     // queryFavorites('page');
235
     loadSelectMerchant('page')
265
     loadSelectMerchant('page')
236
   }
266
   }
237
 }
267
 }
238
 
268
 
239
-//返回顶部事件
269
+// 返回顶部事件
240
 const scrollToTop = function () {
270
 const scrollToTop = function () {
241
-  console.log('返回顶部');
271
+  console.log('返回顶部')
242
   state.scrollTop = 0
272
   state.scrollTop = 0
243
-
244
 }
273
 }
245
-//监视
274
+// 监视
246
 watch(() => state.scrollTop, () => {
275
 watch(() => state.scrollTop, () => {
247
-  if (state.scrollTop as number > 400) {
276
+  if (state.scrollTop as number > 400)
248
     flag.value = true
277
     flag.value = true
249
-  }
250
-  if (state.scrollTop as number < 400) {
278
+
279
+  if (state.scrollTop as number < 400)
251
     flag.value = false
280
     flag.value = false
252
-  }
253
 })
281
 })
254
 
282
 
255
-
256
-
283
+function searchAction() {
284
+  state.currentPage = 1
285
+  loadSelectMerchant('reload')
286
+}
257
 </script>
287
 </script>
288
+
258
 <template>
289
 <template>
259
-  <!--  <nut-category :category="state.merchantCategory" @change="change">-->
260
-  <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange">-->
261
-  <!--    </nut-category-pane>-->
262
-  <!--  </nut-category>-->
290
+  <!--  <nut-category :category="state.merchantCategory" @change="change"> -->
291
+  <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange"> -->
292
+  <!--    </nut-category-pane> -->
293
+  <!--  </nut-category> -->
263
   <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white w-full">
294
   <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white w-full">
264
-
265
-    <nut-searchbar v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant('reload')">
266
-      <template v-slot:rightout>
267
-        <div @tap="loadSelectMerchant('reload')">
295
+    <nut-searchbar v-model="searchValue" @search="searchAction()" @clear="searchAction()">
296
+      <template #rightout>
297
+        <div @tap="searchAction()">
268
           搜索
298
           搜索
269
         </div>
299
         </div>
270
       </template>
300
       </template>
271
     </nut-searchbar>
301
     </nut-searchbar>
272
-
273
-
274
   </div>
302
   </div>
275
   <div class="flex pt-10 ">
303
   <div class="flex pt-10 ">
276
     <!-- 左侧 一级分类 -->
304
     <!-- 左侧 一级分类 -->
277
     <div class="w-1/4">
305
     <div class="w-1/4">
278
-      <scroll-view ref="ToTop" :scroll-y="true" :style="{ height: `${state.scrollHeight}px` }"
279
-        class="w-full h-full bg-[#f8f8f8]">
280
-        <div @tap="loadAll()" :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
281
-          class="relative w-25 h-12 block text-sm flex justify-center items-center">
306
+      <scroll-view
307
+        ref="ToTop" :scroll-y="true" :style="{ height: `${state.scrollHeight}px` }"
308
+        class="w-full h-full bg-[#f8f8f8]"
309
+      >
310
+        <div
311
+          :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''" class="relative w-25 h-12 block text-sm flex justify-center items-center"
312
+          @tap="loadAll()"
313
+        >
282
           <div class="flex items-center gap-1">
314
           <div class="flex items-center gap-1">
283
-            <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == 0"></div>
315
+            <div v-if="state.currentMerchantCategoryId == 0" class="h-4 bg-primary w-1" />
284
             <div>全部</div>
316
             <div>全部</div>
285
           </div>
317
           </div>
286
-
287
         </div>
318
         </div>
288
-        <div v-for="(item, index) in state.merchantCategory" :key="index" @tap="handleCategoryChange(item)"
289
-          :class="state.currentMerchantCategoryId == item.merchant_category_id ? 'bg-white font-bold' : ''"
290
-          class="relative h-12 block text-sm flex justify-center items-center gap-1 w-25">
291
-          <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == item.merchant_category_id"></div>
319
+        <div
320
+          v-for="(item, index) in state.merchantCategory" :key="index" :class="state.currentMerchantCategoryId == item.merchant_category_id ? 'bg-white font-bold' : ''"
321
+          class="relative h-12 block text-sm flex justify-center items-center gap-1 w-25"
322
+          @tap="handleCategoryChange(item)"
323
+        >
324
+          <div v-if="state.currentMerchantCategoryId == item.merchant_category_id" class="h-4 bg-primary w-1" />
292
 
325
 
293
           <div>
326
           <div>
294
             {{ item.category_name }}
327
             {{ item.category_name }}
295
-
296
           </div>
328
           </div>
297
-
298
         </div>
329
         </div>
299
       </scroll-view>
330
       </scroll-view>
300
-
301
     </div>
331
     </div>
302
 
332
 
303
-
304
     <div class="w-3/4 ">
333
     <div class="w-3/4 ">
305
       <div class="fixed z-3 flex flex-col justify-center h-10 pl-3 top-10">
334
       <div class="fixed z-3 flex flex-col justify-center h-10 pl-3 top-10">
306
         <nut-menu>
335
         <nut-menu>
307
-          <nut-menu-item v-model="state.menuDefaultValue" :options="state.options" @change="loadSelectMerchant('reload')">
308
-
309
-          </nut-menu-item>
336
+          <nut-menu-item v-model="state.menuDefaultValue" :options="state.options" @change="loadSelectMerchant('reload')" />
310
         </nut-menu>
337
         </nut-menu>
311
       </div>
338
       </div>
312
       <!-- 返回顶部 -->
339
       <!-- 返回顶部 -->
313
       <div v-show="flag" class="back-top">
340
       <div v-show="flag" class="back-top">
314
-        <img @click="scrollToTop" class="back-TopImg" src="../../static/icon/返回顶部@2x.png" alt="">
341
+        <img class="back-TopImg" src="../../static/icon/返回顶部@2x.png" alt="" @click="scrollToTop">
315
       </div>
342
       </div>
316
-      <scroll-view :scroll-y="true" :style="{ height: `${state.scrollHeight - 60}px` }" :scroll-top="state.scrollTop"
317
-        class="flex flex-1  flex-col   p-3 gap-3 mt-10" :refresher-enabled="true" refresher-background="#f5f5f5"
318
-        refresher-default-style="black" :refresher-triggered="state.triggered" @scrolltolower="handleScrollToLower"
319
-        @refresherpulling="onRefresherPulling" @refresherRestore="onRefresherRestore" @refresherAbort="onRefresherAbort"
320
-        @refresherrefresh="onRefresherRefresh" v-if="state.merchantList && state.merchantList.length > 0"
321
-        @scroll="onscroll">
322
-        <div v-for="(item, index) in state.merchantList" :key="index" @click="handleShowMerchant(item)" class="mb-3 ">
343
+      <scroll-view
344
+        v-if="state.merchantList && state.merchantList.length > 0" :scroll-y="true" :style="{ height: `${state.scrollHeight - 60}px` }"
345
+        :scroll-top="state.scrollTop" class="flex flex-1  flex-col p-3 gap-3 mt-10" :refresher-enabled="true"
346
+        refresher-background="#f5f5f5" refresher-default-style="black" :refresher-triggered="state.triggered"
347
+        :scroll-anchoring="true" @scrolltolower="handleScrollToLower" @refresherpulling="onRefresherPulling"
348
+        @refresherRestore="onRefresherRestore" @refresherAbort="onRefresherAbort"
349
+        @refresherrefresh="onRefresherRefresh" @scroll="onscroll"
350
+      >
351
+        <div v-for="(item, index) in state.merchantList" :key="index" class="mb-3 " @click="handleShowMerchant(item)">
323
           <div class="flex">
352
           <div class="flex">
324
             <div class="flex ">
353
             <div class="flex ">
325
-              <image :src="item.mer_avatar" mode="aspectFill" class="w-20 h-20 rounded-lg"></image>
354
+              <image :src="item.mer_avatar" mode="aspectFill" class="w-20 h-20 rounded-lg" />
326
             </div>
355
             </div>
327
 
356
 
328
             <div class="flex flex-col justify-between px-2">
357
             <div class="flex flex-col justify-between px-2">
@@ -335,9 +364,13 @@ watch(() => state.scrollTop, () => {
335
                 </div>
364
                 </div>
336
               </div>
365
               </div>
337
 
366
 
338
-              <div class="text-xs">{{ (item.distance).toFixed(1) }}km</div>
367
+              <div v-if="item.distance" class="text-xs">
368
+                {{ (item.distance).toFixed(1) }}km
369
+              </div>
370
+              <div v-else class="text-xs">
371
+                0km
372
+              </div>
339
             </div>
373
             </div>
340
-
341
           </div>
374
           </div>
342
         </div>
375
         </div>
343
         <div class=" flex justify-center items-center text-[12px] text-gray-500">
376
         <div class=" flex justify-center items-center text-[12px] text-gray-500">
@@ -349,14 +382,13 @@ watch(() => state.scrollTop, () => {
349
           </div>
382
           </div>
350
         </div>
383
         </div>
351
       </scroll-view>
384
       </scroll-view>
352
-      <div class="flex justify-center items-center w-full h-[60%]" v-else>
385
+      <div v-else class="flex justify-center items-center w-full h-[60%]">
353
         <CXBEmpty />
386
         <CXBEmpty />
354
-
355
       </div>
387
       </div>
356
     </div>
388
     </div>
357
-
358
   </div>
389
   </div>
359
 </template>
390
 </template>
391
+
360
 <route lang="yaml">
392
 <route lang="yaml">
361
 style:
393
 style:
362
   navigationBarTitleText: 储蓄保
394
   navigationBarTitleText: 储蓄保
@@ -398,4 +430,4 @@ page {
398
     border-radius: 4px;
430
     border-radius: 4px;
399
   }
431
   }
400
 }
432
 }
401
-</style>
433
+</style>

+ 5 - 4
src/pages/store/product/detail.vue

@@ -426,12 +426,13 @@ function handleCreateShopping() {
426
         isTo.value = 1
426
         isTo.value = 1
427
         uni.$emit('cart-reload')
427
         uni.$emit('cart-reload')
428
         loadProductDetail()
428
         loadProductDetail()
429
-        uni.showToast({
430
-          title: '添加购物车成功',
431
-          icon: 'none'
432
-        })
429
+        
433
         loadCartCount()
430
         loadCartCount()
434
         state.isShowSku = false
431
         state.isShowSku = false
432
+		uni.showToast({
433
+		  title: '添加购物车成功',
434
+		  icon: 'none'
435
+		})
435
       }
436
       }
436
     }
437
     }
437
   }).catch(error => {
438
   }).catch(error => {

+ 219 - 226
src/pages/store/product/other.vue

@@ -1,50 +1,53 @@
1
 <script setup lang="ts">
1
 <script setup lang="ts">
2
 // import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
2
 // import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
3
+import { merge } from 'lodash-es'
4
+import dayjs from 'dayjs'
3
 import {
5
 import {
4
   getDyProductDetail,
6
   getDyProductDetail,
5
-  getJdProductDetail,
6
   getJTTProductDetail,
7
   getJTTProductDetail,
7
-  getPddProductDetail, 
8
+  getJdProductDetail,
9
+  getPddProductDetail,
8
   getShareId,
10
   getShareId,
9
   getSuProductDetail,
11
   getSuProductDetail,
10
   getTaobaoProductDetail,
12
   getTaobaoProductDetail,
11
-  getVipProductDetail
12
-} from "~/apis/product";
13
-import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
14
-import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
13
+  getVipProductDetail,
14
+} from '~/apis/product'
15
+import CXBBasePage from '~/components/CXBBasePage/CXBBasePage.vue'
16
+import MerchantProductCard from '~/pages/store/home/components/MerchantProductCard.vue'
15
 import type {
17
 import type {
16
   DyProductModel,
18
   DyProductModel,
17
   IProductDetail,
19
   IProductDetail,
18
   JdProductDetailModel,
20
   JdProductDetailModel,
19
-  
21
+
20
   JdProductModel,
22
   JdProductModel,
21
   SuNingProductModel,
23
   SuNingProductModel,
22
   TaobaoProductThirdPartyWaresModel,
24
   TaobaoProductThirdPartyWaresModel,
23
   TaobaoWaresDetail,
25
   TaobaoWaresDetail,
24
-  VipProductModel
25
-} from "~/apis/model/product.model";
26
-import FPrice from "~/components/FPrice/FPrice.vue";
27
-import FButton from "~/components/FButton/FButton.vue";
28
-import CXBButton from "~/components/CXBButton/CXBButton.vue";
29
-import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
30
-import { debounce, merge } from "lodash-es";
31
-
32
-import { useDebounceFn } from '@vueuse/core';
33
-import dayjs from "dayjs";
34
-import { decodeBase64, encodeBase64 } from "~/utils/http/helper";
35
-import { CDN_URL, CDM_URL } from "~/config/app";
36
-import { getRecommendList } from "~/apis/merchant";
37
-import type { DcProductModel } from "~/apis/model/dacang.model";
38
-
39
-const discount_coupon_bg_220804Image = CDN_URL + '/static/assets/discount_coupon_bg_220804.png'
26
+  VipProductModel,
27
+} from '~/apis/model/product.model'
28
+import FPrice from '~/components/FPrice/FPrice.vue'
29
+import CXBBackTop from '~/components/CXBBackTop/CXBBackTop.vue'
30
+
31
+import { decodeBase64, encodeBase64 } from '~/utils/http/helper'
32
+import { CDM_URL, CDN_URL } from '~/config/app'
33
+import { getRecommendList } from '~/apis/merchant'
34
+import type { DcProductModel } from '~/apis/model/dacang.model'
35
+
36
+const props = defineProps({
37
+  type: {
38
+    type: Number,
39
+    default: 0,
40
+  },
41
+})
42
+const discount_coupon_bg_220804Image = `${CDN_URL}/static/assets/discount_coupon_bg_220804.png`
40
 const productId = ref('')
43
 const productId = ref('')
41
-//推荐商品列表
42
-let skuInfo = reactive({
44
+// 推荐商品列表
45
+const skuInfo = reactive({
43
   recommendList: [],
46
   recommendList: [],
44
   totalPage: 0,
47
   totalPage: 0,
45
   pageSize: 10,
48
   pageSize: 10,
46
   status: '',
49
   status: '',
47
-  currentPage: 1
50
+  currentPage: 1,
48
 })
51
 })
49
 
52
 
50
 const userStore = useUserStore()
53
 const userStore = useUserStore()
@@ -56,28 +59,20 @@ const coupon = ref({
56
   money: '',
59
   money: '',
57
   // 优惠券有效期
60
   // 优惠券有效期
58
   startTime: '',
61
   startTime: '',
59
-  endTime: ''
62
+  endTime: '',
60
 })
63
 })
61
 const productDetail = ref<JdProductDetailModel | TaobaoWaresDetail>()
64
 const productDetail = ref<JdProductDetailModel | TaobaoWaresDetail>()
62
 
65
 
63
-const props = defineProps({
64
-  type: {
65
-    type: Number,
66
-    default: 0
67
-  }
68
-})
69
-
70
 const state = reactive({
66
 const state = reactive({
71
   data: {},
67
   data: {},
72
   shareId: '',
68
   shareId: '',
73
-  pddData: {}
69
+  pddData: {},
74
 })
70
 })
75
 const isShow = ref(false)
71
 const isShow = ref(false)
76
 const detail = ref<IProductDetail>()
72
 const detail = ref<IProductDetail>()
77
 const detailclone = ref<IProductDetail>()
73
 const detailclone = ref<IProductDetail>()
78
 const isNeedAuth = ref(false)
74
 const isNeedAuth = ref(false)
79
 onLoad((options: any) => {
75
 onLoad((options: any) => {
80
-
81
   const data: Partial<IProductDetail> = JSON.parse(decodeBase64(options.params))
76
   const data: Partial<IProductDetail> = JSON.parse(decodeBase64(options.params))
82
   state.pddData = data
77
   state.pddData = data
83
   // console.log('我是options数据', data)  url: `/pages/store/product/other?platform=${item.type}&id=${item.id}`
78
   // console.log('我是options数据', data)  url: `/pages/store/product/other?platform=${item.type}&id=${item.id}`
@@ -85,7 +80,7 @@ onLoad((options: any) => {
85
   // if (options.platform && options.id) {
80
   // if (options.platform && options.id) {
86
   uni.showLoading({
81
   uni.showLoading({
87
     title: '数据加载中',
82
     title: '数据加载中',
88
-    icon: 'none'
83
+    icon: 'none',
89
   })
84
   })
90
   mergeProductDetail(data)
85
   mergeProductDetail(data)
91
   loadProductDetail(data)
86
   loadProductDetail(data)
@@ -94,62 +89,59 @@ onLoad((options: any) => {
94
 
89
 
95
 onShow(() => {
90
 onShow(() => {
96
   isSubmit.value = false
91
   isSubmit.value = false
97
-  
98
-	console.log('onshow----')
99
-	if (isNeedAuth.value) {
100
-		console.log('从授权进来的。。。。')
101
-		loadProductDetail(state.pddData)
102
-		isNeedAuth.value = false
103
-	}
92
+
93
+  console.log('onshow----')
94
+  if (isNeedAuth.value) {
95
+    console.log('从授权进来的。。。。')
96
+    loadProductDetail(state.pddData)
97
+    isNeedAuth.value = false
98
+  }
104
 })
99
 })
105
 
100
 
106
-//精品推荐
101
+// 精品推荐
107
 function YouLike() {
102
 function YouLike() {
108
   getRecommendList({
103
   getRecommendList({
109
     page: 1,
104
     page: 1,
110
-    limit: 10
111
-  }).then(res => {
105
+    limit: 10,
106
+  }).then((res) => {
112
     skuInfo.recommendList = res.list
107
     skuInfo.recommendList = res.list
113
     // console.log(skuInfo.recommendList);
108
     // console.log(skuInfo.recommendList);
114
-
115
   })
109
   })
116
 }
110
 }
117
 
111
 
118
-//商品不存在详情
112
+// 商品不存在详情
119
 function soldOut() {
113
 function soldOut() {
120
-	console.log('1')
121
-	console.log(userStore.uid)
114
+  console.log('1')
115
+  console.log(userStore.uid)
122
   if (userStore.uid) {
116
   if (userStore.uid) {
123
     isShow.value = true
117
     isShow.value = true
124
-	console.log('2')
118
+    console.log('2')
125
     uni.setNavigationBarTitle({
119
     uni.setNavigationBarTitle({
126
-      title: '商品下架不存在'
120
+      title: '商品下架不存在',
127
     })
121
     })
128
     loadList('reload')
122
     loadList('reload')
129
     uni.hideLoading()
123
     uni.hideLoading()
130
-  } else {
124
+  }
125
+  else {
131
 	  console.log('3')
126
 	  console.log('3')
132
     uni.showToast({
127
     uni.showToast({
133
       title: '请登录',
128
       title: '请登录',
134
-      icon: 'none'
129
+      icon: 'none',
135
     })
130
     })
136
     setTimeout(() => {
131
     setTimeout(() => {
137
       uni.redirectTo({
132
       uni.redirectTo({
138
-        url: '/pages/user/login/index?key=4'
133
+        url: '/pages/user/login/index?key=4',
139
       })
134
       })
140
     }, 500)
135
     }, 500)
141
   }
136
   }
142
-
143
 }
137
 }
144
 
138
 
145
 function mergeProductDetail(data: Partial<IProductDetail> = {}) {
139
 function mergeProductDetail(data: Partial<IProductDetail> = {}) {
146
   detailclone.value = merge(detailclone.value, data)
140
   detailclone.value = merge(detailclone.value, data)
147
-
148
 }
141
 }
149
 function mergeProductDetailclone(data: Partial<IProductDetail> = {}) {
142
 function mergeProductDetailclone(data: Partial<IProductDetail> = {}) {
150
   detail.value = merge(detailclone.value, data)
143
   detail.value = merge(detailclone.value, data)
151
   // console.log(detail.value);
144
   // console.log(detail.value);
152
-
153
 }
145
 }
154
 
146
 
155
 function loadProductDetail(product: Partial<IProductDetail>) {
147
 function loadProductDetail(product: Partial<IProductDetail>) {
@@ -157,92 +149,90 @@ function loadProductDetail(product: Partial<IProductDetail>) {
157
 
149
 
158
   // 京东
150
   // 京东
159
   if (product.platform == 6) {
151
   if (product.platform == 6) {
160
-	  
161
 	  if (userStore.uid) { // 已登录的
152
 	  if (userStore.uid) { // 已登录的
162
-		  getJdProductDetail(product.id).then(res => {
163
-		    console.log('京东商品详情',res);
164
-		    let { data, status } = res
165
-		    
153
+		  getJdProductDetail(product.id).then((res) => {
154
+		    console.log('京东商品详情', res)
155
+		    const { data, status } = res
156
+
166
 		    const jdProduct = data[0]
157
 		    const jdProduct = data[0]
167
 		    // console.log(jdProduct)
158
 		    // console.log(jdProduct)
168
 		    mergeProductDetailclone({
159
 		    mergeProductDetailclone({
169
 		      images: jdProduct.detail,
160
 		      images: jdProduct.detail,
170
 		      coupon: {
161
 		      coupon: {
171
-		        amount: jdProduct.couMoney
162
+		        amount: jdProduct.couMoney,
172
 		      },
163
 		      },
173
-		      ...jdProduct
164
+		      ...jdProduct,
174
 		    })
165
 		    })
175
-		    
166
+
176
 		    uni.hideLoading()
167
 		    uni.hideLoading()
177
-		})
178
-	  } else { // 未登录的
179
-		  getJTTProductDetail(product.id, 1).then(res => {
180
-		    console.log('京东商品详情',res);
181
-		    let { data, status } = res
182
-		    
168
+      })
169
+	  }
170
+    else { // 未登录的
171
+		  getJTTProductDetail(product.id, 1).then((res) => {
172
+		    console.log('京东商品详情', res)
173
+		    const { data, status } = res
174
+
183
 		    const jdProduct = data[0]
175
 		    const jdProduct = data[0]
184
 		    // console.log(jdProduct)
176
 		    // console.log(jdProduct)
185
 		    mergeProductDetailclone({
177
 		    mergeProductDetailclone({
186
 		      images: jdProduct.detail,
178
 		      images: jdProduct.detail,
187
 		      coupon: {
179
 		      coupon: {
188
-		        amount: jdProduct.couMoney
180
+		        amount: jdProduct.couMoney,
189
 		      },
181
 		      },
190
-		      ...jdProduct
182
+		      ...jdProduct,
191
 		    })
183
 		    })
192
-		    
184
+
193
 		    uni.hideLoading()
185
 		    uni.hideLoading()
194
-		})
186
+      })
195
 	  }
187
 	  }
196
-    
197
-	  
198
-      // if (status === 200) {
199
-        
200
-      // } else {
201
-      //   soldOut()
202
-      // }
203
-    
188
+
189
+    // if (status === 200) {
190
+
191
+    // } else {
192
+    //   soldOut()
193
+    // }
204
   }
194
   }
205
   // 淘宝 *
195
   // 淘宝 *
206
   if (product.platform === 5) {
196
   if (product.platform === 5) {
207
-    getTaobaoProductDetail(product.id).then(res => {
197
+    getTaobaoProductDetail(product.id).then((res) => {
208
       // console.log('taobao>>>',res);
198
       // console.log('taobao>>>',res);
209
-      let { status, data } = res
199
+      const { status, data } = res
210
       if (status === 200) {
200
       if (status === 200) {
211
         const product = data.waresDetail
201
         const product = data.waresDetail
212
         mergeProductDetailclone({
202
         mergeProductDetailclone({
213
           images: product.small_images,
203
           images: product.small_images,
214
           coupon: {
204
           coupon: {
215
             startTime: product.couponStartTime,
205
             startTime: product.couponStartTime,
216
-            endTime: product.couponEndTime
206
+            endTime: product.couponEndTime,
217
           },
207
           },
218
-          ...product
208
+          ...product,
219
         })
209
         })
220
         uni.hideLoading()
210
         uni.hideLoading()
221
-      } else {
211
+      }
212
+      else {
222
         soldOut()
213
         soldOut()
223
       }
214
       }
224
-
225
-
226
     })
215
     })
227
   }
216
   }
228
 
217
 
229
   // 拼多多 *
218
   // 拼多多 *
230
   if (product.platform == 1) {
219
   if (product.platform == 1) {
231
-    getPddProductDetail(product.id).then(res => {
232
-		console.log('res')
220
+    getPddProductDetail(product.id).then((res) => {
221
+      console.log('res')
233
       console.log(res)
222
       console.log(res)
234
 	  console.log()
223
 	  console.log()
235
-      let { status, data } = res
224
+      const { status, data } = res
236
       // detail.value = res
225
       // detail.value = res
237
       if (status !== 200) {
226
       if (status !== 200) {
238
         soldOut()
227
         soldOut()
239
-      } else {
228
+      }
229
+      else {
240
         mergeProductDetailclone({
230
         mergeProductDetailclone({
241
           spreadUrl: data.pddlink.url,
231
           spreadUrl: data.pddlink.url,
242
           images: data.goods_gallery_urls,
232
           images: data.goods_gallery_urls,
243
           featured: data.goods_gallery_urls,
233
           featured: data.goods_gallery_urls,
244
           mallName: data.mall_name,
234
           mallName: data.mall_name,
245
-          ...data
235
+          ...data,
246
           // allowance:
236
           // allowance:
247
         })
237
         })
248
 
238
 
@@ -251,27 +241,26 @@ function loadProductDetail(product: Partial<IProductDetail>) {
251
             coupon: {
241
             coupon: {
252
               // amount: (res.extra_coupon_amount / 100).toString(),
242
               // amount: (res.extra_coupon_amount / 100).toString(),
253
               startTime: dayjs.unix(data.coupon_start_time).format('YYYY-MM-DD'),
243
               startTime: dayjs.unix(data.coupon_start_time).format('YYYY-MM-DD'),
254
-              endTime: dayjs.unix(data.coupon_end_time).format('YYYY-MM-DD')
244
+              endTime: dayjs.unix(data.coupon_end_time).format('YYYY-MM-DD'),
255
             },
245
             },
256
           })
246
           })
257
-        } else {
247
+        }
248
+        else {
258
           mergeProductDetailclone({
249
           mergeProductDetailclone({
259
-            coupon: null
250
+            coupon: null,
260
           })
251
           })
261
         }
252
         }
262
 
253
 
263
         uni.hideLoading()
254
         uni.hideLoading()
264
       }
255
       }
265
-
266
-
267
     })
256
     })
268
   }
257
   }
269
 
258
 
270
   // 唯品会 *
259
   // 唯品会 *
271
   if (product.platform == 2) {
260
   if (product.platform == 2) {
272
-    getVipProductDetail(product.id).then(res => {
261
+    getVipProductDetail(product.id).then((res) => {
273
       // console.log(res.result[0])
262
       // console.log(res.result[0])
274
-      let { data, status } = res
263
+      const { data, status } = res
275
       if (status === 200) {
264
       if (status === 200) {
276
         const product = data.result[0]
265
         const product = data.result[0]
277
         // detail.value = product
266
         // detail.value = product
@@ -280,77 +269,74 @@ function loadProductDetail(product: Partial<IProductDetail>) {
280
           images: product.goodsDetailPictures,
269
           images: product.goodsDetailPictures,
281
           mallName: '唯品自营',
270
           mallName: '唯品自营',
282
           ...product,
271
           ...product,
283
-          ...res
272
+          ...res,
284
         })
273
         })
285
         if (product.couponInfo) {
274
         if (product.couponInfo) {
286
           mergeProductDetailclone({
275
           mergeProductDetailclone({
287
             coupon: {
276
             coupon: {
288
               amount: product.couponInfo.activedAmount,
277
               amount: product.couponInfo.activedAmount,
289
               startTime: product.couponInfo.useBeginTime,
278
               startTime: product.couponInfo.useBeginTime,
290
-              endTime: product.couponInfo.useEndTime
291
-            }
279
+              endTime: product.couponInfo.useEndTime,
280
+            },
292
           })
281
           })
293
         }
282
         }
294
 
283
 
295
         uni.hideLoading()
284
         uni.hideLoading()
296
-      } else {
285
+      }
286
+      else {
297
         soldOut()
287
         soldOut()
298
       }
288
       }
299
-
300
-
301
     })
289
     })
302
   }
290
   }
303
   // 苏宁 *
291
   // 苏宁 *
304
   if (product.platform == 3) {
292
   if (product.platform == 3) {
305
-    getSuProductDetail(product.id).then(res => {
293
+    getSuProductDetail(product.id).then((res) => {
306
       // const product = res
294
       // const product = res
307
-      let { status, data } = res
295
+      const { status, data } = res
308
       if (status === 200) {
296
       if (status === 200) {
309
         mergeProductDetailclone({
297
         mergeProductDetailclone({
310
           images: data.detail,
298
           images: data.detail,
311
-          ...data
299
+          ...data,
312
         })
300
         })
313
 
301
 
314
         uni.hideLoading()
302
         uni.hideLoading()
315
-
316
-      } else {
303
+      }
304
+      else {
317
         soldOut()
305
         soldOut()
318
       }
306
       }
319
-
320
     })
307
     })
321
   }
308
   }
322
   // 抖音 *
309
   // 抖音 *
323
   if (product.platform == 9) {
310
   if (product.platform == 9) {
324
-    getDyProductDetail(product.id).then(res => {
311
+    getDyProductDetail(product.id).then((res) => {
325
       console.log(res)
312
       console.log(res)
326
-      let { status, data } = res
313
+      const { status, data } = res
327
       if (status === 200) {
314
       if (status === 200) {
328
         mergeProductDetailclone({
315
         mergeProductDetailclone({
329
           mallName: data.shopName,
316
           mallName: data.shopName,
330
           images: data.imgs,
317
           images: data.imgs,
331
-          ...data
318
+          ...data,
332
         })
319
         })
333
 
320
 
334
         uni.hideLoading()
321
         uni.hideLoading()
335
-      } else {
322
+      }
323
+      else {
336
         soldOut()
324
         soldOut()
337
       }
325
       }
338
-
339
-
340
     })
326
     })
341
-
342
-
343
   }
327
   }
344
 }
328
 }
345
 
329
 
346
 function handleBuyNow() {
330
 function handleBuyNow() {
347
-  if (isSubmit.value) return
331
+  if (isSubmit.value)
332
+    return
348
   if (!userStore.uid) {
333
   if (!userStore.uid) {
349
     isSubmit.value = true
334
     isSubmit.value = true
350
 
335
 
351
     uni.navigateTo({
336
     uni.navigateTo({
352
-      url: '/pages/user/login/index'
337
+      url: '/pages/user/login/index',
353
     })
338
     })
339
+	return
354
   }
340
   }
355
   if (detail.value?.platform) {
341
   if (detail.value?.platform) {
356
     // 京东
342
     // 京东
@@ -361,9 +347,9 @@ function handleBuyNow() {
361
         uni.navigateToMiniProgram({
347
         uni.navigateToMiniProgram({
362
           appId: 'wx91d27dbf599dff74',
348
           appId: 'wx91d27dbf599dff74',
363
           // path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(detail.value?.spreadUrl),
349
           // path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(detail.value?.spreadUrl),
364
-          path: 'pages/union/proxy/proxy?spreadUrl=' + detail.value.materialUrl,
350
+          path: `pages/union/proxy/proxy?spreadUrl=${detail.value.materialUrl}`,
365
           extraData: {
351
           extraData: {
366
-            foo: 'bar'
352
+            foo: 'bar',
367
           },
353
           },
368
           envVersion: 'release',
354
           envVersion: 'release',
369
           success(res) {
355
           success(res) {
@@ -371,25 +357,26 @@ function handleBuyNow() {
371
             // console.log(res);
357
             // console.log(res);
372
           },
358
           },
373
           fail: (error) => {
359
           fail: (error) => {
374
-            console.log(error);
375
-          }
360
+            console.log(error)
361
+          },
376
         })
362
         })
377
-      } else {
363
+      }
364
+      else {
378
         return uni.showToast({
365
         return uni.showToast({
379
           title: '跳转失败请重试',
366
           title: '跳转失败请重试',
380
-          icon: 'none'
367
+          icon: 'none',
381
         })
368
         })
382
       }
369
       }
383
-    } else if (detail.value?.platform == 1) {
370
+    }
371
+    else if (detail.value?.platform == 1) {
384
       console.log(detail.value)
372
       console.log(detail.value)
385
-	  
373
+
386
 	  if (detail.value.pddlink.mobile_url.includes('mobile.yangkeduo')) {
374
 	  if (detail.value.pddlink.mobile_url.includes('mobile.yangkeduo')) {
387
 		  isNeedAuth.value = true
375
 		  isNeedAuth.value = true
388
-		  
376
+
389
 		  console.log('需要授权')
377
 		  console.log('需要授权')
390
 	  }
378
 	  }
391
-	  
392
-	  
379
+
393
       const pddWx = detail.value.pddlink.wx
380
       const pddWx = detail.value.pddlink.wx
394
       if (pddWx) {
381
       if (pddWx) {
395
         uni.navigateToMiniProgram({
382
         uni.navigateToMiniProgram({
@@ -404,19 +391,20 @@ function handleBuyNow() {
404
             // console.log(res);
391
             // console.log(res);
405
           },
392
           },
406
           fail: (error) => {
393
           fail: (error) => {
407
-            console.log(error);
408
-          }
394
+            console.log(error)
395
+          },
409
         })
396
         })
410
-
411
-      } else {
397
+      }
398
+      else {
412
         uni.showToast({
399
         uni.showToast({
413
           title: '跳转失败请重试',
400
           title: '跳转失败请重试',
414
-          icon: 'none'
401
+          icon: 'none',
415
         })
402
         })
416
       }
403
       }
417
       // console.log(detail.value.pddlink)
404
       // console.log(detail.value.pddlink)
418
       // console.log(pddWx)
405
       // console.log(pddWx)
419
-    } else {
406
+    }
407
+    else {
420
       /*      let platformName = ''
408
       /*      let platformName = ''
421
             let clipboardData = ''
409
             let clipboardData = ''
422
             if (detail.value?.platform == 5) {
410
             if (detail.value?.platform == 5) {
@@ -449,15 +437,16 @@ function handleBuyNow() {
449
                   icon: 'none'
437
                   icon: 'none'
450
                 })
438
                 })
451
               }
439
               }
452
-            })*/
440
+            }) */
453
 
441
 
454
       // }
442
       // }
455
 	  if (detail.value?.platform == 6) {
443
 	  if (detail.value?.platform == 6) {
456
-		  
457
-	  } else {
444
+
445
+	  }
446
+      else {
458
 		  return uni.showToast({
447
 		  return uni.showToast({
459
 		    title: '商品维护中,请稍后再试',
448
 		    title: '商品维护中,请稍后再试',
460
-		    icon: 'none'
449
+		    icon: 'none',
461
 		  })
450
 		  })
462
 	  }
451
 	  }
463
     }
452
     }
@@ -471,48 +460,46 @@ function handleBuyNow() {
471
   }
460
   }
472
   if (detail.value?.platform == 2) {
461
   if (detail.value?.platform == 2) {
473
     console.log(detail.value)
462
     console.log(detail.value)
474
-  }*/
463
+  } */
475
 
464
 
476
   onShareAppMessage(async () => {
465
   onShareAppMessage(async () => {
477
     await uni.showLoading({
466
     await uni.showLoading({
478
       title: '分享中',
467
       title: '分享中',
479
-      icon: 'none'
468
+      icon: 'none',
480
     })
469
     })
481
-    return await getShareId({ pid: state.id, type: 1 }).then(res => {
470
+    return await getShareId({ pid: state.id, type: 1 }).then((res) => {
482
       if (res) {
471
       if (res) {
483
         state.shareId = res.share_id
472
         state.shareId = res.share_id
484
         uni.hideLoading()
473
         uni.hideLoading()
485
         return {
474
         return {
486
           title: `${detail.value.title}`,
475
           title: `${detail.value.title}`,
487
-          path: `pages/store/product/detail?id=${detail.value.id}&from=share&shareID=${state.shareId}`
476
+          path: `pages/store/product/detail?id=${detail.value.id}&from=share&shareID=${state.shareId}`,
488
         }
477
         }
489
       }
478
       }
490
-    }).catch(error => {
479
+    }).catch((error) => {
491
       uni.showToast({
480
       uni.showToast({
492
         title: '请登录后分享',
481
         title: '请登录后分享',
493
-        icon: 'none'
482
+        icon: 'none',
494
       }).then(() => {
483
       }).then(() => {
495
         setTimeout(() => {
484
         setTimeout(() => {
496
           uni.navigateTo({
485
           uni.navigateTo({
497
-            url: '/pages/user/login/index'
486
+            url: '/pages/user/login/index',
498
           })
487
           })
499
         }, 500)
488
         }, 500)
500
       })
489
       })
501
       uni.hideLoading()
490
       uni.hideLoading()
502
     })
491
     })
503
-
504
   })
492
   })
505
 
493
 
506
   onShareTimeline(() => {
494
   onShareTimeline(() => {
507
-
508
     if (!userStore.uid) {
495
     if (!userStore.uid) {
509
       return uni.showToast({
496
       return uni.showToast({
510
         title: '请登录后分享',
497
         title: '请登录后分享',
511
-        icon: 'none'
498
+        icon: 'none',
512
       }).then(() => {
499
       }).then(() => {
513
         setTimeout(() => {
500
         setTimeout(() => {
514
           uni.navigateTo({
501
           uni.navigateTo({
515
-            url: '/pages/user/login/index'
502
+            url: '/pages/user/login/index',
516
           })
503
           })
517
         }, 500)
504
         }, 500)
518
       })
505
       })
@@ -521,11 +508,9 @@ function handleBuyNow() {
521
     return {
508
     return {
522
       title: `${detail.value.store_name}`,
509
       title: `${detail.value.store_name}`,
523
       imageUrl: state.shareImage,
510
       imageUrl: state.shareImage,
524
-      query: `id=${state.id}&from=share&shareID=${state.shareId}`
511
+      query: `id=${state.id}&from=share&shareID=${state.shareId}`,
525
     }
512
     }
526
-
527
   })
513
   })
528
-
529
 }
514
 }
530
 
515
 
531
 /**
516
 /**
@@ -535,15 +520,15 @@ const hasCoupon = computed(() => {
535
   return detail.value?.coupon && detail.value?.coupon.startTime
520
   return detail.value?.coupon && detail.value?.coupon.startTime
536
 })
521
 })
537
 
522
 
538
-//跳转大仓商品详情
523
+// 跳转大仓商品详情
539
 function handleProductItemClick(
524
 function handleProductItemClick(
540
   item:
525
   item:
541
-    JdProductModel
542
-    & DcProductModel
543
-    & DyProductModel
544
-    & SuNingProductModel
545
-    & TaobaoProductThirdPartyWaresModel
546
-    & VipProductModel
526
+  JdProductModel
527
+  & DcProductModel
528
+  & DyProductModel
529
+  & SuNingProductModel
530
+  & TaobaoProductThirdPartyWaresModel
531
+  & VipProductModel,
547
 ) {
532
 ) {
548
   // function navigateToDetail(params) {
533
   // function navigateToDetail(params) {
549
   //   let otherDetailUrl = `/pages/store/product/other`
534
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -553,19 +538,17 @@ function handleProductItemClick(
553
   // }
538
   // }
554
   // 大仓
539
   // 大仓
555
   uni.navigateTo({
540
   uni.navigateTo({
556
-    url: `/pages/store/product/detail?id=${item.product_id}`
541
+    url: `/pages/store/product/detail?id=${item.product_id}`,
557
   })
542
   })
558
 }
543
 }
559
 
544
 
560
 const outImg = computed(() => {
545
 const outImg = computed(() => {
561
-  if (isShow) {
562
-    return CDM_URL + '/image/2023-11-24/20231124182002679.png'
563
-  }
564
-
546
+  if (isShow)
547
+    return `${CDM_URL}/image/2023-11-24/20231124182002679.png`
565
 })
548
 })
566
 
549
 
567
 // 距离顶部距离
550
 // 距离顶部距离
568
-let Scroll_X = ref(0)
551
+const Scroll_X = ref(0)
569
 
552
 
570
 const headerClass = ref('')
553
 const headerClass = ref('')
571
 onPageScroll((page) => {
554
 onPageScroll((page) => {
@@ -573,50 +556,47 @@ onPageScroll((page) => {
573
 
556
 
574
   // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
557
   // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
575
   Scroll_X.value = Number(page.scrollTop.toFixed())
558
   Scroll_X.value = Number(page.scrollTop.toFixed())
576
-  if (page.scrollTop >= 76) {
559
+  if (page.scrollTop >= 76)
577
     headerClass.value = 'bg-white !text-gray-900'
560
     headerClass.value = 'bg-white !text-gray-900'
578
-  } else {
561
+  else
579
     headerClass.value = ''
562
     headerClass.value = ''
580
-  }
581
 })
563
 })
582
 
564
 
583
-
584
-//列表加载
565
+// 列表加载
585
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
566
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
586
   const params = {
567
   const params = {
587
     page: skuInfo.currentPage,
568
     page: skuInfo.currentPage,
588
-    limit: skuInfo.pageSize
569
+    limit: skuInfo.pageSize,
589
   }
570
   }
590
 
571
 
591
-  if (action === 'reload') {
572
+  if (action === 'reload')
592
     params.page = 1
573
     params.page = 1
593
-  }
594
 
574
 
595
   getRecommendList({
575
   getRecommendList({
596
-    ...params
597
-  }).then(res => {
598
-    if (action === 'page') {
576
+    ...params,
577
+  }).then((res) => {
578
+    if (action === 'page')
599
       skuInfo.recommendList = skuInfo.recommendList.concat(res.list)
579
       skuInfo.recommendList = skuInfo.recommendList.concat(res.list)
600
-    }
580
+
601
     if (action === 'reload') {
581
     if (action === 'reload') {
602
       // state.list = state.list.concat(res.list)
582
       // state.list = state.list.concat(res.list)
603
       skuInfo.recommendList = res.list
583
       skuInfo.recommendList = res.list
604
     }
584
     }
605
-    skuInfo.totalPage = Math.ceil(res.count / skuInfo.pageSize);
585
+    skuInfo.totalPage = Math.ceil(res.count / skuInfo.pageSize)
606
     skuInfo.status = 'more'
586
     skuInfo.status = 'more'
607
-    if (callback) {
587
+    if (callback)
608
       callback(res.list)
588
       callback(res.list)
609
-    }
610
   })
589
   })
611
 }
590
 }
612
 
591
 
613
 function handleScrollToLower() {
592
 function handleScrollToLower() {
614
-  skuInfo.status = 'loading';
615
-  skuInfo.currentPage += 1;
593
+  skuInfo.status = 'loading'
594
+  skuInfo.currentPage += 1
616
   // console.log(state.totalPage)
595
   // console.log(state.totalPage)
617
   if (skuInfo.currentPage > skuInfo.totalPage) {
596
   if (skuInfo.currentPage > skuInfo.totalPage) {
618
-    skuInfo.status = 'noMore';
619
-  } else {
597
+    skuInfo.status = 'noMore'
598
+  }
599
+  else {
620
     setTimeout(() => {
600
     setTimeout(() => {
621
       loadList('page')
601
       loadList('page')
622
     }, 300)
602
     }, 300)
@@ -625,16 +605,16 @@ function handleScrollToLower() {
625
 
605
 
626
 onReachBottom(() => {
606
 onReachBottom(() => {
627
   handleScrollToLower()
607
   handleScrollToLower()
628
-
629
 })
608
 })
630
-
631
-
632
 </script>
609
 </script>
610
+
633
 <template>
611
 <template>
634
   <CXBBasePage>
612
   <CXBBasePage>
635
-    <div class="relative w-screen " v-if="detail">
636
-      <swiper v-if="detail.featured" :indicator-dots="false" :circular="true" :autoplay="true" :interval="5000"
637
-        :duration="500" class="h-95">
613
+    <div v-if="detail" class="relative w-screen ">
614
+      <swiper
615
+        v-if="detail.featured" :indicator-dots="false" :circular="true" :autoplay="true" :interval="5000"
616
+        :duration="500" class="h-95"
617
+      >
638
         <swiper-item v-for="(item, index) in detail.featured" :key="index">
618
         <swiper-item v-for="(item, index) in detail.featured" :key="index">
639
           <image :key="index" :src="item" mode="aspectFill" class="h-full w-full" />
619
           <image :key="index" :src="item" mode="aspectFill" class="h-full w-full" />
640
         </swiper-item>
620
         </swiper-item>
@@ -642,47 +622,60 @@ onReachBottom(() => {
642
       <div>
622
       <div>
643
         <div class="relative p-3 bg-white">
623
         <div class="relative p-3 bg-white">
644
           <div class="flex gap-2 items-end">
624
           <div class="flex gap-2 items-end">
645
-            <FPrice v-if="detail && detail.salePrice" :price="detail.salePrice" need-symbol :size="'large'"
646
-              ex-class="!text-[24px]" />
647
-            <FPrice v-if="detail && detail.price" :price="detail.price" :ex-class="'!text-gray'" need-symbol
648
-              strike-through />
625
+            <FPrice
626
+              v-if="detail && detail.salePrice" :price="detail.salePrice" need-symbol size="large"
627
+              ex-class="!text-[24px]"
628
+            />
629
+            <FPrice
630
+              v-if="detail && detail.price" :price="detail.price" ex-class="!text-gray" need-symbol
631
+              strike-through
632
+            />
649
           </div>
633
           </div>
650
 
634
 
651
-          <div class="font-bold py-2">{{ detail.title }}</div>
635
+          <div class="font-bold py-2">
636
+            {{ detail.title }}
637
+          </div>
652
         </div>
638
         </div>
653
 
639
 
654
-        <div class="relative" v-if="hasCoupon">
640
+        <div v-if="hasCoupon" class="relative">
655
           <div class="px-3 relative" @tap="handleBuyNow">
641
           <div class="px-3 relative" @tap="handleBuyNow">
656
-            <image lazy-load :src="discount_coupon_bg_220804Image" mode="widthFix" class="w-full"></image>
642
+            <image lazy-load :src="discount_coupon_bg_220804Image" mode="widthFix" class="w-full" />
657
             <div class="absolute top-2 left-15 h-full w-fit text-white">
643
             <div class="absolute top-2 left-15 h-full w-fit text-white">
658
               <div class=" inline-flex justify-center items-end w-full py-2">
644
               <div class=" inline-flex justify-center items-end w-full py-2">
659
-                <div class="text-[28px]">{{ detail.coupon.amount }}</div>
645
+                <div class="text-[28px]">
646
+                  {{ detail.coupon.amount }}
647
+                </div>
660
                 元代金劵
648
                 元代金劵
661
               </div>
649
               </div>
662
-              <div class="text-[10px]">使用期限:{{ detail.coupon.startTime }} -{{ detail.coupon.endTime }}</div>
650
+              <div class="text-[10px]">
651
+                使用期限:{{ detail.coupon.startTime }} -{{ detail.coupon.endTime }}
652
+              </div>
663
             </div>
653
             </div>
664
           </div>
654
           </div>
665
-
666
         </div>
655
         </div>
667
 
656
 
668
         <div class="relative pb-safe mt-3 bg-white">
657
         <div class="relative pb-safe mt-3 bg-white">
669
           <div v-if="detail.mallName" class="p-3 font-bold">
658
           <div v-if="detail.mallName" class="p-3 font-bold">
670
             {{ detail.mallName }}
659
             {{ detail.mallName }}
671
           </div>
660
           </div>
672
-          <!--          <mpHtml :content=""></mpHtml>-->
673
-          <image v-for="(imgItem, index) in detail.images" :key="index" mode="widthFix" :src="imgItem"
674
-            class="w-full h-full"></image>
661
+          <!--          <mpHtml :content=""></mpHtml> -->
662
+          <image
663
+            v-for="(imgItem, index) in detail.images" :key="index" mode="widthFix" :src="imgItem"
664
+            class="w-full h-full"
665
+          />
675
         </div>
666
         </div>
676
       </div>
667
       </div>
677
       <div class="fixed bottom-0  w-full h-15 shadow">
668
       <div class="fixed bottom-0  w-full h-15 shadow">
678
         <div class="w-full bg-white pb-safe">
669
         <div class="w-full bg-white pb-safe">
679
           <div class="flex justify-between items-center p-3">
670
           <div class="flex justify-between items-center p-3">
680
             <div class="inline-flex items-center">
671
             <div class="inline-flex items-center">
681
-              <div class="text-sm">预估养老金</div>
672
+              <div class="text-sm">
673
+                预估养老金
674
+              </div>
682
               <FPrice :price="detail.yanglao || detail.commission" need-symbol ex-class="text-[20px] font-bold" />
675
               <FPrice :price="detail.yanglao || detail.commission" need-symbol ex-class="text-[20px] font-bold" />
683
             </div>
676
             </div>
684
             <div>
677
             <div>
685
-              <nut-button type="primary" @tap="handleBuyNow" :disabled="isSubmit">
678
+              <nut-button type="primary" :disabled="isSubmit" @tap="handleBuyNow">
686
                 立即购买
679
                 立即购买
687
               </nut-button>
680
               </nut-button>
688
             </div>
681
             </div>
@@ -691,32 +684,32 @@ onReachBottom(() => {
691
       </div>
684
       </div>
692
     </div>
685
     </div>
693
     <!-- 商品下架展示 -->
686
     <!-- 商品下架展示 -->
694
-    <div class="relative w-screen " v-if="isShow">
695
-      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
687
+    <div v-if="isShow" class="relative w-screen ">
688
+      <CXBBackTop :Scroll_X="Scroll_X" :is-css="1" />
696
       <div class="box-out">
689
       <div class="box-out">
697
         <div class="flex-box pb-3 px-3 ">
690
         <div class="flex-box pb-3 px-3 ">
698
           <div class="img-div">
691
           <div class="img-div">
699
-            <image lazy-load :src="outImg" mode="widthFix" class=" top-0 right-0 sold-out ">
700
-            </image>
692
+            <image lazy-load :src="outImg" mode="widthFix" class=" top-0 right-0 sold-out " />
693
+          </div>
694
+          <div class="out-conter">
695
+            该商品下架不存在
701
           </div>
696
           </div>
702
-          <div class="out-conter">该商品下架不存在</div>
703
         </div>
697
         </div>
704
-
705
       </div>
698
       </div>
706
       <div class="flex flex-col pb-safe gap-3">
699
       <div class="flex flex-col pb-safe gap-3">
707
         <div class="p-3 bg-white">
700
         <div class="p-3 bg-white">
708
           <div
701
           <div
709
-            class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-600 before:rounded relative inline-block">
702
+            class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-600 before:rounded relative inline-block"
703
+          >
710
             <div class="pl-2">
704
             <div class="pl-2">
711
               精品推荐
705
               精品推荐
712
             </div>
706
             </div>
713
           </div>
707
           </div>
714
         </div>
708
         </div>
715
-        <div class="pb-3 px-3" v-if="skuInfo.recommendList.length != 0">
709
+        <div v-if="skuInfo.recommendList.length != 0" class="pb-3 px-3">
716
           <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
710
           <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
717
             <div v-for="(item, index) in skuInfo.recommendList" :key="index" @click="handleProductItemClick(item)">
711
             <div v-for="(item, index) in skuInfo.recommendList" :key="index" @click="handleProductItemClick(item)">
718
               <MerchantProductCard :item="item" />
712
               <MerchantProductCard :item="item" />
719
-
720
             </div>
713
             </div>
721
           </grid-view>
714
           </grid-view>
722
           <div class=" flex justify-center items-center text-[12px] text-gray-500">
715
           <div class=" flex justify-center items-center text-[12px] text-gray-500">
@@ -728,12 +721,11 @@ onReachBottom(() => {
728
             </div>
721
             </div>
729
           </div>
722
           </div>
730
         </div>
723
         </div>
731
-
732
       </div>
724
       </div>
733
     </div>
725
     </div>
734
-
735
   </CXBBasePage>
726
   </CXBBasePage>
736
 </template>
727
 </template>
728
+
737
 <style scoped>
729
 <style scoped>
738
 .box-out {
730
 .box-out {
739
   background: #f8f8f8;
731
   background: #f8f8f8;
@@ -765,8 +757,9 @@ onReachBottom(() => {
765
   text-align: center;
757
   text-align: center;
766
 }
758
 }
767
 </style>
759
 </style>
760
+
768
 <route lang="yaml">
761
 <route lang="yaml">
769
 style:
762
 style:
770
   navigationBarTitleText: 商品详情
763
   navigationBarTitleText: 商品详情
771
   enablePullDownRefresh: true
764
   enablePullDownRefresh: true
772
-</route>
765
+</route>

+ 98 - 53
src/pages/user/index.vue

@@ -91,7 +91,7 @@ const myServiceList = [{
91
   url: '/pages/invite-friends/index'
91
   url: '/pages/invite-friends/index'
92
 }, {
92
 }, {
93
   icon: CDN_URL + '/static/assets/dianpuruzhu_220620.png',
93
   icon: CDN_URL + '/static/assets/dianpuruzhu_220620.png',
94
-  text: userStore.userInfo?.is_merchant=="-1"?'商铺入驻':'我的商铺',
94
+  text: userStore.userInfo?.is_merchant=="-1"?'商铺入驻':'我的店铺',
95
   url: ''
95
   url: ''
96
 }, {
96
 }, {
97
   icon: CDN_URL + '/static/assets/mine_setting_220620.png',
97
   icon: CDN_URL + '/static/assets/mine_setting_220620.png',
@@ -124,38 +124,36 @@ onShow(async () => {
124
   // pageStore.setPageConfig({
124
   // pageStore.setPageConfig({
125
   //   orderBack: null
125
   //   orderBack: null
126
   // })
126
   // })
127
-  uni.showLoading({
128
-    title: '登录中',
129
-  })
127
+  // uni.showLoading({
128
+  //   title: '登录中',
129
+  // })
130
   // if (userStore.token ? )
130
   // if (userStore.token ? )
131
+  
131
   if (uni.getStorageSync('UID')) {
132
   if (uni.getStorageSync('UID')) {
132
     state.isLogin = true
133
     state.isLogin = true
133
-    // getUserInfo().then(userInfoResult => {
134
-    //   userStore.setUserInfo(userInfoResult)
135
-    // })
136
     uni.hideLoading()
134
     uni.hideLoading()
137
     await userStore.getUserInfo()
135
     await userStore.getUserInfo()
138
     await userStore.getUserYanglaoJin()
136
     await userStore.getUserYanglaoJin()
139
     agentInfo.value = await getAgentInfo()
137
     agentInfo.value = await getAgentInfo()
140
-    // console.log(agentInfo)
141
-    // await   loadProductDetail()
142
-    //
143
-    // getAgentInfo().then(res => {
144
-    //   console.log(res)
145
-    // })
146
-
147
-  } else {
148
-    uni.navigateTo({
149
-      url: '/pages/user/login/index?key=3'
150
-    })
151
-    userStore.setUserInfo(null)
152
   }
138
   }
153
-
154
   totalOrderNumber().then(res => {
139
   totalOrderNumber().then(res => {
155
-    // console.log(res)
156
     orderQuantity.value = res
140
     orderQuantity.value = res
157
-    // orderQuantity
158
   })
141
   })
142
+  
143
+  
144
+  // if (uni.getStorageSync('UID')) {
145
+  //   state.isLogin = true
146
+  //   uni.hideLoading()
147
+  //   await userStore.getUserInfo()
148
+  //   await userStore.getUserYanglaoJin()
149
+  //   agentInfo.value = await getAgentInfo()
150
+  // } else {
151
+  //   uni.navigateTo({
152
+  //     url: '/pages/user/login/index?key=3'
153
+  //   })
154
+  //   userStore.setUserInfo(null)
155
+  // }
156
+  
159
 })
157
 })
160
 
158
 
161
 function checkAuth() {
159
 function checkAuth() {
@@ -181,23 +179,57 @@ function handleService(item: {
181
   text: string
179
   text: string
182
   url: string
180
   url: string
183
 }) {
181
 }) {
184
-  if (item.text === '商铺入驻'||item.text === '我的店铺') {
185
-    return uni.navigateToMiniProgram({
186
-      appId: 'wx9a3e4ab07f8a9ba2',
187
-      path: 'pages/index/index',
188
-      success(res) {
189
-        // 打开成功
190
-        // console.log(res);
191
-      },
192
-      fail: (error) => {
193
-        console.log(error);
194
-      }
195
-    })
196
-  }
197
-  // if (item.text === '我的地址') {
198
-  uni.navigateTo({
199
-    url: item.url
200
-  })
182
+	
183
+	if (uni.getStorageSync('UID')) {
184
+		console.log('进来了1');
185
+		console.log(item.text);
186
+			
187
+		if (item.text === '商铺入驻'||item.text === '我的店铺') {
188
+			  
189
+			console.log('进来了2');
190
+			  
191
+			return uni.navigateToMiniProgram({
192
+				appId: 'wx9a3e4ab07f8a9ba2',
193
+				path: 'pages/index/index',
194
+				success(res) {
195
+				// 打开成功
196
+				console.log(res);
197
+				},
198
+				fail: (error) => {
199
+				console.log('error = ', error);
200
+				}
201
+			})
202
+		}
203
+		
204
+		uni.navigateTo({
205
+		  url: item.url
206
+		})
207
+	} else {
208
+		
209
+		if (item.text === '商铺入驻'||item.text === '我的店铺') {
210
+			return uni.navigateToMiniProgram({
211
+			  	appId: 'wx9a3e4ab07f8a9ba2',
212
+			  	path: 'pages/index/index',
213
+			  	success(res) {
214
+			  	// 打开成功
215
+			  	console.log(res);
216
+			  	},
217
+			  	fail: (error) => {
218
+			  	console.log('error = ', error);
219
+			  	}
220
+			})
221
+		
222
+		} else if (item.text === '设置') {
223
+			uni.navigateTo({
224
+			  url: item.url
225
+			})
226
+		} else {
227
+			uni.navigateTo({
228
+				url: '/pages/user/login/index?key=3'
229
+			})
230
+			userStore.setUserInfo(null)
231
+		}
232
+	}
201
 }
233
 }
202
 
234
 
203
 
235
 
@@ -226,6 +258,7 @@ function handleShowMyIntegral() {
226
 }
258
 }
227
 
259
 
228
 function handleShowMyAllOrder(tab?: number) {
260
 function handleShowMyAllOrder(tab?: number) {
261
+	
229
   if (tab <= 4) {
262
   if (tab <= 4) {
230
     uni.navigateTo({
263
     uni.navigateTo({
231
       url: '/pages/order/index?tabIndex=' + tab
264
       url: '/pages/order/index?tabIndex=' + tab
@@ -352,24 +385,36 @@ function handleToRedIntegral() {
352
 }
385
 }
353
 
386
 
354
 function handleToContact(item) {
387
 function handleToContact(item) {
388
+	
389
+	
390
+	
355
   if (item.type === 'link') {
391
   if (item.type === 'link') {
356
     return uni.navigateTo({
392
     return uni.navigateTo({
357
       url: item.url
393
       url: item.url
358
     })
394
     })
359
   }
395
   }
396
+  
360
   if (item.type === 'customer') {
397
   if (item.type === 'customer') {
361
-    return uni.openCustomerServiceChat({
362
-      extInfo: {
363
-        url: 'https://work.weixin.qq.com/kfid/kfc8bd3f11a28aa81db'
364
-      },
365
-      corpId: 'wwaeb55681929a37ae',
366
-      success: (res => {
367
-        console.log(res)
368
-      }),
369
-      fail: (res => {
370
-        console.log(res)
371
-      })
372
-    })
398
+	  
399
+	  if (uni.getStorageSync('UID')) {
400
+		  return uni.openCustomerServiceChat({
401
+		    extInfo: {
402
+		      url: 'https://work.weixin.qq.com/kfid/kfc8bd3f11a28aa81db'
403
+		    },
404
+		    corpId: 'wwaeb55681929a37ae',
405
+		    success: (res => {
406
+		      console.log(res)
407
+		    }),
408
+		    fail: (res => {
409
+		      console.log(res)
410
+		    })
411
+		  })
412
+	  } else {
413
+		  uni.navigateTo({
414
+		  	url: '/pages/user/login/index?key=3'
415
+		  })
416
+		  userStore.setUserInfo(null)
417
+	  }
373
   }
418
   }
374
 }
419
 }
375
 
420
 
@@ -386,7 +431,7 @@ function handleShowMyRulePage() {
386
 }
431
 }
387
 </script>
432
 </script>
388
 <template>
433
 <template>
389
-  <div v-if="state.isLogin" class="pb-safe">
434
+  <div  class="pb-safe">
390
     <div class="bg-[#FD1642] h-40 w-full absolute top-0 left-0"></div>
435
     <div class="bg-[#FD1642] h-40 w-full absolute top-0 left-0"></div>
391
     <div class="flex flex-col gap-4 relative px-3 pb-safe">
436
     <div class="flex flex-col gap-4 relative px-3 pb-safe">
392
       <div class="pt-15 ">
437
       <div class="pt-15 ">
@@ -457,7 +502,7 @@ function handleShowMyRulePage() {
457
           </FPopup>
502
           </FPopup>
458
 
503
 
459
         </div>
504
         </div>
460
-        <div style="border-radius: 16rpx;" class="bg-white flex flex-col gap-6 py-4 text-xl">
505
+        <div v-if="state.isLogin" style="border-radius: 16rpx;" class="bg-white flex flex-col gap-6 py-4 text-xl">
461
           <div v-if="userStore.userInfo" class="flex ">
506
           <div v-if="userStore.userInfo" class="flex ">
462
             <div @tap="handleShowAnnuityDetail" class="w-1/2 flex flex-col justify-center" style="padding-left: 48rpx;">
507
             <div @tap="handleShowAnnuityDetail" class="w-1/2 flex flex-col justify-center" style="padding-left: 48rpx;">
463
               <div class="text-xs">养老金</div>
508
               <div class="text-xs">养老金</div>

+ 80 - 14
src/pages/user/login/index.vue

@@ -17,7 +17,8 @@ const userStore = useUserStore()
17
 const state = reactive({
17
 const state = reactive({
18
   qrcode: '',
18
   qrcode: '',
19
   uid: '',
19
   uid: '',
20
-  key: ''
20
+  key: '',
21
+  isShow: false
21
 })
22
 })
22
 onLoad((option: any) => {
23
 onLoad((option: any) => {
23
   state.qrcode = option.type
24
   state.qrcode = option.type
@@ -28,6 +29,14 @@ onLoad((option: any) => {
28
 
29
 
29
 function getPhoneNumber(e) {
30
 function getPhoneNumber(e) {
30
   // console.log(e)
31
   // console.log(e)
32
+  console.log('2')
33
+  if (!state.isShow) {
34
+  	return 	uni.showToast({
35
+  				title: '请阅读并勾选隐私协议',
36
+  				icon: 'none'
37
+  			})
38
+  }
39
+  
31
   if (e.detail.errMsg === 'getPhoneNumber:ok') {
40
   if (e.detail.errMsg === 'getPhoneNumber:ok') {
32
 
41
 
33
   }
42
   }
@@ -40,6 +49,14 @@ function handleViewXieyi(type: number) {
40
 }
49
 }
41
 
50
 
42
 async function handleWexinLogin() {
51
 async function handleWexinLogin() {
52
+	
53
+	if (!state.isShow) {
54
+		return 	uni.showToast({
55
+					title: '请阅读并勾选隐私协议',
56
+					icon: 'none'
57
+				})
58
+	}
59
+	
43
   await uni.showLoading({
60
   await uni.showLoading({
44
     title: '登录中'
61
     title: '登录中'
45
   });
62
   });
@@ -188,6 +205,34 @@ function onClickLeft() {
188
   // })
205
   // })
189
 
206
 
190
 }
207
 }
208
+
209
+function gou() {
210
+	state.isShow = !state.isShow
211
+}
212
+
213
+function otherPhoneLogin() {
214
+	
215
+	if (!state.isShow) {
216
+		return 	uni.showToast({
217
+					title: '请阅读并勾选隐私协议',
218
+					icon: 'none'
219
+				})
220
+	}
221
+	
222
+	uni.navigateTo({
223
+		url: '/pages/user/login/other-phone'
224
+	})
225
+}
226
+
227
+function phoneQuicklyLogin() {
228
+	if (!state.isShow) {
229
+		return 	uni.showToast({
230
+					title: '请阅读并勾选隐私协议',
231
+					icon: 'none'
232
+				})
233
+	}
234
+}
235
+
191
 </script>
236
 </script>
192
 <template>
237
 <template>
193
   <div>
238
   <div>
@@ -211,24 +256,41 @@ function onClickLeft() {
211
         <div>一键登录</div>
256
         <div>一键登录</div>
212
       </div>
257
       </div>
213
 
258
 
214
-      <CXBPhoneLoginButton :text="'手机号快捷登录'"/>
215
-<!--      <div class="text-xs text-gray flex flex-col justify-center items-center">-->
216
-<!--        <div>-->
217
-<!--          登录代表您同意<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span-->
218
-<!--            class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>-->
219
-<!--        </div>-->
220
-<!--      </div>-->
221
-      <navigator url="/pages/user/login/other-phone"
222
-          class="bg-white rounded-md py-3 gap-2 flex justify-center items-center text-sm">
223
-        <div>其他手机号登录</div>
224
-      </navigator>
259
+      
260
+	  <div v-if="state.isShow">
261
+		<CXBPhoneLoginButton :text="'手机号快捷登录'"/>
262
+	  </div>
263
+	  <div v-else>
264
+	  	<div
265
+	  	  class="bg-white border border-solid border-1 border-gray-300 rounded-md py-3 gap-2 flex justify-center items-center" @click="phoneQuicklyLogin">
266
+	  	  <image src="https://test.bjtdba.com/applet/static/home/4879edf0b6e2b0ad29fa7d4053d676b.png" mode="widthFix"
267
+	  	    class="w-4 h-4"></image>
268
+	  	  <button>手机号快捷登录</button>
269
+	  	</div>
270
+	  </div> 
271
+    
272
+	<div class="bg-white rounded-md py-3 gap-2 flex justify-center items-center text-sm" @click="otherPhoneLogin" >其他手机号登录</div>
273
+      
225
     </div>
274
     </div>
226
 	
275
 	
227
 	<div class="bg-white rounded-md py-3 gap-2 flex justify-center items-center text-sm" @click="onClickLeft">
276
 	<div class="bg-white rounded-md py-3 gap-2 flex justify-center items-center text-sm" @click="onClickLeft">
228
 	  <div>暂不登录</div>
277
 	  <div>暂不登录</div>
229
 	</div>
278
 	</div>
230
-    <CXBNotLoginButton :key="state.key"/>
231
-
279
+	<CXBNotLoginButton :key="state.key"/>
280
+	<view class="bottom-index flex flex-row justify-center items-center">
281
+		<view class="bottom-index-in mr-2">
282
+			<image src="https://cdn.bjtdba.com/vod/image/2024-02-29/20240229180900986.png"  style="width: 28rpx; height: 28rpx;" v-if="state.isShow"
283
+					@click="gou" mode="widthFix"></image>
284
+			<image src="https://cdn.bjtdba.com/vod/image/2024-02-29/20240229180930865.png"  style="width: 28rpx; height: 28rpx;" v-else
285
+				@click="gou" mode="widthFix"></image>
286
+		</view>
287
+		<view class="bottom-index-ri text-xs">
288
+			<span class="text-xs">我已经阅读并同意</span>
289
+				<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span
290
+	     class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>
291
+		</view>
292
+	
293
+	</view>
232
   </div>
294
   </div>
233
 
295
 
234
 </template>
296
 </template>
@@ -248,6 +310,10 @@ button {
248
   line-height: inherit;
310
   line-height: inherit;
249
 }
311
 }
250
 
312
 
313
+.bottom-index-in {
314
+	margin-top: 2rpx;
315
+}
316
+
251
 button::after {
317
 button::after {
252
   border: none;
318
   border: none;
253
 }
319
 }