fix: 代客下单商品列表接口修改,增加售罄,下架,不可售状态标识
This commit is contained in:
parent
0b5737116e
commit
059a40dd67
|
|
@ -7,8 +7,8 @@ VITE_APP_BASE_API=/dev-api
|
|||
# 接口地址
|
||||
|
||||
# VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 测试
|
||||
VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
|
||||
# VITE_APP_API_URL=http://192.168.1.31/ # 本地
|
||||
# VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
|
||||
VITE_APP_API_URL=http://192.168.1.31/ # 本地
|
||||
|
||||
|
||||
# WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 5.9 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 20 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 6.5 KiB |
|
|
@ -46,9 +46,6 @@ export const useCartsStore = defineStore("carts", () => {
|
|||
const goods = useStorage<any[]>("Instead_goods", []);
|
||||
async function getGoods(query: any) {
|
||||
const res = await productApi.list({
|
||||
page: 1,
|
||||
size: 999,
|
||||
status: "on_sale",
|
||||
...query,
|
||||
});
|
||||
goods.value = res.filter((v: { type: string }) => v.type != 'coupon');
|
||||
|
|
|
|||
|
|
@ -6,13 +6,36 @@
|
|||
:src="item.coverImg + '?x-oss-process=image/resize,m_lfit,w_100,h_100'"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
<div class="info">
|
||||
<div class="info" @click="itemClick">
|
||||
<div class="name u-flex u-flex-wrap">
|
||||
<span class="weight" v-if="item.type == 'weight'">称重</span>
|
||||
<span class="u-line-3">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="">¥{{ item.lowPrice }}</div>
|
||||
</div>
|
||||
<div class="status" v-if="item.isSoldStock || !item.isSale || !item.isSaleTime">
|
||||
<svg-icon
|
||||
@click="ElMessage.error('该商品已售罄')"
|
||||
v-if="item.isSoldStock"
|
||||
iconClass="shouqing"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
@click="ElMessage.error('该商品已下架')"
|
||||
v-else-if="!item.isSale"
|
||||
iconClass="yi-xiajia"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
@click="ElMessage.error('该商品不在可售时间内')"
|
||||
v-else-if="!item.isSaleTime"
|
||||
iconClass="no-sale"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -26,6 +49,10 @@ const props = defineProps({
|
|||
active: Boolean,
|
||||
select: Function,
|
||||
});
|
||||
const emits = defineEmits(["itemClick"]);
|
||||
function itemClick() {
|
||||
emits("itemClick");
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.goods-item {
|
||||
|
|
@ -50,7 +77,22 @@ const props = defineProps({
|
|||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
background-color: rgba(46, 46, 46, 0.38);
|
||||
z-index: 1;
|
||||
}
|
||||
.status {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
padding: 8px;
|
||||
z-index: 2;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: rgba($color: #000000, $alpha: 0.5);
|
||||
}
|
||||
}
|
||||
:deep(.svg-icon) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.weight {
|
||||
height: 15px;
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@
|
|||
</div>
|
||||
<GoodsItem
|
||||
:item="item"
|
||||
@click="goodsClick(item)"
|
||||
@itemClick="goodsClick(item)"
|
||||
v-for="item in carts.goods"
|
||||
:key="item.id"
|
||||
></GoodsItem>
|
||||
|
|
|
|||
Loading…
Reference in New Issue