|
|
@@ -25,12 +25,16 @@
|
|
|
<view class="goods-list" v-for="(goodsItem, idx) in list.data" :key="idx">
|
|
|
<view class="goods-list-top" @click="edit(goodsItem.id)">
|
|
|
<view class="img-blo">
|
|
|
- <view v-if="goodsItem.stock <= 0 || goodsItem.status == 0" class="sold-out">
|
|
|
- <view class="sold-out-xj">
|
|
|
- 已下架
|
|
|
- <view v-if="goodsItem.stock != 0 && goodsItem.status == 0">(商城隐藏)</view>
|
|
|
+ <block v-if="goodsItem.stock <= 0">
|
|
|
+ <view class="sold-out">
|
|
|
+ <view class="sold-out-xj">已下架</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <view v-if="goodsItem.status == 0" class="sold-out">
|
|
|
+ <view class="sold-out-xj">隐藏</view>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
<img :src="goodsItem.smallCover" mode="aspectFit" />
|
|
|
</view>
|
|
|
<view class="goods-det">
|
|
|
@@ -41,8 +45,8 @@
|
|
|
<view v-if="goodsItem.priceType == 1">
|
|
|
<!-- 当涨价开关开启时,显示涨价后价格和原价 -->
|
|
|
<view v-if="riseSwitch" class="price-container">
|
|
|
- <text class="goods-price" style="font-size:26upx;">¥{{ risePrice(goodsItem).toFixed(2) }}</text>
|
|
|
- <text class="original-price" style="font-size:22upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price).toFixed(2):0 }}</text>
|
|
|
+ <text class="goods-price" style="font-size:26upx;">¥{{ risePrice(goodsItem) }}</text>
|
|
|
+ <text class="original-price" style="font-size:22upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</text>
|
|
|
</view>
|
|
|
<!-- 当涨价开关关闭时,显示原价 -->
|
|
|
<view v-else class="goods-price" style="font-size:26upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</view>
|
|
|
@@ -159,8 +163,8 @@ export default {
|
|
|
searchTimer: null, // 搜索防抖定时器
|
|
|
riseSwitch: false, // 价格上涨开关
|
|
|
riseData: {}, // 价格上涨配置
|
|
|
- lookStock:0, // 1:有库存 2:无库存
|
|
|
- lookPrice:0, // 1:有价格 2:无价格
|
|
|
+ stockStatus:0, // 1:有库存 2:无库存
|
|
|
+ priceStatus:0, // 1:有价格 2:无价格
|
|
|
// 新增筛选相关数据
|
|
|
showFilterPanel: false,
|
|
|
selectedPrice: null, // 选中的价格筛选
|
|
|
@@ -246,8 +250,8 @@ export default {
|
|
|
this.selectedFlowerNum = null;
|
|
|
|
|
|
// 清空后立即更新筛选变量
|
|
|
- this.lookPrice = 0;
|
|
|
- this.lookStock = 0;
|
|
|
+ this.priceStatus = 0;
|
|
|
+ this.stockStatus = 0;
|
|
|
this.flowerNum = 0;
|
|
|
|
|
|
// 关闭筛选面板
|
|
|
@@ -260,8 +264,8 @@ export default {
|
|
|
|
|
|
confirmFilters() {
|
|
|
// 更新原有的筛选变量以保持兼容性
|
|
|
- this.lookPrice = this.selectedPrice || 0;
|
|
|
- this.lookStock = this.selectedStock || 0;
|
|
|
+ this.priceStatus = this.selectedPrice || 0;
|
|
|
+ this.stockStatus = this.selectedStock || 0;
|
|
|
this.flowerNum = this.selectedFlowerNum || 0;
|
|
|
|
|
|
// 关闭筛选面板
|
|
|
@@ -276,20 +280,12 @@ export default {
|
|
|
// 兼容保留:旧筛选弹窗相关方法已不再使用
|
|
|
moreToDo(item){
|
|
|
let that=this;
|
|
|
- let doList = ['打1个标签', '打2个标签','打5个标签', '打10个标签', '销售记录', '设置为散花']
|
|
|
+ let doList = ['打1个标签', '打2个标签','打5个标签', '打10个标签']
|
|
|
let doNum = [1,2,5,10,20]
|
|
|
uni.showActionSheet({
|
|
|
itemList: doList,
|
|
|
success: function (respond) {
|
|
|
let index = respond.tapIndex
|
|
|
- if(index == 4){
|
|
|
- that.$msg('开发中')
|
|
|
- return
|
|
|
- }
|
|
|
- if(index == 5){
|
|
|
- that.$msg('开发中')
|
|
|
- return
|
|
|
- }
|
|
|
let currentNum = Number(doNum[index])
|
|
|
print({id:item.id,num:currentNum}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
@@ -327,7 +323,7 @@ export default {
|
|
|
this.catId = this.tabbar[0].id
|
|
|
this.getGoodsList()
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
searchFn(){
|
|
|
// 清除之前的定时器
|
|
|
@@ -365,8 +361,8 @@ export default {
|
|
|
flower:1,
|
|
|
searchText:this.searchText,
|
|
|
flowerNum:this.flowerNum,
|
|
|
- lookPrice:this.lookPrice,
|
|
|
- lookStock:this.lookStock
|
|
|
+ priceStatus:this.priceStatus,
|
|
|
+ stockStatus:this.stockStatus
|
|
|
}).then(res => {
|
|
|
this.completes(res);
|
|
|
});
|
|
|
@@ -374,7 +370,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getGoodsList() {
|
|
|
- return getCategoryToGoods({ status:'', page: this.list.page, catId:this.catId, flowerNum:this.flowerNum, lookPrice:this.lookPrice, lookStock:this.lookStock }).then(res => {
|
|
|
+ return getCategoryToGoods({ status:'', page: this.list.page, catId:this.catId, flowerNum:this.flowerNum, priceStatus:this.priceStatus, stockStatus:this.stockStatus }).then(res => {
|
|
|
this.completes(res)
|
|
|
})
|
|
|
},
|
|
|
@@ -489,12 +485,12 @@ page {
|
|
|
.goods-list-bottom {
|
|
|
width: 96%;
|
|
|
margin-top: 16upx;
|
|
|
- color: #bebebe;
|
|
|
+ color: rgb(180, 178, 178);
|
|
|
text{
|
|
|
- border:1px solid rgb(218, 216, 216);
|
|
|
- border-radius: 20upx;
|
|
|
+ border:1px solid rgb(196, 193, 193);
|
|
|
+ border-radius: 15upx;
|
|
|
font-size:22upx;
|
|
|
- padding:9upx 25upx 9upx 25upx;
|
|
|
+ padding:12upx 25upx 12upx 25upx;
|
|
|
}
|
|
|
}
|
|
|
.img-blo {
|
|
|
@@ -558,7 +554,6 @@ page {
|
|
|
// 原价格划线样式
|
|
|
.original-price {
|
|
|
color: #999999;
|
|
|
- text-decoration: line-through;
|
|
|
margin-left: 10upx;
|
|
|
}
|
|
|
}
|