Browse Source

1.2开发

master
kola-web 1 month ago
parent
commit
f9c6d1e2d3
  1. 2
      project.config.json
  2. 12
      src/app.ts
  3. BIN
      src/images/icon23.png
  4. BIN
      src/images/title5.png
  5. 32
      src/pages/home/index.scss
  6. 48
      src/pages/home/index.ts
  7. 11
      src/pages/home/index.wxml
  8. 4
      src/pages/informationDetail/index.scss
  9. 14
      src/pages/informationDetail/index.ts
  10. 8
      src/pages/informationDetail/index.wxml
  11. 31
      src/pages/message/index.scss
  12. 9
      src/pages/message/index.wxml

2
project.config.json

@ -71,5 +71,5 @@
} }
] ]
}, },
"appid": "wxf9ce8010f1ad24aa" "appid": "wx71ac9c27c3c3e3f4"
} }

12
src/app.ts

@ -16,15 +16,15 @@ App<IAppOption>({
// 测试号 wx2b0bb13edf717c1d // 测试号 wx2b0bb13edf717c1d
// dev // dev
// appid:wxf9ce8010f1ad24aa // appid:wxf9ce8010f1ad24aa
url: 'https://m.xd.hbraas.com', // url: 'https://m.xd.hbraas.com',
upFileUrl: 'https://m.xd.hbraas.com/', // upFileUrl: 'https://m.xd.hbraas.com/',
imageUrl: 'https://m.xd.hbraas.com/xd/', // imageUrl: 'https://m.xd.hbraas.com/xd/',
// pro // pro
// appid:wx71ac9c27c3c3e3f4 // appid:wx71ac9c27c3c3e3f4
// url: 'https://m.xd.hbsaas.com', url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.xd.hbsaas.com/', upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.xd.hbsaas.com/api/xd/', imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
loginState: '', loginState: '',
isLogin: 0, isLogin: 0,

BIN
src/images/icon23.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

BIN
src/images/title5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

32
src/pages/home/index.scss

@ -113,9 +113,21 @@ page {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.more {
margin-top: 12rpx;
display: flex;
align-items: center;
gap: 10rpx;
font-size: 30rpx;
color: rgba(185, 130, 255, 1);
.icon {
width: 32rpx;
height: 32rpx;
}
}
} }
.item2 { .item2 {
padding: 32rpx; padding: 32rpx;
@ -290,6 +302,9 @@ page {
height: 68rpx; height: 68rpx;
} }
} }
.wrap {
display: flex;
justify-content: space-between;
.num-line { .num-line {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
@ -302,6 +317,12 @@ page {
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
} }
} }
.icon {
margin-top: 50rpx;
width: 32rpx;
height: 32rpx;
}
}
.name { .name {
margin-top: 44rpx; margin-top: 44rpx;
font-size: 28rpx; font-size: 28rpx;
@ -437,7 +458,7 @@ page {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.title { .title {
width: 156rpx; width: 210rpx;
height: 44rpx; height: 44rpx;
} }
.more { .more {
@ -462,6 +483,7 @@ page {
.photo { .photo {
width: 100%; width: 100%;
height: 304rpx; height: 304rpx;
display: block;
border-radius: 32rpx 32rpx 0 0; border-radius: 32rpx 32rpx 0 0;
} }
.content { .content {
@ -470,8 +492,12 @@ page {
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
border-radius: 0 0 32rpx 32rpx; border-radius: 0 0 32rpx 32rpx;
display: flex;
align-items: center;
justify-content: center;
.center { .center {
font-size: 28rpx; font-size: 32rpx;
line-height: 44rpx;
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

48
src/pages/home/index.ts

@ -205,6 +205,54 @@ Page({
url: `/pages/informationDetail/index?id=${id}`, url: `/pages/informationDetail/index?id=${id}`,
}); });
}, },
handleSop(e) {
const { index } = e.currentTarget.dataset;
const { Id, FileList } = this.data.sopList[index];
const params: any = FileList[0];
if (!params) {
return;
}
wx.showLoading({
title: '加载中',
mask: true,
});
app.mpBehavior({ PositionId: '1', OperateType: '2', OperateId: Id as string });
wx.downloadFile({
url: params.FileUrl,
filePath: `${wx.env.USER_DATA_PATH}/${params.FileName}`,
success: (res) => {
if (res.statusCode === 200) {
wx.openDocument({
showMenu: false,
filePath: res.filePath,
success: () => {
wx.hideLoading();
},
fail: () => {
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
wx.hideLoading();
},
});
} else {
wx.hideLoading();
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
}
},
fail() {
wx.hideLoading();
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
},
});
},
handleMore() { handleMore() {
wx.switchTab({ wx.switchTab({
url: '/pages/information/index', url: '/pages/information/index',

11
src/pages/home/index.wxml

@ -23,7 +23,7 @@
<image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image> <image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image>
</view> </view>
<view class="notice"> <view class="notice">
<swiper class="v-swiper" autoplay bind:change="handleSwiperChange"> <swiper class="v-swiper" autoplay="{{false}}" bind:change="handleSwiperChange">
<swiper-item <swiper-item
class="swiper-item" class="swiper-item"
wx:for="{{notice}}" wx:for="{{notice}}"
@ -46,6 +46,10 @@
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view> </view>
<view class="content">{{item.Content}}</view> <view class="content">{{item.Content}}</view>
<view class="more" wx:if="{{item.Url}}">
点击查看
<image class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
</view> </view>
<!-- 入组 --> <!-- 入组 -->
<view class="item4" wx:elif="{{item.Type==2}}"> <view class="item4" wx:elif="{{item.Type==2}}">
@ -61,10 +65,13 @@
</view> </view>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view> </view>
<view class="wrap">
<view class="num-line"> <view class="num-line">
{{item.Composite}} {{item.Composite}}
<view class="sub">例入组</view> <view class="sub">例入组</view>
</view> </view>
<image wx:if="{{item.Url}}" class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view> <view class="name">{{item.Content}}</view>
</view> </view>
<!-- 伦理 --> <!-- 伦理 -->
@ -188,7 +195,7 @@
<image class="title" src="{{imageUrl}}title5.png?t={{Timestamp}}"></image> <image class="title" src="{{imageUrl}}title5.png?t={{Timestamp}}"></image>
</view> </view>
<view class="scroll"> <view class="scroll">
<view class="card" wx:for="{{sopList}}" wx:key="index" bind:tap="handleDetail" data-id="{{item.Id}}"> <view class="card" wx:for="{{sopList}}" wx:key="index" bind:tap="handleSop" data-index="{{index}}">
<image class="photo" src="{{item.CoverImgUrl}}"></image> <image class="photo" src="{{item.CoverImgUrl}}"></image>
<view class="content"> <view class="content">
<view class="center">{{item.Title}}</view> <view class="center">{{item.Title}}</view>

4
src/pages/informationDetail/index.scss

@ -32,7 +32,7 @@
} }
} }
.file-card { .file-card {
margin-top: 32rpx; margin-top: 16rpx;
padding: 22rpx 32rpx; padding: 22rpx 32rpx;
background: linear-gradient(352deg, #f7f6fa 0%, #f2edff 100%); background: linear-gradient(352deg, #f7f6fa 0%, #f2edff 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx; border-radius: 24rpx 24rpx 24rpx 24rpx;
@ -41,6 +41,8 @@
justify-content: space-between; justify-content: space-between;
gap: 24rpx; gap: 24rpx;
.icon { .icon {
align-self: flex-start;
flex-shrink: 0;
width: 84rpx; width: 84rpx;
height: 84rpx; height: 84rpx;
} }

14
src/pages/informationDetail/index.ts

@ -53,12 +53,14 @@ Page({
}); });
}); });
}, },
handlePopup() { handlePopup(e) {
const { index } = e.currentTarget.dataset;
this.setData({ this.setData({
popupShow: true, popupShow: true,
popupType: 'popup5', popupType: 'popup5',
popupParams: { popupParams: {
position: 'bottom', position: 'bottom',
index,
}, },
}); });
}, },
@ -75,15 +77,19 @@ Page({
}); });
}, },
handleDownload() { handleDownload() {
const { detail } = this.data; const {
detail,
popupParams: { index },
} = this.data;
const params = detail.FileList[index];
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
mask: true, mask: true,
}); });
app.mpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string }); app.mpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string });
wx.downloadFile({ wx.downloadFile({
url: detail.FileUrl, url: params.FileUrl,
filePath: `${wx.env.USER_DATA_PATH}/${detail.FileName}`, filePath: `${wx.env.USER_DATA_PATH}/${params.FileName}`,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.openDocument({ wx.openDocument({

8
src/pages/informationDetail/index.wxml

@ -7,11 +7,11 @@
{{detail.ReadCount}} {{detail.ReadCount}}
</view> </view>
</view> </view>
<view class="file-card" wx:if="{{detail.FileUrl}}" bind:tap="handlePopup"> <view class="file-card" wx:for="{{detail.FileList}}" bind:tap="handlePopup" data-index="{{index}}">
<image class="icon" src="{{imageUrl}}{{fileIcon[detail.FileType] || 'none'}}.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}{{fileIcon[item.FileType] || 'none'}}.png?t={{Timestamp}}"></image>
<view class="wrap"> <view class="wrap">
<view class="content">{{detail.FileName}}</view> <view class="content">{{item.FileName}}</view>
<view class="size">{{detail.FileSizeName}}</view> <view class="size">{{item.FileSizeName}}</view>
</view> </view>
<view class="btn">下载</view> <view class="btn">下载</view>
</view> </view>

31
src/pages/message/index.scss

@ -2,7 +2,7 @@ page {
background-color: rgba(246, 248, 249, 1); background-color: rgba(246, 248, 249, 1);
} }
.page { .page {
padding: 32rpx 30rpx; padding: 32rpx 30rpx 0;
.card { .card {
position: relative; position: relative;
padding: 32rpx 120rpx 32rpx 32rpx; padding: 32rpx 120rpx 32rpx 32rpx;
@ -26,6 +26,18 @@ page {
font-size: 32rpx; font-size: 32rpx;
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
} }
.more {
margin-top: 16rpx;
display: flex;
align-items: center;
gap: 20rpx;
font-size: 30rpx;
color: rgba(185, 130, 255, 1);
.icon {
width: 32rpx;
height: 32rpx;
}
}
.status1 { .status1 {
margin-top: 38rpx; margin-top: 38rpx;
font-size: 40rpx; font-size: 40rpx;
@ -65,6 +77,9 @@ page {
height: 36rpx; height: 36rpx;
} }
} }
.num-wrap {
display: flex;
gap: 10rpx;
.num-line { .num-line {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
@ -77,6 +92,13 @@ page {
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
} }
} }
.icon {
margin-top: 50rpx;
margin-left: 20rpx;
width: 32rpx;
height: 32rpx;
}
}
.name { .name {
margin-top: 16rpx; margin-top: 16rpx;
font-size: 28rpx; font-size: 28rpx;
@ -84,4 +106,11 @@ page {
line-height: 44rpx; line-height: 44rpx;
} }
} }
.bottom {
margin: 56rpx auto 0;
display: block;
width: 234rpx;
height: 86rpx;
}
} }

9
src/pages/message/index.wxml

@ -8,13 +8,20 @@
<!-- 文字 --> <!-- 文字 -->
<view class="wrap1" wx:if="{{item.Type==1}}"> <view class="wrap1" wx:if="{{item.Type==1}}">
<view class="content">{{item.Content}}</view> <view class="content">{{item.Content}}</view>
<view class="more" wx:if="{{item.Url}}">
点击查看
<image class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
</view> </view>
<!-- 入组 --> <!-- 入组 -->
<view class="wrap4" wx:elif="{{item.Type==2}}"> <view class="wrap4" wx:elif="{{item.Type==2}}">
<view class="num-wrap">
<view class="num-line"> <view class="num-line">
{{item.Composite}} {{item.Composite}}
<view class="sub">例入组</view> <view class="sub">例入组</view>
</view> </view>
<image wx:if="{{item.Url}}" class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view> <view class="name">{{item.Content}}</view>
</view> </view>
<!-- 伦理 --> <!-- 伦理 -->
@ -47,4 +54,6 @@
</view> </view>
</view> </view>
<pagination pagination="{{pagination}}"></pagination> <pagination pagination="{{pagination}}"></pagination>
<image class="bottom" src="{{imageUrl}}bottom1.png?t={{Timestamp}}"></image>
</view> </view>

Loading…
Cancel
Save