作者 朱振飞

修改流程

... ... @@ -176,21 +176,10 @@ var app = new Vue({
};
getRequest('post', 'user/index/getOrg', null, heder).then(function (res) {
if (res.data.code == 1) {
for (var i=0 ;i< res.data.data.length;i++) {
app.org_list.push({
value: res.data.data[i].id,
label: res.data.data[i].name
})
}
loadEnd()
}
})
},
// 选择类别
choose_item: function () {
weui.picker(app.Illness_list, {
onChange: function (result) {
... ...
... ... @@ -15,40 +15,46 @@ function openWin(winName, url) {
}
function openView(fmName, fmUrl, winTitle, winName, winUrl, fmParams, winParams) {
var options = {
name: '',
url: '',
pageParam: {
winTitle: '',
win: {},
fmName: '',
fmUrl: '',
fm: {},
},
slidBackEnabled: false
};
options.pageParam.fmName = fmName;
options.pageParam.fmUrl = 'widget://html/' + fmUrl + '.html';
if (winName) {
options.name = winName;
} else {
options.name = fmName;
}
if (winUrl) {
options.url = 'widget://html/' + winUrl + '.html';
} else {
options.url = 'widget://html/common/win/win.html';
}
options.pageParam.winTitle = winTitle || '';
options.pageParam.winTitle = winTitle;
if (winParams != undefined && winParams != null && winParams != {} && winParams != 'undefined') {
options.pageParam.win = JSON.stringify(winParams);
}
if (fmParams != undefined && fmParams != null && fmParams != {} && fmParams != 'undefined') {
options.pageParam.fm = JSON.stringify(fmParams);
if(winParams){
for (var item in winParams) {
localStorage.setItem(item,winParams[item])
}
}
api.openWin(options);
window.location.href = winName+'.html'
// var options = {
// name: '',
// url: '',
// pageParam: {
// winTitle: '',
// win: {},
// fmName: '',
// fmUrl: '',
// fm: {},
// },
// slidBackEnabled: false
// };
// options.pageParam.fmName = fmName;
// options.pageParam.fmUrl = 'widget://html/' + fmUrl + '.html';
// if (winName) {
// options.name = winName;
// } else {
// options.name = fmName;
// }
// if (winUrl) {
// options.url = 'widget://html/' + winUrl + '.html';
// } else {
// options.url = 'widget://html/common/win/win.html';
// }
// options.pageParam.winTitle = winTitle || '';
// options.pageParam.winTitle = winTitle;
//
// if (winParams != undefined && winParams != null && winParams != {} && winParams != 'undefined') {
// options.pageParam.win = JSON.stringify(winParams);
// }
// if (fmParams != undefined && fmParams != null && fmParams != {} && fmParams != 'undefined') {
// options.pageParam.fm = JSON.stringify(fmParams);
// }
// api.openWin(options);
}
function closeWindow(winName) {
... ... @@ -59,7 +65,7 @@ function closeWindow(winName) {
function getHeight(id) {
return document.getElementById(id).offsetHeight;
}
function openFm(fmName, url) {
var posY = $api.offset($api.dom("header")).h;
... ...
... ... @@ -84,41 +84,52 @@
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="nurse_banner" :style="{backgroundImage:'url(' + banner + ')'}">
<!--<div class="nurse_text">{{post_title}}</div>-->
</div>
<div class="img_p">
<div v-html="price_table"></div>
</div>
<div class="img_p">
<div v-html="problems"></div>
</div>
<div class="img_p">
<div class="care_title" @click="imgshow=!imgshow"><span>— 服务详情 —</span><span class="iconfont "
:class="{'icon-ziyuan':imgshow,'icon-shangla':!imgshow}"></span>
<header id="header">
<div class="index_header">
<div class="close_left" onclick="closeWindow()"><span class="iconfont icon-fanhui"></span></div>
<span>{{post_title}}</span>
<span class="iconfont icon-fenxiang-tianchong" ></span>
</div>
<div v-html="service_info" v-show="imgshow"></div>
</div>
<div class="img_p">
<div class="care_title" @click="img_show=!img_show"><span>— 服务须知 —</span>
<span class="iconfont" :class="{'icon-ziyuan':img_show,'icon-shangla':!img_show}"></span>
</header>
<div class="warp">
<div class="nurse_banner" :style="{backgroundImage:'url(' + banner + ')'}">
<!--<div class="nurse_text">{{post_title}}</div>-->
</div>
</div>
<div v-show="!img_show">
<div class="img_p">
<div v-html="service_notice"></div>
<div v-html="price_table"></div>
</div>
<div class="img_p">
<div v-html="problems"></div>
</div>
<div class="img_p">
<div class="care_title" @click="imgshow=!imgshow"><span>— 服务详情 —</span><span class="iconfont "
:class="{'icon-ziyuan':imgshow,'icon-shangla':!imgshow}"></span>
</div>
<div v-html="service_info" v-show="imgshow"></div>
</div>
<div class="img_p">
<div class="care_title" @click="img_show=!img_show"><span>— 服务须知 —</span>
<span class="iconfont" :class="{'icon-ziyuan':img_show,'icon-shangla':!img_show}"></span>
</div>
</div>
<div v-show="!img_show">
<div class="img_p">
<div v-html="service_notice"></div>
</div>
</div>
<div class="img_p">
<div v-html="advantage"></div>
</div>
<div class="img_p">
<div v-html="service_step"></div>
</div>
<div class="care_faq" @click="question">
<span>常见问题</span><span class="iconfont icon-xiangyou"></span>
</div>
</div>
<div class="img_p">
<div v-html="advantage"></div>
</div>
<div class="img_p">
<div v-html="service_step"></div>
</div>
<div class="care_faq" @click="question">
<span>常见问题</span><span class="iconfont icon-xiangyou"></span>
</div>
<footer class="doc_footer" id="footer">
<div class="doc_left"><span class="rmb"></span><span class="doc_price">{{price?price:0}}</span><span
class="doc_qi"></span>
... ... @@ -162,19 +173,19 @@
userId: '',
},
created: function () {
apiready = function () {
var app = this
// alert('预约' + api.pageParam.id)
app.cid = api.pageParam.cid;
app.id = api.pageParam.id;
app.care_name = api.pageParam.care_name;
app.cityname = api.pageParam.cityname;
app.proCareInfoInfo();
app.getUserIndexInfo();
}
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();
},
methods: {
// 去预约
appointment: function () {
var app = this
if (app.cid == 5 || app.cid == 7 || app.cid == 8 || app.cid == 10) {
openView('doc_package_f', 'index/doc_package_f', app.care_name, 'doc_package_f', false, {
id: app.id,
... ... @@ -185,23 +196,24 @@
openView('pay_form_f', 'index/pay_form_f', app.care_name, 'pay_form_f', false, {
id: app.id,
cityname: app.cityname,
cid: app.cid,
cid: app.cid
})
}
},
// 去常见问题
question: function () {
var app = this
openView('my_que', 'my/my_que', '常见问题', 'my_que', false, {
id: app.id
})
},
// 获取详情
proCareInfoInfo: function () {
var app = this
var post = {
id: app.id
};
getRequest('post', 'portal/Goods/proCareInfo', post, null).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 1) {
app.banner = res.data.data.banner;
app.post_title = res.data.data.post_title;
... ... @@ -219,6 +231,7 @@
},
// 获取个人的基本信息
getUserIndexInfo: function () {
var app = this
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -233,9 +246,10 @@
},
// 打开客服
openSever: function () {
var app = this
api.openWin({
name: 'cs_win',
url: '../common/cs_win.html',
url: '../common/cs_win.html'
});
},
}
... ...
... ... @@ -28,8 +28,6 @@
align-items: center;
justify-content: center;
}
.doc_content_img img {
width: 100%;
}
... ... @@ -37,19 +35,29 @@
<body>
<div id="loadStart"></div>
<div id="app">
<div class="nurse_banner" :style="{backgroundImage:'url(' + banner + ')'}">
<header id="header">
<div class="index_header">
<span class="iconfont icon-fanhui" onclick="closeWindow()"></span>
<span>家庭医生</span>
<span class="iconfont icon-fenxiang-tianchong" ></span>
</div>
</header>
<div class="warp">
<div class="nurse_banner" :style="{backgroundImage:'url(' + banner + ')'}">
<!--<div class="nurse_text">{{name}}</div>-->
</div>
<!--<div class="nurse_banner" style='background-image: url("../../assets/image/nurse.png")'></div>-->
<!--<img class="doc_content_img" src="../../assets/image/dc_02.jpg"/>-->
<div class="doc_box">
<div v-html="price_table" class="doc_content_img"></div>
<div v-html="problems" class="doc_content_img"></div>
<div v-html="service_info" class="doc_content_img"></div>
<div v-html="advantage" class="doc_content_img"></div>
<div v-html="service_notice" class="doc_content_img"></div>
<div v-html="service_step" class="doc_content_img"></div>
</div>
</div>
<!--<div class="nurse_banner" style='background-image: url("../../assets/image/nurse.png")'></div>-->
<!--<img class="doc_content_img" src="../../assets/image/dc_02.jpg"/>-->
<div class="doc_box">
<div v-html="price_table" class="doc_content_img"></div>
<div v-html="problems" class="doc_content_img"></div>
<div v-html="service_info" class="doc_content_img"></div>
<div v-html="advantage" class="doc_content_img"></div>
<div v-html="service_notice" class="doc_content_img"></div>
<div v-html="service_step" class="doc_content_img"></div>
</div>
<footer class="doc_footer" id="footer">
<div class="doc_left">
<span class="rmb"></span>
... ... @@ -92,14 +100,15 @@
userId:''
},
created: function () {
apiready = function () {
app.cid = api.pageParam.cid;
app.getDoctor();
app.getUserIndexInfo();
}
// apiready = function () {
this.cid = localStorage.getItem('cid');
this.getDoctor();
this.getUserIndexInfo();
// }
},
methods: {
getDoctor: function () {
var that = this
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -107,16 +116,16 @@
getRequest('post', 'portal/Goods/getDoctor', null, header).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
app.banner = res.data.data.banner;
app.price_table = res.data.data.price_table;
app.problems = res.data.data.problems;
app.service_notice = res.data.data.service_notice;
app.advantage = res.data.data.advantage;
app.service_step = res.data.data.service_step;
app.post_title = res.data.data.post_title;
app.service_info = res.data.data.service_info;
app.id = res.data.data.id;
app.price = res.data.data.price;
that.banner = res.data.data.banner;
that.price_table = res.data.data.price_table;
that.problems = res.data.data.problems;
that.service_notice = res.data.data.service_notice;
that.advantage = res.data.data.advantage;
that.service_step = res.data.data.service_step;
that.post_title = res.data.data.post_title;
that.service_info = res.data.data.service_info;
that.id = res.data.data.id;
that.price = res.data.data.price;
loadEnd();
} else {
toastMsg(res.data.msg)
... ... @@ -169,6 +178,7 @@
},
// 获取个人的基本信息
getUserIndexInfo: function () {
var app = this
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -183,6 +193,7 @@
},
// 获取客服token
getRongYunToken: function () {
var app = this
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ...
... ... @@ -21,6 +21,9 @@
<span class="iconfont icon-fenxiang-tianchong" @click="share"></span>
</div>
</header>
<div class="warp">
</div>
</div>
</body>
... ... @@ -43,7 +46,7 @@
cid: ''
},
created: function () {
apiready = function () {
// apiready = function () {
app.cid = api.pageParam.cid;
$api.fixStatusBar($api.dom('header'));
api.setStatusBarStyle({
... ... @@ -65,7 +68,7 @@
cityname: app.cityname
}
});
}
// }
},
methods: {
share: function () {
... ...
... ... @@ -42,9 +42,18 @@
}
.examination_box {
flex:1;
height: 100%;
margin: 0.1rem 0;
background-color: #fff;
box-shadow: 0.01rem 0.02rem 0.05rem #C8C6C6;
display: flex;
display: -webkit-flex;
display: -webkit-box;
flex-flow: column;
-webkit-flex-flow: column;
-webkit-box-orient: vertical;
overflow-x: hidden;
}
.old_price {
... ... @@ -58,54 +67,72 @@
/*padding: 0.28rem 0.25rem;*/
}
.warp{
width: 100%;
height: 100%;
}
svg{
width: 100%;
height: 100%;
display: flex;
display: -webkit-flex;
display: -webkit-box;
flex-flow: column;
-webkit-flex-flow: column;
-webkit-box-orient: vertical;
overflow-x: hidden;
}
</style>
</head>
<body>
<!-- 背景充满 -->
<div id="loadStart"></div>
<div id="app" class="warp" >
<!-- {{JSON.stringify(banner)}} -->
<div id="app">
<header id="header">
<div class="index_header white_bg">
<div class="close_left" onclick="closeWindow()">
<span class="iconfont icon-fanhui"></span>
</div>
<div class="win_mid">{{winTitle}}</div>
<div></div>
</div>
</header>
<div class="nurse_banner" :style="{backgroundImage:'url(' + banner + ')'}">
<div class="nurse_text">{{name}}</div>
</div>
<div class="examination_box">
<div class="examination_swiper">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in navs">
<span v-text="item" :class="{'examination_active':index==ind}"
@click="changeSwiper(index)"></span>
<div class="warp">
<!-- {{JSON.stringify(banner)}} -->
<div class="examination_box">
<div class="examination_swiper">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in navs">
<span v-text="item" :class="{'examination_active':index==ind}" @click="changeSwiper(index)"></span>
</div>
</div>
</div>
</div>
</div>
<div class="examination_content_swiper">
<div class="swiper-container ">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in goods">
<div class="swiper_list">
<div class="swiper_item nodata" v-if="item.goods.length==0">暂无信息</div>
<div class="swiper_item" v-else @click="openDoc(i.good_id)"
v-for="(i,iindex) in item.goods">
<div class="swiper_item_img"><img :src="i.img" alt=""></div>
<div class="swiper_item_right">
<div class="swiper_item_title">{{i.post_title}}</div>
<div class="swiper_item_content">{{i.other_title}}</div>
<div class="swiper_item_type">
<div class="swiper_item_type1" v-for="(j,item2_index) in i.tag">
<div class="icon_img"><img :src="j.url" alt=""></div>
<span>{{j.text}}</span>
</div>
<div class="examination_content_swiper warp">
<div class="swiper-container ">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in goods">
<div class="swiper_list">
<div class="swiper_item nodata" v-if="item.goods.length==0">暂无信息</div>
<div class="swiper_item" v-else @click="openDoc(i.good_id)" v-for="(i,iindex) in item.goods">
<div class="swiper_item_img">
<img :src="i.img" alt="">
</div>
<div class="swiper_item_money"><span>¥{{i.real_price?i.real_price:0}}</span><span
class="old_price">¥{{i.price?i.price:0}}</span>
<div class="swiper_item_right">
<div class="swiper_item_title">{{i.post_title}}</div>
<div class="swiper_item_content">{{i.other_title}}</div>
<div class="swiper_item_type">
<div class="swiper_item_type1" v-for="(j,item2_index) in i.tag">
<div class="icon_img">
<img :src="j.url" alt="">
</div>
<span>{{j.text}}</span>
</div>
</div>
<div class="swiper_item_money">
<span>¥{{i.real_price?i.real_price:0}}</span>
<span class="old_price">¥{{i.price?i.price:0}}</span>
</div>
</div>
</div>
</div>
... ... @@ -116,6 +143,7 @@
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
... ... @@ -149,6 +177,7 @@
},
created: function () {
this.cid = localStorage.getItem('cid')
this.winTitle = localStorage.getItem('winTitle')
this.getCatInfo3();
this.mySwiper = new Swiper('.examination_swiper .swiper-container', {
slidesPerView: 'auto',
... ...
... ... @@ -439,14 +439,17 @@
},
// 轮播图跳转详情
care: function (id, care_name) {
api.openWin({
name: 'care_w',
url: './care_w.html',
pageParam: {
id: id,
care_name: care_name
}
})
window.location.href = 'care_f.html';
localStorage.setItem('id',id);
localStorage.setItem('care_name',care_name);
// api.openWin({
// name: 'care_w',
// url: './care_w.html',
// pageParam: {
// id: id,
// care_name: care_name
// }
// })
},
getUserIndexInfo: function () {
var header = {
... ... @@ -501,7 +504,7 @@
// });
break;
case 5:
url = 'doc_home_w'
url = 'doc_home_f'
break;
case 6:
url = 'disease_f'
... ... @@ -536,7 +539,7 @@
// });
break;
case 10:
url = 'tral_w'
url = 'tral_f'
// api.openWin({
// name: 'tral_w',
// url: './tral_w.html',
... ...
... ... @@ -16,7 +16,7 @@
<style>
body {
background-color: #f5f5f5;
padding-bottom: 75px;
padding-bottom: 15px;
margin: 0;
/*width: 350px;*/
}
... ... @@ -204,10 +204,12 @@
top: 0;
left: 0;
z-index: 5;
background: none;
color: #fff;
line-height: 44px;
padding: 10px 20px 0 20px;
padding: 0 15px;
justify-content: space-between;
box-sizing: border-box;
background-color: rgba(219,178,95,1);
}
.index_on {
... ... @@ -305,15 +307,18 @@
.tral_fee_box{
background-color: #fff;
}
.swiper-container{
margin-top: 44px;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="health_swiper">
<header id="header" class="border0">
<header id="header" class="border0 index_header">
<div :class="['index_header',color_change?'index_on':'','border0']">
<span class="iconfont icon-fanhui" @click="api.closeWin()"></span>
<span class="iconfont icon-fanhui" onclick="closeWindow()"></span>
<span>健康旅游</span>
<span class="iconfont icon-fenxiang-tianchong" @click="share"></span>
</div>
... ... @@ -459,33 +464,34 @@
cid: ''
},
created: function () {
apiready = function () {
app.cid = api.pageParam.cid;
app.health_swiper = new Swiper('.swiper-container', {
effect: 'fade',
fade: {
crossFade: true,
},
autoplay: 3000,
pagination: '.swiper-pagination',
paginationClickable: true,
observer: true,
observeParents: true,
});
app.travel()
}
var app = this;
app.cid = localStorage.getItem('cid');
app.health_swiper = new Swiper('.swiper-container', {
effect: 'fade',
fade: {
crossFade: true,
},
autoplay: 3000,
pagination: '.swiper-pagination',
paginationClickable: true,
observer: true,
observeParents: true,
});
app.travel()
},
mounted: function () {
window.addEventListener('scroll', this.handleScroll)
},
methods: {
appointment: function () {
var app = this;
openView('doc_package_f', 'index/doc_package_f', '旅游套餐', 'doc_package_f', false, {
cid: app.cid,
id: app.id
})
},
travel: function () {
var app = this
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -529,6 +535,7 @@
});
},
handleScroll: function () {
var app = this
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
var offsetTop = document.querySelector('#main').offsetTop;
if (scrollTop > offsetTop) {
... ... @@ -538,6 +545,7 @@
}
},
show: function (index) {
var app = this
if (app.body_show == index) {
app.body_show = -1
} else {
... ...
... ... @@ -49,6 +49,7 @@
.detail_item_right {
display: flex;
align-items: center;
position: relative;
}
.detail_item_right .iconfont {
... ... @@ -90,6 +91,14 @@
position: fixed;
/*margin: 0.3rem 0 0 0;*/
}
.img_input{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
}
</style>
</head>
... ... @@ -99,11 +108,12 @@
<div class="detail_top">
<div class="detail_item">
<div>头像</div>
<div class="detail_item_right" @click="popupVisible_head_img=true">
<div class="detail_item_right" >
<span class="detail_item_img padding0">
<img :src="head_img?head_img:'../../assets/image/default_img.png'" alt="">
</span>
<span class="iconfont icon-xiangyou"></span>
<input type="file" @change="takePhotos" accept="image/jpeg,image/x-png,image/gif" id="" value="" class="img_input">
</div>
<mt-popup v-model="popupVisible_head_img" position="bottom">
<ul class="moreoul">
... ... @@ -276,37 +286,37 @@
user_type_name: ''
},
created: function () {
apiready = function () {
for (var i = 0; i < 300; i++) {
app.weight_list.push({
"label": i + 'kg',
"value": i,
})
}
for (var j = 50; j < 300; j++) {
app.height_list.push(
{
"label": j + 'cm',
"value": j,
}
)
}
app.user_type_name = api.pageParam.name;
app.rid = api.pageParam.rid;
// alert(app.rid)
app.type = api.pageParam.type;
if (app.type == 0) {
app.getUserinfo();
}
app.getJob();
app.getCulture();
app.getMedical();
app.getRelationship();
var app = this;
for (var i = 0; i < 300; i++) {
app.weight_list.push({
"label": i + 'kg',
"value": i,
})
}
for (var j = 50; j < 300; j++) {
app.height_list.push(
{
"label": j + 'cm',
"value": j,
}
)
}
app.user_type_name = localStorage.getItem('name');
app.rid = localStorage.getItem('rid');
// alert(app.rid)
app.type = localStorage.getItem('type');
if (app.type == 0) {
app.getUserinfo();
}
app.getJob();
app.getCulture();
app.getMedical();
app.getRelationship();
},
methods: {
// 获取个人信息
getUserinfo: function () {
var app = this;
var post = {
rid: app.rid
};
... ... @@ -318,7 +328,7 @@
if (res.data.code == 1) {
// alert(JSON.stringify(res));
app.user_info = res.data.data;
app.head_img = app.user_info.avatar;
app.head_img = 'http://wx.cijievip.com/'+app.user_info.avatar;
app.name = app.user_info.name ? app.user_info.name : '';
app.user_info.sex == 1 ? app.checked_male = true : app.checked_male = false;
app.phone = app.user_info.mobile;
... ... @@ -342,48 +352,72 @@
})
},
// 选择头像
takePhotos: function (type) {
api.getPicture({
sourceType: type,
encodingType: 'jpg',
mediaValue: 'pic',
destinationType: 'url',
allowEdit: true,
quality: 50,
targetWidth: 100,
targetHeight: 100,
saveToPhotoAlbum: false
}, function (ret, err) {
if (ret) {
api.ajax({
url: baseurl + "user/index/upAvatar",
method: 'post',
data: {
files: {
file: ret.data
}
},
takePhotos: function () {
var app = this;
var file = e.target.files[0];e
var imgSize=file.size/1024;
if(imgSize>200){
alert('请上传大小不要超过200KB的图片')
}else{
var reader = new FileReader();
reader.readAsDataURL(file); // 读出 base64
reader.onloadend = function () {
// 图片的 base64 格式, 可以直接当成 img 的 src 属性值
var dataURL = reader.result;
// 下面逻辑处理
$.ajax({
type:"post",
url:baseurl + "user/index/upAvatar",
headers: {
"XX-Device-Type": getDevice(),
"XX-Token": getToken()
},
async:true,
data:{
avatar:dataURL,
avatar_wx:1,
token:token,
uid:uid
},
success:function(e){
that.avatar=dataURL;
alert('修改成功');
$(".tsk").show().delay(1500).hide(0);
}
}, function (res, err) {
// alert(JSON.stringify(res));
if (res) {
app.head_img = res.data.url
} else {
});
};
}
}
if (ret) {
api.ajax({
url: baseurl + "user/index/upAvatar",
method: 'post',
data: {
files: {
file: ret.data
}
});
} else {
// alert(JSON.stringify(err));
toastMsg('取消')
}
});
app.popupVisible_head_img = false;
},
headers: {
"XX-Device-Type": getDevice(),
"XX-Token": getToken()
}
}, function (res, err) {
// alert(JSON.stringify(res));
if (res) {
app.head_img = res.data.url
} else {
}
});
} else {
// alert(JSON.stringify(err));
toastMsg('取消')
}
},
// 选择生日
broSelect: function () {
var app = this;
api.openPicker({
type: 'date',
title: '选择出生日期'
... ... @@ -406,6 +440,7 @@
},
// 选择身高
heightSelect: function () {
var app = this;
weui.picker(app.height_list, {
defaultValue: [170],
onChange: function (result) {
... ... @@ -417,6 +452,7 @@
},
// 选择体重
weightSelect: function () {
var app = this;
weui.picker(app.weight_list,
{
defaultValue: [50],
... ... @@ -430,6 +466,7 @@
},
// 选择婚姻状况
getMarry: function () {
var app = this;
weui.picker(app.merry_list, {
onChange: function (result) {
},
... ... @@ -441,6 +478,7 @@
// 获取文化程度
getCulture: function () {
var app = this;
var header = {
'XX-Device-Type': getDevice(),
'XX-Token': getToken()
... ... @@ -462,6 +500,7 @@
},
// 选择文化程度
educations: function () {
var app = this;
weui.picker(app.getCulture_data, {
onChange: function (result) {
},
... ... @@ -473,6 +512,7 @@
},
// 获取职业
getJob: function () {
var app = this;
var header = {
'XX-Device-Type': getDevice(),
'XX-Token': getToken()
... ... @@ -495,6 +535,7 @@
},
// 选择职业
getPosition: function () {
var app = this;
weui.picker(app.position_list, {
onChange: function (result) {
},
... ... @@ -506,6 +547,7 @@
},
// 获取医保类型数据
getMedical: function () {
var app = this;
var header = {
'XX-Device-Type': getDevice(),
'XX-Token': getToken()
... ... @@ -527,6 +569,7 @@
},
// 选择医保类型
doctors: function () {
var app = this;
weui.picker(app.getMedical_data,
{
onChange: function (result) {
... ... @@ -540,6 +583,7 @@
// 获取亲友关系
getRelationship: function () {
var app = this;
var header = {
'XX-Device-Type': getDevice(),
'XX-Token': getToken()
... ... @@ -560,6 +604,7 @@
},
// 选择亲友关系
relation_fun: function () {
var app = this;
weui.picker(app.relationShip,
{
onChange: function (result) {
... ... @@ -572,6 +617,7 @@
},
// 添加亲友
newRecord: function () {
var app = this;
var post = {
rid: app.rid,
relation: app.relation_value,
... ...
... ... @@ -333,6 +333,7 @@
methods: {
// 个人资料
my_detail: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
... ... @@ -344,36 +345,45 @@
},
// 设置
set: function() {
openView('my_set', 'my/my_set', '设置', 'my_set', false, false, false)
window.location.href = 'my_set.html'
// openView('my_set', 'my/my_set', '设置', 'my_set', false, false, false)
},
// 常见问题
question: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_que', 'my/my_que', '常见问题', 'my_que', false, false, false)
window.location.href = 'my_que.html'
// openView('my_que', 'my/my_que', '常见问题', 'my_que', false, false, false)
}
},
// 邀友有赚
friend: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_invite', 'my/my_invite', '邀请好友', 'my_invite', false, {
invite_type: 0
})
localStorage.setItem('invite_type','0');
window.location.href = 'my_invite.html';
// openView('my_invite', 'my/my_invite', '邀请好友', 'my_invite', false, {
// invite_type: 0
// })
}
},
// 我的订单
goPay: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
window.location.href = 'my_orderlist.html';
// openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
}
},
// 我的消息
my_news: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
... ... @@ -384,6 +394,7 @@
},
// 有无消息判断
getNews: function() {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -399,6 +410,7 @@
},
// 我的账号
my_balance: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
... ... @@ -407,6 +419,7 @@
},
// 我的消费金
my_consumption: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
... ... @@ -415,6 +428,7 @@
},
// 我的权益
my_power: function() {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -424,7 +438,8 @@
} else {
getRequest('post', 'user/index/myRights', null, header).then(function(res) {
if(res.data.code == 1) {
openView('my_benefit', 'my/my_benefit', '我的权益', 'my_benefit', false, false, false)
window.location.href = 'my_benefit.html'
// openView('my_benefit', 'my/my_benefit', '我的权益', 'my_benefit', false, false, false)
} else {
toastMsg(res.data.msg);
}
... ... @@ -433,28 +448,33 @@
},
// 健康档案
go_hearth: function() {
var app = this;
if(app.user_type == '') {
toastMsg('未登录')
} else {
api.openFrame({
name: 'my_health',
url: './my_health.html',
// bounces: true,
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto',
},
pageParam: {
rid: 0,
type: 0
}
});
localStorage.setItem('rid','0');
localStorage.setItem('Htype','0');
window.location.href = 'my_health.html';
// api.openFrame({
// name: 'my_health',
// url: './my_health.html',
// // bounces: true,
// rect: {
// x: 0,
// y: 0,
// w: 'auto',
// h: 'auto',
// },
// pageParam: {
// rid: 0,
// type: 0
// }
// });
}
},
// 获取个人信息
getUserIndexInfo: function() {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ...
... ... @@ -426,29 +426,29 @@
// left_opacity: 1
},
created: function () {
apiready = function () {
app.rid = api.pageParam.rid;
app.type = api.pageParam.type ? api.pageParam.type : 0;
app.record();
app.getHeathlyRecord();
api.addEventListener({
name: 'changeInfo'
}, function (ret, err) {
app.record();
app.getHeathlyRecord();
});
api.addEventListener({
name: 'add_success'
}, function (ret, err) {
app.record();
app.getHeathlyRecord();
});
api.addEventListener({
name: 'showlist'
}, function (ret, err) {
app.img_active = ret.value.img_active;
});
}
var app = this ;
app.rid = localStorage.getItem('rid');
var Htype = localStorage.getItem('Htype');
app.type = Htype ? Htype : 0;
app.record();
app.getHeathlyRecord();
// api.addEventListener({
// name: 'changeInfo'
// }, function (ret, err) {
// app.record();
// app.getHeathlyRecord();
// });
// api.addEventListener({
// name: 'add_success'
// }, function (ret, err) {
// app.record();
// app.getHeathlyRecord();
// });
// api.addEventListener({
// name: 'showlist'
// }, function (ret, err) {
// app.img_active = ret.value.img_active;
// });
},
methods: {
// close: function () {
... ... @@ -459,6 +459,7 @@
// },
// 个人资料
openPerson: function () {
var app = this;
var name = '';
if (app.rid == 0) {
name = '个人资料'
... ... @@ -473,6 +474,7 @@
},
// 添加亲友
addPerson: function () {
var app = this;
app.img_active = false;
api.sendEvent({
name: 'hidelist',
... ... @@ -484,6 +486,7 @@
},
// 健康数据
openData: function () {
var app = this;
app.img_active = false;
api.sendEvent({
name: 'hidelist',
... ... @@ -495,16 +498,19 @@
},
// 健康史
openHistory: function () {
var app = this;
app.img_active = false;
openView('my_history', 'my/my_history', '健康史', 'my_history', false, {rid: app.rid});
},
// 亲友档案
openFriend: function () {
var app = this;
app.img_active = false;
openView('my_fri', 'my/my_fri', '亲友健康档案', 'my_fri', false, false, false);
},
// 获取个人档案完善情况
record: function () {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken(),
... ... @@ -535,6 +541,7 @@
},
// 健康记录详情页面
openLife: function (r_type, id, img, name) {
var app = this;
switch (r_type) {
case '1':
case '2':
... ... @@ -572,6 +579,7 @@
},
// 获取全生命周期记录
getHeathlyRecord: function () {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken(),
... ...
... ... @@ -126,20 +126,15 @@
rid: '',
},
created: function () {
apiready = function () {
app.rid = api.pageParam.rid;
// alert(app.rid);
app.question();
api.addEventListener({
name: 'history'
}, function (ret, err) {
app.question()
});
}
var app = this;
app.rid = localStorage.getItem('rid');
// alert(app.rid);
app.question();
},
methods: {
// 打开详情
openHome: function (name, index) {
var app = this;
openView('history_detail', 'my/history_detail', name, 'history_detail', false, {
rid: app.rid,
id: index
... ... @@ -147,6 +142,7 @@
},
// 获取完善情况
question: function () {
var app = this;
var header = {
'XX-Device-Type': getDevice(),
'XX-Token': getToken()
... ...
... ... @@ -167,19 +167,19 @@
invite_type: ''
},
created: function () {
apiready = function () {
app.getUserIndexInfo();
app.invite_type = api.pageParam.invite_type;
if (app.invite_type == 0) {
app.myInvited();
} else {
app.myInvited2();
}
var app = this;
app.getUserIndexInfo();
app.invite_type = localStorage.getItem('invite_type');
if (app.invite_type == 0) {
app.myInvited();
} else {
app.myInvited2();
}
},
methods: {
// 邀友有转
friend: function () {
var app = this;
api.openFrame({
bgColor: 'rgba(0,0,0,0.05)',
name: 'invited',
... ...
... ... @@ -216,27 +216,27 @@
}
},
created: function () {
apiready = function () {
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();
}
});
}
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();
}
});
},
methods: {
// 去详情页
go_detail: function (order_id, order_type, goods_type) {
var app = this;
// alert(goods_type);
if (goods_type == 2) {
openView('my_order', 'my/my_order', '订单详情', 'my_order', false, {
... ... @@ -264,24 +264,28 @@
}
},
all_show: function () {
var app = this;
app.all = true;
app.paying = false;
app.pay = false;
app.paied = false;
},
paying_show: function () {
var app = this;
app.all = false;
app.paying = true;
app.pay = false;
app.paied = false;
},
pay_show: function () {
var app = this;
app.pay = true;
app.all = false;
app.paying = false;
app.paied = false;
},
paied_show: function () {
var app = this;
app.pay = false;
app.all = false;
app.paying = false;
... ... @@ -289,6 +293,7 @@
},
// 获取我的订单列表
myOrder: function () {
var app = this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ...
... ... @@ -13,7 +13,6 @@ function apiadapter(payload) {
if (moduleName === 'db') {
if (method === 'openDatabase') {
callback(cbId, { status: true }, null, true);
return;
}
... ...