Commit 28291870 authored by 黄媛媛's avatar 黄媛媛

修改分类的售完和下架的处理

parent 2dfc5d8e
......@@ -25,9 +25,35 @@
<view :style="{ height: scrollHeight }">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%', padding: '0 0 0 10px' }">
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img"><image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /></view>
<view class="good-img" style="position: relative;">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</view>
<view class="good-info">
<view class="good-name">{{ cx.name }}</view>
<view class="good-name">
<view
v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''"
class="Logo"
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}"
>{{cx.marketingLogo.words}}</view>
<image
v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''"
mode="heightFix"
:src="cx.marketingLogo.ico"
style=" height: 11px;"
/>
<view
style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0"
>
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}</view>
<view class="goodprice">
<view class="left">
<view v-if="cx.is_level==1">
......@@ -155,6 +181,13 @@ export default {
this.loading = false;
console.log('resggg', res);
if (res.resultCode == 1) {
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count == 0) {
......@@ -305,4 +338,11 @@ export default {
border: 1px solid transparent;
font-size: 12px;
}
.catstyle11 .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
</style>
......@@ -31,14 +31,34 @@
<u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)">
<view class="good-img">
<image
mode="aspectFit"
:src="cx.cover_pic"
style="width: 100%; height: 100%;"
/>
<view class="good-img" style="position: relative;">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</view>
<view class="good-name">{{ cx.name }}</view>
<view class="good-name">
<view
v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''"
class="Logo"
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}"
>{{cx.marketingLogo.words}}</view>
<image
v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''"
mode="heightFix"
:src="cx.marketingLogo.ico"
style=" height: 11px;"
/>
<view
style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0"
>
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}</view>
<view class="good-info">
<view class="price" :style="{ color: mainColor }">{{
cx.price_content
......@@ -108,6 +128,13 @@ export default {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count==0) {
......@@ -195,4 +222,11 @@ export default {
flex: 1;
text-align: right;
}
.catstyle3 .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
</style>
......@@ -35,15 +35,35 @@
:key="ci"
@click="clickHandler(cx)"
>
<div class="good-img">
<image
mode="aspectFit"
:src="cx.cover_pic"
style="width: 100%; height: 100%;"
/>
<div class="good-img" style="position: relative;">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</div>
<div class="good-info">
<div class="good-name">{{ cx.name }}</div>
<div class="good-name">
<view
v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''"
class="Logo"
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}"
>{{cx.marketingLogo.words}}</view>
<image
v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''"
mode="heightFix"
:src="cx.marketingLogo.ico"
style=" height: 11px;"
/>
<view
style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0"
>
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}</div>
<div class="goodprice">
<div class="left">
<div v-if="cx.is_level==1">
......@@ -153,6 +173,13 @@ export default {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count==0) {
......@@ -293,4 +320,11 @@ export default {
width: 100%;
height: calc(100vw - 105px / 3.37);
}
.catstyle4 .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
</style>
......@@ -43,14 +43,34 @@
<u-row gutter="10">
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<div class="good" @click="clickHandler(cx)">
<div class="good-img">
<image
mode="aspectFit"
:src="cx.cover_pic"
style="width: 100%; height: 100%;"
/>
<div class="good-img" style="position: relative;">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</div>
<div class="good-name">{{ cx.name }}</div>
<div class="good-name">
<view
v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''"
class="Logo"
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}"
>{{cx.marketingLogo.words}}</view>
<image
v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''"
mode="heightFix"
:src="cx.marketingLogo.ico"
style=" height: 11px;"
/>
<view
style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0"
>
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}</div>
<div class="good-info">
<div class="price" :style="{ color: mainColor }">
{{ cx.price_content }}
......@@ -156,6 +176,13 @@ export default {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count==0) {
......@@ -256,4 +283,11 @@ export default {
border: 1px solid transparent;
font-size: 12px;
}
.catstyle7 .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
</style>
......@@ -42,11 +42,35 @@
:style="{ height: '100%', padding: '0 0 0 10px' }"
>
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
<view class="good-img" style="position: relative;">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</view>
<view class="good-info">
<view class="good-name">{{ cx.name }}</view>
<view class="good-name">
<view
v-if="cx.marketingLogo.iswords && cx.marketingLogo.iswords==1&& cx.marketingLogo.words!=''"
class="Logo"
:style="{color: cx.marketingLogo.wordsColor,
background:cx.marketingLogo.wordsBack ,}"
>{{cx.marketingLogo.words}}</view>
<image
v-if="cx.marketingLogo.iswords&&cx.marketingLogo.iswords==2&& cx.marketingLogo.ico!=''"
mode="heightFix"
:src="cx.marketingLogo.ico"
style=" height: 11px;"
/>
<view
style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;height: 32rpx;font-size: 20rpx;margin-right: 5rpx;"
v-if="cx.freeShippingFullMoneyPinkage>0 || cx.freeShippingFullNumPinkage>0"
>
{{cx.freeShippingFullMoneyPinkage>0 && cx.freeShippingFullNumPinkage==0?cx.freeShippingFullMoneyPinkage+'元包邮':''}}
{{cx.freeShippingFullMoneyPinkage==0 && cx.freeShippingFullNumPinkage>0?cx.freeShippingFullNumPinkage+'件包邮':''}}
</view>
{{ cx.name }}</view>
<view class="goodprice">
<view class="left">
<view v-if="cx.is_level==1">
......@@ -181,6 +205,13 @@ export default {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count==0) {
......@@ -330,4 +361,11 @@ export default {
border: 1px solid transparent;
font-size: 12px;
}
.catstyle8 .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
</style>
......@@ -49,10 +49,14 @@
<text class="label">购买数量</text>
<u-number-box :disabled="!skuObj" v-model="gc" :min="1" :max="goodamount" @change="valChange"></u-number-box>
</view>
<view class="btn-box">
<view class="btn-box" v-if="g.totalStock>0&& g.status==1">
<view style="flex: 1;" v-if="optionType != 1"><u-button @click="joinCar" :ripple="true" :hair-line="false" :custom-style="btn1">加入购物车</u-button></view>
<view style="flex: 1;" v-if="optionType != 0"><u-button @click="buy" :ripple="true" :hair-line="false" :custom-style="btn2">立即购买</u-button></view>
</view>
<view class="btn-box" v-if="g.totalStock==0||g.status==2">
<view style="flex: 1;" ><u-button :ripple="true" :hair-line="false" :custom-style="btn3">售馨</u-button></view>
</view>
</view>
</u-popup>
</template>
......@@ -119,6 +123,16 @@ export default {
fontSize: '13px',
width: '100%'
},
btn3: {
flex: 1,
height: '100%',
borderRadius: '40px',
border: 'none',
color: '#FFF',
fontSize: '13px',
width: '100%',
background:'#ababab'
},
sku: '',
g: {},
skuObj: null,
......@@ -149,6 +163,10 @@ export default {
},
res => {
this.g = res.data.goods;
this.g.totalStock=0;
this.g.attr.forEach(x=>{
this.g.totalStock+=x.stock
})
this.goodimage = this.g.cover_pic;
this.mc = this.$uiConfig.mainColor;
......
......@@ -4,7 +4,10 @@
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)">
<view class="good-img">
<image mode="aspectFill" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
<image mode="aspectFill" :src="cx.cover_pic" style="width: 100%; height: 100%;" >
<image src="../../static/images/icon/plugins-out.png" v-if="cx.totalStock==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
</view>
<view class="good-name" v-if="setting.is_show_goods_name==1">
......@@ -85,6 +88,7 @@ export default {
this.setting = uni.getStorageSync("basedata").mall.setting;
},
clickHandler(item) {
console.log(item)
console.log("GoodsId", item);
uni.navigateTo({ url: "/pages/goods/goods?GoodsId=" + item.id });
},
......
......@@ -40,7 +40,7 @@
</u-checkbox-group>
</view>
<view class="cartList_item" v-for="(item, index) in c.GoodsList" :key="index" :name="item.GoodsName" >
<view style="width: 40px;text-align: center;" v-if="item.GoodsStatus == 1 || editType == true">
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && editType == true) || (item.InventoryNum!=0&&editType == false)">
<u-checkbox-group @change="clickcheckbox(item.checked, item.Price, index, i)">
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox>
</u-checkbox-group>
......@@ -49,6 +49,9 @@
<view class="invalid" :style="{ background: mc }" v-if="item.GoodsStatus != 1 && editType == false">
<Text style="color: #fff; width: 22px;font-size: 20rpx;">失效</Text>
</view>
<view class="invalid" :style="{ background: mc }" v-if="item.InventoryNum == 0 && editType == false">
<Text style="color: #fff; width: 22px;font-size: 20rpx;">售馨</Text>
</view>
<image
:src="item.CoverImage"
......@@ -781,7 +784,7 @@ export default {
text-align: center;
width: 40px;
height: 20px;
line-height: 20px;
line-height: 18px;
border-radius: 10px;
}
.cartStyle .Logo{
......
......@@ -13,10 +13,13 @@
<view style="width: 22px; margin: auto;"><u-icon :name="favorStatus ? 'like' : 'like-o'" size="44" :color="favorStatus ? mc : '#333'"></u-icon></view>
<text class="text">收藏</text>
</view>
<view class="item2">
<view class="item2" v-if="totalStock>0 && status==1">
<view style="flex: 1;"><u-button @click="joinCar" :ripple="true" :hair-line="false" :custom-style="btn1">加入购物车</u-button></view>
<view style="flex: 1;"><u-button @click="buy" :ripple="true" :hair-line="false" :custom-style="btn2">立即购买</u-button></view>
</view>
<view class="item2" v-if="totalStock==0|| status==2">
<view style="flex: 1;" ><u-button :ripple="true" :hair-line="false" :custom-style="btn3">售馨</u-button></view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
......@@ -24,7 +27,7 @@
<script>
import auth from "@/components/auth/index";
export default {
props: ['coverPic', 'goodName', 'favorite', 'goodId'],
props: ['coverPic', 'goodName', 'favorite', 'goodId','totalStock','status'],
data() {
return {
mc: '',
......@@ -48,6 +51,16 @@ export default {
fontSize: '13px',
width: '100%'
},
btn3: {
flex: 1,
height: '100%',
borderRadius: '40px',
border: 'none',
color: '#FFF',
fontSize: '13px',
width: '100%',
background:'#ababab'
},
path: '',
favorStatus: false,
//是否显示登陆
......
......@@ -179,7 +179,7 @@
<view style="width: calc(100vw - 20px); margin-left: 10px; overflow: hidden;"><goodlist :list="recommend"></goodlist></view>
<u-skeleton v-if="loading" :loading="true" :animation="true" bgcolor="#FFF"></u-skeleton>
<goodsaction v-if="!loading" :good-name="g.name" :cover-pic="g.cover_pic" :favorite="g.favorite" :good-id="id" @joincar="joinCar" @buy="buy"></goodsaction>
<goodsaction v-if="!loading" :good-name="g.name" :cover-pic="g.cover_pic" :favorite="g.favorite" :good-id="id" :total-stock ='g.totalStock' :status='g.status' @joincar="joinCar" @buy="buy"></goodsaction>
<goodsku
v-if="!loading && showSku"
border-radius="10"
......@@ -428,6 +428,10 @@ export default {
res => {
if (res.resultCode == 1) {
this.g = res.data.goods;
this.g.totalStock=0;
this.g.attr.forEach(x=>{
this.g.totalStock+=x.stock
})
this.g.marketingLogo = JSON.parse(this.g.marketingLogo)
this.isAllowShare = res.data.goods.isAllowShare; //1为可以分享 2为不能分享
if (this.isAllowShare == 2) {
......
......@@ -177,6 +177,10 @@ export default {
if(res.resultCode==1){
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
......
......@@ -265,6 +265,10 @@ export default {
this.showLoading = true;
res.data.pageData.forEach(x=>{
x.marketingLogo = JSON.parse(x.marketingLogo)
x.totalStock = 0;
x.attr.forEach(j=>{
x.totalStock+=j.stock
})
})
this.g = this.g.concat(res.data.pageData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment