Browse Source

1.0 首页&消息页联调

master
kola-web 5 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
images svn 地址 images svn 地址
svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt
(/images/)(\S\*(?=["|'])) (/images/)(\S*(?=["|']))
{{imageUrl}}$2?t={{Timestamp}} {{imageUrl}}$2?t={{Timestamp}}
ui问题 ui问题

468
src/pages/home/index.scss

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

92
src/pages/home/index.ts

@ -14,23 +14,23 @@ Page({
} as any, } as any,
userInfo: {}, userInfo: {},
unReadMsgCount: 0,
current: 0, current: 0,
notice: [],
bannerList: [], bannerList: [],
briefingList: [],
sopList: [],
list: [] as any[], list: [] as any[],
total: 0,
pagination: {
page: 1,
pages: 1,
count: 1,
},
}, },
onShow() { onShow() {
app.waitLogin({ type: 2 }).then(() => { app.waitLogin({ type: 2 }).then(() => {
// this.getNotice(); this.getNotice();
this.getBanner(); this.getBanner();
this.getBriefingList();
this.getSopList();
this.getList(); this.getList();
app.getUserInfo(2).then((userInfo) => { app.getUserInfo(2).then((userInfo) => {
this.setData({ this.setData({
@ -67,11 +67,16 @@ Page({
getNotice() { getNotice() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=xd/doctor/index/get-unread-msg-count', url: '?r=xd/doctor/index/get-latest-mini-msg',
data: {}, data: {},
}).then((res) => { }).then((res) => {
this.setData({ 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({
url: '/pages/message/index', 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) { 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({ this.setData({
current: e.detail.current, current: e.detail.current,
}); });
@ -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() { getList() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=xd/doctor/index/get-latest-material', url: '?r=xd/doctor/index/get-latest-material',
data: {}, data: {
ContentType: 3,
count: 10,
},
}).then((res) => { }).then((res) => {
res.list.forEach((item) => { res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD'); item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
}); });
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({ this.setData({
total: res.count, list: res.list,
list,
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
}); });
}); });
}, },

250
src/pages/home/index.wxml

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

1
src/pages/message/index.scss

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

31
src/pages/message/index.ts

@ -1,4 +1,5 @@
const app = getApp<IAppOption>(); const app = getApp<IAppOption>();
const dayjs = require('dayjs');
Page({ Page({
data: { data: {
@ -12,15 +13,27 @@ Page({
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
this.getList(); 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) { getList(newPage = 1) {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=xd/doctor/index/get-msg-list', url: '?r=xd/doctor/index/get-mini-msg-list',
data: { data: {
page: newPage, page: newPage,
}, },
@ -28,13 +41,21 @@ Page({
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]; const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({ this.setData({
total: res.count, 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: { pagination: {
page: res.page, page: res.page,
pages: res.pages, pages: res.pages,
count: res.count, count: res.count,
}, },
}); });
wx.setNavigationBarTitle({
title: `消息(${res.count}`,
});
}); });
}, },
onReachBottom() { onReachBottom() {

72
src/pages/message/index.wxml

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

Loading…
Cancel
Save