Skip to content

Commit cb1a751

Browse files
committed
refactor(oss-licenses):优化开源许可证页面样式和功能
- 调整开源许可证链接位置和样式 - 增加复制功能和提示消息 - 优化更新日志显示样式 - 修复微信详情页面布局问题 - 优化 oss-licenses 页面布局和样式 - 调整 oss-licenses-menu 项目名称样式
1 parent ec535f3 commit cb1a751

File tree

6 files changed

+69
-18
lines changed

6 files changed

+69
-18
lines changed

source/pages/index/index.wxml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ See the Mulan PubL v2 for more details.
179179
<view class="flex items-center justify-center mt-32rpx">
180180
<t-link bind:tap="copyOSLink" class="mr-16rpx" content="GitHub 项目地址" hover prefix-icon="logo-github"
181181
size="small" theme="primary"/>
182-
<t-link bind:tap="startOssLicensesMenu" class="ml-16rpx" content="开放源代码许可" hover size="small"
183-
theme="primary"/>
184182
</view>
185183
<t-footer text="Copyright © {{yearNow===2024?'2024':'2024-'+yearNow}} Qverbow Vigor. All Rights Reserved."/>
186184
<view class="m-32rpx">
@@ -189,6 +187,11 @@ See the Mulan PubL v2 for more details.
189187
<view class="m-32rpx">
190188
<t-button bind:tap="recallUA" block size="large" theme="light">撤回同意用户协议</t-button>
191189
</view>
190+
<view class="m-32rpx">
191+
<t-button bind:tap="startOssLicensesMenu" block size="medium" theme="primary" variant="text">
192+
开放源代码许可
193+
</t-button>
194+
</view>
192195
</view>
193196
</t-popup>
194197

@@ -333,10 +336,12 @@ See the Mulan PubL v2 for more details.
333336
<t-button bind:tap="closeCellDetailPopup" block class="ml-16rpx" size="large" theme="primary">确定
334337
</t-button>
335338
</view>
336-
<view class="m-32rpx flex" wx:if="{{detailStatus==='WeixinDetail'}}">
337-
<t-button bind:tap="copyWeixinChangelog" block class="mr-16rpx" size="large" theme="light">复制更新日志链接
338-
</t-button>
339-
<t-button bind:tap="closeCellDetailPopup" block class="ml-16rpx" size="large" theme="primary">确定
339+
340+
<view class="m-32rpx flex items-center flex-col" wx:if="{{detailStatus==='WeixinDetail'}}">
341+
<view>
342+
<t-link bind:tap="copyWeixinChangelog" content="复制更新日志链接" hover size="medium" theme="primary"/>
343+
</view>
344+
<t-button bind:tap="closeCellDetailPopup" block class="mt-16rpx" size="large" theme="primary">确定
340345
</t-button>
341346
</view>
342347
</t-popup>
@@ -445,7 +450,7 @@ See the Mulan PubL v2 for more details.
445450

446451
<view class="flex items-center justify-between mx-32rpx">
447452
<t-loading align="center" class="large" size="68rpx" theme="circular"/>
448-
<view class="break-words ml-24rpx">{{updateProgressDialogMessage}}</view>
453+
<view class="break-all ml-24rpx">{{updateProgressDialogMessage}}</view>
449454
</view>
450455

451456
<view class="m-32rpx">

source/pages/oss-licenses-menu/oss-licenses-menu.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ See the Mulan PubL v2 for more details.
2323
<t-cell arrow bind:tap="licenseMpClick" data-index="{{index}}" description="{{item.description}}" hover
2424
wx:for="{{licenseMp}}" wx:key="{{index}}">
2525
<view slot="title">
26-
<text class="inline">{{item.name + (item.publisher !== '' ? (' (' + item.publisher + ')') : '')}}</text>
26+
<text class="text-32rpx inline">{{item.name + (item.publisher !== '' ? (' (' + item.publisher + ')') : '')}}</text>
2727
<t-tag class="ml-16rpx inline-block vertical-bottom" size="small" theme="default" variant="light">
2828
{{'v' + item.version}}
2929
</t-tag>
@@ -36,7 +36,7 @@ See the Mulan PubL v2 for more details.
3636
<t-cell arrow bind:tap="licenseBuildClick" data-index="{{index}}" description="{{item.description}}" hover
3737
wx:for="{{licenseBuild}}" wx:key="{{index}}">
3838
<view slot="title">
39-
<text class="inline">{{item.name + (item.publisher !== '' ? (' (' + item.publisher + ')') : '')}}</text>
39+
<text class="text-32rpx inline">{{item.name + (item.publisher !== '' ? (' (' + item.publisher + ')') : '')}}</text>
4040
<t-tag class="ml-16rpx inline-block vertical-bottom" size="small" theme="default" variant="light">
4141
{{'v' + item.version}}
4242
</t-tag>

source/pages/oss-licenses/oss-licenses.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
See the Mulan PubL v2 for more details.
1313
*/
1414

15+
import Message from 'tdesign-miniprogram/message/index';
16+
1517
const licensesMp = require('../utils/licenses-mp')
1618
const licensesBuild = require('../utils/licenses-build')
1719

@@ -21,7 +23,7 @@ Page({
2123
* 页面的初始数据
2224
*/
2325
data: {
24-
licensesMp: [], licensesBuild: [], title: "", licenseBody: "", repoLink: ""
26+
licensesMp: [], licensesBuild: [], title: "",version: "", licenseBody: "", repoLink: "", repoType: ""
2527
},
2628

2729
/**
@@ -33,13 +35,17 @@ Page({
3335
if (type === "mp") this.setData({
3436
licenseMp: licensesMp,
3537
title: licensesMp[index].name,
38+
version: licensesMp[index].version,
3639
licenseBody: licensesMp[index].licenseText,
37-
repoLink: licensesMp[index].repository
40+
repoLink: licensesMp[index].repository,
41+
repoType: licensesMp[index].repository.toLowerCase().includes("github.com") ? "GitHub" : (licensesMp[index].repository.toLowerCase().includes("gitlab.com") ? "GitLab" : "Unknown")
3842
}); else if (type === "build") this.setData({
3943
licenseBuild: licensesBuild,
4044
title: licensesBuild[index].name,
45+
version: licensesBuild[index].version,
4146
licenseBody: licensesBuild[index].licenseText,
42-
repoLink: licensesBuild[index].repository
47+
repoLink: licensesBuild[index].repository,
48+
repoType: licensesBuild[index].repository.toLowerCase().includes("github.com") ? "GitHub" : (licensesBuild[index].repository.toLowerCase().includes("gitlab.com") ? "GitLab" : "Unknown")
4349
})
4450
},
4551

@@ -71,6 +77,29 @@ Page({
7177
this.setData({
7278
heightRecycle: windowHeight - elementHeight1
7379
});
74-
},
75-
80+
}, copyUtil(copyData) {
81+
const that = this;
82+
wx.setClipboardData({
83+
data: copyData, success(res) {
84+
setTimeout(() => {
85+
wx.showToast({
86+
title: '', duration: 0, icon: 'none'
87+
});
88+
wx.hideToast();
89+
}, 0)
90+
Message.success({
91+
context: that,
92+
offset: [90, 32],
93+
duration: 3000,
94+
icon: false,
95+
single: false,
96+
content: `已复制:${copyData}`,
97+
align: 'center'
98+
});
99+
}, fail: function (res) {
100+
}
101+
})
102+
}, copyRepo() {
103+
this.copyUtil(this.data.repoLink)
104+
}
76105
})

source/pages/oss-licenses/oss-licenses.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"component": true,
33
"styleIsolation": "apply-shared",
44
"usingComponents": {
5-
"t-navbar": "tdesign-miniprogram/navbar/navbar"
5+
"t-link": "tdesign-miniprogram/link/link",
6+
"t-message": "tdesign-miniprogram/message/message",
7+
"t-navbar": "tdesign-miniprogram/navbar/navbar",
8+
"t-tag": "tdesign-miniprogram/tag/tag"
69
}
710
}

source/pages/oss-licenses/oss-licenses.wxml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,26 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
1212
See the Mulan PubL v2 for more details.
1313
-->
1414

15+
<t-message id="t-message"/>
16+
1517
<view id="titleTop1">
1618
<t-navbar left-arrow t-class-content="t-navbar-content" t-class-placeholder="t-navbar-placeholder">
17-
<view class="ml-16rpx text-36rpx font-600" slot="left">{{title}}</view>
19+
<view class="ml-16rpx" slot="left">
20+
<view class=" text-36rpx font-600 inline">{{title}}</view>
21+
<t-tag class="ml-16rpx inline-block vertical-bottom" size="small" theme="default" variant="light">
22+
{{'v' + version}}
23+
</t-tag>
24+
</view>
1825
</t-navbar>
1926
</view>
2027

21-
<scroll-view class="overflow-y-auto" enhanced scroll-y style="height:{{heightRecycle+'px'}};" type="list">
28+
<scroll-view class="overflow-y-auto block" enhanced scroll-x scroll-y style="height:{{heightRecycle+'px'}};"
29+
type="list">
2230
<view class="p-32rpx">
23-
<text user-select>{{(repoLink !== '' ? repoLink + '\n\n' : '') + licenseBody}}</text>
31+
<t-link bind:tap="copyRepo" class="mb-32rpx" content="{{repoLink}}" hover
32+
prefixIcon="{{repoType==='GitHub'?'logo-github':(repoType==='GitLab'?'logo-gitlab':'git-repository')}}"
33+
size="large" theme="primary" wx:if="{{repoLink !== ''}}"/>
34+
35+
<text class="break-words whitespace-pre-wrap;" user-select>{{licenseBody}}</text>
2436
</view>
2537
</scroll-view>

source/unocss.wxss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ page,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-
3535
.w-full{width:100%;}
3636
.flex{display:flex;}
3737
.flex-1{flex:1 1 0%;}
38+
.flex-col{flex-direction:column;}
3839
.items-center{align-items:center;}
3940
.self-center{align-self:center;}
4041
.justify-center{justify-content:center;}
@@ -53,6 +54,7 @@ page,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-
5354
.text-right{text-align:right;}
5455
.vertical-bottom{vertical-align:bottom;}
5556
.text-13px{font-size:13px;}
57+
.text-32rpx{font-size:32rpx;}
5658
.text-36rpx{font-size:36rpx;}
5759
.text-60rpx{font-size:60rpx;}
5860
.font-600{font-weight:600;}

0 commit comments

Comments
 (0)