diff --git a/components/date-picker/date-picker.vue b/components/date-picker/date-picker.vue index 4ae0907..19a2fd9 100644 --- a/components/date-picker/date-picker.vue +++ b/components/date-picker/date-picker.vue @@ -181,7 +181,8 @@ font-size: 24rpx; color: #787877; padding-left: 35rpx; - margin-bottom: 20rpx; + margin-bottom: 20rpx; + color:#b62828; } &-list { diff --git a/packages/change/change.vue b/packages/change/change.vue index cb2baeb..ad0ea9e 100644 --- a/packages/change/change.vue +++ b/packages/change/change.vue @@ -53,8 +53,17 @@ message: '请输入密码', trigger: 'change' }] - } + }, + dateFalse:'', }; + }, + onLoad() { + const configs = uni.getStorageSync('configs') + configs.map(item=>{ + if(item.key==='dateFalse'){ + this.dateFalse = item.value + } + }) }, methods: { goSubmit() { @@ -62,7 +71,16 @@ toast('请填写卡号或密码') return } - this.$u.api.getCard(this.form).then(res => { + this.$u.api.getCard(this.form).then(res => { + let open_date = res.card.sku.open?res.card.sku.open:false + let today = this.$moment().format('YYYY-MM-DD') + console.log(today,open_date,this.$moment(today).isBefore(open_date)) + if(open_date){ + if(this.$moment(today).isBefore(open_date)){ + toast(this.dateFalse+',请于'+open_date+'再次提货',4000) + return + } + } if (res.card.status === 2) { uni.setStorageSync('vuex_card', { card_number: this.form.card_number, diff --git a/packages/myorder/infoconfirm.vue b/packages/myorder/infoconfirm.vue index fb77339..947816d 100644 --- a/packages/myorder/infoconfirm.vue +++ b/packages/myorder/infoconfirm.vue @@ -3,7 +3,8 @@ - + {{details.sku?details.sku.name:''}} {{details.sku?details.sku.specs:''}} @@ -16,12 +17,15 @@ 发货时间 - {{details.send_date?$moment(details.send_date).format("YYYY年M月DD日"):''}} + + {{details.send_date?$moment(details.send_date).format("YYYY年M月DD日"):''}} + {{details.week?'['+details.week+']':''}} + {{details.lunarData?details.lunarData:""}} - {{details.week?'['+details.week+']':''}} + @@ -95,7 +99,8 @@ line-height: 42rpx; } .imgbox{ - width: 307rpx; + width: 150rpx; + height:150rpx; margin: 0 auto; border-radius: 10rpx; border: 1px solid #ba8b45; @@ -103,8 +108,8 @@ margin-bottom: 14rpx; } .imgbox image{ - width:100%; - height: auto; + width: 150rpx; + height:150rpx; vertical-align: middle; } .confirmpicinfo .pictitle{ @@ -140,14 +145,15 @@ width: 550rpx; background: #fff; border-radius: 10rpx; - padding: 45rpx 20rpx 25rpx; + padding: 25rpx 20rpx; } .confirmmarker{ display: block; - font-size:24rpx; + font-size:32rpx; color: #000; font-weight: bold; margin-bottom: 8rpx; + text-align: center; } .flex-li{ display: flex; diff --git a/packages/myorder/myorder.vue b/packages/myorder/myorder.vue index fe96f1e..0253bf0 100644 --- a/packages/myorder/myorder.vue +++ b/packages/myorder/myorder.vue @@ -45,7 +45,7 @@ 物流查询 - 修改 + 修改 通知收件人 @@ -78,10 +78,17 @@ status: '', current: 0, orderList: [], - showData: true + showData: true, + updateFalse:'', } }, - onLoad() { + onLoad() { + const configs = uni.getStorageSync('configs') + configs.map(item=>{ + if(item.key==='updateFalse'){ + this.updateFalse = item.value + } + }) this.getOrderList() }, methods: { @@ -114,11 +121,20 @@ } // this.listArea = res.regions }, - edit(item) { - uni.setStorageSync('vuex_update_card', item) - uni.navigateTo({ - url: '/packages/order/order?hasCard=true&type=edit' - }) + edit(item) { + if(item.can_update){ + uni.setStorageSync('vuex_update_card', item) + uni.navigateTo({ + url: '/packages/order/order?hasCard=true&type=edit' + }) + }else{ + uni.showToast({ + title: this.updateFalse || '不可更改', + icon: 'none', + duration: 2000 + }); + } + }, // 复制文本到剪贴板 copyText(item,type) { diff --git a/packages/order/order.vue b/packages/order/order.vue index 1ad5243..20f6ecd 100644 --- a/packages/order/order.vue +++ b/packages/order/order.vue @@ -34,23 +34,29 @@ - - - - - - {{form.ymd}} [{{form.week}}] - - - - - 选择发货时间 - - - - - + + + + 发货时间 + + + + + {{form.ymd}} [{{form.week}}] + + + + + 选择发货时间 + + + + + + + 非到货时间,预计发货后48小时左右可到货。 + @@ -60,10 +66,10 @@ - + - + @@ -87,17 +93,17 @@ - + - - + + - {{type=='edit'?'点击修改':'点击提货'}} + {{type=='edit'?'点击修改':'点击提货'}} @@ -109,14 +115,11 @@ 温馨提示 - - 1、下单时请注意填写正确的收货信息。 - 2、因收件方信息有误导致产生的多余运费或退件由收件方自付。 - 3、此商品为生鲜产品,非质量问题不退换。 - 4、如出现售后或快递问题,请于签收日期起1日内反馈,超出不再受理。 + + - 我同意 + 我同意({{isAgreeTime}}) @@ -127,7 +130,7 @@ + > {{cardInfo.sku?cardInfo.sku.name:''}} {{cardInfo.sku?cardInfo.sku.specs:''}} @@ -140,12 +143,14 @@ 发货时间 - {{form.ymd}} + {{form.ymd}} + [{{form.week}}] + {{form.lunarData}} - [{{form.week}}] + @@ -218,11 +223,15 @@ data() { return { showinfo: false, - showagree: false, + showagree: false, + isAgree:false, + isAgreeTime:10, + agreeTimer:null, showAddress: false, listAddress: [], addressInfo: '', - cardInfo: {}, + cardInfo: {}, + tips:'', type: '', form: { card_number: '', @@ -276,7 +285,7 @@ }], area: [{ required: true, - message: '请选择收货地址', + message: '请选择所在地区', trigger: ['change', 'blur'], }], address: [{ @@ -306,6 +315,12 @@ onReady() { this.$refs.uForm.setRules(this.rules); + }, + onUnload() { + if(this.agreeTimer){ + clearInterval(this.agreeTimer) + this.agreeTimer = null + } }, onLoad(option) { let that = this @@ -327,7 +342,6 @@ console.error('标题设置失败', err); } }); - console.log("this.form", this.form) // uni.removeStorageSync("vuex_update_card") } else { this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {} @@ -336,7 +350,13 @@ this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : '' // uni.removeStorageSync("vuex_card") } - + // 温馨提示 + const configs = uni.getStorageSync("configs") + configs.map(item=>{ + if(item.key==='tips'){ + this.tips = item.value + } + }) this.getAddress() this.getDates() // this.getExpress() @@ -362,7 +382,6 @@ // this.listExpress = res // }, changeAddress(e) { - console.log("e", e) if (e) { this.listAddress.map(item => { if (item.id == e) { @@ -418,7 +437,6 @@ }, backDate(e) { - console.log("e123", e) if (e) { this.form.send_date = e.date this.form.ymd = e.ymd @@ -443,7 +461,6 @@ }); }, changeArea(e) { - console.log(e) // return if (e) { let data = e.data @@ -455,7 +472,6 @@ this.form.province_id = data[0] ? data[0].id : '' this.form.city_id = data[1] ? data[1].id : '' this.form.district_id = data[2] ? data[2].id : '' - console.log(this.form) // this.form.area = e.province.label + e.city.label + e.area.label // this.$u.api.matchRegion({ // province: e.province.label, @@ -469,14 +485,12 @@ } }, changeIsMySelf(e) { - console.log(e) if (e) { this.myself = e[0].label this.form.myself = e[0].value } }, changeLocation() { - console.log("location") let _this = this uni.authorize({ scope: 'scope.userLocation', @@ -501,17 +515,8 @@ }) }, backShow() { - let that = this - uni.setNavigationBarTitle({ - title: '信息确认', - success: function() { - console.log('标题设置成功'); - that.showinfo = false - }, - fail: function(err) { - console.error('标题设置失败', err); - } - }); + let that = this + that.showinfo = false }, saveDefalutAddress() { if (this.form.defalut) { @@ -559,78 +564,109 @@ } } + }, + openShowInfo(){ + let that = this + if (!isNull(this.form.mobile2) && this.form.mobile2.length > 0) { + if (!isMobile(this.form.mobile2)) { + toast('备用电话不正确') + return + } + } + if (!isNull(this.form.buy_mobile) && this.form.buy_mobile.length > 0) { + if (!isMobile(this.form.buy_mobile)) { + toast('购买人电话不正确') + return + } + } + this.$refs.uForm.validate(valid => { + // console.log('验证通过'); + if (valid) { + if (!this.showinfo) { + uni.setNavigationBarTitle({ + title: '信息确认', + success: function() { + console.log('标题设置成功'); + that.showinfo = true + }, + fail: function(err) { + console.error('标题设置失败', err); + } + }); + } + } else { + console.log('验证失败'); + // toast('请填写完整信息') + } + }); + }, + closeAgree(){ + if(this.isAgreeTime>0){ + return + }else{ + this.isAgree = true + this.showagree = false + } + }, + reduceAgreeTime(){ + let that = this + if(that.isAgreeTime>0){ + this.agreeTimer = setInterval(function(){ + that.isAgreeTime-- + if(that.isAgreeTime===0){ + that.isAgree = true + that.isAgreeTime = 0 + clearInterval(that.agreeTimer) + that.agreeTimer = null + } + },1000) + } + }, - submit() { + submit() { let that = this - if (!isNull(this.form.mobile2) && this.form.mobile2.length > 0) { - if (!isMobile(this.form.mobile2)) { - toast('备用电话不正确') - return - } + if(!this.isAgree){ + this.showagree = true + this.isAgreeTime = 10 + this.reduceAgreeTime() + }else{ + if(this.isAgree){ + this.form.show = 0 + if (this.type == 'edit') { + console.log("this.form", this.form) + this.$u.api.saveUserOrder(this.form).then(res => { + uni.removeStorageSync('vuex_update_card') + toast(res.msg, 1000, function() { + setTimeout(function() { + that.saveDefalutAddress() + }, 500) + + }) + + }).then(res => { + console.log('res1', res) + + }) + } else { + this.$u.api.addUserOrder(this.form).then(res => { + console.log("res", res) + uni.removeStorageSync('vuex_card') + toast(res.msg, 1000, function() { + setTimeout(function() { + that.saveDefalutAddress() + }, 500) + + }) + + }).then(res => { + console.log('res1', res) + + }) + } + + } + } - if (!isNull(this.form.buy_mobile) && this.form.buy_mobile.length > 0) { - if (!isMobile(this.form.buy_mobile)) { - toast('购买人电话不正确') - return - } - } - this.$refs.uForm.validate(valid => { - // console.log('验证通过'); - if (valid) { - if (!this.showinfo) { - uni.setNavigationBarTitle({ - title: '信息确认', - success: function() { - console.log('标题设置成功'); - that.showagree = true - that.showinfo = true - }, - fail: function(err) { - console.error('标题设置失败', err); - } - }); - } else { - this.form.show = 0 - if (this.type == 'edit') { - console.log("this.form", this.form) - // return - this.$u.api.saveUserOrder(this.form).then(res => { - uni.removeStorageSync('vuex_update_card') - toast(res.msg, 1000, function() { - setTimeout(function() { - that.saveDefalutAddress() - }, 500) - - }) - - }).then(res => { - console.log('res1', res) - - }) - } else { - this.$u.api.addUserOrder(this.form).then(res => { - console.log("res", res) - uni.removeStorageSync('vuex_card') - toast(res.msg, 1000, function() { - setTimeout(function() { - that.saveDefalutAddress() - }, 500) - - }) - - }).then(res => { - console.log('res1', res) - - }) - } - - } - - } else { - console.log('验证失败'); - // toast('请填写完整信息') - } - }); } } @@ -756,10 +792,13 @@ padding: 0; .u-form-item__body { - align-items: baseline; + align-items: baseline; + .u-form-item--left{ + width:0!important; + flex:0!important; + } } } - .hh { &:last-child { text-align: right; @@ -859,7 +898,7 @@ right: 0; bottom: 0; left: 0; - z-index: 9999999; + z-index: 99; } .confirmbox { @@ -881,7 +920,8 @@ } .imgbox { - width: 307rpx; + width: 150rpx; + height:150rpx; margin: 0 auto; border-radius: 10rpx; border: 1px solid #ba8b45; @@ -890,8 +930,8 @@ } .imgbox image { - width: 100%; - height: auto; + width: 150rpx; + height:150rpx; vertical-align: middle; } @@ -939,10 +979,11 @@ .confirmmarker { display: block; - font-size: 24rpx; + font-size: 32rpx; color: #000; font-weight: bold; - margin-bottom: 8rpx; + margin-bottom: 8rpx; + text-align: center; } .flex-li { @@ -999,7 +1040,7 @@ align-items: center; width: 100vw; height: 100vh; - z-index: 9; + z-index: 999; padding: 0 50rpx; &-wrap { @@ -1010,19 +1051,22 @@ &-title { font-size: 32rpx; - color: #000; - margin-bottom: 30rpx + margin-bottom: 30rpx; + color:#b62828; + text-align: center; } &-content { line-height: 1.8; - font-size: 30rpx; + font-size: 30rpx; + height:300rpx; + overflow: scroll; } &-btn { >view { - background-color: #ba8b45; + background-color: rgba(0,0,0,0.5); color: #fff; border-radius: 40rpx; width: 60%; @@ -1030,8 +1074,10 @@ height: 75rpx; text-align: center; line-height: 75rpx; - margin: 40rpx auto; - margin-top: 60rpx; + margin: 20rpx auto; + } + .canAgree{ + background-color: #ba8b45; } } } diff --git a/pages/home/home.vue b/pages/home/home.vue index 8da349e..eea39b0 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -172,6 +172,8 @@ }) uni.setStorageSync('banner3',_arr) } + // 文字信息 + uni.setStorageSync('configs',res.config) }, async getToken() { await uni.login({