更新小程序仓库
This commit is contained in:
@@ -0,0 +1,160 @@
|
||||
// pages/sysMsgList/sysMsgList.js
|
||||
const app = getApp()
|
||||
import {
|
||||
hasRead,
|
||||
getMsg
|
||||
} from "../../api/msg"
|
||||
import {throttle} from "../../utils/util"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list:[],
|
||||
isLock:false,
|
||||
isTriggered:false,
|
||||
page:1,
|
||||
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static',
|
||||
pageNumber:10
|
||||
},
|
||||
handleGo:throttle(function(event){
|
||||
|
||||
let link_type=event.currentTarget.dataset.type;
|
||||
let index=event.currentTarget.dataset.index;
|
||||
let link_params=event.currentTarget.dataset.params;
|
||||
let id=event.currentTarget.dataset.id;
|
||||
let status=event.currentTarget.dataset.status;
|
||||
hasRead(id).then(data=>{
|
||||
let currentItem=`list[${index}].read_status`
|
||||
if(status==0){
|
||||
this.setData({
|
||||
[currentItem]:1
|
||||
})
|
||||
}
|
||||
this.goOther(link_type,link_params);
|
||||
})
|
||||
}),
|
||||
goBack(){
|
||||
wx.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
},
|
||||
|
||||
lower(){
|
||||
if(!this.data.isLock){
|
||||
this.setData({
|
||||
page:++this.data.page
|
||||
})
|
||||
this.handleGetMsg();
|
||||
}
|
||||
},
|
||||
handleRefresher(){
|
||||
this.setData({
|
||||
page:1,
|
||||
isLock:false,
|
||||
list:[]
|
||||
})
|
||||
this.handleGetMsg()
|
||||
},
|
||||
handleGetMsg(){
|
||||
let {page,pageNumber}=this.data;
|
||||
getMsg({
|
||||
page:page,
|
||||
per_page:pageNumber,
|
||||
notice_system_type:1
|
||||
}).then(data=>{
|
||||
let result=data.data;
|
||||
if(result.length==0){
|
||||
this.setData({
|
||||
isLock:true
|
||||
})
|
||||
};
|
||||
this.setData({
|
||||
isTriggered:false,
|
||||
list:this.data.list.concat(result)
|
||||
})
|
||||
})
|
||||
},
|
||||
goOther(link_type,link_params){
|
||||
let url='';
|
||||
if(link_type==1){
|
||||
url= '/TUIService/pages/index?currentConversationID='+link_params.doctor_user_id+'&order_inquiry_id='+link_params.order_inquiry_id+'&inquiry_type='+link_params.inquiry_type;
|
||||
}else if(link_type==7){
|
||||
url='/pages/myWelfare/myWelfare'
|
||||
}else if(link_type==8){
|
||||
url='/pages/medinceOrder/medinceOrder'
|
||||
}else if(link_type==9){
|
||||
url='/pages/medinceOrder/medinceOrder'
|
||||
}else if(link_type==10){
|
||||
url='/pages/orderDetail/orderDetail?order_inquiry_id='+link_params.order_inquiry_id
|
||||
}else if(link_type==12){
|
||||
|
||||
}else if(link_type==13){
|
||||
url='/pages/prescriptDetail/prescriptDetail?order_prescription_id='+link_params.order_prescription_id
|
||||
};
|
||||
app.method.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
},
|
||||
goMishu(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/gandansecretary/gandansecretary',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.handleGetMsg();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({
|
||||
img_host:app.hostConfig().imghost
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"nav":"../../components/nav/nav"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "肝胆相照互联网医院"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--pages/sysMsgList/sysMsgList.wxml-->
|
||||
<nav navName="服务消息"></nav>
|
||||
<view class="page">
|
||||
<scroll-view scroll-y="true" bindscrolltolower="lower" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="100" refresher-enabled="true" class="cellbox" wx:if="{{list.length>0}}">
|
||||
<view class="cell" bindtap="handleGo" data-index="{{index}}" data-id="{{item.notice_id}}" wx:for="{{list}}" wx:key="notice_id" data-type="{{item.link_type}}" data-params="{{item.link_params}}" data-status="{{item.read_status}}">
|
||||
<view class="circle" wx:if="{{item.read_status==0}}"></view>
|
||||
<image src="{{img_host+'/kefu.png'}}" class="icon"></image>
|
||||
<view class="right">
|
||||
<view class="namebox">
|
||||
<view class="name">{{item.from_name}}</view>
|
||||
<view class="date">{{item.notice_send_time}}</view>
|
||||
</view>
|
||||
<view class="detail">{{item.notice_content}}</view>
|
||||
<view class="row" >
|
||||
<button class="button" wx:if="{{item.button_type==2}}" open-type="contact" bindcontact="handleContact">
|
||||
联系客服
|
||||
</button>
|
||||
<view class="button" wx:elif="{{item.button_type==3}}">查看协议</view>
|
||||
<view class="button" wx:elif="{{item.button_type==4}}">订单详情</view>
|
||||
<view class="button" wx:elif="{{item.button_type==5}}">查看处方</view>
|
||||
<view class="button" wx:elif="{{item.button_type==6}}">问诊详情</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="cell">
|
||||
<view class="circle"></view>
|
||||
<image src="https://img.applets.igandanyiyuan.com/applet/patient/static/kefu.png" class="icon"></image>
|
||||
<view class="right">
|
||||
<view class="namebox">
|
||||
<view class="name">肝胆小秘书</view>
|
||||
<view class="date">2022-09-26 12:30:50</view>
|
||||
</view>
|
||||
<view class="detail">您咨询快速问诊/问诊购药/义诊/专家问诊的服务医生已接诊,请查看详情。</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</scroll-view >
|
||||
<view class="nonedata" wx:else>暂无数据!</view>
|
||||
</view>
|
||||
@@ -0,0 +1,81 @@
|
||||
/* pages/sysMsgList/sysMsgList.wxss */
|
||||
.page{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.cellbox{
|
||||
flex:1;
|
||||
overflow-y: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.nonedata{
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.cell{
|
||||
position: relative;
|
||||
display: flex;
|
||||
padding:30rpx 32rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #E7E7E7;
|
||||
}
|
||||
.cell:last-child{
|
||||
border-bottom:none;
|
||||
}
|
||||
.cell .icon{
|
||||
width:72rpx;
|
||||
height:74rpx;
|
||||
}
|
||||
.cell .right{
|
||||
margin-left: 20rpx;
|
||||
flex:1;
|
||||
}
|
||||
.cell .namebox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.namebox .name{
|
||||
font-size: 32rpx;
|
||||
color: rgba(51,51,51,0.9);
|
||||
}
|
||||
.namebox .date{
|
||||
font-size: 24rpx;
|
||||
color: rgba(102,102,102,0.9)
|
||||
}
|
||||
.cell .detail{
|
||||
margin-top: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
.circle{
|
||||
position: absolute;
|
||||
top:12rpx;
|
||||
right: 30rpx;
|
||||
width:20rpx;
|
||||
height:20rpx;
|
||||
background:rgba(239, 79, 32, 1);
|
||||
border-radius: 50%;
|
||||
}
|
||||
.right .row{
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.button{
|
||||
padding:0 30rpx;
|
||||
height: 30rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 400;
|
||||
height: 60rpx;
|
||||
background: #3CC7C0;
|
||||
border-radius: 30rpx;
|
||||
color: #FFFFFF;
|
||||
|
||||
}
|
||||
.nonedata{
|
||||
min-height:600rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user