更新小程序仓库

This commit is contained in:
zoujiandong
2023-11-17 09:51:35 +08:00
parent 13f54a26df
commit 4506940c2d
936 changed files with 60022 additions and 0 deletions
+396
View File
@@ -0,0 +1,396 @@
// index.js
// 获取应用实例
const app = getApp();
import {homeData} from "../../api/index.js"
import{delDoctor} from "../../api/familyDoc"
import {popup} from "../../api/common"
import {setBarData,throttle} from "../../utils/util"
let urlHost=app.hostConfig().agreehost;
Page({
data: {
show:false,
showCode:false,
isOld:false,
codeMsg:'',
showEntryTip:false,
showEntryTip_second:false,
beforeClose(action){
return new Promise((resolve) => {
if (action === 'confirm') {
resolve(true);
} else {
// 拦截取消操作
resolve(false);
}
})
},
showAlert:false,
showIntro:false,
banner:[],
recommend_doctor:[],
my_doctor:[],
module:[],
delId:'',
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static',
popupData:null
},
confirm:throttle(function(event){
if(event.detail){
this.handelDelDoctor();
}
}),
goH5:throttle(function(event){
let {url,name}=event.currentTarget.dataset;
if(url.indexOf("http")!=-1){
let urlName=(decodeURIComponent(url))
if(this.verifySuffix(urlName)){
wx.navigateTo({
url:'/'+url+'&name='+encodeURIComponent(name)
})
}else{
app.method.navigateTo({
url:"/pages/linkPage/linkPage?url="+encodeURIComponent(url)
})
}
}else{
wx.navigateToMiniProgram({
appId: 'wxdee7006582529713',
path:url,
envVersion: 'release',
success(res) {
// 打开成功
}
})
}
}),
verifySuffix(fileName) {
let suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`
let regular = new RegExp(`.*\.${suffix}`)
return regular.test(fileName)
},
handlePopup(){
popup({
popup_type:2
}).then(data=>{
if(data.length!=0){
this.setData({
popupData:data[0].popup_content
});
if(data[0].popup_content.hasOwnProperty("inquiry_type")){
this.setData({
isOld:false
})
}else{
this.setData({
isOld:true
})
}
let showFuli=wx.getStorageSync('showFuli');
console.log("showFuli"+showFuli)
if(!showFuli){
this.setData({
show:true
});
}
}
})
},
handelDelDoctor(){
let {delId,my_doctor}=this.data;
delDoctor(delId).then(data=>{
for (let i = 0; i < my_doctor.length; i++) {
if(my_doctor[i].doctor_id==delId){
my_doctor.splice(i,1);
this.setData({
my_doctor:my_doctor
})
}
}
wx.showToast({
title: '成功删除该医生',
icon:"none"
});
})
},
confirmDel(event){
let id=event.currentTarget.dataset.id;
this.setData({
showAlert:true,
delId:id
})
},
handleMyDoctor(){
myDoctor({
my_doctor_type:1,
page:1,
per_page:3
}).then((data)=>{
let result=data.data;
this.setData({
my_doctor:result
})
})
},
goMydoctor:throttle(function(){
app.method.navigateTo({
url: '/pages/myDoctor/myDoctor',
})
}),
onConfirmEntry(){
//wx.setStorageSync('hasEntry', true);
wx.showTabBar({
animation: true
})
},
onCloseEntry(){
this.setData({
showEntryTip_second:true,
showEntryTip:true
})
},
onConfirmEntry_second(){
this.setData({
showEntryTip_second:false,
//showEntryTip:false,
});
//wx.setStorageSync('hasEntry', true);
// wx.showTabBar({
// animation: true
// })
},
onCloseEntry_second(){
wx.showTabBar({
animation: true
});
this.setData({
showEntryTip_second:false,
showEntryTip:false,
});
wx.exitMiniProgram({success: (res) => {}})
},
goAgreement:throttle(function(event){
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url:"/pages/linkPage/linkPage?url="+encodeURIComponent(urlHost+'/basic/file/agreement.htm?id='+id)
})
}),
goCheck:throttle(function(){
// let that=this;
// wx.scanCode({
// onlyFromCamera: true,
// scanType:['qrCode','barCode','datamatrix','pdf417'],
// success (res) {
// const reg=/^SD[A-Z]{2}\d{2}[A-Z]\d{5}$/
// if(res.result.test(reg)){
// that.setData({
// codeMsg:res.result,
// showCode:true
// })
// }
// }
// })
app.method.navigateTo({
url: '/pages/sugarDetail/sugarDetail',
})
}),
goMall:throttle(function(){
wx.navigateToMiniProgram({
appId: 'wxdee7006582529713',
path:"/pages/home/dashboard/index",
envVersion: 'release',
success(res) {
// 打开成功
}
})
}),
freeConsult:throttle(function(){
app.method.navigateTo({
url: '/pages/expertConsult/expertConsult?type=free'
})
}),
handleFocus:throttle(function(event){
wx.hideKeyboard();
if(event.detail){
app.method.navigateTo({
url: '/pages/search/search',
})
}
}),
goExpertDetail:throttle(function(event){
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url: '/pages/expertDetail/expertDetail?doctor_id='+id
})
}),
goquickExpert:throttle(function(){
app.method.navigateTo({
url: '/pages/quickConsult/quickConsult'
})
}),
goExpertAndCloseOld:throttle(function(){
app.method.navigateTo({
url:'/pages/expertConsult/expertConsult'
})
this.onClickHide();
}),
goExpertAndClose:throttle(function(event){
let id=event.currentTarget.dataset.id;
let url='';
if(id==1){
url='/pages/index/expertConsult'
}else if(id==2){
url='pages/quickConsult/quickConsult'
}else if(id==3){
url='/pages/expertConsult/expertConsult?type=free'
}else if(id==4){
url='/pages/quickConsult/quickConsult?inquiry_type=4'
}else if(id==5){
url='pages/sugarDetail/sugarDetail'
}
if(id!==6){
app.method.navigateTo({
url:url //'/pages/expertConsult/expertConsult'
})
}
this.onClickHide();
}),
goExpert:throttle(function(){
app.method.navigateTo({
url: '/pages/expertConsult/expertConsult'
})
}),
goconsultandbuy:throttle(function(){
app.method.navigateTo({
url: '/pages/quickConsult/quickConsult?inquiry_type=4'
})
}),
watchBack(){
let total=app.globalData.totalUnread;
setBarData(total)
},
onClickHide() {
this.setData({ show: false });
wx.showTabBar();
wx.setStorageSync('showFuli',true);
},
getData(){
homeData().then((data)=>{
let result=this.data;
for (const key in data) {
this.setData({
[key]:data[key]
})
};
})
},
closeIntro(){
this.setData({
showIntro:false
});
wx.showTabBar({
animation: true,
});
wx.setStorageSync('hasIntro',true)
},
onLoad(options) {
this.setData({
beforeClose: this.data.beforeClose.bind(this),
})
wx.removeTabBarBadge({
index:1
});
//this.handleMyDoctor();
},
onShow(){
let isIntro=wx.getStorageSync('hasIntro');
//let isEntry=wx.getStorageSync('hasEntry');
app.watch(this.watchBack.bind(this))//注册监听
this.setData({
img_host:app.hostConfig().imghost
});
if(!isIntro){
this.setData({
showIntro:true,
});
wx.hideTabBar({
animation: true
})
};
// if(!isEntry){
// this.setData({
// showEntryTip:true
// });
// wx.hideTabBar({
// animation: true
// })
// }else{
// this.setData({
// showEntryTip:false
// });
// wx.showTabBar({
// animation: true
// })
// }
this.getData();
this.handlePopup();
app.globalData.origion=0;
if(!app.globalData.totalUnread && app.globalData.totalUnread!=0){
app.imLogin();
}else{
let total=app.globalData.totalUnread;
setBarData(total)
}
wx.getPrivacySetting({
success: res => {
console.log(res)
if (res.needAuthorization) {
// 需要弹出隐私协议
this.setData({
showEntryTip:true
})
wx.hideTabBar({
animation: true
})
} else {
this.setData({
showEntryTip:false
})
wx.showTabBar({
animation: true
})
}
},
fail: () => {},
complete: () => {}
})
},
onShareTimeline(){
return {
title: '肝胆相照互联网医院,复诊购药一站式服务',
query: '/pages/index/index'
}
},
onShareAppMessage() {
return {
title: '肝胆相照互联网医院,复诊购药一站式服务',
path: '/pages/index/index'
}
}
})
+10
View File
@@ -0,0 +1,10 @@
{
"usingComponents": {
"nav-bar": "/components/navbar/navbar",
"van-overlay": "@vant/weapp/overlay/index",
"van-dialog": "@vant/weapp/dialog/index",
"dialog":"/components/dialog/dialog"
},
"navigationStyle":"custom"
}
+185
View File
@@ -0,0 +1,185 @@
<!--index.wxml-->
<wxs src="../../filters/filter.wxs" module="moduleFilter"></wxs>
<van-overlay show="{{ show }}" lock-scroll="{{true}}" root-portal="{{true}}" z-index="999" custom-class="mask">
<view class="fuliwrapper">
<view class="fulititle">新人红包福利</view>
<view class="fulicontent">
<view class="fuliprice">¥<text class="price" decode="true">&nbsp;{{moduleFilter.formatMoney(popupData.coupon_price)}}</text></view>
<!-- "application_scope": 1, // 适用范围(1:全部 2:快速问诊 3:专家问诊 4:公益问诊 5:问诊购药) -->
<view class="rightbox">
<view class="type" wx:if="{{popupData.application_scope==1}}">全场通用</view>
<view class="type" wx:elif="{{popupData.application_scope==2}}">问诊适用</view>
<view class="type" wx:elif="{{popupData.application_scope==3}}">按品牌适用</view>
<view class="type" wx:elif="{{popupData.application_scope==4}}">按类别适用</view>
<view class="type" wx:elif="{{popupData.application_scope==5}}">单品适用</view>
<view class="expire" wx:if="{{popupData.valid_type==2 && popupData.valid_days>0}}">有效期{{popupData.valid_days}}天</view>
<!-- <view class="expire" wx:elif="{{popupData.valid_type==1}}">有效期:{{popupData.valid_end_time}}</view> -->
</view>
<!-- <view class="rightbox" wx:else>
<view class="type" wx:if="{{popupData.application_scope==1}}">所有问诊类型</view>
<view class="type" wx:elif="{{popupData.application_scope==2}}">快速问诊</view>
<view class="type" wx:elif="{{popupData.application_scope==3}}">专家问诊</view>
<view class="type" wx:elif="{{popupData.application_scope==4}}">公益问诊</view>
<view class="type" wx:elif="{{popupData.application_scope==5}}">问诊购药</view>
<view class="expire" wx:if="{{popupData.valid_type==2 && popupData.valid_days>0}}">有效期{{popupData.valid_days}}天</view>
</view> -->
</view>
<view class="fulibtn" bindtap="goExpertAndCloseOld">专家问诊</view>
<!-- <view wx:if="{{!isOld}}">
<view class="fulibtn" bindtap="goExpertAndClose" data-id="1" wx:if="popupData.application_scope==2 && popupData.inquiry_type==1">专家问诊</view>
<view class="fulibtn" bindtap="goExpertAndClose" wx:elif="popupData.application_scope==2 && popupData.inquiry_type==2" data-id="2">快速问诊</view>
<view class="fulibtn" bindtap="goExpertAndClose" wx:elif="popupData.application_scope==2 && popupData.inquiry_type==3" data-id="3">公益问诊</view>
<view class="fulibtn" bindtap="goExpertAndClose" wx:elif="popupData.application_scope==2 && popupData.inquiry_type==4" data-id="4">问诊购药</view>
<view class="fulibtn" bindtap="goExpertAndClose" wx:elif="popupData.application_scope==2 && popupData.inquiry_type==5" data-id="5">检测</view>
<view class="fulibtn" bindtap="goExpertAndClose" wx:else data-id="6">去使用</view>
</view>
<view wx:else>
<view class="fulibtn" bindtap="goExpertAndCloseOld">专家问诊</view>
</view> -->
<image src="{{img_host+'/fulibg.png'}}" class="fulibg" lazy-load="true"></image>
<image src="{{img_host+'/closefuli.png'}}" class="closefuli" bindtap="onClickHide"></image>
</view>
</van-overlay>
<van-overlay show="{{ showIntro }}" lock-scroll="{{true}}" z-index="9999" custom-class="mask">
<view class="introbox">
<image src="{{img_host+'/intro.png'}}" class="introimg" mode='widthFix'></image>
<view class="btnbox">
<view class="btn" bindtap="closeIntro">
我知道了
</view>
</view>
</view>
</van-overlay>
<nav-bar bind:handleFocus="handleFocus"></nav-bar>
<view class="container">
<view class="containIndex">
<view class="wenzhen">
<view class="wenzhenbox">
<view class="wenzhencell" bindtap="goquickExpert">
<view class="row">
<view>快速问诊</view>
<image src="{{img_host+'/kswz.png'}}"></image>
</view>
<view class="desc">
5分钟接诊不耽误
</view>
</view>
<view class="wenzhencell" bindtap="goExpert">
<view class="row">
<view>专家问诊</view>
<image src="{{img_host+'/zjwz.png'}}"></image>
</view>
<view class="desc">
专业医生,服务保障
</view>
</view>
</view>
<view class="buybox" bindtap="goconsultandbuy">
<view class="left">
<view>问诊购药</view>
<view class="desc">在线复诊,正品无忧,送药到家</view>
</view>
<view class="right">
<image src="{{img_host+'/yao.png'}}"></image>
</view>
</view>
</view>
<view class="cellbox">
<view class="cell" bindtap="freeConsult">
<image src="{{img_host+'/gywz.png'}}"></image>
<view class="name">公益问诊</view>
</view>
<view class="cell" bindtap="goMall">
<image src="{{img_host+'/gdmall.png'}}"></image>
<view class="name">肝胆商城</view>
</view>
<view class="cell" bindtap="goCheck">
<image src="../../assets/images/tangzu.png"></image>
<view class="name">糖组检测</view>
</view>
</view>
<view class="ad">
<swiper class="swiper" indicator-dots="{{true}}" circular="{{true}}" indicator-active-color="#3CC7C0" autoplay="{{true}}" interval="3000">
<block wx:for="{{banner}}" wx:key="banner_id">
<swiper-item>
<view class="swiper-item">
<image class="swiperimg" src="{{item.banner_path}}" data-url="{{item.banner_link}}" data-name="{{item.banner_name}}" bindtap="goH5"></image>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class="mydoctor" wx:if="{{my_doctor.length>0}}">
<view class="titlebox">
<view class="title">我的医生</view>
<view class="more" wx:if="{{my_doctor.length>5}}" bindtap="goMydoctor">更多<image src="{{img_host+'/right.png'}}"></image>
</view>
</view>
<view class="page-section-spacing">
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%" show-scrollbar="false" enhanced="true">
<view class="scroll-view-item_H" wx:for="{{my_doctor}}" wx:key="doctor_id" bindtap="goExpertDetail" data-id="{{item.doctor_id}}">
<view class="close" catchtap="confirmDel" data-id="{{item.doctor_id}}" data-index="{{index}}">
<image src="{{img_host+'/close.png'}}"></image>
</view>
<view class="left">
<image src="{{item.avatar}}" wx:if="{{item.avatar}}" mode="aspectFill"></image>
<image src="{{img_host+'/doctor_avatar.png'}}" wx:else></image>
</view>
<view class="right">
<view class="namebox mydoctorbox">
<view class="name">{{item.user_name}}</view>
<view class="position">{{item.doctor_title}}</view>
</view>
<view class="hospital mydoctor">{{item.hospital_name}}</view>
<view class="service">{{item.days}}天内服务过您</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="recommend" wx:if="{{recommend_doctor.length>0}}">
<view class="titlebox">
<view class="title">推荐医生</view>
</view>
<view class="viewbox">
<view class="viewcell" wx:for="{{recommend_doctor}}" wx:key="doctor_id" bindtap="goExpertDetail" data-id="{{item.doctor_id}}">
<view class="left">
<image src="{{item.avatar}}" wx:if="{{item.avatar}}" mode="aspectFill"></image>
<image src="{{img_host+'/doctor_avatar.png'}}" wx:else></image>
</view>
<view class="right">
<view class="namebox">
<view class="name">{{item.user_name}}</view>
<view class="type" wx:if="{{item.hospital_level_name != '未知'&& item.hospital_level_name}}">{{item.hospital_level_name}}</view>
<view class="type" wx:if="{{item.multi_point_status == 1 && item.multi_point_enable==1}}">可处方</view>
</view>
<view class="hospital"><text class="doctor_title" wx:if="{{item.doctor_title}}">{{item.doctor_title}}</text><text>{{item.department_custom_name}}</text></view>
<view class="hospital">{{item.hospital_name}}</view>
<view class="goodjob" wx:if="{{item.be_good_at}}">擅长:{{item.be_good_at}}</view>
<view class="price" wx:if="{{moduleFilter.formatInquiryType(item.doctor_inquiry_config)==1}}">公益问诊:<text>¥{{item.free_clinic_price}}</text></view>
<view class="price" wx:elif="{{moduleFilter.formatInquiryType(item.doctor_inquiry_config)==2}}">专家问诊:<text>¥{{item.price}}</text></view>
<view class="price" wx:else></view>
</view>
</view>
</view>
</view>
</view>
</view>
<dialog bind:confirm="confirm" showDialog="{{showAlert}}" message="确定删除该服务过的医生?"></dialog>
<dialog showDialog="{{showCode}}" message="{{codeMsg}}"></dialog>
<van-dialog zIndex="9999" use-slot title="温馨提示" show="{{ showEntryTip }}" show-cancel-button confirm-button-text="同意并继续" cancel-button-text="不同意" confirm-button-color="#3CC7C0" bind:confirm="onConfirmEntry" bind:cancel="onCloseEntry" before-close="{{beforeClose}}" confirm-button-open-type="agreePrivacyAuthorization">
<view class="entrymsg">
<view> 亲爱的用户,感谢您信任并使用肝胆相照互联网医院!我们依据最新法律法规的要求,制定了<text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》</text>。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。</view>
<view>如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。</view>
</view>
</van-dialog>
<van-dialog zIndex="99999" title="温馨提示" show="{{ showEntryTip_second }}" message="很抱歉,如您不同意《隐私协议》,可能无法继续正常使用我们的服务,请您先同意哦~" show-cancel-button confirm-button-text="好的" cancel-button-text="不同意" confirm-button-color="#3CC7C0" bind:confirm="onConfirmEntry_second" bind:cancel="onCloseEntry_second">
</van-dialog>
File diff suppressed because one or more lines are too long