This commit is contained in:
zoujiandong 2025-12-25 15:49:02 +08:00
parent a52add7452
commit 8689fad91a
15 changed files with 219 additions and 24 deletions

19
app.js
View File

@ -63,7 +63,10 @@ App({
} else {
this.globalData.origion = 0;
};
this.imLogin(options);
if(this.isHasToken()){
this.imLogin(options);
}
},
method: router,
@ -160,6 +163,20 @@ App({
onKickOut(event) {
this.handleLogout();
},
isHasToken(){
let token='';
const { envVersion } = wx.getAccountInfoSync().miniProgram;
if(envVersion=='release'){
token = wx.getStorageSync('AUTH_TOKEN');
}else{
token = wx.getStorageSync('DEV_AUTH_TOKEN');
}
if(token){
return true
}else {
return false;
}
},
async handleLogout() {
if (wx.$TUIKit) {
wx.$TUIKit.destroy();

BIN
assets/images/cert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -48,6 +48,12 @@ Page({
}
}),
goH5:throttle(function(event){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
return
}
let {url,name,type,title}=event.currentTarget.dataset;
if(url.indexOf("http")!=-1){
let urlName=(decodeURIComponent(url))
@ -150,9 +156,18 @@ Page({
})
},
goMydoctor:throttle(function(){
app.method.navigateTo({
url: '/patient/pages/myDoctor/myDoctor',
})
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/patient/pages/myDoctor/myDoctor',
})
}),
onConfirmEntry(){
@ -192,12 +207,24 @@ Page({
wx.exitMiniProgram({success: (res) => {}})
},
goAgreement:throttle(function(event){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url:"/patient/pages/linkPage/linkPage?url="+encodeURIComponent(urlHost+'/basic/file/agreement.htm?id='+id)
})
}),
goCheck:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
// let that=this;
// wx.scanCode({
// onlyFromCamera: true,
@ -218,6 +245,12 @@ Page({
})
}),
goMall:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
wx.navigateToMiniProgram({
appId: 'wxdee7006582529713',
path:"/pages/home/dashboard/index",
@ -228,12 +261,24 @@ Page({
})
}),
freeConsult:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/patient/pages/expertConsult/expertConsult?type=free'
})
}),
handleFocus:throttle(function(event){
wx.hideKeyboard();
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
if(event.detail){
app.method.navigateTo({
url: '/patient/pages/search/search',
@ -242,23 +287,47 @@ Page({
}),
goExpertDetail:throttle(function(event){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url: '/patient/pages/expertDetail/expertDetail?doctor_id='+id
})
}),
goquickExpert:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url:'/patient/pages/expertConsult/expertConsult' //'/patient/pages/quickConsult/quickConsult'
})
}),
goExpertAndCloseOld:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url:'/patient/pages/expertConsult/expertConsult'
})
this.onClickHide();
}),
goExpertAndClose:throttle(function(event){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
let id=event.currentTarget.dataset.id;
let url='';
if(id==1){
@ -284,11 +353,23 @@ Page({
// title: '敬请期待',
// icon:'none'
// })
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/patient/pages/hivConsult/hivConsult'
})
}),
goconsultandbuy:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/patient/pages/expertConsult/expertConsult?type=buyYao'
})
@ -298,11 +379,23 @@ Page({
}),
goHealth:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/healthyService/pages/healthyIntro/healthyIntro'
})
}),
goVisit:throttle(function(){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
app.method.navigateTo({
url: '/healthyService/pages/visitList/visitList'
})
@ -339,6 +432,12 @@ goVisit:throttle(function(){
onLoad(options) {
console.log("index onload");
if(options.doctor_id){
if(!this.isHasToken()){
wx.reLaunch({
url: '/patient/pages/login/login',
})
}
wx.redirectTo({
url: '/patient/pages/expertDetail/expertDetail?doctor_id='+options.query.doctor_id,
})
@ -352,6 +451,20 @@ goVisit:throttle(function(){
});
//this.handleMyDoctor();
},
isHasToken(){
let token='';
const { envVersion } = wx.getAccountInfoSync().miniProgram;
if(envVersion=='release'){
token = wx.getStorageSync('AUTH_TOKEN');
}else{
token = wx.getStorageSync('DEV_AUTH_TOKEN');
}
if(token){
return true
}else {
return false;
}
},
onShow(){
let isIntro=wx.getStorageSync('hasIntro');
//let isEntry=wx.getStorageSync('hasEntry');
@ -388,7 +501,10 @@ goVisit:throttle(function(){
app.globalData.origion=0;
if(!app.globalData.totalUnread && app.globalData.totalUnread!=0){
app.imLogin();
if(this.isHasToken()){
app.imLogin();
}
}else{
let total=app.globalData.totalUnread;
setBarData(total)

View File

@ -56,28 +56,26 @@
<nav-bar bind:handleFocus="handleFocus"></nav-bar>
<view class="container">
<view class="containIndex">
<view class="wenzhen">
<view class="wenzhen" >
<view class="wenzhenbox">
<view class="wenzhencell" bindtap="goquickExpert">
<view class="row">
<view class="name_title">找专家</view>
<!-- <image src="{{img_host+'/find_expert.png'}}" style="width:80rpx;height:80rpx"></image> -->
<image src="{{img_host+'/findexpert.png'}}" mode="" style="width:312rpx;height:182rpx" class="bg"/>
</view>
<view class="desc">
30多位主任医师
200多位主任医师
</view>
<view class="desc">专业医生,服务保障</view>
</view>
<!-- goExpert -->
<view class="wenzhencell" bindtap="goconsultandbuy">
<view class="wenzhencell" bindtap="goconsultandbuy">
<view class="row">
<view class="name_title">问诊购药</view>
<image src="{{img_host+'/buyandask.png'}}" mode="" style="width:312rpx;height:182rpx" class="bg"/>
<!-- <image src="{{img_host+'/hiv.png'}}" style="width:80rpx;height:80rpx"></image> -->
<image src="{{img_host+'/buyandask.png'}}" mode="" style="width:312rpx;height:182rpx;right:0;left:auto" class="bg"/>
</view>
<view class="desc">
30多种常用处方药品
50多种常用处方药品
</view>
<view class="desc">
正品无忧,品质护航

View File

@ -21,6 +21,7 @@ Page({
showDialog:false,
currentData:0,
avatar: '',
register_cert:'',
user_name: '',
doctor_title: '',
doctor_id: '',
@ -96,6 +97,13 @@ Page({
url:'/patient/pages/videoList/videoList'
})
}),
previewImg(){
let {register_cert}=this.data;
wx.previewImage({
current: 'register_cert', // 当前显示图片的http链接
urls: [register_cert] // 需要预览的图片http链接列表
})
},
goSelectPatient() {
//判断是否能接诊

View File

@ -1,6 +1,7 @@
{
"usingComponents": {
"van-rate": "@vant/weapp/rate/index",
"van-image": "@vant/weapp/image/index",
"van-popup": "@vant/weapp/popup/index",
"dialog":"../../../components/dialog/dialog",
"nav":"../../../components/nav/nav"

View File

@ -404,6 +404,25 @@
<view class="line"></view>
</view>
<view class="borderbox" wx:if="{{register_cert}}">
<view class="rowintro">
<image src="../../../assets/images/cert.png" style="width:36rpx"></image>
<text>医师注册证</text>
</view>
<view class="goodjob" style="margin-top:20rpx">
<van-image
width="100"
height="100"
fit="contain"
bindtap="previewImg"
src="{{register_cert}}"
/>
</view>
<view class="line"></view>
</view>
</view>
</view>
</van-popup>

View File

@ -56,6 +56,18 @@ Page({
url:"/patient/pages/linkPage/linkPage?url="+encodeURIComponent(event.currentTarget.dataset.url)
})
}),
onScroll(event) {
wx.createSelectorQuery().select('#scroller')
.boundingClientRect((res) => {
// console.log(event.detail.scrollTop)
if(event.detail.scrollTop>1400){
this.lower();
}
}).exec();
},
lower(e) {
let {lock}=this.data;
let addPage=this.data.page+1;

View File

@ -1,7 +1,7 @@
<!--patient/pages/kepuList/kepuList.wxml-->
<nav navName="{{title}}"></nav>
<view class="scrollwraper">
<scroll-view scroll-y style="width: 100%;height:100%" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="200" refresher-enabled="true" bindscrolltolower="lower" id="scroller" bounces="false">
<scroll-view scroll-y style="width: 100%;height:100%" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="200" refresher-enabled="true" bindscrolltolower="lower" id="scroller" bounces="false" bindscroll="onScroll">
<view class="cell" wx:for="{{list}}" wx:key="article_id" bind:tap="goArticle" data-url="{{item.article_url}}">
<view class="left">
<view class="title">{{item.article_title}}</view>

View File

@ -99,6 +99,7 @@ Page({
const {
file
} = event.detail;
console.log(file)
this.setData({
showCrop:true,
src:file.url
@ -204,6 +205,7 @@ Page({
showCrop:false
})
this.cropper.getImg((obj) => {
console.log(obj)
this.upload(obj)
});
},

View File

@ -51,7 +51,6 @@
"tabIndent": "insertSpaces",
"tabSize": 2
},
"libVersion": "2.30.2",
"packOptions": {
"ignore": [],
"include": []

View File

@ -6,5 +6,5 @@
"bigPackageSizeSupport": false
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "3.3.0"
"libVersion": "3.9.3"
}

View File

@ -26,9 +26,6 @@
SDKAPPID='1600027911';
break;
case 'trial': //体验版环境
// host =`${Hosts.host_prod}`;
// imghost=`${Hosts.img_prod}`;
// agreehost=`${Hosts.agree_prod}`
host = `${Hosts.host_dev}`;
imghost=`${Hosts.img_dev}`;
agreehost=`${Hosts.agree_dev}`;

View File

@ -133,6 +133,10 @@ function request(url, method, data, loding = false) {
reject(res.data);
},
fail: function (res) {
if (loding) {
wx.hideLoading()
wx.stopPullDownRefresh();
}
console.log(res)
console.log(2222222222222222);
// wx.showToast({

View File

@ -1,11 +1,33 @@
// router.js
//import {getCurrentPageUrl} from "./getUrl"
module.exports = {
navigateTo(object) {
let pages = getCurrentPages();
let len = pages.length;
let dlt = 0;
let cur_url=object.url;
let pages = getCurrentPages();
let len = pages.length;
let dlt = 0;
let cur_url=object.url;
// let token='';
// const { envVersion } = wx.getAccountInfoSync().miniProgram;
// if(envVersion=='release'){
// token = wx.getStorageSync('AUTH_TOKEN');
// }else{
// token = wx.getStorageSync('DEV_AUTH_TOKEN');
// };
// if(!token){
// if(cur_url.indexOf('/mobileLogin/mobileLogin')!=-1 || cur_url.indexOf('/linkPage/linkPage')!=-1 || cur_url.indexOf('patient/pages/login/login')!=-1 || cur_url.indexOf('index/index') !=-1){
// AnimatorControllerStateModel.log(111)
// wx.reLaunch({
// url: '/patient/pages/login/login'
// });
// }
// };
object.fail=function(error){
console.log(error)