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

2
manifest.json

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

92
pages/index/index.vue

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

Loading…
Cancel
Save