@ -0,0 +1,17 @@ |
|||
<script> |
|||
export default { |
|||
onLaunch: function() { |
|||
console.log('App Launch') |
|||
}, |
|||
onShow: function() { |
|||
console.log('App Show') |
|||
}, |
|||
onHide: function() { |
|||
console.log('App Hide') |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
/*每个页面公共css */ |
|||
</style> |
@ -0,0 +1,210 @@ |
|||
<template> |
|||
<view class=""> |
|||
<view class="header-com" :style="{paddingTop:headerArea.status_height+'px'}"> |
|||
<view class="header-com-content" :style="{height:headerArea.title_height+'px',lineHeight:headerArea.title_height+'px',fontSize:headerArea.fontSize+'px'}"> |
|||
<view class="header-com-title" v-if="left" :style="{height:headerArea.title_height+'px'}"> |
|||
<img v-if="!isindex && comback" class="header-com-comback" :src="cssUrl+'header_back.svg'" :style="{width:headerArea.backwidth+'px',height:headerArea.backheight+'px'}"> |
|||
<view v-if="(!isindex && comback) || showClouldPhoto" @click="headerComeBack" class="header-com-comback header-com-comback-opc" :style="{width:headerArea.backwidth+'px',height:headerArea.title_height+'px',padding:'0rpx 0rpx 0rpx 36rpx',left:'-18rpx'}"></view> |
|||
|
|||
<img v-if="!showClouldPhoto && !showUserSetting" class="header-com-logo" :src="cssUrl+'logo.png'" :style="{width:headerArea.logowidth+'px',height:headerArea.logoheight+'px'}"> |
|||
<view class="header-com-line" :style="{height:headerArea.lineheight+'px'}" v-if="is_admin && !showClouldPhoto"></view> |
|||
<view class="header-com-role font24rpx PingFangSCMedium" v-if="is_admin && !showClouldPhoto && !showUserSetting">管理员</view> |
|||
<view v-if="showClouldPhoto && typeClouldPhoto == 1" class="clouldPhoto">云相册选择图片</view> |
|||
<view v-if="showClouldPhoto && typeClouldPhoto == 2" class="clouldPhoto">云相册选择封面</view> |
|||
<view v-if="showUserSetting" class="userSetting">修改资料</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="header-com-bt" :style="{width:'100%',height:(headerArea.btheight)+'px'}"></view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name:'header', |
|||
data() { |
|||
return { |
|||
cssUrl:this.cssUrl |
|||
} |
|||
}, |
|||
props:{ |
|||
left:{ |
|||
type:Boolean, |
|||
default:()=>false |
|||
}, |
|||
comback:{ |
|||
type:Boolean, |
|||
default:()=>true |
|||
}, |
|||
showClouldPhoto:{ |
|||
type:Boolean, |
|||
default:()=>false |
|||
}, |
|||
typeClouldPhoto:{ |
|||
type:Number, |
|||
default:()=>0 |
|||
}, |
|||
showUserSetting:{ |
|||
type:Boolean, |
|||
default:()=>false |
|||
}, |
|||
isindex:{ |
|||
type:Boolean, |
|||
default:()=>false |
|||
}, |
|||
role:{ |
|||
type:String, |
|||
default:()=>'', |
|||
}, |
|||
is_admin:{ |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
computed:{ |
|||
headerArea() { |
|||
let area = uni.getSystemInfoSync(); |
|||
// #ifdef MP-WEIXIN |
|||
return this.getHeaderInfo(); |
|||
// #endif |
|||
// #ifndef MP-WEIXIN |
|||
return { |
|||
status_height: area.statusBarHeight, |
|||
title_height: uni.upx2px(80), |
|||
menuLeft: 0, |
|||
fontSize:uni.upx2px(34), |
|||
}; |
|||
// #endif |
|||
} |
|||
}, |
|||
methods: { |
|||
async getUser() { |
|||
await this.$http.req('userapi/index2/getUser').then(data=>{ |
|||
if(data == -1) return; |
|||
uni.removeStorageSync('uuid'); |
|||
uni.removeStorageSync('nickname'); |
|||
uni.removeStorageSync('avatar'); |
|||
uni.removeStorageSync('level_id'); |
|||
uni.removeStorageSync('level_name'); |
|||
uni.removeStorageSync('is_admin'); |
|||
uni.removeStorageSync('avatar_full'); |
|||
uni.removeStorageSync('create'); |
|||
uni.removeStorageSync('uuid_str'); |
|||
|
|||
if(data.is_admin) uni.removeStorageSync('is_admin'); |
|||
uni.setStorageSync('uuid', data.userId); |
|||
uni.setStorageSync('uuid_str', data.userIdStr); |
|||
uni.setStorageSync('nickname', data.nickname); |
|||
uni.setStorageSync('avatar', data.avatar); |
|||
uni.setStorageSync('avatar_full', data.avatar_full); |
|||
uni.setStorageSync('level_id', data.level_id); |
|||
uni.setStorageSync('level_name', data.level_name); |
|||
uni.setStorageSync('create', data.create); |
|||
if(data.is_admin) uni.setStorageSync('is_admin', data.is_admin); |
|||
}); |
|||
}, |
|||
getHeaderInfo() { |
|||
let area = uni.getSystemInfoSync(); |
|||
// #ifdef MP-WEIXIN |
|||
let menu = uni.getMenuButtonBoundingClientRect(); |
|||
var conheight = menu.height + (menu.top - area.statusBarHeight) * 2; |
|||
return { |
|||
status_height: area.statusBarHeight, |
|||
title_height: conheight, |
|||
menuLeft: menu.left, |
|||
menuHeight:menu.height, |
|||
btheight:menu.top+conheight, |
|||
fontSize:uni.upx2px(34), |
|||
backwidth: ((22/38)*(conheight*0.5)), |
|||
backheight:conheight*0.5, |
|||
logowidth: ((556/80)*(conheight*0.48)), |
|||
logoheight:conheight*0.48, |
|||
lineheight:conheight*0.3 |
|||
}; |
|||
// #endif |
|||
}, |
|||
headerComeBack(e){ |
|||
if(this.showClouldPhoto){ |
|||
this.$parent.hideClouldPhoto() |
|||
return |
|||
} |
|||
var hpages = getCurrentPages(); |
|||
if(hpages.length > 1){ |
|||
uni.navigateBack({ |
|||
}); |
|||
}else{ |
|||
uni.reLaunch({ |
|||
url:'/pages/index/index' |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.header-com{ |
|||
overflow: hidden; |
|||
width: 100%; |
|||
position: fixed; |
|||
background: #FFFFFF; |
|||
z-index: 189; |
|||
} |
|||
.header-com-content{ |
|||
width: 100%; |
|||
box-sizing: border-box; |
|||
color: #292929; |
|||
text-align: center; |
|||
font-family: MiSans; |
|||
font-style: normal; |
|||
font-weight: 600; |
|||
line-height: normal; |
|||
box-sizing: border-box; |
|||
overflow: hidden; |
|||
box-sizing: border-box; |
|||
} |
|||
.header-com-title{ |
|||
position: relative; |
|||
display: flex; |
|||
align-items: center; |
|||
height: 100%; |
|||
overflow: hidden; |
|||
box-sizing: border-box; |
|||
} |
|||
.header-com-comback{ |
|||
color: #000000; |
|||
margin-left: 36rpx; |
|||
} |
|||
.header-com-logo{ |
|||
margin-left: 36rpx; |
|||
} |
|||
.header-com-line{ |
|||
width: 3rpx; |
|||
background: #D8D8D8; |
|||
border-radius: 1rpx; |
|||
margin-left: 20rpx; |
|||
} |
|||
.header-com-role{ |
|||
margin-left: 20rpx; |
|||
font-weight: 500; |
|||
color: #999999; |
|||
} |
|||
.header-com-bt{ |
|||
background: #FFFFFF; |
|||
} |
|||
.clouldPhoto{ |
|||
width: 100%; |
|||
position: absolute; |
|||
left: 0; |
|||
top: 0; |
|||
text-align: center; |
|||
} |
|||
.header-com-comback-opc{ |
|||
position: absolute; |
|||
left: 0; |
|||
top: 0; |
|||
opacity: 0; |
|||
z-index:8; |
|||
} |
|||
</style> |
@ -0,0 +1,20 @@ |
|||
<template> |
|||
<view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name:"pop", |
|||
data() { |
|||
return { |
|||
|
|||
}; |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
@ -0,0 +1,142 @@ |
|||
<template> |
|||
<view> |
|||
<view style="height: 100rpx;"></view> |
|||
<view class="tabbar_item_wrap" style=""> |
|||
<view class="tabbar_item tabbar_item01" @click="jumpto('/pages/index/index')" style=""> |
|||
<view :class="[current==1?'tabbarYes':'tabbarNone']"> |
|||
<image :src="current==1?cssUrl+'tabbar_index_active.svg':cssUrl+'tabbar_index.svg'"></image> |
|||
<view :class="[current==1?'tabbarYes':'tabbarNone']">文章</view> |
|||
</view> |
|||
</view> |
|||
<view class="tabbar_item tabbar_item05" style="" v-if="is_admin" @click="addArticle"> |
|||
<image :src="cssUrl+'add.svg'"></image> |
|||
</view> |
|||
<view class="tabbar_item tabbar_item04" @click="jumpto('/pages/user_center/user_center')" style=""> |
|||
<view :class="[current==2?'tabbarYes':'tabbarNone']"> |
|||
<image :src="current==2?cssUrl+'tabbar_user_active.svg':cssUrl+'tabbar_user.svg'"></image> |
|||
<view :class="[current==2?'tabbarYes':'tabbarNone']">我的</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
<script> |
|||
export default { |
|||
props:{ |
|||
current:{ |
|||
type: [String, Number], |
|||
default: 1 |
|||
}, |
|||
is_admin:{ |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
cssUrl:this.cssUrl, |
|||
isios:this.isIos, |
|||
} |
|||
}, |
|||
onLoad() { |
|||
}, |
|||
methods: { |
|||
addArticle() { |
|||
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.$func.toPage('/pages/nonsupport/nonsupport'); |
|||
}); |
|||
return; |
|||
} |
|||
if(event == '/pages/vip/vip') uni.setStorageSync('pagetype', 'vip'); |
|||
uni.reLaunch({ |
|||
url:event |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
.tabbar_item{ |
|||
width: 33.3333333%; |
|||
height: 112rpx; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
margin-top: 10rpx; |
|||
text-align: center; |
|||
} |
|||
.tabbar_item_wrap{ |
|||
position: fixed; |
|||
bottom: 0rpx; |
|||
left: 0rpx; |
|||
right: 0rpx; |
|||
width: 664rpx; |
|||
height: 119.43925233644859rpx; |
|||
background-color: #ffffff; |
|||
display: flex; |
|||
box-sizing: border-box; |
|||
padding-left: 43rpx; |
|||
padding-right: 43rpx; |
|||
justify-content: space-between; |
|||
padding-bottom: constant(safe-area-inset-bottom); |
|||
padding-bottom: env(safe-area-inset-bottom); |
|||
box-sizing: content-box; |
|||
z-index: 8; |
|||
margin: 0 auto; |
|||
box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(181,181,181,0.13); |
|||
} |
|||
.tabbar_item01 image{ |
|||
width: 50rpx; |
|||
height: 50rpx; |
|||
} |
|||
.tabbar_item02 image{ |
|||
width: 50rpx; |
|||
height: 50rpx; |
|||
} |
|||
.tabbar_item05{ |
|||
position: relative; |
|||
} |
|||
.tabbar_item05 image{ |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
position: relative; |
|||
top: -50rpx; |
|||
} |
|||
.tabbar_item03 image{ |
|||
width: 50rpx; |
|||
height: 50rpx; |
|||
} |
|||
.tabbar_item04 image{ |
|||
width: 50rpx; |
|||
height: 50rpx; |
|||
} |
|||
.tabbarNone{ |
|||
color: #888D9C; |
|||
text-align: center; |
|||
font-family: PingFang SC; |
|||
font-size: 21.869158878504674rpx; |
|||
font-style: normal; |
|||
font-weight: 400; |
|||
line-height: normal; |
|||
} |
|||
.tabbarYes{ |
|||
color: #00C160; |
|||
text-align: center; |
|||
font-family: PingFang SC; |
|||
font-size: 21.869158878504674rpx; |
|||
font-style: normal; |
|||
font-weight: 600; |
|||
line-height: normal; |
|||
} |
|||
</style> |
@ -0,0 +1,20 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8" /> |
|||
<script> |
|||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
|||
CSS.supports('top: constant(a)')) |
|||
document.write( |
|||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
|||
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
|||
</script> |
|||
<title></title> |
|||
<!--preload-links--> |
|||
<!--app-context--> |
|||
</head> |
|||
<body> |
|||
<div id="app"><!--app-html--></div> |
|||
<script type="module" src="/main.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,406 @@ |
|||
import App from './App' |
|||
|
|||
// #ifndef VUE3
|
|||
import Vue from 'vue' |
|||
import './uni.promisify.adaptor' |
|||
Vue.config.productionTip = false |
|||
App.mpType = 'app' |
|||
const app = new Vue({ |
|||
...App |
|||
}) |
|||
|
|||
//设备型号判断
|
|||
Vue.prototype.platform = ""; |
|||
Vue.prototype.isIos = ""; |
|||
Vue.prototype.isIphoneXr = false; |
|||
|
|||
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://xmztest.yitongtang66.com/"; |
|||
}else{ |
|||
Vue.prototype.cssUrl = 'https://xmz.yitongtang66.com/assets/img/new/'; |
|||
Vue.prototype.request_domain = "https://xmz.yitongtang66.com/"; |
|||
} |
|||
|
|||
try{ |
|||
var res = uni.getSystemInfoSync(), |
|||
platform = res.platform.toLowerCase(), |
|||
system = res.system.toLowerCase(), |
|||
model = res.model.toLowerCase(); |
|||
if(system.indexOf('mac') > -1 || model.indexOf('mac') > -1 || model.indexOf('iphone 12/13 mini') > -1) platform = 'ios'; |
|||
if(system.indexOf('ios') > -1 || model.indexOf('ipad') > -1) platform = 'ios'; |
|||
Vue.prototype.platform = platform; |
|||
Vue.prototype.isIos = platform == 'ios' ? true : false; |
|||
Vue.prototype.isIphoneXr = (platform == "ios") && (res.model.toLowerCase().indexOf("iphone x")>-1); |
|||
if(NODE_ENV == 'development') Vue.prototype.isIos = ''; |
|||
if(platform.indexOf('windows') > -1) Vue.prototype.isPc = true; |
|||
}catch(e){ |
|||
} |
|||
|
|||
Vue.prototype.env_val = 'xcx'; |
|||
Vue.prototype.is_pc = false; |
|||
Vue.prototype.isMobile = false; |
|||
|
|||
function isMobile() { |
|||
var userAgentInfo = navigator.userAgent; |
|||
|
|||
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; |
|||
|
|||
var mobile_flag = false; |
|||
|
|||
//根据userAgent判断是否是手机
|
|||
for (var v = 0; v < mobileAgents.length; v++) { |
|||
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { |
|||
mobile_flag = true; |
|||
break; |
|||
} |
|||
} |
|||
var screen_width = window.screen.width; |
|||
var screen_height = window.screen.height; |
|||
|
|||
//根据屏幕分辨率判断是否是手机
|
|||
if (screen_width > 325 && screen_height < 750) { |
|||
mobile_flag = true; |
|||
} |
|||
|
|||
return mobile_flag; |
|||
} |
|||
|
|||
|
|||
function trim(str, type = 'both') { |
|||
if (type == 'both') { |
|||
//去除两端
|
|||
return str.replace(/^\s+|\s+$/g, ''); |
|||
} else if (type == "left") { |
|||
//去除左边
|
|||
return str.replace(/^\s*/, ''); |
|||
} else if (type == 'right') { |
|||
//去除右边
|
|||
return str.replace(/(\s*$)/g, ''); |
|||
} else if (type == 'all') { |
|||
//去除所有
|
|||
return str.replace(/\s+/g, ''); |
|||
} else { |
|||
return str; |
|||
} |
|||
} |
|||
|
|||
function isOpenMode() { |
|||
var system = { |
|||
win: false, |
|||
mac: false, |
|||
xll: false, |
|||
ipad: false |
|||
}; |
|||
var p = navigator.platform; |
|||
system.win = p.indexOf("Win") == 0; |
|||
system.mac = p.indexOf("Mac") == 0; |
|||
system.xll = (p == "X11") || (p.indexOf("Linux") == 0); |
|||
system.ipad = (navigator.userAgent.match(/iPad/i) != null) ? true : false; |
|||
if ((system.win || system.mac || system.xll || system.ipad) && !Vue.prototype.isMobile) { |
|||
var ua = navigator.userAgent.toLowerCase(); |
|||
if (ua.match(/MicroMessenger/i) == "micromessenger") { |
|||
// "在PC端微信上打开的"
|
|||
Vue.prototype.env_val = 'pc_weixin'; |
|||
} else { |
|||
// "在PC端非微信上打开的"
|
|||
Vue.prototype.env_val = 'pc'; |
|||
} |
|||
Vue.prototype.isPc = true; |
|||
} else { |
|||
var ua = navigator.userAgent.toLowerCase(); |
|||
if (ua.match(/MicroMessenger/i) == "micromessenger") { |
|||
// "在手机端微信上打开的"
|
|||
Vue.prototype.env_val = 'phone_weixin'; |
|||
} else { |
|||
// "在手机上非微信上打开的"
|
|||
Vue.prototype.env_val = 'phone'; |
|||
} |
|||
} |
|||
} |
|||
|
|||
Vue.prototype.xcxtype = -1; |
|||
Vue.prototype.provider_baidu = "baidu"; |
|||
Vue.prototype.provider_weixin = "weixin"; |
|||
Vue.prototype.provider_alipay = "alipay"; |
|||
Vue.prototype.provider = ''; |
|||
try{ |
|||
uni.getProvider({ |
|||
service: 'oauth', |
|||
success: function (res) { |
|||
if (~res.provider.indexOf(Vue.prototype.provider_baidu)) { |
|||
Vue.prototype.xcxtype = 1; |
|||
Vue.prototype.provider = Vue.prototype.provider_baidu; |
|||
} |
|||
if (~res.provider.indexOf(Vue.prototype.provider_weixin)) { |
|||
Vue.prototype.xcxtype = 0; |
|||
Vue.prototype.provider = Vue.prototype.provider_weixin; |
|||
} |
|||
if (~res.provider.indexOf(Vue.prototype.provider_alipay)) { |
|||
Vue.prototype.xcxtype = 2; |
|||
Vue.prototype.provider = Vue.prototype.provider_alipay; |
|||
} |
|||
|
|||
if(Vue.prototype.xcxtype == -1){ |
|||
Vue.prototype.isMobile = isMobile(); |
|||
isOpenMode(); |
|||
}else{ |
|||
Vue.prototype.isMobile = true; |
|||
} |
|||
} |
|||
}); |
|||
}catch(e){ |
|||
isOpenMode(); |
|||
Vue.prototype.isMobile = isMobile(); |
|||
} |
|||
|
|||
Vue.prototype.appid = ''; |
|||
Vue.prototype.USER_SOURCE_WX_XCX = 1; |
|||
Vue.prototype.USER_SOURCE_WX_H5 = 2; |
|||
Vue.prototype.USER_SOURCE_PC = 3; |
|||
Vue.prototype.USER_SOURCE_H5 = 4; |
|||
if(Vue.prototype.provider == Vue.prototype.provider_weixin) { |
|||
var wxXcxAccountInfo = wx.getAccountInfoSync(); |
|||
Vue.prototype.appid = wxXcxAccountInfo.miniProgram.appId; |
|||
const pagesView = getCurrentPages(); |
|||
const currentPageView = pagesView[pagesView.length - 1]; |
|||
Vue.prototype.View = currentPageView+'New'; |
|||
} |
|||
|
|||
const CODE_SUCCESS = 200; |
|||
const CODE_ERROR = 40001; |
|||
const CODE_LOGIN_EXIPRE = 40002; |
|||
|
|||
Vue.prototype.user_preview = 1; |
|||
Vue.prototype.edit_preview = 2; |
|||
Vue.prototype.add_preview = 3; |
|||
Vue.prototype.edit_album = 4; |
|||
|
|||
function removeLogin() { |
|||
uni.removeStorageSync('token'); |
|||
uni.removeStorageSync('uuid'); |
|||
uni.removeStorageSync('nickname'); |
|||
uni.removeStorageSync('avatar'); |
|||
uni.removeStorageSync('level_id'); |
|||
uni.removeStorageSync('level_name'); |
|||
uni.removeStorageSync('is_admin'); |
|||
uni.removeStorageSync('avatar_full'); |
|||
uni.removeStorageSync('create'); |
|||
uni.removeStorageSync('uuid_str'); |
|||
} |
|||
|
|||
function req(url, data={}, method = 'POST') { |
|||
var domain = Vue.prototype.request_domain; |
|||
data.xcxtype = 3; |
|||
if(Vue.prototype.appid != '') { |
|||
data.appid = Vue.prototype.appid; |
|||
data.xcx_scource = Vue.prototype.USER_SOURCE_WX_XCX; |
|||
}else{ |
|||
domain = '/api/'; |
|||
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; |
|||
data.host = location.host; |
|||
}else{ |
|||
data.xcx_scource = Vue.prototype.USER_SOURCE_PC; |
|||
data.host = location.host; |
|||
} |
|||
} |
|||
|
|||
if(NODE_ENV == 'development') data.env = 'dev'; |
|||
|
|||
var headerObj = {'content-type': 'application/x-www-form-urlencoded'}; |
|||
var token = uni.getStorageSync('token'); |
|||
var uuid = uni.getStorageSync('uuid'); |
|||
|
|||
var loginFunc = ''; |
|||
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX) loginFunc = 'ai_xcx_login'; |
|||
data.submit_source = data.xcx_scource; |
|||
data.is_ai = 1; |
|||
if(token && uuid && url != loginFunc){ |
|||
data.token = token; |
|||
data.user_id = uuid; |
|||
} |
|||
|
|||
return new Promise((resolve, reject) => { |
|||
uni.request({ |
|||
method: method, |
|||
url: domain+url, |
|||
data: data, |
|||
header: headerObj, |
|||
async: false, |
|||
success(res) { |
|||
try{ |
|||
var rdata = res.data; |
|||
if(rdata.code != CODE_SUCCESS) { |
|||
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != 'userapi/login2/weChatLogin'){ |
|||
removeLogin(); |
|||
xcx_login(url, data, method).then(data=>{ |
|||
return resolve(data); |
|||
}); |
|||
return; |
|||
} |
|||
|
|||
if(data.xcx_scource == Vue.prototype.USER_SOURCE_H5 && res.data.info.indexOf('请先登录')>-1){ |
|||
location.href="/pages/jumpxcx/jumpxcx"; |
|||
return; |
|||
} |
|||
|
|||
if(rdata.code==CODE_LOGIN_EXIPRE && data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5 && url != 'ai_get_mplogin_url'){ |
|||
var logindatac = new Object(); |
|||
logindatac.host = location.host; |
|||
|
|||
const pagesc = getCurrentPages(); |
|||
const currentPagec = pagesc[pagesc.length - 1]; |
|||
var pageUrlc = '/'+currentPagec.route; |
|||
logindatac.state = encodeURIComponent(pageUrlc); |
|||
req('ai_get_mplogin_url', logindatac).then(data=>{ |
|||
if(data == -1 || !data.login_link) return; |
|||
location.href = data.login_link; |
|||
}); |
|||
return; |
|||
} |
|||
|
|||
uni.showModal({ |
|||
title: '提示', |
|||
showCancel: false, |
|||
content: rdata.msg ? rdata.msg : '网络错误,请重试|'+res.statusCode, |
|||
success: function (rs) { |
|||
if (rs.confirm && rdata.code==CODE_LOGIN_EXIPRE) { |
|||
removeLogin(); |
|||
const pages = getCurrentPages(); |
|||
const currentPage = pages[pages.length - 1]; |
|||
let pageUrl = '/'+currentPage.route; |
|||
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5){ |
|||
uni.navigateTo({ |
|||
url: '/pages/index/index?url='+encodeURIComponent(pageUrl) |
|||
}); |
|||
}else{ |
|||
|
|||
} |
|||
return; |
|||
} |
|||
} |
|||
}); |
|||
|
|||
return resolve("-1"); |
|||
}else{ |
|||
return resolve(res.data.data); |
|||
} |
|||
}catch(e){ |
|||
uni.showModal({ |
|||
title: '提示', |
|||
showCancel: false, |
|||
content: '请求数据出错|f', |
|||
success: function (rs) { |
|||
return resolve("-1"); |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
fail(err) { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
showCancel: false, |
|||
content: '网络错误,请重试|f|'+JSON.stringify(err), |
|||
success: function (rs) { |
|||
return resolve("-1"); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function xcx_login(url, eqdata={}, method = 'POST') { |
|||
return new Promise((resolve, reject) => { |
|||
wx.login({ |
|||
success (res) { |
|||
if (res.code) { |
|||
var pdata = new Object(); |
|||
pdata.code = res.code; |
|||
req('userapi/login2/weChatLogin', pdata).then(data=>{ |
|||
uni.setStorageSync('token', data.token); |
|||
uni.setStorageSync('uuid', data.userId); |
|||
uni.setStorageSync('uuid_str', data.userIdStr); |
|||
uni.setStorageSync('nickname', data.nickname); |
|||
uni.setStorageSync('avatar', data.avatar); |
|||
uni.setStorageSync('level_id', data.level_id); |
|||
uni.setStorageSync('level_name', data.level_name); |
|||
uni.setStorageSync('avatar_full', data.avatar_full); |
|||
uni.setStorageSync('create', data.create); |
|||
if(data.is_admin) uni.setStorageSync('is_admin', data.is_admin); |
|||
|
|||
eqdata.repeat = 1; |
|||
req(url, eqdata, method).then(data=>{ |
|||
return resolve(data); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}) |
|||
} |
|||
|
|||
function toPage(path){ |
|||
if(Vue.prototype.provider == Vue.prototype.provider_weixin){ |
|||
if(path.indexOf('/index/index') == -1){ |
|||
wx.navigateTo({ |
|||
url: path |
|||
}); |
|||
}else{ |
|||
wx.reLaunch({ |
|||
url: path |
|||
}); |
|||
} |
|||
|
|||
}else{ |
|||
if(path.indexOf('/index/index') == -1){ |
|||
uni.navigateTo({ |
|||
url:path |
|||
}); |
|||
}else{ |
|||
uni.reLaunch({ |
|||
url:path |
|||
}); |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
function modelShow(content, path="",title="提示") { |
|||
uni.showModal({ |
|||
title: title, |
|||
showCancel: false, |
|||
content: content, |
|||
success: function (rs) { |
|||
if(rs.confirm && path != ""){ |
|||
toPage(path); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
Vue.prototype.$pop = {modelShow} |
|||
Vue.prototype.$func = {toPage} |
|||
Vue.prototype.$http = {req} |
|||
Vue.prototype.$trim = {trim} |
|||
|
|||
app.$mount() |
|||
// #endif
|
|||
|
|||
// #ifdef VUE3
|
|||
import { createSSRApp } from 'vue' |
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
return { |
|||
app |
|||
} |
|||
} |
|||
// #endif
|
@ -0,0 +1,72 @@ |
|||
{ |
|||
"name" : "acupuncture_register_system", |
|||
"appid" : "__UNI__72348D3", |
|||
"description" : "", |
|||
"versionName" : "1.0.0", |
|||
"versionCode" : "100", |
|||
"transformPx" : false, |
|||
/* 5+App特有相关 */ |
|||
"app-plus" : { |
|||
"usingComponents" : true, |
|||
"nvueStyleCompiler" : "uni-app", |
|||
"compilerVersion" : 3, |
|||
"splashscreen" : { |
|||
"alwaysShowBeforeRender" : true, |
|||
"waiting" : true, |
|||
"autoclose" : true, |
|||
"delay" : 0 |
|||
}, |
|||
/* 模块配置 */ |
|||
"modules" : {}, |
|||
/* 应用发布信息 */ |
|||
"distribute" : { |
|||
/* android打包配置 */ |
|||
"android" : { |
|||
"permissions" : [ |
|||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
|||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
|||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
|||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
|||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
|||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
|||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
|||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
|||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
|||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
|||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
|||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
|||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
|||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
|||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
|||
] |
|||
}, |
|||
/* ios打包配置 */ |
|||
"ios" : {}, |
|||
/* SDK配置 */ |
|||
"sdkConfigs" : {} |
|||
} |
|||
}, |
|||
/* 快应用特有相关 */ |
|||
"quickapp" : {}, |
|||
/* 小程序特有相关 */ |
|||
"mp-weixin" : { |
|||
"appid" : "", |
|||
"setting" : { |
|||
"urlCheck" : false |
|||
}, |
|||
"usingComponents" : true |
|||
}, |
|||
"mp-alipay" : { |
|||
"usingComponents" : true |
|||
}, |
|||
"mp-baidu" : { |
|||
"usingComponents" : true |
|||
}, |
|||
"mp-toutiao" : { |
|||
"usingComponents" : true |
|||
}, |
|||
"uniStatistics" : { |
|||
"enable" : false |
|||
}, |
|||
"vueVersion" : "2" |
|||
} |
@ -0,0 +1,35 @@ |
|||
{ |
|||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
|||
{ |
|||
"path": "pages/index/index", |
|||
"style": { |
|||
"navigationBarTitleText": "uni-app" |
|||
} |
|||
} |
|||
,{ |
|||
"path" : "pages/test/test", |
|||
"style" : |
|||
{ |
|||
"navigationBarTitleText": "", |
|||
"enablePullDownRefresh": false |
|||
} |
|||
|
|||
} |
|||
,{ |
|||
"path" : "pages/login/login", |
|||
"style" : |
|||
{ |
|||
"navigationBarTitleText": "", |
|||
"enablePullDownRefresh": false |
|||
} |
|||
|
|||
} |
|||
], |
|||
"globalStyle": { |
|||
"navigationBarTextStyle": "black", |
|||
"navigationBarTitleText": "uni-app", |
|||
"navigationBarBackgroundColor": "#F8F8F8", |
|||
"backgroundColor": "#F8F8F8" |
|||
}, |
|||
"uniIdRouter": {} |
|||
} |
@ -0,0 +1,46 @@ |
|||
<template> |
|||
<view class="content"> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
} |
|||
}, |
|||
onLoad() { |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.content { |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.logo { |
|||
height: 200rpx; |
|||
width: 200rpx; |
|||
margin-top: 200rpx; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
margin-bottom: 50rpx; |
|||
} |
|||
|
|||
.text-area { |
|||
display: flex; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.title { |
|||
font-size: 36rpx; |
|||
color: #8f8f94; |
|||
} |
|||
</style> |
@ -0,0 +1,22 @@ |
|||
<template> |
|||
<view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
@ -0,0 +1,22 @@ |
|||
<template> |
|||
<view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
After Width: | Height: | Size: 607 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 962 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 639 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 572 B |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 388 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 924 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 933 B |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 609 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 649 B |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 442 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,10 @@ |
|||
uni.addInterceptor({ |
|||
returnValue (res) { |
|||
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) { |
|||
return res; |
|||
} |
|||
return new Promise((resolve, reject) => { |
|||
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1])); |
|||
}); |
|||
}, |
|||
}); |
@ -0,0 +1,76 @@ |
|||
/** |
|||
* 这里是uni-app内置的常用样式变量 |
|||
* |
|||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 |
|||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 |
|||
* |
|||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 |
|||
*/ |
|||
|
|||
/* 颜色变量 */ |
|||
|
|||
/* 行为相关颜色 */ |
|||
$uni-color-primary: #007aff; |
|||
$uni-color-success: #4cd964; |
|||
$uni-color-warning: #f0ad4e; |
|||
$uni-color-error: #dd524d; |
|||
|
|||
/* 文字基本颜色 */ |
|||
$uni-text-color:#333;//基本色 |
|||
$uni-text-color-inverse:#fff;//反色 |
|||
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 |
|||
$uni-text-color-placeholder: #808080; |
|||
$uni-text-color-disable:#c0c0c0; |
|||
|
|||
/* 背景颜色 */ |
|||
$uni-bg-color:#ffffff; |
|||
$uni-bg-color-grey:#f8f8f8; |
|||
$uni-bg-color-hover:#f1f1f1;//点击状态颜色 |
|||
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 |
|||
|
|||
/* 边框颜色 */ |
|||
$uni-border-color:#c8c7cc; |
|||
|
|||
/* 尺寸变量 */ |
|||
|
|||
/* 文字尺寸 */ |
|||
$uni-font-size-sm:12px; |
|||
$uni-font-size-base:14px; |
|||
$uni-font-size-lg:16; |
|||
|
|||
/* 图片尺寸 */ |
|||
$uni-img-size-sm:20px; |
|||
$uni-img-size-base:26px; |
|||
$uni-img-size-lg:40px; |
|||
|
|||
/* Border Radius */ |
|||
$uni-border-radius-sm: 2px; |
|||
$uni-border-radius-base: 3px; |
|||
$uni-border-radius-lg: 6px; |
|||
$uni-border-radius-circle: 50%; |
|||
|
|||
/* 水平间距 */ |
|||
$uni-spacing-row-sm: 5px; |
|||
$uni-spacing-row-base: 10px; |
|||
$uni-spacing-row-lg: 15px; |
|||
|
|||
/* 垂直间距 */ |
|||
$uni-spacing-col-sm: 4px; |
|||
$uni-spacing-col-base: 8px; |
|||
$uni-spacing-col-lg: 12px; |
|||
|
|||
/* 透明度 */ |
|||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 |
|||
|
|||
/* 文章场景相关 */ |
|||
$uni-color-title: #2C405A; // 文章标题颜色 |
|||
$uni-font-size-title:20px; |
|||
$uni-color-subtitle: #555555; // 二级标题颜色 |
|||
$uni-font-size-subtitle:26px; |
|||
$uni-color-paragraph: #3F536E; // 文章段落颜色 |
|||
$uni-font-size-paragraph:15px; |
@ -0,0 +1,44 @@ |
|||
用户端 静态页面 |
|||
1.首页 |
|||
2.选择就诊人页面 |
|||
3.新增就诊人信息页面 |
|||
4.预约挂号页面 |
|||
5.个人中心页面 |
|||
6.修改个人资料页面 |
|||
7.就诊人列表页面 |
|||
8.修改就诊人信息页面 |
|||
9.预约列表页面 |
|||
10.预约详情页面 |
|||
|
|||
医生端 静态页面 |
|||
1.添加医生信息页面 |
|||
(1)选择医院使用腾讯位置服务接口 |
|||
https://lbs.qq.com/service/webService/webServiceGuide/search/webServiceSuggestion |
|||
2.添加出诊医院页面 |
|||
3.等待就诊页面 |
|||
4.就诊中页面 |
|||
5.就诊完毕页面 |
|||
6.个人中心页面 |
|||
7.医生信息编辑页面 |
|||
8.医院管理页面 |
|||
9.出诊安排页面 |
|||
10.诊疗设置 |
|||
11.患者预约页面 |
|||
12.患者预约码页面 |
|||
13.患者详情页面 |
|||
14.预约详情页面 |
|||
15.助手管理列表页面 |
|||
16.助手邀请码页面 |
|||
17.助手权限页面 |
|||
18.助手详情页面 |
|||
19.助手申请表单页面 |
|||
20.助手申请等待审核页面 |
|||
21.挂号管理列表页面 |
|||
22.挂号退号搜索结果列表页面 |
|||
23.新建档案并录入挂号页面 |
|||
24.追加/减少针灸次数页面 |
|||
25.导出针灸记录页面 |
|||
|
|||
已完成 |
|||
1.针灸挂号系统需求确认 |
|||
2.针灸挂号系统前端框架搭建 |
@ -0,0 +1,84 @@ |
|||
一 用户端 |
|||
1.用户表 user_list |
|||
id |
|||
doctor_id 医生id |
|||
avator 头像 |
|||
nick 昵称 |
|||
openid 公众号openid |
|||
create 创建时间 |
|||
|
|||
2.就诊用户人表 visitor_list |
|||
id |
|||
doctor_id 医生id |
|||
uid 用户id |
|||
name 姓名 |
|||
idcard_ext 身份证后四位 |
|||
last_visit_time 最后就诊时间 |
|||
create 添加时间 |
|||
status 0 正常 1已删除 |
|||
|
|||
3.就诊表 visit_list |
|||
id |
|||
doctor_id 医生id |
|||
hid 医院id |
|||
vuid 就诊用户人id |
|||
date 时间 2024-03-01 |
|||
visit_time 就诊预约时间 07:30-08:30 |
|||
phone 手机号 |
|||
status 0 待就诊 1就诊中 2就诊完成 |
|||
|
|||
4.针灸剩余次数表 acupuncture_remain_list |
|||
id |
|||
vid 就诊用户人id |
|||
hid 医院id |
|||
total_num 总针灸次数 |
|||
remain_num 剩余针灸次数 |
|||
|
|||
4.预约表 appointment_list |
|||
id |
|||
vid 就诊人id |
|||
date 日期 |
|||
time 时间 |
|||
|
|||
|
|||
二 医生端 |
|||
|
|||
1.医生表 doctor_list |
|||
id |
|||
name 姓名 |
|||
phone 手机号 |
|||
invite_code 邀请码 |
|||
desc 简介 |
|||
openid 公众号openid |
|||
detail 个人详细介绍 |
|||
create 注册时间 |
|||
|
|||
2.医院表 hospital_list |
|||
id |
|||
doctor_id 医生id |
|||
province 省 |
|||
cite 市 |
|||
short_name 医院简称 |
|||
departments 科室部门 |
|||
morning_worktime 上午上班时间 上下班时间用英文逗号分隔 |
|||
afternoon_end 下午上班时间 上下班时间用英文逗号分隔 |
|||
holiday_work_type 0 否 1 是 节假日是否停诊 |
|||
acupuncture_num 一次挂号针灸次数 |
|||
acupuncture_time 每次针灸时长 |
|||
bed_num 时间段可预约床位数 |
|||
register_exipre 挂号过期时间,单位小时 |
|||
notice 就诊提醒 |
|||
create 创建时间 |
|||
status 0 就诊中 1 已停诊 |
|||
|
|||
3.每周出诊安排表 week_worktimes |
|||
id |
|||
hid |
|||
week_day |
|||
type 0 休息 1 上午上班 2 下午上班 3 全天出诊 |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|