Compare commits

...

159 Commits

Author SHA1 Message Date
赵公子a
ead9add14a 取消登录地址的校验 2025-09-18 19:54:11 +08:00
赵毅
d24c12257b 修改项目中的appid 和 key 2025-09-18 17:50:24 +08:00
赵毅
fa8dedb78f 修改快捷支付页面样式 和 提交订单页面支付成功之后的弹窗布局样式 2025-09-18 17:35:50 +08:00
赵毅
1acf1f8052 修改自提点部分的传值逻辑 2025-09-18 16:30:01 +08:00
赵毅
55e80254ef 修改线上的请求地址 2025-09-18 16:11:22 +08:00
赵毅
4a7ee0b742 修改名称为 湖畔生活家 2025-09-18 16:05:48 +08:00
赵毅
7dcc220b17 根据环境判断调用的接口地址 2025-09-18 15:39:35 +08:00
赵毅
28da44a63b 修改售后中提交申请的类型错误的bug 2025-09-18 15:20:10 +08:00
赵毅
7596c45f40 隐藏订单列表页几笔售后的展示 2025-09-18 14:34:31 +08:00
赵毅
06c5e64f54 完成申请售后退款金额的修改功能 2025-09-18 10:59:12 +08:00
赵毅
49120a2e1f 修改物业管理部分关于小区的逻辑 2025-09-18 10:20:30 +08:00
赵毅
7d1aa498b4 修改首页布局,确保不会因为屏幕尺寸导致布局混乱 2025-09-18 09:57:23 +08:00
赵毅
9372db9037 如果是后台配置的小区则展示进入小区按钮 2025-09-18 08:53:03 +08:00
赵毅
e7f7853feb 首页样式优化 2025-09-17 18:07:58 +08:00
赵毅
fd29fc9b20 修改取消支付报错的bug 2025-09-17 17:08:36 +08:00
赵毅
c642678502 提交订单页面,当取消支付之后调用取消订单的接口 2025-09-17 16:55:28 +08:00
赵毅
e44cf88635 修改团购备货中和待自提的数据异常问题 2025-09-17 16:52:39 +08:00
赵毅
ad7d404482 11 2025-09-17 16:29:04 +08:00
赵毅
c68243f95e 拆分售后订单的数据 -- 普通和团购 2025-09-17 16:24:34 +08:00
赵毅
a732eab59f 修改从订单列表执行立即付款时的执行逻辑 2025-09-17 16:05:48 +08:00
赵毅
3c87af65de 隐藏再来一单按钮操作 2025-09-17 15:48:42 +08:00
赵毅
4d6e41ed1c 修改湖畔社区页面的数据展示逻辑 2025-09-17 15:46:56 +08:00
赵毅
9bffd147ba 修改页面返回时因为webview数量限制而造成的页面返回错误问题 2025-09-17 15:39:36 +08:00
赵毅
8d7e59c095 修改湖畔缴费中点击立即缴费的提示 2025-09-17 15:25:55 +08:00
赵毅
a8168c6db1 修改未发货状态下的申请退款的请求接口 2025-09-17 15:10:20 +08:00
赵毅
80d6fb8cc9 添加智能设备路由 2025-09-17 15:01:29 +08:00
赵毅
210a3bec81 完成智能设备模块 2025-09-17 15:00:50 +08:00
赵毅
8d8df19256 修改团购的状态逻辑 2025-09-17 14:24:11 +08:00
赵毅
2b6b43afdd 修改物业管理 工单台页面的背景图 2025-09-17 11:59:51 +08:00
赵毅
d322370e44 使用插件实现输入付款金额 2025-09-17 11:54:43 +08:00
赵毅
bac043f2ba 11 2025-09-17 09:56:06 +08:00
赵毅
6625889aee 拆分订单为易购和团购两个列表 2025-09-17 09:52:24 +08:00
赵毅
9e260a1bb8 修改团购订单列表状态名称 2025-09-17 09:51:42 +08:00
赵毅
6e28dc148e 修复在订单列表页点击立即支付后在提交订单页没有自提点的bug 2025-09-17 09:47:00 +08:00
赵毅
d2f6efbd3f 实现底部导航栏中的扫一扫功能 2025-09-17 08:49:18 +08:00
赵毅
814c59cba4 优化首页页面 完成顶部搜索栏和下方商品分类标签的吸顶效果 2025-09-16 17:40:12 +08:00
赵毅
ea3566baa6 11 2025-09-16 16:27:49 +08:00
赵毅
ec382aacf1 修改提交订单 - 创建订单报错的bug 2025-09-16 14:26:17 +08:00
赵毅
9bd2f0c1ea 停车订单详情页面停车时长的逻辑改为计费时长逻辑 2025-09-16 10:13:42 +08:00
赵毅
9b58416ed4 修改临停订单详情页面的数据显示异常的问题 2025-09-16 09:24:07 +08:00
赵毅
dddee35084 修复临停缴费查询停车费的数据显示异常的问题 2025-09-16 08:56:11 +08:00
赵毅
62a0e5c7d7 优化个人中心页面 2025-09-16 08:47:56 +08:00
赵毅
fd462f66bb 修改团购部分不同页面加入购物车导致数据不对的bug 2025-09-15 17:59:51 +08:00
赵毅
398d1ef9c1 调整个人中心的字号 2025-09-15 16:58:22 +08:00
赵毅
6bad5494f9 添加核销码的展示 2025-09-15 16:57:55 +08:00
赵毅
7876e674b0 修改首页金刚区图标大小 2025-09-15 16:11:26 +08:00
赵毅
f870d220ba 修改首页金刚区图标样式和底部导航栏的高度显示 2025-09-15 16:06:51 +08:00
赵毅
8f7ce8f0e9 修改删除小区之后我的小区页面不同步更新的bug 2025-09-15 16:01:00 +08:00
赵毅
35cab6537a 当检测到 webview 数量限制错误时自动切换为 redirectTo 模式 2025-09-15 14:56:30 +08:00
赵毅
bfcf74aaf0 修改评价部分的页面 2025-09-15 14:25:30 +08:00
赵毅
38eedaffe0 完善售后模块 2025-09-15 11:56:23 +08:00
赵毅
1e347ca68f 提示登录后查看时清除storage中的数据 2025-09-15 08:52:47 +08:00
赵毅
b405b88862 添加物业管理显示模块的验证 2025-09-15 08:48:11 +08:00
赵毅
81298faedc 优化订单详情页面的部分逻辑 2025-09-13 18:03:28 +08:00
赵毅
a64939a86a 修改点击查询停车费的页面展示逻辑 2025-09-13 17:57:23 +08:00
赵毅
07ffe842bd 订单列表页面添加供应商的显示 2025-09-13 17:54:42 +08:00
赵毅
db78fe36b0 修改停车订单页面删除最后一条数据后造成的bug 2025-09-13 11:58:45 +08:00
赵毅
849d6149bb 修改停车订单页面数据不显示的bug 2025-09-13 11:56:08 +08:00
赵毅
9e664e1a21 修改临停订单可以重复支付的bug 2025-09-13 11:14:36 +08:00
赵毅
1b552b84d2 11 2025-09-13 10:51:36 +08:00
赵毅
42a5f23564 添加湖畔社区进入小区的作用范围 2025-09-13 10:50:33 +08:00
赵毅
ca4f9cd388 取消湖畔到家页面的跳转 2025-09-13 10:46:20 +08:00
赵毅
6e40c84b89 根据后台配置的免费出场时间显示 2025-09-13 10:41:50 +08:00
赵毅
058d2d4a60 添加月卡订单页面的去支付和取消订单 2025-09-13 10:41:29 +08:00
赵毅
c3ad7f9a37 隐藏月卡充值模块入口 2025-09-13 10:33:12 +08:00
赵毅
1f0de01c5b 完成复制订单编号 2025-09-13 10:32:48 +08:00
赵毅
f767c7109b 修改临停订单,只要没有支付成功都删除该订单 2025-09-13 10:32:03 +08:00
赵毅
9ae7f9e088 优化退款成功和自行寄回页面 2025-09-12 17:13:55 +08:00
赵毅
866ee54a0b 修改商家已处理的页面 2025-09-12 16:11:31 +08:00
赵毅
4098389254 修改售后列表页面的状态展示 2025-09-12 15:40:40 +08:00
赵毅
984593109e 修改换货页面 2025-09-12 15:34:05 +08:00
赵毅
ee60321a03 完成售后页和处理页面的修改申请 2025-09-12 15:07:15 +08:00
赵毅
9557a51e28 修改售后商家处理页的服务类型展示 2025-09-12 11:03:23 +08:00
赵毅
fb5ddc3e9a 完成售后页和处理页面的撤销申请 2025-09-12 10:34:53 +08:00
赵毅
5cb0984e00 点击提交申请时将弹窗数据重置为默认 2025-09-12 09:06:42 +08:00
赵毅
998a14c878 对接售后模块部分接口 2025-09-11 18:04:54 +08:00
赵毅
6bf7d78776 修改湖畔好店页面的布局样式 2025-09-10 17:12:30 +08:00
赵毅
8be8b4de89 本地生活改为湖畔好店 2025-09-10 17:01:23 +08:00
赵毅
a82089990a 修改我的小区默认页的图片地址 2025-09-10 16:41:30 +08:00
赵毅
e1c286058c 完成 - 湖畔社区模块 2025-09-10 16:33:05 +08:00
赵毅
7b656c7a9f 添加首页不是衡水市时重新定位按钮 2025-09-09 18:00:49 +08:00
赵毅
e13cf87f87 根据定位判断显示内容 2025-09-09 17:33:35 +08:00
赵毅
56c189f406 Merge branch 'feature-yjs' of https://git.hshuishang.com/maguodong/uniapp-ZHSQ into feature/yi 2025-09-09 16:43:58 +08:00
赵毅
7789268ffb 编写湖畔社区页面
引入uni的icon插件
2025-09-09 16:31:58 +08:00
kikyoe
9e3f154836 售后 2025-09-09 16:23:08 +08:00
赵毅
76334aed9b 修改我的小区页面布局样式 2025-09-09 11:48:37 +08:00
赵毅
55590b29e3 修改报修页面的数据显示逻辑 2025-09-09 11:38:49 +08:00
赵毅
f7d53e5b4b 临时停车缴费支付成功之后重新查询停车费 2025-09-09 11:34:41 +08:00
赵毅
9a51c9b3a4 优化完善物业管理模块的逻辑 2025-09-09 10:31:30 +08:00
赵毅
00b9af721e 修改本地生活页面布局 2025-09-09 09:09:21 +08:00
赵毅
c1e265ec2a 取消首页点击分类选项的提示信息 2025-09-09 09:03:26 +08:00
赵毅
df0bec40b2 修改切换小区之后金刚区的按钮展示逻辑 2025-09-08 15:42:48 +08:00
赵毅
e4fe37ba3a 优化接单派单页面按钮布局 2025-09-08 15:42:09 +08:00
赵毅
43bd15a93a 修改物业缴费支付报错的bug 2025-09-08 15:41:52 +08:00
赵毅
7596710963 湖畔好店去掉到店服务券 2025-09-08 11:38:49 +08:00
赵毅
80f31109ec 修改没有绑定任何房源的页面样式
修改弹窗广告只出现一次
2025-09-08 10:46:48 +08:00
赵毅
7a3a19a5f7 修改湖畔好店页面搜索框的位置 2025-09-08 09:52:53 +08:00
赵毅
0c810d32ab 修改月卡充值支付取消订单状态不是待支付的bug 2025-09-06 17:43:27 +08:00
赵毅
d8eb80efd9 添加删除我的车辆功能 2025-09-06 16:24:40 +08:00
赵毅
59c72ced9b 修改易购页面的分享 和 生成海报功能 2025-09-06 15:09:12 +08:00
赵毅
ec51286a1e 修改进入详情页的默认选中规格 2025-09-06 14:40:58 +08:00
赵毅
b70b3a40df 修改易购页面选择规格按钮的逻辑错误 2025-09-06 10:09:44 +08:00
赵毅
2a69930eaa 修改团购列表页和商品详情页数据格式不一致的问题 2025-09-05 18:07:51 +08:00
赵毅
ad58591164 修改购物车数量显示不一致问题 2025-09-05 16:11:40 +08:00
赵毅
14826e746d 易购添加库存不足提示 2025-09-05 15:57:03 +08:00
赵毅
389951eeb6 车牌颜色 蓝色 等改为 蓝牌 2025-09-05 15:56:46 +08:00
赵毅
03ef856fd3 修复团购列表页面和详情页规格 数据不一致问题 2025-09-05 14:35:38 +08:00
赵毅
15afc855fc 区分团购和易购的购物车数据 2025-09-05 14:27:47 +08:00
赵毅
f2983a3de5 添加规格选择的popup 2025-09-05 11:34:04 +08:00
赵毅
0c7b906afd 修改易购页面显示undefined的bug 2025-09-05 10:54:11 +08:00
赵毅
5218893ae7 修改易购点击分类的页面显示问题 2025-09-05 10:41:40 +08:00
赵毅
5d77e6f407 修改易购页面显示undefined的bug 2025-09-05 10:40:38 +08:00
赵毅
e7108f6182 Merge branch 'feature-yjs' of https://git.hshuishang.com/maguodong/uniapp-ZHSQ into feature/yi 2025-09-05 08:43:29 +08:00
赵毅
916e41e424 修改易购部分bug 2025-09-04 18:04:42 +08:00
赵毅
267bac2149 修改临停订单列表和包月订单列表的数据格式 2025-09-04 17:44:45 +08:00
赵毅
3fb0454731 修改提交团单页面是否为同一个供应商的条件判断 2025-09-04 16:02:07 +08:00
赵毅
1ee4532487 给停车订单页面的接口添加页数页码 2025-09-04 15:12:49 +08:00
赵毅
997502ef01 修改临停缴费页面的选择车辆的布局 2025-09-04 11:59:16 +08:00
赵毅
68839c2447 车牌颜色根据选择的颜色进行显示 2025-09-04 11:37:37 +08:00
赵毅
08e77df1a5 修改取消支付的信息提示 2025-09-04 09:43:24 +08:00
kikyoe
4036939b9c 售后 2025-09-04 09:35:35 +08:00
赵毅
d18b452e3e 修改停车场列表 - 从近到远排序 2025-09-03 18:05:43 +08:00
赵毅
ffff785c09 创建订单的金额乘以100 2025-09-03 17:07:36 +08:00
赵毅
730e697798 修改我的房产页面的顶部导航 2025-09-03 17:07:19 +08:00
赵毅
82a7e33889 图片地址改为线上地址 2025-09-03 16:29:52 +08:00
赵毅
f58cec3d0d 修改没有房产的页面 2025-09-03 16:27:50 +08:00
赵毅
f6741c1a9b 给小区添加默认图标 2025-09-03 14:22:51 +08:00
赵毅
dc5e328b3c 编写易购模块的搜索页面 2025-09-03 11:12:02 +08:00
赵毅
47f1eaaa09 修改支付订单的逻辑 - 改为根据供应商选择自提点 2025-09-02 17:57:21 +08:00
赵毅
20b03f0f02 修改支付金额的显示问题 2025-09-02 16:09:59 +08:00
赵毅
3fb80ce105 修改易购商品因为没有团购相关信息导致因为start_time报错的问题 2025-09-02 15:42:53 +08:00
赵毅
1a3fd2c137 修改点击选择规格没反应的bug 2025-09-02 14:57:45 +08:00
赵毅
a3980c4470 给易购页面没有数据时添加提示 2025-09-02 11:31:10 +08:00
赵毅
37a93d7286 修改packages/localLife/classify/index页面点击左上角返回没反应的bug 2025-09-02 11:28:20 +08:00
赵毅
fe34a9e81f 修改易购页面的页面样式和点击选中逻辑 2025-09-02 11:01:27 +08:00
赵毅
6d0a011836 修改易购模块部分bug 2025-09-02 08:56:48 +08:00
赵毅
567af67ef1 对接智慧停车模块接口 2025-09-01 11:36:01 +08:00
赵毅
671c24b654 完成智慧停车模块页面 2025-08-29 16:53:08 +08:00
赵毅
b239b83267 修改让用户登录的逻辑 2025-08-28 15:09:00 +08:00
赵毅
44d2447744 修改商家入驻请求方法时的参数校验 2025-08-27 18:18:50 +08:00
赵毅
7f122c9754 修改团购部分的bug 2025-08-27 18:00:04 +08:00
赵毅
3ecdf95c24 修改团购部分bug 2025-08-26 18:32:16 +08:00
赵毅
e3c535d596 对接接口 -- 创建订单 2025-08-25 18:30:33 +08:00
赵毅
cc9eee696a 修改购物车页面布局 2025-08-25 17:11:27 +08:00
赵毅
0fb88da5c2 修改提交团单页面不显示图片的问题 2025-08-25 16:33:27 +08:00
赵毅
184ed7feab 修改代码,不请求方法之间写死 qqmap_key的值 2025-08-25 15:58:23 +08:00
赵毅
53d09262c2 修改购物车页面 -- 添加根据供应商选择的逻辑 2025-08-25 11:45:36 +08:00
赵毅
aaf8962505 修改团购页面图片不显示的bug 2025-08-25 11:32:40 +08:00
赵毅
c15528bcde 修改购物车样式和逻辑 2025-08-25 11:19:09 +08:00
赵毅
e1014ef6ef 修复团购活动结束时间显示异常问题 2025-08-25 08:35:51 +08:00
赵毅
b854bf8cf5 修改多个货品时进入详情页的bug 2025-08-23 16:57:28 +08:00
赵毅
6cd1b93782 对接商品详情页的评价接口 2025-08-23 16:41:21 +08:00
赵毅
103d7563a8 修改团购页面的布局样式 2025-08-23 15:30:01 +08:00
赵毅
4d1dcb72cb 完成团购模块 2025-08-23 11:54:58 +08:00
赵毅
0b302c5bbe Merge branch 'feature-yjs' of https://git.hshuishang.com/maguodong/uniapp-ZHSQ into feature/yi 2025-08-22 09:04:13 +08:00
kikyoe
07b7592165 添加当日达和更改购物车页面 2025-08-22 08:44:37 +08:00
赵毅
84c73e4bdf 对接接口 - 团购列表 团购核销 2025-08-21 18:13:52 +08:00
赵毅
716d94c0d8 修复团购商品详情页面报错 2025-08-20 17:49:55 +08:00
赵毅
ab21a6f441 完成团购模块页面 2025-08-20 16:15:05 +08:00
192 changed files with 28667 additions and 11005 deletions

View File

@ -1,5 +1,12 @@
export const apiArr = {
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
afterSalesList: '/api/v2/wechat/commodity/after-sales/list', // 商品订单售后列表
afterSaleCreate: "/api/v2/wechat/commodity/after-sales/refund-info/create", //商品订单售后信息创建
cancelOrConfirm: "/api/v2/wechat/commodity/order/cancel_or_confirm", //商品订单确认收货或取消
isAllow: "/api/v2/wechat/commodity/after-sales/is-allow", //判断订单是否能申请售后
revokeApply: "/api/v2/wechat/commodity/after-sales/revoke-apply", //撤销售后申请
changeGoodsList: "/api/v2/wechat/commodity/after-sales/change-goods-list", //商品售后换货商品列表
updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请
createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价
orderRefund: "/api/v2/wechat/commodity/order/refund", //商品订单退款
};

View File

@ -1,50 +1,55 @@
export const apiArr = {
isShowSearch: '/api/v1/wechat/home-page/search-enable/info', // 获取搜索框是否显示
hotWord: '/api/v1/wechat/home-page/search-hot-word/info', // 获取搜索框热词
list: '/api/v1/wechat/community/list', // 获取社区列表
info: '/api/v1/wechat/community/info', // 获取单个社区信息
isJoin: '/api/v1/wechat/community/is-join', // 用户是否加入社区、楼宇、房间
tipsList: '/api/v1/wechat/community/tips/list', // 获取全部通知列表
oneTips: '/api/v1/wechat/community/tips/one', // 获取单个社区通知
apply: '/api/v1/wechat/community/apply', // 申请加入小区
getFacilityList: '/api/v1/wechat/community/facility/list', //获取楼号,
getRoomList: '/api/v1/wechat/community/room/list', //获取房间号
ownerList: '/api/v1/wechat/community/owner/list', // 获取社区业主列表
isShowSearch: "/api/v1/wechat/home-page/search-enable/info", // 获取搜索框是否显示
hotWord: "/api/v1/wechat/home-page/search-hot-word/info", // 获取搜索框热词
list: "/api/v1/wechat/community/list", // 获取社区列表
info: "/api/v1/wechat/community/info", // 获取单个社区信息
isJoin: "/api/v1/wechat/community/is-join", // 用户是否加入社区、楼宇、房间
tipsList: "/api/v1/wechat/community/tips/list", // 获取全部通知列表
oneTips: "/api/v1/wechat/community/tips/one", // 获取单个社区通知
apply: "/api/v1/wechat/community/apply", // 申请加入小区
getFacilityList: "/api/v1/wechat/community/facility/list", //获取楼号,
getRoomList: "/api/v1/wechat/community/room/list", //获取房间号
ownerList: "/api/v1/wechat/community/owner/list", // 获取社区业主列表
submit: "/api/v1/wechat/community/owner/feedback-create", //报修提交
getListByRepair: "/api/v1/wechat/community/owner/feedback-list",//报事报修列表
getInfoById: "/api/v1/wechat/community/owner/feedback-info", //报事报修根据id查询详情
submit: "/api/v1/wechat/community/owner/feedback-create", //报修提交
getListByRepair: "/api/v1/wechat/community/owner/feedback-list", //报事报修列表
getInfoById: "/api/v1/wechat/community/owner/feedback-info", //报事报修根据id查询详情
getUserCommunity: "/api/v1/wechat/community/owner/mylist",//获取用户社区信息
getUserCommunity: "/api/v1/wechat/community/owner/mylist", //获取用户社区信息
get_host_info: 'https://zhsq.hshuishang.com/Miniapi/Index/get_host_info',
get_host_info: "https://zhsq.hshuishang.com/Miniapi/Index/get_host_info",
get_community_area_list: "https://zhsq.hshuishang.com/Miniapi/Community/get_community_area_list",
get_community_area_list:
"https://zhsq.hshuishang.com/Miniapi/Community/get_community_area_list",
carList: "/api/v1/wechat/community/car/list", // 获取社区列表
addCar: "/api/v1/wechat/community/car/add", // 添加车辆
getCarList: "/api/v1/wechat/community/car/list", //获取车辆列表
deleteItem: "/api/v1/wechat/community/car/del", //删除车牌
carList: '/api/v1/wechat/community/car/list', // 获取社区列表
addCar: '/api/v1/wechat/community/car/add', // 添加车辆
getCarList: '/api/v1/wechat/community/car/list', //获取车辆列表
deleteItem: "/api/v1/wechat/community/car/del",//删除车牌
getBanner: "/api/v1/wechat/home-page/banner-list", //获取banner图
getButton: "/api/v1/wechat/home-page/button-list", //获取button
getHotWords: "/api/v1/wechat/home-page/search-hot-word/info", //搜索热词
getBanner: "/api/v1/wechat/home-page/banner-list",//获取banner图
getButton: "/api/v1/wechat/home-page/button-list",//获取button
getHotWords: "/api/v1/wechat/home-page/search-hot-word/info",//搜索热词
getAllList: "/api/v2/wechat/community/get-all-list", //获取小区信息列表
commRoomSelect: "/api/v2/wechat/community-room/comm-room-select", //房源筛选器
commInfo: "/api/v2/wechat/mpuser-crud/community-owner/info", //我的房产信息小区列表
create: "/api/v2/wechat/community-owners/create", //创建新的业主信息
getAllList: "/api/v2/wechat/community/get-all-list",//获取小区信息列表
commRoomSelect: "/api/v2/wechat/community-room/comm-room-select",//房源筛选器
communityInfo: "/api/v2/community/get-one", //获取小区信息
commInfo: "/api/v2/wechat/mpuser-crud/community-owner/info",//我的房产信息小区列表
create: "/api/v2/wechat/community-owners/create",//创建新的业主信息
workCommunityList: "/api/v2/wechat/community-worker/work-comm-list", //员工小区列表
communityInfo: "/api/v2/community/get-one",//获取小区信息
getOrderList: "/api/v2/wechat/community-orders/get-all-list", //获取账单
getCommunityRoomList: "/api/v2/wechat/community-room/list", //获取房源列表
getUserGovenmentMoney:
"/api/v2/wechat/government-housing-fund-flow-crud/user", //获取用户公积金
createPayOrder: "/api/v2/wechat/community-order-pay/create", //创建缴费
getPayOrderInfo: "/api/v2/wechat/community-order-pay/get-one", //根据缴费信息获取支付信息
getPayOrderList: "/api/v2/wechat/community-order-pay/get-page", //查询缴费记录
OrderPay: "/api/v2/wechat/community-order-pay/preorder", //预下单
tradeQuery: "/api/v2/wechat/community-order-pay/trade-query", //缴费查单
getOrderList:"/api/v2/wechat/community-orders/get-all-list",//获取账单
getCommunityRoomList:"/api/v2/wechat/community-room/list", //获取房源列表
getUserGovenmentMoney:"/api/v2/wechat/government-housing-fund-flow-crud/user", //获取用户公积金
createPayOrder:"/api/v2/wechat/community-order-pay/create", //创建缴费
getPayOrderInfo:"/api/v2/wechat/community-order-pay/get-one", //根据缴费信息获取支付信息
getPayOrderList:"/api/v2/wechat/community-order-pay/get-page", //查询缴费记录
OrderPay:"/api/v2/wechat/community-order-pay/preorder",//预下单
};
checkComm: "/api/v2/wechat/community/check-comm", //检查小区是否属于当前用户
};

7
api/groupPurchase.js Normal file
View File

@ -0,0 +1,7 @@
export const apiArr = {
groupBuyList: "/api/v2/wechat/commodity/group-buy/list", //团购列表
groupGoodsList: "/api/v2/wechat/commodity/group-goods/list", //团购商品列表
groupBuyAddress: "/api/v2/wechat/commodity/group-buy/address", //团购自提地址
groupBuyRecord: "/api/v2/wechat/commodity/group-buy/buy-record", //团购购买记录
groupBuyWriteOff: "/api/v2/wechat/commodity/group-buy/write-off", //团购核销
};

View File

@ -1,3 +0,0 @@
export const apiArr = {
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
}

22
api/park.js Normal file
View File

@ -0,0 +1,22 @@
export const apiArr = {
carList: '/api/v2/wechat/smart-parking/car/list', // 车辆列表
carAdd: '/api/v2/wechat/smart-parking/car/add', // 车辆添加
monthCardCreate: '/api/v2/wechat/smart-parking/month-card/create', // 月卡订单创建
monthCardOrderList: '/api/v2/wechat/smart-parking/month-card/order/list', // 包月订单列表
monthCardOrderPreorder: '/api/v2/wechat/smart-parking/month-card/order/preorder', // 月卡充值预下单
monthCardOrderQuery: '/api/v2/wechat/smart-parking/month-card/order/trade_query', // 月卡充值订单交易查询
billingRulesList: '/api/v2/wechat/smart-parking/billing-rules/list', // 月卡计费规则列表
tempParkingCreate: '/api/v2/wechat/smart-parking/temp-parking/create', // 临时车缴费订单创建
tempParkingInfo: '/api/v2/wechat/smart-parking/temp-parking/info', // 临时车缴费信息
tempParkingOrderDelete: '/api/v2/wechat/smart-parking/temp-parking/order/delete', // 临时车停车订单删除
tempParkingOrderInfo: '/api/v2/wechat/smart-parking/temp-parking/order/info', // 临时车停车订单信息
tempParkingOrderList: '/api/v2/wechat/smart-parking/temp-parking/order/list', // 临时车停车订单列表
tempParkingOrderPreorder: '/api/v2/wechat/smart-parking/temp-parking/preorder', // 临时车缴费订单预下单
tempParkingOrderQuery: '/api/v2/wechat/smart-parking/temp-parking/trade_query', // 临时车缴费订单交易查询
parkList: '/api/v2/wechat/smart-parking/parking/list', // 停车场列表
deleteCar: '/api/v2/wechat/smart-parking/car/del', // 删除车辆
}

View File

@ -12,5 +12,13 @@ export const apiArr = {
payOrder: "/api/v2/wechat/commodity/order/pay",//支付订单
settingDefaultAddress: '/api/v2/wechat/commodity/receiving_address/default', // 收货地址设置默认
updateAddress: '/api/v2/wechat/commodity/receiving_address/update', // 收货地址修改
addAddress: '/api/v2/wechat/commodity/receiving_address/add', // 收货地址添加
addAddressList: '/api/v2/wechat/commodity/receiving_address', // 收货地址列表
queryOrder: '/api/v2/wechat/commodity/order/trade_query', // 查询订单
getComment: '/api/v2/wechat/commodity/review/list', // 获取评论
mergePreorder: '/api/v2/wechat/commodity/order/preorder', // 商品订单合并预下单
goodsSearch: '/api/v2/wechat/commodity/search', // 商品搜索
cancelPay: '/api/v2/wechat/commodity/order/cancel_pay', // 用户取消支付
}

5
app.miniapp.json Normal file
View File

@ -0,0 +1,5 @@
{
"adapteByMiniprogram": {
"userName": "gh_ca4a91c192dd"
}
}

View File

@ -0,0 +1,282 @@
<template>
<view class="key-container" @click="hide" v-show="showMask">
<uni-transition :modeClass="['slide-bottom']" :show="show"
:styles="{height:'100vh'}"
:duration="duration">
<view class="key-content" @click.stop>
<slot></slot>
<view class="key-box block flex">
<view class="key-left">
<view class="key-top flex flex-wrap">
<view class="btn-box" v-for="(item,index) in numArr" :key="index">
<button hover-class="active" class="cu-btn key-btn text-black text-xl" @click.stop="keydown(item)">{{item}}</button>
</view>
</view>
<view class="key-bottom">
<view class="btn-zero">
<button hover-class="active" class="cu-btn key-btn text-black text-xl" @click.stop="keydown('0')">0</button>
</view>
<view class="btn-point">
<button hover-class="active" class="cu-btn key-btn text-black text-xl" @click.stop="keydown('.')">.</button>
</view>
</view>
</view>
<view class="key-right">
<view class="del">
<button hover-class="active" class="cu-btn key-btn text-black text-xl" @click.stop="del">
<text class="zm iconbackspace text-xl"></text>
</button>
</view>
<view class="confirm">
<button hover-class="active" :style="[confirmStyle]" class="cu-btn" @click.stop="confirm">
<text class="confirm-text">{{confirmText}}</text>
</button>
</view>
</view>
</view>
</view>
</uni-transition>
</view>
</template>
<script>
/**
* 付款组件
* @property {Number} duration - 弹出动画时长默认为300
* @event {Function} change - 数字改变触发参数为数字
* @event {Function} confirm - 付款时触发参数为数字
* @event {Function} hide - 关闭键盘触发参数为空
*/
// 使,exmple
import uniTransition from '../uni-transition/uni-transition.vue'
export default{
components:{
uniTransition
},
props:{
duration:{
type:Number,//
default:300
},
confirmText:{
type:String,
default:'付款'
},
confirmStyle:{
type:Object,
default:()=>{
return{
backgroundColor:'#57BE6D'
}
}
}
},
data(){
return{
value:'',//
show:false,//
showMask:false,//
numArr:[1,2,3,4,5,6,7,8,9]
}
},
watch:{
value(newval,oldval){
this.$emit("change",newval);
}
},
methods:{
close(){
this.show = false;
setTimeout(()=>{
this.showMask = false;
},this.duration)
},
open(){
this.value = '';
this.show = true;
this.showMask = true;
},
del(){
if(this.value.length){
this.value = this.value.slice(0,this.value.length-1);
}
},
keydown(e){
switch(e){
case '.':
//
if(!this.value.length){
this.value = '0.';
}else{
if(this.value.indexOf('.')>-1){
//
}else{
this.value = this.value+''+e;
}
}
break;
case '0':
if(this.value.length === 0){
this.value = this.value+''+e;
}
if(Number(this.value) === 0 && this.value.indexOf('.')== -1){
// value
}else{
this.value = this.value+''+e;
}
break;
default:
this.value = this.value+''+e;
break;
}
},
hide(){
this.$emit('hide');
this.close();
},
confirm(){
this.$emit('confirm',this.value);
this.close();
}
}
}
</script>
<style lang="scss" scoped>
@font-face {
font-family: 'zm'; /* project id 2442084 */
src: url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.eot');
src: url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.woff') format('woff'),
url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.ttf') format('truetype'),
url('https://at.alicdn.com/t/font_2442084_o72ps3802ih.svg#zm') format('svg');
}
.zm {
font-family: "zm" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.iconbackspace:before {
content: "\ef11";
}
.flex{
display: flex;
}
.flex-wrap{
flex-wrap: wrap;
}
.cu-btn {
position: relative;
border: 0rpx;
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0 30rpx;
font-size: 28rpx;
height: 64rpx;
line-height: 1;
text-align: center;
text-decoration: none;
overflow: visible;
margin-left: initial;
transform: translate(0rpx, 0rpx);
margin-right: initial;
}
.cu-btn::after {
display: none;
}
.text-xl{
font-size:36rpx;
font-weight: bold;
font-family: 'microsoft-yahei';
}
.text-black{
color:#333;
}
.active{
background-color: #ddd !important;
transform: translate(2rpx,2rpx);
}
.key-container{
position: fixed;
bottom: 0;
top:0;
left:0;
right:0;
.key-content{
position: absolute;
bottom: 0;
width: 100vw;
background-color: #F7F7F7;
}
}
.key-box{
width: 100%;
box-sizing: border-box;
padding:10rpx 10rpx 0;
.key-left{
width: 75%;
}
.key-right{
width: 25%;
display: flex;
flex-direction: column;
}
.key-bottom{
width: 100%;
display: flex;
}
}
.del{
width: 100%;
}
.btn-box{
width: 33.33%;
padding:0 10rpx 10rpx 0;
box-sizing: border-box;
}
.btn-zero{
width: 66.66%;
padding:0 10rpx 10rpx 0;
box-sizing: border-box;
}
.btn-point{
width: 33.33%;
padding:0 10rpx 10rpx 0;
box-sizing: border-box;
}
.key-right{
flex-shrink: 0;
}
.key-btn{
background-color: #fff;
width: 100%;
height: 90rpx;
}
.confirm{
width: 100%;
flex:1;
padding: 10rpx 0 10rpx 0;
box-sizing: border-box;
button{
width: 100%;
height: 100%;
.confirm-text{
color:#fff;
display: block;
font-size: 32rpx;
}
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<view class="container">
<button type="default" @click="open">打开键盘</button>
{{value}}
<cu-keyboard ref="cukeyboard" @change="change" @confirm="confirm" @hide="hide"></cu-keyboard>
</view>
</template>
<script>
export default {
data() {
return {
value:''
}
},
mounted() {
},
methods: {
change(e){
this.value = e;
console.log("数字改变",e);
},
open(){
console.log("打开键盘");
this.$refs.cukeyboard.open();
},
confirm(e){
console.log("付款",e);
},
hide(){
console.log("关闭键盘")
}
}
}
</script>
<style>
</style>

View File

@ -1,6 +1,6 @@
.foot-fixed {
position: fixed;
bottom: -1px;
bottom: -10px;
left: 0;
right: 0;
z-index: 999;
@ -8,6 +8,7 @@
background: #ffffff;
border-top: 1px solid #E8E8E8;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
/* height: 8%; */
}
.foot-fixed .foot-item {

View File

@ -67,7 +67,7 @@ export default {
photoAc:
"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/footer_facilityAc.png",
nav_name: "智能设备",
url: "",
url: "/packages/smartDevice/index/index",
},
{
photo:
@ -161,6 +161,25 @@ export default {
jump(e) {
const url = e.currentTarget.dataset.url;
const index = e.currentTarget.dataset.idx;
const item = this.navList[index];
//
if (item.isScan) {
// uni-appAPI
uni.scanCode({
success: (res) => {
//
console.log('扫码结果:', res.result);
//
},
fail: (err) => {
console.log('扫码失败:', err);
}
});
return;
}
// url
if (!url || url.trim() === '') {
this.NotOpen();

View File

@ -39,23 +39,26 @@
this.address = uni.getStorageSync('city');
return;
}
uni.request({
url: apiArr.get_host_info,
method: 'post',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
dataType: 'json',
success: (result) => {
console.log(result, 'result');
let wxapp = result.data.all.wxapp;
this.qqmap_key = '55NBZ-MUQYW-EAJRL-YIWPA-ZXCR6-4NBPP';
this.getUserLocation()
if (wxapp) {
this.qqmap_key = wxapp.qqmap_key;
this.getUserLocation()
}
},
})
// uni.request({
// url: apiArr.get_host_info,
// method: 'post',
// header: {
// 'Content-type': 'application/x-www-form-urlencoded'
// },
// dataType: 'json',
// success: (result) => {
// console.log(result, 'result');
// let wxapp = result.data.all.wxapp;
// if (wxapp) {
// this.qqmap_key = wxapp.qqmap_key;
// this.getUserLocation()
// }
// },
// })
},
getUserLocation() {

View File

@ -0,0 +1,279 @@
<template>
<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject"
@click="change">
<slot></slot>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
/**
* Transition 过渡动画
* @description 简单过渡动画组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
* @value fade 渐隐渐出过渡
* @value slide-top 由上至下过渡
* @value slide-right 由右至左过渡
* @value slide-bottom 由下至上过渡
* @value slide-left 由左至右过渡
* @value zoom-in 由小到大过渡
* @value zoom-out 由大到小过渡
* @property {Number} duration 过渡动画持续时间
* @property {Object} styles 组件样式 css 样式注意带-连接符的属性需要使用小驼峰写法如`backgroundColor:red`
*/
export default {
name: 'uniTransition',
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: Array,
default () {
return []
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default () {
return {}
}
}
},
data() {
return {
isShow: false,
transform: '',
ani: { in: '',
active: ''
}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open()
} else {
this.close()
}
},
immediate: true
}
},
computed: {
stylesObject() {
let styles = {
...this.styles,
'transition-duration': this.duration / 1000 + 's'
}
let transfrom = ''
for (let i in styles) {
let line = this.toLine(i)
transfrom += line + ':' + styles[i] + ';'
}
return transfrom
}
},
created() {
// this.timer = null
// this.nextTick = (time = 50) => new Promise(resolve => {
// clearTimeout(this.timer)
// this.timer = setTimeout(resolve, time)
// return this.timer
// });
},
methods: {
change() {
this.$emit('click', {
detail: this.isShow
})
},
open() {
clearTimeout(this.timer)
this.isShow = true
this.transform = ''
this.ani.in = ''
for (let i in this.getTranfrom(false)) {
if (i === 'opacity') {
this.ani.in = 'fade-in'
} else {
this.transform += `${this.getTranfrom(false)[i]} `
}
}
this.$nextTick(() => {
setTimeout(() => {
this._animation(true)
}, 50)
})
},
close(type) {
clearTimeout(this.timer)
this._animation(false)
},
_animation(type) {
let styles = this.getTranfrom(type)
// #ifdef APP-NVUE
if(!this.$refs['ani']) return
animation.transition(this.$refs['ani'].ref, {
styles,
duration: this.duration, //ms
timingFunction: 'ease',
needLayout: false,
delay: 0 //ms
}, () => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
})
// #endif
// #ifndef APP-NVUE
this.transform = ''
for (let i in styles) {
if (i === 'opacity') {
this.ani.in = `fade-${type?'out':'in'}`
} else {
this.transform += `${styles[i]} `
}
}
this.timer = setTimeout(() => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
}, this.duration)
// #endif
},
getTranfrom(type) {
let styles = {
transform: ''
}
this.modeClass.forEach((mode) => {
switch (mode) {
case 'fade':
styles.opacity = type ? 1 : 0
break;
case 'slide-top':
styles.transform += `translateY(${type?'0':'-100%'}) `
break;
case 'slide-right':
styles.transform += `translateX(${type?'0':'100%'}) `
break;
case 'slide-bottom':
styles.transform += `translateY(${type?'0':'100%'}) `
break;
case 'slide-left':
styles.transform += `translateX(${type?'0':'-100%'}) `
break;
case 'zoom-in':
styles.transform += `scale(${type?1:0.8}) `
break;
case 'zoom-out':
styles.transform += `scale(${type?1:1.2}) `
break;
}
})
return styles
},
_modeClassArr(type) {
let mode = this.modeClass
if (typeof(mode) !== "string") {
let modestr = ''
mode.forEach((item) => {
modestr += (item + '-' + type + ',')
})
return modestr.substr(0, modestr.length - 1)
} else {
return mode + '-' + type
}
},
// getEl(el) {
// console.log(el || el.ref || null);
// return el || el.ref || null
// },
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
}
</script>
<style>
.uni-transition {
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: transform, opacity;
}
.fade-in {
opacity: 0;
}
.fade-active {
opacity: 1;
}
.slide-top-in {
/* transition-property: transform, opacity; */
transform: translateY(-100%);
}
.slide-top-active {
transform: translateY(0);
/* opacity: 1; */
}
.slide-right-in {
transform: translateX(100%);
}
.slide-right-active {
transform: translateX(0);
}
.slide-bottom-in {
transform: translateY(100%);
}
.slide-bottom-active {
transform: translateY(0);
}
.slide-left-in {
transform: translateX(-100%);
}
.slide-left-active {
transform: translateX(0);
opacity: 1;
}
.zoom-in-in {
transform: scale(0.8);
}
.zoom-out-active {
transform: scale(1);
}
.zoom-out-in {
transform: scale(1.2);
}
</style>

11
i18n/base.json Normal file
View File

@ -0,0 +1,11 @@
{
"ios": {
"name": "石榴九九"
},
"android": {
"name": "石榴九九"
},
"common": {
"name": "石榴九九"
}
}

View File

@ -57,7 +57,7 @@
},
"oauth" : {
"weixin" : {
"appid" : "wxb4018c78fa143450",
"appid" : "wx1addb25675dd8e70",
"UniversalLinks" : ""
}
}
@ -68,7 +68,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxb4018c78fa143450",
"appid" : "wx1addb25675dd8e70",
"setting" : {
"urlCheck" : false
},

1406
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,19 @@
{
"devDependencies": {
"sass-loader": "^16.0.5"
},
"dependencies": {
"sass": "^1.89.2",
"uview-ui": "^2.0.38"
}
}
"id": "cu-keyboard",
"name": "支付键盘、数字键盘、付款键盘、密码键盘",
"displayName": "支付键盘、数字键盘、付款键盘、密码键盘",
"version": "1.0.1",
"description": "仿微信支付付款键盘,多端通用,简易方便",
"keywords": [
"数字键盘",
"支付键盘",
"付款键盘",
"密码键盘"
],
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}

View File

@ -201,7 +201,7 @@ export default {
? this.city.ad_code
: uni.getStorageSync("ad_code"),
page_num: this.page_num,
page_size: this.page_size,
page_size: 9999,
}).then((res) => {
console.log(res.rows);
this.communityList = res.rows;

View File

@ -1,6 +1,7 @@
page {
background-color: #ffffff;
padding: 0;
padding-bottom: 120rpx;
}
.empty {
@ -106,6 +107,18 @@ image {
position: relative;
}
.swiperBox_no1 {
height: 300rpx;
width: 710rpx;
position: relative;
margin-top: 170rpx;
margin: 170rpx auto 0;
}
.swiperBox_no_img{
border-radius: 15rpx;
}
.swiperBox1 swiper {
height: 100%;
}
@ -154,6 +167,12 @@ image {
margin-top: -96rpx;
}
.swiperBox_no2 {
height: 150rpx;
width: 710rpx;
margin: 0 auto;;
}
.funcList {
display: flex;
align-items: center;
@ -226,7 +245,7 @@ image {
}
.newsList {
margin-bottom: 100rpx;
margin-bottom: 30rpx;
}
.newsItem {
@ -270,7 +289,7 @@ image {
color: #999999;
text-align: center;
background-color: #f6f6fa;
padding: 40rpx;
/* padding: 40rpx; */
}
.bigAds {

View File

@ -1,21 +1,59 @@
<template>
<div class="container">
<div class="empty" v-if="communityList.length == 0">
<view class="container">
<!-- <view class="empty" v-if="communityList.length == 0">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_newEmpty.png" alt="" />
<text>当前账户未绑定任何项目房源信息</text>
<button class="emptyBtn" @click="addCommunity">新增房产绑定</button>
<!-- <button class="emptyBtn2" @click="refresh">刷新</button> -->
</div>
<div v-else>
<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<div class="searchBox_add">
<div class="emptyCommunity" @click="addCommunity">
{{ communityVal }}
</div>
</div>
</div>
</view> -->
<div class="swiperBox1">
<view v-if="communityList.length == 0">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<view class="emptyCommunity" @click="addCommunity">
{{ communityVal }}
</view>
</view>
</view>
<view class="swiperBox_no1">
<swiper @animationfinish="swipers" autoplay circular>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community_no_image1.png" mode="aspectFill"
class="swiperBox_no_img" @click="addCommunity" />
</swiper>
<view class="dot">
<view :class="['dotItem', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
:key="index">
</view>
</view>
</view>
<view class="swiperBox_no2">
<swiper @animationfinish="swipers" autoplay circular>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community_no_image2.png" mode="aspectFill"
class="swiperBox_no_img" @click="addCommunity" />
</swiper>
</view>
<view class="funcList">
<u-grid :col="5" :border="false">
<u-grid-item v-for="(item, index) in noValFunctionList" @click="addCommunity" :key="index">
<image class="grid_Pic" :src="item.nav_icon" mode=""></image>
<text class="grid_Text">{{ item.nav_name }}</text>
</u-grid-item>
</u-grid>
</view>
</view>
<view v-else>
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<view class="emptyCommunity" @click="addCommunity">
{{ communityVal }}
</view>
</view>
</view>
<view class="swiperBox1">
<swiper @animationfinish="swipers" autoplay circular>
<swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)">
<image :src="item.ad_picture" mode="aspectFill" />
@ -27,15 +65,15 @@
:key="index">
</view>
</view>
</div>
</view>
<div class="swiperBox2">
<view class="swiperBox2">
<swiper @animationfinish="swipers" autoplay circular>
<swiper-item v-for="(item, index) in streamerList" :key="index" @click="headerServerClick(item)">
<image :src="item.ad_picture" mode="aspectFill" class="swiperBox2_img" />
</swiper-item>
</swiper>
</div>
</view>
<view class="funcList">
<u-grid :col="rowNum" :border="false">
@ -46,66 +84,66 @@
</u-grid>
</view>
<div v-for="(item, index) in tileList" :key="index" :class="['ads', index == 0 ? 'ads_first' : '']"
<view v-for="(item, index) in tileList" :key="index" :class="['ads', index == 0 ? 'ads_first' : '']"
@click="headerServerClick(item)">
<image :src="item.ad_picture" mode="aspectFill" />
</div>
</view>
<div class="tabs">
<div v-for="(item, index) in categoryList" :key="index"
<view class="tabs" v-if="categoryList.length > 0">
<view v-for="(item, index) in categoryList" :key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</div>
</div>
</view>
</view>
<div class="newsList">
<div class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
<div class="newsItem_left">
<div class="newsItem_left_tit">{{ item.title }}</div>
<div class="newsItem_left_sub">{{ item.author }}</div>
</div>
<div class="newsItem_right">
<view class="newsList" v-if="categoryList.length > 0">
<view class="newsItem" v-for="item in infoList" @click="detail(item)" :key="item.id">
<view class="newsItem_left">
<view class="newsItem_left_tit">{{ item.title }}</view>
<view class="newsItem_left_sub">{{ item.author }}</view>
</view>
<view class="newsItem_right">
<image :src="item.list_image" mode="aspectFill" />
</div>
</div>
</div>
</view>
</view>
</view>
<div class="tips">{{ loadMoreText }}</div>
<view class="tips">{{ loadMoreText }}</view>
<div class="bigAds" v-if="ads1Show">
<div class="bigAdsCon">
<div class="bigAdsCon_img">
<view class="bigAds" v-if="ads1Show">
<view class="bigAdsCon">
<view class="bigAdsCon_img">
<swiper @animationfinish="swipers" autoplay circular>
<swiper-item v-for="(item, index) in largePopList" :key="index" @click="headerServerClick(item)">
<image :src="item.ad_picture" mode="aspectFill" />
</swiper-item>
</swiper>
</div>
<div class="close" @click="closeAds">
</view>
<view class="close" @click="closeAds">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png">
</image>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="bigAds" v-if="ads2Show">
<div class="bigAdsCon2">
<div class="bigAdsCon2_img">
<view class="bigAds" v-if="ads2Show">
<view class="bigAdsCon2">
<view class="bigAdsCon2_img">
<swiper :current="currentSwiperIndex" @change="onSwiperChange" @animationfinish="swipers" autoplay circular>
<swiper-item v-for="(item, index) in popList" :key="index">
<image :src="item.ad_picture" mode="aspectFill" />
</swiper-item>
</swiper>
</div>
<div class="AdsBtnList">
<div class="AdsBtnItem1" @click="closeAds2">取消</div>
<div class="AdsBtnItem2" @click="onDetailClick">了解详情</div>
</div>
</div>
</div>
</div>
</view>
<view class="AdsBtnList">
<view class="AdsBtnItem1" @click="closeAds2">取消</view>
<view class="AdsBtnItem2" @click="onDetailClick">了解详情</view>
</view>
</view>
</view>
</view>
<nav-footer :current="3" />
</div>
</view>
</template>
<script>
@ -134,7 +172,50 @@ export default {
communityList: [],
flag: false,
defaultFunctionList: [],
functionList: [],
noValFunctionList: [
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction1.png',
nav_name: "物业介绍",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction2.png',
nav_name: "物业缴费",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction3.png',
nav_name: "物业公积金",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction1.png',
nav_name: "物业保修",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction4.png',
nav_name: "便民电话",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction5.png',
nav_name: "人脸门禁",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction6.png',
nav_name: "手机开门",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction7.png',
nav_name: "物业活动",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction8.png',
nav_name: "访客邀请",
},
{
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction10.png',
nav_name: "场地预约",
},
],
ads1Show: false,
ads2Show: false,
@ -164,59 +245,72 @@ export default {
};
},
async onLoad(options) {
//
if (options.item) {
this.checkComm(JSON.parse(options.item));
}
},
onHide() {
uni.removeStorageSync("is_me");
},
onUnload() {
uni.removeStorageSync("is_me");
},
async onShow() {
//
// if (!uni.getStorageSync("changeCommData")) {
// return;
// }
await request(apiArr2.commInfo, "POST", {
user_id: uni.getStorageSync("userId"),
longitude: uni.getStorageSync("location").lng,
latitude: uni.getStorageSync("location").lat,
page_num: this.page_num,
page_size: this.page_size,
}).then((res) => {
if (res.rows.length == 0) {
uni.removeStorageSync("changeCommData");
return;
}
const targetItem = res.rows.find((item) => {
return item.community_id == uni.getStorageSync("changeCommData").id;
});
if (targetItem) {
//
this.isShowBill = targetItem.bill_front_end_display == 1;
//
if (targetItem.front_end_display == 1) {
uni.removeStorageSync("changeCommData");
}
}
res.rows = res.rows.filter((item) => {
return item.front_end_display != 1;
});
console.log("🚀 ~ onLoad ~ res.rows:", res.rows)
if (!uni.getStorageSync("changeCommData")) {
uni.setStorageSync("changeCommData", { name: res.rows[0].name, id: res.rows[0].community_id })
uni.setStorageSync("isShowNav", res.rows[0].room_owner_list[0].type)
}
this.communityList = res.rows;
});
const meun = menuButtonInfo();
this.top = meun.top;
// this.top = meun.height + meun.top;
this.localHeight = meun.height;
// this.getCommunityList()
if (this.communityList.length == 0) {
this.communityVal = "添加我的房产";
} else {
console.log("🚀 ~ onLoad ~ this.communityList:", this.communityList)
this.communityVal = uni.getStorageSync("changeCommData").name;
this.defaultFunctionList = [
{
create_time: "",
id: 4,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/repairList/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1b1lyxawt8cnke.png",
nav_name: "报事报修",
other_appid: "",
other_path: "",
sort: 5,
update_time: "",
visible_communities: ""
},
{
create_time: "",
id: 5,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/propertyPayment/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1t7d1k0qmuha61.png",
nav_name: "物业缴费",
other_appid: "",
other_path: "",
sort: 4,
update_time: "",
visible_communities: "",
},
{
create_time: "",
id: 7,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/providentFund/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s29e33rd7rsrecf.png",
nav_name: "物业公积金",
other_appid: "",
other_path: "",
sort: 2,
update_time: "",
visible_communities: ""
}
]
const isMe = uni.getStorageSync("is_me");
// is_metruefalse
if (isMe === true || isMe === undefined || isMe === null || isMe === '') {
await this.getCommunityList();
}
this.getfunctionNum();
this.getAdvertising();
@ -256,14 +350,68 @@ export default {
// desc() {
// NavgateTo("../communityDetail/index")
// },
checkComm(item) {
if (uni.getStorageSync("is_me")) {
uni.setStorageSync("changeCommData", { name: item.name, id: item.community_id })
} else {
this.communityList = []
this.communityVal = item.name;
}
},
async getCommunityList() {
await request(apiArr2.commInfo, "POST", {
user_id: uni.getStorageSync("userId"),
longitude: uni.getStorageSync("location").lng,
latitude: uni.getStorageSync("location").lat,
page_num: this.page_num,
page_size: this.page_size,
}).then((res) => {
if (res.rows.length == 0) {
uni.removeStorageSync("changeCommData");
return;
}
const targetItem = res.rows.find((item) => {
return item.community_id == uni.getStorageSync("changeCommData").id;
});
if (targetItem) {
//
this.isShowBill = targetItem.bill_front_end_display == 1;
//
if (targetItem.front_end_display == 1) {
uni.removeStorageSync("changeCommData");
}
}else{
uni.removeStorageSync("changeCommData");
}
res.rows = res.rows.filter((item) => {
return item.front_end_display != 1;
});
if (!uni.getStorageSync("changeCommData")) {
uni.setStorageSync("changeCommData", { name: res.rows[0].name, id: res.rows[0].community_id })
}
this.communityList = res.rows;
});
if (this.communityList.length == 0) {
this.communityVal = "添加我的房产";
} else {
this.communityVal = uni.getStorageSync("changeCommData").name;
}
},
apply() {
NavgateTo("../applyOwer/index");
},
closeAds() {
this.ads1Show = false;
// 1
uni.setStorageSync('ads1Showed', true);
},
closeAds2() {
this.ads2Show = false;
// 2
uni.setStorageSync('ads2Showed', true);
},
jump(e) {
if (!e) {
@ -293,6 +441,7 @@ export default {
},
async getfunctionNum() {
this.functionList = this.defaultFunctionList;
const res = await request(
apiArr.commInfo,
"POST",
@ -318,16 +467,24 @@ export default {
console.log(res, "xx");
// rowNum colNum
const totalItems = this.rowNum * this.colNum;
// 使 slice totalItems
this.functionList = res.rows.slice(0, totalItems).map((item) => {
const totalItems = this.rowNum * this.colNum - 3;
// totalItems
const newItems = res.rows.slice(0, totalItems).map((item) => {
return {
...item,
nav_icon: picUrl + item.nav_icon,
};
});
console.log("functionList", this.functionList);
// nav_name
newItems.forEach(newItem => {
const exists = this.functionList.some(existingItem =>
existingItem.nav_name === newItem.nav_name
);
if (!exists) {
this.functionList.push(newItem);
}
});
},
async getAdvertising() {
@ -385,7 +542,9 @@ export default {
ad_picture: picUrl + item.ad_picture,
};
});
this.ads1Show = res4.rows.length !== 0 ? true : false;
// 1广
const ads1Showed = uni.getStorageSync('ads1Showed');
this.ads1Show = !ads1Showed && res4.rows.length !== 0 ? true : false;
const res5 = await request(apiArr.advPage, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id),
@ -399,7 +558,9 @@ export default {
ad_picture: picUrl + item.ad_picture,
};
});
this.ads2Show = res5.rows.length !== 0 ? true : false;
// 2广
const ads2Showed = uni.getStorageSync('ads2Showed');
this.ads2Show = !ads2Showed && res5.rows.length !== 0 ? true : false;
},
headerServerClick(e) {
@ -521,7 +682,7 @@ export default {
const res = await request(apiArr.infoPage, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id),
announcement_category_id: item.id,
announcement_category_id: item?.id,
title: "",
category_name: "",
page_num: this.page_num,

View File

@ -1,67 +1,41 @@
* {
margin: 0;
padding: 0;
}
page {
background-color: #f6f7fb;
}
.community-list-container {
padding: 20rpx;
min-height: 100vh;
}
.search-bar {
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.search-input {
display: flex;
align-items: center;
background-color: #f0f0f0;
border-radius: 50rpx;
padding: 15rpx 20rpx;
}
.search-icon {
width: 40rpx;
height: 40rpx;
font-family: 'iconfont';
color: #999;
margin-right: 15rpx;
font-size: 30rpx;
}
.search-input input {
flex: 1;
font-size: 28rpx;
color: #333;
background-color: transparent;
}
.community-list {
border-radius: 10rpx;
overflow: hidden;
width: 100%;
}
.community-item-box {
background-color: #fff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
align-items: flex-start;
}
.community-item {
padding: 20rpx;
display: flex;
margin-bottom: 15rpx;
background-color: #fff;
}
.community-item:last-child {
border-bottom: none;
}
.community-image {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
width: 200rpx;
height: 200rpx;
border-radius: 12rpx;
overflow: hidden;
margin-right: 20rpx;
flex-shrink: 0;
margin-right: 30rpx;
background-color: #f5f5f5;
}
.community-image image {
@ -70,62 +44,97 @@ page {
}
.community-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
min-height: 200rpx;
width: 100%;
position: relative;
}
.community-name {
font-size: 32rpx;
font-weight: bold;
font-size: 36rpx;
font-weight: 600;
color: #333;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 50rpx;
}
.community-address {
font-size: 26rpx;
.community-property {
font-size: 24rpx;
color: #666;
line-height: 40rpx;
margin-top: 10rpx;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.community-distance {
display: inline-block;
border: 1rpx solid #5ba6ec;
color: #5ba6ec;
font-size: 24rpx;
color: #999;
font-weight: bold;
padding: 5rpx 15rpx;
border-radius: 15rpx;
margin-top: 10rpx;
}
/* 适配不同屏幕尺寸 */
@media screen and (min-width: 768px) {
.community-list-container {
padding: 30rpx;
}
.community-buttons {
display: flex;
gap: 20rpx;
margin-top: 20rpx;
}
.community-item {
padding: 30rpx;
}
.community-action-btn {
display: flex;
align-items: center;
justify-content: center;
background-color: #f0f2f5;
border-radius: 24rpx;
padding: 8rpx 16rpx;
font-size: 24rpx;
color: #666;
}
.community-image {
width: 200rpx;
height: 200rpx;
}
.btn-icon {
margin-right: 6rpx;
font-size: 22rpx;
}
.community-name {
font-size: 36rpx;
}
.btn-text {
font-size: 24rpx;
margin-left: 5rpx;
}
.community-address {
font-size: 28rpx;
}
#local {
height: 30rpx;
width: 28.08rpx;
margin-right: 17rpx;
}
.community-distance {
font-size: 26rpx;
}
.community-address {
display: flex;
font-size: 28rpx;
color: #333;
font-weight: bold;
line-height: 36rpx;
margin-top: 30rpx;
}
.community-address-text {
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 26rpx;
}
.enter-btn {
width: 120rpx;
height: 40rpx;
background: #7bc327;
color: #fff;
font-size: 24rpx;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 5rpx;
right: 0rpx;
}

View File

@ -1,85 +1,389 @@
<template>
<view class="community-list-container">
<!-- <view class="search-bar">
<view class="search-input">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill" class="search-icon"></image>
<input type="text" placeholder="搜索社区" />
</view>
</view> -->
<view class="community-list">
<view class="community-item" v-for="(item, index) in communityList" :key="index">
<view class="community-image">
<image :src="item.image" mode="aspectFill"></image>
<view class="community-item-box" v-for="(item, index) in communityList" :key="index">
<view class="community-item">
<view class="community-image" @tap="enterCommunity(item)">
<!-- 使用默认图片作为 fallback -->
<image :src="item.pic || defaultCommunityImage" mode="aspectFill"
@error="handleImageError(item)"></image>
</view>
<view class="community-info">
<view class="community-name" @tap="enterCommunity(item)">{{ item.name }}</view>
<view class="community-property">物业公司{{ item.property || '-' }}</view>
<view class="community-distance">距我当前{{ item.distance || '未知' }}</view>
<view class="community-buttons">
<view class="community-action-btn" @tap="navigate(item)">
<uni-icons type="paperplane-filled" size="18"></uni-icons>
<text class="btn-text">导航</text>
</view>
<view class="community-action-btn" @tap="callPhone(item)" v-if="item.property_server_phone">
<uni-icons type="phone-filled" size="18"></uni-icons>
<view class="btn-text">电话</view>
</view>
</view>
<view v-if="item.isShow" class="enter-btn" @tap="enterCommunity(item)">进入小区</view>
</view>
</view>
<view class="community-info">
<view class="community-name">{{ item.name }}</view>
<view class="community-address">{{ item.address }}</view>
<view class="community-distance">{{ item.distance }}</view>
<view class="community-address">
<image id="local"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_localIcon.png"
mode="aspectFill"></image>
<view class="community-address-text">{{ item.addr }}</view>
</view>
</view>
</view>
<nav-footer :current="0" />
</view>
</template>
<script>
import {
request,
picUrl,
uniqueByField,
menuButtonInfo,
NavgateTo,
calculateDistance
} from "../../../utils";
import { apiArr } from "../../../api/community";
export default {
name: 'CommunityList',
data() {
return {
communityList: [
{
id: 1,
name: '凯旋城东区',
address: '衡水市,桃城-衡水市人民路与育才街交叉口西行100米路南',
distance: '0 m',
image: 'http://localhost:8080/test_community.png'
},
{
id: 2,
name: '岸芷庭蓝(一区)',
address: '衡水市,河阳西路与中华南大街交叉口东220米',
distance: '1000 m',
image: 'http://localhost:8080/test_community.png'
},
{
id: 3,
name: '滏阳锦苑',
address: '衡水市,滏阳苑',
distance: '2 km',
image: 'http://localhost:8080/test_community.png'
},
{
id: 4,
name: '隆兴小区',
address: '衡水市,河北省衡水市高新区隆兴西路隆兴小区',
distance: '5 km',
image: 'http://localhost:8080/test_community.png'
},
{
id: 5,
name: '紫金广场',
address: '衡水市,衡水市桃城区人民西路与庆丰南街交叉口',
distance: '894 km',
image: 'http://localhost:8080/test_community.png'
},
{
id: 6,
name: '万和瑞景',
address: '衡水市,政通街46号',
distance: '12249 km',
image: 'http://localhost:8080/test_community.png'
}
]
communityList: [], //
allCommunityList: [], //
currentPage: 1,
pageSize: 16,
hasMoreData: true,
isLoading: false,
tencentMapKey: '55NBZ-MUQYW-EAJRL-YIWPA-ZXCR6-4NBPP', // API Key
defaultCommunityImage: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community_no_image3.png' //
};
},
methods: {
async getCommunityList() {
//
if (this.isLoading) {
return;
}
//
uni.showLoading({
title: '加载中...'
});
this.isLoading = true;
try {
//
const locationData = await this.getUserLocation();
if (!locationData) {
throw new Error('无法获取用户位置');
}
const userLat = parseFloat(locationData.lat);
const userLng = parseFloat(locationData.lng);
//
const res = await request(apiArr.getAllList, "POST", {
page_num: 1,
page_size: 9999
});
if (res && res.rows) {
// 1km
let processedList = res.rows.map(item => {
//
if (item.pic) {
item.pic = picUrl + item.pic;
}
try {
//
if (userLat && userLng && item.lat && item.lng) {
const parkLat = parseFloat(item.lat);
const parkLng = parseFloat(item.lng);
// 使Haversine
const distance = calculateDistance(userLat, userLng, parkLat, parkLng);
item.distance = distance.toFixed(2) + 'km';
item.distanceValue = distance; //
}
} catch (error) {
console.error('计算距离失败:', error);
item.distanceValue = Infinity;
}
// isShow
item.isShow = true;
return item;
});
// 1km
processedList = processedList.filter(item =>
item.distanceValue && item.distanceValue <= 1
);
// API1km
const nearbyCommunities = await this.getNearbyCommunities(userLat, userLng);
// API
let mergedList = [...processedList];
if (nearbyCommunities && nearbyCommunities.length > 0) {
//
const tencentCommunities = nearbyCommunities.map(item => {
//
const distance = calculateDistance(userLat, userLng, item.lat, item.lng);
// POI
let communityImage = '';
if (item.photos && item.photos.length > 0) {
//
communityImage = item.photos[0].url;
}
return {
name: item.title,
addr: item.address,
lat: item.lat,
lng: item.lng,
distance: distance.toFixed(2) + 'km',
distanceValue: distance,
//
pic: communityImage || this.defaultCommunityImage, // 使
property: item.extension && item.extension.property_company ? item.extension.property_company : '-',
property_server_phone: item.tel || '',
community_id: `tencent_${item.id}` // ID
};
});
//
mergedList = [...processedList, ...tencentCommunities];
// community_id
mergedList = uniqueByField(mergedList, 'community_id');
}
//
mergedList.sort((a, b) => {
const distanceA = a.distanceValue || Infinity;
const distanceB = b.distanceValue || Infinity;
return distanceA - distanceB;
});
// allCommunityList
this.allCommunityList = mergedList;
this.currentPage = 1;
this.updateDisplayList();
}
} catch (error) {
console.error('获取社区列表失败:', error);
uni.showToast({
title: '获取数据失败',
icon: 'none',
duration: 1500
});
} finally {
this.isLoading = false;
//
uni.hideLoading();
}
},
//
getUserLocation() {
return new Promise((resolve, reject) => {
try {
let locationData = uni.getStorageSync('location');
if (locationData) {
// locationData
const location = typeof locationData === 'string' ? JSON.parse(locationData) : locationData;
if (location.lat && location.lng) {
resolve(location);
return;
}
}
} catch (error) {
console.error('从缓存获取位置失败:', error);
}
//
uni.getLocation({
type: 'gcj02',
altitude: true,
success: (res) => {
const location = {
lat: res.latitude,
lng: res.longitude
};
//
uni.setStorageSync('location', location);
resolve(location);
},
fail: (err) => {
console.error('获取位置失败:', err);
reject(err);
}
});
});
},
// API1km
async getNearbyCommunities(lat, lng) {
try {
const keyword = '小区';
const radius = 1000; // 1km
const pageSize = 20;
// 使uni.requestAPIextensions=all
return new Promise((resolve, reject) => {
uni.request({
url: 'https://apis.map.qq.com/ws/place/v1/search',
method: 'GET',
data: {
keyword: keyword,
boundary: `nearby(${lat},${lng},${radius})`,
key: this.tencentMapKey,
page_size: pageSize,
extensions: 'all' //
},
success: (res) => {
if (res.statusCode === 200 && res.data.status === 0) {
//
const results = res.data.data.map(item => ({
id: item.id,
title: item.title,
address: item.address,
lat: item.location.lat,
lng: item.location.lng,
tel: item.tel || '',
photos: item.photos || [], //
extension: item.extension || {}, //
isShow: false
}));
resolve(results);
} else {
console.error('腾讯地图API请求失败:', res.data);
resolve([]);
}
},
fail: (err) => {
console.error('腾讯地图API请求错误:', err);
resolve([]);
}
});
});
} catch (error) {
console.error('获取附近小区失败:', error);
return [];
}
},
// 使
handleImageError(item) {
item.pic = this.defaultCommunityImage;
},
//
updateDisplayList() {
const startIndex = 0;
const endIndex = this.currentPage * this.pageSize;
this.communityList = this.allCommunityList.slice(startIndex, endIndex);
this.hasMoreData = endIndex < this.allCommunityList.length;
},
navigate(item) {
//
if (item.lat && item.lng) {
//
const latitude = parseFloat(item.lat);
const longitude = parseFloat(item.lng);
if (!isNaN(latitude) && !isNaN(longitude)) {
uni.openLocation({
latitude: latitude,
longitude: longitude,
name: item.name || '未知小区',
address: item.addr || '',
scale: 18,
success: () => {
console.log('打开地图成功:', item.name);
},
fail: (error) => {
console.error('打开地图失败:', error);
}
});
} else {
uni.showToast({
title: '位置信息无效',
icon: 'none',
duration: 1500
});
}
} else {
uni.showToast({
title: '暂无位置信息',
icon: 'none',
duration: 1500
});
}
},
callPhone(item) {
if (item.property_server_phone) {
uni.makePhoneCall({
phoneNumber: item.property_server_phone,
success: () => {
},
fail: (error) => {
}
});
} else {
uni.showToast({
title: '暂无联系电话',
icon: 'none',
duration: 1500
});
}
},
enterCommunity(item) {
request(apiArr.checkComm, "POST", {
community_id: item.community_id,
user_id: uni.getStorageSync("userId"),
}).then((res) => {
uni.setStorageSync("is_me", res.is_me)
NavgateTo("/packages/community/index/index?item=" + JSON.stringify(item));
})
},
//
loadMore() {
if (this.hasMoreData && !this.isLoading) {
this.currentPage += 1;
this.updateDisplayList();
}
}
},
onLoad() {
this.getCommunityList();
},
//
onReachBottom() {
this.loadMore();
},
//
onPullDownRefresh() {
this.currentPage = 1;
this.hasMoreData = true;
this.getCommunityList().then(() => {
uni.stopPullDownRefresh();
});
}
};
</script>
<style>
@import url("./index.css");
</style>
</style>

View File

@ -1,6 +1,40 @@
page {
background-color: #f6f7fb;
background-color: #ffffff;
padding: 0;
overflow-y: hidden;
}
.searchBox {
padding-bottom: 24rpx;
background-color: #fff;
margin-top: 105rpx;
}
.searchBox_add {
height: 100%;
width: 100%;
display: flex;
}
.searchBox_left {
flex: 1;
display: flex;
align-items: center;
padding-left: 20rpx;
}
.searchBox_mid {
flex: 1;
font-size: 40rpx;
color: #222222;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.searchBox_right {
flex: 1;
}
.container {
@ -22,9 +56,22 @@ image {
margin-top: 180rpx;
}
.emptyTitle {
font-size: 36rpx;
color: #222222;
margin-top: 50rpx;
font-weight: bold;
}
.emptyMsg {
font-size: 28rpx;
color: #999999;
margin: 30rpx;
}
.empty image {
width: 340rpx;
height: 240rpx;
width: 500rpx;
height: 400rpx;
}
.addBtn {
@ -57,11 +104,13 @@ image {
border-bottom: 1rpx solid #EBEBEB;
padding: 30rpx 0;
}
.communityItem_left{
.communityItem_left {
display: flex;
align-items: center;
}
.communityItem_left_img {
width: 160rpx;
height: 140rpx;
@ -69,9 +118,11 @@ image {
overflow: hidden;
margin-right: 30rpx;
}
.communityItem_left_msg{
.communityItem_left_msg {
flex: 1;
}
.communityItem_left_msg_tit {
font-size: 30rpx;
color: #222222;
@ -86,7 +137,7 @@ image {
color: #999999;
}
.communityItem_right{
.communityItem_right {
width: 34rpx;
height: 34rpx;
margin-left: 80rpx;
@ -95,4 +146,4 @@ image {
/* 最后一个 communityItem */
.communityItem:last-child {
border-bottom: none;
}
}

View File

@ -1,35 +1,44 @@
<template>
<view class="container">
<!-- <view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<view class="searchBox_left">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</view>
<view class="searchBox_mid">我的房产</view>
<view class="searchBox_right"></view>
</view>
</view> -->
<view class="empty" v-if="communityList.length == 0">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_newEmpty.png"
alt="" />
没有添加任何房产
<view class="emptyTitle">绑定房源</view>
<view class="emptyMsg">请绑定房源信息 以便使用其他功能</view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community_no_image3.png" alt="" />
</view>
<div class="communityList">
<div class="communityItem" v-for="item in communityList" :key="item.community_id"
<view class="communityList">
<view class="communityItem" v-for="item in communityList" :key="item.community_id"
@click="choseCommunity(item)">
<div class="communityItem_left">
<div class="communityItem_left_img">
<view class="communityItem_left">
<view class="communityItem_left_img">
<image :src="item.pic" mode="aspectFill"></image>
</div>
<div class="communityItem_left_msg">
<div class="communityItem_left_msg_tit">{{ item.name }}<span> {{ item.room_owner_list.length }}
</span></div>
<div class="communityItem_left_msg_msg">{{ item.addr }}</div>
</div>
</div>
<div class="communityItem_right">
</view>
<view class="communityItem_left_msg">
<view class="communityItem_left_msg_tit">{{ item.name }}<span> {{ item.room_owner_list.length
}}
</span></view>
<view class="communityItem_left_msg_msg">{{ item.addr }}</view>
</view>
</view>
<view class="communityItem_right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
v-if="item.community_id != currentCommunity.id"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
v-if="item.community_id == currentCommunity.id"></image>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="addBtn" @click="addCommunity">添加我的房产</div>
<view class="addBtn" @click="addCommunity">去绑定房源</view>
</view>
</template>
@ -53,6 +62,9 @@ export default {
}
},
methods: {
back() {
NavgateTo("/packages/community/index/index")
},
addCommunity() {
NavgateTo("/packages/community/addCommunity/index")
},
@ -78,9 +90,7 @@ export default {
choseCommunity(e) {
this.currentCommunity = e
uni.setStorageSync('changeCommData', { id: e.community_id, name: e.name });
uni.setStorageSync('currentCommunityAddr',e.addr);
uni.setStorageSync("isShowNav", e.room_owner_list[0].type)
console.log("🚀 ~ choseCommunity ~ e.room_owner_list[0].type:", e.room_owner_list[0].type)
uni.setStorageSync('currentCommunityAddr', e.addr);
NavgateTo("1")
},
},

View File

@ -1,97 +1,97 @@
<template>
<div class="container">
<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<div class="searchBox_add">
<div class="searchBox_left">
<view class="container">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<view class="searchBox_left">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</div>
<div class="searchBox_mid">报修信息</div>
<div class="searchBox_right"></div>
</div>
</div>
</view>
<view class="searchBox_mid">报修信息</view>
<view class="searchBox_right"></view>
</view>
</view>
<div class="repairMsg">
<div class="repairTit">
<view class="repairMsg">
<view class="repairTit">
报修信息
</div>
</view>
<div class="label"><span class="red">*</span>选择房源信息</div>
<div class="roomList">
<div v-for="(item, index) in roomList" :key="index" :class="active == index ?'roomItem active':'roomItem'" @click="changeAct(index)">{{ item.name }}</div>
</div>
<view class="label"><span class="red">*</span>选择房源信息</view>
<view class="roomList">
<view v-for="(item, index) in roomList" :key="index" :class="active == index ?'roomItem active':'roomItem'" @click="changeAct(index)">{{ item.name }}</view>
</view>
<div class="row">
<div class="row_label"><span class="red">*</span>报修类型</div>
<div class="row_con" @click="chose">
<view class="row">
<view class="row_label"><span class="red">*</span>报修类型</view>
<view class="row_con" @click="chose">
<input type="text" :value="category.category_name" placeholder="请选择报修类型" disabled>
<u-icon bold color="#999999" size="30" name="arrow-right"></u-icon>
</div>
</div>
</view>
</view>
<div class="row">
<div class="row_label"><span class="red">*</span>问题描述</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span class="red">*</span>问题描述</view>
<view class="row_con">
<input type="text" placeholder="请描述故障" :value="repairInfo" data-name="repairInfo" @input="handlerInputClick">
</div>
</div>
</view>
</view>
<div class="row">
<div class="row_label"><span class="red">*</span>联系人</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span class="red">*</span>联系人</view>
<view class="row_con">
<input type="text" placeholder="请输入您的姓名" :value="contactName" data-name="contactName" @input="handlerInputClick">
</div>
</div>
</view>
</view>
<div class="row">
<div class="row_label"><span class="red">*</span>联系电话</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span class="red">*</span>联系电话</view>
<view class="row_con">
<input type="number" maxlength="11" placeholder="请输入您的联系方式" :value="contactPhone" data-name="contactPhone" @input="handlerInputClick">
</div>
</div>
</view>
</view>
<div class="row noneBorder">
<div class="row_label"><span class="red">*</span>上门时间</div>
<div class="row_con" @click="choseTime">
<view class="row noneBorder">
<view class="row_label"><span class="red">*</span>上门时间</view>
<view class="row_con" @click="choseTime">
<input type="text" :value="time" placeholder="请选择上门时间" disabled>
<u-icon bold color="#999999" size="30" name="arrow-right"></u-icon>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="repairMedia">
<div class="row df">
<div class="row_label">上传图片</div>
<div class="row_con2">
<view class="repairMedia">
<view class="row df">
<view class="row_label">上传图片</view>
<view class="row_con2">
<u-upload :fileList="imgList" name="imgList" @afterRead="afterReadImg" @delete="deletePic" multiple
:maxCount="5">
<div class="imgCon">
<view class="imgCon">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png" mode="widthFix"></image>
上传图片
</div>
</view>
</u-upload>
</div>
</div>
</view>
</view>
<div class="row df">
<div class="row_label">上传视频</div>
<div class="row_con2">
<view class="row df">
<view class="row_label">上传视频</view>
<view class="row_con2">
<u-upload v-if="!videoList.url" :fileList="videoList" @afterRead="afterReadVideo" @delete="deleteVideo" name="videoList"
:maxCount="1" accept="video">
<div class="imgCon">
<view class="imgCon">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_videoImg.png" mode="widthFix"></image>
上传视频
</div>
</view>
</u-upload>
<div v-if="videoList.url" class="videoBOX">
<view v-if="videoList.url" class="videoBOX">
<video id="myVideo" :src="videoList.url" playsinline webkit-playsinline></video>
<div class="mask" @click="playFullScreenVideo">
<div class="mask_cancel" @click="cancels">删除</div>
</div>
</div>
</div>
</div>
</div>
<view class="mask" @click="playFullScreenVideo">
<view class="mask_cancel" @click="cancels">删除</view>
</view>
</view>
</view>
</view>
</view>
<u-picker :show="show" :columns="[columns]" keyName="category_name" @confirm="confirm1" @cancel="cancel1" />
<u-datetime-picker
@ -105,9 +105,9 @@
@close="cancel2"
/>
<div class="btn" @click="handlerSubmitClick">确认报修</div>
<view class="btn" @click="handlerSubmitClick">确认报修</view>
</div>
</view>
</template>
<script>

View File

@ -213,7 +213,7 @@ image {
}
.payItem_money{
width: 150rpx;
width: auto;
}
.bottom {

View File

@ -1,319 +1,255 @@
<template>
<div class="container">
<div
class="searchBox"
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
>
<div class="searchBox_add">
<u-icon
bold
color="#000"
size="40"
name="arrow-left"
@click="back"
></u-icon>
</div>
</div>
<view class="container">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</view>
</view>
<div class="community">
<div class="community_left">
<image
mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/test.png"
alt=""
/>
</div>
<div class="community_right" @click="changeShow">
<div class="community_right_text">
<div class="community_right_text1">{{ currentRoom.name }}</div>
<div class="community_right_text2">{{ currentCommunityAddr }}</div>
</div>
<div class="community_right_more">
<view class="community">
<view class="community_left">
<image mode="aspectFill" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/test.png"
alt="" />
</view>
<view class="community_right" @click="changeShow">
<view class="community_right_text">
<view class="community_right_text1">{{ currentRoom.name }}</view>
<view class="community_right_text2">{{ currentCommunityAddr }}</view>
</view>
<view class="community_right_more">
<u-icon bold color="#999999" size="30" name="arrow-right"></u-icon>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="tabList">
<div
class="tabItem"
:class="active == 0 ? 'active' : ''"
@click="changeTab(0)"
>
<view class="tabList">
<view class="tabItem" :class="active == 0 ? 'active' : ''" @click="changeTab(0)">
账单
</div>
<div class="line"></div>
<div
class="tabItem"
:class="active == 1 ? 'active' : ''"
@click="changeTab(1)"
>
</view>
<view class="line"></view>
<view class="tabItem" :class="active == 1 ? 'active' : ''" @click="changeTab(1)">
缴费记录
</div>
</div>
</view>
</view>
<div class="homeMoney" v-if="active == 0">
<div class="homeMoney_box">
<div class="homeMoney_box_left">
<div class="homeMoney_box_left1">物业公积金</div>
<div class="homeMoney_box_left2">可抵扣账户金额</div>
</div>
<div class="homeMoney_box_right">
<div class="homeMoney_box_right1">
<view class="homeMoney" v-if="active == 0">
<view class="homeMoney_box">
<view class="homeMoney_box_left">
<view class="homeMoney_box_left1">物业公积金</view>
<view class="homeMoney_box_left2">可抵扣账户金额</view>
</view>
<view class="homeMoney_box_right">
<view class="homeMoney_box_right1">
<span></span>{{ balanceMoney }}
</div>
<div class="homeMoney_box_right2" @click="more(currentRoom)">
</view>
<view class="homeMoney_box_right2" @click="more(currentRoom)">
查看详情
<div style="margin-left: 12rpx">
<u-icon
bold
color="#894B11"
size="30"
name="arrow-right"
></u-icon>
</div>
</div>
</div>
</div>
</div>
<view style="margin-left: 12rpx">
<u-icon bold color="#894B11" size="30" name="arrow-right"></u-icon>
</view>
</view>
</view>
</view>
</view>
<div class="payList" v-if="active == 0">
<div class="payItem" v-for="(item, index) in Bill" :key="index">
<div class="payItem_tit">
<div class="payItem_left">
<checkbox
:checked="item.check"
@click="checkChange(item, index)"
></checkbox>
<div style="margin-left: 24rpx">{{ item.order_date }}</div>
</div>
<div class="payItem_right">
<view class="payList" v-if="active == 0">
<view class="payItem" v-for="(item, index) in Bill" :key="index">
<view class="payItem_tit">
<view class="payItem_left">
<checkbox :checked="item.check" @click="checkChange(item, index)"></checkbox>
<view style="margin-left: 24rpx">{{ item.order_date }}</view>
</view>
<view class="payItem_right">
<span></span>
<view class="payItem_money">{{ item.unpaid_amount }}</view>
<p>未缴</p>
<div style="margin-left: 40rpx" @click="changeCheck(item, index)">
<u-icon
bold
color="#894B11"
size="30"
name="arrow-down"
v-if="!item.more"
></u-icon>
<u-icon
bold
color="#894B11"
size="30"
name="arrow-up"
v-if="item.more"
></u-icon>
</div>
</div>
</div>
<div v-if="item.more">
<div
class="payItem_List"
v-for="(items, indes) in item.community_order_rows"
:key="items.order_id"
>
<checkbox
:checked="items.check"
@click="itemsCheckChange(items, indes, index)"
></checkbox>
<div class="Item_time" v-if="items.billing_cycle == 1">
<view style="margin-left: 40rpx" @click="changeCheck(item, index)">
<u-icon bold color="#894B11" size="30" name="arrow-down" v-if="!item.more"></u-icon>
<u-icon bold color="#894B11" size="30" name="arrow-up" v-if="item.more"></u-icon>
</view>
</view>
</view>
<view v-if="item.more">
<view class="payItem_List" v-for="(items, indes) in item.community_order_rows" :key="items.order_id">
<checkbox :checked="items.check" @click="itemsCheckChange(items, indes, index)"></checkbox>
<view class="Item_time" v-if="items.billing_cycle == 1">
{{ items.order_date }}
</div>
<div class="Item_time" v-if="items.billing_cycle == 2">
</view>
<view class="Item_time" v-if="items.billing_cycle == 2">
{{ items.order_datetime }}
</div>
<div class="Item_type">
</view>
<view class="Item_type">
{{ items.community_fee_type ? items.community_fee_type.type_name : '' }}
</div>
<div class="Item_money">{{ items.money }}</div>
<div class="Item_status" v-if="items.status == 0">未付款</div>
<div class="Item_status sucess" v-if="items.status == 1">
</view>
<view class="Item_money">{{ items.money }}</view>
<view class="Item_status" v-if="items.status == 0">未付款</view>
<view class="Item_status sucess" v-if="items.status == 1">
已付款
</div>
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
</view>
<!-- 选择支付类型 -->
<div class="payTypeList" v-if="active == 0">
<div class="PayTypeItem">
<div class="PayTypeItem_left">
<div class="PayTypeItem_img">
<image
mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
alt=""
/>
</div>
<div class="PayTypeItem_con">
<div class="PayTypeItem_con_tit">微信支付</div>
<div class="PayTypeItem_con_msg">单笔支付限额10000.00</div>
</div>
</div>
<view class="payTypeList" v-if="active == 0">
<view class="PayTypeItem">
<view class="PayTypeItem_left">
<view class="PayTypeItem_img">
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png" alt="" />
</view>
<view class="PayTypeItem_con">
<view class="PayTypeItem_con_tit">微信支付</view>
<view class="PayTypeItem_con_msg">单笔支付限额10000.00</view>
</view>
</view>
<div class="PayTypeItem_right">
<view class="PayTypeItem_right">
<radio :checked="payType == 1" @click="changePayType(1)"></radio>
</div>
</div>
<div class="line3"></div>
<div class="PayTypeItem">
<div class="PayTypeItem_left">
<div class="PayTypeItem_img">
<image
mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png"
alt=""
/>
</div>
<div class="PayTypeItem_con">
<div class="PayTypeItem_con_tit">物业公积金支付</div>
<div class="PayTypeItem_con_msg">
</view>
</view>
<view class="line3"></view>
<view class="PayTypeItem">
<view class="PayTypeItem_left">
<view class="PayTypeItem_img">
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png" alt="" />
</view>
<view class="PayTypeItem_con">
<view class="PayTypeItem_con_tit">物业公积金支付</view>
<view class="PayTypeItem_con_msg">
可用公积金<span></span>{{ balanceMoney }}
<div class="PayTypeItem_con_msg2" @click="changeShow2">
<view class="PayTypeItem_con_msg2" @click="changeShow2">
可组合支付
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
<div class="PayTypeItem_right">
<view class="PayTypeItem_right">
<radio :checked="payType == 2" @click="changePayType(2)"></radio>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="bottom" v-if="active == 0">
<div class="bottom_left">
<view class="bottom" v-if="active == 0">
<view class="bottom_left">
<span>合计</span>
<p></p>
{{ currentMoney }}
</div>
<div class="bottom_right" @click="OrderPay">立即支付</div>
</div>
</view>
<view class="bottom_right" @click="createPay">立即支付</view>
</view>
<div class="payHisList" v-if="active == 1">
<div class="payHisItem" v-for="item in payOrderList" :key="item.id">
<div class="row">
<div class="row_label">缴费金额</div>
<div class="row_con1">{{ item.money }}</div>
</div>
<div class="row">
<div class="row_label2"></div>
<div class="row_con2">{{ item.pay_time }}支付</div>
</div>
<div class="line4"></div>
<div class="row">
<div class="row_label">绑定房源</div>
<div class="row_con3">
<div class="row_con3_1">
<view class="payHisList" v-if="active == 1">
<view class="payHisItem" v-for="item in payOrderList" :key="item.id">
<view class="row">
<view class="row_label">缴费金额</view>
<view class="row_con1">{{ item.money }}</view>
</view>
<view class="row">
<view class="row_label2"></view>
<view class="row_con2">{{ item.pay_time }}支付</view>
</view>
<view class="line4"></view>
<view class="row">
<view class="row_label">绑定房源</view>
<view class="row_con3">
<view class="row_con3_1">
{{ item.community_order.length }}个账单
</div>
<div class="row_con3_2">明细可从收据查看</div>
</div>
</div>
</view>
<view class="row_con3_2">明细可从收据查看</view>
</view>
</view>
<div class="row">
<div class="row_label">应缴费金额</div>
<div class="row_con4">{{ item.money }}</div>
</div>
<view class="row">
<view class="row_label">应缴费金额</view>
<view class="row_con4">{{ item.money }}</view>
</view>
<div class="row">
<div class="row_label">物业费公积金抵扣金额</div>
<div class="row_con4">-{{ item.reduction_money }}</div>
</div>
<view class="row">
<view class="row_label">物业费公积金抵扣金额</view>
<view class="row_con4">-{{ item.reduction_money }}</view>
</view>
<div class="row">
<div class="row_label">缴费单号</div>
<div class="row_con4">{{ item.order_pay_no }}</div>
</div>
<div class="line4"></div>
<div class="Receipt">收据</div>
</div>
</div>
<view class="row">
<view class="row_label">缴费单号</view>
<view class="row_con4">{{ item.order_pay_no }}</view>
</view>
<view class="line4"></view>
<view class="Receipt">收据</view>
</view>
</view>
<div class="boxshadow" v-if="show" @click="changeShow">
<div class="boxshadowCon">
<div class="boxshadowCon_Tit">
<view class="boxshadow" v-if="show" @click="changeShow">
<view class="boxshadowCon">
<view class="boxshadowCon_Tit">
选择房源
<div class="cancel" @click.stop="show = false">取消</div>
</div>
<div class="lines"></div>
<div class="communityList" v-if="roomList.length > 0">
<div
class="communityItem"
v-for="item in roomList"
:key="item.room_id"
@click="selectRoom(item)"
>
<div class="communityItem_text">
<view class="cancel" @click.stop="show = false">取消</view>
</view>
<view class="lines"></view>
<view class="communityList" v-if="roomList.length > 0">
<view class="communityItem" v-for="item in roomList" :key="item.room_id" @click="selectRoom(item)">
<view class="communityItem_text">
{{ item.facility_name }}{{ item.floor }} {{ item.number }}
</div>
<div class="communityItem_radio">
</view>
<view class="communityItem_radio">
<radio :checked="selectedRoomId === item.room_id"></radio>
</div>
</div>
</div>
<div class="communityList" v-else>
<div class="communityItem">
<div class="communityItem_text">暂无房源</div>
</div>
</div>
</div>
</div>
</view>
</view>
</view>
<view class="communityList" v-else>
<view class="communityItem">
<view class="communityItem_text">暂无房源</view>
</view>
</view>
</view>
</view>
<div class="boxshadow" v-if="show2" @click="changeShow2">
<div class="boxshadowCon">
<div class="boxshadowCon_Tit">
<view class="boxshadow" v-if="show2" @click="changeShow2">
<view class="boxshadowCon">
<view class="boxshadowCon_Tit">
付款总金额
<div class="cancel" @click.stop="show2 = false">取消</div>
</div>
<div class="boxshadowCon_subTit">
<view class="cancel" @click.stop="show2 = false">取消</view>
</view>
<view class="boxshadowCon_subTit">
<p></p>
{{ currentMoney }}
</div>
<div class="lines"></div>
</view>
<view class="lines"></view>
<div class="BanlenceList">
<div class="banlenceItem">
<div class="banlenceItem_left">
<image
mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
alt=""
/>
<view class="BanlenceList">
<view class="banlenceItem">
<view class="banlenceItem_left">
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png" alt="" />
微信支付
</div>
<div class="banlenceItem_right">
</view>
<view class="banlenceItem_right">
<span></span>{{ (currentMoney - balanceMoney).toFixed(2) }}
</div>
</div>
<div class="line3"></div>
<div class="banlenceItem">
<div class="banlenceItem_left">
<image
mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png"
alt=""
/>
</view>
</view>
<view class="line3"></view>
<view class="banlenceItem">
<view class="banlenceItem_left">
<image mode="aspectFill"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_homeMoney.png" alt="" />
物业公积金支付
</div>
<div class="banlenceItem_right">
</view>
<view class="banlenceItem_right">
<span></span>{{ balanceMoney }}
</div>
</div>
</div>
</view>
</view>
</view>
<div class="btn" @click="OrderPay">
<view class="btn" @click="createPay">
物业公积金+微信支付 <span></span>{{ currentMoney }}
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
</template>
<script>
@ -533,7 +469,7 @@ export default {
}).then((res) => {
console.log(res);
this.payInfoId = res.id;
this.getPayInfo();
this.OrderPay();
});
},
//
@ -547,15 +483,22 @@ export default {
//
async OrderPay() {
// this.payInfoId
await request(apiArr.OrderPay, "POST", { order_pay_id: 6 }).then(
(res) => {
console.log(res);
await request(apiArr.OrderPay, "POST", { order_pay_id: this.payInfoId }).then(
async (res) => {
const params = {
order_pay_id: this.payInfoId,
}
await request(apiArr.OrderPay, "POST", params).then(
(res) => {
}
);
}
);
},
//
getPayList() {
request(apiArr.getPayOrderList, "POST", {
room_id: this.currentRoom.room_id,
page_num: this.page_num,
@ -569,7 +512,7 @@ export default {
flag = false;
}
this.flag = flag;
this.payOrderList = this.payOrderList.concat(res.rows);
this.payOrderList = res.rows;
});
},

View File

@ -1,3 +1,7 @@
/* .box{
padding-bottom: 100rpx;
} */
.searchBox {
padding-bottom: 24rpx;
background-color: #fff;
@ -65,6 +69,10 @@
transform: translateX(-50%);
}
.orderListBox{
padding-bottom: 220rpx;
}
.orderList {
margin-top: 20rpx;
@ -167,7 +175,11 @@ page {
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 200rpx;
position: fixed;
bottom: 100rpx;
left: 50%;
transform: translateX(-50%);
z-index: 99;
}

View File

@ -25,7 +25,7 @@
</view>
</view>
<view v-if="list.length !== 0">
<view v-if="list.length !== 0" class="orderListBox">
<view class="orderList" v-for="(item, index) in list" :key="index">
<view class="orderItem" @click="handlerDetailClick(item.id)">
<view :class="['orderItemTit', statusType[item.status].style]">
@ -69,7 +69,7 @@
</view>
</view>
</view>
<view v-if="list.length == 0" class="empty">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_nearbyList_empty.png"
mode="aspectFill"></image>
@ -140,10 +140,10 @@ export default {
async init() {
const [awaitingNumb, underwayNum, doneNum, discardNum] =
await Promise.all([
this.awaitingRes(),
this.underwayRes(),
this.doneRes(),
this.discardRes(),
this.awaitingRes(1),
this.awaitingRes(2),
this.awaitingRes(3),
this.awaitingRes(4),
]);
this.awaitingNumb = awaitingNumb;
this.underwayNum = underwayNum;
@ -152,6 +152,7 @@ export default {
},
async getTabsList() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
community_id: Number(uni.getStorageSync("changeCommData").id),
status: this.active,
page_num: this.page_num,
page_size: this.page_size,
@ -170,36 +171,10 @@ export default {
}
},
//
async awaitingRes() {
async awaitingRes(status) {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 1,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async underwayRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 2,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async discardRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 4,
page_num: this.page_num,
page_size: this.page_size,
});
return res.total;
},
//
async doneRes() {
const res = await request(apiArr.getWorkOrderCrudList, "POST", {
status: 3,
community_id: Number(uni.getStorageSync("changeCommData").id),
status: status,
page_num: this.page_num,
page_size: this.page_size,
});

View File

@ -1,667 +0,0 @@
<template>
<view>
<view class="express">
<!-- Step Navigation -->
<view class="strideList">
<view class="strideItem" :class="{active: step == 1}" @tap="changeItem(1)">基础<br />信息</view>
<view class="icons">
<image
:src="step != 2 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_1.png' : 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_2.png'"
mode="widthFix" />
</view>
<view class="strideItem" :class="{active: step == 2}" @tap="changeItem(2)">病历<br />信息</view>
<view class="icons">
<image
:src="step != 3 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_1.png' : 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_2.png'"
mode="widthFix" />
</view>
<view class="strideItem" :class="{active: step == 3}" @tap="changeItem(3)">生活<br />方式</view>
<view class="icons">
<image
:src="step != 4 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_1.png' : 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/play_2.png'"
mode="widthFix" />
</view>
<view class="strideItem" :class="{active: step == 4}" @tap="changeItem(4)">授权<br />用户</view>
</view>
<!-- Step 1: Basic Information -->
<view class="basic" v-if="step == 1">
<view class="basic_row">
<view class="basic_row_tit">姓名</view>
<view class="basic_row_con">
<input v-model="name" placeholder="请填写您的姓名" placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">电话</view>
<view class="basic_row_con">
<input v-model="phone" type="number" maxlength="11" placeholder="请填写您的电话"
placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">性别</view>
<view class="basic_row_con">
<view class="sex" :class="{active2: sex == 'man'}" @tap="changeSex('man')">
<view class="cir"></view>
</view>
<view class="sex" :class="{active2: sex == 'woman'}" @tap="changeSex('woman')">
<view class="cir"></view>
</view>
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">出生日期</view>
<view class="basic_row_con" @tap="changeShow">
<input v-model="time" disabled placeholder="请选择您的出生日期"
placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">身高</view>
<view class="basic_row_con">
<input v-model="height" placeholder="请填写身高(单位cm)" placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row none">
<view class="basic_row_tit">体重</view>
<view class="basic_row_con">
<input v-model="weight" placeholder="请填写体重(单位Kg)" placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="btn" @click="headerStepClick">下一步</view>
</view>
<!-- Step 2: Medical Information -->
<view class="infomation" v-if="step == 2">
<view class="basic_row">
<view class="basic_row_tit">血值类型</view>
<view class="basic_row_con" @tap="changeShow2('bloodType', '血脂类型')">
<input v-model="bloodType" disabled placeholder="请选择您的血值类型"
placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">糖尿病类型</view>
<view class="basic_row_con" @tap="changeShow2('diabetesType', '糖尿病类型')">
<input v-model="diabetesType" disabled placeholder="请选择您的糖尿病类型"
placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row">
<view class="basic_row_tit">血压类型</view>
<view class="basic_row_con" @tap="changeShow2('bloodPressure', '血压类型')">
<input v-model="bloodPressure" disabled placeholder="请选择您的血压类型"
placeholder-style="color: #999999;font-size: 26rpx" />
</view>
</view>
<view class="basic_row2">
<view class="basic_row_tit">既往病史</view>
<view class="illnessList">
<view class="illnessItem" :class="{checked: pastCase === 'a'}" @tap="headerInputClick2('pastCase', 'a')">胸闷
</view>
<view class="illnessItem" :class="{checked: pastCase === 'b'}" @tap="headerInputClick2('pastCase', 'b')">心慌
</view>
<view class="illnessItem" :class="{checked: pastCase === 'c'}" @tap="headerInputClick2('pastCase', 'c')">头晕
</view>
<view class="illnessItem" :class="{checked: pastCase === 'd'}" @tap="headerInputClick2('pastCase', 'd')">痛风
</view>
<view class="illnessItem" :class="{checked: pastCase === 'e'}" @tap="headerInputClick2('pastCase', 'e')">
脑血管疾病</view>
<view class="illnessItem" :class="{checked: pastCase === 'f'}" @tap="headerInputClick2('pastCase', 'f')">
急性并发症</view>
<view class="illnessItem" :class="{checked: pastCase === 'g'}" @tap="headerInputClick2('pastCase', 'g')">
心脏疾病</view>
<view class="illnessItem" :class="{checked: pastCase === 'h'}" @tap="headerInputClick2('pastCase', 'h')">其他
</view>
<!-- 其他病史选项... -->
</view>
</view>
<view class="basic_row2">
<view class="basic_row_tit">既往用药</view>
<view class="drugList">
<view class="drugItem" :class="{checked: pharmacy === 'a'}" @tap="headerInputClick2('pharmacy', 'a')">他汀类降脂药
</view>
<view class="drugItem" :class="{checked: pharmacy === 'b'}" @tap="headerInputClick2('pharmacy', 'b')">中药降脂
</view>
<view class="drugItem" :class="{checked: pharmacy === 'c'}" @tap="headerInputClick2('pharmacy', 'c')">中药降酸药
</view>
<view class="drugItem" :class="{checked: pharmacy === 'd'}" @tap="headerInputClick2('pharmacy', 'd')">其他
</view>
</view>
</view>
<view class="basic_row none">
<view class="basic_row_tit">用药时间</view>
<view class="basic_row_con">
<view class="sex" :class="{active2: drugTime == '3'}" @tap="changeTime('3')">
<view class="cir"></view>3
</view>
<view class="sex" :class="{active2: drugTime == '1'}" @tap="changeTime('1')">
<view class="cir"></view>一年以内
</view>
</view>
</view>
<view class="btn" @click="headerStepClick">下一步</view>
</view>
<!-- Step 3: Lifestyle -->
<view class="life" v-if="step == 3">
<!-- 生活方式表单内容... -->
<view class="basic_row3" style="margin-top: 20rpx;">
<view class="basic_row_tit">吸烟情况</view>
<view class="basic_row_con3">
<view class="sex" :class="{ active2: smoke === 'no' }" @click="handleSelect('smoke', 'no')">
<view class="cir"></view>从不
</view>
<view class="sex" :class="{ active2: smoke === 'ring' }" @click="handleSelect('smoke', 'ring')">
<view class="cir"></view>已戒烟
</view>
<view class="sex" :class="{ active2: smoke === 'yes' }" @click="handleSelect('smoke', 'yes')">
<view class="cir"></view>吸烟
</view>
</view>
</view>
<!-- 饮酒情况 -->
<view class="basic_row3">
<view class="basic_row_tit">饮酒情况</view>
<view class="basic_row_con3">
<view class="sex" :class="{ active2: drink === 'no' }" @click="handleSelect('drink', 'no')">
<view class="cir"></view>从不
</view>
<view class="sex" :class="{ active2: drink === 'once' }" @click="handleSelect('drink', 'once')">
<view class="cir"></view>偶尔
</view>
<view class="sex" :class="{ active2: drink === 'yes' }" @click="handleSelect('drink', 'yes')">
<view class="cir"></view>经常
</view>
<view class="sex" :class="{ active2: drink === 'ring' }" @click="handleSelect('drink', 'ring')">
<view class="cir"></view>戒酒
</view>
</view>
</view>
<!-- 日常工作 -->
<view class="basic_row3">
<view class="basic_row_tit">日常工作</view>
<view class="basic_row_con3">
<view class="sex" :class="{ active2: dailyWork === 'easy' }" @click="handleSelect('dailyWork', 'easy')">
<view class="cir"></view>轻体力劳动
</view>
<view class="sex" :class="{ active2: dailyWork === 'in' }" @click="handleSelect('dailyWork', 'in')">
<view class="cir"></view>中体力劳动
</view>
<view class="sex" :class="{ active2: dailyWork === 'repeat' }" @click="handleSelect('dailyWork', 'repeat')">
<view class="cir"></view>重体力劳动
</view>
<view class="sex" :class="{ active2: dailyWork === 'rest' }" @click="handleSelect('dailyWork', 'rest')">
<view class="cir"></view>休息
</view>
</view>
</view>
<!-- 运动情况 -->
<view class="basic_row3">
<view class="basic_row_tit">运动情况</view>
<view class="basic_row_con3">
<view class="sex" :class="{ active2: motion === 'lack' }" @click="handleSelect('motion', 'lack')">
<view class="cir"></view>2
</view>
<view class="sex" :class="{ active2: motion === 'once' }" @click="handleSelect('motion', 'once')">
<view class="cir"></view>3-5
</view>
<view class="sex" :class="{ active2: motion === 'days' }" @click="handleSelect('motion', 'days')">
<view class="cir"></view>每天
</view>
<view class="sex" :class="{ active2: motion === 'no' }" @click="handleSelect('motion', 'no')">
<view class="cir"></view>无运动
</view>
</view>
</view>
<!-- 睡眠情况 -->
<view class="basic_row3 none">
<view class="basic_row_tit">睡眠情况</view>
<view class="basic_row_con3">
<view class="sex" :class="{ active2: sleep === 'law' }" @click="handleSelect('sleep', 'law')">
<view class="cir"></view>规律
</view>
<view class="sex" :class="{ active2: sleep === 'noLaw' }" @click="handleSelect('sleep', 'noLaw')">
<view class="cir"></view>熬夜
</view>
<view class="sex" :class="{ active2: sleep === 'overturn' }" @click="handleSelect('sleep', 'overturn')">
<view class="cir"></view>黑白颠倒
</view>
<view class="sex" :class="{ active2: sleep === 'rest' }" @click="handleSelect('sleep', 'rest')">
<view class="cir"></view>其他
</view>
</view>
</view>
<view class="btn" @click="headerStepClick">下一步</view>
</view>
<!-- Step 4: Authorization -->
<view class="user" v-if="step == 4">
<!-- 授权表单内容... -->
<view class="basic_row3 none">
<view class="basic_row_tit">档案授权</view>
<view class="basic_row_con2">
<view
class="sex"
:class="{ active2: accredit === 'owner' }"
@click="handleSelect('accredit', 'owner')"
>
<view class="cir"></view>对所有人员开放
</view>
<view
class="sex"
:class="{ active2: accredit === 'family' }"
@click="handleSelect('accredit', 'family')"
>
<view class="cir"></view>对家庭成员开放
</view>
<view
class="sex"
:class="{ active2: accredit === 'serve' }"
@click="handleSelect('accredit', 'serve')"
>
<view class="cir"></view>对服务人员开放
</view>
<view
class="sex"
:class="{ active2: accredit === 'oneself' }"
@click="handleSelect('accredit', 'oneself')"
>
<view class="cir"></view>只允许自己查看
</view>
</view>
</view>
<view class="btn" bind:tap="headerSubmitClick">提交</view>
</view>
</view>
<!-- Date Picker Popup -->
<u-popup :show="show" mode="bottom" round close-on-click-overlay>
<view style="width: 100%;">
<u-datetime-picker mode="date" :show="show" :formatter="formatter" @cancel="onClose"
@confirm="onInput"></u-datetime-picker>
</view>
</u-popup>
<!-- Blood Type Picker Popup -->
<u-popup :show="show2" mode="bottom" round close-on-click-overlay>
<view style="width: 100%;">
<u-picker :columns="columns" :show="show2" :title="PopupTitle" @confirm="onInput2" @cancel="onClose2"
show-toolbar></u-picker>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
step: 1,
name: '',
phone: '',
sex: '',
time: '',
height: '',
weight: '',
bloodType: '',
diabetesType: '',
bloodPressure: '',
pastCase: '',
pharmacy: '',
drugTime: '',
smoke: '',
drink: '',
dailyWork: '',
motion: '',
sleep: '',
accredit: '',
show: false,
show2: false,
currentDate: new Date().getTime(),
popupType: '',
PopupTitle: '',
columns: [], // Your picker options
formatter(type, value) {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
}
}
},
methods: {
changeItem(step) {
this.step = step;
},
changeSex(sex) {
this.sex = sex;
},
changeTime(time) {
this.drugTime = time;
},
changeShow() {
this.show = true;
console.log(this.show, 'asdasd');
},
changeShow2(type, title) {
this.popupType = type;
this.PopupTitle = title;
this.show2 = true;
},
headerInputClick(e) {
this[e.currentTarget.dataset.name] = e.detail.value;
},
headerInputClick2(name, val) {
this[name] = val;
},
headerStepClick() {
this.step++;
},
headerSubmitClick() {
// Submit logic
},
onClose() {
this.show = false;
},
onClose2() {
this.show2 = false;
},
onInput(e) {
this.time = this.$u.timeFormat(e.value, 'yyyy-mm-dd');
this.show = false;
},
onInput2(e) {
this[this.popupType] = e[0];
this.show2 = false;
},
handleSelect(name,val) {
console.log(name,val);
this[name] = val;
return;
},
}
}
</script>
<style scoped>
image {
width: 100%;
height: 100%;
}
.strideList {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 43rpx;
}
.strideItem {
width: 120rpx;
height: 120rpx;
background: #D9D9D9;
border-radius: 50%;
overflow: hidden;
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.icons {
width: 26rpx;
height: 26rpx;
}
.active {
background: #FF512A;
}
.strideList {
margin-top: 42rpx;
}
.basic {
margin: 0 20rpx;
margin-top: 62rpx;
}
.basic_row {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #E6E6E6;
height: 90rpx;
}
.basic_row_tit {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.basic_row_con {
text-align: right;
display: flex;
align-items: center;
height: 100%;
}
.basic_row_con input {
height: 90rpx;
}
.sex {
display: flex;
align-items: center;
font-weight: 400;
font-size: 26rpx;
color: #222222;
margin-left: 40rpx;
}
.cir {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
border: 1rpx solid #555555;
margin-right: 16rpx;
box-sizing: border-box;
}
.active2 .cir {
background-color: #ff512a;
border: none;
}
.none {
border-bottom: none;
}
.btn {
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
width: 650rpx;
height: 80rpx;
background: #FF512A;
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 64rpx;
}
.infomation {
margin: 0 20rpx;
margin-top: 92rpx;
padding-bottom: 60rpx;
}
.basic_row2 {
display: flex;
flex-direction: column;
padding-top: 30rpx;
}
.illnessItem {
width: 150rpx;
height: 50rpx;
background: #F0F0F0;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400;
font-size: 26rpx;
color: #999999;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
.illnessList {
margin-top: 30rpx;
display: flex;
flex-wrap: wrap;
}
.basic_row2 .ipts {
border-bottom: 1rpx solid #E6E6E6;
padding: 30rpx 0;
}
.drugList {
display: flex;
flex-wrap: wrap;
margin-top: 25rpx;
}
.drugItem {
background: #F0F0F0;
border-radius: 100rpx 100rpx 100rpx 100rpx;
white-space: nowrap;
font-weight: 400;
font-size: 26rpx;
color: #999999;
padding: 10rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
.checked {
background: #FF512A;
color: #FFFFFF;
}
.life {
margin: 0 52rpx;
}
.life .basic_row {
width: 100%;
justify-content: flex-start;
min-height: 90rpx;
}
.life .basic_row_tit {
white-space: nowrap;
margin-right: 32rpx;
}
.life .basic_row_con {
flex-wrap: wrap;
}
.life .sex {
margin: 15rpx 0;
margin-right: 16rpx;
}
.basic_row_con3 {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.basic_row3 {
min-height: 90rpx;
display: flex;
padding-top: 30rpx;
padding-bottom: 30rpx;
align-items: flex-start;
border-bottom: 1rpx solid #E6E6E6;
}
.basic_row_con3 .sex {
margin-top: 0;
}
.life .none {
border-bottom: none;
}
.user {
margin: 0 52rpx;
margin-top: 92rpx;
}
.user .none {
border-bottom: none;
}
.user .sex {
margin-bottom: 30rpx;
}
</style>

View File

@ -1,611 +0,0 @@
<template>
<view class="headlth">
<!-- Swiper Section -->
<view class="swiper">
<swiper :autoplay="true" :interval="3000" :duration="500">
<swiper-item>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_img.png" mode="widthFix" />
</swiper-item>
</swiper>
</view>
<!-- Tab List -->
<view class="tabList">
<view class="tabItem" v-for="(item, index) in tabList" :key="index" @tap="jump(item.url)">
<view class="tabImg">
<image :src="item.img" mode="heightFix" />
</view>
<view class="tabName">
{{item.name}}
</view>
</view>
</view>
<view class="gray"></view>
<!-- Hot Services -->
<view class="tit">
热门服务
</view>
<view class="serviceTag">
<view class="serviceTagItem" v-for="(service, idx) in healthServices" :key="idx">
<view class="serviceTagItem_name">{{service.name}}</view>
<view class="serviceTagItem_msg">{{service.value}}</view>
<view :class="'serviceTagItem_img' + (idx+1)">
<image :src="service.icon" mode="widthFix" />
</view>
</view>
</view>
<view class="gray"></view>
<!-- Tabs -->
<view class="tabs">
<view class="tab" :class="{active: tabIndex == 0}" @tap="changeTab(0)">服务列表</view>
<view class="tab" :class="{active: tabIndex == 1}" @tap="changeTab(1)">商户列表</view>
</view>
<!-- Service List -->
<view class="list_item" v-if="tabIndex == 0" v-for="(item, index) in serverList" :key="index">
<view class="item_tit">
<view class="item_tit_left">{{item.cate_name}}</view>
<view class="item_tit_right" @tap="ServerMore(item.cate_id)">
更多
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png"
mode="widthFix" />
</view>
</view>
<view class="item_goodsList">
<view class="item_goodsItem" v-for="(items, subIndex) in item.appoints" :key="subIndex"
@tap="ServerDesc(items.appoint_id)">
<view class="item_goodsItem_tit">
<image :src="items.photo" mode="aspectFill" />
</view>
<view class="item_goodsItem_name">{{items.title}}</view>
<view class="item_goodsItem_msg">
<view>{{items.price}}</view>
<text>/{{items.unit}}</text>
</view>
</view>
</view>
</view>
<!-- Merchant List -->
<view class="merchantList" v-if="tabIndex == 1">
<view class="merchantItem" v-for="(item, index) in 4" :key="index">
<view class="merchantItem_left">
<view class="merchantItem_left_img">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/gropBuy/goods.png" mode="widthFix" />
</view>
<view class="merchantItem_left_msg">
<view class="merchantItem_left_msg_tit">永训医疗</view>
<view class="merchantItem_left_msg_add">衡阳市石鼓区中山北路1号</view>
<view class="merchantItem_left_msg_msg">中国领先的高科技医疗设备研...</view>
<view class="merchantItem_left_msg_tag">健康 卫生 先进</view>
</view>
</view>
<view class="merchantItem_right">
电话询价
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabList: [{
name: "快速建档",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon1.png',
url: "../express/express",
},
{
name: "健康自测",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon2.png',
url: "../SelfTest/SelfTest",
},
{
name: "健康管理",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon3.png',
url: "",
},
{
name: "上门服务",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon4.png',
url: "/packages/doorToDoor/pages/doorToDoor/doorToDoor",
},
{
name: "自检报告",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon5.png',
url: "../report/report",
},
{
name: "健康饮食",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon6.png',
url: "../food/food",
},
{
name: "健康运动",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon7.png',
url: "../sports/sports",
},
{
name: "社区商城",
img: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon8.png',
url: "",
},
],
healthServices: [{
name: '体温',
value: '37°C',
icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon_1.png'
},
{
name: '血压',
value: '37mmHg',
icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon_2.png'
},
{
name: '血糖',
value: '37mmol/L',
icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon_3.png'
},
{
name: '心率',
value: '37次/分',
icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/health_icon_4.png'
}
],
tabIndex: 0,
serverList:[
{
cate_name: '家政保洁',
appoints: [
{
appoint_id: 1,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_1.png',
title: '上门抽血',
price: 45,
unit: '次',
},
{
appoint_id: 2,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_2.png',
title: '上门肌注',
price: 65,
unit: '次',
},
{
appoint_id: 3,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_3.png',
title: '脐带护理',
price: 95,
unit: '次',
}
]
},
{
cate_name: '健康养生',
appoints: [
{
appoint_id: 1,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_4.png',
title: '体质养生',
price: 45,
unit: '张',
},
{
appoint_id: 2,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_5.png',
title: '四季养生',
price: 300,
unit: '套',
},
{
appoint_id: 3,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_6.png',
title: '肝脾养生',
price: 451,
unit: '套',
}
]
},
{
cate_name: '跑腿服务',
appoints: [
{
appoint_id: 1,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_7.png',
title: '同城快递',
price: 45,
unit: '件',
},
{
appoint_id: 2,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_8.png',
title: '快递代取',
price: 300,
unit: '件',
},
{
appoint_id: 3,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_9.png',
title: '外卖代取',
price: 451,
unit: '件',
}
]
},
{
cate_name: '设备配套',
appoints: [
{
appoint_id: 1,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_10.png',
title: '血糖计',
price: 45,
unit: '个',
},
{
appoint_id: 2,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_11.png',
title: '血压计',
price: 300,
unit: '个',
},
{
appoint_id: 3,
photo: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/health/Mask_group_12.png',
title: '尿酸检测仪',
price: 451,
unit: '个',
}
]
}
],//
}
},
methods: {
jump(url) {
uni.navigateTo({
url: url
});
},
changeTab(index) {
this.tabIndex = index;
},
ServerMore(cateId) {
// Handle more click
console.log('More clicked for category:', cateId);
},
ServerDesc(appointId) {
// Handle service description click
console.log('Service clicked:', appointId);
}
},
onLoad() {
// Load your data here
// this.loadTabList();
// this.loadServerList();
}
}
</script>
<style scoped>
image {
width: 100%;
height: 100%;
}
.swiper {
width: 710rpx;
height: 300rpx;
margin: 0 auto;
margin-top: 30rpx;
}
.swiper .swiper {
width: 100%;
height: 100%;
}
.swiper image {
width: 100%;
height: 100%;
}
.tabList {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 40rpx;
}
.tabItem {
display: flex;
width: 25%;
align-items: center;
flex-direction: column;
margin-bottom: 46rpx;
}
.tabImg {
height: 54rpx;
}
.tabName {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.tit {
font-weight: bold;
font-size: 32rpx;
color: #222222;
margin-left: 20rpx;
padding-top: 30rpx;
}
.serviceTag {
display: flex;
justify-content: space-between;
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.serviceTagItem {
width: 171rpx;
height: 212rpx;
background: linear-gradient(148deg, #FFF3EF 0%, #FFD0C0 100%);
border-radius: 30rpx 30rpx 30rpx 30rpx;
box-sizing: border-box;
padding-left: 28rpx;
padding-top: 37rpx;
position: relative;
}
.serviceTagItem_name {
font-weight: bold;
font-size: 28rpx;
color: #000000;
}
.serviceTagItem_msg {
margin-top: 76rpx;
margin-left: 0rpx;
z-index: 2;
position: relative;
}
.serviceTagItem_img1 {
width: 70rpx;
height: 105rpx;
position: absolute;
bottom: 5rpx;
right: 8rpx;
}
.serviceTagItem_img2 {
width: 68.89rpx;
height: 87.54rpx;
position: absolute;
bottom: 15rpx;
right: 6rpx;
}
.serviceTagItem_img3 {
height: 79rpx;
width: 71rpx;
position: absolute;
bottom: 18rpx;
right: 7rpx;
}
.serviceTagItem_img4 {
width: 70rpx;
height: 105rpx;
position: absolute;
bottom: 5rpx;
right: 8rpx;
}
.tabs {
display: flex;
align-items: center;
margin-left: 20rpx;
padding-top: 30rpx;
}
.tabs .tab {
font-weight: 400;
font-size: 28rpx;
color: #555555;
margin-right: 70rpx;
}
.tabs .active {
font-weight: bold;
font-size: 32rpx;
position: relative;
}
.tabs .active::after {
content: '';
width: 127rpx;
height: 10rpx;
background: #FF512A;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
.tabs .active::before {
width: 127rpx;
height: 10rpx;
filter: blur(6.599999904632568rpx);
background: #FF5D73;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
.list {
margin-top: 36rpx;
}
.item_tit {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 20rpx;
margin-bottom: 32rpx;
margin-top: 30rpx;
}
.item_tit_left {
font-weight: bold;
font-size: 28rpx;
color: #000000;
}
.item_tit_right {
font-weight: 400;
font-size: 24rpx;
color: #D5AC66;
display: flex;
align-items: center;
}
.item_tit_right image {
width: 12rpx;
height: 22rpx;
margin-left: 8rpx;
}
.item_goodsItem_tit {
width: 223rpx;
height: 161rpx;
}
.item_goodsItem_name {
font-weight: 400;
font-size: 26rpx;
color: #222222;
margin-top: 20rpx;
margin-left: 10rpx;
}
.item_goodsItem_msg {
font-weight: 400;
font-size: 22rpx;
color: #FF512A;
display: flex;
align-items: flex-end;
margin-top: 6rpx;
margin-left: 13rpx;
}
.item_goodsItem_msg view {
font-weight: 500;
font-size: 36rpx;
}
.item_goodsItem_msg text {
font-size: 22rpx;
color: #FF512A;
}
.item_goodsList {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx;
}
.list_item {
padding-bottom: 32rpx;
border-bottom: 1rpx solid #E6E6E6;
}
.merchantList {
margin: 0 20rpx;
margin-top: 30rpx;
}
.merchantItem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1rpx solid #E6E6E6;
box-sizing: border-box;
}
.merchantItem_right {
font-weight: 400;
font-size: 26rpx;
color: #FFFFFF;
width: 150rpx;
height: 50rpx;
background: #D5AC66;
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
}
.merchantItem_left {
display: flex;
align-items: center;
}
.merchantItem_left_img {
width: 180rpx;
height: 180rpx;
border-radius: 20rpx;
overflow: hidden;
margin-right: 20rpx;
}
.merchantItem_left_msg_tit {
font-weight: 400;
font-size: 32rpx;
color: #000000;
}
.merchantItem_left_msg_add {
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-top: 14rpx;
}
.merchantItem_left_msg_msg {
font-weight: 400;
font-size: 22rpx;
color: #FF512A;
background: #FFF0ED;
padding: 2rpx;
margin-top: 16rpx;
}
.merchantItem_left_msg_tag {
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-top: 18rpx;
}
</style>

View File

@ -1,203 +0,0 @@
<template>
<view class="selftTest">
<view class="Tit">血脂</view>
<view class="row">
<view class="row_tit">总胆固醇</view>
<view class="row_con">
<view wx:if="Info.zdgc_status == '1'">较低</view>
<view wx:if="Info.zdgc_status == '2'">正常</view>
<view wx:if="Info.zdgc_status == '3'">较高</view>
</view>
</view>
<view class="row">
<view class="row_tit">高密度脂</view>
<view class="row_con">
<view wx:if="Info.gmdz_status == '1'">较低</view>
<view wx:if="Info.gmdz_status == '2'">正常</view>
<view wx:if="Info.gmdz_status == '3'">较高</view>
</view>
</view>
<view class="row">
<view class="row_tit">甘油三脂</view>
<view class="row_con">
<view wx:if="Info.gysz_status == '1'">较低</view>
<view wx:if="Info.gysz_status == '2'">正常</view>
<view wx:if="Info.gysz_status == '3'">较高</view>
</view>
</view>
<view class="row">
<view class="row_tit">低密度脂</view>
<view class="row_con">
<view wx:if="Info.dmyh_status == '1'">较低</view>
<view wx:if="Info.dmyh_status == '2'">正常</view>
<view wx:if="Info.dmyh_status == '3'">较高</view>
</view>
</view>
<view class="row">
<view class="row_tit">冠心病指数</view>
<view class="row_con">
<view wx:if="Info.gxbzs_status == '1'">较低</view>
<view wx:if="Info.gxbzs_status == '2'">正常</view>
<view wx:if="Info.gxbzs_status == '3'">较高</view>
</view>
</view>
<view class="row none">
<view class="row_tit">动脉硬化</view>
<view class="row_con">
<view wx:if="Info.dmyh_status == '1'">较低</view>
<view wx:if="Info.dmyh_status == '2'">正常</view>
<view wx:if="Info.dmyh_status == '3'">较高</view>
</view>
</view>
<view class="gray"></view>
<view class="Tit">常规项目</view>
<view class="row type2">
<view class="row_tit">体重</view>
<view class="row_con">
<view wx:if="Info.tz_status == '1'">较低</view>
<view wx:if="Info.tz_status == '2'">正常</view>
<view wx:if="Info.tz_status == '3'">较高</view>
</view>
</view>
<view class="row type2">
<view class="row_tit">心率</view>
<view class="row_con">
<view wx:if="Info.xl_status == '1'">较低</view>
<view wx:if="Info.xl_status == '2'">正常</view>
<view wx:if="Info.xl_status == '3'">较高</view>
</view>
</view>
<view class="row none">
<view class="row_tit">体温</view>
<view class="row_con">
<view wx:if="Info.tw_status == '1'">较低</view>
<view wx:if="Info.tw_status == '2'">正常</view>
<view wx:if="Info.tw_status == '3'">较高</view>
</view>
</view>
<view class="gray"></view>
<view class="Tit">尿酸</view>
<view class="row none">
<view class="row_tit">尿酸</view>
<view class="row_con">
<view wx:if="Info.ns_status == '1'">较低</view>
<view wx:if="Info.ns_status == '2'">正常</view>
<view wx:if="Info.ns_status == '3'">较高</view>
</view>
</view>
<view class="gray"></view>
<view class="Tit">血压</view>
<view class="row">
<view class="row_tit">收缩压</view>
<view class="row_con">
<view wx:if="Info.ssy_status == '1'">较低</view>
<view wx:if="Info.ssy_status == '2'">正常</view>
<view wx:if="Info.ssy_status == '3'">较高</view>
</view>
</view>
<view class="row">
<view class="row_tit">舒张压</view>
<view class="row_con">
<view wx:if="Info.szy_status == '1'">较低</view>
<view wx:if="Info.szy_status == '2'">正常</view>
<view wx:if="Info.szy_status == '3'">较高</view>
</view>
</view>
<view class="row none">
<view class="row_tit">脉搏</view>
<view class="row_con ">
<view wx:if="Info.mb_status == '1'">较低</view>
<view wx:if="Info.mb_status == '2'">正常</view>
<view wx:if="Info.mb_status == '3'">较高</view>
</view>
</view>
<view class="gray"></view>
<view class="Tit">眼科</view>
<view class="row">
<view class="row_tit">左眼视力</view>
<view class="row_con">
<view wx:if="Info.zysl_status == '1'">较低</view>
<view wx:if="Info.zysl_status == '2'">正常</view>
<view wx:if="Info.zysl_status == '3'">较高</view>
</view>
</view>
<view class="row none">
<view class="row_tit">右眼视力</view>
<view class="row_con ">
<view wx:if="Info.yysl_status == '1'">较低</view>
<view wx:if="Info.yysl_status == '2'">正常</view>
<view wx:if="Info.yysl_status == '3'">较高</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: "",
Info: "",
}
},
methods: {
},
onLoad(options) {
let that = this
this.id = options.id
}
}
</script>
<style>
.selftTest {
padding: 30rpx 20rpx;
padding-top: 0;
}
.Tit {
font-weight: bold;
font-size: 32rpx;
color: #222222;
margin-bottom: 25rpx;
margin-top: 30rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1rpx solid #E6E6E6;
box-sizing: border-box;
}
.row_tit {
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.row_con {
display: flex;
align-items: center;
font-weight: 400;
font-size: 26rpx;
color: #72BB4E;
}
.row_con input {
text-align: right;
}
.none {
border-bottom: none;
}
.type2 {
color: #FF512A;
}
</style>

View File

@ -1,159 +0,0 @@
<template>
<view class="report">
<view class="reportList">
<view class="reportItem" @click="desc" v-for="(item, index) in orderList">
<view class="reportItem_left">
<view class="reportItem_img">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/port.png" mode="widthFix" />
</view>
<view class="reportItem_text">
<view class="reportItem_text_tit">{{item.title}}检查报告</view>
<view class="reportItem_text_type">检测方式
<view>自测</view>
</view>
</view>
</view>
<view class="reportItem_right">
查看
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png"
mode="widthFix" />
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
t: uni.getMenuButtonBoundingClientRect().top,
h: uni.getMenuButtonBoundingClientRect().height,
orderList: [{
title: "123"
}]
}
},
methods: {
handleNavigateBack() {
uni.navigateBack();
},
desc(id) {
//
}
}
}
</script>
<style>
image {
width: 100%;
height: 100%;
}
.nav-box {
box-sizing: border-box;
width: 100%;
z-index: 2;
background: #F9F9F9;
padding-bottom: 25rpx;
}
.nav-box .nav-bar {
display: flex;
align-items: center;
}
.nav-box .nav-bar .nav-bar-left,
.nav-box .nav-bar .nav-bar-right {
padding: 0 20rpx;
width: 132rpx;
/* min-width: 36rpx; */
}
.nav-box .nav-bar .nav-bar-left van-icon {
vertical-align: sub;
color: #333333;
}
.nav-box .nav-bar .nav-bar-title {
flex: 1;
text-align: center;
font-weight: 400;
font-size: 36rpx;
color: #000000;
}
.nav-box .nav-bar-right {
font-weight: 400;
font-size: 26rpx;
color: #FF512A;
display: flex;
align-items: center;
}
.nav-box .nav-bar-right image {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.reportList {
margin: 0 20rpx;
margin-top: 15rpx;
}
.reportItem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1rpx solid #E6E6E6;
}
.reportItem_left {
display: flex;
align-items: center;
}
.reportItem_img {
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
}
.reportItem_right {
display: flex;
font-weight: 400;
font-size: 26rpx;
color: #222222;
align-items: center;
}
.reportItem_right image {
width: 12rpx;
height: 26rpx;
margin-left: 13rpx;
}
.reportItem_text_tit {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.reportItem_text_type {
font-weight: 400;
font-size: 22rpx;
color: #999999;
display: flex;
align-items: center;
}
.reportItem_text_type view {
color: #222;
}
</style>

View File

@ -1,204 +0,0 @@
<template>
<view class="selftTest">
<view class="Tit">血脂</view>
<view class="row">
<view class="row_tit">总胆固醇</view>
<view class="row_con">
<input type="number" v-model="zdgc" @input="ipt1" data-datas="zdgc" placeholder="0.4-4" placeholder-style="color: #999999;font-size: 26rpx;" />mg/dL
</view>
</view>
<view class="row">
<view class="row_tit">高密度脂</view>
<view class="row_con">
<input type="number" v-model="gmdz" @input="ipt1" data-datas="gmdz" placeholder="2.9-6" placeholder-style="color: #999999;font-size: 26rpx;" />mmol/L
</view>
</view>
<view class="row">
<view class="row_tit">甘油三脂</view>
<view class="row_con">
<input type="number" v-model="gysz" @input="ipt1" data-datas="gysz" placeholder="1.04-2.59" placeholder-style="color: #999999;font-size: 26rpx;" />mg/L
</view>
</view>
<view class="row">
<view class="row_tit">低密度脂</view>
<view class="row_con">
<input type="number" v-model="dzdz" @input="ipt1" data-datas="dzdz" placeholder="0.51-1.7" placeholder-style="color: #999999;font-size: 26rpx;" />mmol/dL
</view>
</view>
<view class="row">
<view class="row_tit">冠心病指数</view>
<view class="row_con">
<input type="number" v-model="gxbzs" @input="ipt1" data-datas="gxbzs" placeholder="0.3-3.35" placeholder-style="color: #999999;font-size: 26rpx;" />
</view>
</view>
<view class="row none">
<view class="row_tit">动脉硬化</view>
<view class="row_con">
<input type="number" v-model="dmyh" @input="ipt1" data-datas="dmyh" placeholder="1.3-4.5" placeholder-style="color: #999999;font-size: 26rpx;" />
</view>
</view>
<view class="gray"></view>
<view class="Tit">常规项目</view>
<view class="row">
<view class="row_tit">体重</view>
<view class="row_con">
<input type="number" v-model="tz" @input="ipt1" data-datas="tz" placeholder="1-200" placeholder-style="color: #999999;font-size: 26rpx;" />Kg
</view>
</view>
<view class="row">
<view class="row_tit">心率</view>
<view class="row_con">
<input type="number" v-model="xl" @input="ipt1" data-datas="xl" placeholder="60-100" placeholder-style="color: #999999;font-size: 26rpx;" />/
</view>
</view>
<view class="row none">
<view class="row_tit">体温</view>
<view class="row_con">
<input type="number" v-model="tw" @input="ipt1" data-datas="tw" placeholder="35-37.5" placeholder-style="color: #999999;font-size: 26rpx;" />
</view>
</view>
<view class="gray"></view>
<view class="Tit">尿酸</view>
<view class="row none">
<view class="row_tit">尿酸</view>
<view class="row_con">
<input type="number" v-model="ns" @input="ipt1" data-datas="ns" placeholder="179-416" placeholder-style="color: #999999;font-size: 26rpx;" />μmol/L
</view>
</view>
<view class="gray"></view>
<view class="Tit">血压</view>
<view class="row">
<view class="row_tit">收缩压</view>
<view class="row_con">
<input type="number" v-model="ssy" @input="ipt1" data-datas="ssy" placeholder="1-200" placeholder-style="color: #999999;font-size: 26rpx;" />Kg
</view>
</view>
<view class="row">
<view class="row_tit">舒张压</view>
<view class="row_con">
<input type="number" v-model="szy" @input="ipt1" data-datas="szy" placeholder="60-100" placeholder-style="color: #999999;font-size: 26rpx;" />/
</view>
</view>
<view class="row none">
<view class="row_tit">脉搏</view>
<view class="row_con">
<input type="number" v-model="mb" @input="ipt1" data-datas="mb" placeholder="60-100" placeholder-style="color: #999999;font-size: 26rpx;" />/
</view>
</view>
<view class="gray"></view>
<view class="Tit">眼科</view>
<view class="row">
<view class="row_tit">左眼视力</view>
<view class="row_con">
<input type="number" v-model="zysl" @input="ipt1" data-datas="zysl" placeholder="1.0-4.0" placeholder-style="color: #999999;font-size: 26rpx;" />
</view>
</view>
<view class="row none">
<view class="row_tit">右眼视力</view>
<view class="row_con">
<input type="number" v-model="yysl" @input="ipt1" data-datas="yysl" placeholder="1.0-4.0" placeholder-style="color: #999999;font-size: 26rpx;" />
</view>
</view>
<view class="btn" @tap="submit">
提交
</view>
</view>
</template>
<script>
export default {
data() {
return {
zdgc: '',
gmdz: '',
gysz: '',
dzdz: '',
gxbzs: '',
dmyh: '',
tz: '',
xl: '',
tw: '',
ns: '',
ssy: '',
szy: '',
mb: '',
zysl: '',
yysl: ''
}
},
methods: {
ipt1(e) {
const key = e.currentTarget.dataset.datas;
this[key] = e.detail.value;
},
submit() {
//
}
}
}
</script>
<style>
.selftTest {
padding: 30rpx 20rpx;
padding-top: 0;
}
.Tit {
font-weight: bold;
font-size: 32rpx;
color: #222222;
margin-bottom: 25rpx;
margin-top: 30rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1rpx solid #E6E6E6;
box-sizing: border-box;
}
.row_tit {
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.row_con {
display: flex;
align-items: center;
font-weight: 400;
font-size: 26rpx;
color: #999999;
justify-content: flex-end;
flex: 1;
}
.row_con input {
text-align: right;
color: #222;
flex: 1;
}
.none {
border-bottom: none;
}
.btn {
width: 650rpx;
height: 80rpx;
background: #FF512A;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 30rpx;
}
</style>

View File

@ -254,21 +254,21 @@ export default {
methods: {
//
chooseLocation() {
uni.navigateTo({
url: "/packages/areaPopup/index",
});
// uni.navigateTo({
// url: "/packages/areaPopup/index",
// });
},
//
searchService() {
uni.navigateTo({
url: "/packages/homeServer/search/index",
});
// uni.navigateTo({
// url: "/packages/homeServer/search/index",
// });
},
//
navigateToService(item) {
uni.navigateTo({
url: "/packages/homeServer/classify/index",
});
// uni.navigateTo({
// url: "/packages/homeServer/classify/index",
// });
// uni.navigateTo({
// url: `/packages/homeServer/serverInfo/index?service=${encodeURIComponent(
// JSON.stringify(item)
@ -280,7 +280,7 @@ export default {
// uni.navigateTo({
// url: `/packages/homeServer/reservation/index?id=${service.id}&name=${service.name}`,
// });
NavgateTo("/packages/homeServer/searchInfo/index");
// NavgateTo("/packages/homeServer/searchInfo/index");
},
//
contactService() {
@ -304,7 +304,7 @@ export default {
//
lookNotice() {
NavgateTo("/packages/homeServer/noticeManage/index");
// NavgateTo("/packages/homeServer/noticeManage/index");
},
},
onLoad() {

View File

@ -5,23 +5,44 @@ page {
.header {
display: flex;
align-items: center;
position: relative;
z-index: 1;
}
.header_tit {
width: 100%;
position: absolute;
flex: 1;
text-align: center;
z-index: 0;
}
.header .u-icon {
position: absolute;
z-index: 2;
padding: 20rpx;
margin-left: 10rpx;
}
.localBox {
font-size: 26rpx;
color: #222222;
box-sizing: border-box;
width: 100%;
padding-bottom: 20rpx;
background-color: #f6f7fb;
}
.localBoxItem{
width: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
background-color: #fff;
}
.local {
display: flex;
align-items: center;
font-size: 26rpx;
color: #222222;
box-sizing: border-box;
padding: 20rpx;
width: 100%;
background-color: #fff;
width: auto;
white-space: nowrap;
}
#local {
@ -35,16 +56,16 @@ page {
}
.search {
background-color: #f6f7fb;
flex: 1;
padding: 20rpx 0;
margin-left: 15rpx;
}
.searchBox {
width: 710rpx;
width: 93%;
height: 70rpx;
background: #FFFFFF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
margin: 0 auto;
background: #f6f7fb;
border-radius: 100rpx;
display: flex;
box-sizing: border-box;
align-items: center;
@ -176,11 +197,11 @@ page {
width: 389rpx;
height: 119rpx;
background: #FFFFFF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
border-radius: 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
bottom: 100rpx;
display: flex;
align-items: center;
justify-content: center;
@ -192,12 +213,11 @@ page {
height: 119rpx;
filter: blur(8.600000381469727rpx);
background: rgba(0, 0, 0, 0.3);
border-radius: 100rpx 100rpx 100rpx 100rpx;
border-radius: 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
border-radius: 100rpx 100rpx 100rpx 100rpx;
bottom: 100rpx;
}

View File

@ -4,18 +4,24 @@
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
<view class="header_tit">{{ headerTitle }}</view>
</view>
<view class="local">
<image id="local" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_localIcon.png"
mode="aspectFill"></image>
{{ address }}
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="localBox">
<view class="localBoxItem">
<view class="local">
<image id="local"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_localIcon.png"
mode="aspectFill"></image>
{{ address }}
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="search">
<view class="searchBox">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="请输入您想搜索的内容" />
<view class="search">
<view class="searchBox">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="请输入您想搜索的内容" />
</view>
</view>
</view>
</view>
<view class="merchantList" v-if="merchatList.length > 0">
@ -69,11 +75,11 @@
<view class="btnList">
<view class="btn_left">
<!-- <view class="btn_left">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_serverIcon.png"
mode="aspectFill"></image>
到店服务券
</view>
</view> -->
<view class="line"></view>
<view class="btn_right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/lcoal_payIcon.png"

View File

@ -157,30 +157,32 @@ export default {
},
//
getCommentList() {
request(apiArr.getMerchantComment, "POST", {
page_num: this.page_num,
page_size: this.page_size,
merchant_id: this.info.id,
}).then(res => {
this.page_num++
if (res.rows.length == this.page_size) {
this.flag = true;
} else {
this.flag = false;
}
this.isShow = res.rows[0].merchant_info.quick_purchase_enabled == 1
const list = res.rows.filter((item) => {
return item.status == 2;
});
list.forEach(item => {
item.merchant_evaluation_reply_list =item.merchant_evaluation_reply_list.filter((item) => {
if (uni.getStorageSync('userId')) {
request(apiArr.getMerchantComment, "POST", {
page_num: this.page_num,
page_size: this.page_size,
merchant_id: this.info.id,
}).then(res => {
this.page_num++
if (res.rows.length == this.page_size) {
this.flag = true;
} else {
this.flag = false;
}
this.isShow = res.rows[0].merchant_info.quick_purchase_enabled == 1
const list = res.rows.filter((item) => {
return item.status == 2;
})
})
});
this.commentList = this.commentList.concat(list);
})
list.forEach(item => {
item.merchant_evaluation_reply_list = item.merchant_evaluation_reply_list.filter((item) => {
return item.status == 2;
})
})
this.commentList = this.commentList.concat(list);
})
}
},
getMerchantInfo() {

View File

@ -3,18 +3,30 @@ page {
}
.container {
/* padding-top: 100rpx; */
padding-bottom: 50rpx;
}
.localBox {
font-size: 26rpx;
color: #222222;
box-sizing: border-box;
width: 100%;
padding-bottom: 20rpx;
background-color: #f6f7fb;
}
.localBoxItem{
width: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
background-color: #fff;
}
.local {
display: flex;
align-items: center;
font-size: 26rpx;
color: #222222;
box-sizing: border-box;
padding: 20rpx;
width: 100%;
background-color: #fff;
width: auto;
white-space: nowrap;
}
#local {
@ -28,16 +40,16 @@ page {
}
.search {
background-color: #f6f7fb;
flex: 1;
padding: 20rpx 0;
margin-left: 15rpx;
}
.searchBox {
width: 710rpx;
width: 93%;
height: 70rpx;
background: #FFFFFF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
margin: 0 auto;
background: #f6f7fb;
border-radius: 100rpx;
display: flex;
box-sizing: border-box;
align-items: center;
@ -169,11 +181,11 @@ page {
width: 389rpx;
height: 119rpx;
background: #FFFFFF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
border-radius: 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
bottom: 100rpx;
display: flex;
align-items: center;
justify-content: center;
@ -185,13 +197,11 @@ page {
height: 119rpx;
filter: blur(8.600000381469727rpx);
background: rgba(0, 0, 0, 0.3);
border-radius: 100rpx 100rpx 100rpx 100rpx;
border-radius: 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
border-radius: 100rpx 100rpx 100rpx 100rpx;
bottom: 100rpx;
}
@ -235,7 +245,7 @@ page {
.lines {
background-color: #f5f7f9;
height: 40rpx;
height: 20rpx;
width: 100%;
}

View File

@ -1,17 +1,23 @@
<template>
<view class="container">
<view class="local">
<image id="local" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_localIcon.png"
mode="aspectFill"></image>
{{ address }}
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="localBox">
<view class="localBoxItem">
<view class="local">
<image id="local"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_localIcon.png"
mode="aspectFill"></image>
{{ address }}
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="search">
<view class="searchBox">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="请输入您想搜索的内容" />
<view class="search">
<view class="searchBox">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="请输入您想搜索的内容" />
</view>
</view>
</view>
</view>
@ -91,11 +97,11 @@
</view>
<view class="btnList">
<view class="btn_left">
<!-- <view class="btn_left">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_serverIcon.png"
mode="aspectFill"></image>
到店服务券
</view>
</view> -->
<view class="line"></view>
<view class="btn_right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/lcoal_payIcon.png"

View File

@ -1,8 +1,8 @@
<template>
<div class="container">
<div class="header" :style="{ paddingTop: top + 'px', height: localHeight + 'px' }">
<view class="container">
<view class="header" :style="{ paddingTop: top + 'px', height: localHeight + 'px' }">
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
</div>
</view>
<swiper class="swiper" autoplay>
<swiper-item v-for="(item, pageIndex) in info.bigImg" :key="pageIndex">
@ -10,76 +10,77 @@
</swiper-item>
</swiper>
<div class="swiper_boxshadow"></div>
<view class="swiper_boxshadow"></view>
<div class="Tit">
<view class="Tit">
<span>{{ info.merchant_name }}</span> 付款
</div>
</view>
<div class="Msg">
<div class="payMony">
<input type="number" v-model="Money" placeholder="付款金额" placeholder-style="font-size: 50rpx;"
@blur="handleMoneyInput" step="0.01" min="0.01"> </div>
<div class="payRemark">
<view class="Msg">
<view class="payMony">
<input type="number" v-model="Money" placeholder="付款金额" placeholder-style="font-size: 50rpx;" @blur="handleMoneyInput" @focus="showKeyboard" step="0.01" min="0.01">
<cu-keyboard ref="cukeyboard" @change="change" @confirm="keyboardConfirm" @hide="hide"></cu-keyboard>
</view>
<view class="payRemark">
<input type="text" v-model="remarks" placeholder="付款备注">
</div>
</div>
</view>
</view>
<div class="Msg2">
<div class="Msg2_tit">
<div class="Msg2_tit_left">获得物业公积金</div>
<div class="Msg2_tit_right" @click="choseComminty">
<view class="Msg2">
<view class="Msg2_tit">
<view class="Msg2_tit_left">获得物业公积金</view>
<!-- <view class="Msg2_tit_right" @click="choseComminty">
绑定房源
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</div>
</div>
</view> -->
</view>
<div class="Msg2_con">
<div class="Msg2_con_left">
<view class="Msg2_con">
<view class="Msg2_con_left">
<span>
{{ homeMoney }}
</span>
</div>
<div class="Msg2_con_right">
</view>
<!-- <view class="Msg2_con_right">
{{ room_name }}
</div>
</div>
</div>
</view> -->
</view>
</view>
<div class="Msg3">
<div class="Msg3_tit">获得积分</div>
<div class="Msg3_con">
<view class="Msg3">
<view class="Msg3_tit">获得积分</view>
<view class="Msg3_con">
{{ integral }}
</div>
</div>
</view>
</view>
<div class="btn" @click="pay">确认支付</div>
<view class="btn" @click="pay">确认支付</view>
<div class="btnList">
<div class="btnItem" @click="payList">付款记录</div>
<div class="line"></div>
<div class="btnItem" @click="homeMoneList">物业费公积金</div>
<div class="line"></div>
<div class="btnItem" @click="home">首页</div>
<div class="btnItem2" @click="changeBoxshadow">
<view class="btnList">
<view class="btnItem" @click="payList">付款记录</view>
<view class="line"></view>
<view class="btnItem" @click="homeMoneList">物业费公积金</view>
<view class="line"></view>
<view class="btnItem" @click="home">首页</view>
<view class="btnItem2" @click="changeBoxshadow">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_qrcode.png"
mode="aspectFill"></image>
本页二维码
</div>
</div>
</view>
</view>
<u-picker :show="show" :columns="[commintyList]" keyName="label" @confirm='confirm' @close='onClose'
@cancel='onClose' closeOnClickOverlay></u-picker>
<div class="boxshadow" @click="changeBoxshadow2" v-if="boxShow">
<div class="boxshadow_con">
<view class="boxshadow" @click="changeBoxshadow2" v-if="boxShow">
<view class="boxshadow_con">
<image :src="myCode" mode="aspectFill"></image>
</div>
</div>
</view>
</view>
</div>
</view>
</template>
<script>
@ -136,6 +137,48 @@ export default {
methods: {
showKeyboard() {
this.$refs.cukeyboard.open();
},
//
change(value) {
//
let formattedValue = value.toString().replace(/[^\d.]/g, '');
// 00
if (formattedValue.length >= 2 && formattedValue[0] === '0' && formattedValue[1] !== '.') {
formattedValue = formattedValue.substring(1);
}
//
formattedValue = formattedValue.replace(/\.{2,}/g, '.');
//
const parts = formattedValue.split('.');
if (parts.length > 1) {
formattedValue = parts[0] + '.' + parts[1].substring(0, 2);
}
//
if (formattedValue.startsWith('.')) {
formattedValue = '0' + formattedValue;
}
this.Money = formattedValue;
},
//
keyboardConfirm(value) {
//
if (value && value.endsWith('.')) {
value = value.slice(0, -1);
}
this.Money = value;
this.$refs.cukeyboard.close();
},
//
hide() {
//
},
handleMoneyInput() {
//
let value = this.Money.toString().replace(/[^\d.]/g, '');
@ -169,8 +212,8 @@ export default {
url: 'https://api.weixin.qq.com/cgi-bin/token',
data: {
grant_type: 'client_credential',
appid: "wxb4018c78fa143450",
secret: "82a3471a28fcbfe27d8eb4397b60069b"
appid: "wx1addb25675dd8e70",
secret: "1c153a91d0558b4c3834a4399ebc7496"
},
header: {
// 'custom-header': 'hello' //

View File

@ -1,54 +1,55 @@
<template>
<div class="container">
<div class="payInfoList">
<div class="PayInfoItem" v-for="item in payList">
<div class="row">
<div class="row_label">付款金额</div>
<div class="row_con">{{ item.order_amount }}</div>
</div>
<div class="row">
<div class="row_label2">{{item.create_time}}</div>
<div class="row_label2" v-if="false">Adapay微信小程序支付</div>
<div class="row_label2">{{item.payment_method}}</div>
</div>
<div class="line"></div>
<view class="container">
<view class="payInfoList">
<view class="PayInfoItem" v-for="item in payList">
<view class="row">
<view class="row_label">付款金额</view>
<view class="row_con">{{ item.order_amount }}</view>
</view>
<view class="row">
<view class="row_label2">{{item.create_time}}</view>
<view class="row_label2" v-if="false">Adapay微信小程序支付</view>
<view class="row_label2">{{item.payment_method}}</view>
</view>
<view class="line"></view>
<div class="row2">
<div class="label">订单号</div>
<div class="con3">{{item.order_no}}</div>
</div>
<view class="row2">
<view class="label">订单号</view>
<view class="con3">{{item.order_no}}</view>
</view>
<div class="row2">
<div class="label">消费门店</div>
<div class="con3">{{item.merchant_info.merchant_name}}</div>
</div>
<view class="row2">
<view class="label">消费门店</view>
<view class="con3">{{item.merchant_info.merchant_name}}</view>
</view>
<div class="row2">
<div class="label">当前状态</div>
<div class="con3" v-if="item.status == 1">已支付</div>
<div class="con3" v-if="item.status == 2">待支付</div>
<div class="con3" v-if="item.status == 3">已退款</div>
</div>
<view class="row2">
<view class="label">当前状态</view>
<view class="con3" v-if="item.status == 1">待支付</view>
<view class="con3" v-else-if="item.status == 2">已支付</view>
<view class="con3" v-else-if="item.status == 5">已退款</view>
<view class="con3" v-else>未知</view>
</view>
<div class="line"></div>
<view class="line"></view>
<div class="row3">
<div class="label">返物业费</div>
<div class="con3" @click="houseProvident">{{item.refund_property_fee}}
<view class="row3">
<view class="label">返物业费</view>
<view class="con3" @click="houseProvident">{{item.refund_property_fee}}
<u-icon name="arrow-right" color="#999999" size="40" style="max-lines: 10rpx;"></u-icon>
</div>
</div>
<div class="line"></div>
<div class="row">
<div class="label">返会员积分</div>
<div class="con3" @click="points">{{ item.refund_member_points }}
</view>
</view>
<view class="line"></view>
<view class="row">
<view class="label">返会员积分</view>
<view class="con3" @click="points">{{ item.refund_member_points }}
<u-icon name="arrow-right" color="#999999" size="40" style="max-lines: 10rpx;"></u-icon>
</div>
</div>
</view>
</view>
</div>
</div>
</div>
</view>
</view>
</view>
</template>
<script>

View File

@ -1,190 +0,0 @@
[
{
"id": 9001,
"after_sales_no": "AS202508130001",
"commodity_order_id": 1001,
"after_sales_status": 1,
"applicant": "张三",
"after_sales_reason": "拍错商品/不想要了",
"after_sales_type": 1,
"application_description": "请尽快处理退款",
"application_images": "http://localhost:8080/test.png",
"is_need_process": 1,
"process_status": 1,
"refund_amount": 68.00,
"after_sales_goods": "1@8001",
"refund_method": 1,
"review_status": 1,
"creator": "customer",
"create_time": "2025-08-13T11:20:00Z",
"commodity_order_item": [
{
"id": 7001,
"goods_id": 8001,
"goods_name": "澳洲牛排",
"is_support_same_day": 1,
"commodity_pic": "http://localhost:8080/test.png",
"sales_price": 68.00,
"count": 1,
"after_sales_status": 1
}
]
},
{
"id": 9002,
"after_sales_no": "AS202508130002",
"commodity_order_id": 1002,
"after_sales_status": 1,
"after_sales_type": 1,
"refund_no": "RF202508130001",
"refund_completed_time": "2025-08-13T14:30:00Z",
"is_need_process": 2,
"process_status": 2,
"refund_amount": 45.80,
"after_sales_goods": "2@8004",
"refund_method": 1,
"review_status": 2,
"review_remark": "审核通过,已原路退款",
"reviewer": "客服008",
"review_time": "2025-08-13T14:15:00Z",
"create_time": "2025-08-13T13:45:00Z",
"commodity_order_item": [
{
"id": 7004,
"goods_id": 8004,
"goods_name": "东北大米",
"sales_price": 22.90,
"count": 2,
"after_sales_status": 3
}
]
},
{
"id": 9003,
"after_sales_no": "AS202508130003",
"commodity_order_id": 1003,
"after_sales_status": 1,
"applicant": "李四",
"after_sales_reason": "商品质量问题",
"after_sales_type": 2,
"application_description": "商品包装破损",
"application_images": "http://localhost:8080/test.png",
"return_description": "已通过顺丰寄回",
"return_images": "http://localhost:8080/test.png",
"return_tracking_no": "SF1234567890",
"return_logistics_company": "顺丰速运",
"return_contact_phone": "13800138000",
"is_need_process": 1,
"process_status": 1,
"refund_amount": 152.00,
"after_sales_goods": "1@8003",
"refund_method": 1,
"review_status": 1,
"create_time": "2025-08-13T15:30:00Z",
"commodity_order_item": [
{
"id": 7003,
"goods_id": 8003,
"goods_name": "精品榴莲",
"sales_price": 152.00,
"count": 1,
"after_sales_status": 1
}
]
},
{
"id": 9004,
"after_sales_no": "AS202508130004",
"after_sales_type": 2,
"after_sales_status": 1,
"process_status": 2,
"refund_amount": 39.90,
"review_status": 2,
"review_remark": "商品已验货,符合退款条件",
"reviewer": "质检005",
"review_time": "2025-08-13T16:45:00Z",
"refund_no": "RF202508130002",
"refund_completed_time": "2025-08-13T17:30:00Z",
"create_time": "2025-08-13T09:30:00Z",
"commodity_order_item": [
{
"id": 7005,
"goods_name": "酸奶套装",
"sales_price": 39.90,
"count": 1,
"after_sales_status": 2
}
]
},
{
"id": 9005,
"after_sales_no": "AS202508130005",
"commodity_order_id": 1004,
"after_sales_type": 3,
"after_sales_status": 1,
"applicant": "王五",
"after_sales_reason": "商品发错型号",
"application_description": "购买的是XL码收到L码",
"application_images": "http://localhost:8080/test.png",
"is_need_process": 1,
"process_status": 1,
"after_sales_goods": "1@8006",
"receiving_address": "上海市浦东新区张江高科88号",
"review_status": 1,
"create_time": "2025-08-13T10:15:00Z",
"commodity_order_item": [
{
"id": 7006,
"goods_id": 8006,
"goods_name": "冷冻虾仁",
"sales_price": 76.50,
"count": 1,
"after_sales_status": 1
}
]
},
{
"id": 9006,
"after_sales_no": "AS202508130006",
"after_sales_type": 3,
"after_sales_status": 1,
"process_status": 2,
"processor": "客服012",
"process_time": "2025-08-13T14:20:00Z",
"process_remark": "已补发新商品物流单号YT987654321",
"review_status": 2,
"reviewer": "客服主管",
"review_time": "2025-08-13T13:40:00Z",
"create_time": "2025-08-13T09:00:00Z",
"commodity_order_item": [
{
"id": 7007,
"goods_id": 8007,
"goods_name": "进口橙子",
"sales_price": 32.00,
"count": 2,
"after_sales_status": 2
}
]
},
{
"id": 9007,
"after_sales_no": "AS202508130007",
"after_sales_status": 2,
"revoke_time": "2025-08-13T11:05:00Z",
"after_sales_type": 1,
"applicant": "赵六",
"after_sales_reason": "商品运输损坏",
"create_time": "2025-08-13T10:30:00Z",
"update_time": "2025-08-13T11:05:00Z",
"commodity_order_item": [
{
"id": 7002,
"goods_name": "有机西兰花",
"sales_price": 10.50,
"count": 1,
"after_sales_status": 4
}
]
}
]

View File

@ -41,6 +41,7 @@
}
.company-name {
width: 550rpx;
font-size: 32rpx;
font-weight: bold;
}
@ -93,8 +94,7 @@
.goods-desc {
font-size: 26rpx;
color: #ff4d4f;
background-color: #fff2f0;
color: #999999;
padding: 4rpx 12rpx;
border-radius: 8rpx;
display: inline-block;

View File

@ -5,9 +5,9 @@
<!-- 头部信息 -->
<view class="header">
<view class="company-info">
<text class="company-name">{{ item.commodity_order_item[0].goods_name || '衡水喜屏传媒有限公司'
}}</text>
<text class="after-sale-no">退货退款</text>
<view class="company-name">{{ item.commodity_order_item[0].goods_name }}</view>
<text class="after-sale-no">{{ item.after_sales_type === 1 ? '退款' : (item.after_sales_type === 2
? '退货退款' : '换货') }}</text>
</view>
<text class="order-time">提交订单{{ formatDate(item.create_time) }}</text>
</view>
@ -22,7 +22,7 @@
{{ ite.goods_name }}
<text class="refund-amount">退款¥{{ ite.sales_price }}</text>
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-desc">{{ ite.goods_spec }}</text>
<view class="price-count">
<text class="goods-price">¥{{ ite.sales_price }}/</text>
<text class="goods-count">x{{ ite.count }}</text>
@ -31,9 +31,9 @@
</view>
<!-- 退款状态 -->
<view class="status-container">
<view class="status-container" v-if="showStatus">
<view class="status-item" @click="pendingPage(item)">
<text class="status-label">{{ getStatusText(item.after_sales_status) }}</text>
<text class="status-label">{{ getStatusText(item) }}</text>
<text class="status-desc">商家将在<text style="color: #e73b05;">{{
calculateProcessingTime(item.create_time) }}</text>内处理</text>
<view class="arrow-right"></view>
@ -41,9 +41,9 @@
</view>
<!-- 操作按钮 -->
<view class="action-buttons">
<button class="modify-btn" @click="modifyApplication">修改申请</button>
<button class="cancel-btn" @click="cancelApplication">撤销申请</button>
<view class="action-buttons" v-if="showStatus">
<button class="modify-btn" @click="modifyApplication(item)">修改申请</button>
<button class="cancel-btn" @click="cancelApplication(item)">撤销申请</button>
</view>
</view>
</view>
@ -52,7 +52,7 @@
</template>
<script>
import afterSaleData from './afterSale.json';
import { apiArr } from "../../../api/afterSale";
import {
isPhone,
picUrl,
@ -62,22 +62,60 @@ import {
} from '../../../utils';
export default {
props: {
afterSaleList: {
type: Array,
default: () => []
},
order_cate: {
type: Number,
default: 1,
},
},
data() {
return {
currentAfterSale: afterSaleData
currentAfterSale: this.afterSaleList,
showStatus: true,
};
},
onLoad() {
watch: {
afterSaleList: {
handler(newVal) {
this.currentAfterSale = newVal;
},
deep: true
}
},
methods: {
getStatusText(status) {
//
getList() {
const params = {
user_id: uni.getStorageSync('userId'),
order_cate: this.order_cate,
}
request(apiArr.afterSalesList, "POST", params).then((res) => {
res.after_sales_list.forEach(item => {
item.commodity_order_item?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.currentAfterSale = res.after_sales_list;
});
},
getStatusText(item) {
if (item.after_sales_status === 2) {
return '已撤销';
}
if (item.process_status === 2) {
this.showStatus = false;
return '已完成';
} else if (item.process_status === 3) {
return '已取消';
}
const status = item.review_status;
const statusMap = {
1: '商家待处理',
2: '已撤销',
3: '已完成',
4: '已拒绝'
2: '商家已同意',
3: '商家已拒绝',
};
return statusMap[status] || '未知状态';
},
@ -95,29 +133,51 @@ export default {
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
modifyApplication() {
console.log('修改申请');
modifyApplication(item) {
NavgateTo(`../apply/index?item=${JSON.stringify(item)}`);
},
cancelApplication() {
cancelApplication(item) {
uni.showModal({
title: '提示',
content: '确定要撤销退款申请吗?',
success: (res) => {
if (res.confirm) {
console.log('撤销申请');
uni.navigateBack();
const params = {
id: item.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
this.getList();
uni.showToast({
title: '订单撤销成功',
icon: 'success',
// duration: 1500,
// success: () => {
// this.$emit('revokeApply');
// }
});
});
}
}
});
},
pendingPage(item) {
NavgateTo(`/packages/myOrders/pending/index?item=${JSON.stringify(item)}`); //
// NavgateTo(`/packages/myOrders/sendBack/index?item=${JSON.stringify(item)}`); //
// NavgateTo(`/packages/myOrders/refundOver/index?item=${JSON.stringify(item)}`); //退
// NavgateTo(`/packages/myOrders/changeInfo/index?item=${JSON.stringify(item)}`); //
}
// NavgateTo(`/packages/myOrders/sendBack/index?item=${JSON.stringify(item)}`);
}
if (item.after_sales_type === 3) {
if (item.review_status === 2) {
NavgateTo(`/packages/myOrders/sendBack/index?item=${JSON.stringify(item)}`); //
return;
}
NavgateTo(`/packages/myOrders/changeInfo/index?item=${JSON.stringify(item)}`)
} else {
if (item.refund_completed_time) {
NavgateTo(`/packages/myOrders/refundOver/index?item=${JSON.stringify(item)}`); //退
return;
}
NavgateTo(`/packages/myOrders/pending/index?item=${JSON.stringify(item)}`);
}
}
},
};
</script>

View File

@ -72,7 +72,7 @@
退货退款</view>
<view :class="['asTab2', selectedAfterSaleType2 === 1 ? 'active' : '']"
@click="selectAfterSaleType2(1)">
退
退
</view>
</view>
<view class="reason-list" v-if="selectedAfterSaleType2 === 0">
@ -103,14 +103,15 @@ import {
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from "../../../api/afterSale";
export default {
data() {
return {
currentAfterSale: null,
afterSalePopup2: false,
afterSalePopup3: false,
selectedAfterSaleType2: 0, // 0:退/退, 1:退
selectedAfterSaleType2: 0, // 0:退/退, 1:退
selectedAsReason: 0,
selectedServiceType: '',
selectedRefundReason: '',
@ -119,9 +120,10 @@ export default {
postage: 0,
refundDescription: '',
refundMethod: '自行寄回',
merchantAddress: '衡水市路北街道中心北大街世纪名城41号楼',
merchantContact: '高尚 18032753127',
merchantAddress: '',
merchantContact: '',
imgList: [],
afterSalesType: 2,
applyRefundReasons: [
'商品质量问题',
'商品与描述不符',
@ -143,8 +145,10 @@ export default {
this.currentAfterSale = item;
// 退
if (item) {
this.refundAmount = item.sales_price || 0;
this.refundAmount = item.refund_amount || 0;
this.maxRefundAmount = item.sales_price || 0;
this.merchantAddress = item.supplier_address || '未设置';
this.merchantContact = `${item.supplier_name} ${item.supplier_phone}` || '未设置';
}
},
methods: {
@ -153,12 +157,13 @@ export default {
this.afterSalePopup2 = false;
},
closeAfterSalePopup3() {
this.afterSalePopup3 = false;
},
//
selectAfterSaleType2(index) {
if (index == 0) {
this.afterSalesType = 2;
} else {
this.afterSalesType = 1;
}
this.selectedAfterSaleType2 = index;
},
@ -169,7 +174,7 @@ export default {
// 退
confirmAfterSaleCancel2() {
const afterSaleTypes = ['退货退款', '退'];
const afterSaleTypes = ['退货退款', '退'];
const selectedType = afterSaleTypes[this.selectedAfterSaleType2];
console.log('选中的售后类型:', selectedType);
@ -191,7 +196,6 @@ export default {
// 退
openAfterSalePopup2(type) {
this.afterSalePopup3 = false;
this.afterSalePopup2 = true;
},
@ -213,16 +217,14 @@ export default {
// 退
modifyRefundAmount() {
console.log('修改退款金额');
// 退
},
//
viewAddressDetails() {
console.log('查看地址详情');
//
},
// 退
//
submitRefundApplication() {
if (!this.selectedServiceType || !this.selectedRefundReason) {
uni.showToast({
@ -232,26 +234,38 @@ export default {
return;
}
//
const refundInfo = {
serviceType: this.selectedServiceType,
refundReason: this.selectedRefundReason,
refundAmount: this.refundAmount,
maxRefundAmount: this.maxRefundAmount,
postage: this.postage,
refundDescription: this.refundDescription,
refundMethod: this.refundMethod,
merchantAddress: this.merchantAddress,
merchantContact: this.merchantContact,
imgList: this.imgList
};
console.log('提交退款申请:', refundInfo);
const params = {
id: this.currentAfterSale.id,
after_sales_type: this.afterSalesType,
after_sales_reason: this.selectedRefundReason,
refund_amount: this.refundAmount,
application_description: this.refundDescription,
application_images: this.imgList && this.imgList.length > 0 ?
this.imgList.map(img => img.url).join(',') : '',
receiving_address: this.merchantAddress
}
console.log("🚀 ~ submitRefundApplication ~ params:", params)
request(apiArr.updateApply, "POST", params).then((res) => {
uni.showToast({
title: '申请提交成功',
icon: 'success'
});
this.afterSalePopup3 = false;
//
uni.showToast({
title: '退款申请提交成功',
icon: 'success'
//
const updatedAfterSale = {
...this.currentAfterSale,
after_sales_type: this.afterSalesType,
after_sales_reason: this.selectedRefundReason,
refund_amount: this.refundAmount,
application_description: this.refundDescription,
application_images: this.imgList && this.imgList.length > 0 ?
this.imgList.map(img => img.url).join(',') : ''
};
setTimeout(() => {
this.currentAfterSale = updatedAfterSale;
uni.setStorageSync('afterSaleItem', updatedAfterSale);
}, 1500);
});
}
}

View File

@ -2,27 +2,23 @@
<view class="order-list">
<view class="order-item" v-for="(item, index) in orderList" :key="index">
<view class="order-header">
<text class="order-name">{{ item.orderName }}</text>
<text class="order-number">{{ item.orderNumber }}</text>
<text class="order-name">{{ item.supplier_name }}</text>
<text class="order-number">{{ item.order_no }}</text>
</view>
<view class="product-list">
<view
class="product-item"
v-for="(product, pIndex) in item.products"
:key="pIndex"
>
<view class="product-item" v-for="(product, pIndex) in item.commodity_order_item_list" :key="pIndex">
<view class="product-info">
<view class="product-img">
<image :src="product.imageUrl" mode="aspectFit"></image>
<view class="tag" v-if="product.tag">{{ product.tag }}</view>
<image :src="product.commodity_pic"></image>
<view class="tag" v-if="product.is_same_day === 1">当日达</view>
</view>
<view class="product-details">
<text class="product-name">{{ product.name }}</text>
<text class="product-spec">{{ product.spec }}</text>
<text class="product-unit">{{ product.unit }}</text>
<text class="product-name">{{ product.goods_name }}</text>
<text class="product-spec">{{ product.goods_spec }}</text>
<text class="product-unit">{{ product.sales_price }}/{{ product.goods_unit }}</text>
</view>
</view>
<button class="evaluate-btn" @click="evaluateOrder(product)">
<button class="evaluate-btn" @click="evaluateOrder(item)">
评价
</button>
</view>
@ -35,64 +31,35 @@
import { request, NavgateTo } from "../../../utils";
export default {
props: {
orderData: {
type: Array,
default: () => []
}
},
data() {
return {
orderList: [
{
orderName: "衡水商贸国际公司",
orderNumber: "4534534255",
products: [
{
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tag: "当日达",
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
{
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tag: "当日达",
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
],
},
{
orderNumber: "54352342331",
products: [
{
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tag: "",
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
{
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tag: "",
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
{
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tag: "",
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
],
},
],
orderList: [],
};
},
methods: {
evaluateOrder(item) {
console.log("🚀 ~ evaluateOrder ~ orderNumber:", item);
NavgateTo(`../evaluate/index?item=${JSON.stringify(item)}`);
},
},
mounted() {
//
this.orderList = this.orderData;
},
watch: {
// orderData
orderData: {
handler(newVal) {
this.orderList = newVal;
},
deep: true
}
}
};
</script>

View File

@ -213,12 +213,9 @@ page {
.goods-desc {
font-size: 26rpx;
color: #ff4d4f;
background-color: #fff2f0;
padding: 4rpx 12rpx;
color: #999999;
border-radius: 8rpx;
display: inline-block;
margin: 10rpx 0;
}
.goods-price {

View File

@ -1,7 +1,7 @@
<template>
<view class="container page">
<!-- 进度指示器 -->
<view class="process-steps_top" v-if="false">
<view class="process-steps_top" v-if="currentAfterSale.process_status === 1">
<view class="step-item">
<view class="step-line"></view>
<view class="step-circle active"></view>
@ -30,15 +30,15 @@
</view>
</view>
<view class="status-tip" v-if="false">
<view class="status-tip" v-if="currentAfterSale.process_status === 3">
<text class="status-title">换货关闭</text>
<text class="status-desc">2025年7月25日 11:30</text>
<text class="status-desc">{{ formatDate(currentAfterSale.revoke_time) }}</text>
<text class="status-desc">由于您主动撤销换货申请,换货关闭</text>
</view>
<view class="status-tip">
<view class="status-tip" v-if="currentAfterSale.review_status === 3">
<text class="status-title">换货关闭</text>
<text class="status-desc">2025年7月25日 11:30</text>
<text class="status-desc">{{ formatDate(currentAfterSale.review_time) }}</text>
<text class="status-desc" style="color: #f63b08;">商家拒绝了您的换货申请,换货关闭</text>
</view>
@ -59,16 +59,14 @@
class="copy-icon" @click="copyRefundNo"/> -->
</view>
</view>
<image src="http://localhost:8080/af_update_address.png" class="icon_2" />
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/af_update_address.png"
class="icon_2" />
</view>
</view>
</view>
<button class="addOrderIdBtn" @click="addOrderId">填写单号</button>
</view>
<!-- 商品信息 -->
<view>
<view class="goods-info">
@ -82,10 +80,10 @@
v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</text>
{{ currentAfterSale.commodity_order_item[0].goods_name }}
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-desc">{{ currentAfterSale.commodity_order_item[0].goods_spec }}</text>
<text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
<text class="goods-count">X{{ currentAfterSale.after_sales_goods.split('@')[0] }}</text>
</text>
</view>
</view>
@ -105,7 +103,7 @@
</view>
<view class="info-item">
<text class="info-label">换货数量</text>
<text class="info-value">{{ currentAfterSale.commodity_order_item[0].count }}</text>
<text class="info-value">{{ currentAfterSale.change_goods }}</text>
</view>
<view class="info-item">
<text class="info-label">申请时间</text>
@ -118,7 +116,7 @@
</view>
<view class="info-item">
<text class="info-label">收货地址</text>
<text class="info-value">{{ currentAfterSale.user_address }}</text>
<text class="info-value">{{ currentAfterSale.receiving_address }}</text>
</view>
<view class="info-item" v-if="false">
<text class="info-label">退款完结</text>
@ -128,7 +126,7 @@
</view>
<!-- 操作按钮 -->
<view class="action-buttons" v-if="false">
<view class="action-buttons" v-if="currentAfterSale.process_status === 1">
<button class="cancel-btn" @click="cancelRefund">撤销申请</button>
<button class="urge-btn" @click="modifyRefund">修改申请</button>
</view>
@ -199,6 +197,7 @@ import {
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from "../../../api/afterSale";
export default {
data() {
@ -219,7 +218,7 @@ export default {
},
methods: {
getServiceTypeText(type) {
return type === 1 ? '退货退款' : '仅退款';
return type === 1 ? '仅退款' : (type === 2 ? '退货退款' : '换货');
},
//
@ -281,10 +280,14 @@ export default {
confirmColor: "#ff4d4f",
success: (res) => {
if (res.confirm) {
//
uni.showToast({
title: '订单撤销成功',
icon: 'success'
const params = {
id: this.currentAfterSale.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
});
}
},

View File

@ -6,11 +6,11 @@
<!-- 订单编号 -->
<view class="order-info">
<text class="order-label">订单编号</text>
<text class="order-value">38757328485</text>
<text class="order-value">{{ itemObj.order_no }}</text>
</view>
<view class="goods">
<view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png" class="goodsImg"></image>
<image :src="itemObj.commodity_order_item_list[0].commodity_pic" class="goodsImg"></image>
</view>
<view class="rating">
<view>很差</view>
@ -23,70 +23,38 @@
<!-- 商品品质 -->
<view class="rating-item">
<text class="rating-label">商品品质</text>
<u-rate
v-model="qualityRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="qualityRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 配送速度 -->
<view class="rating-item">
<text class="rating-label">配送速度</text>
<u-rate
v-model="speedRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="speedRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 快递员服务 -->
<view class="rating-item">
<text class="rating-label">快递员服务</text>
<u-rate
v-model="serviceRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="serviceRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 评价输入 -->
<view class="comment-section">
<textarea
class="comment-input"
placeholder="展开说说对商品的想法吧…"
v-model="comment"
></textarea>
<textarea class="comment-input" placeholder="展开说说对商品的想法吧…" v-model="comment"></textarea>
</view>
<!-- 图片上传 -->
<view class="upload-section">
<view class="image-list">
<view
class="image-item"
v-for="(img, index) in imageList"
:key="index"
>
<view class="image-item" v-for="(img, index) in imageList" :key="index">
<image :src="img" class="uploaded-img"></image>
<view class="delete-btn" @click="deleteImage(index)">
<text class="delete-icon">×</text>
</view>
</view>
</view>
<view
class="upload-btn"
@click="chooseImage"
v-if="imageList.length < 3"
>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/upload.png"
class="upload-icon"
></image>
<view class="upload-btn" @click="chooseImage" v-if="imageList.length < 3">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/upload.png" class="upload-icon">
</image>
<view class="upload-text">上传图片</view>
<view class="upload-count">({{ imageList.length }}/3)</view>
</view>
@ -101,31 +69,22 @@
<script>
import uImage from "../../../uni_modules/uview-ui/components/u--image/u--image.vue";
import { picUrl, NavgateTo, request } from "../../../utils";
import { apiArr } from "../../../api/afterSale";
export default {
components: { uImage },
data() {
return {
//
goods: [
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index1.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index2.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index3.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index4.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index5.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index1.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index2.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index3.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index4.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index5.png" },
],
//
qualityRating: 5,
qualityRating: 0,
speedRating: 0,
serviceRating: 0,
//
comment: "",
//
imageList: [],
itemObj: {},
};
},
methods: {
@ -160,19 +119,29 @@ export default {
});
return;
}
//
uni.showToast({
title: "评价提交成功",
icon: "success",
const params = {
order_id: this.itemObj.id,
goods_id: this.itemObj.commodity_order_item_list[0].goods_id,
user_id: uni.getStorageSync("userId"),
quality_score: this.qualityRating,
speed_score: this.speedRating,
service_score: this.serviceRating,
user_review: this.comment,
review_image: this.imageList,
}
request(apiArr.createReview, "POST", params).then((res) => {
uni.showToast({
title: "评价提交成功",
icon: "success",
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
},
},
onLoad(options) {
console.log("🚀 ~ onLoad ~ options:", options);
const itemObj = JSON.parse(decodeURIComponent(options.item));
this.itemObj = JSON.parse(decodeURIComponent(options.item));
},
};
</script>

View File

@ -0,0 +1,594 @@
page {
background-color: #f6f7fb;
padding-bottom: 50rpx;
min-height: 100vh;
}
.tabs {
display: flex;
align-items: center;
background: #ffffff;
height: 100rpx;
padding: 0 20rpx;
box-sizing: border-box;
display: flex;
overflow-x: auto;
white-space: nowrap;
}
.tabItem {
font-size: 25rpx;
color: #222222;
margin-right: 60rpx;
height: 42rpx;
}
.active2 {
font-size: 25rpx;
font-weight: 700;
position: relative;
}
.active2::after {
content: '';
background: url(https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_active.png) no-repeat;
background-size: 100% 100%;
width: 52rpx;
height: 22rpx;
position: absolute;
left: 50%;
bottom: -16rpx;
transform: translateX(-50%);
}
.contentList {
margin: 20rpx;
min-height: 250rpx;
background-color: #ffffff;
border-radius: 20rpx;
padding: 10rpx;
}
.order-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
font-size: 24rpx;
color: #a3a3a3;
border-bottom: 1rpx solid #eee;
}
.orderTitle {
width: 100%;
font-size: 24rpx;
font-weight: bold;
}
.orderTitleSupplier {
font-size: 28rpx;
color: #333;
font-weight: bold;
margin-bottom: 10rpx;
display: flex;
justify-content: space-between;
}
.status {
color: #ff5252;
font-weight: bold;
font-size: 24rpx;
}
.status2 {
color: #333;
font-weight: bold;
border: 1rpx solid #f83d19;
display: flex;
padding: 10rpx;
border-radius: 10rpx;
font-size: 24rpx;
}
.status2 img {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.status3 {
color: #949494;
font-weight: bold;
font-size: 24rpx;
}
.order_status{
color: #333;
font-weight: bold;
font-size: 24rpx;
}
.goods-list {
display: flex;
flex-wrap: wrap;
padding: 15rpx;
gap: 15rpx;
}
.goods-item {
width: 120rpx;
height: 120rpx;
}
.goods-img {
width: 100%;
height: 100%;
border-radius: 8rpx;
}
.order-footer {
padding: 15rpx;
margin-top: 20rpx;
border-top: 1rpx solid #eee;
}
.order-footer-text {
font-size: 24rpx;
display: flex;
justify-content: flex-end;
}
.order-footer-text text {
color: #ff3710;
margin-left: 10rpx;
font-weight: bold;
}
.btn-group {
display: flex;
justify-content: flex-end;
margin-top: 30rpx;
}
.cancel-btn {
width: 160rpx;
height: 60rpx;
background: #d9d9d9;
color: black;
border: 1rpx solid #ddd;
border-radius: 30rpx;
font-size: 24rpx;
margin: 0;
}
.afterSaleNum {
font-size: 26rpx;
color: #ff3710;
align-items: center;
display: flex;
position: relative;
right: 230rpx;
font-weight: bold;
}
.yfd-btn {
width: 160rpx;
height: 60rpx;
background: #ffebcb;
color: #802002;
border: none;
border-radius: 30rpx;
font-size: 24rpx;
margin: 0 20rpx;
}
.pay-btn {
width: 160rpx;
height: 60rpx;
background: #ff5252;
color: #fff;
border: none;
border-radius: 30rpx;
font-size: 24rpx;
margin: 0;
margin-left: 15rpx;
}
.required{
color: red;
}
.cancel-reason-container {
width: 100%;
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx;
box-sizing: border-box;
max-height: 80vh;
overflow-y: auto;
}
.asType {
margin-bottom: 30rpx;
}
.asType text {
font-size: 28rpx;
color: #333;
display: block;
margin-bottom: 20rpx;
}
.asTabs {
display: flex;
gap: 20rpx;
}
.asTab {
padding: 15rpx 20rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: #333;
}
.asTab.active {
border: 1rpx solid #ff5252;
color: #ff5252;
}
.asTabs2 {
display: flex;
justify-content: space-between;
}
.asTab2 {
width: 50%;
padding: 15rpx 20rpx;
font-size: 28rpx;
color: #333;
text-align: center;
}
.asTab2.active {
border-bottom: 1rpx solid #ff5252;
color: #ff5252;
margin-bottom: 20rpx;
}
.asGoodsInfo {
margin-bottom: 30rpx;
}
.asGoodInfo {
display: flex;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
position: relative;
}
.asGoodRadio{
margin-top: 60rpx;
}
.asGoodImg {
width: 160rpx;
height: 160rpx;
border-radius: 20rpx;
margin-right: 20rpx;
object-fit: cover;
}
.asGoodDetail {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.asGoodTitle {
font-size: 28rpx;
color: #333;
line-height: 40rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.asGoodTag {
background-color: #ff7d00;
color: white;
font-size: 22rpx;
padding: 5rpx 10rpx;
border-radius: 20rpx 0 20rpx 20rpx;
}
.asGoodTag1 {
margin-right: 15rpx;
}
.tag-img {
position: absolute;
top: 145rpx;
left: 130rpx;
z-index: 1;
}
.asGoodDesc {
font-size: 24rpx;
color: #999;
}
.asGoodPrice {
font-size: 28rpx;
color: #ff5252;
font-weight: bold;
}
.asGoodNum {
font-size: 28rpx;
color: #333;
align-self: flex-start;
margin-top: 120rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
color: #333;
}
.reason-list {
margin-bottom: 30rpx;
}
.reason-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.radio {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #999;
margin-right: 20rpx;
position: relative;
}
.radio.active {
border-color: #e60012;
}
.radio.active::after {
content: '';
position: absolute;
width: 14rpx;
height: 14rpx;
background-color: #e60012;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.reason-item text {
font-size: 28rpx;
color: #333;
}
.confirm-btn {
width: 100%;
height: 88rpx;
background-color: #ff451b;
color: #fff;
font-size: 32rpx;
border-radius: 44rpx;
line-height: 88rpx;
text-align: center;
margin-top: 20rpx;
border: none;
}
.noSalePopup {
padding: 50rpx 50rpx 0 50rpx;
text-align: center;
}
.noSalePopup-btn {
width: 250rpx;
height: 70rpx;
background-color: #e60012;
color: #fff;
font-size: 32rpx;
border-radius: 44rpx;
line-height: 70rpx;
text-align: center;
margin-top: 40rpx;
border: none;
}
/* 确认退款信息弹窗样式 */
.refund-info-container {
background-color: #ffffff;
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
}
.refund-title {
font-size: 32rpx;
color: #333333;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
}
.refund-item {
display: flex;
margin-bottom: 26rpx;
padding-bottom: 26rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.hr{
position: relative;
left: -30rpx;
right: -30rpx;
width: 120%;
height: 20rpx;
background-color: #f0f2f5;
margin-top: 20rpx;
margin-bottom: 30rpx;
}
.refund-item2 {
margin-bottom: 26rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.refund-item:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.refund-label {
width: 200rpx;
font-size: 28rpx;
color: #333333;
display: flex;
align-items: center;
}
.refund-value {
flex: 1;
font-size: 28rpx;
color: #666666;
text-align: right;
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
}
.price {
color: #ff4d4f;
font-size: 32rpx;
font-weight: bold;
}
.modify-btn {
color: #989898;
font-size: 26rpx;
margin-left: 15rpx;
}
.refund-hint {
font-size: 24rpx;
color: #999999;
text-align: right;
position: absolute;
top: 45rpx;
}
.refund-description {
width: 100%;
height: 160rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
font-size: 26rpx;
color: #333333;
resize: none;
margin-top: 10rpx;
}
.refund-attachment {
margin-top: 20rpx;
}
.upload-btn {
display: flex;
align-items: center;
font-size: 26rpx;
color: #1989fa;
}
.upload-icon {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
.contact-info {
font-size: 26rpx;
color: #666666;
margin-top: 10rpx;
text-align: right;
}
.submit-btn {
width: 100%;
height: 90rpx;
background-color: #ff4d4f;
color: #ffffff;
font-size: 32rpx;
border-radius: 45rpx;
margin-top: 30rpx;
display: flex;
justify-content: center;
align-items: center;
border: none;
}
.arrow-right {
display: inline-block;
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid #999999;
border-right: 2rpx solid #999999;
transform: rotate(45deg);
margin-left: 10rpx;
}
/* 图片上传 */
.imgCon {
font-size: 18rpx;
color: #222222;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 120rpx;
height: 120rpx;
background: #F6F7FB;
border: 1rpx solid #D1D1D1;
border-radius: 10rpx 10rpx 10rpx 10rpx;
margin: 20rpx 0;
}
.imgCon image {
width: 34rpx;
height: 34rpx;
margin-bottom: 8rpx;
}
.u-upload__wrap__preview {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx 0rpx 10rpx 10rpx !important;
margin-top: 20rpx !important;
}
.u-upload__wrap__preview__image {
width: 100% !important;
height: 100% !important;
object-fit: cover;
}

View File

@ -0,0 +1,416 @@
<template>
<view class="container">
<view class="tabs">
<view v-for="(item, index) in categoryList" :key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</view>
</view>
<view class="content">
<view v-if="selectedTab === 6">
<awaitRated :orderData="orderData" />
</view>
<view v-else-if="selectedTab === 7">
<rated :orderData="orderData" />
</view>
<view v-else-if="selectedTab === 8">
<afterSale :afterSaleList="afterSaleList" @revokeApply="revokeApply" />
</view>
<view v-else>
<view v-for="(item, index) in orderData" :key="index">
<view class="contentList">
<!-- 订单头部信息 -->
<view class="order-header" @click="toDetails(item)">
<view class="orderTitle">
<view class="orderTitleSupplier">{{ item.supplier_name }}
<view v-if="item.order_status == 6 || item.order_status == 5" class="status3">{{
getOrderStatus(item.order_status) }}</view>
<view v-else-if="item.order_status == 7" class="status2">
<img src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/refund.png" />
{{ getOrderStatus(item.order_status) }}
</view>
<view v-else class="order_status">{{
getOrderStatus(item.order_status)
}}</view>
</view>
<text>提交订单{{ item.order_time }}</text>
</view>
</view>
<!-- 商品列表 -->
<view class="goods-list" @click="toDetails(item)">
<view v-for="(goods, goodsIndex) in item.commodity_order_item_list" :key="goodsIndex" class="goods-item">
<image :src="goods.commodity_pic" class="goods-img"></image>
</view>
</view>
<!-- 订单底部信息 -->
<view class="order-footer">
<view class="order-footer-text" @click="toDetails(item)">{{ item.total_count }}件商品共计
<text> {{ item.total_amount }}</text>
</view>
<view>
<view class="btn-group" v-if="item.order_status === 1">
<button class="cancel-btn" @click="cancelOrder(item)">
取消订单
</button>
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="pay-btn" @click="goToPay(item)">立即支付</button>
</view>
<view class="btn-group" v-if="item.order_status === 3">
<button class="cancel-btn" @click="applyRefund(item)">申请退款</button>
</view>
<view class="btn-group" v-if="item.order_status === 4">
<button class="cancel-btn" @click="viewLogistics(item)">查看物流</button>
<button class="pay-btn" @click="confirmReceiving(item)">确认收货</button>
</view>
<view class="btn-group" v-if="item.order_status === 5">
<!-- <text class="afterSaleNum">{{ item.commodity_order_item_list.length }}笔售后</text> -->
<button class="cancel-btn" @click="afterSale(item)">退换/售后</button>
<button class="pay-btn" @click="orderEvaluate(item)" :disabled="item.evauate_status === 1">评价</button>
</view>
<view class="btn-group" v-if="item.order_status === 6">
<!-- <button class="cancel-btn" @click="orderEvaluate">
服务评价
</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<!-- <button class="pay-btn" @click="goToPay(item)">再来一单</button> -->
</view>
<view class="btn-group" v-if="item.order_status === 7">
<!-- <button class="pay-btn" @click="goToPay(item)">再来一单</button> -->
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!------------------ 以下为popup ------------------>
<!-- 取消订单 -->
<cancel-order-popup :showPopup.sync="showPopup" @orderCancelled="handleOrderCancelled" />
<!-- 申请退款 -->
<refund-popup :showPopup.sync="showTkPopup" @refundConfirmed="handleRefundConfirmed" />
<!-- 退换 售后 - 选择退款原因 -->
<!-- 售后弹窗组件 -->
<after-sale-popup :afterSaleGoods.sync="afterSaleGoods" :orderItem="afterSaleOrderItem" ref="afterSalePopupRef"
@refundSubmitted="handleRefundSubmitted" :order_cate="2" />
<!-- 无售后商品 -->
<view>
<u-popup ref="popup" mode="center" :show="noSalePopup" :round="15" :mask-close-able="false">
<view class="noSalePopup">
<view>抱歉该订单已无可申请售后的商品</view>
<button class="noSalePopup-btn" @click="noSalePopup = false">我知道了</button>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr as afterSaleApi } from "../../../api/afterSale";
import Rated from "../rated/rated.vue";
import AwaitRated from "../awaitRated/awaitRated.vue";
import AfterSale from "../afterSale/index.vue";
import cancelOrderPopup from '../index/popup/cancelOrder/cancelOrder.vue';
import refundPopup from '../index/popup/refund/refund.vue';
import afterSalePopup from '../index/popup/afterSale/index.vue';
export default {
components: {
Rated,
AwaitRated,
AfterSale,
cancelOrderPopup,
refundPopup,
afterSalePopup
},
data() {
return {
categoryList: [
{ category_name: "全部" },
{ category_name: "待付款" },
{ category_name: "备货中" },
{ category_name: "待自提" },
{ category_name: "已完成" },
{ category_name: "已取消" },
{ category_name: "待评价" },
{ category_name: "已评价" },
{ category_name: "售后" },
],
selectedTab: 0,
// orderData: orderMockData,
orderData: [],
showPopup: false,//
afterSaleGoods: [],//
afterSaleOrderItem: {},//
noSalePopup: false,//
showTkPopup: false,//退
afterSaleItem: '',//
afterSaleList: [],//
selectStatus: '',//status
evaluateStatus: '',//
};
},
methods: {
selectTab(index, item) {
this.selectedTab = index;
if (index == 6) {
this.evaluateStatus = 2;
this.selectStatus = ''
} else if (index == 7) {
this.evaluateStatus = 1;
this.selectStatus = ''
} else if (index == 2) {
this.selectStatus = 3;
this.evaluateStatus = ''
} else {
this.selectStatus = index > 2 ? index + 1 : index;
this.evaluateStatus = ''
}
this.getOrderList();
},
//
cancelOrder(item) {
this.afterSaleItem = item;
this.showPopup = true
},
//
handleOrderCancelled(data) {
const params = {
order_id: this.afterSaleItem.id,
method: 1,
cancel_reason: data.reason,
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
this.getOrderList();
});
},
//
afterSale(item) {
this.afterSaleGoods = item.commodity_order_item_list;
//
this.afterSaleOrderItem = item;
this.$refs.afterSalePopupRef.openAfterSalePopup();
console.log(item.id);
//
// request(afterSaleApi.isAllow, "POST", {
// order_id: item.id,
// }).then((res) => {
// if (res.data.is_allow_after_sales) {
// this.afterSaleGoods = res.data.allow_items;
// // this.selectedAsGood = item.commodity_order_item_list[0].id;
// this.$refs.afterSalePopupRef.openAfterSalePopup();
// } else {
// this.noSalePopup = true
// }
// });
},
// 退
handleRefundSubmitted(data) {
const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleOrderItem.id,
goods_ids: this.afterSaleOrderItem.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: data.afterSalesType,
after_sales_reason: data.refundReason,
refund_amount: data.refundAmount,
application_description: data.refundDescription,
// URL
application_images: data.imgList && data.imgList.length > 0 ?
data.imgList.map(img => img.url).join(',') : '',
order_status: 5,
receiving_address: data.merchantAddress,
change_goods_id: data.changeServiceId
}
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
this.getOrderList();
});
},
// 退
applyRefund(item) {
this.afterSaleItem = item;
this.showTkPopup = true
},
//
viewLogistics(item) {
},
// 退
handleRefundConfirmed(data) {
const params = {
order_id: this.afterSaleItem.id,
}
request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款成功", icon: "none" });
this.getOrderList();
});
},
//
confirmReceiving(item) {
uni.showModal({
title: "确认收货",
content: "确认收货后订单状态将变为【已完成】,如有售后需求可正常申请退款/售后,确定要确认收货吗?",
success: (res) => {
if (res.confirm) {
const params = {
order_id: item.id,
method: 2,
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
this.getOrderList();
});
}
},
});
},
goToPay(item) {
//
const transformedItems = item.commodity_order_item_list.map(goods => ({
isafterSale: true,
orderId: item.id,
commodity_goods_info: {
commodity_brief: "",
commodity_id: goods.commodity_id,
commodity_pic: goods.commodity_pic,
goods_alias: goods.goods_name,
goods_carousel: "",
goods_detail_pic: "",
goods_intro: goods.goods_name,
goods_name: goods.goods_name,
goods_no: "",
goods_spec: goods.goods_spec,
goods_status: 1,
goods_unit: goods.goods_unit,
goods_video: "",
group_buy_activity_info: null,
id: goods.id,
is_same_day: goods.is_same_day || false,
is_support_same_day: goods.is_support_same_day || 2,
market_price: goods.sales_price,
sales_price: goods.sales_price,
stock_quantity: goods.stock_quantity
},
commodity_id: goods.commodity_id,
count: goods.count,
create_time: item.create_time,
goods_id: goods.goods_id,
group_buy_id: 0,
id: goods.id,
supplier_id: item.supplier_id,
supplier_name: item.supplier_name,
update_time: item.update_time,
user_id: item.user_id
}));
NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`)
},
toDetails(item) {
NavgateTo(
`/packages/myOrders/orderDetails/index?item=${JSON.stringify(item)}`
);
},
checkLogistics() {
NavgateTo(`/packages/myOrders/logistics/index`);
},
orderEvaluate(item) {
NavgateTo(`/packages/myOrders/orderEvaluate/index?item=${JSON.stringify(item)}`);
},
getOrderStatus(order_status) {
switch (order_status) {
case 1:
return "待付款";
case 2:
return "支付中";
case 3:
return "备货中";
case 4:
return "待自提";
case 5:
return "已完成";
case 6:
return "已取消";
case 7:
return "退款中";
case 8:
return "已退款";
}
},
getOrderList() {
this.orderData = []
request(afterSaleApi.orderList, "POST", {
order_status: this.selectStatus,
evaluate_status: this.evaluateStatus,
user_id: uni.getStorageSync("userId"),
}).then((res) => {
res.order_list?.forEach(item => {
item.commodity_order_item_list?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.orderData = res.order_list.filter(item => item.order_cate === 2);
this.getAfterSaleList();
});
},
getAfterSaleList() {
const params = {
user_id: uni.getStorageSync('userId'),
order_cate: 2,
}
request(afterSaleApi.afterSalesList, "POST", params).then((res) => {
res.after_sales_list?.forEach(item => {
item.commodity_order_item?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.afterSaleList = res.after_sales_list;
});
},
//
revokeApply() {
this.getOrderList();
}
},
onLoad(options) {
this.getOrderList();
},
onShow() {
this.getOrderList();
uni.removeStorageSync('afterSaleItem')
},
};
</script>
<style>
@import url("./index.css");
</style>

View File

@ -1,6 +1,6 @@
page {
background-color: #f6f7fb;
padding-bottom: 0;
padding-bottom: 50rpx;
min-height: 100vh;
}
@ -59,9 +59,25 @@ page {
border-bottom: 1rpx solid #eee;
}
.orderTitle {
width: 100%;
font-size: 24rpx;
font-weight: bold;
}
.orderTitleSupplier {
font-size: 28rpx;
color: #333;
font-weight: bold;
margin-bottom: 10rpx;
display: flex;
justify-content: space-between;
}
.status {
color: #ff5252;
font-weight: bold;
font-size: 24rpx;
}
.status2 {
@ -71,6 +87,7 @@ page {
display: flex;
padding: 10rpx;
border-radius: 10rpx;
font-size: 24rpx;
}
.status2 img {
@ -82,6 +99,13 @@ page {
.status3 {
color: #949494;
font-weight: bold;
font-size: 24rpx;
}
.order_status{
color: #333;
font-weight: bold;
font-size: 24rpx;
}
.goods-list {

View File

@ -5,33 +5,38 @@
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</view>
</view>
<view class="content">
<view v-if="selectedTab === 6">
<awaitRated />
<awaitRated :orderData="orderData" />
</view>
<view v-if="selectedTab === 7">
<rated />
<view v-else-if="selectedTab === 7">
<rated :orderData="orderData" />
</view>
<view v-if="selectedTab === 8">
<afterSale />
<view v-else-if="selectedTab === 8">
<afterSale :afterSaleList="afterSaleList" @revokeApply="revokeApply" />
</view>
<view v-else>
<view v-for="(item, index) in orderData" :key="index">
<view class="contentList">
<!-- 订单头部信息 -->
<view class="order-header" @click="toDetails(item)">
<text>提交订单{{ item.order_time }}</text>
<view v-if="item.order_status == 6 || item.order_status == 5" class="status3">{{
getOrderStatus(item.order_status) }}</view>
<view v-else-if="item.order_status == 7" class="status2">
<img src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/refund.png" />
{{ getOrderStatus(item.order_status) }}
<view class="orderTitle">
<view class="orderTitleSupplier">{{ item.supplier_name }}
<view v-if="item.order_status == 6 || item.order_status == 5" class="status3">{{
getOrderStatus(item.order_status) }}</view>
<view v-else-if="item.order_status == 7" class="status2">
<img src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/refund.png" />
{{ getOrderStatus(item.order_status) }}
</view>
<view v-else class="order_status">{{
getOrderStatus(item.order_status)
}}</view>
</view>
<text>提交订单{{ item.order_time }}</text>
</view>
<view v-else class="order_status">{{
getOrderStatus(item.order_status)
}}</view>
</view>
<!-- 商品列表 -->
@ -52,29 +57,29 @@
取消订单
</button>
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="pay-btn" @click="goToPay">立即支付</button>
<button class="pay-btn" @click="goToPay(item)">立即支付</button>
</view>
<view class="btn-group" v-if="item.order_status === 3">
<button class="cancel-btn" @click="applyRefund(item)">申请退款</button>
</view>
<view class="btn-group" v-if="item.order_status === 4">
<button class="cancel-btn" @click="cancelOrder">查看物流</button>
<button class="cancel-btn" @click="viewLogistics(item)">查看物流</button>
<button class="pay-btn" @click="confirmReceiving(item)">确认收货</button>
</view>
<view class="btn-group" v-if="item.order_status === 5">
<text class="afterSaleNum">4笔售后</text>
<!-- <text class="afterSaleNum">{{ item.commodity_order_item_list.length }}笔售后</text> -->
<button class="cancel-btn" @click="afterSale(item)">退换/售后</button>
<button class="pay-btn" @click="cancelOrder">评价</button>
<button class="pay-btn" @click="orderEvaluate(item)" :disabled="item.evauate_status === 1">评价</button>
</view>
<view class="btn-group" v-if="item.order_status === 6">
<!-- <button class="cancel-btn" @click="orderEvaluate">
服务评价
</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="cancelOrder">再来一单</button> -->
<button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<!-- <button class="pay-btn" @click="goToPay(item)">再来一单</button> -->
</view>
<view class="btn-group" v-if="item.order_status === 7">
<button class="pay-btn" @click="cancelOrder">再来一单</button>
<!-- <button class="pay-btn" @click="goToPay(item)">再来一单</button> -->
</view>
</view>
</view>
@ -92,8 +97,8 @@
<!-- 退换 售后 - 选择退款原因 -->
<!-- 售后弹窗组件 -->
<after-sale-popup :afterSaleGoods.sync="afterSaleGoods" ref="afterSalePopupRef"
@refundSubmitted="handleRefundSubmitted" />
<after-sale-popup :afterSaleGoods.sync="afterSaleGoods" :orderItem="afterSaleOrderItem" ref="afterSalePopupRef"
@refundSubmitted="handleRefundSubmitted" :order_cate="1" />
<!-- 无售后商品 -->
<view>
@ -116,7 +121,6 @@ import {
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from "../../../api/order";
import { apiArr as afterSaleApi } from "../../../api/afterSale";
import Rated from "../rated/rated.vue";
import AwaitRated from "../awaitRated/awaitRated.vue";
@ -124,7 +128,6 @@ import AfterSale from "../afterSale/index.vue";
import cancelOrderPopup from './popup/cancelOrder/cancelOrder.vue';
import refundPopup from './popup/refund/refund.vue';
import afterSalePopup from './popup/afterSale/index.vue';
import orderMockData from "./orderMockData.json";
export default {
@ -141,30 +144,46 @@ export default {
categoryList: [
{ category_name: "全部" },
{ category_name: "待付款" },
{ category_name: "已取消" },
{ category_name: "待发货" },
{ category_name: "配送中" },
{ category_name: "已完成" },
{ category_name: "已取消" },
{ category_name: "待评价" },
{ category_name: "已评价" },
{ category_name: "售后" },
],
selectedTab: 0,
orderData: orderMockData,
// orderData: orderMockData,
orderData: [],
showPopup: false,//
afterSaleGoods: [],//
afterSaleOrderItem: {},//
noSalePopup: false,//
showTkPopup: false,//退
afterSaleItem: '',//
afterSaleList: [],//
selectStatus: '',//status
evaluateStatus: '',//
};
},
methods: {
selectTab(index, item) {
this.selectedTab = index;
if (index !== 6) {
this.getOrderList();
if (index == 6) {
this.evaluateStatus = 2;
this.selectStatus = ''
} else if (index == 7) {
this.evaluateStatus = 1;
this.selectStatus = ''
} else if (index == 2) {
this.selectStatus = 3;
this.evaluateStatus = ''
} else {
this.selectStatus = index > 2 ? index + 1 : index;
this.evaluateStatus = ''
}
this.getOrderList();
},
//
cancelOrder(item) {
@ -174,14 +193,13 @@ export default {
//
handleOrderCancelled(data) {
console.log("🚀 ~ handleOrderCancelled ~ 取消原因:", data.reason);
const params = {
order_id: this.afterSaleItem.id,
method: 1,
cancel_reason: data.reason,
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
console.log("🚀 ~ handleOrderCancelled ~ res:", res)
this.getOrderList();
});
},
@ -189,26 +207,45 @@ export default {
//
afterSale(item) {
this.afterSaleGoods = item.commodity_order_item_list;
//
this.afterSaleOrderItem = item;
this.$refs.afterSalePopupRef.openAfterSalePopup();
console.log(item.id);
// //
// request(afterSaleApi.isAllow, "POST", {
// order_id: item.id,
// }).then((res) => {
// console.log("🚀 ~ afterSale ~ res:", res)
// if (res.data.is_allow_after_sales) {
// this.afterSaleGoods = res.data.allow_items;
// // this.selectedAsGood = item.commodity_order_item_list[0].id;
// this.$refs.afterSalePopupRef.openAfterSalePopup();
// } else {
// this.noSalePopup = true
// }
// });
//
// request(afterSaleApi.isAllow, "POST", {
// order_id: item.id,
// }).then((res) => {
// if (res.data.is_allow_after_sales) {
// this.afterSaleGoods = res.data.allow_items;
// // this.selectedAsGood = item.commodity_order_item_list[0].id;
// this.$refs.afterSalePopupRef.openAfterSalePopup();
// } else {
// this.noSalePopup = true
// }
// });
},
// 退
handleRefundSubmitted(data) {
console.log("🚀 ~ handleRefundSubmitted ~ 退款申请提交成功:", data);
const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleOrderItem.id,
goods_ids: this.afterSaleOrderItem.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: data.afterSalesType,
after_sales_reason: data.refundReason,
refund_amount: data.refundAmount,
application_description: data.refundDescription,
// URL
application_images: data.imgList && data.imgList.length > 0 ?
data.imgList.map(img => img.url).join(',') : '',
order_status: 5,
receiving_address: data.merchantAddress,
change_goods_id: data.changeServiceId
}
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
this.getOrderList();
});
},
@ -218,21 +255,19 @@ export default {
this.showTkPopup = true
},
//
viewLogistics(item) {
},
// 退
handleRefundConfirmed(data) {
console.log("🚀 ~ handleRefundConfirmed ~ handleRefundConfirmed:", this.afterSaleItem)
console.log("🚀 ~ handleRefundConfirmed ~ 退款原因:", data.reason);
const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleItem.id,
after_sales_type: 1,
after_sales_reason: data.reason,
refund_amount: this.afterSaleItem.total_amount,
order_status: 3
}
console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params)
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
console.log("🚀 ~ handleRefundConfirmed ~ res:", res)
request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款成功", icon: "none" });
this.getOrderList();
});
},
@ -247,15 +282,53 @@ export default {
order_id: item.id,
method: 2,
}
console.log("🚀 ~ confirmReceiving ~ params:", params)
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
console.log("🚀 ~ handleRefundConfirmed ~ res:", res)
this.getOrderList();
});
}
},
});
},
goToPay() {
goToPay(item) {
//
const transformedItems = item.commodity_order_item_list.map(goods => ({
isafterSale: true,
orderId: item.id,
commodity_goods_info: {
commodity_brief: "",
commodity_id: goods.commodity_id,
commodity_pic: goods.commodity_pic,
goods_alias: goods.goods_name,
goods_carousel: "",
goods_detail_pic: "",
goods_intro: goods.goods_name,
goods_name: goods.goods_name,
goods_no: "",
goods_spec: goods.goods_spec,
goods_status: 1,
goods_unit: goods.goods_unit,
goods_video: "",
group_buy_activity_info: null,
id: goods.id,
is_same_day: goods.is_same_day || false,
is_support_same_day: goods.is_support_same_day || 2,
market_price: goods.sales_price,
sales_price: goods.sales_price,
stock_quantity: goods.stock_quantity
},
commodity_id: goods.commodity_id,
count: goods.count,
create_time: item.create_time,
goods_id: goods.goods_id,
group_buy_id: 0,
id: goods.id,
supplier_id: item.supplier_id,
supplier_name: item.supplier_name,
update_time: item.update_time,
user_id: item.user_id
}));
NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`)
},
toDetails(item) {
NavgateTo(
@ -267,8 +340,8 @@ export default {
NavgateTo(`/packages/myOrders/logistics/index`);
},
orderEvaluate() {
NavgateTo(`/packages/myOrders/orderEvaluate/index`);
orderEvaluate(item) {
NavgateTo(`/packages/myOrders/orderEvaluate/index?item=${JSON.stringify(item)}`);
},
getOrderStatus(order_status) {
@ -293,17 +366,49 @@ export default {
},
getOrderList() {
request(apiArr.orderList, "POST", {
this.orderData = []
request(afterSaleApi.orderList, "POST", {
order_status: this.selectStatus,
evaluate_status: this.evaluateStatus,
user_id: uni.getStorageSync("userId"),
}).then((res) => {
//
res.order_list?.forEach(item => {
item.commodity_order_item_list?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.orderData = res.order_list.filter(item => item.order_cate == 1);
this.getAfterSaleList();
});
},
getAfterSaleList() {
const params = {
user_id: uni.getStorageSync('userId'),
order_cate: 1,
}
request(afterSaleApi.afterSalesList, "POST", params).then((res) => {
res.after_sales_list?.forEach(item => {
item.commodity_order_item?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.afterSaleList = res.after_sales_list;
});
},
//
revokeApply() {
this.getOrderList();
}
},
onLoad(options) {
this.getOrderList();
},
onShow() {
this.getOrderList();
uni.removeStorageSync('afterSaleItem')
},
};
</script>
<style>

View File

@ -1,167 +0,0 @@
[
{
"id": 1001,
"user_id": 2001,
"supplier_id": 3001,
"supplier_name": "生鲜优选",
"order_group_id": 5001,
"order_no": "DD202508131001",
"total_amount": 88.50,
"total_count": 3,
"order_status": 1,
"evauate_status": 2,
"after_sales_status": 2,
"receiving_name": "张三",
"receiving_phone": "13800138001",
"receiving_address": "北京市朝阳区科技园A座101",
"pay_method": "微信支付",
"payment_amount": 0,
"payment_status": "未支付",
"payment_serial": "",
"payer_name": "",
"order_time": "2025-08-13T10:30:00Z",
"is_same_day": 1,
"estimated_delivery_time": "今日14:00-16:00",
"remark": "请尽快配送",
"shiliu_score": 88.5,
"shiliu_seed": 22.1,
"timeout_time_stamp": 1755086400,
"commodity_order_item_list": [
{
"id": 7001,
"order_id": 1001,
"goods_id": 8001,
"goods_name": "澳洲牛排",
"commodity_pic": "http://localhost:8080/test.png",
"goods_unit": "盒",
"goods_spec": "200g/盒",
"cost_price": 45.0,
"sales_price": 68.0,
"count": 1,
"is_support_same_day": 1,
"is_same_day": true
},
{
"id": 7002,
"goods_id": 8002,
"goods_name": "有机西兰花",
"commodity_pic": "http://localhost:8080/test.png",
"goods_unit": "份",
"goods_spec": "500g/份",
"cost_price": 8.0,
"sales_price": 10.5,
"count": 2,
"is_support_same_day": 1,
"is_same_day": true
}
]
},
{
"id": 1002,
"order_no": "DD202508131002",
"total_amount": 152.0,
"total_count": 5,
"order_status": 2,
"payment_status": "支付中",
"payment_time": "2025-08-13T10:35:22Z",
"payer_name": "李四",
"order_time": "2025-08-13T10:32:15Z",
"commodity_order_item_list": [
{
"id": 7003,
"goods_id": 8003,
"goods_name": "精品榴莲",
"commodity_pic": "http://localhost:8080/test.png",
"sales_price": 152.0,
"count": 1,
"is_support_same_day": 1,
"is_same_day": false
}
]
},
{
"id": 1003,
"order_no": "DD202508131003",
"total_amount": 45.8,
"order_status": 3,
"payment_status": "已支付",
"payment_amount": 45.8,
"payment_serial": "PY20250813100003",
"order_time": "2025-08-13T09:15:30Z",
"is_same_day": 2,
"commodity_order_item_list": [
{
"id": 7004,
"goods_name": "东北大米",
"count": 2,
"sales_price": 22.9
}
]
},
{
"id": 1004,
"order_no": "DD202508131004",
"order_status": 4,
"receiving_name": "王五",
"receiving_phone": "13900139000",
"payment_serial": "PY20250813090001",
"order_time": "2025-08-13T08:45:00Z",
"is_same_day": 1,
"commodity_order_item_list": [
{
"id": 7005,
"goods_name": "酸奶套装",
"count": 1,
"sales_price": 39.9
}
]
},
{
"id": 1005,
"order_no": "DD202508131005",
"order_status": 5,
"evauate_status": 2,
"payment_status": "已支付",
"completed_at": "2025-08-13T15:20:18Z",
"order_time": "2025-08-13T11:20:18Z",
"commodity_order_item_list": [
{
"id": 7003,
"goods_id": 8003,
"goods_name": "冷冻虾仁",
"commodity_pic": "http://localhost:8080/test.png",
"sales_price": 152.0,
"count": 3,
"is_support_same_day": 1,
"is_same_day": false
},
{
"id": 7004,
"goods_id": 8004,
"goods_name": "精品榴莲",
"commodity_pic": "http://localhost:8080/test.png",
"sales_price": 152.0,
"count": 1,
"is_support_same_day": 2,
"is_same_day": false
}
]
},
{
"id": 1006,
"order_no": "DD202508131006",
"order_status": 6,
"cancelled_by": "user",
"cancel_time": "2025-08-13T10:40:05Z",
"cancel_reason": "选错商品",
"order_time": "2025-08-13T10:38:12Z",
"commodity_order_item_list": [
{
"id": 7007,
"goods_name": "进口橙子",
"count": 2,
"sales_price": 32.0
}
]
}
]

View File

@ -427,7 +427,6 @@
}
.itemSize {
width: 30%;
font-size: 26rpx;
color: #333;
background: #F6F7FB;
@ -447,7 +446,6 @@
height: 100rpx;
margin-right: 30rpx;
border-radius: 20rpx;
border:1rpx solid red;
}
.itemSize_top{

View File

@ -19,13 +19,14 @@
</view>
<view class="asGoodsInfo" v-for="(item, index) in afterSaleGoods" :key="index">
<view class="asGoodInfo" @click="selectAsGood(item)">
<view :class="['radio asGoodRadio', selectedAsGood == item.id ? 'active' : '']"></view>
<view :class="['radio asGoodRadio', selectedAsGood == item.goods_id ? 'active' : '']">
</view>
<view class="asGoodTag tag-img" v-if="item.is_support_same_day === 1">当日达</view>
<image :src="item.commodity_pic" class="asGoodImg"></image>
<view class="asGoodDetail">
<view class="asGoodTitle">
<text class="asGoodTag asGoodTag1" v-if="item.is_support_same_day === 1">当日达</text>
{{ item.goods_name}}
{{ item.goods_name }}
</view>
<view class="asGoodDesc">{{ item.goods_spec }}</view>
<view class="asGoodPrice">¥{{ item.cost_price }}/</view>
@ -50,7 +51,7 @@
@click="selectAfterSaleType2(0)">
退货退款</view>
<view :class="['asTab2', selectedAfterSaleType2 === 1 ? 'active' : '']"
@click="selectAfterSaleType2(1)">退
@click="selectAfterSaleType2(1)">退
</view>
</view>
<view class="reason-list" v-if="selectedAfterSaleType2 === 0">
@ -79,7 +80,6 @@
<view class="refund-title">确认退款信息</view>
<view class="refund-item">
<view class="refund-label">服务类型<text class="required">*</text></view>
<view class="refund-value" @click="openAfterSalePopup2('serviceType')">
{{ selectedServiceType || '请选择服务类型' }}
<text class="arrow-right"></text>
@ -173,20 +173,21 @@
<view class="refund-item">
<view class="refund-label">换货商品<text class="required">*</text></view>
<view class="refund-value" @click="changeGood()">
{{ changeServiceType || '请选择需要换的商品' }}
{{ changeServiceName || '请选择需要换的商品' }}
<text class="arrow-right"></text>
</view>
</view>
<view class="text-wrapper_8">
<text class="text_41">高尚</text>
<text class="text_42">15901518415</text>
<text class="text_41">{{ orderItem.receiving_name }}</text>
<text class="text_42">{{ orderItem.receiving_phone }}</text>
</view>
<view class="block_15">
<view class="address-view">
<text> {{ merchantAddress }} </text>
<text> {{ orderItem.receiving_address }} </text>
<view class="copy-icon" @click="copyRefundNo"></view>
</view>
<image src="http://localhost:8080/af_update_address.png" class="icon_2"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/af_update_address.png"
class="icon_2"></image>
</view>
<view class="hr"></view>
<view class="refund-item2">
@ -215,13 +216,14 @@
<view class="popup-header-view" @click="closeSize">取消</view>
</view>
<view class="itemSize_top">
<image :src="changeImg" class="itemSize-img"></image>
<image :src="currentGG.commodity_pic" class="itemSize-img"></image>
<view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/</view>
<view class="itemSize_name">{{ currentGG.goods_name }}</view>
<view class="itemSize_price">{{ currentGG.sales_price }}/{{ currentGG.goods_unit }}
</view>
</view>
</view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
<view class="itemSize" v-for="(item, index) in changeGoodsList" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''">
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
</view>
@ -230,11 +232,23 @@
</template>
<script>
import { upload, picUrl } from '../../../../../utils';
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../../../utils';
import { apiArr } from "../../../../../api/afterSale";
export default {
name: 'AfterSalePopup',
props: {
orderItem: {
type: Object,
default: () => ({})
},
afterSaleGoods: {
type: Array,
default: () => []
@ -247,26 +261,29 @@ export default {
afterSalePopup3: false,
selectedAsGood: '',
selectedAfterSaleType: 0, // 0:退/退, 1:
selectedAfterSaleType2: 0, // 0:退/退, 1:退
selectedAfterSaleType2: 0, // 0:退/退, 1:退
selectedAsReason: 0,
selectedReason: 0,//
selectedServiceType: '',
selectedRefundReason: '',
changeRefundReason: '', //
changeServiceType: '', //
changeServiceName: '', //
changeServiceId: '', // id
changeGoodsList: [], //
showSize: false,//
changeImg: "",
changeName: "",
changePrice: "",
currentGG: {},//
currentGGIndex: 0,
afterSalesType: 2, // 1:退 2:退退 3:
merchantContact: '', //
merchantAddress: '', //
refundAmount: 0,
maxRefundAmount: 0,
postage: 0,
refundDescription: '',
refundMethod: '自行寄回',
merchantAddress: '衡水市路北街道中心北大街世纪名城41号楼',
merchantContact: '高尚 18032753127',
imgList: [],
refundAmount: 0, // 退
maxRefundAmount: 0, // 退
postage: 0, //
applyRefundReasons: [
'商品质量问题',
'商品与描述不符',
@ -294,7 +311,9 @@ export default {
openAfterSalePopup() {
this.$nextTick(() => {
if (this.afterSaleGoods && this.afterSaleGoods.length > 0) {
this.selectedAsGood = this.afterSaleGoods[0].id;
this.selectedAsGood = this.afterSaleGoods[0].goods_id;
this.afterSalesType = 2
this.selectedAfterSaleType = 0;
this.afterSalePopup = true;
}
})
@ -302,7 +321,7 @@ export default {
//
selectAsGood(item) {
this.selectedAsGood = item.id;
this.selectedAsGood = item.goods_id;
},
//
@ -328,10 +347,18 @@ export default {
//
selectAfterSaleType(index) {
if (index === 1) {
this.afterSalesType = 3;
}
this.selectedAfterSaleType = index;
},
selectAfterSaleType2(index) {
if(index === 1) {
this.afterSalesType = 1;
}else{
this.afterSalesType = 2;
}
this.selectedAfterSaleType2 = index;
},
@ -342,6 +369,9 @@ export default {
console.log('售后商品 - 选中的售后类型:', selectedType);
console.log('选中的售后商品:', this.selectedAsGood);
this.merchantContact = `${this.orderItem.supplier_name} ${this.orderItem.supplier_phone}`;
this.merchantAddress = this.orderItem.supplier_address;
this.afterSalePopup = false;
this.afterSalePopup2 = true;
},
@ -376,12 +406,17 @@ export default {
}
this.afterSalePopup2 = false;
},
// 退
// 退
confirmAfterSaleCancel2() {
const afterSaleTypes = ['退货退款', '退'];
const afterSaleTypes = ['退货退款', '退'];
const selectedType = afterSaleTypes[this.selectedAfterSaleType2];
console.log('选中的售后类型:', selectedType);
// 退退
this.refundAmount = this.orderItem.total_amount;
this.maxRefundAmount = this.orderItem.total_amount;
//
this.postage = this.orderItem.postage || 0;
let selectedReasonText = '';
if (selectedType == '退货退款') {
@ -394,10 +429,6 @@ export default {
// 退
this.selectedServiceType = selectedType;
this.selectedRefundReason = selectedReasonText;
// 退
this.refundAmount = 4704.00;
this.maxRefundAmount = 53.80;
this.postage = 0.00;
this.selectAsReason(0);
this.afterSalePopup2 = false;
@ -412,8 +443,25 @@ export default {
//
changeGood() {
this.afterSalePopup3 = false;
this.showSize = true;
const params = {
goods_id: this.selectedAsGood,
}
request(apiArr.changeGoodsList, "POST", params).then((res) => {
res.change_goods_list.forEach(item => {
item.commodity_pic = picUrl + item.commodity_pic;
})
this.changeGoodsList = res.change_goods_list;
console.log("🚀 ~ changeGood ~ this.currentGG:", this.currentGG)
if (!this.currentGG.goods_name) {
this.currentGG = this.changeGoodsList.find(item => item.id == this.selectedAsGood);
this.currentGGIndex = this.changeGoodsList.indexOf(this.currentGG);
this.changeServiceName = this.currentGG.goods_name
this.changeServiceId = this.currentGG.id
}
this.afterSalePopup3 = false;
this.showSize = true;
});
},
closeSize() {
@ -422,17 +470,10 @@ export default {
//
changeGG(item, index) {
console.log("🚀 ~ changeGG ~ item:", item);
this.currentGG = item;
this.currentGGIndex = index;
if (this.currentGG.cart_count) {
this.currentNum = this.currentGG.cart_count.count;
} else {
this.currentGG.cart_count = { count: 0 };
}
this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
this.changeServiceName = this.currentGG.goods_name
this.changeServiceId = this.currentGG.id
this.afterSalePopup3 = true;
this.showSize = false;
@ -455,7 +496,50 @@ export default {
// 退
modifyRefundAmount() {
console.log('修改退款金额');
const that = this;
//
uni.showModal({
title: '修改退款金额',
editable: true,
placeholderText: `请输入不超过¥${this.maxRefundAmount.toFixed(2)}的金额`,
success: function (res) {
if (res.confirm && res.content) {
let inputAmount = parseFloat(res.content);
//
if (isNaN(inputAmount) || inputAmount <= 0) {
uni.showToast({
title: '请输入有效的金额',
icon: 'none'
});
return;
}
//
inputAmount = Math.round(inputAmount * 100) / 100;
// 退
if (inputAmount > that.maxRefundAmount) {
uni.showToast({
title: `退款金额不能超过¥${that.maxRefundAmount.toFixed(2)}`,
icon: 'none'
});
return;
}
// 退
that.refundAmount = inputAmount;
// 退
that.$emit('refundAmountChanged', that.refundAmount);
uni.showToast({
title: '退款金额修改成功',
icon: 'success'
});
}
}
});
},
//
@ -465,33 +549,62 @@ export default {
// 退
submitRefundApplication() {
if (!this.selectedServiceType || !this.selectedRefundReason) {
uni.showToast({
title: '请选择服务类型和退款原因',
icon: 'none'
});
return;
if(this.afterSalesType !== 3) {
if (!this.selectedServiceType || !this.selectedRefundReason) {
uni.showToast({
title: '请选择服务类型和退款原因',
icon: 'none'
});
return;
}
}
//
const refundInfo = {
afterSalesType: this.afterSalesType,
serviceType: this.selectedServiceType,
refundReason: this.selectedRefundReason,
refundAmount: this.refundAmount,
maxRefundAmount: this.maxRefundAmount,
refundReason: this.selectedRefundReason || this.changeRefundReason,
refundAmount: this.refundAmount || this.orderItem.total_amount,
maxRefundAmount: this.maxRefundAmount || this.orderItem.total_amount,
postage: this.postage,
refundDescription: this.refundDescription,
refundMethod: this.refundMethod,
merchantAddress: this.merchantAddress,
merchantContact: this.merchantContact,
imgList: this.imgList
merchantAddress: this.orderItem.supplier_address,
merchantContact: `${this.orderItem.supplier_name} ${this.orderItem.supplier_phone}`,
imgList: this.imgList,
changeServiceId: this.changeServiceId,
};
console.log('提交退款申请:', refundInfo);
this.afterSalePopup3 = false;
// 退
this.$emit('refundSubmitted', refundInfo);
}
//
this.resetAfterSaleData();
},
//
resetAfterSaleData() {
this.selectedAsGood = '';
this.selectedAfterSaleType = 0; // 0:退/退, 1:
this.selectedAfterSaleType2 = 0; // 0:退/退, 1:退
this.selectedAsReason = 0;
this.selectedReason = 0; //
this.selectedServiceType = '';
this.selectedRefundReason = '';
this.changeRefundReason = ''; //
this.changeServiceName = ''; //
this.changeServiceId = ''; // id
this.changeGoodsList = []; //
this.currentGG = {}; //
this.currentGGIndex = 0;
this.refundDescription = '';
this.imgList = [];
this.refundAmount = 0;
this.maxRefundAmount = 0;
this.postage = 0;
},
}
};
</script>

View File

@ -49,7 +49,6 @@ export default {
confirmCancel() {
const selectedText = this.cancelReasons[this.selectedReason];
console.log("🚀 ~ confirmCancel ~ 取消原因:", selectedText);
uni.showModal({
title: "取消订单",
content: "千辛万苦挑选的商品,确定要取消吗?",

View File

@ -50,7 +50,6 @@ export default {
confirmRefund() {
const selectedText = this.applyRefundReasons[this.selectedReason];
console.log("🚀 ~ confirmRefund ~ 退款原因:", selectedText);
this.$emit('update:showPopup', false);
this.$emit('refundConfirmed', { reason: selectedText });
uni.showModal({

View File

@ -8,12 +8,12 @@
</view>
<view class="status-bar" v-if="status === '3'">
<view class="status">待发货</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="countdown">预计到货时间: {{ orderInfo.estimated_delivery_time }}</view>
<view class="tips">商家正在加急打包中了请耐心等候</view>
</view>
<view class="status-bar" v-if="status === '4'">
<view class="status">待配送</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="countdown">预计到货时间: {{ orderInfo.estimated_delivery_time }}</view>
<view class="tips">
配送司机15901518415
<img class="phone" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/phone.png" />
@ -21,13 +21,13 @@
</view>
<view class="status-bar" v-if="status === '5' || status === '退款中'">
<view class="status">已完成</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="countdown">预计到货时间: {{ orderInfo.estimated_delivery_time }}</view>
<view class="tips">感谢对我们的信任期待下次光临</view>
</view>
<view class="status-bar" v-if="status === '6'">
<view class="status">已取消</view>
<view class="countdown">订单已取消</view>
<view class="tips">您的订单已取消再来一单吧</view>
<!-- <view class="tips">您的订单已取消再来一单吧</view> -->
</view>
<!-- <view class="status-bar" v-if="status === '退款中'">
<view class="status">已完成</view>
@ -39,9 +39,9 @@
<!-- 订单金额 -->
<view class="amount-section">
<view v-if="status !== '退款中'">
<view class="total-amount">¥{{ orderInfo.shiliu_score }}</view>
<view class="total-amount">¥{{ orderInfo.total_amount }}</view>
<view class="original-price">商品下单应付
<text> ¥{{ orderInfo.shiliu_score }}</text>
<text> ¥{{ orderInfo.total_amount }}</text>
</view>
</view>
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
@ -62,7 +62,7 @@
</view>
<view class="hr"></view>
<view class="info-item">
<view class="info-label1">下单总金额( ¥{{ orderInfo.orderAmount }} )</view>
<view class="info-label1">下单总金额( ¥{{ orderInfo.total_amount }} )</view>
<view class="info-action">明细</view>
</view>
<view class="info-item">
@ -81,12 +81,12 @@
<view class="section-title">配送信息</view>
<view class="info-item">
<view class="info-label">配送方式</view>
<!-- <view class="info-value">{{ orderInfo.deliveryType }}</view> -->
<view class="info-value">商家自配</view>
<view class="info-value" v-if="orderInfo.order_cate === 1">商家自配</view>
<view class="info-value" v-if="orderInfo.order_cate === 2">客户自提</view>
</view>
<view class="info-item">
<view class="info-label">预计配送时间</view>
<view class="info-value"></view>
<view class="info-value">{{ orderInfo.estimated_delivery_time }}</view>
</view>
</view>
@ -134,23 +134,23 @@
</view>
<view class="bottom-buttons" v-if="status === '3'">
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="cancel-btn" @click="cancelOrder">取消订单</button>
<button class="cancel-btn" @click="applyRefund">申请退款</button>
<!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> -->
</view>
<view class="bottom-buttons" v-if="status === '4'">
<button class="cancel-btn" @click="checkLogistics">查看物流</button>
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="pay-btn" @click="gotoPayment">立即支付</button>
<button class="pay-btn" @click="confirmReceiving">确认收货</button>
</view>
<view class="bottom-buttons" v-if="status === '5'">
<button class="cancel-btn" @click="orderEvaluate">服务评价</button>
<!-- <button class="cancel-btn" @click="afterSale">退换/售后</button> -->
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="pay-btn" @click="gotoPayment">立即支付</button>
<button class="pay-btn" @click="orderEvaluate" :disabled="orderInfo.evauate_status === 1">评价</button>
</view>
<view class="bottom-buttons" v-if="status === '6'">
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> -->
<button class="pay-btn" @click="gotoPayment">再来一单</button>
<!-- <button class="pay-btn" @click="gotoPayment">再来一单</button> -->
</view>
</view>
</view>
@ -158,7 +158,8 @@
</template>
<script>
import { picUrl, NavgateTo } from "../../../utils";
import { picUrl, NavgateTo, request } from "../../../utils";
import { apiArr as afterSaleApi } from "../../../api/afterSale";
export default {
data() {
@ -170,7 +171,6 @@ export default {
},
onLoad(options) {
const item = JSON.parse(options?.item);
console.log("🚀 ~ onLoad ~ item:", item)
//
item.order_status == "1" ? this.startCountdown() : "";
this.status = JSON.stringify(item.order_status);
@ -202,26 +202,116 @@ export default {
content: "确定要取消订单吗?",
success: (res) => {
if (res.confirm) {
// API
uni.showToast({ title: "订单已取消", icon: "none" });
setTimeout(() => uni.navigateBack(), 1500);
const params = {
order_id: this.orderInfo.id,
method: 1,
cancel_reason: '用户主动取消',
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
uni.showToast({ title: "订单已取消", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
}
},
});
},
// 退
applyRefund() {
uni.showModal({
title: "申请退款",
content: "确定要申请退款吗?",
success: (res) => {
if (res.confirm) {
const params = {
order_id: this.orderInfo.id,
}
request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款成功", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
}
}
});
},
//
confirmReceiving() {
uni.showModal({
title: "确认收货",
content: "确认收货后订单状态将变为【已完成】,如有售后需求可正常申请退款/售后,确定要确认收货吗?",
success: (res) => {
if (res.confirm) {
const params = {
order_id: this.orderInfo.id,
method: 2,
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
uni.showToast({ title: "已确认收货", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
}
},
});
},
gotoPayment() {
console.log("🚀 ~ gotoPayment ~ 去支付:");
//
// uni.navigateTo({
// url: "/kitchen/pay/index",
// });
//
const transformedItems = this.orderInfo.commodity_order_item_list.map(goods => ({
isafterSale: true,
orderId: item.id,
commodity_goods_info: {
commodity_brief: "",
commodity_id: goods.goods_id,
commodity_pic: goods.commodity_pic,
goods_alias: goods.goods_name,
goods_carousel: "",
goods_detail_pic: "",
goods_intro: goods.goods_name,
goods_name: goods.goods_name,
goods_no: "",
goods_spec: goods.goods_spec,
goods_status: 1,
goods_unit: goods.goods_unit,
goods_video: "",
group_buy_activity_info: null,
id: goods.id,
is_same_day: goods.is_same_day || false,
is_support_same_day: goods.is_support_same_day || 2,
market_price: goods.sales_price,
sales_price: goods.sales_price,
stock_quantity: goods.stock_quantity
},
commodity_id: goods.goods_id,
count: goods.count,
create_time: this.orderInfo.create_time,
goods_id: goods.id,
group_buy_id: 0,
id: goods.id,
supplier_id: this.orderInfo.supplier_id,
supplier_name: this.orderInfo.supplier_name,
update_time: this.orderInfo.update_time,
user_id: this.orderInfo.user_id
}));
NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`)
},
checkLogistics() {
NavgateTo(`/packages/myOrders/logistics/index`);
},
orderEvaluate() {
NavgateTo(`/packages/myOrders/orderEvaluate/index`);
NavgateTo(`/packages/myOrders/orderEvaluate/index?item=${JSON.stringify(this.orderInfo)}`);
},
//
afterSale() {
NavgateTo(`/packages/myOrders/afterSale/index`);
}
},
};

View File

@ -3,8 +3,8 @@
<!-- 商品图片区域 -->
<scroll-view class="goods-scroll" scroll-x>
<view class="goods-list">
<view class="goods-item" v-for="(item, index) in goods" :key="index">
<image :src="item.image" class="goods-img"></image>
<view class="goods-item" v-for="(item, index) in itemObj.commodity_order_item_list" :key="index">
<image :src="item.commodity_pic" class="goods-img"></image>
</view>
</view>
</scroll-view>
@ -14,7 +14,7 @@
<!-- 订单编号 -->
<view class="order-info">
<text class="order-label">订单编号</text>
<text class="order-value">38757328485</text>
<text class="order-value">{{ itemObj.order_no }}</text>
</view>
<view class="rating">
<view>很差</view>
@ -26,70 +26,38 @@
<!-- 商品品质 -->
<view class="rating-item">
<text class="rating-label">商品品质</text>
<u-rate
v-model="qualityRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="qualityRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 配送速度 -->
<view class="rating-item">
<text class="rating-label">配送速度</text>
<u-rate
v-model="speedRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="speedRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 快递员服务 -->
<view class="rating-item">
<text class="rating-label">快递员服务</text>
<u-rate
v-model="serviceRating"
size="40"
active-color="#FFB400"
inactive-color="#EEEEEE"
gutter="60"
></u-rate>
<u-rate v-model="serviceRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 评价输入 -->
<view class="comment-section">
<textarea
class="comment-input"
placeholder="亲,可以从其他角度评价商品,可以帮助我们为您提供更好的服务~"
v-model="comment"
></textarea>
<textarea class="comment-input" placeholder="亲,可以从其他角度评价商品,可以帮助我们为您提供更好的服务~" v-model="comment"></textarea>
</view>
<!-- 图片上传 -->
<view class="upload-section">
<view class="image-list">
<view
class="image-item"
v-for="(img, index) in imageList"
:key="index"
>
<view class="image-item" v-for="(img, index) in imageList" :key="index">
<image :src="img" class="uploaded-img"></image>
<view class="delete-btn" @click="deleteImage(index)">
<text class="delete-icon">×</text>
</view>
</view>
</view>
<view
class="upload-btn"
@click="chooseImage"
v-if="imageList.length < 3"
>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/upload.png"
class="upload-icon"
></image>
<view class="upload-btn" @click="chooseImage" v-if="imageList.length < 3">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/upload.png" class="upload-icon">
</image>
<view class="upload-text">上传图片</view>
<view class="upload-count">({{ imageList.length }}/3)</view>
</view>
@ -103,24 +71,14 @@
</template>
<script>
import { picUrl, NavgateTo, request } from "../../../utils";
import { apiArr } from "../../../api/afterSale";
export default {
data() {
return {
//
goods: [
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index1.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index2.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index3.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index4.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index5.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index1.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index2.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index3.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index4.png" },
{ image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/order_index5.png" },
],
itemObj: {},
//
qualityRating: 5,
qualityRating: 0,
speedRating: 0,
serviceRating: 0,
//
@ -129,6 +87,9 @@ export default {
imageList: [],
};
},
onLoad(options) {
this.itemObj = JSON.parse(decodeURIComponent(options.item));
},
methods: {
//
chooseImage() {
@ -161,14 +122,25 @@ export default {
});
return;
}
// API
uni.showToast({
title: "评价提交成功",
icon: "success",
const params = {
order_id: this.itemObj.id,
goods_id: this.itemObj.commodity_order_item_list[0].goods_id,
user_id: uni.getStorageSync("userId"),
quality_score: this.qualityRating,
speed_score: this.speedRating,
service_score: this.serviceRating,
user_review: this.comment,
review_image: this.imageList,
}
request(apiArr.createReview, "POST", params).then((res) => {
uni.showToast({
title: "评价提交成功",
icon: "success",
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
},
},
};

View File

@ -89,6 +89,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.asGoodTag {
@ -123,12 +124,9 @@
.goods-desc {
font-size: 26rpx;
color: #ff4d4f;
background-color: #fff2f0;
padding: 4rpx 12rpx;
color: #999999;
border-radius: 8rpx;
display: inline-block;
margin: 10rpx 0;
}
.goods-price {
@ -146,10 +144,9 @@
.refund-amount {
font-size: 28rpx;
align-self: flex-start;
margin-top: 20rpx;
font-weight: 500;
position: relative;
left: 140rpx;
position: absolute;
right: 10rpx;
}
.refund-info {
@ -246,7 +243,6 @@
/* 弹窗样式 */
.popup-content {
width: 600rpx;
background-color: #ffffff;
border-radius: 20rpx;
padding: 40rpx;
@ -301,12 +297,13 @@
.continue-btn {
width: 240rpx;
height: 80rpx;
background-color: #f6f7fb;
color: #333333;
background-color: #ffe8e5;
color: #ff370b;
border-radius: 40rpx;
font-size: 28rpx;
line-height: 80rpx;
text-align: center;
border: none;
}
.know-btn {

View File

@ -1,7 +1,7 @@
<template>
<view class="container">
<!-- 进度条 -->
<view class="progress-container" v-if="false">
<view class="progress-container" v-if="currentAfterSale.process_status === 1">
<view class="progress-item active">
<text class="progress-text">商家处理</text>
</view>
@ -15,7 +15,7 @@
</view>
</view>
<view class="progress-container">
<view class="progress-container" v-if="currentAfterSale.process_status === 2">
<view class="progress-item active">
<text class="progress-text">商家处理</text>
</view>
@ -26,13 +26,13 @@
</view>
<!-- 状态提示 -->
<view class="status-tip" v-if="false">
<view class="status-tip" v-if="currentAfterSale.process_status === 1">
<text class="status-title">请等待商家处理</text>
<text class="status-desc"><text style="font-weight: bold;">2</text>后商家未处理将自动同意</text>
<text class="status-desc">您已成功发起退款申请请耐心等待商家处理</text>
</view>
<view class="status-tip">
<view class="status-tip" v-if="currentAfterSale.review_status === 3">
<text class="status-title">商家拒绝申请,请您处理</text>
<text class="status-desc"><text style="color: #f63b08;">2</text>后未处理将自动关闭</text>
</view>
@ -50,9 +50,10 @@
<text class="asGoodTag asGoodTag1"
v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</text>
{{ currentAfterSale.commodity_order_item[0].goods_name }}
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount.toFixed(2) }}</text>
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount ?
currentAfterSale.refund_amount.toFixed(2) : '0.00' }}</text>
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-desc">{{ currentAfterSale.commodity_order_item[0].goods_spec }}</text>
<text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
@ -75,7 +76,8 @@
</view>
<view class="info-item">
<text class="info-label">退款金额<text style="color: #fc3811;">*</text></text>
<text class="info-value amount">{{ '¥' + currentAfterSale.refund_amount.toFixed(2) }}</text>
<text class="info-value amount">{{ '¥' + (currentAfterSale.refund_amount ?
currentAfterSale.refund_amount.toFixed(2) : '0.00') }}</text>
</view>
<view class="info-item">
<text class="info-label">申请时间<text style="color: #fc3811;">*</text></text>
@ -89,7 +91,7 @@
</view>
<!-- 操作按钮 -->
<view class="action-buttons">
<view class="action-buttons" v-if="currentAfterSale.process_status === 1">
<button class="cancel-btn" @click="cancelRefund">撤销申请</button>
<button class="modify-btn" @click="modifyRefund">修改申请</button>
<button class="urge-btn" @click="urgeProcess">催处理</button>
@ -115,7 +117,7 @@
</template>
<script>
import { apiArr } from "../../../api/afterSale";
import {
isPhone,
picUrl,
@ -136,14 +138,27 @@ export default {
//
this.pickerDefaultDate = new Date(this.currentAfterSale.create_time);
},
onShow() {
const storageAfterSale = uni.getStorageSync('afterSaleItem');
if (storageAfterSale) {
this.currentAfterSale = storageAfterSale;
uni.removeStorageSync('afterSaleItem');
}
},
onLoad(options) {
const item = JSON.parse(options?.item);
console.log("🚀 ~ onLoad ~ item:", item)
this.currentAfterSale = item;
},
// onBackPress
onBackPress() {
// 使uni.navigateBack()indexonShow
uni.navigateBack();
return true; //
},
methods: {
getServiceTypeText(type) {
return type === 1 ? '退货退款' : '仅退款';
return type === 1 ? '退款' : (type === 2 ? '退货退款' : '换货');
},
//
@ -183,10 +198,14 @@ export default {
confirmColor: "#ff4d4f",
success: (res) => {
if (res.confirm) {
//
uni.showToast({
title: '订单撤销成功',
icon: 'success'
const params = {
id: this.currentAfterSale.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
});
}
},

View File

@ -66,8 +66,8 @@
}
.image-item image {
width: 80rpx;
height: 80rpx;
width: 100%;
height: 100%;
}
.image-text {

View File

@ -1,44 +1,38 @@
<template>
<view class="evaluation-container">
<!-- 评价内容区域 -->
<view class="evaluation-content">
<!-- 订单头部信息 -->
<view class="order-header">
<text class="order-name">{{ orderInfo.orderName }}</text>
<text class="order-number">{{ orderInfo.orderNumber }}</text>
</view>
<view class="evaluation-area">
<text class="evaluation-text">{{ evaluationInfo.content }}</text>
<!-- 评价图片区域 -->
<view class="image-list">
<view
class="image-item"
v-for="(img, index) in evaluationInfo.images"
:key="index"
>
<image :src="img.url" mode="aspectFill"></image>
<text class="image-text">{{ img.text }}</text>
<view>
<view v-for="(item, index) in orderList" :key="index">
<view class="evaluation-content">
<!-- 订单头部信息 -->
<view class="order-header">
<text class="order-name">{{ item.supplier_name }}</text>
<text class="order-number">{{ item.order_no }}</text>
</view>
</view>
<text class="order-date">{{ orderInfo.date }}</text>
</view>
<!-- 商品信息区域 -->
<view class="product-info">
<view class="product-img">
<image :src="productInfo.imageUrl" mode="aspectFit"></image>
<view
class="tag"
v-for="(tag, index) in productInfo.tags"
:key="index"
>{{ tag }}</view
>
</view>
<view class="product-details">
<text class="product-name">{{ productInfo.name }}</text>
<text class="product-spec">{{ productInfo.spec }}</text>
<text class="product-unit">{{ productInfo.unit }}</text>
<view class="evaluation-area">
<text class="evaluation-text">{{ item.evaluate_info.user_review }}</text>
<!-- 评价图片区域 -->
<view class="image-list" v-if="item.evaluate_info.review_image && item.evaluate_info.review_image.length > 0">
<view class="image-item" v-for="(img, index) in parseReviewImages(item.evaluate_info.review_image)" :key="index">
<image :src="img"></image>
</view>
</view>
<text class="order-date">{{ item.evaluate_info.create_time }}</text>
</view>
<!-- 商品信息区域 -->
<view class="product-info">
<view class="product-img">
<image :src="item.commodity_order_item_list[0].commodity_pic"></image>
<view class="tag" v-if="item.commodity_order_item_list[0].is_same_day === 1" :key="index">当日达</view>
</view>
<view class="product-details">
<text class="product-name">{{ item.commodity_order_item_list[0].goods_name }}</text>
<text class="product-spec">{{ item.commodity_order_item_list[0].goods_spec }}</text>
<text class="product-unit">{{ item.commodity_order_item_list[0].sales_price }}/{{ item.commodity_order_item_list[0].goods_unit }}</text>
</view>
</view>
</view>
</view>
</view>
@ -47,30 +41,61 @@
<script>
export default {
props: {
orderData: {
type: Array,
default: () => []
}
},
data() {
return {
orderInfo: {
orderName: "衡水商贸国际公司",
orderNumber: "4534534255",
date: "2025-07-21",
},
evaluationInfo: {
content: "评价文字内容",
images: [
{ url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/eval1.png", text: "评价图片" },
{ url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/eval2.png", text: "评价图片" },
{ url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/eval3.png", text: "评价图片" },
],
},
productInfo: {
imageUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/product.png",
tags: ["当日达", "当日达"],
name: "货品名称",
spec: "货品规格",
unit: "货品单位",
},
orderList: [],
};
},
methods: {
//
parseReviewImages(reviewImage) {
try {
//
if (typeof reviewImage === 'string' && reviewImage.trim()) {
//
const cleanStr = reviewImage.replace(/^"|"$/g, '').replace(/^'|'$/g, '').trim();
let images = [];
// 使JSON
if (cleanStr.startsWith('[') && cleanStr.endsWith(']')) {
images = JSON.parse(cleanStr);
} else if (cleanStr.includes(',')) {
//
images = cleanStr.split(',').map(img => img.trim());
}
// URL
return Array.isArray(images) ? images : [];
}
//
return Array.isArray(reviewImage) ? reviewImage : [];
} catch (error) {
console.error('解析评价图片失败:', error);
return [];
}
}
},
mounted() {
//
this.orderList = this.orderData;
console.log("🚀 ~ mounted ~ this.orderList:", this.orderList);
},
watch: {
// orderData
orderData: {
handler(newVal) {
this.orderList = newVal;
console.log("🚀 ~ watch orderData ~ this.orderList:", this.orderList);
},
deep: true
}
}
};
</script>

View File

@ -107,6 +107,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.asGoodTag {
@ -141,12 +142,9 @@
.goods-desc {
font-size: 26rpx;
color: #ff4d4f;
background-color: #fff2f0;
padding: 4rpx 12rpx;
color: #999999;
border-radius: 8rpx;
display: inline-block;
margin: 10rpx 0;
}
.goods-price {
@ -164,10 +162,9 @@
.refund-amount {
font-size: 28rpx;
align-self: flex-start;
margin-top: 20rpx;
font-weight: 500;
position: relative;
left: 140rpx;
position: absolute;
right: 10rpx;
}
.refund-info {
@ -262,6 +259,18 @@
text-align: center;
}
.moneyGo-btn{
width: 220rpx;
height: 80rpx;
background-color: #ff370b;
color: #ffffff;
border: none;
border-radius: 40rpx;
font-size: 28rpx;
line-height: 80rpx;
text-align: center;
}
.bottomImg{
width: 70rpx;
height: 80rpx;

View File

@ -1,7 +1,7 @@
<template>
<view class="container">
<!-- 进度条 -->
<view class="progress-container" v-if="false">
<view class="progress-container">
<view class="progress-item">
<text class="progress-text">商家处理</text>
</view>
@ -15,7 +15,7 @@
</view>
</view>
<view class="progress-container">
<view class="progress-container" v-if="false">
<view class="progress-item">
<text class="progress-text">商家处理</text>
</view>
@ -46,10 +46,10 @@
{{ currentAfterSale.commodity_order_item[0].goods_name }}
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount.toFixed(2) }}</text>
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-desc">{{ currentAfterSale.commodity_order_item[0].goods_spec }}</text>
<text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
<text class="goods-count">X{{ currentAfterSale.after_sales_goods.split('@')[0] }}</text>
</text>
</view>
</view>
@ -87,12 +87,12 @@
</view>
<!-- 操作按钮 -->
<view class="action-buttons" v-if="false">
<button class="modify-btn" @click="modifyRefund">寄件详情</button>
<button class="cancel-btn" @click="moneyGo">钱款去向</button>
<view class="action-buttons">
<button class="modify-btn" @click="shippingDetails">寄件详情</button>
<button class="moneyGo-btn" @click="moneyGo">钱款去向</button>
</view>
<view class="action-buttons">
<view class="action-buttons" v-if="false">
<button class="cancel-btn" @click="cancelRefund">撤销申请</button>
<button class="urge-btn" @click="modifyRefund">修改申请</button>
</view>
@ -104,7 +104,7 @@
<!-- 弹窗头部 -->
<view class="popup-header">
<text class="header-title">退款总额 ¥{{ currentAfterSale.refund_amount ?
currentAfterSale.refund_amount.toFixed(2) : '34.18' }}</text>
currentAfterSale.refund_amount.toFixed(2) : '0.00' }}</text>
<text class="close-btn" @click="closeMoneyGoPopup">取消</text>
</view>
@ -118,7 +118,7 @@
</view>
<text class="method-text">退回微信</text>
<text class="method-amount">{{ currentAfterSale.refund_amount ? '¥' +
currentAfterSale.refund_amount.toFixed(2) : 34.18' }}</text>
currentAfterSale.refund_amount.toFixed(2) : 0.0' }}</text>
</view>
</view>
<!-- 退款状态 -->
@ -155,6 +155,7 @@ import {
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from "../../../api/afterSale";
export default {
data() {
@ -175,7 +176,7 @@ export default {
},
methods: {
getServiceTypeText(type) {
return type === 1 ? '退货退款' : '仅退款';
return type === 1 ? '仅退款' : (type === 2 ? '退货退款' : '换货');
},
//
@ -236,11 +237,15 @@ export default {
confirmText: "确认撤销",
confirmColor: "#ff4d4f",
success: (res) => {
if (res.confirm) {
//
uni.showToast({
title: '订单撤销成功',
icon: 'success'
if (res.confirm) {
const params = {
id: this.currentAfterSale.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
});
}
},

View File

@ -137,9 +137,9 @@ export default {
};
console.log('提交物流信息:', logisticsInfo);
//
//
uni.showToast({
title: '物流信息提交成功',
title: '提交成功',
icon: 'success'
});
}

View File

@ -108,6 +108,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.asGoodTag {
@ -142,12 +143,9 @@
.goods-desc {
font-size: 26rpx;
color: #ff4d4f;
background-color: #fff2f0;
padding: 4rpx 12rpx;
color: #999999;
border-radius: 8rpx;
display: inline-block;
margin: 10rpx 0;
}
.goods-price {
@ -165,10 +163,9 @@
.refund-amount {
font-size: 28rpx;
align-self: flex-start;
margin-top: 20rpx;
font-weight: 500;
position: relative;
left: 140rpx;
position: absolute;
right: 10rpx;
}
.refund-info {

View File

@ -22,11 +22,15 @@
<view class="status-desc2">需您自行联系快递公司退回请不要邮寄到付</view>
<view class="info-item" style="border: none;">
<text class="info-label">商家地址</text>
<text class="info-value">{{ currentAfterSale.after_sales_no }}</text>
<text class="info-value">{{ currentAfterSale.supplier_address }}</text>
<text class="copy-icon" @click="copyAdress"></text>
</view>
<button class="addOrderIdBtn" @click="addOrderId">填写单号</button>
<button class="addOrderIdBtn" @click="addOrderId" v-if="true">填写单号</button>
<view class="logistics-info" v-else>
<text>退货物流</text>
<text v-if="false"></text>
</view>
</view>
<view class="hr"></view>
@ -44,10 +48,11 @@
{{ currentAfterSale.commodity_order_item[0].goods_name }}
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount.toFixed(2) }}</text>
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-desc">{{ currentAfterSale.commodity_order_item[0].goods_spec }}</text>
<text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
<text class="goods-count">X{{ currentAfterSale.after_sales_goods.split('@')[0] }}
</text>
</text>
</view>
</view>
@ -82,8 +87,10 @@
<!-- 操作按钮 -->
<view class="action-buttons">
<!-- 填写完物流单号后不显示图片和平台介入按钮 -->
<view>
<image class="bottomImg" src="http://localhost:8080/secdBack_bottom.png" alt=""/>
<image class="bottomImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/secdBack_bottom.png"
alt="" />
</view>
<button class="modify-btn" @click="modifyRefund">平台介入</button>
<button class="cancel-btn" @click="cancelRefund">撤销申请</button>
@ -92,7 +99,6 @@
</template>
<script>
import {
isPhone,
picUrl,
@ -100,12 +106,14 @@ import {
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from "../../../api/afterSale";
export default {
data() {
return {
currentAfterSale: {},
pickerDefaultDate: new Date()
pickerDefaultDate: new Date(),
logisticsInfo: null
};
},
created() {
@ -116,10 +124,25 @@ export default {
const item = JSON.parse(options?.item);
console.log("🚀 ~ onLoad ~ item:", item)
this.currentAfterSale = item;
this.getLogisticsInfo();
},
onShow() {
//
this.getLogisticsInfo();
},
methods: {
//
getLogisticsInfo() {
const info = uni.getStorageSync('logisticsInfo');
if (info) {
this.logisticsInfo = info;
// storage
// uni.removeStorageSync('logisticsInfo');
}
},
getServiceTypeText(type) {
return type === 1 ? '退货退款' : '仅退款';
return type === 1 ? '仅退款' : (type === 2 ? '退货退款' : '换货');
},
//
@ -132,7 +155,7 @@ export default {
//
copyAdress() {
uni.setClipboardData({
data: this.currentAfterSale.after_sales_no,
data: this.currentAfterSale.supplier_address,
success: () => {
uni.showToast({
title: '复制成功',
@ -148,7 +171,7 @@ export default {
});
},
addOrderId(){
addOrderId() {
NavgateTo(`../returnLogistics/index?item=${JSON.stringify(this.currentAfterSale)}`);
},
@ -181,10 +204,14 @@ export default {
confirmColor: "#ff4d4f",
success: (res) => {
if (res.confirm) {
//
uni.showToast({
title: '订单撤销成功',
icon: 'success'
const params = {
id: this.currentAfterSale.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
});
}
},
@ -193,7 +220,7 @@ export default {
//
modifyRefund() {
NavgateTo(`../apply/index?item=${JSON.stringify(this.currentAfterSale)}`);
// NavgateTo(`../apply/index?item=${JSON.stringify(this.currentAfterSale)}`);
},
}
};

View File

@ -0,0 +1,106 @@
page {
background-color: #f5f7fb;
padding-top: 30rpx;
}
.container {
background-color: #fff;
padding: 30rpx;
border-radius: 20rpx;
}
.title {
font-size: 30rpx;
margin-top: 10rpx;
margin-bottom: 30rpx;
text-align: center;
}
.btn {
width: 80%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
background-color: #ff4016;
color: #fff;
font-size: 32rpx;
border-radius: 50rpx;
margin: 100rpx auto;
}
.selectColorBox{
width: 95%;
display: flex;
justify-content: space-between;
align-items: center;
margin: 30rpx auto 0;
}
.selectColor{
display: flex;
justify-content: space-between;
align-items: center;
}
.color{
margin-right: 10rpx;
}
/* 弹窗样式 */
.payIpt {
background-color: #fff;
border-radius: 30rpx 30rpx 0 0;
overflow: hidden;
}
.tit {
font-size: 32rpx;
text-align: center;
padding: 30rpx 0;
font-weight: bold;
border-bottom: 1rpx solid #eee;
}
/* 颜色列表样式 */
.color-list {
max-height: 500rpx;
padding: 20rpx 0;
}
.color-item {
font-size: 28rpx;
text-align: center;
padding: 30rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.color-item:last-child {
border-bottom: none;
}
.color-item.active {
color: #ff4016;
}
/* 底部按钮样式 */
.popup-footer {
display: flex;
border-top: 1rpx solid #eee;
}
.cancel-btn,
.confirm-btn {
flex: 1;
text-align: center;
padding: 30rpx 0;
font-size: 32rpx;
}
.cancel-btn {
color: #666;
border-right: 1rpx solid #eee;
}
.confirm-btn {
color: #ff4016;
}

View File

@ -0,0 +1,127 @@
<template>
<view>
<view class="container">
<view class="title">请输入车牌号码</view>
<car-number-input @numberInputResult="numberInputResult" :defaultStr="defaultNum" ref="carNumberInput" />
<view class="selectColorBox" @click="show = true">
<view>车牌颜色</view>
<view class="selectColor">
<view class="color">{{ color }}</view>
<u-icon name="arrow-right" size="25"></u-icon>
</view>
</view>
</view>
<view class="btn" @click="submit">确定</view>
<!-- 选择车牌颜色 -->
<u-popup :show="show" :round="30" mode="bottom" @close="onClose">
<view class="payIpt">
<view class="tit">选择车牌颜色</view>
<!-- 颜色选择列表 -->
<scroll-view class="color-list" scroll-y>
<view class="color-item" :class="{ 'active': selectedColorIndex === index }"
v-for="(item, index) in colorOptions" :key="index" @click="selectColor(index)">
{{ item }}
</view>
</scroll-view>
<!-- 底部按钮 -->
<view class="popup-footer">
<view class="cancel-btn" @click="onClose">取消</view>
<view class="confirm-btn" @click="confirmColor">确定</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
defaultNum: '',
color: '请选择',
show: false,
//
colorOptions: ['蓝牌', '黄牌', '黑牌', '白牌', '绿牌', '渐变绿底黑字', '黄绿双拼底黑字'],
//
selectedColorIndex: -1
};
},
mounted() {
},
methods: {
numberInputResult(e) {
this.defaultNum = e;
},
onClose() {
this.show = false;
},
//
selectColor(index) {
this.selectedColorIndex = index;
},
//
confirmColor() {
if (this.selectedColorIndex !== -1) {
this.color = this.colorOptions[this.selectedColorIndex];
}
this.show = false;
},
//
submit() {
const actualNumber = this.defaultNum.replace(/\s/g, '');
if (this.defaultNum == '' || actualNumber.length < 7) {
uni.showToast({
title: '请输入正确的车牌号',
icon: 'none',
duration: 2000
})
return;
}
if (this.color == '请选择') {
uni.showToast({
title: '请选择车牌颜色',
icon: 'none',
duration: 2000
})
return;
}
const params = {
user_id: uni.getStorageSync('userId'),
car_number: this.defaultNum,
car_number_color: this.color
}
request(apiArr.carAdd, "POST", params).then((res) => {
uni.showToast({
title: '添加成功',
icon: 'success',
duration: 2000
})
if (this.$refs.carNumberInput) {
// inputList
for (let i = 0; i < 8; i++) {
this.$refs.carNumberInput.inputList[i] = ' ';
}
this.$refs.carNumberInput.$forceUpdate();
}
this.color = '请选择';
this.selectedColorIndex = -1;
});
}
}
}
</script>
<style>
@import url('./index.css')
</style>

View File

@ -0,0 +1,124 @@
page {
background-color: #f5f7fb;
padding-top: 20rpx;
}
/* 车辆信息容器样式 */
.container-box{
height: 83vh;
overflow-y: auto;
}
.car-info-container {
width: 92%;
background-color: #ffffff;
padding: 30rpx;
border-bottom: 1rpx solid #eeeeee;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.car-info{
display: flex;
justify-content: space-between;
}
/* 车牌样式 */
.license-plate {
display: flex;
align-items: center;
gap: 20rpx;
}
/* 车牌类型标签样式 */
.plate-type-box{
padding: 11rpx 2rpx;
/* border: 1rpx solid #1890ff; */
border-radius: 8rpx;
}
.plate-type {
background-color: #1890ff;
color: white;
padding: 10rpx 20rpx;
border-radius: 8rpx;
font-size: 28rpx;
}
/* 车牌号样式 */
.plate-number {
font-size: 32rpx;
color: #333333;
font-weight: 500;
display: flex;
align-items: center;
padding: 15rpx 30rpx;
border-radius: 10rpx;
}
/* 蓝色车牌样式 */
.plate-color-blue {
background-color: #1890ff;
color: white;
}
/* 黄色车牌样式 */
.plate-color-yellow {
background-color: #ffc53d;
color: black;
}
/* 黑色车牌样式 */
.plate-color-black {
background-color: #333333;
color: white;
}
/* 白色车牌样式 */
.plate-color-white {
background-color: white;
color: black;
border: 1rpx solid #dddddd;
}
/* 绿色车牌样式 */
.plate-color-green {
background-color: #37bd75;
color: white;
}
/* 渐变绿底黑字车牌样式 */
.plate-color-gradient-green {
background: linear-gradient(180deg, #ffffff 0%, #2fe259 100%);
color: black;
}
/* 黄绿双拼底黑字车牌样式 */
.plate-color-yellow-green {
background: linear-gradient(90deg, #ffc53d 30%, #37bd75 0%);
color: black;
}
.plate-energy{
font-size: 24rpx;
padding: 7rpx 15rpx;
margin-left: 15rpx;
border-radius: 10rpx;
background-color: #f2f3f4;
color: #37bd75;
}
/* 添加车辆按钮样式 */
.add-car-btn {
height: 100rpx;
width: 80%;
background-color: #ff3f15;
line-height: 100rpx;
color: white;
border-radius: 50rpx;
font-size: 32rpx;
font-weight: 500;
position: absolute;
bottom: 100rpx;
left: 10%;
}

View File

@ -0,0 +1,105 @@
<template>
<view class="container">
<!-- 车辆信息区域 -->
<view class="container-box">
<view class="car-info-container" v-for="(item, index) in carList" :key="index">
<view class="car-info">
<view class="license-plate">
<view class="plate-type-box">
<text class="plate-type" :class="{
'plate-color-blue': item.car_number_color === '蓝牌',
'plate-color-yellow': item.car_number_color === '黄牌',
'plate-color-black': item.car_number_color === '黑牌',
'plate-color-white': item.car_number_color === '白牌',
'plate-color-green': item.car_number_color === '绿牌',
'plate-color-gradient-green': item.car_number_color === '渐变绿底黑字',
'plate-color-yellow-green': item.car_number_color === '黄绿双拼底黑字'
}">{{ item.car_number_color }}</text>
</view>
<view class="plate-number">
{{ item.car_number }}
<view class="plate-energy" v-if="getActualCarNumberLength(item.car_number) > 7">新能源</view>
</view>
</view>
<u-icon name="trash" size="45rpx" @click="deleteCar(item)"></u-icon>
</view>
</view>
</view>
<!-- 添加车辆按钮 -->
<button class="add-car-btn" @click="addCar">添加车辆</button>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
carList: []
}
},
methods: {
getCarList() {
const params = {
user_id: uni.getStorageSync('userId')
}
request(apiArr.carList, "POST", params).then((res) => {
this.carList = res.car_list;
})
},
//
getActualCarNumberLength(carNumber) {
if (!carNumber) return 0;
//
const actualNumber = carNumber.replace(/\s/g, '');
return actualNumber.length;
},
deleteCar(item) {
uni.showModal({
title: '提示',
content: '确定删除该车辆吗?',
success: (res) => {
if (res.confirm) {
const params = {
car_id: item.id
}
request(apiArr.deleteCar, "POST", params).then((res) => {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
});
this.getCarList();
})
}
}
})
},
addCar() {
//
uni.navigateTo({
url: '/packages/park/addCar/index'
})
}
},
onShow() {
this.getCarList();
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,393 @@
/* 包月支付页面样式 */
page {
background-color: #f5f7fb;
}
.monthly-payment-container {
box-sizing: border-box;
width: 100%;
}
.overlay {
position: absolute;
top: 90rpx;
left: 0;
width: 100%;
height: 94vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 98;
}
/* 下拉停车场列表样式 */
.parking-list {
background-color: #ffffff;
padding: 20rpx 30rpx;
border-bottom: 1rpx solid #f0f0f0;
border-radius: 0 0 40rpx 40rpx;
position: fixed;
top: 80rpx;
left: 0;
right: 0;
z-index: 999;
}
/* 搜索框样式 */
.search-box {
display: flex;
align-items: center;
background-color: #f5f7fb;
border-radius: 50rpx;
padding: 20rpx 30rpx;
margin: 20rpx 0;
}
.search-icon {
margin-right: 15rpx;
}
.search-input {
flex: 1;
font-size: 26rpx;
color: #333333;
background-color: transparent;
}
/* 停车场列表项样式 */
.parking-items {
max-height: 600rpx;
overflow-y: auto;
}
.parking-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 25rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.parking-item:last-child {
border-bottom: none;
}
.parking-item-right {
flex: 1;
}
.parking-name {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 10rpx;
display: block;
}
.parking-distance {
font-size: 26rpx;
color: #999999;
margin-right: 20rpx;
}
.parking-address {
font-size: 26rpx;
color: #999999;
display: block;
margin-top: 8rpx;
}
.parking-item-left {
display: flex;
align-items: flex-start;
position: relative;
}
.parking-selected {
font-size: 40rpx;
color: #ff4219;
position: relative;
right: 30rpx;
}
.parking-spaces {
background-color: #ffeeee;
border-radius: 20rpx;
padding: 8rpx 16rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 30rpx;
}
.spaces-label {
font-size: 22rpx;
color: #ff4219;
margin-bottom: 4rpx;
}
.spaces-number {
font-size: 30rpx;
font-weight: bold;
color: #ff4219;
}
/* 顶部标题样式 */
.header {
display: flex;
align-items: center;
justify-content: center;
position: relative;
background-color: #fff3f1;
padding: 20rpx 0;
height: 45rpx;
}
.header-title {
font-size: 32rpx;
font-weight: 500;
color: #333333;
text-align: center;
margin-right: 10rpx;
font-weight: bold;
}
.header-arrow {
width: 30rpx;
height: 30rpx;
margin-left: 10rpx;
}
/* 车辆信息样式 */
.car-info {
display: flex;
justify-content: center;
margin: 40rpx 0;
}
.car-image {
width: 50%;
height: 200rpx;
position: absolute;
top: 193rpx;
}
/* 停车场信息样式 */
.park-info {
margin-bottom: 20rpx;
margin-top: 50rpx;
}
.park-name {
font-size: 32rpx;
color: #333333;
}
.park-type {
font-size: 28rpx;
color: #ff4d4f;
margin-left: 30rpx;
font-weight: bold;
}
/* 支付金额样式 */
.payment-amount {
margin-bottom: 30rpx;
}
.amount-label {
display: block;
font-size: 26rpx;
color: #c8c7c7;
margin-bottom: 10rpx;
}
.amount-value {
font-size: 40rpx;
color: #ff4d4f;
}
/* 选项列表样式 */
.options-list {
background-color: #ffffff;
border-radius: 20rpx;
overflow: hidden;
border-radius: 30rpx;
margin: 200rpx 30rpx 0;
padding: 30rpx;
}
.option-item {
padding: 20rpx 30rpx;
border-radius: 50rpx;
margin-bottom: 25rpx;
background-color: #f5f7fb;
transition: all 0.3s ease;
}
.option-right {
display: flex;
align-items: center;
}
.option-box {
display: flex;
justify-content: space-between;
align-items: center;
}
.option-image {
width: 35rpx;
height: 35rpx;
margin-left: 20rpx;
}
.option-label {
font-size: 26rpx;
color: #333333;
font-weight: bold;
}
.option-val {
color: #ff370a;
}
.option-val2 {
margin: 0 auto;
}
.option-value {
font-size: 26rpx;
color: #999999;
flex: 1;
text-align: right;
margin-right: 20rpx;
}
.option-arrow {
width: 24rpx;
height: 24rpx;
}
/* 下一步按钮样式 */
.next-step-btn {
background-color: #ff4219;
color: #ffffff;
text-align: center;
padding: 20rpx;
border-radius: 100rpx;
margin: 40rpx 0;
}
.next-step-text {
font-size: 36rpx;
font-weight: 500;
}
/* 订单记录样式 */
.order-record {
text-align: center;
margin-top: 50rpx;
}
.order-record-text {
font-size: 28rpx;
color: #ff3f11;
}
/* 弹窗通用样式 */
.car-plate-popup {
padding: 30rpx;
box-sizing: border-box;
background-color: #ffffff;
border-radius: 30rpx 30rpx 0 0;
max-height: 80vh; /* 限制弹窗最大高度 */
}
.popup-header {
text-align: center;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.car-plate-list {
max-height: 600rpx;
overflow-y: auto;
padding-right: 10rpx; /* 为滚动条留出空间 */
}
/* 美化滚动条样式 */
.car-plate-list::-webkit-scrollbar {
width: 8rpx;
}
.car-plate-list::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4rpx;
}
.car-plate-list::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 4rpx;
}
.car-plate-list::-webkit-scrollbar-thumb:hover {
background: #999;
}
.car-plate-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx;
margin-bottom: 20rpx;
background-color: #f5f7fb;
border-radius: 20rpx;
transition: all 0.3s ease;
}
.car-plate-item.selected {
background-color: #ff431923;
border: 2rpx solid #ff4219;
}
.plate-number {
font-size: 28rpx;
font-weight: 500;
color: #333333;
flex: 1;
}
.rule-price {
font-size: 32rpx;
font-weight: bold;
color: #ff4219;
margin-right: 20rpx;
}
.popup-footer {
margin-top: 30rpx;
padding-top: 20rpx;
border-top: 1rpx solid #f0f0f0;
}
.close-btn {
width: 100%;
height: 90rpx;
line-height: 90rpx;
background-color: #ff4219;
color: #ffffff;
border: none;
border-radius: 45rpx;
font-size: 32rpx;
font-weight: 500;
}
.close-btn:active {
background-color: #e03a16;
}

View File

@ -0,0 +1,499 @@
<template>
<view class="monthly-payment-container">
<!-- 顶部标题 -->
<view class="header" @tap="toggleDropdown">
<text class="header-title">{{ headerTitle }}</text>
<u-icon :name="isDropdownOpen ? 'arrow-up' : 'arrow-down'" size="28"></u-icon>
</view>
<!-- 下拉停车场列表 -->
<view v-if="isDropdownOpen" class="parking-list">
<!-- 搜索框 -->
<view class="search-box">
<u-icon name="search" size="40" color="#999" class="search-icon" />
<input type="text" placeholder="搜索停车场" class="search-input" />
</view>
<!-- 停车场列表 -->
<view class="parking-items">
<view class="parking-item" v-for="(park, index) in parkingLots" :key="index"
@tap="selectParkingLot(park)">
<view class="parking-item-left">
<view class="parking-spaces">
<text class="spaces-label">剩余车位</text>
<text class="spaces-number">{{ park.space_count }}</text>
</view>
</view>
<view class="parking-item-right">
<text class="parking-name">{{ park.parking_name }}</text>
<text class="parking-distance">{{ park.distance }}km</text>
<text class="parking-address">{{ park.address }}</text>
</view>
<view class="parking-selected" v-if="park.isSelected"></view>
</view>
</view>
</view>
<view class="options-list">
<view class="overlay" v-if="isDropdownOpen" @tap="toggleDropdown"></view>
<!-- 车辆信息 -->
<view class="car-info">
<image class="car-image" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/car.png"
mode="aspectFit" />
</view>
<!-- 停车场信息 -->
<view class="park-info" v-if="headerTitle != '请选择停车场'">
<text class="park-name">{{ headerTitle }}</text>
<text class="park-type">{{ selectedParkType == 1 ? '地上' : '地下' }}</text>
</view>
<!-- 支付金额 -->
<view class="payment-amount">
<text class="amount-label">支付金额</text>
<text class="amount-value">¥{{ paymentAmount.toFixed(2) }}</text>
</view>
<!-- 选项列表 -->
<!-- 选择车牌 -->
<view class="option-item" @tap="selectCarPlate">
<view v-if="selectedCarPlate" class="option-box">
<view class="option-label option-val">{{ selectedCarPlate }}</view>
<view class="option-right">
<image class="option-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_refresh.png"
mode="aspectFit" />
<image class="option-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_finish.png"
mode="aspectFit" />
</view>
</view>
<view v-else class="option-box">
<text class="option-label">请选择车牌</text>
<u-icon name="arrow-right" size="30" />
</view>
</view>
<!-- 计费规则 -->
<view class="option-item" @tap="showPriceRule">
<view v-if="monthPrice !== ''" class="option-box">
<view class="option-label option-val2">{{ monthPrice + '元/月' }}</view>
</view>
<view v-else class="option-box">
<text class="option-label">计费规则</text>
<u-icon name="arrow-right" size="30" />
</view>
</view>
<!-- 包月月数 -->
<view class="option-item" @tap="selectMonthCount">
<view v-if="monthCount" class="option-box">
<view class="option-label option-val">{{ monthCount + '个月' }}</view>
<view class="option-right">
<image class="option-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_refresh.png"
mode="aspectFit" />
<image class="option-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_finish.png"
mode="aspectFit" />
</view>
</view>
<view v-else class="option-box">
<text class="option-label">包月月数</text>
<u-icon name="arrow-right" size="30" />
</view>
</view>
<!-- 开始时间 -->
<view class="option-item">
<view class="option-box">
<text class="option-label">开始时间</text>
<text class="option-value">{{ startTime }}</text>
</view>
</view>
<!-- 结束时间 -->
<view class="option-item">
<view class="option-box">
<text class="option-label">结束时间</text>
<text class="option-value">{{ endTime || '--年--月--日' }}</text>
</view>
</view>
<!-- 下一步按钮 -->
<view class="next-step-btn" @tap="goToNextStep">
<text class="next-step-text">下一步</text>
</view>
</view>
<!-- 订单记录 -->
<view class="order-record" @tap="viewOrderRecords">
<text class="order-record-text">订单记录>></text>
</view>
<!-- 车牌选择弹窗 -->
<u-popup :show="showCarPlatePopup" :round="30" mode="bottom" :closeable="true" close-icon-position="top-right"
@close="onCloseCarPlatePopup">
<view class="car-plate-popup">
<view class="popup-header">
<text class="popup-title">选择车牌</text>
</view>
<view class="car-plate-list">
<view class="car-plate-item" v-for="(plate, index) in carPlateList" :key="index"
@tap="onSelectCarPlate(plate)" :class="{ 'selected': selectedCarPlate === plate.car_number }">
<text class="plate-number">{{ plate.car_number }}</text>
<u-icon v-if="selectedCarPlate === plate.car_number" name="checkmark-circle" size="28"
color="#ff4219"></u-icon>
</view>
</view>
</view>
</u-popup>
<!-- 计费规则弹窗 -->
<u-popup :show="billingRulesPopup" :round="30" mode="bottom" :closeable="true" close-icon-position="top-right"
@close="onCloseBillingRulesPopup">
<view class="car-plate-popup">
<view class="popup-header">
<text class="popup-title">计费规则</text>
</view>
<view class="car-plate-list">
<view class="car-plate-item" v-for="(rule, index) in billingRulesList" :key="index"
@tap="onSelectBillingRule(rule)" :class="{ 'selected': monthPrice === rule.price }">
<text class="plate-number">{{ rule.billing_rule_name }}</text>
<text class="rule-price">¥{{ rule.month_price }}/</text>
<u-icon v-if="monthPrice === rule.month_price" name="checkmark-circle" size="28"
color="#ff4219"></u-icon>
</view>
</view>
</view>
</u-popup>
<!-- 包月月数选择弹窗 -->
<u-popup :show="showMonthCountPopup" :round="30" mode="bottom" :closeable="true" close-icon-position="top-right"
@close="onCloseMonthCountPopup">
<view class="car-plate-popup">
<view class="popup-header">
<text class="popup-title">选择包月月数</text>
</view>
<view class="car-plate-list">
<view class="car-plate-item" v-for="(month, index) in monthList" :key="index"
@tap="onSelectMonthCount(month)" :class="{ 'selected': monthCount === month.value }">
<text class="plate-number">{{ month.label }}</text>
<u-icon v-if="monthCount === month.value" name="checkmark-circle" size="28"
color="#ff4219"></u-icon>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
//
selectedCarPlate: '',
monthCount: '',
startTime: '',
endTime: '',
paymentAmount: 2400.00,
monthPrice: '',
//
isDropdownOpen: false,
headerTitle: '请选择停车场',
selectedParkType: '',
selectedParkId: '',//id
parkingLots: [],
//
showCarPlatePopup: false,
carPlateList: [],
selectedCarPlateId: '',//id
//
billingRulesPopup: false,
billingRulesList: [],
selectedBillingRule: '',//
//
showMonthCountPopup: false,
monthList: Array.from({ length: 12 }, (_, i) => ({
value: i + 1,
label: (i + 1) + '个月'
}))
}
},
computed: {
isAllFilled() {
return this.selectedParkId && this.selectedCarPlateId && this.monthCount > 0 && this.startTime;
}
},
methods: {
//
toggleDropdown() {
this.isDropdownOpen = !this.isDropdownOpen;
},
//
selectParkingLot(park) {
//
this.parkingLots.forEach(item => {
item.isSelected = false;
});
//
park.isSelected = true;
this.$set(this, 'headerTitle', park.parking_name);
this.$set(this, 'selectedParkType', park.space_type);
this.selectedParkId = park.id;
this.isDropdownOpen = false;
},
selectCarPlate() {
this.showCarPlatePopup = true;
},
onCloseCarPlatePopup() {
this.showCarPlatePopup = false;
},
//
onSelectCarPlate(plate) {
this.selectedCarPlate = plate.car_number;
this.selectedCarPlateId = plate.id;
this.showCarPlatePopup = false;
},
//
showPriceRule() {
if (!this.selectedParkId) {
uni.showToast({
title: '请选择停车场',
icon: 'none'
})
return;
}
this.getBillingRulesList();
this.billingRulesPopup = true;
},
//
onCloseBillingRulesPopup() {
this.billingRulesPopup = false;
},
//
onSelectBillingRule(rule) {
this.selectedBillingRule = rule.billing_rule_name;
this.monthPrice = rule.month_price;
this.paymentAmount = this.monthCount * this.monthPrice;
this.billingRulesPopup = false;
},
//
selectMonthCount() {
this.showMonthCountPopup = true;
},
//
onCloseMonthCountPopup() {
this.showMonthCountPopup = false;
},
//
onSelectMonthCount(month) {
this.monthCount = month.value;
if (this.startTime) {
const startDate = new Date(this.startTime);
//
const endDate = new Date(startDate);
endDate.setMonth(endDate.getMonth() + this.monthCount);
//
endDate.setDate(endDate.getDate() - 1);
// 23:59:59
endDate.setHours(23, 59, 59, 999);
// 使
const endYear = endDate.getFullYear();
const endMonth = String(endDate.getMonth() + 1).padStart(2, '0');
const endDay = String(endDate.getDate()).padStart(2, '0');
const endHours = String(endDate.getHours()).padStart(2, '0');
const endMinutes = String(endDate.getMinutes()).padStart(2, '0');
const endSeconds = String(endDate.getSeconds()).padStart(2, '0');
this.endTime = `${endYear}-${endMonth}-${endDay} ${endHours}:${endMinutes}:${endSeconds}`;
}
this.paymentAmount = this.monthCount * this.monthPrice;
this.showMonthCountPopup = false;
},
//
goToNextStep() {
if (!this.isAllFilled) {
uni.showModal({
title: "提示",
content: "请填写完整信息",
showCancel: false,
});
return;
}
//
// const params = {
// headerTitle: this.headerTitle,
// selectedParkType: this.selectedParkType,
// selectedParkId: this.selectedParkId,
// selectedCarPlateId: this.selectedCarPlateId,
// selectedCarPlate: this.selectedCarPlate,
// monthPrice: this.monthPrice,
// monthCount: this.monthCount,
// startTime: this.startTime,
// endTime: this.endTime,
// paymentAmount: this.paymentAmount,
// selectedBillingRule: this.selectedBillingRule,
// };
const params = {
user_id: uni.getStorageSync('userId'),
parking_id: this.selectedParkId,
car_id: this.selectedCarPlateId,
billing_rules: this.selectedBillingRule,
month_count: this.monthCount,
total_amount: this.paymentAmount,
start_time: this.startTime,
end_time: this.endTime,
}
request(apiArr.monthCardCreate, "POST", params).then((resVal) => {
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
const params = {
order_id: resVal.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type,
headerTitle: this.headerTitle,
selectedParkType: this.selectedParkType,
selectedParkId: this.selectedParkId,
selectedCarPlateId: this.selectedCarPlateId,
selectedCarPlate: this.selectedCarPlate,
monthPrice: this.monthPrice,
monthCount: this.monthCount,
startTime: this.startTime,
endTime: this.endTime,
paymentAmount: this.paymentAmount,
selectedBillingRule: this.selectedBillingRule,
}
NavgateTo(`../parkOrderDetail/index?item=${encodeURIComponent(JSON.stringify(params))}`);
})
},
//
viewOrderRecords() {
NavgateTo('../monthlyPaymentOrder/index');
},
//
getParkList() {
request(apiArr.parkList, "POST", {}).then((res) => {
//
this.parkingLots = res.parking_list.map(park => {
try {
let locationData = uni.getStorageSync('location');
if (locationData) {
let location = locationData;
const userLat = location.lat;
const userLng = location.lng;
const parkLat = park.lat;
const parkLng = park.lng;
// 使Haversine
const R = 6371; //
const dLat = (parkLat - userLat) * Math.PI / 180;
const dLng = (parkLng - userLng) * Math.PI / 180;
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(userLat * Math.PI / 180) * Math.cos(parkLat * Math.PI / 180) *
Math.sin(dLng / 2) * Math.sin(dLng / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = (R * c).toFixed(1);
//
return { ...park, distance };
}
return park;
} catch (error) {
console.error('计算停车场距离时出错:', error);
return park;
}
});
//
this.parkingLots.sort((a, b) => {
//
if (a.distance !== undefined && b.distance !== undefined) {
return a.distance - b.distance;
}
if (a.distance !== undefined) return -1;
if (b.distance !== undefined) return 1;
return 0;
});
})
},
//
getCarPlateList() {
request(apiArr.carList, "POST", {}).then((res) => {
this.carPlateList = res.car_list;
})
},
//
getBillingRulesList() {
const params = {
parking_id: this.selectedParkId,
}
request(apiArr.billingRulesList, "POST", params).then((res) => {
this.billingRulesList = res.billing_rules_list;
})
},
},
onLoad() {
// 0:00:00
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
const day = String(today.getDate()).padStart(2, '0');
// 'YYYY-MM-DD HH:mm:ss'
this.startTime = `${year}-${month}-${day} 00:00:00`;
//
this.paymentAmount = this.monthCount * this.monthPrice;
this.getParkList();
this.getCarPlateList();
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,152 @@
page{
background-color: #f4f7fb;
overflow-y: hidden;
}
.tabs {
display: flex;
align-items: center;
background: #ffffff;
height: 100rpx;
padding: 0 20rpx;
box-sizing: border-box;
display: flex;
overflow-x: auto;
white-space: nowrap;
}
.tabItem {
font-size: 25rpx;
color: #222222;
margin-right: 60rpx;
height: 42rpx;
}
.active2 {
font-size: 25rpx;
font-weight: 700;
position: relative;
}
.active2::after {
content: '';
background: url(https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_active.png) no-repeat;
background-size: 100% 100%;
width: 52rpx;
height: 22rpx;
position: absolute;
left: 50%;
bottom: -16rpx;
transform: translateX(-50%);
}
/* 订单列表样式 */
.order-list {
padding: 30rpx;
height: 85vh;
overflow-y: auto;
}
.order-card {
background-color: #ffffff;
border-radius: 20rpx;
margin-bottom: 30rpx;
overflow: hidden;
}
.order-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
background: linear-gradient(to right, #ffe7e7, #ffffff);
}
.copy-icon {
width: 30rpx;
height: 30rpx;
}
.order-number {
font-size: 26rpx;
color: #333;
font-weight: bold;
}
.order-status {
font-size: 26rpx;
padding: 5rpx 20rpx;
border-radius: 50rpx;
}
.order-status.pending {
color: #999999;
}
.order-status.using {
color: #ff4219;
}
.order-status.expired {
color: #999999;
}
.order-content {
padding: 30rpx;
}
.order-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
}
.order-item.amount {
padding-top: 30rpx;
}
.order-label {
font-size: 28rpx;
color: #666666;
}
.order-value {
font-size: 28rpx;
color: #333333;
text-align: right;
}
.amount-value {
color: #ff4219;
font-size: 32rpx;
font-weight: bold;
}
.order-value.paid {
color: #4CD964;
}
.order-footer {
display: flex;
justify-content: flex-end;
padding: 30rpx;
border-top: 1rpx solid #f0f0f0;
}
.cancel-button {
font-size: 28rpx;
color: #333;
background-color: #d9d9d9;
padding: 15rpx 40rpx;
border-radius: 50rpx;
margin-right: 20rpx;
}
.pay-button {
font-size: 28rpx;
color: #ffffff;
background-color: #ff4219;
padding: 15rpx 40rpx;
border-radius: 50rpx;
}

View File

@ -0,0 +1,161 @@
<template>
<view class="container">
<view class="tabs">
<view v-for="(item, index) in categoryList" :key="index"
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</view>
</view>
<!-- 订单列表 -->
<view class="order-list">
<view v-for="(order, index) in orders" :key="index" class="order-card">
<view class="order-header">
<text class="order-number">订单编号{{ order.order_sn }}</text>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/copy.png" class="copy-icon"
@click="copyOrderNo(order.order_sn)" />
<text class="order-status" :class="{
'pending': order.status == 1,
'using': order.status == 2,
'expired': order.status == 3
}">
{{ order.status == 1 ? '待支付' : order.status == 2 ? '使用中' : order.status == 3 ? '已过期' : '' }}
</text>
</view>
<view class="order-content">
<view class="order-item">
<text class="order-label">车场名称</text>
<text class="order-value">{{ order.parkingInfo.parking_name }}</text>
</view>
<view class="order-item">
<text class="order-label">车牌号</text>
<text class="order-value">{{ order.carInfo.car_no }}</text>
</view>
<view class="order-item">
<text class="order-label">包月月数</text>
<text class="order-value">{{ order.month_num }}个月</text>
</view>
<view class="order-item">
<text class="order-label">开始时间</text>
<text class="order-value">{{ order.carInfo.enable_time }}</text>
</view>
<view class="order-item">
<text class="order-label">到期时间</text>
<text class="order-value">{{ order.carInfo.deadline_time }}</text>
</view>
<view class="order-item amount">
<text class="order-label">订单金额</text>
<text class="order-value amount-value">¥{{ order.amount }}</text>
</view>
<!-- 根据订单状态显示不同内容 -->
<view v-if="order.status == '2' || order.status === '3'" class="order-item">
<text class="order-label">付款时间</text>
<text class="order-value">{{ order.pay_time }}</text>
</view>
<view v-if="order.status == '2'" class="order-item">
<text class="order-label">支付状态</text>
<text class="order-value paid">已支付</text>
</view>
</view>
<!-- 待支付订单显示操作按钮 -->
<view v-if="order.status == 1" class="order-footer">
<view class="cancel-button" @tap="cancelOrder(order)">取消订单</view>
<view class="pay-button" @tap="goToPayment(order)">去支付</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
categoryList: [
{
category_name: '全部',
category_id: 0
},
{
category_name: '待支付',
category_id: 1
},
{
category_name: '使用中',
category_id: 2
},
{
category_name: '已过期',
category_id: 3
},
],
selectedTab: 0,
orders: []
}
},
methods: {
//
copyOrderNo(order_sn) {
uni.setClipboardData({
data: order_sn,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
selectTab(index, item) {
this.selectedTab = index;
this.getOrderList()
},
//
cancelOrder(order) {
console.log('取消订单:', order);
},
//
goToPayment(order) {
NavgateTo('../parkOrderDetail/index?item=' + JSON.stringify(order));
},
//
getOrderList() {
const params = {
user_id: uni.getStorageSync('userId'),
order_status: this.selectedTab,
}
if (params.order_status == 0) {
params.order_status = ''
}
request(apiArr.monthCardOrderList, "POST", params).then(res => {
this.orders = res.month_card_order_list;
})
},
onLoad() {
this.getOrderList()
}
},
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,166 @@
/* 订单详情页面样式 */
page{
background-color: #f5f7fb;
}
/* 容器样式 */
.order-detail-container {
width: 100%;
min-height: 100vh;
}
/* 订单状态区域 */
.order-status-section {
height: 200rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx 50rpx;
background-color: #f5f7fb;
}
.status-left {
flex: 1;
}
.status-title {
font-size: 40rpx;
font-weight: 600;
color: #333333;
display: block;
margin-bottom: 10rpx;
}
.park-name {
font-size: 28rpx;
color: #333;
}
.status-right {
width: 250rpx;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.success-icon {
width: 100%;
height: 100%;
}
/* 金额信息区域 */
.amount-section {
background-color: #ffffff;
margin-bottom: 20rpx;
}
.amount-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 40rpx;
border-bottom: 1rpx solid #eeeeee;
}
.amount-item:last-child {
border-bottom: none;
}
.amount-label {
font-size: 30rpx;
color: #333;
font-weight: bold;
}
.amount-label2 {
font-size: 26rpx;
color: #666666;
}
.amount-value {
display: flex;
align-items: center;
}
.amount-value text {
font-size: 40rpx;
font-weight: 600;
color: #333333;
margin-right: 10rpx;
}
.arrow-icon {
width: 24rpx;
height: 24rpx;
transition: transform 0.3s;
}
/* 服务信息区域 */
.service-section {
background-color: #ffffff;
padding-bottom: 30rpx;
}
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
padding: 30rpx 40rpx 20rpx;
display: block;
}
.info-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 25rpx 40rpx;
}
.info-label {
font-size: 30rpx;
color: #666666;
}
.info-item text:last-child {
font-size: 30rpx;
color: #333333;
text-align: right;
flex: 1;
margin-left: 20rpx;
}
/* 订单号容器 */
.order-number-container {
display: flex;
align-items: center;
flex: 1;
justify-content: flex-end;
}
.order-number-container text {
font-size: 30rpx;
color: #333333;
margin-right: 10rpx;
}
.copy-icon {
width: 36rpx;
height: 36rpx;
cursor: pointer;
}
/* 触摸反馈效果 */
.amount-item:active,
.copy-icon:active {
background-color: rgba(0, 0, 0, 0.05);
}
/* 适配不同屏幕尺寸的响应式调整 */
@media screen and (min-width: 768px) {
.order-detail-container {
max-width: 768px;
margin: 0 auto;
box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
}
}

View File

@ -0,0 +1,183 @@
<template>
<view class="order-detail-container">
<!-- 订单状态区域 -->
<view class="order-status-section">
<view class="status-left">
<text class="status-title">订单已支付</text>
<text class="park-name">{{ orderDetail.parking.parking_name }}</text>
</view>
<view class="status-right">
<image class="success-icon"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderOk.png" mode="aspectFit">
</image>
</view>
</view>
<!-- 金额信息区域 -->
<view class="amount-section">
<view class="amount-item" @tap="toggleAmountExpand">
<text class="amount-label">实付金额</text>
<view class="amount-value">
<text>¥{{ orderDetail.pay_method/100 }}</text>
<u-icon :name="amountExpanded ? 'arrow-up' : 'arrow-down'" size="28"></u-icon>
</view>
</view>
<view class="amount-item" v-show="amountExpanded">
<text class="amount-label2">订单金额</text>
<text>¥{{ orderDetail.pay_method/100 }}</text>
</view>
</view>
<!-- 电商服务区域 -->
<view class="service-section">
<text class="section-title">订单信息</text>
<view class="info-item">
<text class="info-label">车牌号码</text>
<text>{{ orderDetail.record_info.car_number }}</text>
</view>
<view class="info-item">
<text class="info-label">交易时间</text>
<text>{{ orderDetail.pay_time }}</text>
</view>
<view class="info-item">
<!-- <text class="info-label">停车时长</text>
<text>{{ calculateParkingDuration() }}</text> -->
<text class="info-label">计费时长</text>
<text>{{ getTime(orderDetail.billing_time) }}</text>
</view>
<view class="info-item">
<text class="info-label">订单类型</text>
<text>停车</text>
</view>
<view class="info-item">
<text class="info-label">支付方式</text>
<text>{{ orderDetail.pay_method == 1 ? '微信' : orderDetail.pay_method == 2 ? '支付宝' : '其他' }}</text>
</view>
<view class="info-item">
<text class="info-label">订单号</text>
<view class="order-number-container">
<text>{{ orderDetail.order_no }}</text>
<image class="copy-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/copy.png"
mode="aspectFit" @tap="copyOrderNumber"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
//
amountExpanded: false,
//
orderDetail: {}
}
},
methods: {
//
toggleAmountExpand() {
this.amountExpanded = !this.amountExpanded;
},
//
copyOrderNumber() {
// 使uni.setClipboardData API
uni.setClipboardData({
data: this.orderDetail.order_no,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none',
duration: 2000
});
}
});
},
//
getTime(time) {
if (!time) {
return '0分钟';
}
const hourVal = Math.floor(time/60);
const minuteVal = time%60;
if (hourVal === 0) {
return `${minuteVal}分钟`;
}
return `${hourVal}小时${minuteVal}分钟`
},
calculateParkingDuration() {
if (!this.orderDetail || !this.orderDetail.record_info) {
return '0分钟';
}
const inTime = new Date(this.orderDetail.record_info.in_time);
const outTime = new Date(this.orderDetail.record_info.out_time);
//
const diffMs = outTime - inTime;
//
const diffMinutes = Math.floor(diffMs / (1000 * 60));
if (diffMinutes < 60) {
return `${diffMinutes}分钟`;
} else {
const hours = Math.floor(diffMinutes / 60);
const minutes = diffMinutes % 60;
if (minutes === 0) {
return `${hours}小时`;
} else {
return `${hours}小时${minutes}分钟`;
}
}
}
},
onLoad(options) {
console.log("接收的原始参数:", options);
if (options && options.order) {
try {
//
const decodedOrder = decodeURIComponent(options.order);
this.orderDetail = JSON.parse(decodedOrder);
console.log("解析成功:", this.orderDetail);
} catch (err) {
console.error("解析失败:", err);
//
}
}
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,181 @@
/* 页面基础样式 */
page {
background-color: #f5f7fb;
box-sizing: border-box;
}
.order-list {
width: 100%;
}
/* 月份分组样式 */
.month-group {
}
.month-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
font-size: 26rpx;
color: #999999;
}
.month-title {
}
.month-expense {
}
/* 订单项样式 */
.order-item {
background-color: #ffffff;
padding: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
position: relative;
border-bottom: 1rpx solid #eeeeee;
}
.order-left {
flex: 1;
display: flex;
flex-direction: column;
}
/* 订单类型样式 */
.order-type {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
}
.order-type1 {
display: flex;
align-items: center;
}
.order-icon {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
.order-type-text {
font-size: 28rpx;
color: #333333;
margin-right: 15rpx;
}
.order-status {
font-size: 24rpx;
color: #333;
}
/* 停车场信息样式 */
.order-park-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15rpx;
}
.order-park-name {
font-size: 28rpx;
color: #333333;
font-weight: bold;
flex: 1;
}
.order-amount {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-left: 20rpx;
}
/* 车辆信息样式 */
.order-car-info {
display: flex;
align-items: center;
margin-bottom: 15rpx;
}
.order-car-number {
font-size: 28rpx;
color: #999999;
margin-right: 15rpx;
}
.order-car-type {
font-size: 24rpx;
padding: 4rpx 16rpx;
border-radius: 20rpx;
background-color: #fff1f0;
color: #ff4d4f;
}
/* 时间样式 */
.order-time {
font-size: 24rpx;
color: #999999;
}
/* 删除按钮样式 */
.delete-button {
width: 40rpx;
height: 40rpx;
position: absolute;
bottom: 30rpx;
right: 30rpx;
}
/* 空状态样式 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.empty-icon {
width: 200rpx;
height: 200rpx;
margin-bottom: 30rpx;
}
.empty-text {
font-size: 28rpx;
color: #999999;
}
/* 响应式调整 */
@media screen and (min-width: 768px) {
.order-item {
padding: 40rpx;
}
.month-title {
font-size: 32rpx;
}
.order-park-name {
font-size: 36rpx;
}
.order-amount {
font-size: 40rpx;
}
}
/* 触摸反馈样式 */
.order-item:active {
background-color: #f8f8f8;
}
.delete-button:active {
opacity: 0.7;
}

View File

@ -0,0 +1,177 @@
<template>
<view class="order-list">
<!-- 订单按月分组显示 -->
<view class="month-group" v-for="monthGroup in orderData" :key="monthGroup.month">
<view class="month-header">
<text class="month-title">{{ monthGroup.pay_time }}</text>
<text class="month-expense">支出¥{{ monthGroup.amount }}</text>
</view>
<!-- 订单列表 -->
<view v-if="orderData.length > 0">
<view class="order-item" v-for="order in monthGroup.orders" :key="order.id"
@tap="viewOrderDetail(order)">
<view class="order-left">
<view class="order-type">
<view class="order-type1">
<image class="order-icon"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_p.png"
mode="aspectFit"></image>
<text class="order-type-text">停车</text>
</view>
<text class="order-status">{{ order.status == 1 ? '待支付' : '已支付' }}</text>
</view>
<view class="order-park-info">
<text class="order-park-name">{{ order.record_info.parking_info.parking_name }}</text>
<text class="order-amount">¥{{ order.amount.toFixed(2) }}</text>
</view>
<view class="order-car-info">
<text class="order-car-number">{{ order.record_info.car_number }}</text>
<text class="order-car-type">{{ order.record_info.car_billing_type == 1 ? '月租车' :
(order.record_info.car_billing_type == 2) ? '临时车' : '贵宾车' }}</text>
</view>
<text class="order-time">{{ order.pay_time }}</text>
</view>
<view class="delete-button" @tap.stop="deleteOrder(order)">
<u-icon name="trash" size="45rpx"></u-icon>
</view>
</view>
</view>
</view>
<!-- 空状态显示 -->
<view class="empty-state" v-if="orderData.length === 0">
<image class="empty-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/empty_order.png"
mode="aspectFit"></image>
<text class="empty-text">暂无停车订单</text>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
orderData: [],
page_num: 1,
page_size: 20,
}
},
methods: {
//
viewOrderDetail(order) {
const orderStr = JSON.stringify(order);
// &?
const encodedOrder = encodeURIComponent(orderStr);
NavgateTo(`../orderDetail/index?order=${encodedOrder}`);
},
//
deleteOrder(order) {
const that = this;
uni.showModal({
title: '确认删除订单',
content: '你确定删除订单吗?删除之后你将无法再找回该订单',
success: function (res) {
if (res.confirm) {
const params = {
order_id: order.id
}
request(apiArr.tempParkingOrderDelete, "POST", params).then((res) => {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
});
that.getOrderData();
})
}
}
});
},
//
groupOrdersByMonth(orderList) {
const monthMap = new Map();
orderList.forEach(order => {
let payTime;
try {
payTime = new Date(order.pay_time);
} catch (error) {
payTime = new Date(order.pay_time.replace(/T/, ' ').replace(/\+.*$/, ''));
}
//
const year = payTime.getFullYear();
const month = payTime.getMonth() + 1;
const monthKey = `${year}-${month.toString().padStart(2, '0')}`;
//
if (!monthMap.has(monthKey)) {
monthMap.set(monthKey, {
month: monthKey,
pay_time: `${year}${month}`,
amount: 0,
orders: []
});
}
//
const monthGroup = monthMap.get(monthKey);
monthGroup.orders.push(order);
monthGroup.amount += parseFloat(order.amount || 0);
});
// Map
const groupedArray = Array.from(monthMap.values());
groupedArray.sort((a, b) => b.month.localeCompare(a.month));
//
groupedArray.forEach(group => {
group.amount = group.amount.toFixed(2);
});
return groupedArray;
},
//
getOrderData() {
const params = {
page_num: this.page_num,
page_size: this.page_size,
user_id: uni.getStorageSync('userId')
}
request(apiArr.tempParkingOrderList, "POST", params).then((res) => {
this.orderData = this.groupOrdersByMonth(res.order_list);
})
}
},
onLoad() {
//
this.getOrderData();
},
//
onReachBottom() {
this.page_size += 10;
this.getOrderData();
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,151 @@
/* 订单详情页面样式 */
page {
background-color: #f5f7fb;
}
/* 容器样式 */
.order-detail-container {
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
}
/* 支付金额头部 */
.payment-header {
background-color: #ffffff;
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
margin-top: 20rpx;
}
.amount-info {
display: flex;
align-items: baseline;
}
.amount-symbol {
font-size: 32rpx;
color: #333333;
}
.amount-value {
font-size: 40rpx;
font-weight: bold;
color: #333333;
margin-left: 10rpx;
}
.payment-status {
font-size: 24rpx;
color: #ffffff;
background-color: #ff4219;
padding: 2rpx 15rpx;
border-radius: 30rpx;
margin-left: 15rpx;
}
/* 订单详情内容 */
.order-content {
padding: 40rpx 40rpx 0 40rpx;
background-color: #ffffff;
}
.detail-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0;
}
.detail-label {
font-size: 26rpx;
color: #a7a7a7;
width: 180rpx;
}
.detail-value {
font-size: 26rpx;
color: #333333;
flex: 1;
text-align: right;
}
.park-type {
color: #ff4219;
margin-right: 10rpx;
}
/* 支付方式选择 */
.payment-method {
margin-top: 20rpx;
background-color: #ffffff;
padding: 30rpx 40rpx;
}
.method-item {
display: flex;
justify-content: space-between;
align-items: center;
}
.method-info {
display: flex;
align-items: center;
}
.method-info-img {
width: 50rpx;
height: 50rpx;
margin-right: 20rpx;
}
.method-text {
font-size: 32rpx;
color: #333333;
}
/* 底部支付栏 */
.bottom-payment {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 40rpx;
background-color: #ffffff;
border-top: 1rpx solid #f0f0f0;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
}
.total-amount {
display: flex;
align-items: baseline;
}
.total-label {
font-size: 32rpx;
color: #666666;
}
.total-value {
font-size: 40rpx;
font-weight: bold;
color: #ff4219;
margin-left: 10rpx;
}
.pay-button {
background-color: #ff4219;
color: #ffffff;
padding: 20rpx 60rpx;
border-radius: 50rpx;
}
.pay-text {
font-size: 34rpx;
font-weight: bold;
color: #ffffff;
}

View File

@ -0,0 +1,188 @@
<template>
<view class="order-detail-container">
<!-- 支付金额头部 -->
<view class="payment-header">
<view class="amount-info">
<text class="amount-symbol">¥</text>
<text class="amount-value">{{ itemObj.paymentAmount }}</text>
<text class="payment-status">待付款</text>
</view>
</view>
<!-- 订单详情内容 -->
<view class="order-content">
<!-- 停车场信息 -->
<view class="detail-item">
<text class="detail-label">停车场</text>
<view class="detail-value">
<text class="park-type">{{ itemObj.selectedParkType == 1 ? '地上' : '地下' }}</text>
<text class="park-name">{{ itemObj.headerTitle }}</text>
</view>
</view>
<!-- 车牌号 -->
<view class="detail-item">
<text class="detail-label">车牌号</text>
<text class="detail-value">{{ itemObj.selectedCarPlate }}</text>
</view>
<!-- 开始时间 -->
<view class="detail-item">
<text class="detail-label">开始时间</text>
<text class="detail-value">{{ itemObj.startTime }}</text>
</view>
<!-- 结束时间 -->
<view class="detail-item">
<text class="detail-label">结束时间</text>
<text class="detail-value">{{ itemObj.endTime }}</text>
</view>
</view>
<!-- 支付方式选择 -->
<view class="payment-method">
<view class="method-item">
<view class="method-info">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit" class="method-info-img"></image>
<text class="method-text">微信支付</text>
</view>
<!-- <view class="payment-select" v-if="selectedPayment === 'wechat'">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view>
<view class="payment-select" v-else>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view> -->
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
mode="aspectFit" style="width: 30rpx; height: 30rpx;"></image>
</view>
</view>
<!-- 底部支付栏 -->
<view class="bottom-payment">
<view class="total-amount">
<text class="total-label">合计¥</text>
<text class="total-value">{{ itemObj.paymentAmount }}</text>
</view>
<view class="pay-button" @tap="submitPayment">
<text class="pay-text">立即支付</text>
</view>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
itemObj: {}
}
},
methods: {
//
submitPayment() {
const param = {
order_id: this.itemObj.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: this.itemObj.trans_type,
}
request(apiArr.monthCardOrderPreorder, "POST", param).then(res => {
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
//
uni.requestPayment({
timeStamp: res.timeStamp,
nonceStr: res.nonceStr,
package: res.package,
signType: res.signType,
paySign: res.paySign,
success: (payRes) => {
const params = {
order_id: resVal.order_id,
}
request(apiArr.monthCardOrderQuery, "POST", params).then(res => {
this.boxshadow1 = true
})
},
fail: (payErr) => {
uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
icon: 'none'
})
},
complete: () => {
//
}
})
} else {
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
})
}
},
onLoad(options) {
const rawData = JSON.parse(decodeURIComponent(options.item));
// month_card_order_list
if (rawData.carInfo) {
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
this.itemObj = {
endTime: rawData.carInfo.deadline_time || '',
headerTitle: rawData.parkingInfo.parking_name || '',
monthCount: rawData.month_num || 0,
monthPrice: rawData.monthly_rental_fee || 0,
order_id: rawData.id || 0,
paymentAmount: rawData.amount || 0,
selectedBillingRule: rawData.billing_rule_id || '',
selectedCarPlate: rawData.carInfo.car_no || '',
selectedCarPlateId: rawData.carInfo.id || 0,
selectedParkId: rawData.parking_id || 0,
selectedParkType: rawData.parkingInfo.space_type || 0,
startTime: rawData.carInfo.enable_time || '',
trans_type: trans_type,
user_id: rawData.user_id || 0
};
} else {
// 使
this.itemObj = rawData;
}
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -0,0 +1,485 @@
page {
background-color: #f5f7fb;
overflow-y: hidden;
}
.monthly-payment-container {
box-sizing: border-box;
width: 100%;
}
.header {
display: flex;
align-items: center;
justify-content: center;
position: relative;
background-color: #fff3f1;
padding: 20rpx 0;
height: 45rpx;
}
.header-title {
font-size: 32rpx;
font-weight: 500;
color: #333333;
text-align: center;
margin-right: 10rpx;
font-weight: bold;
}
.header-arrow {
width: 30rpx;
height: 30rpx;
margin-left: 10rpx;
}
/* 搜索框样式 */
.search-box {
display: flex;
align-items: center;
background-color: #f5f7fb;
border-radius: 50rpx;
padding: 20rpx 30rpx;
margin: 20rpx 0;
}
.search-icon {
margin-right: 15rpx;
}
.search-input {
flex: 1;
font-size: 26rpx;
color: #333333;
background-color: transparent;
}
/* 下拉停车场列表样式 */
.parking-list {
background-color: #ffffff;
padding: 20rpx 30rpx;
border-bottom: 1rpx solid #f0f0f0;
border-radius: 0 0 40rpx 40rpx;
position: fixed;
top: 80rpx;
left: 0;
right: 0;
z-index: 999;
}
.overlay {
position: absolute;
top: 90rpx;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 98;
}
.parking-items {
max-height: 600rpx;
overflow-y: auto;
}
.parking-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 25rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.parking-item:last-child {
border-bottom: none;
}
.parking-item-right {
flex: 1;
}
.parking-name {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 10rpx;
display: block;
}
.parking-distance {
font-size: 26rpx;
color: #999999;
margin-right: 20rpx;
}
.parking-address {
font-size: 26rpx;
color: #999999;
display: block;
margin-top: 8rpx;
}
.parking-item-left {
display: flex;
align-items: flex-start;
position: relative;
}
.parking-selected {
font-size: 40rpx;
color: #ff4219;
position: relative;
right: 30rpx;
}
.parking-spaces {
background-color: #ffeeee;
border-radius: 20rpx;
padding: 8rpx 16rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 30rpx;
}
.spaces-label {
font-size: 22rpx;
color: #ff4219;
margin-bottom: 4rpx;
}
.spaces-number {
font-size: 30rpx;
font-weight: bold;
color: #ff4219;
}
/* 车辆选择器 */
.changeCar {
background-color: #fff;
border-bottom: 1rpx solid #eeeeee;
position: relative;
}
.car-selector {
width: 27%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
height: 100rpx;
}
.selected-car-text {
font-size: 28rpx;
color: #333333;
font-weight: bold;
}
/* 车辆下拉列表样式 */
.car-dropdown {
width: 33%;
height: 600rpx;
overflow-y: auto;
background-color: #ffffff;
border-top: 1rpx solid #f0f0f0;
position: absolute;
top: 100rpx;
left: 0;
right: 0;
z-index: 999;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
margin-left: 50rpx;
border-radius: 20rpx;
}
.dropdown-arrow {
position: absolute;
top: -8px;
left: 20%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid #fff;
}
/* 车辆选项样式 */
.car-item {
padding: 30rpx;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #f0f0f0;
text-align: center;
font-weight: bold;
}
.car-item:last-child {
border-bottom: none;
}
.car-item:active {
background-color: #f5f7fb;
}
.container {
background-color: #fff;
padding: 30rpx;
}
.title {
font-size: 30rpx;
margin-top: 10rpx;
margin-bottom: 30rpx;
text-align: center;
}
.selectColorBox {
width: 95%;
display: flex;
justify-content: space-between;
align-items: center;
margin: 30rpx auto 0;
}
.selectColor {
display: flex;
justify-content: space-between;
align-items: center;
}
.color {
margin-right: 10rpx;
}
/* 弹窗样式 */
.payIpt {
background-color: #fff;
border-radius: 30rpx 30rpx 0 0;
overflow: hidden;
}
.tit {
font-size: 32rpx;
text-align: center;
padding: 30rpx 0;
font-weight: bold;
border-bottom: 1rpx solid #eee;
}
/* 颜色列表样式 */
.color-list {
max-height: 500rpx;
padding: 20rpx 0;
}
.color-item {
font-size: 28rpx;
text-align: center;
padding: 30rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.color-item:last-child {
border-bottom: none;
}
.color-item.active {
color: #ff4016;
}
/* 底部按钮样式 */
.popup-footer {
display: flex;
border-top: 1rpx solid #eee;
}
.cancel-btn,
.confirm-btn {
flex: 1;
text-align: center;
padding: 30rpx 0;
font-size: 32rpx;
}
.cancel-btn {
color: #666;
border-right: 1rpx solid #eee;
}
.confirm-btn {
color: #ff4016;
}
/* 查询停车费 */
.order-record {
text-align: center;
padding: 30rpx 0;
border-top: 1rpx solid #eeeeee;
background-color: #ffffff;
}
.order-record-text {
font-size: 28rpx;
color: #ff3f11;
}
/* 停车费展示部分样式 */
.cost-container {
background-color: #ffffff;
padding: 40rpx 30rpx;
margin-top: 20rpx;
}
.not-found{
text-align: center;
font-size: 28rpx;
color: #999999;
}
.cost-image{
width: 100%;
height: 150rpx;
margin-bottom: 10rpx;
}
.cost-header {
text-align: center;
margin-bottom: 20rpx;
}
.cost-title {
font-size: 32rpx;
color: #333333;
font-weight: bold;
}
.cost-title2 {
color: #999999;
margin-left: 10rpx;
}
.cost-amount {
display: flex;
align-items: baseline;
justify-content: center;
margin-bottom: 20rpx;
font-size: 40rpx;
color: #ff3f11;
font-weight: bold;
}
.amount-symbol {
margin-right: 10rpx;
}
.amount-number {
}
.cost-info {
margin-bottom: 30rpx;
}
.info-item {
display: flex;
justify-content: center;
margin-bottom: 15rpx;
font-size: 24rpx;
color: #999999;
}
.info-label {
margin-right: 10rpx;
}
.info-value {
}
.notice {
background-color: #fff8f4;
padding: 20rpx;
border-radius: 10rpx;
margin-bottom: 30rpx;
}
.notice-text {
font-size: 26rpx;
color: #999999;
text-align: center;
display: block;
}
.notice-text2 {
font-size: 28rpx;
color: #999999;
text-align: center;
}
.payment-methods {
margin-bottom: 40rpx;
}
.payment-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1rpx solid #f0f0f0;
position: relative;
}
.payment-item:last-child {
border-bottom: none;
}
.payment-item-content {
display: flex;
align-items: center;
}
.payment-icon {
width: 50rpx;
height: 50rpx;
margin-right: 20rpx;
border-radius: 50%;
}
.payment-name {
font-size: 30rpx;
color: #333333;
font-weight: bold;
}
.payment-selected {
width: 30rpx;
height: 30rpx;
border: 3rpx solid #ff3f11;
border-radius: 50%;
position: absolute;
right: 50rpx;
}
.payment-selected::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 15rpx;
height: 15rpx;
background-color: #ff3f11;
border-radius: 50%;
}
.pay-button {
width: 70%;
margin: 0 auto;
background-color: #ff370b;
color: #ffffff;
text-align: center;
padding: 20rpx 0;
font-size: 32rpx;
font-weight: bold;
border-radius: 50rpx;
}

View File

@ -0,0 +1,589 @@
<template>
<view class="monthly-payment-container">
<!-- 顶部标题 -->
<view class="header" @tap="toggleDropdown">
<text class="header-title">{{ headerTitle }}</text>
<u-icon :name="isDropdownOpen ? 'arrow-up' : 'arrow-down'" size="28"></u-icon>
</view>
<!-- 下拉停车场列表 -->
<view v-if="isDropdownOpen" class="parking-list">
<!-- 搜索框 -->
<view class="search-box">
<u-icon name="search" size="40" color="#999" class="search-icon" />
<input type="text" placeholder="搜索停车场" class="search-input" />
</view>
<!-- 停车场列表 -->
<view class="parking-items">
<view class="parking-item" v-for="(park, index) in parkingLots" :key="index"
@tap="selectParkingLot(park)">
<view class="parking-item-left">
<view class="parking-spaces">
<text class="spaces-label">剩余车位</text>
<text class="spaces-number">{{ park.space_count }}</text>
</view>
</view>
<view class="parking-item-right">
<text class="parking-name">{{ park.parking_name }}</text>
<text class="parking-distance">{{ park.distance }}km</text>
<text class="parking-address">{{ park.address }}</text>
</view>
<view class="parking-selected" v-if="park.isSelected"></view>
</view>
</view>
</view>
<view>
<view class="overlay" v-if="isDropdownOpen" />
<!-- 车辆选择区域 -->
<view class="changeCar">
<view class="car-selector" @tap="toggleCarDropdown">
<text class="selected-car-text">{{ selectedCar || '选择车辆' }}</text>
<u-icon :name="isCarDropdownOpen ? 'arrow-up' : 'arrow-down'" size="28"></u-icon>
</view>
<!-- 车辆下拉列表 -->
<view v-if="isCarDropdownOpen" class="car-dropdown">
<view class="dropdown-arrow"></view>
<view class="car-item" v-for="(car, index) in cars" :key="index" @click="selectCar(car)">
{{ car.car_number }}
</view>
</view>
</view>
<view class="container">
<view class="title">请输入车牌号码</view>
<car-number-input @numberInputResult="numberInputResult" :defaultStr="defaultNum"
ref="carNumberInput" />
<view class="selectColorBox" @click="show = true">
<view>车牌颜色</view>
<view class="selectColor">
<view class="color">{{ color }}</view>
<u-icon name="arrow-right" size="25"></u-icon>
</view>
</view>
</view>
<view class="order-record" @tap="selectCost">
<text class="order-record-text">查询停车费>></text>
</view>
<!-- 停车费展示部分 -->
<view v-if="showCost1">
<view v-if="payStatus === 1" class="cost-container">
<view>
<image class="cost-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderLoading.png"
mode="aspectFit" />
</view>
<view class="cost-header">
<text class="cost-title">{{ parkingLotName }} <text class="cost-title2">待支付</text></text>
</view>
<view class="cost-amount">
<text class="amount-symbol">¥</text>
<text class="amount-number">{{ costAmount }}</text>
</view>
<view class="cost-info">
<view class="info-item">
<text class="info-label">车牌号</text>
<text class="info-value">{{ currentCarNumber }}</text>
</view>
<view class="info-item">
<text class="info-label">进场时间</text>
<text class="info-value">{{ entryTime }}</text>
</view>
<view class="info-item">
<text class="info-label">计费时间</text>
<text class="info-value">{{ billingTime }}</text>
</view>
</view>
<view class="notice">
<!-- 未支付状态显示 -->
<text class="notice-text"> 请于付款后{{ feeOutTime }}分钟内离场否则将加收停车费</text>
</view>
<view class="payment-methods">
<view class="payment-item" :class="{ 'selected': paymentMethod === 'wechat' }"
@tap="selectPayment('wechat')">
<view class="payment-item-content">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit" class="payment-icon"></image>
<text class="payment-name">微信支付</text>
</view>
<view v-if="paymentMethod === 'wechat'" class="payment-selected"></view>
</view>
</view>
<view class="pay-button" @tap="confirmPayment">立即付款</view>
</view>
<view v-else class="cost-container notice-text2">
<view>
<image class="cost-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderLoading.png"
mode="aspectFit" />
</view>
<span v-if="!isTimeout"> 支付成功请于{{ countdownTime }}内离场否则将加收停车费</span>
<span v-else> 您已超时未离场已重新计费</span>
</view>
</view>
<view v-if="showCost2" class="cost-container not-found">
未找到停车记录
</view>
<!-- 选择车牌颜色 -->
<u-popup :show="show" :round="30" mode="bottom" @close="onClose">
<view class="payIpt">
<view class="tit">选择车牌颜色</view>
<!-- 颜色选择列表 -->
<scroll-view class="color-list" scroll-y>
<view class="color-item" :class="{ 'active': selectedColorIndex === index }"
v-for="(item, index) in colorOptions" :key="index" @click="selectColor(index)">
{{ item }}
</view>
</scroll-view>
<!-- 底部按钮 -->
<view class="popup-footer">
<view class="cancel-btn" @click="onClose">取消</view>
<view class="confirm-btn" @click="confirmColor">确定</view>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
import { apiArr } from '@/api/park.js'
export default {
data() {
return {
isDropdownOpen: false,
headerTitle: '请选择停车场',
parkingLots: [],
defaultNum: '',
color: '请选择',
show: false,
//
colorOptions: ['蓝牌', '黄牌', '黑牌', '白牌', '绿牌', '渐变绿底黑字', '黄绿双拼底黑字'],
//
selectedColorIndex: -1,
//
isCarDropdownOpen: false,
selectedCar: '',
cars: [],
//
showCost1: false,
showCost2: false,
parkingLotName: '',
costAmount: '',
currentCarNumber: '',
feeOutTime: '',//
entryTime: '',
billingTime: '',
paymentMethod: 'wechat',
// ID
timerId: null,
//
payStatus: 0,
payTime: '',
countdownTime: '',
isTimeout: false
}
},
onLoad() {
this.getParkList();
},
//
onUnload() {
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
},
methods: {
//
toggleDropdown() {
this.isCarDropdownOpen = false
this.isDropdownOpen = !this.isDropdownOpen;
},
//
selectParkingLot(park) {
//
this.parkingLots.forEach(item => {
item.isSelected = false;
});
//
park.isSelected = true;
//
this.$set(this, 'headerTitle', park.parking_name);
//
this.isDropdownOpen = false;
},
numberInputResult(e) {
this.defaultNum = e;
//
this.showCost1 = false;
this.showCost2 = false;
// 使$nextTickDOM
this.$nextTick(() => {
if (this.$refs.carNumberInput) {
// inputList
const valList = e.split("");
if (e == '其他车辆') {
for (let i = 0; i < 8; i++) {
this.$refs.carNumberInput.inputList[i] = ' ';
}
} else {
for (let i in valList) {
this.$refs.carNumberInput.inputList[i] = valList[i];
}
}
//
this.$refs.carNumberInput.$forceUpdate();
}
});
},
onClose() {
this.show = false;
},
//
updateBillingTime() {
const entryDateTime = new Date(this.entryTime);
const currentDateTime = new Date();
const diff = currentDateTime - entryDateTime;
//
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
//
let timeStr = '';
if (days > 0) {
timeStr += days + '天';
}
if (hours > 0 || days > 0) {
timeStr += hours + '时';
}
if (minutes > 0 || hours > 0 || days > 0) {
timeStr += minutes + '分';
}
timeStr += seconds + '秒';
this.billingTime = timeStr;
},
//
updateCountdown() {
const payDateTime = new Date(this.payTime);
const currentDateTime = new Date();
//
const expireDateTime = new Date(payDateTime.getTime() + parseInt(this.feeOutTime) * 60 * 1000);
//
if (currentDateTime > expireDateTime) {
this.isTimeout = true;
//
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
} else {
//
const remainingSeconds = Math.floor((expireDateTime - currentDateTime) / 1000);
// :
const minutes = Math.floor(remainingSeconds / 60);
const seconds = remainingSeconds % 60;
this.countdownTime = `${minutes}${seconds}`;
}
},
//
selectColor(index) {
this.selectedColorIndex = index;
},
//
confirmColor() {
if (this.selectedColorIndex !== -1) {
this.color = this.colorOptions[this.selectedColorIndex];
}
this.show = false;
},
//
toggleCarDropdown() {
this.isCarDropdownOpen = !this.isCarDropdownOpen;
},
//
selectCar(car) {
this.selectedCar = car.car_number;
this.isCarDropdownOpen = false;
if (car.car_number == '其他车辆') {
NavgateTo('../addCar/index')
}
this.numberInputResult(car.car_number)
},
//
selectCost() {
const selectedParkingLot = this.parkingLots.find(park => park.isSelected);
if (!selectedParkingLot) {
uni.showToast({
title: '请先选择停车场',
icon: 'none'
});
return;
}
if (!this.defaultNum) {
uni.showToast({
title: '请输入车牌号',
icon: 'none'
});
return;
}
const params = {
parking_id: selectedParkingLot.id,
car_number: this.defaultNum,
}
request(apiArr.tempParkingInfo, "POST", params).then((res) => {
if (res) {
this.parkingLotName = res.parking.parking_name;
this.costAmount = res.fee_amount;
this.currentCarNumber = res.car_number;
this.entryTime = res.in_time;
this.feeOutTime = res.parking.free_out_time
//
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
//
this.payStatus = res.pay_status || 0;
this.payTime = res.pay_time || '';
this.countdownTime = '';
this.isTimeout = false;
// (pay_status=1)
if (this.payStatus === 2 && this.payTime) {
//
this.updateCountdown();
//
this.timerId = setInterval(() => {
this.updateCountdown();
}, 1000);
} else {
if (res.car_billing_type == 1) {
this.billingTime = '月租车';
} else if (res.car_billing_type == 2) {
this.billingTime = '临时车';
} else {
//
this.updateBillingTime();
//
this.timerId = setInterval(() => {
this.updateBillingTime();
}, 1000);
}
}
this.showCost1 = true;
} else {
this.showCost2 = true;
}
})
},
//
selectPayment(method) {
this.paymentMethod = method;
},
//
confirmPayment() {
const selectedParkingLot = this.parkingLots.find(park => park.isSelected);
const params = {
car_number: this.defaultNum,
parking_id: selectedParkingLot.id,
user_id: uni.getStorageSync('userId'),
}
request(apiArr.tempParkingCreate, "POST", params).then((resVal) => {
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
const param = {
order_id: resVal.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.tempParkingOrderPreorder, "POST", param).then(res => {
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
//
uni.requestPayment({
timeStamp: res.timeStamp,
nonceStr: res.nonceStr,
package: res.package,
signType: res.signType,
paySign: res.paySign,
success: (payRes) => {
//
//
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
//
this.showCost1 = false;
this.showCost2 = false;
this.parkingLotName = '';
this.costAmount = '';
this.currentCarNumber = '';
this.entryTime = '';
this.billingTime = '';
this.feeOutTime = '';
//
this.paymentMethod = 'wechat';
const params = {
order_id: resVal.order_id,
}
request(apiArr.tempParkingOrderQuery, "POST", params).then(res => {
this.selectCost()
})
},
fail: (payErr) => {
const params = {
order_id: resVal.order_id
}
request(apiArr.tempParkingOrderDelete, "POST", params).then((res) => {
})
uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
icon: 'none'
})
}
})
} else {
const params = {
order_id: resVal.order_id
}
request(apiArr.tempParkingOrderDelete, "POST", params).then((res) => {
})
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
})
}).catch(error => {
console.log("111"); // 111
console.error("创建临时停车订单失败", error);
uni.showToast({
title: '创建订单失败',
icon: 'none'
})
})
},
//
getCarList() {
const params = {
user_id: uni.getStorageSync('userId')
}
request(apiArr.carList, "POST", params).then((res) => {
this.cars = res.car_list;
this.cars.push({
car_number: '其他车辆'
})
})
},
//
getParkList() {
request(apiArr.parkList, "POST", {}).then((res) => {
//
this.parkingLots = res.parking_list.map(park => {
try {
let locationData = uni.getStorageSync('location');
if (locationData) {
let location = locationData;
const userLat = location.lat;
const userLng = location.lng;
const parkLat = park.lat;
const parkLng = park.lng;
// 使Haversine
const R = 6371; //
const dLat = (parkLat - userLat) * Math.PI / 180;
const dLng = (parkLng - userLng) * Math.PI / 180;
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(userLat * Math.PI / 180) * Math.cos(parkLat * Math.PI / 180) *
Math.sin(dLng / 2) * Math.sin(dLng / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = (R * c).toFixed(1);
//
return { ...park, distance };
}
return park;
} catch (error) {
console.error('计算停车场距离时出错:', error);
return park;
}
});
//
this.parkingLots.sort((a, b) => {
//
if (a.distance !== undefined && b.distance !== undefined) {
return a.distance - b.distance;
}
if (a.distance !== undefined) return -1;
if (b.distance !== undefined) return 1;
return 0;
});
})
},
},
onShow() {
this.getCarList();
}
}
</script>
<style>
@import url('./index.css');
</style>

View File

@ -16,15 +16,15 @@
<view class="label">选择运营商</view>
<view class="operator-list">
<view class="operator-item" :class="{ 'active': selectedOperator === 'chinaMobile' }" @click="selectOperator('chinaMobile')">
<image class="operator-icon" src="http://localhost:8080/payTheFees_yidong.png" mode="aspectFit" />
<image class="operator-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_yidong.png" mode="aspectFit" />
<text>移动</text>
</view>
<view class="operator-item" :class="{ 'active': selectedOperator === 'chinaUnicom' }" @click="selectOperator('chinaUnicom')">
<image class="operator-icon" src="http://localhost:8080/payTheFees_liantong.png" mode="aspectFit" />
<image class="operator-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_liantong.png" mode="aspectFit" />
<text>中国联通</text>
</view>
<view class="operator-item" :class="{ 'active': selectedOperator === 'chinaTelecom' }" @click="selectOperator('chinaTelecom')">
<image class="operator-icon" src="http://localhost:8080/payTheFees_dianxin.png" mode="aspectFit" />
<image class="operator-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_dianxin.png" mode="aspectFit" />
<text>中国电信</text>
</view>
</view>
@ -118,8 +118,8 @@ export default {
handlePay() {
if (this.isFormValid) {
uni.showToast({
title: '缴费成功',
icon: 'success'
title: '该功能暂未实现',
icon: 'none'
});
}
},
@ -138,11 +138,11 @@ export default {
getOperatorIcon() {
switch (this.selectedOperator) {
case 'chinaMobile':
return 'http://localhost:8080/payTheFees_yidong.png';
return 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_yidong.png';
case 'chinaUnicom':
return 'http://localhost:8080/payTheFees_liantong.png';
return 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_liantong.png';
case 'chinaTelecom':
return 'http://localhost:8080/payTheFees_dianxin.png';
return 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/payTheFees_dianxin.png';
default:
return '';
}

View File

@ -1,52 +1,52 @@
<template>
<view class="container">
<div class="row">
<div class="row_label"><span>*</span>收货人</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span>*</span>收货人</view>
<view class="row_con">
<u--input placeholder="请输入姓名" clearable border="none" v-model="name"></u--input>
</div>
</div>
</view>
</view>
<div class="row">
<div class="row_label"><span>*</span>手机号</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span>*</span>手机号</view>
<view class="row_con">
<u--input type="number" placeholder="请输入手机号" clearable border="none" v-model="phone" ></u--input>
</div>
</div>
</view>
</view>
<div class="tabList">
<div class="tabItem" :class="{ 'active': tab == 0 }" @click="changeTab(0)">地图选址</div>
<div class="tabItem" :class="{ 'active': tab == 1 }" @click="changeTab(1)">地区选择</div>
</div>
<view class="tabList">
<view class="tabItem" :class="{ 'active': tab == 0 }" @click="changeTab(0)">地图选址</view>
<view class="tabItem" :class="{ 'active': tab == 1 }" @click="changeTab(1)">地区选择</view>
</view>
<div class="tabItems" v-if="tab == 0">
<div class="row">
<div class="row_label">地址</div>
<div class="row_con">
<div class="choseAddress" @click="chooseAddress">
<view class="tabItems" v-if="tab == 0">
<view class="row">
<view class="row_label">地址</view>
<view class="row_con">
<view class="choseAddress" @click="chooseAddress">
<text v-if="showOrientation">请选择地址</text>
<text v-if="!showOrientation" style="color: #000;">{{ orientation.region }} {{orientation.district}}</text>
</div>
</view>
<div class="currentAddress" v-if="showOrientation">
<div class="currentAddress1">
<div class="currentAddress1_left">当前定位{{orientation.district}}</div>
<div class="currentAddress1_right" @click="headerConfirmClick">使用</div>
</div>
<div class="currentAddress2">{{orientation.region}}</div>
</div>
</div>
</div>
<div class="row">
<div class="row_label">门牌号</div>
<div class="row_con noneborder">
<view class="currentAddress" v-if="showOrientation">
<view class="currentAddress1">
<view class="currentAddress1_left">当前定位{{orientation.district}}</view>
<view class="currentAddress1_right" @click="headerConfirmClick">使用</view>
</view>
<view class="currentAddress2">{{orientation.region}}</view>
</view>
</view>
</view>
<view class="row">
<view class="row_label">门牌号</view>
<view class="row_con noneborder">
<u--input placeholder="例6栋201室" clearable border="none" v-model="houseNumber"></u--input>
<!-- <div class="tips">记得完善门牌号</div> -->
</div>
</div>
</div>
<!-- <view class="tips">记得完善门牌号</view> -->
</view>
</view>
</view>
<div class="tabItems" v-if="tab == 1">
<view class="tabItems" v-if="tab == 1">
<view>
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 400rpx;" :value="id"
@change="bindChange">
@ -65,27 +65,27 @@
</picker-view>
</view>
<div class="row">
<div class="row_label"><span>*</span>详细地址</div>
<div class="row_con">
<view class="row">
<view class="row_label"><span>*</span>详细地址</view>
<view class="row_con">
<u--input placeholder="小区、门牌号" clearable border="none" v-model="houseNumber"></u--input>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="line"></div>
<div class="isdef" @click="headerSettingDefaultAddressClick">
<div class="isdef_left">
<div class="isdef_left1">设置默认地址</div>
<div class="isdef_left2">提醒下单时会优先选择</div>
</div>
<div class="isdef_right">
<view class="line"></view>
<view class="isdef" @click="headerSettingDefaultAddressClick">
<view class="isdef_left">
<view class="isdef_left1">设置默认地址</view>
<view class="isdef_left2">提醒下单时会优先选择</view>
</view>
<view class="isdef_right">
<img v-if="isDefault == 2" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png" alt="" />
<img v-if="isDefault == 1" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png" alt="" />
</div>
</div>
</view>
</view>
<div class="btn" @click="headerSubmitClick">确定</div>
<view class="btn" @click="headerSubmitClick">确定</view>
</view>
</template>
@ -222,9 +222,10 @@ export default {
})
return
}
console.log("🚀 ~ headerSubmitClick ~ type:", this.type)
if(this.type === 'edit') {
const res = await request(apiArr2.updateAddress, "POST", {
id: this.id,
user_id: this.id,
name: this.name,
phone: this.phone,
address: this.tab === 0 ? this.orientation.region + this.orientation.district : `${confirmProv1.short_name}${xsq.short_name ? xsq.short_name : confirmCity.short_name}${confirmDist.short_name}`,

View File

@ -1,44 +1,44 @@
<template>
<view class="container">
<div class="hasAddress">
<div class="addressList">
<div class="addressItem" v-for="item, index in list" :key="index" :class="{ 'addressItem_def': index == 0 }">
<div class="addressItem_top">
{{item.name}} {{item.phone}} <div v-if="item.is_default === 1" class="is_def">默认</div>
</div>
<div class="addressItem_mid">{{item.address}}{{ item.house_number }}</div>
<div class="addressItem_footer">
<div class="addressItem_footer_left">
<div v-if="item.is_default !== 1" @click="headerSettingDefault(item.id)">
<view class="hasAddress">
<view class="addressList">
<view class="addressItem" v-for="item, index in list" :key="index" :class="{ 'addressItem_def': index == 0 }">
<view class="addressItem_top">
{{item.name}} {{item.phone}} <view v-if="item.is_default === 1" class="is_def">默认</view>
</view>
<view class="addressItem_mid">{{item.address}}{{ item.house_number }}</view>
<view class="addressItem_footer">
<view class="addressItem_footer_left">
<view v-if="item.is_default !== 1" @click="headerSettingDefault(item.id)">
<image src="http://192.168.0.172:5500/7.15/shop_checked1.png"></image>
设为默认
</div>
</view>
<div v-if="item.is_default === 1">
<view v-if="item.is_default === 1">
<image src="http://192.168.0.172:5500/7.15/shop_checked2.png"></image>
已默认
</div>
</view>
</div>
<div class="addressItem_footer_right">
<div class="btn1" @click="deleteItem(item.id )">删除</div>
<div class="btn2" @click="editItem(item)">修改</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="footerBtn" @click="addAddress">新增收货地址</div>
</div>
</div>
</view>
<view class="addressItem_footer_right">
<view class="btn1" @click="deleteItem(item.id )">删除</view>
<view class="btn2" @click="editItem(item)">修改</view>
</view>
</view>
</view>
</view>
<view class="footer">
<view class="footerBtn" @click="addAddress">新增收货地址</view>
</view>
</view>
<div class="empty" v-if="false">
<view class="empty" v-if="false">
<image src="http://192.168.0.172:5500/7.15/shop_noAdd.png"></image>
<div class="empty_text">暂无收货地址</div>
<view class="empty_text">暂无收货地址</view>
<div class="addBtn" @click="addAddress">添加收货地址</div>
</div>
<view class="addBtn" @click="addAddress">添加收货地址</view>
</view>
</view>
</template>
@ -104,7 +104,7 @@ export default {
},
async init() {
const res = await request(apiArr.addressList, 'POST', {});
const res = await request(apiArr.addAddressList, 'POST', {});
this.list = res.address_list;
}
},

View File

@ -23,6 +23,34 @@ image {
z-index: 2;
}
.isDay {
background-color: orangered;
height: 35rpx;
border-radius: 5rpx;
color: white;
font-size: 22rpx;
text-align: center;
justify-content: center;
padding: 5rpx 10rpx;
display: flex;
}
.tag {
background-color: orangered;
color: white;
font-size: 40rpx;
padding: 5rpx 10rpx;
border-radius: 5rpx;
}
.tag-img {
position: absolute;
top: 20%;
left: 0;
z-index: 1;
}
.searchBox_left {
box-sizing: border-box;
padding-left: 20rpx;
@ -80,6 +108,7 @@ image {
color: #C7C7C7;
margin-left: 30rpx;
padding-bottom: 4rpx;
text-decoration: line-through;
}
.GGBox {
@ -159,6 +188,7 @@ image {
margin: 0 20rpx;
margin-top: 20rpx;
font-weight: 700;
display: flex;
}
.Msg {
@ -303,6 +333,15 @@ image {
display: flex;
}
.shadowBox1Item_btn{
width: 150rpx;
height: 170rpx;
opacity:0;
position: absolute;
left: 100rpx;
top: 40rpx;
}
.shadowBox1Item {
flex: 1;
display: flex;
@ -568,15 +607,17 @@ image {
margin: 5rpx 5rpx 0 5rpx;
}
.itemSizeBox {
margin: 30rpx;
}
.itemSize {
width: 30%;
font-size: 26rpx;
color: #333;
background: #F6F7FB;
border-radius: 40rpx;
padding: 10rpx 15rpx;
white-space: nowrap;
margin:20rpx 30rpx;
}
.itemSize_active {
@ -584,15 +625,14 @@ image {
color: #fff;
}
.itemSize-img{
.itemSize-img {
width: 100rpx;
height: 100rpx;
margin-right: 30rpx;
border-radius: 20rpx;
border:1rpx solid red;
}
.itemSize_top{
.itemSize_top {
display: flex;
margin-left: 30rpx;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,315 @@
.group-purchase-container {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
max-width: 750rpx;
margin: 0 auto;
background-color: #ffffff;
}
/* 顶部横幅 */
.banner {
background: linear-gradient(to right, #fd8d3c, #fe4909);
color: white;
/* position: relative; */
overflow: hidden;
height: 350rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.banner image {
width: 100%;
height: 300rpx;
/* object-fit: cover; */
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.banner-content {
z-index: 1;
}
.banner-title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 10rpx;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
.banner-subtitle {
font-size: 18rpx;
background-color: rgba(255, 255, 255, 0.2);
padding: 5rpx 10rpx;
border-radius: 4rpx;
display: inline-block;
}
/* 商品列表 */
.goods-list {
background-color: #ffffff;
padding: 30rpx 20rpx;
margin-top: -50rpx;
border-radius: 50rpx 50rpx 0 0;
height: 60vh;
overflow-y: auto;
}
.goods-item {
border-radius: 10rpx;
padding: 15rpx;
margin-bottom: 25rpx;
display: flex;
}
.goods-item2 {
border-radius: 10rpx;
padding: 15rpx;
margin-bottom: 25rpx;
display: flex;
}
.goods-image {
width: 140rpx;
height: 140rpx;
border-radius: 15rpx;
overflow: hidden;
margin-right: 15rpx;
}
.goods-image image {
width: 100%;
height: 100%;
object-fit: cover;
}
.goods-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.goods-name {
font-size: 28rpx;
font-weight: bold;
margin-bottom: 8rpx;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.goods-desc {
font-size: 22rpx;
color: #666;
margin-bottom: 10rpx;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.goods-price {
font-size: 28rpx;
color: #e63946;
margin-bottom: 10rpx;
}
.price-container {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
}
.group-price {
font-size: 28rpx;
color: #e63946;
margin-right: 10rpx;
border-radius: 4rpx;
display: flex;
}
.group-price1{
width: 100rpx;
padding: 10rpx 15rpx;
color: #ffffff;
background-color: #fc5d15;
border-radius: 15rpx 0 0 15rpx;
}
.group-price2{
width: auto;
padding: 10rpx 15rpx;
background: linear-gradient(to bottom, #fef6d6, #fee8a9);
border-radius: 0 15rpx 15rpx 0;
}
.original-price {
font-size: 26rpx;
color: #999;
}
.countdown {
width: auto;
font-size: 22rpx;
padding: 10rpx 20rpx;
color: #ffffff;
margin-bottom: 15rpx;
border-radius: 50rpx;
background-color: #fe2f01;
position: absolute;
/* top: 120rpx; */
bottom: -30rpx;
right: 0;
}
.quantity-control {
display: flex;
align-items: center;
justify-content: flex-end;
}
.decrease-btn {
width: 40rpx;
height: 40rpx;
background-color: #f5f5f5;
border: 1rpx solid #ccc;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #333;
}
.increase-btn {
width: 40rpx;
height: 40rpx;
background-color: #ff502a;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #ffffff;
}
.quantity {
margin: 0 15rpx;
font-size: 24rpx;
width: 40rpx;
text-align: center;
}
/* 购物车按钮 */
.shop_car {
width: 140rpx;
height: 140rpx;
position: fixed;
right: 33rpx;
bottom: 80rpx;
z-index: 10;
}
.shop_car image {
width: 100%;
height: 100%;
}
.u-badge {
position: absolute;
right: 0;
top: -10rpx;
}
/* 规格标签样式 */
.specification-tag {
width: 130rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #feeceb;
padding: 10rpx 20rpx;
border-radius: 40rpx;
margin: 15rpx 0;
font-size: 26rpx;
color: #dd4020;
}
.specification-tag text {
margin-right: 5rpx;
}
/* 货品列表样式 */
.sku-list {
margin-top: 10rpx;
padding: 15rpx;
background-color: #f9f9f9;
border-radius: 10rpx;
}
.sku-item{
position: relative;
margin-bottom: 30rpx;
}
.sku-info{
display: flex;
align-items: center;
justify-content: center;
}
.sku-image{
width: 100rpx;
height: 100rpx;
border-radius: 15rpx;
overflow: hidden;
margin-right: 15rpx;
}
.sku-price {
font-size: 26rpx;
color: #e63946;
margin-right: 10rpx;
border-radius: 4rpx;
display: flex;
margin-top: 15rpx;
}
.sku-price1{
width: auto;
padding: 10rpx 15rpx;
color: #ffffff;
background-color: #fc5d15;
border-radius: 15rpx 0 0 15rpx;
}
.sku-price2{
width: auto;
padding: 10rpx 15rpx;
background: linear-gradient(to bottom, #fef6d6, #fee8a9);
border-radius: 0 15rpx 15rpx 0;
}
.sku-control {
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 15rpx;
}
.sku-countdown {
width: auto;
font-size: 22rpx;
padding: 5rpx 20rpx;
color: #ffffff;
margin-bottom: 15rpx;
border-radius: 50rpx;
background-color: #fe2f01;
position: absolute;
top: 170rpx;
right: 0;
}

View File

@ -0,0 +1,350 @@
<template>
<view class="group-purchase-container">
<!-- 顶部横幅 -->
<view class="banner">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/gp_index_top.png"></image>
</view>
<!-- 商品列表 -->
<view class="goods-list">
<!-- 商品项 -->
<view v-for="(item, index) in goodsList" :key="index">
<!-- 有多个货品 -->
<view class="goods-item" v-if="item.group_buy_goods_list.length > 1">
<view class="goods-image">
<image :src="item.commodity_pic" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-name">{{ item.commodity_name }}</view>
<view class="goods-desc">{{ item.commodity_intro }}</view>
<view class="goods-price"> {{ getPriceRange(item.group_buy_goods_list) }} </view>
<!-- 选择规格标签 -->
<view class="specification-tag" @click.stop="toggleSkuList(index)">
<text>{{ item.showSkuList ? '收起' : '选择规格' }}</text>
<u-icon name="arrow-down" size="26rpx" color="#FF370B" v-if="!item.showSkuList"></u-icon>
<u-icon name="arrow-up" size="26rpx" color="#FF370B" v-else></u-icon>
</view>
<!-- 货品列表 -->
<view class="sku-list" v-if="item.showSkuList">
<view v-for="(sku, skuIndex) in item.group_buy_goods_list" :key="skuIndex">
<view class="sku-item" @click="toDetail(sku)">
<view class="sku-info">
<view class="sku-image">
<image :src="sku.commodity_pic" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-name">{{ sku.goods_name }}</view>
<view class="goods-desc">{{ sku.goods_spec }}</view>
</view>
</view>
<view class="price-container">
<view class="sku-price">
<view class="sku-price1">团购价</view>
<view class="sku-price2">{{ sku.group_buy_price }}/{{ sku.goods_unit }}
</view>
</view>
<view class="sku-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(index, skuIndex)">-
</view>
<view class="quantity">{{ sku.quantity }}</view>
<view class="increase-btn" @tap.stop="increaseQuantity(index, skuIndex)">+
</view>
</view>
</view>
<view class="original-price">单买价 {{ sku.sales_price }}/{{ sku.goods_unit }}</view>
<view class="sku-countdown">
{{
getEndTheCountdown(sku.group_buy_activity_info.end_time)
}}
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 只有一个货品 -->
<view v-else>
<view class="goods-item2" @click="toDetail(item)">
<view class="goods-image">
<image :src="item.commodity_pic" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-name">{{ item.commodity_name }}</view>
<view class="goods-desc">{{ item.commodity_intro }}</view>
<view class="price-container">
<view class="group-price">
<view class="group-price1">团购价</view>
<view class="group-price2">{{ item.group_buy_goods_list[0].group_buy_price }}/{{
item.group_buy_goods_list[0].goods_unit }}</view>
</view>
<view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(index, 0)">-</view>
<view class="quantity">{{ item.group_buy_goods_list[0].quantity }}</view>
<view class="increase-btn" @tap.stop="increaseQuantity(index, 0)">+</view>
</view>
</view>
<view class="original-price">单买价 {{ item.group_buy_goods_list[0].sales_price }}/{{
item.group_buy_goods_list[0].goods_unit }}</view>
<view class="countdown">
{{ getEndTheCountdown(item.group_buy_goods_list[0].group_buy_activity_info.end_time) }}
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 购物车按钮 -->
<view class="shop_car" @click="shopCar">
<u-badge numberType="limit" type="error" max="99" :value="carNum"></u-badge>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car_num.png"></image>
</view>
</view>
</template>
<script>
import { picUrl, menuButtonInfo, request, NavgateTo } from "../../../utils";
import { apiArr } from '@/api/groupPurchase.js'
import { apiArr as shopApi } from "../../../api/shop.js";
export default {
data() {
return {
goodsList: [],
carNum: 0,
quantity: 0,
timer: null, // ID
endTime: '', //
updateTime: Date.now(), //
goodsDetail: []
};
},
onLoad() {
// this.getGoodsList()
},
onShow() {
//
if (!this.timer) {
this.timer = setInterval(() => {
//
this.updateTime = Date.now();
}, 1000);
}
// getGoodsListgetShopdetailgetGoodsNum
Promise.all([
// getGoodsList
this.goodsList.length > 0 ? Promise.resolve() : this.getGoodsList(),
// getShopdetail
this.getShopdetail()
]).then(() => {
this.getGoodsNum();//
});
},
methods: {
getGoodsList() {
if(!uni.getStorageSync('userId')){
uni.showToast({
title: '请先登录',
icon: 'none'
})
return
}
const params = {
user_id: uni.getStorageSync('userId')
}
return request(apiArr.groupBuyList, 'POST', params).then(res => {
const list = res.group_buy_list.map(item => {
// quantity
const group_buy_goods_list = item.group_buy_goods_list.map(sku => ({
...sku,
commodity_pic: picUrl + sku.commodity_pic,
quantity: 0
}));
return {
...item,
commodity_pic: picUrl + item.commodity_pic,
showSkuList: false,
group_buy_goods_list
}
})
this.goodsList = list
return res;
})
},
getShopdetail() {
const params = {
is_group_buy: 1,
}
return request(shopApi.getCar, "POST", params).then((res) => {
this.carNum = res.total;
//
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
return res;
});
},
getGoodsNum() {
if (!this.goodsDetail || !this.goodsList || this.goodsList.length === 0) {
return;
}
//
this.goodsList.forEach(goods => {
//
goods.group_buy_goods_list.forEach(sku => {
//
const matchedItem = this.goodsDetail.find(item => item.goods_id === sku.goods_id);
// quantity
if (matchedItem) {
sku.quantity = matchedItem.count;
} else {
// 0
sku.quantity = 0;
}
});
});
},
toDetail(itemObj) {
const item = {
...itemObj,
groupById: itemObj.group_buy_activity_info.id
};
NavgateTo(`/packages/shop/groupPurchaseDetail/index?item=${JSON.stringify(item)}`)
},
//
getPriceRange(goodsList) {
if (!goodsList || goodsList.length === 0) return '¥0';
const prices = goodsList.map(item => Number(item.sales_price));
const minPrice = Math.min(...prices);
const maxPrice = Math.max(...prices);
return minPrice === maxPrice ? `${minPrice}` : `${minPrice} ~ ¥${maxPrice}`;
},
// /
toggleSkuList(index) {
this.goodsList[index].showSkuList = !this.goodsList[index].showSkuList;
},
//
increaseQuantity(goodsIndex, skuIndex) {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == 0) {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity += this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity
this.carNum += this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity
} else {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].total_stock) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].max_limit_quantity) {
uni.showToast({
title: '一次最多购买' + this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].max_limit_quantity + '件',
icon: 'none'
});
return
}
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity++;
this.carNum++;
}
const params = {
goods_id_and_count: [
{
goods_id: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].id,
count: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity,
},
],
group_buy_id: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].group_buy_activity_info.id
}
this.updateCar(params);
},
//
decreaseQuantity(goodsIndex, skuIndex) {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity > 0) {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity) {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity = 0
this.carNum = 0
} else {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity--;
this.carNum--;
}
const params = {
goods_id_and_count: [
{
goods_id: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].id,
count: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity,
},
],
group_buy_id: this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].group_buy_activity_info.id
}
this.updateCar(params);
} else {
uni.showToast({
title: '已经没有了...',
icon: 'none'
});
}
},
//
async updateCar(params) {
return request(shopApi.updateCar, "POST", params).then((res) => {
this.getShopdetail();
uni.showToast({
title: "操作成功!",
success() { },
});
});
},
//
shopCar() {
const item = {
is_group_buy: 1,
}
NavgateTo("../shopCar/index?item=" + JSON.stringify(item));
},
//
getEndTheCountdown(endTime) {
//
const now = new Date().getTime();
const end = new Date(endTime).getTime();
//
let diff = end - now;
//
if (diff <= 0) {
return '团购已结束';
}
//
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
diff -= days * (1000 * 60 * 60 * 24);
const hours = Math.floor(diff / (1000 * 60 * 60));
diff -= hours * (1000 * 60 * 60);
const minutes = Math.floor(diff / (1000 * 60));
diff -= minutes * (1000 * 60);
//
return `${days}${hours}小时${minutes}分钟后结束`;
}
},
onHide() {
//
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
}
};
</script>
<style>
@import url("./index.css");
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,878 @@
<template>
<view>
<view class="header">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_left" @click="back">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</view>
</view>
</view>
<view class="swiper">
<view class="tag2 tag-img" v-if="
currentGG.is_same_day
">当日达</view>
<swiper :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000" @change="changeIndex">
<swiper-item v-for="(item, index) in currentGG.goods_carousel" :key="index">
<image :src="picUrl + item"></image>
</swiper-item>
</swiper>
<view class="NumDot" v-if="currentGG.goods_carousel && currentGG.goods_carousel.length > 0">
{{ currentIndex }} /{{ currentGG.goods_carousel.length }}
</view>
</view>
<view class="box_15">
<view class="section_2">
<view class="text-wrapper_4">
<text lines="1" class="text_31"></text>
<text lines="1" class="text_30">{{ currentGG.group_buy_price }}</text>
<text lines="1" class="text_33">/{{ currentGG.goods_unit }}</text>
</view>
<text lines="1" decode="true" class="text_32">单买价&nbsp;{{ currentGG.sales_price }}/{{
currentGG.goods_unit }}</text>
</view>
<view class="section_3">
<text lines="1" class="text_34">距结束还剩</text>
<view class="box_16">
<view class="timeBox">
<view class="dayTimeBox">{{ endTheCountdownDay }}</view>
<view class="timeBox">
<view class="time">{{ endTheCountdownHour }}</view>
<view></view>
</view>
<view class="timeBox">
<view class="time">{{ endTheCountdownMinute }}</view>
<view></view>
</view>
<view class="timeBox">
<view class="time">{{ endTheCountdownSecond }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="Money">
<view class="MoneyMark"></view>
{{ currentGG.group_buy_price }}
<view class="MoneyUnit">/{{ currentGG.goods_unit }}</view>
<view class="num">已售{{ soldOutNum }} | 剩余{{ currentGG.total_stock }}</view>
</view>
<!-- 规格 -->
<!-- @click="changeGG2(item, index)" :class="index == currentGGIndex ? 'active' : ''"> -->
<view class="GGBox">
<view class="GG_left">
<view class="GG_Item" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'active' : ''">
{{ item.goods_spec }} / {{ item.goods_unit }}
</view>
</view>
<view class="GG_rigth" v-if="info.commodity_goods_info_list && info.commodity_goods_info_list.length > 0">
{{ info.commodity_goods_info_list.length }}
</view>
</view>
<view class="Tit">
<view class="tag tag-text" v-if="
currentGG.is_same_day
">当日达</view>
{{ currentGG.goods_name }}
</view>
<view class="Msg">{{ currentGG.commodity_brief }}</view>
<view class="fenge"></view>
<!-- 已购买区域 -->
<view>
<view class="purchase-area">
<view class="purchase-count">{{ totalCount }}人已购买</view>
<view class="view-more" @click="showPurchaseRecords">查看更多 &gt;</view>
</view>
<view class="record-list">
<view class="record-item" v-for="(record, index) in purchaseRecords" :key="index">
<view class="record-user">
<image :src="record.avatar" class="user-avatar"></image>
<view class="user-name">{{ record.nick_name }}</view>
</view>
<view class="record-amount">
{{ formatDate(record.buy_time) }}买了{{ record.count }}
</view>
<view class="record-time">
<button class="buy-btn" @click="goSubmit">去下单</button>
</view>
</view>
</view>
</view>
<view class="fenge"></view>
<h3 class="GoodsMsg">商品详情</h3>
<view class="Msg_Item">
<view class="Msg_ItemTit">货号</view>
<view class="Msg_ItemCon" @click="copys(currentGG.goods_no)">
{{ currentGG.goods_no }}
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_copy.png"></image>
</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">规格说明</view>
<view class="Msg_ItemCon">{{ currentGG.goods_spec }}</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">售卖单位</view>
<view class="Msg_ItemCon">{{ currentGG.goods_unit }}</view>
</view>
<view class="GoosMsg">
<image v-for="item in currentGG.goods_detail_pic" :src="picUrl + item" :key="item" mode="widthFix"></image>
</view>
<view class="priceInfo">
<h3 class="priceInfo-title">价格说明</h3>
<view class="priceInfo-content">
<view>
<text class="priceInfo-content-title">划线价格</text>
指商品的厂商指导价正品零售价市面常见价或该商品曾经展示过的销售价等并非原价仅供参考
</view>
<view>
<text class="priceInfo-content-title">未划线价格</text>
指商品的实时价格不因表述的差异改变性质具体成交价格根据商品参加活动或使用优惠券等发生变化最终以订单结算价格为准
</view>
</view>
</view>
<!-- 底部购物车 -->
<view class="Car">
<view class="car_left">
<view class="share" @click="share">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share.png"
mode="widthFix"></image>
分享
</view>
<view class="cars" @click="car">
<u-badge numberType="limit" :type="type" max="99" :value="carNum"></u-badge>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car.png"
mode="widthFix"></image>
购物车
</view>
</view>
<view class="car_right2" v-if="info.commodity_goods_info_list[currentGGIndex].total_stock < 1">
已售罄
</view>
<view class="car_right" v-if="
info.commodity_goods_info_list[currentGGIndex].total_stock > 0 &&
(!info.commodity_goods_info_list[currentGGIndex].cart_count ||
info.commodity_goods_info_list[currentGGIndex].cart_count.count == 0)
" @click="addCar">
加入购物车
</view>
<view class="car_right" @click="changeCar" v-if="
info.commodity_goods_info_list[currentGGIndex].cart_count.count > 0
&& info.commodity_goods_info_list[currentGGIndex].total_stock > 0
">
加入购物车
</view>
</view>
<!-- 分享 -->
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
<view class="shadowBox1">
<view class="shadowBox1Item" @click="shareFriend">
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
微信好友
</button>
</view>
<view class="shadowBox1Item" @click="openSave">
<button class="shadowBox1Item_btn">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_saveImg.png"
mode="aspectFill"></image>
生成海报
</button>
</view>
</view>
</view>
<!-- 海报 -->
<view class="shadow" @click="changeShadow2" v-if="boxshadow2">
<view class="shadowBox2">
<view class="shadowBox_img">
<view class="boxshadow_tit">今日商品推荐</view>
<view class="boxshadow_img">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
</image>
</view>
<view class="line"></view>
<view class="shadowBoxInfo">
<view class="shadowboxInfo_left">二维码</view>
<view class="shadowboxInfo_right">
<view class="shadowboxInfo_right_1">正鲜生</view>
<view class="shadowboxInfo_right_2">
长按识别小程序 <br />
数量有限马上抢购
</view>
</view>
</view>
</view>
<view class="shadowBox_btn" @click.stop="saveImg">保存海报</view>
</view>
</view>
<!-- 评价 查看详情 -->
<!-- <u-popup :show="show" round="20rpx" mode="bottom" @close="close" @open="open" :z-index="10070">
<view class="reviews-section">
<view class="popup-header">
<h3 class="popup-header-h3">评价</h3>
<view class="popup-header-view" @click="close">取消</view>
</view>
<view class="temp">
<view class="temp1">
<img class="temp_img" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/pingjia.png" />
为你展示真实评价
</view>
<view class="temp1" @click="showSizePopup">
款式
<img class="temp_img1" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/kuanshi.png" />
</view>
</view>
<view class="reviews-list" v-if="comments.length > 0">
<view class="review-item" v-for="(comment, index) in comments" :key="index">
<view class="review-user">
<image :src="comment.avatar" class="user-avatar"></image>
<view class="user-info">
<view class="user-name">{{ comment.username }}</view>
</view>
<view class="review-time">{{ comment.time }}</view>
</view>
<view class="user-purchase">已购 {{ comment.product }}</view>
<view class="review-content">{{ comment.content }}</view>
<view class="review-images" v-if="comment.images.length > 0">
<image :src="img" class="review-img" v-for="(img, idx) in comment.images" :key="idx"></image>
</view>
</view>
</view>
</view>
</u-popup> -->
<!-- 团购记录弹窗 -->
<u-popup :show="showPurchase" round="20rpx" mode="bottom" @close="closePurchase">
<view class="purchase-popup">
<view class="popup-header">
<h3 class="popup-header-h3">团购记录</h3>
<view class="popup-header-view" @click="closePurchase">取消</view>
</view>
<view class="purchase-records">
<view class="record-header">
<view class="record-header-item">买家</view>
<view class="record-header-item">数量</view>
<view class="record-header-item">购买时间</view>
</view>
<view class="record-list">
<view class="record-item" v-for="(record, index) in purchaseRecords" :key="index">
<view class="record-user">
<image :src="record.avatar" class="user-avatar"></image>
<view class="user-name">{{ record.nick_name }}</view>
</view>
<view class="record-amount">+{{ record.count }}</view>
<view class="record-time">{{ record.buy_time }}</view>
</view>
</view>
</view>
</view>
</u-popup>
<!-- 选择款式 -->
<u-popup :show="showSize" round="20rpx" mode="bottom" @close="closeSize">
<view class="popup-header">
<h3 class="popup-header-h3">选择款式</h3>
<view class="popup-header-view" @click="closeSize">取消</view>
</view>
<view class="itemSize_top">
<image :src="changeImg" class="itemSize-img"></image>
<view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/</view>
</view>
</view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''">
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
</view>
</u-popup>
</view>
</template>
<script>
import { apiArr } from "../../../api/shop";
import { apiArr as apiArr2 } from "../../../api/groupPurchase";
import { picUrl, menuButtonInfo, request, NavgateTo } from "../../../utils";
export default {
data() {
return {
itemObj: {},
picUrl,
top: "",
localHeight: "",
carNum: "",
prevCarNum: "",
currentNum: "0", //
type: "error",
boxshadow1: false,
boxshadow2: false,
id: "",
groupById: "",
info: "",
currentIndex: "1", //
currentGG: "", //
currentGGIndex: "", //index
carOrderList: [],
//
showReviewPopup: false,
soldOutNum: 0,
show: false,
showSize: false,
showPurchase: false,
purchaseRecords: [],
totalCount: 0,
changeImg: "",
changeName: "",
changePrice: "",
endTime: "",
endTheCountdownDay: '',
endTheCountdownHour: '',
endTheCountdownMinute: '',
endTheCountdownSecond: '',
timer: null, // ID
};
},
methods: {
//
showPurchaseRecords() {
if (this.purchaseRecords.length > 0) {
this.showPurchase = true;
} else {
uni.showToast({
title: '没有更多数据',
icon: 'none'
})
}
},
//
closePurchase() {
this.showPurchase = false;
},
//
goSubmit() {
NavgateTo('/packages/shop/groupPurchaseSubmit/index')
},
changeIndex(e) {
this.currentIndex = e.detail.current + 1;
},
back() {
uni.navigateBack({
delta: 1,
});
},
// -
shareFriend() {
this.boxshadow1 = false; //
//
const shareInfo = {
title: this.currentGG.goods_name || '商品分享', //
desc: this.currentGG.commodity_brief || '快来看看这款商品吧', //
link: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`, //
imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || '') //
};
//
if (typeof WeixinJSBridge === 'undefined') {
// 使uniAPI
if (typeof uni.share !== 'undefined') {
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
title: shareInfo.title,
summary: shareInfo.desc,
href: shareInfo.link,
imageUrl: shareInfo.imageUrl,
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
},
fail: (err) => {
console.error('分享失败', err);
uni.showToast({
title: '分享失败,请重试',
icon: 'none',
duration: 2000
});
}
});
} else {
uni.showToast({
title: '请在微信客户端打开',
icon: 'none'
});
}
return;
}
try {
//
WeixinJSBridge.invoke('sendAppMessage', {
title: shareInfo.title,
desc: shareInfo.desc,
link: shareInfo.link,
img_url: shareInfo.imageUrl,
img_width: '120',
img_height: '120',
type: 'link',
data_url: ''
}, (res) => {
if (res.err_msg === 'sendAppMessage:ok') {
uni.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
} else if (res.err_msg === 'sendAppMessage:cancel') {
uni.showToast({
title: '已取消分享',
icon: 'none',
duration: 2000
});
} else {
console.error('分享失败', res);
uni.showToast({
title: '分享失败,请重试',
icon: 'none',
duration: 2000
});
}
});
} catch (error) {
console.error('调用微信分享接口失败', error);
// 使wx.ready
if (typeof wx !== 'undefined') {
wx.ready(() => {
//
wx.onMenuShareAppMessage({
title: shareInfo.title,
desc: shareInfo.desc,
link: shareInfo.link,
imgUrl: shareInfo.imageUrl,
type: 'link',
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
},
cancel: () => {
uni.showToast({
title: '已取消分享',
icon: 'none',
duration: 2000
});
},
fail: (err) => {
console.error('分享失败', err);
uni.showToast({
title: '分享失败,请重试',
icon: 'none',
duration: 2000
});
}
});
//
uni.showToast({
title: '请点击右上角分享按钮',
icon: 'none'
});
});
wx.error((err) => {
console.error('微信JS-SDK初始化失败', err);
uni.showToast({
title: '分享功能加载失败',
icon: 'none'
});
});
}
}
},
changeShadow() {
this.boxshadow1 = false;
},
openSave() {
this.boxshadow1 = false;
this.boxshadow2 = true;
},
//
saveImg() {
this.boxshadow2 = false;
//
uni.downloadFile({
url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png",
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: (res) => {
uni.showToast({
title: "保存成功",
icon: "success",
duration: 2000,
});
},
fail: (err) => {
console.log("保存失败", err);
},
});
}
},
fail: (err) => {
console.log("下载失败", err);
},
});
},
changeShadow2() {
this.boxshadow2 = false;
},
//
share() {
this.boxshadow1 = true;
},
//
getGoodsInfo() {
const params = {
id: this.id,
group_buy_activity_id: this.groupById
}
request(apiArr.getGoodsInfo, "POST", params).then((res) => {
//
res.commodity_goods_info_list.forEach((item) => {
item.goods_detail_pic = item.goods_detail_pic ? item.goods_detail_pic.split(",") : [];
item.goods_carousel = item.goods_carousel ? item.goods_carousel.split(",") : [];
item.commodity_pic = item.commodity_pic ? item.commodity_pic.split(",") : [];
});
//
if (this.carOrderList) {
this.carOrderList.forEach((items) => {
res.commodity_goods_info_list.forEach((item) => {
if (items.goods_id == item.id) {
item.cart_count = { count: 0 };
item.cart_count.count = items.count;
}
});
});
}
const currentTime = new Date().getTime();
// group_buy_activity_info
if (res.commodity_goods_info_list && Array.isArray(res.commodity_goods_info_list)) {
res.commodity_goods_info_list = res.commodity_goods_info_list.filter(item => {
const startTime = new Date(item.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(item.group_buy_activity_info?.end_time).getTime();
return item.group_buy_activity_info !== null && currentTime >= startTime && currentTime <= endTime
});
}
this.info = res;
//
if (this.itemObj) {
// itemObj
this.itemObj.goods_detail_pic = this.itemObj.goods_detail_pic ? this.itemObj.goods_detail_pic.split(",") : [];
this.itemObj.goods_carousel = this.itemObj.goods_carousel ? this.itemObj.goods_carousel.split(",") : [];
this.itemObj.commodity_pic = this.itemObj.commodity_pic ? this.itemObj.commodity_pic.split(",") : [];
this.currentGG = this.itemObj;
// itemObj
this.currentGGIndex = this.info && this.info.commodity_goods_info_list
? this.info.commodity_goods_info_list.findIndex(item => item.id === this.itemObj.id)
: 0;
// 0
if (this.currentGGIndex === -1) {
this.currentGGIndex = 0;
}
this.changeImg = this.currentGG.commodity_pic[0];
this.changeName = this.currentGG.goods_alias;
this.changePrice = this.currentGG.sales_price;
} else {
//
this.currentGG = null;
this.currentGGIndex = 0;
this.changeImg = '';
this.changeName = '';
this.changePrice = '';
}
});
},
copys(e) {
uni.setClipboardData({
data: e,
success: (res) => {
uni.showToast({
title: "复制成功",
icon: "success",
duration: 2000,
});
},
});
},
//
changeGG(item, index) {
this.currentGG = item;
this.currentGGIndex = index;
if (this.currentGG.cart_count) {
this.currentNum = this.currentGG.cart_count.count;
} else {
this.currentGG.cart_count = { count: 0 };
}
this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
},
car() {
const item = {
is_group_buy: 1,
}
NavgateTo("../shopCar/index?item=" + JSON.stringify(item));
},
//
getShopCar() {
request(apiArr.getCarCount, "POST", {}).then((res) => {
this.carNum = res.total;
this.prevCarNum = res.total;
});
},
getShopCarList() {
const params = {
is_group_buy: 1,
}
return request(apiArr.getCar, "POST", params).then((res) => {
//
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
return res;
});
},
addCar() {
let that = this;
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = {
count: this.info.commodity_goods_info_list[this.currentGGIndex].min_order_quantity,
};
// this.info.commodity_goods_info_list.forEach((item) => {
// console.log(item.cart_count);
// goods_id_and_count.push({
// goods_id: item.id,
// count: item.cart_count ? item.cart_count.count : 0,
// });
// });
let countVal = this.info.commodity_goods_info_list[this.currentGGIndex].min_order_quantity
const params = {
goods_id_and_count: [
{
goods_id:
this.info.commodity_goods_info_list[this.currentGGIndex].id,
count: countVal,
},
],
group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id,
}
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
that.getShopCarList();
});
},
//
changeCar() {
// 0
const currentCount = this.info.commodity_goods_info_list[this.currentGGIndex].cart_count?.count;
//
const newCount = currentCount + 1;
const params = {
user_id: uni.getStorageSync("userId"),
goods_id_and_count: [
{
goods_id: this.info.commodity_goods_info_list[this.currentGGIndex].id,
count: newCount,
},
],
group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id,
};
request(apiArr.updateCar, "POST", params).then((res) => {
this.getShopCarList();
uni.showToast({
title: "操作成功!",
success() { },
});
this.getShopCar();
this.getGoodsInfo();
});
},
showPopup() {
this.show = true;
},
showSizePopup() {
this.showSize = true;
},
close() {
this.show = false;
},
closeSize() {
this.showSize = false;
},
//
getBuyRecord() {
const params = {
activity_id: 47,
goods_id: this.id
}
request(apiArr2.groupBuyRecord, 'POST', params).then(res => {
const record = res.group_buy_record.map(item => {
return {
...item,
avatar: picture + item.avatar
}
})
this.purchaseRecords = record
this.totalCount = res.total_count
// item.countsoldOutNum
this.soldOutNum = record.reduce((total, item) => total + (item.count || 0), 0)
})
},
formatDate(dateStr) {
if (!dateStr) return '';
const date = new Date(dateStr);
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${month}${day}`;
},
//
getEndTheCountdown(endTime) {
//
const now = new Date().getTime();
const end = new Date(endTime).getTime();
//
let diff = end - now;
//
if (diff <= 0) {
return '团购已结束';
}
//
this.endTheCountdownDay = Math.floor(diff / (1000 * 60 * 60 * 24));
diff -= this.endTheCountdownDay * (1000 * 60 * 60 * 24);
this.endTheCountdownHour = Math.floor(diff / (1000 * 60 * 60));
diff -= this.endTheCountdownHour * (1000 * 60 * 60);
this.endTheCountdownMinute = Math.floor(diff / (1000 * 60));
diff -= this.endTheCountdownMinute * (1000 * 60);
this.endTheCountdownSecond = Math.floor(diff / (1000));
}
},
onLoad(options) {
this.itemObj = JSON.parse(decodeURIComponent(options.item));
const meun = menuButtonInfo();
this.top = meun.top;
this.localHeight = meun.height;
this.id = this.itemObj.commodity_id ? this.itemObj.commodity_id : this.itemObj.id;
this.groupById = this.itemObj.groupById
if (this.itemObj.commodity_id) {
this.endTime = this.itemObj.group_buy_activity_info.end_time
} else {
this.endTime = this.itemObj.group_buy_goods_list[0].group_buy_activity_info.end_time
}
this.getBuyRecord()
this.getEndTheCountdown(this.endTime)
//
this.timer = setInterval(() => {
this.getEndTheCountdown(this.endTime)
}, 1000)
},
onReachBottom() { },
onShow() {
// getShopCarListgetGoodsInfo
this.getShopCarList().then(() => {
this.getGoodsInfo();
});
this.getShopCar();
},
//( id count 0 )
onHide() {
//
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
let goods_id_and_count = [];
this.info.commodity_goods_info_list.forEach((item) => {
goods_id_and_count.push({
goods_id: item.id,
count: item.cart_count ? item.cart_count.count : 0,
});
});
// request(apiArr.updateCar, "POST", {
// goods_id_and_count,
// }).then((res) => {
// console.log("Cart updated on hide");
// });
return;
},
};
</script>
<style>
@import url("./index.css");
</style>

View File

@ -0,0 +1,518 @@
page {
background-color: #f5f7fb;
}
.container {
padding: 0;
margin: 0;
font-size: 28rpx;
color: #333;
}
/* 顶部切换栏 */
.tab-bar {
display: flex;
background-color: #fff;
padding: 20rpx 0;
}
.tab-item {
width: 180rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
border-radius: 15rpx;
margin: 0 20rpx;
font-size: 28rpx;
border: 1rpx solid #ddd;
}
.tab-item.active {
background-color: #ff370b;
color: #fff;
}
/* 分隔线 */
.divider {
height: 20rpx;
background-color: #f5f5f5;
}
/* 公共标题样式 */
.section-title {
font-size: 32rpx;
color: #333;
font-weight: bold;
padding: 20rpx 30rpx;
}
/* 收货地址区域 */
.info-section {
background: repeating-linear-gradient(to right,
#fe5355,
#fe5355 20px,
#549aff 20px,
#549aff 40px);
padding: 10rpx 0;
}
.address-section {
background-color: #fff;
}
.address-info {
padding: 30rpx;
display: flex;
justify-content: space-between;
align-items: flex-start;
border-bottom: 1rpx solid #eee;
}
.address-main {
flex: 1;
}
.address-name-phone {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.name {
font-size: 32rpx;
margin-right: 20rpx;
}
.phone {
font-size: 30rpx;
color: #666;
}
.address-detail {
font-size: 28rpx;
color: #666;
line-height: 40rpx;
display: flex;
align-items: center;
}
.address-arrow {
color: #333;
}
/* 商品信息区域 */
.goods-section {
background-color: #fff;
margin-bottom: 20rpx;
}
.goods-item {
border-radius: 10rpx;
padding: 15rpx;
display: flex;
background-color: #fff;
}
.goods-image {
width: 140rpx;
height: 140rpx;
border-radius: 15rpx;
overflow: hidden;
margin-right: 15rpx;
}
.goods-image image {
width: 100%;
height: 100%;
object-fit: cover;
}
.goods-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.goods-name {
font-size: 28rpx;
font-weight: bold;
margin-bottom: 8rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.goods-desc {
font-size: 22rpx;
color: #666;
margin-bottom: 10rpx;
}
.price-container {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
}
.group-price {
font-size: 28rpx;
color: #e63946;
margin-right: 10rpx;
border-radius: 4rpx;
/* display: flex; */
}
.group-price-box {
display: flex;
}
.group-price1 {
width: 100rpx;
padding: 10rpx 15rpx;
color: #ffffff;
background-color: #fc5d15;
border-radius: 15rpx 0 0 15rpx;
}
.group-price2 {
width: auto;
padding: 10rpx 15rpx;
background: linear-gradient(to bottom, #fef6d6, #fee8a9);
border-radius: 0 15rpx 15rpx 0;
}
.original-price {
font-size: 26rpx;
color: #999;
}
.countdown {
width: 250rpx;
font-size: 22rpx;
padding: 10rpx 15rpx;
color: #ffffff;
margin-bottom: 15rpx;
border-radius: 50rpx;
background-color: #fe2f01;
position: absolute;
top: 150rpx;
right: 0;
}
.quantity-control {
display: flex;
align-items: center;
justify-content: flex-end;
}
.decrease-btn {
width: 40rpx;
height: 40rpx;
background-color: #f5f5f5;
border: 1rpx solid #ccc;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #333;
}
.increase-btn {
width: 40rpx;
height: 40rpx;
background-color: #ff502a;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #ffffff;
}
.quantity {
margin: 0 15rpx;
font-size: 24rpx;
width: 40rpx;
text-align: center;
}
/* 运费和总金额区域 */
.fee-section,
.total-section {
background-color: #fff;
padding: 30rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #eee;
}
.fee-name,
.total-name {
font-size: 30rpx;
}
.fee-value,
.total-value {
font-size: 30rpx;
color: #333;
}
.total-value {
font-weight: bold;
color: #FF7658;
}
/* 复制 */
.copy-icon {
width: 30rpx;
height: 30rpx;
background-image: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/copy.png');
background-size: cover;
margin-left: 10rpx;
}
/* 支付方式区域 */
.payment-section {
background-color: #fff;
margin-bottom: 20rpx;
margin-top: 15rpx;
}
.payment-item {
padding: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1rpx solid #eee;
}
.payment-icon {
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
}
.payment-icon image {
width: 100%;
height: 100%;
}
.payment-content {
flex: 1;
}
.payment-name {
font-size: 32rpx;
margin-bottom: 5rpx;
}
.payment-desc {
font-size: 26rpx;
color: #333;
}
.payment-select {
color: #FF7658;
}
/* 立即支付按钮 */
.pay-button {
height: 100rpx;
line-height: 100rpx;
text-align: center;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
color: #fff;
font-size: 36rpx;
font-weight: bold;
border-radius: 50rpx;
position: fixed;
bottom: 50rpx;
left: 15%;
width: 70%;
/* z-index: 99; */
}
/* 自提样式 */
.pickup-info {
padding: 30rpx;
background-color: #fff;
}
.pickup-address {
font-size: 30rpx;
margin-bottom: 10rpx;
}
.pickup-time {
font-size: 28rpx;
color: #999;
}
/* 弹窗 */
.shadow {
background: rgba(0, 0, 0, 0.4);
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 9;
}
.shadowBox2 {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: auto;
height: auto;
}
.shadowBox_img {
width: 600rpx;
height: 500rpx;
background-color: #fff;
border-radius: 20rpx;
}
.boxshadow_tit {
font-size: 32rpx;
color: #222222;
padding-top: 40rpx;
display: flex;
justify-content: center;
align-items: center;
}
.boxshadow_tit_img {
width: 70rpx;
height: 70rpx;
margin-right: 10rpx;
}
.boxshadow_img {
/* width: 300rpx;
height: 300rpx; */
margin: 0 auto;
margin-top: 40rpx;
text-align: center;
}
.boxbottom {
width: 100%;
margin-top: 50rpx;
display: flex;
justify-content: center;
align-items: center;
}
.line1 {
width: 80rpx;
height: 1rpx;
margin: 0 10rpx;
background: linear-gradient(to left, #333, #fff);
}
.line2 {
width: 80rpx;
height: 1rpx;
margin: 0 10rpx;
background: linear-gradient(to right, #333, #fff);
}
.shadowBox1 {
width: 100%;
display: flex;
margin-top: 30rpx;
}
.shadowBox1Item_btn{
width: 110rpx;
height: 150rpx;
border: 1rpx solid red;
position: absolute;
left: 100rpx;
opacity:0;
}
.shadowBox2Item_btn{
width: 110rpx;
height: 150rpx;
border: 1rpx solid red;
position: absolute;
right: 100rpx;
opacity:0;
}
.shadowBox1Item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #000000;
}
.shadowBox1Item image {
width: 100rpx;
height: 100rpx;
margin-bottom: 26rpx;
}
.shadowBoxInfo {
display: flex;
align-items: center;
margin-left: 62rpx;
margin-top: 11rpx;
}
.shadowboxInfo_left {
width: 130rpx;
height: 130rpx;
background: #EFEFEF;
border-radius: 50%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
margin-right: 36rpx;
}
.shadowboxInfo_right_1 {
font-size: 32rpx;
color: #222222;
margin-bottom: 10rpx;
}
.shadowboxInfo_right_2 {
font-size: 26rpx;
color: #999999;
}
.shadowBox_btn {
font-size: 36rpx;
color: #FFFFFF;
width: 600rpx;
height: 90rpx;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 60rpx;
}
.empty-tip{
height: 200rpx;
font-size: 28rpx;
color: #999999;
text-align: center;
line-height: 200rpx;
background-color: #fff;
}

View File

@ -0,0 +1,786 @@
<template>
<view class="container">
<!-- 顶部切换栏 -->
<view class="tab-bar">
<!-- <view :class="{ active: activeTab === 'delivery' }" class="tab-item" @click="switchTab('delivery')">配送
</view> -->
<view :class="{ active: activeTab === 'pickup' }" class="tab-item" @click="switchTab('pickup')">自提</view>
</view>
<!-- 分隔线 -->
<view class="divider"></view>
<!-- 配送/自提信息 -->
<view class="info-section" v-if="activeTab === 'delivery'">
<view class="address-section">
<view class="section-title">收货地址</view>
<view class="address-info" @click="chooseAddress" v-if="defAddress">
<view class="address-main">
<view class="address-name-phone">
<text class="name">{{ defAddress.name }}</text>
<text class="phone">{{ defAddress.phone }}</text>
</view>
<view class="address-detail">
{{ defAddress.address }}{{ defAddress.house_number }}
<view class="copy-icon" @click.stop="copyAddress" />
</view>
</view>
<view class="address-arrow"><u-icon name="arrow-right" size="25"></u-icon></view>
</view>
</view>
</view>
<!-- 分隔线 -->
<view class="divider"></view>
<!-- 商品信息 -->
<view v-if="activeTab === 'delivery' && orderList1.length > 0">
<view class="goods-list">
<view class="goods-item" v-for="(item, index) in orderList1" :key="index">
<view class="goods-image">
<image :src="item.commodity_goods_info.commodity_pic" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-name">{{ item.commodity_goods_info.goods_name }}</view>
<view class="goods-desc">{{ item.commodity_goods_info.goods_spec }}</view>
<view class="price-container">
<view class="group-price">
<view>{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit
}}</view>
<!-- 运费 -->
<view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view>
</view>
<view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(item)">-</view>
<view class="quantity">{{ item.count }}</view>
<view class="increase-btn" @tap.stop="increaseQuantity(item)">+</view>
</view>
</view>
</view>
</view>
</view>
<!-- 运费 -->
<!-- <view class="fee-section">
<view class="fee-name">运费</view>
<view class="fee-value">{{ item.commodity_goods_info.freight }}</view>
</view> -->
<!-- 总金额 -->
<view class="total-section">
<view class="total-name">总金额</view>
<view class="total-value">{{ calculateTotal('order1') }}</view>
</view>
<!-- 支付方式 -->
<view class="payment-section">
<view class="payment-item" @click="selectPayment('wechat')">
<view class="payment-icon">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit"></image>
</view>
<view class="payment-content">
<view class="payment-name">微信支付</view>
<view class="payment-desc"><text
style="color: #f03d0e;margin-right: 15rpx;">可用优惠券</text>单笔支付限额:¥10000.00</view>
</view>
<view class="payment-select" v-if="selectedPayment === 'wechat'">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view>
<view class="payment-select" v-else>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view>
</view>
</view>
</view>
<view v-if="activeTab === 'delivery' && orderList1.length == 0" class="empty-tip">
暂无商品数据
</view>
<view v-if="activeTab === 'pickup' && orderList2.length > 0">
<!-- 按供应商分组 -->
<view v-for="(group, supplierId) in supplierGroups" :key="supplierId">
<view class="goods-list">
<view class="info-section">
<view class="address-section">
<view class="section-title">自提点</view>
<view @click="editAddress(group[0])">
<view v-if="defZTAddress.length > 0">
<view v-for="(adItem, adIndex) in defZTAddress" :key="adIndex">
<view class="address-info" v-if="adItem.id == supplierId">
<view class="address-main">
<view class="address-name-phone">
<text class="name">{{ adItem.name }}</text>
<text class="phone">{{ adItem.phone }}</text>
</view>
<view class="address-detail">
{{ adItem.address }}
<view class="copy-icon" @click.stop="copyZTAddress" />
</view>
</view>
<view class="address-arrow"><u-icon name="arrow-right" size="25"></u-icon>
</view>
</view>
</view>
<view class="address-info"
v-if="!defZTAddress.some(adItem => adItem.id == supplierId)">
<view class="address-main">
<view class="address-name-phone">
<text class="name">请选择自提点</text>
</view>
</view>
<view class="address-arrow"><u-icon name="arrow-right" size="25"></u-icon>
</view>
</view>
</view>
<view class="address-info" v-else>
<view class="address-main">
<view class="address-name-phone">
<text class="name">请选择自提点</text>
</view>
</view>
<view class="address-arrow"><u-icon name="arrow-right" size="25"></u-icon></view>
</view>
</view>
</view>
</view>
</view>
<!-- 该供应商下的所有商品 -->
<view class="goods-item" v-for="(item, index) in group" :key="index">
<view class="goods-image">
<image :src="item.commodity_goods_info.commodity_pic" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-name">{{ item.commodity_goods_info.goods_name }}</view>
<view class="goods-desc">{{ item.commodity_goods_info.goods_spec }}</view>
<view class="price-container">
<view class="group-price">
<view>
<view v-if="isWithinActivityTime(item)" class="group-price-box">
<view class="group-price1">团购价</view>
<view class="group-price2">
{{ '¥' + item.commodity_goods_info.group_buy_price }}
/{{ item.commodity_goods_info.goods_unit }}
</view>
</view>
<view v-else>
{{ '¥' + item.commodity_goods_info.sales_price }}
/{{ item.commodity_goods_info.goods_unit }}
</view>
</view>
<!-- 运费 -->
<!-- <view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view> -->
</view>
<view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(item)">-</view>
<view class="quantity">{{ item.count }}</view>
<view class="increase-btn" @tap.stop="increaseQuantity(item)">+</view>
</view>
</view>
</view>
</view>
</view>
<!-- 运费 -->
<!-- <view class="fee-section">
<view class="fee-name">运费</view>
<view class="fee-value">{{ item.commodity_goods_info.freight }}</view>
</view> -->
<!-- 总金额 -->
<view class="total-section">
<view class="total-name">总金额</view>
<view class="total-value">{{ calculateTotal('order2') }}</view>
</view>
<!-- 支付方式 -->
<view class="payment-section">
<view class="payment-item" @click="selectPayment('wechat')">
<view class="payment-icon">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit"></image>
</view>
<view class="payment-content">
<view class="payment-name">微信支付</view>
<view class="payment-desc"><text
style="color: #f03d0e;margin-right: 15rpx;">可用优惠券</text>单笔支付限额:¥10000.00</view>
</view>
<view class="payment-select" v-if="selectedPayment === 'wechat'">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view>
<view class="payment-select" v-else>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
mode="aspectFit" style="width: 40rpx; height: 40rpx;"></image>
</view>
</view>
</view>
</view>
<view v-if="activeTab === 'pickup' && orderList2.length == 0" class="empty-tip">
暂无商品数据
</view>
<!-- 立即支付按钮 -->
<view class="pay-button" @click="submitPayment">立即支付</view>
<!-- 弹窗 - 支付成功 -->
<view class="shadow" @click="changeShadow" v-if="boxshadow1">
<view class="shadowBox2">
<view class="shadowBox_img">
<view class="boxshadow_tit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/af_√.png"
class="boxshadow_tit_img">
</image>
已支付成功
</view>
<view class="boxshadow_img">
<view>核销码{{ verifyCode }}</view>
<!-- <image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
</image> -->
</view>
<view class="boxbottom">
<view class="line1"></view>
赶快邀请好友来下单吧
<view class="line2"></view>
</view>
<view @click.stop="changeShadow">
<view class="shadowBox1">
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick" />
<view class="shadowBox1Item">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
微信好友
</view>
<button class="shadowBox2Item_btn" open-type="share" bindtap="onShareButtonClick" />
<view class="shadowBox1Item" @click="shareFriend">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
小程序链接
</view>
<!-- <view class="shadowBox1Item" @click="openSave">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_saveImg.png"
mode="aspectFill"></image>
二维码海报
</view> -->
</view>
</view>
</view>
</view>
</view>
<!-- 海报 -->
<view class="shadow" @click="changeShadow2" v-if="boxshadow2">
<view class="shadowBox2">
<view class="shadowBox_img">
<view class="boxshadow_tit">今日商品推荐</view>
<view class="boxshadow_img">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
</image>
</view>
<view class="shadowBoxInfo">
<view class="shadowboxInfo_left">二维码</view>
<view class="shadowboxInfo_right">
<view class="shadowboxInfo_right_1">正鲜生</view>
<view class="shadowboxInfo_right_2">
长按识别小程序 <br />
数量有限马上抢购
</view>
</view>
</view>
</view>
<view class="shadowBox_btn" @click.stop="saveImg">保存海报</view>
</view>
</view>
</view>
</template>
<script>
import { picUrl, menuButtonInfo, request, NavgateTo } from "../../../utils";
import { apiArr } from "../../../api/shop";
export default {
data() {
return {
activeTab: 'pickup', //
quantity: 1, //
selectedPayment: 'wechat',
boxshadow1: false,
boxshadow2: false,
defAddress: {},
defZTAddress: [],
orderList1: [],
orderList2: [],
carList: [],
// id
group_buy_activity_id: 0,
//
verifyCode: '',
};
},
computed: {
// id
supplierGroups() {
const groups = {};
this.orderList2.forEach(item => {
const supplierId = item.supplier_id || 'default';
if (!groups[supplierId]) {
groups[supplierId] = [];
}
groups[supplierId].push(item);
});
return groups;
},
},
onLoad(options) {
this.carList = JSON.parse(options.shopCarList)
console.log("🚀 ~ onLoad ~ JSON.parse(options.shopCarList):", JSON.parse(options.shopCarList))
},
onShow() {
this.getUserAddress()
this.getZTAddress()
this.getGoodsList()
},
onUnload() {
uni.removeStorageSync('changeZTAddress')
},
methods: {
switchTab(tab) {
this.activeTab = tab;
},
//
getUserAddress() {
request(apiArr.getUserDefAddress, "POST", {}).then(res => {
this.defAddress = res.default_address
})
},
//
getGoodsList() {
this.orderList1 = []
this.orderList2 = []
this.carList.forEach(item => {
// URLhttpspicUrl
if (item.commodity_goods_info.commodity_pic && item.commodity_goods_info.commodity_pic.indexOf('https') !== 0) {
item.commodity_goods_info.commodity_pic = picUrl + item.commodity_goods_info.commodity_pic
}
// const list = item.commodity_goods_info.group_buy_activity_info
const list = true
if (list) {
this.orderList2.push(item)
} else {
this.orderList1.push(item)
}
})
},
getZTAddress() {
setTimeout(() => {
let changeAddress = uni.getStorageSync('changeZTAddress')
if (changeAddress) {
this.defZTAddress = changeAddress
}
}, 100)
},
chooseAddress() {
NavgateTo('../address/index')
},
editAddress(item) {
NavgateTo('../ztLocation/index?item=' + JSON.stringify(item));
},
decreaseQuantity(item) {
const currentTime = new Date().getTime();
const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (item.count > 0) {
if (currentTime >= startTime && currentTime <= endTime) {
if (item.count == item.commodity_goods_info.min_order_quantity) {
uni.showToast({
title: '最少购买' + item.commodity_goods_info.min_order_quantity + '件',
icon: 'none'
});
item.count = 0
} else {
item.count--
}
} else {
item.count--
}
// 0carList
if (item.count === 0) {
const index = this.carList.findIndex(carItem => carItem.goods_id === item.goods_id);
if (index > -1) {
this.carList.splice(index, 1);
//
this.getGoodsList();
}
}
this.changeCart(item)
}
},
increaseQuantity(item) {
console.log("🚀 ~ increaseQuantity ~ item:", item)
const currentTime = new Date().getTime();
const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (item.count >= item.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
if (currentTime >= startTime && currentTime <= endTime) {
if (item.count == 0) {
item.count += item.commodity_goods_info.min_order_quantity
} else {
if (item.count >= item.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
if (item.count == item.commodity_goods_info.max_limit_quantity) {
uni.showToast({
title: '一次最多购买' + item.commodity_goods_info.max_limit_quantity + '件',
icon: 'none'
});
return
}
}
}
item.count++;
this.changeCart(item);
},
//
changeCart(item) {
const params = {
goods_id_and_count: [
{
goods_id: item.goods_id,
count: item.count,
},
],
}
request(apiArr.updateCar, "POST", params).then(res => {
uni.showToast({
title: "操作成功!",
success() { },
});
})
},
//
calculateTotal(order) {
const currentTime = new Date().getTime();
if (order === 'order1') {
let total = 0;
this.orderList1.forEach(goods => {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
});
//
return total.toFixed(2);
} else {
let total = 0;
this.orderList2.forEach(goods => {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
});
//
return total.toFixed(2);
}
},
selectPayment(payment) {
this.selectedPayment = payment;
},
submitPayment() {
//
const supplierIds = [...new Set(this.orderList2.map(item =>
item.supplier_id || 'default'
))];
const allHaveZTAddress = supplierIds.every(supplierId => {
const ztAddress = this.defZTAddress.find(adItem => adItem.id == supplierId);
return !!ztAddress;
});
if (!allHaveZTAddress) {
uni.showToast({
title: '请选择所有货品的自提点',
icon: 'none'
});
return;
}
//
const currentTime = new Date().getTime();
let isGroupBuyValid = true;
//
for (let supplierId in this.supplierGroups) {
const group = this.supplierGroups[supplierId];
for (let item of group) {
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
// isGroupBuyValidfalse
if (!activityInfo) {
isGroupBuyValid = false;
break;
}
const startTime = new Date(activityInfo.start_time).getTime();
const endTime = new Date(activityInfo.end_time).getTime();
if (!(currentTime >= startTime && currentTime <= endTime)) {
isGroupBuyValid = false;
break;
}
}
if (!isGroupBuyValid) break;
}
// isafterSaletrue
const hasAfterSaleItem = this.carList.some(item => item.isafterSale === true);
const orderIdFromAfterSale = hasAfterSaleItem ? this.carList.find(item => item.isafterSale === true)?.orderId : null;
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
// isafterSaletruecreateOrder
if (hasAfterSaleItem && orderIdFromAfterSale) {
const param = {
order_id: orderIdFromAfterSale,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.mergePreorder, "POST", param).then(res => {
this.handleMergePreorderResponse(res, orderIdFromAfterSale);
})
} else {
//
const params = {
user_id: uni.getStorageSync('userId'),
is_group_buy: isGroupBuyValid,
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
const group = this.supplierGroups[supplierId];
const firstItem = group[0];
// id
this.group_buy_activity_id = firstItem.commodity_goods_info.group_buy_activity_id;
// id
const ztAddress = this.defZTAddress.find(adItem => adItem.id == supplierId) || {};
return {
supplier_id: firstItem.supplier_id,
supplier_name: firstItem.supplier_name || '',
is_same_day: firstItem.commodity_goods_info.is_same_day,
receiving_name: ztAddress.name || '',
receiving_phone: ztAddress.phone || '',
receiving_address: ztAddress.address || '',
merchant_id: ztAddress.address_id,
group_buy_activity_id: firstItem.commodity_goods_info.group_buy_activity_id,
goods_and_count: group.map(item => {
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
const isGroupBuy = activityInfo &&
currentTime >= new Date(activityInfo.start_time).getTime() &&
currentTime <= new Date(activityInfo.end_time).getTime();
return {
goods_id: item.goods_id,
count: item.count,
price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price,
freight: item.commodity_goods_info.freight,
}
})
}
})
}
request(apiArr.createOrder, "POST", params).then(resVal => {
const param = {
order_id: resVal.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.mergePreorder, "POST", param).then(res => {
this.handleMergePreorderResponse(res, resVal.order_id);
})
})
}
},
// mergePreorder
handleMergePreorderResponse(res, orderId) {
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
//
uni.requestPayment({
timeStamp: res.timeStamp,
nonceStr: res.nonceStr,
package: res.package,
signType: res.signType,
paySign: res.paySign,
success: (payRes) => {
const params = {
order_id: orderId,
from: 2,
group_buy_activity_id: this.group_buy_activity_id,
}
request(apiArr.queryOrder, "POST", params).then(res => {
this.verifyCode = res.verification_code
this.boxshadow1 = true
})
},
fail: (payErr) => {
uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '已取消支付' : '支付失败',
icon: 'none'
})
const params = {
order_ids: orderId,
}
request(apiArr.cancelPay, "POST", params).then(res => {
})
},
complete: () => {
//
}
})
} else {
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
},
//
copyAddress() {
// 使uni-appAPI
uni.setClipboardData({
data: this.defAddress.address + this.defAddress.house_number,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
copyZTAddress() {
// 使uni-appAPI
uni.setClipboardData({
data: this.defZTAddress.address,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
openSave() {
this.boxshadow1 = false;
this.boxshadow2 = true;
},
changeShadow() {
this.boxshadow1 = false;
},
changeShadow2() {
this.boxshadow2 = false;
},
//
saveImg() {
this.boxshadow2 = false;
//
uni.downloadFile({
url: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png",
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: (res) => {
uni.showToast({
title: "保存成功",
icon: "success",
duration: 2000,
});
},
fail: (err) => {
console.log("保存失败", err);
},
});
}
},
fail: (err) => {
console.log("下载失败", err);
},
});
},
//
isWithinActivityTime(item) {
if (!item || !item.commodity_goods_info || !item.commodity_goods_info.group_buy_activity_info) {
return false;
}
const now = new Date();
const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time);
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time);
return now >= startTime && now <= endTime;
},
}
};
</script>
<style>
@import url('./index.css');
</style>

View File

@ -106,6 +106,10 @@ page {
white-space: nowrap;
}
.slide_item_active text {
color: #ff5f3c;
}
.Con {
flex: 1;
display: flex;
@ -158,7 +162,7 @@ page {
overflow: hidden;
position: relative;
overflow-y: auto;
margin-bottom: 150rpx;
padding-bottom: 260rpx;
}
.CateInfo_tit {
@ -311,11 +315,14 @@ page {
}
.CateList_Box {
width: 71.5%;
display: flex;
overflow: hidden;
position: relative;
z-index: 9;
/* position: relative; */
position: fixed;
z-index: 15;
padding: 20rpx 10rpx;
background-color: #ffffff;
}
.CateList {
@ -333,7 +340,7 @@ page {
height: 40rpx;
background: #F6F7FB;
border-radius: 10rpx 10rpx 10rpx 10rpx;
padding: 5rpx 30rpx;
padding: 5rpx 20rpx;
font-size: 26rpx;
color: #222222;
display: flex;
@ -360,6 +367,10 @@ page {
margin-left: 10rpx;
}
.CateIte {
margin-top: 80rpx;
}
.CateInfo {
margin: 0 10rpx;
padding: 10rpx 10rpx;
@ -392,8 +403,8 @@ page {
padding-bottom: 30rpx;
position: absolute;
left: 0;
top: 0;
z-index: 11;
top: 160rpx;
z-index: 20;
}
.header2 .slide .slide_con .slide_conBox:nth-child(5n) {
@ -418,7 +429,7 @@ page {
left: 0;
right: 0;
bottom: 0;
top: 0;
top: 160rpx;
background-color: rgba(0, 0, 0, 0.3);
z-index: 10;
}
@ -431,13 +442,14 @@ page {
padding: 20rpx 12rpx;
padding-right: 0;
position: absolute;
top: 85rpx;
z-index: 9;
width: 100%;
}
.activeCateList .CateList_Item {
margin-bottom: 16rpx;
margin-right: 28rpx;
margin-right: 20rpx;
}
.activeCateList .CateList_Item:nth-child(4n) {
@ -511,7 +523,7 @@ page {
position: relative;
}
.GGItem_Image image{
.GGItem_Image image {
border-radius: 20rpx;
}
@ -566,9 +578,9 @@ page {
.shop_car {
width: 140rpx;
height: 140rpx;
position: fixed;
right: 33rpx;
bottom: 180rpx;
position: absolute;
bottom: 100rpx;
right: 10rpx;
z-index: 10;
}
@ -579,6 +591,26 @@ page {
.u-badge {
position: absolute;
right: 0;
right: 70rpx;
/* 调整角标位置,使其在隐藏状态下也能看到 */
top: -10rpx;
z-index: 11;
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: normal;
font-size: 28rpx;
color: #999999;
margin-top: 350rpx;
width: 100%;
}
.empty image {
width: 366rpx;
height: 226rpx;
margin-bottom: 27rpx;
}

View File

@ -1,101 +1,58 @@
<template>
<div class="container">
<view class="container">
<!-- 顶部展开后的阴影 -->
<div class="boxshadow" v-if="topShow"></div>
<div class="header" :class="topShow ? 'op0' : ''">
<div
class="searchBox"
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
>
<div class="searchBox_left" @click="back">
<view class="boxshadow" v-if="topShow"></view>
<view class="header">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_left" @click="back">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</div>
<div class="searchBox_ipt" @click="searchPage">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"
></image>
</view>
<view class="searchBox_ipt" @click="searchPage">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input disabled type="text" placeholder="输入商品名称" />
</div>
</div>
<div class="slide">
<div class="slide_con">
<div
v-for="(item, index) in CateList"
:key="index"
class="slide_conBox"
@click="changeCate(item.id)"
>
<view class="slide_item">
<image
:src="picUrl + item.category_pic"
mode="aspectFill"
></image>
</view>
</view>
<view class="slide">
<view class="slide_con">
<view v-for="(item, index) in CateList" :key="index" class="slide_conBox" @click="changeCate(item.id)">
<view class="slide_item" :class="item.id === currentCategoryId ? 'slide_item_active' : ''">
<image :src="picUrl + item.category_pic" mode="aspectFill"></image>
<text>{{ item.category_name }}</text>
</view>
</div>
</div>
</view>
</view>
<div class="open" @click="topOpen" v-if="!topShow">
<view class="open" @click="topOpen" v-if="!topShow">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_openIcon.png"
mode="aspectFill"
></image>
</div>
</div>
</div>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_openIcon.png"
mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 整体展开的顶部 -->
<div class="header header2" v-if="topShow">
<div
class="searchBox"
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
>
<div class="searchBox_left">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</div>
<div class="searchBox_ipt">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"
></image>
<input type="text" placeholder="输入商品名称" />
</div>
</div>
<div class="slide">
<div class="slide_con">
<div
v-for="(item, index) in CateList"
:key="index"
class="slide_conBox"
>
<view class="slide_item">
<image
:src="picUrl + item.category_pic"
mode="aspectFill"
></image>
<view class="header header2" v-if="topShow">
<view class="slide">
<view class="slide_con">
<view v-for="(item, index) in CateList" :key="index" class="slide_conBox" @click="changeCate(item.id)">
<view class="slide_item" :class="item.id === currentCategoryId ? 'slide_item_active' : ''">
<image :src="picUrl + item.category_pic" mode="aspectFill"></image>
<text>{{ item.category_name }}</text>
</view>
</div>
</div>
</div>
</view>
</view>
</view>
<div class="hides" @click="topOpen">
<view class="hides" @click="topOpen">
收起 <u-icon name="arrow-up"></u-icon>
</div>
</div>
</view>
</view>
<div class="Con">
<div class="Con_left">
<div
class="CateItem"
:class="item.id === currentLeftCateId ? 'CateItem_active' : ''"
v-for="item in leftCateList"
:key="item.id"
@click="changeLeftCate(item.id)"
>
<view class="Con">
<view class="Con_left">
<view class="CateItem" :class="item.id === currentLeftCateId ? 'CateItem_active' : ''"
v-for="item in leftCateList" :key="item.id" @click="changeLeftCate(item.id)">
<!-- <image v-if="false" class="hot"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_hot.png"
mode="aspectFill">
@ -104,222 +61,157 @@
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_bao.png"
mode="aspectFill"></image> -->
{{ item.category_name }}
</div>
</div>
<div class="Con_right">
<div class="CateList_Box" :class="cateListShow ? 'bgf' : ''">
<div class="CateList" ref="cateListRef">
<div
class="CateList_Item"
v-for="(item, index) in tagList"
:key="item.id"
:class="index == rightTopActive ? 'CateList_Item_active' : ''"
@click="checkItem(index)"
>
</view>
</view>
<view class="Con_right" v-if="tagList1.length > 0">
<view class="CateList_Box" :class="cateListShow ? 'bgf' : ''">
<view class="CateList" ref="cateListRef">
<view class="CateList_Item" v-for="(item, index) in tagList" :key="item.id"
:class="index == rightTopActive ? 'CateList_Item_active' : ''" @click="checkItem(index)">
{{ item.tag_name }}
</div>
</div>
<div class="more" @click="changeCateListShow">
</view>
</view>
<view class="more" @click="changeCateListShow">
<u-icon v-if="!cateListShow" name="arrow-down"></u-icon>
<u-icon v-if="cateListShow" name="arrow-up"></u-icon>
</div>
</div>
</view>
</view>
<!-- 右下展开的内容 -->
<div class="activeCateList" v-if="cateListShow">
<div
class="CateList_Item"
v-for="(item, index) in tagList"
:key="index"
:class="index == rightTopActive ? 'CateList_Item_active' : ''"
@click="checkItem(index)"
>
<view class="activeCateList" v-if="cateListShow">
<view class="CateList_Item" v-for="(item, index) in tagList" :key="index"
:class="index == rightTopActive ? 'CateList_Item_active' : ''" @click="checkItem(index)">
{{ item.tag_name }}
</div>
</div>
</view>
</view>
<!-- 右下阴影 -->
<div class="boxshadow2" v-if="cateListShow"></div>
<view class="boxshadow2" v-if="cateListShow" @click="changeCateListShow"></view>
<div class="CateInfo" v-for="item in tagList" :key="item.id">
<div class="CateInfo_tit">
{{ item.tag_name }}
</div>
<div
class="CateInfo_Item"
v-for="items in item.commodity_info_list"
:key="items.id"
>
<div class="CateInfo_Item_Box">
<div class="CateInfo_Item_left" @click="goods(items)">
<view
class="tag tag-img"
v-if="
<view class="CateIte">
<view class="CateInfo"
v-for="item in (selectedTagId === 'all' ? tagList.slice(1) : [tagList.find(t => t.id === selectedTagId) || {}])"
:key="item.id">
<view class="CateInfo_tit">
{{ item.tag_name }}
</view>
<view class="CateInfo_Item" v-for="items in item.commodity_info_list" :key="items.id">
<view class="CateInfo_Item_Box">
<view class="CateInfo_Item_left" @click="goods(items)">
<view class="tag tag-img" v-if="
!items.commodity_goods_info_list[1] &&
items.commodity_goods_info_list[0].is_same_day
"
>当日达</view
>
<image
:src="picUrl + items.commodity_pic"
mode="aspectFill"
></image>
</div>
<div class="CateInfo_Item_right" :class="GGshow ? 'noneBor' : ''">
<div class="CateInfo_Item_right_Tit" @click="goods(items)">
<view
class="tag tag-text"
v-if="
">当日达</view>
<image :src="picUrl + items.commodity_pic" mode="aspectFill"></image>
</view>
<view class="CateInfo_Item_right" :class="GGshow ? 'noneBor' : ''">
<view class="CateInfo_Item_right_Tit" @click="goods(items)">
<view class="tag tag-text" v-if="
!items.commodity_goods_info_list[1] &&
items.commodity_goods_info_list[0].is_same_day
"
>当日达</view
>
{{ items.commodity_name }}
</div>
<div class="CateInfo_Item_right_subtit" @click="goods(items)">
{{ items.commodity_intro }}
</div>
<div class="CateInfo_Item_Money">
<div class="CateInfo_Item_Money_left">
{{ getPriceRange(items.commodity_goods_info_list) }}
</div>
<div
class="CateInfo_Item_Money_right"
v-if="!(items.commodity_goods_info_list.length > 1)"
>
<u-number-box
:min="0"
v-model="items.commodity_goods_info_list[0].quantity"
@change="(value) => handleQuantityChange(value, items)"
>
<view slot="minus" class="minus">
<u-icon name="minus" size="20"></u-icon>
</view>
<text
slot="input"
style="width: 50px; text-align: center"
class="input"
>{{
items.commodity_goods_info_list[0].quantity
? items.commodity_goods_info_list[0].quantity
: 0
}}</text
>
<view slot="plus" class="plus">
<u-icon name="plus" color="#FFFFFF" size="20"></u-icon>
</view>
</u-number-box>
</div>
</div>
<div
class="gg"
@click="chooseGG(items)"
v-if="
items.commodity_goods_info_list.length > 1 && !items.isShow
"
>
选择规格
<u-icon
name="arrow-down"
size="26rpx"
color="#FF370B"
></u-icon>
</div>
<div
class="gg"
@click="chooseGG(items)"
v-if="
items.commodity_goods_info_list.length > 1 && items.isShow
"
>
收起
<u-icon name="arrow-up" size="26rpx" color="#FF370B"></u-icon>
</div>
</div>
</div>
<div class="GGList" v-if="items.isShow">
<div
class="GGItem"
v-for="ite in items.commodity_goods_info_list"
:key="ite.id"
@click="goods(items)"
>
<div class="GGItem_Image">
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
<image
:src="picUrl + ite.commodity_pic"
mode="aspectFill"
></image>
</div>
<div class="GGItem_Con">
<div class="GGItem_Con_Tit">
<view class="tag tag-text" v-if="ite.is_same_day"
>当日达</view
>
{{ ite.goods_name }}
</div>
<div class="GGItem_Con_Msg">
<div class="GGItem_Con_Msg_left">
<span></span>{{ ite.sales_price }}
</div>
<div class="GGItem_Con_Msg_right">
<u-number-box
v-model="ite.quantity"
:min="0"
@change="(value) => handleQuantityChange(value, ite)"
>
">当日达</view>
{{ items.commodity_name }}
</view>
<view class="CateInfo_Item_right_subtit" @click="goods(items)">
{{ items.commodity_intro }}
</view>
<view class="CateInfo_Item_Money">
<view class="CateInfo_Item_Money_left">
{{ getPriceRange(items.commodity_goods_info_list) }}
</view>
<view class="CateInfo_Item_Money_right" v-if="!(items.commodity_goods_info_list.length > 1)">
<u-number-box :min="0" v-model="items.commodity_goods_info_list[0].quantity"
@change="(value) => handleQuantityChange(value, items)">
<view slot="minus" class="minus">
<u-icon name="minus" size="20"></u-icon>
</view>
<text
slot="input"
style="width: 50px; text-align: center"
class="input"
>{{ ite.quantity ? ite.quantity : 0 }}</text
>
<text slot="input" style="width: 50px; text-align: center" class="input">{{
items.commodity_goods_info_list[0].quantity
? items.commodity_goods_info_list[0].quantity
: 0
}}</text>
<view slot="plus" class="plus">
<u-icon
name="plus"
color="#FFFFFF"
size="20"
></u-icon>
<u-icon name="plus" color="#FFFFFF" size="20"></u-icon>
</view>
</u-number-box>
</div>
</div>
</div>
</div>
</div>
</div>
</view>
</view>
<!-- 按钮 -->
<!-- <div class="btn">
<view class="gg" @click="chooseGG(item,items)" v-if="
items.commodity_goods_info_list.length > 1 && !items.isShow
">
选择规格
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
</view>
<view class="gg" @click="chooseGG(item,items)" v-if="
items.commodity_goods_info_list.length > 1 && items.isShow
">
收起
<u-icon name="arrow-up" size="26rpx" color="#FF370B"></u-icon>
</view>
</view>
</view>
<view class="GGList" v-if="items.isShow">
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id" @click="goods(ite,items)">
<view class="GGItem_Image">
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
</view>
<view class="GGItem_Con">
<view class="GGItem_Con_Tit">
<view class="tag tag-text" v-if="ite.is_same_day">当日达</view>
{{ ite.goods_name }}
</view>
<view class="GGItem_Con_Msg">
<view class="GGItem_Con_Msg_left">
<span></span>{{ ite.sales_price }}
</view>
<view class="GGItem_Con_Msg_right">
<u-number-box v-model="ite.quantity" :min="0"
@change="(value) => handleQuantityChange(value, ite)">
<view slot="minus" class="minus">
<u-icon name="minus" size="20"></u-icon>
</view>
<text slot="input" style="width: 50px; text-align: center" class="input">{{ ite.quantity ?
ite.quantity : 0 }}</text>
<view slot="plus" class="plus">
<u-icon name="plus" color="#FFFFFF" size="20"></u-icon>
</view>
</u-number-box>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 按钮 -->
<!-- <view class="btn">
查看全部商品
<div class="cir">
<view class="cir">
<u-icon name="arrow-right" color="#fff" size="12px"></u-icon>
</div>
</div> -->
</div>
</div>
</div>
</view>
</view> -->
</view>
</view>
</view>
<view class="Con_right" v-else>
<view class="empty">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_nearbyList_empty.png"
mode="aspectFill"></image>
暂无数据
</view>
</view>
</view>
<!-- <nav-footer :current="3" /> -->
<div class="shop_car" @click="shopCar">
<u-badge
numberType="limit"
type="error"
max="99"
:value="carNum"
></u-badge>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car_num.png"
></image>
<view class="shop_car" @click="shopCar">
<u-badge numberType="limit" type="error" max="99" :value="carNum"></u-badge>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car_num.png"></image>
<!-- <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car_empty.png"></image> -->
</div>
</div>
</view>
</view>
</template>
<script>
@ -335,6 +227,7 @@ export default {
search: "",
value: "1",
cateListShow: false,
conRightElement: null,
iconList: [
{
icon: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_icon1.png",
@ -382,8 +275,11 @@ export default {
rightTopActive: 0,
currentLeftCateId: null,
topShow: false,
currentCategoryId: null,
GGshow: false,
originalTagList: [], // tagList
selectedTagId: null, // ID
CateList: [], //
currentFirstId: "",
leftCateList: [], //
@ -392,6 +288,7 @@ export default {
currentThirdId: "",
tagList: [],
tagList1: [],
carNum: "",
goodsDetail: [],
@ -405,14 +302,25 @@ export default {
},
changeCate(id) {
this.checkItem(0)
// ID
this.currentCategoryId = id;
// id
const category = this.CateList.find((item) => item.id === id);
if (category) {
// leftCateListnull
this.leftCateList = category.level_two_category || [];
this.secondId = this.leftCateList[0]?.id;
this.tagList1 = category.level_three_category || [];
if (this.leftCateList.length > 0) {
this.currentLeftCateId = this.leftCateList[0].id;
this.secondId = this.leftCateList[0].id;
} else {
this.currentLeftCateId = null;
this.secondId = null;
}
this.getGoodsList();
}
this.topShow = false;
},
//
changeCateListShow() {
@ -420,23 +328,42 @@ export default {
},
//
checkItem(index) {
this.cateListShow = false
this.rightTopActive = index;
// ID
this.selectedTagId = this.tagList[index]?.id;
},
//
topOpen() {
this.topShow = !this.topShow;
},
//
chooseGG(e) {
e.isShow = !e.isShow;
chooseGG(item,targetItems) {
// id
if (item && targetItems && item.id) {
for (let i = 1; i < this.tagList.length; i++) {
const tagItem = this.tagList[i];
// item.idtagItem
if (tagItem.id === item.id) {
const infoIndex = tagItem.commodity_info_list.findIndex(infoItem => infoItem.id === targetItems.id);
if (infoIndex > -1) {
//
const currentItem = tagItem.commodity_info_list[infoIndex];
this.$set(currentItem, 'isShow', !currentItem.isShow);
console.log("修改后数据源中的isShow:", currentItem.isShow);
break;
}
}
}
}
},
//
searchPage() {
NavgateTo("../search/index");
},
//
goods(e) {
NavgateTo(`../goods/index?item=${JSON.stringify(e)}`);
goods(ite,items) {
NavgateTo(`../goods/index?item=${JSON.stringify(ite)}`);
},
//
@ -449,6 +376,8 @@ export default {
console.log(res);
this.CateList = res.commodity_category_list;
this.firstId = res.commodity_category_list[0].id;
//
this.currentCategoryId = this.firstId;
this.leftCateList =
res.commodity_category_list[0].level_two_category || [];
if (this.leftCateList.length > 0) {
@ -465,31 +394,39 @@ export default {
getGoodsList() {
if (!this.secondId) {
this.tagList = [];
this.originalTagList = [];
return;
}
request(apiArr.getGoodsList, "POST", {
user_id: uni.getStorageSync("userId"),
id: this.secondId,
}).then((res) => {
res.commodity_list.forEach((item) => {
item.commodity_info_list.forEach((item) => {
item.commodity_goods_info_list.forEach((param) => {
//
const commodityList = JSON.parse(JSON.stringify(res.commodity_list));
commodityList.forEach((tagItem) => { //
tagItem.commodity_info_list.forEach((infoItem) => { //
// isShow
this.$set(infoItem, 'isShow', false);
infoItem.commodity_goods_info_list.forEach((param) => {
this.goodsDetail.forEach((goods) => {
if (goods.goods_id === param.id) {
param.quantity = goods.count;
this.$set(param, 'quantity', goods.count); // $set
}
});
});
item.isShow = false;
});
});
this.tagList = res.commodity_list;
this.originalTagList = commodityList;
this.tagList1 = commodityList;
// tagList使
this.tagList = [{ id: 'all', tag_name: '全部' }, ...commodityList];
this.rightTopActive = 0;
this.selectedTagId = 'all';
});
},
getShopCarList() {
request(apiArr.getCar, "POST").then((res) => {
console.log(res);
this.carNum = res.total;
//
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list)
@ -504,32 +441,88 @@ export default {
},
//
handleQuantityChange(val, item) {
const quantity = typeof val === 'object' && val !== null && 'value' in val ? val.value : val;
//
let currentQuantity = 0;
let stockQuantity = 0;
let goodsToUpdate = null;
// items.commodity_goods_info_list[0].quantity
if (
item.commodity_goods_info_list &&
item.commodity_goods_info_list.length
) {
this.goodsId = item.commodity_goods_info_list[0].id;
} else {
this.goodsId = item.id;
currentQuantity = item.commodity_goods_info_list[0].quantity || 0;
stockQuantity = item.commodity_goods_info_list[0].stock_quantity || 0;
goodsToUpdate = item.commodity_goods_info_list[0];
}
// ite.quantity
else {
this.goodsId = item.id;
currentQuantity = item.quantity || 0;
stockQuantity = item.stock_quantity || 0;
goodsToUpdate = item;
}
//
if (quantity > currentQuantity && currentQuantity >= stockQuantity) {
uni.showToast({
title: "库存不足",
icon: 'none'
});
return;
}
// 使$set
this.$set(goodsToUpdate, 'quantity', quantity);
const params = {
user_id: uni.getStorageSync("userId"),
goods_id_and_count: [
{
goods_id: this.goodsId,
count: val.value,
count: quantity,
},
],
};
//
request(apiArr.updateCar, "POST", params).then((res) => {
console.log(res);
//
this.getShopCarList();
// goodsDetail
setTimeout(() => {
//
this.syncGoodsQuantities();
}, 100);
uni.showToast({
title: "操作成功!",
success() {},
success() { },
});
});
},
//
syncGoodsQuantities() {
//
this.tagList.forEach((tagItem) => {
if (tagItem.commodity_info_list) {
tagItem.commodity_info_list.forEach((infoItem) => {
infoItem.commodity_goods_info_list.forEach((param) => {
const goods = this.goodsDetail.find(g => g.goods_id === param.id);
if (goods) {
this.$set(param, 'quantity', goods.count);
}
});
});
}
});
},
getPriceRange(goodsList) {
if (!goodsList || goodsList.length === 0) return '¥0';
const prices = goodsList.map(item => Number(item.sales_price));
@ -549,6 +542,13 @@ export default {
this.getShopCarList();
this.getGoodsList();
},
onHide() {
//
if (this.conRightElement) {
this.conRightElement = null;
}
},
onReachBottom() {
if (this.flag) {
}

View File

@ -69,6 +69,12 @@ image {
margin-top: 48rpx;
}
.hisTop{
display: flex;
align-items: center;
justify-content: space-between;
}
.hisTit {
font-size: 33rpx;
color: #222222;
@ -172,10 +178,40 @@ image {
flex: 1;
}
.tag {
background-color: #ff7d00;
color: white;
font-size: 22rpx;
padding: 5rpx 10rpx;
border-radius: 20rpx 0 20rpx 20rpx;
}
.tag-img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.tag-text {
display: inline-block;
vertical-align: middle;
margin-right: 20rpx;
}
.tag-name {
background-color: #ff7d00;
color: white;
font-size: 22rpx;
padding: 5rpx 10rpx;
border-radius: 20rpx 0 20rpx 20rpx;
}
.searchItem_right_tit {
font-size: 30rpx;
color: #000000;
font-weight: 600;
display: flex;
}
.searchItem_right_subTit {
@ -184,6 +220,171 @@ image {
margin-top: 10rpx;
}
/* 商品信息样式 */
.CateInfo_Item_Box {
display: flex;
padding: 20rpx 40rpx;
border-bottom: 1rpx solid #EBEBEB;
position: relative;
}
.CateInfo_Item_left {
width: 140rpx;
min-width: 140rpx;
height: 140rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx;
overflow: hidden;
margin-right: 15rpx;
position: relative;
}
.CateInfo_Item_left image {
width: 100%;
height: 100%;
}
.CateInfo_Item_right {
flex: 1;
}
.CateInfo_Item_right_Tit {
font-size: 30rpx;
color: #000000;
font-weight: bold;
margin-bottom: 10rpx;
}
.CateInfo_Item_right_subtit {
font-size: 26rpx;
color: #999999;
margin-top: 10rpx;
}
.CateInfo_Item_Money {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 27rpx;
}
.CateInfo_Item_Money_left {
font-size: 34rpx;
color: #FF370B;
}
.CateInfo_Item_Money_left span {
font-size: 28rpx;
}
.CateInfo_Item_Money_right .input {
padding: 0;
}
/* 数量选择器样式 */
.minus {
width: 22px;
height: 22px;
border-width: 1px;
border-color: #E6E6E6;
border-style: solid;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.input {
padding: 0 10px;
}
.plus {
width: 22px;
height: 22px;
background-color: #FF0000;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
/* 规格选择样式 */
.gg {
width: 142rpx;
height: 40rpx;
background: #FFEBEB;
border-radius: 20rpx 20rpx 20rpx 20rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #FF370B;
position: absolute;
right: 100rpx;
bottom: 20rpx;
}
.GGList {
width: 550rpx;
background: rgba(255, 239, 239, 0.5);
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 25rpx 16rpx;
box-sizing: border-box;
margin-left: 26rpx;
position: relative;
left: 22%;
}
.noneBor {
border-bottom: none;
}
.GGItem {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.GGItem_Image {
width: 120rpx;
height: 100rpx;
margin: 0 20rpx 20rpx 0;
position: relative;
}
.GGItem_Image image {
border-radius: 20rpx;
}
.GGItem_Con_Tit {
font-size: 28rpx;
color: #000000;
}
.GGItem_Con {
flex: 1;
}
.GGItem_Con_Msg_left {
display: flex;
font-size: 30rpx;
color: #FF370B;
}
.GGItem_Con_Msg_left span {
font-size: 24rpx;
}
.GGItem_Con_Msg {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
}
.GGItem_Con_Msg_right .input {
padding: 0;
}
.searchItem_right_Money {
display: flex;
align-items: center;
@ -225,4 +426,24 @@ image {
display: flex;
align-items: center;
justify-content: center;
}
}
/* 测试用 */
.search-input {
width: 100%;
padding: 10px;
border-radius: 5px;
/* border: 1px solid #ccc; */
}
.search-results {
margin-top: 20px;
}
.result-item {
padding: 10px;
/* border-bottom: 1px solid #ddd; */
}
/* 测试用 */

Some files were not shown because too many files have changed in this diff Show More