diff --git a/public/imgs/bottomnav/gerenzhongxin-background.png b/public/imgs/bottomnav/gerenzhongxin-background.png index 18f07bb..49764fd 100644 Binary files a/public/imgs/bottomnav/gerenzhongxin-background.png and b/public/imgs/bottomnav/gerenzhongxin-background.png differ diff --git a/public/imgs/bottomnav/jifenshangcheng-background.png b/public/imgs/bottomnav/jifenshangcheng-background.png index 1d500d7..e0646c1 100644 Binary files a/public/imgs/bottomnav/jifenshangcheng-background.png and b/public/imgs/bottomnav/jifenshangcheng-background.png differ diff --git a/public/imgs/bottomnav/rongdoumingxi-background.png b/public/imgs/bottomnav/rongdoumingxi-background.png index 93c8934..73dc0b3 100644 Binary files a/public/imgs/bottomnav/rongdoumingxi-background.png and b/public/imgs/bottomnav/rongdoumingxi-background.png differ diff --git a/public/imgs/bottomnav/rongdoupipei-background.png b/public/imgs/bottomnav/rongdoupipei-background.png index 5477d92..59e28fd 100644 Binary files a/public/imgs/bottomnav/rongdoupipei-background.png and b/public/imgs/bottomnav/rongdoupipei-background.png differ diff --git a/public/imgs/bottomnav/zhuye-background.png b/public/imgs/bottomnav/zhuye-background.png index 8f692bc..63f6d54 100644 Binary files a/public/imgs/bottomnav/zhuye-background.png and b/public/imgs/bottomnav/zhuye-background.png differ diff --git a/public/imgs/mainpage/jifenyue1.png b/public/imgs/mainpage/jifenyue1.png new file mode 100644 index 0000000..1cfcc9e Binary files /dev/null and b/public/imgs/mainpage/jifenyue1.png differ diff --git a/public/imgs/mainpage/jifenyue2.png b/public/imgs/mainpage/jifenyue2.png new file mode 100644 index 0000000..665c868 Binary files /dev/null and b/public/imgs/mainpage/jifenyue2.png differ diff --git a/public/imgs/mainpage/shangcheng1.png b/public/imgs/mainpage/shangcheng1.png deleted file mode 100644 index fc28b28..0000000 Binary files a/public/imgs/mainpage/shangcheng1.png and /dev/null differ diff --git a/public/imgs/mainpage/shangcheng2.png b/public/imgs/mainpage/shangcheng2.png deleted file mode 100644 index 64413aa..0000000 Binary files a/public/imgs/mainpage/shangcheng2.png and /dev/null differ diff --git a/src/components/BottomNav.vue b/src/components/BottomNav.vue index c526f99..69a9be3 100644 --- a/src/components/BottomNav.vue +++ b/src/components/BottomNav.vue @@ -174,9 +174,17 @@ const backgroundImage = computed(() => { /* 最左边小球向右偏移 */ .nav-item:first-child { + transform: translateX(12px); +} + +.nav-item:nth-child(2) { transform: translateX(10px); } +.nav-item:nth-child(4) { + transform: translateX(-5px); +} + /* 最右边小球向左偏移 */ .nav-item:last-child { transform: translateX(-10px); diff --git a/src/utils/api.js b/src/utils/api.js index 55c856b..568cf99 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -169,7 +169,7 @@ const hideLoading = () => { // 生成不同的实例 export const apiRequest = createRequest('/api') -export const midRequest = createRequest('/mid') +export const midRequest = createRequest('http://192.168.0.12:3005/mid') // 初始化时设置token const token = localStorage.getItem('token') @@ -209,7 +209,8 @@ export const userAPI = { // 认证相关API export const authAPI = { // 登录 - login: (data) => midRequest.post('/auth/login', data), + // login: (data) => midRequest.post('/auth/login', data), + login: (data) => apiRequest.post('/auth/login', data), // 注册 register: (data) => midRequest.post('/auth/register', data), @@ -224,10 +225,12 @@ export const authAPI = { // 验证码相关API export const captchaAPI = { // 生成验证码 - generate: () => midRequest.get('/captcha/generate'), + // generate: () => midRequest.get('/captcha/generate'), + generate: () => apiRequest.get('/captcha/generate'), // 验证验证码 - verify: (data) => midRequest.post('/captcha/verify', data) + // verify: (data) => midRequest.post('/captcha/verify', data) + verify: (data) => apiRequest.post('/captcha/verify', data) } // 文件上传API @@ -275,6 +278,8 @@ export const paymentAPI = { // 购买商品 export const buyAPI = { buy: (data) => midRequest.post('/payment/create-order', data), + pay: (outTradeNo, params) => midRequest.get(`/payment/query-status/${outTradeNo}`, {params}), + test : () => apiRequest.get('/payment/pay-product/test'), } // 转账相关API diff --git a/src/views/MainPage.vue b/src/views/MainPage.vue index ff58105..9a4f933 100644 --- a/src/views/MainPage.vue +++ b/src/views/MainPage.vue @@ -46,7 +46,7 @@ 获取融豆 - 商城 + 商城 @@ -318,7 +318,7 @@ export default { // 处理系统公告点击事件 const handleSystemAnnouncementClick = () => { - console.log('触发') + // console.log('触发') isSystemAnnouncementClick.value = true; showWelcomeDialog.value = true; // 无条件显示对话框 }; @@ -531,7 +531,6 @@ export default { max-width: 180px; object-fit: contain; border-radius: 8px; - margin-left: -10px; } .action-image2 { @@ -548,7 +547,6 @@ export default { height: auto; max-width: 180px; object-fit: contain; - margin-right: -10px; } .tips { diff --git a/src/views/ProductDetail.vue b/src/views/ProductDetail.vue index a4cacfa..a8f9c8d 100644 --- a/src/views/ProductDetail.vue +++ b/src/views/ProductDetail.vue @@ -23,9 +23,9 @@
-
+ + +
+ + + + + + +
+ +
@@ -247,7 +274,7 @@ import { import api from '@/utils/api' import { getImageUrl } from '@/config' -import { watch } from 'vue' +import { watch, nextTick } from 'vue' const route = useRoute() const router = useRouter() @@ -271,6 +298,25 @@ const totalPoints = computed(() => { return product.value ? product.value.points * quantity.value : 0 }) +const carouselRef = ref(null) +const currentIndex = ref(0) + +// 点击小图切换大图 +const handleSmallImageClick = (index) => { + currentIndex.value = index + // 使用 nextTick 确保 DOM 更新后再设置轮播图 + nextTick(() => { + if (carouselRef.value) { + carouselRef.value.setActiveItem(index) + } + }) +} + +// 轮播图切换时更新当前索引 +const handleCarouselChange = (current) => { + currentIndex.value = current +} + // 购物车相关计算属性已移除 // 方法 @@ -503,6 +549,9 @@ watch( scrollbar-width: none; -ms-overflow-style: none; + + justify-content: center; + justify-items: center; } .small-images::-webkit-scrollbar { diff --git a/src/views/Shop.vue b/src/views/Shop.vue index f90a549..df84d0e 100644 --- a/src/views/Shop.vue +++ b/src/views/Shop.vue @@ -22,7 +22,7 @@
- + {{ item.name }}
@@ -224,7 +224,7 @@ onMounted(() => { } .product-content { - width: 100%; + width: 153px; height: 240px; border-radius: 5px; background-color: #fff;