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
+120 -4
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)
+7 -9
View File
@@ -56,33 +56,31 @@
<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>
</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>
</view>
</view>
</view>
<!-- <view class="buybox" bindtap="goconsultandbuy">
<view class="left">