会员最低利润率

version/0412
fanfan 11 months ago
parent 5bc195f39c
commit 40290e0441
  1. 8
      api/newFun.js
  2. 100
      pages/news3/vipPrice.vue

@ -233,3 +233,11 @@ export const setStorePrice = (param) => {
export const getStorePriceInfo = (param) => { export const getStorePriceInfo = (param) => {
return request.get('store/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)
}

@ -38,8 +38,9 @@
<text v-else style="color: #8F8F8F;">请设置</text> <text v-else style="color: #8F8F8F;">请设置</text>
</view> </view>
<view class="rangeInput fix"> <view class="rangeInput fix">
<input type="text" style="border: none;" @input="onRate($event,index_1,index_2)" <input type="text" style="border: none;line-height:70rpx"
placeholder="请设置" v-model="val.add_price_rate" /> @input="onRate($event,index_1,index_2)" placeholder="请设置"
v-model="val.add_price_rate" />
</view> </view>
<view class="profit"> <view class="profit">
<text>{{val.startProfit}}</text> - <text>{{val.endProfit}}</text> <text>{{val.startProfit}}</text> - <text>{{val.endProfit}}</text>
@ -61,15 +62,15 @@
<view class="price_rat" v-if="type==0"> <view class="price_rat" v-if="type==0">
<view class="price_set"> <view class="price_set">
<view class="price_txt"> <view class="price_txt">
<text>最低利润</text><input type="text" :min="5" style="border: none;" placeholder="请输入最低利润" <text>最低利润</text><input type="text" @input="onSetRate" :min="5" style="border: none;"
v-model="add_price_rate" /> placeholder="请输入最低利润率" v-model="min_profit" /><text style="position: absolute;right: 10rpx;">%</text>
</view> </view>
<view class="price_bnt"> <view class="price_bnt" @click="onSubmitProfit" :style="{'opacity': min_profit?1:0.6 }">
确认 确认
</view> </view>
</view> </view>
<view class="ruleText" v-if="type==0"> <view class="ruleText" v-if="type==0">
备注利润低于_元的商品不展示在商城里 备注利润低于_____元的商品不展示在商城里
</view> </view>
</view> </view>
</view> </view>
@ -100,6 +101,7 @@
list: [], list: [],
categoryList: '', categoryList: '',
type: '', type: '',
min_profit: null
} }
}, },
onLoad(op) { onLoad(op) {
@ -107,10 +109,48 @@
title: op.type == 0 ? '会员价' : '分销价' title: op.type == 0 ? '会员价' : '分销价'
}) })
this.type = op.type this.type = op.type
this.getCategory() this.getCategory();
this.getStore()
}, },
methods: { 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() { async getInfor() {
let { let {
@ -267,7 +307,7 @@
let rate = Number(e.detail.value) 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 = '' 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.list[this.index_1].price_list[this.index_2].startProfit = Number((this.list[this.index_1].price_list[
this this
@ -415,6 +455,23 @@
align-items: center; align-items: center;
justify-content: space-between; 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 { .price_bnt {
@ -430,12 +487,15 @@
line-height: 60upx; line-height: 60upx;
text-align: center; text-align: center;
} }
.price_txt { .price_txt {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
} }
.ruleText { .ruleText {
margin-top: 10rpx; margin-top: 20rpx;
font-size: 28upx; font-size: 28upx;
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
font-weight: 400; 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 { .category_box {
display: flex; display: flex;
@ -495,6 +546,19 @@
background-color: #fff; background-color: #fff;
margin-bottom: 14upx; 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 { .classTitle {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

Loading…
Cancel
Save