w-ui-v1 1.0.40 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
7
7
  "main": "index.ts",
8
- "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1"
10
- },
8
+
11
9
  "peerDependencies": {
12
10
  "wot-design-uni": "^1.7.0",
13
11
  "z-paging": "^2.8.5"
@@ -35,11 +35,38 @@ const pageData = ref([])
35
35
  const pageConf = ref({ groups: [] })
36
36
 
37
37
  onLoad((option: any) => {
38
- sourceId.value = props.sourceId || option.sourceId
39
- code.value = option.code || props.code
38
+ const q = decodeURIComponent(option.q) // 获取到二维码原始链接内容
39
+ let sc:any=getQueryParams(q)
40
+ sourceId.value = props.sourceId || option.sourceId ||sc.sourceId
41
+ code.value = option.code || props.code || sc.code
40
42
  getPageData()
41
43
  uni.setNavigationBarTitle({ title: "详情" })
42
44
  })
45
+
46
+ //将 URL 中问号后面的参数转换为对象
47
+ function getQueryParams(url:string) {
48
+ // 获取问号后面的部分
49
+ const queryString = url.split('?')[1];
50
+
51
+ if (!queryString) {
52
+ return {};
53
+ }
54
+
55
+ // 将参数字符串分割成键值对数组
56
+ const pairs = queryString.split('&');
57
+
58
+ // 创建结果对象
59
+ const result = {};
60
+
61
+ // 遍历键值对
62
+ pairs.forEach(pair => {
63
+ const [key, value] = pair.split('=');
64
+ // 解码URI组件并添加到结果对象
65
+ result[decodeURIComponent(key)] = decodeURIComponent(value || '');
66
+ });
67
+
68
+ return result;
69
+ }
43
70
  // 获取页面配置
44
71
  function getPageConfig() {
45
72
  detailPageConfig(sourceId.value).then((res: any) => {
@@ -238,7 +265,7 @@ function goto(type = '', PItem: any, item: any) {
238
265
 
239
266
  .label {
240
267
  //文字换行
241
- white-space: normal;
268
+ white-space: nowrap;
242
269
  word-break: break-all;
243
270
  margin-right: 20rpx;
244
271
  }
@@ -85,6 +85,12 @@ function withSlot() {
85
85
  message
86
86
  .confirm({
87
87
  title: pageConf.value?.title,
88
+ cancelButtonProps: {
89
+ round:false
90
+ },
91
+ confirmButtonProps: {
92
+ round:false
93
+ },
88
94
  beforeConfirm:({ resolve }) => {
89
95
  toast.loading(`${pageConf.value?.title}中...`)
90
96
  customButtonSave(page.value.sourceId,props.itemData.code,model).then((res)=>{
@@ -14,7 +14,7 @@
14
14
  :placeholder="`请选择${item.title}`" :source-id="item.sourceId" filterable />
15
15
  <wd-input v-else-if="item.extControlType === 'text'" type="text" :label="item.title"
16
16
  v-model="searchData[item.sourceId]" :placeholder="`请输入${item.title}`" clearable />
17
- <wd-picker v-else-if="item.extControlType === 'select'" :columns="Enumcolumn[item.mstrucId]"
17
+ <wd-picker v-else-if="item.extControlType === 'multiselect'" :columns="Enumcolumn[item.mstrucId]"
18
18
  :label="item.title" :placeholder="`请选择${item.title}`" v-model="searchData[item.sourceId]" clearable />
19
19
  <view v-else-if="item.extControlType === 'int'">
20
20
  <wd-input type="number" :label="item.title" v-model="searchData[item.sourceId]"
@@ -32,8 +32,8 @@
32
32
  :placeholder="`请输入${item.title}`" clearable />
33
33
  </view>
34
34
  <view class="search-btn">
35
- <wd-button size="small" icon="refresh" @click="clear" type="info">重置</wd-button>
36
- <wd-button size="small" icon="search" @click="search">确定</wd-button>
35
+ <wd-button size="small" icon="refresh" :round="false" @click="clear" type="info">重置</wd-button>
36
+ <wd-button size="small" icon="search" :round="false" @click="search">确定</wd-button>
37
37
 
38
38
  </view>
39
39
 
@@ -153,6 +153,9 @@ async function getEnumer() {
153
153
  if (item.extControlType === 'select') {
154
154
  params.push(`mstrucIds=${item.mstrucId}`)
155
155
  }
156
+ if (item.extControlType === 'multiselect') {
157
+ params.push(`mstrucIds=${item.mstrucId}`)
158
+ }
156
159
 
157
160
  });
158
161
  if (!params.length) return
@@ -164,8 +167,9 @@ async function getEnumer() {
164
167
 
165
168
  <style scoped lang="scss">
166
169
  .search-box {
170
+
167
171
  .left {
168
- position: relative;
172
+ // position: relative;
169
173
 
170
174
  .search-icon {
171
175
  position: absolute;
@@ -176,7 +180,12 @@ async function getEnumer() {
176
180
  }
177
181
 
178
182
  .search-btn {
179
- margin: 20rpx;
183
+ z-index: 1;
184
+ background-color: #fff;
185
+ height: 30px;
186
+ position: sticky;
187
+ bottom: 0;
188
+ padding: 20rpx;
180
189
  display: flex;
181
190
  justify-content: space-between;
182
191
 
Binary file
package/w-user/w-user.vue CHANGED
@@ -1,112 +1,149 @@
1
1
  <template>
2
- <view class="user">
3
- <view class="top-box">
4
- <view class="top">
5
- <view class="circle">
6
- <wd-icon name="user-circle" size="120rpx" color="#bababa"></wd-icon>
7
- </view>
8
- <view class="username">
9
- <view class="name">
10
- <text>{{ userInfo.name }}</text>
11
- </view>
12
- <view class="nickName">
13
- <text>昵称:{{ userInfo.nickName }}</text>
14
- </view>
15
- </view>
16
- </view>
17
- </view>
18
-
19
- <wd-cell-group>
20
- <wd-cell title="个人信息" icon="user" v-if="userInfo.viewPersonalInfoable" :is-link="true" :clickable="true" @click="goUserInfo"/>
21
- <!-- <wd-cell title="修改密码" icon="keywords" :is-link="true" :clickable="true" /> -->
22
- <wd-cell title="退出登录" icon="logout" :is-link="true" :clickable="true" @click="quit" />
23
- </wd-cell-group>
24
- <wd-message-box />
25
- </view>
2
+ <view class="user">
3
+ <view class="top-box">
4
+ <!-- 用户头部信息 -->
5
+ <view class="user-header">
6
+ <view class="user-info">
7
+ <!-- <img src="user.avatar" class="avatar" alt="用户头像"> -->
8
+ <image class="avatar" src="./user-avatar-fill.png" mode=""></image>
9
+ <view class="user-text">
10
+ <view class="user-name">{{ userInfo.name }}</view>
11
+ <view class="user-nickname">
12
+ 昵称:{{ userInfo.nickName }}
13
+ </view>
14
+ </view>
15
+ </view>
16
+ </view>
17
+ </view>
18
+
19
+ <wd-cell-group>
20
+ <wd-cell title="个人信息" icon="user" v-if="userInfo.viewPersonalInfoable" :is-link="true" :clickable="true"
21
+ @click="goUserInfo" />
22
+ <!-- <wd-cell title="修改密码" icon="keywords" :is-link="true" :clickable="true" /> -->
23
+ <wd-cell title="退出登录" icon="logout" :is-link="true" :clickable="true" @click="quit" />
24
+ </wd-cell-group>
25
+ <wd-message-box />
26
+ </view>
26
27
  </template>
27
28
 
28
29
  <script setup lang="ts">
29
- import { ref } from 'vue';
30
- import {
31
- useMessage
32
- } from 'wot-design-uni'
33
- defineOptions({
34
- name: 'WUser'
35
- })
36
- const message = useMessage()
37
- const userInfo = ref({
38
- name:uni.getStorageSync('userInfo').name,
39
- nickName:uni.getStorageSync('userInfo').nickName,
40
- viewPersonalInfoable:uni.getStorageSync('userInfo').viewPersonalInfoable
41
- })
42
-
43
- //退出登录
44
- const quit = () => {
45
- message
46
- .confirm({
47
- // msg: '提示文案',
48
- title: '退出登录'
49
- })
50
- .then(() => {
51
- uni.removeStorageSync('token')
52
- uni.reLaunch({
53
- url: '/pages/login/login'
54
- })
55
- })
56
- .catch(() => {
57
- console.log('点击了取消按钮')
58
- })
59
-
60
- }
61
-
62
- //查看用户信息
63
- const goUserInfo = () => {
64
- uni.navigateTo({
65
- url: `/pages/detail/detail?sourceId=${uni.getStorageSync('userInfo').gtmplSourceId}&code=${uni.getStorageSync('userInfo').id}`
66
- })
67
- }
30
+ import { ref } from 'vue';
31
+ import {
32
+ useMessage
33
+ } from 'wot-design-uni'
34
+ defineOptions({
35
+ name: 'WUser'
36
+ })
37
+ const message = useMessage()
38
+ const userInfo = ref({
39
+ name: uni.getStorageSync('userInfo').name,
40
+ nickName: uni.getStorageSync('userInfo').nickName,
41
+ viewPersonalInfoable: uni.getStorageSync('userInfo').viewPersonalInfoable
42
+ })
43
+
44
+ //退出登录
45
+ const quit = () => {
46
+ message
47
+ .confirm({
48
+ // msg: '提示文案',
49
+ title: '退出登录'
50
+ })
51
+ .then(() => {
52
+ uni.removeStorageSync('token')
53
+ uni.reLaunch({
54
+ url: '/pages/login/login'
55
+ })
56
+ })
57
+ .catch(() => {
58
+ console.log('点击了取消按钮')
59
+ })
60
+
61
+ }
62
+
63
+ //查看用户信息
64
+ const goUserInfo = () => {
65
+ uni.navigateTo({
66
+ url: `/pages/detail/detail?sourceId=${uni.getStorageSync('userInfo').gtmplSourceId}&code=${uni.getStorageSync('userInfo').id}`
67
+ })
68
+ }
68
69
  </script>
69
70
 
70
71
  <style scoped lang="scss">
71
- .user {
72
- background-color: #f5f5f5;
73
- height: 100vh;
74
-
75
- .top-box{
76
- // display: flex;
77
- // justify-content: center;
78
- // padding: 10px;
79
- .top {
80
- display: flex;
81
- align-items: center;
82
- padding: 25rpx;
83
- background-color: #4d80f0;
84
-
85
- .circle {
86
- background-color: #fcfcfccd;
87
- border-radius: 100%;
88
- margin-right: 20rpx;
89
- }
90
-
91
- .username {
92
- font-size: 40rpx;
93
-
94
- .name {
95
- margin-bottom: 10rpx;
96
- color: #fff;
97
- }
98
-
99
- .ic {
100
- font-size: 30rpx;
101
- color: #fff;
102
- }
103
- .nickName{
104
- font-size: 12px;
105
- color: #fff;
106
- }
107
- }
108
- }
109
- }
110
-
111
- }
72
+ .user {
73
+ background-color: #f5f5f5;
74
+ height: 100vh;
75
+
76
+ .top-box {
77
+ padding: 15px;
78
+ .user-header {
79
+ border-radius: 10px;
80
+ margin: auto;
81
+ background: linear-gradient(135deg, #4a6cf7 0%, #2541b2 100%);
82
+ color: white;
83
+ padding: 30px 20px;
84
+ box-shadow: 0 4px 12px rgba(74, 108, 247, 0.2);
85
+ position: relative;
86
+ overflow: hidden;
87
+ }
88
+
89
+ .user-header::before {
90
+ content: "";
91
+ position: absolute;
92
+ top: -50px;
93
+ right: -50px;
94
+ width: 150px;
95
+ height: 150px;
96
+ background: rgba(255, 255, 255, 0.1);
97
+ border-radius: 50%;
98
+ }
99
+
100
+ .user-header::after {
101
+ content: "";
102
+ position: absolute;
103
+ bottom: -80px;
104
+ left: -30px;
105
+ width: 200px;
106
+ height: 200px;
107
+ background: rgba(255, 255, 255, 0.05);
108
+ border-radius: 50%;
109
+ }
110
+
111
+ .user-info {
112
+ display: flex;
113
+ align-items: center;
114
+ position: relative;
115
+ z-index: 1;
116
+ }
117
+
118
+ .avatar {
119
+ width: 140rpx;
120
+ height: 140rpx;
121
+ border-radius: 50%;
122
+ border: 3px solid rgba(255, 255, 255, 0.3);
123
+ margin-right: 15px;
124
+ object-fit: cover;
125
+ // background-color: #fff;
126
+ }
127
+
128
+ .user-text {
129
+ flex: 1;
130
+ }
131
+
132
+ .user-name {
133
+ font-size: 20px;
134
+ font-weight: 600;
135
+ margin-bottom: 5px;
136
+ }
137
+
138
+ .user-nickname {
139
+ font-size: 14px;
140
+ opacity: 0.9;
141
+ display: flex;
142
+ align-items: center;
143
+ }
144
+ }
145
+
146
+
147
+
148
+ }
112
149
  </style>