作者 朱振飞

修改

... ... @@ -301,7 +301,6 @@ footer {
align-items: center;
justify-content: center;
margin-right: 0.22rem;
overflow: hidden;
border-radius: 0.1rem;
float: left;
padding: 0.28rem 0 0 0;
... ...
... ... @@ -135,8 +135,8 @@ function fixIos7Bar(t) {
}
function getToken() {
if ($api.getStorage('token')) {
return $api.getStorage('token')
if (localStorage.getItem('token')) {
return localStorage.getItem('token')
} else {
return null;
}
... ... @@ -167,7 +167,6 @@ function isLogin(_this, callback) {
});
}
function loadEnd() {
var ele = document.getElementById('loadStart');
if (ele) {
... ... @@ -178,10 +177,9 @@ function loadEnd() {
}
}
function getcity() {
if ($api.getStorage('city')) {
return $api.getStorage('city')
if (localStorage.getItem('city')) {
return localStorage.getItem('city')
} else {
return null;
}
... ... @@ -355,11 +353,10 @@ function getRequest(type, url, params, header) {
params: params,
headers: header,
}).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 502) {
setTimeout(() => {
window.location.href = '/html/login/login_index.html'
}, 2000);
// setTimeout(() => {
// window.location.href = '../../html/login/login_index.html'
// }, 2000);
// openView('login_index', 'login/login_index', '登录', 'login_index', false, false, false)
} else {
resolve(res)
... ...
... ... @@ -46,21 +46,15 @@
url: ''
},
created: function () {
apiready = function () {
api.setWinAttr({
slidBackEnabled: false
});
app.id = api.pageParam.id;
app.cid = api.pageParam.cid;
app.proCareInfoInfo();
app.cityname = api.pageParam.cityname;
$api.fixStatusBar($api.dom('header'));
app.headerH = $api.offset($api.dom('header')).h;
}
var app = this;
app.id = localStorage.getItem('id');
app.cid = localStorage.getItem('cid');
app.proCareInfoInfo();
app.cityname = localStorage.getItem('cityName');
},
methods: {
proCareInfoInfo: function () {
var app = this;
var post = {
id: app.id
};
... ... @@ -92,6 +86,7 @@
})
},
share: function () {
var app = this;
api.openFrame({
bgColor: 'rgba(0,0,0,0.05)',
name: 'share',
... ...
... ... @@ -21,7 +21,12 @@
.examination_swiper {
background-color: #fff;
}
.swiper-slide{
/*display: none;*/
}
.swiper-slide.swiper-slide-active{
display: block;
}
.examination_swiper .swiper-slide {
width: auto;
/*min-width: 23%;*/
... ... @@ -43,7 +48,6 @@
.examination_box {
flex:1;
height: 100%;
margin: 0.1rem 0;
background-color: #fff;
box-shadow: 0.01rem 0.02rem 0.05rem #C8C6C6;
... ... @@ -72,9 +76,9 @@
display: -webkit-box;
flex-flow: column;
-webkit-flex-flow: column;
-webkit-box-orient: vertical;
overflow-x: hidden;
}
</style>
... ... @@ -109,7 +113,7 @@
</div>
</div>
<div class="examination_content_swiper warp">
<div class="swiper-container ">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in goods">
<div class="swiper_list">
... ... @@ -176,45 +180,32 @@
goods: []
},
created: function () {
var app = this;
this.cid = localStorage.getItem('cid')
this.winTitle = localStorage.getItem('winTitle')
this.getCatInfo3();
this.mySwiper = new Swiper('.examination_swiper .swiper-container', {
slidesPerView: 'auto',
slideToClickedSlide: true,
observer: true,
observeParents: true,
freeMode: true
});
//内容轮播
this.Swiper1 = new Swiper('.examination_content_swiper .swiper-container', {
observer: true,
observeParents: true,
autoHeight: true,
onTransitionEnd: function (swiper) {
app.ind = swiper.activeIndex;
app.mySwiper.slideTo(swiper.activeIndex, 500)
// alert(swiper.activeIndex);
}
});
},
methods: {
changeSwiper: function (index) {
var app = this;
app.Swiper1.slideTo(index, 500);
app.ind = index
},
openDoc: function (id) {
api.openWin({
name: 'care_w',
url: './care_w.html',
pageParam: {
id: id,
cid: app.cid
}
})
var app = this;
// api.openWin({
// name: 'care_w',
// url: './care_w.html',
// pageParam: {
// id: id,
// cid: app.cid
// }
// })
},
getCatInfo3: function () {
var app = this;
var post = {
cid: this.cid
};
... ... @@ -232,9 +223,7 @@
for(var i=0;i<app.goods.length;i++){
nav.push(app.goods[i].name)
}
app.navs = nav;
loadEnd()
} else {
toastMsg(res.data.msg)
... ... @@ -242,6 +231,37 @@
})
}
},
mounted(){
var app = this;
app.mySwiper = new Swiper('.examination_swiper .swiper-container', {
slidesPerView: 'auto',
slideToClickedSlide: true,
observer: true,
observeParents: true,
freeMode: true,
onTransitionEnd: function (swiper) {
}
});
this.$nextTick(function(){
app.Swiper1 = new Swiper('.examination_content_swiper .swiper-container', {
observer: true,
observeParents: true,
autoHeight: true,
onTouchStart: function(swiper){
console.log(swiper)
},
onTransitionEnd: function (swiper) {
console.log(this.activeIndex);
app.ind = swiper.activeIndex;
app.mySwiper.slideTo(swiper.activeIndex, 500)
// alert(swiper.activeIndex);
}
});
})
//内容轮播
}
})
</script>
... ...
... ... @@ -358,12 +358,6 @@
// 隐藏菜单
hideMenu: function () {
app.img_active = !app.img_active;
api.sendEvent({
name: 'hide_menu',
extra: {
img_active: app.img_active
}
});
},
// 严选推荐定位
handleScroll: function () {
... ...
... ... @@ -93,17 +93,12 @@
},
methods: {
care: function (id) {
api.openWin({
name: 'care_w',
url: './care_w.html',
pageParam: {
id: id,
cityname: app.cityname
}
})
localStorage.setItem('id',id);
window.location.href = 'care_f.html';
},
// 获取分类信息
getCatInfo: function () {
var app = this;
var post = {
cid: this.cid
};
... ...
... ... @@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../assets/css/doc.css">
<link rel="stylesheet" href="../../assets/css/pay_form_f.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<style>
<style>
body {
background-color: #f2f2f2;
padding-bottom: 1.5rem;
... ... @@ -328,89 +328,84 @@
},
created: function () {
apiready = function () {
app.getUserIndexInfo();
$api.rmStorage('city');
app.id = api.pageParam.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));
});
// 上传证明事件
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) {
app.pos = 'relative'
} else {
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('请重试')
}
});
var app = this;
app.getUserIndexInfo();
$api.rmStorage('city');
app.id = localStorage.getItem('id');
app.applyInfo();
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;
// });
var client_h = window.innerHeight;
window.addEventListener('resize', function () {
if (window.innerHeight < client_h) {
app.pos = 'relative'
} else {
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('请重试')
// }
// });
// 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)
}
})
}
,
},
}
})
... ...
... ... @@ -13,7 +13,7 @@
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
</head>
<body>
<div id="app">
<div id="app" v-cloak>
<!--<div class="login_loading" v-show="isLogin">-->
<!--<div class="login_img"><img src="../../assets/image/loading.gif" alt=""></div>-->
<!--<span>正在登录...</span>-->
... ... @@ -136,9 +136,9 @@
'XX-Device-Type': getDevice()
};
getRequest('post', 'home/index/checkSMS', post, header).then(function (res) {
console.log(res)
alert(JSON.stringify(res))
if (res.data.code == 1) {
$api.setStorage('token', res.data.data.token);
localStorage.setItem('token', res.data.data.token);
window.location.href = '../index/index_f.html'
} else {
toastMsg(res.data.msg)
... ... @@ -168,11 +168,8 @@
getRequest('post', 'home/index/loginByPass', post, header).then(function (res) {
// alert(JSON.stringify(res.data.data.token));
if (res.data.code == 1) {
$api.setStorage('token', res.data.data.token);
api.openWin({
name: 'index_win',
url: '../common/index_win.html',
});
localStorage.setItem('token', res.data.data.token);
window.location.href = '../index/index_f.html'
} else {
toastMsg(res.data.msg)
}
... ...
... ... @@ -145,7 +145,7 @@
</div>
<div class="cons_item_bottom" v-else>
<span>{{item.post_title}}</span>
<span class="bottom_btn">不可使用</span>
<!--<span class="bottom_btn">不可使用</span>-->
</div>
</div>
<div class="save_btn" @click="noUse">不使用消费金</div>
... ...
... ... @@ -482,6 +482,7 @@
getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function(res) {
// alert(JSON.stringify(res));
if(res.data.code == 1) {
res.data.data.avatar = 'http://wx.cijievip.com'+res.data.data.avatar
app.user_type = res.data.data;
} else {}
loadEnd()
... ... @@ -489,7 +490,6 @@
}, //底部菜单跳转
changeTab(index){
var url = index==0?'../index/index_f.html':index == 1?'../strict/strict_f.html':'my_f.html'
console.log(url)
window.location.href = url
}
... ...
... ... @@ -306,28 +306,25 @@
</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="../../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>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<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);
new FastClick(document.body);
var app = new Vue({
el: "#app",
... ... @@ -349,6 +346,7 @@
},
created: function () {
this.crowd(); //第三栏
alert(1)
},
mounted: function() {
window.addEventListener('scroll', this.handleScroll)
... ... @@ -418,12 +416,13 @@
},
// 获取详情
crowd: function() {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/crowd', null, header).then(function(res) {
// alert(JSON.stringify(res));
alert(JSON.stringify(res));
if(res.data.code == 1) {
app.banner = res.data.data.banner;
app.state = res.data.data.state;
... ...