Browse Source

首页医院列表

master
kuaileWu 1 year ago
parent
commit
6f082d0811
  1. 19
      main.js
  2. 2
      manifest.json
  3. 92
      pages/index/index.vue

19
main.js

@ -22,10 +22,10 @@ const NODE_ENV = 'development';
// const NODE_ENV = 'production'; // const NODE_ENV = 'production';
if(NODE_ENV == 'development'){ if(NODE_ENV == 'development'){
Vue.prototype.cssUrl = '/static/images/frontend/'; Vue.prototype.cssUrl = '/static/images/frontend/';
Vue.prototype.request_domain = "http://apizj.checkcopy.com/"; Vue.prototype.request_domain = "http://api.checkcopy.com/";
}else{ }else{
Vue.prototype.cssUrl = '/static/images/frontend/'; Vue.prototype.cssUrl = '/static/images/frontend/';
Vue.prototype.request_domain = "http://apizj.checkcopy.com/"; Vue.prototype.request_domain = "http://api.yizherenxin.cn/";
} }
try{ try{
@ -174,9 +174,9 @@ if(Vue.prototype.provider == Vue.prototype.provider_weixin) {
Vue.prototype.View = currentPageView+'New'; Vue.prototype.View = currentPageView+'New';
} }
const CODE_SUCCESS = 2000; const CODE_SUCCESS = 0;
const CODE_ERROR = 40001; const CODE_ERROR = 40001;
const CODE_LOGIN_EXIPRE = 401; const CODE_LOGIN_EXIPRE = 40002;
Vue.prototype.user_preview = 1; Vue.prototype.user_preview = 1;
Vue.prototype.edit_preview = 2; Vue.prototype.edit_preview = 2;
@ -193,7 +193,7 @@ function req(url, data={}, method = 'POST', header={}) {
data.appid = Vue.prototype.appid; data.appid = Vue.prototype.appid;
data.xcx_scource = Vue.prototype.USER_SOURCE_WX_XCX; data.xcx_scource = Vue.prototype.USER_SOURCE_WX_XCX;
}else{ }else{
domain = '/api/'; domain = '/api/user/';
if(Vue.prototype.isMobile){ if(Vue.prototype.isMobile){
data.xcx_scource = Vue.prototype.USER_SOURCE_H5; data.xcx_scource = Vue.prototype.USER_SOURCE_H5;
if(Vue.prototype.env_val.indexOf('weixin') > -1) data.xcx_scource = Vue.prototype.USER_SOURCE_WX_H5; if(Vue.prototype.env_val.indexOf('weixin') > -1) data.xcx_scource = Vue.prototype.USER_SOURCE_WX_H5;
@ -234,10 +234,11 @@ function req(url, data={}, method = 'POST', header={}) {
const currentPagec = pagesc[pagesc.length - 1]; const currentPagec = pagesc[pagesc.length - 1];
var pageUrlc = '/'+currentPagec.route; var pageUrlc = '/'+currentPagec.route;
uni.setStorageSync('rebackPagePath', pageUrlc); uni.setStorageSync('rebackPagePath', pageUrlc);
req(getWxH5LoginConfigUri, logindatac, 'GET').then(data=>{ location.href = Vue.prototype.request_domain+'api/common/wxh5_login/?state=user'
if(data == -1 || !data.user_authorize_url) return; // req(getWxH5LoginConfigUri, logindatac, 'GET').then(data=>{
location.href = data.user_authorize_url; // if(data == -1 || !data.user_authorize_url) return;
}); // location.href = data.user_authorize_url;
// });
return; return;
} }

2
manifest.json

@ -80,7 +80,7 @@
"disableHostCheck" : true, "disableHostCheck" : true,
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"target" : "http://apizj.checkcopy.com", "target" : "http://api.checkcopy.com",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false "secure" : false
} }

92
pages/index/index.vue

@ -3,19 +3,19 @@
<view class="header-wrapper flex"> <view class="header-wrapper flex">
<view class="left"> <view class="left">
<view class="flex top PfScMedium"> <view class="flex top PfScMedium">
<view class="ft50 over2">{{doctorInfo.name}}</view> <view class="ft50 over2">{{doctorInfo.doctor_info.name}}</view>
<view v-if="doctor_dept"> <view v-if="doctor_dept">
<view class="over2">{{doctor_dept}}</view> <view class="over2">{{doctor_dept}}</view>
</view> </view>
</view> </view>
<view class="bt over2" v-if="doctorInfo.brief"> <view class="bt over2" v-if="doctorInfo.doctor_info.desc">
{{doctorInfo.brief}} {{doctorInfo.doctor_info.desc}}
</view> </view>
</view> </view>
<img class="right" :src="doctorInfo.photo" alt="" @click="enlargePicture(doctorInfo.photo)" v-if="doctorInfo.photo"> <img class="right" :src="doctorInfo.doctor_info.avator" alt="" @click="enlargePicture(doctorInfo.doctor_info.avator)" v-if="doctorInfo.doctor_info.avator">
</view> </view>
<view class="block desc-wrapper" v-if="doctorInfo.intro"> <view class="block desc-wrapper" v-if="doctorInfo.doctor_info.detail">
<view class="title-wrapper flex"> <view class="title-wrapper flex">
<view class="title"> <view class="title">
医生简介 医生简介
@ -24,7 +24,7 @@
</view> </view>
<view class="con over2 over4"> <view class="con over2 over4">
{{doctorInfo.intro}} {{doctorInfo.doctor_info.detail}}
</view> </view>
</view> </view>
@ -33,15 +33,15 @@
<view class="top flex"> <view class="top flex">
<view class="left"> <view class="left">
<view class="title flex"> <view class="title flex">
<text class="over2">{{item.hospital_name}}</text> <text class="over2">{{item.h_name}}</text>
<img :src="cssUrl+'index_comback.svg'" v-if="item.hospital_location" @click="toLocation(item)"> <img :src="cssUrl+'index_comback.svg'" v-if="item.h_pos" @click="toLocation(item)">
</view> </view>
<view class="date over2" v-if="item.visit_day_text"> <view class="date over2" v-if="item.visit_times">
出诊{{item.visit_day_text}} 出诊{{item.visit_times}}
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="flex right-wrapper" style="justify-content:flex-end;" v-if="item.hospital_location"> <view class="flex right-wrapper" style="justify-content:flex-end;" v-if="item.h_pos">
<view class="" @click="toLocation(item)"> <view class="" @click="toLocation(item)">
<img :src="cssUrl+'index_nav.svg'" alt=""> <img :src="cssUrl+'index_nav.svg'" alt="">
<view>导航</view> <view>导航</view>
@ -90,7 +90,8 @@
doctorInfo:false, doctorInfo:false,
doctor_dept:false, doctor_dept:false,
hospitals:false, hospitals:false,
recentAppoint:[] recentAppoint:[],
loginToken:false
} }
}, },
components:{ components:{
@ -99,24 +100,29 @@
}, },
onLoad(option) { onLoad(option) {
if(option.code) this.code = option.code if(option.code) this.code = option.code
if(option.token) {
this.loginToken = option.token
uni.setStorageSync('token', this.loginToken)
// var rebackPagePath = uni.getStorageSync('rebackPagePath')
// if(!rebackPagePath)
}
}, },
onShow() { onShow() {
this.doctor_id = getApp().globalData.doctorId this.doctor_id = getApp().globalData.doctorId
if(!this.doctor_id) return if(!this.doctor_id) return
var title = '李静医生预约就诊' var title = ''
if(this.code) title = '登录' if(this.code) title = '登录'
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:title title:title
}) })
var token = uni.getStorageSync('token') // var token = uni.getStorageSync('token')
if(this.code && !token) { // if(this.code && !token) {
var rebackPagePath = uni.getStorageSync('rebackPagePath') // var rebackPagePath = uni.getStorageSync('rebackPagePath')
this.login() // this.login()
return // return
} // }
this.getDoctorInfo() this.getDoctorInfo()
}, },
methods: { methods: {
@ -125,18 +131,19 @@
uni.showActionSheet({ uni.showActionSheet({
itemList: ['腾讯地图', '百度地图', '高德地图'], itemList: ['腾讯地图', '百度地图', '高德地图'],
success: function (res) { success: function (res) {
var lngLat = hospital.hospital_location.toString().split(',') var lngLat = hospital.h_pos.toString().split(',')
var lng = lngLat[0].toString() var lng = lngLat[0].toString()
, lat = lngLat[1].toString() , lat = lngLat[1].toString()
var baiduLngLat = that.qqMapTransBMap(lng, lat) var baiduLngLat = that.qqMapTransBMap(lng, lat)
var mapList = [ var mapList = [
'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.hospital_name, 'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.h_name,
'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.hospital_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo', 'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.h_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo',
'https://m.amap.com/share/index/lnglat='+hospital.hospital_location+'&name='+hospital.hospital_name+'&src=uriapi&innersrc=uriapi', 'https://m.amap.com/share/index/lnglat='+hospital.h_pos+'&name='+hospital.h_name+'&src=uriapi&innersrc=uriapi',
] ]
console.log(mapList[res.tapIndex]) console.log(mapList[res.tapIndex])
// return; // return;
// return;
location.href = mapList[res.tapIndex] location.href = mapList[res.tapIndex]
}, },
fail: function (res) { fail: function (res) {
@ -144,33 +151,34 @@
}); });
}, },
login() { login() {
this.$http.req('client/user/login', {code:this.code}, 'POST').then(data=>{ // this.$http.req('login', {code:this.code}, 'POST').then(data=>{
if(data == -1) return // if(data == -1) return
uni.setStorageSync('token', data.token) // uni.setStorageSync('token', data.token)
var rebackPagePath = uni.getStorageSync('rebackPagePath') // var rebackPagePath = uni.getStorageSync('rebackPagePath')
if(rebackPagePath){ // if(rebackPagePath){
uni.navigateTo({ // uni.navigateTo({
url:rebackPagePath // url:rebackPagePath
}) // })
} // }
}); // });
}, },
getDoctorInfo() { getDoctorInfo() {
this.$http.req('client/user/doctorpage/'+this.doctor_id, {}, 'GET').then(data=>{ // if(this.loginToken) return;
this.$http.req('index_info', {}, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.pageShow = true this.pageShow = true
this.keywords = data
this.doctorInfo = data this.doctorInfo = data
if(this.doctorInfo.visit_hospital && this.doctorInfo.visit_hospital.length>0){ if(this.doctorInfo.doctor_info && this.doctorInfo.doctor_info.depart_name.length>0){
this.doctor_dept = this.doctorInfo.visit_hospital[0].hospital_dept_name this.doctor_dept = this.doctorInfo.doctor_info.depart_name
} }
if(this.doctorInfo.visit_hospital && this.doctorInfo.visit_hospital.length>0){ if(this.doctorInfo.hospital_list && this.doctorInfo.hospital_list.length>0){
this.hospitals = this.doctorInfo.visit_hospital this.hospitals = this.doctorInfo.hospital_list
} }
if(this.doctorInfo.appoint_record && this.doctorInfo.appoint_record.length>0){ if(this.doctorInfo.appoint_list && this.doctorInfo.appoint_list.length>0){
this.recentAppoint = this.doctorInfo.appoint_record this.recentAppoint = this.doctorInfo.appoint_list
} }
}); });
}, },

Loading…
Cancel
Save