jmash-core-mp 0.1.7 → 0.1.9
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/lib/index.d.ts +1 -1
- package/lib/types/core.d.ts +20 -0
- package/package.json +1 -1
- package/src/components/auth-user/jmash-user.mpx +355 -345
- package/src/components/common/jmash-top-navigation.mpx +6 -2
- package/src/index.ts +1 -1
- package/src/styles/index.scss +1 -27
- package/src/styles/vars.scss +27 -0
- package/src/types/core.ts +29 -0
- package/src/components/common/auth-search.mpx +0 -31
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AppConfig, ResponseData, ValidateData } from "./types/core";
|
|
1
|
+
export type { AppConfig, ResponseData, ValidateData, EventBase, EventTarget, CanvasResponse } from "./types/core";
|
|
2
2
|
export type { Entry, DictEntryModel } from "./api/dict/types";
|
|
3
3
|
export { EntryDict, EnumDict } from "./api/dicts";
|
|
4
4
|
export { mpxFetch } from "./utils/request";
|
package/lib/types/core.d.ts
CHANGED
|
@@ -19,3 +19,23 @@ export interface ValidateData {
|
|
|
19
19
|
validate: boolean;
|
|
20
20
|
message: string;
|
|
21
21
|
}
|
|
22
|
+
export interface EventBase {
|
|
23
|
+
changedTouches?: any;
|
|
24
|
+
currentTarget: EventTarget;
|
|
25
|
+
target?: EventTarget;
|
|
26
|
+
type?: string;
|
|
27
|
+
detail?: any;
|
|
28
|
+
touches: any;
|
|
29
|
+
}
|
|
30
|
+
export interface EventTarget {
|
|
31
|
+
dataset: any;
|
|
32
|
+
id: string | number;
|
|
33
|
+
offsetLeft?: number;
|
|
34
|
+
offsetTop?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface CanvasResponse {
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
nodeCanvasType?: string;
|
|
40
|
+
node: any;
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,345 +1,355 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="auth-user-box">
|
|
3
|
-
<block wx:if="{{ isLogin }}">
|
|
4
|
-
<view class="auth-user-l">
|
|
5
|
-
<!-- 头像 -->
|
|
6
|
-
<view class="avatar-wrapper">
|
|
7
|
-
<image src="{{ baseUrl+'/v1/file/image/clip/200/200/' + userInfo.avatar }}" class="avatar-img"
|
|
8
|
-
wx:if="{{ userInfo.avatar }}" mode="aspectFill"></image>
|
|
9
|
-
<image src="{{ resourceUrl + '/images/mall/' + defaultAvatar }}" class="avatar-img"
|
|
10
|
-
wx:elif="{{ defaultAvatar }}" mode="aspectFill"></image>
|
|
11
|
-
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img" wx:else mode="aspectFill"></image>
|
|
12
|
-
<view class="avatar-badge">
|
|
13
|
-
<text class="badge-icon">✎</text>
|
|
14
|
-
</view>
|
|
15
|
-
</view>
|
|
16
|
-
|
|
17
|
-
<!-- 用户信息 -->
|
|
18
|
-
<view class="auth-user-r" bind:tap="handleUpdateUser">
|
|
19
|
-
<view class="user-edit">
|
|
20
|
-
<text class="user-name">{{ userInfo.realName || '微信用户' }}</text>
|
|
21
|
-
<view class="edit-icon-bg">
|
|
22
|
-
<text class="edit-icon">✎</text>
|
|
23
|
-
</view>
|
|
24
|
-
</view>
|
|
25
|
-
<text class="user-mobile">{{ userInfo.mobilePhoneIns || '未绑定手机号'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
<text class="login-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
font-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view class="auth-user-box">
|
|
3
|
+
<block wx:if="{{ isLogin }}">
|
|
4
|
+
<view class="auth-user-l">
|
|
5
|
+
<!-- 头像 -->
|
|
6
|
+
<view class="avatar-wrapper">
|
|
7
|
+
<image src="{{ baseUrl+'/v1/file/image/clip/200/200/' + userInfo.avatar }}" class="avatar-img"
|
|
8
|
+
wx:if="{{ userInfo.avatar }}" mode="aspectFill"></image>
|
|
9
|
+
<image src="{{ resourceUrl + '/images/mall/' + defaultAvatar }}" class="avatar-img"
|
|
10
|
+
wx:elif="{{ defaultAvatar }}" mode="aspectFill"></image>
|
|
11
|
+
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img" wx:else mode="aspectFill"></image>
|
|
12
|
+
<view class="avatar-badge">
|
|
13
|
+
<text class="badge-icon">✎</text>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
|
|
17
|
+
<!-- 用户信息 -->
|
|
18
|
+
<view class="auth-user-r" bind:tap="handleUpdateUser">
|
|
19
|
+
<view class="user-edit">
|
|
20
|
+
<text class="user-name" style="color: {{ userNameColor }}">{{ userInfo.realName || '微信用户' }}</text>
|
|
21
|
+
<view class="edit-icon-bg">
|
|
22
|
+
<text class="edit-icon">✎</text>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
25
|
+
<text class="user-mobile" style="color: {{ userMobileColor }}">{{ userInfo.mobilePhoneIns || '未绑定手机号'
|
|
26
|
+
}}</text>
|
|
27
|
+
</view>
|
|
28
|
+
|
|
29
|
+
<!-- 右侧箭头 -->
|
|
30
|
+
<view class="right-arrow" bind:tap="handleUpdateUser">
|
|
31
|
+
<text class="arrow-icon">›</text>
|
|
32
|
+
</view>
|
|
33
|
+
</view>
|
|
34
|
+
</block>
|
|
35
|
+
|
|
36
|
+
<!-- 未登录状态 -->
|
|
37
|
+
<view class="auth-user-l not-logged-in" wx:else>
|
|
38
|
+
<view class="not-logged-wrapper">
|
|
39
|
+
<view class="avatar-wrapper" bind:tap="handleLogin">
|
|
40
|
+
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img not-logged" mode="aspectFill"></image>
|
|
41
|
+
<view class="avatar-plus">
|
|
42
|
+
<text class="plus-icon">+</text>
|
|
43
|
+
</view>
|
|
44
|
+
</view>
|
|
45
|
+
<view class="auth-user-r">
|
|
46
|
+
<text class="login-hint-text">登录后解锁更多功能</text>
|
|
47
|
+
<view class="login-btn" bind:tap="handleLogin">
|
|
48
|
+
<text class="login-text">立即登录</text>
|
|
49
|
+
<text class="login-arrow">›</text>
|
|
50
|
+
</view>
|
|
51
|
+
</view>
|
|
52
|
+
</view>
|
|
53
|
+
</view>
|
|
54
|
+
</view>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script lang="ts">
|
|
58
|
+
import mpx, { createComponent, ref, onShow, computed } from '@mpxjs/core'
|
|
59
|
+
import { useUserStore } from '../../store/user'
|
|
60
|
+
import { UserInfo } from "../../api/auth/types";
|
|
61
|
+
|
|
62
|
+
createComponent({
|
|
63
|
+
properties: {
|
|
64
|
+
defaultAvatar: {
|
|
65
|
+
type: String,
|
|
66
|
+
value: ''
|
|
67
|
+
},
|
|
68
|
+
backurl: {
|
|
69
|
+
type: String,
|
|
70
|
+
value: '/pages/home'
|
|
71
|
+
},
|
|
72
|
+
tabbar: {
|
|
73
|
+
type: String,
|
|
74
|
+
value: 'false'
|
|
75
|
+
},
|
|
76
|
+
userNameColor: {
|
|
77
|
+
type: String,
|
|
78
|
+
value: '#111111'
|
|
79
|
+
},
|
|
80
|
+
userMobileColor: {
|
|
81
|
+
type: String,
|
|
82
|
+
value: '#999999'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
setup(props, context) {
|
|
86
|
+
let config = getApp().globalData.config;
|
|
87
|
+
let resourceUrl = ref(config.resourceUrl);
|
|
88
|
+
let baseUrl = ref(config.baseUrl);
|
|
89
|
+
let userInfo = ref({} as UserInfo);
|
|
90
|
+
let userStore = useUserStore();
|
|
91
|
+
let refreshFunc = () => {
|
|
92
|
+
// 检查登录是否有效?
|
|
93
|
+
if (userStore.checkLogin()) {
|
|
94
|
+
userStore.getUserInfo().then((resp) => {
|
|
95
|
+
userInfo.value = resp;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
onShow(refreshFunc);
|
|
100
|
+
//console.log(resourceUrl);
|
|
101
|
+
const isLogin = computed(() => userStore.accessToken !== '');
|
|
102
|
+
return { resourceUrl, baseUrl, userInfo, userStore, refreshFunc, isLogin };
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
handleLogin() {
|
|
106
|
+
console.log("handleLogin");
|
|
107
|
+
//检查登录并跳转登录
|
|
108
|
+
this.userStore.loginOnlyAC().then(() => {
|
|
109
|
+
//登录成功,加载业务
|
|
110
|
+
console.log("静默登录成功");
|
|
111
|
+
this.refreshFunc();
|
|
112
|
+
}).catch(() => {
|
|
113
|
+
console.log("登录失败1!", this.backurl);
|
|
114
|
+
mpx.navigateTo({
|
|
115
|
+
url: '/jmash/pages/auth/login' + "?backurl=" + encodeURIComponent(this.backurl) + "&tabbar=" + this.tabbar
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
handleUpdateUser() {
|
|
120
|
+
mpx.navigateTo({
|
|
121
|
+
url: '/jmash/pages/auth/update-user'
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
})
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<style lang="scss">
|
|
130
|
+
@use "../../styles/index.scss" as *;
|
|
131
|
+
|
|
132
|
+
// 颜色变量
|
|
133
|
+
$primary: #07c160;
|
|
134
|
+
$text-1: #111111;
|
|
135
|
+
$text-2: #666666;
|
|
136
|
+
$text-3: #999999;
|
|
137
|
+
$border: #e8e8e8;
|
|
138
|
+
$bg-page: #f5f5f5;
|
|
139
|
+
$bg-card: #ffffff;
|
|
140
|
+
// 修改背景色从白色变到透明
|
|
141
|
+
.auth-user-box {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
padding: 32rpx 24rpx;
|
|
145
|
+
// background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
|
|
146
|
+
border-radius: 20rpx;
|
|
147
|
+
margin: 16rpx 16rpx 24rpx;
|
|
148
|
+
// box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
|
149
|
+
transition: all 0.3s;
|
|
150
|
+
background: transparent;
|
|
151
|
+
|
|
152
|
+
&:active {
|
|
153
|
+
transform: translateY(1rpx);
|
|
154
|
+
box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.06);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.auth-user-l {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
flex: 1;
|
|
161
|
+
width: 100%;
|
|
162
|
+
|
|
163
|
+
.avatar-wrapper {
|
|
164
|
+
position: relative;
|
|
165
|
+
margin-right: 20rpx;
|
|
166
|
+
flex-shrink: 0;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
|
|
169
|
+
.avatar-img {
|
|
170
|
+
width: 96rpx;
|
|
171
|
+
height: 96rpx;
|
|
172
|
+
border-radius: 50%;
|
|
173
|
+
background-color: $bg-page;
|
|
174
|
+
display: block;
|
|
175
|
+
transition: all 0.3s;
|
|
176
|
+
border: 3rpx solid rgba(7, 193, 96, 0.1);
|
|
177
|
+
box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.1);
|
|
178
|
+
|
|
179
|
+
&:active {
|
|
180
|
+
transform: scale(1.05);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&.not-logged {
|
|
184
|
+
opacity: 0.4;
|
|
185
|
+
filter: grayscale(100%);
|
|
186
|
+
box-shadow: none;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.avatar-badge {
|
|
191
|
+
position: absolute;
|
|
192
|
+
right: -2rpx;
|
|
193
|
+
bottom: -2rpx;
|
|
194
|
+
width: 36rpx;
|
|
195
|
+
height: 36rpx;
|
|
196
|
+
background: $primary;
|
|
197
|
+
border-radius: 50%;
|
|
198
|
+
border: 2rpx solid $bg-card;
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
box-shadow: 0 2rpx 6rpx rgba(7, 193, 96, 0.3);
|
|
203
|
+
|
|
204
|
+
.badge-icon {
|
|
205
|
+
font-size: 16rpx;
|
|
206
|
+
color: #fff;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.auth-user-r {
|
|
213
|
+
flex: 1;
|
|
214
|
+
min-width: 0;
|
|
215
|
+
|
|
216
|
+
.user-edit {
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
margin-bottom: 10rpx;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
|
|
222
|
+
.user-name {
|
|
223
|
+
font-size: 32rpx;
|
|
224
|
+
font-weight: 600;
|
|
225
|
+
color: $text-1;
|
|
226
|
+
line-height: 1.2;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.edit-icon-bg {
|
|
230
|
+
width: 32rpx;
|
|
231
|
+
height: 32rpx;
|
|
232
|
+
background: rgba(7, 193, 96, 0.1);
|
|
233
|
+
border-radius: 50%;
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
margin-left: 8rpx;
|
|
238
|
+
|
|
239
|
+
.edit-icon {
|
|
240
|
+
font-size: 14rpx;
|
|
241
|
+
color: $primary;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.user-mobile {
|
|
247
|
+
font-size: 24rpx;
|
|
248
|
+
color: $text-3;
|
|
249
|
+
line-height: 1.4;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.right-arrow {
|
|
254
|
+
flex-shrink: 0;
|
|
255
|
+
width: 32rpx;
|
|
256
|
+
height: 32rpx;
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
|
|
261
|
+
.arrow-icon {
|
|
262
|
+
font-size: 28rpx;
|
|
263
|
+
color: $text-3;
|
|
264
|
+
font-weight: 300;
|
|
265
|
+
line-height: 1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// 未登录状态
|
|
270
|
+
.not-logged-in {
|
|
271
|
+
.not-logged-wrapper {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
width: 100%;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.avatar-wrapper {
|
|
278
|
+
.avatar-plus {
|
|
279
|
+
position: absolute;
|
|
280
|
+
right: -4rpx;
|
|
281
|
+
bottom: -4rpx;
|
|
282
|
+
width: 40rpx;
|
|
283
|
+
height: 40rpx;
|
|
284
|
+
background: $primary;
|
|
285
|
+
border-radius: 50%;
|
|
286
|
+
border: 3rpx solid $bg-card;
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.3);
|
|
291
|
+
|
|
292
|
+
.plus-icon {
|
|
293
|
+
font-size: 36rpx;
|
|
294
|
+
color: #fff;
|
|
295
|
+
line-height: 1;
|
|
296
|
+
font-weight: 300;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.auth-user-r {
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
flex: 1;
|
|
305
|
+
min-width: 0;
|
|
306
|
+
margin-left: 8rpx;
|
|
307
|
+
|
|
308
|
+
.login-hint-text {
|
|
309
|
+
font-size: 24rpx;
|
|
310
|
+
color: $text-3;
|
|
311
|
+
margin-bottom: 12rpx;
|
|
312
|
+
line-height: 1.4;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.login-btn {
|
|
316
|
+
display: inline-flex;
|
|
317
|
+
align-items: center;
|
|
318
|
+
padding: 12rpx 24rpx;
|
|
319
|
+
background: linear-gradient(135deg, #07c160 0%, #05a050 100%);
|
|
320
|
+
border-radius: 40rpx;
|
|
321
|
+
cursor: pointer;
|
|
322
|
+
box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.25);
|
|
323
|
+
transition: all 0.3s;
|
|
324
|
+
width: fit-content;
|
|
325
|
+
|
|
326
|
+
&:active {
|
|
327
|
+
transform: scale(0.98);
|
|
328
|
+
box-shadow: 0 2rpx 6rpx rgba(7, 193, 96, 0.2);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.login-text {
|
|
332
|
+
font-size: 26rpx;
|
|
333
|
+
font-weight: 600;
|
|
334
|
+
color: #fff;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.login-arrow {
|
|
338
|
+
font-size: 30rpx;
|
|
339
|
+
color: #fff;
|
|
340
|
+
margin-left: 4rpx;
|
|
341
|
+
line-height: 1;
|
|
342
|
+
font-weight: 300;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
</style>
|
|
349
|
+
|
|
350
|
+
<script type="application/json">
|
|
351
|
+
{
|
|
352
|
+
"component": true,
|
|
353
|
+
"usingComponents": {}
|
|
354
|
+
}
|
|
355
|
+
</script>
|
|
@@ -110,8 +110,12 @@ createComponent({
|
|
|
110
110
|
const defaultTitleColorWhite = "#fff";
|
|
111
111
|
const defaultTitleColorBlack = "#333";
|
|
112
112
|
let color: string;
|
|
113
|
-
//
|
|
114
|
-
let titleColor =
|
|
113
|
+
// 计算标题颜色:回到顶部时使用自定义颜色,否则根据渐变模式切换
|
|
114
|
+
let titleColor = scrollTop === 0
|
|
115
|
+
? this.titleColor
|
|
116
|
+
: (this.isGradient
|
|
117
|
+
? (scrollTop >= 80 ? defaultTitleColorBlack : defaultTitleColorWhite)
|
|
118
|
+
: this.titleColor);
|
|
115
119
|
|
|
116
120
|
if (scrollTop === 0) {
|
|
117
121
|
color = "rgba(255, 255, 255, 0)";
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AppConfig, ResponseData, ValidateData } from "./types/core";
|
|
1
|
+
export type { AppConfig, ResponseData, ValidateData, EventBase, EventTarget, CanvasResponse } from "./types/core";
|
|
2
2
|
export type { Entry, DictEntryModel } from "./api/dict/types";
|
|
3
3
|
export { EntryDict, EnumDict } from "./api/dicts";
|
|
4
4
|
export { mpxFetch } from "./utils/request";
|
package/src/styles/index.scss
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
$border-radius: 20rpx;
|
|
3
|
-
$border-mini-radius: 10rpx;
|
|
4
|
-
$border-max-radius: 50rpx;
|
|
5
|
-
// 字体大小
|
|
6
|
-
$font-size: 28rpx;
|
|
7
|
-
$font-size-mini: 24rpx;
|
|
8
|
-
// 颜色
|
|
9
|
-
$white-color: #fff;
|
|
10
|
-
$red-color: #ef4444;
|
|
11
|
-
$green-color: #16a34a;
|
|
12
|
-
$blue-color: #2563eb;
|
|
13
|
-
$black-color: #000;
|
|
14
|
-
// 字体颜色
|
|
15
|
-
$font-color: #333;
|
|
16
|
-
$font-color-grey: #666;
|
|
17
|
-
$font-color-grey-opacity: #999;
|
|
18
|
-
// 宽
|
|
19
|
-
$width: 100%;
|
|
20
|
-
// 层级
|
|
21
|
-
$z-index: 99999;
|
|
22
|
-
// 下拉线颜色
|
|
23
|
-
$border-line: #ebebeb;
|
|
24
|
-
// 背景色
|
|
25
|
-
$background-color: #f6f6f6;
|
|
26
|
-
// 白色背景
|
|
27
|
-
$background-white-color: #fff;
|
|
1
|
+
@forward "@/styles/vars.scss";
|
|
28
2
|
|
|
29
3
|
//tabbar web 放在底部
|
|
30
4
|
/* @mpx-if (__mpx_mode__ === 'web') */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// 圆角
|
|
2
|
+
$border-radius: 20rpx;
|
|
3
|
+
$border-mini-radius: 10rpx;
|
|
4
|
+
$border-max-radius: 50rpx;
|
|
5
|
+
// 字体大小
|
|
6
|
+
$font-size: 28rpx;
|
|
7
|
+
$font-size-mini: 24rpx;
|
|
8
|
+
// 颜色
|
|
9
|
+
$white-color: #fff;
|
|
10
|
+
$red-color: #ef4444;
|
|
11
|
+
$green-color: #16a34a;
|
|
12
|
+
$blue-color: #2563eb;
|
|
13
|
+
$black-color: #000;
|
|
14
|
+
// 字体颜色
|
|
15
|
+
$font-color: #333;
|
|
16
|
+
$font-color-grey: #666;
|
|
17
|
+
$font-color-grey-opacity: #999;
|
|
18
|
+
// 宽
|
|
19
|
+
$width: 100%;
|
|
20
|
+
// 层级
|
|
21
|
+
$z-index: 99999;
|
|
22
|
+
// 下拉线颜色
|
|
23
|
+
$border-line: #ebebeb;
|
|
24
|
+
// 背景色
|
|
25
|
+
$background-color: #f6f6f6;
|
|
26
|
+
// 白色背景
|
|
27
|
+
$background-white-color: #fff;
|
package/src/types/core.ts
CHANGED
|
@@ -39,3 +39,32 @@ export interface ValidateData {
|
|
|
39
39
|
// 校验失败提示信息.
|
|
40
40
|
message: string;
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
// 事件基础
|
|
44
|
+
export interface EventBase {
|
|
45
|
+
// 在触摸事件中使用,表示触摸点的状态
|
|
46
|
+
changedTouches?: any;
|
|
47
|
+
// 事件绑定的元素
|
|
48
|
+
currentTarget: EventTarget;
|
|
49
|
+
// 指向触发事件的目标节点
|
|
50
|
+
target?: EventTarget;
|
|
51
|
+
// 事件的类型,指示事件的具体类型,如 click, input, blur
|
|
52
|
+
type?: string;
|
|
53
|
+
detail?: any;
|
|
54
|
+
touches: any;
|
|
55
|
+
}
|
|
56
|
+
// 事件绑定的元素
|
|
57
|
+
export interface EventTarget {
|
|
58
|
+
dataset: any;
|
|
59
|
+
id: string | number;
|
|
60
|
+
offsetLeft?: number;
|
|
61
|
+
offsetTop?: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// canvas返回的数据
|
|
65
|
+
export interface CanvasResponse {
|
|
66
|
+
width?: number;
|
|
67
|
+
height?: number;
|
|
68
|
+
nodeCanvasType?: string;
|
|
69
|
+
node: any;
|
|
70
|
+
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="search-component">
|
|
3
|
-
<text>搜索组件</text>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { createComponent } from '@mpxjs/core'
|
|
9
|
-
|
|
10
|
-
createComponent({
|
|
11
|
-
data: {
|
|
12
|
-
title: '搜索'
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<style lang="scss">
|
|
18
|
-
.search-component {
|
|
19
|
-
padding: 40rpx;
|
|
20
|
-
text-align: center;
|
|
21
|
-
font-size: 32rpx;
|
|
22
|
-
color: #333;
|
|
23
|
-
}
|
|
24
|
-
</style>
|
|
25
|
-
|
|
26
|
-
<script type="application/json">
|
|
27
|
-
{
|
|
28
|
-
"component": true,
|
|
29
|
-
"usingComponents": {}
|
|
30
|
-
}
|
|
31
|
-
</script>
|