From 40290e044102cb98fa9229b197444c051b90ec61 Mon Sep 17 00:00:00 2001 From: fanfan Date: Thu, 29 Feb 2024 20:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=9C=80=E4=BD=8E=E5=88=A9?= =?UTF-8?q?=E6=B6=A6=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/newFun.js | 8 +++ pages/news3/vipPrice.vue | 110 +++++++++++++++++++++++++++++++-------- 2 files changed, 95 insertions(+), 23 deletions(-) diff --git a/api/newFun.js b/api/newFun.js index 0436084..322de3e 100644 --- a/api/newFun.js +++ b/api/newFun.js @@ -232,4 +232,12 @@ export const setStorePrice = (param) => { // 会员分类xiangqing export const getStorePriceInfo = (param) => { return request.get('store/getStorePriceInfo', param) +} +// 会员分类xiangqing +export const editStore = (param) => { + return request.post('store/editStore', param) +} +// 会员分类xiangqing +export const storeData = (param) => { + return request.get('store/data', param) } \ No newline at end of file diff --git a/pages/news3/vipPrice.vue b/pages/news3/vipPrice.vue index e248b91..b5b9d4f 100644 --- a/pages/news3/vipPrice.vue +++ b/pages/news3/vipPrice.vue @@ -38,8 +38,9 @@ 请设置 - + {{val.startProfit}} - {{val.endProfit}} @@ -61,15 +62,15 @@ - 最低利润: + 最低利润率:% - + 确认 - 备注:利润低于_元的商品不展示在商城里。 + 备注:利润低于_____元的商品不展示在商城里。 @@ -100,6 +101,7 @@ list: [], categoryList: '', type: '', + min_profit: null } }, onLoad(op) { @@ -107,10 +109,48 @@ title: op.type == 0 ? '会员价' : '分销价' }) this.type = op.type - this.getCategory() + this.getCategory(); + this.getStore() }, methods: { + async onSubmitProfit() { + if (!this.min_profit) { + return this.$toast('请输入最低利润率') + } + let { + status, + message, + data + } = await newFunApi.editStore({ + min_profit: this.min_profit + }); + if (status == 200) { + uni.showToast({ + title: "保存成功" + }) + this.getStore() + } + }, + async getStore() { + let { + status, + message, + data + } = await newFunApi.storeData(); + if (status == 200) { + this.min_profit = data.storeInfo.min_profit || '' + } + }, + onSetRate(e) { + let rate = Number(e.detail.value) + if (5 >= rate) { + this.min_profit = '' + return this.$toast('最低利率不能低于等于0%') + } + this.min_profit = rate + + }, // 获取详情 async getInfor() { let { @@ -265,9 +305,9 @@ // 计算利润率 onRate(e, index_1, index_2) { let rate = Number(e.detail.value) - if (0 > rate) { + if (0 >rate) { this.list[this.index_1].price_list[this.index_2].add_price_rate = '' - return this.$toast('最低利率不能低于0%') + return this.$toast('最低利率不能低于等于0%') } this.list[this.index_1].price_list[this.index_2].startProfit = Number((this.list[this.index_1].price_list[ this @@ -415,6 +455,23 @@ align-items: center; justify-content: space-between; + ::v-deep .uni-input-wrapper { + width: 270rpx !important; + text-align: left !important; + height: 70rpx !important; + line-height: 70rpx !important; + margin-left: 20rpx; + + } + + ::v-deep uni-input { + height: 70rpx !important; + font-size: 28rpx; + line-height: 70rpx !important; + border-bottom: 1rpx solid #E6E6E6 !important; + } + + } .price_bnt { @@ -430,12 +487,15 @@ line-height: 60upx; text-align: center; } -.price_txt{ - display: flex; - align-items: center; -} + + .price_txt { + display: flex; + align-items: center; + position: relative; + } + .ruleText { - margin-top: 10rpx; + margin-top: 20rpx; font-size: 28upx; font-family: PingFang SC, PingFang SC; font-weight: 400; @@ -444,16 +504,7 @@ } - ::v-deep .uni-input-wrapper { - width: 180rpx !important; - text-align: center !important; - height: 70rpx !important; - } - ::v-deep uni-input { - height: 70rpx !important; - font-size: 28rpx; - } .category_box { display: flex; @@ -495,6 +546,19 @@ background-color: #fff; margin-bottom: 14upx; + ::v-deep .uni-input-wrapper { + width: 180rpx !important; + text-align: center !important; + height: 70rpx !important; + line-height: 70rpx !important; + } + + ::v-deep uni-input { + height: 70rpx !important; + font-size: 28rpx; + line-height: 70rpx !important; + } + .classTitle { display: flex; justify-content: space-between;