2022-03-24 17:32:26 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<page-meta :page-style="'overflow:'+(ifShowPageMeta?'hidden':'visible')"></page-meta>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view>
|
|
|
|
|
|
<!-- 顶部操作条 -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<cu-custom :bgColor="'bg-white'" :isBack="true" :isBackHome="false" :homePageUrl="'/pages/index/index'">
|
|
|
|
|
|
<block slot="backText">返回</block>
|
2022-04-23 23:13:29 +08:00
|
|
|
|
<!-- <block slot="backHomeText">首页</block> -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<block slot="content">商品详情</block>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</cu-custom>
|
|
|
|
|
|
<!-- 导航栏 -->
|
|
|
|
|
|
<uni-transition class="fixed-top-bar" mode-class="fade" :show="showTopNav">
|
2022-08-25 00:11:43 +08:00
|
|
|
|
<view class="grid text-center col-2 solid-top solid-bottom bg-white">
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="padding" :class="curTopNav == 0 ? 'bg-blue' : ''" @click.stop="clickNav(0)">服务</view>
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<!-- <view class="padding" :class="curTopNav == 1 ? 'bg-blue' : ''" @click.stop="clickNav(1)">评价</view> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="padding" :class="curTopNav == 2 ? 'bg-blue' : ''" @click.stop="clickNav(2)">详情</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</uni-transition>
|
2023-03-18 23:58:52 +08:00
|
|
|
|
<!-- 轮播图,视频 :autoplay="!productVideoPlaying" interval="5000" duration="500"-->
|
|
|
|
|
|
<swiper :class="changeSwiperHeight ? 'sm-screen-swiper' : 'sm-screen-swiper lg-screen-swiper'" @change="changeSwiper">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<swiper-item v-if="productDetail.goodsVideoUrl">
|
2022-06-22 17:38:20 +08:00
|
|
|
|
<video style="width: 100%; height: 100%;" id="productVideo" :src="productDetail.goodsVideoUrl" :controls="true" :autoplay="false"
|
2022-08-29 19:16:34 +08:00
|
|
|
|
:show-center-play-btn="true" :show-fullscreen-btn="true"></video>
|
2022-05-28 18:45:27 +08:00
|
|
|
|
</swiper-item>
|
|
|
|
|
|
<swiper-item v-for="(item,index) in swiperList" :key="item.goodsImgsId" @click="clickSwiper($event, item, 1)">
|
2022-06-22 17:38:20 +08:00
|
|
|
|
<image style="width: 100%; height: 100%;" :src="item.imgUrl" mode="aspectFit"></image>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</swiper-item>
|
|
|
|
|
|
</swiper>
|
|
|
|
|
|
<!-- 价格及活动栏 -->
|
|
|
|
|
|
<view class="bg-gradual-color padding-sm margin-bottom-xs shadow-blur">
|
|
|
|
|
|
<view class="flex justify-between align-center">
|
2022-06-01 00:36:46 +08:00
|
|
|
|
<view v-if="curProductSpecs.discountPrice">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<text class="text-sl text-price">{{curProductSpecs.discountPrice}}</text>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<text class="text-del">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<text class="text-xxl">¥{{curProductSpecs.goodsPrice}}</text>
|
2022-07-24 11:41:33 +08:00
|
|
|
|
</text>
|
|
|
|
|
|
<text class="margin-left-xs text-xxl">/{{curProductSpecs.goodsUnit}}</text>
|
2022-06-01 00:36:46 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view v-else>
|
|
|
|
|
|
<text class="text-sl text-price">{{curProductSpecs.goodsPrice}}</text>
|
2022-07-24 11:41:33 +08:00
|
|
|
|
<text class="margin-left-xs text-xxl">/{{curProductSpecs.goodsUnit}}</text>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view>
|
2022-07-24 11:41:33 +08:00
|
|
|
|
<text class="text-df">已售:{{curProductSpecs.saleNum}}</text>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view id="pageAnchor0" class="flex justify-between align-end">
|
2023-02-11 11:30:56 +08:00
|
|
|
|
<view class="text-df" v-if="curUserInfo.placeStatus === 2">
|
2023-02-12 04:15:45 +08:00
|
|
|
|
佣金:<text class="text-price margin-right-sm">{{curProductSpecs.finalPrice ? curProductSpecs.finalPrice : 0}}</text>
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<!-- <text class="cuIcon-share"></text> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<!-- <view class="text-df">
|
|
|
|
|
|
距结束:<uni-countdown style="float: right;" :day="1" :hour="1" :minute="12" :second="40" background-color="#fff" splitorColor="#fff"></uni-countdown>
|
|
|
|
|
|
</view> -->
|
|
|
|
|
|
<view class="flex justify-end text-df align-center">
|
2022-06-27 17:30:14 +08:00
|
|
|
|
<!-- <view>距结束:</view> -->
|
|
|
|
|
|
<!-- <uni-countdown style="float: right;" :day="1" :hour="1" :minute="12" :second="40"
|
|
|
|
|
|
background-color="#fff" splitorColor="#fff"></uni-countdown> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 产品概要 -->
|
|
|
|
|
|
<view class="bg-white padding-sm">
|
|
|
|
|
|
<view class="flex justify-between text-df align-center">
|
2022-08-25 00:11:43 +08:00
|
|
|
|
<view class="padding-right-sm text-left">
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="text-xl">
|
2023-02-12 04:15:45 +08:00
|
|
|
|
<view class='cu-tag round bg-orange light' v-if="productDetail.servActivity">
|
|
|
|
|
|
<text>{{productDetail.servActivity}}</text>
|
2023-03-18 23:58:52 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class='cu-tag round light bg-blue padding-lr-sm' v-if="productDetail.deptGoodsCategoryName">
|
|
|
|
|
|
<text v-if="productDetail.parGoodsCategoryName">
|
|
|
|
|
|
{{productDetail.parGoodsCategoryName}}
|
|
|
|
|
|
<text class="margin-lr-xs">/</text>
|
|
|
|
|
|
</text>
|
|
|
|
|
|
<text>{{productDetail.deptGoodsCategoryName}}</text>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
2022-05-28 18:45:27 +08:00
|
|
|
|
{{productDetail.goodsName}}
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
2022-07-24 11:41:33 +08:00
|
|
|
|
<view class="text-sm text-gray margin-top-xs">{{productDetail.goodsDesc}}</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
2022-08-25 00:11:43 +08:00
|
|
|
|
<view class="text-xl text-right padding-lr solid-left">
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<!-- <view class="margin-tb-xs"><text class="cuIcon-share"></text></view> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view v-if="productInfo.isGoldServ" class="margin-tb-xs text-orange"><text
|
|
|
|
|
|
class="cuIcon-friendfamous"></text></view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 服务保障和规格 -->
|
2023-02-12 04:15:45 +08:00
|
|
|
|
<view class="margin-lr-sm padding margin-top-sm bg-white">
|
|
|
|
|
|
<view v-if="productDetail.expectDuration">
|
|
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-main-color'>
|
|
|
|
|
|
<text class="cuIcon-repairfill"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-main-color">
|
|
|
|
|
|
服务时效
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<text class="margin-lr-xs text-sm">{{productDetail.expectDuration}}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view v-if="productDetail.warrantyPeriod">
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-main-color'>
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<text class="cuIcon-repairfill"></text>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-main-color">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
服务保障
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2023-02-15 22:30:11 +08:00
|
|
|
|
<text class="margin-lr-xs text-sm">质保期{{productDetail.warrantyPeriod}}  不满意重新服务  快速退赔</text>
|
2022-05-28 18:45:27 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view>
|
|
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-main-color'>
|
|
|
|
|
|
<text class="cuIcon-deliver_fill"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-main-color">
|
|
|
|
|
|
服务区域
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<text v-for="(item,index) in productDetail.goodsAreaList">
|
|
|
|
|
|
<text class="margin-lr-xs text-sm">{{item.areaName}}<text v-if="index != productDetail.goodsAreaList.length - 1">,</text></text>
|
|
|
|
|
|
</text>
|
|
|
|
|
|
</view>
|
2023-02-15 22:30:11 +08:00
|
|
|
|
<view>
|
|
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-main-color'>
|
|
|
|
|
|
<text class="cuIcon-deliver_fill"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-main-color">
|
|
|
|
|
|
区域备注
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<text class="margin-lr-xs text-sm">{{productDetail.areaDesc}}</text>
|
|
|
|
|
|
</view>
|
2023-03-18 23:58:52 +08:00
|
|
|
|
<view>
|
|
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-red'>
|
|
|
|
|
|
<text class="cuIcon-noticefill"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-red">
|
|
|
|
|
|
请核对下单地址与服务区域相匹配
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2022-08-25 00:11:43 +08:00
|
|
|
|
<!-- <view v-if="productDetail.remark">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<view class="cu-capsule margin-tb-xs">
|
|
|
|
|
|
<view class='cu-tag bg-main-color'>
|
|
|
|
|
|
<text class="cuIcon-commentfill"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-tag line-main-color">
|
|
|
|
|
|
备注
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<text class="margin-lr-xs text-sm">{{productDetail.remark}}</text>
|
2022-08-25 00:11:43 +08:00
|
|
|
|
</view> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="solid-top text-lg padding-tb-sm">
|
|
|
|
|
|
<text class="text-black">选择品类</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="flex flex-wrap" :class="isShowAllSpecs ? '' : 'certern-height'">
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<view class="margin-tb-xs margin-right-xs" v-for="(item,index) in productDetail.goodsStandardList" :key="item.goodsStandardId">
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class='cu-tag round padding'
|
2022-05-28 18:45:27 +08:00
|
|
|
|
:class="curProductSpecs.goodsStandardId === item.goodsStandardId ? 'line-main-color' : 'line-default'"
|
|
|
|
|
|
@click="chooseSpecs(item)">{{item.goodsStandardName}}</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="text-bold text-gray text-lg text-center bg-white padding-top-sm" @click="showAllSpecs()"><text
|
|
|
|
|
|
:class="'cuIcon-' + (isShowAllSpecs ? 'fold' : 'unfold')"></text></view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 服务评价 -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<!-- <view id="pageAnchor1" class="margin-lr-sm margin-top-sm bg-white"> -->
|
|
|
|
|
|
<!-- <view class="flex justify-between align-end padding"> -->
|
|
|
|
|
|
<!-- <view class="text-black text-lg">商品评价</view> -->
|
2022-06-27 10:25:57 +08:00
|
|
|
|
<!-- <view class="text-red text-sm">好评率95%<text class="text-bold text-gray cuIcon-right"></text></view> -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<!-- </view> -->
|
|
|
|
|
|
<!-- <view class="text-center padding-bottom">开发中,敬请期待</view> -->
|
2022-06-27 10:25:57 +08:00
|
|
|
|
<!-- <comments-card :reviewers="reviewers"></comments-card> -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<!-- </view> -->
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<!-- 店家链接 -->
|
2022-04-01 16:54:10 +08:00
|
|
|
|
<view class="margin-lr-sm margin-top-sm padding bg-white">
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<view class="flex justify-between align-center">
|
|
|
|
|
|
<view class="flex justify-start align-center">
|
2022-06-27 10:25:57 +08:00
|
|
|
|
<view class="cu-avatar round" :style="'background-image:url(' + shopInfo.workerLogoUrl + ');'"></view>
|
2022-04-23 23:13:29 +08:00
|
|
|
|
<view class="content flex-sub margin-lr-sm">
|
2022-06-27 10:25:57 +08:00
|
|
|
|
<view class="text-black">{{shopInfo.name}}</view>
|
|
|
|
|
|
<uni-rate :size="15" :readonly="true" allow-half :value="5" />
|
2022-04-23 23:13:29 +08:00
|
|
|
|
</view>
|
2022-03-24 17:32:26 +08:00
|
|
|
|
</view>
|
2022-04-01 16:54:10 +08:00
|
|
|
|
<view class="text-sm" @click="showShopDetail(shopInfo)">店铺查看<text class="text-bold text-gray cuIcon-right"></text></view>
|
2022-03-24 17:32:26 +08:00
|
|
|
|
</view>
|
2022-04-01 16:54:10 +08:00
|
|
|
|
</view>
|
2022-08-25 00:11:43 +08:00
|
|
|
|
<!-- 服务详情 -->
|
|
|
|
|
|
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar ">
|
|
|
|
|
|
<view class="text-center padding-xl">{{productDetail.remark}}</view>
|
|
|
|
|
|
<view class="image">
|
|
|
|
|
|
<image v-for="(item,index) in detailPicList" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
|
|
|
|
|
</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 底部操作条 -->
|
|
|
|
|
|
<view class="cu-bar bg-white tabbar border shop fixed-bottom-bar">
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<view class="action" @click="showIndex">
|
|
|
|
|
|
<view class="cuIcon-homefill"></view>
|
|
|
|
|
|
首页
|
|
|
|
|
|
</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<button class="action" open-type="contact">
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<view class="cuIcon-servicefill text-green">
|
|
|
|
|
|
<!-- <view class="cu-tag badge" v-if="ifHasCsMsg"></view> -->
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
客服
|
2022-07-04 16:04:58 +08:00
|
|
|
|
</button>
|
|
|
|
|
|
<view class="action" @click="showShopDetail(shopInfo)">
|
|
|
|
|
|
<view class="cuIcon-taoxiaopu text-orange"></view>
|
|
|
|
|
|
店铺
|
|
|
|
|
|
</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<!-- <view class="action">
|
|
|
|
|
|
<view class=" cuIcon-shop"></view> 店铺
|
|
|
|
|
|
</view> -->
|
2022-07-04 16:04:58 +08:00
|
|
|
|
<!-- <view class="action" @click="showCart">
|
2022-03-18 17:13:24 +08:00
|
|
|
|
<view class="cuIcon-cart">
|
2022-04-01 16:54:10 +08:00
|
|
|
|
<view class="cu-tag badge" v-if="totalPickCount > 0">{{totalPickCount}}</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
购物车
|
2022-07-04 16:04:58 +08:00
|
|
|
|
</view> -->
|
|
|
|
|
|
<!-- <view class="bg-main-color light submit" @click="toggleProductPickModal">加入购物车</view> -->
|
2022-07-01 22:31:45 +08:00
|
|
|
|
<view class="bg-main-color submit" @tap="checkLogin" @click="toggleProductPickModal($event, true)">立即订购</view>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<!-- 底部弹窗 -->
|
2022-04-01 16:54:10 +08:00
|
|
|
|
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
2022-03-24 17:32:26 +08:00
|
|
|
|
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" @click="toggleProductPickModal"><text
|
|
|
|
|
|
class="cuIcon-close"></text></view>
|
2022-05-28 18:45:27 +08:00
|
|
|
|
<product-pick :shopInfo="shopInfo" :productInfo="productDetail" :specsList="productDetail.goodsStandardList" :orderNow="orderNow"></product-pick>
|
2022-07-01 22:31:45 +08:00
|
|
|
|
</uni-popup>
|
|
|
|
|
|
<!-- 登录校验弹窗 -->
|
|
|
|
|
|
<vertify-login ref="vertifyLogin" @reload="checkLogin"></vertify-login>
|
|
|
|
|
|
<vertify-phone ref="vertifyPhone" @reload="checkLogin"></vertify-phone>
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import commentsCard from '@/components/goods-card/comments-card.vue';
|
2022-03-24 17:32:26 +08:00
|
|
|
|
import productPick from '@/pages/product/product-pick.vue';
|
2022-03-18 17:13:24 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
components: {
|
2022-03-24 17:32:26 +08:00
|
|
|
|
commentsCard,
|
|
|
|
|
|
productPick
|
2022-03-18 17:13:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
2022-05-28 18:45:27 +08:00
|
|
|
|
return {
|
2022-07-01 22:31:45 +08:00
|
|
|
|
inParam: {},
|
2022-05-28 18:45:27 +08:00
|
|
|
|
productDetail: {},
|
|
|
|
|
|
detailPicList: [],
|
2022-03-18 17:13:24 +08:00
|
|
|
|
swiperList: [],
|
|
|
|
|
|
curProductSpecs: {},
|
|
|
|
|
|
productInfo: {},
|
|
|
|
|
|
guaranteeList: [],
|
|
|
|
|
|
isShowAllSpecs: false,
|
|
|
|
|
|
reviewers: [],
|
|
|
|
|
|
productVideoPlaying: false,
|
2022-06-20 15:22:34 +08:00
|
|
|
|
showTopNav: false,
|
|
|
|
|
|
changeSwiperHeight: false,
|
2022-03-24 17:32:26 +08:00
|
|
|
|
curTopNav: 0,
|
|
|
|
|
|
shopInfo: {},
|
2022-04-01 16:54:10 +08:00
|
|
|
|
ifShowPageMeta: false,
|
|
|
|
|
|
orderNow: false,
|
|
|
|
|
|
totalPickCount: 0,
|
2022-05-01 18:45:54 +08:00
|
|
|
|
ifHasCsMsg: true,
|
2023-02-11 11:30:56 +08:00
|
|
|
|
picUrls: [],
|
|
|
|
|
|
curUserInfo: {}
|
2022-03-18 17:13:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-05-11 16:09:53 +08:00
|
|
|
|
onLoad(options) {
|
2022-07-01 22:31:45 +08:00
|
|
|
|
let params = JSON.parse(decodeURIComponent(options.params));
|
|
|
|
|
|
this.inParam = params;
|
|
|
|
|
|
this.loadData();
|
2022-04-01 16:54:10 +08:00
|
|
|
|
this.bindEvent();
|
2022-04-23 23:13:29 +08:00
|
|
|
|
},
|
|
|
|
|
|
onUnload() {
|
|
|
|
|
|
this.offBindEvent();
|
2022-03-18 17:13:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
onReady() {
|
|
|
|
|
|
this.productVideoContext = uni.createVideoContext('productVideo');
|
|
|
|
|
|
},
|
|
|
|
|
|
onPageScroll(e) {
|
2022-06-20 15:22:34 +08:00
|
|
|
|
this.showTopNav = e.scrollTop > 250 ? true : false;
|
|
|
|
|
|
this.changeSwiperHeight = e.scrollTop > 50 ? true: false;
|
2022-03-18 17:13:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2023-02-11 11:30:56 +08:00
|
|
|
|
async loadData() {
|
|
|
|
|
|
await this.$request.refreshCurUserCache();
|
|
|
|
|
|
this.curUserInfo = this.$request.getCurUserInfo();
|
2022-05-28 18:45:27 +08:00
|
|
|
|
let productDetailMock = await this.$api.data('productDetail');
|
|
|
|
|
|
this.productDetail = await this.$request.getGoodsDetail({
|
2022-07-01 22:31:45 +08:00
|
|
|
|
goodsId: this.inParam.goodsId
|
2022-05-28 18:45:27 +08:00
|
|
|
|
});
|
|
|
|
|
|
// 默认规格
|
|
|
|
|
|
this.curProductSpecs = this.productDetail.goodsStandardList[0];
|
|
|
|
|
|
// 轮播图
|
|
|
|
|
|
this.swiperList = this.productDetail.goodsImgsMap["0"];
|
|
|
|
|
|
// 详情图
|
|
|
|
|
|
this.detailPicList = this.productDetail.goodsImgsMap["1"];
|
|
|
|
|
|
// 用于点击放大查看图片
|
|
|
|
|
|
this.swiperList.forEach((picItem) => {
|
|
|
|
|
|
this.picUrls.push(picItem.imgUrl);
|
|
|
|
|
|
})
|
|
|
|
|
|
this.detailPicList.forEach((picItem) => {
|
|
|
|
|
|
this.picUrls.push(picItem.imgUrl);
|
|
|
|
|
|
})
|
2022-06-27 10:25:57 +08:00
|
|
|
|
let res = await this.$request.getWorkerAllDetailById({
|
|
|
|
|
|
workerId: this.productDetail.workerId
|
|
|
|
|
|
})
|
|
|
|
|
|
this.shopInfo = res.data;
|
2022-05-28 18:45:27 +08:00
|
|
|
|
|
|
|
|
|
|
this.guaranteeList = productDetailMock.guaranteeList;
|
|
|
|
|
|
this.productInfo = productDetailMock.productInfo;
|
|
|
|
|
|
this.reviewers = productDetailMock.reviewers;
|
2022-06-27 10:25:57 +08:00
|
|
|
|
// this.shopInfo = productDetailMock.shopInfo;
|
2022-04-01 16:54:10 +08:00
|
|
|
|
},
|
2022-07-01 22:31:45 +08:00
|
|
|
|
async checkLogin() {
|
|
|
|
|
|
let loginRes = await this.authLogin();
|
|
|
|
|
|
if (!loginRes) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.loadData();
|
|
|
|
|
|
},
|
|
|
|
|
|
async authLogin() {
|
|
|
|
|
|
// 更新缓存中的userInfo
|
|
|
|
|
|
let res = await this.$request.storageExistUser();
|
|
|
|
|
|
// 获取缓存中的userInfo
|
|
|
|
|
|
let curUserInfo = this.$request.getCurUserInfo();
|
|
|
|
|
|
// 校验提示登录
|
|
|
|
|
|
if (!curUserInfo || !curUserInfo.openId) {
|
|
|
|
|
|
this.$refs.vertifyLogin.showModal();
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$refs.vertifyLogin.hideModal();
|
|
|
|
|
|
}
|
|
|
|
|
|
// 校验提示获取手机号码
|
|
|
|
|
|
if (!curUserInfo.phone) {
|
|
|
|
|
|
this.$refs.vertifyPhone.showModal();
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$refs.vertifyPhone.hideModal();
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
},
|
2022-04-01 16:54:10 +08:00
|
|
|
|
bindEvent() {
|
|
|
|
|
|
uni.$on('product-detail_add2Cart', this.add2Cart);
|
2022-04-23 23:13:29 +08:00
|
|
|
|
},
|
|
|
|
|
|
offBindEvent() {
|
|
|
|
|
|
uni.$off('product-detail_add2Cart');
|
2022-03-18 17:13:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
chooseSpecs(item) {
|
|
|
|
|
|
this.curProductSpecs = item;
|
|
|
|
|
|
},
|
|
|
|
|
|
showAllSpecs() {
|
|
|
|
|
|
this.isShowAllSpecs = !this.isShowAllSpecs;
|
2022-05-01 18:45:54 +08:00
|
|
|
|
},
|
2022-05-28 18:45:27 +08:00
|
|
|
|
clickSwiper(e, item, type) {
|
|
|
|
|
|
if (type === 1) {
|
2022-06-22 17:38:20 +08:00
|
|
|
|
this.viewImage(item.imgUrl);
|
2022-05-28 18:45:27 +08:00
|
|
|
|
} else if (type === 0) {
|
2022-05-01 18:45:54 +08:00
|
|
|
|
this.pauseVideo(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
viewImage(url) {
|
|
|
|
|
|
uni.previewImage({
|
2022-05-28 18:45:27 +08:00
|
|
|
|
urls: this.picUrls,
|
2022-05-01 18:45:54 +08:00
|
|
|
|
current: url
|
|
|
|
|
|
});
|
2022-03-18 17:13:24 +08:00
|
|
|
|
},
|
2022-05-01 18:45:54 +08:00
|
|
|
|
pauseVideo(e) {
|
2023-03-12 22:06:15 +08:00
|
|
|
|
if (this.productVideoPlaying) {
|
|
|
|
|
|
this.productVideoContext.exitFullScreen();
|
2022-03-18 17:13:24 +08:00
|
|
|
|
this.productVideoContext.pause();
|
2023-03-12 22:06:15 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.productVideoContext.requestFullScreen();
|
2022-03-18 17:13:24 +08:00
|
|
|
|
this.productVideoContext.play();
|
|
|
|
|
|
}
|
|
|
|
|
|
this.productVideoPlaying = !this.productVideoPlaying;
|
|
|
|
|
|
},
|
|
|
|
|
|
changeSwiper(e) {
|
|
|
|
|
|
// 只有第一个是视频,如果是切换到图片就停止播放
|
|
|
|
|
|
if (e.detail.current !== 0) {
|
|
|
|
|
|
this.productVideoContext.pause();
|
|
|
|
|
|
this.productVideoPlaying = false;
|
|
|
|
|
|
}
|
2022-03-24 17:32:26 +08:00
|
|
|
|
},
|
|
|
|
|
|
clickNav(index) {
|
|
|
|
|
|
// 修改聚焦时的样式
|
|
|
|
|
|
this.curTopNav = index;
|
|
|
|
|
|
// 跳转到指定目录
|
|
|
|
|
|
uni.pageScrollTo({
|
|
|
|
|
|
selector: '#pageAnchor' + index
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-07-01 22:31:45 +08:00
|
|
|
|
async toggleProductPickModal(e, orderNow) {
|
2022-04-01 16:54:10 +08:00
|
|
|
|
this.orderNow = orderNow ? true : false;
|
2022-03-24 17:32:26 +08:00
|
|
|
|
if (this.ifShowPageMeta) {
|
|
|
|
|
|
this.$refs.productPickPopup.close();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$refs.productPickPopup.open();
|
2022-04-01 16:54:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
changePopupState(e) {
|
|
|
|
|
|
this.ifShowPageMeta = e.show;
|
|
|
|
|
|
},
|
|
|
|
|
|
add2Cart(totalPickCount) {
|
|
|
|
|
|
this.totalPickCount = totalPickCount;
|
|
|
|
|
|
this.toggleProductPickModal();
|
|
|
|
|
|
},
|
|
|
|
|
|
showShopDetail(shopInfo) {
|
|
|
|
|
|
uni.navigateTo({
|
2022-04-23 23:13:29 +08:00
|
|
|
|
url: '../product/shop-detail?shopInfo=' + encodeURIComponent(JSON.stringify(shopInfo))
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
showCart() {
|
|
|
|
|
|
let myCartInfo = {};
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: '/pages/my/my-cart?myCartInfo=' + encodeURIComponent(JSON.stringify(myCartInfo))
|
2022-04-01 16:54:10 +08:00
|
|
|
|
});
|
2022-07-04 16:04:58 +08:00
|
|
|
|
},
|
|
|
|
|
|
showIndex() {
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: '/pages/index/index'
|
|
|
|
|
|
});
|
2022-03-18 17:13:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.certern-height {
|
2022-05-28 18:45:27 +08:00
|
|
|
|
max-height: 300rpx;
|
2022-03-18 17:13:24 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
2022-03-24 17:32:26 +08:00
|
|
|
|
|
|
|
|
|
|
.left-top-sm-bar {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 25rpx;
|
|
|
|
|
|
top: 25rpx;
|
|
|
|
|
|
z-index: 99;
|
2022-06-20 15:22:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sm-screen-swiper {
|
|
|
|
|
|
height: 400rpx;
|
|
|
|
|
|
transition: all 0.5s ease-in-out;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.lg-screen-swiper {
|
2022-08-29 19:16:34 +08:00
|
|
|
|
height: 115vw;
|
2022-06-20 15:22:34 +08:00
|
|
|
|
transition: all 0.5s ease-in-out;
|
2022-03-24 17:32:26 +08:00
|
|
|
|
}
|
2022-03-18 17:13:24 +08:00
|
|
|
|
</style>
|