From 7d3daf2f0294823603715c1eda6e774066aa635d Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Wed, 5 Aug 2026 18:07:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(distribution):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=88=86=E9=94=80=E5=91=98=E4=B8=AD=E5=BF=83=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增分销业绩统计页面,包含时间范围筛选和自定义日期选择功能 - 重构分销认证页面,改为跳转至招募页面申请分销员身份 - 添加分销商品访问记录功能,支持分享追踪和佣金计算 - 更新分销历史记录页面,优化数据结构和显示字段 - 完全重写分销员首页,包含用户信息、收益统计、等级系统等功能 --- api/distribution.js | 215 ++ api/goods.js | 91 - components/distribution-goods-share/index.vue | 459 ++++ .../distribution-goods-share/poster-panel.vue | 539 +++++ config/api.js | 4 +- js_sdk/u-draw-poster/utils/global.js | 17 +- js_sdk/u-draw-poster/utils/utils.js | 4 +- manifest.json | 1 + pages.json | 1923 +++++++++-------- pages/mine/address/add.vue | 759 +++---- pages/mine/distribution/achievement.vue | 549 ++++- pages/mine/distribution/auth.vue | 97 +- pages/mine/distribution/bind.vue | 44 + pages/mine/distribution/customer-list.vue | 833 +++++++ pages/mine/distribution/grade.vue | 611 ++++++ pages/mine/distribution/history.vue | 19 +- pages/mine/distribution/home.vue | 1015 ++++++++- pages/mine/distribution/invite-friends.vue | 329 +++ pages/mine/distribution/invite-list.vue | 486 +++++ pages/mine/distribution/invite.vue | 425 ++++ pages/mine/distribution/join.vue | 883 ++++++-- pages/mine/distribution/list.vue | 782 +++---- pages/mine/distribution/order-detail.vue | 512 +++++ pages/mine/distribution/order-list.vue | 710 ++++++ pages/mine/distribution/poster.vue | 428 ++++ pages/mine/distribution/share.vue | 28 + pages/mine/distribution/withdrawal.vue | 2 +- pages/passport/login.vue | 122 +- pages/passport/wechatMPLogin.vue | 8 +- pages/product/goods.vue | 31 +- pages/tabbar/home/template/tpl_notice.vue | 21 +- pages/tabbar/user/utils/tool.vue | 569 ++--- utils/filters.js | 42 + vue.config.js | 25 +- 34 files changed, 10053 insertions(+), 2530 deletions(-) create mode 100644 api/distribution.js create mode 100644 components/distribution-goods-share/index.vue create mode 100644 components/distribution-goods-share/poster-panel.vue create mode 100644 pages/mine/distribution/bind.vue create mode 100644 pages/mine/distribution/customer-list.vue create mode 100644 pages/mine/distribution/grade.vue create mode 100644 pages/mine/distribution/invite-friends.vue create mode 100644 pages/mine/distribution/invite-list.vue create mode 100644 pages/mine/distribution/invite.vue create mode 100644 pages/mine/distribution/order-detail.vue create mode 100644 pages/mine/distribution/order-list.vue create mode 100644 pages/mine/distribution/poster.vue create mode 100644 pages/mine/distribution/share.vue diff --git a/api/distribution.js b/api/distribution.js new file mode 100644 index 0000000..9d2a946 --- /dev/null +++ b/api/distribution.js @@ -0,0 +1,215 @@ +/** + * 分销员相关 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 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/config/api.js b/config/api.js index 7c5dd28..466c86e 100644 --- a/config/api.js +++ b/config/api.js @@ -3,13 +3,13 @@ */ // 开发环境 const dev = { - buyer: "https://buyer-api.pickmall.cn", + buyer: "http://127.0.0.1:8888", im: "https://im-api.pickmall.cn", mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt", }; // 生产环境 const prod = { - buyer: "https://buyer-api.pickmall.cn", + buyer: "http://127.0.0.1:8888", im: "https://im-api.pickmall.cn", mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt", }; diff --git a/js_sdk/u-draw-poster/utils/global.js b/js_sdk/u-draw-poster/utils/global.js index 872b77d..9914e52 100644 --- a/js_sdk/u-draw-poster/utils/global.js +++ b/js_sdk/u-draw-poster/utils/global.js @@ -1,5 +1,20 @@ var _a; -export const PLATFORM = typeof process !== 'undefined' ? (_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.VUE_APP_PLATFORM : undefined; +function detectPlatform() { + if (typeof process !== 'undefined' && (_a = process === null || process === void 0 ? void 0 : process.env) !== null && _a !== void 0 && _a.VUE_APP_PLATFORM) { + return process.env.VUE_APP_PLATFORM; + } + if (typeof wx !== 'undefined' && typeof wx.getSystemInfoSync === 'function') { + return 'mp-weixin'; + } + if (typeof uni !== 'undefined' && typeof uni.getSystemInfoSync === 'function') { + const info = uni.getSystemInfoSync(); + if (info && info.uniPlatform === 'mp-weixin') { + return 'mp-weixin'; + } + } + return undefined; +} +export const PLATFORM = detectPlatform(); /** 全局对象 */ const _uni = (function () { if (typeof uni != "undefined") diff --git a/js_sdk/u-draw-poster/utils/utils.js b/js_sdk/u-draw-poster/utils/utils.js index 8f38812..5aa9c65 100644 --- a/js_sdk/u-draw-poster/utils/utils.js +++ b/js_sdk/u-draw-poster/utils/utils.js @@ -37,7 +37,9 @@ export const handleBuildOpts = (options) => { } const oldSelector = defaultOpts.selector; if (PLATFORM === 'mp-weixin' && defaultOpts.type2d) { - defaultOpts.selector = '#' + defaultOpts.selector; + defaultOpts.selector = oldSelector.startsWith('#') + ? oldSelector + : '#' + oldSelector; } if (!PLATFORM) { console.error('注意! draw-poster未开启uni条件编译! 当环境是微信小程序将不会动态切换为type2d模式'); diff --git a/manifest.json b/manifest.json index f87ecaf..050da72 100644 --- a/manifest.json +++ b/manifest.json @@ -210,6 +210,7 @@ }, "plugins" : {}, "libVersion" : "3.5.8", + "__usePrivacyCheck__" : true, "requiredPrivateInfos" : [ "chooseLocation", "getLocation" ] }, "h5" : { diff --git a/pages.json b/pages.json index 618ac78..dcc8154 100644 --- a/pages.json +++ b/pages.json @@ -1,917 +1,1006 @@ -{ - - "easycom": { - "autoscan": true, - "custom": { - "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^u-loading$": "uview-plus/components/u-loading-icon/u-loading-icon.vue", - "^u-alert-tips$": "uview-plus/components/u-alert/u-alert.vue", - "^u-time-line-item$": "@/components/u-time-line/u-time-line-item.vue", - "^u-time-line$": "@/components/u-time-line/u-time-line.vue", - "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" - } - }, - "pages": [ - - { - "path": "pages/tabbar/home/index", - "style": { - "navigationBarTitleText": "首页", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarTextStyle": "black", - "enablePullDownRefresh":true - } - }, - { - "path":"pages/tabbar/screen/fullScreen", - "style": { - "navigationStyle": "custom", // 隐藏系统导航栏 - "app-plus":{ - "animationType": "fade-in", // 设置fade-in淡入动画,为最合理的动画类型 - "background": "transparent", // 背景透明 - "backgroundColor": "rgba(0,0,0,0)", // 背景透明 - "popGesture": "none" // 关闭IOS屏幕左边滑动关闭当前页面的功能 - } - } - }, - { - "path": "pages/tabbar/home/title", - "style": { - "navigationBarTitleText": "消息" - } - }, - { - "path": "pages/tabbar/cart/cartList", - "style": { - "navigationBarTitleText": "购物车", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarBackgroundColor": "#fff", - "enablePullDownRefresh":true //实现下拉刷新样式 - - } - }, { - "path": "pages/tabbar/category/category", - "style": { - "navigationBarTitleText": "分类", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarTextStyle": "black", - "disableScroll": true, - "app-plus": { - "bounce": "none", - "scrollIndicator": "none" - } - } - }, - - { - "path": "pages/navigation/search/searchPage", - "style": { - "navigationBarTitleText": "搜索", - "navigationStyle": "custom", - - "app-plus": { - //app页面不显示滚动条 - "scrollIndicator": "none", - "bottom": "0", - "contentAdjust": "false", - "bounce": "none", - "safearea": { - "bottom": "none" - } - } - } - }, { - "path": "pages/tabbar/user/my", - "style": { - "navigationBarTextStyle": "white", - "enablePullDownRefresh": true, - "navigationStyle": "custom" - } - }, - - { - "path": "pages/tabbar/home/web-view", - "style": { - - } - }, - { - "path": "pages/tabbar/special/special", - "style": { - "navigationBarTitleText": "专题" - } - } - - ], - "subPackages": [ - - { - "root": "pages/mine", - "pages": [ - - { - "path": "signIn", - "style": { - "navigationBarTitleText": "签到" - } - }, { - "path": "myTracks", - "style": { - "navigationBarTitleText": "我的足迹", - "enablePullDownRefresh": true, - "navigationStyle": "custom" - } - }, { - "path": "myCollect", - "style": { - "navigationBarTitleText": "收藏", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "app-plus": { - "scrollIndicator": "none" - } - } - }, - { - "path": "distribution/list", - "style": { - "navigationBarTitleText": "推广分佣", - "app-plus": { - //app页面不显示滚动条 - "scrollIndicator": "none" - } - } - }, - { - "path": "distribution/withdrawal", - "style": { - "navigationBarTitleText": "提现", - "app-plus": { - //app页面不显示滚动条 - "scrollIndicator": "none" - } - } - }, - { - "path": "distribution/join", - "style": { - "navigationBarTitleText": "推广资格申请", - "navigationBarTextStyle": "black", - "app-plus": { - //app页面不显示滚动条 - "scrollIndicator": "none" - } - } - }, - { - "path": "distribution/history", - "style": { - "navigationBarTitleText": "提现历史" - - } - }, - { - "path": "distribution/auth", - "style": { - "navigationBarTitleText": "会员实名认证" - - } - }, - { - "path": "distribution/achievement", - "style": { - "navigationBarTitleText": "我的分销业绩" - - } - }, - { - "path": "distribution/home", - "style": { - "navigationBarTitleText": "推广分佣" - - } - }, - { - "path": "deposit/index", - "style": { - "navigationStyle": "custom" - - } - }, - { - "path": "deposit/operation", - "style": { - "navigationStyle": "custom" - - } - }, - { - "path": "deposit/recharge", - "style": { - "navigationBarTitleText": "充值金额" - - } - }, - { - "path": "deposit/withdrawal", - "style": { - "navigationBarTitleText": "提现金额" - - } - }, - { - "path": "deposit/withdrawApply", - "style": { - "navigationStyle": "custom" - } - }, - - { - "path": "deposit/info", - "style": { - "navigationBarTitleText": "预存款详情" - - } - }, - { - "path": "address/address", - "style": { - "enablePullDownRefresh": true, - "navigationBarTitleText": "地址管理" - } - }, - { - "path": "address/storeAddress", - "style": { - "enablePullDownRefresh": true, - "navigationBarTitleText": "自提点" - } - }, - { - "path": "address/add", - "style": { - "navigationBarTitleText": "收货人" - } - }, - { - "path": "address/addressManage", - "style": { - "navigationBarTitleText": "地址管理" - } - }, - { - "path": "set/versionFunctionList", - "style": { - "navigationBarTitleText": "功能介绍" - } - }, - - { - "path": "set/securityCenter/fingerLogin", - "style": { - "navigationBarTitleText": "指纹登录" - } - }, - { - "path": "set/securityCenter/faceLogin", - "style": { - "navigationBarTitleText": "面容登录" - } - }, - - - { - "path": "set/securityCenter/editPassword", - "style": { - "navigationBarTitleText": "修改密码", - "app-plus": { - - } - } - }, - - { - "path": "set/securityCenter/bindMobile", - "style": { - "navigationBarTitleText": "绑定手机号", - "app-plus": { - - } - } - }, - - { - "path": "im/list", - "style": { - "navigationStyle": "custom", // 隐藏系统导航栏 - "enablePullDownRefresh": true, - "app-plus": { - } - - } - }, - { - "path": "im/index", - "style": { - "navigationStyle": "custom", // 隐藏系统导航栏 - "enablePullDownRefresh": true, - "app-plus": { - } - - } - }, - { - "path": "set/feedBack", - "style": { - "navigationBarTitleText": "意见反馈" - } - }, - { - "path": "set/securityCenter/updatePwdTab", - "style": { - "navigationBarTitleText": "修改密码" - } - }, - { - "path": "set/securityCenter/editLoginPassword", - "style": { - "navigationBarTitleText": "修改密码" - } - }, - { - "path": "set/securityCenter/securityCenter", - "style": { - "navigationBarTitleText": "安全中心" - } - }, - - { - "path": "set/editionIntro", - "style": { - "navigationBarTitleText": "关于我们" - } - }, - { - "path": "set/setUp", - "style": { - "navigationBarTitleText": "设置" - } - }, - { - "path": "set/personMsg", - "style": { - "navigationBarTitleText": "个人信息", - "app-plus": { - "titleNView": { - "padding-right": "12", - "buttons": [{ - "text": "保存", - "fontSize": "16", - "width": "auto", - "color": "#FFFFFF" - }] - } - } - } - }, { - "path": "help/tips", - "style": { - "navigationBarTitleText": "" - } - }, { - "path": "point/myPoint", - "style": { - "navigationBarTitleText": "我的积分" - } - }, - { - "path": "msgTips/main", - "style": { - "navigationBarTitleText": "消息中心" - } - }, - { - "path": "msgTips/sysMsg/index", - "style": { - "navigationBarTitleText": "系统消息" - } - }, - { - "path": "msgTips/serviceMsg/index", - "style": { - "navigationBarTitleText": "客服记录" - } - }, - { - "path": "msgTips/packageMsg/index", - "style": { - "navigationBarTitleText": "物流消息" - } - }, - { - "path": "msgTips/packageMsg/logisticsDetail", - "style": { - "navigationBarTitleText": "订单跟踪" - } - } - - ] - - }, - - - { - "root": "pages/product", - "pages": [{ - "path": "shopPage", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - },{ - "path": "shopList", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - },{ - "path": "licencePhoto", - "style": { - "navigationBarTitleText": "营业执照" - } - },{ - "path": "shopPageGoods", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "goods", - "style": { - "backgroundColor": "#fff", - "navigationStyle": "custom", - "app-plus": { - // 将回弹属性关掉 - "bounce": "none", - // 禁止页面滚动 - "scrollIndicator": "none", - "safearea": { - "bottom": { - "offset": "none" - } - } - } - } - }, - { - "path": "askList", - "style": { - "navigationBarTitleText": "问答专区" - } - }, - { //商品评价 - "path": "comment", - "style": { - "navigationBarTitleText": "商品评价", - "navigationStyle": "custom", - "app-plus": { - //app页面不显示滚动条 - "scrollIndicator": "none" - } - } - }, - { // 客服 - "path": "customerservice/index", - "style": { - "navigationBarTitleText": "客服", - "usingComponents": { - // #ifdef MP-WEIXIN - "chat": "plugin://myPlugin/chat" - // #endif - } - } - } - - ] - - }, - { - "root": "pages/floor", - "pages": [{ - "path": "empty" - }] - - }, - { - "root": "pages/passport", - "pages": [{ - "path": "login", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom", - "app-plus": { - "titleNView": false, - "animationType": "slide-in-bottom", - "scrollIndicator": "none", - "safearea": { - "bottom": { - "offset": "none" - } - } - } - } - }, - - { - "path": "entry/seller/index", - "style": { - "navigationBarTitleText": "店铺入驻", - "navigationStyle": "custom" - } - }, - { - "path": "entry/seller/control", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "article", - "style": { - "navigationBarTitleText": "文章" - } - }, - { - "path": "wechatMPLogin", - "style": { - "navigationBarTitleText": "小程序登录", - "navigationStyle": "custom", - "navigationBarTextStyle": "black" - } - }, - { - "path": "scannerCodeLoginConfirm", - "style": { - "navigationBarTitleText": "扫码登录", - "navigationStyle": "custom", - "navigationBarTextStyle": "black" - } - } - ] - - }, - - { - "root": "pages/promotion", - "pages": [ { - "path": "seckill", - "style": { - "navigationBarTitleText": "限时抢购", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarTextStyle": "black" , - "app-plus": { - "titleNView": { - "homeButton":true - } - } - } - }, - - // #ifndef MP-WEIXIN - { - "path": "live/room", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white", - "disableScroll": true - } - }, - // #endif - { - "path": "joinGroup", - "style": { - "navigationBarTitleText": "拼团活动", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarTextStyle": "black" , - "app-plus": { - // 将回弹属性关掉 - "bounce": "none" - } - } - }, - // #ifndef MP-WEIXIN - { - "path": "lives", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "black" - } - }, - // #endif - { - "path": "bargain/list", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - - } - },{ - "path": "bargain/detail", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - - } - },{ - "path": "bargain/log", - "style": { - "navigationBarTitleText": "砍价记录" - } - },{ - "path": "point/detail", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - - } - },{ - "path": "point/pointList", - "style": { - "navigationBarTitleText": "积分商城" - - - } - } - - ] - - }, - { - "root": "pages/cart", - "pages": [{ - "path": "coupon/myCoupon", - "style": { - "navigationBarTitleText": "我的优惠券", - "app-plus": { - "bounce": "coupon/none" - - } - } - }, - { - "path": "coupon/couponDetail", - "style": { - "navigationBarTitleText": "优惠券详情" - } - }, - { - "path": "coupon/index", - "style": { - "navigationBarTitleText": "优惠券" - } - }, - - { - "path": "coupon/couponCenter", - "style": { - "navigationBarTitleText": "领券中心", - "enablePullDownRefresh": true - - } - }, - { - "path": "payment/payOrder", - "style": { - "navigationBarTitleText": "支付订单", - "app-plus": { - "popGesture": "none" //禁止侧滑退出 - - } - } - }, - { - "path": "payment/success", - "style": { - "navigationBarTitleText": "支付成功", - "navigationStyle": "custom", // 隐藏系统导航栏 - "navigationBarTextStyle": "white", - "app-plus": { - "popGesture": "none", //禁止侧滑退出 - "titleNView": false - } - } - }, - { - "path": "payment/error", - "style": { - "navigationBarTitleText": "支付失败", - "navigationStyle": "custom", - "navigationBarTextStyle": "black", - "app-plus": { - "popGesture": "none" - } - } - }, - { - "path": "payment/shareOrderGoods", - "style": { - "navigationBarTitleText": "", - "app-plus": { - - } - } - } - - ] - - }, - { - "root": "pages/order", - "pages": [{ - "path": "complain/complain", - "style": { - "navigationBarTitleText": "订单商品投诉" - } - }, - { - "path": "complain/complainInfo", - "style": { - "navigationBarTitleText": "投诉详情" - } - }, - { - "path": "complain/complainList", - "style": { - "navigationBarTitleText": "投诉列表" - } - }, - { - "path": "myOrder", - "style": { - "navigationBarTitleText": "我的订单", - "enablePullDownRefresh": true, - "app-plus": { - "bounce": "none" - - } - } - }, - { - "path": "invoice/invoiceDetail", - "style": { - "navigationBarTitleText": "发票详情" - } - }, - { - "path": "orderDetail", - "style": { - "navigationBarTitleText": "订单详情" - } - }, - { - "path": "deliverDetail", - "style": { - "navigationBarTitleText": "物流详情" - } - }, - { - "path": "evaluate/evaluateDetail", - "style": { - "navigationBarTitleText": "评价详情" - } - }, - - { - "path": "evaluate/releaseEvaluate", - "style": { - "navigationBarTitleText": "发布评价" - } - }, - { - "path": "evaluate/myEvaluate", - "style": { - "navigationBarTitleText": "我的评价" - } - }, - - { - "path": "afterSales/applyProgress", - "style": { - "navigationBarTitleText": "售后服务" - } - }, - { - "path": "afterSales/applyDetail", - "style": { - "navigationBarTitleText": "售后服务" - } - }, - { - "path": "afterSales/applySuccess", - "style": { - "navigationBarTitleText": "提交成功", - "app-plus": { - "bounce": "none", - "titleNView": { - "titleColor": "#FFFFFF", - "buttons": [{ - "text": "完成", - "fontSize": "14", - "color": "#FFFFFF", - "width": "36px" - // "background": "rgba(0,0,0,0)" - }] - } - } - } - }, - { - "path": "afterSales/afterSalesDetailExpress" - }, - { - "path": "afterSales/afterSalesSelect", - "style": { - "navigationBarTitleText": "申请售后" - } - }, - { - "path": "afterSales/afterSalesDetail", - "style": { - "navigationBarTitleText": "申请售后" - } - }, - { - "path": "afterSales/afterSales", - "style": { - "navigationBarTitleText": "售后管理", - "enablePullDownRefresh": true - } - }, - { - "path": "fillorder", - "style": { - "navigationBarTitleText": "填写订单" - } - } - ] - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "Lili商城", - "navigationBarBackgroundColor": "#fff", - "backgroundColor": "#fff", - "app-plus": { - // 全局关闭回弹功能 - "bounce": "none" - - } - }, - "tabBar": { - "color": "#666", - "selectedColor": "#ff3c2a", - "borderStyle": "black", - "backgroundColor": "#ffffff", - "list": [{ - "pagePath": "pages/tabbar/home/index", - "iconPath": "static/tabbar/home.png", - "selectedIconPath": "static/tabbar/home-s.png", - "text": "首页" - }, - { - "pagePath": "pages/tabbar/category/category", - "iconPath": "static/tabbar/category.png", - "selectedIconPath": "static/tabbar/category-s.png", - "text": "分类" - }, - - { - "pagePath": "pages/tabbar/cart/cartList", - "iconPath": "static/tabbar/cart.png", - "selectedIconPath": "static/tabbar/cart-s.png", - "text": "购物车" - }, - { - "pagePath": "pages/tabbar/user/my", - "iconPath": "static/tabbar/mine.png", - "selectedIconPath": "static/tabbar/mine-s.png", - "text": "我的" - } - ] - }, - // #todo 为什么要注释condition下代码? - // IOS plus.runtime.arguments 添加 condition节点后, 框架会修改 runtime.arguments - // 会影响什么功能? - // -在h5中唤醒app会一直返回默认值 {"name":"","path":"","query":"","id":0} - "condition": { //模式配置,仅开发期间生效 - // "current": 0, //当前激活的模式(list 的索引项) - // "list": [{ - // "name": "", //模式名称 - // "path":"", //启动页面,必选 - // "query": "" //启动参数,在页面的onLoad函数里面得到 - // }] - } -} +{ + + "easycom": { + "autoscan": true, + "custom": { + "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^u-loading$": "uview-plus/components/u-loading-icon/u-loading-icon.vue", + "^u-alert-tips$": "uview-plus/components/u-alert/u-alert.vue", + "^u-time-line-item$": "@/components/u-time-line/u-time-line-item.vue", + "^u-time-line$": "@/components/u-time-line/u-time-line.vue", + "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" + } + }, + "pages": [ + + { + "path": "pages/tabbar/home/index", + "style": { + "navigationBarTitleText": "首页", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "black", + "enablePullDownRefresh":true + } + }, + { + "path":"pages/tabbar/screen/fullScreen", + "style": { + "navigationStyle": "custom", // 隐藏系统导航栏 + "app-plus":{ + "animationType": "fade-in", // 设置fade-in淡入动画,为最合理的动画类型 + "background": "transparent", // 背景透明 + "backgroundColor": "rgba(0,0,0,0)", // 背景透明 + "popGesture": "none" // 关闭IOS屏幕左边滑动关闭当前页面的功能 + } + } + }, + { + "path": "pages/tabbar/home/title", + "style": { + "navigationBarTitleText": "消息" + } + }, + { + "path": "pages/tabbar/cart/cartList", + "style": { + "navigationBarTitleText": "购物车", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarBackgroundColor": "#fff", + "enablePullDownRefresh":true //实现下拉刷新样式 + + } + }, { + "path": "pages/tabbar/category/category", + "style": { + "navigationBarTitleText": "分类", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "black", + "disableScroll": true, + "app-plus": { + "bounce": "none", + "scrollIndicator": "none" + } + } + }, + + { + "path": "pages/navigation/search/searchPage", + "style": { + "navigationBarTitleText": "搜索", + "navigationStyle": "custom", + + "app-plus": { + //app页面不显示滚动条 + "scrollIndicator": "none", + "bottom": "0", + "contentAdjust": "false", + "bounce": "none", + "safearea": { + "bottom": "none" + } + } + } + }, { + "path": "pages/tabbar/user/my", + "style": { + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true, + "navigationStyle": "custom" + } + }, + + { + "path": "pages/tabbar/home/web-view", + "style": { + + } + }, + { + "path": "pages/tabbar/special/special", + "style": { + "navigationBarTitleText": "专题" + } + } + + ], + "subPackages": [ + + { + "root": "pages/mine", + "pages": [ + + { + "path": "signIn", + "style": { + "navigationBarTitleText": "签到" + } + }, { + "path": "myTracks", + "style": { + "navigationBarTitleText": "我的足迹", + "enablePullDownRefresh": true, + "navigationStyle": "custom" + } + }, { + "path": "myCollect", + "style": { + "navigationBarTitleText": "收藏", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "app-plus": { + "scrollIndicator": "none" + } + } + }, + { + "path": "distribution/list", + "style": { + "navigationBarTitleText": "推广商品", + "app-plus": { + //app页面不显示滚动条 + "scrollIndicator": "none" + } + } + }, + { + "path": "distribution/withdrawal", + "style": { + "navigationBarTitleText": "提现", + "app-plus": { + //app页面不显示滚动条 + "scrollIndicator": "none" + } + } + }, + { + "path": "distribution/join", + "style": { + "navigationBarTitleText": "推广资格申请", + "navigationBarTextStyle": "black", + "app-plus": { + //app页面不显示滚动条 + "scrollIndicator": "none" + } + } + }, + { + "path": "distribution/history", + "style": { + "navigationBarTitleText": "提现历史" + + } + }, + { + "path": "distribution/auth", + "style": { + "navigationBarTitleText": "会员实名认证" + + } + }, + { + "path": "distribution/achievement", + "style": { + "navigationBarTitleText": "业绩统计", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f6f8" + } + }, + { + "path": "distribution/grade", + "style": { + "navigationBarTitleText": "分销等级" + } + }, + { + "path": "distribution/home", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "分销员中心" + } + }, + { + "path": "distribution/invite-list", + "style": { + "navigationBarTitleText": "我的邀请", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f6f8" + } + }, + { + "path": "distribution/customer-list", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "客户列表", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f6f8" + } + }, + { + "path": "distribution/invite-friends", + "style": { + "navigationBarTitleText": "邀请卡", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#fff7f0" + } + }, + { + "path": "distribution/invite", + "style": { + "navigationBarTitleText": "图文邀请卡", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f5f5" + } + }, + { + "path": "distribution/order-list", + "style": { + "navigationBarTitleText": "推广订单", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f6f8" + } + }, + { + "path": "distribution/order-detail", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "分销订单详情", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f6f8" + } + }, + { + "path": "distribution/poster", + "style": { + "navigationBarTitleText": "平台海报", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#f5f5f5" + } + }, + { + "path": "distribution/bind", + "style": { + "navigationBarTitleText": "加载中", + "navigationStyle": "custom" + } + }, + { + "path": "distribution/share", + "style": { + "navigationBarTitleText": "分享给好友", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "backgroundColor": "#ffffff" + } + }, + { + "path": "deposit/index", + "style": { + "navigationStyle": "custom" + + } + }, + { + "path": "deposit/operation", + "style": { + "navigationStyle": "custom" + + } + }, + { + "path": "deposit/recharge", + "style": { + "navigationBarTitleText": "充值金额" + + } + }, + { + "path": "deposit/withdrawal", + "style": { + "navigationBarTitleText": "提现金额" + + } + }, + { + "path": "deposit/withdrawApply", + "style": { + "navigationStyle": "custom" + } + }, + + { + "path": "deposit/info", + "style": { + "navigationBarTitleText": "预存款详情" + + } + }, + { + "path": "address/address", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "地址管理" + } + }, + { + "path": "address/storeAddress", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "自提点" + } + }, + { + "path": "address/add", + "style": { + "navigationBarTitleText": "收货人" + } + }, + { + "path": "address/addressManage", + "style": { + "navigationBarTitleText": "地址管理" + } + }, + { + "path": "set/versionFunctionList", + "style": { + "navigationBarTitleText": "功能介绍" + } + }, + + { + "path": "set/securityCenter/fingerLogin", + "style": { + "navigationBarTitleText": "指纹登录" + } + }, + { + "path": "set/securityCenter/faceLogin", + "style": { + "navigationBarTitleText": "面容登录" + } + }, + + + { + "path": "set/securityCenter/editPassword", + "style": { + "navigationBarTitleText": "修改密码", + "app-plus": { + + } + } + }, + + { + "path": "set/securityCenter/bindMobile", + "style": { + "navigationBarTitleText": "绑定手机号", + "app-plus": { + + } + } + }, + + { + "path": "im/list", + "style": { + "navigationStyle": "custom", // 隐藏系统导航栏 + "enablePullDownRefresh": true, + "app-plus": { + } + + } + }, + { + "path": "im/index", + "style": { + "navigationStyle": "custom", // 隐藏系统导航栏 + "enablePullDownRefresh": true, + "app-plus": { + } + + } + }, + { + "path": "set/feedBack", + "style": { + "navigationBarTitleText": "意见反馈" + } + }, + { + "path": "set/securityCenter/updatePwdTab", + "style": { + "navigationBarTitleText": "修改密码" + } + }, + { + "path": "set/securityCenter/editLoginPassword", + "style": { + "navigationBarTitleText": "修改密码" + } + }, + { + "path": "set/securityCenter/securityCenter", + "style": { + "navigationBarTitleText": "安全中心" + } + }, + + { + "path": "set/editionIntro", + "style": { + "navigationBarTitleText": "关于我们" + } + }, + { + "path": "set/setUp", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "set/personMsg", + "style": { + "navigationBarTitleText": "个人信息", + "app-plus": { + "titleNView": { + "padding-right": "12", + "buttons": [{ + "text": "保存", + "fontSize": "16", + "width": "auto", + "color": "#FFFFFF" + }] + } + } + } + }, { + "path": "help/tips", + "style": { + "navigationBarTitleText": "" + } + }, { + "path": "point/myPoint", + "style": { + "navigationBarTitleText": "我的积分" + } + }, + { + "path": "msgTips/main", + "style": { + "navigationBarTitleText": "消息中心" + } + }, + { + "path": "msgTips/sysMsg/index", + "style": { + "navigationBarTitleText": "系统消息" + } + }, + { + "path": "msgTips/serviceMsg/index", + "style": { + "navigationBarTitleText": "客服记录" + } + }, + { + "path": "msgTips/packageMsg/index", + "style": { + "navigationBarTitleText": "物流消息" + } + }, + { + "path": "msgTips/packageMsg/logisticsDetail", + "style": { + "navigationBarTitleText": "订单跟踪" + } + } + + ] + + }, + + + { + "root": "pages/product", + "pages": [{ + "path": "shopPage", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + },{ + "path": "shopList", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + },{ + "path": "licencePhoto", + "style": { + "navigationBarTitleText": "营业执照" + } + },{ + "path": "shopPageGoods", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "goods", + "style": { + "backgroundColor": "#fff", + "navigationStyle": "custom", + "app-plus": { + // 将回弹属性关掉 + "bounce": "none", + // 禁止页面滚动 + "scrollIndicator": "none", + "safearea": { + "bottom": { + "offset": "none" + } + } + } + } + }, + { + "path": "askList", + "style": { + "navigationBarTitleText": "问答专区" + } + }, + { //商品评价 + "path": "comment", + "style": { + "navigationBarTitleText": "商品评价", + "navigationStyle": "custom", + "app-plus": { + //app页面不显示滚动条 + "scrollIndicator": "none" + } + } + }, + { // 客服 + "path": "customerservice/index", + "style": { + "navigationBarTitleText": "客服", + "usingComponents": { + // #ifdef MP-WEIXIN + "chat": "plugin://myPlugin/chat" + // #endif + } + } + } + + ] + + }, + { + "root": "pages/floor", + "pages": [{ + "path": "empty" + }] + + }, + { + "root": "pages/passport", + "pages": [{ + "path": "login", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "app-plus": { + "titleNView": false, + "animationType": "slide-in-bottom", + "scrollIndicator": "none", + "safearea": { + "bottom": { + "offset": "none" + } + } + } + } + }, + + { + "path": "entry/seller/index", + "style": { + "navigationBarTitleText": "店铺入驻", + "navigationStyle": "custom" + } + }, + { + "path": "entry/seller/control", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "article", + "style": { + "navigationBarTitleText": "文章" + } + }, + { + "path": "wechatMPLogin", + "style": { + "navigationBarTitleText": "小程序登录", + "navigationStyle": "custom", + "navigationBarTextStyle": "black" + } + }, + { + "path": "scannerCodeLoginConfirm", + "style": { + "navigationBarTitleText": "扫码登录", + "navigationStyle": "custom", + "navigationBarTextStyle": "black" + } + } + ] + + }, + + { + "root": "pages/promotion", + "pages": [ { + "path": "seckill", + "style": { + "navigationBarTitleText": "限时抢购", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "black" , + "app-plus": { + "titleNView": { + "homeButton":true + } + } + } + }, + + // #ifndef MP-WEIXIN + { + "path": "live/room", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white", + "disableScroll": true + } + }, + // #endif + { + "path": "joinGroup", + "style": { + "navigationBarTitleText": "拼团活动", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "black" , + "app-plus": { + // 将回弹属性关掉 + "bounce": "none" + } + } + }, + // #ifndef MP-WEIXIN + { + "path": "lives", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "black" + } + }, + // #endif + { + "path": "bargain/list", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + + } + },{ + "path": "bargain/detail", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + + } + },{ + "path": "bargain/log", + "style": { + "navigationBarTitleText": "砍价记录" + } + },{ + "path": "point/detail", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + + } + },{ + "path": "point/pointList", + "style": { + "navigationBarTitleText": "积分商城" + + + } + } + + ] + + }, + { + "root": "pages/cart", + "pages": [{ + "path": "coupon/myCoupon", + "style": { + "navigationBarTitleText": "我的优惠券", + "app-plus": { + "bounce": "coupon/none" + + } + } + }, + { + "path": "coupon/couponDetail", + "style": { + "navigationBarTitleText": "优惠券详情" + } + }, + { + "path": "coupon/index", + "style": { + "navigationBarTitleText": "优惠券" + } + }, + + { + "path": "coupon/couponCenter", + "style": { + "navigationBarTitleText": "领券中心", + "enablePullDownRefresh": true + + } + }, + { + "path": "payment/payOrder", + "style": { + "navigationBarTitleText": "支付订单", + "app-plus": { + "popGesture": "none" //禁止侧滑退出 + + } + } + }, + { + "path": "payment/success", + "style": { + "navigationBarTitleText": "支付成功", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white", + "app-plus": { + "popGesture": "none", //禁止侧滑退出 + "titleNView": false + } + } + }, + { + "path": "payment/error", + "style": { + "navigationBarTitleText": "支付失败", + "navigationStyle": "custom", + "navigationBarTextStyle": "black", + "app-plus": { + "popGesture": "none" + } + } + }, + { + "path": "payment/shareOrderGoods", + "style": { + "navigationBarTitleText": "", + "app-plus": { + + } + } + } + + ] + + }, + { + "root": "pages/order", + "pages": [{ + "path": "complain/complain", + "style": { + "navigationBarTitleText": "订单商品投诉" + } + }, + { + "path": "complain/complainInfo", + "style": { + "navigationBarTitleText": "投诉详情" + } + }, + { + "path": "complain/complainList", + "style": { + "navigationBarTitleText": "投诉列表" + } + }, + { + "path": "myOrder", + "style": { + "navigationBarTitleText": "我的订单", + "enablePullDownRefresh": true, + "app-plus": { + "bounce": "none" + + } + } + }, + { + "path": "invoice/invoiceDetail", + "style": { + "navigationBarTitleText": "发票详情" + } + }, + { + "path": "orderDetail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "deliverDetail", + "style": { + "navigationBarTitleText": "物流详情" + } + }, + { + "path": "evaluate/evaluateDetail", + "style": { + "navigationBarTitleText": "评价详情" + } + }, + + { + "path": "evaluate/releaseEvaluate", + "style": { + "navigationBarTitleText": "发布评价" + } + }, + { + "path": "evaluate/myEvaluate", + "style": { + "navigationBarTitleText": "我的评价" + } + }, + + { + "path": "afterSales/applyProgress", + "style": { + "navigationBarTitleText": "售后服务" + } + }, + { + "path": "afterSales/applyDetail", + "style": { + "navigationBarTitleText": "售后服务" + } + }, + { + "path": "afterSales/applySuccess", + "style": { + "navigationBarTitleText": "提交成功", + "app-plus": { + "bounce": "none", + "titleNView": { + "titleColor": "#FFFFFF", + "buttons": [{ + "text": "完成", + "fontSize": "14", + "color": "#FFFFFF", + "width": "36px" + // "background": "rgba(0,0,0,0)" + }] + } + } + } + }, + { + "path": "afterSales/afterSalesDetailExpress" + }, + { + "path": "afterSales/afterSalesSelect", + "style": { + "navigationBarTitleText": "申请售后" + } + }, + { + "path": "afterSales/afterSalesDetail", + "style": { + "navigationBarTitleText": "申请售后" + } + }, + { + "path": "afterSales/afterSales", + "style": { + "navigationBarTitleText": "售后管理", + "enablePullDownRefresh": true + } + }, + { + "path": "fillorder", + "style": { + "navigationBarTitleText": "填写订单" + } + } + ] + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "Lili商城", + "navigationBarBackgroundColor": "#fff", + "backgroundColor": "#fff", + "app-plus": { + // 全局关闭回弹功能 + "bounce": "none" + + } + }, + "tabBar": { + "color": "#666", + "selectedColor": "#ff3c2a", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [{ + "pagePath": "pages/tabbar/home/index", + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-s.png", + "text": "首页" + }, + { + "pagePath": "pages/tabbar/category/category", + "iconPath": "static/tabbar/category.png", + "selectedIconPath": "static/tabbar/category-s.png", + "text": "分类" + }, + + { + "pagePath": "pages/tabbar/cart/cartList", + "iconPath": "static/tabbar/cart.png", + "selectedIconPath": "static/tabbar/cart-s.png", + "text": "购物车" + }, + { + "pagePath": "pages/tabbar/user/my", + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mine-s.png", + "text": "我的" + } + ] + }, + // #todo 为什么要注释condition下代码? + // IOS plus.runtime.arguments 添加 condition节点后, 框架会修改 runtime.arguments + // 会影响什么功能? + // -在h5中唤醒app会一直返回默认值 {"name":"","path":"","query":"","id":0} + "condition": { //模式配置,仅开发期间生效 + // "current": 0, //当前激活的模式(list 的索引项) + // "list": [{ + // "name": "", //模式名称 + // "path":"", //启动页面,必选 + // "query": "" //启动参数,在页面的onLoad函数里面得到 + // }] + } +} diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue index ba9f50e..326df8b 100644 --- a/pages/mine/address/add.vue +++ b/pages/mine/address/add.vue @@ -1,375 +1,386 @@ - - - \ 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/bind.vue b/pages/mine/distribution/bind.vue new file mode 100644 index 0000000..bcf48a0 --- /dev/null +++ b/pages/mine/distribution/bind.vue @@ -0,0 +1,44 @@ + + + + + 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..1e13275 --- /dev/null +++ b/pages/mine/distribution/invite.vue @@ -0,0 +1,425 @@ + + + + + diff --git a/pages/mine/distribution/join.vue b/pages/mine/distribution/join.vue index a8b1d85..a4ebe8b 100644 --- a/pages/mine/distribution/join.vue +++ b/pages/mine/distribution/join.vue @@ -1,127 +1,756 @@ - - - - - - - + + + + + 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..3b720e2 --- /dev/null +++ b/pages/mine/distribution/poster.vue @@ -0,0 +1,428 @@ + + + + + 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/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/utils/filters.js b/utils/filters.js index 32087e1..4b3a8a0 100644 --- a/utils/filters.js +++ b/utils/filters.js @@ -528,6 +528,48 @@ export function serviceStatusList (val) { return statusList[val]; } +/** + * 格式化商品规格展示(兼容 SKU JSON 与纯文本) + */ +export function formatGoodsSpecs(specs) { + if (specs === null || specs === undefined) { + return '默认' + } + const trimmed = String(specs).trim() + if (!trimmed) { + return '默认' + } + if (!trimmed.startsWith('{') && !trimmed.startsWith('[')) { + return trimmed + } + try { + const data = JSON.parse(trimmed) + if (!data || typeof data !== 'object' || Array.isArray(data)) { + return trimmed + } + const parts = [] + Object.keys(data).forEach((key) => { + if (key === 'images') { + return + } + const value = data[key] + if (value === null || value === undefined || value === '') { + return + } + if (typeof value === 'object') { + return + } + const text = String(value).trim() + if (text) { + parts.push(text) + } + }) + return parts.length ? parts.join(' ') : '默认' + } catch (e) { + return '默认' + } +} + /** * 订单状态列表 */ diff --git a/vue.config.js b/vue.config.js index 4fcbd16..c4415a1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,20 +1,7 @@ +const path = require('path') -// module.exports = { -// /** -// * 此处为发行h5,微信小程序,app中删除console -// * 如需显示console 需要注释此处重新运行 -// */ -// chainWebpack: (config) => { -// // 发行或运行时启用了压缩时会生效 -// config.optimization.minimizer('terser').tap((args) => { -// const compress = args[0].terserOptions.compress -// // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...) -// compress.drop_console = true -// compress.pure_funcs = [ -// '__f__', // App 平台 vue 移除日志代码 -// // 'console.debug' // 可移除指定的 console 方法 -// ] -// return args -// }) -// } -// } \ No newline at end of file +module.exports = { + transpileDependencies: [ + path.join(__dirname, 'js_sdk/u-draw-poster'), + ], +} From 4b1a09cbc34b56326e51cc85dba4c09cfb40dc9b Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Tue, 11 Aug 2026 15:43:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat(distribution):=20=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E5=88=86=E9=94=80=E5=8A=9F=E8=83=BD=E4=B8=8E=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增银行卡管理页面,支持用户查看与管理银行卡。 - 实现添加、删除及设置默认银行卡功能。 - 优化邀请与加入页面,展示邀请人信息并改进用户提示。 - 更新海报与二维码生成逻辑,提升用户体验。 - 重构多个组件,提高可读性与可维护性。 --- App.vue | 2 + README.md | 76 +-- api/distribution.js | 9 + components/m-buy/goods.vue | 2 + .../m-search-revision/m-search-revision.vue | 202 +++---- pages/mine/distribution/bank-accounts.vue | 382 +++++++++++++ pages/mine/distribution/bind.vue | 24 +- pages/mine/distribution/cash-history.vue | 204 +++++++ pages/mine/distribution/invite.vue | 356 +++++++------ pages/mine/distribution/join.vue | 157 +++++- pages/mine/distribution/poster.vue | 385 +++++++------- pages/mine/distribution/wallet-log.vue | 191 +++++++ pages/mine/distribution/withdraw-apply.vue | 502 ++++++++++++++++++ pages/order/myOrder.vue | 9 - pages/product/goods.vue | 6 +- utils/distributionBind.js | 190 +++++++ utils/distributionPosterCanvas.ts | 289 ++++++++++ utils/storage.js | 22 +- 18 files changed, 2481 insertions(+), 527 deletions(-) create mode 100644 pages/mine/distribution/bank-accounts.vue create mode 100644 pages/mine/distribution/cash-history.vue create mode 100644 pages/mine/distribution/wallet-log.vue create mode 100644 pages/mine/distribution/withdraw-apply.vue create mode 100644 utils/distributionBind.js create mode 100644 utils/distributionPosterCanvas.ts 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 index 9d2a946..af87571 100644 --- a/api/distribution.js +++ b/api/distribution.js @@ -189,6 +189,15 @@ export function getRecruitPage() { }) } +/** 招募页邀请人信息(无需登录) */ +export function getRecruitInviter(distributionId) { + return http.request({ + url: `/distribution/distribution/recruit/inviter`, + method: Method.GET, + params: { distributionId }, + }) +} + /** 提交招募申请 */ export function submitRecruitApplication(data) { return http.request({ diff --git a/components/m-buy/goods.vue b/components/m-buy/goods.vue index 23debb1..a0ee8f8 100644 --- a/components/m-buy/goods.vue +++ b/components/m-buy/goods.vue @@ -250,6 +250,8 @@ const buy = (data: any) => { url: `/pages/order/fillorder?way=${data.cartType}&addr=${''}&parentOrder=${encodeURIComponent(JSON.stringify(parentOrder.value))}` }) } + }).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, +}) + diff --git a/pages/mine/distribution/bind.vue b/pages/mine/distribution/bind.vue index bcf48a0..14b3d40 100644 --- a/pages/mine/distribution/bind.vue +++ b/pages/mine/distribution/bind.vue @@ -4,32 +4,20 @@ + + diff --git a/pages/mine/distribution/invite.vue b/pages/mine/distribution/invite.vue index 1e13275..599a572 100644 --- a/pages/mine/distribution/invite.vue +++ b/pages/mine/distribution/invite.vue @@ -9,74 +9,81 @@ 重新加载
- - - - - - {{ inviteContext.memberName || '分销员' }} - - - {{ inviteContext.slogan }} - - - - {{ qrLoadingText }} - - - {{ qrError }} - 重新生成 - - - + + + - - 长按图片保存海报 + 保存海报 + 点击预览,长按或保存到相册 - + + + + + + + + + + diff --git a/pages/mine/distribution/join.vue b/pages/mine/distribution/join.vue index a4ebe8b..3e82b37 100644 --- a/pages/mine/distribution/join.vue +++ b/pages/mine/distribution/join.vue @@ -4,7 +4,16 @@ 暂未开放线上招募 - + + + + + + 邀请您加入 + {{ inviterName }} + + + 加入条件 - 满足以下条件后可申请成为分销员 + + {{ isUserLoggedIn ? '满足以下条件后可申请成为分销员' : '登录后可查看您的达标进度并申请成为分销员' }} + @@ -87,7 +98,14 @@ - + + + + 立即登录 + + + + @@ -148,8 +166,13 @@ import { ref, reactive, computed } from 'vue' import { onLoad, onShow } from '@dcloudio/uni-app' import { useStore } from '@/store' import { getThemeStyle } from '@/utils/theme' -import { getRecruitPage, getRecruitProgress, submitRecruitApplication } from '@/api/distribution' -import { tipsToLogin } from '@/utils/filters.js' +import storage from '@/utils/storage.js' +import config from '@/config/config' +import { parseGoodsImageUrl, tipsToLogin } from '@/utils/filters.js' +import { resolveRecruitDistributionIdFromScene } from '@/utils/distributionBind.js' +import { getRecruitPage, getRecruitProgress, getRecruitInviter, submitRecruitApplication } from '@/api/distribution' + +const defaultAvatar = config.defaultUserPhoto const store = useStore() const themeStyle = computed(() => getThemeStyle(store.state.theme)) @@ -166,6 +189,9 @@ const agreementVisible = ref(false) const applyFormVisible = ref(false) const formInfoCompleted = ref(false) const fieldErrors = reactive>({}) +const inviterInfo = ref(null) + +const isUserLoggedIn = computed(() => !!storage.getAccessToken()) const plan = computed(() => pageInfo.value.plan || null) const fields = computed(() => pageInfo.value.fields || []) @@ -219,12 +245,25 @@ const isManualApply = computed(() => { return (plan.value?.applyMode || 'MANUAL') === 'MANUAL' }) +const showLoginFooter = computed(() => { + return !!plan.value && !isUserLoggedIn.value && !loading.value +}) + +const showInviterHeader = computed(() => { + if (!recruitToken.value) return false + const info = inviterInfo.value + return !!(info?.memberName || info?.memberAvatar) +}) + +const inviterName = computed(() => inviterInfo.value?.memberName || '分销员') +const inviterAvatar = computed(() => parseGoodsImageUrl(inviterInfo.value?.memberAvatar) || defaultAvatar) + const showManualApply = computed(() => { - return !showApplyResult.value && conditionsMet.value && isManualApply.value + return isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && isManualApply.value }) const showAutoApplyTip = computed(() => { - return !showApplyResult.value && conditionsMet.value && plan.value?.applyMode === 'AUTO' + return isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && plan.value?.applyMode === 'AUTO' }) const showApplyForm = computed(() => { @@ -250,10 +289,48 @@ const consumeCountOk = computed(() => { }) -onLoad((query) => { - recruitToken.value = query?.token || query?.distributionId || '' +onLoad(async (query) => { + let token = query?.token || query?.distributionId || '' + if (!token && query?.scene) { + token = await resolveRecruitDistributionIdFromScene(query.scene) + } + recruitToken.value = token ? String(token) : '' + if (recruitToken.value) { + loadInviterInfo(recruitToken.value) + } }) +function loadInviterInfo(distributionId: string) { + getRecruitInviter(distributionId).then((res) => { + if (res.data?.success) { + inviterInfo.value = res.data.result || null + } + }) +} + +function emptyProgress() { + return { + satisfied: false, + currentSelfPurchaseAmount: 0, + currentConsumeCount: 0, + purchaseGoodsSatisfied: false, + } +} + +function hasConditionalJoin(planData: any) { + if (!planData || planData.joinConditionType !== 'CONDITIONAL') return false + return !!(planData.requireSelfPurchaseAmount || planData.requireConsumeCount || planData.requirePurchaseGoods) +} + +function goLogin() { + // #ifdef MP-WEIXIN + uni.navigateTo({ url: '/pages/passport/wechatMPLogin' }) + // #endif + // #ifndef MP-WEIXIN + uni.navigateTo({ url: '/pages/passport/login' }) + // #endif +} + onShow(() => { loadPageData() }) @@ -265,10 +342,20 @@ function loadPageData() { submitApplicationStatus.value = '' formInfoCompleted.value = false Object.keys(fieldErrors).forEach((key) => delete fieldErrors[key]) - Promise.all([getRecruitPage(), getRecruitProgress()]) - .then(([pageRes, progressRes]) => { - pageInfo.value = pageRes.data?.result || {} - progress.value = progressRes.data?.result || null + const tasks: Promise[] = [getRecruitPage()] + if (isUserLoggedIn.value) { + tasks.push(getRecruitProgress()) + } + Promise.all(tasks) + .then((results) => { + const pageRes = results[0] + const pageResult = pageRes.data?.result || {} + pageInfo.value = pageResult + if (results.length > 1) { + progress.value = results[1].data?.result || emptyProgress() + } else { + progress.value = hasConditionalJoin(pageResult.plan) ? emptyProgress() : { satisfied: true } + } }) .finally(() => { loading.value = false @@ -401,6 +488,50 @@ function submit() { font-size: 28rpx; } +.inviter-header { + display: flex; + align-items: center; + background: #fff; + border-radius: 16rpx; + padding: 28rpx; + margin-bottom: 24rpx; +} + +.inviter-avatar { + width: 96rpx; + height: 96rpx; + border-radius: 50%; + background: #f5f5f5; + margin-right: 24rpx; + flex-shrink: 0; +} + +.inviter-meta { + flex: 1; + min-width: 0; +} + +.inviter-label { + font-size: 24rpx; + color: #999; + margin-bottom: 8rpx; +} + +.inviter-name { + font-size: 32rpx; + font-weight: 600; + color: #222; + line-height: 1.4; +} + +.login-tip { + font-size: 26rpx; + color: #666; + text-align: center; + margin-bottom: 24rpx; + line-height: 1.5; +} + .section { background: #fff; border-radius: 16rpx; diff --git a/pages/mine/distribution/poster.vue b/pages/mine/distribution/poster.vue index 3b720e2..dcaabc5 100644 --- a/pages/mine/distribution/poster.vue +++ b/pages/mine/distribution/poster.vue @@ -9,74 +9,72 @@ 重新加载 - - - - - - {{ posterContext.memberName || '分销员' }} - - - {{ posterContext.slogan }} - - - - {{ qrLoadingText }} - - - {{ qrError }} - 重新生成 - - - + + + 长按保存分享 + + - + + + + + + - 长按图片保存海报 - - 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/order/myOrder.vue b/pages/order/myOrder.vue index ebd6cd7..06a7b22 100644 --- a/pages/order/myOrder.vue +++ b/pages/order/myOrder.vue @@ -292,18 +292,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/product/goods.vue b/pages/product/goods.vue index 34b3fe9..adfcb4a 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -319,6 +319,7 @@ import { ref, reactive, computed, watch, nextTick, getCurrentInstance } from 'vu import { onLoad, onShow } from '@dcloudio/uni-app' import { getGoods, getGoodsList, getMpScene } from '@/api/goods.js' import { recordDistributionGoodsVisit } from '@/api/distribution.js' +import { tryBindDistribution } from '@/utils/distributionBind.js' import * as API_trade from '@/api/trade.js' import * as API_Members from '@/api/members.js' import * as API_store from '@/api/store.js' @@ -518,7 +519,10 @@ async function init(id: any, goodsId: any, distributionId = "", shareId = "") { } const distId = distributionId || store.state.distributionId - if (distId && goodsId && id) { + if (distId) { + await tryBindDistribution(distId) + } + if (distId && goodsId && id && storage.getAccessToken()) { recordDistributionGoodsVisit({ skuId: id, goodsId, diff --git a/utils/distributionBind.js b/utils/distributionBind.js new file mode 100644 index 0000000..add8060 --- /dev/null +++ b/utils/distributionBind.js @@ -0,0 +1,190 @@ +/** + * 分销海报 / 商品分享扫码绑客(统一入口) + */ +import storage from '@/utils/storage.js' +import store from '@/store' +import { getGoodsDistribution } from '@/api/distribution.js' +import { getMpScene } from '@/api/goods.js' + +const PENDING_KEY = 'pending_distribution_id' + +/** 本次冷启动内已尝试绑定的分销员 ID,避免重复请求 */ +const launchBoundIds = new Set() + +let flushing = false + +export function clearPendingDistributionId() { + try { + uni.removeStorageSync(PENDING_KEY) + } catch (e) { + // ignore + } +} + +export function setPendingDistributionId(distributionId) { + if (!distributionId) return + try { + uni.setStorageSync(PENDING_KEY, String(distributionId)) + } catch (e) { + console.warn('set pending distributionId failed', e) + } +} + +export function getPendingDistributionId() { + try { + return uni.getStorageSync(PENDING_KEY) || '' + } catch (e) { + return '' + } +} + +export function resetLaunchBindCache() { + launchBoundIds.clear() +} + +/** + * 解析葵花码 scene:支持 shortLinkId 或明文 bind,{distributionId} + */ +export async function resolveDistributionIdFromScene(scene) { + if (!scene) return '' + const raw = decodeURIComponent(String(scene)).trim() + if (!raw) return '' + + if (raw.startsWith('bind,')) { + const id = raw.split(',')[1] + return id ? String(id).trim() : '' + } + + try { + const res = await getMpScene(raw) + const params = res?.data?.success ? String(res.data.result || '').trim() : '' + if (params.startsWith('bind,')) { + const id = params.split(',')[1] + return id ? String(id).trim() : '' + } + } catch (error) { + console.warn('resolve distribution scene failed', error) + } + return '' +} + +function parseRecruitIdFromParams(params) { + if (!params) return '' + const text = String(params).trim() + if (text.startsWith('recruit_')) { + const id = text.substring('recruit_'.length) + return id ? String(id).trim() : '' + } + return '' +} + +/** + * 解析图文邀请卡 scene:支持 shortLinkId 或明文 recruit_{distributionId} + */ +export async function resolveRecruitDistributionIdFromScene(scene) { + if (!scene) return '' + const raw = decodeURIComponent(String(scene)).trim() + if (!raw) return '' + + const direct = parseRecruitIdFromParams(raw) + if (direct) return direct + + try { + const res = await getMpScene(raw) + const params = res?.data?.success ? String(res.data.result || '').trim() : '' + return parseRecruitIdFromParams(params) + } catch (error) { + console.warn('resolve recruit scene failed', error) + } + return '' +} + +const CLEAR_PENDING_CODES = new Set([22000, 22001]) + +function shouldClearPendingOnFailure(res) { + const code = res?.data?.code + if (code != null && CLEAR_PENDING_CODES.has(Number(code))) { + return true + } + const message = String(res?.data?.message || '') + if (message.includes('分销员不存在') || message.includes('分销功能关闭')) { + return true + } + return false +} + +/** + * 尝试绑定分销员:已登录直接请求;未登录写入 pending + */ +export async function tryBindDistribution(distributionId, options = {}) { + const id = String(distributionId || '').trim() + if (!id) return + + const force = options.force === true + if (!force && launchBoundIds.has(id)) { + return + } + launchBoundIds.add(id) + + if (!storage.getAccessToken()) { + setPendingDistributionId(id) + store.state.distributionId = id + return + } + + try { + const res = await getGoodsDistribution(id) + if (res?.data?.success) { + clearPendingDistributionId() + store.state.distributionId = id + return + } + if (shouldClearPendingOnFailure(res)) { + clearPendingDistributionId() + } + } catch (error) { + console.warn('bind distribution failed', error) + const res = error?.data ? error : error?.response?.data ? { data: error.response.data } : null + if (res && shouldClearPendingOnFailure(res)) { + clearPendingDistributionId() + } + } +} + +/** + * 登录成功后补绑 pending + */ +export async function flushPendingBind() { + if (flushing) return + const pendingId = getPendingDistributionId() + if (!pendingId || !storage.getAccessToken()) { + return + } + flushing = true + try { + launchBoundIds.delete(pendingId) + await tryBindDistribution(pendingId, { force: true }) + } finally { + flushing = false + } +} + +/** + * App onLaunch:有 scene 则解析绑客;无 scene 清除 pending + */ +export async function handleAppLaunchScene(options) { + resetLaunchBindCache() + + const scene = options?.query?.scene + if (!scene) { + clearPendingDistributionId() + return + } + + const distributionId = await resolveDistributionIdFromScene(scene) + if (!distributionId) { + return + } + + await tryBindDistribution(distributionId) +} diff --git a/utils/distributionPosterCanvas.ts b/utils/distributionPosterCanvas.ts new file mode 100644 index 0000000..658b534 --- /dev/null +++ b/utils/distributionPosterCanvas.ts @@ -0,0 +1,289 @@ +import { nextTick } from 'vue' +import DrawPoster from '@/js_sdk/u-draw-poster' + +export const POSTER_WIDTH = 630 +export const POSTER_HEIGHT = 1000 + +const QR_SIZE = 180 +const AVATAR_SIZE = 86 +const PADDING_H = 24 +const MEMBER_LEFT = PADDING_H + 16 +const BOTTOM_RATIO = 0.06 +const MEMBER_ROW_GAP = 12 +const NAME_FONT_SIZE = 30 +const SLOGAN_FONT_SIZE = 24 +const NAME_LINE_HEIGHT = 38 +const SLOGAN_LINE_HEIGHT = 32 + +// #ifdef MP-WEIXIN +const st2 = (size: number) => size * 2 +// #endif +// #ifndef MP-WEIXIN +const st2 = (size: number) => size +// #endif + +export interface DistributionPosterOptions { + backgroundImage?: string + memberAvatar?: string + memberName?: string + slogan?: string + qrImage: string + textColor?: string + showMemberInfo?: boolean +} + +function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)) +} + +export async function resolveImagePath(url: string) { + if (!url) { + throw new Error('图片地址无效') + } + if ( + url.startsWith('data:') || + url.startsWith('wxfile://') || + url.startsWith('http://tmp/') || + url.startsWith('https://tmp/') || + url.startsWith('file://') + ) { + return url + } + const res = await uni.downloadFile({ url }) + if (res.statusCode === 200 && res.tempFilePath) { + return res.tempFilePath + } + throw new Error('图片下载失败,请检查图片域名配置') +} + +function getImageInfo(src: string): Promise<{ width: number; height: number }> { + return new Promise((resolve, reject) => { + uni.getImageInfo({ + src, + success: (res) => resolve({ width: res.width, height: res.height }), + fail: reject, + }) + }) +} + +function calcCoverBox(imgW: number, imgH: number, boxW: number, boxH: number) { + const scale = Math.max(boxW / imgW, boxH / imgH) + const width = imgW * scale + const height = imgH * scale + return { + x: (boxW - width) / 2, + y: (boxH - height) / 2, + width, + height, + } +} + +export function clearDrawPosterCache(selector: string) { + const pages = getCurrentPages() + const page = pages[pages.length - 1] as any + if (!page) return + delete page[`#${selector}__dp`] + delete page[`${selector}__dp`] +} + +async function waitCanvasReady() { + await nextTick() + await sleep(150) +} + +async function drawCircleImage(ctx: any, src: string, x: number, y: number, size: number) { + const radius = size / 2 + const cx = x + radius + const cy = y + radius + ctx.save() + ctx.beginPath() + ctx.arc(st2(cx), st2(cy), st2(radius), 0, Math.PI * 2) + ctx.clip() + await ctx.drawImage(src, st2(x), st2(y), st2(size), st2(size)) + ctx.restore() + ctx.save() + ctx.strokeStyle = 'rgba(255, 255, 255, 0.9)' + ctx.lineWidth = st2(2) + ctx.beginPath() + ctx.arc(st2(cx), st2(cy), st2(radius - 1), 0, Math.PI * 2) + ctx.stroke() + ctx.restore() +} + +export async function composeDistributionPoster( + selector: string, + componentThis: any, + options: DistributionPosterOptions +): Promise { + const { + backgroundImage = '', + memberAvatar = '', + memberName = '分销员', + slogan = '', + qrImage, + textColor = '#1f2a44', + showMemberInfo = true, + } = options + + if (!qrImage) { + throw new Error('葵花码未生成') + } + + clearDrawPosterCache(selector) + await waitCanvasReady() + + const dp = await DrawPoster.build({ + selector, + componentThis, + loading: false, + debugging: false, + }) + + if (!dp?.canvas || !dp?.ctx) { + throw new Error('画布初始化失败,请重试') + } + + // #ifdef MP-WEIXIN + dp.canvas.width = st2(POSTER_WIDTH) + dp.canvas.height = st2(POSTER_HEIGHT) + // #endif + + const localQr = await resolveImagePath(qrImage) + let localBg = '' + if (backgroundImage) { + try { + localBg = await resolveImagePath(backgroundImage) + } catch (error) { + console.warn('poster background download failed', error) + } + } + let localAvatar = '' + if (showMemberInfo && memberAvatar) { + try { + localAvatar = await resolveImagePath(memberAvatar) + } catch (error) { + console.warn('poster avatar download failed', error) + } + } + + const bottomOffset = POSTER_HEIGHT * BOTTOM_RATIO + const rowBottom = POSTER_HEIGHT - bottomOffset + const qrX = POSTER_WIDTH - PADDING_H - QR_SIZE + const qrY = rowBottom - QR_SIZE + + await dp.draw((ctx: any) => { + ctx.fillStyle = '#ffffff' + ctx.fillRect(st2(0), st2(0), st2(POSTER_WIDTH), st2(POSTER_HEIGHT)) + }) + + if (localBg) { + await dp.draw(async (ctx: any) => { + const { width: imgW, height: imgH } = await getImageInfo(localBg) + const fit = calcCoverBox(imgW, imgH, POSTER_WIDTH, POSTER_HEIGHT) + await ctx.drawImage( + localBg, + st2(fit.x), + st2(fit.y), + st2(fit.width), + st2(fit.height) + ) + }) + } + + await dp.draw(async (ctx: any) => { + ctx.fillStyle = '#ffffff' + ctx.fillRoundRect(st2(qrX), st2(qrY), st2(QR_SIZE), st2(QR_SIZE), st2(12)) + await ctx.drawImage(localQr, st2(qrX), st2(qrY), st2(QR_SIZE), st2(QR_SIZE)) + }) + + if (showMemberInfo) { + await dp.draw(async (ctx: any) => { + const textMaxWidth = qrX - MEMBER_LEFT - 16 + const memberBlockHeight = + AVATAR_SIZE + + MEMBER_ROW_GAP + + NAME_LINE_HEIGHT + + (slogan ? MEMBER_ROW_GAP + SLOGAN_LINE_HEIGHT : 0) + const blockHeight = Math.max(memberBlockHeight, QR_SIZE) + const blockTop = rowBottom - blockHeight + + const avatarX = MEMBER_LEFT + const avatarY = blockTop + const nameY = avatarY + AVATAR_SIZE + MEMBER_ROW_GAP + const sloganY = nameY + NAME_LINE_HEIGHT + MEMBER_ROW_GAP + + if (localAvatar) { + await drawCircleImage(ctx, localAvatar, avatarX, avatarY, AVATAR_SIZE) + } else { + const radius = AVATAR_SIZE / 2 + ctx.save() + ctx.fillStyle = 'rgba(255, 255, 255, 0.3)' + ctx.beginPath() + ctx.arc(st2(avatarX + radius), st2(avatarY + radius), st2(radius), 0, Math.PI * 2) + ctx.fill() + ctx.strokeStyle = 'rgba(255, 255, 255, 0.9)' + ctx.lineWidth = st2(2) + ctx.stroke() + ctx.restore() + } + + ctx.textAlign = 'left' + ctx.textBaseline = 'top' + ctx.fillStyle = textColor + ctx.font = `bold ${st2(NAME_FONT_SIZE)}px PingFang SC` + ctx.fillWarpText({ + text: memberName, + maxWidth: st2(textMaxWidth), + x: st2(avatarX), + y: st2(nameY), + layer: 1, + lineHeight: st2(NAME_LINE_HEIGHT), + }) + + if (slogan) { + ctx.font = `${st2(SLOGAN_FONT_SIZE)}px PingFang SC` + ctx.fillWarpText({ + text: slogan, + maxWidth: st2(textMaxWidth), + x: st2(avatarX), + y: st2(sloganY), + layer: 1, + lineHeight: st2(SLOGAN_LINE_HEIGHT), + }) + } + }) + } + + const path = await dp.createImagePath() + if (!path || path === '---stop createImagePath---') { + throw new Error('海报图片导出失败') + } + return path +} + +export function savePosterToAlbum(filePath: string) { + if (!filePath) return + uni.saveImageToPhotosAlbum({ + filePath, + success: () => { + uni.showToast({ title: '已保存到相册', icon: 'none' }) + }, + fail: (err: any) => { + const errMsg = err?.errMsg || '' + if (errMsg.includes('auth deny') || errMsg.includes('authorize')) { + uni.showModal({ + title: '提示', + content: '需要您授权保存图片到相册', + confirmText: '去设置', + success: (modalRes) => { + if (modalRes.confirm) { + uni.openSetting({}) + } + }, + }) + return + } + uni.showToast({ title: '保存失败', icon: 'none' }) + }, + }) +} diff --git a/utils/storage.js b/utils/storage.js index 053390e..9004538 100644 --- a/utils/storage.js +++ b/utils/storage.js @@ -9,13 +9,13 @@ const FACE_LOGIN = isDev ? "face_login_dev" : "face_login"; const FINGER_LOGIN = isDev ? "finger_login_dev" : "finger_login"; const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn"; const AFTERSALE_DATA = isDev ? "aftersale_data_dev" : "aftersale_data"; -export default { - setInviter(val){ - uni.setStorageSync('inviter', val) - }, - getInviter(){ - return uni.getStorageSync('inviter'); - }, +export default { + setInviter(val){ + uni.setStorageSync('inviter', val) + }, + getInviter(){ + return uni.getStorageSync('inviter'); + }, //写入自动发券 setAutoCp(val){ @@ -84,6 +84,14 @@ export default { // 写入登录 setHasLogin(val) { uni.setStorageSync(HAS_LOGIN, val); + if (val) { + try { + const { flushPendingBind } = require("@/utils/distributionBind.js"); + flushPendingBind(); + } catch (e) { + // ignore + } + } }, // 获取是否登录 getHasLogin() { From 651d1106da2c3f39d955fe91f3d916ae08ad96b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com> Date: Thu, 13 Aug 2026 17:23:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?refactor(logistics):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=89=A9=E6=B5=81=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA=E4=B8=8E?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新物流详情页面,简化数据获取流程,增强用户体验。 - 优化订单详情页面,动态展示物流信息,支持不同配送状态。 - 新增配送工具函数,提升代码复用性与可读性。 - 调整样式以改善界面布局,确保信息清晰可读。 --- pages/mine/msgTips/packageMsg/index.vue | 6 +- .../msgTips/packageMsg/logisticsDetail.vue | 110 ++-- pages/order/deliverDetail.vue | 482 ++++++++++-------- pages/order/orderDetail.vue | 110 ++-- utils/orderDelivery.js | 47 ++ 5 files changed, 428 insertions(+), 327 deletions(-) create mode 100644 utils/orderDelivery.js diff --git a/pages/mine/msgTips/packageMsg/index.vue b/pages/mine/msgTips/packageMsg/index.vue index 7b0067a..260c48b 100644 --- a/pages/mine/msgTips/packageMsg/index.vue +++ b/pages/mine/msgTips/packageMsg/index.vue @@ -6,7 +6,7 @@
{{ formatSendTime(row.send_time) }}
- - - - {{ logisticsInfo.shipper }}快递 {{ logisticsInfo.logisticCode }} - - - - - - - - - - - + + 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/orderDetail.vue b/pages/order/orderDetail.vue index 8f7728b..3ad41e8 100644 --- a/pages/order/orderDetail.vue +++ b/pages/order/orderDetail.vue @@ -8,26 +8,24 @@ - - - + + 券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }} - - - 当前订单有 {{ orderPackage.length }} 个包裹快递 - -
- 点击此处查看 -
-
- - {{ '暂无物流信息' }} + + {{ deliveryEntryText }} +
点击此处查看
+
+ + 等待商家发货
-
@@ -131,7 +129,7 @@ 取消订单 - 查看物流 + 查看物流 查看拼团信息 立即付款 确认收货 store.getters.lightColor) @@ -279,7 +282,6 @@ const orderStatusMap: Record = { TAKE: { title: '待核验' }, } -const logisticsList = ref('') const shareFlag = ref(false) const order = ref>({}) const cancelShow = ref(false) @@ -290,7 +292,28 @@ const sn = ref('') const cancelList = ref([]) const rogShow = ref(false) const reason = ref('') -const orderPackage = ref('') +const orderPackage = ref([]) +const legacyTraces = ref(null) + +const allowOperation = computed(() => + getOrderAllowOperation(order.value, orderDetail.value) +) + +const showDeliveryInfoBlock = computed(() => { + 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() @@ -302,12 +325,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() { @@ -347,12 +385,6 @@ function goToShopPage(val: any) { }) } -function loadLogistics(orderSnParam: string) { - getExpress(orderSnParam).then((res) => { - logisticsList.value = res.data.result - }) -} - function inviteGroup() { shareFlag.value = true } @@ -371,15 +403,15 @@ 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 (order.value.deliveryMethod === 'LOGISTICS') { - loadLogistics(orderSnParam) - getOrderPackage() + if (!order.value.allowOperationVO && result.allowOperationVO) { + order.value.allowOperationVO = result.allowOperationVO } + await loadDelivery(order.value) hideLoadingIfNeeded() }) } @@ -482,18 +514,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/utils/orderDelivery.js b/utils/orderDelivery.js new file mode 100644 index 0000000..9ba1f0b --- /dev/null +++ b/utils/orderDelivery.js @@ -0,0 +1,47 @@ +/** + * 订单配送展示工具(整单 / 拆单 / 无需配送) + */ + +export function shouldLoadDelivery(order) { + return ( + order?.deliveryMethod === 'LOGISTICS' && + order?.allowOperationVO?.showLogistics === true + ) +} + +export function isNoDelivery(packageItem) { + return ( + packageItem?.fulfillmentMode === 'NO_DELIVERY' || + packageItem?.logisticsRequired === false + ) +} + +export function getPackageTitle(packageItem, index) { + if (isNoDelivery(packageItem)) return '无需配送' + if (packageItem?.fulfillmentMode === 'WHOLE') return '整单发货' + if (packageItem?.fulfillmentMode === 'SPLIT') return `包裹 ${index + 1}` + return `包裹 ${index + 1}` +} + +export function getDeliveryEntryText(packages, orderStatus, legacyTraces) { + if (packages?.length) { + const allNoDelivery = packages.every(isNoDelivery) + if (allNoDelivery) return '查看配送说明' + if (orderStatus === 'PARTS_DELIVERED') { + return `已发出 ${packages.length} 个包裹,剩余商品待发货` + } + return `共 ${packages.length} 个配送包裹` + } + + const traces = legacyTraces?.traces + if (Array.isArray(traces) && traces.length) { + const latest = traces[0] + return latest?.AcceptStation || '商家已发货,物流信息同步中' + } + + return '商家已发货,物流信息同步中' +} + +export function getOrderAllowOperation(order, orderDetail) { + return order?.allowOperationVO || orderDetail?.allowOperationVO || {} +}