|
|
|
@ -42,15 +42,17 @@
|
|
|
|
'switch-type-item-active': form.product_sku_id === tag.id,
|
|
|
|
'switch-type-item-active': form.product_sku_id === tag.id,
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
:style="{
|
|
|
|
:style="{
|
|
|
|
'background': !tag.stock_num ? '#aaa' : ''
|
|
|
|
background: !tag.stock_num ? '#aaa' : '',
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
v-for="tag in detail.product_skus"
|
|
|
|
v-for="tag in detail.product_skus"
|
|
|
|
:key="tag.id"
|
|
|
|
:key="tag.id"
|
|
|
|
@tap="() => {
|
|
|
|
@tap="
|
|
|
|
if (tag.stock_num) {
|
|
|
|
() => {
|
|
|
|
form.product_sku_id = tag.id
|
|
|
|
if (tag.stock_num) {
|
|
|
|
|
|
|
|
form.product_sku_id = tag.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ tag.name }}
|
|
|
|
{{ tag.name }}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
@ -94,7 +96,7 @@
|
|
|
|
name="arrow-left"
|
|
|
|
name="arrow-left"
|
|
|
|
:size="36"
|
|
|
|
:size="36"
|
|
|
|
color="#333"
|
|
|
|
color="#333"
|
|
|
|
@tap="$u.route({type:'back'})"
|
|
|
|
@tap="$u.route({ type: 'back' })"
|
|
|
|
></u-icon>
|
|
|
|
></u-icon>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="flex1"
|
|
|
|
class="flex1"
|
|
|
|
@ -106,19 +108,19 @@
|
|
|
|
placeholder="请输入搜索内容"
|
|
|
|
placeholder="请输入搜索内容"
|
|
|
|
></u-search>
|
|
|
|
></u-search>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<button class="clear-btn" style="padding: 0 14rpx;" open-type="share">
|
|
|
|
<button
|
|
|
|
<u-icon
|
|
|
|
class="clear-btn"
|
|
|
|
name="share"
|
|
|
|
style="padding: 0 14rpx"
|
|
|
|
:size="36"
|
|
|
|
open-type="share"
|
|
|
|
color="#333"
|
|
|
|
>
|
|
|
|
></u-icon>
|
|
|
|
<u-icon name="share" :size="36" color="#333"></u-icon>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button class="clear-btn" style="padding: 0 14rpx;" @click="$u.route({ url: '/package_sub/pages/Shop/Cart' })">
|
|
|
|
<button
|
|
|
|
<u-icon
|
|
|
|
class="clear-btn"
|
|
|
|
name="shopping-cart"
|
|
|
|
style="padding: 0 14rpx"
|
|
|
|
:size="36"
|
|
|
|
@click="$u.route({ url: '/package_sub/pages/Shop/Cart' })"
|
|
|
|
color="#333"
|
|
|
|
>
|
|
|
|
></u-icon>
|
|
|
|
<u-icon name="shopping-cart" :size="36" color="#333"></u-icon>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
@ -131,7 +133,7 @@
|
|
|
|
{{ tab.text }}
|
|
|
|
{{ tab.text }}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="comment">
|
|
|
|
<!-- <view class="comment">
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="panel-title"
|
|
|
|
class="panel-title"
|
|
|
|
@tap="
|
|
|
|
@tap="
|
|
|
|
@ -177,7 +179,8 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="detail">
|
|
|
|
-->
|
|
|
|
|
|
|
|
<view class="detail">
|
|
|
|
<view class="panel-title"> 宝贝详情 </view>
|
|
|
|
<view class="panel-title"> 宝贝详情 </view>
|
|
|
|
<view>
|
|
|
|
<view>
|
|
|
|
<u-parse :html="detail.content" lazy-load />
|
|
|
|
<u-parse :html="detail.content" lazy-load />
|
|
|
|
@ -190,7 +193,11 @@
|
|
|
|
class="product-item"
|
|
|
|
class="product-item"
|
|
|
|
v-for="item in recommendPro"
|
|
|
|
v-for="item in recommendPro"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
@tap="$u.throttle(() => {toDetail(item)}, 500)"
|
|
|
|
@tap="
|
|
|
|
|
|
|
|
$u.throttle(() => {
|
|
|
|
|
|
|
|
toDetail(item);
|
|
|
|
|
|
|
|
}, 500)
|
|
|
|
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<view class="top">
|
|
|
|
<view class="top">
|
|
|
|
<image
|
|
|
|
<image
|
|
|
|
@ -209,20 +216,20 @@
|
|
|
|
<text>{{ item.price }}</text>
|
|
|
|
<text>{{ item.price }}</text>
|
|
|
|
<text>起</text>
|
|
|
|
<text>起</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <u-button-->
|
|
|
|
<!-- <u-button-->
|
|
|
|
<!-- :hair-line="false"-->
|
|
|
|
<!-- :hair-line="false"-->
|
|
|
|
<!-- type="warning"-->
|
|
|
|
<!-- type="warning"-->
|
|
|
|
<!-- ripple-->
|
|
|
|
<!-- ripple-->
|
|
|
|
<!-- shape="circle"-->
|
|
|
|
<!-- shape="circle"-->
|
|
|
|
<!-- :custom-style="{-->
|
|
|
|
<!-- :custom-style="{-->
|
|
|
|
<!-- height: '28rpx',-->
|
|
|
|
<!-- height: '28rpx',-->
|
|
|
|
<!-- 'line-height': '28rpx',-->
|
|
|
|
<!-- 'line-height': '28rpx',-->
|
|
|
|
<!-- padding: '0 6rpx',-->
|
|
|
|
<!-- padding: '0 6rpx',-->
|
|
|
|
<!-- color: '#fff',-->
|
|
|
|
<!-- color: '#fff',-->
|
|
|
|
<!-- 'font-size': '17rpx',-->
|
|
|
|
<!-- 'font-size': '17rpx',-->
|
|
|
|
<!-- }"-->
|
|
|
|
<!-- }"-->
|
|
|
|
<!-- >加入购物车</u-button-->
|
|
|
|
<!-- >加入购物车</u-button-->
|
|
|
|
<!-- >-->
|
|
|
|
<!-- >-->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
@ -249,19 +256,32 @@
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
v-for="item in detail.product_skus || []"
|
|
|
|
v-for="item in detail.product_skus || []"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
@click="() => {
|
|
|
|
@click="
|
|
|
|
if (item.stock_num) {
|
|
|
|
() => {
|
|
|
|
form.product_sku_id = item.id
|
|
|
|
if (item.stock_num) {
|
|
|
|
|
|
|
|
form.product_sku_id = item.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<view class="top">
|
|
|
|
<view class="top">
|
|
|
|
<image
|
|
|
|
<image
|
|
|
|
class="product-item__img"
|
|
|
|
class="product-item__img"
|
|
|
|
:src="item.image ? item.image.url : (detail.image?detail.image.url:'')"
|
|
|
|
:src="
|
|
|
|
|
|
|
|
item.image
|
|
|
|
|
|
|
|
? item.image.url
|
|
|
|
|
|
|
|
: detail.image
|
|
|
|
|
|
|
|
? detail.image.url
|
|
|
|
|
|
|
|
: ''
|
|
|
|
|
|
|
|
"
|
|
|
|
mode="aspectFill"
|
|
|
|
mode="aspectFill"
|
|
|
|
></image>
|
|
|
|
></image>
|
|
|
|
<image class="product-item__soldout" v-if="!item.stock_num" src="~@/package_sub/static/Shop/yishouxing.png" mode="aspectFit"></image>
|
|
|
|
<image
|
|
|
|
|
|
|
|
class="product-item__soldout"
|
|
|
|
|
|
|
|
v-if="!item.stock_num"
|
|
|
|
|
|
|
|
src="~@/package_sub/static/Shop/yishouxing.png"
|
|
|
|
|
|
|
|
mode="aspectFit"
|
|
|
|
|
|
|
|
></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="bottom">
|
|
|
|
<view class="bottom">
|
|
|
|
<view class="product-item__title">
|
|
|
|
<view class="product-item__title">
|
|
|
|
@ -284,9 +304,17 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</scroll-view>
|
|
|
|
<view class="sku-num" style="padding-left: 10%;padding-top: 8rpx;" v-if="isSkuSubmit">
|
|
|
|
<view
|
|
|
|
|
|
|
|
class="sku-num"
|
|
|
|
|
|
|
|
style="padding-left: 10%; padding-top: 8rpx"
|
|
|
|
|
|
|
|
v-if="isSkuSubmit"
|
|
|
|
|
|
|
|
>
|
|
|
|
<text>数量:</text>
|
|
|
|
<text>数量:</text>
|
|
|
|
<u-number-box v-model="form.num" :min="1" :max="productSku.stock_num"></u-number-box>
|
|
|
|
<u-number-box
|
|
|
|
|
|
|
|
v-model="form.num"
|
|
|
|
|
|
|
|
:min="1"
|
|
|
|
|
|
|
|
:max="productSku.stock_num"
|
|
|
|
|
|
|
|
></u-number-box>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="confirm-btn">
|
|
|
|
<view class="confirm-btn">
|
|
|
|
<u-button
|
|
|
|
<u-button
|
|
|
|
@ -311,7 +339,10 @@
|
|
|
|
<u-icon name="server-fill" :size="40" color="#333"></u-icon>
|
|
|
|
<u-icon name="server-fill" :size="40" color="#333"></u-icon>
|
|
|
|
<view class="text u-line-1">客服</view>
|
|
|
|
<view class="text u-line-1">客服</view>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<view class="item car" @tap="$u.route({ url: '/package_sub/pages/Shop/Cart' })">
|
|
|
|
<view
|
|
|
|
|
|
|
|
class="item car"
|
|
|
|
|
|
|
|
@tap="$u.route({ url: '/package_sub/pages/Shop/Cart' })"
|
|
|
|
|
|
|
|
>
|
|
|
|
<u-badge
|
|
|
|
<u-badge
|
|
|
|
class="car-num"
|
|
|
|
class="car-num"
|
|
|
|
:count="cartNum"
|
|
|
|
:count="cartNum"
|
|
|
|
@ -359,10 +390,10 @@ export default {
|
|
|
|
text: "宝贝",
|
|
|
|
text: "宝贝",
|
|
|
|
targetClass: "content",
|
|
|
|
targetClass: "content",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
text: "评价",
|
|
|
|
// text: "评价",
|
|
|
|
targetClass: "comment",
|
|
|
|
// targetClass: "comment",
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
text: "详情",
|
|
|
|
text: "详情",
|
|
|
|
targetClass: "detail",
|
|
|
|
targetClass: "detail",
|
|
|
|
@ -406,11 +437,11 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
toDetail(item) {
|
|
|
|
toDetail(item) {
|
|
|
|
this.$u.route({
|
|
|
|
this.$u.route({
|
|
|
|
url: '/package_sub/pages/Shop/ProductDetail',
|
|
|
|
url: "/package_sub/pages/Shop/ProductDetail",
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
id: item.id
|
|
|
|
id: item.id,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 获取一个目标元素的高度
|
|
|
|
// 获取一个目标元素的高度
|
|
|
|
getElRect(elClass, dataVal) {
|
|
|
|
getElRect(elClass, dataVal) {
|
|
|
|
@ -579,14 +610,14 @@ export default {
|
|
|
|
title: "请选择产品规格",
|
|
|
|
title: "请选择产品规格",
|
|
|
|
type: "warning",
|
|
|
|
type: "warning",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!this.form.num) {
|
|
|
|
if (!this.form.num) {
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
title: "请选择产品数量",
|
|
|
|
title: "请选择产品数量",
|
|
|
|
type: "warning",
|
|
|
|
type: "warning",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const res = await this.$u.api.cartSave(this.form);
|
|
|
|
const res = await this.$u.api.cartSave(this.form);
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
@ -597,8 +628,8 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.isImmediateBuy) {
|
|
|
|
if (this.isImmediateBuy) {
|
|
|
|
this.$u.route({
|
|
|
|
this.$u.route({
|
|
|
|
url: '/package_sub/pages/Shop/Pay'
|
|
|
|
url: "/package_sub/pages/Shop/Pay",
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.showType = false;
|
|
|
|
this.showType = false;
|
|
|
|
} catch (err) {}
|
|
|
|
} catch (err) {}
|
|
|
|
@ -990,7 +1021,7 @@ page {
|
|
|
|
padding: 40rpx;
|
|
|
|
padding: 40rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
box-sizing: border-box;
|
|
|
|
background: #ffffff99;
|
|
|
|
background: #ffffff99;
|
|
|
|
opacity: .86;
|
|
|
|
opacity: 0.86;
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
left: 0;
|
|
|
|
|