diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c92168f..0e1afa7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,6 +3,14 @@ "Vue.volar", "dbaeumer.vscode-eslint", "EditorConfig.EditorConfig", - "esbenp.prettier-vscode" + "esbenp.prettier-vscode", + "zhuangtongfa.Material-theme", + "PKief.material-icon-theme", + "ms-vscode.vscode-typescript-next", + "pranaygp.vscode-css-peek", + "ecmel.vscode-html-css", + "formulahendry.auto-rename-tag", + "bradlc.vscode-tailwindcss", + "unocss.unocss" ] } diff --git a/components.d.ts b/components.d.ts index c822f55..7ef8bc4 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,15 +10,22 @@ declare module 'vue' { export interface GlobalComponents { RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + VanArea: typeof import('vant/es')['Area'] VanButton: typeof import('vant/es')['Button'] VanCell: typeof import('vant/es')['Cell'] VanCellGroup: typeof import('vant/es')['CellGroup'] VanField: typeof import('vant/es')['Field'] + VanForm: typeof import('vant/es')['Form'] VanIcon: typeof import('vant/es')['Icon'] - VanRate: typeof import('vant/es')['Rate'] + VanNoticeBar: typeof import('vant/es')['NoticeBar'] + VanPopover: typeof import('vant/es')['Popover'] + VanPopup: typeof import('vant/es')['Popup'] VanSearch: typeof import('vant/es')['Search'] + VanStepper: typeof import('vant/es')['Stepper'] + VanSwipe: typeof import('vant/es')['Swipe'] + VanSwipeItem: typeof import('vant/es')['SwipeItem'] + VanSwitch: typeof import('vant/es')['Switch'] VanTab: typeof import('vant/es')['Tab'] VanTabs: typeof import('vant/es')['Tabs'] - VanUploader: typeof import('vant/es')['Uploader'] } } diff --git a/src/api/index.ts b/src/api/index.ts index 46cc6fd..e6595f8 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,6 @@ import axios from '@/utils/axios' import user from './user' -import shop from './commodity' +import shop from './shop' import common from './common' const totalApiConfig = { user, shop, common } diff --git a/src/api/commodity.ts b/src/api/shop.ts similarity index 60% rename from src/api/commodity.ts rename to src/api/shop.ts index 2582ba1..ad8928e 100644 --- a/src/api/commodity.ts +++ b/src/api/shop.ts @@ -1,8 +1,13 @@ // 商品维度接口 const shop = { + // 商品 searchCommodityList: ['/index/page/list'], // 获取商品列表接口 getCommodityDetail: ['/index/product/detail'], // 获取商品详情 getReviewList: ['/comment/list'], // 获取评价接口 + addCart: ['/shipping/cart/addOrUpdate'], // 添加购物车接口 + order: ['/order/add'], // 下单 + // 订单 + orderList: ['/order/list'], // 订单列表 } export default shop diff --git a/src/assets/variables.scss b/src/assets/variables.scss index fa5b16a..41d9873 100644 --- a/src/assets/variables.scss +++ b/src/assets/variables.scss @@ -1,4 +1,5 @@ $theme-color: #01cf24; +$theme-light-color: #e4fdea; $theme-disabled-color: #cefad5; .theme-bg-color { diff --git a/src/utils/page.ts b/src/utils/page.ts index e9f9476..fac102e 100644 --- a/src/utils/page.ts +++ b/src/utils/page.ts @@ -1,3 +1,4 @@ +import api from '@/api' import { closeToast, showLoadingToast, type ToastWrapperInstance } from 'vant' interface ApiType { @@ -61,3 +62,8 @@ window.useTipDialog = ( tipDialogData.show = true tipDialogData.callback = callback } + +// 添加购物车 +export const handleAddCart = async (skuId: number, num: number = 1) => { + await api.shop.addCart.post({ num, skuId }) +} diff --git a/src/views/commodity-detail/components/address-list.vue b/src/views/commodity-detail/components/address-list.vue index aa2dc4f..c69ed08 100644 --- a/src/views/commodity-detail/components/address-list.vue +++ b/src/views/commodity-detail/components/address-list.vue @@ -11,24 +11,24 @@
{{ item.detail }}
-{{ item.name }} {{ item.tel }}
+{{ item.buyerName }} {{ item.buyerPhone }}
-
¥29.9
++ ¥{{ curPageData.price }} +
+
+
手表系列
-手表系列水
-手表
-手表123
-手表12
-手表系列
-手表系列水
-手表
-手表123
-手表12
-+ {{ item.label }} +
+