jmash-core-mp 0.1.15 → 0.1.17
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/utils/request.js +2 -2
- package/package.json +1 -1
- package/src/components/auth-user/jmash-user.mpx +359 -356
- package/src/components/common/jmash-none-data.mpx +82 -77
- package/src/pages/index.mpx +44 -44
- package/src/utils/request.ts +2 -2
- package/lib/types/core.d.ts +0 -41
- /package/lib/{types/core.js → pages/index.mpx.d.ts} +0 -0
package/lib/utils/request.js
CHANGED
|
@@ -103,8 +103,8 @@ mpx.xfetch.interceptors.response.use(function (res) {
|
|
|
103
103
|
}
|
|
104
104
|
return Promise.reject(res);
|
|
105
105
|
}
|
|
106
|
-
//
|
|
107
|
-
return res;
|
|
106
|
+
// 返回promise,通过catch ,处理 code,message.
|
|
107
|
+
return Promise.reject(res);
|
|
108
108
|
});
|
|
109
109
|
//刷新Token
|
|
110
110
|
function refreshToken(refreshToken) {
|
package/package.json
CHANGED
|
@@ -1,356 +1,359 @@
|
|
|
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="{{
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<!--
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<image src="{{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
let
|
|
90
|
-
let
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
console.log("
|
|
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
|
-
font-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view class="auth-user-box">
|
|
3
|
+
<block wx:if="{{ isLogin }}">
|
|
4
|
+
<view class="auth-user-l" bind:tap="handleUpdateUser">
|
|
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="{{ defaultAvatar }}" class="avatar-img" wx:elif="{{ defaultAvatar }}" mode="aspectFill"></image>
|
|
10
|
+
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img" wx:else mode="aspectFill"></image>
|
|
11
|
+
<!-- <view class="avatar-badge">
|
|
12
|
+
<text class="badge-icon">✎</text>
|
|
13
|
+
</view> -->
|
|
14
|
+
</view>
|
|
15
|
+
|
|
16
|
+
<!-- 用户信息 -->
|
|
17
|
+
<view class="auth-user-r" bind:tap="handleUpdateUser">
|
|
18
|
+
<view class="user-edit">
|
|
19
|
+
<text class="user-name" style="color: {{ userNameColor }}">{{ userInfo.realName || '微信用户' }}</text>
|
|
20
|
+
<view class="edit-icon-bg">
|
|
21
|
+
<text class="edit-icon">✎</text>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<text class="user-mobile" style="color: {{ userMobileColor }}">{{ userInfo.mobilePhoneIns || '未绑定手机号'
|
|
25
|
+
}}</text>
|
|
26
|
+
</view>
|
|
27
|
+
|
|
28
|
+
<!-- 右侧箭头 -->
|
|
29
|
+
<!-- <view class="right-arrow" bind:tap="handleUpdateUser">
|
|
30
|
+
<text class="arrow-icon">›</text>
|
|
31
|
+
</view> -->
|
|
32
|
+
</view>
|
|
33
|
+
</block>
|
|
34
|
+
|
|
35
|
+
<!-- 未登录状态 -->
|
|
36
|
+
<view class="auth-user-l not-logged-in" wx:else>
|
|
37
|
+
<view class="not-logged-wrapper">
|
|
38
|
+
<view class="avatar-wrapper" bind:tap="handleLogin">
|
|
39
|
+
<!-- <image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img not-logged" mode="aspectFill"></image> -->
|
|
40
|
+
<image src="{{ defaultAvatar }}" class="avatar-img not-logged" wx:if="{{ defaultAvatar }}" mode="aspectFill">
|
|
41
|
+
</image>
|
|
42
|
+
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img not-logged" wx:else mode="aspectFill">
|
|
43
|
+
</image>
|
|
44
|
+
<view class="avatar-plus">
|
|
45
|
+
<text class="plus-icon">+</text>
|
|
46
|
+
</view>
|
|
47
|
+
</view>
|
|
48
|
+
<view class="auth-user-r">
|
|
49
|
+
<text class="login-hint-text">登录后解锁更多功能</text>
|
|
50
|
+
<view class="login-btn" bind:tap="handleLogin">
|
|
51
|
+
<text class="login-text">立即登录</text>
|
|
52
|
+
<text class="login-arrow">›</text>
|
|
53
|
+
</view>
|
|
54
|
+
</view>
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
</view>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script lang="ts">
|
|
61
|
+
import mpx, { createComponent, ref, onShow, computed } from '@mpxjs/core'
|
|
62
|
+
import { useUserStore } from '../../store/user'
|
|
63
|
+
import { UserInfo } from "../../api/auth/types";
|
|
64
|
+
|
|
65
|
+
createComponent({
|
|
66
|
+
properties: {
|
|
67
|
+
defaultAvatar: {
|
|
68
|
+
type: String,
|
|
69
|
+
value: ''
|
|
70
|
+
},
|
|
71
|
+
backurl: {
|
|
72
|
+
type: String,
|
|
73
|
+
value: '/pages/home'
|
|
74
|
+
},
|
|
75
|
+
tabbar: {
|
|
76
|
+
type: String,
|
|
77
|
+
value: 'false'
|
|
78
|
+
},
|
|
79
|
+
userNameColor: {
|
|
80
|
+
type: String,
|
|
81
|
+
value: '#111111'
|
|
82
|
+
},
|
|
83
|
+
userMobileColor: {
|
|
84
|
+
type: String,
|
|
85
|
+
value: '#999999'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
setup(props, context) {
|
|
89
|
+
let config = getApp().globalData.config;
|
|
90
|
+
let resourceUrl = ref(config.resourceUrl);
|
|
91
|
+
let baseUrl = ref(config.baseUrl);
|
|
92
|
+
let userInfo = ref({} as UserInfo);
|
|
93
|
+
let userStore = useUserStore();
|
|
94
|
+
let refreshFunc = () => {
|
|
95
|
+
// 检查登录是否有效?
|
|
96
|
+
if (userStore.checkLogin()) {
|
|
97
|
+
userStore.getUserInfo().then((resp) => {
|
|
98
|
+
userInfo.value = resp;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
onShow(refreshFunc);
|
|
103
|
+
//console.log(resourceUrl);
|
|
104
|
+
const isLogin = computed(() => userStore.accessToken !== '');
|
|
105
|
+
return { resourceUrl, baseUrl, userInfo, userStore, refreshFunc, isLogin };
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
handleLogin() {
|
|
109
|
+
console.log("handleLogin");
|
|
110
|
+
//检查登录并跳转登录
|
|
111
|
+
this.userStore.loginOnlyAC().then(() => {
|
|
112
|
+
//登录成功,加载业务
|
|
113
|
+
console.log("静默登录成功");
|
|
114
|
+
this.refreshFunc();
|
|
115
|
+
}).catch(() => {
|
|
116
|
+
console.log("登录失败1!", this.backurl);
|
|
117
|
+
mpx.navigateTo({
|
|
118
|
+
url: '/jmash/pages/auth/login' + "?backurl=" + encodeURIComponent(this.backurl) + "&tabbar=" + this.tabbar
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
handleUpdateUser() {
|
|
123
|
+
mpx.navigateTo({
|
|
124
|
+
url: '/jmash/pages/auth/update-user'
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
})
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style lang="scss">
|
|
133
|
+
@use "../../styles/index.scss" as *;
|
|
134
|
+
|
|
135
|
+
// 颜色变量
|
|
136
|
+
$primary: #07c160;
|
|
137
|
+
$text-1: #111111;
|
|
138
|
+
$text-2: #666666;
|
|
139
|
+
$text-3: #999999;
|
|
140
|
+
$border: #e8e8e8;
|
|
141
|
+
$bg-page: #f5f5f5;
|
|
142
|
+
$bg-card: #ffffff;
|
|
143
|
+
|
|
144
|
+
// 修改背景色从白色变到透明
|
|
145
|
+
.auth-user-box {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
padding: 32rpx 24rpx 32rpx 0;
|
|
149
|
+
// background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
|
|
150
|
+
border-radius: 20rpx;
|
|
151
|
+
margin: 16rpx 16rpx 24rpx 0;
|
|
152
|
+
// box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
|
153
|
+
transition: all 0.3s;
|
|
154
|
+
background: transparent;
|
|
155
|
+
|
|
156
|
+
&:active {
|
|
157
|
+
transform: translateY(1rpx);
|
|
158
|
+
box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.06);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.auth-user-l {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
flex: 1;
|
|
165
|
+
width: 100%;
|
|
166
|
+
|
|
167
|
+
.avatar-wrapper {
|
|
168
|
+
position: relative;
|
|
169
|
+
margin-right: 30rpx;
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
|
|
173
|
+
.avatar-img {
|
|
174
|
+
width: 130rpx;
|
|
175
|
+
height: 130rpx;
|
|
176
|
+
border-radius: 50%;
|
|
177
|
+
// background-color: $bg-page;
|
|
178
|
+
display: block;
|
|
179
|
+
transition: all 0.3s;
|
|
180
|
+
// border: 3rpx solid rgba(7, 193, 96, 0.1);
|
|
181
|
+
// box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.1);
|
|
182
|
+
|
|
183
|
+
&:active {
|
|
184
|
+
transform: scale(1.05);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.not-logged {
|
|
188
|
+
opacity: 0.4;
|
|
189
|
+
filter: grayscale(100%);
|
|
190
|
+
box-shadow: none;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.avatar-badge {
|
|
195
|
+
position: absolute;
|
|
196
|
+
right: -2rpx;
|
|
197
|
+
bottom: -2rpx;
|
|
198
|
+
width: 36rpx;
|
|
199
|
+
height: 36rpx;
|
|
200
|
+
background: $primary;
|
|
201
|
+
border-radius: 50%;
|
|
202
|
+
border: 2rpx solid $bg-card;
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
box-shadow: 0 2rpx 6rpx rgba(7, 193, 96, 0.3);
|
|
207
|
+
|
|
208
|
+
.badge-icon {
|
|
209
|
+
font-size: 16rpx;
|
|
210
|
+
color: #fff;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.auth-user-r {
|
|
217
|
+
flex: 1;
|
|
218
|
+
min-width: 0;
|
|
219
|
+
|
|
220
|
+
.user-edit {
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
margin-bottom: 10rpx;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
|
|
226
|
+
.user-name {
|
|
227
|
+
font-size: 32rpx;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
color: $text-1;
|
|
230
|
+
line-height: 1.2;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.edit-icon-bg {
|
|
234
|
+
width: 36rpx;
|
|
235
|
+
height: 36rpx;
|
|
236
|
+
background: $primary;
|
|
237
|
+
border-radius: 50%;
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
justify-content: center;
|
|
241
|
+
margin-left: 8rpx;
|
|
242
|
+
|
|
243
|
+
.edit-icon {
|
|
244
|
+
font-size: 16rpx;
|
|
245
|
+
color: #fff;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.user-mobile {
|
|
251
|
+
font-size: 24rpx;
|
|
252
|
+
color: $text-3;
|
|
253
|
+
line-height: 1.4;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.right-arrow {
|
|
258
|
+
flex-shrink: 0;
|
|
259
|
+
width: 32rpx;
|
|
260
|
+
height: 32rpx;
|
|
261
|
+
display: flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
|
|
265
|
+
.arrow-icon {
|
|
266
|
+
font-size: 66rpx;
|
|
267
|
+
color: $text-3;
|
|
268
|
+
font-weight: 300;
|
|
269
|
+
line-height: 1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// 未登录状态
|
|
274
|
+
.not-logged-in {
|
|
275
|
+
.not-logged-wrapper {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
width: 100%;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.avatar-wrapper {
|
|
282
|
+
.avatar-plus {
|
|
283
|
+
position: absolute;
|
|
284
|
+
right: -4rpx;
|
|
285
|
+
bottom: -4rpx;
|
|
286
|
+
width: 40rpx;
|
|
287
|
+
height: 40rpx;
|
|
288
|
+
background: $primary;
|
|
289
|
+
border-radius: 50%;
|
|
290
|
+
border: 3rpx solid $bg-card;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.3);
|
|
295
|
+
|
|
296
|
+
.plus-icon {
|
|
297
|
+
font-size: 36rpx;
|
|
298
|
+
color: #fff;
|
|
299
|
+
line-height: 1;
|
|
300
|
+
font-weight: 300;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.auth-user-r {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
flex: 1;
|
|
309
|
+
min-width: 0;
|
|
310
|
+
margin-left: 8rpx;
|
|
311
|
+
|
|
312
|
+
.login-hint-text {
|
|
313
|
+
font-size: 24rpx;
|
|
314
|
+
color: $text-3;
|
|
315
|
+
margin-bottom: 12rpx;
|
|
316
|
+
line-height: 1.4;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.login-btn {
|
|
320
|
+
display: inline-flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
padding: 12rpx 24rpx;
|
|
323
|
+
background: linear-gradient(135deg, #07c160 0%, #05a050 100%);
|
|
324
|
+
border-radius: 40rpx;
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.25);
|
|
327
|
+
transition: all 0.3s;
|
|
328
|
+
width: fit-content;
|
|
329
|
+
|
|
330
|
+
&:active {
|
|
331
|
+
transform: scale(0.98);
|
|
332
|
+
box-shadow: 0 2rpx 6rpx rgba(7, 193, 96, 0.2);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.login-text {
|
|
336
|
+
font-size: 26rpx;
|
|
337
|
+
font-weight: 600;
|
|
338
|
+
color: #fff;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.login-arrow {
|
|
342
|
+
font-size: 30rpx;
|
|
343
|
+
color: #fff;
|
|
344
|
+
margin-left: 4rpx;
|
|
345
|
+
line-height: 1;
|
|
346
|
+
font-weight: 300;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
</style>
|
|
353
|
+
|
|
354
|
+
<script type="application/json">
|
|
355
|
+
{
|
|
356
|
+
"component": true,
|
|
357
|
+
"usingComponents": {}
|
|
358
|
+
}
|
|
359
|
+
</script>
|
|
@@ -1,77 +1,82 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="auth-none-data" style="margin-top: {{ marginTop }}rpx; padding-top: {{ paddingTop }}rpx;">
|
|
3
|
-
<image src="{{ resourceUrl + imgUrl }}" mode="heightFix" style="width: {{ imgWidth }};height: {{ imgHeight }};" />
|
|
4
|
-
<view class="holder-text" style="color: {{ contentColor }};">{{ content }}</view>
|
|
5
|
-
</view>
|
|
6
|
-
</template>
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import { createComponent } from "@mpxjs/core"
|
|
9
|
-
import { config } from "../../utils/config";
|
|
10
|
-
|
|
11
|
-
createComponent({
|
|
12
|
-
properties: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type: Number,
|
|
16
|
-
value:
|
|
17
|
-
},
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
type: Number,
|
|
21
|
-
value:
|
|
22
|
-
},
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
type:
|
|
26
|
-
value:
|
|
27
|
-
},
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
type: String,
|
|
31
|
-
value: "
|
|
32
|
-
},
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
type: String,
|
|
36
|
-
value: "
|
|
37
|
-
},
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
type: String,
|
|
41
|
-
value: "
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view class="auth-none-data" style="margin-top: {{ marginTop }}rpx; padding-top: {{ paddingTop }}rpx;">
|
|
3
|
+
<image src="{{ resourceUrl + imgUrl }}" mode="heightFix" style="width: {{ imgWidth }};height: {{ imgHeight }};" />
|
|
4
|
+
<view class="holder-text" style="color: {{ contentColor }};margin-top: {{ imgTextGap }}rpx;">{{ content }}</view>
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { createComponent } from "@mpxjs/core"
|
|
9
|
+
import { config } from "../../utils/config";
|
|
10
|
+
|
|
11
|
+
createComponent({
|
|
12
|
+
properties: {
|
|
13
|
+
// 图片与文本之间的间距
|
|
14
|
+
imgTextGap: {
|
|
15
|
+
type: Number,
|
|
16
|
+
value: 0
|
|
17
|
+
},
|
|
18
|
+
// 上外边距
|
|
19
|
+
marginTop: {
|
|
20
|
+
type: Number,
|
|
21
|
+
value: 300
|
|
22
|
+
},
|
|
23
|
+
// 上内边距
|
|
24
|
+
paddingTop: {
|
|
25
|
+
type: Number,
|
|
26
|
+
value: 0
|
|
27
|
+
},
|
|
28
|
+
// 文本内容
|
|
29
|
+
content: {
|
|
30
|
+
type: String,
|
|
31
|
+
value: "暂无数据"
|
|
32
|
+
},
|
|
33
|
+
// 图片的宽
|
|
34
|
+
imgWidth: {
|
|
35
|
+
type: String,
|
|
36
|
+
value: "auto"
|
|
37
|
+
},
|
|
38
|
+
// 图片的高
|
|
39
|
+
imgHeight: {
|
|
40
|
+
type: String,
|
|
41
|
+
value: "125px"
|
|
42
|
+
},
|
|
43
|
+
// 图片的路径
|
|
44
|
+
imgUrl: {
|
|
45
|
+
type: String,
|
|
46
|
+
value: "/components/contacts_nomore2x.png"
|
|
47
|
+
},
|
|
48
|
+
contentColor: {
|
|
49
|
+
type: String,
|
|
50
|
+
value: "#b6b6b6"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup() {
|
|
54
|
+
let resourceUrl = config.resourceUrl + "/images/"
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
resourceUrl
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss">
|
|
64
|
+
@use "../../styles/index.scss" as *;
|
|
65
|
+
|
|
66
|
+
.auth-none-data {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
|
|
72
|
+
.holder-text {
|
|
73
|
+
font-size: $font-size;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
77
|
+
|
|
78
|
+
<script type="application/json">
|
|
79
|
+
{
|
|
80
|
+
"component": true
|
|
81
|
+
}
|
|
82
|
+
</script>
|
package/src/pages/index.mpx
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="page-body">
|
|
3
|
-
<button type="default" bind:tap="toHomePage">Welcome to Jmash Core MP</button>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import mpx, { createPage } from '@mpxjs/core'
|
|
9
|
-
|
|
10
|
-
createPage({
|
|
11
|
-
setup(props, context) {
|
|
12
|
-
return {};
|
|
13
|
-
},
|
|
14
|
-
methods: {
|
|
15
|
-
toHomePage() {
|
|
16
|
-
mpx.switchTab({
|
|
17
|
-
url: '/pages/tabbar/home'
|
|
18
|
-
})
|
|
19
|
-
},
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<style lang="scss">
|
|
25
|
-
.page-body {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
align-items: center;
|
|
29
|
-
padding: 40rpx;
|
|
30
|
-
gap: 30rpx;
|
|
31
|
-
|
|
32
|
-
button {
|
|
33
|
-
width: 80%;
|
|
34
|
-
height: 80rpx;
|
|
35
|
-
font-size: 32rpx;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
|
|
40
|
-
<script type="application/json">
|
|
41
|
-
{
|
|
42
|
-
"usingComponents": {}
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="page-body">
|
|
3
|
+
<button type="default" bind:tap="toHomePage">Welcome to Jmash Core MP</button>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import mpx, { createPage } from '@mpxjs/core'
|
|
9
|
+
|
|
10
|
+
createPage({
|
|
11
|
+
setup(props, context) {
|
|
12
|
+
return {};
|
|
13
|
+
},
|
|
14
|
+
methods: {
|
|
15
|
+
toHomePage() {
|
|
16
|
+
mpx.switchTab({
|
|
17
|
+
url: '/pages/tabbar/home'
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss">
|
|
25
|
+
.page-body {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: 40rpx;
|
|
30
|
+
gap: 30rpx;
|
|
31
|
+
|
|
32
|
+
button {
|
|
33
|
+
width: 80%;
|
|
34
|
+
height: 80rpx;
|
|
35
|
+
font-size: 32rpx;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
|
|
40
|
+
<script type="application/json">
|
|
41
|
+
{
|
|
42
|
+
"usingComponents": {}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
package/src/utils/request.ts
CHANGED
package/lib/types/core.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/// <reference types="miniprogram-api-typings" />
|
|
2
|
-
/// <reference types="miniprogram-api-typings" />
|
|
3
|
-
export type ResponseData<T extends string | WechatMiniprogram.IAnyObject | ArrayBuffer = string | WechatMiniprogram.IAnyObject | ArrayBuffer> = WechatMiniprogram.RequestSuccessCallbackResult<T>;
|
|
4
|
-
export interface AppConfig {
|
|
5
|
-
tenant: string;
|
|
6
|
-
name: string;
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
resourceUrl: string;
|
|
9
|
-
appId: string;
|
|
10
|
-
componentAppid: string;
|
|
11
|
-
wechatComponentAppId: string;
|
|
12
|
-
wechatAppId: string;
|
|
13
|
-
wechatBiz: string;
|
|
14
|
-
siteId: string;
|
|
15
|
-
dev: boolean;
|
|
16
|
-
testNewUser: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface ValidateData {
|
|
19
|
-
validate: boolean;
|
|
20
|
-
message: string;
|
|
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
|
-
}
|
|
File without changes
|