diff --git a/pages/margin/margin.vue b/pages/margin/margin.vue index 31ffed1..da57fc0 100644 --- a/pages/margin/margin.vue +++ b/pages/margin/margin.vue @@ -23,52 +23,52 @@ {{merchant_Data.margin}}元 - + - - - - 扣除编号:{{item.financial_record_sn}} - 扣除金额:{{item.number}}元 - 扣费方式:{{item.financial_type=='auto_margin'? '订单自动补缴': '其他扣除'}} - 订单编号:{{item.order_sn}} - 扣除时间:{{item.create_time}} - - - {{loadTitle2}} - - - 没有更多了 - - - - - 订单编号:{{item.order_sn}} - 支付金额:{{item.total_price}} - 支付状态:{{item.pay_type==1?'已支付':'待支付'}} - 支付时间:{{item.pay_time}} - - - {{loadTitle}} - - - 没有更多了 - - + + 扣除编号:{{item.financial_record_sn}} + 扣除金额:{{item.number}}元 + 扣费方式:{{item.financial_type=='auto_margin'? '订单自动补缴': '其他扣除'}} + 订单编号:{{item.order_sn}} + 扣除时间:{{item.create_time}} + + + {{loadTitle2}} + + + 没有更多了 + + + + + 订单编号:{{item.order_sn}} + 支付金额:{{item.total_price}} + 支付状态:{{item.pay_type==1?'已支付':'待支付'}} + 支付时间:{{item.pay_time}} + + + {{loadTitle}} + + + 没有更多了 + + @@ -77,9 +77,11 @@ merchant, paymerchant, marginlist, - autoMarginlist + autoMarginlist } from '@/api/api.js' - import { Toast } from '../../libs/uniApi' + import { + Toast + } from '../../libs/uniApi' export default { data() { return { @@ -89,66 +91,40 @@ page: 1, limit: 10 }, - where2: { - page: 1, - limit: 10 - }, + where2: { + page: 1, + limit: 10 + }, productList: [], - deductList: [], + deductList: [], loadend: false, loading: false, loadTitle: '加载更多', - loadend2: false, - loading2: false, - loadTitle2: '加载更多', - current: 0 + loadend2: false, + loading2: false, + loadTitle2: '加载更多', + current: 0 } }, onLoad(e) { this.mer_id = e.mer_id this.decimal() // this.list(true); - this.autoList(true); + this.autoList(true); }, onReachBottom() { - if(this.current==0){ - this.loadend2 = false; - this.loading2 = false; - this.autoList(false); - }else { - this.loadend = false; - this.loading = false; - this.list(false); + if (this.current == 0) { + this.loadend2 = false; + this.loading2 = false; + this.autoList(false); + } else { + this.loadend = false; + this.loading = false; + this.list(false); } }, 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() { merchant({ @@ -172,28 +148,28 @@ if (res.confirm) { // console.log('用户点击确定'); paymerchant().then((res) => { - try{ - uni.requestPayment({ - provider: 'wxpay', - orderInfo: res.data - .config, //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】 - success: (res) => { - this.$util.Tips({ - title: '支付成功' - }); - this.decimal() - this.list(true) - }, - fail: (err) => { - this.$util.Tips({ - title: '支付失败' - }); - console.log('fail:' + JSON.stringify(err)); - } - }); - }catch(err){ - Toast('请前往小程序中支付') - } + try { + uni.requestPayment({ + provider: 'wxpay', + orderInfo: res.data + .config, //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】 + success: (res) => { + this.$util.Tips({ + title: '支付成功' + }); + this.decimal() + this.list(true) + }, + fail: (err) => { + this.$util.Tips({ + title: '支付失败' + }); + console.log('fail:' + JSON.stringify(err)); + } + }); + } catch (err) { + Toast('请前往小程序中支付') + } }).catch((err) => { this.$util.Tips({ title: err @@ -204,47 +180,74 @@ } } }); - } - }, - changeCurrent(e){ - this.current = e.index; - if(e.index==0){ - this.loadend = false; - this.loading = false; - this.autoList(true); - }else { - this.loadend = false; - this.loading = false; - this.list(true) - } - }, - autoList(isPage){ - let that = this; - if (that.loadend2) return; - if (that.loading2) return; - if (isPage === true) that.$set(that, 'deductList', []); - that.loading2 = true; - that.loadTitle2 = ''; - autoMarginlist(this.mer_id, that.where2).then(res=>{ - let list = res.data; - let deductList = that.$util.SplitArray(list, that.deductList); - let loadend = list.length < that.where2.limit; - that.loadend2 = loadend; - that.loading2 = false; - that.loadTitle2 = loadend ? '已全部加载' : '加载更多'; - setTimeout(() => { - that.$set(that, 'deductList', deductList); - }, 500); - that.$set(that.where2, 'page', that.where2.page + 1); - if (that.where2.page == 1 && res.data.length <= 0) that.emptyShow = true - }).catch(err=>{ - console.log(err); + changeCurrent(e) { + this.current = e.index; + if (e.index == 0) { + this.loadend = false; + this.loading = false; + this.autoList(true); + } else { + this.loadend = false; + this.loading = false; + this.list(true) + } + }, + + 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; + if (that.loadend2) return; + if (that.loading2) return; + if (isPage === true) that.$set(that, 'deductList', []); + that.loading2 = true; + that.loadTitle2 = ''; + autoMarginlist(this.mer_id, that.where2).then(res => { + let list = res.data; + let deductList = that.$util.SplitArray(list, that.deductList); + let loadend = list.length < that.where2.limit; + that.loadend2 = loadend; + that.loading2 = false; + that.loadTitle2 = loadend ? '已全部加载' : '加载更多'; + setTimeout(() => { + that.$set(that, 'deductList', deductList); + }, 500); + that.$set(that.where2, 'page', that.where2.page + 1); + if (that.where2.page == 1 && res.data.length <= 0) that.emptyShow = true + }).catch(err => { + console.log(err); that.loading2 = false; that.loadTitle2 = '加载更多'; - }) - } + }) + } } } @@ -260,10 +263,10 @@ .content-order { background: #fff; border-radius: 21rpx 21rpx; - margin: 0 28rpx; + margin: 0 28rpx; margin-top: 30rpx; padding: 28rpx; - box-shadow: 0 0 10rpx 2rpx rgba(0, 0, 0, 0.1); + box-shadow: 0 0 10rpx 2rpx rgba(0, 0, 0, 0.1); .view { font-size: 30rpx; @@ -271,9 +274,8 @@ font-weight: 400; color: #333333; } - - .deduct{ - } + + .deduct {} } .info { @@ -302,13 +304,12 @@ border-radius: 14rpx 14rpx 14rpx 14rpx; opacity: 1; padding: 31.5rpx 28rpx; - font-size: 30rpx; + font-size: 30rpx; display: flex; flex-direction: column; justify-content: space-between; position: absolute; top: 0; - .title { font-size: 32rpx; @@ -328,12 +329,13 @@ flex-shrink: 0; margin-right: 18rpx; } - .text{ - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - } + + .text { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + } } } } @@ -407,9 +409,10 @@ font-weight: 400; color: #FFFFFF; } - .btn-d{ - background-color: #999; - } + + .btn-d { + background-color: #999; + } } .tip { diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue index caa9875..49dc292 100644 --- a/pages/product/addGoodDetail/addGoodDetail.vue +++ b/pages/product/addGoodDetail/addGoodDetail.vue @@ -205,6 +205,7 @@ style="background-color: #F9F9F9;height: 166rpx;" :maxlength='300'> + { - return item.value == this.formData.delivery_free[0] - }) + + let checkboxList1 = uni.getStorageSync('checkboxList1'); + if (checkboxList1 && checkboxList1.length > 0) { + this.checkboxList1 = checkboxList1; + } else { + this.checkboxList1 = this.checkboxList1.filter(item => { + return item.value == this.formData.delivery_free[0] + }); + uni.setStorageSync('checkboxList1', this.checkboxList1) + } } if (option.product_id) { this.formData.product_id = option.product_id diff --git a/pages/product/addGoodDetail/goodsPrice.vue b/pages/product/addGoodDetail/goodsPrice.vue index 80f9934..913fb41 100644 --- a/pages/product/addGoodDetail/goodsPrice.vue +++ b/pages/product/addGoodDetail/goodsPrice.vue @@ -295,7 +295,11 @@ uni.redirectTo({ url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`, success(res) { - uni.setStorageSync('delta', 2); + + let delta = uni.getStorageSync('delta'); + if (delta) delta += 1; + else delta = 2; + uni.setStorageSync('delta', delta); } }) }, diff --git a/pages/product/list/index.vue b/pages/product/list/index.vue index a6a3bf7..4a34135 100644 --- a/pages/product/list/index.vue +++ b/pages/product/list/index.vue @@ -37,13 +37,13 @@ 零售: {{item.attrValue[0].price}}/{{item.attrValue[0].unit_name}} + style="font-size: 22rpx;">¥{{item.price}}/{{item.unit_name}} 批发: {{item.attrValue[0].wholesale_price}}{{item.price}}/{{item.attrValue[0].wholesale_unit_name}}