392 lines
11 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<view class="box">
<view class="tit">请填写预约信息</view>
<view class="row none" v-if="isreal == 1">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon1.png" mode="" />
请选择上门时间
</view>
<view class="row_con" @click="changeShow">
{{time}}
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png" mode="" />
</view>
</view>
<view class="row none" v-if="isreal == 2">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon2.png" mode="" />
请选择服务时间
</view>
<view class="row_con" @click="changeShow2">
{{serTime}}
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png" mode="" />
</view>
</view>
<view class="gray"></view>
<view class="row">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon3.png" mode="" />
联系人姓名
</view>
<view class="row_con">
<input
type="text"
placeholder="请填写联系人姓名"
placeholder-style="font-size: 26rpx;color: #999999;"
:value="name"
data-name='name'
@input="headerInputClick"
/>
</view>
</view>
<view class="row">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon4.png" mode="" />
联系人电话
</view>
<view class="row_con">
<input
type="number"
maxlength="11"
placeholder="请填写联系人电话"
placeholder-style="font-size: 26rpx;color: #999999;"
:value="phone"
data-name='phone'
@input="headerInputClick"
/>
</view>
</view>
<view class="row">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon5.png" mode="" />
请选择服务地址
</view>
<view class="row_con" @click="changeArea">
{{citys}}
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png" mode="" />
</view>
</view>
<view class="row none">
<view class="row_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon5.png" mode="" />
详细地址
</view>
<view class="row_con">
<input
type="text"
placeholder="请填写详细地址"
placeholder-style="font-size: 26rpx;color: #999999;"
:value="add"
data-name='add'
@input="headerInputClick"
/>
</view>
</view>
<view class="gray"></view>
<view class="doorToDoor">
<view class="doorToDoor_tit">是否上门服务</view>
<view class="selectItem" @click="changeCir(1)">
<view :class="['cir', isreal == 1 ? 'active' : '']"></view>
</view>
<view class="selectItem" @click="changeCir(2)">
<view :class="['cir', isreal == 2 ? 'active' : '']"></view>
</view>
</view>
<view class="gray"></view>
<view class="row none">
<view class="row_tit2">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/doorToDoor/reser_icon6.png" mode="" />
<input
type="text"
placeholder="给商家捎句话"
placeholder-style="font-size: 26rpx;color: #999999;"
:value="msg"
data-name='msg'
@input="headerInputClick"
/>
</view>
</view>
<view class="gray"></view>
<view class="agree">
<view :class="['cir', agree ? 'active' : '']" @click="changeAgree"></view>
<view @click="changeShow3">
我已阅读并同意服务合同中的内容
</view>
</view>
<view class="btn" @click="submit">提交申请 </view>
</view>
<u-datetime-picker
:show="show"
mode="datetime"
:closeOnClickOverlay="true"
:minDate="minDate"
:formatter="formatter"
@confirm="onInput"
@cancel="onClose"
@close="onClose"
/>
<areaPopup :show="show2" @selectArea='headerAreaClick' @close='onClose' />
<u-popup :show="show3" mode="center" @close="onClose" round="20rpx" closeOnClickOverlay>
<view class="pop_body">
<view class="popBox">
<view class="tit2">服务声明</view>
乙方指定的家政服务人员须遵守以下行为准则
1遵守国家各项法律法规和社会公德执行公民道德建设实施纲要自尊自强爱岗敬业遵守企业各项规章制度维护经营者和甲方的合法权益
2遵守职业道德尊重甲方生活习俗主动适应甲方视甲方如亲人不虐待所照看的老残人员不泄露甲方隐私不参与甲方家庭及邻里的矛盾纠纷不传闲话以免激化矛盾不向甲方借钱或索要财物在离开甲方家庭时要主动打开自己的包裹让其检查以示尊重
3遵守合同条款不无故违约不无故要求换户或不辞而别如与甲方发生矛盾出现甲方侵犯家政服务人员合法权益或变更服务地址服务工种等无论何种原因家政服务人员均应先行告知经营者不要擅自处理
4努力学习服务技能完成经营者和甲方安排的工作任务对不会使用的器具未经经营者指导和甲方允许不要使用未经甲方同意不使用其通讯工具和电脑等设备
5保证自身和甲方的安全不要与异性成青年人同居一室不带亲朋好友在甲方家中停留或食宿不擅自外出或夜不归宿如有特殊情况不能按时返回要征得甲方同意要注意防火防盗
 第九条 服务人员仪态仪表   乙方指定的家政服务人员须遵守以下仪态仪表要求   1讲究个人卫生着装整洁大方不能过于随意不穿紧身衣裤或过于暴露的服装   2佩戴饰物要适当不浓妆艳抹不留长指甲和涂指甲油
3言谈举止大方得体与甲方交流时要正视对方不要左顾右盼不能双臂交叉或双手插在兜里
</view>
<view class="know" @click="onClose">我已知晓</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
apiArr
} from '../../../api/communityService';
import {
request,
isPhone
} from '../../../utils';
export default {
data() {
return {
time: "", //上门时间
serTime: "", //服务时间
name: "", //姓名
phone: "", //电话
citys: "", //服务地址
add: "", //详细地址
isreal: 1, //是否上门
msg: "", //信息
id: "",
agree: false, //是否阅读同意
type: "1", //1上门时间 2服务时间
info: "",
GoodsMsg: "", //商户信息
orderMsg: "",
show: false,
show2: false,
show3: false,
minDate: new Date().getTime(),
formatter(type, value) {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
},
}
},
methods: {
async init(id) {
const res = await request(apiArr.serverInfo, 'POST', {
appoint_id: Number(id)
});
this.info = res;
uni.setNavigationBarTitle({
title: res.title
})
},
changeShow() {
this.show = !this.show;
this.type = 1;
},
//
changeShow2() {
this.show = !this.show;
this.type = 2;
},
// 关闭弹窗选择器
onClose(){
this.show = false;
this.show2 = false;
this.show3 = false;
},
// 时间选择器点击确定
onInput(event){
const date = new Date(event.value); // 获取选中的 Date 对象
const year = date.getFullYear(); // 获取年份
const month = date.getMonth() + 1; // 获取月份(注意月份从 0 开始,需要 +1
const day = date.getDate(); // 获取日期
const hours =date.getHours()
const minutes = date.getMinutes();
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
console.log('time', time, 'type', this.type);
this.show = false;
if(this.type == 1){
this.time = time;
}else{
this.serTime = time;
}
},
// input 输入框输入值、
headerInputClick(e) {
console.log('eeee', e)
const { name } = e.currentTarget.dataset;
const { value } = e.detail;
this[name] = value;
},
// 地址选择弹窗
changeArea(){
this.show2 = true;
},
headerAreaClick(data) {
console.log('接受参数值', data);
this.citys = `${data.confirmProv.name}${data.confirmCity.area_name}${data.confirmDist.business_name}`;
this.show2 = false;
},
changeCir(e){
this.isreal = e
},
// 打开服务合同弹窗
changeShow3(){
this.show3 = true
},
// 同意服务合同
changeAgree(){
this.agree = !this.agree;
},
async submit() {
console.log('他啥都', this);
if(this.isreal == '1'){
if(!this.time){
uni.showToast({
title: '请选择上门时间',
icon:"none"
})
return
}
}else{
if(!this.serTime){
uni.showToast({
title: '请选择服务时间',
icon:"none"
})
return
}
}
if(!this.name){
uni.showToast({
title: '请填写联系人姓名',
icon:"none"
})
return
}
if(!this.phone){
uni.showToast({
title: '请填写联系人电话',
icon:"none"
})
return
}
if(!isPhone(this.phone)){
uni.showToast({
title: '请填写正确电话',
icon:"none"
})
return
}
if(!this.citys){
uni.showToast({
title: '请选择服务地址',
icon:"none"
})
return
}
if(!this.add){
uni.showToast({
title: '请填写详细地址',
icon:"none"
})
return
}
if(!this.agree){
uni.showToast({
title: '请阅读合同内容',
icon:"none"
})
return
}
let svctime
if(this.isreal == '1'){
svctime = this.time
}else{
svctime = this.serTime
}
uni.showLoading({
title: '申请中...',
mask:true
})
const res = await request(apiArr.createServerOrder, 'POST', {
addr: this.citys + this.add,
appoint_id: this.info.appoint_id,
capon_id: 0,
cate_id: this.info.cate_id,
name: this.name,
order_type: this.type,
shop_id: this.info.shop_id,
svctime,
tel: this.phone
}, { silent: false });
console.log('12332322', res);
this.orderMsg = res;
// that.getGoodsMsg()
}
},
onLoad(options) {
this.id = options.id;
this.init(options.id);
}
}
</script>
<style>
@import url("./index.css");
</style>