diff --git a/project.private.config.json b/project.private.config.json index 91461b6..b612694 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -2,7 +2,8 @@ "projectname": "spider_cloud_warehouse", "setting": { "compileHotReLoad": true, - "bigPackageSizeSupport": true + "bigPackageSizeSupport": true, + "urlCheck": false }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "condition": { diff --git a/src/api/index.ts b/src/api/index.ts index b0e6c06..5fd0136 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -9,6 +9,8 @@ export { FindColorListApi, } from './product/index' +export { ShoppingCartUpdateApi, ShoppingCartDeleteApi, ShoppingCartListApi } from './shopping/index' + import { useRequest } from '@/use/useHttp' /** * 系列列表 diff --git a/src/api/shopping/index.ts b/src/api/shopping/index.ts new file mode 100644 index 0000000..afd11f5 --- /dev/null +++ b/src/api/shopping/index.ts @@ -0,0 +1,31 @@ +import { useRequest } from "@/use/useHttp" +/** + * 修改购物车 + * @returns + */ +export const ShoppingCartUpdateApi = () => { + return useRequest({ + url: `/v1/mp/shoppingCart/productColor`, + method: 'put', + }) +} +/** + * 删除购物车商品 + * @returns + */ + export const ShoppingCartDeleteApi = () => { + return useRequest({ + url: `/v1/mp/shoppingCart/productColor`, + method: "delete", + }) +} +/** + * 获取购物车商品列表 + * @returns + */ + export const ShoppingCartListApi = () => { + return useRequest({ + url: `/v1/mp/shoppingCart/productColor`, + method: "get", + }) +} diff --git a/src/components/checkbox/index.tsx b/src/components/checkbox/index.tsx index 13c648c..f3ac720 100644 --- a/src/components/checkbox/index.tsx +++ b/src/components/checkbox/index.tsx @@ -10,6 +10,7 @@ type params = { onSelect?: () => void //选择触发 onClose?: () => void //取消触发 status?: boolean //是否选中 + hidden?: boolean // 隐藏单选框 disabled?: boolean //是否禁用 triggerLabel?: boolean // 点击label是否触发选中 circle?: boolean @@ -34,6 +35,7 @@ export default forwardRef((props: params, ref) => { customStyles = {}, customClassName = '', customTextClass = '', + hidden = false, } = props const [selected, SetSelected] = useState(false) const onSelectEven = () => { @@ -79,7 +81,7 @@ export default forwardRef((props: params, ref) => { }, [status]) return ( - +