123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602 |
- <template>
- <view class="container u-skeleton" @scroll="handlePageScroll">
- <global-loading />
- <view class="">
- <!-- 拼团滚动 -->
- <view class="news-box">
- <view class="news-bg">
- <swiper
- class="goodsImgswiper-box" :vertical="true" :circular="true" interval="8000"
- duration="2000"
- :autoplay="true"
- >
- <swiper-item v-for="(item, index) in broadCastList" :key="index">
- <view class="news-item flex-items">
- <image class="item-avatar" :src="item.headImage"></image>
- <view class="news-item-user">{{ item.name }}</view>
- <view class="news-item-info">{{ item.timeStr }}</view>
- <view v-if="item.type === 1" class="news-item-info">
- 给了好评
- </view>
- <view v-if="item.type === 2" class="news-item-info">
- 正在拼单
- </view>
- <view v-if="item.type === 3" class="news-item-info">
- 拼单成功
- </view>
- <view v-if="item.type === 4" class="news-item-info">
- 下单
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <!-- 轮播图+分享+价格名称+活动倒计时+优惠券 -->
- <GoodActivityDetail
- ref="goodActivityDetail" :sku-select="selectedSku" :product-info="productData"
- :time-active-type="timeActiveType" :mark-tools="markTools" :shop-mark-tools="shopMarkTools"
- @activityEnd="handleActivityEnd" @couponClick="handleShowCoupon"
- />
- <!-- 发货 -->
- <view class="express-box flex-items flex-row fs24 u-skeleton-fillet">
- <label class="fs24 font-color-999 mar-right-20 ">发货</label>
- <image
- v-if="productData.receive && productData.receive.receiveAdress"
- src="../../static/images/origin/mapIcon.png"
- ></image>
- <label v-if="productData.receive && productData.receive.receiveAdress" class="mar-left-10 mapName mar-right-30">
- {{ productData.receive.receiveAdress }}
- </label>
- <label>快递:¥ {{ productData.logisticsPrice || 0 }}</label>
- </view>
- <!-- 选择SKU -->
- <view class="fs24 chooseSize-box flex-start" @click=" handleShowGoodsSkuSelect(6)">
- <view class="chooseSize-content flex-items flex-row flex-sp-between u-skeleton-fillet">
- <view class="flex-row-plus ">
- <label class="fs26 mar-left-30 font-color-999">选择</label>
- <view class="valueBox mar-left-20 flex-items">
- <view v-for="(item, index) in currentSuk" :key="index" class="mar-right-10">
- {{ item.skuText || '-' }}
- </view>
- </view>
- </view>
- <image class="arrow-icon" src="../../static/images/origin/arrow.png"></image>
- </view>
- </view>
- <!-- 结合销售 -->
- <CombinedSales :pid="productId" :product-data="productData"></CombinedSales>
- <!-- 拼团 -->
- <view v-if="selectedSku.activityType === 1" class="borRig-line-20"></view>
- <!-- 拼单列表 -->
- <view v-if="selectedSku.activityType === 1 && topThreeCollageOrders.length > 0" class="goodsDiscount">
- <view class="questionTit mar-left-30 flex-items flex-row flex-sp-between">
- <label class="">这些人正在拼单</label>
- <view class="allMoreBox">
- <view class="allMore" @click="handleOpenGroupBookingList">
- 查看全部
- </view>
- <image class="evaluateAllArrow-icon mar-left-10" src="../../static/images/origin/arrow.png"></image>
- </view>
- </view>
- <view v-for="(Gitem, index) in topThreeCollageOrders" :key="index" class="groupBuy">
- <view v-if="Gitem.time > 0" class="groupBuyList">
- <view class="groupBuyItem">
- <view class="leftAvatar">
- <img :src="Gitem.headImage" alt="">
- <span>{{ Gitem.name }}</span>
- </view>
- <view class="rightInfo">
- <view class="groupBuyTime" style="width: 70%;">
- <view class="needPeople flex-row-plus">还差<b>{{ Gitem.person }}人</b>拼成</view>
- <view class="endDate">剩余{{ handleGetDownTime(Gitem.time) }}</view>
- </view>
- <view class="groupBuyBtn" @click="handleGoGroupBooking(Gitem.collageId)">
- 和Ta拼
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 评价 -->
- <GoodEvaluateAndQuestion
- ref="goodEvaluateAndQuestion" class=" u-skeleton-fillet" :product-info="productData"
- :comment-list="commentList"
- />
- <!-- 店铺 -->
- <view class="inStore-box flex-items flex-row flex-sp-between u-skeleton-fillet">
- <view class="flex-display flex-row">
- <view>
- <image class="inStore-logo default-img" :src="productData.shopLogo" @click="handleJumpToStore"></image>
- </view>
- <view class="flex-display flex-column mar-left-20">
- <label @click="handleJumpToStore">{{ productData.shopName }}</label>
- <view class="flex-display flex-row fs24 font-color-999 mar-top-5">
- <label>商品总类:{{ productData.classifyNumber }}</label>
- <label class="mar-left-30">已售:{{ productData.number }}件</label>
- </view>
- </view>
- </view>
- <view class="inStore-but" @click="handleJumpToStore">
- 去逛逛
- </view>
- </view>
- <!-- 详细信息 -->
- <view class="goodsDetails-box u-skeleton-fillet">
- <view class="goodsDetails-title">
- <view class="goodsDetails-Line"></view>
- <label class="goodsDetails-text">宝贝详情</label>
- <view class="goodsDetails-Line"></view>
- </view>
- <view class="goodsDetailsimg-box">
- <view class="">
- <rich-text :nodes="sellDescList"></rich-text>
- </view>
- </view>
- </view>
- </view>
- <!-- 底部购买 -->
- <view class="buygoods-box">
- <view class="buygoodsBut-box flex-row-plus" :style="{ 'height': (isIphone === true ? 160 : 130) + 'rpx' }">
- <view class="btns_container">
- <view class="btns flex-column-plus" @click="handleJumpToStore">
- <image class="store-icon" src="../../static/images/origin/storeIcon.png"></image>
- <label class="fs22">店铺</label>
- </view>
- <!-- #ifdef MP-WEIXIN || APP-PLUS || H5 -->
- <view class="btns flex-column-plus mar-left-10" @click="flyToService">
- <image class="store-icon" src="../../static/images/origin/service-product-detail.png"></image>
- <label class="fs22">客服</label>
- </view>
- <!-- #endif -->
- <view class="btns flex-column-plus mar-left-10 flex-items Cart" @click="handleJumpToShopCart">
- <view v-if="allCartNum > 0" class="cartAllNum">
- {{ allCartNum }}
- </view>
- <image class="store-icon" src="../../static/images/origin/gouwuche.png"></image>
- <label class="fs22">购物车</label>
- </view>
- </view>
- <view class="btns_container">
- <view v-if="productData.shelveState === 0" class="flex-row-plus offShelf">
- 商品已下架
- </view>
- <view v-else-if="selectedSku.activityType === 1" class="flex-row-plus flex-items">
- <view class="joinShopCartBut" @click=" handleShowGoodsSkuSelect(4)">
- 单独购买
- </view>
- <view class="buyNowBut" @click=" handleShowGoodsSkuSelect(3)">
- 我要开团
- </view>
- </view>
- <view v-else class="flex-row-plus flex-items">
- <view class="joinShopCartBut" @click=" handleShowGoodsSkuSelect(1)">
- 加入购物车
- </view>
- <view class="buyNowBut" @click=" handleShowGoodsSkuSelect(2)">
- 立即购买
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 回到顶部 -->
- <view class="returnTopService-box">
- <view
- class="returnTop-box flex-items-plus flex-column"
- :style="{ 'display': returnTopFlag === true ? 'flex' : 'none' }" @click="handleReturnTop"
- >
- <image class="returnTopImg" src="../../static/images/origin/backTop.png"></image>
- </view>
- </view>
- <!-- SKU选择器 -->
- <GoodSkuSelect
- ref="skuSelect" :product-data="productData" :selected-sku="selectedSku" :collage-id="collageId"
- @postSelectSku="selectSkuPostProcessor" @getCurrentSku="handleSelectSku"
- @changeCartNum="(num) => allCartNum = num"
- />
- <!-- 优惠券选择器 -->
- <CouponPopup
- ref="couponPopup" :mark-tools="markTools" :shop-mark-tools="shopMarkTools" :set-top="topLeft"
- :current-active="currentActive"
- ></CouponPopup>
- <!-- 拼单弹框 -->
- <u-popup
- v-model="showGroupBuyList" class="popupDiscount" mode="center" border-radius="14"
- close-icon-pos="top-right"
- close-icon-size="20"
- >
- <view class="popupDiscountTit">这些人正在拼单</view>
- <view class="groupBuy">
- <view class="groupBuyList">
- <scroll-view style="height: 480upx;" scroll-y>
- <view v-for="(aitem, index) in selectedSku.collageOrders" :key="index" class="groupBuyItem1">
- <view v-if="aitem.time > 0" class="leftAvatar">
- <img :src="aitem.headImage" alt="">
- <view class="groupBuyTime">
- <view class="needPeople">
- <span>{{ aitem.name }}</span>还差<b>{{ aitem.person }}人</b>
- </view>
- <view class="endDate">剩余{{ handleGetDownTime(aitem.time) }}</view>
- </view>
- </view>
- <view v-if="aitem.time > 0" class="rightInfo">
- <view class="groupBuyBtn" @click="handleGoGroupBooking(aitem.collageId)">
- 和Ta拼
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </u-popup>
- <!-- 骨架屏 -->
- <Skeleton el-color="#efefef" bg-color="#fff" :loading="isFirstComeIn && loading" :animation="true"></Skeleton>
- </view>
- </template>
- <script>
- import Skeleton from '../../components/Skeleton'
- import UButton from '../../uview-ui/components/u-button/u-button'
- import CombinedSales from '@/components/activities/combinedSales'
- import CouponPopup from '../../components/goodsDetalils/coupon-popup'
- import { Services } from '../../utils/services'
- import GoodEvaluateAndQuestion from './components/GoodEvaluateAndQuestion'
- import GoodActivityDetail from './components/GoodActivityDetail'
- import GoodSkuSelect from './components/GoodSkuSelect'
- import { TimeFormatting } from '../../utils/timeUtil'
- import USkeleton from '../../uview-ui/components/u-skeleton/u-skeleton'
- import { J_STORAGE_KEY } from '../../config/constant'
- const NET = require('../../utils/request')
- const API = require('../../config/api')
- export default {
- name: 'GoodsDetails',
- components: {
- USkeleton,
- Skeleton,
- CouponPopup,
- CombinedSales,
- UButton,
- GoodEvaluateAndQuestion,
- GoodActivityDetail,
- GoodSkuSelect
- },
- data() {
- return {
- isFirstComeIn: true,
- loading: true,
- isIphone: '',
- returnTopFlag: false, // 回到顶部
- productId: '', // 商品ID,有可能屎缓存数据
- shopGroupWorkId: null, // 拼团数据ID
- topThreeCollageOrders: {}, // 当前商品拼单数据
- collageId: 0, // 去拼团时的拼单ID
- broadCastList: [], // 拼团滚动数据
- showGroupBuyList: false, // 是否展示拼单弹窗
- shopGroupWorkTicker: null, // 拼团倒计时定时器
- paramSkuId: null, // 秒杀商品ID
- // 商品详情
- productData: {},
- // 当前选中SKU
- selectedSku: {},
- currentSuk: [], // 选中的SKU(子组件给当前页面做数据渲染)
- buyNum: 1, // 当前选取的SKU购买数量
- storeId: '', // 店铺ID
- commentList: [], // 商品评价列表
- sellDescList: '', // 商品详情长图(富文本)
- timeActiveType: true, // 是否开启活动(非则预热)
- btnType: 1, // 拉起SKU窗口的按钮类型 1加入购物车 2立即购买 3开团 4单独购买 6选择SKU
- allCartNum: 0, // 购物车数量
- markTools: [], // 平台优惠券
- shopMarkTools: [], // 店铺优惠券
- currentActive: 0, // 优惠券选项卡类型
- topLeft: 0, // 距离顶部(返回顶部使用)
- // 埋点对象
- pointOption: {
- inTime: null,
- data: {
- eventType: 1,
- productIds: ''
- }
- }
- }
- },
- created() {
- if (this.ticker) { // 这一段是防止进入页面出去后再进来计时器重复启动
- clearInterval(this.ticker)
- }
- if (this.allCartNum > 99) {
- this.allCartNum = '...'
- }
- },
- beforeDestroy() {
- },
- onShow() {
- },
- onLoad(options) {
- // 页面滚动条归0,不然骨架屏有问题
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- })
- this.productData = {
- logisticsPrice: 0,
- images: ['123', '123', '123'],
- productName: '....',
- ifCollect: 1
- }
- this.selectedSku = {
- activityType: 0,
- originalPrice: 0
- }
- if (options.detail) {
- options = this.$getJumpParam(options)
- }
- this.isFirstComeIn = true
- this.loading = true
- let salesId = null
- this.pointOption.inTime = new Date().getTime()
- this.isIphone = getApp().globalData.isIphone
- const item = getApp().globalData.productShareItem
- if (item) {
- const item = getApp().globalData.productShareItem
- this.shopId = parseInt(item.shopId)
- this.productId = item.productId
- this.paramSkuId = item.skuId
- salesId = parseInt(item.salesId)
- getApp().globalData.productShareItem = undefined
- } else {
- this.shopId = parseInt(options.shopId)
- this.productId = options.productId
- this.paramSkuId = options.skuId
- salesId = parseInt(options.salesId)
- }
- // 判断是否是拼团
- if (options.shopGroupWorkId) {
- this.shopGroupWorkId = options.shopGroupWorkId
- }
- this.handleGetProductDetail()
- // 绑定分销关系
- salesId && this.shopId ? this.bindSalesCustomer(salesId, this.shopId) : ''
- this.allCartNum = uni.getStorageSync('allCartNum')
- },
- onUnload() {
- // 判断是否要埋点
- const nowTime = new Date().getTime()
- if (nowTime - this.pointOption.inTime >= 5000) {
- // 埋点
- this.pointOption.data.productIds = this.productId
- this.$store.dispatch('app/doPointer', this.pointOption.data)
- }
- // 销毁平团倒计时计时器
- if (this.shopGroupWorkTicker) {
- clearInterval(this.shopGroupWorkTicker)
- this.shopGroupWorkTicker = null
- }
- },
- mounted() {
- },
- onPageScroll(e) {
- this.returnTopFlag = e.scrollTop > 600
- this.topLeft = e.scrollTop
- },
- methods: {
- /**
- * 页面滚动事件
- * @param e
- */
- handlePageScroll(e) {
- this.topLeft = e.scrollTop
- },
- /**
- * 选取sku
- * @param skuObj:{currentSuk:object,selectedSku:object,buyNum:number}
- */
- handleSelectSku(skuObj) {
- this.currentSuk = skuObj.currentSku
- this.selectedSku = skuObj.skuItem
- this.buyNum = skuObj.buyNum
- },
- /**
- * 选择sku后置方法
- * 判断有无活动等操作
- */
- selectSkuPostProcessor() {
- const ifEnable = this.selectedSku.ifEnable
- if (this.selectedSku.activityType === 1 && ifEnable === 0) {
- this.topThreeCollageOrders = this.selectedSku.collageOrders.slice(0, 3)
- }
- if ([1, 2, 3, 4, 5].includes(this.selectedSku.activityType) && ifEnable === 0) {
- this.$refs.goodActivityDetail.handleGetCountDownNumber(this.selectedSku.endTime)
- }
- this.timeActiveType = ifEnable === 0
- },
- /**
- * 获取拼团滚动数据
- */
- async handleGetGroupBookingRollList() {
- const param = {
- productId: this.productId,
- shopGroupWorkId: this.shopGroupWorkId ?? undefined
- }
- const res = await NET.request(API.GetBroadCastList, param, 'GET')
- this.broadCastList = res.data
- },
- /**
- * 和他人拼单
- * @param collageId 已存在的拼团订单ID
- */
- handleGoGroupBooking(collageId) {
- this.showGroupBuyList = false
- this.collageId = collageId
- this.$refs.skuSelect.goodsDetailShowFlag = true
- },
- /**
- * 设置拼团倒计时
- */
- handleSetDownTime() { // 这个计时器是每秒减去数组中指定字段的时间
- let productHaveCollageOrder = false
- // 判断sku组合中是否存在拼单
- const skuCollects = this.productData.map
- for (const skuCollectItemKey in skuCollects) {
- const collageOrders = skuCollects[skuCollectItemKey].collageOrders
- if (collageOrders && collageOrders.length > 0) {
- productHaveCollageOrder = true
- break
- }
- }
- if (!productHaveCollageOrder) return
- this.shopGroupWorkTicker = setInterval(() => {
- for (const skuCollectItemKey in skuCollects) {
- const collageOrders = skuCollects[skuCollectItemKey].collageOrders
- if (collageOrders && collageOrders.length > 0) {
- collageOrders.forEach((collageItem) => {
- collageItem.time > 0 ? collageItem.time -= 1000 : ''
- })
- }
- }
- }, 1000)
- },
- /**
- * 根据时间戳获取格式化时间(处理计时器)
- * @param remainMillSecs 毫秒,还有多久结束
- * @return {string}
- */
- handleGetDownTime(remainMillSecs) {
- if (remainMillSecs <= 0) {
- clearInterval(this.shopGroupWorkTicker)
- this.shopGroupWorkTicker = null
- this.handleGetProductDetail()
- }
- const timeFormatting = TimeFormatting(remainMillSecs / 1000)
- return `${timeFormatting.hour}:${timeFormatting.min}:${timeFormatting.sec}`
- },
- /**
- * 跳转到购物车
- */
- handleJumpToShopCart() {
- this.$jumpToTabbar('../../pages/tabbar/cart/index')
- },
- /**
- * 跳转到店铺
- */
- handleJumpToStore() {
- this.$jump(`../store/index?storeId=${this.shopId}`)
- },
- /**
- * 返回头部
- */
- handleReturnTop() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 300
- })
- },
- /**
- * 打开SKU弹窗
- * @param type 1加入购物车 2立即购买 3开团 4单独购买 6选择SKU
- */
- handleShowGoodsSkuSelect(type) {
- // 为type情况时,绝不可能为和他人拼单
- this.collageId = 0
- this.$refs.skuSelect.btnType = type
- this.$refs.skuSelect.goodsDetailShowFlag = true
- },
- /**
- * 打开优惠券弹窗
- */
- handleShowCoupon() {
- this.$refs.couponPopup.showActivity = true
- },
- /**
- * 活动商品时间到后置方法
- * 供GoodActivityDetail组件调用
- */
- handleActivityEnd() {
- this.selectedSku.activityType = 0
- location.reload()
- },
- /**
- * 获取商品详情
- */
- async handleGetProductDetail() {
- this.loading = true
- // uni.showLoading({
- // title: '加载中...',
- // mask: true
- // })
- try {
- const postData = {
- shopId: this.shopId,
- productId: this.productId,
- skuId: this.paramSkuId,
- terminal: 1
- }
- const res = await NET.request(API.QueryProductDetail, postData, 'GET')
- this.isFirstComeIn = false
- this.loading = false
- this.productData = res.data
- this.markTools = res.data.markTools // 平台优惠券
- this.shopMarkTools = res.data.shopMarkTools // 店铺优惠券
- this.currentActive = this.markTools.length === 0 && this.shopMarkTools.length > 0 ? 1 : 0
- // 处理单规格商品,如果是单款式商品,需要特殊处理productData.names
- const skuCollectionList = this.productData.map
- const skuCollectionListKeys = Object.keys(skuCollectionList)
- if (skuCollectionListKeys.length === 1 && skuCollectionListKeys[0] === '单款项') {
- this.productData.names[0].values.push({
- skuValue: this.productData.names[0].skuName,
- valueCode: '单款项'
- })
- }
- // 如果sku的图像为空,设置为商品的图像
- for (const key in skuCollectionList) {
- if (!skuCollectionList[key].image) {
- skuCollectionList[key].image = this.productData.images[0]
- }
- }
- // 评价
- this.commentList = res.data.comments
- // 宝贝详情
- this.sellDescList = res.data.text.replace(
- /\<img/gi,
- '<img style="max-width:100%;height:auto" '
- )
- // 渲染商详之后,如果参数传了skuId,则选中该skuId,否则选中第一个规格
- this.$nextTick(async () => {
- if (this.paramSkuId) {
- this.$refs.skuSelect.handleSelectBySkuId(this.paramSkuId)
- } else {
- // 默认选中第0个
- for (const skuRowItem of this.productData.names) {
- this.$refs.skuSelect.handleClickSkuItem(skuRowItem.nameCode, skuRowItem.values[0].valueCode)
- }
- }
- // 如果是拼团,设置拼团id
- if (this.productData.activityType === 1) {
- this.shopGroupWorkId = this.productData.shopGroupWorkId
- await this.handleGetGroupBookingRollList()
- this.handleSetDownTime()
- }
- await this.$refs.goodEvaluateAndQuestion.handleGetProblemList()
- })
- } finally {
- uni.hideLoading()
- // this.loading = false
- }
- },
- /**
- * 绑定分销关系
- * @param salesId 分销员ID
- * @param storeId 店铺ID
- */
- bindSalesCustomer(salesId, storeId) {
- // 如果已登录,静默绑定客户关系,否则跳转到登录页面
- if (!uni.getStorageSync(J_STORAGE_KEY)) {
- uni.setStorageSync('salesId', salesId)
- uni.setStorageSync('shopId', storeId)
- uni.navigateTo({
- url: '../../pages_category_page2/userModule/login'
- })
- return
- }
- NET.request(API.BindSalesCustomer, {
- shopId: storeId,
- distributorId: salesId
- }, 'POST').then((res) => {
- })
- },
- /**
- * 打开拼团列表
- */
- handleOpenGroupBookingList() {
- if (this.topThreeCollageOrders.length > 0) {
- this.showGroupBuyList = true
- } else {
- uni.showToast({
- title: '还没有人拼单,快去拼单吧!',
- icon: 'none'
- })
- }
- },
- /**
- * 打开客服
- * @return {Promise<void>}
- */
- async flyToService() {
- (await Services(this.shopId)).flyToService()
- }
- }
- }
- </script>
- <style>
- .page {
- background-color: #F7F7F7;
- }
- </style>
- <style
- scoped
- lang="scss"
- >
- .page {
- background-color: #F7F7F7;
- }
- .news-box {
- position: fixed;
- left: 20rpx;
- top: 200rpx;
- z-index: 9999;
- .news-bg {
- width: 450rpx;
- height: 70rpx;
- overflow: hidden;
- .news-item {
- background: rgba(0, 0, 0, 0.75);
- border-radius: 16rpx;
- height: 70rpx;
- color: #FFFFFF;
- font-size: 24rpx;
- padding: 0 20rpx;
- width: 450rpx;
- .item-avatar {
- width: 50rpx;
- height: 50rpx;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- }
- }
- }
- .tabsbox {
- width: 100%;
- margin-top: 20rpx;
- background-color: #FFFFFF;
- }
- .checkimg {
- width: 40rpx;
- height: 40rpx;
- margin-right: 30rpx;
- }
- .container {
- padding-bottom: 180upx;
- .arrow-icon {
- width: 16rpx;
- height: 24rpx;
- }
- .goodgDes-box {
- background-color: #FFFFFF;
- width: 100%;
- padding-bottom: 25rpx;
- .priceBuyNum-box {
- width: 677rpx;
- margin-top: 30rpx;
- }
- .nameContainer {
- display: flex;
- .goodsName-box {
- width: 677rpx;
- height: 85rpx;
- .img618-cion {
- width: 70rpx;
- height: 36rpx;
- }
- }
- .collectBox {
- width: 80rpx;
- margin: 0 30rpx 0 15rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- .store-icon {
- width: 48rpx;
- height: 48rpx;
- }
- }
- .discounts-box {
- margin-top: 20rpx;
- .discounts-text {
- margin-left: 10rpx;
- color: #FF7800;
- background-color: #FFE4CC;
- padding: 6rpx 12rpx;
- border-radius: 4rpx;
- }
- }
- .activity-box {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: flex-end;
- border-top: 1upx solid #EDEDED;
- .activity-content {
- width: 614rpx;
- padding-top: 20rpx;
- .activity-text {
- color: #FF7700;
- border: 1rpx solid #FF7700;
- padding: 6rpx 23rpx;
- }
- .coupon-arrow {
- width: 16rpx;
- height: 24rpx;
- margin-left: 15rpx;
- }
- }
- }
- }
- .express-box {
- height: 100rpx;
- background-color: #FFFFFF;
- padding-left: 30rpx;
- border-top: 12rpx solid #F8F8F8;
- border-bottom: 12rpx solid #F8F8F8;
- image {
- width: 21rpx;
- height: 27rpx;
- }
- .expressSite-icon {
- width: 30rpx;
- height: 30rpx;
- }
- .mapName {
- position: relative;
- &:before {
- content: '';
- width: 2rpx;
- height: 30rpx;
- background: #CCCCCC;
- display: block;
- position: absolute;
- right: -16rpx;
- top: 5rpx;
- }
- }
- }
- .chooseSize-box {
- height: 90rpx;
- background-color: #FFFFFF;
- margin: 10rpx 0;
- .chooseSize-content {
- width: 100%;
- }
- }
- .questionTit {
- height: 90rpx;
- border-bottom: 1rpx solid #EEEEEE;
- margin-right: 35rpx;
- color: #333333;
- font-size: 30rpx;
- .allMoreBox {
- display: flex;
- align-items: center;
- color: #999999;
- font-size: 24rpx;
- .evaluateAllArrow-icon {
- width: 18rpx;
- height: 24rpx;
- }
- }
- }
- .shopEvaList {
- display: flex;
- padding: 30rpx;
- flex-wrap: wrap;
- border-bottom: 20rpx solid #EEEEEE;
- .shopEvaItem {
- padding: 0 14rpx;
- height: 60rpx;
- background: #ffe4cc;
- border-radius: 6rpx;
- line-height: 60rpx;
- text-align: center;
- font-size: 28rpx;
- color: #666666;
- margin: 0 20rpx 20rpx 0;
- }
- }
- .storeEvaluate-box {
- background-color: #FFFFFF;
- margin-top: 20rpx;
- .storeEvaluate {
- width: 690rpx;
- padding: 20rpx 0;
- border-bottom: 1rpx solid #EDEDED;
- }
- .storeEvaluateTag-box {
- margin-top: 10rpx;
- margin-left: 10rpx;
- padding-bottom: 30rpx;
- display: flex;
- flex-wrap: wrap;
- .storeEvaluateTag-text {
- background-color: #FFE4CC;
- border-radius: 6rpx;
- padding: 16rpx 14rpx;
- color: #656565;
- margin-left: 20rpx;
- margin-top: 20rpx;
- }
- }
- }
- .inStore-box {
- background-color: #FFFFFF;
- margin-top: 20rpx;
- padding: 20rpx 30rpx;
- .inStore-logo {
- width: 70rpx;
- height: 70rpx;
- }
- .inStore-but {
- width: 140rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: left;
- font-size: 24rpx;
- color: #FFEBC4;
- background: #333333;
- padding-left: 20rpx;
- position: relative;
- &:before {
- content: '';
- width: 60rpx;
- height: 60rpx;
- background: url("../../static/images/origin/arrow2.png") no-repeat center center;
- background-size: contain;
- display: block;
- position: absolute;
- right: 0;
- }
- }
- }
- .goodsDetails-box {
- background-color: #FFFFFF;
- margin-top: 20rpx;
- padding: 20rpx 30rpx;
- .goodsDetails-title {
- display: flex;
- flex-direction: row;
- align-items: center;
- .goodsDetails-Line {
- width: 265rpx;
- border-bottom: 1rpx solid #EDEDED;
- }
- .goodsDetails-text {
- padding: 0 22rpx;
- }
- }
- .goodsDetailsimg-box {}
- }
- .priceExplain-box {
- background-color: #FFFFFF;
- margin-top: 20rpx;
- padding: 20rpx 30rpx;
- .priceExplain-title {
- display: flex;
- flex-direction: row;
- align-items: center;
- .priceExplain-Line {
- width: 265rpx;
- border-bottom: 1rpx solid #EDEDED;
- }
- .priceExplain-text {
- padding: 0 22rpx;
- }
- }
- .priceExplain-dot {
- width: 9rpx;
- height: 9rpx;
- border: 1rpx solid #FF7700;
- border-radius: 50%;
- background-color: #FF7700;
- }
- }
- .buygoods-box {
- position: fixed;
- bottom: 0rpx;
- box-sizing: border-box;
- z-index: 999;
- .groupByInfo {
- background: #fffbe9;
- padding: 0 30rpx;
- height: 80rpx;
- .groupByInfoBox {
- height: 80rpx;
- }
- .groupByLeft {
- .groupByAvatar {
- margin-right: 15rpx;
- }
- img {
- width: 50rpx;
- height: 50rpx;
- }
- .name {
- font-size: 24rpx;
- }
- .groupByNum {
- margin-right: 10rpx;
- }
- .groupByTime {
- color: #333333;
- }
- }
- .groupByBtn {
- height: 60rpx;
- background: #333333;
- color: #FFEBC4;
- font-size: 14rpx;
- line-height: 60rpx;
- text-align: center;
- padding: 0 20rpx;
- }
- }
- .buygoodsBut-box {
- background-color: #FFFFFF;
- width: 750rpx;
- padding: 20rpx 32rpx;
- box-shadow: 0rpx 0rpx 10rpx 1rpx #EDEDED;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- .btns_container {
- display: flex;
- align-items: center;
- }
- .btns {
- width: 80rpx;
- }
- .Cart {
- position: relative;
- .cartAllNum {
- position: absolute;
- width: 30rpx;
- height: 30rpx;
- line-height: 30rpx;
- text-align: center;
- font-size: 17rpx;
- color: #FFFFFF;
- background: #C5AA7B;
- border-radius: 50%;
- opacity: 1;
- z-index: 999;
- }
- // #ifdef APP
- .cartAllNum {
- right: -6rpx;
- top: -6rpx;
- }
- // #endif
- /* #ifdef H5 */
- .cartAllNum {
- right: -10rpx;
- top: -6rpx;
- }
- /* #endif */
- /* #ifdef MP-WEIXIN */
- .cartAllNum {
- right: -3rpx;
- top: 0;
- }
- /* #endif */
- }
- .store-icon {
- width: 48rpx;
- height: 48rpx;
- }
- .joinShopCartBut {
- width: 190rpx;
- height: 80rpx;
- background-color: #FFFFFF;
- color: #333333;
- font-size: 28rpx;
- line-height: 80rpx;
- border: 2rpx solid #333333;
- text-align: center;
- margin-left: 40rpx;
- box-sizing: border-box;
- }
- .buyNowBut {
- width: 190rpx;
- height: 80rpx;
- background: #333333;
- color: #FFEBC4;
- font-size: 28rpx;
- line-height: 80rpx;
- text-align: center;
- margin-left: 16rpx;
- }
- .offShelf {
- background: #b7b7b7;
- border-radius: 50rpx;
- width: 360rpx;
- margin-left: 50rpx;
- line-height: 80rpx;
- height: 80rpx;
- justify-content: center;
- color: #333333;
- }
- }
- }
- .returnTopService-box {
- position: fixed;
- bottom: 160rpx;
- right: 30rpx;
- .fs16 {
- font-size: 16rpx;
- }
- .returnTop-box {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- background: #FFFFFF;
- opacity: 0.8;
- .returnTopImg {
- width: 58rpx;
- height: 58rpx;
- }
- }
- .serviceImg-box {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- background-color: #FFFFFF;
- box-shadow: 0rpx 0rpx 5rpx 3rpx #999999;
- .serviceImg {
- width: 36rpx;
- height: 36rpx;
- display: block;
- background: url("../../static/images/origin/serviceImg.png") no-repeat center center;
- background-size: contain;
- }
- }
- }
- .parameterShow-box {
- .parameter-title {
- width: 100%;
- text-align: center;
- padding-bottom: 36rpx;
- }
- .parameter-modle {
- width: 690rpx;
- padding-bottom: 36rpx;
- font-size: 26rpx;
- }
- .parameterTruebut-box {
- background-color: #FFFFFF;
- padding: 20rpx 0;
- .parameterTruebut {
- width: 690rpx;
- height: 80rpx;
- background-image: linear-gradient(135deg, #FFA100 10%, #FF7911 100%);
- color: #FFFFFF;
- border-radius: 40rpx;
- line-height: 80rpx;
- text-align: center;
- font-size: 26rpx;
- }
- }
- }
- .couponShow-box {
- .couponShow {
- z-index: 333;
- height: 1000rpx;
- .couponTitle-box {
- width: 100%;
- }
- .coupon-title-active {
- color: #FF7700;
- border-bottom: 2rpx solid #FF7700;
- padding-bottom: 30rpx;
- }
- .usableCoupon-content {
- padding: 30rpx 0;
- .usableCoupon-box {
- width: 690rpx;
- height: 140rpx;
- border-radius: 10rpx;
- background-color: #FFE9D8;
- .immediateUse-but {
- color: #FF7800;
- border-radius: 30rpx;
- padding: 0 40rpx;
- border-left: 3rpx solid #EBD7C7;
- height: 140rpx;
- border-radius: 60rpx;
- line-height: 140rpx;
- font-weight: bold;
- }
- }
- }
- }
- }
- .succeedShow-box {
- position: absolute;
- top: 220rpx;
- left: 185rpx;
- .succeedShow {
- background-color: #7F7F7F;
- width: 380rpx;
- height: 280rpx;
- border-radius: 10rpx;
- opacity: 0.8;
- .couponSucceedImg {
- width: 200rpx;
- height: 130rpx;
- }
- }
- }
- }
- .activity-box {
- display: flex;
- flex-direction: column;
- width: 100%;
- height: 100%;
- .title-box {
- width: 100%;
- height: 100upx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- position: relative;
- border-bottom: solid 1px #EEEEEE;
- }
- }
- .activity-coupon-box {
- display: flex;
- flex-direction: column;
- width: 100%;
- overflow: auto;
- flex: 1;
- }
- .content-box {
- width: 100%;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- padding: 30rpx;
- }
- .tag-box {
- width: 100%;
- box-sizing: border-box;
- height: 80rpx;
- line-height: 80rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #FF7911;
- }
- .label-lingqu {
- width: 100%;
- font-weight: 500;
- color: rgba(51, 51, 51, 1);
- }
- .coupon-item {
- width: 690rpx;
- height: 120rpx;
- border-radius: 10rpx;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-top: 20rpx;
- flex-shrink: 0;
- background-color: #FFE9D8;
- }
- .money-box {
- width: 160rpx;
- box-sizing: border-box;
- padding-left: 30rpx;
- font-weight: 500;
- color: #FF7911;
- }
- .info-box {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- color: rgba(255, 121, 17, 1);
- }
- .receive-btn {
- width: 200rpx;
- height: 120rpx;
- background: rgba(255, 233, 216, 1);
- box-shadow: 0px 0px 5rpx 0px rgba(102, 102, 102, 0.35);
- line-height: 120rpx;
- text-align: center;
- font-size: 28rpx;
- font-weight: bold;
- color: rgba(255, 121, 17, 1);
- border-bottom-right-radius: 10rpx;
- border-top-right-radius: 10rpx;
- border-top-left-radius: 120rpx;
- border-bottom-left-radius: 120rpx;
- }
- .received {
- background: #f1f1f1;
- color: #999;
- }
- .canvas-box {
- display: block;
- position: absolute;
- top: 100rpx;
- }
- .sceneMarketingBox {
- width: 100%;
- background: url("../../static/images/origin/sceneMarketingDetailsIcon.png"
- ) no-repeat center;
- padding: 20rpx 30rpx;
- background-size: cover;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .sceneNameBox {
- width: 220rpx;
- text-align: center;
- color: #C83732;
- font-size: 20rpx;
- }
- }
- .goodsDiscount {
- .groupBuy {
- .groupBuyList {
- .groupBuyItem {
- padding: 0 30rpx;
- height: 116rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1rpx solid #EEEEEE;
- .leftAvatar {
- display: flex;
- align-items: center;
- width: 50%;
- img {
- width: 72rpx;
- height: 72rpx;
- margin-right: 10rpx;
- border-radius: 50%;
- }
- }
- .rightInfo {
- display: flex;
- align-items: center;
- width: 50%;
- .groupBuyTime {
- .needPeople {
- font-size: 28rpx;
- color: #333333;
- margin-bottom: 10rpx;
- font-weight: 400;
- b {
- color: #C5AA7B;
- font-weight: 400;
- }
- }
- .endDate {
- color: #666666;
- }
- }
- .groupBuyBtn {
- width: 140rpx;
- height: 60rpx;
- line-height: 60rpx;
- background: #333333;
- text-align: center;
- color: #FFEBC4;
- font-size: 24rpx;
- }
- }
- }
- }
- }
- }
- .popupDiscount {
- padding-bottom: 70rpx;
- .popupDiscountTit {
- font-size: 36rpx;
- color: #333333;
- height: 105rpx;
- line-height: 105rpx;
- text-align: center;
- border-bottom: 1rpx solid #EEEEEE;
- }
- .groupBuy {
- padding-bottom: 80rpx;
- .groupBuyList {
- .groupBuyItem1 {
- padding: 0 30rpx;
- height: 116rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1rpx solid #EEEEEE;
- .leftAvatar {
- display: flex;
- align-items: center;
- img {
- width: 72rpx;
- height: 72rpx;
- margin-right: 10rpx;
- border-radius: 50%;
- }
- .groupBuyTime {
- margin-right: 80rpx;
- margin-bottom: 10rpx;
- width: 320rpx;
- .needPeople {
- font-size: 26rpx;
- color: #333333;
- span {
- color: #333333;
- padding-right: 10rpx;
- }
- b {
- color: #C5AA7B;
- font-weight: 400;
- }
- }
- .endDate {
- color: #333333;
- opacity: 0.7;
- font-size: 24rpx;
- }
- }
- }
- .rightInfo {
- display: flex;
- align-items: center;
- .groupBuyBtn {
- width: 140rpx;
- height: 70rpx;
- line-height: 70rpx;
- background: #333333;
- text-align: center;
- color: #FFEBC4;
- font-weight: 400;
- }
- }
- }
- }
- }
- }
- .combination {
- padding: 0 20rpx;
- .combinationList {
- width: 100%;
- height: 680rpx;
- background: #333333;
- box-shadow: 0 20rpx 30rpx rgba(0, 0, 0, 0.3);
- border-radius: 20rpx;
- .combinationTitle {
- padding: 32rpx 20rpx 0 30rpx;
- image {
- width: 211rpx;
- height: 33rpx;
- }
- .combinationPrice {
- padding: 0 20px;
- height: 50rpx;
- background: linear-gradient(90deg, #C83732 0%, #E25C44 100%);
- box-shadow: 0 6rpx 12rpx rgba(233, 0, 0, 0.3);
- border-radius: 26rpx;
- line-height: 50rpx;
- text-align: center;
- color: #FFFFFF;
- opacity: 0.8;
- }
- }
- .buyBtn {
- width: 96%;
- height: 84rpx;
- line-height: 84rpx;
- border: 2rpx solid rgba(0, 0, 0, 0);
- background: linear-gradient(88deg, #C5AA7B 0%, #FFEBC4 100%);
- text-align: center;
- color: #333333;
- margin: 0 auto;
- }
- }
- }
- </style>
|