This commit is contained in:
haomingming
2023-03-28 20:52:22 +08:00
parent 69df3bf6b3
commit 5ba50e4e61
58 changed files with 1122 additions and 347 deletions
+40
View File
@@ -1,3 +1,5 @@
import { API } from './../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
@@ -7,5 +9,43 @@ Page({
},
height: app.globalData.height,
visible: false,
list: [],
current_page: 0,
total: 0,
per_page: 0,
last_page: 0,
},
onShow(){
this.getList();
},
getList(){
let current_page = this.data.current_page;
current_page = current_page + 1;
this.setData({
current_page: current_page
})
let list = this.data.list;
api.getDoctorMessageService({page: current_page}).then(response => {
console.log(response);
this.setData({
list: list.concat(response.data.data),
current_page: response.data.current_page,
total: response.data.total,
per_page: response.data.per_page,
last_page: response.data.last_page,
})
}).catch(errors => {console.error(errors);})
},
onReachBottom() {
console.log('===触底了!!===');
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
this.getList()
}
},
putMessageReadNoticeAll(){
api.putMessageReadNoticeAll({notice_type: 1}).then(response => {
console.log(response);
}).catch(errors => {console.error(errors);})
}
})
+6 -2
View File
@@ -2,6 +2,10 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"van-image": "@vant/weapp/image/index"
}
"van-image": "@vant/weapp/image/index",
"van-divider": "@vant/weapp/divider/index",
"van-empty": "@vant/weapp/empty/index"
},
"enablePullDownRefresh": false,
"onReachBottomDistance": 50
}
+37 -8
View File
@@ -2,7 +2,30 @@
<view class="container">
<view class="list">
<view class="item">
<view class="item" wx:for="{{list}}">
<view class="item_top">
<view class="item_img" wx:if="{{item.inquiry_type == 1}}">
<text style="margin-left: 10rpx;">快速问诊</text>
<van-image class="van_img" src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice/kuaisu.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 2}}">
<text style="margin-left: 10rpx;">快速问诊</text>
<van-image class="van_img" src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice/kuaisu.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 3}}">
<text style="margin-left: 10rpx;">公益问诊</text>
<van-image class="van_img" src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice/yizhen.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 4}}">
<text style="margin-left: 10rpx;">问诊购药</text>
<van-image class="van_img" src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice/drug.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_date">{{item.notice_send_time}}</view>
</view>
<view class="item_content">{{item.notice_title}}</view>
</view>
<!-- <view class="item">
<view class="item_top">
<view class="item_img">
<text style="margin-left: 10rpx;">快速问诊</text>
@@ -11,9 +34,9 @@
<view class="item_date">2023-1-02 12:22</view>
</view>
<view class="item_content">您有新的图文问诊咨询,请注意查看。</view>
</view>
</view> -->
<view class="item">
<!-- <view class="item">
<view class="item_top">
<view class="item_img">
<text style="margin-left: 10rpx;">在线问诊</text>
@@ -22,9 +45,9 @@
<view class="item_date">2023-1-02 12:22</view>
</view>
<view class="item_content">您有新的图文问诊咨询,请注意查看。</view>
</view>
</view> -->
<view class="item">
<!-- <view class="item">
<view class="item_top">
<view class="item_img">
<text style="margin-left: 10rpx;">公益问诊</text>
@@ -33,9 +56,9 @@
<view class="item_date">2023-1-02 12:22</view>
</view>
<view class="item_content">您有新的图文问诊咨询,请注意查看。</view>
</view>
</view> -->
<view class="item">
<!-- <view class="item">
<view class="item_top">
<view class="item_img">
<text style="margin-left: 10rpx;">问诊购药</text>
@@ -44,8 +67,14 @@
<view class="item_date">2023-1-02 12:22</view>
</view>
<view class="item_content">您有新的图文问诊咨询,请注意查看。</view>
</view>
</view> -->
</view>
<van-empty description="暂无数据" wx:if="{{list.length == 0}}" />
<van-divider contentPosition="center" wx:if="{{list.length > 0 && current_page == last_page}}">到底了~</van-divider>
<van-image bind:click="putMessageReadNoticeAll" style="position: fixed; right: 0;bottom: 262rpx;" src="https://img.applets.igandanyiyuan.com/applet/doctor/static/images/yishi/service_notice/readall.png" fit="heightFix" height="84rpx" aria-label="role" />
<view style="height: 50rpx;">
</view>
</view>