diff --git a/App.vue b/App.vue index 7d04e9d..ac86430 100644 --- a/App.vue +++ b/App.vue @@ -12,6 +12,7 @@ import { } from '@/utils/theme' import { onLaunch, onShow } from '@dcloudio/uni-app' import { useStore } from '@/store' +import { handleAppLaunchScene } from '@/utils/distributionBind.js' const store = useStore() @@ -21,6 +22,7 @@ wx.onAppRoute(() => {}) onLaunch((val) => { initTheme() + handleAppLaunchScene(val) if (val?.query?.inviter) { storage.setInviter(val.query.inviter) } diff --git a/README.md b/README.md index 6ec9b08..8951d6f 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,15 @@ # Lilishop(PickMall) 开源商城系统 -[![GitHub Stars](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=github)](https://github.com/hongyehuicheng/lilishop) +[![GitHub Stars](https://img.shields.io/github/stars/lilishop/lilishop.svg?style=social&logo=github)](https://github.com/lilishop/lilishop) [![Gitee Stars](https://gitee.com/beijing_hongye_huicheng/lilishop/badge/star.svg?theme=dark)](https://gitee.com/beijing_hongye_huicheng/lilishop) +[![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](./LICENSE) +[![Vue](https://img.shields.io/badge/Vue-3-brightgreen.svg)](https://vuejs.org/) +[![uni-app](https://img.shields.io/badge/uni--app-Vue3-blue.svg)](https://uniapp.dcloud.net.cn/) +

简体中文 | English

-## All-In-One 一键启动 - -如果只是想快速体验完整商城,不需要分别部署后端、PC、商家端、运营端、IM Web、H5、MySQL 和 Redis。安装 Docker Desktop 后,可以直接下载 `docker` 仓库 `allinone-lite-mysql-redis` 分支的一键安装脚本,按提示输入 IP/域名、端口、密码和数据目录,即可启动单镜像单容器体验环境。 - -macOS / Linux: - -```bash -curl -fsSL https://gitee.com/beijing_hongye_huicheng/docker/raw/allinone-lite-mysql-redis/install/install-lilishop.sh -o install-lilishop.sh -chmod +x install-lilishop.sh -./install-lilishop.sh -``` - -Windows PowerShell: - -```powershell -Invoke-WebRequest -Uri "https://gitee.com/beijing_hongye_huicheng/docker/raw/allinone-lite-mysql-redis/install/install-lilishop.ps1" -OutFile "install-lilishop.ps1" -Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -.\install-lilishop.ps1 -``` - -默认镜像:`ccr.ccs.tencentyun.com/lilishop/lilishop-all-in-one:lite`。启动后可访问买家 PC、商家端、运营端、IM Web 会话/消息页、uniapp H5 和后端 API。更多说明见 [docker/all-in-one 文档](https://gitee.com/beijing_hongye_huicheng/docker/tree/allinone-lite-mysql-redis/all-in-one)。 - -All-In-One `lite` 是本地体验和演示形态:一个容器内包含应用、前端资源、H5、MariaDB、Redis 和本地文件存储。它不是生产高可用架构,也不内置 Elasticsearch、RocketMQ、XXL-Job、Kibana、Logstash 或 RocketMQ Dashboard;搜索、消息和定时任务逻辑在 lite 环境中使用 MySQL / Redis / 本地调度兼容实现。 LILISHOP 是基于 Spring Boot / Spring Cloud / Vue / Uniapp 开发的 Java 开源商城系统,支持 B2B2C 多商户商城、小程序商城、微服务商城、直播电商、分销返佣、秒杀活动、Docker 私有化部署。 @@ -36,7 +17,7 @@ LILISHOP 是基于 Spring Boot / Spring Cloud / Vue / Uniapp 开发的 Java 开 - Java商城系统 - 开源商城系统 -- SpringBoot商城系统 +- Spring Boot 4商城系统 - SpringCloud微服务商城 - B2B2C商城源码 - 多商户商城系统 @@ -58,14 +39,15 @@ LILISHOP 是基于 Spring Boot / Spring Cloud / Vue / Uniapp 开发的 Java 开 ### 1. 项目简介 **Lilishop** 是一款功能完善的B2B2C多商户商城系统,采用前后端分离架构,全端代码开源。 -后端基于 **SpringBoot4** 构建,具备高内聚、低耦合的特性,支持分布式部署。 +后端基于 **Spring Boot 4**(Java 21)构建,具备高内聚、低耦合的特性,支持分布式部署。 前端覆盖PC、H5、小程序和APP,基于 **Vue** 和 **uni-app** 开发。 - **官方网站**: - **官方文档**: -- **Gitee 仓库**: +- **Gitee 仓库**: - **GitHub 仓库**: +本仓库为买家端 **H5 / 小程序 / APP** 源码(`lilishop-uniapp`)。 --- @@ -103,7 +85,7 @@ LILISHOP 是基于 Spring Boot / Spring Cloud / Vue / Uniapp 开发的 Java 开 [**部署文档 -> 环境准备**](https://docs.pickmall.cn/deply/deply.html) #### 数据库初始化 -- **推荐方式**: 使用项目提供的 `docker-compose` 配置,可自动完成数据库(MySQL, Redis, Elasticsearch等)的部署与初始化。 +- **推荐方式**: 使用项目提供的 `docker-compose` 配置,可自动完成数据库(MySQL、Redis 等)的部署与初始化。 - **手动方式**: 如果您选择手动部署,SQL脚本位于以下地址。请确保获取与您代码版本一致的SQL文件。 [**数据库脚本 (Gitee)**](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) @@ -120,15 +102,13 @@ LILISHOP 是基于 Spring Boot / Spring Cloud / Vue / Uniapp 开发的 Java 开 - H5 / 小程序 / APP:`lilishop-uniapp` - 部署、SQL、镜像与启动脚本:`docker` -All-In-One 仅用于本地体验、演示或验证,不代表生产高可用部署架构。生产部署应按实际访问量、稳定性、监控、备份和扩缩容要求拆分数据库、缓存、搜索、消息、任务调度、前端静态资源和后端服务。 +--- ### 6. 功能列表 [功能清单](https://bdwx2tfwwt.feishu.cn/sheets/FFQKscQKDhUx60to1k9cbMngnYb?from=from_copylink) - - - +--- ### 7. 开源与授权 @@ -145,6 +125,34 @@ All-In-One 仅用于本地体验、演示或验证,不代表生产高可用部 我们欢迎任何形式的交流与贡献。在提问前,请先查阅 [官方文档](https://docs.pickmall.cn/) ,并参考 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md) 以便高效沟通。 - **[在线客服](https://work.weixin.qq.com/kfid/kfc4d8dc24a73c15f44)** -- **微信交流1群(已满)** -- **微信交流2群**: +- **微信交流群**: ![微信群](https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/wechat.jpg) + +--- + +### 9. 升级计划 + +以下功能将陆续在后续版本中发布:✅ 已完成 · 🔜 规划中 + +- ✅ 商品定时上下架 +- ✅ 商品分组 +- ✅ 会员分组 +- ✅ 商品虚拟销量 +- ✅ 专用发票(发票上传) +- ✅ 置顶评论 +- ✅ 客户等级 +- ✅ 购物卡 +- ✅ 腾讯云-云直播 +- ✅ 统计:营业概况、商品概况、会员概况、积分分析、储值分析、营销概况、分销统计 +- ✅ 经营报表(店铺业绩报表、商品同比环比报表、销售订单明细报表、商品销售汇总报表) +- ✅ 卡密商品 +- ✅ 二级分销 +- ✅ 定时任务管理 +- 🔜 主题色管理 +- 🔜 店铺结算汇总 +- 🔜 支付方式汇总 +- 🔜 结算台账 +- 🔜 钱包流水 +- 🔜 财务汇总 +- 🔜 微信小店对接 +- 🔜 抖店对接 diff --git a/api/distribution.js b/api/distribution.js new file mode 100644 index 0000000..af87571 --- /dev/null +++ b/api/distribution.js @@ -0,0 +1,224 @@ +/** + * 分销员相关 API + */ + +import { http, Method } from '@/utils/request.js' + +/** + * 绑定分销员 + * @param distributionId 分销员ID + */ +export function getGoodsDistribution(distributionId) { + return http.request({ + url: `/distribution/distribution/bindingDistribution/${distributionId}`, + method: Method.GET, + }) +} + +/** + * 获取当前会员的分销员信息(含待提现、冻结金额等) + */ +export function distribution() { + return http.request({ + url: `/distribution/distribution`, + method: Method.GET, + }) +} + +/** 推广海报上下文(邀请好友锁客) */ +export function getPromotionPoster() { + return http.request({ + url: `/distribution/distribution/promotion-poster`, + method: Method.GET, + }) +} + +/** 邀请卡上下文(招募下级分销员) */ +export function getInviteCard() { + return http.request({ + url: `/distribution/distribution/invite-card`, + method: Method.GET, + }) +} + +/** 我邀请的下级分销员列表 */ +export function getDistributionInvitees(params) { + return http.request({ + url: `/distribution/distribution/invite/invitees`, + method: Method.GET, + params, + }) +} + +/** 分销员业绩统计 */ +export function getDistributionPerformance(params) { + return http.request({ + url: `/distribution/distribution/performance`, + method: Method.GET, + params, + }) +} + +/** 我的客户列表 */ +export function getDistributionCustomers(params) { + return http.request({ + url: `/distribution/distribution/customers`, + method: Method.GET, + params, + }) +} + +/** 客户详情 */ +export function getDistributionCustomerDetail(id) { + return http.request({ + url: `/distribution/distribution/customers/${id}`, + method: Method.GET, + }) +} + +/** 设置/取消客户星标 */ +export function updateDistributionCustomerStarred(id, starred) { + return http.request({ + url: `/distribution/distribution/customers/${id}/starred`, + method: Method.PUT, + params: { starred }, + }) +} + +/** 分销等级列表(买家端可见时) */ +export function getDistributionGrades() { + return http.request({ + url: `/distribution/distribution/grades`, + method: Method.GET, + }) +} + +/** 分销员提现 */ +export function cash(params) { + return http.request({ + url: `/distribution/cash`, + method: Method.POST, + params, + }) +} + +/** 分销员提现历史 */ +export function cashLog(params) { + return http.request({ + url: `/distribution/cash`, + method: Method.GET, + params, + }) +} + +/** 推广/邀请订单分页列表 */ +export function getDistributionOrders(params) { + return http.request({ + url: `/distribution/order/orders`, + method: Method.GET, + params, + }) +} + +/** 推广/邀请订单详情 */ +export function getDistributionOrderDetail(params) { + return http.request({ + url: `/distribution/order/orders/detail`, + method: Method.GET, + params, + }) +} + +/** 获取分销商品设置 */ +export function getDistributionGoodsSetting() { + return http.request({ + url: `/distribution/goods/setting`, + method: Method.GET, + }) +} + +/** 获取分销员商品列表 */ +export function distributionGoods(params) { + return http.request({ + url: `/distribution/goods`, + method: Method.GET, + params, + }) +} + +/** 获取分销员中心推荐商品 */ +export function getDistributionFeaturedGoods() { + return http.request({ + url: `/distribution/goods/featured`, + method: Method.GET, + }) +} + +/** 获取分销商品分享上下文(推广图文) */ +export function getDistributionGoodsShareContext(params) { + return http.request({ + url: `/distribution/goods/share-context`, + method: Method.GET, + params, + }) +} + +/** 获取分销商品海报上下文(生成葵花码,服务端记录分享) */ +export function getDistributionGoodsPosterContext(params) { + return http.request({ + url: `/distribution/goods/poster-context`, + method: Method.GET, + params, + }) +} + +/** 分享商品访问(记录访问并绑定客户关系) */ +export function recordDistributionGoodsVisit(params) { + return http.request({ + url: `/distribution/distribution/share-visit`, + method: Method.GET, + params, + }) +} + +/** 招募页信息 */ +export function getRecruitPage() { + return http.request({ + url: `/distribution/distribution/recruit/page`, + method: Method.GET, + }) +} + +/** 招募页邀请人信息(无需登录) */ +export function getRecruitInviter(distributionId) { + return http.request({ + url: `/distribution/distribution/recruit/inviter`, + method: Method.GET, + params: { distributionId }, + }) +} + +/** 提交招募申请 */ +export function submitRecruitApplication(data) { + return http.request({ + url: `/distribution/distribution/recruit/apply`, + method: Method.POST, + data, + }) +} + +/** 招募条件进度 */ +export function getRecruitProgress() { + return http.request({ + url: `/distribution/distribution/recruit/progress`, + method: Method.GET, + }) +} + +/** 上级分销员信息 */ +export function getDistributionParent() { + return http.request({ + url: `/distribution/distribution/parent`, + method: Method.GET, + }) +} diff --git a/api/goods.js b/api/goods.js index 06a2986..65bc8f1 100644 --- a/api/goods.js +++ b/api/goods.js @@ -37,18 +37,6 @@ export function getGoodsRelated(params) { }); } -/** - * 获取商品分销 - * @param distributionId 商品分销ID - */ - export function getGoodsDistribution(distributionId) { - return http.request({ - url: `/distribution/distribution/bindingDistribution/${distributionId}`, - method: Method.GET, - }); -} - - /** * 获取商品列表 * @param params @@ -118,85 +106,6 @@ export function getCategoryList(id) { }); } - - - -/** - * 获取当前会员的分销商信息 可根据分销商信息查询待提现金额以及冻结金额等信息 - */ -export function distribution() { - return http.request({ - url: `/distribution/distribution`, - method: Method.GET, - }); -} - -/** - * 申请分销商 - */ -export function applyDistribution(params) { - return http.request({ - url: `/distribution/distribution`, - method: Method.POST, - params, - }); -} - -/** - * 分销商提现 - */ -export function cash(params) { - return http.request({ - url: `/distribution/cash`, - method: Method.POST, - params, - }); -} - -/** - * 分销商提现历史 - */ -export function cashLog(params) { - return http.request({ - url: `/distribution/cash`, - method: Method.GET, - params - - }); -} - -/** - * 获取分销商分页订单列表 - */ -export function distributionOrderList(params) { - return http.request({ - url: `/distribution/distribution/distributionOrder`, - method: Method.GET, - params - }); -} - -/** - * 获取分销商商品列表 - */ -export function distributionGoods(params) { - return http.request({ - url: `/distribution/goods`, - method: Method.GET, - params, - }); -} -/** - * 选择分销商品 分销商品id - */ -export function checkedDistributionGoods(params) { - return http.request({ - url: `/distribution/goods/checked/${params.id}`, - method: Method.GET, - params - }); -} - /** * 获取 小程序码 */ diff --git a/components/distribution-goods-share/index.vue b/components/distribution-goods-share/index.vue new file mode 100644 index 0000000..ee44849 --- /dev/null +++ b/components/distribution-goods-share/index.vue @@ -0,0 +1,459 @@ + + + + + diff --git a/components/distribution-goods-share/poster-panel.vue b/components/distribution-goods-share/poster-panel.vue new file mode 100644 index 0000000..47e93dd --- /dev/null +++ b/components/distribution-goods-share/poster-panel.vue @@ -0,0 +1,539 @@ + + + + + diff --git a/components/m-buy/goods.vue b/components/m-buy/goods.vue index 79258a8..55ae097 100644 --- a/components/m-buy/goods.vue +++ b/components/m-buy/goods.vue @@ -289,6 +289,8 @@ const buy = (data: any) => { icon: 'none', }) } + }).finally(() => { + uni.hideLoading() }) } diff --git a/components/m-search-revision/m-search-revision.vue b/components/m-search-revision/m-search-revision.vue index 712d34f..f188d01 100644 --- a/components/m-search-revision/m-search-revision.vue +++ b/components/m-search-revision/m-search-revision.vue @@ -1,23 +1,23 @@ @@ -37,25 +37,25 @@ +watch(inputVal, (newVal) => { + newVal ? (isDelShow.value = true) : (isDelShow.value = false) +}) + +watch(() => props.modelValue, (newVal) => { + if (newVal !== inputVal.value) { + inputVal.value = newVal || '' + } +}) + +defineExpose({ + isShowSeachGoods, + inputVal, + clear, + setInputValue, +}) + \ No newline at end of file diff --git a/pages/mine/distribution/achievement.vue b/pages/mine/distribution/achievement.vue index 1977201..9bf0664 100644 --- a/pages/mine/distribution/achievement.vue +++ b/pages/mine/distribution/achievement.vue @@ -1,10 +1,555 @@ diff --git a/pages/mine/distribution/auth.vue b/pages/mine/distribution/auth.vue index 954da91..eabd78e 100644 --- a/pages/mine/distribution/auth.vue +++ b/pages/mine/distribution/auth.vue @@ -1,99 +1,24 @@ @@ -102,8 +27,8 @@ function submitForm() { padding: 32rpx; } .tips { - margin-top: 20rpx; - font-size: 24rpx; - color: #999; + font-size: 28rpx; + color: #666; + line-height: 1.6; } diff --git a/pages/mine/distribution/bank-accounts.vue b/pages/mine/distribution/bank-accounts.vue new file mode 100644 index 0000000..2ece322 --- /dev/null +++ b/pages/mine/distribution/bank-accounts.vue @@ -0,0 +1,382 @@ + + + + + diff --git a/pages/mine/distribution/bind.vue b/pages/mine/distribution/bind.vue new file mode 100644 index 0000000..14b3d40 --- /dev/null +++ b/pages/mine/distribution/bind.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/pages/mine/distribution/cash-history.vue b/pages/mine/distribution/cash-history.vue new file mode 100644 index 0000000..bac6ca7 --- /dev/null +++ b/pages/mine/distribution/cash-history.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/pages/mine/distribution/customer-list.vue b/pages/mine/distribution/customer-list.vue new file mode 100644 index 0000000..300b26f --- /dev/null +++ b/pages/mine/distribution/customer-list.vue @@ -0,0 +1,833 @@ + + + + + diff --git a/pages/mine/distribution/grade.vue b/pages/mine/distribution/grade.vue new file mode 100644 index 0000000..d8c09a8 --- /dev/null +++ b/pages/mine/distribution/grade.vue @@ -0,0 +1,611 @@ + + + + + diff --git a/pages/mine/distribution/history.vue b/pages/mine/distribution/history.vue index 65c5b42..be76a08 100644 --- a/pages/mine/distribution/history.vue +++ b/pages/mine/distribution/history.vue @@ -32,11 +32,10 @@ {{ item.goodsName }} - 提成金额:+{{ unitPrice(item.rebate) }} + 提成金额:+{{ unitPrice(item.commissionAmount) }} 创建时间:{{ item.createTime }} - 店铺:{{ item.storeName }} 会员名称:{{ item.memberName }} @@ -57,7 +56,7 @@ import { ref } from 'vue' import { onLoad, onReachBottom } from '@dcloudio/uni-app' import { useStore } from '@/store' -import { cashLog, distributionOrderList } from '@/api/goods' +import { cashLog, getDistributionOrders } from '@/api/distribution' import { unitPrice } from '@/utils/filters.js' const store = useStore() @@ -71,7 +70,7 @@ const listType = ref(0) const routeQuery = ref>({}) const withdrawParams = ref({ pageNumber: 1, pageSize: 10 }) -const achievementParams = ref({ pageNumber: 1, pageSize: 10 }) +const achievementParams = ref({ pageNumber: 1, pageSize: 10, orderType: 'PROMOTION' }) onLoad((option) => { const type = Number(option.type != null ? option.type : 0) @@ -100,12 +99,16 @@ function hideLoadingIfNeeded() { function fetchAchievementList() { uni.showLoading({ title: '加载中' }) - distributionOrderList(achievementParams.value).then((res) => { - if (res.data.success && res.data.result.records.length >= 1) { - achievementList.value.push(...res.data.result.records) + getDistributionOrders(achievementParams.value).then((res) => { + const records = res.data.success ? res.data.result?.records || [] : [] + if (records.length) { + achievementList.value.push(...records) + if (records.length < achievementParams.value.pageSize) { + loadStatus.value = 'nomore' + } } else { loadStatus.value = 'nomore' - isEmpty.value = true + isEmpty.value = achievementList.value.length === 0 } hideLoadingIfNeeded() }) diff --git a/pages/mine/distribution/home.vue b/pages/mine/distribution/home.vue index ee89e33..623a47f 100644 --- a/pages/mine/distribution/home.vue +++ b/pages/mine/distribution/home.vue @@ -1,107 +1,908 @@ - - - - - + + + + + diff --git a/pages/mine/distribution/invite-friends.vue b/pages/mine/distribution/invite-friends.vue new file mode 100644 index 0000000..5994910 --- /dev/null +++ b/pages/mine/distribution/invite-friends.vue @@ -0,0 +1,329 @@ + + + + + diff --git a/pages/mine/distribution/invite-list.vue b/pages/mine/distribution/invite-list.vue new file mode 100644 index 0000000..6784a7e --- /dev/null +++ b/pages/mine/distribution/invite-list.vue @@ -0,0 +1,486 @@ + + + + + diff --git a/pages/mine/distribution/invite.vue b/pages/mine/distribution/invite.vue new file mode 100644 index 0000000..599a572 --- /dev/null +++ b/pages/mine/distribution/invite.vue @@ -0,0 +1,485 @@ + + + + + diff --git a/pages/mine/distribution/join.vue b/pages/mine/distribution/join.vue index a8b1d85..3e82b37 100644 --- a/pages/mine/distribution/join.vue +++ b/pages/mine/distribution/join.vue @@ -1,127 +1,887 @@ - - - - - - - + + + + + diff --git a/pages/mine/distribution/list.vue b/pages/mine/distribution/list.vue index 2548251..ce589b4 100644 --- a/pages/mine/distribution/list.vue +++ b/pages/mine/distribution/list.vue @@ -1,496 +1,402 @@ + + \ No newline at end of file + +.goods-earn { + display: inline-block; + padding: 4rpx 12rpx; + border-radius: 6rpx; + background: #fff0f0; + color: #ff4d4f; + font-size: 22rpx; + line-height: 1.4; +} + +.goods-price { + margin-top: 10rpx; + color: #222; + font-size: 34rpx; + font-weight: 700; + line-height: 1.2; +} + +.share-btn { + flex-shrink: 0; + margin-left: 12rpx; + padding: 14rpx 24rpx; + border-radius: 999rpx; + background: linear-gradient(135deg, #ff8f3f 0%, #ff6b35 100%); + color: #fff; + font-size: 24rpx; + line-height: 1; + white-space: nowrap; +} + +.load-more { + padding: 24rpx 0 40rpx; + text-align: center; + color: #bbb; + font-size: 24rpx; +} + diff --git a/pages/mine/distribution/order-detail.vue b/pages/mine/distribution/order-detail.vue new file mode 100644 index 0000000..d8f1351 --- /dev/null +++ b/pages/mine/distribution/order-detail.vue @@ -0,0 +1,512 @@ + + + + + diff --git a/pages/mine/distribution/order-list.vue b/pages/mine/distribution/order-list.vue new file mode 100644 index 0000000..1ed5197 --- /dev/null +++ b/pages/mine/distribution/order-list.vue @@ -0,0 +1,710 @@ + + + + + diff --git a/pages/mine/distribution/poster.vue b/pages/mine/distribution/poster.vue new file mode 100644 index 0000000..dcaabc5 --- /dev/null +++ b/pages/mine/distribution/poster.vue @@ -0,0 +1,421 @@ + + + + + diff --git a/pages/mine/distribution/share.vue b/pages/mine/distribution/share.vue new file mode 100644 index 0000000..b8891f2 --- /dev/null +++ b/pages/mine/distribution/share.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/pages/mine/distribution/wallet-log.vue b/pages/mine/distribution/wallet-log.vue new file mode 100644 index 0000000..97fd5cc --- /dev/null +++ b/pages/mine/distribution/wallet-log.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/pages/mine/distribution/withdraw-apply.vue b/pages/mine/distribution/withdraw-apply.vue new file mode 100644 index 0000000..fabbbb8 --- /dev/null +++ b/pages/mine/distribution/withdraw-apply.vue @@ -0,0 +1,502 @@ + + + + + diff --git a/pages/mine/distribution/withdrawal.vue b/pages/mine/distribution/withdrawal.vue index f3fd6fe..651ff01 100644 --- a/pages/mine/distribution/withdrawal.vue +++ b/pages/mine/distribution/withdrawal.vue @@ -29,7 +29,7 @@ diff --git a/pages/order/deliverDetail.vue b/pages/order/deliverDetail.vue index e4d61f2..3ee8c97 100644 --- a/pages/order/deliverDetail.vue +++ b/pages/order/deliverDetail.vue @@ -1,238 +1,310 @@ - + \ No newline at end of file + +.empty { + padding: 40rpx 0; +} + diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue index a0594df..2a29f92 100644 --- a/pages/order/myOrder.vue +++ b/pages/order/myOrder.vue @@ -294,18 +294,9 @@ function waitPay(val: any) { function pay(val: any) { if (val.sn) { - // #ifdef MP-WEIXIN - new LiLiWXPay({ - sn: val.sn, - price: val.flowPrice, - orderType: 'ORDER', - }).pay() - // #endif - // #ifndef MP-WEIXIN uni.navigateTo({ url: '/pages/cart/payment/payOrder?order_sn=' + val.sn, }) - // #endif } } diff --git a/pages/order/orderDetail.vue b/pages/order/orderDetail.vue index 08ebd9f..b5020da 100644 --- a/pages/order/orderDetail.vue +++ b/pages/order/orderDetail.vue @@ -8,8 +8,8 @@ - - + + @@ -25,16 +25,16 @@ 券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }} - - - 当前订单有 {{ orderPackage.length }} 个包裹快递 - -
- 点击此处查看 -
-
- - {{ '暂无物流信息' }} + + {{ deliveryEntryText }} +
点击此处查看
+
+ + 等待商家发货
@@ -144,7 +144,7 @@ 取消订单 - 查看物流 + 查看物流 查看拼团信息 立即付款 确认收货 = { TAKE: { title: '待核验' }, } -const logisticsList = ref('') const shareFlag = ref(false) const order = ref>({}) const cancelShow = ref(false) @@ -311,8 +315,9 @@ const sn = ref('') const cancelList = ref([]) const rogShow = ref(false) const reason = ref('') -const orderPackage = ref('') -// orderType=E_COUPON:无物流/核销码;卡密见 cardKeyDetail(仅本单 orderItems,不含满赠子单) +const orderPackage = ref([]) +const legacyTraces = ref(null) + const isECouponOrder = computed(() => checkECouponOrder(order.value?.orderType)) const isNonPhysicalOrder = computed(() => checkNonPhysicalOrder(order.value?.orderType)) const ecouponCardKeyDelivered = computed(() => @@ -325,6 +330,27 @@ const ecouponPendingMessage = computed(() => { return pending ? resolveCardKeyFulfillMessage(pending) : '' }) +const allowOperation = computed(() => + getOrderAllowOperation(order.value, orderDetail.value) +) + +const showDeliveryInfoBlock = computed(() => { + if (isECouponOrder.value) return true + if (order.value.orderType === 'VIRTUAL') return false + if (order.value.deliveryMethod === 'SELF_PICK_UP') return false + if (order.value.verificationCode) return true + if (order.value.deliveryMethod === 'LOGISTICS') return true + return false +}) + +const deliveryEntryText = computed(() => + getDeliveryEntryText( + orderPackage.value, + order.value.orderStatus, + legacyTraces.value + ) +) + function hideLoadingIfNeeded() { if (store.state.isShowToast) uni.hideLoading() } @@ -335,12 +361,27 @@ onLoad((options) => { loadData(orderSnParam) }) -function getOrderPackage() { - getPackage(order.value.sn).then((res) => { - if (res.data.success) { - orderPackage.value = res.data.result +async function loadDelivery(orderData: Record) { + orderPackage.value = [] + legacyTraces.value = null + + if (!shouldLoadDelivery(orderData)) { + return + } + + try { + const packageResponse = await getPackage(orderData.sn) + const packages = packageResponse?.data?.result || [] + if (packages.length) { + orderPackage.value = packages + return } - }) + + const traceResponse = await getExpress(orderData.sn) + legacyTraces.value = traceResponse?.data?.result || null + } catch { + // 配送信息加载失败时不阻断订单详情展示 + } } function handleClickDeliver() { @@ -349,6 +390,13 @@ function handleClickDeliver() { }) } +function goCardKeyDetail() { + if (!sn.value) return + uni.navigateTo({ + url: `/pages/order/cardKey/cardKeyDetail?sn=${sn.value}`, + }) +} + function refundPriceList(status: string) { switch (status) { case 'ALL_REFUND': @@ -380,12 +428,6 @@ function goToShopPage(val: any) { }) } -function loadLogistics(orderSnParam: string) { - getExpress(orderSnParam).then((res) => { - logisticsList.value = res.data.result - }) -} - function inviteGroup() { shareFlag.value = true } @@ -404,32 +446,19 @@ function ByUserMessage(orderItem: any) { function loadData(orderSnParam: string) { uni.showLoading({ title: '加载中' }) - getOrderDetail(orderSnParam).then((res) => { + getOrderDetail(orderSnParam).then(async (res) => { const result = res.data.result order.value = result.order orderGoodsList.value = result.orderItems orderDetail.value = result - if ( - result.order.deliveryMethod === 'LOGISTICS' && - !checkECouponOrder(result.order.orderType) && - result.order.orderType !== 'VIRTUAL' - ) { - // E_COUPON 无物流信息 - loadLogistics(orderSnParam) - getOrderPackage() + if (!order.value.allowOperationVO && result.allowOperationVO) { + order.value.allowOperationVO = result.allowOperationVO } + await loadDelivery(order.value) hideLoadingIfNeeded() }) } -function goCardKeyDetail() { - // 仅传 orderSn,卡密在二级页重新请求订单详情,不经路由/Vuex 传递明文 - if (!sn.value) return - uni.navigateTo({ - url: `/pages/order/cardKey/cardKeyDetail?sn=${sn.value}`, - }) -} - function onReceipt(val: any) { uni.navigateTo({ url: '/pages/order/invoice/invoiceDetail?id=' + val.id, @@ -528,18 +557,6 @@ function onComment(_orderSnText: string) { }) } -function onLogistics(orderItem: any) { - uni.navigateTo({ - url: - '/pages/mine/msgTips/packageMsg/logisticsDetail?logi_id=' + - orderItem.logi_id + - '&ship_no=' + - orderItem.ship_no + - '&order_sn=' + - orderItem.sn, - }) -} - function reasonChange(val: string) { reason.value = val } diff --git a/pages/passport/login.vue b/pages/passport/login.vue index 5f6419a..f318c5b 100644 --- a/pages/passport/login.vue +++ b/pages/passport/login.vue @@ -1,8 +1,8 @@