From 293bdab16ef217cf02416c0e0ffeca36a0c69e6d Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 20 八月 2024 15:52:35 +0800
Subject: [PATCH] update 更新质检的操作界面和接口
---
sub_pages/customer/self/history.vue | 97 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 80 insertions(+), 17 deletions(-)
diff --git a/sub_pages/customer/self/history.vue b/sub_pages/customer/self/history.vue
index d6513f6..d1a2578 100644
--- a/sub_pages/customer/self/history.vue
+++ b/sub_pages/customer/self/history.vue
@@ -59,7 +59,7 @@
if (item.status == 'UP') {
} else {
- this.$message.showToast('已失效,无法查看详情')
+ this.$message.showToast('商品已下架,无法查看详情')
return
}
uni.navigateTo({
@@ -70,8 +70,8 @@
//提交到购物车中
// this.$message.showLoading()
const res = await this.$store.dispatch('submitShopping', dto);
- console.log('res',res)
- if (res&&res.code == 0){
+ console.log('res', res)
+ if (res && res.code == 0) {
dto.shopnum = res.data || 0
this.$forceUpdate()
}
@@ -101,14 +101,14 @@
var t = parseInt(res.content)
if (isNaN(t) || t < 0) {
this.$message.showToast('数目需要大于等于0')
-
+
} else {
- if(!item.stock || t>item.stock){
+ if (!item.stock || t > item.stock) {
this.$message.showToast('库存不足无法修改')
return
}
this.addnum(item, (t - item.shopnum))
-
+
}
} else {
@@ -128,7 +128,7 @@
if (!item.stock) {
item.stock = 0
}
- if (item.shopnum + addnum > item.stock) {
+ if (addnum > 0 & item.shopnum + addnum > item.stock) {
this.$message.showToast('库存不足,无法修改')
return
}
@@ -169,12 +169,14 @@
</view>
</view>
<view class="component-filter-container p10">
- <view class="flex1" @click.stop="order_show=true">
- {{ this.query.columnStr || '排序' }}
+ <!-- @click.stop="order_show=true" -->
+ <view class="flex1" @click.stop="$refs.popup_column.open()">
+ 排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
</view>
- <view class="flex1" @click.stop="level_show=true">
- {{ this.query.levelStr || '级别' }}
+ <!-- @click.stop="level_show=true" -->
+ <view class="flex1" @click.stop="$refs.popup_level.open()">
+ {{ query.levelStr || '级别' }}
<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
</view>
</view>
@@ -189,10 +191,11 @@
@cancel="order_show=false"></u-picker>
<view class="trade-list-container">
- <view class="trade-info-container flex" v-for="(dto,index) of list" :key="index"
- >
- <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image>
- <view class="flex1" >
+ <view class="trade-info-container flex" :class="[dto.status!=='UP'?'OFF':'']" v-for="(dto,index) of list"
+ :key="index">
+ <image class="img img100 br-4 m-r-10" :class="[!dto.stock?'component-stock-zero':'']"
+ :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image>
+ <view class="flex1">
<view class="flex" @click.stop="toDetail(dto)">
<view class="title">
<span class="m-r-5" style="display: inline-block;"
@@ -217,7 +220,8 @@
<view class="m-r-0 flex" v-if="dto.shopnum">
<uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32"
@click.stop="addnum(dto,-1)"></uni-icons>
- <view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.shopnum&&dto.shopnum>=1">
+ <view class="curnums" @click.stop="updateItemNum(dto)"
+ v-if="dto.shopnum&&dto.shopnum>=1">
{{ dto.shopnum }}
</view>
<uni-icons v-if="!dto.shopnum||dto.shopnum<=999" type="plus-filled" size="32"
@@ -231,6 +235,58 @@
</view>
</view>
+
+
+
+ <uni-popup ref="popup_level" type="bottom">
+ <view class="component-popup_input_all">
+ <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同级别</view>
+ <view v-for="(item,i) in level_columns" :key="i" class="m-t-20">
+ <view class="m-t-12 flex value-items">
+ <view class="value-item" @click="()=>{
+ if(each.value!==query.value){
+ query.level = each.value
+ query.levelStr = each.label
+ refreshList()
+ $refs.popup_level.close()
+ }
+ }" :class="[query.level==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
+ {{ each.label || '-' }}
+ </view>
+ </view>
+ </view>
+ <view class="button-space"></view>
+ <view>
+ <view class="button-green" @click="$refs.popup_level.close()">关闭
+ </view>
+ </view>
+ </view>
+ </uni-popup>
+ <uni-popup ref="popup_column" type="bottom">
+ <view class="component-popup_input_all">
+ <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同排序</view>
+ <view v-for="(item,i) in order_columns" :key="i" class="m-t-20">
+ <view class="m-t-12 flex value-items">
+ <view class="value-item" @click="()=>{
+ if(each.value!==query.value){
+ query.column = each.value
+ query.columnStr = each.label
+ refreshList()
+ $refs.popup_column.close()
+ }
+ }" :class="[query.column==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
+ {{ each.label || '-' }}
+ </view>
+ </view>
+ </view>
+ <view class="button-space"></view>
+ <view>
+ <view class="button-green" @click="$refs.popup_column.close()">关闭
+ </view>
+ </view>
+ </view>
+ </uni-popup>
+
</view>
</template>
@@ -268,6 +324,13 @@
}
+ .trade-info-container.OFF {
+ .title {
+ color: #666;
+
+ }
+ }
+
.trade-info-container {
background-color: #fff;
border-radius: 20rpx;
@@ -286,7 +349,7 @@
font-weight: 600;
font-size: 28rpx;
- color: #000000;
+ color: #000;
line-height: 40rpx;
.level {
--
Gitblit v1.9.3