From f29b9dee3aa4c05fc36e8d89ec96f60efe71196e Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期二, 30 七月 2024 17:54:55 +0800 Subject: [PATCH] 1 --- sub_pages/supplier/flower-manage/flower-add.vue | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-) diff --git a/sub_pages/supplier/flower-manage/flower-add.vue b/sub_pages/supplier/flower-manage/flower-add.vue index 896afcc..2382501 100644 --- a/sub_pages/supplier/flower-manage/flower-add.vue +++ b/sub_pages/supplier/flower-manage/flower-add.vue @@ -163,17 +163,11 @@ <view class="form-item bottom-border-no"> <view class="label">商品描述</view> <view class="m-l-a m-r-0 flex"> - <!-- <u-input type="textarea" v-model="dto.description" placeholder="请输入商品描述" type="number" - ></u-input> --> - <!-- <u--textarea v-model="dto.description" style="margin-top: 16px;" - placeholder="请输入商品描述" count></u--textarea> --> - <!-- <uni-easyinput v-model="dto.description" placeholder="请输入商品描述" ></uni-easyinput> --> </view> </view> <view style="min-width: 500rpx;margin-left: 20rpx;margin-right: 20rpx;margin-top: 20rpx;"> - <u--textarea v-model="dto.description" autoHeight - placeholder="请输入商品描述"></u--textarea> + <u--textarea v-model="dto.description" autoHeight placeholder="请输入商品描述"></u--textarea> </view> @@ -391,7 +385,7 @@ } } }, - mapCategoryTree(node, arr) { + mapCategoryTree(node, arr,parentCheckTrue=false) { var has = true if (arr) { var hasTrue = false @@ -402,6 +396,9 @@ has = true if (this.columns_categorys_search) { has = false + } + if(parentCheckTrue){ + has = true } var tmp = { ...item, @@ -425,12 +422,14 @@ // } this.columns_categorys_dict['@' + item.id] = item if (item.children && item.children.length > 0) { - tmp.children = [] - var childrenhas = this.mapCategoryTree(tmp.children, item.children) - if (childrenhas) { - has = true - hasTrue = true + //如果上级已经有了,下级都包含 + tmp.children = [] + var childrenhas = this.mapCategoryTree(tmp.children, item.children,has) + if (childrenhas) { + has = true + hasTrue = true } + } else { tmp.children = undefined } @@ -539,16 +538,20 @@ return } var tmp = parseFloat(this.dto.price) - if (isNaN(tmp) || ('' + tmp) !== ('' + this.dto.price)) { + if (isNaN(tmp) || parseFloat('' + tmp).toFixed(3) !== parseFloat('' + this.dto.price).toFixed(3)) { this.$message.showToast('商品价格格式错误,精确到分') + console.log('a1', ('' + tmp)) + console.log('a1', ('' + this.dto.price)) return } - if ((tmp.toFixed(2) + '' + '0') !== tmp.toFixed(3)) { + if ((tmp.toFixed(2) + '' + '0') !== ('' + tmp.toFixed(3))) { this.$message.showToast('商品价格至多精确到分') + console.log('a1', (tmp.toFixed(2) + '' + '0')) + console.log('a1', tmp.toFixed(3)) // console.log('tmp.toFixed(2)',tmp.toFixed(2),tmp.toFixed(3)) return } else { - this.dto.price = this.dto.price.toFixed(2) + this.dto.price = tmp.toFixed(2) } if (this.dto.price <= 0) { this.$message.showToast('商品价格不能小于等于0') @@ -626,7 +629,7 @@ uploadIcon(key) { console.log('that dto key', key) const that = this - if (key == 'video') { + if (key === 'video') { uni.chooseVideo({ maxDuration: 30, sourceType: ['camera', 'album'], @@ -735,8 +738,9 @@ // height: 100px; .label { - width: 300rpx; - line-height: 60px; + width: 240rpx; + line-height: 60px; + min-width: 240rpx; } -- Gitblit v1.9.3