From 3ccdc86f3cd867c98bac17deb715fb6b6060e463 Mon Sep 17 00:00:00 2001 From: sjeam <359824901@qq.com> Date: Wed, 23 Jul 2025 14:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=85=BC=E5=AE=B9=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.development | 2 +- env/.env.production | 2 +- package.json | 1 + pnpm-lock.yaml | 20 +++ src/pages/common/goods/detail.vue | 281 ++++++++++++++++++------------ src/pages/common/goods/order.vue | 55 +++++- src/pages/tab/home/index.vue | 21 ++- src/pages/tab/list/index.vue | 29 ++- 8 files changed, 276 insertions(+), 135 deletions(-) diff --git a/env/.env.development b/env/.env.development index c078d37..ac6762f 100644 --- a/env/.env.development +++ b/env/.env.development @@ -2,7 +2,7 @@ VITE_APP_ENV=development # 接口地址 -VITE_API_BASE_URL=http://localhost:8080 +VITE_API_BASE_URL=https://test.shop.lihaink.cn # 删除console VITE_DROP_CONSOLE=false diff --git a/env/.env.production b/env/.env.production index 7ee7743..95ba5a8 100644 --- a/env/.env.production +++ b/env/.env.production @@ -2,7 +2,7 @@ VITE_APP_ENV=production # 接口地址 -VITE_API_BASE_URL=http://localhost:8080/prod +VITE_API_BASE_URL=https://test.shop.lihaink.cn # 删除console VITE_DROP_CONSOLE=true diff --git a/package.json b/package.json index 2f5bbf2..ad571cf 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ }, "devDependencies": { "@antfu/eslint-config": "4.13.0", + "@babel/plugin-proposal-private-property-in-object": "7.21.11", "@dcloudio/types": "^3.4.8", "@dcloudio/uni-automator": "3.0.0-4060420250429001", "@dcloudio/uni-cli-shared": "3.0.0-4060420250429001", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18a268a..ab81295 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,6 +48,9 @@ importers: '@antfu/eslint-config': specifier: 4.13.0 version: 4.13.0(@typescript-eslint/utils@8.32.0(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3))(@unocss/eslint-plugin@0.63.6(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3) + '@babel/plugin-proposal-private-property-in-object': + specifier: 7.21.11 + version: 7.21.11(@babel/core@7.27.1) '@dcloudio/types': specifier: ^3.4.8 version: 3.4.15 @@ -367,6 +370,13 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-proposal-private-property-in-object@7.21.11': + resolution: {integrity: sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -6363,6 +6373,16 @@ snapshots: dependencies: '@babel/core': 7.27.1 + '@babel/plugin-proposal-private-property-in-object@7.21.11(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.27.1) + transitivePeerDependencies: + - supports-color + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.27.1)': dependencies: '@babel/core': 7.27.1 diff --git a/src/pages/common/goods/detail.vue b/src/pages/common/goods/detail.vue index 9b9a5bc..6d437de 100644 --- a/src/pages/common/goods/detail.vue +++ b/src/pages/common/goods/detail.vue @@ -1,27 +1,20 @@ - @@ -104,7 +77,7 @@ import { reactive } from 'vue'; // onBeforeMount, onMounted, onBeforeUnmount, onUnmounted, // onBeforeUpdate, onUpdated, nextTick, defineProps, toRaw } from 'vue' import { onLoad, onShow } from '@dcloudio/uni-app' - +const matchedItems_sc =ref([]) // 页面加载 onLoad((options) => { // loadData() @@ -131,51 +104,129 @@ const list4 = reactive([ // 同样,这里看起来 url 应该是一个视频或图片的URL,但给的是一个图片URL // 需要根据实际需求修正这个值 }, -]); +]); +function changeSC(){ +} const goods_list_detail = [ - { - id: 1, - name: "猪肉", - label: "", - image: " ", - disabled: true, - num: 100, - unit_name: "g", - default_num: 100, - }, - { - id: 2, - name: "毛豆", - label: "(建议食材)", - disabled: false, - num: 100, - unit_name: "ml", - default_num: 100, - }, - { - id: 3, - name: "食用油", - label: "(建议食材)", - disabled: false, - num: 100, - unit_name: "g", - default_num: 100, - }, - { - id: 4, - name: "豆瓣酱", - label: "(建议食材)", - disabled: false, - num: 100, - unit_name: "ml", - default_num: 100, - }, + { + id: 1, + name: "猪肉", + label: "", + image: " ", + disabled: true, + num: 100, + unit_name: "g", + default_num: 100, + }, + { + id: 2, + name: "毛豆", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, + { + id: 3, + name: "食用油", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "g", + default_num: 100, + }, + { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, + { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, + { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, + { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, + { + id: 4, + name: "豆瓣酱", + label: "(建议食材)", + disabled: false, + num: 100, + unit_name: "ml", + default_num: 100, + }, ]; //加入购物车 -function addCart() { +function addCart () { uni.switchTab({ url: '/pages/tab/list/index' }); diff --git a/src/pages/common/goods/order.vue b/src/pages/common/goods/order.vue index 21022e4..bacb30e 100644 --- a/src/pages/common/goods/order.vue +++ b/src/pages/common/goods/order.vue @@ -39,8 +39,9 @@ - + @@ -796,7 +799,7 @@ export default defineComponent({ // menuIndex.value = index; this.menuIndex = index; CommonApi.goodsMenu({ key: 123 }).catch((res) => { - if (res.status == 200) { + if (res.status === 200) { // this.tabList = res.data.menuList; this.tabList = this.list1 console.log(res); diff --git a/src/pages/tab/list/index.vue b/src/pages/tab/list/index.vue index 11f4f0f..77b15ff 100644 --- a/src/pages/tab/list/index.vue +++ b/src/pages/tab/list/index.vue @@ -1,3 +1,10 @@ + +