From c212c9ab501e1aff9e2dd90e8e87871c0bc7f1bc Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 30 七月 2024 14:03:29 +0800
Subject: [PATCH] fix bug
---
sub_pages/customer/shopping/shopping.vue | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/sub_pages/customer/shopping/shopping.vue b/sub_pages/customer/shopping/shopping.vue
index 3ff5488..76ea10c 100644
--- a/sub_pages/customer/shopping/shopping.vue
+++ b/sub_pages/customer/shopping/shopping.vue
@@ -1,6 +1,6 @@
<template>
<view class="shopping-container">
- <view class="top-title"><span class="t-red">*</span> 苏州市一价全含,市区内包邮派送到店
+ <view class="top-title"><span class="t-red">*</span> 花满芫报价已包含打包材料费、交易佣金
</view>
<view class="top-desc">
全程鲜花冷链专线,时效快,损耗小
@@ -29,24 +29,25 @@
<radio :checked="ids.indexOf(dto.id)>=0" @click="changeItem(dto,'flower')"></radio>
<image class="img img100 m-r-6 br-4" :src="dto.url||dto.cover"></image>
<view class="flex1">
- <view class="title"><span class="m-r-5"
+ <view class="title" @click.stop="toDetail(dto)"><span class="m-r-5"
style="display: inline-block;">{{dto.categoryStr||''}}</span><span
v-if="dto.levelStr" class="m-r-5"
style="display: inline-block;">{{ dto.levelStr || '' }}</span>{{ dto.name || '-' }}
</view>
- <view class="price">
+ <view class="price" @click.stop="toDetail(dto)">
{{ dto.price || '-' }}元/扎
</view>
<view class="flex">
- <view class="desc m-t-12 flex">
+ <view class="desc flex p-t-5" @click.stop="toDetail(dto)">
<view class="m-r-15">剩余:{{ dto.stock || 0 }}</view>
<view class="m-r-15">颜色:{{ dto.color || '-' }}</view>
</view>
<view class="button-icons flex m-l-a m-r-0">
<uni-icons v-if="dto.num&&dto.num>=1" type="minus" size="32"
- @click="addnum(dto,-1)"></uni-icons>
+ @click.stop="addnum(dto,-1)"></uni-icons>
<view class="curnums" v-if="dto.num&&dto.num>=1">{{ dto.num }}</view>
- <uni-icons type="plus-filled" size="32" @click="addnum(dto,1)"></uni-icons>
+ <uni-icons type="plus-filled" size="32"
+ @click.stop="addnum(dto,1)"></uni-icons>
</view>
</view>
</view>
@@ -197,7 +198,7 @@
break
}
}
- console.log('this.list',this.list)
+ console.log('this.list', this.list)
}
},
@@ -244,6 +245,27 @@
//更换个人的
if (this.ids.indexOf(dto.id) < 0) {
this.ids.push(dto.id)
+ var has = true
+
+ //判断如果都有,那么顶部的按钮也勾选上
+ for (var i = 0; i < this.list.length; i++) {
+ if (this.list[i].supplierId === dto.supplierId) {
+ for (var j = 0; j < this.list[i].flowerList.length; j++) {
+ if (this.ids.indexOf(this.list[i].flowerList[j].id) < 0) {
+ has = false
+ break
+ }
+ }
+ break
+ }
+ }
+ if (has) {
+ this.ids.push(dto.supplierId)
+ this.$forceUpdate()
+ }else{
+ console.log('has',this.ids,dto)
+ }
+
} else {
this.checkall = false
@@ -258,6 +280,13 @@
if (dto.num + addnum >= 0) {
} else {
+ return
+ }
+ if (!dto.stock) {
+ dto.stock = 0
+ }
+ if (dto.num + addnum > dto.stock) {
+ this.$message.showToast('库存不足,无法添加')
return
}
this.$message.showLoading()
@@ -300,6 +329,11 @@
this.list = data || []
}
+ },
+ toDetail(dto) {
+ uni.navigateTo({
+ url: '/sub_pages/customer/trade/detail?id=' + dto.id
+ })
}
}
}
--
Gitblit v1.9.3