优化商品详情页面

This commit is contained in:
java110 2020-10-28 23:51:20 +08:00
parent f260c8e630
commit 808b1214ae
6 changed files with 596 additions and 614 deletions

View File

@ -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();
}
});
})
}

View File

@ -16,20 +16,6 @@
<view class="express"></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="">

View File

@ -5,7 +5,7 @@
</view>
<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>
<image class="goods-image" :src="item.coverPhoto"></image>

View File

@ -68,7 +68,7 @@
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
import { mapMutations, mapActions, mapState } from 'vuex';
export default {
name: 'shoproSku',
name: 'vcSku',
components: {
uniNumberBox
},
@ -276,6 +276,10 @@ export default {
// skuPrice
getCanUseSkuPrice() {
let newPrice = [];
if(this.skuPrice == undefined){
return newPrice;
}
for (let price of this.skuPrice) {
if (price.stock <= 0) {

View File

@ -93,6 +93,7 @@ export default {
queryActivitiesType: baseUrl +'app/activitiesType/queryActivitiesType',
queryProductLabel: baseUrl +'app/product/queryProductLabel',
queryGroupBuyProduct: baseUrl +'app/groupBuy/queryGroupBuyProduct',
queryProduct: baseUrl +'app/product/queryProduct',
NEED_NOT_LOGIN_PAGE: [
'/pages/login/login',

File diff suppressed because it is too large Load Diff