Browse Source

1.0 首页&消息页联调

master
kola-web 4 days ago
parent
commit
946e10f493
  1. 2
      README.md
  2. 468
      src/pages/home/index.scss
  3. 92
      src/pages/home/index.ts
  4. 250
      src/pages/home/index.wxml
  5. 1
      src/pages/message/index.scss
  6. 31
      src/pages/message/index.ts
  7. 72
      src/pages/message/index.wxml

2
README.md

@ -9,7 +9,7 @@ https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c @@ -9,7 +9,7 @@ https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c
images svn 地址
svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt
(/images/)(\S\*(?=["|']))
(/images/)(\S*(?=["|']))
{{imageUrl}}$2?t={{Timestamp}}
ui问题

468
src/pages/home/index.scss

@ -69,267 +69,269 @@ page { @@ -69,267 +69,269 @@ page {
height: 100%;
}
}
.v-swiper {
.notice {
position: relative;
height: 384rpx;
border-radius: 32rpx;
.swiper-item {
.v-swiper {
height: 384rpx;
border-radius: 32rpx;
background-color: #fff;
.item1 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
.swiper-item {
border-radius: 32rpx;
background-color: #fff;
.item1 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
}
}
}
.icon {
width: 68rpx;
height: 68rpx;
}
}
.icon {
width: 68rpx;
height: 68rpx;
.content {
margin-top: 28rpx;
font-size: 30rpx;
color: rgba(33, 29, 46, 1);
line-height: 56rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
}
.content {
margin-top: 28rpx;
font-size: 30rpx;
color: rgba(33, 29, 46, 1);
line-height: 56rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
}
.item2 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
.item2 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
}
}
}
.icon {
width: 68rpx;
height: 68rpx;
}
}
.icon {
width: 68rpx;
height: 68rpx;
.status1 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(195, 49, 0, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
}
}
}
.status1 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(195, 49, 0, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
.status2 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(69, 163, 83, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
}
}
}
.status2 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(69, 163, 83, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
.status3 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
}
}
}
.status3 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.item3 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
.item3 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
}
}
}
.icon {
width: 68rpx;
height: 68rpx;
}
}
.icon {
width: 68rpx;
height: 68rpx;
.status4 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
}
}
}
.status4 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
.status2 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(69, 163, 83, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
}
}
}
.status2 {
margin-top: 38rpx;
font-size: 40rpx;
color: rgba(69, 163, 83, 1);
font-weight: bold;
display: flex;
align-items: center;
gap: 12rpx;
.s-icon {
width: 36rpx;
height: 36rpx;
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.item4 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
.item4 {
padding: 32rpx;
.i-header {
display: flex;
align-items: center;
justify-content: space-between;
.date {
.year {
font-size: 24rpx;
color: rgba(173, 172, 178, 1);
line-height: 32rpx;
}
.day {
display: flex;
align-items: baseline;
font-size: 36rpx;
color: rgba(173, 172, 178, 1);
line-height: 40rpx;
.sub {
font-size: 22rpx;
}
}
}
.icon {
width: 68rpx;
height: 68rpx;
}
}
.icon {
width: 68rpx;
height: 68rpx;
.num-line {
display: flex;
align-items: baseline;
font-size: 72rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
.sub {
font-size: 32rpx;
color: rgba(33, 29, 46, 1);
}
}
}
.num-line {
display: flex;
align-items: baseline;
font-size: 72rpx;
color: rgba(185, 130, 255, 1);
font-weight: bold;
.sub {
font-size: 32rpx;
color: rgba(33, 29, 46, 1);
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.name {
margin-top: 44rpx;
font-size: 28rpx;
color: rgba(105, 104, 110, 1);
line-height: 44rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.item5 {
padding: 96rpx 22rpx 0;
.icon1 {
width: 276rpx;
height: 214rpx;
}
.title {
margin-top: -60rpx;
font-size: 32rpx;
color: rgba(173, 172, 178, 1);
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
.icon2 {
width: 36rpx;
height: 36rpx;
.item5 {
padding: 96rpx 22rpx 0;
.icon1 {
width: 276rpx;
height: 214rpx;
}
.title {
margin-top: -60rpx;
font-size: 32rpx;
color: rgba(173, 172, 178, 1);
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
.icon2 {
width: 36rpx;
height: 36rpx;
}
}
}
}
@ -337,6 +339,8 @@ page { @@ -337,6 +339,8 @@ page {
.dots {
position: absolute;
bottom: 16rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
display: flex;
align-items: center;

92
src/pages/home/index.ts

@ -14,23 +14,23 @@ Page({ @@ -14,23 +14,23 @@ Page({
} as any,
userInfo: {},
unReadMsgCount: 0,
current: 0,
notice: [],
bannerList: [],
briefingList: [],
sopList: [],
list: [] as any[],
total: 0,
pagination: {
page: 1,
pages: 1,
count: 1,
},
},
onShow() {
app.waitLogin({ type: 2 }).then(() => {
// this.getNotice();
this.getNotice();
this.getBanner();
this.getBriefingList();
this.getSopList();
this.getList();
app.getUserInfo(2).then((userInfo) => {
this.setData({
@ -67,11 +67,16 @@ Page({ @@ -67,11 +67,16 @@ Page({
getNotice() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-unread-msg-count',
url: '?r=xd/doctor/index/get-latest-mini-msg',
data: {},
}).then((res) => {
this.setData({
unReadMsgCount: res.unReadMsgCount,
notice: res.list.map((item) => {
item.year = dayjs(item.PublishDate).format('YYYY');
item.month = dayjs(item.PublishDate).format('MM');
item.day = dayjs(item.PublishDate).format('DD');
return item;
}),
});
});
},
@ -80,8 +85,25 @@ Page({ @@ -80,8 +85,25 @@ Page({
url: '/pages/message/index',
});
},
handleNoticeDetail(e) {
const { index } = e.currentTarget.dataset;
const { Id, Url } = this.data.notice[index];
app.mpBehavior({ PositionId: '4', OperateType: '1', OperateId: Id });
if (Url) {
wx.navigateTo({
url: Url,
fail() {
wx.reLaunch({
url: Url,
});
},
});
}
},
handleSwiperChange(e) {
console.log('DEBUGPRINT[89]: index.ts:83: e=', e);
const current = e.detail.current;
const { Id } = this.data.bannerList[current];
app.mpBehavior({ PositionId: '4', OperateType: '4', OperateId: Id });
this.setData({
current: e.detail.current,
});
@ -111,24 +133,54 @@ Page({ @@ -111,24 +133,54 @@ Page({
},
});
},
getBriefingList() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-latest-material',
data: {
count: 10,
ContentType: 1,
},
}).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
});
this.setData({
briefingList: res.list,
});
});
},
getSopList() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-latest-material',
data: {
count: 10,
ContentType: 2,
},
}).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
});
this.setData({
sopList: res.list,
});
});
},
getList() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-latest-material',
data: {},
data: {
ContentType: 3,
count: 10,
},
}).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
});
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({
total: res.count,
list,
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
list: res.list,
});
});
},

250
src/pages/home/index.wxml

@ -20,122 +20,121 @@ @@ -20,122 +20,121 @@
</view>
<view class="banner">
<view class="edc" bind:tap="handleWebview">
<image class="e-img" src="/images/card1.png"></image>
<image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image>
</view>
<swiper class="v-swiper" current="{{current}}" bind:change="handleSwiperChange">
<swiper-item class="swiper-item" wx:for="{{8}}" wx:key="index">
<!-- 文字 -->
<view class="item1" wx:if="{{false}}">
<view class="i-header">
<view class="date">
<view class="year">2025</view>
<view class="day">
6
<text class="sub">月</text>
1
<text class="sub">日</text>
<view class="notice">
<swiper class="v-swiper" current="{{current}}" bind:change="handleSwiperChange">
<swiper-item
class="swiper-item"
wx:for="{{notice}}"
wx:key="Id"
bind:tap="handleNoticeDetail"
data-index="{{index}}"
>
<!-- 文字 -->
<view class="item1" wx:if="{{item.Type==1}}">
<view class="i-header">
<view class="date">
<view class="year">{{item.year}}</view>
<view class="day">
{{item.month}}
<text class="sub">月</text>
{{item.day}}
<text class="sub">日</text>
</view>
</view>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
<image class="icon" src="/images/icon12.png"></image>
</view>
<view class="content">
您有一份甲状腺登记研究简报25.06第一期,该请查收您有一份甲状腺登记研究简报25.06第一期,该请查收
</view>
</view>
<!-- 伦理 -->
<view class="item2" wx:elif="{{false}}">
<view class="i-header">
<view class="date">
<view class="year">2025</view>
<view class="day">
6
<text class="sub">月</text>
1
<text class="sub">日</text>
<view class="content">{{item.Content}}</view>
</view>
<!-- 入组 -->
<view class="item4" wx:elif="{{item.Type==2}}">
<view class="i-header">
<view class="date">
<view class="year">{{item.year}}</view>
<view class="day">
{{item.month}}
<text class="sub">月</text>
{{item.day}}
<text class="sub">日</text>
</view>
</view>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
<image class="icon" src="/images/icon13.png"></image>
</view>
<view class="status1" wx:if="{{true}}">
未通过
<image class="s-icon" src="/images/icon19.png"></image>
</view>
<view class="status2" wx:elif="{{false}}">
未通过
<image class="s-icon" src="/images/icon20.png"></image>
</view>
<view class="status3" wx:elif="{{false}}">
未通过
<image class="s-icon" src="/images/icon21.png"></image>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
</view>
</view>
<!-- edc -->
<view class="item3" wx:elif="{{false}}">
<view class="i-header">
<view class="date">
<view class="year">2025</view>
<view class="day">
6
<text class="sub">月</text>
1
<text class="sub">日</text>
<view class="num-line">
{{item.Composite}}
<view class="sub">例入组</view>
</view>
<view class="name">{{item.Content}}</view>
</view>
<!-- 伦理 -->
<view class="item2" wx:elif="{{item.Type==3}}">
<view class="i-header">
<view class="date">
<view class="year">{{item.year}}</view>
<view class="day">
{{item.month}}
<text class="sub">月</text>
{{item.day}}
<text class="sub">日</text>
</view>
</view>
<image class="icon" src="{{imageUrl}}icon13.png?t={{Timestamp}}"></image>
</view>
<image class="icon" src="/images/icon14.png"></image>
</view>
<view class="status4" wx:if="{{true}}">
已上会
<image class="s-icon" src="/images/icon21.png"></image>
</view>
<view class="status2" wx:elif="{{false}}">
未通过
<image class="s-icon" src="/images/icon20.png"></image>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
</view>
</view>
<!-- 入组 -->
<view class="item4" wx:elif="{{false}}">
<view class="i-header">
<view class="date">
<view class="year">2025</view>
<view class="day">
6
<text class="sub">月</text>
1
<text class="sub">日</text>
<view class="status1" wx:if="{{item.Composite==1}}">
通过
<image class="s-icon" src="{{imageUrl}}icon19.png?t={{Timestamp}}"></image>
</view>
<view class="status2" wx:elif="{{item.Composite==2}}">
未通过
<image class="s-icon" src="{{imageUrl}}icon20.png?t={{Timestamp}}"></image>
</view>
<view class="status3" wx:elif="{{item.Composite==3}}">
已上会
<image class="s-icon" src="{{imageUrl}}icon21.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view>
</view>
<!-- edc -->
<view class="item3" wx:elif="{{item.Type==4}}">
<view class="i-header">
<view class="date">
<view class="year">{{item.year}}</view>
<view class="day">
{{item.month}}
<text class="sub">月</text>
{{item.day}}
<text class="sub">日</text>
</view>
</view>
<image class="icon" src="{{imageUrl}}icon14.png?t={{Timestamp}}"></image>
</view>
<view class="status4" wx:if="{{item.Cmposite==1}}">
未申请
<image class="s-icon" src="{{imageUrl}}icon21.png?t={{Timestamp}}"></image>
</view>
<view class="status2" wx:elif="{{item.Composite==2}}">
已申请
<image class="s-icon" src="{{imageUrl}}icon20.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" bind:tap="handleNotice" wx:key="none">
<!-- more -->
<view class="item5">
<image class="icon1" src="{{imageUrl}}icon17.png?t={{Timestamp}}"></image>
<view class="title">
查看更多
<image class="icon2" src="{{imageUrl}}icon18.png?t={{Timestamp}}"></image>
</view>
<image class="icon" src="/images/icon12.png"></image>
</view>
<view class="num-line">
7
<view class="sub">例入组</view>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
</view>
</view>
<!-- more -->
<view class="item5">
<image class="icon1" src="/images/icon17.png"></image>
<view class="title">
查看更多
<image class="icon2" src="/images/icon18.png"></image>
</view>
</view>
</swiper-item>
</swiper-item>
</swiper>
<view class="dots">
<view class="dot {{index==0 && 'active'}}" wx:for="{{6}}"></view>
<view class="dot {{current==index && 'active'}}" wx:for="{{notice.length+1}}" wx:key="index"></view>
</view>
</swiper>
</view>
</view>
<view class="ad">
<swiper
@ -156,23 +155,25 @@ @@ -156,23 +155,25 @@
</swiper-item>
</swiper>
</view>
<view class="briefing">
<view class="briefing" wx:if="{{briefingList.length > 0}}">
<view class="b-header">
<image class="title" src="/images/title4.png"></image>
<view class="more">
查看全部
<van-icon name="arrow" />
</view>
<image class="title" src="{{imageUrl}}title4.png?t={{Timestamp}}"></image>
<!-- <view class="more"> -->
<!-- 查看全部 -->
<!-- <van-icon name="arrow" /> -->
<!-- </view> -->
</view>
<view class="scroll">
<image
wx:for="{{10}}"
wx:for="{{briefingList}}"
wx:key="index"
class="card"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
src="{{item.CoverImgUrl}}"
bind:tap="handleDetail"
data-id="{{item.Id}}"
></image>
<view class="none">
<image class="icon" src="/images/none1.png"></image>
<view class="none" wx:if="{{briefingList.length == 1}}">
<image class="icon" src="{{imageUrl}}none1.png?t={{Timestamp}}"></image>
<view class="content">
更多内容
<view></view>
@ -182,22 +183,19 @@ @@ -182,22 +183,19 @@
</view>
</view>
<view class="sop">
<view class="sop" wx:if="{{sopList.length > 0}}">
<view class="s-header">
<image class="title" src="/images/title5.png"></image>
<image class="title" src="{{imageUrl}}title5.png?t={{Timestamp}}"></image>
</view>
<view class="scroll">
<view class="card" wx:for="{{10}}" wx:key="index">
<image
class="photo"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
<view class="card" wx:for="{{sopList}}" wx:key="index" bind:tap="handleDetail" data-id="{{item.Id}}">
<image class="photo" src="{{item.CoverImgUrl}}"></image>
<view class="content">
<view class="center">替妥尤单抗的作用机制、适用场景、使用方式</view>
<view class="center">{{item.Title}}</view>
</view>
</view>
<view class="none">
<image class="icon" src="/images/none1.png"></image>
<view class="none" wx:if="{{sopList.length == 1}}">
<image class="icon" src="{{imageUrl}}none1.png?t={{Timestamp}}"></image>
<view class="content">
更多内容
<view></view>
@ -234,12 +232,12 @@ @@ -234,12 +232,12 @@
</view>
</view>
<view class="none">
<image class="icon" src="/images/none2.png"></image>
<image class="icon" src="{{imageUrl}}none2.png?t={{Timestamp}}"></image>
<view class="content">建设中 敬请期待...</view>
</view>
</view>
<image class="bottom" src="/images/bottom1.png"></image>
<image class="bottom" src="{{imageUrl}}bottom1.png?t={{Timestamp}}"></image>
</view>
<popup

1
src/pages/message/index.scss

@ -8,6 +8,7 @@ page { @@ -8,6 +8,7 @@ page {
padding: 32rpx 120rpx 32rpx 32rpx;
border-radius: 32rpx;
background-color: #fff;
margin-bottom: 24rpx;
.stage {
position: absolute;
top: 26rpx;

31
src/pages/message/index.ts

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
const app = getApp<IAppOption>();
const dayjs = require('dayjs');
Page({
data: {
@ -12,15 +13,27 @@ Page({ @@ -12,15 +13,27 @@ Page({
onLoad() {
app.waitLogin().then(() => {
this.getList();
wx.setNavigationBarTitle({
title: '消息(20)',
});
});
},
handleDetail(e) {
const { index } = e.currentTarget.dataset;
const { Id, Url } = this.data.list[index];
app.mpBehavior({ PositionId: '4', OperateType: '1', OperateId: Id });
if (Url) {
wx.navigateTo({
url: Url,
fail() {
wx.reLaunch({
url: Url,
});
},
});
}
},
getList(newPage = 1) {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-msg-list',
url: '?r=xd/doctor/index/get-mini-msg-list',
data: {
page: newPage,
},
@ -28,13 +41,21 @@ Page({ @@ -28,13 +41,21 @@ Page({
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({
total: res.count,
list,
list: list.map((item) => {
item.year = dayjs(item.PublishDate).format('YYYY');
item.month = dayjs(item.PublishDate).format('MM');
item.day = dayjs(item.PublishDate).format('DD');
return item;
}),
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
});
wx.setNavigationBarTitle({
title: `消息(${res.count}`,
});
});
},
onReachBottom() {

72
src/pages/message/index.wxml

@ -1,52 +1,54 @@ @@ -1,52 +1,54 @@
<view class="page">
<view class="card">
<image class="stage" src="/images/icon12.png"></image>
<image class="stage" src="/images/icon13.png"></image>
<image class="stage" src="/images/icon14.png"></image>
<view class="date">2025年 6月1日</view>
<view class="wrap1">
<view class="content">您有一份甲状腺登记研究简报(2025.06第一期),该请查收</view>
<view class="card" wx:for="{{list}}" wx:key="Id" data-index="{{index}}" bind:tap="handleDetail">
<image wx:if="{{item.Type==1}}" class="stage" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
<image wx:elif="{{item.Type==2}}" class="stage" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
<image wx:elif="{{item.Type==3}}" class="stage" src="{{imageUrl}}icon13.png?t={{Timestamp}}"></image>
<image wx:elif="{{item.Type==4}}" class="stage" src="{{imageUrl}}icon14.png?t={{Timestamp}}"></image>
<view class="date">{{item.year}}年 {{item.month}}月{{item.day}}日</view>
<!-- 文字 -->
<view class="wrap1" wx:if="{{item.Type==1}}">
<view class="content">{{item.Content}}</view>
</view>
<view class="wrap2">
<view class="status1" wx:if="{{true}}">
未通过
<image class="s-icon" src="/images/icon19.png"></image>
</view>
<view class="status2" wx:elif="{{false}}">
未通过
<image class="s-icon" src="/images/icon20.png"></image>
</view>
<view class="status3" wx:elif="{{false}}">
未通过
<image class="s-icon" src="/images/icon21.png"></image>
<!-- 入组 -->
<view class="wrap4" wx:elif="{{item.Type==2}}">
<view class="num-line">
7
<view class="sub">例入组</view>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
{{item.Content}}
</view>
</view>
<view class="wrap3">
<view class="status4" wx:if="{{true}}">
未通过
<image class="s-icon" src="/images/icon21.png"></image>
<!-- 伦理 -->
<view class="wrap2" wx:elif="{{item.Type==3}}">
<view class="status1" wx:if="{{item.Composite==1}}">
通过
<image class="s-icon" src="{{imageUrl}}icon19.png?t={{Timestamp}}"></image>
</view>
<view class="status2" wx:elif="{{false}}">
<view class="status2" wx:elif="{{item.Composite==2}}">
未通过
<image class="s-icon" src="/images/icon20.png"></image>
<image class="s-icon" src="{{imageUrl}}icon20.png?t={{Timestamp}}"></image>
</view>
<view class="status3" wx:elif="{{item.Composite==3}}">
已上会
<image class="s-icon" src="{{imageUrl}}icon21.png?t={{Timestamp}}"></image>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
{{item.Content}}
</view>
</view>
<view class="wrap4">
<view class="num-line">
7
<view class="sub">例入组</view>
<!-- edc -->
<view class="wrap3" wx:elif="{{item.Type==4}}">
<view class="status4" wx:if="{{item.Cmposite==1}}">
未申请
<image class="s-icon" src="{{imageUrl}}icon21.png?t={{Timestamp}}"></image>
</view>
<view class="status2" wx:elif="{{item.Composite==2}}">
已申请
<image class="s-icon" src="{{imageUrl}}icon20.png?t={{Timestamp}}"></image>
</view>
<view class="name">
中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院
中国医科大学附属第一医院
{{item.Content}}
</view>
</view>
</view>

Loading…
Cancel
Save