李战雷 2 lat temu
rodzic
commit
29f233d3ee

+ 1 - 1
pages.config.ts

@@ -9,7 +9,7 @@ export default defineUniPages({
9 9
     // Gray3
10 10
     color: '#828282',
11 11
     // Gray1
12
-    selectedColor: '#333333',
12
+    selectedColor: '#FE0032',
13 13
     backgroundColor: '#FFFFFF',
14 14
     list: [{
15 15
       pagePath: 'pages/home/index',

+ 1 - 1
src/apis/product.ts

@@ -301,7 +301,7 @@ export function getPddProductDetail(goodsId: string): Promise<PDDProductDetailMo
301 301
  * @param params
302 302
  */
303 303
 export function searchPddProduct(params: ProductParams): Promise<Array<PDDProductModel>> {
304
-    return defHttp.get({
304
+    return detailHttp.get({
305 305
         url: API.PDD_SEARCH,
306 306
         data: {
307 307
             ...params

Plik diff jest za duży
+ 1 - 1
src/pages.json


+ 18 - 3
src/pages/home/components/navs.vue

@@ -101,9 +101,24 @@ function handleItemClick(item: any) {
101 101
     }
102 102
     // 会员专区
103 103
     case 'user': {
104
-      uni.navigateTo({
105
-        url: `/pages/vip/index?type=`+item.key
106
-      })
104
+      // uni.navigateTo({
105
+      //   url: `/pages/vip/index?type=`+item.key
106
+      // })
107
+	  
108
+	  uni.navigateToMiniProgram({
109
+	      appId: 'wx82986c4471ce7efc',
110
+	      path: 'pages/home/index',
111
+	  	  envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
112
+	      success(res) {
113
+	        // 打开成功
114
+	        console.log(res);
115
+	      },
116
+	      fail: (error) => {
117
+	        console.log(error);
118
+	      }
119
+	    })
120
+	  
121
+	  
107 122
       break;
108 123
     }
109 124
     // 秒杀

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

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

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

@@ -102,8 +102,8 @@ function handleConfirm() {
102 102
       OrderLists: state.orderList,
103 103
       type: 'tdbaspzf'
104 104
     },
105
-    envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
106
-    // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
105
+    // envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
106
+    envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
107 107
     success(res) {
108 108
       // 打开成功
109 109
       uni.showToast({

+ 6 - 1
src/pages/real-name-authentication/index.vue

@@ -190,7 +190,7 @@ function handleSubmit () {
190 190
     const certificationRequest: CertificationRequest = {
191 191
       user_name: formData.user_name,
192 192
       user_card: formData.user_card,
193
-      // mobile: formData.mobile,
193
+      mobile: userStore.userInfo.phone,
194 194
       card_positive: formData.card_positive,
195 195
       card_reverse: formData.card_reverse
196 196
     }
@@ -203,6 +203,11 @@ function handleSubmit () {
203 203
         formData.user_name = res.user_name
204 204
       }
205 205
       state.isLoading = false
206
+	  state.isCertified = true
207
+	  
208
+	  userStore.getUserInfo()
209
+	  
210
+	  
206 211
     }).catch(error => {
207 212
       uni.showToast({
208 213
         title: error,

+ 75 - 16
src/pages/search/index.vue

@@ -140,8 +140,34 @@ function searchProduct() {
140 140
     }
141 141
     case PLATFORM_NAME.PDD: {
142 142
       searchPddProduct({ keyword: searchValue.value, page: 1, limit: 10}).then(res => {
143
-        if(res.we_app_info){
144
-          const pddWx = res.we_app_info
143
+		  
144
+		  
145
+		  console.log('11111111111')
146
+		  console.log(res)
147
+		  
148
+		  let pddData
149
+		  
150
+		  if (res.message.length > 20) {
151
+			  pddData = JSON.parse(res.message)
152
+		  }
153
+		  console.log('11111111112')
154
+		  
155
+		  console.log(pddData)
156
+		  
157
+		  if(pddData) {
158
+			  console.log('122222222')
159
+			modalVisible.value = true
160
+			pddPath.value = pddData.we_app_info.page_path
161
+			return
162
+		  }else {
163
+			  
164
+			  console.log('1222223333')
165
+			  console.log(res.data)
166
+			list.value = res.data
167
+		  }
168
+		  
169
+        if(res.data.we_app_info){
170
+          const pddWx = res.data.we_app_info
145 171
           console.log(pddWx)
146 172
           if (pddWx) {
147 173
             uni.navigateToMiniProgram({
@@ -162,7 +188,7 @@ function searchProduct() {
162 188
             })
163 189
           }
164 190
         }else{
165
-          list.value = res
191
+          list.value = res.data
166 192
         }
167 193
 
168 194
       })
@@ -251,14 +277,14 @@ function loadProductList(action: 'page' | 'reload', callback?: (items) => void)
251 277
       break;
252 278
     }
253 279
     case PLATFORM_NAME.DY: {
254
-      getDyLiveList({
255
-        page: state.currentPage,
256
-        limit: 4,
257
-        // keyword: ''
258
-      }).then(res => {
259
-        // console.log(res)
260
-        // console.log(res.authorPic)
261
-      })
280
+      // getDyLiveList({
281
+      //   page: state.currentPage,
282
+      //   limit: 4,
283
+      //   // keyword: ''
284
+      // }).then(res => {
285
+      //   // console.log(res)
286
+      //   // console.log(res.authorPic)
287
+      // })
262 288
       getDyLiveList({page: 1,limit: 4})
263 289
           .then(res => {
264 290
             // console.log(res)
@@ -609,8 +635,31 @@ function handleScrollToLower() {
609 635
 
610 636
 onReachBottom(() => {
611 637
   handleScrollToLower()
612
-
613 638
 })
639
+
640
+const modalVisible = ref(false)
641
+const pddPath = ref('')
642
+
643
+function onCancel() {
644
+  modalVisible.value = false
645
+}
646
+
647
+function onOk() {
648
+	uni.navigateToMiniProgram({
649
+	  appId: 'wxa918198f16869201',
650
+	  path: pddPath.value,
651
+	  envVersion: 'release',
652
+	  success(res) {
653
+	    // 打开成功
654
+	    // console.log(res);
655
+	  },
656
+	  fail: (error) => {
657
+	    console.log(error);
658
+	  }
659
+	})
660
+}
661
+
662
+
614 663
 </script>
615 664
 <template>
616 665
 
@@ -764,11 +813,21 @@ onReachBottom(() => {
764 813
         </div>
765 814
       </div>
766 815
 
816
+		
817
+		
767 818
     </div>
768
-  <div class="pt-36 flex flex-col justify-center items-center" v-else>
769
-    <CXBEmpty ></CXBEmpty>
770
-
771
-  </div>
819
+	
820
+	<div class="pt-36 flex flex-col justify-center items-center" v-else>
821
+		<CXBEmpty ></CXBEmpty>
822
+	</div>
823
+  
824
+	<nut-dialog
825
+		title="需要去拼多多授权"
826
+		v-model:visible="modalVisible"
827
+		@cancel="onCancel"
828
+		@ok="onOk"
829
+	/>
830
+  
772 831
 
773 832
 </template>
774 833
 

+ 19 - 8
src/pages/store/nearby/index.vue

@@ -4,7 +4,7 @@ import type { StoreResult } from "~/apis/model/storeModel";
4 4
 import { StoreParams } from "~/apis/model/storeModel";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6 6
 import { USER_LATITUDE, USER_LONGITUDE } from "~/constants";
7
-import { getProductShare } from "~/apis/common";
7
+import { getProductShare, getLocal } from "~/apis/common";
8 8
 import { useUserStore } from "~/stores/userStore";
9 9
 import Cache from "~/utils/cache";
10 10
 const usePageStore = usePageStoreWidthOut()
@@ -57,6 +57,9 @@ const { windowHeight } = uni.getSystemInfoSync()
57 57
 state.scrollHeight = windowHeight - 45
58 58
 
59 59
 onLoad((option) => {
60
+	
61
+	getLocal()
62
+	
60 63
   if (option && option.shareId) {
61 64
     userStore.setShareId(option.shareId)
62 65
   }
@@ -143,13 +146,21 @@ function loadSelectMerchant(action: 'page' | 'reload', callback?: (items) => voi
143 146
       category_id: state.category_id
144 147
     })
145 148
   }
146
-  if (state.menuDefaultValue === 2) {
147
-    params = Object.assign({}, params, {
148
-      distanceAsc: 0,
149
-      lat: uni.getStorageSync(USER_LATITUDE),
150
-      lng: uni.getStorageSync(USER_LONGITUDE)
151
-    })
149
+  
150
+  if (uni.getStorageSync(USER_LATITUDE)) {
151
+	  params = Object.assign({}, params, {
152
+	    distanceAsc: 0,
153
+	    lat: uni.getStorageSync(USER_LATITUDE),
154
+	    lng: uni.getStorageSync(USER_LONGITUDE)
155
+	  })
152 156
   }
157
+  // if (state.menuDefaultValue === 2) {
158
+  //   params = Object.assign({}, params, {
159
+  //     distanceAsc: 0,
160
+  //     lat: uni.getStorageSync(USER_LATITUDE),
161
+  //     lng: uni.getStorageSync(USER_LONGITUDE)
162
+  //   })
163
+  // }
153 164
 
154 165
   getSelectMerchant(params).then((res: StoreResult) => {
155 166
     // console.log(state.triggered)
@@ -324,7 +335,7 @@ watch(() => state.scrollTop, () => {
324 335
                 </div>
325 336
               </div>
326 337
 
327
-              <div class="text-xs">{{ (item.distance / 100).toFixed(1) }}km</div>
338
+              <div class="text-xs">{{ (item.distance).toFixed(1) }}km</div>
328 339
             </div>
329 340
 
330 341
           </div>

+ 0 - 36
src/pagesC/goods_details/index.vue

@@ -1,36 +0,0 @@
1
-<script setup lang="ts">
2
-onLoad((option) => {
3
-  if (option && option.id) {
4
-    uni.redirectTo({
5
-      url: `/pages/store/product/detail?id=${option.id}&shareID=${option.shareID}`
6
-    })
7
-  } else {
8
-    uni.switchTab({
9
-      url: '/page/home/index'
10
-    })
11
-  }
12
-})
13
-</script>
14
-
15
-<style>
16
-page {
17
-  background-color: #f8f8f8;
18
-}
19
-button {
20
-  margin: 0;
21
-  padding: 0;
22
-  outline: none;
23
-  border-radius: 0;
24
-  background-color: transparent;
25
-  line-height: inherit;
26
-}
27
-
28
-button::after {
29
-  border: none;
30
-}
31
-
32
-</style>
33
-<route lang="yaml">
34
-style:
35
-  navigationBarTitleText: 商品详情
36
-</route>

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

@@ -80,7 +80,7 @@ export class vRequest {
80 80
                 method: configTemp.method?.toUpperCase() as UniApp.RequestOptions['method'],
81 81
                 header: configTemp.header || {},
82 82
                 success: (res) => {
83
-                    // console.log('我是商品res啊', res);
83
+                    console.log('我是商品res啊', res);
84 84
 
85 85
                     resolve(res.data as any)
86 86
 

+ 0 - 1
vite.config.ts

@@ -37,7 +37,6 @@ export default defineConfig({
37 37
         UniPages({
38 38
             routeBlockLang: 'yaml',
39 39
             minify: true,
40
-            subPackages: ['src/pagesC']
41 40
         }),
42 41
         UnoCSS(),
43 42
         // https://github.com/antfu/unplugin-auto-import