@hlw-uni/mp-cli 1.0.15 → 1.0.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/bin/cli.js +2 -5
- package/bin/cli.ts +1 -3
- package/package.json +1 -1
- package/templates/config.js +0 -1
- package/templates/mp-toutiao/base/package.json +3 -3
- package/templates/mp-toutiao/base/vite.config.ts +1 -1
- package/templates/mp-toutiao/template1/template.json +1 -2
- package/templates/mp-toutiao/template2/template.json +1 -2
- package/templates/mp-weixin/base/package.json +3 -3
- package/templates/mp-weixin/base/src/main.ts +2 -1
- package/templates/mp-weixin/base/vite.config.ts +1 -1
- package/templates/mp-weixin/template1/src/pages/user/index.vue +191 -0
- package/templates/mp-weixin/template1/template.json +1 -2
- package/templates/mp-weixin/template2/template.json +1 -2
- package/templates/mp-weixin/template3/template.json +1 -2
package/bin/cli.js
CHANGED
|
@@ -76,8 +76,7 @@ var require_config = __commonJS({
|
|
|
76
76
|
return {
|
|
77
77
|
id,
|
|
78
78
|
name: meta.name || `\u6A21\u677F ${id}`,
|
|
79
|
-
description: meta.description || ""
|
|
80
|
-
colors: Array.isArray(meta.colors) ? meta.colors : ["#667eea", "#764ba2"]
|
|
79
|
+
description: meta.description || ""
|
|
81
80
|
};
|
|
82
81
|
});
|
|
83
82
|
return { id: platform, name: PLATFORM_NAMES[platform] || platform, templates };
|
|
@@ -302,9 +301,7 @@ async function runCreate(opts) {
|
|
|
302
301
|
name,
|
|
303
302
|
description,
|
|
304
303
|
author,
|
|
305
|
-
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
306
|
-
primaryColor: styleTemplate?.colors[0] ?? "#3b82f6",
|
|
307
|
-
secondaryColor: styleTemplate?.colors[1] ?? "#764ba2"
|
|
304
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
308
305
|
});
|
|
309
306
|
spinner.succeed();
|
|
310
307
|
console.log();
|
package/bin/cli.ts
CHANGED
|
@@ -10,7 +10,7 @@ import path from 'path';
|
|
|
10
10
|
import fs from 'fs-extra';
|
|
11
11
|
|
|
12
12
|
interface Platform { id: string; name: string; templateCount: number; }
|
|
13
|
-
interface Template { id: string; name: string; description: string;
|
|
13
|
+
interface Template { id: string; name: string; description: string; }
|
|
14
14
|
interface PlatformConfig { id: string; name: string; templates: Template[]; }
|
|
15
15
|
|
|
16
16
|
const cwd = process.cwd();
|
|
@@ -224,8 +224,6 @@ async function runCreate(opts: {
|
|
|
224
224
|
description,
|
|
225
225
|
author,
|
|
226
226
|
date: new Date().toISOString().split('T')[0],
|
|
227
|
-
primaryColor: styleTemplate?.colors[0] ?? '#3b82f6',
|
|
228
|
-
secondaryColor: styleTemplate?.colors[1] ?? '#764ba2',
|
|
229
227
|
});
|
|
230
228
|
|
|
231
229
|
spinner.succeed();
|
package/package.json
CHANGED
package/templates/config.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@dcloudio/uni-app-plus": "3.0.0-4080420251103001",
|
|
12
12
|
"@dcloudio/uni-components": "3.0.0-4080420251103001",
|
|
13
13
|
"@dcloudio/uni-mp-toutiao": "3.0.0-4080420251103001",
|
|
14
|
-
"@hlw-uni/mp-core": "
|
|
15
|
-
"@hlw-uni/mp-vue": "^1.0.
|
|
14
|
+
"@hlw-uni/mp-core": "^1.0.7",
|
|
15
|
+
"@hlw-uni/mp-vue": "^1.0.2",
|
|
16
16
|
"@vueuse/core": "^10.9.0",
|
|
17
17
|
"pinia": "^2.1.7",
|
|
18
18
|
"pinia-plugin-unistorage": "^1.2.3",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@dcloudio/types": "^3.4.8",
|
|
23
23
|
"@dcloudio/uni-cli-shared": "3.0.0-4080420251103001",
|
|
24
24
|
"@dcloudio/vite-plugin-uni": "3.0.0-4080420251103001",
|
|
25
|
-
"@hlw-uni/mp-vite-plugin": "
|
|
25
|
+
"@hlw-uni/mp-vite-plugin": "^1.0.8",
|
|
26
26
|
"@unocss/transformer-directives": "^66.1.1",
|
|
27
27
|
"@vue/tsconfig": "^0.1.3",
|
|
28
28
|
"sass": "^1.70.0",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"@dcloudio/uni-app-plus": "3.0.0-4080420251103001",
|
|
13
13
|
"@dcloudio/uni-components": "3.0.0-4080420251103001",
|
|
14
14
|
"@dcloudio/uni-mp-weixin": "3.0.0-4080420251103001",
|
|
15
|
-
"@hlw-uni/mp-core": "^1.0.
|
|
16
|
-
"@hlw-uni/mp-vue": "^1.0.
|
|
15
|
+
"@hlw-uni/mp-core": "^1.0.8",
|
|
16
|
+
"@hlw-uni/mp-vue": "^1.0.2",
|
|
17
17
|
"@vueuse/core": "^10.9.0",
|
|
18
18
|
"pinia": "^2.1.7",
|
|
19
19
|
"pinia-plugin-unistorage": "^0.1.2",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@dcloudio/types": "^3.4.8",
|
|
24
24
|
"@dcloudio/uni-cli-shared": "3.0.0-4080420251103001",
|
|
25
25
|
"@dcloudio/vite-plugin-uni": "3.0.0-4080420251103001",
|
|
26
|
-
"@hlw-uni/mp-vite-plugin": "^1.0.
|
|
26
|
+
"@hlw-uni/mp-vite-plugin": "^1.0.8",
|
|
27
27
|
"@unocss/transformer-directives": "^66.1.1",
|
|
28
28
|
"@vue/tsconfig": "^0.1.3",
|
|
29
29
|
"sass": "^1.70.0",
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="user-page">
|
|
3
|
+
<view class="user-card">
|
|
4
|
+
<view class="user-card__bg"></view>
|
|
5
|
+
<view class="user-card__body">
|
|
6
|
+
<image
|
|
7
|
+
class="user-card__avatar"
|
|
8
|
+
src="https://cdn.uviewui.com/uview/album/1.jpg"
|
|
9
|
+
mode="aspectFill"
|
|
10
|
+
/>
|
|
11
|
+
<view class="user-card__info">
|
|
12
|
+
<text class="user-card__name">未登录</text>
|
|
13
|
+
<text class="user-card__desc">点击头像登录账号</text>
|
|
14
|
+
</view>
|
|
15
|
+
<view class="user-card__arrow">›</view>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
|
|
19
|
+
<view class="stats-card">
|
|
20
|
+
<view class="stats-card__item">
|
|
21
|
+
<text class="stats-card__value">{{ points }}</text>
|
|
22
|
+
<text class="stats-card__label">我的积分</text>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="stats-card__divider"></view>
|
|
25
|
+
<view class="stats-card__item">
|
|
26
|
+
<text class="stats-card__value">{{ memberExpiry }}</text>
|
|
27
|
+
<text class="stats-card__label">会员到期</text>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
|
|
31
|
+
<view class="menu-list">
|
|
32
|
+
<view
|
|
33
|
+
class="menu-item"
|
|
34
|
+
v-for="(item, index) in menuList"
|
|
35
|
+
:key="index"
|
|
36
|
+
@click="handleMenuClick(item)"
|
|
37
|
+
>
|
|
38
|
+
<text class="menu-item__text">{{ item.label }}</text>
|
|
39
|
+
<view class="menu-item__arrow">›</view>
|
|
40
|
+
</view>
|
|
41
|
+
</view>
|
|
42
|
+
</view>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { ref } from 'vue'
|
|
47
|
+
|
|
48
|
+
const points = ref(0)
|
|
49
|
+
const memberExpiry = ref('--')
|
|
50
|
+
|
|
51
|
+
const menuList = ref([
|
|
52
|
+
{ label: '帮助列表', path: '' },
|
|
53
|
+
{ label: '在线客服', path: '' },
|
|
54
|
+
{ label: '关注公众号', path: '' },
|
|
55
|
+
{ label: '常见问题', path: '' },
|
|
56
|
+
{ label: '系统设置', path: '' }
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
const handleMenuClick = (item: any) => {
|
|
60
|
+
console.log('点击了菜单:', item.label)
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style scoped lang="scss">
|
|
65
|
+
.user-page {
|
|
66
|
+
min-height: 100vh;
|
|
67
|
+
padding: 32rpx;
|
|
68
|
+
background: #f5f6fa;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.user-card {
|
|
72
|
+
position: relative;
|
|
73
|
+
border-radius: 24rpx;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.08);
|
|
76
|
+
|
|
77
|
+
&__bg {
|
|
78
|
+
position: absolute;
|
|
79
|
+
inset: 0;
|
|
80
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&__body {
|
|
84
|
+
position: relative;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
padding: 48rpx 32rpx;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__avatar {
|
|
91
|
+
width: 128rpx;
|
|
92
|
+
height: 128rpx;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
border: 4rpx solid rgba(255, 255, 255, 0.6);
|
|
95
|
+
background: #fff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__info {
|
|
99
|
+
flex: 1;
|
|
100
|
+
margin-left: 24rpx;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__name {
|
|
106
|
+
font-size: 36rpx;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
color: #fff;
|
|
109
|
+
line-height: 1.4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__desc {
|
|
113
|
+
margin-top: 8rpx;
|
|
114
|
+
font-size: 24rpx;
|
|
115
|
+
color: rgba(255, 255, 255, 0.8);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__arrow {
|
|
119
|
+
font-size: 48rpx;
|
|
120
|
+
color: rgba(255, 255, 255, 0.8);
|
|
121
|
+
line-height: 1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.stats-card {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
margin-top: 24rpx;
|
|
129
|
+
padding: 40rpx 32rpx;
|
|
130
|
+
background: #fff;
|
|
131
|
+
border-radius: 24rpx;
|
|
132
|
+
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
|
|
133
|
+
|
|
134
|
+
&__item {
|
|
135
|
+
flex: 1;
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__value {
|
|
142
|
+
font-size: 40rpx;
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
color: #333;
|
|
145
|
+
line-height: 1.2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__label {
|
|
149
|
+
margin-top: 12rpx;
|
|
150
|
+
font-size: 24rpx;
|
|
151
|
+
color: #999;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__divider {
|
|
155
|
+
width: 2rpx;
|
|
156
|
+
height: 64rpx;
|
|
157
|
+
background: #eee;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.menu-list {
|
|
162
|
+
margin-top: 24rpx;
|
|
163
|
+
background: #fff;
|
|
164
|
+
border-radius: 24rpx;
|
|
165
|
+
padding: 0 32rpx;
|
|
166
|
+
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.menu-item {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
justify-content: space-between;
|
|
173
|
+
padding: 32rpx 0;
|
|
174
|
+
border-bottom: 2rpx solid #f5f6fa;
|
|
175
|
+
|
|
176
|
+
&:last-child {
|
|
177
|
+
border-bottom: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__text {
|
|
181
|
+
font-size: 30rpx;
|
|
182
|
+
color: #333;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&__arrow {
|
|
186
|
+
font-size: 40rpx;
|
|
187
|
+
color: #ccc;
|
|
188
|
+
line-height: 1;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|