...
|
...
|
@@ -328,56 +328,53 @@ |
|
|
|
|
|
},
|
|
|
created: function () {
|
|
|
apiready = function () {
|
|
|
var app = this;
|
|
|
app.getUserIndexInfo();
|
|
|
$api.rmStorage('city');
|
|
|
app.id = api.pageParam.id;
|
|
|
app.id = localStorage.getItem('id');
|
|
|
app.applyInfo();
|
|
|
app.cityname = api.pageParam.cityname;
|
|
|
api.setFrameAttr({
|
|
|
name: 'pay_form',
|
|
|
reload: true
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'choose_city'
|
|
|
}, function (ret, err) {
|
|
|
// console.log(JSON.stringify(ret))
|
|
|
// alert(JSON.stringify(ret));
|
|
|
// app.user_address = ret.value.city + ' ' + ret.value.address;
|
|
|
app.user_address = ret.value.address;
|
|
|
app.user_address_detail = ret.value.name;
|
|
|
app.lon = ret.value.longitude;
|
|
|
app.lat = ret.value.latitude;
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'meal'
|
|
|
}, function (ret, err) {
|
|
|
app.meal = ret.value.meal + ret.value.num + app.unit;
|
|
|
app.num = ret.value.num;
|
|
|
app.price = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
app.attribute_id = ret.value.attribute_id
|
|
|
// alert(JSON.stringify(ret.value));
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'room'
|
|
|
}, function (ret, err) {
|
|
|
// alert(JSON.stringify(ret));
|
|
|
app.meal = ret.value.name_left + ',' + ret.value.name_right + ',' + ret.value.num + '个月';
|
|
|
app.num = ret.value.num;
|
|
|
app.price = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
app.attribute_id = ret.value.attribute_id
|
|
|
// alert(JSON.stringify(ret.value));
|
|
|
});
|
|
|
app.cityname = localStorage.getItem('cityName');
|
|
|
|
|
|
// api.addEventListener({
|
|
|
// name: 'choose_city'
|
|
|
// }, function (ret, err) {
|
|
|
// // console.log(JSON.stringify(ret))
|
|
|
// // alert(JSON.stringify(ret));
|
|
|
// // app.user_address = ret.value.city + ' ' + ret.value.address;
|
|
|
// app.user_address = ret.value.address;
|
|
|
// app.user_address_detail = ret.value.name;
|
|
|
// app.lon = ret.value.longitude;
|
|
|
// app.lat = ret.value.latitude;
|
|
|
// });
|
|
|
// api.addEventListener({
|
|
|
// name: 'meal'
|
|
|
// }, function (ret, err) {
|
|
|
// app.meal = ret.value.meal + ret.value.num + app.unit;
|
|
|
// app.num = ret.value.num;
|
|
|
// app.price = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
// app.attribute_id = ret.value.attribute_id
|
|
|
// // alert(JSON.stringify(ret.value));
|
|
|
// });
|
|
|
// api.addEventListener({
|
|
|
// name: 'room'
|
|
|
// }, function (ret, err) {
|
|
|
// // alert(JSON.stringify(ret));
|
|
|
// app.meal = ret.value.name_left + ',' + ret.value.name_right + ',' + ret.value.num + '个月';
|
|
|
// app.num = ret.value.num;
|
|
|
// app.price = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
// app.attribute_id = ret.value.attribute_id
|
|
|
// // alert(JSON.stringify(ret.value));
|
|
|
// });
|
|
|
// 上传证明事件
|
|
|
api.addEventListener({
|
|
|
name: 'prove'
|
|
|
}, function (ret, err) {
|
|
|
// alert(JSON.stringify(ret.value));
|
|
|
app.diagnosis = ret.value.diagnosis;
|
|
|
app.drug_recipe = ret.value.drug_recipe;
|
|
|
app.drug = ret.value.drug;
|
|
|
app.ill_case = ret.value.ill_case;
|
|
|
});
|
|
|
// api.addEventListener({
|
|
|
// name: 'prove'
|
|
|
// }, function (ret, err) {
|
|
|
// // alert(JSON.stringify(ret.value));
|
|
|
// app.diagnosis = ret.value.diagnosis;
|
|
|
// app.drug_recipe = ret.value.drug_recipe;
|
|
|
// app.drug = ret.value.drug;
|
|
|
// app.ill_case = ret.value.ill_case;
|
|
|
// });
|
|
|
var client_h = window.innerHeight;
|
|
|
window.addEventListener('resize', function () {
|
|
|
if (window.innerHeight < client_h) {
|
...
|
...
|
@@ -386,31 +383,29 @@ |
|
|
app.pos = 'fixed'
|
|
|
}
|
|
|
}, false);
|
|
|
api.addEventListener({
|
|
|
name: 'sev_time'
|
|
|
}, function (ret, err) {
|
|
|
if (ret) {
|
|
|
app.date_info = ret.value.dateinfo;
|
|
|
} else {
|
|
|
toastMsg('请重试')
|
|
|
}
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'bro_time'
|
|
|
}, function (ret, err) {
|
|
|
if (ret) {
|
|
|
app.broth_info = ret.value.broinfo;
|
|
|
} else {
|
|
|
toastMsg('请重试')
|
|
|
}
|
|
|
});
|
|
|
// api.addEventListener({
|
|
|
// name: 'sev_time'
|
|
|
// }, function (ret, err) {
|
|
|
// if (ret) {
|
|
|
// app.date_info = ret.value.dateinfo;
|
|
|
// } else {
|
|
|
// toastMsg('请重试')
|
|
|
// }
|
|
|
// });
|
|
|
// api.addEventListener({
|
|
|
// name: 'bro_time'
|
|
|
// }, function (ret, err) {
|
|
|
// if (ret) {
|
|
|
// app.broth_info = ret.value.broinfo;
|
|
|
// } else {
|
|
|
// toastMsg('请重试')
|
|
|
// }
|
|
|
// });
|
|
|
// app.name=api.pageParam.name;
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
// 选择服务日期
|
|
|
dateSelect: function () {
|
|
|
|
|
|
api.openWin({
|
|
|
name: 'getSev_w',
|
|
|
url: '../common/getSev_w.html'
|
...
|
...
|
@@ -427,12 +422,10 @@ |
|
|
// 上传证明
|
|
|
openProve: function () {
|
|
|
openView('prove', 'index/prove', '上传就医证明','prove',false,false,false)
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 获取订单详情
|
|
|
applyInfo: function () {
|
|
|
|
|
|
|
|
|
var app = this;
|
|
|
var post = {
|
|
|
gid: app.id
|
|
|
};
|
...
|
...
|
@@ -443,7 +436,6 @@ |
|
|
console.log(header);
|
|
|
|
|
|
getRequest('post', 'portal/Goods/applyInfo', post, header).then(function (res) {
|
|
|
alert(res)
|
|
|
console.log(JSON.stringify(res));
|
|
|
// alert(JSON.stringify(res))
|
|
|
if (res.data.code == 1) {
|
...
|
...
|
@@ -462,10 +454,10 @@ |
|
|
toastMsg(res.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 切换亲友信息
|
|
|
tab_person: function (index, rid) {
|
|
|
var app = this;
|
|
|
if (app.ind == index) {
|
|
|
app.ind = -1;
|
|
|
app.user_name = '';
|
...
|
...
|
@@ -484,7 +476,6 @@ |
|
|
'XX-Token': getToken()
|
|
|
};
|
|
|
getRequest('post', 'portal/Goods/getPersonal', post, header).then(function (res) {
|
|
|
// alert(JSON.stringify(res));
|
|
|
if (res.data.code == 1) {
|
|
|
app.user_name = res.data.data.name;
|
|
|
app.checked_male = res.data.data.sex == 1 ? true : false;
|
...
|
...
|
@@ -497,8 +488,7 @@ |
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 选择套餐
|
|
|
chooseMeal: function () {
|
|
|
if (app.attribute_type == 1) {
|
...
|
...
|
@@ -535,42 +525,41 @@ |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 选择服务地址
|
|
|
openMap: function () {
|
|
|
openView('choose_address', 'common/choose_address', '选择服务地址', 'choose_address', false, {cityname: app.cityname});
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 获取协议
|
|
|
openIsPro: function () {
|
|
|
var app = this;
|
|
|
app.isPro = !app.isPro;
|
|
|
api.openFrame({
|
|
|
bgColor: 'rgba(0,0,0,0.05)',
|
|
|
name: 'tool_fm',
|
|
|
url: '../common/tool_fm.html',
|
|
|
bounces: false,
|
|
|
animation: {
|
|
|
type: "push",
|
|
|
subType: "from_bottom",
|
|
|
duration: 300
|
|
|
},
|
|
|
rect: {
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
w: 'auto',
|
|
|
h: 'auto'
|
|
|
window.location.href = '../common/tool_fm.html';
|
|
|
// api.openFrame({
|
|
|
// bgColor: 'rgba(0,0,0,0.05)',
|
|
|
// name: 'tool_fm',
|
|
|
// url: '../common/tool_fm.html',
|
|
|
// bounces: false,
|
|
|
// animation: {
|
|
|
// type: "push",
|
|
|
// subType: "from_bottom",
|
|
|
// duration: 300
|
|
|
// },
|
|
|
// rect: {
|
|
|
// x: 0,
|
|
|
// y: 0,
|
|
|
// w: 'auto',
|
|
|
// h: 'auto'
|
|
|
// }
|
|
|
// })
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
,
|
|
|
// 去协议
|
|
|
getAgreement: function (name, id) {
|
|
|
openView('agree_content', 'common/agree_content', name, 'agree_content', false, {id: id})
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 去预约
|
|
|
appointment: function () {
|
|
|
var app = this;
|
|
|
// alert(app.date_info);
|
|
|
if (app.user_name == '') {
|
|
|
toastMsg('请输入服务对象')
|
...
|
...
|
@@ -583,9 +572,11 @@ |
|
|
}
|
|
|
else if (app.broth_info == '') {
|
|
|
toastMsg('请选择出生日期')
|
|
|
} else if (app.user_address_detail == '' && app.user_address == '') {
|
|
|
}
|
|
|
else if (app.user_address_detail == '' && app.user_address == '') {
|
|
|
toastMsg('请输入详细地址')
|
|
|
} else if (!id_card.test(app.user_id_card) && app.is_idcard == 1) {
|
|
|
}
|
|
|
else if (!id_card.test(app.user_id_card) && app.is_idcard == 1) {
|
|
|
toastMsg('身份证号码不正确')
|
|
|
}
|
|
|
else if (app.meal == '' && app.num == '' && app.attribute_id == '') {
|
...
|
...
|
@@ -593,7 +584,8 @@ |
|
|
}
|
|
|
else if (app.user_content == '') {
|
|
|
toastMsg('请描述疑问和症状')
|
|
|
} else if (app.is_prove == 1 && app.diagnosis == '' && app.drug_recipe == '' && app.drug == '') {
|
|
|
}
|
|
|
else if (app.is_prove == 1 && app.diagnosis == '' && app.drug_recipe == '' && app.drug == '') {
|
|
|
toastMsg('请上传证明')
|
|
|
}
|
|
|
else if (app.push_btn == false) {
|
...
|
...
|
@@ -642,13 +634,11 @@ |
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 客服
|
|
|
openSever: function () {
|
|
|
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
// 获取个人信息
|
|
|
getUserIndexInfo: function () {
|
|
|
var header = {
|
...
|
...
|
@@ -662,8 +652,7 @@ |
|
|
toastMsg(res.data.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
,
|
|
|
},
|
|
|
|
|
|
}
|
|
|
})
|
...
|
...
|
|