Browse Source

样式和交互兼容相关

master
kuaileWu 3 months ago
parent
commit
810de72fbd
  1. 40
      App.vue
  2. 2
      components/header.vue
  3. 10
      components/listBox.vue
  4. 33
      components/tabbar.vue
  5. 2
      components/visitorAccount.vue
  6. 2
      components/visitorList.vue
  7. 71
      main.js
  8. 13
      manifest.json
  9. 4
      pages/book_detail/book_detail.vue
  10. 58
      pages/index/index.vue
  11. 4
      pages/modify_visitor/modify_visitor.vue
  12. 9
      pages/prebook/prebook.vue
  13. 2
      pages/prebook_list/prebook_list.vue
  14. 2
      pages/user_modify/user_modify.vue
  15. 2
      pages/usercenter/usercenter.vue
  16. 8
      pages/visit_detail/visit_detail.vue
  17. 8
      pages/visitors/visitors.vue
  18. 4
      pages/waiting_method/waiting_method.vue

40
App.vue

@ -7,6 +7,8 @@
onLaunch: function(option) {
console.log(option,'option====');
var did = false
// #ifdef H5
try {
const pathParts = location.pathname.split('/');
const paramIndex = pathParts.indexOf('did');
@ -16,6 +18,25 @@
}
} catch (e) {
}
// #endif
// #ifdef MP-WEIXIN
if(option.query && option.query.did) did = option.query.did
if(option.query && option.query.scene) {
var scene = decodeURIComponent(option.query.scene)
const params = {};
scene.split('&').forEach(item => {
const pair = item.split('=');
if (pair.length === 2) {
params[pair[0]] = pair[1];
}
});
if(params['depart_id']) did = params['depart_id'];
option.query.logintype = params['logintype'];
uni.clearStorageSync()
}
// #endif
if(option.query && option.query.checkin_depart_id) {
uni.setStorageSync('checkin_depart_id', option.query.checkin_depart_id)
@ -26,15 +47,32 @@
if(doctor_id){
this.globalData.doctorId = doctor_id
}else{
// #ifdef H5
document.getElementsByTagName('body')[0].innerHTML = ""
setTimeout(function(){
alert('请扫描二维码或点击分享网站链接进入');
},500)
}, 500)
// #endif
// #ifdef MP-WEIXIN
uni.showModal({
title: '请扫描小程序二维码进入',
content: '',
showCancel: false,
success: ({ confirm, cancel }) => {}
})
// #endif
}
}else{
this.globalData.doctorId = did
uni.setStorageSync(this.globalData.doctoridStorageKey, did)
// #ifdef H5
location.href = '/'
// #endif
}
},
onShow: function() {},

2
components/header.vue

@ -80,7 +80,7 @@
},
methods: {
async getUser() {
await this.$http.req('userapi/index2/getUser').then(data=>{
await this.$http.req('api/userapi/index2/getUser').then(data=>{
if(data == -1) return;
uni.removeStorageSync('uuid');
uni.removeStorageSync('nickname');

10
components/listBox.vue

@ -4,8 +4,16 @@
<view class="left PfScMedium">
{{leftTitle}}
</view>
<view class="right">
<slot>{{rightTitle}}</slot>
<!-- #ifdef MP-WEIXIN -->
<template>{{rightTitle}}</template>
<!-- #endif -->
<!-- #ifdef H5 -->
<slot>{{rightTitle}}</slot>
<!-- #endif -->
</view>
</view>
</view>

33
components/tabbar.vue

@ -61,7 +61,7 @@
},
methods: {
async initWxConfig() {
await this.$http.req('user/get_wx_jssdk_config', {url:location.href}, 'POST').then(data=>{
await this.$http.req('api/user/get_wx_jssdk_config', {url:location.href}, 'POST').then(data=>{
if(data == -1) return
this.wxConfig = data
try {
@ -82,6 +82,21 @@
});
},
async scanCode() {
// #ifdef MP-WEIXIN
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: (res) => {
console.log('扫码结果:', res.result);
},
fail: (err) => {
console.error('扫码失败:', err);
uni.showToast({ title: '扫码失败', icon: 'none' });
}
});
// #endif
// #ifdef H5
if(!this.isWechat) {
uni.showToast({
title: '请在微信浏览器中打开',
@ -111,6 +126,8 @@
})
}
})
// #endif
},
handleScanResult(result) {
// uni.showModal({
@ -122,20 +139,6 @@
this.$func.toPage('/pages/edit/edit');
},
jumpto(event) {
if(event == '/pages/vip/vip' && this.isIos && this.xcxtype == 0){
this.$http.req('get_aixcx_audit').then(data=>{
if(data == -1) return;
if(data.isopen) {
uni.reLaunch({
url:event
})
return;
}
this.$nav.navToPath('/pages/nonsupport/nonsupport');
});
return;
}
if(event == '/pages/vip/vip') uni.setStorageSync('pagetype', 'vip');
uni.reLaunch({
url:event
})

2
components/visitorAccount.vue

@ -101,7 +101,7 @@ export default {
obj.visitor_id = this.visitor_id
if(this.visit_record) obj.visit_record = 1
if(this.visit_id) obj.visit_id = this.visit_id
await this.$http.req('user/get_visitor_info', obj, 'POST').then(data=>{
await this.$http.req('api/user/get_visitor_info', obj, 'POST').then(data=>{
if(data == -1) return
this.visitorInfo = data;
if((this.visitorInfo.single_items && this.visitorInfo.single_items.length > 0) || (this.visitorInfo.treatment_package && Object.keys(this.visitorInfo.treatment_package).length > 0)) {

2
components/visitorList.vue

@ -48,7 +48,7 @@ export default {
var obj = new Object()
if (this.visitor_id != 0) obj.visitor_id = this.visitor_id
this.$http.req('user/get_visitors', obj, 'POST').then(data => {
this.$http.req('api/user/get_visitors', obj, 'POST').then(data => {
if (data == -1) return
this.vistors = data
this.$emit('dataEvent', this.vistors)

71
main.js

@ -18,16 +18,6 @@ String.prototype.trim=function(){
  return this.replace(/(^s*)|(s*$)/g, "");
}
const NODE_ENV = 'development';
// const NODE_ENV = 'production';
if(NODE_ENV == 'development'){
Vue.prototype.cssUrl = '/static/images/frontend/';
Vue.prototype.request_domain = "http://jasonyizherenxin.checkcopy.com/";
}else{
Vue.prototype.cssUrl = '/static/images/frontend/';
Vue.prototype.request_domain = "http://api.yizherenxin.cn/";
}
try{
var res = uni.getSystemInfoSync(),
platform = res.platform.toLowerCase(),
@ -162,6 +152,26 @@ try{
Vue.prototype.isMobile = isMobile();
}
const NODE_ENV = 'development';
// const NODE_ENV = 'production';
if(Vue.prototype.provider == Vue.prototype.provider_weixin){
if (NODE_ENV == "development") {
Vue.prototype.request_domain = 'http://jasonyizherenxin.checkcopy.com/';
Vue.prototype.cssUrl = "/static/images/frontend/";
} else {
Vue.prototype.request_domain = 'https://api.yizherenxin.cn/';
Vue.prototype.cssUrl = "/static/images/frontend/";
}
}else{
if(NODE_ENV == 'development'){
Vue.prototype.request_domain = "http://jasonyizherenxin.checkcopy.com/";
Vue.prototype.cssUrl = '/static/images/frontend/';
}else{
Vue.prototype.request_domain = "http://api.yizherenxin.cn/";
Vue.prototype.cssUrl = '/static/images/frontend/';
}
}
Vue.prototype.appid = '';
Vue.prototype.USER_SOURCE_WX_XCX = 1;
Vue.prototype.USER_SOURCE_WX_H5 = 2;
@ -251,6 +261,14 @@ function req(url, data={}, method = 'POST', header={}) {
return;
}
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != '/api/common/xcx_login'){
removeLogin();
xcx_login(url, data, method).then(data=>{
return resolve(data);
});
return;
}
uni.showModal({
title: '提示',
showCancel: false,
@ -278,10 +296,12 @@ function req(url, data={}, method = 'POST', header={}) {
return resolve(res.data.data);
}
}catch(e){
console.log(e)
uni.showModal({
title: '提示',
showCancel: false,
content: '请求数据出错|f',
content: '请求数据出错8|f',
success: function (rs) {
return resolve("-1");
}
@ -307,15 +327,24 @@ function xcx_login(url, eqdata={}, method = 'POST') {
wx.login({
success (res) {
if (res.code) {
var pdata = new Object();
pdata.code = res.code;
req('client/user/login', pdata, 'POST').then(data=>{
setToken(data.token)
eqdata.repeat = 1;
req(url, eqdata, method).then(data=>{
var pdata = new Object();
pdata.code = res.code;
var doctor_id = uni.getStorageSync('doctor_id');
pdata.state = 'user-'+doctor_id;
req('/api/common/xcx_login', pdata).then(data=>{
var udata = data
if(udata && udata.jwttoken) {
setToken(udata.jwttoken)
setUinfo(JSON.stringify(udata))
}
pdata.repeat = 1;
req(url, pdata, method).then(data=>{
return resolve(data);
});
});
}
}
});
@ -348,9 +377,9 @@ function toPage(path){
}
}
function navToPath(path) {
function navToPath(path, isreLaunch = false) {
// #ifdef MP-WEIXIN
if(path.indexOf('/pages/index/index') == -1){
if(path.indexOf('/pages/index/index') == -1 && !isreLaunch){
wx.navigateTo({
url: path
});
@ -364,7 +393,6 @@ function navToPath(path) {
// #ifdef H5
location.href = path;
// #endif
}
function modelShow(content, path="",title="提示") {
@ -416,7 +444,8 @@ function setTitlefFunc(title) {
uni.setNavigationBarTitle({
title: title || ''
});
};
};
Vue.prototype.$setTitle = {setTitlefFunc}
Vue.prototype.$pop = {modelShow}
Vue.prototype.$func = {toPage}

13
manifest.json

@ -50,9 +50,15 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxba76fd01dab5e1d8",
"appid" : "wxd82211a91abc5a3e",
"permission": {
"scope.userLocation": { "desc": "定位权限说明" },
"scope.camera": { "desc": "需要访问相机以完成扫码" }
},
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"minified" : true,
"es6" : true
},
"usingComponents" : true
},
@ -70,8 +76,7 @@
"enable" : false
},
"vueVersion" : "2",
/* "target" : "http://jasonyizherenxin.checkcopy.com",*/
/* "target" : "http://api.yizherenxin.cn",*/
/* "target" : "http://jasonyizherenxin.checkcopy.com",*//* "target" : "http://api.yizherenxin.cn",*/
"h5" : {
"router" : {
"mode" : "history",

4
pages/book_detail/book_detail.vue

@ -114,7 +114,7 @@
content:'确认取消预约?',
success(res) {
if(!res.confirm) return
that.$http.req('user/cancel_appoint', {
that.$http.req('api/user/cancel_appoint', {
appoint_id:that.bookId,
depart_id:that.depart_id
},
@ -142,7 +142,7 @@
this.$func.toPage('/pages/index/index')
},
getBookDetail(){
this.$http.req('user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
this.$http.req('api/user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
if(data == -1) {
this.bookInfo = false
return

58
pages/index/index.vue

@ -42,6 +42,7 @@
<view class="left">
<view class="title flex">
<text class="over2 PfScMedium hospital_name">{{item.hospital_name}}</text>
<view class="fixed_hospital" v-if="item.is_fixed == 1">医保定点</view>
</view>
<view class="date over2 over4" v-if="item.address">
{{item.address}}
@ -62,7 +63,7 @@
出诊{{ item.workdate_desc }}
</view>
<uni-collapse ref="collapse" v-model="collapseValue[key]" @change="changeCollapse" class="notice-collapse" v-if="item.notice">
<uni-collapse ref="collapse" v-model="collapseValue[key]" class="notice-collapse" v-if="item.notice">
<uni-collapse-item title="就诊须知">
<view class=" content" >
<view class="text" v-html="item.notice"></view>
@ -91,7 +92,7 @@
</view>
</view>
<pre-book-list class="preg-books" :dataList="recentAppoint" :topnopadding="true" v-if="this.doctorInfo && !this.doctorInfo.is_all_card"></pre-book-list>
<tabbar current="1" leftButtonText="主页" v-if="!this.doctorInfo.is_all_card"></tabbar>
<tabbar current="1" leftButtonText="主页" v-if="!doctorInfo.is_all_card"></tabbar>
</view>
</template>
@ -152,6 +153,26 @@
},
methods: {
toLocation(hospital){
// #ifdef MP-WEIXIN
var lngLat = hospital.hospital_pos.toString().split(',')
var lng = Number(lngLat[0])
, lat = Number(lngLat[1])
if (typeof wx !== 'undefined' && wx.openLocation) {
wx.openLocation({
latitude: lat,
longitude: lng,
name: hospital.hospital_name || '目的地',
address: hospital.address || '',
scale: 15,
success: () => console.log('打开成功'),
fail: (err) => console.error('失败', err)
});
}
// #endif
// #ifdef H5
var that = this
uni.showActionSheet({
itemList: ['腾讯地图', '百度地图', '高德地图'],
@ -167,34 +188,12 @@
'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_pos+'&name='+hospital.hospital_name+'&src=uriapi&innersrc=uriapi',
]
// location.href(mapList[res.tapIndex])
//
if (typeof wx !== 'undefined' && wx.openLocation) {
//
// lat
// wx.openLocation({
// latitude: lat,
// longitude: lng,
// name: hospital.hospital_name || '',
// address: hospital.address || '',
// scale: 18
// });
wx.openLocation({
latitude: baiduLngLat.lat,
longitude: baiduLngLat.lng,
name: hospital.hospital_name || '目的地',
address: hospital.address || '',
scale: 18
});
}
//
else if (/MicroMessenger/i.test(navigator.userAgent)) {
location.href = mapList[res.tapIndex];
}
location.href(mapList[res.tapIndex])
},
fail: function (res) {
}
});
// #endif
},
copyAddress(address){
uni.setClipboardData({
@ -204,14 +203,11 @@
}
});
},
changeCollapse(e) {
console.log(e);
},
setLoginUserInfo(info) {
this.$setuinfo.setUinfo(JSON.stringify(info))
},
login() {
this.$http.req('common/get_user_info', {code:this.code,state:this.state}, 'POST').then(data=>{
this.$http.req('api/common/get_user_info', {code:this.code,state:this.state}, 'POST').then(data=>{
if(data == -1) return
this.$settoken.setToken(data.jwttoken)
@ -228,7 +224,7 @@
},
async getDoctorInfo() {
await this.$http.req('user/index_info', {}, 'GET').then(data=>{
await this.$http.req('api/user/index_info', {}, 'GET').then(data=>{
if(data == -1) return
// var data = JSON.parse(uni.getStorageSync('doctor_info'));

4
pages/modify_visitor/modify_visitor.vue

@ -74,11 +74,11 @@
that.adding = false
}, 5000);
var req = 'user/add_visitor'
var req = 'api/user/add_visitor'
var method = 'POST'
if(this.vid){
param.id = this.vid
req = 'user/update_visitor'
req = 'api/user/update_visitor'
}
this.$http.req(req, param, method, true).then(data=>{

9
pages/prebook/prebook.vue

@ -112,6 +112,7 @@
},
tips(){
uni.removeStorageSync('active_visitors')
var that = this
uni.showToast({
title:"成功预约"+this.chooseVisitorCount+"人",
mask:true,
@ -119,7 +120,7 @@
times:false,
success() {
setTimeout(function(){
this.$nav.navToPath("/pages/prebook_list/prebook_list")
that.$nav.navToPath("/pages/prebook_list/prebook_list")
}, 1500)
}
})
@ -129,7 +130,7 @@
depart_id:this.departId,
date:date?date:''
}
this.$http.req('/user/get_appoint_times',param, 'POST').then(data=>{
this.$http.req('api/user/get_appoint_times',param, 'POST').then(data=>{
let date2work = data.date2work
let regxp = /^0/;
for(let key in date2work){
@ -179,7 +180,7 @@
param.time_interval = this.times.time_interval;
param.date = this.times.date;
this.chooseVisitorCount = uids.length
this.$http.req('user/appoint', param,'POST').then(data=>{
this.$http.req('api/user/appoint', param,'POST').then(data=>{
if(data == -1) return
this.tips()
});
@ -197,7 +198,7 @@
this.times.date = times.date;
this.times.time_desc = '下午';
if(times.type == 1) this.times.time_desc = '上午';
this.$http.req('user/check_appoint_nums', param,'POST').then(data=>{
this.$http.req('api/user/check_appoint_nums', param,'POST').then(data=>{
if(data.remain < this.activeVisitors.length){
this.needSelectMembers = true
this.$set(this.times, 'remain', data.remain)

2
pages/prebook_list/prebook_list.vue

@ -40,7 +40,7 @@
var timerobj = setTimeout(function(){
uni.hideLoading()
}, 3000)
this.$http.req('user/get_appoints', param, 'POST', true).then(data=>{
this.$http.req('api/user/get_appoints', param, 'POST', true).then(data=>{
clearTimeout(timerobj)
uni.hideLoading()
if(data == -1) return

2
pages/user_modify/user_modify.vue

@ -48,7 +48,7 @@
},
methods: {
getUser(){
this.$http.req('user/get_user_info', {}, 'GET').then(data=>{
this.$http.req('api/user/get_user_info', {}, 'GET').then(data=>{
if(data == -1) return
this.uinfo = data
this.nick = this.uinfo.nick

2
pages/usercenter/usercenter.vue

@ -39,7 +39,7 @@
},
methods: {
getUser(){
this.$http.req('user/get_user_info', {}, 'POST').then(data=>{
this.$http.req('api/user/get_user_info', {}, 'POST').then(data=>{
if(data == -1) return
this.uinfo = data
});

8
pages/visit_detail/visit_detail.vue

@ -1,9 +1,11 @@
<template>
<view class="book-page btPadding" v-show="bookInfo">
<view class="list-box">
<list-box class="item-wrapper" v-if="item.show" v-for="(item,key) in list" :key="key" :leftTitle="item.leftTitle" :rightTitle="item.rightTitle?item.rightTitle:''">
<view class="item-inner" v-html="item.custom" v-if="item.custom" @click="edit" :data-item="item" :data-key="key"></view>
</list-box>
</view>
<view class="bot-con" v-show="hasRecord">
@ -115,7 +117,7 @@
param.only_set_bed_desc = 1;
}
that.$http.req('user/set_wait_type', param, 'POST').then(data=>{
that.$http.req('api/user/set_wait_type', param, 'POST').then(data=>{
if(data == -1) return
uni.showToast({
title:"修改成功",
@ -157,7 +159,7 @@
content:'确认取消预约?',
success(res) {
if(!res.confirm) return
that.$http.req('user/cancel_appoint', {
that.$http.req('api/user/cancel_appoint', {
appoint_id:that.bookId,
depart_id:that.depart_id
},
@ -188,7 +190,7 @@
},
getBookDetail(){
this.$http.req('user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
this.$http.req('api/user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
if(data == -1) {
this.bookInfo = false
return

8
pages/visitors/visitors.vue

@ -162,7 +162,6 @@
}
},
async onShow() {
await this.getDoctorInfo();
},
onReady() {
@ -174,7 +173,7 @@
},
// --
async getDoctorInfo() {
await this.$http.req('user/index_info', {}, 'GET').then(data=>{
await this.$http.req('api/user/index_info', {}, 'GET').then(data=>{
if(data == -1) return
this.doctorInfo = data;
@ -221,7 +220,7 @@
content:'删除'+visitor.name+'后,就诊记录还可以查到,确定删除吗?',
success(res) {
if(!res.confirm) return
that.$http.req('/user/del_visitor', {id:visitor.id},'POST').then(data=>{
that.$http.req('api/user/del_visitor', {id:visitor.id},'POST').then(data=>{
that.getVisitors()
});
}
@ -260,10 +259,11 @@
obj.depart_id = this.depart_id
}
this.$http.req('user/get_visitors', obj, 'POST').then(data=>{
this.$http.req('api/user/get_visitors', obj, 'POST').then(data=>{
this.visitUsers = data;
this.visitUsers = [...this.visitUsers]
this.popMsgs = []
this.selectCount = 0
for (var i = 0; i < this.visitUsers.length; i++) {
this.visitUsers[i].select = false

4
pages/waiting_method/waiting_method.vue

@ -52,7 +52,7 @@
methods: {
getVisitors() {
this.$http.req('user/get_visitors', {}, 'POST').then(data=>{
this.$http.req('api/user/get_visitors', {}, 'POST').then(data=>{
this.visitUsers = data;
this.visitUsers = [...this.visitUsers]
this.popMsgs = []
@ -90,7 +90,7 @@
obj.checkin_list = JSON.stringify(params);
this.$http.req('user/checkin', obj, 'POST').then(data => {
this.$http.req('api/user/checkin', obj, 'POST').then(data => {
//
if(data == -1) return
this.$nav.navToPath('/pages/prebook_list/prebook_list')

Loading…
Cancel
Save