main
lion 1 year ago
parent bf8608f294
commit 4fa660d221

@ -3,19 +3,19 @@
<u-popup v-model="show" mode="bottom"> <u-popup v-model="show" mode="bottom">
<view class="date"> <view class="date">
<view class="date-title"> <view class="date-title">
<view>配送</view> <view>发货时间</view>
<view @click="closePop"> <view @click="closePop">
<u-icon name="close-circle-fill" color="#f0efed" size="32"></u-icon> <u-icon name="close-circle-fill" color="#f0efed" size="32"></u-icon>
</view> </view>
</view> </view>
<view class="date-express"> <!-- <view class="date-express">
<view v-for="(item,index) in express"> <view v-for="(item,index) in express">
<view @click="chooseExpress(index,item)" <view @click="chooseExpress(index,item)"
:class="{'date-express-item':true,'date-express-item_active':expressIndex==index}" :class="{'date-express-item':true,'date-express-item_active':expressIndex==index}"
v-if="item.name">{{item.name}}</view> v-if="item.name">{{item.name}}</view>
</view> </view>
</view> </view> -->
<view class="date-stitle">送货时间</view> <view class="date-stitle">非到货时间预计发货后48小时左右可到货</view>
<view class="date-list"> <view class="date-list">
<view class="date-list-left"> <view class="date-list-left">
<view v-for="(item,index) in data"> <view v-for="(item,index) in data">
@ -30,13 +30,13 @@
{{dateObj.lunarData?dateObj.lunarData:''}} {{dateObj.lunarData?dateObj.lunarData:''}}
<view>今日剩余可提货量{{dateObj.canUse.quantity - dateObj.canUse.booked}}</view> <view>今日剩余可提货量{{dateObj.canUse.quantity - dateObj.canUse.booked}}</view>
</view> </view>
<view class="hh"> <!-- <view class="hh">
<view @click="chooseHh(index,item)" <view @click="chooseHh(index,item)"
:class="{'hh-item':true,'hh-item_active':hhIndex==index}" :class="{'hh-item':true,'hh-item_active':hhIndex==index}"
v-for="(item,index) in hhList"> v-for="(item,index) in hhList">
{{item}} {{item}}
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
<view class="date-btn"> <view class="date-btn">
@ -62,63 +62,63 @@
return [] return []
} }
}, },
// // //
express: { // express: {
type: Array, // type: Array,
default () { // default () {
return [] // return []
} // }
} // }
}, },
data() { data() {
return { return {
show: false, show: false,
expressIndex: -1, // expressIndex: -1,
expressObj: {}, // expressObj: {},
dateIndex: -1, dateIndex: -1,
dateObj: {}, dateObj: {},
hhList: ['09:00-15:00', '15:00-21:00'], // hhList: ['09:00-15:00', '15:00-21:00'],
hhIndex: -1, // hhIndex: -1,
} }
}, },
methods: { methods: {
chooseExpress(index, item) { // chooseExpress(index, item) {
this.expressObj = item // this.expressObj = item
this.expressIndex = index // this.expressIndex = index
}, // },
chooseDate(index, item) { chooseDate(index, item) {
this.dateIndex = index this.dateIndex = index
this.dateObj = item this.dateObj = item
}, },
chooseHh(index, item) { // chooseHh(index, item) {
this.hhTime = item // this.hhTime = item
this.hhIndex = index // this.hhIndex = index
}, // },
closePop() { closePop() {
this.show = false this.show = false
}, },
confirmPop() { confirmPop() {
if (isEmptyObject(this.dateObj)) { if (isEmptyObject(this.dateObj)) {
toast('请选择日期') toast('请选择发货时间')
return
}
if (isEmptyObject(this.expressObj)) {
toast('请选择快递')
return
}
if (isNull(this.hhTime)) {
toast('请选择时间')
return return
} }
// if (isEmptyObject(this.expressObj)) {
// toast('')
// return
// }
// if (isNull(this.hhTime)) {
// toast('')
// return
// }
// AB // AB
for (const key in this.expressObj) { // for (const key in this.expressObj) {
if (this.expressObj.hasOwnProperty(key)) { // if (this.expressObj.hasOwnProperty(key)) {
this.dateObj[`express${key}`] = this.expressObj[key]; // this.dateObj[`express${key}`] = this.expressObj[key];
} // }
} // }
this.dateObj.hhtime = this.hhTime // this.dateObj.hhtime = this.hhTime
this.$emit('refresh', this.dateObj) this.$emit('refresh', this.dateObj)
this.show = false this.show = false
console.log("this.dateObj", this.dateObj) console.log("this.dateObj", this.dateObj)
@ -145,6 +145,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-left: 35rpx; padding-left: 35rpx;
padding-bottom: 10rpx;
} }
&-express { &-express {
@ -178,9 +179,9 @@
&-stitle { &-stitle {
font-size: 24rpx; font-size: 24rpx;
color: #000; color: #787877;
padding-left: 35rpx; padding-left: 35rpx;
margin-bottom: 35rpx; margin-bottom: 20rpx;
} }
&-list { &-list {

@ -160,7 +160,7 @@
.systemtext text { .systemtext text {
display: block; display: block;
font-size: 20rpx; font-size: 28rpx;
color: #000; color: #000;
line-height: 36rpx; line-height: 36rpx;
} }
@ -202,7 +202,7 @@
height: 74rpx; height: 74rpx;
line-height: 74rpx; line-height: 74rpx;
color: #676767 !important; color: #676767 !important;
font-size: 20rpx !important; font-size: 26rpx !important;
padding-left: 94rpx; padding-left: 94rpx;
padding-right: 30rpx; padding-right: 30rpx;
background-position: left 30rpx center; background-position: left 30rpx center;
@ -219,15 +219,15 @@
} }
/deep/ .u-btn { /deep/ .u-btn {
color: #b98b44 !important; color: #fff !important;
font-size: 24rpx !important; font-size: 26rpx !important;
font-weight: bold; font-weight: bold;
padding: 0; padding: 0;
height: 74rpx !important; height: 74rpx !important;
width: 100%; width: 100%;
line-height: 74rpx !important; line-height: 74rpx !important;
border-radius: 50rpx; border-radius: 50rpx;
background-color: #f4f3f2 !important; background-color: #b98b44 !important;
} }
/deep/ .u-btn::after { /deep/ .u-btn::after {

@ -11,11 +11,7 @@
</u-form-item> </u-form-item>
<!-- <view class="orderForm-address"> --> <!-- <view class="orderForm-address"> -->
<u-form-item label="所在地区" required prop="area" label-position="left"> <u-form-item label="所在地区" required prop="area" label-position="left">
<u-input v-model="form.area" placeholder="请选择所在地区" @click="openArea" /> <u-input type="select" v-model="form.area" placeholder="请选择所在地区" @click="openArea" />
<view slot="right" class="arearight" @click="changeLocation">
<u-icon name="map"></u-icon>
定位
</view>
</u-form-item> </u-form-item>
<!-- </view> --> <!-- </view> -->
@ -23,7 +19,11 @@
<u-input v-model="form.area" placeholder="请选择地区" @click="openArea" type="select" /> <u-input v-model="form.area" placeholder="请选择地区" @click="openArea" type="select" />
</u-form-item> --> </u-form-item> -->
<u-form-item label="详细地址" required prop="address" label-position="left"> <u-form-item label="详细地址" required prop="address" label-position="left">
<u-input v-model="form.address" placeholder="请填写详细地址" /> <u-input v-model="form.address" placeholder="请填写详细地址" />
<view slot="right" class="arearight" @click="changeLocation" style="color:#000">
<u-icon name="map"></u-icon>
定位
</view>
</u-form-item> </u-form-item>
<u-form-item label="设置默认地址" label-width="180" :border-bottom="false" prop="defalut" <u-form-item label="设置默认地址" label-width="180" :border-bottom="false" prop="defalut"
label-position="left"> label-position="left">
@ -124,7 +124,8 @@
const res = await this.$u.api.getRegion() const res = await this.$u.api.getRegion()
this.listArea = res.regions this.listArea = res.regions
}, },
openArea() { openArea() {
uni.hideKeyboard()
this.$refs.pickers.open().then(function() { this.$refs.pickers.open().then(function() {
console.log('picker打开'); console.log('picker打开');
}); });
@ -190,7 +191,7 @@
uni.chooseLocation({ uni.chooseLocation({
success(res) { success(res) {
console.log("res", res) console.log("res", res)
_this.form.area = res.address // _this.form.area = res.address
_this.form.address = res.name _this.form.address = res.name
}, },
fail(res) { fail(res) {

@ -14,13 +14,13 @@
<image src="../../static/icon1.png" mode="widthFix"></image> <image src="../../static/icon1.png" mode="widthFix"></image>
</view> </view>
<view class="confirmright"> <view class="confirmright">
<text class="confirmmarker">收货日期</text> <text class="confirmmarker">发货时间</text>
<view class="flex-li confirmdate"> <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>
<text class="smallfont">{{details.lunarData?details.lunarData:""}}</text> <text class="smallfont">{{details.lunarData?details.lunarData:""}}</text>
</view> </view>
<view class="flex-li confirmdate"> <view class="flex-li confirmdate">
<text>{{details.hh?details.hh:''}}</text> <!-- <text>{{details.hh?details.hh:''}}</text> -->
<text class="smallfont">{{details.week?'['+details.week+']':''}}</text> <text class="smallfont">{{details.week?'['+details.week+']':''}}</text>
</view> </view>
</view> </view>

@ -36,9 +36,10 @@
</view> </view>
</view> </view>
<view class="ordertime" @click="toDetail(item)"> <view class="ordertime" @click="toDetail(item)">
<text>预计送达时间</text> <text>预计发货时间</text>
<view>{{item.send_date?$moment(item.send_date).format("M月DD日"):''}}<text <view>{{item.send_date?$moment(item.send_date).format("M月DD日"):''}}<text
class="orderweek">{{item.week?'['+item.week+']':''}}</text>{{item.hh?item.hh:''}} class="orderweek">{{item.week?'['+item.week+']':''}}</text>
<!-- {{item.hh?item.hh:''}} -->
</view> </view>
</view> </view>
<view class="ordertab"> <view class="ordertab">

@ -2,7 +2,9 @@
<!-- <page-meta :page-style="'overflow:'+(showinfo?'hidden':'visible')"></page-meta> --> <!-- <page-meta :page-style="'overflow:'+(showinfo?'hidden':'visible')"></page-meta> -->
<view class="cotainer"> <view class="cotainer">
<date-picker ref="datePickers" @refresh="backDate" :data="listDates" :express="listExpress"></date-picker> <!-- <date-picker ref="datePickers" @refresh="backDate" :data="listDates" :express="listExpress"></date-picker> -->
<date-picker ref="datePickers" @refresh="backDate" :data="listDates"></date-picker>
<view class="orderForm"> <view class="orderForm">
@ -25,24 +27,25 @@
</view> --> </view> -->
<view> <view>
<view>卡券状态</view> <view>卡券状态</view>
<view class="status" v-html="type=='edit'?cardInfo.first_card.status_label:cardInfo.status_label"></view> <view class="status"
v-html="type=='edit'?cardInfo.first_card.status_label:cardInfo.status_label"></view>
</view> </view>
</view> </view>
</view> </view>
<view class="orderInfo-status"> <view class="orderInfo-status">
<u-form-item label="货时间" :border-bottom="false" style="width:100%" prop="send_date" <u-form-item label="货时间" :border-bottom="false" style="width:100%" prop="send_date"
label-position="left"> label-position="left">
<!-- <view></view> --> <!-- <view></view> -->
<view class="hh" @click="openDatePicker"> <view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date"> <view class="" v-if="form.send_date">
<view>{{form.express}}</view> <!-- <view>{{form.express}}</view> -->
<view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text> <view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text>
{{form.hh}} <!-- {{form.hh}} -->
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view>选择货时间</view> <view>选择货时间</view>
</view> </view>
<view> <view>
<u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon> <u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon>
@ -63,24 +66,23 @@
<u-input v-model="form.mobile2" placeholder="请填写备用号码" /> <u-input v-model="form.mobile2" placeholder="请填写备用号码" />
</u-form-item> </u-form-item>
<u-form-item label="所在地区" prop="area" label-position="left"> <u-form-item label="所在地区" prop="area" label-position="left">
<u-input v-model="form.area" placeholder="请选择所在地区" @click="openArea" /> <u-input type="select" v-model="form.area" placeholder="请选择所在地区" @click="openArea" />
</u-form-item>
<u-form-item label="详细地址" prop="address" label-position="left">
<u-input v-model="form.address" placeholder="请填写详细地址" />
<view slot="right" class="arearight" @click="changeLocation"> <view slot="right" class="arearight" @click="changeLocation">
<u-icon name="map"></u-icon> <u-icon name="map"></u-icon>
定位 定位
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="详细地址" prop="address" label-position="left">
<u-input v-model="form.address" placeholder="请填写详细地址" />
</u-form-item>
<u-form-item label="设置默认地址" :border-bottom="false" prop="defalut" label-position="left"> <u-form-item label="设置默认地址" :border-bottom="false" prop="defalut" label-position="left">
<u-switch slot="right" v-model="form.defalut" active-color="#ba8b45" inactive-color="#adadac" <u-switch slot="right" v-model="form.defalut" active-color="#ba8b45" inactive-color="#adadac"
size="40"></u-switch> size="40"></u-switch>
</u-form-item> </u-form-item>
<u-form-item label="备注" prop="remark" label-position="top">
<u-input type="textarea" v-model="form.remark" placeholder="请填写备注" />
</u-form-item>
</view> </view>
<!-- <view class="orderForm-address">
<text><text>*</text>收货地址</text>
<u-button @click="changeLocation" size="mini">获取位置</u-button>
</view> -->
<view class="orderForm-wrap"> <view class="orderForm-wrap">
<u-form-item label="是否本人收货" prop="myself" label-position="left"> <u-form-item label="是否本人收货" prop="myself" label-position="left">
<u-input v-model="myself" placeholder="选填" @click="showIsMySelf = true" type="select" /> <u-input v-model="myself" placeholder="选填" @click="showIsMySelf = true" type="select" />
@ -102,12 +104,30 @@
<u-select @confirm="changeIsMySelf" v-model="showIsMySelf" :list="listIsMySelf"></u-select> <u-select @confirm="changeIsMySelf" v-model="showIsMySelf" :list="listIsMySelf"></u-select>
<!-- 免责协议 -->
<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>
<view class="agreeinfo-btn">
<view @click="showagree = false,showinfo=true">我同意</view>
</view>
</view>
</view>
<!-- 确认信息 --> <!-- 确认信息 -->
<view class="ordercontainer" v-if="showinfo"> <view class="ordercontainer" v-if="showinfo">
<view class="confirmbox"> <view class="confirmbox">
<view class="confirmpicinfo"> <view class="confirmpicinfo">
<view class="imgbox"> <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
:src="cardInfo.sku?(cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')"
mode="widthFix"></image>
</view> </view>
<view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view> <view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view>
<text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text> <text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text>
@ -118,13 +138,13 @@
<image src="../../static/icon1.png" mode="widthFix"></image> <image src="../../static/icon1.png" mode="widthFix"></image>
</view> </view>
<view class="confirmright"> <view class="confirmright">
<text class="confirmmarker">收货日期</text> <text class="confirmmarker">发货时间</text>
<view class="flex-li confirmdate"> <view class="flex-li confirmdate">
<text>{{form.ymd}}</text> <text>{{form.ymd}}</text>
<text class="smallfont">{{form.lunarData}}</text> <text class="smallfont">{{form.lunarData}}</text>
</view> </view>
<view class="flex-li confirmdate"> <view class="flex-li confirmdate">
<text>{{form.hh}}</text> <!-- <text>{{form.hh}}</text> -->
<text class="smallfont">[{{form.week}}]</text> <text class="smallfont">[{{form.week}}]</text>
</view> </view>
</view> </view>
@ -157,6 +177,7 @@
<text class="confirmtab" @click="submit">{{type=='edit'?'':''}}</text> <text class="confirmtab" @click="submit">{{type=='edit'?'':''}}</text>
</view> </view>
</view> </view>
<!-- 选择地址 --> <!-- 选择地址 -->
<view class="addressinfo" v-if="showAddress"> <view class="addressinfo" v-if="showAddress">
<u-popup v-model="showAddress" mode="bottom"> <u-popup v-model="showAddress" mode="bottom">
@ -197,11 +218,12 @@
data() { data() {
return { return {
showinfo: false, showinfo: false,
showagree: false,
showAddress: false, showAddress: false,
listAddress: [], listAddress: [],
addressInfo: '', addressInfo: '',
cardInfo: {}, cardInfo: {},
type:'', type: '',
form: { form: {
card_number: '', card_number: '',
password: '', password: '',
@ -209,8 +231,8 @@
send_date: '', send_date: '',
ymd: '', ymd: '',
lunarData: '', lunarData: '',
express: '', // express: '',
hh: '', // hh: '',
week: '', week: '',
area: '', area: '',
@ -226,13 +248,13 @@
buy_name: '', buy_name: '',
buy_mobile: '' buy_mobile: ''
}, },
listExpress: [{ // listExpress: [{
id: 0, // id: 0,
value: '顺丰快递' // value: ''
}, { // }, {
id: 1, // id: 1,
value: '中通快递' // value: ''
}], // }],
listDates: [], listDates: [],
date: '', date: '',
listArea: [], listArea: [],
@ -249,7 +271,7 @@
rules: { rules: {
send_date: [{ send_date: [{
required: true, required: true,
message: '请选择货时间', message: '请选择货时间',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}], }],
area: [{ area: [{
@ -285,37 +307,39 @@
this.$refs.uForm.setRules(this.rules); this.$refs.uForm.setRules(this.rules);
}, },
onLoad(option) { onLoad(option) {
let that = this let that = this
if (option.hasCard) { if (option.hasCard) {
if(option.type=='edit'){ if (option.type == 'edit') {
this.type = 'edit' this.type = 'edit'
this.form = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") : {}, this.form = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") : {},
this.cardInfo = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") : {}, this.cardInfo = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") :
this.form.ymd = this.momentDay(this.form.send_date).ymd {},
uni.removeStorageSync("vuex_update_card") this.form.ymd = this.momentDay(this.form.send_date).ymd
uni.setNavigationBarTitle({ uni.removeStorageSync("vuex_update_card")
title: '修改订单', uni.setNavigationBarTitle({
success: function() { title: '修改订单',
console.log('标题设置成功'); success: function() {
that.showinfo = false console.log('标题设置成功');
}, that.showinfo = false
fail: function(err) { },
console.error('标题设置失败', err); fail: function(err) {
} console.error('标题设置失败', err);
}); }
console.log("this.form",this.form) });
// uni.removeStorageSync("vuex_update_card") console.log("this.form", this.form)
}else{ // uni.removeStorageSync("vuex_update_card")
this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {} } else {
this.form.card_number = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card_number : '' this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {}
this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : '' this.form.card_number = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card_number :
uni.removeStorageSync("vuex_card") ''
this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : ''
// uni.removeStorageSync("vuex_card")
} }
this.getAddress() this.getAddress()
this.getDates() this.getDates()
this.getExpress() // this.getExpress()
this.getArea() this.getArea()
} else { } else {
toast("未查询到卡券信息") toast("未查询到卡券信息")
@ -328,15 +352,15 @@
methods: { methods: {
async getAddress() { async getAddress() {
const res = await this.$u.api.getUserAddress() const res = await this.$u.api.getUserAddress()
this.listAddress = res.address this.listAddress = res.address
if(!this.type == 'edit'){ if (!this.type == 'edit') {
this.showAddress = this.listAddress.length > 0 ? true : false this.showAddress = this.listAddress.length > 0 ? true : false
} }
}, },
async getExpress() { // async getExpress() {
const res = await this.$u.api.getExpress() // const res = await this.$u.api.getExpress()
this.listExpress = res // this.listExpress = res
}, // },
changeAddress(e) { changeAddress(e) {
console.log("e", e) console.log("e", e)
if (e) { if (e) {
@ -398,9 +422,9 @@
if (e) { if (e) {
this.form.send_date = e.date this.form.send_date = e.date
this.form.ymd = e.ymd this.form.ymd = e.ymd
this.form.express = e.expressname // this.form.express = e.expressname
this.form.express_type_id = e.expressid // this.form.express_type_id = e.expressid
this.form.hh = e.hhtime // this.form.hh = e.hhtime
this.form.week = e.week this.form.week = e.week
this.form.lunarData = e.lunarData this.form.lunarData = e.lunarData
} }
@ -411,11 +435,9 @@
async getArea() { async getArea() {
const res = await this.$u.api.getRegion() const res = await this.$u.api.getRegion()
this.listArea = res.regions this.listArea = res.regions
console.log(res)
console.log(this.listArea)
}, },
openArea() { openArea() {
uni.hideKeyboard()
this.$refs.pickers.open().then(function() { this.$refs.pickers.open().then(function() {
console.log('picker打开'); console.log('picker打开');
}); });
@ -425,7 +447,7 @@
// return // return
if (e) { if (e) {
let data = e.data let data = e.data
let _this = this let _this = this
_this.form.area = '' _this.form.area = ''
data.forEach(function(item, index) { data.forEach(function(item, index) {
_this.form.area += item.value + ' '; _this.form.area += item.value + ' ';
@ -464,7 +486,7 @@
uni.chooseLocation({ uni.chooseLocation({
success(res) { success(res) {
console.log("res", res) console.log("res", res)
_this.form.area = res.address // _this.form.area = res.address
_this.form.address = res.name _this.form.address = res.name
}, },
fail(res) { fail(res) {
@ -503,49 +525,50 @@
city_id: this.form.city_id, city_id: this.form.city_id,
district_id: this.form.district_id, district_id: this.form.district_id,
defalut: 1 defalut: 1
}).then(res => { }).then(res => {
if(this.type=='edit'){ if (this.type == 'edit') {
uni.redirectTo({ uni.redirectTo({
url: '/packages/myorder/myorder' url: '/packages/myorder/myorder'
}) })
}else{ } else {
uni.redirectTo({ uni.redirectTo({
url: '/packages/product/public' url: '/packages/product/public'
}) })
} }
}).then(res => { }).then(res => {
if(this.type=='edit'){ if (this.type == 'edit') {
uni.redirectTo({ uni.redirectTo({
url: '/packages/myorder/myorder' url: '/packages/myorder/myorder'
}) })
}else{ } else {
uni.redirectTo({ uni.redirectTo({
url: '/packages/product/public' url: '/packages/product/public'
}) })
} }
}) })
} else { } else {
if(this.type=='edit'){ if (this.type == 'edit') {
uni.redirectTo({ uni.redirectTo({
url: '/packages/myorder/myorder' url: '/packages/myorder/myorder'
}) })
}else{ } else {
uni.redirectTo({ uni.redirectTo({
url: '/packages/product/public' url: '/packages/product/public'
}) })
} }
} }
}, },
submit() { submit() {
let that = this let that = this
if ((!isNull(this.form.mobile2) && this.form.mobile2.length > 0) || (!isNull(this.form.buy_mobile) && this if (!isNull(this.form.mobile2) && this.form.mobile2.length > 0) {
.form.buy_mobile.length > 0)) {
if (!isMobile(this.form.mobile2)) { if (!isMobile(this.form.mobile2)) {
toast('备用电话不正确') toast('备用电话不正确')
return return
} }
}
if (!isNull(this.form.buy_mobile) && this.form.buy_mobile.length > 0) {
if (!isMobile(this.form.buy_mobile)) { if (!isMobile(this.form.buy_mobile)) {
toast('购买人电话不正确') toast('购买人电话不正确')
return return
@ -559,6 +582,7 @@
title: '信息确认', title: '信息确认',
success: function() { success: function() {
console.log('标题设置成功'); console.log('标题设置成功');
that.showagree = true
that.showinfo = true that.showinfo = true
}, },
fail: function(err) { fail: function(err) {
@ -566,40 +590,40 @@
} }
}); });
} else { } else {
this.form.show = 0 this.form.show = 0
if(this.type=='edit'){ if (this.type == 'edit') {
console.log("this.form",this.form) console.log("this.form", this.form)
// return // return
this.$u.api.saveUserOrder(this.form).then(res => { this.$u.api.saveUserOrder(this.form).then(res => {
uni.removeStorageSync('vuex_update_card') uni.removeStorageSync('vuex_update_card')
toast(res.msg, 1000, function() { toast(res.msg, 1000, function() {
setTimeout(function() { setTimeout(function() {
that.saveDefalutAddress() that.saveDefalutAddress()
}, 500) }, 500)
}) })
}).then(res => { }).then(res => {
console.log('res1', res) console.log('res1', res)
}) })
}else{ } else {
this.$u.api.addUserOrder(this.form).then(res => { this.$u.api.addUserOrder(this.form).then(res => {
console.log("res", res) console.log("res", res)
uni.removeStorageSync('vuex_card') uni.removeStorageSync('vuex_card')
toast(res.msg, 1000, function() { toast(res.msg, 1000, function() {
setTimeout(function() { setTimeout(function() {
that.saveDefalutAddress() that.saveDefalutAddress()
}, 500) }, 500)
}) })
}).then(res => { }).then(res => {
console.log('res1', res) console.log('res1', res)
}) })
} }
} }
} else { } else {
@ -965,5 +989,51 @@
border: 1rpx solid #ba8b45; border: 1rpx solid #ba8b45;
background: #ba8b45; background: #ba8b45;
} }
.agreeinfo {
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
width: 100vw;
height: 100vh;
z-index: 9;
padding: 0 50rpx;
&-wrap {
background: #fff;
padding: 60rpx 40rpx;
border-radius: 20rpx;
}
&-title {
font-size: 32rpx;
color: #000;
margin-bottom: 30rpx
}
&-content {
line-height: 1.8;
font-size: 30rpx;
}
&-btn {
>view {
background-color: #ba8b45;
color: #fff;
border-radius: 40rpx;
width: 60%;
margin: 0 auto;
height: 75rpx;
text-align: center;
line-height: 75rpx;
margin: 40rpx auto;
margin-top: 60rpx;
}
}
}
} }
</style> </style>
Loading…
Cancel
Save