部分修改

main
lion 1 year ago
parent b124f0c8cc
commit 4f104d67e1

@ -181,7 +181,8 @@
font-size: 24rpx;
color: #787877;
padding-left: 35rpx;
margin-bottom: 20rpx;
margin-bottom: 20rpx;
color:#b62828;
}
&-list {

@ -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,

@ -3,7 +3,8 @@
<view class="confirmbox">
<view class="confirmpicinfo">
<view class="imgbox">
<image :src="details.sku?(details.sku.image_url?details.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')" mode="widthFix"></image>
<image :src="details.sku?(details.sku.image_url?details.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')"
></image>
</view>
<view class="pictitle">{{details.sku?details.sku.name:''}}</view>
<text>{{details.sku?details.sku.specs:''}}</text>
@ -16,12 +17,15 @@
<view class="confirmright">
<text class="confirmmarker">发货时间</text>
<view class="flex-li confirmdate">
<text>{{details.send_date?$moment(details.send_date).format("YYYY年M月DD日"):''}}</text>
<text>
{{details.send_date?$moment(details.send_date).format("YYYY年M月DD日"):''}}
<text style="color:#b62828" class="smallfont">{{details.week?'['+details.week+']':''}}</text>
</text>
<text class="smallfont">{{details.lunarData?details.lunarData:""}}</text>
</view>
<view class="flex-li confirmdate">
<!-- <text>{{details.hh?details.hh:''}}</text> -->
<text class="smallfont">{{details.week?'['+details.week+']':''}}</text>
</view>
</view>
</view>
@ -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;

@ -45,7 +45,7 @@
<view class="ordertab">
<!-- -->
<text class="deleteorder" @click="copyText(item.express_number)" v-if="item.status==1"></text>
<text class="deleteorder" @click="edit(item)" v-if="item.can_update"></text>
<text class="deleteorder" @click="edit(item)" v-if="item.status===0"></text>
<text class="orderinform" @click="copyText(item,'send')"></text>
</view>
</view>
@ -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) {

@ -34,23 +34,29 @@
</view>
</view>
<view class="orderInfo-status">
<u-form-item label="发货时间" :border-bottom="false" style="width:100%" prop="send_date"
label-position="left">
<!-- <view></view> -->
<view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date">
<!-- <view>{{form.express}}</view> -->
<view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text>
<!-- {{form.hh}} -->
</view>
</view>
<view v-else>
<view>选择发货时间</view>
</view>
<view>
<u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon>
</view>
</view>
<u-form-item label="发货时间" :label-style="{'display':'none','width':0,'flex':0}" :border-bottom="false" style="width:100%" prop="send_date"
label-position="left">
<view style="display: flex;align-items: center;justify-content: space-between;">
<view>
<view>发货时间</view>
</view>
<view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date">
<!-- <view>{{form.express}}</view> -->
<view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text>
<!-- {{form.hh}} -->
</view>
</view>
<view v-else>
<view>选择发货时间</view>
</view>
<view>
<u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon>
</view>
</view>
</view>
<view style="color:#b62828;font-size:24rpx">非到货时间预计发货后48小时左右可到货</view>
</u-form-item>
</view>
@ -60,10 +66,10 @@
<u-input v-model="form.contact" placeholder="请填写收货人姓名" />
</u-form-item>
<u-form-item label="手机号码" prop="mobile" label-position="left">
<u-input v-model="form.mobile" placeholder="请填写手机号码" />
<u-input type="number" :maxlength="11" v-model="form.mobile" placeholder="请填写手机号码" />
</u-form-item>
<u-form-item label="备用号码" prop="mobile2" label-position="left">
<u-input v-model="form.mobile2" placeholder="请填写备用号码" />
<u-input v-model="form.mobile2" type="number" :maxlength="11" placeholder="请填写备用号码" />
</u-form-item>
<u-form-item label="所在地区" prop="area" label-position="left">
<u-input type="select" v-model="form.area" placeholder="请选择所在地区" @click="openArea" />
@ -87,17 +93,17 @@
<u-form-item label="是否本人收货" prop="myself" label-position="left">
<u-input v-model="myself" placeholder="选填" @click="showIsMySelf = true" type="select" />
</u-form-item>
<u-form-item label="购人姓名" prop="buy_name" label-position="left">
<u-form-item label="购人姓名" prop="buy_name" label-position="left">
<u-input v-model="form.buy_name" placeholder="选填" />
</u-form-item>
<u-form-item label="购人电话" :border-bottom="false" prop="buy_mobile" label-position="left">
<u-input v-model="form.buy_mobile" placeholder="选填" />
<u-form-item label="购人电话" :border-bottom="false" prop="buy_mobile" label-position="left">
<u-input v-model="form.buy_mobile" type="number" :maxlength="11" placeholder="选填" />
</u-form-item>
</view>
</u-form>
<view class="orderForm-btn">
<view @click="submit">{{type=='edit'?'':''}}</view>
<view @click="openShowInfo">{{type=='edit'?'':''}}</view>
</view>
</view>
<aui-picker ref="pickers" :title="'地区选择'" :data="listArea" @callback="changeArea"></aui-picker>
@ -109,14 +115,11 @@
<view class="agreeinfo" v-if="showagree">
<view class="agreeinfo-wrap">
<view class="agreeinfo-title">温馨提示</view>
<view class="agreeinfo-content">
<view>1下单时请注意填写正确的收货信息</view>
<view>2因收件方信息有误导致产生的多余运费或退件由收件方自付</view>
<view>3此商品为生鲜产品非质量问题不退换</view>
<view>4如出现售后或快递问题请于签收日期起1日内反馈超出不再受理</view>
<view class="agreeinfo-content">
<view v-html="tips"></view>
</view>
<view class="agreeinfo-btn">
<view @click="showagree = false,showinfo=true">我同意</view>
<view @click="closeAgree" :class="isAgree?'canAgree':''">我同意<text v-if="isAgreeTime>0">({{isAgreeTime}})</text></view>
</view>
</view>
</view>
@ -127,7 +130,7 @@
<view class="imgbox">
<image
:src="cardInfo.sku?(cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')"
mode="widthFix"></image>
></image>
</view>
<view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view>
<text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text>
@ -140,12 +143,14 @@
<view class="confirmright">
<text class="confirmmarker">发货时间</text>
<view class="flex-li confirmdate">
<text>{{form.ymd}}</text>
<text>{{form.ymd}}
<text class="smallfont" style="color:#b62828">[{{form.week}}]</text>
</text>
<text class="smallfont">{{form.lunarData}}</text>
</view>
<view class="flex-li confirmdate">
<!-- <text>{{form.hh}}</text> -->
<text class="smallfont">[{{form.week}}]</text>
</view>
</view>
</view>
@ -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;
}
}
}

@ -172,6 +172,8 @@
})
uni.setStorageSync('banner3',_arr)
}
//
uni.setStorageSync('configs',res.config)
},
async getToken() {
await uni.login({

Loading…
Cancel
Save