create-weapp-vite 2.0.31 → 2.0.32
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/README.md +1 -0
- package/dist/{chunk-FGMHC2DJ.js → chunk-IT75MAH3.js} +3 -2
- package/dist/cli.js +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/wevu-retail/.editorconfig +9 -0
- package/templates/wevu-retail/.vscode/settings.json +10 -0
- package/templates/wevu-retail/AGENTS.md +35 -0
- package/templates/wevu-retail/README.md +26 -0
- package/templates/wevu-retail/auto-import-components.json +1 -0
- package/templates/wevu-retail/gitignore +35 -0
- package/templates/wevu-retail/package.json +42 -0
- package/templates/wevu-retail/postcss.config.js +6 -0
- package/templates/wevu-retail/project.config.json +44 -0
- package/templates/wevu-retail/project.private.config.json +8 -0
- package/templates/wevu-retail/src/app.vue +104 -0
- package/templates/wevu-retail/src/common/updateManager.ts +29 -0
- package/templates/wevu-retail/src/components/filter/index.vue +134 -0
- package/templates/wevu-retail/src/components/filter-popup/index.vue +67 -0
- package/templates/wevu-retail/src/components/goods-card/index.vue +219 -0
- package/templates/wevu-retail/src/components/goods-list/index.vue +91 -0
- package/templates/wevu-retail/src/components/load-more/index.vue +99 -0
- package/templates/wevu-retail/src/components/loading-content/index.vue +48 -0
- package/templates/wevu-retail/src/components/price/index.vue +104 -0
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +143 -0
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +18 -0
- package/templates/wevu-retail/src/components/swipeout/index.vue +118 -0
- package/templates/wevu-retail/src/components/swipeout/swipe.wxs +151 -0
- package/templates/wevu-retail/src/components/webp-image/index.vue +105 -0
- package/templates/wevu-retail/src/components/webp-image/utils.wxs +140 -0
- package/templates/wevu-retail/src/config/index.ts +20437 -0
- package/templates/wevu-retail/src/custom-tab-bar/data.ts +22 -0
- package/templates/wevu-retail/src/custom-tab-bar/index.vue +62 -0
- package/templates/wevu-retail/src/model/activities.ts +7 -0
- package/templates/wevu-retail/src/model/activity.ts +18 -0
- package/templates/wevu-retail/src/model/address.ts +31 -0
- package/templates/wevu-retail/src/model/cart.ts +306 -0
- package/templates/wevu-retail/src/model/category.ts +175 -0
- package/templates/wevu-retail/src/model/comments/queryDetail.ts +50 -0
- package/templates/wevu-retail/src/model/comments.ts +298 -0
- package/templates/wevu-retail/src/model/coupon.ts +39 -0
- package/templates/wevu-retail/src/model/detailsComments.ts +30 -0
- package/templates/wevu-retail/src/model/good.ts +1904 -0
- package/templates/wevu-retail/src/model/goods.ts +7 -0
- package/templates/wevu-retail/src/model/order/applyService.ts +329 -0
- package/templates/wevu-retail/src/model/order/orderConfirm.ts +147 -0
- package/templates/wevu-retail/src/model/order/orderDetail.ts +1191 -0
- package/templates/wevu-retail/src/model/order/orderList.ts +1033 -0
- package/templates/wevu-retail/src/model/promotion.ts +20 -0
- package/templates/wevu-retail/src/model/search.ts +60 -0
- package/templates/wevu-retail/src/model/submitComment.ts +58 -0
- package/templates/wevu-retail/src/model/swiper.ts +39 -0
- package/templates/wevu-retail/src/model/usercenter.ts +52 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +104 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +41 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +333 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +5 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +20 -0
- package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +334 -0
- package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +100 -0
- package/templates/wevu-retail/src/pages/cart/index.vue +342 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +95 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +73 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +121 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +74 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +102 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +137 -0
- package/templates/wevu-retail/src/pages/category/index.vue +50 -0
- package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +95 -0
- package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +44 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +135 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +94 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +136 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png +0 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/index.vue +65 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +92 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +93 -0
- package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +196 -0
- package/templates/wevu-retail/src/pages/goods/comments/index.vue +293 -0
- package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +117 -0
- package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +440 -0
- package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +83 -0
- package/templates/wevu-retail/src/pages/goods/details/index.vue +598 -0
- package/templates/wevu-retail/src/pages/goods/list/index.vue +299 -0
- package/templates/wevu-retail/src/pages/goods/result/index.vue +350 -0
- package/templates/wevu-retail/src/pages/goods/search/index.vue +196 -0
- package/templates/wevu-retail/src/pages/home/home.vue +215 -0
- package/templates/wevu-retail/src/pages/home/readme +8 -0
- package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +34 -0
- package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +430 -0
- package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +1262 -0
- package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +299 -0
- package/templates/wevu-retail/src/pages/order/apply-service/index.vue +665 -0
- package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +142 -0
- package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +75 -0
- package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +356 -0
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +17 -0
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +125 -0
- package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +262 -0
- package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +126 -0
- package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +86 -0
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +161 -0
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +25 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +22 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +16 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +207 -0
- package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +185 -0
- package/templates/wevu-retail/src/pages/order/config.ts +94 -0
- package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +145 -0
- package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +7 -0
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +71 -0
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +267 -0
- package/templates/wevu-retail/src/pages/order/invoice/index.vue +94 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +78 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +11 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +11 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +707 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +8 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +115 -0
- package/templates/wevu-retail/src/pages/order/order-detail/index.vue +456 -0
- package/templates/wevu-retail/src/pages/order/order-list/index.vue +288 -0
- package/templates/wevu-retail/src/pages/order/pay-result/index.vue +77 -0
- package/templates/wevu-retail/src/pages/order/receipt/index.vue +336 -0
- package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +145 -0
- package/templates/wevu-retail/src/pages/user/address/edit/index.vue +514 -0
- package/templates/wevu-retail/src/pages/user/address/list/index.vue +249 -0
- package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +156 -0
- package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +92 -0
- package/templates/wevu-retail/src/pages/user/name-edit/index.vue +49 -0
- package/templates/wevu-retail/src/pages/user/person-info/index.vue +198 -0
- package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +33 -0
- package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +90 -0
- package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +108 -0
- package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +82 -0
- package/templates/wevu-retail/src/pages/usercenter/index.vue +301 -0
- package/templates/wevu-retail/src/services/_utils/delay.ts +3 -0
- package/templates/wevu-retail/src/services/_utils/timeout.ts +3 -0
- package/templates/wevu-retail/src/services/activity/fetchActivity.ts +20 -0
- package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +20 -0
- package/templates/wevu-retail/src/services/address/edit.ts +33 -0
- package/templates/wevu-retail/src/services/address/fetchAddress.ts +48 -0
- package/templates/wevu-retail/src/services/address/list.ts +31 -0
- package/templates/wevu-retail/src/services/cart/cart.ts +20 -0
- package/templates/wevu-retail/src/services/comments/fetchComments.ts +18 -0
- package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +18 -0
- package/templates/wevu-retail/src/services/coupon/index.ts +65 -0
- package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +20 -0
- package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +18 -0
- package/templates/wevu-retail/src/services/good/fetchGood.ts +18 -0
- package/templates/wevu-retail/src/services/good/fetchGoods.ts +29 -0
- package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +37 -0
- package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +39 -0
- package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +35 -0
- package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +38 -0
- package/templates/wevu-retail/src/services/home/home.ts +53 -0
- package/templates/wevu-retail/src/services/order/applyService.ts +70 -0
- package/templates/wevu-retail/src/services/order/orderConfirm.ts +69 -0
- package/templates/wevu-retail/src/services/order/orderDetail.ts +39 -0
- package/templates/wevu-retail/src/services/order/orderList.ts +39 -0
- package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +22 -0
- package/templates/wevu-retail/src/services/promotion/detail.ts +18 -0
- package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +28 -0
- package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +18 -0
- package/templates/wevu-retail/src/sitemap.json +7 -0
- package/templates/wevu-retail/src/utils/addressParse.ts +25 -0
- package/templates/wevu-retail/src/utils/getPermission.ts +45 -0
- package/templates/wevu-retail/src/utils/mock.ts +51 -0
- package/templates/wevu-retail/src/utils/util.ts +134 -0
- package/templates/wevu-retail/src/vite-env.d.ts +1 -0
- package/templates/wevu-retail/tailwind.config.ts +15 -0
- package/templates/wevu-retail/tsconfig.app.json +58 -0
- package/templates/wevu-retail/tsconfig.json +11 -0
- package/templates/wevu-retail/tsconfig.node.json +33 -0
- package/templates/wevu-retail/vite.config.ts +14 -0
package/README.md
CHANGED
|
@@ -5,15 +5,16 @@ import fs2 from "fs-extra";
|
|
|
5
5
|
import path2 from "pathe";
|
|
6
6
|
|
|
7
7
|
// ../weapp-vite/package.json
|
|
8
|
-
var version = "6.6.
|
|
8
|
+
var version = "6.6.8";
|
|
9
9
|
|
|
10
10
|
// ../wevu/package.json
|
|
11
|
-
var version2 = "6.6.
|
|
11
|
+
var version2 = "6.6.8";
|
|
12
12
|
|
|
13
13
|
// src/enums.ts
|
|
14
14
|
var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
|
|
15
15
|
TemplateName2["default"] = "default";
|
|
16
16
|
TemplateName2["wevu"] = "wevu";
|
|
17
|
+
TemplateName2["wevuRetail"] = "wevu-retail";
|
|
17
18
|
TemplateName2["tailwindcss"] = "tailwindcss";
|
|
18
19
|
TemplateName2["vant"] = "vant";
|
|
19
20
|
TemplateName2["tdesign"] = "tdesign";
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProject
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IT75MAH3.js";
|
|
4
4
|
|
|
5
5
|
// src/cli.ts
|
|
6
6
|
import path from "path";
|
|
@@ -40,6 +40,10 @@ async function run() {
|
|
|
40
40
|
name: "Wevu + TDesign \u6A21\u677F (wevu + tdesign + tailwindcss)",
|
|
41
41
|
value: "wevu-tdesign" /* wevuTdesign */
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: "Wevu Retail \u6A21\u677F (wevu + tdesign + tailwindcss + mokup)",
|
|
45
|
+
value: "wevu-retail" /* wevuRetail */
|
|
46
|
+
},
|
|
43
47
|
{
|
|
44
48
|
name: "\u96C6\u6210 Tailwindcss",
|
|
45
49
|
value: "tailwindcss" /* tailwindcss */
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AGENTS Guidelines (retail template)
|
|
2
|
+
|
|
3
|
+
Scope: everything under `templates/weapp-vite-wevu-tailwindcss-tdesign-retail-template/`.
|
|
4
|
+
|
|
5
|
+
Use this file together with root `AGENTS.md`.
|
|
6
|
+
|
|
7
|
+
## 1. Source of Truth
|
|
8
|
+
|
|
9
|
+
- This template must stay aligned with:
|
|
10
|
+
- `apps/tdesign-miniprogram-starter-retail`
|
|
11
|
+
- Page mapping, interaction behavior, and major WXML DOM structure should remain parity-compatible.
|
|
12
|
+
- Do not add extra business regions, placeholder blocks, or additional interaction flows not present in source app.
|
|
13
|
+
|
|
14
|
+
## 2. Authoring Constraints
|
|
15
|
+
|
|
16
|
+
- Page/component source must use Vue SFC + TypeScript.
|
|
17
|
+
- Do not reintroduce native mini-program 4-file page/component source style (`.js + .wxml + .wxss + .json`) for business pages/components.
|
|
18
|
+
- Styles should use Tailwind utility workflow configured with `weapp-tailwindcss`.
|
|
19
|
+
- Avoid ad-hoc copy scripts for WXS sidecar files when normal `weapp-vite` pipeline can resolve them.
|
|
20
|
+
|
|
21
|
+
## 3. Fast Validation Commands
|
|
22
|
+
|
|
23
|
+
- Template local checks:
|
|
24
|
+
- `pnpm -C templates/weapp-vite-wevu-tailwindcss-tdesign-retail-template typecheck`
|
|
25
|
+
- `pnpm -C templates/weapp-vite-wevu-tailwindcss-tdesign-retail-template build`
|
|
26
|
+
- Parity e2e check:
|
|
27
|
+
- `pnpm vitest run -c ./e2e/vitest.e2e.devtools.config.ts e2e/ide/template-weapp-vite-wevu-tailwindcss-tdesign-retail-template.test.ts`
|
|
28
|
+
|
|
29
|
+
Use full e2e matrix only if parity test or shared runtime/compiler tests indicate wider impact.
|
|
30
|
+
|
|
31
|
+
## 4. WXML/WXS Notes
|
|
32
|
+
|
|
33
|
+
- Keep generated WXML valid for WeChat DevTools parser.
|
|
34
|
+
- `<wxs />` self-closing and non-self-closing forms are both valid inputs and should remain supported by compile pipeline.
|
|
35
|
+
- If WXS import resolution fails, prefer fixing compiler/transform handling over adding template-level workarounds.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# weapp-vite-wevu-tailwindcss-tdesign-retail-template
|
|
2
|
+
|
|
3
|
+
该模板页面、组件与交互逻辑已与 `apps/tdesign-miniprogram-starter-retail` 保持一致。
|
|
4
|
+
|
|
5
|
+
- 页面与业务组件统一采用 Vue SFC(`.vue`)编写
|
|
6
|
+
- 业务脚本统一采用 TypeScript(`lang="ts"` / `*.ts`)
|
|
7
|
+
- 不再使用微信原生四文件(`*.js` + `*.wxml` + `*.wxss` + `*.json`)作为页面/组件源码
|
|
8
|
+
|
|
9
|
+
## 开发
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm install
|
|
13
|
+
pnpm dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 构建
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 页面对齐说明
|
|
23
|
+
|
|
24
|
+
- 页面路径与 `app.json` 分包配置一一对应
|
|
25
|
+
- 页面结构、组件引用、事件处理与原项目同步
|
|
26
|
+
- 不包含 `RetailPageShell`/`mokup` 占位页实现
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# testing
|
|
7
|
+
coverage
|
|
8
|
+
|
|
9
|
+
# next.js
|
|
10
|
+
.next/
|
|
11
|
+
out/
|
|
12
|
+
build
|
|
13
|
+
|
|
14
|
+
# misc
|
|
15
|
+
.DS_Store
|
|
16
|
+
*.pem
|
|
17
|
+
|
|
18
|
+
# debug
|
|
19
|
+
npm-debug.log*
|
|
20
|
+
yarn-debug.log*
|
|
21
|
+
yarn-error.log*
|
|
22
|
+
.pnpm-debug.log*
|
|
23
|
+
|
|
24
|
+
# local env files
|
|
25
|
+
.env.local
|
|
26
|
+
.env.development.local
|
|
27
|
+
.env.test.local
|
|
28
|
+
.env.production.local
|
|
29
|
+
|
|
30
|
+
# turbo
|
|
31
|
+
.turbo
|
|
32
|
+
|
|
33
|
+
dist
|
|
34
|
+
vite.config.ts.timestamp-*.mjs
|
|
35
|
+
dist-web
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "weapp-vite-wevu-tailwindcss-tdesign-retail-template",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "weapp-vite + tdesign retail 模板",
|
|
7
|
+
"author": "ice breaker <1324318532@qq.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/weapp-vite/weapp-vite.git",
|
|
12
|
+
"directory": "templates/weapp-vite-wevu-tailwindcss-tdesign-retail-template"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/weapp-vite/weapp-vite/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "weapp-vite dev",
|
|
20
|
+
"dev:open": "weapp-vite dev -o",
|
|
21
|
+
"build": "weapp-vite build",
|
|
22
|
+
"typecheck": "vue-tsc --noEmit -p tsconfig.app.json",
|
|
23
|
+
"open": "weapp-vite open",
|
|
24
|
+
"postinstall": "weapp-tw patch"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"dayjs": "^1.9.3",
|
|
28
|
+
"tdesign-miniprogram": "1.12.3",
|
|
29
|
+
"tslib": "^2.8.1",
|
|
30
|
+
"wevu": "workspace:*"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"autoprefixer": "^10.4.24",
|
|
34
|
+
"miniprogram-api-typings": "^5.0.1",
|
|
35
|
+
"postcss": "^8.5.6",
|
|
36
|
+
"tailwindcss": "^3.4.19",
|
|
37
|
+
"typescript": "^5.9.3",
|
|
38
|
+
"vue-tsc": "^3.2.4",
|
|
39
|
+
"weapp-tailwindcss": "^4.10.2",
|
|
40
|
+
"weapp-vite": "workspace:*"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "项目配置文件",
|
|
3
|
+
"miniprogramRoot": "dist/",
|
|
4
|
+
"compileType": "miniprogram",
|
|
5
|
+
"setting": {
|
|
6
|
+
"babelSetting": {
|
|
7
|
+
"ignore": [],
|
|
8
|
+
"disablePlugins": [],
|
|
9
|
+
"outputPath": ""
|
|
10
|
+
},
|
|
11
|
+
"coverView": false,
|
|
12
|
+
"postcss": false,
|
|
13
|
+
"minified": false,
|
|
14
|
+
"enhance": false,
|
|
15
|
+
"showShadowRootInWxmlPanel": false,
|
|
16
|
+
"packNpmRelationList": [
|
|
17
|
+
{
|
|
18
|
+
"packageJsonPath": "./package.json",
|
|
19
|
+
"miniprogramNpmDistDir": "./dist"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"ignoreUploadUnusedFiles": true,
|
|
23
|
+
"compileHotReLoad": false,
|
|
24
|
+
"skylineRenderEnable": true,
|
|
25
|
+
"packNpmManually": true,
|
|
26
|
+
"es6": true,
|
|
27
|
+
"minifyWXML": true
|
|
28
|
+
},
|
|
29
|
+
"simulatorType": "wechat",
|
|
30
|
+
"simulatorPluginLibVersion": {},
|
|
31
|
+
"condition": {},
|
|
32
|
+
"srcMiniprogramRoot": "dist/",
|
|
33
|
+
"editorSetting": {
|
|
34
|
+
"tabIndent": "insertSpaces",
|
|
35
|
+
"tabSize": 2
|
|
36
|
+
},
|
|
37
|
+
"libVersion": "3.13.2",
|
|
38
|
+
"packOptions": {
|
|
39
|
+
"ignore": [],
|
|
40
|
+
"include": []
|
|
41
|
+
},
|
|
42
|
+
"appid": "wx6ffee4673b257014",
|
|
43
|
+
"projectname": "weapp-vite-wevu-tailwindcss-tdesign-retail-template"
|
|
44
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
|
3
|
+
"projectname": "weapp-vite-wevu-tailwindcss-tdesign-retail-template",
|
|
4
|
+
"setting": {
|
|
5
|
+
"compileHotReLoad": true
|
|
6
|
+
},
|
|
7
|
+
"libVersion": "3.14.0"
|
|
8
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onShow } from 'wevu'
|
|
3
|
+
import updateManager from './common/updateManager'
|
|
4
|
+
|
|
5
|
+
defineAppJson({
|
|
6
|
+
pages: ['pages/home/home', 'pages/category/index', 'pages/cart/index', 'pages/usercenter/index'],
|
|
7
|
+
subpackages: [
|
|
8
|
+
{
|
|
9
|
+
root: 'pages/user',
|
|
10
|
+
name: 'user',
|
|
11
|
+
pages: ['person-info/index', 'address/list/index', 'address/edit/index', 'name-edit/index'],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
root: 'pages/goods',
|
|
15
|
+
name: 'goods',
|
|
16
|
+
pages: [
|
|
17
|
+
'list/index',
|
|
18
|
+
'details/index',
|
|
19
|
+
'search/index',
|
|
20
|
+
'result/index',
|
|
21
|
+
'comments/index',
|
|
22
|
+
'comments/create/index',
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
root: 'pages/order',
|
|
27
|
+
name: 'order',
|
|
28
|
+
pages: [
|
|
29
|
+
'order-confirm/index',
|
|
30
|
+
'receipt/index',
|
|
31
|
+
'pay-result/index',
|
|
32
|
+
'order-list/index',
|
|
33
|
+
'order-detail/index',
|
|
34
|
+
'apply-service/index',
|
|
35
|
+
'after-service-list/index',
|
|
36
|
+
'after-service-detail/index',
|
|
37
|
+
'fill-tracking-no/index',
|
|
38
|
+
'delivery-detail/index',
|
|
39
|
+
'invoice/index',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
root: 'pages/coupon',
|
|
44
|
+
name: 'coupon',
|
|
45
|
+
pages: ['coupon-list/index', 'coupon-detail/index', 'coupon-activity-goods/index'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
root: 'pages/promotion',
|
|
49
|
+
name: 'promotion',
|
|
50
|
+
pages: ['promotion-detail/index'],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
tabBar: {
|
|
54
|
+
custom: true,
|
|
55
|
+
color: '#666666',
|
|
56
|
+
selectedColor: '#FF5F15',
|
|
57
|
+
backgroundColor: '#ffffff',
|
|
58
|
+
borderStyle: 'black',
|
|
59
|
+
list: [
|
|
60
|
+
{
|
|
61
|
+
pagePath: 'pages/home/home',
|
|
62
|
+
text: '首页',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
pagePath: 'pages/category/index',
|
|
66
|
+
text: '分类',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
pagePath: 'pages/cart/index',
|
|
70
|
+
text: '购物车',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
pagePath: 'pages/usercenter/index',
|
|
74
|
+
text: '我的',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
requiredPrivateInfos: ['chooseAddress'],
|
|
79
|
+
lazyCodeLoading: 'requiredComponents',
|
|
80
|
+
usingComponents: {},
|
|
81
|
+
window: {
|
|
82
|
+
backgroundTextStyle: 'light',
|
|
83
|
+
navigationBarBackgroundColor: '#fff',
|
|
84
|
+
navigationBarTitleText: 'Weixin',
|
|
85
|
+
navigationBarTextStyle: 'black',
|
|
86
|
+
},
|
|
87
|
+
sitemapLocation: 'sitemap.json',
|
|
88
|
+
permission: {
|
|
89
|
+
'scope.userLocation': {
|
|
90
|
+
desc: '你的位置信息将用于小程序位置接口的效果展示',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
onShow(() => {
|
|
96
|
+
updateManager()
|
|
97
|
+
})
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style>
|
|
101
|
+
@tailwind base;
|
|
102
|
+
@tailwind components;
|
|
103
|
+
@tailwind utilities;
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default () => {
|
|
2
|
+
if (!wx.canIUse('getUpdateManager')) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const updateManager = wx.getUpdateManager();
|
|
7
|
+
|
|
8
|
+
updateManager.onCheckForUpdate(function (res) {
|
|
9
|
+
// 请求完新版本信息的回调
|
|
10
|
+
console.log('版本信息', res);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
updateManager.onUpdateReady(function () {
|
|
14
|
+
wx.showModal({
|
|
15
|
+
title: '更新提示',
|
|
16
|
+
content: '新版本已经准备好,是否重启应用?',
|
|
17
|
+
success(res) {
|
|
18
|
+
if (res.confirm) {
|
|
19
|
+
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
20
|
+
updateManager.applyUpdate();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
updateManager.onUpdateFailed(function () {
|
|
27
|
+
// 新版本下载失败
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
Component({
|
|
3
|
+
externalClasses: ['wr-class'],
|
|
4
|
+
|
|
5
|
+
options: {
|
|
6
|
+
multipleSlots: true,
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
properties: {
|
|
10
|
+
overall: {
|
|
11
|
+
type: Number,
|
|
12
|
+
value: 1,
|
|
13
|
+
observer(overall) {
|
|
14
|
+
this.setData({
|
|
15
|
+
overall,
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
layout: {
|
|
20
|
+
type: Number,
|
|
21
|
+
value: 1,
|
|
22
|
+
observer(layout) {
|
|
23
|
+
this.setData({
|
|
24
|
+
layout,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
sorts: {
|
|
29
|
+
type: String,
|
|
30
|
+
value: '',
|
|
31
|
+
observer(sorts) {
|
|
32
|
+
this.setData({
|
|
33
|
+
sorts,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
type: String,
|
|
39
|
+
value: '#FA550F',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
data: {
|
|
44
|
+
layout: 1,
|
|
45
|
+
overall: 1,
|
|
46
|
+
sorts: '',
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
methods: {
|
|
50
|
+
onChangeShowAction() {
|
|
51
|
+
const { layout } = this.data;
|
|
52
|
+
const nextLayout = layout === 1 ? 0 : 1;
|
|
53
|
+
this.triggerEvent('change', { ...this.properties, layout: nextLayout });
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
handlePriseSort() {
|
|
57
|
+
const { sorts } = this.data;
|
|
58
|
+
this.triggerEvent('change', {
|
|
59
|
+
...this.properties,
|
|
60
|
+
overall: 0,
|
|
61
|
+
sorts: sorts === 'desc' ? 'asc' : 'desc',
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
open() {
|
|
66
|
+
this.triggerEvent('showFilterPopup', {
|
|
67
|
+
show: true,
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
onOverallAction() {
|
|
72
|
+
const { overall } = this.data;
|
|
73
|
+
const nextOverall = overall === 1 ? 0 : 1;
|
|
74
|
+
const nextData = {
|
|
75
|
+
sorts: '',
|
|
76
|
+
prices: [],
|
|
77
|
+
};
|
|
78
|
+
this.triggerEvent('change', {
|
|
79
|
+
...this.properties,
|
|
80
|
+
...nextData,
|
|
81
|
+
overall: nextOverall,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<template>
|
|
89
|
+
<!-- 过滤组件 -->
|
|
90
|
+
<view class="wr-class filter-wrap [width:100%] [height:88rpx] [display:flex] [justify-content:space-between] [position:relative] [background:#fff]">
|
|
91
|
+
<view class="filter-left-content [height:100%] [display:flex] [flex-grow:2] [flex-flow:row_nowrap] [justify-content:space-between] [&_.filter-item]:[flex:1] [&_.filter-item]:[height:100%] [&_.filter-item]:[display:flex] [&_.filter-item]:[align-items:center] [&_.filter-item]:[justify-content:center] [&_.filter-item]:[font-size:26rpx] [&_.filter-item]:[line-height:36rpx] [&_.filter-item]:[font-weight:400] [&_.filter-item]:[color:rgba(51,_51,_51,_1)] [&_.filter-item_.filter-price]:[display:flex] [&_.filter-item_.filter-price]:[flex-direction:column] [&_.filter-item_.filter-price]:[margin-left:6rpx] [&_.filter-item_.filter-price]:[justify-content:space-between] [&_.filter-item_.wr-filter]:[margin-left:8rpx] [&_.filter-active-item]:[color:#fa550f]">
|
|
92
|
+
<view class="filter-item {{overall === 1 ? 'filter-active-item' : ''}}" bindtap="onOverallAction">
|
|
93
|
+
综合
|
|
94
|
+
</view>
|
|
95
|
+
<view class="filter-item" bind:tap="handlePriseSort">
|
|
96
|
+
<text style="color: {{sorts !== '' ? color : '' }}">价格</text>
|
|
97
|
+
<view class="filter-price">
|
|
98
|
+
<t-icon
|
|
99
|
+
prefix="wr"
|
|
100
|
+
name="arrow_drop_up"
|
|
101
|
+
size="18rpx"
|
|
102
|
+
style="color:{{sorts === 'asc' ? color : '#bbb'}}"
|
|
103
|
+
/>
|
|
104
|
+
<t-icon
|
|
105
|
+
prefix="wr"
|
|
106
|
+
name="arrow_drop_down"
|
|
107
|
+
size="18rpx"
|
|
108
|
+
style="color:{{sorts === 'desc' ? color : '#bbb'}}"
|
|
109
|
+
/>
|
|
110
|
+
</view>
|
|
111
|
+
</view>
|
|
112
|
+
<view class="filter-item {{prices.length ? 'filter-active-item' : ''}}" bindtap="open" data-index="5">
|
|
113
|
+
筛选
|
|
114
|
+
<t-icon
|
|
115
|
+
name="filter"
|
|
116
|
+
prefix="wr"
|
|
117
|
+
color="#333"
|
|
118
|
+
size="32rpx"
|
|
119
|
+
/>
|
|
120
|
+
</view>
|
|
121
|
+
</view>
|
|
122
|
+
</view>
|
|
123
|
+
<!-- 筛选弹框 -->
|
|
124
|
+
<slot name="filterPopup" />
|
|
125
|
+
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<json>
|
|
129
|
+
{
|
|
130
|
+
"component": true,
|
|
131
|
+
"usingComponents": {
|
|
132
|
+
"t-icon": "tdesign-miniprogram/icon/icon"
|
|
133
|
+
}
|
|
134
|
+
}</json>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
Component({
|
|
3
|
+
externalClasses: ['wr-class'],
|
|
4
|
+
|
|
5
|
+
options: {
|
|
6
|
+
multipleSlots: true,
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
properties: {
|
|
10
|
+
show: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
observer(show) {
|
|
13
|
+
this.setData({ visible: show });
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
closeBtn: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
value: false,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
data: { visible: false },
|
|
23
|
+
|
|
24
|
+
methods: {
|
|
25
|
+
reset() {
|
|
26
|
+
this.triggerEvent('reset');
|
|
27
|
+
},
|
|
28
|
+
confirm() {
|
|
29
|
+
this.triggerEvent('confirm');
|
|
30
|
+
},
|
|
31
|
+
close() {
|
|
32
|
+
this.triggerEvent('showFilterPopupClose');
|
|
33
|
+
|
|
34
|
+
this.setData({ visible: false });
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<t-popup
|
|
42
|
+
visible="{{visible}}"
|
|
43
|
+
placement="right"
|
|
44
|
+
bind:visible-change="close"
|
|
45
|
+
data-index="5"
|
|
46
|
+
close-btn="{{closeBtn}}"
|
|
47
|
+
>
|
|
48
|
+
<view class="content [&_.filter-btns-wrap]:[width:100%] [&_.filter-btns-wrap]:[position:absolute] [&_.filter-btns-wrap]:[bottom:calc(20rpx_+_env(safe-area-inset-bottom))] [&_.filter-btns-wrap]:[display:flex] [&_.filter-btns-wrap]:[flex-direction:row] [&_.filter-btns-wrap]:[border-radius:10rpx_0_0_10rpx] [&_.filter-btns-wrap]:[padding:16rpx_32rpx] [&_.filter-btns-wrap]:[border-top:1rpx_solid_#e5e5e5] [&_.filter-btns-wrap]:[box-sizing:border-box]">
|
|
49
|
+
<slot name="filterSlot" />
|
|
50
|
+
<view class="filter-btns-wrap">
|
|
51
|
+
<view class="filter-btn btn-reset [flex:1] [display:flex] [justify-content:center] [align-items:center] [font-size:28rpx] [font-weight:500] [height:80rpx] [color:#fa4126] [background:rgba(255,_255,_255,_1)] [position:relative] [border:1rpx_solid_#fa4126] [border-radius:84rpx_0_0_84rpx]" bind:tap="reset">重置</view>
|
|
52
|
+
<view class="filter-btn btn-confirm [flex:1] [display:flex] [justify-content:center] [align-items:center] [font-size:28rpx] [font-weight:500] [height:80rpx] [border-radius:0_84rpx_84rpx_0] [border:1rpx_solid_#fa4126] [color:#fff] [background:#fa4126]" bind:tap="confirm" data-index="5">
|
|
53
|
+
确定
|
|
54
|
+
</view>
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
</t-popup>
|
|
58
|
+
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<json>
|
|
62
|
+
{
|
|
63
|
+
"component": true,
|
|
64
|
+
"usingComponents": {
|
|
65
|
+
"t-popup": "tdesign-miniprogram/popup/popup"
|
|
66
|
+
}
|
|
67
|
+
}</json>
|