diff --git a/admin/src/api/product.ts b/admin/src/api/product.ts index 53256b1d..0164691e 100644 --- a/admin/src/api/product.ts +++ b/admin/src/api/product.ts @@ -39,3 +39,15 @@ export function importSpecData(productId: number, file: File) { headers: { 'Content-Type': 'multipart/form-data' }, }) } + +export function getSpecDataList(productId: number) { + return http.get(`/admin/products/${productId}/spec-data`) +} + +export function createSpecData(productId: number, data: any) { + return http.post(`/admin/products/${productId}/spec-data`, data) +} + +export function deleteSpecData(productId: number, specId: number) { + return http.delete(`/admin/products/${productId}/spec-data/${specId}`) +} diff --git a/admin/src/layout/AdminLayout.vue b/admin/src/layout/AdminLayout.vue index bb8f4940..823f510e 100644 --- a/admin/src/layout/AdminLayout.vue +++ b/admin/src/layout/AdminLayout.vue @@ -9,6 +9,9 @@ 商品管理 + + 分类管理 + 订单管理 diff --git a/admin/src/router/index.ts b/admin/src/router/index.ts index 9b961aff..929850ba 100644 --- a/admin/src/router/index.ts +++ b/admin/src/router/index.ts @@ -44,6 +44,11 @@ const router = createRouter({ name: 'MoldList', component: () => import('../views/mold/MoldList.vue'), }, + { + path: 'categories', + name: 'CategoryList', + component: () => import('../views/category/CategoryList.vue'), + }, ], }, ], diff --git a/admin/src/views/category/CategoryList.vue b/admin/src/views/category/CategoryList.vue new file mode 100644 index 00000000..b6de8ff6 --- /dev/null +++ b/admin/src/views/category/CategoryList.vue @@ -0,0 +1,117 @@ + + + diff --git a/admin/src/views/product/ProductForm.vue b/admin/src/views/product/ProductForm.vue index 58723866..d15054c4 100644 --- a/admin/src/views/product/ProductForm.vue +++ b/admin/src/views/product/ProductForm.vue @@ -33,6 +33,24 @@ + + + + + + +
用于商品列表页展示的缩略图
+
+ 详细参数配置 - - +
+ {{ tag }} + +
- - +
+ {{ tag }} + +
- - +
+ {{ tag }} + +
- + + + + + + + + + + + + + 金料信息 + + + + + + + + + + + 主石信息 + + + + + + + 副石信息 + + + + + + + 工费信息 + + + + + + + + + + + + + 保存 取消 @@ -107,8 +222,8 @@ + + diff --git a/miniprogram/api/product.ts b/miniprogram/api/product.ts index 6d7556fd..8b6e915e 100644 --- a/miniprogram/api/product.ts +++ b/miniprogram/api/product.ts @@ -14,7 +14,7 @@ export const getProductSpecs = (id: number) => get(`/api/products/${id}/specs`) /** 根据参数组合获取规格数据列表 */ -export const getSpecDataList = (id: number, params: { fineness: string; mainStone: string; ringSize: string }) => +export const getSpecDataList = (id: number, params: { fineness?: string; mainStone?: string; ringSize?: string }) => post(`/api/products/${id}/spec-data`, params as unknown as Record) /** 获取商品分类列表 */ diff --git a/miniprogram/components/BannerSwiper.vue b/miniprogram/components/BannerSwiper.vue index e2e01637..bab66a13 100644 --- a/miniprogram/components/BannerSwiper.vue +++ b/miniprogram/components/BannerSwiper.vue @@ -1,34 +1,31 @@ diff --git a/miniprogram/components/ProductCard.vue b/miniprogram/components/ProductCard.vue index d68a0816..b7be9279 100644 --- a/miniprogram/components/ProductCard.vue +++ b/miniprogram/components/ProductCard.vue @@ -1,76 +1,85 @@ + .product-card { + display: flex; + flex-direction: column; + background: #fff; + border-radius: 16rpx; + overflow: hidden; + width: 100%; + } + + .product-card__image { + width: 100%; + height: 340rpx; + } + + .product-card__info { + padding: 16rpx 20rpx 20rpx; + } + + .product-card__name { + font-size: 26rpx; + color: #333; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: block; + line-height: 1.5; + } + + .product-card__bottom { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 12rpx; + } + + .product-card__price-tag { + background: linear-gradient(135deg, #f5a0b8, #FF6D9B); + border-radius: 8rpx; + padding: 4rpx 16rpx; + } + + .product-card__price { + font-size: 28rpx; + color: #fff; + font-weight: bold; + } + + .product-card__stock { + font-size: 22rpx; + color: #999; + } + \ No newline at end of file diff --git a/miniprogram/components/ShippingNotice.vue b/miniprogram/components/ShippingNotice.vue index e77e56fb..87b399ce 100644 --- a/miniprogram/components/ShippingNotice.vue +++ b/miniprogram/components/ShippingNotice.vue @@ -1,9 +1,15 @@ @@ -12,20 +18,34 @@ diff --git a/miniprogram/components/SpecPanel.vue b/miniprogram/components/SpecPanel.vue index a5a91123..95df2f2b 100644 --- a/miniprogram/components/SpecPanel.vue +++ b/miniprogram/components/SpecPanel.vue @@ -1,281 +1,317 @@ diff --git a/miniprogram/pages.json b/miniprogram/pages.json index 3607315c..d59600af 100644 --- a/miniprogram/pages.json +++ b/miniprogram/pages.json @@ -3,13 +3,13 @@ { "path": "pages/index/index", "style": { - "navigationBarTitleText": "珠宝商城" + "navigationStyle": "custom" } }, { "path": "pages/product/detail", "style": { - "navigationBarTitleText": "商品详情" + "navigationStyle": "custom" } }, { diff --git a/miniprogram/pages/index/index.vue b/miniprogram/pages/index/index.vue index 737e8bb0..a76cb601 100644 --- a/miniprogram/pages/index/index.vue +++ b/miniprogram/pages/index/index.vue @@ -1,131 +1,309 @@ + .home-page { + min-height: 100vh; + background: #f5f5f5; + } + + /* 自定义导航栏 */ + .custom-navbar { + background: linear-gradient(to right, #FFCFDE, #FFA6C4); + } + + .custom-navbar__content { + display: flex; + align-items: center; + justify-content: center; + } + + .custom-navbar__title { + font-size: 34rpx; + font-weight: bold; + color: #333; + } + + /* 搜索栏 */ + .search-bar { + display: flex; + align-items: center; + padding: 16rpx 24rpx; + } + + .search-bar__input { + flex: 1; + display: flex; + align-items: center; + background: #fff; + border-radius: 40rpx; + padding: 16rpx 24rpx; + height: 72rpx; + box-sizing: border-box; + } + + .search-bar__icon { + width: 32rpx; + height: 32rpx; + margin-right: 12rpx; + } + + .search-bar__placeholder { + font-size: 24rpx; + color: #999; + } + + .search-bar__btn { + margin-left: 16rpx; + font-size: 28rpx; + color: #333; + font-weight: 500; + } + + /* 分类图标 */ + .category-section { + white-space: nowrap; + padding: 32rpx 0 24rpx; + background: #FFFFFF; + } + + .category-section__inner { + display: inline-flex; + padding: 0 24rpx; + gap: 32rpx; + } + + .category-icon { + display: inline-flex; + flex-direction: column; + align-items: center; + gap: 12rpx; + flex-shrink: 0; + } + + .category-icon__circle { + width: 120rpx; + height: 120rpx; + border-radius: 30rpx; + background: linear-gradient(135deg, #fce4ec, #f8bbd0); + display: flex; + align-items: center; + justify-content: center; + } + + .category-icon--active .category-icon__circle { + background: linear-gradient(135deg, #f48fb1, #e91e63); + box-shadow: 0 4rpx 16rpx rgba(233, 30, 99, 0.3); + } + + .category-icon__emoji { + font-size: 48rpx; + } + + .category-icon__img { + width: 90rpx; + height: 90rpx; + } + + .category-icon__label { + font-size: 24rpx; + color: #333; + } + + .category-icon--active .category-icon__label { + color: #e91e63; + font-weight: bold; + } + + /* 快捷入口 */ + .quick-actions { + display: flex; + gap: 20rpx; + padding: 0 24rpx 24rpx; + background-color: #FFFFFF; + } + + .quick-action { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + gap: 16rpx; + padding: 28rpx 0; + border-radius: 16rpx; + background: #fff; + } + + .quick-action--calc { + background: linear-gradient(135deg, #FFA4C3, #FFD2E0); + } + + .quick-action--service { + background: linear-gradient(135deg, #e8f5e9, #fff); + } + + .quick-action__icon { + font-size: 44rpx; + } + + .quick-action__text { + font-size: 30rpx; + color: #333; + font-weight: 600; + } + + /* 商品列表 */ + .product-grid { + display: flex; + flex-wrap: wrap; + padding: 0 24rpx; + gap: 16rpx; + } + + .product-grid__item { + width: calc(50% - 8rpx); + } + + .empty-tip, + .loading-tip { + text-align: center; + padding: 60rpx 0; + color: #999; + font-size: 28rpx; + } + \ No newline at end of file diff --git a/miniprogram/pages/product/detail.vue b/miniprogram/pages/product/detail.vue index 2a6868db..94fbdc0e 100644 --- a/miniprogram/pages/product/detail.vue +++ b/miniprogram/pages/product/detail.vue @@ -1,26 +1,42 @@