Merge pull request '修改美甲' (#363) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/363
This commit is contained in:
hansu 2020-09-11 14:46:32 +08:00
commit ab4c80ae36
3 changed files with 44 additions and 13 deletions

View File

@ -154,10 +154,11 @@ export default {
});
},
// 美甲-提交订单
addManicure({ name, time }) {
addManicure({ name, phone, time }) {
return vm.$u.post('MemberManicure/addManicure', {
name: name,
time: time
phone: phone,
// time: time
});
},
// 会员服务-积分数

View File

@ -14,6 +14,7 @@
<view class="order-status">{{ item.status }}</view>
</view>
<view class="order-name">美甲人姓名{{ item.manicure_name }}</view>
<view class="order-name">美甲人电话{{ item.phone }}</view>
<view class="order-date">时间{{ item.manicure_time | date }}</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#ECECEC" margin-bottom="20" v-if="orderList.length>=pageSize"></u-loadmore>
@ -129,7 +130,7 @@ export default {
.order-item {
padding: 30rpx;
width:690rpx;
height: 229rpx;
// height: 229rpx;
background: rgba(255,255,255,1);
border-radius: 10rpx;
margin-bottom: 20rpx;

View File

@ -5,15 +5,23 @@
<view>美甲人</view>
<input type="text" v-model="name" />
</view>
<view class="order-date" @click="show=true">
<view class="title">美甲时间</view>
<image src="../static/mine/21.png" v-if="!time"></image>
<view v-else class="time">{{ time }}</view>
<view class="order-name">
<view>美甲人电话</view>
<input type="text" v-model="phone" maxlength="11" />
</view>
<view class="order-address">
<view class="title">美甲地址</view>
<input type="text" v-model="address" disabled />
</view>
<view class="order-name">
<view>美甲店电话</view>
<input type="text" v-model="storePhone" disabled />
</view>
<!-- <view class="order-date" @click="show=true">
<view class="title">美甲时间</view>
<image src="../static/mine/21.png" v-if="!time"></image>
<view v-else class="time">{{ time }}</view>
</view> -->
</view>
<view class="order-btn" @click="addManicureOrder">确认订单</view>
<u-picker mode="time" v-model="show" :params="params" @confirm="chooseDate"></u-picker>
@ -26,6 +34,8 @@ export default {
return {
name: '',
time: '',
phone: '',
storePhone: '',
address: '',
params: {
year: true,
@ -41,28 +51,38 @@ export default {
},
onLoad() {
this.getConfigInfo();
this.getPhone();
},
methods: {
validateValue() {
if(this.$u.test.isEmpty(this.name)) {
this.showToast('姓名不能为空', 'error');
this.showToast('姓名不能为空');
return false;
}
if(this.$u.test.isEmpty(this.time)) {
this.showToast('日期不能为空', 'error');
if(this.$u.test.isEmpty(this.phone)) {
this.showToast('美甲人电话不能为空');
return false;
}
if(new Date() > new Date(this.time)) {
this.showToast('日期错误', 'error');
if(!this.$u.test.mobile(this.phone)) {
this.showToast('美甲人电话错误');
return false;
}
// if(this.$u.test.isEmpty(this.time)) {
// this.showToast('', 'error');
// return false;
// }
// if(new Date() > new Date(this.time)) {
// this.showToast('', 'error');
// return false;
// }
return true;
},
addManicureOrder() {
if(!this.validateValue()) return false;
this.$u.api.addManicure({
name: this.name,
time: new Date(this.time)
phone: this.phone,
// time: new Date(this.time)
}).then((res)=>{
if(res.errCode == 0) {
this.$refs.uToast.show({
@ -85,6 +105,15 @@ export default {
}
})
},
getPhone() {
this.$u.api.getConfigInfo({
code: 'manicure_phone',
}).then(res => {
if(res.errCode == 0) {
this.storePhone = res.data.config.value;
}
})
},
chooseDate(e) {
// let time = e.year + '' + e.month + '' + e.day + '' + e.hour + '' + e.minute + ''
let time = e.year + '/' + e.month + '/' + e.day + ' ' + e.hour + ':' + e.minute