价格修改 返回bug修改

This commit is contained in:
1154079537 2024-05-21 16:35:54 +08:00
parent fc96dceea9
commit 8eb4c1f97d
4 changed files with 179 additions and 164 deletions

View File

@ -23,7 +23,8 @@
<view class="tab"> <view class="tab">
<view class="item active" style="margin: 0;">{{merchant_Data.margin}}</view> <view class="item active" style="margin: 0;">{{merchant_Data.margin}}</view>
</view> </view>
<button class="btn" :class="{'btn-d': merchant_Data.is_margin != 1}" @click="paydecimal">{{merchant_Data.is_margin != 1?"无需缴纳":"缴纳"}}</button> <button class="btn" :class="{'btn-d': merchant_Data.is_margin != 1}"
@click="paydecimal">{{merchant_Data.is_margin != 1?"无需缴纳":"缴纳"}}</button>
</view> </view>
<!-- <view class="tip"> <!-- <view class="tip">
<view class="title">注意事项</view> <view class="title">注意事项</view>
@ -35,8 +36,7 @@
color: '#333', color: '#333',
fontWeight: 'bold', fontWeight: 'bold',
transform: 'scale(1.05)' transform: 'scale(1.05)'
}" }" :inactiveStyle="{
:inactiveStyle="{
color: '#333', color: '#333',
transform: 'scale(1)' transform: 'scale(1)'
}"></u-tabs> }"></u-tabs>
@ -79,7 +79,9 @@
marginlist, marginlist,
autoMarginlist autoMarginlist
} from '@/api/api.js' } from '@/api/api.js'
import { Toast } from '../../libs/uniApi' import {
Toast
} from '../../libs/uniApi'
export default { export default {
data() { data() {
return { return {
@ -111,44 +113,18 @@
this.autoList(true); this.autoList(true);
}, },
onReachBottom() { onReachBottom() {
if(this.current==0){ if (this.current == 0) {
this.loadend2 = false; this.loadend2 = false;
this.loading2 = false; this.loading2 = false;
this.autoList(false); this.autoList(false);
}else { } else {
this.loadend = false; this.loadend = false;
this.loading = false; this.loading = false;
this.list(false); this.list(false);
} }
}, },
methods: { methods: {
list(isPage) {
let that = this;
if (that.loadend) return;
if (that.loading) return;
if (isPage === true) that.$set(that, 'productList', []);
that.loading = true;
that.loadTitle = '';
marginlist(that.where).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.productList);
let loadend = list.length < that.where.limit;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
setTimeout(() => {
that.$set(that, 'productList', productList);
}, 500)
that.$set(that.where, 'page', that.where.page + 1);
if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
// //
decimal() { decimal() {
merchant({ merchant({
@ -172,7 +148,7 @@
if (res.confirm) { if (res.confirm) {
// console.log(''); // console.log('');
paymerchant().then((res) => { paymerchant().then((res) => {
try{ try {
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
orderInfo: res.data orderInfo: res.data
@ -191,7 +167,7 @@
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
} }
}); });
}catch(err){ } catch (err) {
Toast('请前往小程序中支付') Toast('请前往小程序中支付')
} }
}).catch((err) => { }).catch((err) => {
@ -204,30 +180,57 @@
} }
} }
}); });
} }
}, },
changeCurrent(e){ changeCurrent(e) {
this.current = e.index; this.current = e.index;
if(e.index==0){ if (e.index == 0) {
this.loadend = false; this.loadend = false;
this.loading = false; this.loading = false;
this.autoList(true); this.autoList(true);
}else { } else {
this.loadend = false; this.loadend = false;
this.loading = false; this.loading = false;
this.list(true) this.list(true)
} }
}, },
autoList(isPage){
list(isPage) {
let that = this;
if (that.loadend) return;
if (that.loading) return;
if (isPage === true) that.$set(that, 'productList', []);
that.loading = true;
that.loadTitle = '';
marginlist(that.where).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.productList);
let loadend = list.length < that.where.limit;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
setTimeout(() => {
that.$set(that, 'productList', productList);
}, 500)
if (isPage) that.where.page = 1;
else that.$set(that.where, 'page', that.where.page + 1);
if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
autoList(isPage) {
let that = this; let that = this;
if (that.loadend2) return; if (that.loadend2) return;
if (that.loading2) return; if (that.loading2) return;
if (isPage === true) that.$set(that, 'deductList', []); if (isPage === true) that.$set(that, 'deductList', []);
that.loading2 = true; that.loading2 = true;
that.loadTitle2 = ''; that.loadTitle2 = '';
autoMarginlist(this.mer_id, that.where2).then(res=>{ autoMarginlist(this.mer_id, that.where2).then(res => {
let list = res.data; let list = res.data;
let deductList = that.$util.SplitArray(list, that.deductList); let deductList = that.$util.SplitArray(list, that.deductList);
let loadend = list.length < that.where2.limit; let loadend = list.length < that.where2.limit;
@ -239,7 +242,7 @@
}, 500); }, 500);
that.$set(that.where2, 'page', that.where2.page + 1); that.$set(that.where2, 'page', that.where2.page + 1);
if (that.where2.page == 1 && res.data.length <= 0) that.emptyShow = true if (that.where2.page == 1 && res.data.length <= 0) that.emptyShow = true
}).catch(err=>{ }).catch(err => {
console.log(err); console.log(err);
that.loading2 = false; that.loading2 = false;
that.loadTitle2 = '加载更多'; that.loadTitle2 = '加载更多';
@ -272,8 +275,7 @@
color: #333333; color: #333333;
} }
.deduct{ .deduct {}
}
} }
.info { .info {
@ -309,7 +311,6 @@
position: absolute; position: absolute;
top: 0; top: 0;
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
@ -328,7 +329,8 @@
flex-shrink: 0; flex-shrink: 0;
margin-right: 18rpx; margin-right: 18rpx;
} }
.text{
.text {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
@ -407,7 +409,8 @@
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
.btn-d{
.btn-d {
background-color: #999; background-color: #999;
} }
} }

View File

@ -205,6 +205,7 @@
style="background-color: #F9F9F9;height: 166rpx;" :maxlength='300'></u--textarea> style="background-color: #F9F9F9;height: 166rpx;" :maxlength='300'></u--textarea>
<u-line color="#F3F3F3" style="margin: 30rpx 0;"></u-line> <u-line color="#F3F3F3" style="margin: 30rpx 0;"></u-line>
<u-form-item label="送货方式" labelPosition="left" prop='delivery_way' required> <u-form-item label="送货方式" labelPosition="left" prop='delivery_way' required>
<u-checkbox-group v-model="formData.delivery_way" placement="row" slot="right"> <u-checkbox-group v-model="formData.delivery_way" placement="row" slot="right">
<u-checkbox shape="circle" v-for="(item, index) in checkboxList1" :key="index" <u-checkbox shape="circle" v-for="(item, index) in checkboxList1" :key="index"
@ -425,8 +426,7 @@
{ {
name: '快递配送', name: '快递配送',
value: '2', value: '2',
}, }
], ],
attrRules: { attrRules: {
price: '单价不能为空', price: '单价不能为空',
@ -767,11 +767,19 @@
this.initFormData(option) this.initFormData(option)
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
this.isSet2() this.isSet2()
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',') this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',');
if (this.formData.delivery_way.length == 1) { if (this.formData.delivery_way.length == 1) {
let checkboxList1 = uni.getStorageSync('checkboxList1');
if (checkboxList1 && checkboxList1.length > 0) {
this.checkboxList1 = checkboxList1;
} else {
this.checkboxList1 = this.checkboxList1.filter(item => { this.checkboxList1 = this.checkboxList1.filter(item => {
return item.value == this.formData.delivery_free[0] return item.value == this.formData.delivery_free[0]
}) });
uni.setStorageSync('checkboxList1', this.checkboxList1)
}
} }
if (option.product_id) { if (option.product_id) {
this.formData.product_id = option.product_id this.formData.product_id = option.product_id

View File

@ -295,7 +295,11 @@
uni.redirectTo({ uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`, url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`,
success(res) { success(res) {
uni.setStorageSync('delta', 2);
let delta = uni.getStorageSync('delta');
if (delta) delta += 1;
else delta = 2;
uni.setStorageSync('delta', delta);
} }
}) })
}, },

View File

@ -37,13 +37,13 @@
<view class="" style="color: #FC452F;font-size: 24rpx;"> <view class="" style="color: #FC452F;font-size: 24rpx;">
<text style="color:#989898" v-if='isWholeSale'>零售</text> <text <text style="color:#989898" v-if='isWholeSale'>零售</text> <text
style="font-size: 22rpx;"></text><text>{{item.attrValue[0].price}}</text><text style="font-size: 22rpx;"></text><text>{{item.price}}</text><text
style="color: #828282;">/{{item.attrValue[0].unit_name}}</text> style="color: #828282;">/{{item.unit_name}}</text>
</view> </view>
<view class="" style="color: #FC452F;font-size: 24rpx;" v-if='isWholeSale'> <view class="" style="color: #FC452F;font-size: 24rpx;" v-if='isWholeSale'>
<text style="color:#989898">批发</text> <text <text style="color:#989898">批发</text> <text
style="font-size: 22rpx;"></text><text>{{item.attrValue[0].wholesale_price}}</text><text style="font-size: 22rpx;"></text><text>{{item.price}}</text><text
style="color: #828282;">/{{item.attrValue[0].wholesale_unit_name}}</text> style="color: #828282;">/{{item.attrValue[0].wholesale_unit_name}}</text>
</view> </view>
</view> </view>