send 7.28
This commit is contained in:
@@ -21,11 +21,12 @@
|
||||
<label for="area">详细地址:</label>
|
||||
<input type="text" id="area" placeholder="" v-model="area" />
|
||||
</view>
|
||||
<view>
|
||||
<view @click="showTime=true">
|
||||
<label for="time">预约时间:</label>
|
||||
<input type="text" id="time" placeholder="" v-model="time" />
|
||||
<input type="text" id="time" placeholder="" disabled v-model="time" />
|
||||
</view>
|
||||
</view>
|
||||
<u-picker mode="time" v-model="showTime" :params="params" @confirm="chooseDate"></u-picker>
|
||||
<view class="goods-container">
|
||||
<view class="store">
|
||||
<image :src="store.store_avatar"></image>
|
||||
@@ -63,11 +64,20 @@ export default {
|
||||
address: '', // 选择地址
|
||||
area: '', // 详细地址
|
||||
time: '',
|
||||
showTime: false,
|
||||
number: 1, // 商品数量
|
||||
area_id: '', // 地区id 省
|
||||
city_id: '', // 城市id
|
||||
goodsInfo: {},
|
||||
store: {},
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: false
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -98,10 +108,22 @@ export default {
|
||||
this.$u.toast('详细地址不可为空');
|
||||
return false;
|
||||
}
|
||||
if(this.$u.test.isEmpty(this.time)) {
|
||||
this.$u.toast('预约时间不可为空');
|
||||
return false;
|
||||
}
|
||||
if(new Date(this.time) < new Date()) {
|
||||
this.$u.toast('预约时间错误');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
chooseDate(e) {
|
||||
let time = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute;
|
||||
this.time = time;
|
||||
},
|
||||
confirmBtn() {
|
||||
if(!this.verification) return false;
|
||||
if(!this.verification()) return false;
|
||||
this.$u.api.saveGoodsTry({
|
||||
member_name: this.name,
|
||||
member_mobile: this.phone,
|
||||
@@ -110,7 +132,8 @@ export default {
|
||||
goods_id: this.goodsInfo.goods_id,
|
||||
num: this.number,
|
||||
store_id: this.store.store_id,
|
||||
}).then((res)=>{
|
||||
appointment_time: new Date(this.time),
|
||||
}).then(res => {
|
||||
this.$u.toast(res.message);
|
||||
if (res.errCode == 0) {
|
||||
// this.$u.route({ type: 'navigateBack' });
|
||||
|
||||
Reference in New Issue
Block a user