作者 朱振飞

预约模块地址处理

... ... @@ -351,19 +351,20 @@ function getRequest(type, url, params, header) {
url: baseurl + url,
method: type,
params: params,
headers: header,
headers: header
}).then(function (res) {
if (res.data.code == 502) {
// setTimeout(() => {
// window.location.href = '../../html/login/login_index.html'
// }, 2000);
if (res.data.code == '502') {
setTimeout(function(){
window.location.href = '../../html/login/login_index.html'
}, 2000);
// openView('login_index', 'login/login_index', '登录', 'login_index', false, false, false)
} else {
resolve(res)
}
loadEnd();
// resolve(res)
}).catch(function (err) {
}).catch(function (err) {
console.log(121212)
toastMsg('网络错误');
// openView('wrong', 'common/wrong', '网络错误', 'wrong', false, false, false);
// alert(JSON.stringify(err))
... ...
... ... @@ -173,14 +173,13 @@
userId: '',
},
created: function () {
var app = this
// alert('预约' + api.pageParam.id)
app.cid = localStorage.getItem('cid');
app.id = localStorage.getItem('id');
app.care_name = localStorage.getItem('care_name');
app.cityname = localStorage.getItem('cityname');
app.proCareInfoInfo();
app.getUserIndexInfo();
this.cid = localStorage.getItem('cid');
this.id = localStorage.getItem('id');
this.care_name = localStorage.getItem('care_name');
this.cityname = localStorage.getItem('cityname');
this.proCareInfoInfo();
this.getUserIndexInfo();
},
methods: {
// 去预约
... ...
... ... @@ -387,7 +387,6 @@
app.attribute = api.pageParam.attribute.split(',');
app.id = api.pageParam.id;
app.unit = api.pageParam.unit;
}
},
methods: {
... ... @@ -398,6 +397,7 @@
api.closeWin();
},
choose_sever: function (attr, index) {
var app = this;
app.active_index = index;
app.active_name = app.attribute[index];
app.attribute_id = app.attribute[index].id;
... ...
... ... @@ -269,7 +269,6 @@
}else {
toastMsg('请选择入住类型')
}
},
plus: function () {
if (app.num < app.price_info.limit_num) {
... ...
... ... @@ -7,6 +7,35 @@
<title></title>
<link rel="stylesheet" href="../../assets/css/reset.css">
<link rel="stylesheet" type="text/css" href="../../assets/css/city.css">
<style>
header {
width: 100%;
height: auto;
font-size: 15px;
}
.index_header {
line-height: 0.44rem;
color: #424242;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.24rem 0.42rem;
}
.close_left {
position: relative;
}
.close_left::before {
position: absolute;
left: -0.1rem;
right: -0.1rem;
top: -0.1rem;
bottom: -0.1rem;
content: '';
}
</style>
</head>
<body>
... ... @@ -80,24 +109,17 @@
var firstTouch;
shortcut.addEventListener('touchstart', function (e) {
var anchor = e.target.getAttribute('data-anchor');
firstTouch = e.touches[0];
touch.y1 = firstTouch.pageY;
touch.anchor = anchor;
scrollTo(anchor);
});
shortcut.addEventListener('touchmove', function (e) {
firstTouch = e.touches[0];
touch.y2 = firstTouch.pageY;
var anchorHeight = 16;
var delta = (touch.y2 - touch.y1) / anchorHeight | 0;
var anchor = shortcutList[shortcutList.indexOf(touch.anchor) + delta];
... ...
... ... @@ -198,18 +198,8 @@
</footer>
</div>
</body>
</html>
<script>
window.onLoad = function () {
var map = new AMap.Map('container');
}
var url = 'https://webapi.amap.com/maps?v=1.4.8&key=ef53760bd959a4df08b7d4587280e642&callback=onLoad';
var jsapi = document.createElement('script');
jsapi.charset = 'utf-8';
jsapi.src = url;
document.head.appendChild(jsapi);
</script>
<script type="text/javascript" src = 'https://webapi.amap.com/maps?v=1.4.4&test=true&key=ef53760bd959a4df08b7d4587280e642&&plugin=AMap.ToolBar,AMap.IndoorMap'></script>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
... ... @@ -261,6 +251,12 @@
user_info: []
},
created: function () {
var cityName = localStorage.getItem('cityName')
if(cityName){
this.cityname = cityName
}else{
this.get_city()
}
this.cat(); //首页导航
this.indexList(); //第三栏
this.show(); //严选推荐
... ... @@ -323,16 +319,19 @@
},
// 切换当前城市
goToCity: function () {
var app = this
if (app.cityname == '') {
toastMsg('定位中')
} else {
api.openWin({
name: 'city_win',
url: '../index/city_win.html',
pageParam: {
cityname: app.cityname
}
});
localStorage.setItem('cityName',app.cityname);
window.location.href = '../index/city_f.html';
// api.openWin({
// name: 'city_win',
// url: '',
// pageParam: {
// cityname: app.cityname
// }
// });
}
},
// 显示快捷菜单
... ...
... ... @@ -202,6 +202,538 @@
background-color: #FFF;
overflow-y: auto;
}
/*套餐选择*/
.meal {
display: flex;
flex-direction: column;
justify-content: flex-end;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
}
.meal_title {
text-align: center;
color: #424242;
font-size: 15px;
font-weight: bold;
border-bottom: 1px solid #ccc;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.25rem;
}
.meal_item {
background-color: #fff;
}
.pay_box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10% 0.25rem 10%;
}
.pay_num {
font-size: 12px;
color: #424242;
}
.pay_btn_box {
display: flex;
align-items: center;
}
.pay_btn_box .iconfont {
font-size: 20px;
color: #ccc;
}
.pay_btn_box input {
width: 0.5rem;
text-align: center;
border: 0;
outline: none;
font-size: 15px;
}
.pay_num .limit {
padding: 0;
font-size: 12px;
color: #ccc;
}
.pay_btn {
font-size: 15px;
color: #fff;
background-color: #dbb25f;
text-align: center;
padding: 0.2rem 0;
}
.room_box, .price_box {
display: flex;
/*align-items: center;*/
justify-content: space-between;
padding: 0.2rem 0.4rem 0 0.4rem;
}
.room_left {
font-size: 15px;
color: #424242;
}
.youhui {
color: #d8b25f;
font-size: 12px;
margin-left: 0.1rem;
}
.room_right {
color: #dbb25f;
font-size: 15px;
}
.old_price {
text-decoration: line-through;
color: #ccc;
margin-left: 0.1rem;
}
.room_tips {
color: #ccc;
font-size: 12px;
padding: 0 0.4rem;
}
.price_left, .price_right {
display: flex;
/*align-items: center;*/
flex-wrap: wrap;
flex: 1;
}
.price_left span, .price_right span {
background-color: #f2f2f2;
color: #424242;
padding: 0 0.2rem;
font-size: 14px;
margin: 0 0.2rem 0.2rem 0;
border-radius: 0.05rem;
cursor: pointer;
min-width: 0.88rem;
text-align: center;
height: 0.48rem;
display: flex;
align-items: center;
justify-content: center;
}
.icon-cuohao {
font-size: 15px;
color: #424242;
}
.price_box .span_active {
background-color: #dbb25f;
color: #fff;
}
.meal_title {
text-align: center;
color: #424242;
font-size: 15px;
font-weight: bold;
border-bottom: 1px solid #ccc;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.25rem;
}
.meal_price_box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #424242;
padding: 0.25rem 10% 0 10%;
}
.meal_price {
color: #d8b25f;
font-size: 9px;
margin-left: 0.1rem;
}
.incer {
color: #ccc;
font-size: 9px;
padding: 0 10%;
}
.sever_list {
display: flex;
align-items: center;
flex-wrap: wrap;
font-size: 12px;
padding: 0.25rem 10%;
}
.sever_list span {
background-color: #f2f2f2;
padding: 0.1rem 0.2rem;
margin: 0 0.2rem 0.2rem 0;
border-radius: 0.07rem;
}
.sever_list .span_active {
background-color: #dbb25f;
color: #fff;
}
.meal_item {
background-color: #fff;
}
.pay_box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10% 0.25rem 10%;
}
.pay_num {
font-size: 12px;
color: #424242;
}
.pay_btn_box {
display: flex;
align-items: center;
}
.pay_btn_box .iconfont {
font-size: 20px;
color: #ccc;
}
.pay_btn_box input {
width: 0.5rem;
text-align: center;
border: 0;
outline: none;
font-size: 15px;
}
.pay_num .limit {
padding: 0;
font-size: 9px;
color: #ccc;
}
.price {
flex: 1;
text-align: right;
}
.price .meal_price {
font-size: 12px;
}
.price .old_price {
text-decoration: line-through;
color: #ccc;
margin-left: 0.1rem;
}
.pay_btn {
font-size: 15px;
color: #fff;
background-color: #dbb25f;
text-align: center;
padding: 0.2rem 0;
}
.icon-cuohao {
font-size: 15px;
color: #424242;
}
.save_btn {
text-align: center;
font-size: 0.36rem;
color: #fff;
padding: 0.15rem 0;
width: 100%;
position: absolute;
left: 0;
bottom: 0;
z-index: 100;
background-color: #dbb25f;
}
.moreoul {
width: 100%;
}
.moreoul li {
width: 100%;
padding: 0.3rem 0;
line-height: 0.3rem;
font-size: 16px;
border-bottom: 1px solid #f0f0f0;
text-align: center;
}
.nodata {
font-size: 16px;
color: #c0c0c0;
text-align: center;
padding: 0.5rem 0;
width: 100% !important;
}
.weui-picker__indicator:after {
border-bottom: 1px solid #dbb25f;
}
.weui-picker__indicator:before {
border-top: 1px solid #dbb25f;
}
.weui-picker__action {
padding: 0.2rem 0;
font-size: 13px;
text-align: center;
}
.weui-picker__action:first-child {
color: #333;
text-align: center;
}
.weui-picker__action:last-child {
color: #fff;
text-align: center;
background-color: #dbb25f;
}
.weui-picker__hd {
padding: 0;
}
.weui-picker__item {
font-size: 13px;
}
.close_left {
position: relative;
}
.close_left::before {
position: absolute;
left: -0.1rem;
right: -0.1rem;
top: -0.1rem;
bottom: -0.1rem;
content: '';
}
.mint-popup-bottom {
width: 100%;
}
.weui-check__label:active {
background: transparent;
}
.weui-cells_checkbox .weui-icon-checked:before {
/*content: '';*/
}
.weui-cells_checkbox .weui-check:checked + .weui-icon-checked:before {
color: #dbb25f
}
.weui-cell__hd {
position: relative;
}
.weui-cell__hd::before {
content: '';
position: absolute;
left: -10px;
right: -10px;
top: -10px;
bottom: -10px;
}
.mold_index {
position: fixed;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.05);
/*background-color: #000;*/
left: 0;
top: 0;
bottom: 0;
z-index: 10;
}
.weui-mask, .weui-mask_transparent {
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.weui-toast {
position: fixed;
z-index: 5000;
width: 40%;
min-width: 20%;
min-height: auto;
height: auto;
top: 50%;
left: 0;
right: 0;
margin: 0 auto;
/*margin-left: -3.8em;*/
background: hsla(0, 0%, 7%, .7);
text-align: center;
border-radius: 5px;
color: #fff;
font-size: 14px;
}
.weui-icon_toast {
margin: 0;
/*display: block*/
}
.weui-toast__content {
margin: 0;
padding: 0.1rem 0;
}
.weui-icon_toast.weui-icon-success-no-circle {
font-size: 0;
}
.weui-icon_toast.weui-icon-success-no-circle:before {
color: #fff;
font-size: 0;
margin: 0;
}
/*图片上传*/
#photoBox{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #FFF;
}
.auth2_title {
font-size: 14px;
color: #424242;
margin: 0.57rem 0.62rem 0 0.62rem;
}
.photos {
display: flex;
align-items: center;
/*justify-content: space-around;*/
flex-wrap: wrap;
font-size: 14px;
color: #424242;
}
.photo_item {
display: flex;
align-items: center;
flex-direction: column;
margin: 0.84rem 0 0 0;
/*flex: 1;*/
width: 50%;
}
.photo_item_img {
height: 1.92rem;
width: 2.46rem;
border: 1px dashed #dcdcdc;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0.1rem;
overflow: hidden;
margin-bottom: 0.28rem;
position: relative;
}
.photo_item_img input{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.photo_item_img .iconfont {
font-size: 33px;
color: #c1c1c1;
}
.photo_item_img img {
width: 100%;
}
.idcard_box input {
padding: 0.28rem 0;
width: 100%;
text-align: right;
}
.idcard_box .iconfont {
color: #E3C88D;
margin-right: 0.1rem;
}
.photo_re {
color: #AAAAAA;
font-size: 14px;
text-align: right;
margin: 0 0 0.47rem 0;
padding-right: 1.3rem;
}
.auth2_tips {
text-align: center;
font-size: 10px;
color: #AAAAAA;
margin-bottom: 0.65rem;
}
.save_btn {
position: relative;
width: 84%;
margin: 0.91rem auto 0.3rem auto;
border-radius: 0.1rem;
font-size: 15px;
}
</style>
<body>
<div id="loadStart"></div>
... ... @@ -390,18 +922,18 @@
<div class="my_address">
<div class="address_title"><span class="iconfont icon-shouye"></span><span> 我的服务地址</span></div>
<div class="address_item nodata" v-if="user_address_list.length==0">暂无服务地址</div>
<div class="address_item" v-for="(item,index) in user_address_list" @click="choose_address(item.address,item.address_info,item.lon,item.lat)" v-else>
<div class="address_item" v-for="(item,index) in user_address_list" @click="choose_address(item.pname,item.address,item.address_info,item.lon,item.lat)" v-else>
<span>{{item.address}}{{item.address_info}}</span>
</div>
</div>
<div class="my_address">
<div class="address_title"><span class="iconfont icon-dizhi"></span><span>我的附近地址</span></div>
<div class="address_item" v-for="(item,index) in nearList" @click="choose_address(item.address,'',item.lon,item.lat)">
<div class="address_item" v-for="(item,index) in nearList" @click="choose_address(item.pname,item.address,'',item.lon,item.lat)">
<span>{{item.address}}</span>
</div>
</div>
</div>
<div v-for="(item,index) in keywords" class="city_item" @click="choose_address(item.address,item.name,item.lon,item.lat)" v-else>
<div v-for="(item,index) in keywords" class="city_item" @click="choose_address(item.cityname,item.address,item.name,item.lon,item.lat)" v-else>
<div>
<div class="city_name">{{item.name}}</div>
<div class="city_address">{{item.address}}</div>
... ... @@ -409,6 +941,117 @@
</div>
</div>
</div>
<!--选择套餐-->
<div @click="close" class="meal" v-if="room">
<div class="meal_item" @click.stop>
<div class="meal_title">
<span></span>
<span>入住选择</span>
<span class="iconfont icon-cuohao" @click="close"></span>
</div>
<div class="room_box">
<div class="room_left">
<div><span>服务价格</span><span class="youhui">优惠¥{{price_info.count?price_info.count:0}}</span></div>
</div>
<div class="room_right">
<span>¥{{price_info.price?price_info.price:0}}</span>
<span class="old_price">原价{{price_info.o_price?price_info.o_price:0}}</span>
</div>
</div>
<div class="room_tips">此价格包含护理、房间、用餐费用</div>
<div class="price_box">
<div class="price_left">
<span :class="{'span_active':index==active_index}"
v-for="(item,index) in attribute[0]"
@click="choose_left(index)">{{item}}</span>
</div>
<div class="price_right">
<span :class="{'span_active':index==active_index2}"
v-for="(item,index) in attribute[1]"
@click="choose_right(index)">{{item}}</span>
</div>
</div>
<div class="pay_box">
<span class="pay_num">入住周期 <span
class="limit">({{price_info.limit_num?price_info.limit_num:0}}{{unit}})</span></span>
<div class="pay_btn_box">
<span class="iconfont icon-jian" @click="reduce"></span>
<input type="number" placeholder="" value="1" v-model="num">
<span class="iconfont icon-jikediancanicon09" @click="plus"></span>
</div>
</div>
<div class="pay_btn" @click.stop="pay_go">确定</div>
</div>
</div>
<div @click="close" class="meal" v-if="taocan">
<div class="meal_item" @click.stop>
<div class="meal_title"><span></span><span>选择套餐</span><span class="iconfont icon-cuohao"
@click="close"></span></div>
<div class="meal_price_box">
<div><span>服务价格</span><span class="meal_price">优惠价格¥{{Math.abs(priceList.count)?Math.abs(priceList.count):0}}</span>
</div>
<div class="price"><span class="meal_price">¥{{priceList.price?priceList.price:0}}</span><span
class="old_price">原价¥{{priceList.o_price?priceList.o_price:0}}</span></div>
</div>
<div class="incer">此服务由慈界平台优质服务商提供</div>
<div class="sever_list"><span :class="{'span_active':index==active_index}"
v-for="(item,index) in attribute"
@click="t_choose_sever(item,index)">{{item}}</span></div>
<div class="pay_box">
<span class="pay_num">购买数量 <span
class="limit">(限购<span>{{priceList.limit_num?priceList.limit_num:0}}</span>{{unit}})</span></span>
<div class="pay_btn_box">
<span class="iconfont icon-jian" @click="t_reduce"></span>
<input type="number" placeholder="" value="1" v-model="num">
<span class="iconfont icon-jikediancanicon09" @click="t_plus"></span>
</div>
</div>
<div class="pay_btn" @click="t_pay_go">确定</div>
</div>
</div>
<!--选择图片上传-->
<div id="photoBox" v-cloak v-if="photoUpload">
<div class="auth2_title">请上传就医证明,以便订单审核(为您保密)</div>
<div class="photos">
<div class="photo_item">
<div class="photo_item_img" >
<img v-if="img1" :src="img1"/>
<span v-else class="iconfont icon-xiangji"></span>
<input type="file" accept="image/*" @change="addPic" id="a">
</div>
<div class="photo_type">诊断证明/医疗处置单</div>
</div>
<div class="photo_item">
<div class="photo_item_img" @click="popupVisible1=true">
<img v-if="img2" :src="img2"/>
<span v-else class="iconfont icon-xiangji"></span>
<input type="file" accept="image/*" @change="addPic" id="b">
</div>
<div class="photo_type">药品处方</div>
</div>
<div class="photo_item">
<div class="photo_item_img" @click="popupVisible2=true">
<img v-if="img3" :src="img3"/>
<span v-else class="iconfont icon-xiangji"></span>
<input type="file" accept="image/*" @change="addPic" id="c">
</div>
<div class="photo_type">药品照片</div>
</div>
<div class="photo_item">
<div class="photo_item_img" @click="popupVisible3=true">
<img v-if="img4" :src="img4"/>
<span v-else class="iconfont icon-xiangji"></span>
<input type="file" accept="image/*" @change="addPic" id="d">
</div>
<div class="photo_type">
<div>病例</div>
</div>
</div>
</div>
<div class="photo_re">(选填)</div>
<div class="save_btn" @click="auth_next">提交</div>
<div class="auth2_tips">为提高审核速度,请最少上传1张清晰的图片</div>
</div>
</div>
</body>
</html>
... ... @@ -425,7 +1068,7 @@
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
<script type="text/javascript" src = 'https://webapi.amap.com/maps?v=1.4.4&test=true&key=ef53760bd959a4df08b7d4587280e642&&plugin=AMap.ToolBar,AMap.IndoorMap'></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script>
var app = new Vue({
el: '#app',
... ... @@ -473,17 +1116,13 @@
attribute_id: '',
attribute_type: '',
user_info: [],
lon: '',
lat: '',
diagnosis: '',
drug_recipe: '',
drug: '',
ill_case: '',
unit: '',
pos: 'fixed',
city: true,
lat: '',
lng: '',
city: false,
keyword: '',
keywords: [],
cities: [],
... ... @@ -491,25 +1130,57 @@
nearList: [],
user_address_list: [],
address_show: true,
lon: '',
lat: '',
latitude: '',
longitude: '',
//经度
lng: '',
//纬度
lat: '',
map: {},
//经纬度
centerPoint: []
centerPoint: [],
// 套餐选择
active_left: '',
active_right: '',
attribute: [],
price_info: [],
active_index: -1,
active_index2: -1,
taocan: false,
room: false,
// 套餐选择2
sever_list: [],
priceList: [],
// 图片上传
photoUpload: true,
img1: '',
img2: '',
img3: '',
img4: '',
popupVisible: false,
popupVisible1: false,
popupVisible2: false,
popupVisible3: false,
configinfo: []
},
created: function () {
var app = this;
this.getUserIndexInfo();
this.id = localStorage.getItem('id');
this.applyInfo();
this.cityname = localStorage.getItem('cityName');
this.getUserIndexInfo();
this.applyInfo();
//获取当前地址
this.get_city()
this.get_city();
this.getsdk();
//获取已经上传的图片
if ($api.getStorage('img1') || ($api.getStorage('img2')) || ($api.getStorage('img3')) || ($api.getStorage('img4'))) {
app.img1 = $api.getStorage('img1');
app.img2 = $api.getStorage('img2');
app.img3 = $api.getStorage('img3');
app.img4 = $api.getStorage('img4')
}
// api.addEventListener({
// name: 'choose_city'
... ... @@ -577,16 +1248,11 @@
// toastMsg('请重试')
// }
// });
// app.name=api.pageParam.name;
// app.name=api.pageParam.name;
},
methods: {
// 选择服务日期
dateSelect: function () {
// api.openWin({
// name: 'getSev_w',
// url: '../common/getSev_w.html'
// });
var calendar = new datePicker();
calendar.init({
'trigger': '#sever', /*按钮选择器,用于触发弹出插件*/
... ... @@ -632,7 +1298,7 @@
},
// 上传证明
openProve: function () {
openView('prove', 'index/prove', '上传就医证明','prove',false,false,false)
openView('prove', '../index/prove', '上传就医证明','prove',false,false,false)
},
// 获取订单详情
applyInfo: function () {
... ... @@ -698,44 +1364,19 @@
},
// 选择套餐
chooseMeal: function () {
var app = this;
if (app.attribute_type == 1) {
api.openWin({
name: 'choose_meal_w.html',
url: './choose_meal_w.html',
pageParam: {
attribute: app.attribute,
id: app.id,
unit: app.unit
}
});
app.taocan = true;
app.room = false;
} else {
api.openFrame({
bgColor: 'rgba(0,0,0,0.05)',
name: 'choose_room_f',
url: './choose_room_f.html',
bounces: false,
animation: {
type: "push",
subType: "from_bottom",
duration: 300
},
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto'
},
pageParam: {
attribute: app.attribute,
id: app.id,
unit: app.unit
}
});
app.room = true;
app.taocan = false;
}
},
// 选择服务地址
openMap: function () {
openView('choose_address', '../common/choose_address', '选择服务地址', 'choose_address', false, {cityname: app.cityname});
this.city = true;
// openView('choose_address', '../common/choose_address', '选择服务地址', 'choose_address', false, {cityname: app.cityname});
},
// 获取协议
openIsPro: function () {
... ... @@ -773,7 +1414,6 @@
// api.hideProgress();
}, 2000);
},
// 定位当前城市
get_city: function() {
var app = this ;
... ... @@ -789,8 +1429,7 @@
AMap.event.addListener(geolocation, 'complete', onComplete)
AMap.event.addListener(geolocation, 'error', onError)
function onComplete(data) {
alert(JSON.stringify(data));
app.cityname = data.addressComponent.province;
// app.cityname = data.addressComponent.province;
console.log(app.cityname);
app.lng = data.position.lng;
app.lat = data.position.lat;
... ... @@ -817,7 +1456,7 @@
console.log(JSON.stringify(status))
if(result.info === 'OK') {
var locationList = result.poiList.pois; // 周边地标建筑列表
//console.log(JSON.stringify(locationList))
console.log(locationList)
app.nearList = locationList          // 生成地址列表html
//           createLocationHtml(locationList);
} else {
... ... @@ -919,18 +1558,13 @@
}
},
// 选择地址
choose_address: function(address, name, longitude, latitude) {
api.sendEvent({
name: 'choose_city',
extra: {
address: address,
name: name,
longitude: longitude,
latitude: latitude,
city: app.cityname
}
});
closeWindow();
choose_address: function(cityname,address, name, longitude, latitude) {
this.cityname = cityname;
this.user_address = address;
this.user_address_detail = name;
this.lon = longitude;
this.lat = latitude;
this.city = false;
},
// 切换城市
choose_city_fun: function() {
... ... @@ -954,6 +1588,193 @@
}
});
},
//套餐选择
choose_left: function (index) {
app.active_index = index;
app.active_left = app.attribute[0][index];
app.num = app.price_info.limit_num;
app.getPrice();
},
choose_right: function (index) {
app.active_index2 = index;
app.active_right = app.attribute[1][index];
app.getPrice();
app.num = app.price_info.limit_num;
},
reduce: function () {
if (app.price_info.limit_num) {
if (app.num > app.price_info.limit_num) {
app.num--
} else {
toastMsg('不能低于' + app.price_info.limit_num + '个月哦')
}
}else {
toastMsg('请选择入住类型')
}
},
plus: function () {
if (app.num < app.price_info.limit_num) {
} else {
app.num++
}
},
getPrice: function () {
if (app.active_left && app.active_right) {
var post = {
attribute: app.active_left + '_' + app.active_right,
id: app.id
};
getRequest('post', 'portal/Goods/getPrice', post, null).then(function (res) {
if (res.data.code == 1) {
app.price_info = res.data.data;
app.num = app.price_info.limit_num;
app.attribute_id = app.price_info.attribute_id
}
})
} else {
toastMsg('请选择入住类型')
}
},
pay_go: function () {
if (app.active_left && app.active_right) {
api.sendEvent({
name: 'room',
extra: {
name_left: app.active_left,
name_right: app.active_right,
num: app.num,
price: app.price_info.price,
attribute_id: app.attribute_id
}
});
app.close()
}
else {
toastMsg('请选择入住类型')
}
},
//套餐选择2
close: function () {
// api.closeWin({
// name: 'choose_meal_w'
// });
this.taocan = false
this.room = false
},
t_choose_sever: function (attr, index) {
var app = this;
app.active_index = index;
app.active_name = app.attribute[index];
app.attribute_id = app.attribute[index].id;
var post = {
id: app.id,
attribute: attr
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/getPrice', post, header).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 1) {
app.priceList = res.data.data;
} else {
toastMsg(res.msg)
}
});
app.num = 1;
app.meal = app.active_name + app.num + app.unit;
},
t_reduce: function () {
var app = this;
if (app.num > 1) {
app.num--
}
app.price = parseFloat(app.priceList.price) * (app.num);
app.meal = app.active_name + app.num + app.unit;
},
t_plus: function () {
var app = this;
if (app.num < app.priceList.limit_num) {
app.num++
} else {
toastMsg('不能超过最大限购哦')
}
app.price = parseFloat(app.priceList.price) * (app.num);
app.meal = app.active_name + app.num + app.unit;
},
t_pay_go: function () {
var app = this;
if (app.active_name != '') {
app.close()
} else {
toastMsg('请选择套餐类型')
}
},
//证明上传
addPic(event){
},
//诊断证明/医疗处置单
auth1: function (type) {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx.uploadImage({
localId: localIds, // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
var serverId = res.serverId; // 返回图片的服务器端ID
app.img1=serverId
}
});
}
});
},
// 药品处方
auth2: function (type) {
app.popupVisible1 = false;
},
// 药品照片
auth3: function (type) {
app.popupVisible2 = false;
},
// 病例
auth4: function (type) {
app.popupVisible3 = false;
},
auth_next: function () {
if (app.img1 == '') {
toastMsg('请上传诊断证明/医疗处置单')
} else if (app.img2 == '') {
toastMsg('请上传药品处方')
} else if (app.img3 == '') {
toastMsg('请上传药品照片')
}
else {
api.sendEvent({
name: 'prove',
extra: {
diagnosis: app.img1,
drug_recipe: app.img2,
drug: app.img3,
ill_case: app.img4
}
});
api.closeWin();
}
},
// 去预约
appointment: function () {
var app = this;
... ... @@ -1043,7 +1864,8 @@
'XX-Token': getToken()
};
getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
if (res.data.code == 1) {
console.log(res)
if (res.data.code === '1') {
app.user_info = res.data.data;
} else {
toastMsg(res.data.msg)
... ...
... ... @@ -200,7 +200,6 @@
app.img3 = $api.getStorage('img3');
app.img4 = $api.getStorage('img4')
}
}
},
methods: {
... ... @@ -214,7 +213,7 @@
apis: 'chooseImage,uploadImage'
};
getRequest('post', 'user/index/getSingture', post, header).then(function (res) {
// alert(JSON.stringify(res))
alert(JSON.stringify(res))
if (res.data.code == 1) {
app.configinfo = res.data.data;
wx.config({
... ... @@ -245,7 +244,6 @@
var serverId = res.serverId; // 返回图片的服务器端ID
app.img1=serverId
}
});
}
... ...
... ... @@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../assets/css/pay.css">
<link rel="stylesheet" href="../../assets/css/my_news.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
<title>我的账户</title>
<style>
body {
background-color: #f4f4f4;
... ... @@ -143,6 +143,7 @@
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
... ... @@ -160,26 +161,20 @@
user_type: []
},
created: function () {
apiready = function () {
api.addEventListener({
name: 'cash'
}, function (ret, err) {
app.getUserIndexInfo();
});
app.getUserIndexInfo();
}
this.getUserIndexInfo();
},
methods: {
my_count: function () {
var app = this;
// alert(app.user_type.balance);
if (parseFloat(app.user_type.balance) <= 0) {
toastMsg('余额不足')
} else {
openView('my_cash', 'my/my_cash', '提现确认', 'my_cash', false, {balance: app.user_type.balance})
openView('my_cash', '../my/my_cash', '提现确认', 'my_cash', false, {balance: app.user_type.balance})
}
},
getUserIndexInfo: function () {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ...
... ... @@ -119,7 +119,7 @@
</div>
<!--<div :class="['cons_item',item.able==1?'':'cons_item_nouse']"-->
<div class='cons_item'
v-for="(item,index) in getConsumeMoney_data">
v-for="(item,index) in getConsumeMoney_data" >
<div class="cons_item_img"><img src="../../assets/image/juan_03.jpg" alt=""></div>
<div class="cons_item_content">
<div class="cons_left">
... ... @@ -132,9 +132,10 @@
</div>
</div>
<div class="cons_item_img2"><img src="../../assets/image/line.jpg" alt=""></div>
<div class="cons_item_bottom"><span>{{item.post_title}}</span><span class="bottom_btn"
v-if="item.able">去使用</span><span
class="bottom_btn" v-else>不可使用</span>
<div class="cons_item_bottom">
<span>{{item.post_title}}</span>
<!--<span class="bottom_btn" v-if="item.able">去使用</span>-->
<!--<span class="bottom_btn" v-else>不可使用</span>-->
</div>
</div>
<!--<div class="cons_item">-->
... ... @@ -174,25 +175,15 @@
getConsumeMoney_data: []
},
created: function () {
apiready = function () {
app.order_id = api.pageParam.order_id;
app.getConsumeMoney();
}
this.order_id = localStorage.getItem('order_id');
this.getConsumeMoney();
},
methods: {
goUse: function () {
api.openWin({
name: 'win',
url: '../common/index_win.html',
});
api.sendEvent({
name: 'index0',
extra: {
index: 0
}
});
window.location.href = '../common/index_win.html'
},
getConsumeMoney: function () {
var app = this;
var post = {
order_id: app.order_id
};
... ... @@ -207,7 +198,7 @@
}
loadEnd();
});
},
}
}
})
</script>
\ No newline at end of file
... ...
... ... @@ -155,7 +155,7 @@
<span class="iconfont icon-xiangyou"></span>
</div>
</div>
<div class="detail_item" @click="broSelect">
<div class="detail_item" @click="broSelect" id="broDate">
<div>生日</div>
<div class="detail_item_right">
<div class="detail_item_input">
... ... @@ -240,6 +240,7 @@
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
<script>
var app = new Vue({
el: '#app',
... ... @@ -388,7 +389,6 @@
};
}
}
if (ret) {
api.ajax({
url: baseurl + "user/index/upAvatar",
... ... @@ -418,25 +418,46 @@
// 选择生日
broSelect: function () {
var app = this;
api.openPicker({
type: 'date',
title: '选择出生日期'
}, function (ret, err) {
if (ret) {
app.bro_year = ret.year;
app.bro_month = ret.month;
app.bro_day = ret.day;
app.broth_info = app.bro_year + '-' + add0(app.bro_month) + '-' + add0(app.bro_day);
if (checkDate(app.broth_info, 2)) {
return app.broth_info
} else {
var calendar = new datePicker();
calendar.init({
'trigger': '#broDate', /*按钮选择器,用于触发弹出插件*/
'type': 'date', /*模式:date日期;datetime日期时间;time时间;ym年月;*/
// 'minDate':getTimeDetil(3), /*最小日期*/
'minDate': '', /*最小日期*/
'maxDate': formatDate(new Date(), 1), /*最大日期*/
'onSubmit': function () {/*确认时触发事件*/
console.log(calendar.value);
if (calendar.value) {
app.broth_info = calendar.value;
calendar.onClose()
}else {
toastMsg('出生日期不能比今天晚');
return app.broth_info = app.default_bro
}
} else {
console.log(JSON.stringify(err));
},
'onClose': function () {/*取消时触发事件*/
// api.closeWin();
}
});
})
// api.openPicker({
// type: 'date',
// title: '选择出生日期'
// }, function (ret, err) {
// if (ret) {
// app.bro_year = ret.year;
// app.bro_month = ret.month;
// app.bro_day = ret.day;
// app.broth_info = app.bro_year + '-' + add0(app.bro_month) + '-' + add0(app.bro_day);
// if (checkDate(app.broth_info, 2)) {
// return app.broth_info
// } else {
// toastMsg('出生日期不能比今天晚');
// return app.broth_info = app.default_bro
// }
// } else {
// console.log(JSON.stringify(err));
// }
// });
},
// 选择身高
heightSelect: function () {
... ...
... ... @@ -414,7 +414,7 @@
if(app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_balance', 'my/my_balance', '我的账号', 'my_balance', false, false, false)
openView('my_balance', '../my/my_balance', '我的账号', 'my_balance', false, false, false)
}
},
// 我的消费金
... ... @@ -423,7 +423,7 @@
if(app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_consumption', 'my/my_consumption', '我的消费金', 'my_consumption', false, false, false)
openView('my_consumption', '../my/my_consumption', '我的消费金', 'my_consumption', false, false, false)
}
},
// 我的权益
... ...
... ... @@ -466,7 +466,7 @@
} else {
name = '亲友资料'
}
openView('my_detail', 'my/my_detail', name, 'my_detail', false, {
openView('my_detail', '../my/my_detail', name, 'my_detail', false, {
type: app.type,
rid: app.rid,
name: name
... ...
... ... @@ -217,21 +217,21 @@
},
created: function () {
var app = this;
app.myOrder();
api.addEventListener({
name: 'cancel_order'
}, function (ret, err) {
if (ret) {
app.myOrder();
}
});
api.addEventListener({
name: 're_money'
}, function (ret, err) {
if (ret) {
app.myOrder();
}
});
this.myOrder();
// api.addEventListener({
// name: 'cancel_order'
// }, function (ret, err) {
// if (ret) {
// app.myOrder();
// }
// });
// api.addEventListener({
// name: 're_money'
// }, function (ret, err) {
// if (ret) {
// app.myOrder();
// }
// });
},
methods: {
// 去详情页
... ...