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. 50
      src/pages/home/index.scss
  6. 48
      src/pages/home/index.ts
  7. 17
      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. 49
      src/pages/message/index.scss
  12. 15
      src/pages/message/index.wxml

2
project.config.json

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

12
src/app.ts

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

50
src/pages/home/index.scss

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

48
src/pages/home/index.ts

@ -205,6 +205,54 @@ Page({ @@ -205,6 +205,54 @@ Page({
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() {
wx.switchTab({
url: '/pages/information/index',

17
src/pages/home/index.wxml

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
<image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image>
</view>
<view class="notice">
<swiper class="v-swiper" autoplay bind:change="handleSwiperChange">
<swiper class="v-swiper" autoplay="{{false}}" bind:change="handleSwiperChange">
<swiper-item
class="swiper-item"
wx:for="{{notice}}"
@ -46,6 +46,10 @@ @@ -46,6 +46,10 @@
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</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 class="item4" wx:elif="{{item.Type==2}}">
@ -61,9 +65,12 @@ @@ -61,9 +65,12 @@
</view>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
<view class="num-line">
{{item.Composite}}
<view class="sub">例入组</view>
<view class="wrap">
<view class="num-line">
{{item.Composite}}
<view class="sub">例入组</view>
</view>
<image wx:if="{{item.Url}}" class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view>
</view>
@ -188,7 +195,7 @@ @@ -188,7 +195,7 @@
<image class="title" src="{{imageUrl}}title5.png?t={{Timestamp}}"></image>
</view>
<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>
<view class="content">
<view class="center">{{item.Title}}</view>

4
src/pages/informationDetail/index.scss

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

14
src/pages/informationDetail/index.ts

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

8
src/pages/informationDetail/index.wxml

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

49
src/pages/message/index.scss

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

15
src/pages/message/index.wxml

@ -8,12 +8,19 @@ @@ -8,12 +8,19 @@
<!-- 文字 -->
<view class="wrap1" wx:if="{{item.Type==1}}">
<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 class="wrap4" wx:elif="{{item.Type==2}}">
<view class="num-line">
{{item.Composite}}
<view class="sub">例入组</view>
<view class="num-wrap">
<view class="num-line">
{{item.Composite}}
<view class="sub">例入组</view>
</view>
<image wx:if="{{item.Url}}" class="icon" src="{{imageUrl}}icon23.png?t={{Timestamp}}"></image>
</view>
<view class="name">{{item.Content}}</view>
</view>
@ -47,4 +54,6 @@ @@ -47,4 +54,6 @@
</view>
</view>
<pagination pagination="{{pagination}}"></pagination>
<image class="bottom" src="{{imageUrl}}bottom1.png?t={{Timestamp}}"></image>
</view>

Loading…
Cancel
Save