diff --git a/.claude/settings.local.json b/.claude/settings.local.json index b10ccf8..b67efe0 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -5,7 +5,10 @@ "Bash(mkdir -p 'E:\\code\\智柜宝\\wx\\src\\api\\shop')", "Bash(tree 'E:\\code\\智柜宝\\wx\\src\\api' -I 'foo|goods|layout|login|me|order|system|types' -L 2)", "Bash(mkdir -p 'E:\\code\\智柜宝\\wx\\src\\pages\\home')", - "Bash(mkdir -p 'E:\\code\\智柜宝\\wx\\src\\pages\\home\\components')" + "Bash(mkdir -p 'E:\\code\\智柜宝\\wx\\src\\pages\\home\\components')", + "Bash(cp 'E:\\code\\智柜宝\\wx\\doc\\thirdParty\\src\\pages\\product\\components\\checkout.vue' 'E:\\code\\智柜宝\\wx\\src\\pages\\index\\components\\checkout.vue')", + "Bash(cp 'E:\\code\\智柜宝\\wx\\doc\\thirdParty\\src\\pages\\product\\components\\RentingCabinetContainer.vue' 'E:\\code\\智柜宝\\wx\\src\\pages\\index\\components\\renting-cabinet-container.vue')", + "Bash(test -f 'E:\\code\\智柜宝\\wx\\src\\pages\\index\\components\\product-container.vue')" ], "deny": [], "ask": [] diff --git a/doc/迁移指令.md b/doc/迁移指令.md new file mode 100644 index 0000000..0ce4140 --- /dev/null +++ b/doc/迁移指令.md @@ -0,0 +1,10 @@ +@doc\thirdParty\ 文件夹下是旧H5项目的代码,现在已经将其api部分的代码移植到了本微信小程序项目。现在需要移植页面,改为 + 微信小程序uni-app的写法,第一步先移植首页 @doc\thirdParty\src\pages\product\ 内的页面和全部组件,小程序写法参考 + @src\pages\index\index.vue + + 。仅参考语法,api需要使用原ProductList.vue中已经移植到本项目的相应api,stores也需要使用移植后的pinia。生成的代码写到 + @src\pages\home\ 文件夹下 + +参考已迁移至本项目的代码 @src\pages\index\ 。将 @doc\thirdParty\src\pages\product\components\ + 下的另外两个component也迁移到本项目。注意thirdParty下的是H5项目,现在需要改为微信小程序uni-app。api需要使用原Product + List.vue中已经移植到本项目的相应api,stores也需要使用移植后的pinia。 \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 4cff0b3..7f38c4a 100644 --- a/src/pages.json +++ b/src/pages.json @@ -61,6 +61,13 @@ }, "excludeLoginPath": false }, + { + "path": "pages/index/checkout", + "type": "page", + "style": { + "navigationBarTitleText": "订单结算" + } + }, { "path": "pages/login/faceLogin", "type": "page", diff --git a/src/pages/index/checkout.vue b/src/pages/index/checkout.vue new file mode 100644 index 0000000..9acf8a8 --- /dev/null +++ b/src/pages/index/checkout.vue @@ -0,0 +1,495 @@ + + + + + diff --git a/src/pages/index/components/cart.vue b/src/pages/index/components/cart.vue index 451d1d4..0bc8444 100644 --- a/src/pages/index/components/cart.vue +++ b/src/pages/index/components/cart.vue @@ -68,9 +68,10 @@ function handleClearCartOrRentingCart() { // 结算方法 function handleCheckout() { - handleClose() - // emit事件由父组件处理 - // router.push("/product/checkout") + handleClose(); + uni.navigateTo({ + url: '/pages/index/checkout' + }); } diff --git a/src/pages/index/components/renting-cabinet-container.vue b/src/pages/index/components/renting-cabinet-container.vue new file mode 100644 index 0000000..f0f3e9a --- /dev/null +++ b/src/pages/index/components/renting-cabinet-container.vue @@ -0,0 +1,435 @@ + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index b8aa167..cf11dc6 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -34,7 +34,7 @@ onMounted(async () => { if (res?.code === 0 && res?.data?.length > 0) { shopList.value = res.data; - shopList.value = [...shopList.value, ...res.data, ...res.data, ...res.data]; + // shopList.value = [...shopList.value, ...res.data, ...res.data, ...res.data]; } } catch (error) { console.error('获取店铺列表失败:', error) @@ -70,7 +70,7 @@ function backToShopList() { // 结算方法 function handleCheckout() { uni.navigateTo({ - url: '/pages/index/shopping-cart/index' + url: '/pages/index/checkout' }) } diff --git a/src/static/svg/product-image.svg b/src/static/svg/product-image.svg new file mode 100644 index 0000000..f12a898 --- /dev/null +++ b/src/static/svg/product-image.svg @@ -0,0 +1,6 @@ + + + 空闲 + \ No newline at end of file