|
|
|
@ -1,260 +1,157 @@
|
|
|
|
|
<template>
|
|
|
|
|
<!-- 商品详情 -->
|
|
|
|
|
<!-- 商品详情页面容器 -->
|
|
|
|
|
<view class="container">
|
|
|
|
|
<!-- 轮播图 -->
|
|
|
|
|
<swiper
|
|
|
|
|
:indicator-dots="indicatorDots"
|
|
|
|
|
:autoplay="autoplay"
|
|
|
|
|
:indicator-color="indicatorColor"
|
|
|
|
|
:interval="interval"
|
|
|
|
|
:duration="duration"
|
|
|
|
|
:indicator-active-color="indicatorActiveColor"
|
|
|
|
|
>
|
|
|
|
|
<block
|
|
|
|
|
v-for="(item, index) in imgs"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<!-- 轮播图组件,用于展示商品图片 -->
|
|
|
|
|
<swiper :indicator-dots="indicatorDots" <!-- 是否显示指示点 -->
|
|
|
|
|
:autoplay="autoplay" <!-- 是否自动播放 -->
|
|
|
|
|
:indicator-color="indicatorColor" <!-- 未选中指示点的颜色 -->
|
|
|
|
|
:interval="interval" <!-- 自动切换时间间隔 -->
|
|
|
|
|
:duration="duration" <!-- 滑动动画时长 -->
|
|
|
|
|
:indicator-active-color="indicatorActiveColor" <!-- 当前选中指示点颜色 -->
|
|
|
|
|
>
|
|
|
|
|
<!-- 循环生成轮播项 -->
|
|
|
|
|
<block v-for="(item, index) in imgs" :key="index">
|
|
|
|
|
<swiper-item>
|
|
|
|
|
<image :src="item" />
|
|
|
|
|
<image :src="item" /> <!-- 显示每一张商品图片 -->
|
|
|
|
|
</swiper-item>
|
|
|
|
|
</block>
|
|
|
|
|
</swiper>
|
|
|
|
|
<!-- end 轮播图 -->
|
|
|
|
|
<!-- 商品信息 -->
|
|
|
|
|
<!-- 商品信息展示区 -->
|
|
|
|
|
<view class="prod-info">
|
|
|
|
|
<!-- 标题与收藏按钮 -->
|
|
|
|
|
<view class="tit-wrap">
|
|
|
|
|
<view class="prod-tit">
|
|
|
|
|
{{ prodName }}
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="col"
|
|
|
|
|
@tap="addOrCannelCollection"
|
|
|
|
|
>
|
|
|
|
|
<image
|
|
|
|
|
v-if="!isCollection"
|
|
|
|
|
src="@/static/images/icon/prod-col.png"
|
|
|
|
|
/>
|
|
|
|
|
<image
|
|
|
|
|
v-if="isCollection"
|
|
|
|
|
src="@/static/images/icon/prod-col-red.png"
|
|
|
|
|
/>
|
|
|
|
|
<view class="prod-tit">{{ prodName }}</view> <!-- 商品名称 -->
|
|
|
|
|
<view class="col" @tap="addOrCannelCollection">
|
|
|
|
|
<!-- 收藏/取消收藏按钮 -->
|
|
|
|
|
<image v-if="!isCollection" src="@/static/images/icon/prod-col.png" /> <!-- 未收藏图标 -->
|
|
|
|
|
<image v-if="isCollection" src="@/static/images/icon/prod-col-red.png" /> <!-- 已收藏图标 -->
|
|
|
|
|
收藏
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sales-p">
|
|
|
|
|
{{ brief }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sales-p">{{ brief }}</view> <!-- 商品简短描述 -->
|
|
|
|
|
<!-- 商品价格信息 -->
|
|
|
|
|
<view class="prod-price">
|
|
|
|
|
<text
|
|
|
|
|
v-if="defaultSku && defaultSku.price"
|
|
|
|
|
class="price"
|
|
|
|
|
>
|
|
|
|
|
<text v-if="defaultSku && defaultSku.price" class="price">
|
|
|
|
|
<!-- 当前售价 -->
|
|
|
|
|
¥
|
|
|
|
|
<text class="price-num">
|
|
|
|
|
{{ wxs.parsePrice(defaultSku.price)[0] }}
|
|
|
|
|
</text>
|
|
|
|
|
.{{ wxs.parsePrice(defaultSku.price)[1] }}
|
|
|
|
|
<text class="price-num">{{ wxs.parsePrice(defaultSku.price)[0] }}</text> <!-- 整数部分 -->
|
|
|
|
|
.{{ wxs.parsePrice(defaultSku.price)[1] }} <!-- 小数部分 -->
|
|
|
|
|
</text>
|
|
|
|
|
<text
|
|
|
|
|
v-if="defaultSku && defaultSku.oriPrice"
|
|
|
|
|
class="ori-price"
|
|
|
|
|
>
|
|
|
|
|
<text v-if="defaultSku && defaultSku.oriPrice" class="ori-price">
|
|
|
|
|
<!-- 原价 -->
|
|
|
|
|
¥{{ wxs.parsePrice(defaultSku.oriPrice)[0] }}.{{ wxs.parsePrice(defaultSku.oriPrice)[1] }}
|
|
|
|
|
</text>
|
|
|
|
|
<text class="sales" />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 已选规格 -->
|
|
|
|
|
<view
|
|
|
|
|
class="sku"
|
|
|
|
|
@tap="showSku"
|
|
|
|
|
>
|
|
|
|
|
<view class="sku-tit">
|
|
|
|
|
已选
|
|
|
|
|
<text class="sales"></text> <!-- 销量等其他信息预留 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sku-con">
|
|
|
|
|
{{ selectedProp.length > 0 ? selectedProp + ',' : '' }}{{ prodNum }}件
|
|
|
|
|
</view>
|
|
|
|
|
<view class="more">
|
|
|
|
|
...
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 已选规格展示 -->
|
|
|
|
|
<view class="sku" @tap="showSku">
|
|
|
|
|
<view class="sku-tit">已选</view>
|
|
|
|
|
<view class="sku-con">{{ selectedProp.length > 0 ? selectedProp + ',' : '' }}{{ prodNum }}件</view> <!-- 展示已选择的规格和数量 -->
|
|
|
|
|
<view class="more">...</view> <!-- 更多选项提示 -->
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 评价 -->
|
|
|
|
|
|
|
|
|
|
<!-- 评价区域 -->
|
|
|
|
|
<view class="cmt-wrap">
|
|
|
|
|
<view
|
|
|
|
|
class="cmt-tit"
|
|
|
|
|
@tap="showComment"
|
|
|
|
|
>
|
|
|
|
|
<!-- 评价标题 -->
|
|
|
|
|
<view class="cmt-tit" @tap="showComment">
|
|
|
|
|
<view class="cmt-t">
|
|
|
|
|
评价
|
|
|
|
|
<text class="cmt-good">
|
|
|
|
|
好评{{ prodCommData.positiveRating }}%
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cmt-count">
|
|
|
|
|
共{{ prodCommData.number }}条
|
|
|
|
|
<text class="cmt-more" />
|
|
|
|
|
<text class="cmt-good">好评{{ prodCommData.positiveRating }}%</text> <!-- 好评率 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cmt-count">共{{ prodCommData.number }}条<text class="cmt-more"></text></view> <!-- 评价总数 -->
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 评价标签和列表 -->
|
|
|
|
|
<view class="cmt-cont">
|
|
|
|
|
<view
|
|
|
|
|
class="cmt-tag"
|
|
|
|
|
@tap="showComment"
|
|
|
|
|
>
|
|
|
|
|
<view class="cmt-tag" @tap="showComment">
|
|
|
|
|
<text>全部({{ prodCommData.number }})</text>
|
|
|
|
|
<text>好评({{ prodCommData.praiseNumber }})</text>
|
|
|
|
|
<text>中评({{ prodCommData.secondaryNumber }})</text>
|
|
|
|
|
<text>差评({{ prodCommData.negativeNumber }})</text>
|
|
|
|
|
<text>有图({{ prodCommData.picNumber }})</text>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 评价内容列表 -->
|
|
|
|
|
<view class="cmt-items">
|
|
|
|
|
<view
|
|
|
|
|
v-for="(item, index) in littleCommPage"
|
|
|
|
|
:key="index"
|
|
|
|
|
class="cmt-item"
|
|
|
|
|
>
|
|
|
|
|
<view v-for="(item, index) in littleCommPage" :key="index" class="cmt-item">
|
|
|
|
|
<view class="cmt-user">
|
|
|
|
|
<text class="date">
|
|
|
|
|
{{ item.recTime }}
|
|
|
|
|
</text>
|
|
|
|
|
<text class="date">{{ item.recTime }}</text> <!-- 评价时间 -->
|
|
|
|
|
<view class="cmt-user-info">
|
|
|
|
|
<image
|
|
|
|
|
class="user-img"
|
|
|
|
|
:src="item.pic"
|
|
|
|
|
/>
|
|
|
|
|
<view class="nickname">
|
|
|
|
|
{{ item.nickName }}
|
|
|
|
|
<image class="user-img" :src="item.pic" /> <!-- 用户头像 -->
|
|
|
|
|
<view class="nickname">{{ item.nickName }}</view> <!-- 用户昵称 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cmt-cnt">
|
|
|
|
|
{{ item.content }}
|
|
|
|
|
</view>
|
|
|
|
|
<scroll-view
|
|
|
|
|
v-if="item.pics.length"
|
|
|
|
|
class="cmt-attr"
|
|
|
|
|
scroll-x="true"
|
|
|
|
|
>
|
|
|
|
|
<image
|
|
|
|
|
v-for="(commPic, index2) in item.pics"
|
|
|
|
|
:key="index2"
|
|
|
|
|
:src="commPic"
|
|
|
|
|
/>
|
|
|
|
|
<view class="cmt-cnt">{{ item.content }}</view> <!-- 评价内容 -->
|
|
|
|
|
<!-- 如果有图片,则显示图片滚动视图 -->
|
|
|
|
|
<scroll-view v-if="item.pics.length" class="cmt-attr" scroll-x="true">
|
|
|
|
|
<image v-for="(commPic, index2) in item.pics" :key="index2" :src="commPic" />
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
v-if="prodCommPage.records.length > 2"
|
|
|
|
|
class="cmt-more-v"
|
|
|
|
|
>
|
|
|
|
|
<text @tap="showComment">
|
|
|
|
|
查看全部评价
|
|
|
|
|
</text>
|
|
|
|
|
<!-- 如果评价超过2条,显示查看更多 -->
|
|
|
|
|
<view v-if="prodCommPage.records.length > 2" class="cmt-more-v">
|
|
|
|
|
<text @tap="showComment">查看全部评价</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 商品详情 -->
|
|
|
|
|
|
|
|
|
|
<!-- 商品详情内容 -->
|
|
|
|
|
<view class="prod-detail">
|
|
|
|
|
<view>
|
|
|
|
|
<rich-text :nodes="content" />
|
|
|
|
|
<rich-text :nodes="content"></rich-text> <!-- 使用富文本渲染商品详情 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- end 商品详情 -->
|
|
|
|
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
|
|
<!-- 底部操作栏 -->
|
|
|
|
|
<view class="cart-footer">
|
|
|
|
|
<view
|
|
|
|
|
class="btn icon"
|
|
|
|
|
@tap="toHomePage"
|
|
|
|
|
>
|
|
|
|
|
<image src="@/static/images/tabbar/homepage.png" />
|
|
|
|
|
首页
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="btn icon"
|
|
|
|
|
@tap="toCartPage"
|
|
|
|
|
>
|
|
|
|
|
<image src="@/static/images/tabbar/basket.png" />
|
|
|
|
|
购物车
|
|
|
|
|
<view
|
|
|
|
|
v-if="totalCartNum>0"
|
|
|
|
|
class="badge badge-1"
|
|
|
|
|
>
|
|
|
|
|
{{ totalCartNum }}
|
|
|
|
|
<!-- 首页按钮 -->
|
|
|
|
|
<view class="btn icon" @tap="toHomePage">
|
|
|
|
|
<image src="@/static/images/tabbar/homepage.png" />首页
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 购物车按钮 -->
|
|
|
|
|
<view class="btn icon" @tap="toCartPage">
|
|
|
|
|
<image src="@/static/images/tabbar/basket.png" />购物车
|
|
|
|
|
<view v-if="totalCartNum>0" class="badge badge-1">{{ totalCartNum }}</view> <!-- 购物车商品数量 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="btn cart"
|
|
|
|
|
@tap="showSku"
|
|
|
|
|
>
|
|
|
|
|
<text>加入购物车</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="btn buy"
|
|
|
|
|
@tap="showSku"
|
|
|
|
|
>
|
|
|
|
|
<text>立即购买</text>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 加入购物车按钮 -->
|
|
|
|
|
<view class="btn cart" @tap="showSku"><text>加入购物车</text></view>
|
|
|
|
|
<!-- 立即购买按钮 -->
|
|
|
|
|
<view class="btn buy" @tap="showSku"><text>立即购买</text></view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- end 底部按钮 -->
|
|
|
|
|
|
|
|
|
|
<!-- 规格弹窗 -->
|
|
|
|
|
<view
|
|
|
|
|
v-if="skuShow"
|
|
|
|
|
class="pup-sku"
|
|
|
|
|
>
|
|
|
|
|
<view v-if="skuShow" class="pup-sku">
|
|
|
|
|
<view class="pup-sku-main">
|
|
|
|
|
<!-- 弹窗头部 -->
|
|
|
|
|
<view class="pup-sku-header">
|
|
|
|
|
<image
|
|
|
|
|
class="pup-sku-img"
|
|
|
|
|
:src="defaultSku.pic?defaultSku.pic:pic"
|
|
|
|
|
/>
|
|
|
|
|
<image class="pup-sku-img" :src="defaultSku.pic?defaultSku.pic:pic" /> <!-- 商品图片 -->
|
|
|
|
|
<view class="pup-sku-price">
|
|
|
|
|
<!-- 商品价格 -->
|
|
|
|
|
¥
|
|
|
|
|
<text
|
|
|
|
|
v-if="defaultSku && defaultSku.price"
|
|
|
|
|
class="pup-sku-price-int"
|
|
|
|
|
>
|
|
|
|
|
{{ wxs.parsePrice(defaultSku.price)[0] }}
|
|
|
|
|
</text>
|
|
|
|
|
<text v-if="defaultSku && defaultSku.price" class="pup-sku-price-int">{{ wxs.parsePrice(defaultSku.price)[0] }}</text>
|
|
|
|
|
.{{ wxs.parsePrice(defaultSku.price)[1] }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="pup-sku-prop">
|
|
|
|
|
<text>已选</text>
|
|
|
|
|
{{ selectedProp.length > 0 ? selectedProp + ',' : '' }}{{ prodNum }}件
|
|
|
|
|
<!-- 已选规格 -->
|
|
|
|
|
<text>已选</text>{{ selectedProp.length > 0 ? selectedProp + ',' : '' }}{{ prodNum }}件
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="close"
|
|
|
|
|
@tap="closePopup"
|
|
|
|
|
/>
|
|
|
|
|
<view class="close" @tap="closePopup"></view> <!-- 关闭按钮 -->
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 弹窗主体 -->
|
|
|
|
|
<view class="pup-sku-body">
|
|
|
|
|
<!-- 规格选择区 -->
|
|
|
|
|
<view class="pup-sku-area">
|
|
|
|
|
<view
|
|
|
|
|
v-if="skuList.length"
|
|
|
|
|
class="sku-box"
|
|
|
|
|
>
|
|
|
|
|
<block
|
|
|
|
|
v-for="(skuGroupItem, skuGroupItemIndex) in skuGroupList"
|
|
|
|
|
:key="skuGroupItemIndex"
|
|
|
|
|
>
|
|
|
|
|
<view
|
|
|
|
|
v-for="(skuLine, key) in skuGroupItem"
|
|
|
|
|
:key="key"
|
|
|
|
|
class="items sku-text"
|
|
|
|
|
>
|
|
|
|
|
<text class="sku-kind">
|
|
|
|
|
{{ key }}
|
|
|
|
|
</text>
|
|
|
|
|
<view v-if="skuList.length" class="sku-box">
|
|
|
|
|
<block v-for="(skuGroupItem, skuGroupItemIndex) in skuGroupList" :key="skuGroupItemIndex">
|
|
|
|
|
<view v-for="(skuLine, key) in skuGroupItem" :key="key" class="items sku-text">
|
|
|
|
|
<text class="sku-kind">{{ key }}</text> <!-- 规格类型 -->
|
|
|
|
|
<view class="con">
|
|
|
|
|
<text
|
|
|
|
|
v-for="skuLineItem in skuLine"
|
|
|
|
|
:key="skuLineItem"
|
|
|
|
|
class="sku-choose-item"
|
|
|
|
|
<!-- 循环展示每一个规格选项 -->
|
|
|
|
|
<text v-for="skuLineItem in skuLine" :key="skuLineItem" class="sku-choose-item"
|
|
|
|
|
:class="[selectedPropList.indexOf(key + ':' + skuLineItem) !== -1?'active':'',
|
|
|
|
|
isSkuLineItemNotOptional(allProperties,selectedPropObj,key,skuLineItem,propKeys)? 'dashed' : '']"
|
|
|
|
|
@click="toChooseItem(skuGroupItemIndex, skuLineItem, key)"
|
|
|
|
|
>
|
|
|
|
|
@click="toChooseItem(skuGroupItemIndex, skuLineItem, key)">
|
|
|
|
|
{{ skuLineItem }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
@ -262,218 +159,199 @@
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 数量选择 -->
|
|
|
|
|
<view class="pup-sku-count">
|
|
|
|
|
<view class="num-wrap">
|
|
|
|
|
<view
|
|
|
|
|
class="minus"
|
|
|
|
|
@tap="onCountMinus"
|
|
|
|
|
>
|
|
|
|
|
<text class="row" />
|
|
|
|
|
<view class="minus" @tap="onCountMinus"><text class="row"></text></view> <!-- 减少数量 -->
|
|
|
|
|
<view class="text-wrap"><input type="number" :value="prodNum" disabled></view> <!-- 显示数量 -->
|
|
|
|
|
<view class="plus" @tap="onCountPlus"><text class="row"></text><text class="col"></text></view> <!-- 增加数量 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="text-wrap">
|
|
|
|
|
<input
|
|
|
|
|
type="number"
|
|
|
|
|
:value="prodNum"
|
|
|
|
|
disabled
|
|
|
|
|
>
|
|
|
|
|
<view class="count-name">数量</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="plus"
|
|
|
|
|
@tap="onCountPlus"
|
|
|
|
|
>
|
|
|
|
|
<text class="row" />
|
|
|
|
|
<text class="col" />
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 弹窗底部 -->
|
|
|
|
|
<view class="pup-sku-footer">
|
|
|
|
|
<view class="btn cart" @tap="addToCart">加入购物车</view> <!-- 加入购物车按钮 -->
|
|
|
|
|
<view class="btn buy" @tap="buyNow">立即购买</view> <!-- 立即购买按钮 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="count-name">
|
|
|
|
|
数量
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 评价弹窗 -->
|
|
|
|
|
<view v-if="commentShow" class="cmt-popup">
|
|
|
|
|
<view class="cmt-tit">
|
|
|
|
|
<view class="cmt-t">
|
|
|
|
|
商品评价
|
|
|
|
|
<text class="cmt-good">好评度{{ prodCommData.positiveRating }}%</text> <!-- 好评率 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="pup-sku-footer">
|
|
|
|
|
<view
|
|
|
|
|
class="btn cart"
|
|
|
|
|
@tap="addToCart"
|
|
|
|
|
>
|
|
|
|
|
加入购物车
|
|
|
|
|
<text class="close" @tap="closePopup"></text> <!-- 关闭按钮 -->
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="btn buy"
|
|
|
|
|
@tap="buyNow"
|
|
|
|
|
>
|
|
|
|
|
立即购买
|
|
|
|
|
<view class="cmt-cont">
|
|
|
|
|
<!-- 评价筛选标签 -->
|
|
|
|
|
<view class="cmt-tag">
|
|
|
|
|
<text data-evaluate="-1" :class="evaluate==-1?'selected':''" @tap="getProdCommPage">全部({{ prodCommData.number }})</text>
|
|
|
|
|
<text data-evaluate="0" :class="evaluate==0?'selected':''" @tap="getProdCommPage">好评({{ prodCommData.praiseNumber }})</text>
|
|
|
|
|
<text data-evaluate="1" :class="evaluate==1?'selected':''" @tap="getProdCommPage">中评({{ prodCommData.secondaryNumber }})</text>
|
|
|
|
|
<text data-evaluate="2" :class="evaluate==2?'selected':''" @tap="getProdCommPage">差评({{ prodCommData.negativeNumber }})</text>
|
|
|
|
|
<text data-evaluate="3" :class="evaluate==3?'selected':''" @tap="getProdCommPage">有图({{ prodCommData.picNumber }})</text>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 评价内容列表 -->
|
|
|
|
|
<view class="cmt-items">
|
|
|
|
|
<block v-if="prodCommPage.records.length">
|
|
|
|
|
<view v-for="(item, index) in prodCommPage.records" :key="index" class="cmt-item">
|
|
|
|
|
<view class="cmt-user">
|
|
|
|
|
<text class="date">{{ item.recTime }}</text> <!-- 评价时间 -->
|
|
|
|
|
<view class="cmt-user-info">
|
|
|
|
|
<image class="user-img" :src="item.pic" /> <!-- 用户头像 -->
|
|
|
|
|
<view class="nickname">{{ item.nickName }}</view> <!-- 用户昵称 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cmt-cnt">{{ item.content }}</view> <!-- 评价内容 -->
|
|
|
|
|
<!-- 如果有图片,则显示图片滚动视图 -->
|
|
|
|
|
<scroll-view v-if="item.pics.length" class="cmt-attr" scroll-x="true">
|
|
|
|
|
<image v-for="(commPic, index2) in item.pics" :key="index2" :src="commPic" />
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 评价弹窗 -->
|
|
|
|
|
<view
|
|
|
|
|
v-if="commentShow"
|
|
|
|
|
class="cmt-popup"
|
|
|
|
|
>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 评价弹窗组件,当commentShow为true时显示 -->
|
|
|
|
|
<view v-if="commentShow" class="cmt-popup">
|
|
|
|
|
<!-- 弹窗标题栏 -->
|
|
|
|
|
<view class="cmt-tit">
|
|
|
|
|
<view class="cmt-t">
|
|
|
|
|
商品评价
|
|
|
|
|
<text class="cmt-good">
|
|
|
|
|
好评度{{ prodCommData.positiveRating }}%
|
|
|
|
|
</text>
|
|
|
|
|
商品评价 <!-- 标题文本 -->
|
|
|
|
|
<text class="cmt-good">好评度{{ prodCommData.positiveRating }}%</text> <!-- 显示商品的好评率 -->
|
|
|
|
|
</view>
|
|
|
|
|
<text
|
|
|
|
|
class="close"
|
|
|
|
|
@tap="closePopup"
|
|
|
|
|
/>
|
|
|
|
|
<text class="close" @tap="closePopup" /> <!-- 关闭按钮,点击时调用closePopup方法关闭弹窗 -->
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 弹窗内容区 -->
|
|
|
|
|
<view class="cmt-cont">
|
|
|
|
|
<!-- 评价筛选标签 -->
|
|
|
|
|
<view class="cmt-tag">
|
|
|
|
|
<text
|
|
|
|
|
data-evaluate="-1"
|
|
|
|
|
:class="evaluate==-1?'selected':''"
|
|
|
|
|
@tap="getProdCommPage"
|
|
|
|
|
>
|
|
|
|
|
<!-- 动态生成评价筛选选项 -->
|
|
|
|
|
<text data-evaluate="-1"
|
|
|
|
|
:class="evaluate == -1 ? 'selected' : ''"
|
|
|
|
|
@tap="getProdCommPage">
|
|
|
|
|
全部({{ prodCommData.number }})
|
|
|
|
|
</text>
|
|
|
|
|
<text
|
|
|
|
|
data-evaluate="0"
|
|
|
|
|
:class="evaluate==0?'selected':''"
|
|
|
|
|
@tap="getProdCommPage"
|
|
|
|
|
>
|
|
|
|
|
<text data-evaluate="0"
|
|
|
|
|
:class="evaluate == 0 ? 'selected' : ''"
|
|
|
|
|
@tap="getProdCommPage">
|
|
|
|
|
好评({{ prodCommData.praiseNumber }})
|
|
|
|
|
</text>
|
|
|
|
|
<text
|
|
|
|
|
data-evaluate="1"
|
|
|
|
|
:class="evaluate==1?'selected':''"
|
|
|
|
|
@tap="getProdCommPage"
|
|
|
|
|
>
|
|
|
|
|
<text data-evaluate="1"
|
|
|
|
|
:class="evaluate == 1 ? 'selected' : ''"
|
|
|
|
|
@tap="getProdCommPage">
|
|
|
|
|
中评({{ prodCommData.secondaryNumber }})
|
|
|
|
|
</text>
|
|
|
|
|
<text
|
|
|
|
|
data-evaluate="2"
|
|
|
|
|
:class="evaluate==2?'selected':''"
|
|
|
|
|
@tap="getProdCommPage"
|
|
|
|
|
>
|
|
|
|
|
<text data-evaluate="2"
|
|
|
|
|
:class="evaluate == 2 ? 'selected' : ''"
|
|
|
|
|
@tap="getProdCommPage">
|
|
|
|
|
差评({{ prodCommData.negativeNumber }})
|
|
|
|
|
</text>
|
|
|
|
|
<text
|
|
|
|
|
data-evaluate="3"
|
|
|
|
|
:class="evaluate==3?'selected':''"
|
|
|
|
|
@tap="getProdCommPage"
|
|
|
|
|
>
|
|
|
|
|
<text data-evaluate="3"
|
|
|
|
|
:class="evaluate == 3 ? 'selected' : ''"
|
|
|
|
|
@tap="getProdCommPage">
|
|
|
|
|
有图({{ prodCommData.picNumber }})
|
|
|
|
|
</text>
|
|
|
|
|
<!-- 每个文本元素都有一个data-evaluate属性用于标识评价类型,并根据evaluate值来决定是否添加'selected'类名以高亮当前选中的筛选条件 -->
|
|
|
|
|
<!-- 点击任一文本元素时会触发getProdCommPage方法,加载对应的评价数据 -->
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 评价列表 -->
|
|
|
|
|
<view class="cmt-items">
|
|
|
|
|
<!-- 如果存在评价记录,则循环渲染每个评价项 -->
|
|
|
|
|
<block v-if="prodCommPage.records.length">
|
|
|
|
|
<view
|
|
|
|
|
v-for="(item, index) in prodCommPage.records"
|
|
|
|
|
<view v-for="(item, index) in prodCommPage.records"
|
|
|
|
|
:key="index"
|
|
|
|
|
class="cmt-item"
|
|
|
|
|
>
|
|
|
|
|
class="cmt-item">
|
|
|
|
|
<!-- 用户信息 -->
|
|
|
|
|
<view class="cmt-user">
|
|
|
|
|
<text class="date">
|
|
|
|
|
{{ item.recTime }}
|
|
|
|
|
</text>
|
|
|
|
|
<text class="date">{{ item.recTime }}</text> <!-- 评价时间 -->
|
|
|
|
|
<view class="cmt-user-info">
|
|
|
|
|
<image
|
|
|
|
|
class="user-img"
|
|
|
|
|
:src="item.pic"
|
|
|
|
|
/>
|
|
|
|
|
<view class="nickname">
|
|
|
|
|
{{ item.nickName }}
|
|
|
|
|
</view>
|
|
|
|
|
<image class="user-img" :src="item.pic" /> <!-- 用户头像 -->
|
|
|
|
|
<view class="nickname">{{ item.nickName }}</view> <!-- 用户昵称 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cmt-cnt">
|
|
|
|
|
{{ item.content }}
|
|
|
|
|
</view>
|
|
|
|
|
<scroll-view
|
|
|
|
|
v-if="item.pics.length"
|
|
|
|
|
class="cmt-attr"
|
|
|
|
|
scroll-x="true"
|
|
|
|
|
>
|
|
|
|
|
<image
|
|
|
|
|
v-for="(commPic, index2) in item.pics"
|
|
|
|
|
<!-- 评价内容 -->
|
|
|
|
|
<view class="cmt-cnt">{{ item.content }}</view>
|
|
|
|
|
<!-- 如果评价中有图片,则展示图片滚动视图 -->
|
|
|
|
|
<scroll-view v-if="item.pics.length" class="cmt-attr" scroll-x="true">
|
|
|
|
|
<image v-for="(commPic, index2) in item.pics"
|
|
|
|
|
:key="index2"
|
|
|
|
|
:src="commPic"
|
|
|
|
|
/>
|
|
|
|
|
:src="commPic" />
|
|
|
|
|
</scroll-view>
|
|
|
|
|
<view
|
|
|
|
|
v-if="item.replyContent"
|
|
|
|
|
class="cmt-reply"
|
|
|
|
|
>
|
|
|
|
|
<text class="reply-tit">
|
|
|
|
|
店铺回复:
|
|
|
|
|
</text>
|
|
|
|
|
<!-- 店铺回复,如果有的话 -->
|
|
|
|
|
<view v-if="item.replyContent" class="cmt-reply">
|
|
|
|
|
<text class="reply-tit">店铺回复:</text>
|
|
|
|
|
{{ item.replyContent }}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</block>
|
|
|
|
|
<view
|
|
|
|
|
v-if="!prodCommPage.records.length"
|
|
|
|
|
class="empty"
|
|
|
|
|
>
|
|
|
|
|
<!-- 如果没有评价记录,则显示提示信息 -->
|
|
|
|
|
<view v-if="!prodCommPage.records.length" class="empty">
|
|
|
|
|
暂无评价
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
v-if="prodCommPage.pages > prodCommPage.current"
|
|
|
|
|
class="load-more"
|
|
|
|
|
>
|
|
|
|
|
<text @tap="getMoreCommPage">
|
|
|
|
|
点击加载更多
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 加载更多按钮,当还有未加载的评价页时显示 -->
|
|
|
|
|
<view v-if="prodCommPage.pages > prodCommPage.current" class="load-more">
|
|
|
|
|
<text @tap="getMoreCommPage">点击加载更多</text> <!-- 点击时调用getMoreCommPage方法加载下一页评价 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
const wxs = number()
|
|
|
|
|
|
|
|
|
|
const indicatorDots = ref(true)
|
|
|
|
|
const indicatorColor = ref('#f2f2f2')
|
|
|
|
|
const indicatorActiveColor = ref('#eb2444')
|
|
|
|
|
const autoplay = ref(true)
|
|
|
|
|
const interval = ref(3000)
|
|
|
|
|
const duration = ref(1000)
|
|
|
|
|
const selectedProp = ref([])
|
|
|
|
|
let prodId = 0
|
|
|
|
|
/**
|
|
|
|
|
<script setup>
|
|
|
|
|
const wxs = number()
|
|
|
|
|
|
|
|
|
|
const indicatorDots = ref(true)
|
|
|
|
|
const indicatorColor = ref('#f2f2f2')
|
|
|
|
|
const indicatorActiveColor = ref('#eb2444')
|
|
|
|
|
const autoplay = ref(true)
|
|
|
|
|
const interval = ref(3000)
|
|
|
|
|
const duration = ref(1000)
|
|
|
|
|
const selectedProp = ref([])
|
|
|
|
|
let prodId = 0
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
prodId = options.prodid// 加载商品信息
|
|
|
|
|
getProdInfo() // 加载商品数据
|
|
|
|
|
getProdCommData() // 加载评论项
|
|
|
|
|
getLittleProdComm() // 查看用户是否关注
|
|
|
|
|
getCollection()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const app = getApp()
|
|
|
|
|
const totalCartNum = ref(0)
|
|
|
|
|
/**
|
|
|
|
|
const app = getApp()
|
|
|
|
|
const totalCartNum = ref(0)
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
|
*/
|
|
|
|
|
onShow(() => {
|
|
|
|
|
onShow(() => {
|
|
|
|
|
totalCartNum.value = app.globalData.totalCartCount
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 分享设置
|
|
|
|
|
*/
|
|
|
|
|
onShareAppMessage(() => {
|
|
|
|
|
onShareAppMessage(() => {
|
|
|
|
|
return {
|
|
|
|
|
title: prodName.value,
|
|
|
|
|
path: '/pages/prod/prod?prodid=' + prodId
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const isCollection = ref(false)
|
|
|
|
|
/**
|
|
|
|
|
const isCollection = ref(false)
|
|
|
|
|
/**
|
|
|
|
|
* 获取是否关注信息
|
|
|
|
|
*/
|
|
|
|
|
const getCollection = () => {
|
|
|
|
|
const getCollection = () => {
|
|
|
|
|
uni.showLoading()
|
|
|
|
|
http.request({
|
|
|
|
|
url: '/p/user/collection/isCollection',
|
|
|
|
@ -486,12 +364,12 @@ const getCollection = () => {
|
|
|
|
|
isCollection.value = data
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 添加或者取消收藏商品
|
|
|
|
|
*/
|
|
|
|
|
const addOrCannelCollection = () => {
|
|
|
|
|
const addOrCannelCollection = () => {
|
|
|
|
|
uni.showLoading()
|
|
|
|
|
http.request({
|
|
|
|
|
url: '/p/user/collection/addOrCancel',
|
|
|
|
@ -502,20 +380,20 @@ const addOrCannelCollection = () => {
|
|
|
|
|
isCollection.value = !isCollection.value
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const skuList = ref([])
|
|
|
|
|
const brief = ref('')
|
|
|
|
|
const prodNum = ref(1)
|
|
|
|
|
const pic = ref('')
|
|
|
|
|
const imgs = ref('')
|
|
|
|
|
const prodName = ref('')
|
|
|
|
|
const price = ref(0)
|
|
|
|
|
const content = ref('')
|
|
|
|
|
/**
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const skuList = ref([])
|
|
|
|
|
const brief = ref('')
|
|
|
|
|
const prodNum = ref(1)
|
|
|
|
|
const pic = ref('')
|
|
|
|
|
const imgs = ref('')
|
|
|
|
|
const prodName = ref('')
|
|
|
|
|
const price = ref(0)
|
|
|
|
|
const content = ref('')
|
|
|
|
|
/**
|
|
|
|
|
* 获取商品信息
|
|
|
|
|
*/
|
|
|
|
|
const getProdInfo = () => {
|
|
|
|
|
const getProdInfo = () => {
|
|
|
|
|
uni.showLoading()
|
|
|
|
|
http.request({
|
|
|
|
|
url: '/prod/prodInfo',
|
|
|
|
@ -544,10 +422,10 @@ const getProdInfo = () => {
|
|
|
|
|
groupSkuProp(data.skuList, data.price)
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const prodCommData = ref({})
|
|
|
|
|
const getProdCommData = () => {
|
|
|
|
|
const prodCommData = ref({})
|
|
|
|
|
const getProdCommData = () => {
|
|
|
|
|
http.request({
|
|
|
|
|
url: '/prodComm/prodCommData',
|
|
|
|
|
method: 'GET',
|
|
|
|
@ -558,33 +436,33 @@ const getProdCommData = () => {
|
|
|
|
|
.then(({ data }) => {
|
|
|
|
|
prodCommData.value = data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const prodCommPage = ref({
|
|
|
|
|
const prodCommPage = ref({
|
|
|
|
|
current: 0,
|
|
|
|
|
pages: 0,
|
|
|
|
|
records: []
|
|
|
|
|
})
|
|
|
|
|
/**
|
|
|
|
|
})
|
|
|
|
|
/**
|
|
|
|
|
* 获取部分评论
|
|
|
|
|
*/
|
|
|
|
|
const getLittleProdComm = () => {
|
|
|
|
|
const getLittleProdComm = () => {
|
|
|
|
|
if (prodCommPage.value.records.length) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
getProdCommPage()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getMoreCommPage = () => {
|
|
|
|
|
const getMoreCommPage = () => {
|
|
|
|
|
getProdCommPage()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const littleCommPage = ref([])
|
|
|
|
|
const evaluate = ref(-1)
|
|
|
|
|
/**
|
|
|
|
|
const littleCommPage = ref([])
|
|
|
|
|
const evaluate = ref(-1)
|
|
|
|
|
/**
|
|
|
|
|
* 获取分页获取评论
|
|
|
|
|
*/
|
|
|
|
|
const getProdCommPage = (e) => {
|
|
|
|
|
const getProdCommPage = (e) => {
|
|
|
|
|
if (e) {
|
|
|
|
|
if (e.currentTarget.dataset.evaluate === evaluate.value) {
|
|
|
|
|
return
|
|
|
|
@ -625,19 +503,19 @@ const getProdCommPage = (e) => {
|
|
|
|
|
littleCommPage.value = records.slice(0, 2)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let selectedPropObjList = null
|
|
|
|
|
const skuGroup = ref({})
|
|
|
|
|
const defaultSku = ref(null)
|
|
|
|
|
const selectedPropObj = ref({})
|
|
|
|
|
const propKeys = ref([])
|
|
|
|
|
const allProperties = ref([])
|
|
|
|
|
const findSku = ref(true)
|
|
|
|
|
const skuGroupList = ref([])
|
|
|
|
|
/**
|
|
|
|
|
}
|
|
|
|
|
let selectedPropObjList = null
|
|
|
|
|
const skuGroup = ref({})
|
|
|
|
|
const defaultSku = ref(null)
|
|
|
|
|
const selectedPropObj = ref({})
|
|
|
|
|
const propKeys = ref([])
|
|
|
|
|
const allProperties = ref([])
|
|
|
|
|
const findSku = ref(true)
|
|
|
|
|
const skuGroupList = ref([])
|
|
|
|
|
/**
|
|
|
|
|
* 组装SKU
|
|
|
|
|
*/
|
|
|
|
|
const groupSkuProp = (skuList, defaultPrice) => {
|
|
|
|
|
const groupSkuProp = (skuList, defaultPrice) => {
|
|
|
|
|
if (skuList.length === 1 && !skuList[0].properties) {
|
|
|
|
|
defaultSku.value = skuList[0]
|
|
|
|
|
findSku.value = true
|
|
|
|
@ -693,13 +571,13 @@ const groupSkuProp = (skuList, defaultPrice) => {
|
|
|
|
|
skuGroupList.value = unique(_skuGroupList)
|
|
|
|
|
allProperties.value = _allProperties
|
|
|
|
|
parseSelectedObjToVals(skuList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const selectedPropList = ref(null)
|
|
|
|
|
/**
|
|
|
|
|
const selectedPropList = ref(null)
|
|
|
|
|
/**
|
|
|
|
|
* 将已选的 {key:val,key2:val2}转换成 [val,val2]
|
|
|
|
|
*/
|
|
|
|
|
const parseSelectedObjToVals = (skuList) => {
|
|
|
|
|
const parseSelectedObjToVals = (skuList) => {
|
|
|
|
|
const selectedPropObjListParam = selectedPropObjList
|
|
|
|
|
let selectedPropertiesParam = ''
|
|
|
|
|
const selectedPropListParam = []
|
|
|
|
@ -726,12 +604,12 @@ const parseSelectedObjToVals = (skuList) => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
findSku.value = findSkuParam
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 判断当前的规格值 是否可以选
|
|
|
|
|
*/
|
|
|
|
|
const isSkuLineItemNotOptional = (allProperties, selectedPropObjParam, key, item, propKeys) => {
|
|
|
|
|
const isSkuLineItemNotOptional = (allProperties, selectedPropObjParam, key, item, propKeys) => {
|
|
|
|
|
const selectedPropObj = Object.assign({}, selectedPropObjParam)
|
|
|
|
|
let properties = ''
|
|
|
|
|
selectedPropObj[key] = item
|
|
|
|
@ -750,21 +628,21 @@ const isSkuLineItemNotOptional = (allProperties, selectedPropObjParam, key, item
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 规格点击事件
|
|
|
|
|
*/
|
|
|
|
|
const toChooseItem = (skuGroupItemIndex, skuLineItem, key) => {
|
|
|
|
|
const toChooseItem = (skuGroupItemIndex, skuLineItem, key) => {
|
|
|
|
|
selectedPropObjList[skuGroupItemIndex][key] = skuLineItem
|
|
|
|
|
selectedPropObj.value[key] = skuLineItem
|
|
|
|
|
parseSelectedObjToVals(skuList.value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 去重
|
|
|
|
|
*/
|
|
|
|
|
const unique = (arr) => {
|
|
|
|
|
const unique = (arr) => {
|
|
|
|
|
const map = {}
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
const obj = {}
|
|
|
|
@ -772,31 +650,31 @@ const unique = (arr) => {
|
|
|
|
|
map[JSON.stringify(obj)] = item
|
|
|
|
|
})
|
|
|
|
|
return Object.keys(map).map(key => JSON.parse(key))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 跳转到首页
|
|
|
|
|
*/
|
|
|
|
|
const toHomePage = () => {
|
|
|
|
|
const toHomePage = () => {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/index/index'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 跳转到购物车
|
|
|
|
|
*/
|
|
|
|
|
const toCartPage = () => {
|
|
|
|
|
const toCartPage = () => {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/basket/basket'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const shopId = 1
|
|
|
|
|
/**
|
|
|
|
|
const shopId = 1
|
|
|
|
|
/**
|
|
|
|
|
* 加入购物车
|
|
|
|
|
*/
|
|
|
|
|
const addToCart = () => {
|
|
|
|
|
const addToCart = () => {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
mask: true
|
|
|
|
|
})
|
|
|
|
@ -819,12 +697,12 @@ const addToCart = () => {
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 立即购买
|
|
|
|
|
*/
|
|
|
|
|
const buyNow = () => {
|
|
|
|
|
const buyNow = () => {
|
|
|
|
|
uni.setStorageSync('orderItem', JSON.stringify({
|
|
|
|
|
prodId,
|
|
|
|
|
skuId: defaultSku.value.skuId,
|
|
|
|
@ -834,42 +712,42 @@ const buyNow = () => {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/submit-order/submit-order?orderEntry=1'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 减数量
|
|
|
|
|
*/
|
|
|
|
|
const onCountMinus = () => {
|
|
|
|
|
const onCountMinus = () => {
|
|
|
|
|
if (prodNum.value > 1) {
|
|
|
|
|
prodNum.value = prodNum.value - 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 加数量
|
|
|
|
|
*/
|
|
|
|
|
const onCountPlus = () => {
|
|
|
|
|
const onCountPlus = () => {
|
|
|
|
|
if (prodNum.value < 1000) {
|
|
|
|
|
prodNum.value = prodNum.value + 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const skuShow = ref(false)
|
|
|
|
|
const showSku = () => {
|
|
|
|
|
const skuShow = ref(false)
|
|
|
|
|
const showSku = () => {
|
|
|
|
|
skuShow.value = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const commentShow = ref(false)
|
|
|
|
|
const showComment = () => {
|
|
|
|
|
const commentShow = ref(false)
|
|
|
|
|
const showComment = () => {
|
|
|
|
|
commentShow.value = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const closePopup = () => {
|
|
|
|
|
const closePopup = () => {
|
|
|
|
|
skuShow.value = false
|
|
|
|
|
commentShow.value = false
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@use './prod.scss';
|
|
|
|
|
</style>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@use './prod.scss';
|
|
|
|
|
</style>
|
|
|
|
|