create-weapp-vite 1.3.2 → 1.3.3
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/dist/{chunk-CP2T5O3U.js → chunk-KDUDSVZ5.js} +2 -2
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/wevu-tdesign/README.md +5 -0
- package/templates/wevu-tdesign/components.d.ts +1 -1
- package/templates/wevu-tdesign/public/tabbar/ability-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/ability.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list.png +0 -0
- package/templates/wevu-tdesign/src/app.vue +60 -2
- package/templates/wevu-tdesign/src/components/EmptyState/index.vue +36 -0
- package/templates/wevu-tdesign/src/components/FilterBar/index.vue +63 -0
- package/templates/wevu-tdesign/src/components/FormRow/index.vue +43 -0
- package/templates/wevu-tdesign/src/components/FormStep/index.vue +48 -0
- package/templates/wevu-tdesign/src/components/KpiBoard/index.vue +146 -0
- package/templates/wevu-tdesign/src/components/QuickActionGrid/index.vue +90 -0
- package/templates/wevu-tdesign/src/components/ResultCard/index.vue +51 -0
- package/templates/wevu-tdesign/src/components/SectionTitle/index.vue +34 -0
- package/templates/wevu-tdesign/src/components/TrendCard/index.vue +101 -0
- package/templates/wevu-tdesign/src/pages/ability/index.vue +177 -0
- package/templates/wevu-tdesign/src/pages/data/index.vue +188 -0
- package/templates/wevu-tdesign/src/pages/form/index.vue +249 -0
- package/templates/wevu-tdesign/src/pages/index/index.vue +228 -126
- package/templates/wevu-tdesign/src/pages/list/index.vue +178 -0
- package/templates/wevu-tdesign/src/subpackages/ability/index.vue +106 -0
- package/templates/wevu-tdesign/src/subpackages/lab/index.vue +136 -0
- package/templates/wevu-tdesign/src/vite-env.d.ts +4 -0
- package/templates/wevu-tdesign/tsconfig.app.json +6 -1
- package/templates/wevu-tdesign/vite.config.ts +11 -1
- package/templates/wevu-tdesign/src/components/HelloWorld/index.vue +0 -23
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Toast from 'tdesign-miniprogram/toast/index'
|
|
3
|
+
|
|
4
|
+
import { computed, getCurrentInstance, onPullDownRefresh, ref, watch } from 'wevu'
|
|
5
|
+
|
|
6
|
+
import EmptyState from '@/components/EmptyState/index.vue'
|
|
7
|
+
import FilterBar from '@/components/FilterBar/index.vue'
|
|
8
|
+
import SectionTitle from '@/components/SectionTitle/index.vue'
|
|
9
|
+
|
|
10
|
+
definePageJson({
|
|
11
|
+
navigationBarTitleText: '清单',
|
|
12
|
+
backgroundColor: '#f6f7fb',
|
|
13
|
+
enablePullDownRefresh: true,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const mpContext = getCurrentInstance()
|
|
17
|
+
|
|
18
|
+
const query = ref('')
|
|
19
|
+
const activeStatus = ref('all')
|
|
20
|
+
const loading = ref(true)
|
|
21
|
+
|
|
22
|
+
const items = ref([
|
|
23
|
+
{
|
|
24
|
+
id: 1,
|
|
25
|
+
title: '门店会员激活方案',
|
|
26
|
+
owner: '王凯',
|
|
27
|
+
status: 'processing',
|
|
28
|
+
deadline: '今日 18:00',
|
|
29
|
+
priority: 'P0',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 2,
|
|
33
|
+
title: '社群内容排期',
|
|
34
|
+
owner: '林鹤',
|
|
35
|
+
status: 'pending',
|
|
36
|
+
deadline: '明日 12:00',
|
|
37
|
+
priority: 'P1',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 3,
|
|
41
|
+
title: '新客任务提醒',
|
|
42
|
+
owner: '陈一',
|
|
43
|
+
status: 'done',
|
|
44
|
+
deadline: '已完成',
|
|
45
|
+
priority: 'P2',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 4,
|
|
49
|
+
title: '客服脚本优化',
|
|
50
|
+
owner: '韩逸',
|
|
51
|
+
status: 'processing',
|
|
52
|
+
deadline: '周五 20:00',
|
|
53
|
+
priority: 'P1',
|
|
54
|
+
},
|
|
55
|
+
])
|
|
56
|
+
|
|
57
|
+
interface StatusFilter { value: string, label: string, count?: number }
|
|
58
|
+
|
|
59
|
+
const statusFilters = ref<StatusFilter[]>([])
|
|
60
|
+
|
|
61
|
+
function rebuildStatusFilters() {
|
|
62
|
+
const source = Array.isArray(items.value) ? items.value : []
|
|
63
|
+
const summary = source.reduce<Record<string, number>>((acc, item) => {
|
|
64
|
+
acc[item.status] = (acc[item.status] ?? 0) + 1
|
|
65
|
+
return acc
|
|
66
|
+
}, {})
|
|
67
|
+
statusFilters.value = [
|
|
68
|
+
{ value: 'all', label: '全部', count: source.length },
|
|
69
|
+
{ value: 'processing', label: '进行中', count: summary.processing ?? 0 },
|
|
70
|
+
{ value: 'pending', label: '待启动', count: summary.pending ?? 0 },
|
|
71
|
+
{ value: 'done', label: '已完成', count: summary.done ?? 0 },
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
rebuildStatusFilters()
|
|
76
|
+
watch(items, rebuildStatusFilters, { deep: true })
|
|
77
|
+
|
|
78
|
+
const filteredItems = computed(() =>
|
|
79
|
+
items.value.filter((item) => {
|
|
80
|
+
const matchStatus = activeStatus.value === 'all' || item.status === activeStatus.value
|
|
81
|
+
const matchQuery = !query.value || item.title.includes(query.value) || item.owner.includes(query.value)
|
|
82
|
+
return matchStatus && matchQuery
|
|
83
|
+
}),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
const hasEmpty = computed(() => !loading.value && filteredItems.value.length === 0)
|
|
87
|
+
|
|
88
|
+
function showToast(message: string) {
|
|
89
|
+
if (!mpContext) {
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
Toast({
|
|
93
|
+
selector: '#t-toast',
|
|
94
|
+
context: mpContext as any,
|
|
95
|
+
message,
|
|
96
|
+
theme: 'success',
|
|
97
|
+
duration: 1000,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function reload() {
|
|
102
|
+
loading.value = true
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
loading.value = false
|
|
105
|
+
showToast('列表已刷新')
|
|
106
|
+
}, 600)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function onAction(item: (typeof items.value)[number]) {
|
|
110
|
+
showToast(`打开「${item.title}」详情`)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
onPullDownRefresh(() => {
|
|
114
|
+
reload()
|
|
115
|
+
wx.stopPullDownRefresh()
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
reload()
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
|
|
123
|
+
<view class="rounded-[28rpx] bg-gradient-to-br from-[#fdf2f8] via-[#fff7fb] to-[#ffffff] p-[20rpx]">
|
|
124
|
+
<SectionTitle title="任务清单" subtitle="筛选、搜索与分页反馈" />
|
|
125
|
+
<view class="mt-[12rpx]">
|
|
126
|
+
<FilterBar v-model:query="query" v-model:active="activeStatus" :filters="statusFilters" />
|
|
127
|
+
</view>
|
|
128
|
+
</view>
|
|
129
|
+
|
|
130
|
+
<view v-if="loading" class="mt-[20rpx] flex flex-col items-center gap-[12rpx] rounded-[24rpx] bg-white p-[24rpx]">
|
|
131
|
+
<t-loading theme="circular" size="40" />
|
|
132
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
133
|
+
正在同步数据...
|
|
134
|
+
</text>
|
|
135
|
+
</view>
|
|
136
|
+
|
|
137
|
+
<view v-else class="mt-[20rpx] space-y-[14rpx]">
|
|
138
|
+
<view v-for="item in filteredItems" :key="item.id" class="rounded-[20rpx] bg-white p-[18rpx] shadow-[0_12rpx_28rpx_rgba(17,24,39,0.08)]">
|
|
139
|
+
<view class="flex items-start justify-between">
|
|
140
|
+
<view>
|
|
141
|
+
<text class="text-[26rpx] font-semibold text-[#1f1a3f]">
|
|
142
|
+
{{ item.title }}
|
|
143
|
+
</text>
|
|
144
|
+
<text class="mt-[6rpx] block text-[22rpx] text-[#6f6b8a]">
|
|
145
|
+
负责人:{{ item.owner }} · 截止 {{ item.deadline }}
|
|
146
|
+
</text>
|
|
147
|
+
</view>
|
|
148
|
+
<t-tag
|
|
149
|
+
size="small"
|
|
150
|
+
:theme="item.status === 'done' ? 'success' : item.status === 'processing' ? 'primary' : 'warning'"
|
|
151
|
+
variant="light"
|
|
152
|
+
>
|
|
153
|
+
{{ item.status === 'done' ? '已完成' : item.status === 'processing' ? '进行中' : '待启动' }}
|
|
154
|
+
</t-tag>
|
|
155
|
+
</view>
|
|
156
|
+
<view class="mt-[12rpx] flex items-center justify-between">
|
|
157
|
+
<view class="flex items-center gap-[8rpx]">
|
|
158
|
+
<t-tag size="small" theme="primary" variant="outline">
|
|
159
|
+
{{ item.priority }}
|
|
160
|
+
</t-tag>
|
|
161
|
+
<text class="text-[20rpx] text-[#7a7aa0]">
|
|
162
|
+
进度跟进
|
|
163
|
+
</text>
|
|
164
|
+
</view>
|
|
165
|
+
<t-button size="small" theme="primary" variant="outline" @tap="onAction(item)">
|
|
166
|
+
查看
|
|
167
|
+
</t-button>
|
|
168
|
+
</view>
|
|
169
|
+
</view>
|
|
170
|
+
</view>
|
|
171
|
+
|
|
172
|
+
<view v-if="hasEmpty" class="mt-[20rpx]">
|
|
173
|
+
<EmptyState title="暂无匹配任务" description="调整筛选条件或刷新数据" action-text="重新加载" @action="reload" />
|
|
174
|
+
</view>
|
|
175
|
+
|
|
176
|
+
<t-toast id="t-toast" />
|
|
177
|
+
</view>
|
|
178
|
+
</template>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onShow, ref } from 'wevu'
|
|
3
|
+
|
|
4
|
+
import SectionTitle from '@/components/SectionTitle/index.vue'
|
|
5
|
+
|
|
6
|
+
definePageJson({
|
|
7
|
+
navigationBarTitleText: 'API 场景',
|
|
8
|
+
backgroundColor: '#f6f7fb',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const systemInfo = ref<WechatMiniprogram.GetSystemInfoSuccessCallbackResult | null>(null)
|
|
12
|
+
|
|
13
|
+
const infoRows = computed(() => {
|
|
14
|
+
const info = systemInfo.value
|
|
15
|
+
return [
|
|
16
|
+
{ label: '机型', value: info?.model ?? '--' },
|
|
17
|
+
{ label: '系统', value: info ? `${info.system}` : '--' },
|
|
18
|
+
{ label: '版本', value: info?.version ?? '--' },
|
|
19
|
+
{ label: '基础库', value: info?.SDKVersion ?? '--' },
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const layoutRows = computed(() => {
|
|
24
|
+
const info = systemInfo.value
|
|
25
|
+
if (!info) {
|
|
26
|
+
return []
|
|
27
|
+
}
|
|
28
|
+
return [
|
|
29
|
+
{ label: '屏幕宽度', value: `${info.windowWidth}px` },
|
|
30
|
+
{ label: '屏幕高度', value: `${info.windowHeight}px` },
|
|
31
|
+
{ label: '状态栏', value: `${info.statusBarHeight}px` },
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
function loadSystemInfo() {
|
|
36
|
+
wx.getSystemInfo({
|
|
37
|
+
success: (result) => {
|
|
38
|
+
systemInfo.value = result
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onShow(() => {
|
|
44
|
+
loadSystemInfo()
|
|
45
|
+
})
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
|
|
50
|
+
<view class="rounded-[28rpx] bg-gradient-to-br from-[#ecfccb] via-[#ffffff] to-[#d9f99d] p-[20rpx]">
|
|
51
|
+
<SectionTitle title="系统信息" subtitle="使用原生 API 获取设备信息" />
|
|
52
|
+
</view>
|
|
53
|
+
|
|
54
|
+
<view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
55
|
+
<SectionTitle title="设备概览" subtitle="基础信息卡片" />
|
|
56
|
+
<view class="mt-[12rpx] space-y-[10rpx]">
|
|
57
|
+
<view v-for="row in infoRows" :key="row.label" class="flex items-center justify-between">
|
|
58
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
59
|
+
{{ row.label }}
|
|
60
|
+
</text>
|
|
61
|
+
<text class="text-[22rpx] font-semibold text-[#1f1a3f]">
|
|
62
|
+
{{ row.value }}
|
|
63
|
+
</text>
|
|
64
|
+
</view>
|
|
65
|
+
</view>
|
|
66
|
+
</view>
|
|
67
|
+
|
|
68
|
+
<view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
69
|
+
<SectionTitle title="布局信息" subtitle="适配屏幕尺寸" />
|
|
70
|
+
<view class="mt-[12rpx] space-y-[10rpx]">
|
|
71
|
+
<view v-for="row in layoutRows" :key="row.label" class="flex items-center justify-between">
|
|
72
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
73
|
+
{{ row.label }}
|
|
74
|
+
</text>
|
|
75
|
+
<text class="text-[22rpx] font-semibold text-[#1f1a3f]">
|
|
76
|
+
{{ row.value }}
|
|
77
|
+
</text>
|
|
78
|
+
</view>
|
|
79
|
+
</view>
|
|
80
|
+
</view>
|
|
81
|
+
|
|
82
|
+
<view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
83
|
+
<SectionTitle title="构建提示" subtitle="weapp-vite 特性" />
|
|
84
|
+
<view class="mt-[12rpx] space-y-[10rpx]">
|
|
85
|
+
<view class="flex items-center gap-[8rpx]">
|
|
86
|
+
<view class="h-[8rpx] w-[8rpx] rounded-full bg-[#2f2b5f]" />
|
|
87
|
+
<text class="text-[22rpx] text-[#4c4b68]">
|
|
88
|
+
子包页面按需加载,降低首包压力
|
|
89
|
+
</text>
|
|
90
|
+
</view>
|
|
91
|
+
<view class="flex items-center gap-[8rpx]">
|
|
92
|
+
<view class="h-[8rpx] w-[8rpx] rounded-full bg-[#2f2b5f]" />
|
|
93
|
+
<text class="text-[22rpx] text-[#4c4b68]">
|
|
94
|
+
组件与页面使用 alias 路径统一管理
|
|
95
|
+
</text>
|
|
96
|
+
</view>
|
|
97
|
+
<view class="flex items-center gap-[8rpx]">
|
|
98
|
+
<view class="h-[8rpx] w-[8rpx] rounded-full bg-[#2f2b5f]" />
|
|
99
|
+
<text class="text-[22rpx] text-[#4c4b68]">
|
|
100
|
+
全局样式隔离使用 apply-shared
|
|
101
|
+
</text>
|
|
102
|
+
</view>
|
|
103
|
+
</view>
|
|
104
|
+
</view>
|
|
105
|
+
</view>
|
|
106
|
+
</template>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'wevu'
|
|
3
|
+
|
|
4
|
+
import SectionTitle from '@/components/SectionTitle/index.vue'
|
|
5
|
+
|
|
6
|
+
definePageJson({
|
|
7
|
+
navigationBarTitleText: '组件实验室',
|
|
8
|
+
backgroundColor: '#f6f7fb',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const activeTab = ref('base')
|
|
12
|
+
const rating = ref(4)
|
|
13
|
+
const progress = ref(68)
|
|
14
|
+
const slider = ref(42)
|
|
15
|
+
const toggle = ref(true)
|
|
16
|
+
|
|
17
|
+
const progressValue = computed(() => (Number.isFinite(progress.value) ? progress.value : 0))
|
|
18
|
+
|
|
19
|
+
const tabs = [
|
|
20
|
+
{ value: 'base', label: '基础' },
|
|
21
|
+
{ value: 'feedback', label: '反馈' },
|
|
22
|
+
{ value: 'display', label: '展示' },
|
|
23
|
+
]
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
|
|
28
|
+
<view class="rounded-[28rpx] bg-gradient-to-br from-[#f5f3ff] via-[#ffffff] to-[#eef2ff] p-[20rpx]">
|
|
29
|
+
<SectionTitle title="TDesign 组件实验室" subtitle="常用组件的组合应用" />
|
|
30
|
+
<view class="mt-[12rpx]">
|
|
31
|
+
<t-tabs :value="activeTab" @change="(e) => (activeTab = e.detail.value)">
|
|
32
|
+
<t-tab-panel v-for="tab in tabs" :key="tab.value" :value="tab.value" :label="tab.label" />
|
|
33
|
+
</t-tabs>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
|
|
37
|
+
<view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
38
|
+
<view v-if="activeTab === 'base'" class="space-y-[14rpx]">
|
|
39
|
+
<SectionTitle title="基础组件" subtitle="标签、徽标、头像" />
|
|
40
|
+
<view class="flex flex-wrap gap-[10rpx]">
|
|
41
|
+
<t-tag theme="primary" variant="light">
|
|
42
|
+
新品
|
|
43
|
+
</t-tag>
|
|
44
|
+
<t-tag theme="warning" variant="light">
|
|
45
|
+
加急
|
|
46
|
+
</t-tag>
|
|
47
|
+
<t-tag theme="success" variant="light">
|
|
48
|
+
已完成
|
|
49
|
+
</t-tag>
|
|
50
|
+
<t-tag theme="default" variant="outline">
|
|
51
|
+
低风险
|
|
52
|
+
</t-tag>
|
|
53
|
+
</view>
|
|
54
|
+
<view class="flex items-center gap-[14rpx]">
|
|
55
|
+
<t-badge count="8">
|
|
56
|
+
<t-avatar size="small" shape="round">
|
|
57
|
+
A
|
|
58
|
+
</t-avatar>
|
|
59
|
+
</t-badge>
|
|
60
|
+
<t-badge count="new">
|
|
61
|
+
<t-avatar size="small" shape="round">
|
|
62
|
+
B
|
|
63
|
+
</t-avatar>
|
|
64
|
+
</t-badge>
|
|
65
|
+
<t-avatar-group max="3" size="small">
|
|
66
|
+
<t-avatar>U1</t-avatar>
|
|
67
|
+
<t-avatar>U2</t-avatar>
|
|
68
|
+
<t-avatar>U3</t-avatar>
|
|
69
|
+
<t-avatar>U4</t-avatar>
|
|
70
|
+
</t-avatar-group>
|
|
71
|
+
</view>
|
|
72
|
+
</view>
|
|
73
|
+
|
|
74
|
+
<view v-else-if="activeTab === 'feedback'" class="space-y-[14rpx]">
|
|
75
|
+
<SectionTitle title="反馈组件" subtitle="进度、评分、滑块" />
|
|
76
|
+
<t-progress :percentage="progressValue" status="active" stroke-width="8" />
|
|
77
|
+
<view class="flex items-center justify-between">
|
|
78
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
79
|
+
满意度评分
|
|
80
|
+
</text>
|
|
81
|
+
<t-rate :value="rating" @change="(e) => (rating = e.detail.value)" />
|
|
82
|
+
</view>
|
|
83
|
+
<view class="flex items-center justify-between">
|
|
84
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
85
|
+
阈值调整
|
|
86
|
+
</text>
|
|
87
|
+
<view class="flex items-center gap-[12rpx]">
|
|
88
|
+
<t-slider :value="slider" @change="(e) => (slider = e.detail.value)" />
|
|
89
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
90
|
+
{{ slider }}%
|
|
91
|
+
</text>
|
|
92
|
+
</view>
|
|
93
|
+
</view>
|
|
94
|
+
<view class="flex items-center justify-between">
|
|
95
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
96
|
+
自动提醒
|
|
97
|
+
</text>
|
|
98
|
+
<t-switch :value="toggle" @change="(e) => (toggle = e.detail.value)" />
|
|
99
|
+
</view>
|
|
100
|
+
</view>
|
|
101
|
+
|
|
102
|
+
<view v-else class="space-y-[14rpx]">
|
|
103
|
+
<SectionTitle title="展示组件" subtitle="提示、轮播、二维码" />
|
|
104
|
+
<t-notice-bar theme="info" content="TDesign 组件可用于丰富产品体验。" />
|
|
105
|
+
<t-swiper :autoplay="true" height="140">
|
|
106
|
+
<t-swiper-item>
|
|
107
|
+
<view class="h-full rounded-[20rpx] bg-gradient-to-br from-[#c7d2fe] to-[#f0abfc] p-[16rpx]">
|
|
108
|
+
<text class="text-[24rpx] font-semibold text-white">
|
|
109
|
+
品牌展示
|
|
110
|
+
</text>
|
|
111
|
+
<text class="mt-[6rpx] block text-[20rpx] text-white/80">
|
|
112
|
+
适合做活动横幅
|
|
113
|
+
</text>
|
|
114
|
+
</view>
|
|
115
|
+
</t-swiper-item>
|
|
116
|
+
<t-swiper-item>
|
|
117
|
+
<view class="h-full rounded-[20rpx] bg-gradient-to-br from-[#fde68a] to-[#fca5a5] p-[16rpx]">
|
|
118
|
+
<text class="text-[24rpx] font-semibold text-white">
|
|
119
|
+
营销推荐
|
|
120
|
+
</text>
|
|
121
|
+
<text class="mt-[6rpx] block text-[20rpx] text-white/80">
|
|
122
|
+
支持多色主题
|
|
123
|
+
</text>
|
|
124
|
+
</view>
|
|
125
|
+
</t-swiper-item>
|
|
126
|
+
</t-swiper>
|
|
127
|
+
<view class="flex items-center justify-between">
|
|
128
|
+
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
129
|
+
扫码体验
|
|
130
|
+
</text>
|
|
131
|
+
<t-qrcode value="https://vite.icebreaker.top" size="90" />
|
|
132
|
+
</view>
|
|
133
|
+
</view>
|
|
134
|
+
</view>
|
|
135
|
+
</view>
|
|
136
|
+
</template>
|
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
"@/*": [
|
|
17
17
|
"./src/*"
|
|
18
18
|
],
|
|
19
|
+
"tdesign-miniprogram/miniprogram_dist/*": [
|
|
20
|
+
"./node_modules/tdesign-miniprogram/miniprogram_dist/*"
|
|
21
|
+
],
|
|
19
22
|
"tdesign-miniprogram/*": [
|
|
20
23
|
"./node_modules/tdesign-miniprogram/miniprogram_dist/*"
|
|
21
24
|
]
|
|
22
25
|
},
|
|
23
26
|
"resolveJsonModule": true,
|
|
24
27
|
"types": [
|
|
25
|
-
"miniprogram-api-typings"
|
|
28
|
+
"miniprogram-api-typings",
|
|
29
|
+
"vue",
|
|
30
|
+
"@vue/runtime-core"
|
|
26
31
|
],
|
|
27
32
|
"allowImportingTsExtensions": true,
|
|
28
33
|
"allowJs": true,
|
|
@@ -10,6 +10,16 @@ export default defineConfig({
|
|
|
10
10
|
typedComponents: true,
|
|
11
11
|
vueComponents: true,
|
|
12
12
|
},
|
|
13
|
+
wevu: {
|
|
14
|
+
defaults: {
|
|
15
|
+
component: {
|
|
16
|
+
options: {
|
|
17
|
+
virtualHost: true,
|
|
18
|
+
styleIsolation: 'apply-shared',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
13
23
|
// pnpm g 生成的格式
|
|
14
24
|
// https://vite.icebreaker.top/guide/generate.html
|
|
15
25
|
generate: {
|
|
@@ -21,7 +31,7 @@ export default defineConfig({
|
|
|
21
31
|
component: 'src/components',
|
|
22
32
|
page: 'src/pages',
|
|
23
33
|
},
|
|
24
|
-
// 假如你想让默认生成的组件命名为
|
|
34
|
+
// 假如你想让默认生成的组件命名为 Foo/index 而不是 Foo/Foo 可以下列选项
|
|
25
35
|
// filenames: {
|
|
26
36
|
// component: 'index',
|
|
27
37
|
// page: 'index',
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const props = withDefaults(
|
|
3
|
-
defineProps<{
|
|
4
|
-
title?: string
|
|
5
|
-
subtitle?: string
|
|
6
|
-
}>(),
|
|
7
|
-
{
|
|
8
|
-
title: 'Hello WeVU',
|
|
9
|
-
subtitle: '',
|
|
10
|
-
},
|
|
11
|
-
)
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<view class="rounded-[24rpx] bg-gradient-to-br from-[#4c6ef5] to-[#7048e8] p-[24rpx]">
|
|
16
|
-
<text class="block text-[40rpx] font-bold text-white">
|
|
17
|
-
{{ props.title }}
|
|
18
|
-
</text>
|
|
19
|
-
<text v-if="props.subtitle" class="mt-[8rpx] block text-[26rpx] text-white/85">
|
|
20
|
-
{{ props.subtitle }}
|
|
21
|
-
</text>
|
|
22
|
-
</view>
|
|
23
|
-
</template>
|