|
|
@@ -1,24 +1,24 @@
|
|
1
|
1
|
<script lang="ts" setup>
|
|
2
|
2
|
import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
|
|
3
|
|
-import {getProductDetail, getRecommendList} from "~/apis/merchant";
|
|
|
3
|
+import { getProductDetail, getRecommendList } from "~/apis/merchant";
|
|
4
|
4
|
import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
|
|
5
|
5
|
import FCell from "~/components/FCell/FCell.vue";
|
|
6
|
|
-import type {SkuModel} from "~/apis/model/product.model";
|
|
|
6
|
+import type { SkuModel } from "~/apis/model/product.model";
|
|
7
|
7
|
import CXBSkuPopup from "~/components/CXBSkuPopup/CXBSkuPopup.vue";
|
|
8
|
8
|
import CXBBackTop from '~/components/CXBBackTop/CXBBackTop.vue';
|
|
9
|
|
-import {createShopping} from "~/apis/order.api";
|
|
10
|
|
-import {getAgentInfo, getCartCount, relation, removeMyRelation, xcxBanding} from "~/apis/user";
|
|
|
9
|
+import { createShopping } from "~/apis/order.api";
|
|
|
10
|
+import { getAgentInfo, getCartCount, relation, removeMyRelation, xcxBanding } from "~/apis/user";
|
|
11
|
11
|
import {
|
|
12
|
12
|
DyProductModel,
|
|
13
|
13
|
JdProductModel,
|
|
14
|
14
|
SuNingProductModel,
|
|
15
|
15
|
TaobaoProductThirdPartyWaresModel, VipProductModel
|
|
16
|
16
|
} from "~/apis/model/product.model";
|
|
17
|
|
-import {DcProductModel} from "~/apis/model/dacang.model";
|
|
18
|
|
-import {CDN_URL} from "~/config/app";
|
|
|
17
|
+import { DcProductModel } from "~/apis/model/dacang.model";
|
|
|
18
|
+import { CDN_URL } from "~/config/app";
|
|
19
|
19
|
import dayjs from "dayjs";
|
|
20
|
|
-import {getShareId} from "~/apis/product";
|
|
21
|
|
-import {debounce} from "lodash-es";
|
|
|
20
|
+import { getShareId } from "~/apis/product";
|
|
|
21
|
+import { debounce } from "lodash-es";
|
|
22
|
22
|
|
|
23
|
23
|
const usePageStore = usePageStoreWidthOut()
|
|
24
|
24
|
|
|
|
@@ -54,9 +54,9 @@ const state = reactive({
|
|
54
|
54
|
goods: {
|
|
55
|
55
|
price: '4599.00',
|
|
56
|
56
|
imagePath:
|
|
57
|
|
- '//img14.360buyimg.com/n4/jfs/t1/215845/12/3788/221990/618a5c4dEc71cb4c7/7bd6eb8d17830991.jpg'
|
|
|
57
|
+ '//img14.360buyimg.com/n4/jfs/t1/215845/12/3788/221990/618a5c4dEc71cb4c7/7bd6eb8d17830991.jpg'
|
|
58
|
58
|
},
|
|
59
|
|
-//1表示立即购买;2表示加入购物车,3表示立即兑换
|
|
|
59
|
+ //1表示立即购买;2表示加入购物车,3表示立即兑换
|
|
60
|
60
|
flag: '1',
|
|
61
|
61
|
isNew: '0',
|
|
62
|
62
|
cartNum: 1,
|
|
|
@@ -64,7 +64,7 @@ const state = reactive({
|
|
64
|
64
|
shareImage: '',
|
|
65
|
65
|
})
|
|
66
|
66
|
const detail: any = ref(null)
|
|
67
|
|
-
|
|
|
67
|
+let isShow = ref(false)
|
|
68
|
68
|
onShow(() => {
|
|
69
|
69
|
uni.showLoading({
|
|
70
|
70
|
title: '数据加载中',
|
|
|
@@ -87,10 +87,16 @@ uni.showShareMenu({
|
|
87
|
87
|
menus: ['shareAppMessage', 'shareTimeline']
|
|
88
|
88
|
})
|
|
89
|
89
|
onLoad((option: any) => {
|
|
|
90
|
+ uni.showLoading({
|
|
|
91
|
+ title: '数据加载中',
|
|
|
92
|
+ icon: 'none'
|
|
|
93
|
+ })
|
|
|
94
|
+ console.log(option);
|
|
90
|
95
|
// const id = '4858'
|
|
91
|
96
|
state.id = option.id
|
|
92
|
97
|
// state.id = 4858
|
|
93
|
98
|
const fromShareId = option.shareID
|
|
|
99
|
+ // console.log(fromShareId);
|
|
94
|
100
|
// console.log(fromShareId + '---share_id...')
|
|
95
|
101
|
// if (state.shareId) {
|
|
96
|
102
|
if (fromShareId) {
|
|
|
@@ -108,45 +114,58 @@ onLoad((option: any) => {
|
|
108
|
114
|
state.recommendList = res.list
|
|
109
|
115
|
})
|
|
110
|
116
|
|
|
111
|
|
- getShareId({ pid: state.id, type: 1}).then(res => {
|
|
|
117
|
+ getShareId({ pid: state.id, type: 1 }).then(res => {
|
|
112
|
118
|
state.shareId = res.share_id
|
|
113
|
119
|
userStore.setRedirectPage(`/pages/store/product/detail?id=${state.id}&from=share&shareID=${state.shareId}`, 'page')
|
|
114
|
120
|
|
|
115
|
121
|
})
|
|
116
|
122
|
|
|
|
123
|
+
|
|
|
124
|
+
|
|
117
|
125
|
})
|
|
118
|
126
|
|
|
119
|
127
|
function loadProductDetail() {
|
|
120
|
128
|
|
|
121
|
129
|
getProductDetail(state.id).then(res => {
|
|
122
|
|
- // console.log(res)
|
|
123
|
|
- detail.value = res
|
|
124
|
|
-
|
|
125
|
|
- state.shareImage = detail.value.image
|
|
126
|
|
- if (res && res.mer_id && res.mer_id === '148') {
|
|
127
|
|
- if (detail.value && detail.value.price ) {
|
|
128
|
|
- detail.value.price = detail.value.price * 30
|
|
|
130
|
+ // console.log('我是res.message', res.message)
|
|
|
131
|
+ // console.log(res);
|
|
|
132
|
+ if (res.status === 200) {
|
|
|
133
|
+ detail.value = res.data
|
|
|
134
|
+
|
|
|
135
|
+ state.shareImage = detail.value.image
|
|
|
136
|
+ if (res && res.mer_id && res.mer_id === '148') {
|
|
|
137
|
+ if (detail.value && detail.value.price) {
|
|
|
138
|
+ detail.value.price = detail.value.price * 30
|
|
|
139
|
+ }
|
|
129
|
140
|
}
|
|
130
|
|
- }
|
|
131
|
|
- state.isRelation = res.isRelation
|
|
132
|
|
- if (res.merchant_type == 2) {
|
|
133
|
|
- xcxBanding({
|
|
134
|
|
- mer_id: res.mer_id,
|
|
135
|
|
- share_id: state.shareId
|
|
136
|
|
- }).then(res => {
|
|
137
|
|
- console.info(res)
|
|
|
141
|
+ state.isRelation = res.isRelation
|
|
|
142
|
+ if (res.merchant_type == 2) {
|
|
|
143
|
+ xcxBanding({
|
|
|
144
|
+ mer_id: res.mer_id,
|
|
|
145
|
+ share_id: state.shareId
|
|
|
146
|
+ }).then(res => {
|
|
|
147
|
+ console.info(res)
|
|
|
148
|
+ })
|
|
|
149
|
+ }
|
|
|
150
|
+
|
|
|
151
|
+ // if (detail.value.mer_id === '148') {
|
|
|
152
|
+ // }
|
|
|
153
|
+ uni.hideLoading()
|
|
|
154
|
+ } else {
|
|
|
155
|
+ isShow.value = true
|
|
|
156
|
+ uni.setNavigationBarTitle({
|
|
|
157
|
+ title: '商品下架不存在'
|
|
138
|
158
|
})
|
|
|
159
|
+ uni.hideLoading()
|
|
|
160
|
+
|
|
139
|
161
|
}
|
|
140
|
162
|
|
|
141
|
|
- // if (detail.value.mer_id === '148') {
|
|
142
|
|
- // }
|
|
143
|
|
- uni.hideLoading()
|
|
144
|
163
|
}).catch(error => {
|
|
145
|
164
|
// console.log(error)
|
|
146
|
165
|
uni.showToast({
|
|
147
|
166
|
icon: "none",
|
|
148
|
167
|
title: error
|
|
149
|
|
- }).then( () => {
|
|
|
168
|
+ }).then(() => {
|
|
150
|
169
|
setTimeout(() => {
|
|
151
|
170
|
uni.navigateBack()
|
|
152
|
171
|
}, 500)
|
|
|
@@ -201,7 +220,7 @@ onShareTimeline(() => {
|
|
201
|
220
|
|
|
202
|
221
|
return {
|
|
203
|
222
|
title: `${detail.value.store_name}`,
|
|
204
|
|
- imageUrl: state.shareImage,
|
|
|
223
|
+ imageUrl: state.shareImage,
|
|
205
|
224
|
query: `id=${state.id}&from=share&shareID=${state.shareId}`
|
|
206
|
225
|
}
|
|
207
|
226
|
|
|
|
@@ -290,7 +309,7 @@ function handleCreateShopping() {
|
|
290
|
309
|
// product_attr_unique: JSON.stringify(state.currentSku),
|
|
291
|
310
|
product_attr_unique: state.currentSku.unique,
|
|
292
|
311
|
cart_num: state.cartNum,
|
|
293
|
|
- is_new: (state.flag === '1' || state.flag === '3') ? '1': '0'
|
|
|
312
|
+ is_new: (state.flag === '1' || state.flag === '3') ? '1' : '0'
|
|
294
|
313
|
}).then(res => {
|
|
295
|
314
|
// console.log(res)
|
|
296
|
315
|
if (res.cart_id) {
|
|
|
@@ -316,7 +335,7 @@ function handleCreateShopping() {
|
|
316
|
335
|
title: error,
|
|
317
|
336
|
icon: 'none'
|
|
318
|
337
|
})
|
|
319
|
|
- } else if (error === '库存不足') {
|
|
|
338
|
+ } else if (error === '库存不足') {
|
|
320
|
339
|
return uni.showToast({
|
|
321
|
340
|
title: error,
|
|
322
|
341
|
icon: 'none'
|
|
|
@@ -335,7 +354,7 @@ function handleCreateShopping() {
|
|
335
|
354
|
*
|
|
336
|
355
|
* @param flag //1表示立即购买;2表示加入购物车,3表示立即兑换
|
|
337
|
356
|
*/
|
|
338
|
|
-function handleOrderConfirm(flag: '1' | '2'| '3') {
|
|
|
357
|
+function handleOrderConfirm(flag: '1' | '2' | '3') {
|
|
339
|
358
|
debounce(() => {
|
|
340
|
359
|
if (!userStore.uid) {
|
|
341
|
360
|
return uni.showToast({
|
|
|
@@ -350,7 +369,7 @@ function handleOrderConfirm(flag: '1' | '2'| '3') {
|
|
350
|
369
|
|
|
351
|
370
|
})
|
|
352
|
371
|
}
|
|
353
|
|
- }, 150, {
|
|
|
372
|
+ }, 150, {
|
|
354
|
373
|
'leading': true,
|
|
355
|
374
|
'trailing': false
|
|
356
|
375
|
})
|
|
|
@@ -368,17 +387,17 @@ function handleCountChange(val) {
|
|
368
|
387
|
// console.log(val)
|
|
369
|
388
|
// detail.value.
|
|
370
|
389
|
// if (val > 0) {
|
|
371
|
|
- state.cartNum = val
|
|
|
390
|
+ state.cartNum = val
|
|
372
|
391
|
// }
|
|
373
|
392
|
}
|
|
374
|
393
|
function handleProductItemClick(
|
|
375
|
|
- item:
|
|
376
|
|
- JdProductModel
|
|
377
|
|
- & DcProductModel
|
|
378
|
|
- & DyProductModel
|
|
379
|
|
- & SuNingProductModel
|
|
380
|
|
- & TaobaoProductThirdPartyWaresModel
|
|
381
|
|
- & VipProductModel
|
|
|
394
|
+ item:
|
|
|
395
|
+ JdProductModel
|
|
|
396
|
+ & DcProductModel
|
|
|
397
|
+ & DyProductModel
|
|
|
398
|
+ & SuNingProductModel
|
|
|
399
|
+ & TaobaoProductThirdPartyWaresModel
|
|
|
400
|
+ & VipProductModel
|
|
382
|
401
|
) {
|
|
383
|
402
|
// function navigateToDetail(params) {
|
|
384
|
403
|
// let otherDetailUrl = `/pages/store/product/other`
|
|
|
@@ -421,7 +440,7 @@ function handleRelation() {
|
|
421
|
440
|
|
|
422
|
441
|
function handleRemoveRelation() {
|
|
423
|
442
|
// console.log('on....')
|
|
424
|
|
- removeMyRelation({type: 1, type_id: state.id}).then(res => {
|
|
|
443
|
+ removeMyRelation({ type: 1, type_id: state.id }).then(res => {
|
|
425
|
444
|
// isCare.value = false
|
|
426
|
445
|
state.isRelation = false
|
|
427
|
446
|
|
|
|
@@ -464,10 +483,10 @@ let Scroll_X = ref(0)
|
|
464
|
483
|
const headerClass = ref('')
|
|
465
|
484
|
onPageScroll((page) => {
|
|
466
|
485
|
// console.log('滚轮事件触发了',page.scrollTop.toFixed());
|
|
467
|
|
-
|
|
|
486
|
+
|
|
468
|
487
|
// console.log(page.scrollTop.toFixed(),'距离顶部的距离')
|
|
469
|
488
|
Scroll_X.value = Number(page.scrollTop.toFixed())
|
|
470
|
|
- if (page.scrollTop >= 76 ) {
|
|
|
489
|
+ if (page.scrollTop >= 76) {
|
|
471
|
490
|
headerClass.value = 'bg-white !text-gray-900'
|
|
472
|
491
|
} else {
|
|
473
|
492
|
headerClass.value = ''
|
|
|
@@ -476,27 +495,21 @@ onPageScroll((page) => {
|
|
476
|
495
|
</script>
|
|
477
|
496
|
|
|
478
|
497
|
<template>
|
|
|
498
|
+ <!-- 商品上架状态 -->
|
|
479
|
499
|
<div class="flex flex-col gap-3 pb-20" v-if="detail">
|
|
480
|
|
- <CXBBackTop :Scroll_X="Scroll_X"/>
|
|
|
500
|
+ <CXBBackTop :Scroll_X="Scroll_X" />
|
|
481
|
501
|
<div class="bg-white ">
|
|
482
|
502
|
<div class="w-screen h-94">
|
|
483
|
|
- <swiper
|
|
484
|
|
- v-if="detail && detail.slider_image"
|
|
485
|
|
- :indicator-dots="state.indicatorDots"
|
|
486
|
|
- indicator-active-color="#e93323"
|
|
487
|
|
- :autoplay="state.autoplay"
|
|
488
|
|
- :circular="state.circular"
|
|
489
|
|
- :interval="state.interval"
|
|
490
|
|
- :duration="state.duration"
|
|
491
|
|
- class="w-full h-94"
|
|
492
|
|
- >
|
|
|
503
|
+ <swiper v-if="detail && detail.slider_image" :indicator-dots="state.indicatorDots"
|
|
|
504
|
+ indicator-active-color="#e93323" :autoplay="state.autoplay" :circular="state.circular"
|
|
|
505
|
+ :interval="state.interval" :duration="state.duration" class="w-full h-94">
|
|
493
|
506
|
<swiper-item v-for="(item, index) in detail.slider_image" :key="index">
|
|
494
|
|
- <image :src="item" @tap="previewImage(index)" class="!w-full !h-full" mode="aspectFill"/>
|
|
|
507
|
+ <image :src="item" @tap="previewImage(index)" class="!w-full !h-full" mode="aspectFill" />
|
|
495
|
508
|
</swiper-item>
|
|
496
|
509
|
</swiper>
|
|
497
|
510
|
</div>
|
|
498
|
511
|
<div class="bg-gradient-to-r from-[#fe7577] to-[#fe0032] h-20 mt-3 flex items-center p-3 justify-between"
|
|
499
|
|
- v-if="detail.seckill == 1">
|
|
|
512
|
+ v-if="detail.seckill == 1">
|
|
500
|
513
|
<div class="flex flex-col">
|
|
501
|
514
|
<div class="flex gap-2 items-center text-white">
|
|
502
|
515
|
<div class="text-[30px] font-bold">
|
|
|
@@ -505,16 +518,15 @@ onPageScroll((page) => {
|
|
505
|
518
|
<image :src="miaoshaIcon" mode="widthFix" class="w-10"></image>
|
|
506
|
519
|
</div>
|
|
507
|
520
|
<div class="text-white text-xs">
|
|
508
|
|
- 即将恢复原价 ¥{{detail.ot_price}}
|
|
|
521
|
+ 即将恢复原价 ¥{{ detail.ot_price }}
|
|
509
|
522
|
</div>
|
|
510
|
523
|
</div>
|
|
511
|
524
|
<div class="flex flex-col items-center gap-2 justify-center">
|
|
512
|
525
|
<image :src="xiaoshimiaoshaIcon" class="w-17 h-4" model="widthFix"></image>
|
|
513
|
526
|
<div class="text-white " v-if="detail.seckill_s == 1">
|
|
514
|
|
- <div class="text-xs"
|
|
515
|
|
- >
|
|
516
|
|
- 距秒杀结束</div>
|
|
517
|
|
- <nut-countdown :end-time="new Date(detail.seckill_date_end).getTime() + 60 * 1000" ></nut-countdown>
|
|
|
527
|
+ <div class="text-xs">
|
|
|
528
|
+ 距秒杀结束</div>
|
|
|
529
|
+ <nut-countdown :end-time="new Date(detail.seckill_date_end).getTime() + 60 * 1000"></nut-countdown>
|
|
518
|
530
|
</div>
|
|
519
|
531
|
<div class="text-white" v-if="detail.seckill_s == 2">
|
|
520
|
532
|
<div class="">
|
|
|
@@ -527,18 +539,14 @@ onPageScroll((page) => {
|
|
527
|
539
|
</div>
|
|
528
|
540
|
|
|
529
|
541
|
</div>
|
|
530
|
|
- <div class="bg-black bg-op-30 fixed top-3 rounded-full right-3 h-6 w-6 flex flex-col justify-center items-center z-10"
|
|
531
|
|
- @click="toggleRelation"
|
|
532
|
|
- >
|
|
533
|
|
- <div class="h4 w-4"
|
|
534
|
|
- :class="state.isRelation ? 'bg-primary i-tabler-star-filled' : 'i-tabler-star text-white'"
|
|
535
|
|
-
|
|
536
|
|
- ></div>
|
|
|
542
|
+ <div
|
|
|
543
|
+ class="bg-black bg-op-30 fixed top-3 rounded-full right-3 h-6 w-6 flex flex-col justify-center items-center z-10"
|
|
|
544
|
+ @click="toggleRelation">
|
|
|
545
|
+ <div class="h4 w-4" :class="state.isRelation ? 'bg-primary i-tabler-star-filled' : 'i-tabler-star text-white'">
|
|
|
546
|
+ </div>
|
|
537
|
547
|
</div>
|
|
538
|
548
|
|
|
539
|
|
- <div
|
|
540
|
|
- class="flex flex-col p-3 gap-3"
|
|
541
|
|
- >
|
|
|
549
|
+ <div class="flex flex-col p-3 gap-3">
|
|
542
|
550
|
<div class="flex flex-row items-center text-[#FE0032] font-bold text-lg gap-2">
|
|
543
|
551
|
<div v-if="is148Merchant && detail.price" class="flex justify-end items-end gap-2">
|
|
544
|
552
|
<div class="!text-[24px]">{{ Number.parseFloat(detail.price).toFixed(2) }} </div>
|
|
|
@@ -549,18 +557,14 @@ onPageScroll((page) => {
|
|
549
|
557
|
¥ {{ detail.price }}
|
|
550
|
558
|
</div>
|
|
551
|
559
|
</div>
|
|
552
|
|
- <div
|
|
553
|
|
- v-if="!is148Merchant"
|
|
554
|
|
- class="line-through text-xs font-bold flex text-gray-600"
|
|
555
|
|
- >
|
|
|
560
|
+ <div v-if="!is148Merchant" class="line-through text-xs font-bold flex text-gray-600">
|
|
556
|
561
|
原价 ¥ {{ detail.ot_price }}
|
|
557
|
562
|
</div>
|
|
558
|
563
|
</div>
|
|
559
|
|
- <div
|
|
560
|
|
- v-if="!is148Merchant"
|
|
561
|
|
- class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
|
|
562
|
|
- <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
|
|
563
|
|
- mode="widthFix" class="!w-8 h-4"></image>
|
|
|
564
|
+ <div v-if="!is148Merchant"
|
|
|
565
|
+ class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
|
|
|
566
|
+ <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix" class="!w-8 h-4">
|
|
|
567
|
+ </image>
|
|
564
|
568
|
<div class="px-2 flex items-center jusitify-center" v-if="detail.yanglao">
|
|
565
|
569
|
<div>
|
|
566
|
570
|
养老金 ¥{{ detail.yanglao }}
|
|
|
@@ -570,16 +574,14 @@ onPageScroll((page) => {
|
|
570
|
574
|
|
|
571
|
575
|
<div class="flex flex-col gap-2">
|
|
572
|
576
|
<div class="flex font-bold flex items-center gap-1" v-if="detail && detail.store_name">
|
|
573
|
|
- <div class="flex bg-primary text-white rounded text-[10px] text-center">
|
|
574
|
|
- <div class=" h-4 w-4 ">仓</div></div>
|
|
|
577
|
+ <div class="flex bg-primary text-white rounded text-[10px] text-center">
|
|
|
578
|
+ <div class=" h-4 w-4 ">仓</div>
|
|
|
579
|
+ </div>
|
|
575
|
580
|
<div class=" justify-center items-center" v-html="detail.store_name">
|
|
576
|
581
|
</div>
|
|
577
|
582
|
</div>
|
|
578
|
|
- <div
|
|
579
|
|
- v-if="detail.store_info"
|
|
580
|
|
- class="text-gray-600 text-sm w-fit px-1"
|
|
581
|
|
- :class="is148Merchant ? 'border border-solid border-gray' : ''"
|
|
582
|
|
- >
|
|
|
583
|
+ <div v-if="detail.store_info" class="text-gray-600 text-sm w-fit px-1"
|
|
|
584
|
+ :class="is148Merchant ? 'border border-solid border-gray' : ''">
|
|
583
|
585
|
{{ detail.store_info }}
|
|
584
|
586
|
</div>
|
|
585
|
587
|
</div>
|
|
|
@@ -587,11 +589,11 @@ onPageScroll((page) => {
|
|
587
|
589
|
<div class="flex gap-3 text-[12px]">
|
|
588
|
590
|
<div>分享:</div>
|
|
589
|
591
|
<div class="flex-1 items-center flex ">
|
|
590
|
|
- <button open-type="share" class="flex gap-2 w-1/2 text-[12px]">
|
|
|
592
|
+ <button open-type="share" class="flex gap-2 w-1/2 text-[12px]">
|
|
591
|
593
|
|
|
592
|
594
|
<image :src="wx_shareImg" mode="widthFix" class="w-5 h-5"></image>
|
|
593
|
595
|
<div>微信</div>
|
|
594
|
|
- </button>
|
|
|
596
|
+ </button>
|
|
595
|
597
|
|
|
596
|
598
|
<div class="flex gap-2 w-1/2" @click="shareShowTips = true">
|
|
597
|
599
|
<image :src="pyqImg" mode="widthFix" class="w-5 h-5"></image>
|
|
|
@@ -603,29 +605,24 @@ onPageScroll((page) => {
|
|
603
|
605
|
</div>
|
|
604
|
606
|
</div>
|
|
605
|
607
|
|
|
606
|
|
- <FCell
|
|
607
|
|
- arrow
|
|
608
|
|
- @tap="state.isShowSku = !state.isShowSku"
|
|
609
|
|
- >
|
|
|
608
|
+ <FCell arrow @tap="state.isShowSku = !state.isShowSku">
|
|
610
|
609
|
<template #title>
|
|
611
|
610
|
<div class="flex items-center" v-if="state.currentSku">
|
|
612
|
611
|
<div class="font-bold">规格:</div>
|
|
613
|
|
-<!-- <div v-for="(key, index) in Object.keys(detail.sku)"-->
|
|
614
|
|
-<!-- :key="index"-->
|
|
615
|
|
-<!-- class="pl-2 text-sm"-->
|
|
616
|
|
-<!-- >-->
|
|
617
|
|
-<!-- {{ key }}-->
|
|
618
|
|
-<!-- </div>-->
|
|
619
|
|
- {{state.currentSku.sku}}
|
|
|
612
|
+ <!-- <div v-for="(key, index) in Object.keys(detail.sku)"-->
|
|
|
613
|
+ <!-- :key="index"-->
|
|
|
614
|
+ <!-- class="pl-2 text-sm"-->
|
|
|
615
|
+ <!-- >-->
|
|
|
616
|
+ <!-- {{ key }}-->
|
|
|
617
|
+ <!-- </div>-->
|
|
|
618
|
+ {{ state.currentSku.sku }}
|
|
620
|
619
|
</div>
|
|
621
|
620
|
|
|
622
|
621
|
</template>
|
|
623
|
622
|
</FCell>
|
|
624
|
623
|
|
|
625
|
624
|
<!-- 店铺信息 -->
|
|
626
|
|
- <div
|
|
627
|
|
- @tap="handleShowMerchant(detail.mer_id)"
|
|
628
|
|
- class="flex gap-3 p-3 bg-white">
|
|
|
625
|
+ <div @tap="handleShowMerchant(detail.mer_id)" class="flex gap-3 p-3 bg-white">
|
|
629
|
626
|
<div v-if="detail && detail.merchant">
|
|
630
|
627
|
<image :src="detail.merchant.mer_avatar" mode="widthFix" class=" h-12 w-12"></image>
|
|
631
|
628
|
</div>
|
|
|
@@ -634,9 +631,7 @@ onPageScroll((page) => {
|
|
634
|
631
|
<div>{{ detail.merchant.mer_name }}</div>
|
|
635
|
632
|
<div class="i-tabler-chevron-right text-gray"></div>
|
|
636
|
633
|
</div>
|
|
637
|
|
- <div
|
|
638
|
|
- class="border border-solid border-red text-red text-xs px-1 rounded-full w-fit"
|
|
639
|
|
- >
|
|
|
634
|
+ <div class="border border-solid border-red text-red text-xs px-1 rounded-full w-fit">
|
|
640
|
635
|
进入店铺
|
|
641
|
636
|
</div>
|
|
642
|
637
|
</div>
|
|
|
@@ -645,26 +640,19 @@ onPageScroll((page) => {
|
|
645
|
640
|
<div class="flex flex-col bg-white">
|
|
646
|
641
|
<div class="p-3">
|
|
647
|
642
|
<div
|
|
648
|
|
- 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">
|
|
|
643
|
+ 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">
|
|
649
|
644
|
<div class="pl-2">
|
|
650
|
645
|
为你推荐
|
|
651
|
646
|
</div>
|
|
652
|
647
|
</div>
|
|
653
|
648
|
</div>
|
|
654
|
649
|
<div class="pb-3">
|
|
655
|
|
- <scroll-view
|
|
656
|
|
- class=" whitespace-nowrap w-screen text-white text-sm"
|
|
657
|
|
- :scroll-with-animation="true"
|
|
658
|
|
- :scroll-x="true"
|
|
659
|
|
- :show-scrollbar="false"
|
|
660
|
|
- >
|
|
|
650
|
+ <scroll-view class=" whitespace-nowrap w-screen text-white text-sm" :scroll-with-animation="true"
|
|
|
651
|
+ :scroll-x="true" :show-scrollbar="false">
|
|
661
|
652
|
<div class="pl-3" v-if="detail && detail.merchant">
|
|
662
|
|
- <div v-for="(item, index) in detail.merchant.recommend"
|
|
663
|
|
- :key="index"
|
|
664
|
|
- @click="handleProductItemClick(item)"
|
|
665
|
|
- class="flex inline-flex items-center justify-center relative "
|
|
666
|
|
- >
|
|
667
|
|
- <MerchantProductCard :item="item" exClass="w-40 border border-solid border-gray-200 mr-3"/>
|
|
|
653
|
+ <div v-for="(item, index) in detail.merchant.recommend" :key="index" @click="handleProductItemClick(item)"
|
|
|
654
|
+ class="flex inline-flex items-center justify-center relative ">
|
|
|
655
|
+ <MerchantProductCard :item="item" exClass="w-40 border border-solid border-gray-200 mr-3" />
|
|
668
|
656
|
</div>
|
|
669
|
657
|
|
|
670
|
658
|
</div>
|
|
|
@@ -676,7 +664,7 @@ onPageScroll((page) => {
|
|
676
|
664
|
<div class="flex flex-col justify-center bg-white">
|
|
677
|
665
|
<div class="p-3">
|
|
678
|
666
|
<div
|
|
679
|
|
- class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-800 before:rounded relative inline-block">
|
|
|
667
|
+ class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-800 before:rounded relative inline-block">
|
|
680
|
668
|
<div class="pl-2">
|
|
681
|
669
|
图文详情
|
|
682
|
670
|
</div>
|
|
|
@@ -694,7 +682,7 @@ onPageScroll((page) => {
|
|
694
|
682
|
<div class="flex flex-col pb-safe gap-3">
|
|
695
|
683
|
<div class="p-3 bg-white">
|
|
696
|
684
|
<div
|
|
697
|
|
- 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">
|
|
|
685
|
+ 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">
|
|
698
|
686
|
<div class="pl-2">
|
|
699
|
687
|
猜你喜欢
|
|
700
|
688
|
</div>
|
|
|
@@ -702,11 +690,8 @@ onPageScroll((page) => {
|
|
702
|
690
|
</div>
|
|
703
|
691
|
<div class="pb-3 px-3" v-if="state.recommendList">
|
|
704
|
692
|
<grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
|
|
705
|
|
- <div v-for="(item, index) in state.recommendList"
|
|
706
|
|
- :key="index"
|
|
707
|
|
- @click="handleProductItemClick(item)"
|
|
708
|
|
- >
|
|
709
|
|
- <MerchantProductCard :item="item"/>
|
|
|
693
|
+ <div v-for="(item, index) in state.recommendList" :key="index" @click="handleProductItemClick(item)">
|
|
|
694
|
+ <MerchantProductCard :item="item" />
|
|
710
|
695
|
|
|
711
|
696
|
</div>
|
|
712
|
697
|
</grid-view>
|
|
|
@@ -715,57 +700,75 @@ onPageScroll((page) => {
|
|
715
|
700
|
</div>
|
|
716
|
701
|
|
|
717
|
702
|
</div>
|
|
718
|
|
- <div class="fixed bottom-0 w-screen pb-safe bg-white">
|
|
|
703
|
+ <!-- 商品下架 -->
|
|
|
704
|
+ <div class="relative w-screen " v-if="isShow">
|
|
|
705
|
+ <CXBBackTop :Scroll_X="Scroll_X" />
|
|
|
706
|
+ <div class="box-out">
|
|
|
707
|
+ <div class="flex-box pb-3 px-3 ">
|
|
|
708
|
+ <div class="img-div">
|
|
|
709
|
+ <image lazy-load src="../../../static/icon/商品下架不存在@3x.png" mode="widthFix" class=" top-0 right-0 sold-out ">
|
|
|
710
|
+ </image>
|
|
|
711
|
+ </div>
|
|
|
712
|
+ <div class="out-conter">该商品下架不存在</div>
|
|
|
713
|
+ </div>
|
|
|
714
|
+
|
|
|
715
|
+ </div>
|
|
|
716
|
+ <div class="flex flex-col pb-safe gap-3">
|
|
|
717
|
+ <div class="p-3 bg-white">
|
|
|
718
|
+ <div
|
|
|
719
|
+ 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">
|
|
|
720
|
+ <div class="pl-2">
|
|
|
721
|
+ 猜你喜欢
|
|
|
722
|
+ </div>
|
|
|
723
|
+ </div>
|
|
|
724
|
+ </div>
|
|
|
725
|
+ <div class="pb-3 px-3" v-if="state.recommendList.length != 0">
|
|
|
726
|
+ <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
|
|
|
727
|
+ <div v-for="(item, index) in state.recommendList" :key="index" @click="handleProductItemClick(item)">
|
|
|
728
|
+ <MerchantProductCard :item="item" />
|
|
|
729
|
+
|
|
|
730
|
+ </div>
|
|
|
731
|
+ </grid-view>
|
|
|
732
|
+ </div>
|
|
|
733
|
+
|
|
|
734
|
+ </div>
|
|
|
735
|
+ </div>
|
|
|
736
|
+ <!-- 底部栏 -->
|
|
|
737
|
+ <div class="fixed bottom-0 w-screen pb-safe bg-white" v-if="detail">
|
|
719
|
738
|
<div class="flex flex-row justify-between py-2 ">
|
|
720
|
739
|
<div class=" flex justify-around">
|
|
721
|
|
- <div
|
|
722
|
|
- @tap="handleShowMerchant(detail.mer_id)"
|
|
723
|
|
- class="flex flex-col justify-center items-center pl-4"
|
|
724
|
|
- >
|
|
725
|
|
-<!-- <div class="i-tabler-building-store"></div>-->
|
|
|
740
|
+ <div @tap="handleShowMerchant(detail.mer_id)" class="flex flex-col justify-center items-center pl-4">
|
|
|
741
|
+ <!-- <div class="i-tabler-building-store"></div>-->
|
|
726
|
742
|
<image :src="shangpinxiangqing_dianpu" mode="widthFix" class="w-6 h-6"></image>
|
|
727
|
743
|
<div class="text-[11px]">店铺</div>
|
|
728
|
744
|
</div>
|
|
729
|
745
|
|
|
730
|
|
- <div
|
|
731
|
|
- @tap="handleShowCustomer"
|
|
732
|
|
- class="flex flex-col justify-center items-center pl-4">
|
|
733
|
|
-<!-- <div class="i-tabler-headset"></div>-->
|
|
|
746
|
+ <div @tap="handleShowCustomer" class="flex flex-col justify-center items-center pl-4">
|
|
|
747
|
+ <!-- <div class="i-tabler-headset"></div>-->
|
|
734
|
748
|
<image :src="shangpinxiangqing_kefu" mode="widthFix" class="w-6 h-6"></image>
|
|
735
|
749
|
|
|
736
|
750
|
<div class="text-[11px]">客服</div>
|
|
737
|
751
|
</div>
|
|
738
|
|
- <div
|
|
739
|
|
- @tap="handleShowShopCart"
|
|
740
|
|
- class="flex flex-col justify-center items-center pl-4 relative">
|
|
741
|
|
- <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white justify-center items-center absolute top--1 right--1 text-center"
|
|
742
|
|
- v-if="state.cartCount"
|
|
743
|
|
- >
|
|
744
|
|
- {{state.cartCount}}
|
|
|
752
|
+ <div @tap="handleShowShopCart" class="flex flex-col justify-center items-center pl-4 relative">
|
|
|
753
|
+ <div
|
|
|
754
|
+ class="bg-primary rounded-full w-3 h-3 text-[9px] text-white justify-center items-center absolute top--1 right--1 text-center"
|
|
|
755
|
+ v-if="state.cartCount">
|
|
|
756
|
+ {{ state.cartCount }}
|
|
745
|
757
|
</div>
|
|
746
|
758
|
<image :src="shangpinxiangqing_gouwuche" mode="widthFix" class="w-6 h-6"></image>
|
|
747
|
759
|
|
|
748
|
|
-<!-- <div class="i-tabler-shopping-cart"></div>-->
|
|
|
760
|
+ <!-- <div class="i-tabler-shopping-cart"></div>-->
|
|
749
|
761
|
<div class="text-[11px]">购物车</div>
|
|
750
|
762
|
</div>
|
|
751
|
763
|
</div>
|
|
752
|
764
|
<div class="flex flex-row text-sm text-white gap-2 pr-3">
|
|
753
|
|
- <div
|
|
754
|
|
- @tap="handleAddCart"
|
|
755
|
|
- v-if="!is148Merchant"
|
|
756
|
|
- class="bg-[#FFA319] rounded-full w-25 flex justify-center items-center h-9">
|
|
|
765
|
+ <div @tap="handleAddCart" v-if="!is148Merchant"
|
|
|
766
|
+ class="bg-[#FFA319] rounded-full w-25 flex justify-center items-center h-9">
|
|
757
|
767
|
加入购物车
|
|
758
|
768
|
</div>
|
|
759
|
|
- <div
|
|
760
|
|
- class="bg-[#F94032] rounded-full w-25 flex justify-center items-center h-9"
|
|
761
|
|
- >
|
|
762
|
|
- <div v-if="is148Merchant"
|
|
763
|
|
- @click="handleOrderConfirm('3')"
|
|
764
|
|
- >立即兑换</div>
|
|
765
|
|
- <div
|
|
766
|
|
- v-else
|
|
767
|
|
- @click="handleOrderConfirm('1')"
|
|
768
|
|
- >立即购买</div>
|
|
|
769
|
+ <div class="bg-[#F94032] rounded-full w-25 flex justify-center items-center h-9">
|
|
|
770
|
+ <div v-if="is148Merchant" @click="handleOrderConfirm('3')">立即兑换</div>
|
|
|
771
|
+ <div v-else @click="handleOrderConfirm('1')">立即购买</div>
|
|
769
|
772
|
</div>
|
|
770
|
773
|
</div>
|
|
771
|
774
|
</div>
|
|
|
@@ -773,73 +776,97 @@ onPageScroll((page) => {
|
|
773
|
776
|
|
|
774
|
777
|
</div>
|
|
775
|
778
|
|
|
776
|
|
- <CXBSkuPopup
|
|
777
|
|
- v-model:show="state.isShowSku"
|
|
778
|
|
- :detail="detail"
|
|
779
|
|
- @selected:item="onSelectedSku"
|
|
780
|
|
- @submit="handleCreateShopping"
|
|
781
|
|
- @count-change="handleCountChange"
|
|
782
|
|
- />
|
|
783
|
|
-<!-- <nut-sku-->
|
|
784
|
|
-<!-- v-model:visible="state.isShowSku"-->
|
|
785
|
|
-<!-- :goods="state.goods"-->
|
|
786
|
|
-<!-- @selectSku="selectSku"-->
|
|
787
|
|
-<!-- >-->
|
|
788
|
|
-<!-- <!– 商品展示区,价格区域 –>-->
|
|
789
|
|
-<!-- <template #sku-header-price>-->
|
|
790
|
|
-<!-- <div>-->
|
|
791
|
|
-<!-- <nut-price :price="goods.price" :needSymbol="true" :thousands="false"> </nut-price>-->
|
|
792
|
|
-<!-- <span class="tag"></span>-->
|
|
793
|
|
-<!-- </div>-->
|
|
794
|
|
-<!-- </template>-->
|
|
795
|
|
-<!-- </nut-sku>-->
|
|
|
779
|
+ <CXBSkuPopup v-model:show="state.isShowSku" :detail="detail" @selected:item="onSelectedSku"
|
|
|
780
|
+ @submit="handleCreateShopping" @count-change="handleCountChange" />
|
|
|
781
|
+ <!-- <nut-sku-->
|
|
|
782
|
+ <!-- v-model:visible="state.isShowSku"-->
|
|
|
783
|
+ <!-- :goods="state.goods"-->
|
|
|
784
|
+ <!-- @selectSku="selectSku"-->
|
|
|
785
|
+ <!-- >-->
|
|
|
786
|
+ <!-- <!– 商品展示区,价格区域 –>-->
|
|
|
787
|
+ <!-- <template #sku-header-price>-->
|
|
|
788
|
+ <!-- <div>-->
|
|
|
789
|
+ <!-- <nut-price :price="goods.price" :needSymbol="true" :thousands="false"> </nut-price>-->
|
|
|
790
|
+ <!-- <span class="tag"></span>-->
|
|
|
791
|
+ <!-- </div>-->
|
|
|
792
|
+ <!-- </template>-->
|
|
|
793
|
+ <!-- </nut-sku>-->
|
|
796
|
794
|
|
|
797
|
795
|
|
|
798
|
796
|
<nut-overlay v-model:visible="shareShowTips" :lock-scroll="true">
|
|
799
|
|
- <image src="https://cdn.bjtdba.com/vod/image/2023-09-16/20230916194347287.png"
|
|
800
|
|
- mode="widthFix" class="absolute top-0 right-0"
|
|
801
|
|
- ></image>
|
|
802
|
|
-
|
|
803
|
|
-<!-- <div class="flex flex-col justify-center items-center w-full h-full"-->
|
|
804
|
|
-<!-- >-->
|
|
805
|
|
-<!-- <div class="bg-white">-->
|
|
806
|
|
-<!-- <image :src="currentItem.image_fake" mode="widthFix" class="w-60"></image>-->
|
|
807
|
|
-<!-- <div class="bg-white p-3 flex justify-around gap-3">-->
|
|
808
|
|
-<!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
809
|
|
-<!-- <image :src="wechatImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
810
|
|
-<!-- <div>微信</div>-->
|
|
811
|
|
-<!-- </div>-->
|
|
812
|
|
-<!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
813
|
|
-<!-- <image :src="pyqImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
814
|
|
-<!-- <div>朋友圈</div>-->
|
|
815
|
|
-<!-- </div>-->
|
|
816
|
|
-<!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
817
|
|
-<!-- <image :src="bctpImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
818
|
|
-<!-- <div>保存图片</div>-->
|
|
819
|
|
-<!-- </div>-->
|
|
820
|
|
-<!-- </div>-->
|
|
821
|
|
-<!-- </div>-->
|
|
822
|
|
-
|
|
823
|
|
-<!-- </div>-->
|
|
|
797
|
+ <image :lazy-load="true" src="https://cdn.bjtdba.com/vod/image/2023-09-16/20230916194347287.png" mode="widthFix"
|
|
|
798
|
+ class="absolute top-0 right-0"></image>
|
|
|
799
|
+
|
|
|
800
|
+ <!-- <div class="flex flex-col justify-center items-center w-full h-full"-->
|
|
|
801
|
+ <!-- >-->
|
|
|
802
|
+ <!-- <div class="bg-white">-->
|
|
|
803
|
+ <!-- <image :src="currentItem.image_fake" mode="widthFix" class="w-60"></image>-->
|
|
|
804
|
+ <!-- <div class="bg-white p-3 flex justify-around gap-3">-->
|
|
|
805
|
+ <!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
|
806
|
+ <!-- <image :src="wechatImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
|
807
|
+ <!-- <div>微信</div>-->
|
|
|
808
|
+ <!-- </div>-->
|
|
|
809
|
+ <!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
|
810
|
+ <!-- <image :src="pyqImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
|
811
|
+ <!-- <div>朋友圈</div>-->
|
|
|
812
|
+ <!-- </div>-->
|
|
|
813
|
+ <!-- <div class="flex flex-col text-[12px] justify-center items-center" @tap.stop="shareImage">-->
|
|
|
814
|
+ <!-- <image :src="bctpImg" mode="widthFix" class="w-8 h-8"></image>-->
|
|
|
815
|
+ <!-- <div>保存图片</div>-->
|
|
|
816
|
+ <!-- </div>-->
|
|
|
817
|
+ <!-- </div>-->
|
|
|
818
|
+ <!-- </div>-->
|
|
|
819
|
+
|
|
|
820
|
+ <!-- </div>-->
|
|
824
|
821
|
</nut-overlay>
|
|
825
|
822
|
</template>
|
|
826
|
823
|
<style>
|
|
827
|
824
|
page {
|
|
828
|
825
|
background-color: #f8f8f8;
|
|
829
|
826
|
}
|
|
830
|
|
- button {
|
|
831
|
|
- margin: 0;
|
|
832
|
|
- padding: 0;
|
|
833
|
|
- outline: none;
|
|
834
|
|
- border-radius: 0;
|
|
835
|
|
- background-color: transparent;
|
|
836
|
|
- line-height: inherit;
|
|
837
|
|
- }
|
|
|
827
|
+
|
|
|
828
|
+button {
|
|
|
829
|
+ margin: 0;
|
|
|
830
|
+ padding: 0;
|
|
|
831
|
+ outline: none;
|
|
|
832
|
+ border-radius: 0;
|
|
|
833
|
+ background-color: transparent;
|
|
|
834
|
+ line-height: inherit;
|
|
|
835
|
+}
|
|
838
|
836
|
|
|
839
|
837
|
button::after {
|
|
840
|
838
|
border: none;
|
|
841
|
839
|
}
|
|
842
|
840
|
|
|
|
841
|
+.box-out {
|
|
|
842
|
+ background: #f8f8f8;
|
|
|
843
|
+ height: 200px;
|
|
|
844
|
+}
|
|
|
845
|
+
|
|
|
846
|
+.flex-box {
|
|
|
847
|
+ background: #ffffff;
|
|
|
848
|
+ box-shadow: 3px;
|
|
|
849
|
+ height: 80%;
|
|
|
850
|
+ display: flex;
|
|
|
851
|
+ flex-direction: column;
|
|
|
852
|
+ justify-content: space-evenly;
|
|
|
853
|
+}
|
|
|
854
|
+
|
|
|
855
|
+.img-div {
|
|
|
856
|
+ width: 100%;
|
|
|
857
|
+
|
|
|
858
|
+}
|
|
|
859
|
+
|
|
|
860
|
+.sold-out {
|
|
|
861
|
+ display: block;
|
|
|
862
|
+ width: 120px;
|
|
|
863
|
+ height: 120px;
|
|
|
864
|
+ margin: 0 auto;
|
|
|
865
|
+}
|
|
|
866
|
+
|
|
|
867
|
+.out-conter {
|
|
|
868
|
+ text-align: center;
|
|
|
869
|
+}
|
|
843
|
870
|
</style>
|
|
844
|
871
|
<route lang="yaml">
|
|
845
|
872
|
style:
|