Browse Source

手机号违规整改

李战雷 2 years ago
parent
commit
325e06ba4e

+ 16 - 0
src/apis/product.ts

@@ -24,6 +24,8 @@ enum API {
24 24
     PRODUCT_SHARE = '/api/product_share',
25 25
     // 京东商品详情
26 26
     JD_DETAIL = '/api/jd/detail',
27
+	// 未登录京东商品详情
28
+	JTT_DETAIL = '/api/jtt/detail',
27 29
     // 京东商品列表
28 30
     JD_LIST = '/api/jd/list',
29 31
     // 京东商品列表搜索
@@ -145,6 +147,20 @@ export  function getJdProductDetail(skuId: string): Promise<JdgProductDetailMode
145 147
 }
146 148
 
147 149
 /**
150
+ * 未登录获取京东商品详情
151
+ * @param skuId
152
+ */
153
+export  function getJTTProductDetail(skuId: string, type: string): Promise<JdgProductDetailModel> {
154
+    return detailHttp.get({
155
+        url: API.JTT_DETAIL,
156
+        data: {
157
+            skuId,
158
+			type
159
+        }
160
+    })
161
+}
162
+
163
+/**
148 164
  * 京东商品列表
149 165
  * @param params
150 166
  */

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

@@ -56,7 +56,6 @@ function handleClick() {
56 56
     })
57 57
   }
58 58
 }
59
-
60 59
 // function handleShowSearchPage() {
61 60
 //
62 61
 // }

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

@@ -14,7 +14,7 @@ const navList = ref([{
14 14
   key: 'miaosha'
15 15
 },{
16 16
   image: CDM_URL + '/image/2023-11-30/20231130092625318.png',
17
-  title: '会员专区',
17
+  title: '一壶茶',
18 18
   key: 'user',
19 19
 },{
20 20
   image: '',
@@ -108,7 +108,7 @@ function handleItemClick(item: any) {
108 108
 	  uni.navigateToMiniProgram({
109 109
 	      appId: 'wx82986c4471ce7efc',
110 110
 	      path: 'pages/home/index',
111
-	  	  envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
111
+	  	  envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
112 112
 	      success(res) {
113 113
 	        // 打开成功
114 114
 	        console.log(res);

+ 6 - 6
src/pages/miaosha/index.vue

@@ -47,13 +47,13 @@ const state = reactive({
47 47
 
48 48
 onLoad((options) => {
49 49
   if (options.type_show == 1) {
50
-    if (!userStore.uid) {
51
-      userStore.setRedirectPage(`/pages/miaosha/index`, 'page')
52
-      return uni.redirectTo({
53
-        url: '/pages/user/login/index?key=4'
54
-      })
50
+    // if (!userStore.uid) {
51
+    //   userStore.setRedirectPage(`/pages/miaosha/index`, 'page')
52
+    //   return uni.redirectTo({
53
+    //     url: '/pages/user/login/index?key=4'
54
+    //   })
55 55
 
56
-    }
56
+    // }
57 57
     loadList('reload')
58 58
   } else {
59 59
     loadList('reload')

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

@@ -436,6 +436,7 @@ console.log(5);
436 436
 console.log("5");
437 437
 
438 438
 console.log(item.type);
439
+console.log(state.currentTab);
439 440
 
440 441
   function navigateToDetail(params) {
441 442
     let otherDetailUrl = `/pages/store/product/other`
@@ -443,12 +444,24 @@ console.log(item.type);
443 444
       url: `${otherDetailUrl}?params=${params}`
444 445
     })
445 446
   }
447
+  
448
+  let itemType = 0
449
+  if (typeof item.type === 'string') {
450
+	  itemType = parseInt(item.type)
451
+  } else {
452
+	  itemType = item.type
453
+  }
454
+  
446 455
   // 大仓
447
-  if (state.currentTab === PLATFORM_NAME.DC && item.type === 5) {
456
+  if (state.currentTab === PLATFORM_NAME.DC && itemType === 5) {
457
+	  
458
+	  console.log('进来了', state.currentTab);
459
+	  
448 460
     uni.navigateTo({
449 461
       url: `/pages/store/product/detail?id=${item.product_id}`
450 462
     })
451 463
   }
464
+  
452 465
   // 京东
453 466
   if (item.type === 6) {
454 467
     // productParams.id = item.skuId

+ 27 - 22
src/pages/store/product/detail.vue

@@ -228,35 +228,40 @@ onShareAppMessage(async () => {
228 228
       }
229 229
     }
230 230
   }).catch(error => {
231
-    uni.showToast({
232
-      title: '请登录后分享',
233
-      icon: 'none'
234
-    }).then(() => {
235
-      setTimeout(() => {
236
-        uni.navigateTo({
237
-          url: '/pages/user/login/index'
238
-        })
239
-      }, 500)
240
-    })
231
+    // uni.showToast({
232
+    //   title: '请登录后分享',
233
+    //   icon: 'none'
234
+    // }).then(() => {
235
+    //   setTimeout(() => {
236
+    //     uni.navigateTo({
237
+    //       url: '/pages/user/login/index'
238
+    //     })
239
+    //   }, 500)
240
+    // })
241 241
     uni.hideLoading()
242
+	return {
243
+		title: `${detail.value.store_name}`,
244
+		imageUrl: detail.value.image,
245
+		path: `pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`
246
+	}
242 247
   })
243 248
 
244 249
 })
245 250
 
246 251
 onShareTimeline(() => {
247 252
 
248
-  if (!userStore.uid) {
249
-    return uni.showToast({
250
-      title: '请登录后分享',
251
-      icon: 'none'
252
-    }).then(() => {
253
-      setTimeout(() => {
254
-        uni.navigateTo({
255
-          url: '/pages/user/login/index'
256
-        })
257
-      }, 500)
258
-    })
259
-  }
253
+  // if (!userStore.uid) {
254
+  //   return uni.showToast({
255
+  //     title: '请登录后分享',
256
+  //     icon: 'none'
257
+  //   }).then(() => {
258
+  //     setTimeout(() => {
259
+  //       uni.navigateTo({
260
+  //         url: '/pages/user/login/index'
261
+  //       })
262
+  //     }, 500)
263
+  //   })
264
+  // }
260 265
 
261 266
   return {
262 267
     title: `${detail.value.store_name}`,

+ 84 - 28
src/pages/store/product/other.vue

@@ -3,7 +3,9 @@
3 3
 import {
4 4
   getDyProductDetail,
5 5
   getJdProductDetail,
6
-  getPddProductDetail, getShareId,
6
+  getJTTProductDetail,
7
+  getPddProductDetail, 
8
+  getShareId,
7 9
   getSuProductDetail,
8 10
   getTaobaoProductDetail,
9 11
   getVipProductDetail
@@ -14,6 +16,7 @@ import type {
14 16
   DyProductModel,
15 17
   IProductDetail,
16 18
   JdProductDetailModel,
19
+  
17 20
   JdProductModel,
18 21
   SuNingProductModel,
19 22
   TaobaoProductThirdPartyWaresModel,
@@ -66,14 +69,17 @@ const props = defineProps({
66 69
 
67 70
 const state = reactive({
68 71
   data: {},
69
-  shareId: ''
72
+  shareId: '',
73
+  pddData: {}
70 74
 })
71 75
 const isShow = ref(false)
72 76
 const detail = ref<IProductDetail>()
73 77
 const detailclone = ref<IProductDetail>()
78
+const isNeedAuth = ref(false)
74 79
 onLoad((options: any) => {
75 80
 
76 81
   const data: Partial<IProductDetail> = JSON.parse(decodeBase64(options.params))
82
+  state.pddData = data
77 83
   // console.log('我是options数据', data)  url: `/pages/store/product/other?platform=${item.type}&id=${item.id}`
78 84
   userStore.setRedirectPage(`/pages/store/product/other?params=${encodeBase64(data)}`, 'page')
79 85
   // if (options.platform && options.id) {
@@ -88,6 +94,13 @@ onLoad((options: any) => {
88 94
 
89 95
 onShow(() => {
90 96
   isSubmit.value = false
97
+  
98
+	console.log('onshow----')
99
+	if (isNeedAuth.value) {
100
+		console.log('从授权进来的。。。。')
101
+		loadProductDetail(state.pddData)
102
+		isNeedAuth.value = false
103
+	}
91 104
 })
92 105
 
93 106
 //精品推荐
@@ -104,14 +117,18 @@ function YouLike() {
104 117
 
105 118
 //商品不存在详情
106 119
 function soldOut() {
120
+	console.log('1')
121
+	console.log(userStore.uid)
107 122
   if (userStore.uid) {
108 123
     isShow.value = true
124
+	console.log('2')
109 125
     uni.setNavigationBarTitle({
110 126
       title: '商品下架不存在'
111 127
     })
112 128
     loadList('reload')
113 129
     uni.hideLoading()
114 130
   } else {
131
+	  console.log('3')
115 132
     uni.showToast({
116 133
       title: '请登录',
117 134
       icon: 'none'
@@ -140,25 +157,50 @@ function loadProductDetail(product: Partial<IProductDetail>) {
140 157
 
141 158
   // 京东
142 159
   if (product.platform == 6) {
143
-    getJdProductDetail(product.id).then(res => {
144
-      console.log(res);
145
-      let { data, status } = res
146
-      if (status === 200) {
147
-        const jdProduct = data[0]
148
-        // console.log(jdProduct)
149
-        mergeProductDetailclone({
150
-          images: jdProduct.detail,
151
-          coupon: {
152
-            amount: jdProduct.couMoney
153
-          },
154
-          ...jdProduct
155
-        })
156
-
157
-        uni.hideLoading()
158
-      } else {
159
-        soldOut()
160
-      }
161
-    })
160
+	  
161
+	  if (userStore.uid) { // 已登录的
162
+		  getJdProductDetail(product.id).then(res => {
163
+		    console.log('京东商品详情',res);
164
+		    let { data, status } = res
165
+		    
166
+		    const jdProduct = data[0]
167
+		    // console.log(jdProduct)
168
+		    mergeProductDetailclone({
169
+		      images: jdProduct.detail,
170
+		      coupon: {
171
+		        amount: jdProduct.couMoney
172
+		      },
173
+		      ...jdProduct
174
+		    })
175
+		    
176
+		    uni.hideLoading()
177
+		})
178
+	  } else { // 未登录的
179
+		  getJTTProductDetail(product.id, 1).then(res => {
180
+		    console.log('京东商品详情',res);
181
+		    let { data, status } = res
182
+		    
183
+		    const jdProduct = data[0]
184
+		    // console.log(jdProduct)
185
+		    mergeProductDetailclone({
186
+		      images: jdProduct.detail,
187
+		      coupon: {
188
+		        amount: jdProduct.couMoney
189
+		      },
190
+		      ...jdProduct
191
+		    })
192
+		    
193
+		    uni.hideLoading()
194
+		})
195
+	  }
196
+    
197
+	  
198
+      // if (status === 200) {
199
+        
200
+      // } else {
201
+      //   soldOut()
202
+      // }
203
+    
162 204
   }
163 205
   // 淘宝 *
164 206
   if (product.platform === 5) {
@@ -187,7 +229,9 @@ function loadProductDetail(product: Partial<IProductDetail>) {
187 229
   // 拼多多 *
188 230
   if (product.platform == 1) {
189 231
     getPddProductDetail(product.id).then(res => {
190
-      // console.log(res);
232
+		console.log('res')
233
+      console.log(res)
234
+	  console.log()
191 235
       let { status, data } = res
192 236
       // detail.value = res
193 237
       if (status !== 200) {
@@ -337,14 +381,22 @@ function handleBuyNow() {
337 381
         })
338 382
       }
339 383
     } else if (detail.value?.platform == 1) {
340
-      // console.log(detail.value)
384
+      console.log(detail.value)
385
+	  
386
+	  if (detail.value.pddlink.mobile_url.includes('mobile.yangkeduo')) {
387
+		  isNeedAuth.value = true
388
+		  
389
+		  console.log('需要授权')
390
+	  }
391
+	  
392
+	  
341 393
       const pddWx = detail.value.pddlink.wx
342 394
       if (pddWx) {
343 395
         uni.navigateToMiniProgram({
344 396
           appId: pddWx.app_id,
345 397
           path: pddWx.page_path,
346 398
           // extraData: {
347
-          //  foo: 'bar'
399
+          //  foo: 'bar'mobile_url: "https://p.pinduoduo.com/VHKD9VbP"  mobile.yangkeduo
348 400
           // },
349 401
           envVersion: 'release',
350 402
           success(res) {
@@ -400,10 +452,14 @@ function handleBuyNow() {
400 452
             })*/
401 453
 
402 454
       // }
403
-      return uni.showToast({
404
-        title: '商品维护中,请稍后再试',
405
-        icon: 'none'
406
-      })
455
+	  if (detail.value?.platform == 6) {
456
+		  
457
+	  } else {
458
+		  return uni.showToast({
459
+		    title: '商品维护中,请稍后再试',
460
+		    icon: 'none'
461
+		  })
462
+	  }
407 463
     }
408 464
   }
409 465
   /*

+ 4 - 0
src/pages/user/login/index.vue

@@ -223,6 +223,10 @@ function onClickLeft() {
223 223
         <div>其他手机号登录</div>
224 224
       </navigator>
225 225
     </div>
226
+	
227
+	<div class="bg-white rounded-md py-3 gap-2 flex justify-center items-center text-sm" @click="onClickLeft">
228
+	  <div>暂不登录</div>
229
+	</div>
226 230
     <CXBNotLoginButton :key="state.key"/>
227 231
 
228 232
   </div>

+ 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