作者 朱振飞

术后修改

... ... @@ -43,7 +43,7 @@ App({
wx.showNavigationBarLoading()
wx.showLoading({
title: '加载中',
})
})
var promise = new Promise((resolve, reject) => {
let that = this;
let postData = data;
... ... @@ -151,7 +151,7 @@ App({
let params = {
code: res.code
}
that.post(url, params).then((res) => {
that.post(url, params ).then((res) => {
let url = 'index/setStatisticsVisitorLog';
let params = {
'doctor_id': that.globalData.doctorid,
... ...
{
"pages": [
"pages/start/start",
"pages/index/index",
"pages/aboutme/aboutme",
"pages/addrecord/addrecord",
"pages/addfile/addfile",
"pages/introduce/introduce",
"pages/my/my",
"pages/opinion/opinion",
"pages/record/record",
"pages/normal/normal",
"pages/file_manage/file_manage",
"pages/article/article",
"pages/mold/mold",
"pages/line/line",
"pages/article_detail/article_detail",
"pages/ence_push/ence_push",
"pages/map/map",
"pages/editfile/editfile",
"pages/editrecord/editrecord",
"pages/agreement/agreement"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#3AA0EA",
"navigationBarTitleText": "术后小程序",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
},
"tabBar": {
"color": "#A1A1A1",
"selectedColor": "#1CB9FA",
"list": [
{
"pagePath": "pages/index/index",
"text": "血项测评",
"iconPath": "img/x2.png",
"selectedIconPath": "img/x1.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "img/w2.png",
"selectedIconPath": "img/w1.png"
}
]
}
"pages": [
"pages/start/start",
"pages/index/index",
"pages/aboutme/aboutme",
"pages/addrecord/addrecord",
"pages/addfile/addfile",
"pages/introduce/introduce",
"pages/my/my",
"pages/opinion/opinion",
"pages/record/record",
"pages/normal/normal",
"pages/file_manage/file_manage",
"pages/article/article",
"pages/mold/mold",
"pages/line/line",
"pages/article_detail/article_detail",
"pages/ence_push/ence_push",
"pages/map/map",
"pages/editfile/editfile",
"pages/editrecord/editrecord",
"pages/agreement/agreement",
"pages/file_choose/file_choose"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#3AA0EA",
"navigationBarTitleText": "术后小程序",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
},
"tabBar": {
"color": "#A1A1A1",
"selectedColor": "#1CB9FA",
"list": [
{
"pagePath": "pages/index/index",
"text": "血项测评",
"iconPath": "img/x2.png",
"selectedIconPath": "img/x1.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "img/w2.png",
"selectedIconPath": "img/w1.png"
}
]
}
}
\ No newline at end of file
... ...
... ... @@ -27,6 +27,14 @@
.wxParse-img{
width:100% !important;
}
.nodata{
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
font-size: 15px;
color: #ccc;
}
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_873289_cq7godatqkt.eot?t=1539597789388'); /* IE9*/
src: url('//at.alicdn.com/t/font_873289_cq7godatqkt.eot?t=1539597789388#iefix') format('embedded-opentype'), /* IE6-IE8 */
... ...
... ... @@ -153,8 +153,8 @@ Page({
let err = '';
if (that.data.files_id == '') {
err = '患者id不能为空'
} else if (that.data.drug == '请选择用药') {
err = '请选择用药'
} else if (that.data.drug == '') {
err = '请输入用药'
} else if (that.data.date == '请选择时间') {
err = '请停药日期'
} else if (that.data.date1 == '请选择时间') {
... ... @@ -187,7 +187,7 @@ Page({
remark: that.data.remarks,
images: that.data.upimg
}
app.post(url, params, header).then((res) => {
app.post(url, params,header).then((res) => {
wx.showModal({
title: '成功',
content: '添加记录成功',
... ...
// pages/file_manage/file_manage.js
// 请注意常量的命名必须是Page
const Page = require('../../utils/ald-stat.js').Page;
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
datalist: [],
files_id: '',
show: true,//是否显示选择项
hadData: true
},
goaddfile() {
wx.navigateTo({
url: '/pages/addfile/addfile',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
setstate(e) {
let that = this;
let index = e.currentTarget.dataset.index;
let datalist = this.data.datalist;
let url = 'user/setDefaultFilesId';
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let params = {
fields_id: e.currentTarget.id
}
app.post(url, params, header).then((res) => {
for (let obj of datalist) {
obj.state = false;
}
datalist[index].state = true;
that.setData({
datalist: datalist
})
wx.showToast({
title: '切换成功',
icon: 'success',
duration: 1000,
success: function(res) {
},
fail: function(res) {},
complete: function(res) {},
})
setTimeout(()=>{
wx.switchTab({
url: '/pages/index/index',
})
},1000)
// wx.showModal({
// title: '提示',
// content: '设置成功',
// showCancel: false,
// success: function (res) {
// if (res.cancel) {
// } else {
// }
// },
// fail: function (res) { },
// complete: function (res) { },
// })
}).catch((errMsg) => {
console.log(errMsg)
})
},
//获取档案列表
getFilesList() {
let that = this;
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''//不知道啥含义
}
let url = 'user/getFilesList';
app.post(url, {}, header).then((res) => {
let list = res;
for (let obj of list) {
obj.state = false;
if (obj.id == that.data.files_id) {
obj.state = true
}
}
that.setData({
datalist: list
})
console.log(res)
}).catch((errMsg) => {
console.log(errMsg)
})
},
//编辑档案
goeditfile(e) {
console.log(e.currentTarget.dataset.obj)
wx.navigateTo({
url: '/pages/editfile/editfile?obj=' + JSON.stringify(e.currentTarget.dataset.obj),
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
app.setStatisticsVisitorLog('/pages/file_manage/file_manage');
if (options.files_id != undefined) {
that.setData({
files_id: options.files_id
})
}
if (options.show != undefined) {
that.setData({
show: false
})
}
that.getFilesList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
that.getFilesList();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{}
\ No newline at end of file
... ...
<!--pages/file_manage/file_manage.wxml-->
<view class='addfile' bindtap='goaddfile'>
<view class='addfile_left'>
<view class='addfile_img'>
<image src='../../img/jia.png'></image>
</view>
<view>添加新档案</view>
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
<view class='manage'>
<view class='manage_item' wx:for='{{datalist}}' wx:key bindtap='setstate' data-index='{{index}}' id='{{item.id}}' data-obj='{{item}}'>
<view class='manage_left'>
<view>{{item.patient}}
<text class='txt_sex'>{{item.sex_string}}</text>{{item.age}}岁</view>
<view class='sub_item'>{{item.disease_name}}</view>
</view>
<view wx:if='{{show}}'>
<view class='manage_right' wx:if='{{item.state}}' >
<image src='../../img/choose_yes.png'></image>
</view>
<view class='manage_right' wx:else >
<image src='../../img/choose_no.png'></image>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/file_choose/file_choose.wxss */
@import '../file_manage/file_manage.wxss'
\ No newline at end of file
... ...
... ... @@ -10,7 +10,8 @@ Page({
data: {
datalist:[],
files_id:'',
show:true//是否显示选择项
show:true,//是否显示选择项
hadData: true
},
goaddfile(){
wx.navigateTo({
... ... @@ -70,7 +71,12 @@ Page({
}
let url ='user/getFilesList';
app.post(url,{},header).then((res)=>{
const list = res;
let list = res;
if(res.length<1){
that.setData({
hadData: false
})
}
for (let obj of list){
obj.state=false;
if (obj.id == that.data.files_id){
... ...
... ... @@ -8,7 +8,8 @@
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
<view class='manage'>
<view class='manage' wx:if="{{hadData}}">
<view class='manage_item' wx:for='{{datalist}}' wx:key bindtap='goeditfile' data-obj='{{item}}'>
<view class='manage_left'>
<view>{{item.patient}}
... ... @@ -24,5 +25,6 @@
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
<view class='nodata' wx:else>您还没有建立档案哦</view>
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@ Page({
* 页面的初始数据
*/
data: {
showdoctor: true, //是否显示首页医生信息
showdoctor: false, //是否显示首页医生信息
show_notest: false, //显示有记录和无记录之间的切换
showfilesLog: false, //是否显示最新记录(没有记录不显示)
showdoc_adv:true,
... ... @@ -16,6 +16,7 @@ Page({
filesLogdata: '', //档案数量
doctorinfo: [], //医生信息
fileslog: {}, //最新记录
hasToken: false
},
goaddrecord(files_id, patient) {
wx.navigateTo({
... ... @@ -64,9 +65,12 @@ Page({
})
}
},
addrecord(e){
this.goaddrecord(e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient);
},
gofile_manage(files_id) {
wx.navigateTo({
url: '/pages/file_manage/file_manage?files_id=' + files_id,
url: '/pages/file_choose/file_choose?files_id=' + files_id,
})
},
//到文章详情
... ... @@ -89,15 +93,19 @@ Page({
wx.setStorageSync('token', res.token);
that.getRecommendArticleList(openid, res.doctor_id);
if (res.doctor_id == 0) { //没有关联医生
if (app.globalData.doctorid == 0) { //没有传过来的doctorid
if (app.globalData.doctorid == 0) { //没有传过来的doctorid
} else {
that.setData({
showdoctor: true
})
that.getDoctorInfo(app.globalData.doctorid);
that.bindDoctor(openid,app.globalData.doctorid);
}
} else { //有关联医生获取医生详情
that.setData({
showdoctor: false
showdoctor: true
})
} else {
that.getDoctorInfo(app.globalData.doctorid);
that.bindDoctor(openid,app.globalData.doctorid);
}
} else { //有关联医生获取医生详情
app.globalData.doctor_id = res.doctor_id;
app.globalData.doctorid = res.doctorid;
that.getDoctorInfo(res.doctorid);
... ... @@ -169,6 +177,9 @@ Page({
complete: function(res) {},
})
},
switchUser(e){
this.gofile_manage(e.currentTarget.dataset.files_id);
},
//获取最新病情记录
getLastFilesLog(openid) {
let that = this;
... ... @@ -217,65 +228,66 @@ Page({
},
//授权
getopwer(e) {
console.log(e)
let that = this;
console.log('token',wx.getStorageSync('token'));
if (wx.getStorageSync('token') == undefined || wx.getStorageSync('token') == ''){
wx.login({
success: (res) => {
let url = 'public/login';
let params = {
code: res.code,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
doctorid: app.globalData.doctorid
}
app.post(url, params).then((res) => {
wx.setStorageSync('token', res.token);
if (e.currentTarget.dataset.tag == '1') {
that.goaddfile();
} else if (e.currentTarget.dataset.tag == '2') {
that.gofile_manage(e.currentTarget.dataset.files_id);
} else if (e.currentTarget.dataset.tag == '3') {
that.goaddrecord(e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient);
}
}).catch((errMsg) => {
console.log(errMsg)
if (e.detail.encryptedData){
wx.login({
success: (res) => {
let url = 'public/login';
let params = {
code: res.code,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
doctorid: app.globalData.doctorid
}
app.post(url, params).then((res) => {
wx.setStorageSync('token', res.token);
that.setData({
hasToken: true
})
// if (e.currentTarget.dataset.tag == '1') {
that.goaddfile();
// } else if (e.currentTarget.dataset.tag == '2') {
// that.gofile_manage(e.currentTarget.dataset.files_id);
// } else if (e.currentTarget.dataset.tag == '3') {
// that.goaddrecord(e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient);
// }
}).catch((errMsg) => {
console.log(errMsg)
})
}
})
}else{
wx.showToast({
title: '授权后才能正常使用',
icon:'none'
})
}
})
}else{
if (e.currentTarget.dataset.tag == '1') {
that.goaddfile();
} else if (e.currentTarget.dataset.tag == '2') {
that.gofile_manage(e.currentTarget.dataset.files_id);
} else if (e.currentTarget.dataset.tag == '3') {
that.goaddrecord(e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient);
}
}
// if (wx.getStorageSync('token') == undefined || wx.getStorageSync('token') == ''){
// }else{
// if (e.currentTarget.dataset.tag == '1') {
// that.goaddfile();
// } else if (e.currentTarget.dataset.tag == '2') {
// that.gofile_manage(e.currentTarget.dataset.files_id);
// } else if (e.currentTarget.dataset.tag == '3') {
// that.goaddrecord(e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient);
// }
// }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
wx.login({
success: (res) => {
let url = 'public/getSessionKey';
let params = {
code: res.code
}
app.post(url, params).then((res) => {
wx.setStorageSync('openid', res.openid)
that.ifdoctorid(res.openid); //判断是否有医生ID
that.getFilesNumber(res.openid); //获取档案数量
that.getLastFilesLog(res.openid);
app.setStatisticsVisitorLog('/pages/index/index'); //统计打开界面数量
}).catch((errMsg) => {
console.log(errMsg)
})
// var openid = wx.getStorageSync('openid');
let token = wx.getStorageSync('token');
// 判断是否授权设置授权权限
if(token){
this.setData({
hasToken: true
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -285,23 +297,14 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function(options) {
let that = this;
wx.login({
success: (res) => {
let url = 'public/getSessionKey';
let params = {
code: res.code
}
app.post(url, params).then((res) => {
that.ifdoctorid(res.openid); //判断是否有医生ID
that.getFilesNumber(res.openid); //获取档案数量
that.getLastFilesLog(res.openid);
}).catch((errMsg) => {
console.log(errMsg)
})
}
})
let that = this;
var openid = wx.getStorageSync('openid');
let token = wx.getStorageSync('token');
this.ifdoctorid(openid); //判断是否有医生ID
this.getFilesNumber(openid); //获取档案数量
this.getLastFilesLog(openid);
app.setStatisticsVisitorLog('/pages/index/index'); //统计打开界面数量
},
/**
* 生命周期函数--监听页面隐藏
... ...
<view wx:if='{{showdoctor}}'>
<view class='index_item' bindtap='gointroduce' data-id='{{doctorinfo.doctor_id}}'>
<view class='index_item_left'>
<view class='itemimg'>
<image src='{{doctorinfo.avatar}}'></image>
</view>
<view class='item_box'>
<view class='item_box_title'>{{doctorinfo.name}}</view>
<view class='item_contenr'>{{doctorinfo.department_name}} {{doctorinfo.title_name}}</view>
<view>{{doctorinfo.hospital_name}}</view>
</view>
<view class='index_item' bindtap='gointroduce' data-id='{{doctorinfo.doctor_id}}'>
<view class='index_item_left'>
<view class='itemimg'>
<image src='{{doctorinfo.avatar}}'></image>
</view>
<view class='item_box'>
<view class='item_box_title'>{{doctorinfo.name}}</view>
<view class='item_contenr'>{{doctorinfo.department_name}} {{doctorinfo.title_name}}</view>
<view>{{doctorinfo.hospital_name}}</view>
</view>
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
</view>
<view class='index_test' wx:if='{{show_notest}}'>
<view class='test_frist'>
<view class='dot'></view>
记录血项测评结果,并获得专家建议和正确医学科普知识。
<view class='button_box'>
<button open-type="getUserInfo" bindgetuserinfo='getopwer' data-tag='1'></button>
<view class='jia_box'>
<view class='iconfont icon-jia'></view>
</view>
<view class='jia_txt'>添加血项检测记录</view>
<view class='test_frist'>
<view class='dot'></view>
记录血项测评结果,并获得专家建议和正确医学科普知识。
<view class='button_box' >
<view class='jia_box' wx:if='{{hasToken}}' bindtap='goaddfile'>
<view class='iconfont icon-jia'></view>
</view>
<button open-type="getUserInfo" wx:else class='jia_box' bindgetuserinfo='getopwer' data-tag='1'><view class='iconfont icon-jia'></view></button>
<view class='jia_txt'>添加血项检测记录</view>
</view>
</view>
</view>
</view>
<view class='index_twotest' wx:else>
<view class='index_twotab'>
<view>用户:{{fileslog.patient}} {{fileslog.age}}岁</view>
<view class='twotab' wx:if='{{filesLogdata > 1}}'>
<button class='twotab_button' open-type='getUserInfo' bindgetuserinfo='getopwer' data-tag='2' data-files_id='{{fileslog.files_id}}'></button>
切换用户
</view>
</view>
<view class='two_main'>
<view class='two_item'>
<view>
最近添加记录:
<text class='time_txt'>{{fileslog.create_time}}</text>
<view class='index_twotab'>
<view>用户:{{fileslog.patient}} {{fileslog.age}}岁</view>
<view class='twotab' bindtap='switchUser' data-files_id='{{fileslog.files_id}}' wx:if="{{filesLogdata>1}}">
切换用户
</view>
</view>
<view class='two_item_box' wx:if='{{showfilesLog}}'>
<view class="two_item two_items {{fileslog.more.white_blood_cell_result=='正常'?'':'danger'}} " >
<view class='two_items_left'>
<view class='two_txt'>白细胞计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
<view class='two_main'>
<view class='two_item'>
<view>
最近添加记录:
<text class='time_txt'>{{fileslog.create_time}}</text>
</view>
{{fileslog.more.white_blood_cell_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.white_blood_cell}}</text>*10^9/L</view>
</view>
<view class="two_item two_items {{fileslog.more.neutrophils_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>中性粒细胞计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
<view class='two_item_box' wx:if='{{showfilesLog}}'>
<view class="two_item two_items {{fileslog.more.white_blood_cell_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>白细胞计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
</view>
{{fileslog.more.white_blood_cell_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.white_blood_cell}}</text>*10^9/L</view>
</view>
{{fileslog.more.neutrophils_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.neutrophils}}</text>*10^9/L</view>
</view>
<view class="two_item two_items {{fileslog.more.hemoglobin_result=='正常'?'':'danger'}} " >
<view class='two_items_left'>
<view class='two_txt'>血红蛋白</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
<view class="two_item two_items {{fileslog.more.neutrophils_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>中性粒细胞计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
</view>
{{fileslog.more.neutrophils_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.neutrophils}}</text>*10^9/L</view>
</view>
{{fileslog.more.hemoglobin_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.hemoglobin}}</text>g/L</view>
</view>
<view class="two_item two_items {{fileslog.more.platelet_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>血小板计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
<view class="two_item two_items {{fileslog.more.hemoglobin_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>血红蛋白</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
</view>
{{fileslog.more.hemoglobin_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.hemoglobin}}</text>g/L</view>
</view>
<view class="two_item two_items {{fileslog.more.platelet_result=='正常'?'':'danger'}} ">
<view class='two_items_left'>
<view class='two_txt'>血小板计数</view>
<view class='two_state' bindtap='gonormal'>
<view class='iconbox'>
<view class='iconfont icon-jinggao'></view>
</view>
{{fileslog.more.platelet_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.platelet}}</text>*10^9/L</view>
</view>
{{fileslog.more.platelet_result}}
</view>
</view>
<view class="two_item_rigth">
<text class='two_num'> {{fileslog.more.platelet}}</text>*10^9/L</view>
</view>
</view>
<view class='notest' wx:else>暂无记录</view>
<view class='two_item' wx:if='{{fileslog.doctor_reply != null}}'>
<view>医生建议:</view>
<view class='two_item_content'>{{fileslog.doctor_reply == null ? '等待医生回复':fileslog.doctor_reply}}</view>
</view>
<view class='two_item two_items'>
<view class='two_item_yuan_box' bindtap='gorecord' data-files_id='{{fileslog.files_id}}' data-showrecord='1'>
<view class='two_item_yuan'>
<image src='../../img/qst.png'></image>
</view>
<view>趋势图</view>
</view>
<view class='two_item_yuan_box'>
<button class='two_item_yuan_box_button' open-type='getUserInfo' bindgetuserinfo='getopwer' data-tag='3' data-files_id='{{fileslog.files_id}}' data-patient='{{fileslog.patient}}'></button>
<view class='jia_box two_jiabox'>
<view class='iconfont icon-jia'></view>
<view class='notest' wx:else>暂无记录</view>
<view class='two_item' wx:if='{{fileslog.doctor_reply != null}}'>
<view>医生建议:</view>
<view class='two_item_content'>{{fileslog.doctor_reply == null ? '等待医生回复':fileslog.doctor_reply}}</view>
</view>
<view>添加血项检测记录</view>
</view>
<view class='two_item_yuan_box' bindtap='gorecord' data-showrecord='2' data-files_id='{{fileslog.files_id}}' data-patient='{{fileslog.patient}}'>
<view class='two_item_yuan'>
<image src='../../img/bq.png'></image>
<!-- 授权判断 -->
<view class='two_item two_items' >
<view class='two_item_yuan_box' bindtap='gorecord' data-files_id='{{fileslog.files_id}}' data-showrecord='1'>
<view class='two_item_yuan'>
<image src='../../img/qst.png'></image>
</view>
<view>趋势图</view>
</view>
<view class='two_item_yuan_box' bindtap='addrecord' data-tag='3' data-files_id='{{fileslog.files_id}}' data-patient='{{fileslog.patient}}'>
<!-- <button class='two_item_yuan_box_button' open-type='getUserInfo' bindgetuserinfo='getopwer' data-tag='3' data-files_id='{{fileslog.files_id}}' data-patient='{{fileslog.patient}}' ></button> -->
<view class='jia_box two_jiabox'>
<view class='iconfont icon-jia'></view>
</view>
<view>添加血项检测记录</view>
</view>
<view class='two_item_yuan_box' bindtap='gorecord' data-showrecord='2' data-files_id='{{fileslog.files_id}}' data-patient='{{fileslog.patient}}'>
<view class='two_item_yuan'>
<image src='../../img/bq.png'></image>
</view>
<view>病情记录</view>
</view>
</view>
<view>病情记录</view>
</view>
</view>
</view>
</view>
<view class='index_three'>
<view class='three'>
<view class='three_title'>相关文章:</view>
</view>
<view wx:for='{{articlelist}}' wx:key>
<view class='three' bindtap='goarticle_details' id='{{item.id}}'>
<view class='threeimg_box'>
<image src='{{item.more.thumbnail}}'></image>
</view>
<view class='three_txtbox'>
<view class='three_txtbox_title'>{{item.post_title}}</view>
<view>
{{item.hospital_name}} {{item.department_name}}{{item.title_name}} {{item.doctor_name}}</view>
</view>
<view class='three'>
<view class='three_title'>相关文章:</view>
</view>
<view wx:for='{{articlelist}}' wx:key>
<view class='three' bindtap='goarticle_details' id='{{item.id}}'>
<view class='threeimg_box'>
<image src='{{item.more.thumbnail}}'></image>
</view>
<view class='three_txtbox'>
<view class='three_txtbox_title'>{{item.post_title}}</view>
<view>
{{item.hospital_name}} {{item.department_name}}{{item.title_name}} {{item.doctor_name}}</view>
</view>
</view>
</view>
<view class='three just_last' bindtap='goarticle'>
<view class='more'>查看更多</view>
<view class='iconfont icon-xiangyou'></view>
</view>
</view>
<view class='three just_last' bindtap='goarticle'>
<view class='more'>查看更多</view>
<view class='iconfont icon-xiangyou'></view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -288,10 +288,14 @@ opacity: 0;
.button_box{
position:relative;
}
.button_box button{
button.jia_box{
width: 130rpx;
height: 130rpx;
}
/* .button_box button{
position: absolute;
width:100%;
height: 100%;
opacity: 0;
z-index:100;
}
\ No newline at end of file
} */
\ No newline at end of file
... ...
... ... @@ -11,14 +11,12 @@ Page({
},
//登陆
getopwer(e){
console.log(e)
let that = this;
app.globalData.userInfo = e.detail.userInfo;
wx.setStorageSync('userInfo', e.detail.userInfo);
if (wx.getStorageSync('token') == undefined || wx.getStorageSync('token') == ''){
if (e.detail.encryptedData){
wx.login({
success: (res) => {
console.log(res);
let url = 'public/login';
let params = {
code: res.code,
... ... @@ -28,6 +26,7 @@ Page({
}
app.post(url, params).then((res) => {
wx.setStorageSync('token', res.token);
wx.setStorageSync('token', res.token);
that.setData({
userInfo: app.globalData.userInfo,
ifpower: true
... ... @@ -37,6 +36,11 @@ Page({
})
}
})
}else{
wx.showToast({
title: '授权登录后才能正常使用',
icon: 'none'
})
}
},
... ... @@ -62,12 +66,21 @@ Page({
})
},
gofile_manage(){
wx.navigateTo({
url: '/pages/file_manage/file_manage?show='+1,
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
})
let token = wx.getStorageSync('token');
if(token){
wx.navigateTo({
url: '/pages/file_manage/file_manage?show=' + 1,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}else{
wx.showToast({
title: '请授权登录后使用',
icon: 'none'
})
}
},
goaboutme(){
wx.navigateTo({
... ... @@ -83,18 +96,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
app.setStatisticsVisitorLog('/pages/my/my');
if (wx.getStorageSync('token')==undefined){
that.setData({
ifpower: false
})
}else{
that.setData({
userInfo: app.globalData.userInfo,
ifpower: true
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -107,7 +109,18 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
app.setStatisticsVisitorLog('/pages/my/my');
let that = this;
let token = wx.getStorageSync('token')
if (token) {
that.setData({
ifpower: true
})
} else {
that.setData({
ifpower: false
})
}
},
/**
... ...
<!--pages/my/my.wxml-->
<view class='my_top'>
<button class='login_btn' wx:if='{{!ifpower}}' open-type="getUserInfo" bindgetuserinfo='getopwer'>
</button>
<view class='my_top_content' wx:if='{{ifpower}}' >
<view class='my_top_content'>
<view class='my_img'>
<open-data type="userAvatarUrl"></open-data>
<!-- <image src='{{userInfo.avatarUrl}}'></image> -->
</view>
<!-- <view>{{userInfo.nickName}}</view> -->
<view><open-data type="userNickName"></open-data></view>
<view wx:if="{{ifpower}}"><open-data type="userNickName"></open-data></view>
<view wx:else><button class='user_login' open-type="getUserInfo" bindgetuserinfo='getopwer'>授权登录</button></view>
</view>
<view class='my_top_content' wx:else>
<!-- <view class='my_top_content'>
<view class='my_img'>
<image src='../../img/no_puimg.png'></image>
</view>
<view>点击登录</view>
</view>
<view></view>
</view> -->
</view>
<view class='my_itembox'>
<view class='my_item' bindtap='gofile_manage'>
... ...
... ... @@ -74,4 +74,16 @@ page{
}
.button_item{
padding:6rpx 30rpx;
}
button.user_login{
line-height: 1.4;
color: #FFF;
background: none;
font-size: 30rpx;
padding-left: 6px;
padding-right: 6px;
border: none;
}
button.user_login:after{
border: 1rpx solid #FFF;
}
\ No newline at end of file
... ...
... ... @@ -31,6 +31,7 @@ Page({
})
},
getopenid(){
wx.clearStorageSync('token')
let that=this;
wx.login({
success: (res) => {
... ... @@ -40,6 +41,7 @@ Page({
}
app.post(url, params).then((res) => {
that.gettoken(res.openid)
wx.setStorageSync('openid', res.openid)
}).catch((errMsg) => {
console.log(errMsg)
})
... ... @@ -50,13 +52,16 @@ Page({
let that = this;
let url = 'public/checkOpenid';
let params = {
openid: openid
openid: openid
}
app.post(url, params).then((res) => {
wx.setStorageSync('token', res.token);
console.log(res)
wx.setStorageSync('token', res.token);
wx.setStorageSync('userInfo', res.user);
}).catch((errMsg) => {
console.log(errMsg)
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
... ... @@ -64,6 +69,8 @@ Page({
onLoad: function (options) {
let that = this;
console.log(options);
that.getopenid();
if (options.scene != undefined) {
var scene = decodeURIComponent(options.scene);
var doctorid = scene.split("=")[1];
... ... @@ -72,12 +79,10 @@ Page({
app.globalData.doctorid = doctorid;
}
}
console.log(options.doctorid);
if (options.doctorid != undefined) {
app.globalData.doctorid = options.doctorid;
}
that.getWelcomeInfo();
that.getopenid();
},
/**
* 生命周期函数--监听页面初次渲染完成
... ...