mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-12 10:00:57 +08:00
优化商品详情页面
This commit is contained in:
parent
f260c8e630
commit
808b1214ae
@ -56,3 +56,29 @@ export function getGroupBuyProduct(dataObj) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询产品
|
||||||
|
*/
|
||||||
|
export function getProduct(dataObj) {
|
||||||
|
return new Promise(
|
||||||
|
(resolve, reject) => {
|
||||||
|
requestNoAuth({
|
||||||
|
url: url.queryProduct,
|
||||||
|
method: "GET",
|
||||||
|
data: dataObj,
|
||||||
|
//动态数据
|
||||||
|
success: function(res) {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
let _products = res.data.data;
|
||||||
|
resolve(_products);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reject();
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,20 +16,6 @@
|
|||||||
<view class="express"></view>
|
<view class="express"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 积分商品 -->
|
|
||||||
<view class="score-price-card" v-if="type === 'score'">
|
|
||||||
<view class="x-f">
|
|
||||||
<image class="score-img" src="http://shopro.7wpp.com/imgs/score.png" mode=""></image>
|
|
||||||
<text class="price">{{ detail.price }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="x-bc price-bottom-box">
|
|
||||||
<view class="x-f">
|
|
||||||
<view class="original-price">价值:¥{{ detail.original_price }}</view>
|
|
||||||
<text class="line"></text>
|
|
||||||
<view class="sold">已兑换:{{ detail.sales }}件</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 团购商品 -->
|
<!-- 团购商品 -->
|
||||||
<view class="groupon-price-box" v-if="detail.activity && detail.activity.type === 'groupon'">
|
<view class="groupon-price-box" v-if="detail.activity && detail.activity.type === 'groupon'">
|
||||||
<view class="">
|
<view class="">
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="grid margin-bottom text-center col-2">
|
<view class="grid margin-bottom text-center col-2">
|
||||||
<view class="padding-lr-xs margin-top-xs " v-for="(item,indexs) in products" :key="indexs">
|
<view class="padding-lr-xs margin-top-xs margin-bottom-sm" v-for="(item,indexs) in products" :key="indexs">
|
||||||
<view class="padding bg-white goods" @tap="_toGoodsDetail(item)">
|
<view class="padding bg-white goods" @tap="_toGoodsDetail(item)">
|
||||||
<view>
|
<view>
|
||||||
<image class="goods-image" :src="item.coverPhoto"></image>
|
<image class="goods-image" :src="item.coverPhoto"></image>
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
|
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
|
||||||
import { mapMutations, mapActions, mapState } from 'vuex';
|
import { mapMutations, mapActions, mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: 'shoproSku',
|
name: 'vcSku',
|
||||||
components: {
|
components: {
|
||||||
uniNumberBox
|
uniNumberBox
|
||||||
},
|
},
|
||||||
@ -277,6 +277,10 @@ export default {
|
|||||||
getCanUseSkuPrice() {
|
getCanUseSkuPrice() {
|
||||||
let newPrice = [];
|
let newPrice = [];
|
||||||
|
|
||||||
|
if(this.skuPrice == undefined){
|
||||||
|
return newPrice;
|
||||||
|
}
|
||||||
|
|
||||||
for (let price of this.skuPrice) {
|
for (let price of this.skuPrice) {
|
||||||
if (price.stock <= 0) {
|
if (price.stock <= 0) {
|
||||||
// || price.stock < this.goodsNum 不判断是否大于当前选择数量,在 uni-number-box 判断,并且 取 stock 和 goods_num 的小值
|
// || price.stock < this.goodsNum 不判断是否大于当前选择数量,在 uni-number-box 判断,并且 取 stock 和 goods_num 的小值
|
||||||
|
|||||||
@ -93,6 +93,7 @@ export default {
|
|||||||
queryActivitiesType: baseUrl +'app/activitiesType/queryActivitiesType',
|
queryActivitiesType: baseUrl +'app/activitiesType/queryActivitiesType',
|
||||||
queryProductLabel: baseUrl +'app/product/queryProductLabel',
|
queryProductLabel: baseUrl +'app/product/queryProductLabel',
|
||||||
queryGroupBuyProduct: baseUrl +'app/groupBuy/queryGroupBuyProduct',
|
queryGroupBuyProduct: baseUrl +'app/groupBuy/queryGroupBuyProduct',
|
||||||
|
queryProduct: baseUrl +'app/product/queryProduct',
|
||||||
|
|
||||||
NEED_NOT_LOGIN_PAGE: [
|
NEED_NOT_LOGIN_PAGE: [
|
||||||
'/pages/login/login',
|
'/pages/login/login',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user