diff --git a/src/api/shop.js b/src/api/shop.js
index 9014dcc..807a450 100644
--- a/src/api/shop.js
+++ b/src/api/shop.js
@@ -158,35 +158,13 @@ export const createOrder = ({
// 创建购物车订单
export const createCartOrder = ({
- type = "" ,
- original_price = "",
- actual_price = "",
- reduction_amount = 0,
- pay_amount = "",
- pay_type = "",
- address_id = "",
- address = "",
- name = "",
- phone = "",
- note = "",
- items = []
+ product_pic= "",
}) => {
return request({
url: CREATE_CART_ORDER,
method: "post",
data: {
- type,
- original_price,
- actual_price,
- reduction_amount,
- pay_amount,
- pay_type,
- address_id,
- address,
- name,
- phone,
- note,
- items
+ product_pic
},
});
};
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index 9598689..aa3586b 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -3,9 +3,8 @@
- {{ title }}
+ {{ title }}
diff --git a/src/components/TabBar.vue b/src/components/TabBar.vue
index 00f5f9d..adeb596 100644
--- a/src/components/TabBar.vue
+++ b/src/components/TabBar.vue
@@ -31,27 +31,27 @@
text: "首页",
isSpecial: false,
},
- {
- pageId: "filesPage",
- iconPath: `${imgPrefix}tabBar-record.png`,
- selectedIconPath: `${imgPrefix}tabBar-selectedRecord.png`,
- text: "档案",
- isSpecial: false,
- },
- {
- pageId: "reservationPage",
- iconPath: `${imgPrefix}tabbar-reservation.gif`,
- selectedIconPath: `${imgPrefix}tabbar-bath.png`,
- text: "立即预约",
- isSpecial: true, // 特殊样式标记(中间突出的按钮)
- },
- {
- pageId: "shopPage",
- iconPath: `${imgPrefix}tabBar-mall.png`,
- selectedIconPath: `${imgPrefix}tabBar-selectdMall.png`,
- text: "商城",
- isSpecial: false,
- },
+ // {
+ // pageId: "filesPage",
+ // iconPath: `${imgPrefix}tabBar-record.png`,
+ // selectedIconPath: `${imgPrefix}tabBar-selectedRecord.png`,
+ // text: "档案",
+ // isSpecial: false,
+ // },
+ // {
+ // pageId: "reservationPage",
+ // iconPath: `${imgPrefix}tabbar-reservation.gif`,
+ // selectedIconPath: `${imgPrefix}tabbar-bath.png`,
+ // text: "立即预约",
+ // isSpecial: true, // 特殊样式标记(中间突出的按钮)
+ // },
+ // {
+ // pageId: "shopPage",
+ // iconPath: `${imgPrefix}tabBar-mall.png`,
+ // selectedIconPath: `${imgPrefix}tabBar-selectdMall.png`,
+ // text: "分类",
+ // isSpecial: false,
+ // },
{
pageId: "minePage",
iconPath: `${imgPrefix}tabBar-mine.png`,
diff --git a/src/page-reser/components/info-cell.vue b/src/page-reser/components/info-cell.vue
index 264d369..e482acc 100644
--- a/src/page-reser/components/info-cell.vue
+++ b/src/page-reser/components/info-cell.vue
@@ -69,7 +69,7 @@
- 以下区域需收取调度费:奉贤区、嘉定区、青浦区、松江区、崇明区、金山区
+
diff --git a/src/page-reser/reservation/index.vue b/src/page-reser/reservation/index.vue
index 1f326d4..550dbc1 100644
--- a/src/page-reser/reservation/index.vue
+++ b/src/page-reser/reservation/index.vue
@@ -4,7 +4,7 @@
-
+
-
+
-
+
-
- 下一步
+
+ 预约
@@ -185,6 +185,65 @@ export default {
}
},
methods: {
+ // 核销按钮点击处理
+ async writeOff () {
+ try {
+ // 调用核销 API
+ const result = await tt.verifyCertificates({
+ // 唯一标识,防止重复提交(重要!)
+ verifyToken: `${Date.now()}_${Math.random()}`,
+
+ // 当前核销的门店ID
+ poiId: this.data.currentPoiId,
+
+ // 要核销的订单和券列表
+ orderList: [
+ {
+ orderId: '100238388744094', // 订单ID
+ certificateList: [ // 本次要核销的券
+ '724375050697789', // 普通团购券
+ // 次卡需要特殊格式
+ {
+ code: '723733187837987',
+ times: 2 // 本次核销2次
+ }
+ ]
+ }
+ ],
+
+ // 【必填】核销成功后跳转的页面
+ orderEntrySchema: {
+ path: 'pages/order/detail', // 你的订单详情页路径
+ params: JSON.stringify({ orderId: 'xxx' })
+ },
+
+ // 成功回调(仅代表API调用成功)
+ success: (res) => {
+ console.log('API调用成功', res);
+
+ // 需要遍历确认每个券的核销结果
+ const verifyResults = res.orderVerifyResults;
+ const allSuccess = verifyResults.every(item => item.resultCode === 0);
+
+ if (allSuccess) {
+ tt.showToast({ title: '核销成功' });
+ // 刷新页面或跳转
+ } else {
+ tt.showToast({ title: '部分核销失败', icon: 'none' });
+ }
+ },
+
+ // 失败回调
+ fail: (err) => {
+ console.error('核销失败', err);
+ tt.showToast({ title: '核销失败,请重试', icon: 'none' });
+ }
+ });
+ } catch (error) {
+ console.error('调用异常', error);
+ }
+},
+
getPetShortName(pet) {
const n = pet.name || pet.pet_name || pet.pet_nickname || '';
return n.length > 2 ? n.slice(0, 2) + '…' : n.slice(0, 2);
diff --git a/src/pageHome/service/feeding.vue b/src/pageHome/service/feeding.vue
index a6f9534..bbbcf24 100644
--- a/src/pageHome/service/feeding.vue
+++ b/src/pageHome/service/feeding.vue
@@ -118,7 +118,7 @@
- 以下区域需收取调度费:奉贤区、嘉定区、青浦区、松江区、崇明县、金山区
+
diff --git a/src/pages.json b/src/pages.json
index e3fe124..e002133 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -44,6 +44,12 @@
"navigationBarTitleText": "我的公益"
}
},
+ {
+ "path": "pages/client/mine/qualification",
+ "style": {
+ "navigationBarTitleText": "服务资质"
+ }
+ },
{
"path": "pages/client/category/index",
"style": {
diff --git a/src/pages/client/category/components/GoodItem.vue b/src/pages/client/category/components/GoodItem.vue
index e76f333..d3b98dc 100644
--- a/src/pages/client/category/components/GoodItem.vue
+++ b/src/pages/client/category/components/GoodItem.vue
@@ -5,28 +5,25 @@
{{ data.product_name || "" }}
-
+
¥
{{data.prices[0].original_price || 0 }}
- 到手价
+
¥{{ minPrice.price_shichang || 0 }}
-
+
+ 立即购买
+
@@ -76,6 +73,10 @@ export default {
this.isAnimating = false;
}, 600);
},
+ // 立即购买
+ handleBuyNow() {
+ this.$emit('buyNow', this.data);
+ },
},
};
@@ -158,6 +159,21 @@ export default {
animation: addCartBounce 0.6s ease;
}
}
+
+ .buy-now-btn-wrapper {
+ margin-top: 16rpx;
+ display: flex;
+ justify-content: flex-end;
+
+ .buy-now-btn {
+ background: linear-gradient(90deg, #FF19A0, #FF4DB8);
+ color: #FFFFFF;
+ font-size: 24rpx;
+ padding: 12rpx 32rpx;
+ border-radius: 24rpx;
+ font-weight: 500;
+ }
+ }
}
@keyframes addCartBounce {
diff --git a/src/pages/client/home/index.vue b/src/pages/client/home/index.vue
index 29619f7..a253a21 100644
--- a/src/pages/client/home/index.vue
+++ b/src/pages/client/home/index.vue
@@ -3,6 +3,9 @@
+
+
+
+
+
{{ userInfo.username ? userInfo.username : "嗨,你好呀" }}
登陆享受更多精彩内容
-
-
-
- v{{ userInfo.vipLevel ? userInfo.vipLevel : 0 }}会员
-
+
+
注册/登陆
-
- {{ userInfo.couponCount ? userInfo.couponCount : 0 }}张优惠券
-
-
+
-
-
@@ -142,25 +86,39 @@ import {
userWllet
} from "../../../api/login";
import WeChatCopyModal from "@/components/WeChatCopyModal.vue";
+import GoodItem from "../shop/components/GoodItem.vue";
+import DraggableContact from "@/components/DraggableContact.vue";
+import {
+ getGoodsClassify,
+ getGoodsListData
+ } from "@/api/shop";
export default {
name: "HomePage",
components: {
- WeChatCopyModal
+ GoodItem,
+ WeChatCopyModal,
+ DraggableContact
},
- data() {
- return {
- imgPrefix,
- couponCount: 1,
- swiperDataList: [
- {
- image: `${imgPrefix}banner1.png`
- },
- {
- image: `${imgPrefix}bannerShare.png`
- }
- ],
- secondMenuItemList: [{
+ data() {
+ return {
+ imgPrefix,
+ couponCount: 1,
+ goodsList: [], // 商品列表
+ goodsTotal: 0, // 商品总数
+ goodPage: 1, // 当前页码
+ isLoadingGoods: false, // 是否正在加载商品
+ refreshTriggered: false, // 刷新是否已触发
+ cartCount: 0, // 购物车数量
+ swiperDataList: [
+ {
+ image: `${imgPrefix}banner1.png`
+ },
+ {
+ image: `${imgPrefix}bannerShare.png`
+ }
+ ],
+ secondMenuItemList: [{
title: "邀请有礼",
tips: "邀请好友得好礼",
img: `${imgPrefix}home-invite .png`,
@@ -202,13 +160,39 @@ export default {
},
userInfo() {
return this.$store.state?.user?.userInfo || {};
- }
+ },
+ leftColumnGoods() {
+ return this.goodsList.filter((v, i) => i % 2 === 0);
+ },
+ rightColumnGoods() {
+ return this.goodsList.filter((v, i) => i % 2 === 1);
+ },
+ cartShowCount() {
+ return this.cartCount > 9 ? "9+" : this.cartCount;
+ }
},
created() {
- this.buyService()
-
+ this.getGoodsList()
},
methods: {
+ getGoodsList() {
+ if (this.isLoadingGoods) return;
+ this.isLoadingGoods = true;
+ const params = {
+ type: 0
+ }
+ getGoodsListData(params)
+ .then((res) => {
+ const list = res?.data || [];
+ this.goodsList =
+ this.goodPage === 1 ? list : [...this.goodsList, ...list];
+ this.goodsTotal = res?.count || 0;
+ })
+ .finally(() => {
+ this.isLoadingGoods = false;
+ this.refreshTriggered = false;
+ });
+ },
toLogin() {
uni.navigateTo({
url: "/pages/client/auth/index",
@@ -258,24 +242,6 @@ export default {
// url: '/pageHome/service/index'
// });
},
- // 我的钱包
- buyService() {
- const value = JSON.parse(uni.getStorageSync('vuex'));
- console.log(value, '??')
- this.userId = value.user.userInfo.userID
- this.nick_name = value.user.userInfo.username
- // this.yaoqing_code = value.user.userInfo.yaoqing_code
- // console.log(value,'--')
- userWllet(value.user.userInfo.userID).then((res) => {
- uni.setStorage({ //存入Storage
- key: 'userInfo',
- data: { //存的数据(可以是多条)
- 'user_id': res.data.user_id,
- 'wallet_id': res.data.id
- }
- })
- });
- },
onSecondMenuScroll(e) {
const scrollLeft = e.detail.scrollLeft || 0;
const sysInfo = uni.getSystemInfoSync();
@@ -352,6 +318,30 @@ export default {
});
},
+ // 立即购买
+ addToCar(goodsData) {
+ console.log(goodsData,'--=')
+ uni.navigateTo({
+ url: `/pages/client/order/create`,
+ success: (res) => {
+ // 通过eventChannel向被打开页面传送数据
+ res.eventChannel.emit("createOrder", {
+ goodList: [{
+ ...this.goodsData,
+ goods_id:goodsData.product_id,
+ price_id:goodsData.prices[0].price_id,
+ number:1,
+ goods_name: goodsData.product_name,
+ price_name: goodsData?.product_name,
+ goods_price: goodsData.prices[0].actual_price,
+ product_pic:goodsData.product_pic
+ }, ],
+ });
+ },
+ });
+
+ },
+
// 跳转微信客服 - 使用自定义弹窗
jumpToWeChat() {
if (this.$refs.wechatCopyModal) {
@@ -361,6 +351,16 @@ export default {
});
}
},
+
+ // 可拖动联系客服组件点击回调
+ handleContactClick() {
+ if (this.$refs.wechatCopyModal) {
+ this.$refs.wechatCopyModal.show({
+ title: '请添加客服号',
+ weChatCode: 'Wagoo2025'
+ });
+ }
+ },
},
};
@@ -371,6 +371,33 @@ export default {
background-color: #ffecf3;
}
+ .recommand-goods-wrapper {
+ .recommand-title {
+ margin-bottom: 10rpx;
+ }
+
+ .goods-list {
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-start;
+ align-items: flex-start;
+ margin-top: 16rpx;
+
+ .goods-list-item {
+ flex: 1;
+ min-width: 0;
+
+ &.left {
+ margin-right: 20rpx;
+ }
+ }
+ }
+
+ .loading-wrapper {
+ padding: 10rpx 0;
+ }
+ }
+
.homeContainer {
height: calc(100vh - #{$app_tabbar_height + 36});
background-color: #ffecf3;
@@ -431,7 +458,22 @@ export default {
align-items: center;
.userContent {
- margin-left: 16rpx;
+ display: flex;
+ align-items: center;
+ gap: 16rpx;
+
+ .userAvatar {
+ width: 92rpx;
+ height: 92rpx;
+ border-radius: 50%;
+ flex-shrink: 0;
+ }
+
+ .user-info-wrapper {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ }
.userName {
font-weight: 500;
diff --git a/src/pages/client/mine/index.vue b/src/pages/client/mine/index.vue
index 4097d3e..9013ede 100644
--- a/src/pages/client/mine/index.vue
+++ b/src/pages/client/mine/index.vue
@@ -14,13 +14,13 @@
{{ userInfo.userID && userInfo.username ? userInfo.username : '嗨,你好呀' }}
-
+
-
+
-
+
-