Commit aee791e7 by liimin

Merge branch 'feature/rework' of http://192.168.3.233:8090/monorepo/venus into feature/rework

2 parents 2c2e8a33 c224b75d
Showing 398 changed files with 3763 additions and 485 deletions
......@@ -2,7 +2,8 @@
import { updateResolutionConfig } from "@/config/resolution-adapt/index.uts";
// #ifdef APP
import { layoutService } from "@/services/LayoutService.uts";
import { recordService } from "@/services/recorder";
import { lockOrientation } from "@/utils/plus-screen.uts";
// #endif
let firstBackTime = 0;
......@@ -11,24 +12,25 @@ export default {
onLaunch () {
// #ifdef APP
layoutService.init();
// uni.onWindowResize((res) => {
// updateResolutionConfig();
// });
const sys = uni.getSystemInfoSync();
console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`);
// pad/大屏锁定横屏,手机锁定竖屏
if (layoutService.isMode("pad") || layoutService.isMode("desktop")) {
lockOrientation("landscape-primary");
// 锁定后延迟刷新屏幕尺寸,此时已旋转为横屏,getSystemInfoSync() 会返回 1174x768
setTimeout(() => {
layoutService.refreshScreenInfo();
}, 400);
// 启动阶段多次重试锁定,避免首屏/框架稍后把方向改回竖屏(不做按页面锁定)
setTimeout(() => { lockOrientation("landscape-primary"); }, 600);
setTimeout(() => { lockOrientation("landscape-primary"); }, 1200);
} else {
lockOrientation("portrait-primary");
}
// #endif
console.log("App Launch");
setTimeout(() => {
// 模拟接待开始
console.log("Simulating reception start...");
recordService.startAudio();
// 模拟接待结束
console.log("Simulating reception end...");
setTimeout(() => {
recordService.stopAudio();
}, 10_000);
updateResolutionConfig();
}, 1000);
// 启动时仅做分辨率配置,避免后台定时器/录音模拟导致对象被长时间持有
updateResolutionConfig();
},
onShow () {
console.log("App Show");
......@@ -60,9 +62,24 @@ export default {
};
</script>
<style>
<style lang="scss">
/* 引入自定义 CSS 工具类 */
@import url("./common.css");
/* I18n 布局适配:横竖屏 + 分辨率 */
@import "./adapt/landscape/1080/home-frame.scss";
@import "./adapt/landscape/1920/home-frame.scss";
@import "./adapt/portrait/1080/home-frame.scss";
@import "./adapt/portrait/1920/home-frame.scss";
@import "./adapt/landscape/1080/boutique-index.scss";
@import "./adapt/landscape/1920/boutique-index.scss";
@import "./adapt/portrait/1080/boutique-index.scss";
@import "./adapt/portrait/1920/boutique-index.scss";
@import "./adapt/landscape/1080/login.scss";
@import "./adapt/landscape/1920/login.scss";
@import "./adapt/portrait/1080/login.scss";
@import "./adapt/portrait/1920/login.scss";
@import "./adapt/portrait/1080/account-items.scss";
@import "./adapt/portrait/1920/account-items.scss";
/* 全局默认样式 */
uni-page-body {
......
/* 精品页 横屏 1080 档位适配
* 目前主要依赖全局 spacing/font/radius 变量,这里预留结构,后续可按需补充页面级变量
*/
.mode-landscape.res-1080 {
/* 示例:可在此处为精品页单独定义变量,例如:
* --boutique-card-height: 200px;
*/
}
/* HomeFrame 横屏 1080 档位适配 */
.home-frame-container.mode-landscape.res-1080 {
/* 对应 layout-vars.uts 中 1024/1174 档的值 */
--l-content-left-width: 605px;
--l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
/* 登录选择账号页 横屏 1080 档位适配
* 通过 LayoutRoot 上的 .mode-landscape.res-1080 类控制,仅在横屏 1080 档时生效。
*/
.mode-landscape.res-1080 {
/* 示例:可根据登录页设计调整根容器
* .page-container {
* padding: 0 var(--l-spacing-lg);
* }
*/
}
/* 精品页 横屏 1920 档位适配(预留) */
.mode-landscape.res-1920 {
/* 示例:后续可在此定义 1920 档变量 */
}
/* HomeFrame 横屏 1920 档位适配 */
.home-frame-container.mode-landscape.res-1920 {
/* 对应 layout-vars.uts 中 1920 档的值 */
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
/* 登录选择账号页 横屏 1920 档位适配
* 大屏(如 1920 宽度)下,可在此增加更宽松的留白和布局。
*/
.mode-landscape.res-1920 {
/* 示例:后续按实际设计稿补充
* .page-container {
* max-width: 1600px;
* margin: 0 auto;
* }
*/
}
/* 账号选择页 竖屏 1080 档位适配
* 典型手机竖屏场景(如 360 x 800 等宽度归为 1080 档)。
* 通过 .account-page 避免影响其他页面。
*/
.mode-portrait.res-1080 .account-page {
.layout {
padding-top: 48px;
padding-bottom: 24px;
}
.content-box {
top: 120px;
bottom: 48px;
width: 94%;
border-radius: 16px;
}
.step-box {
transform: scale(0.9);
}
/* 竖屏下账号/门店列表:一行一个,撑满宽度 */
.box {
padding: 0 16px;
justify-content: flex-start;
}
.box .items {
width: 100%;
margin-bottom: 16px;
}
}
/* 精品页 竖屏 1080 档位适配
* 使用 LayoutRoot 提供的 mode/res class:
* - .mode-portrait.res-1080
* 可在此范围内定制精品页在竖屏手机上的布局与尺寸。
*/
.mode-portrait.res-1080 {
/* 精品首页竖屏下“开始接待”区域适配,降低高度避免图片拉伸感 */
.start {
height: 96px;
// padding-top: 24px;
}
}
/* HomeFrame 竖屏 1080 档位适配
* 注意:数值暂时复用横屏 1080 档,后续可根据你的竖屏设计稿单独调整
*/
.home-frame-container.mode-portrait.res-1080 {
--l-content-left-width: 605px;
--l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
/* 登录页 竖屏 1080 档位适配(如 360 x 800 等宽度归为 1080 档)
* 通过 .login-page 避免影响其他页面;仅在手机竖屏时生效。
*/
.mode-portrait.res-1080 .login-page {
.layout {
justify-content: flex-start;
align-items: stretch;
padding: 32px 24px;
}
.login {
align-items: stretch;
margin-top: 16px;
max-width: 320px;
margin-left: auto;
margin-right: auto;
}
.login .title {
font-size: 28px;
margin-bottom: 12px;
}
.login .sub-title {
font-size: 14px;
margin: 12px 0 20px;
}
.login .input {
width: 100%;
height: 48px;
border-radius: 24px;
margin-bottom: 16px;
}
.login .btn {
width: 100%;
height: 48px;
margin-top: 8px;
font-size: 18px;
}
.form-footer {
padding-left: 0;
margin-top: 16px;
}
.app-code {
bottom: 12px;
/* 手机端登录页 APP 编码:完全使用固定像素,不参与变量缩放 */
font-size: 10px !important;
line-height: 14px;
left: 50%;
transform: translateX(-50%) scale(0.85);
}
}
/* 账号选择页 竖屏 1920 档位适配(预留)
* 如后续有竖屏大屏需求,可在此补充。
*/
.mode-portrait.res-1920 .account-page {
}
/* 精品页 竖屏 1920 档位适配(预留)
* 当前大屏场景通常为横屏,此处作为扩展占位。
*/
.mode-portrait.res-1920 {
/* 根据后续竖屏大屏设计补充 */
}
/* HomeFrame 竖屏 1920 档位适配
* 注意:数值暂时复用横屏 1920 档,后续可根据你的竖屏设计稿单独调整
*/
.home-frame-container.mode-portrait.res-1920 {
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
/* 登录选择账号页 竖屏 1920 档位适配(预留)
* 如后续有竖屏大屏设备需求,可在此补充。
*/
.mode-portrait.res-1920 {
/* 预留占位,不影响现有布局 */
}
......@@ -20,3 +20,12 @@ export function getBoutiquePackageList(data: UTSJSONObject): Promise<any> {
...data
} as UTSJSONObject);
}
// 新历史订单列表
export function getOrderListPage(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.pad.api.history.order.page',
'projectName': 'pad',
...data
} as UTSJSONObject)
}
\ No newline at end of file
......@@ -4,9 +4,9 @@
import http from "@/api/request/http.uts";
/** 获取交付人员列表 */
export function getEmployeeList(data: UTSJSONObject): Promise<any> {
export function getEmployeeListApi(data: UTSJSONObject): Promise<any> {
return http.post({
"method": "dj.api.smartcarlife.employee.getByMerchantId",
"method": "dj.api.smartcarlife.employee.getByMerchantId.new",
"projectName": "boutique",
"sceneList": [0],
...data
......@@ -34,3 +34,14 @@ export function getCarBrandsListApi(data: UTSJSONObject): Promise<any> {
...data
} as UTSJSONObject, false, "scrm");
}
/**
* 查询门店支付配置
*/
export function findPayInfo(data: UTSJSONObject): Promise<any> {
return http.post({
method: "dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
projectName: "boutique",
...data
} as UTSJSONObject);
}
import http from '@/api/request/http.uts'
/**查询客户档案列表 */
export function getCustomerInfoListApi(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.api.smartcarlife.customervisits.customerInfoList',
'projectName': 'boutique',
...data
} as UTSJSONObject)
}
\ No newline at end of file
/**
* 环境配置(从 gl_tape 迁移)
* 0: ip 本地 1: dev 开发 2: uat 测试 3: prod 生产 4: beta 预发布
* 0: ip 本地 1: dev 开发 2: test 测试 3: prod 生产 4: beta 预发布
*/
const TARGET_OPTIONS = ["ip", "dev", "uat", "prod", "beta"];
const TARGET_OPTIONS = ["ip", "dev", "test", "prod", "beta"];
const TARGET_INDEX = 2;
// 为兼容 UTS 的限制,这里不再使用复杂的类型约束,统一用 UTSJSONObject
......@@ -18,7 +18,7 @@ const secretKeyMap: UTSJSONObject = {
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
}
},
uat: {
test: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
......@@ -41,7 +41,7 @@ const secretKeyMap: UTSJSONObject = {
const domainMap: UTSJSONObject = {
ip: "http://192.168.1.122:8292",
dev: "https://scrm.dev.glsx.com.cn",
uat: "https://scrm.test.glsx.com.cn",
test: "https://scrm.test.glsx.com.cn",
beta: "https://scrm.beta.glsx.com.cn",
prod: "https://scrm.glsx.com.cn"
};
......@@ -50,7 +50,7 @@ const evaluationDomainMap: UTSJSONObject = {
ip: "http://192.168.1.221:5003",
dev: "http://gsc.dev.glsx.com.cn",
beta: "https://gsc.beta.glsx.com.cn",
uat: "http://gsc.test.glsx.com.cn",
test: "http://gsc.test.glsx.com.cn",
prod: "https://gsc.glsx.com.cn",
pet: "https://cdptest.glsx.com.cn"
};
......@@ -59,7 +59,7 @@ const djDomainMap: UTSJSONObject = {
ip: "http://192.168.1.122:8292",
dev: "http://dj.dev.glsx.com.cn",
beta: "https://dj.beta.glsx.com.cn",
uat: "https://dj.test.glsx.com.cn",
test: "https://dj.test.glsx.com.cn",
prod: "https://dj.glsx.com.cn",
pet: "https://cdptest.glsx.com.cn"
};
......@@ -68,7 +68,7 @@ const merchantDomainMap: UTSJSONObject = {
ip: "http://rop-merchant.dev.glsx.com.cn",
dev: "http://rop-merchant.dev.glsx.com.cn",
beta: "https://rop-merchant.beta.glsx.com.cn",
uat: "https://rop-merchant.test.glsx.com.cn",
test: "https://rop-merchant.test.glsx.com.cn",
prod: "https://commodity.glsx.com.cn",
pet: ""
};
......@@ -76,7 +76,7 @@ const merchantDomainMap: UTSJSONObject = {
const djSecretKeyMap: UTSJSONObject = {
ip: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
dev: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
uat: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
test: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
beta: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
prod: { appKey: "d7ffc3346fc9a45bccaaa35300d59022", secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353" },
pet: { appKey: "d7ffc3346fc9a45bccaaa35300d59022", secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353" }
......@@ -97,7 +97,7 @@ const signSecretKeyMap: UTSJSONObject = {
pdfUrl:
"https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/testdev/8981c8ca-8b30-436e-bb17-82fb6a53a3c4%E4%BA%8C%E6%89%8B%E8%BD%A6%E8%BD%AC%E8%AE%A9%E5%8D%8F%E8%AE%AE.pdf"
},
uat: {
test: {
appKey: "App_PromoteBusiness",
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
carBasrUrl: "http://qcdidicb.glsx.com.cn/router",
......@@ -163,4 +163,4 @@ export const signSecretKey: SignSecretKeyItem = signSecretKeyMap[currentTarget]
export const pathEnum: UTSJSONObject = PATH_ENUM;
export const pathEnumExport: UTSJSONObject = PATH_ENUM;
// env 仅用于区分当前环境标签,这里直接按 TARGET_INDEX 映射为字符串
export const env: string = TARGET_INDEX == 3 ? "production" : TARGET_INDEX == 1 ? "develop" : "test";
export const env: string = TARGET_INDEX == 3 ? "production" : (TARGET_INDEX == 1 ? "develop" : "test");
......@@ -26,3 +26,82 @@ export async function searchRecordingEndTime(params: UTSJSONObject): Promise<str
// console.log("🚀 ~ getToken ~ d:", d)
return d as Promise<string>;
}
export async function getMerchantPerformance(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = {
projectName: 'boutique',
...params
}
return await http.fetch("dj.api.car.boutique.inspection.findMerchantPerformance", data, true, "dj")
}
/** 查询当前门店客户档案列表(预录列表) */
export async function getCustomerFileList(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = {
projectName: 'boutique',
...params
}
return await http.fetch("dj.api.smartcarlife.customervisits.customerInfoPage", data, true, "dj")
}
/**ҵ������ */
// getMerchantPerformance(data){
// return http.post({
// method: 'dj.api.car.boutique.inspection.findMerchantPerformance',
// projectName: 'boutique',
// ...data
// })
// },
// 传参
// {
// "merchantIdList": 44218339,
// "sceneType": 1,
// "startDate": "2026-03-01",
// "endDate": "2026-03-31",
// "hmzxFlag": 3
// }
// /** 查询接待记录列表 */
// getReceptionList(data) {
// return http.post({
// method: 'dj.api.smartcarlife.reception.customer.page',
// projectName: 'boutique',
// ...data
// })
// {
// "merchantId": 44218339,
// "pageNum": 1,
// "pageSize": 10,
// "reviewFlag": 0,
// "orderFinishFlag": 0,
// "bussinessType": 2
// }
/**查询当前门店客户档案列表 */
// getCustomerFileList (data) {
// return http.post({
// method: 'dj.api.smartcarlife.customervisits.customerInfoPage',
// projectName: 'boutique',
// ...data
// })
// },
// 预录列表传参
// {
// "pageNum": 1,
// "pageSize": 10,
// "receptionStatus": 1,
// "merchantId": 44218339,
// "bussinessScene": 2,
// "startTime": "2026-03-18 00:00:00",
// "endTime": "2026-03-18 23:59:59"
// }
// },
// /** 接待统计 */
// getReceptionStatistics(data) {
// return http.post({
// method: 'dj.api.smartcarlife.reception.customer.statistics',
// projectName: 'boutique',
// ...data
// })
// },
\ No newline at end of file
......@@ -97,7 +97,8 @@ class Request {
secret = djKey.secret as string;
}
const sessionId = storage.get("sessionId") as null | string;
const rawSessionId = storage.get("sessionId");
const sessionId = (rawSessionId != null && rawSessionId != "") ? `${rawSessionId}` : null;
let noSignAttr: string[] = [];
if (params.sessionId == null && sessionId != null && sessionId != "") {
......@@ -171,19 +172,29 @@ class Request {
const path = pathEnum[projectName] ?? "";
const requestData = this.getData(params, finalHostType);
// 手动序列化成 application/x-www-form-urlencoded 格式,避免 Android 原生层类型转换问题
const formPairs: string[] = [];
// Android 原生层对 data 类型敏感:传 string 可能触发 ClassCastException
// 改为传 UTSJSONObject(全 string 值),由框架序列化为 form-urlencoded
const formDataObj: UTSJSONObject = {};
for (const key in requestData) {
const val = requestData[key];
if (val != null) {
formPairs.push(`${key}=${encodeURIComponent(`${val}`)}`);
let valStr: string;
if (typeof val === "string") {
valStr = val;
} else if (typeof val === "number" || typeof val === "boolean") {
valStr = `${val}`;
} else {
valStr = JSON.stringify(val);
}
formDataObj[key] = valStr;
}
}
const formData = formPairs.join("&");
const hostUrl = HOST[finalHostType] as string;
const pathStr = (path != null && path != "") ? `${path}` : "";
const methodStr = (requestData.method != null && requestData.method != "") ? `${requestData.method}` : "";
uni.request({
url: `${hostUrl}${path}router?method=${requestData.method}`,
data: formData,
url: `${hostUrl}${pathStr}router?method=${methodStr}`,
data: formDataObj,
method: requestMethod,
header,
dataType: "json",
......@@ -218,9 +229,9 @@ class Request {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
uni.hideLoading();
if (currentPage.route != "pages/common/login") {
if (currentPage.route != "pages/common/login/index") {
uni.reLaunch({
url: "/pages/common/login"
url: "/pages/common/login/index"
});
}
} else {
......
......@@ -23,7 +23,6 @@ export function sign(params: UTSJSONObject, secret: string, noSignAttr: string[]
} as StringifyOptions;
const objStr = qsStringify(params, options);
console.log(objStr, "===");
// 2. split('&') 拆开
const objVal = objStr.split("&");
......
......@@ -91,9 +91,9 @@ export function gscPost(url: string, data: UTSJSONObject, config: GscPostConfig
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
uni.hideLoading();
if (currentPage.route != "pages/common/login") {
if (currentPage.route != "pages/common/login/index") {
uni.reLaunch({
url: "/pages/common/login"
url: "/pages/common/login/index"
});
}
reject(resData);
......
......@@ -6,7 +6,7 @@ import { env } from "@/api/env.uts";
import http from "@/api/request/http.uts";
import { storage } from "@/utils/storage.uts";
const ENV_STR = env == "production" ? "prod" : (env == "develop" ? "develop" : "uat");
const ENV_STR = env == "production" ? "prod" : (env == "develop" ? "develop" : "test");
const CONFIG_MODULE = "app-tape";
const BOUTIQUE_CONFIG_MODULE = "boutique-pad-config";
const CONFIG_BASE = "https://config-center-backend.glsx.com.cn/glsxAdmin/config";
......@@ -124,55 +124,59 @@ export async function getSoureData(
...params
});
if (res && res.id) {
console.log(res.id, "res.idres.idres.idres.id");
if (res != null && (res as UTSJSONObject).id != null) {
console.log((res as UTSJSONObject).id, "res.idres.idres.idres.id");
const data = await getEquityMaterialConfig({
id: res.id
id: (res as UTSJSONObject).id
});
if (data) {
let { toolList, materialInfoList } = data;
let storageName = `source_${sceneType}_${shopMerchantId}`;
if (params.brandId && params.subBrandId) {
storageName += `_${params.brandId}_${params.subBrandId}`;
if (data != null) {
const dataObj = data as UTSJSONObject;
const storageName = `source_${sceneType}_${shopMerchantId}`;
let toolList: Array<any> = [];
if (dataObj.toolList != null) {
toolList = dataObj.toolList as Array<any>;
}
let materialInfoList: Array<any> = [];
if (dataObj.materialInfoList != null) {
materialInfoList = dataObj.materialInfoList as Array<any>;
}
const insurance = materialInfoList.find(e => e.componentName == "insurance");
const hasEquity = toolList.find(e => e.id == insurance?.id);
const insurance = (materialInfoList as Array<any>).find((e: any) => (e as UTSJSONObject).componentName == "insurance");
const hasEquity = (toolList as Array<any>).find((e: any) => (e as UTSJSONObject).id == (insurance as UTSJSONObject).id);
if (insurance && hasEquity) {
let configList;
if (insurance != null && hasEquity != null) {
let configList: Array<any> = [];
try {
configList = await findReceptionpriproConfigList({});
storage.set("findReceptionpriproConfigList", configList);
configList = await findReceptionpriproConfigList({}) as Array<any>;
storage.set("findReceptionpriproConfigList", configList, 0);
} catch {
configList = storage.get("findReceptionpriproConfigList");
configList = storage.get("findReceptionpriproConfigList") as Array<any>;
}
const toolOtherList = configList.map(i => {
const toolOtherList = (configList as Array<any>).map((i: any) => {
return {
id: hasEquity.id + 100 + i.id,
shortTitle: i.productName,
shortTitleUrl: i.procuctLog
id: ((hasEquity as UTSJSONObject).id as number) + 100 + ((i as UTSJSONObject).id as number),
shortTitle: (i as UTSJSONObject).productName,
shortTitleUrl: (i as UTSJSONObject).procuctLog
} as UTSJSONObject;
});
toolList = toolList.concat(toolOtherList);
const moduleOtherList = configList.map(i => {
const moduleOtherList = (configList as Array<any>).map((i: any) => {
return {
id: hasEquity.id + 100 + i.id,
title: i.productName,
shortTitleUrl: i.procuctLog,
productPoster: i.productPoster,
id: ((hasEquity as UTSJSONObject).id as number) + 100 + ((i as UTSJSONObject).id as number),
title: (i as UTSJSONObject).productName,
shortTitleUrl: (i as UTSJSONObject).procuctLog,
productPoster: (i as UTSJSONObject).productPoster,
showAlt: false,
componentName: "CaseCenter",
receptionpriproCusCaseList: i.receptionpriproCusCaseList,
receptionpriproCusCaseList: (i as UTSJSONObject).receptionpriproCusCaseList,
hide: true,
detailTitle: i.productName,
detailTitle: (i as UTSJSONObject).productName,
thumbnail: "https://img02.glsx.com.cn/weapp/resource/app-tape/common/qsyw.webp"
} as UTSJSONObject;
});
......@@ -180,16 +184,16 @@ export async function getSoureData(
materialInfoList = materialInfoList.concat(moduleOtherList);
}
data.toolList = await imgTransformBase64(toolList, ["shortTitleUrl"]);
data.moduleList = await imgTransformBase64(materialInfoList, ["thumbnail", "receptionSourceDetailList", "screenList"]);
dataObj.toolList = await imgTransformBase64(toolList, ["shortTitleUrl"]);
dataObj.moduleList = await imgTransformBase64(materialInfoList, ["thumbnail", "receptionSourceDetailList", "screenList"]);
uni.setStorageSync(storageName, {
moduleList: data.moduleList,
toolList: data.toolList,
id: res.id
moduleList: dataObj.moduleList,
toolList: dataObj.toolList,
id: (res as UTSJSONObject).id
});
return data;
return dataObj;
} else {
throw new Error("获取数据失败");
}
......@@ -198,7 +202,7 @@ export async function getSoureData(
}
} catch (error) {
uni.hideLoading();
if (error) {
if (error != null) {
uni.showToast({
title: `${error}`,
icon: "none",
......@@ -210,46 +214,42 @@ export async function getSoureData(
}
/** 批量图片转 base64 */
async function imgTransformBase64(imgList: Array<any> = [], keyList: string[]): Promise<Array<any>> {
return await Promise.all(
imgList.map(async e => {
await Promise.all(
Object.keys(e).map(async key => {
if (keyList.includes(key)) {
const isArray = Array.isArray(e[key]);
async function imgTransformBase64(imgList: Array<any>= [], keyList: string[]): Promise<Array<any>> {
const result: Array<any> = [];
for (const e of imgList) {
const eObj = e as UTSJSONObject;
for (const key in eObj) {
if (keyList.includes(key)) {
const isArray = Array.isArray(eObj[key]);
if (isArray) {
await Promise.all(
e[key].map(async i => {
await Promise.all(
Object.keys(i).map(async k => {
if (k == "detailUrl" && i[k]) {
i[k] = await getBase64(i[k]);
}
})
);
})
);
} else {
if (typeof e[key] === "string" && e[key]) {
e[key] = await getBase64(e[key]);
if (isArray) {
const arr = eObj[key] as Array<any>;
for (const item of arr) {
const itemObj = item as UTSJSONObject;
for (const k in itemObj) {
if (k == "detailUrl" && itemObj[k] != null) {
itemObj[k] = await getBase64(itemObj[k] as string);
}
if (e[key] && typeof e[key] === "object") {
await Promise.all(
Object.keys(e[key]).map(async k => {
if (e[key][k]) {
e[key][k] = await getBase64(e[key][k]);
}
})
);
}
}
} else {
if (typeof eObj[key] === "string" && eObj[key] != null) {
eObj[key] = await getBase64(eObj[key] as string);
}
if (eObj[key] != null && typeof eObj[key] === "object") {
const nestedObj = eObj[key] as UTSJSONObject;
for (const k in nestedObj) {
if (nestedObj[k] != null) {
nestedObj[k] = await getBase64(nestedObj[k] as string);
}
}
}
})
);
return e;
})
);
}
}
}
result.push(e);
}
return result;
}
/** 转 base64 */
......@@ -260,10 +260,31 @@ async function getBase64(url: string): Promise<string> {
method: "GET",
responseType: "arraybuffer",
success: res => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data as ArrayBuffer)}`;
resolve(base64);
try {
const data: any | null = res.data;
let base64: string;
if (data == null) {
console.warn("res.data is null or undefined");
resolve(url);
return;
}
if (typeof data === "string") {
base64 = `data:image/png;base64,${data}`;
} else {
base64 = `data:image/png;base64,${uni.arrayBufferToBase64(data as ArrayBuffer)}`;
}
console.log("转换后的 base64:", `${base64.slice(0, 50) }...`);
resolve(base64);
} catch (error) {
console.error("转换 base64 失败:", error, "res.data:", res.data);
resolve(url);
}
},
fail: err => {
console.error("请求失败:", err);
resolve(url);
}
});
......
......@@ -52,11 +52,13 @@ export async function apiSelectAccountLogin(params: UTSJSONObject): Promise<UTSJ
// 获取园区店下的4S店:dj.api.scenemerchantref.query4SRefByYqShopByLogin
export async function apiGetSceneMerchantRefStoreList(params: UTSJSONObject): Promise<any> {
console.log("🚀 ~ 取园区店下的4S店 ~ params:", params)
const data: UTSJSONObject = {
projectName: 'boutique',
method: 'dj.api.scenemerchantref.query4SRefByYqShopByLogin',
...params
}
console.log("🚀 ~ 取园区店下的4S店 ~ params:", data)
return await http.post(data, true, 'dj', null)
}
......@@ -89,3 +91,15 @@ export async function apiGetMerchantBrand(params: UTSJSONObject): Promise<any> {
}
return await http.post(data, true, 'dj', null)
}
/**
* 查询门店保险权益
*/
export function getMerchantInsuranceListApi(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.api.smartcarlife.recepiton.findMerchantItem',
'projectName': 'boutique',
...data
} as UTSJSONObject)
}
......@@ -23,6 +23,9 @@
--l-radius-lg: 12px;
--l-radius-xl: 16px;
--l-radius-a : 100rpx;
/* 接待中心左右模块宽度(1173x768 基准),LayoutService 动态覆盖 */
--l-reception-left-width: 328px;
--l-reception-right-width: 677px;
}
/* ==================== 布局 ==================== */
......
<!-- 退出弹框 -->
<template>
<MessageBox :popupW="704" ref="finishRef" :content="finishContene" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else>
完成接待
<text>
(推荐)
</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text>
(不推荐)
</text>
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import MessageBox from './MessageBox.uvue'
import { ComponentPublicInstance } from 'vue'
const props = defineProps({
finishDoneText: String,
finishContene: {
type: String,
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
})
const finishRef = ref(null)
function open(): void {
(finishRef.value as ComponentPublicInstance).$callMethod('open')
}
function hide(): void {
(finishRef.value as ComponentPublicInstance).$callMethod('close')
}
const emit = defineEmits(['openStep', 'backHome'])
defineExpose({ open, hide })
</script>
<style lang="scss">
.footer {
border-top: 2rpx solid #eff0f2;
font-weight: 600;
font-size: 32rpx;
margin-top: 48rpx;
.footer-btn {
justify-content: center;
margin: 16rpx auto 0;
flex-direction: row;
align-items: center;
}
.confirm {
width: 608rpx;
height: 80rpx;
background: #2c66f7;
border-radius: 40rpx;
color: #fff;
}
.cancel {
width: 608rpx;
height: 80rpx;
background: #ffffff00;
border-radius: 40rpx;
color: #2c66f7;
}
text {
font-size: 24rpx;
}
}
</style>
\ No newline at end of file
......@@ -91,8 +91,8 @@ defineExpose({
.popup-box {
width: 700px;
max-height: 80vh;
min-height: 32vh;
max-height: 80%;
min-height: 32%;
background: #ffffff;
border-radius: var(--l-radius-xl);
overflow: hidden;
......
<template>
<view
v-if="showMask"
class="custom-popup-mask"
:class="{ 'mask-visible': isAnimated }"
@click="handleMaskClick"
>
<view
class="custom-popup-content"
:class="[`popup-${positionClass}`, { 'content-visible': isAnimated }]"
@click.stop
>
<slot>
</slot>
</view>
</view>
</template>
<script setup lang="uts">
const props = defineProps({
visible: {
type: Boolean,
default: false
},
position: {
type: String,
default: "center"
},
maskClosable: {
type: Boolean,
default: true
},
duration: {
type: Number,
default: 300
}
})
const emit = defineEmits(['update:visible', 'close', 'mask-click', 'opened', 'closed'])
function close(): void {
emit('update:visible', false)
emit('close')
}
function open(): void {
emit('update:visible', true)
}
function handleMaskClick(): void {
emit('mask-click')
if (props.maskClosable) {
close()
}
}
const showMask = ref<boolean>(props.visible)
const isAnimated = ref<boolean>(false)
let closeTimer: any | null = null
let openTimer: any | null = null
const positionClass = computed<string>(() => {
const positionMap: UTSJSONObject = {
'top': 'top',
'center': 'center',
'bottom': 'bottom',
'left': 'left',
'right': 'right'
} as UTSJSONObject
const mappedValue = positionMap[props.position] as string | null
if (mappedValue == null) {
return 'center'
}
return mappedValue
})
watch(props.visible, (newVal: boolean) => {
if (newVal == true) {
// 打开流程
if (closeTimer != null) {
clearTimeout(closeTimer as number)
closeTimer = null
}
if (openTimer != null) {
clearTimeout(openTimer as number)
openTimer= null
}
showMask.value = true
isAnimated.value = false
// 等待 DOM 渲染后添加动画类
openTimer = setTimeout(() => {
isAnimated.value = true
}, 50)
// 动画完成后触发事件
setTimeout(() => {
emit('opened')
}, props.duration + 50)
} else {
// 关闭流程
if (openTimer != null) {
clearTimeout(openTimer as number)
openTimer = null
}
isAnimated.value = false
closeTimer= setTimeout(() => {
showMask.value = false
emit('closed')
}, props.duration)
}
}, { immediate: true })
defineExpose({ open, close })
</script>
<style scoped lang="scss">
.custom-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.3);
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
transition: opacity 0.3s ease;
&.mask-visible {
opacity: 1;
}
}
.custom-popup-content {
position: absolute;
max-height: 90%;
opacity: 0;
transform: scale(0.95);
transition: opacity 0.3s ease, transform 0.3s ease;
&.content-visible {
opacity: 1;
transform: scale(1);
}
&.popup-top {
top: 0;
left: 50%;
transform: translateY(-100%) translateX(-50%);
width: 100%;
border-bottom-left-radius: 20rpx;
border-bottom-right-radius: 20rpx;
&.content-visible {
transform: translateY(0) translateX(-50%);
}
}
&.popup-center {
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.95);
min-width: 600rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
&.content-visible {
transform: translate(-50%, -50%) scale(1);
}
}
&.popup-bottom {
bottom: 0;
left: 50%;
transform: translateY(100%) translateX(-50%);
width: 100%;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
&.content-visible {
transform: translateY(0) translateX(-50%);
}
}
&.popup-left {
top: 50%;
left: 0;
transform: translateX(-100%) translateY(-50%);
height: 100%;
max-width: 80%;
border-top-right-radius: 20rpx;
border-bottom-right-radius: 20rpx;
&.content-visible {
transform: translateX(0) translateY(-50%);
}
}
&.popup-right {
top: 50%;
right: 0;
transform: translateX(100%) translateY(-50%);
height: 100%;
max-width: 80%;
border-top-left-radius: 20rpx;
border-bottom-left-radius: 20rpx;
&.content-visible {
transform: translateX(0) translateY(-50%);
}
}
}
</style>
\ No newline at end of file
<template>
<view :class="['customer-box',{'is-show':showCustomerBox}]">
<view class="customer-title">
客户档案的记录
</view>
<scroll-view
scroll-y
class="scroll-box"
>
<template v-if="loading">
<view class="loading flex">
<uni-icons
type="refreshempty"
:size="46"
color="#3773F8"
class="icon"
>
</uni-icons>
</view>
</template>
<template v-else>
<template v-if="searchList.length">
<template v-for="(i,index) in searchList" :key="index">
<view
class="item flex"
hover-class="active"
@click="chooseItem(i)"
>
{{ `${showType == 'tel'?i.ownerPhone:i.ownerName}`}}
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<view class="icon">
</view>
未匹配到客户信息
</view>
</template>
</template>
</scroll-view>
</view>
</template>
<script setup lang="uts">
import { storage } from '@/utils/storage.uts'
import { state } from '@/store/index.uts'
import { getCustomerInfoListApi } from '@/api/customer-api.uts'
type CustomerInfo = UTSJSONObject
type UserInfo = UTSJSONObject
type SearchParams = {
merchantId: string
bussinessScene: number
ownerPhone?: string
ownerName?: string
}
const props = defineProps({
searchValue: String,
showType: String,
show: Boolean
})
const emit = defineEmits(['choose'])
const loading = ref<boolean>(true)
const searchList = ref<Array<CustomerInfo>>([])
const showCustomerBox = computed<boolean>(() => {
const searchValue = props.searchValue ?? ''
return props.show == true && (state.user?.haveCustomerAccess ?? false) && (searchValue !== '' && searchValue !== null)
})
async function getCustomerInfoList(val: string, type: string): Promise<void> {
try {
loading.value = true
const userInfo: UserInfo | null = storage.get("userInfo") as UTSJSONObject | null
const userInfoObj = userInfo ?? { shopMerchantId: '', sceneType: 0 }
const shopMerchantId = userInfoObj.shopMerchantId
const params: SearchParams = {
merchantId: shopMerchantId as String,
bussinessScene: userInfoObj.sceneType == 0 ? 1 : 2
}
if (type == 'tel') {
params.ownerPhone= val
} else {
params.ownerName = val
}
const result = await getCustomerInfoListApi(params as UTSJSONObject)
searchList.value = result as UTSArray<UTSJSONObject>
loading.value = false
} catch (error) {
loading.value = false
}
}
watch(showCustomerBox.value , (newVal: boolean) => {
if (newVal == true) {
getCustomerInfoList(props.searchValue ?? '', props.showType ?? '')
}
}, { immediate: true })
function chooseItem(item: CustomerInfo): void {
emit('choose', item)
}
</script>
<style scoped lang='scss'>
.customer-box {
position: absolute;
left: 0;
top: 88rpx;
width: 100%;
height: 352rpx;
background: #ffffff;
border-radius: 16rpx;
z-index: -1;
opacity: 0;
.customer-title {
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
padding: 16rpx 24rpx 8rpx;
}
.scroll-box {
height: calc(100% - 64rpx);
.loading {
width: 100%;
height: 100%;
justify-content: center;
.icon {
animation: rotate-loading 1s linear infinite;
}
}
.nothing {
width: 100%;
height: 100%;
font-size: 24rpx;
color: #c7ccd7;
flex-direction: column;
.icon {
margin-top: 52rpx;
width: 96rpx;
height: 96rpx;
/* background-image: url('@/assets/images/common/nothing.webp'); */
background-size: 100%;
}
}
.item {
width: 100%;
height: 48rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
padding-left: 24rpx;
margin-bottom: 8rpx;
}
.active {
background: #ecf1ff;
}
@keyframes rotate-loading {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.is-show {
z-index: 1;
opacity: 1;
}
</style>
\ No newline at end of file
<template>
<MessageBox
ref="employeeBoxVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="handleClose"
>
<view class="select-box">
<template v-for="(item, index) in employeeList" :key="index" >
<view
:class="['select-item',{ checked: (salesUuid as string) == (item as UTSJSONObject).uuid }]"
@click="handleSelect(item)"
>
{{ (item as UTSJSONObject).staffName }}
</view>
</template>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import { ref, computed, watch } from 'vue'
import MessageBox from './MessageBox.uvue'
import { state, dispatch } from '@/store/index.uts'
import { storage } from '@/utils/storage.uts'
import { getEmployeeListApi } from '@/api/common-api.uts'
import { ComponentPublicInstance } from 'vue'
type Props = {
title?: string
salesPropsUuid?: string
}
type UserInfo = UTSJSONObject
const props = withDefaults(defineProps<Props>(), {
title: '销售',
salesPropsUuid: ''
})
const emit = defineEmits(['close', 'select'])
const employeeBoxVisible = ref(null)
const watchStatus = computed(() => {
const status = state.user?.historyStatus
if (status == null) {
return false
} else if (status == 1) {
return true
} else {
return false
}
})
const updateView = ref<number>(Date.now())
const salesUuid = computed(() => {
const val1 = state.user.customerInfo.salesUuid
const val2 = props.salesPropsUuid
return val1 !== null && val1 !== '' ? val1 : val2
})
// const employeeList = computed(() => {
// return state.user.employeeList
// })
const employeeList = ref<Array<any>>([])
watch(updateView.value,()=>{
const list = storage.get("employeeList") as UTSArray<Any>
employeeList.value = list != null ? list : []
}, { immediate: true, deep: true })
function close(): void {
if (employeeBoxVisible.value != null) {
(employeeBoxVisible.value as ComponentPublicInstance).$callMethod('close')
}
}
watch(watchStatus.value, () => {
close()
}, { immediate: true })
function handleClose(): void {
emit('close')
}
function open(): void {
if (employeeBoxVisible.value != null) {
(employeeBoxVisible.value as ComponentPublicInstance).$callMethod('open')
}
const userInfo: UserInfo | null = storage.get("userInfo") as UTSJSONObject | null
if (userInfo == null) return
const shopMerchantId = userInfo.shopMerchantId
// 获取销售人员列表
getEmployeeListApi({ merchantId: shopMerchantId }).then((res: any) => {
const employeeList = res as Array<any>
dispatch('setEmployeeList', employeeList)
const listToStore = employeeList != null ? employeeList : []
storage.set('employeeList', listToStore, 0)
updateView.value = Date.now()
})
}
function handleSelect(item: any): void {
close()
emit('select', item)
}
defineExpose({ open, close })
</script>
<style scoped lang="scss">
.select-box {
margin: 40rpx 0;
display: flex;
flex-wrap: wrap;
overflow-y: scroll;
max-height: 800rpx;
padding-bottom: 60rpx;
flex-direction: row;
.select-item {
width: 48%;
/* width: 23.5%; */
margin-right: 2%;
margin-bottom: 32rpx;
text-align: center;
height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&:nth-child(4n) {
margin-right: 0;
}
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
<template>
<view class="entrance-box">
<view class="entrance-list">
<view
v-for="(item, index) in entranceList"
:key="index"
class="entrance-item"
@click="handleClick(item)"
>
<view class="entrance-icon" :style="{ backgroundColor: item.color }"></view>
<text class="entrance-name">{{ item.label }}</text>
</view>
<view class="entrance-box">
<view class="entrance-list">
<view v-for="(item, index) in entranceList"
:key="index"
class="entrance-item"
@click="handleClick(item)">
<!-- uView Next 图片图标:name 传图片路径(包含 /) -->
<un-icon class="entrance-icon"
:name="getIconUrl(item.icon)"
size="48" />
<text class="entrance-name">{{ item.label }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { computed } from 'vue'
import { computed } from "vue";
type EntranceItem = {
label: string
color: string
icon: string
label: string
}
const props = defineProps<{
sceneType?: number
}>()
}>();
defineEmits(['entranceClick'])
defineEmits(["entranceClick"]);
const entranceList = computed((): EntranceItem[] => {
const sceneType = props.sceneType ?? 1
if (sceneType == 1) {
return [
{ label: '驻店日报', color: '#7c4dff' },
{ label: '新建工单', color: '#4673ff' },
{ label: '战败下单', color: '#ff4747' },
{ label: '工单列表', color: '#ff8c00' },
{ label: '工资申诉', color: '#ffc107' }
]
}
if (sceneType == 0) {
return [
{ label: '驻店日报', color: '#7c4dff' },
{ label: '新建工单', color: '#4673ff' },
{ label: '权益提单', color: '#4caf50' },
{ label: '战败下单', color: '#ff4747' },
{ label: '工单列表', color: '#ff8c00' },
{ label: '工资申诉', color: '#ffc107' }
]
}
return [
{ label: '驻店日报', color: '#7c4dff' },
{ label: '新建工单', color: '#4673ff' },
{ label: '战败下单', color: '#ff4747' },
{ label: '工单列表', color: '#ff8c00' },
{ label: '工资申诉', color: '#ffc107' }
]
})
const sceneType = props.sceneType ?? 1;
if (sceneType === 1) {
// 轻改场景:对应老项目 icon-daily-report / icon-create-order / icon-defeat-order / icon-order-management / icon-wage-appeal
return [
{ label: "驻店日报", icon: "daily-report", color: "#7c4dff" },
{ label: "新建工单", icon: "create-order", color: "#4673ff" },
{ label: "战败下单", icon: "defeat-order", color: "#ff4747" },
{ label: "工单列表", icon: "order-management", color: "#ff8c00" },
{ label: "工资申诉", icon: "wage-appeal", color: "#ffc107" }
];
}
if (sceneType === 0) {
// 权益场景:在轻改基础上增加“权益提单” icon-equity-order
return [
{ label: "驻店日报", icon: "daily-report", color: "#7c4dff" },
{ label: "新建工单", icon: "create-order", color: "#4673ff" },
{ label: "权益提单", icon: "equity-order", color: "#4caf50" },
{ label: "战败下单", icon: "defeat-order", color: "#ff4747" },
{ label: "工单列表", icon: "order-management", color: "#ff8c00" },
{ label: "工资申诉", icon: "wage-appeal", color: "#ffc107" }
];
}
// 其它场景兜底:先复用轻改配置
return [
{ label: "驻店日报", icon: "daily-report", color: "#7c4dff" },
{ label: "新建工单", icon: "create-order", color: "#4673ff" },
{ label: "战败下单", icon: "defeat-order", color: "#ff4747" },
{ label: "工单列表", icon: "order-management", color: "#ff8c00" },
{ label: "工资申诉", icon: "wage-appeal", color: "#ffc107" }
];
});
function handleClick(_item: EntranceItem): void {
uni.showToast({ title: "敬请期待", icon: "none" });
}
function handleClick(item: EntranceItem): void {
uni.showToast({ title: '敬请期待', icon: 'none' })
function getIconUrl(icon: string): string {
// App 端需用相对路径,便于打包时基于当前文件解析并打入包内
if (icon === "daily-report") return "../static/images/boutique/tools/daily-report.png";
if (icon === "create-order") return "../static/images/boutique/tools/create-order.png";
if (icon === "equity-order") return "../static/images/boutique/tools/equity-order.png";
if (icon === "defeat-order") return "../static/images/boutique/tools/defeat-order.png";
if (icon === "order-management") return "../static/images/boutique/tools/order-management.png";
if (icon === "wage-appeal") return "../static/images/boutique/tools/wage-appeal.png";
return "../static/images/boutique/tools/daily-report.png";
}
</script>
......@@ -77,7 +93,7 @@ function handleClick(item: EntranceItem): void {
}
.entrance-item {
width: 80px;
width: 100px;
display: flex;
flex-direction: column;
align-items: center;
......@@ -92,8 +108,8 @@ function handleClick(item: EntranceItem): void {
}
.entrance-name {
font-size: var(--l-font-sm);
font-size: 12px;
color: #333;
margin-top: var(--l-spacing-xs);
margin-top: 6px;
}
</style>
<template>
<view class="left-side left-side-pad">
<!-- 横屏 / Pad:左侧竖向导航(头像 + 场景切换 + 设置) -->
<view v-if="!isPortraitMode"
class="left-side left-side-pad">
<image class="left-side-bg-img"
mode="aspectFill"
src="/static/images/home/left-bg.png" />
......@@ -13,10 +15,10 @@
<view v-for="(item, index) in tabs"
:key="index"
class="tab-item"
:class="[tabIndex == index ? 'tabActive' : '']"
:class="[currentTabIndex === index ? 'tabActive' : '']"
@click="onChangeTab(index)">
<view class="icon-box">
<view class="icon-placeholder" :class="[tabIndex == index ? 'icon-active' : '']"></view>
<view class="icon-placeholder" :class="[currentTabIndex === index ? 'icon-active' : '']"></view>
</view>
<text class="tab-label">{{ item.label }}</text>
</view>
......@@ -35,6 +37,25 @@
<SettingBox :visible="showSetting"
@update:visible="onSettingVisible" />
</view>
<!-- 竖屏手机:底部 TabBar,仅保留场景 Tab,不显示头像和底部两个按钮 -->
<view v-else
class="left-side left-side-portrait">
<view class="portrait-tabs-row">
<view v-for="(item, index) in tabs"
:key="index"
class="tab-item tab-item-inline"
:class="[currentTabIndex === index ? 'tabActive' : '']"
@click="onChangeTab(index)">
<view class="tab-icon-wrap">
<image class="tab-icon"
mode="aspectFit"
:src="getTabIconSrc(item.icon, currentTabIndex === index)" />
</view>
<text class="tab-label">{{ item.label }}</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
......@@ -61,6 +82,11 @@ const isPortraitMode = computed((): boolean => {
return props.isPortrait === true;
});
const currentTabIndex = computed((): number => {
const idx = props.tabIndex as null | number;
return idx != null ? idx : 0;
});
type SceneTypeItem = { describe: string; icon: string; title: string; }
function getSceneTypeItem(sceneId: number): null | SceneTypeItem {
......@@ -123,14 +149,33 @@ const sceneTypeIdList = computed((): number[] => {
return result;
});
const tabs = [
type TabItem = {
label: string;
icon: string;
name: string;
};
const tabs: TabItem[] = [
{ label: "首页", icon: "home", name: "HomeSlot" },
{ label: "接待中心", icon: "record", name: "ReceptionCenter" },
{ label: "学习中心", icon: "study", name: "StudyCenter" },
{ label: "场景集市", icon: "scene", name: "SceneMarket" },
{ label: "活动中心", icon: "activity", name: "ActivityCenter" }
// { label: "场景集市", icon: "scene", name: "SceneMarket" },
// { label: "活动中心", icon: "activity", name: "ActivityCenter" }
];
function getTabIconSrc(icon: string, active: boolean): string {
if (icon === "home") {
return active ? "/static/images/tabbar/home-active.png" : "/static/images/tabbar/home.png";
}
if (icon === "record") {
return active ? "/static/images/tabbar/record-active.png" : "/static/images/tabbar/record.png";
}
if (icon === "study") {
return active ? "/static/images/tabbar/study-active.png" : "/static/images/tabbar/study.png";
}
return "/static/images/tabbar/home.png";
}
const userName = computed((): string => {
const info = props.userInfo;
if (info == null) {
......@@ -234,6 +279,7 @@ function jumpPersonCenter(): void {
padding: var(--l-spacing-sm) var(--l-spacing-md);
min-height: 56px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
justify-content: center;
}
.portrait-top-row {
......@@ -255,6 +301,7 @@ function jumpPersonCenter(): void {
flex-direction: row;
align-items: center;
padding: 0 var(--l-spacing-sm);
justify-content: center;
}
.portrait-tabs-row .tab-item-inline {
......@@ -266,6 +313,19 @@ function jumpPersonCenter(): void {
color: #3773f8;
}
.tab-icon-wrap {
width: 24px;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.tab-icon {
width: 24px;
height: 24px;
}
.portrait-action {
flex-shrink: 0;
}
......@@ -299,7 +359,6 @@ function jumpPersonCenter(): void {
align-items: center;
box-sizing: border-box;
position: relative;
text-align: center;
}
.user-avatar {
......@@ -336,12 +395,11 @@ function jumpPersonCenter(): void {
}
.tab-item {
width: 52px; /* toRpx(104) / 2 */
width: 80px; /* toRpx(104) / 2 */
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 12.5px; /* toRpx(25) / 2 */
text-align: center;
}
.icon-box {
......@@ -368,6 +426,7 @@ function jumpPersonCenter(): void {
font-size: 13px; /* toRpx(26) / 2 */
color: #8a98b5;
margin-top: 6px; /* toRpx(12) / 2 */
text-align: center;
}
.tabActive .tab-label {
......@@ -388,6 +447,9 @@ function jumpPersonCenter(): void {
}
.tab-item-inline {
flex-direction: row;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
<template>
<view class="customer-flow-box">
<text class="customer-flow-title">门店客流情况</text>
<!-- uni-app x 不支持 background-image,用 image+overflow 模拟雪碧图;App 端不支持 calc/vmin 故用固定 px -->
<view class="sprite-icon icon-customer-flow">
<!-- <image class="sprite-img" src="/static/images/reception/bg-reception-flow.png" mode="scaleToFill" /> -->
</view>
<view class="deliveries flex flex-col">
<text class="label-text">累计交付数</text>
<view class="num-wrap">
<text class="num-text">{{ formattedNumber('cumulativeDeliveryCount') }}</text>
</view>
</view>
<view class="touchpoints flex flex-col">
<text class="label-text">实际触客数</text>
<view class="num-wrap">
<text class="num-text">{{ formattedNumber('actualContactCount') }}</text>
</view>
</view>
<view class="touchpoint-rate flex flex-col">
<text class="label-text">实际触客率</text>
<view class="num-wrap">
<text :class="['num-text rate-num', { 'rate-color': showRateColor }]">{{ formattedNumber('contactRate', '%') }}</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { computed } from "vue";
/** 页面数据:cumulativeDeliveryCount、actualContactCount、contactRate */
const props = withDefaults(
defineProps<{
pageData?: UTSJSONObject | null
dataShow?: boolean
}>(),
{
pageData: (): UTSJSONObject => ({}),
dataShow: true
}
);
/** 是否显示触客率高亮色(蓝色) */
const showRateColor = computed((): boolean => {
if (!props.dataShow) {
return false;
}
const pd = props.pageData;
if (pd == null) {
return false;
}
const val = pd["contactRate"];
if (val == null) {
return false;
}
const n = val as number;
return n > 0;
});
/** 格式化数字,无数据时返回 --(与原文一致:0 视为无数据) */
function formattedNumber(key: string, unit: string | null = null): string {
const pd = props.pageData;
const ds = props.dataShow;
if (pd == null || !ds) {
return "--";
}
const val = pd[key];
if (val == null || val == 0 || val == "") {
return "--";
}
let str = "" + val;
if (unit != null && unit != "") {
str = str + unit;
}
return str;
}
</script>
<style scoped lang="scss">
/* 门店客流 - 基准 211px,随父级 flex 比例自适应 */
.customer-flow-box {
position: relative;
width: 100%;
height: 100%;
min-height: 0;
color: #333333;
background-color: #ffffff;
border-radius: 16px;
}
.customer-flow-title {
position: relative;
z-index: 1;
font-size: 14px;
font-weight: 400;
padding: 12px 16px 0;
}
/* 雪碧图布局:宽高 100% 填满父级 */
.sprite-icon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 16px;
overflow: hidden;
}
.icon-customer-flow .sprite-img {
width: 100%;
height: 100%;
}
.deliveries,
.touchpoints,
.touchpoint-rate {
position: absolute;
font-size: 10px;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
.label-text {
font-size: 10px;
color: inherit;
}
.deliveries,
.touchpoints {
color: #ffffff;
width: 200px;
height: 64px;
left: 16px;
justify-content: center;
align-items: center;
}
.deliveries .num-text,
.touchpoints .num-text {
font-size: 12px;
font-weight: 400;
color: #ffffff;
text-align: center;
}
.deliveries .label-text,
.touchpoints .label-text {
color: #ffffff;
text-align: center;
}
/* 基准 211px 下 54/118/104px,用百分比适配高度变化 */
.deliveries {
top: 25.6%;
padding-top: 0;
}
.touchpoints {
top: 55.9%;
padding-top: 0;
}
.touchpoint-rate {
top: 49.3%;
left: 64.6%;
}
.touchpoint-rate .num-text {
font-size: 14px;
font-weight: bold;
color: #333333;
transition: all 0.15s;
}
.touchpoint-rate .rate-color {
color: #4673ff;
}
</style>
<template>
<MessageBox
ref="customerTagstVisible"
position="bottom"
:isFooter="false"
:title="title"
:maxHeight="1040"
@close="emit('close')"
>
<view class="select-views">
<template v-for="(i, index) in list" :key="index">
<view class="select-group">
<view class="select-title">
<text class="select-title-text">{{ getLabelName(i) }}</text>
</view>
<view class="select-box">
<view
v-for="(item, ind) in getNextList(i)"
:key="ind"
class="select-item"
:class="{ checked: checkedItem(item) }"
@click="handleSelect(item)"
>
<view class="sprite-icon icon-tag-checked"></view>
<text class="select-item-text">{{ getLabelName(item) }}</text>
</view>
</view>
</view>
</template>
</view>
<view class="footer-btns">
<view class="btn cancel" @click="clearSwitch ? clear() : close()">
<text class="btn-text cancel-text">{{ cancelText }}</text>
</view>
<view :class="['btn', { disabled: disabled }]" @click="choose">
<text class="btn-text">确定</text>
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import { computed, ref, watch } from "vue";
import { state } from "@/store/index.uts";
type MessageBoxRef = {
open: () => void;
close: () => void;
};
const props = defineProps({
chooseList: Array,
title: {
type: String,
default: "请选择客户标签",
},
disabledSwitch: {
type: Boolean,
default: true,
},
cancelText: {
type: String,
default: "取消",
},
clearSwitch: {
type: Boolean,
default: false,
},
sceneNumber: {
type: [Number, String],
default: -1,
},
});
const emit = defineEmits(["close", "select"]);
const customerTagstVisible = ref<MessageBoxRef | null>(null);
const list = ref<UTSJSONObject[]>([]);
const componentChooseList = ref<UTSJSONObject[]>([]);
const watchStatus = computed(() => {
return state.user.historyStatus;
});
const disabled = computed((): boolean => {
return props.disabledSwitch && componentChooseList.value.length == 0;
});
function cloneChooseList(source: any | null): UTSJSONObject[] {
if (source == null || !(source instanceof Array)) {
return [];
}
const sourceList = source as Array<any>;
const result: UTSJSONObject[] = [];
let i = 0;
while (i < sourceList.length) {
const itemAny = sourceList[i];
if (itemAny != null) {
result.push(itemAny as UTSJSONObject);
}
i++;
}
return result;
}
/** 从父级标签对象中安全取出 nextList,保证 v-for 的 source 为 UTSArray 类型,避免 renderList 重载匹配失败 */
function getNextList(parent: UTSJSONObject): UTSJSONObject[] {
const raw = parent["nextList"];
if (raw == null || !(raw instanceof Array)) {
return [];
}
const arr = raw as Array<any>;
const result: UTSJSONObject[] = [];
let idx = 0;
while (idx < arr.length) {
const it = arr[idx];
if (it != null) {
result.push(it as UTSJSONObject);
}
idx++;
}
return result;
}
function getLabelName(target: any): string {
if (target == null) {
return "";
}
const obj = target as UTSJSONObject;
const v = obj["labelName"];
return v != null ? `${v}` : "";
}
function getLabelId(target: any): string {
if (target == null) {
return "";
}
const obj = target as UTSJSONObject;
const labelIdAny = obj["labelId"];
return labelIdAny != null ? `${labelIdAny}` : "";
}
function findChooseIndex(item: any): number {
const targetId = getLabelId(item);
let i = 0;
while (i < componentChooseList.value.length) {
const currentId = getLabelId(componentChooseList.value[i]);
if (currentId == targetId) {
return i;
}
i++;
}
return -1;
}
const close = (): void => {
const popupRef = customerTagstVisible.value;
if (popupRef != null) {
popupRef.close();
}
};
const watchStatusGetter = (): any => {
return watchStatus.value;
};
const chooseListGetter = (): any | null => {
return props.chooseList as any | null;
};
watch(
watchStatusGetter,
(_newVal: any) => {
close();
},
{ immediate: true }
);
watch(
chooseListGetter,
(newVal: any | null) => {
componentChooseList.value = cloneChooseList(newVal);
},
{ immediate: true }
);
function open(): void {
const popupRef = customerTagstVisible.value;
if (popupRef != null) {
popupRef.open();
}
const sceneNumberText = `${props.sceneNumber}`;
const requestScene = sceneNumberText != "-1" ? sceneNumberText : "";
// TODO:uni.$storage 与 uni.$api 在当前 UTS 环境未接入,先注释真实请求,避免编译 error18
// 需要接入接口时,可在公共请求封装中补充 UTS 版本的 storage 与 customerApi,再恢复下面逻辑
list.value = [];
/*
const userInfoAny = uni.$storage.get("userInfo");
let sceneTypeText = "";
if (userInfoAny != null) {
const userInfoObj = userInfoAny as UTSJSONObject;
const sceneTypeAny = userInfoObj["sceneType"];
sceneTypeText = sceneTypeAny != null ? `${sceneTypeAny}` : "";
}
const sceneNumberText = `${props.sceneNumber}`;
const requestScene = sceneNumberText != "-1" ? sceneNumberText : sceneTypeText;
uni.$api.customerApi
.findCustomerTags({
scene: requestScene,
})
.then((res: any | null) => {
if (res != null && res instanceof Array) {
list.value = res as UTSJSONObject[];
} else {
list.value = [];
}
})
.catch((_err: any) => {
list.value = [];
});
*/
}
function handleSelect(item: any): void {
const index = findChooseIndex(item);
if (index == -1) {
componentChooseList.value.push(item as UTSJSONObject);
} else {
componentChooseList.value.splice(index, 1);
}
}
function checkedItem(item: any): boolean {
return findChooseIndex(item) != -1;
}
function choose(): void {
if (disabled.value) {
return;
}
emit("select", componentChooseList.value);
close();
}
function clear(): void {
componentChooseList.value = [];
}
defineExpose({
open,
close,
clear,
});
</script>
<style scoped lang="scss">
.select-views {
overflow-y: scroll;
max-height: 520px;
position: relative;
padding-bottom: 64px;
flex-direction: column;
}
.select-group {
margin: 16px 0;
flex-direction: column;
}
.select-title {
margin-bottom: 5px;
}
.select-title-text {
font-size: 14px;
color: #999999;
}
.select-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.select-item {
width: 24%;
min-height: 35px;
margin-bottom: 16px;
opacity: 1;
border: 1px solid #dce0e6;
border-radius: 4px;
position: relative;
box-sizing: border-box;
padding: 7px 20px;
display: flex;
align-items: center;
justify-content: center;
}
.select-item .sprite-icon {
display: none;
position: absolute;
right: -1px;
top: -1px;
}
.select-item-text {
font-size: 16px;
color: #333333;
word-break: break-all;
line-height: 22px;
text-align: center;
}
.checked {
border: 1px solid #2c66f7;
background: #ecf1ff;
}
.checked .sprite-icon {
display: block;
}
.checked .select-item-text {
color: #2c66f7;
}
.footer-btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 88px;
background: #ffffff;
box-sizing: border-box;
padding-top: 16px;
display: flex;
justify-content: center;
}
.btn {
width: 359px;
height: 40px;
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.btn-text {
font-weight: 700;
font-size: 16px;
color: #ffffff;
text-align: center;
}
.cancel {
margin-right: 17px;
background: #dae9ff;
}
.cancel-text {
color: #2c66f7;
}
.disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
}
</style>
\ No newline at end of file
<template>
<un-popup
:show="props.show"
mode="right"
:width="popupSize.w"
:height="popupSize.h"
closeable
closeOnClickOverlay
safeAreaInsetBottom
safeAreaInsetTop
:customStyle="{ overflow: 'hidden', boxSizing: 'border-box' }"
@close="handleClose"
@open="onPopupOpen"
>
<view class="form-detail-wrap">
<view class="form-detail-header">
<text class="form-detail-title">客户档案</text>
</view>
<scroll-view class="form-detail-scroll" scroll-y="true">
<view class="form-detail-body">
<view class="form-row">
<text class="form-label">姓名</text>
<text class="form-value">{{ displayName }}</text>
</view>
<view class="form-row">
<text class="form-label">电话</text>
<text class="form-value">{{ displayPhone }}</text>
</view>
<view class="form-row">
<text class="form-label">品牌车型</text>
<text class="form-value">{{ displayBrandModel }}</text>
</view>
<view class="form-row">
<text class="form-label">接待场景</text>
<text class="form-value">{{ displayReceptionScenario }}</text>
</view>
<view class="form-row">
<text class="form-label">到店日期</text>
<text class="form-value">{{ displayVisitDate }}</text>
</view>
<view class="form-row">
<text class="form-label">客户标签</text>
<text class="form-value">{{ displayCustomerTags }}</text>
</view>
</view>
<!-- <view class="form-detail-goods">
<text class="form-detail-goods-title">商品套餐</text>
<un-empty
mode="data"
text="数据为空"
icon="http://cdn.uviewui.com/uview/empty/car.png"
/>
</view> -->
</scroll-view>
</view>
</un-popup>
</template>
<script setup lang="uts">
import { ref, computed, onMounted } from 'vue'
type PopupSize = { w: string; h: string }
function getPopupSize(): PopupSize {
const info = uni.getWindowInfo()
const w = info.windowWidth > 0 ? info.windowWidth : info.screenWidth
const h = info.windowHeight > 0 ? info.windowHeight : info.screenHeight
return { w: w + 'px', h: h + 'px' }
}
const props = withDefaults(
defineProps<{
show?: boolean
/** 详情数据,支持 ownerName/name、ownerPhone/phone、brandModel、receptionScenario、arrivalDate/arrivalTime、customerTags */
detail?: UTSJSONObject | null
}>(),
{ show: false, detail: null }
)
const popupSize = ref<PopupSize>({ w: '375px', h: '667px' })
onMounted(() => {
popupSize.value = getPopupSize()
})
function onPopupOpen(): void {
popupSize.value = getPopupSize()
}
const emit = defineEmits<{
'close': []
}>()
function getStr(data: UTSJSONObject | null, key: string): string {
if (data == null) { return '' }
const v = data[key]
if (v == null) { return '' }
return `${v}`
}
function getTs(data: UTSJSONObject | null, key: string): number | null {
if (data == null) { return null }
const v = data[key]
if (v == null) { return null }
if (typeof v == 'number') { return v }
const n = parseFloat(`${v}`)
return isNaN(n) ? null : n
}
// 格式化手机号:13001365398 -> 130 0136 5398
function formatPhone(phone: string): string {
if (phone == null || phone == '') { return '' }
const s = phone.replace(/\s/g, '')
if (s.length >= 11) {
return s.substring(0, 3) + ' ' + s.substring(3, 7) + ' ' + s.substring(7, 11)
}
return phone
}
// 格式化到店日期:支持 arrivalDate(YYYY-MM-DD) 或 arrivalTime(时间戳)
function formatVisitDate(d: UTSJSONObject | null): string {
if (d == null) { return '' }
const dateStr = getStr(d, 'arrivalDate')
if (dateStr != null && dateStr != '') {
return dateStr
}
const ts = getTs(d, 'arrivalTime')
if (ts == null || ts <= 0) { return '' }
const date = new Date(ts)
const y = date.getFullYear()
const m = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${y}-${m}-${day}`
}
// 空值显示为 "-"
function orPlaceholder(val: string): string {
return (val != null && val != '') ? val : '-'
}
const displayName = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
const v = getStr(d, 'ownerName')
if (v != '') { return v }
return orPlaceholder(getStr(d, 'name'))
})
const displayPhone = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
const raw = getStr(d, 'ownerPhone')
if (raw != '') { return formatPhone(raw) }
const raw2 = getStr(d, 'phone')
return orPlaceholder(formatPhone(raw2))
})
const displayBrandModel = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
return orPlaceholder(getStr(d, 'brandModel'))
})
const displayReceptionScenario = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
return orPlaceholder(getStr(d, 'receptionScenario'))
})
const displayVisitDate = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
const v = formatVisitDate(d)
return orPlaceholder(v)
})
const displayCustomerTags = computed((): string => {
const d = props.detail
if (d == null) { return '-' }
return orPlaceholder(getStr(d, 'customerTags'))
})
function handleClose(): void {
emit('close')
}
</script>
<style lang="scss" scoped>
.form-detail-wrap {
display: flex;
flex-direction: column;
height: 100%;
padding: 24px 24px 0;
padding-bottom: 24px;
overflow: hidden;
box-sizing: border-box;
}
.form-detail-header {
margin-bottom: 16px;
}
.form-detail-title {
font-size: 18px;
font-weight: 700;
color: #1e293b;
}
.form-detail-scroll {
flex: 1;
min-height: 0;
overflow: hidden;
}
.form-detail-body {
display: flex;
flex-direction: column;
width: 100%;
}
.form-row {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 12px 0;
border-bottom: 1px solid #e2e8f0;
}
.form-label {
width: 100px;
flex-shrink: 0;
font-size: 14px;
color: #1e293b;
}
.form-value {
flex: 1;
min-width: 0;
font-size: 14px;
color: #1e293b;
}
.form-value:empty {
color: #94a3b8;
}
.form-detail-goods {
display: flex;
flex-direction: column;
margin-top: 24px;
padding-top: 16px;
border-top: 1px solid #e2e8f0;
}
.form-detail-goods-title {
font-size: 16px;
font-weight: 700;
color: #1e293b;
margin-bottom: 16px;
}
</style>
<template>
<view class="line-bar-box">
<view class="tabs-header">
<page-tabs
:list="tabList"
@changeTab="changeTab"
size="small"
/>
</view>
<view class="chart-wrap">
<l-echart ref="chartRef" @finished="initChart" />
</view>
</view>
</template>
<script setup lang="uts">
import { ref, computed, watch, nextTick } from "vue";
import PageTabs from "@/components/PageTabs.uvue";
/** 接待中心 - 柱状图组件入参,透传页面数据与业务场景 */
const props = withDefaults(
defineProps<{
/** 是否展示业绩数据,受左侧「小眼睛」开关控制 */
dataShow?: boolean
/** 页面聚合数据(含门店/个人产值等),由父级 ReceptionCenter 提供 */
pageData?: UTSJSONObject | null
/** 业务场景类型:0-延保 1-轻改 等 */
sceneType?: number | null
/** 是否鸿蒙端,预留用于端能力差异处理 */
isHarmony?: boolean
/** 业务类型:1-延保 2-轻改 */
bussinessType?: number | null
}>(),
{
dataShow: true,
pageData: null,
sceneType: 1,
isHarmony: false,
bussinessType: null
}
);
type ChartMetricItem = { label: string; value: number; raw: string }
const chartRef = ref<LEchartComponentPublicInstance | null>(null)
/** 当前选中的 Tab 索引:0-成交率 1-客单价/成交数 */
const tabIndex = ref(0);
/** Tab 文案列表,会根据 sceneType / isHarmony / bussinessType 动态切换 */
const tabList = ref<string[]>(['本月交付成交率', '本月交付客单价']);
/** 当前柱状图原始数据(排序后):value 为数值,raw 为展示文案(如 85% / ¥28370 / --) */
const chartData = ref<ChartMetricItem[]>([]);
/** 成交率指标 key 与展示名称(与老项目保持一致) */
const rateKeys: string[] = ['excellentStoreAvgDealRate', 'thisStoreDealRate', 'personalDealRate'];
const rateLabels: string[] = ['优秀门店均值', '本门店', '个人'];
/** 客单价/成交数指标 key 与展示名称(与老项目保持一致) */
const priceKeys: string[] = ['excellentStoreAvgDeal', 'thisStoreKdj', 'personalKdj'];
const priceLabels: string[] = ['优秀门店均值', '本门店', '个人'];
/** pageData 计算属性:确保非空对象,便于后续访问 */
const pageDataRef = computed((): UTSJSONObject => {
const pd = props.pageData;
return pd != null ? pd : ({} as UTSJSONObject);
});
/** 将指标数值转换为柱状图长度,保证为 number */
function valueToBarLength(v: number): number {
if (v == null) {
return 0;
}
return v;
}
/** 获取指标数值,失败时返回 null */
function getMetricNumber(pd: UTSJSONObject, key: string): number | null {
const val = pd[key];
if (val == null || val == "") {
return null;
}
const num = parseFloat("" + val);
if (isNaN(num)) {
return null;
}
return num;
}
/** 按业务规则计算当前 Tab 下的 chartData:排序 + 文案填充 + 隐藏逻辑 */
function rebuildChartData(): void {
const pd = pageDataRef.value;
const metrics: ChartMetricItem[] = [];
const isRateTab = tabIndex.value == 0;
const keys = isRateTab ? rateKeys : priceKeys;
const labels = isRateTab ? rateLabels : priceLabels;
let i = 0;
while (i < keys.length) {
const key = keys[i];
const label = labels[i];
const numOrNull = getMetricNumber(pd, key);
const isNull = numOrNull == null;
const value = isNull ? 0 : (numOrNull as number);
let rawText = "--";
if (props.dataShow && !isNull) {
if (isRateTab) {
rawText = "" + value + "%";
} else {
// 轻改场景下,客单价 Tab 需要加 ¥ 前缀
if (props.sceneType == 1 && tabIndex.value == 1) {
rawText = "¥" + value;
} else {
rawText = "" + value;
}
}
}
metrics.push({
label,
value,
raw: rawText
} as ChartMetricItem);
i++;
}
// 根据数值从大到小排序(UTS 不支持自定义 comparator,使用手写排序)
const n = metrics.length;
let x = 0;
while (x < n - 1) {
let y = x + 1;
while (y < n) {
if (metrics[y].value > metrics[x].value) {
const tmp = metrics[x];
metrics[x] = metrics[y];
metrics[y] = tmp;
}
y++;
}
x++;
}
chartData.value = metrics;
}
/** 根据场景类型/业务类型/鸿蒙端动态设置 Tab 标题(对齐老项目逻辑)
* (sceneType 0: 2.1场景,1:1.1场景) (bussinessType 1:延保,3:权益)
* 2.1场景 鸿蒙 --- 问界/鸿蒙 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙 --- 选延保 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙 --- 权益 [本月交付成交率] 改为 [广联权益渗透率]; [本月交付客单价] 改成 [广联权益成交数]
*/
function rebuildTabList(): void {
let list: string[] = ['本月交付成交率', '本月交付客单价'];
const sceneType = props.sceneType;
const bussinessType = props.bussinessType;
const isHarmony = props.isHarmony == true;
if (sceneType != null && sceneType == 0) {
if (isHarmony) {
list[1] = '整车延保成交数';
} else {
if (bussinessType != null && bussinessType == 1) {
list[1] = '整车延保成交数';
} else if (bussinessType != null && bussinessType == 3) {
list = ['广联权益渗透率', '广联权益成交数'];
}
}
}
tabList.value = list;
}
/** 构建柱状图配置(APP 端 option 经 JSON 序列化传递,不支持 formatter 函数) */
function buildChartOption(): UTSJSONObject {
const data = chartData.value
const labels: string[] = []
let i = data.length - 1
while (i >= 0) {
labels.push(data[i].label)
i--
}
const gradients: UTSJSONObject[] = [
{ type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: '#389fff' }, { offset: 1, color: '#2c66f7' }] },
{ type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: '#708dff' }, { offset: 1, color: '#6858f5' }] },
{ type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: '#94cbff' }, { offset: 1, color: '#3283fb' }] }
]
const dataItems: UTSJSONObject[] = []
let j = data.length - 1
while (j >= 0) {
const it = data[j]
const grad = gradients[j] as UTSJSONObject
dataItems.push({
value: valueToBarLength(it.value),
raw: it.raw,
itemStyle: {
color: grad
}
} as UTSJSONObject)
j--
}
return {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
confine: true,
formatter: '{b}: {@raw}'
},
grid: {
left: -4,
right: 85,
top: 12,
bottom: 12,
containLabel: true
},
xAxis: {
show: false,
type: 'value',
min: 0,
splitLine: { show: false }
},
yAxis: {
type: 'category',
axisTick: { show: false },
data: labels,
axisLine: { lineStyle: { width: 1, color: '#CFD4E3' } },
axisLabel: { color: '#333333', fontSize: 12, fontWeight: 400 }
},
series: [
{
name: '产值',
type: 'bar',
barWidth: 6,
data: dataItems,
label: {
show: props.dataShow,
position: 'right',
formatter: '{@raw}',
color: '#333333',
fontSize: 14,
fontWeight: 500
}
}
]
} as UTSJSONObject
}
/** 根据最新 props/pageData 重建图表并刷新 ECharts */
function refreshChart(): void {
rebuildTabList();
rebuildChartData();
const comp = chartRef.value;
if (comp != null) {
comp.setOption(buildChartOption());
}
}
/** Tab 切换回调 */
function changeTab(index: number): void {
tabIndex.value = index;
refreshChart();
}
const initChart = async (): Promise<void> => {
const comp = chartRef.value
if (comp == null) {
return
}
try {
await comp.init(null)
// 初始化时根据 props 构建实际业务数据
refreshChart();
} catch (e) {
console.error('LineBar 图表初始化失败:', e)
}
}
// 监听数据与业务场景变化,实时刷新图表
watch(
pageDataRef,
() => {
nextTick(() => {
refreshChart();
});
},
{ deep: true }
);
const dataShowRef = computed((): boolean => {
return props.dataShow === true;
});
const sceneTypeRef = computed((): number => {
const v = props.sceneType;
return v != null ? (v as number) : 0;
});
const bussinessTypeRef = computed((): number => {
const v = props.bussinessType;
return v != null ? (v as number) : 0;
});
const isHarmonyRef = computed((): boolean => {
return props.isHarmony === true;
});
watch(
dataShowRef,
() => {
nextTick(() => {
refreshChart();
});
}
);
watch(
sceneTypeRef,
() => {
nextTick(() => {
refreshChart();
});
}
);
watch(
bussinessTypeRef,
() => {
nextTick(() => {
refreshChart();
});
}
);
watch(
isHarmonyRef,
() => {
nextTick(() => {
refreshChart();
});
}
);
</script>
<style scoped lang="scss">
/* 基准 194px,随父级 flex 比例自适应;子绝父相定位参照 */
.line-bar-box {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
min-height: 0;
box-sizing: border-box;
padding: 12px 14px;
background: #ffffff;
border-radius: 16px;
}
/* Tab 区域:顶部居中 */
.tabs-header {
width: 100%;
height: 32px;
flex-shrink: 0;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 8px;
}
/* 子绝父相:图表相对于 line-bar-box 靠左下定位 */
.chart-wrap {
position: absolute;
left: 14px;
bottom: 12px;
width: 268px;
height: 101px;
box-sizing: border-box;
}
</style>
<template>
<view class="output-value-box">
<text class="output-value-title">本月产值</text>
<view class="output-value">
<view class="value">
<text class="value-num">{{ formattedNumber('actualProduction') }}</text>
<text class="unit">万</text>
</view>
<view class="sub-value flex">
<text class="sub-label">个人产值</text>
<text class="num">{{ formattedNumber('personalProduction') }}万</text>
</view>
</view>
<view class="output-canvas">
<canvas id="output-chart" class="canvas"></canvas>
<view class="chart-text">
<text class="chart-label">产值贡献</text>
<text class="chart-num">{{ formattedNumber('productionContribution') }}%</text>
</view>
</view>
<view class="output-view-wrap">
<view class="output-view flex">
<view class="item flex">
<text class="item-label">目标</text>
<text class="num">{{ formattedNumber('targetProduction') }}万</text>
</view>
<view class="divider"></view>
<view class="item flex">
<text class="item-label">达成比例</text>
<text class="num">{{ formattedNumber('achievementRatio', '%') }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
/** 页面数据:actualProduction、personalProduction、targetProduction、achievementRatio、productionContribution */
const props = withDefaults(
defineProps<{
pageData?: UTSJSONObject | null
dataShow?: boolean
}>(),
{
pageData: (): UTSJSONObject => ({}),
dataShow: true
}
);
/** 格式化数字,无数据时返回 --;unit 可选,如 '%'、'万' */
function formattedNumber(key: string, unit: string | null = null): string {
const pd = props.pageData;
const ds = props.dataShow;
if (pd == null || !ds) {
return "--";
}
const val = pd[key];
if (val == null || val == "") {
return "--";
}
let str = "" + val;
if (unit != null && unit != "") {
str = str + unit;
}
return str;
}
onMounted(() => {
drawChart();
});
watch(
() => props.pageData,
() => {
drawChart();
},
{ deep: true }
);
function drawChart() {
const pd = props.pageData;
if (pd == null) return;
// 获取 contribution 值,假设是 0-100 的数字
let contribution = 0;
const val = pd['productionContribution'];
if (val != null && val != "") {
contribution = parseFloat("" + val);
}
// 限制在 0-100
if (contribution < 0) contribution = 0;
if (contribution > 100) contribution = 100;
const ctx = uni.getElementById('output-chart')?.getContext('2d') as CanvasRenderingContext2D | null;
if (ctx == null) return;
const width = 100; // canvas 宽
const height = 100; // canvas 高
const centerX = width / 2;
const centerY = height / 2;
const radius = 38; // 半径
const lineWidth = 8; // 线宽
// 清空画布
ctx.clearRect(0, 0, width, height);
// 绘制背景圆环
ctx.beginPath();
ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
ctx.lineWidth = lineWidth;
ctx.strokeStyle = '#F0F2F5'; // 浅灰色背景
ctx.lineCap = 'round';
ctx.stroke();
// 绘制进度条
const startAngle = -Math.PI / 2;
const endAngle = startAngle + (contribution / 100) * 2 * Math.PI;
// 只有当有进度时才绘制
if (contribution > 0) {
ctx.beginPath();
ctx.arc(centerX, centerY, radius, startAngle, endAngle);
ctx.lineWidth = lineWidth;
ctx.strokeStyle = '#4673ff'; // 蓝色进度
ctx.lineCap = 'round';
// 增加阴影,使效果更接近设计图
ctx.shadowBlur = 4;
ctx.shadowColor = 'rgba(70, 115, 255, 0.3)';
ctx.stroke();
// 绘制完后清除阴影,以免影响其他绘制
ctx.shadowBlur = 0;
}
}
</script>
<style scoped lang="scss">
/* 本月产值 - 基准 183px,toRpx/2 换算为 px;文字样式仅写在 text 上 */
.output-value-box {
position: relative;
height: 183px;
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #ffffff; /* 确保背景色 */
border-radius: 12px; /* 圆角 */
padding: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02); /* 轻微阴影,增强卡片质感 */
}
.output-value-title {
font-size: 14px;
font-weight: 500; /* 加粗一点 */
padding: 16px 16px 0;
color: #333333;
}
.output-value {
padding: 20px 0 0 20px;
flex-shrink: 0;
}
.value {
display: flex;
align-items: baseline;
margin-bottom: 8px;
}
.value-num {
color: #4673ff;
font-size: 32px; /* 加大字体 */
line-height: 32px;
font-weight: bold;
font-family: DINAlternate-Bold, Roboto-Bold, Helvetica-Bold, sans-serif; /* 字体回退 */
}
.unit {
color: #333333;
font-size: 14px;
font-weight: 400;
margin-left: 4px;
line-height: 18px;
}
.sub-value {
display: flex;
align-items: center;
}
.sub-value .sub-label {
color: #666666; /* 稍微浅一点的灰色 */
font-size: 12px;
}
.sub-value .num {
color: #4673ff;
font-size: 14px;
font-weight: 500;
margin-left: 4px;
}
.output-canvas {
position: absolute;
right: 16px;
top: 36px;
width: 100px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
.canvas {
width: 100px;
height: 100px;
position: absolute;
top: 0;
left: 0;
}
.chart-text {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 1; /* 确保在 canvas 上方 */
}
.chart-label {
font-size: 10px;
color: #666666;
margin-bottom: 2px;
}
.chart-num {
font-size: 16px;
color: #4673ff;
font-weight: bold;
}
/* 底部目标/达成比例栏 */
.output-view-wrap {
position: absolute;
left: 0;
right: 0;
bottom: 16px;
display: flex;
justify-content: center;
}
.output-view {
width: 90%; /* 稍微宽一点 */
max-width: 340px;
height: 36px; /* 加高一点 */
border-radius: 18px;
background: #F5F7FF; /* 浅蓝色背景,更接近设计图 */
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
box-sizing: border-box;
}
.output-view .item {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
flex-shrink: 0;
}
.output-view .item-label {
color: #333333;
font-size: 12px;
}
.output-view .num {
margin-left: 6px;
color: #4673ff;
font-size: 14px;
font-weight: bold;
}
/* 中间竖线 */
.divider {
width: 1px;
height: 14px;
background: #D8DCE6; /* 调整分隔线颜色 */
flex-shrink: 0;
margin: 0 10px;
}
</style>
<template>
<view class="data-container">
</view>
</template>
<script setup lang="uts">
</script>
<style scoped lang="scss">
.error-tip {
font-size: toRpx(28);
padding: toRpx(32) toRpx(60) toRpx(24);
margin-top: toRpx(100);
margin-bottom: toMinusRpx(80);
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.data-container {
background: #ffffff59;
border-radius: toRpx(48);
margin: toRpx(80) toRpx(66) toRpx(80) 0;
height: calc(100% - #{toRpx(160)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
.nav-bar {
position: absolute;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(28);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.form {
display: flex;
flex-wrap: wrap;
gap: toRpx(80) toRpx(160);
padding: toRpx(80);
margin-top: toRpx(60);
&-item {
width: calc(50% - #{toRpx(80)});
display: flex;
align-items: center;
color: #6c6c70;
font-size: toRpx(30);
height: toRpx(80);
box-sizing: border-box;
.label {
position: relative;
margin-left: auto;
flex-shrink: 0;
width: toRpx(124);
margin-right: toRpx(30);
}
.required {
&::before {
content: '*';
color: #ff0000;
position: absolute;
left: toMinusRpx(20);
top: 50%;
transform: translate(0, -50%);
}
}
.value {
height: toRpx(80);
flex: 1;
border: toRpx(2) solid #e8e8ea;
background: #ffffff;
margin-left: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(40);
border-radius: toRpx(8);
&.error {
border: toRpx(2) solid #f24724;
border-radius: toRpx(8);
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
padding: 0 !important;
font-size: toRpx(30);
color: #333;
&::placeholder {
color: #c9c9c9;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
}
}
.footer-box {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(34);
padding: 0 toRpx(280);
.cancel-btn {
height: toRpx(80);
background: #dae9ff;
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
color: #2c66f7;
flex: 1;
}
.submit-btn {
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
flex: 1;
color: #ffffff;
}
}
}
.select-box {
margin: toRpx(40) 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(20);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(68);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #292d33;
font-size: toRpx(28);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
<template>
<view class="home-frame-container">
<view class="home-frame-container"
:class="[modeClass, resolutionClass]">
<!-- 首页内容区 -->
<view v-if="!showDetail"
class="home-content home-content-pad">
<HomeFrameLeftSide :tab-index="tabIndex"
:user-info="userInfo"
@change-tab="onChangeTab" />
<view class="right-side">
class="home-content"
:class="[isPortraitMode ? 'home-content-portrait' : 'home-content-pad']">
<!-- 右侧内容:竖屏和横屏共用一套结构,只是顺序不同 -->
<view v-if="isPortraitMode" class="right-side">
<!-- 横屏三卡片布局:轻改等使用 swiperCustom -->
<view v-if="useCardLayout && tabIndex == 0" class="app-content-box right-content show-content-box">
<view class="start" @click="onStartClick">
<view class="start-inner">
<text class="start-text">开始接待</text>
</view>
</view>
<view class="right-content-box flex-row">
<view class="content-left">
<view class="module-box box-class">
<view class="common-title">
<text class="title-text">产品介绍</text>
</view>
<view class="content-box">
<slot v-if="swiperCustom" name="swiperCustom"></slot>
<view v-else class="swiper-placeholder">
<text class="placeholder-text">敬请期待</text>
</view>
</view>
</view>
<view class="tool-box box-class">
<view class="common-title">
<text class="title-text">展业工具</text>
</view>
<view class="content-box">
<Entrance :scene-type="sceneType" />
</view>
</view>
</view>
<view class="content-right box-class">
<view class="common-title">
<text class="title-text">服务中心</text>
</view>
<view class="content-box">
<HomeFrameMessageIndex class="message-box" />
</view>
</view>
</view>
</view>
<!-- 旧版居中布局:权益、二手车等使用 #home -->
<view v-else-if="tabIndex == 0" class="legacy-home-wrap">
<slot name="home"></slot>
</view>
<view v-else-if="tabIndex == 1" class="reception-center-wrap">
<view v-show="!showReceptionDetail" class="reception-center-inner">
<ReceptionCenterCenter @show-reception-detail="onShowReceptionDetail" />
</view>
<view v-show="showReceptionDetail" class="reception-detail-inner">
<ReceptionDetail :embedded="true" :item="receptionDetailItem" @close="onReceptionDetailClose" />
</view>
</view>
</view>
<view v-else class="right-side">
<!-- 横屏三卡片布局:轻改等使用 swiperCustom -->
<view v-if="useCardLayout && tabIndex == 0" class="app-content-box right-content show-content-box">
<view class="start" @click="onStartClick">
<image class="start-bg-img"
mode="scaleToFill"
src="/static/images/home/start-btn.png" />
<view class="start-inner">
<text class="start-text">开始接待</text>
</view>
......@@ -53,7 +105,28 @@
<view v-else-if="tabIndex == 0" class="legacy-home-wrap">
<slot name="home"></slot>
</view>
<!-- 横屏接待中心:仅显示右侧列表区 -->
<view v-else-if="tabIndex == 1" class="reception-center-wrap">
<view v-show="!showReceptionDetail" class="reception-center-inner">
<ReceptionCenterCenter :only-right="true" @show-reception-detail="onShowReceptionDetail" />
</view>
<view v-show="showReceptionDetail" class="reception-detail-inner">
<ReceptionDetail :embedded="true" :item="receptionDetailItem" @close="onReceptionDetailClose" />
</view>
</view>
</view>
<!-- 竖屏:底部 TabBar;横屏:左侧栏 -->
<HomeFrameLeftSide v-if="isPortraitMode"
:is-portrait="true"
:tab-index="tabIndex"
:user-info="userInfo"
@change-tab="onChangeTab" />
<HomeFrameLeftSide v-else
:is-portrait="false"
:tab-index="tabIndex"
:user-info="userInfo"
@change-tab="onChangeTab" />
<!-- 底部门店信息:与 right-side 同级,样式与旧项目 store-addr 一致 -->
<!-- <view v-if="showFooter" class="store-addr">
<view class="addr-line addr-line-left"></view>
......@@ -74,10 +147,13 @@
import { computed, defineExpose, ref } from "vue";
import Entrance from "@/components/Entrance.uvue";
import { layoutService } from "@/services/LayoutService.uts";
import { storage } from "@/utils/storage.uts";
import HomeFrameLeftSide from "./LeftSide.uvue";
import HomeFrameMessageIndex from "./MessageIndex.uvue";
import ReceptionCenterCenter from "./ReceptionCenter/center.uvue";
import ReceptionDetail from "./ReceptionCenter/receptionDetail.uvue";
const props = defineProps<{
showFooter?: boolean
......@@ -92,10 +168,29 @@ const useCardLayout = computed((): boolean => {
return props.swiperCustom === true;
});
const modeClass = computed((): string => {
const modeRef = layoutService.getCurrentMode();
const m = modeRef.value;
// pad / desktop 归为横屏,portrait 归为竖屏
return m == "portrait" ? "mode-portrait" : "mode-landscape";
});
const resolutionClass = computed((): string => {
const bucket = layoutService.getResolutionBucket();
return `res-${bucket}`;
});
const isPortraitMode = computed((): boolean => {
return layoutService.isMode("portrait");
});
const showDetail = ref(false);
const userInfo = ref<UTSJSONObject>({});
const sceneType = ref<number>(1);
const tabIndex = ref(0);
// 接待详情:成交卡片点击时展示
const showReceptionDetail = ref(false);
const receptionDetailItem = ref<UTSJSONObject>({});
function updateApp(): void {
const info = storage.get("userInfo");
......@@ -118,6 +213,15 @@ function onChangeTab(index: number): void {
tabIndex.value = index;
}
function onShowReceptionDetail(item: UTSJSONObject): void {
receptionDetailItem.value = item;
showReceptionDetail.value = true;
}
function onReceptionDetailClose(): void {
showReceptionDetail.value = false;
}
function onStartClick(): void {
emit("start");
}
......@@ -130,6 +234,7 @@ defineExpose({
</script>
<style scoped lang="scss">
.home-frame-container {
width: 100%;
height: 100%;
......@@ -152,6 +257,10 @@ defineExpose({
flex-direction: row;
}
.home-content-portrait {
flex-direction: column;
}
.detail-content {
flex: 1;
width: 100%;
......@@ -166,7 +275,16 @@ defineExpose({
overflow: hidden;
}
.mode-portrait .right-side {
order: 1;
}
.mode-portrait .left-side-portrait {
order: 2;
}
.app-content-box {
margin-top: 40px;
flex: 1;
display: flex;
flex-direction: column;
......@@ -179,28 +297,18 @@ defineExpose({
/* 与旧项目一致:背景图铺满,文字居中偏上,无渐变遮罩 */
.start {
height: 126px;
height: 86px;
box-sizing: border-box;
margin-right: 32px;
position: relative;
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 30px;
padding-top: 36px;
overflow: hidden;
flex-shrink: 0;
min-width: 140px;
}
.start-bg-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
/* 与旧项目 background-size: 100% 100% 一致,铺满容器 */
border-radius: 18px;
background: #5b8cff;
}
.start-inner {
......@@ -216,7 +324,7 @@ defineExpose({
}
.start-text {
font-size: 36px;
font-size: 16px;
font-weight: 600;
color: #ffffff;
text-align: center;
......@@ -239,7 +347,7 @@ defineExpose({
}
.content-left {
width: var(--l-content-left-width);
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
......@@ -271,8 +379,8 @@ defineExpose({
}
.title-text {
font-size: var(--l-font-lg);
font-weight: 600;
font-size: 16px;
font-weight: 500;
color: #333;
}
......@@ -307,6 +415,27 @@ defineExpose({
overflow: hidden;
}
.reception-center-wrap {
flex: 1;
width: 100%;
height: 100%;
min-height: 0;
display: flex;
flex-direction: column;
position: relative;
}
.reception-center-inner,
.reception-detail-inner {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
}
/* 底部门店信息,与旧项目 store-addr 一致:居中、无通栏背景、两侧渐变线 */
.store-addr {
position: absolute;
......
<template>
<view class="layout-root" :style="styleObj">
<view class="layout-root" :class="[modeClass, resolutionClass]" :style="styleObj">
<slot></slot>
</view>
</template>
......@@ -7,15 +7,28 @@
<script setup lang="uts">
import { computed, type Ref } from 'vue'
import { useLayout } from '@/composables/useLayout'
import { layoutService } from '@/services/LayoutService.uts'
const layout = useLayout()
const rawCssVars = (layout as UTSJSONObject)['cssVars'] as Ref<UTSJSONObject> | null
const styleObj = computed((): UTSJSONObject => {
const r = rawCssVars
if (r == null) return {}
const v = r.value
return v != null ? v : {}
})
const modeClass = computed((): string => {
const modeRef = layoutService.getCurrentMode()
const m = modeRef.value
return m == 'portrait' ? 'mode-portrait' : 'mode-landscape'
})
const resolutionClass = computed((): string => {
const bucket = layoutService.getResolutionBucket()
return `res-${bucket}`
})
</script>
<style scoped>
......
<template>
<uni-popup
ref="tips"
:type="position"
:is-mask-click="false"
:animation="animation"
>
<un-popup :show="visible" @close="onClose" @open="open" :mode="position">
<view
class="tips-wrapper"
:style="{ width: popupW + 'rpx', minHeight: popupH + 'rpx',maxHeight: maxHeight + 'rpx' }"
:class="['tips-wrapper',{'radius': position === 'center'}]"
:style="popupStyle"
>
<view class="tips-content">
<view
class="icon-close-box flex"
@click="close"
class="icon-close-box flex"
@click="hide"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="18"
color="#1A1A1A"
></uni-icons>
class="icon-close"
type="closeempty"
:size="18"
color="#1A1A1A"
>
</uni-icons>
</view>
<view class="tips-title">
<template v-if="back">
<view
class="sprite-icon icon-back"
@click="close"
></view>
class="sprite-icon icon-back"
@click="hide"
>
</view>
</template>
{{ title }}
</view>
<text
class="tips-text"
v-if="content"
class="tips-text"
v-if="content"
>{{ content }}</text>
<slot></slot>
</view>
<view
<slot>
</slot>
</view>
<view
class="tips-footer"
v-if="isFooter"
>
<view
>
<view
v-if="showCancelBtn"
class="tips-btn close"
@click="cancel()"
>{{
cancelBtnText
}}</view>
<view
class="tips-btn preview"
@click="confirm()"
>{{
confirmBtnText
}}</view>
</view>
<template v-else>
<slot name="footer"></slot>
</template>
</view>
</uni-popup>
@click="cancel"
>{{
cancelBtnText
}}</view>
<view
class="tips-btn preview"
@click="confirm"
>{{
confirmBtnText
}}</view>
</view>
<template v-else>
<slot name="footer">
</slot>
</template>
</view>
</un-popup>
</template>
<script>
export default {
name: "MessageBox",
data () {
return {};
},
props: {
animation: {
type: Boolean,
default: true
},
isAutoClose: {
type: Boolean,
default: true,
},
position: {
type: String,
default: "center",
},
popupW: {
type: Number,
},
popupH: {
type: Number,
default: 372,
},
isFooter: {
type: Boolean,
default: true,
},
title: {
type: String,
default: "提示",
},
content: {
type: String,
default: "",
},
confirmBtnText: {
type: String,
default: "确定",
},
cancelBtnText: {
type: String,
default: "取消",
},
maxHeight: Number,
back: Boolean,
showCancelBtn: {
type: Boolean,
default: true,
<script setup lang="uts">
import { ComponentPublicInstance } from 'vue'
const props = defineProps({
isAutoClose: {
type: Boolean,
default: true
},
position: {
type: String,
default: "center"
},
popupW: Number,
popupH: {
type: Number,
default: 372
},
isFooter: {
type: Boolean,
default: true
},
title: {
type: String,
default: "提示"
},
content: {
type: String,
default: ""
},
confirmBtnText: {
type: String,
default: "确定"
},
cancelBtnText: {
type: String,
default: "取消"
},
maxHeight: Number,
back: Boolean,
showCancelBtn: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['close',
'cancel',
'confirm'])
const visible = ref<boolean>(false)
const popupRef= ref(null)
const popupStyle = computed(() => {
return {
width: props.popupW != null && props.popupW > 0 ? (props.popupW ?? 0) + 'rpx' : '100%',
minHeight: props.popupH != null && props.popupH > 0 ? (props.popupH ?? 0) + 'rpx' : '100%',
maxHeight: props.maxHeight != null && props.maxHeight > 0 ? (props.maxHeight ?? 0) + 'rpx' : '100%'
}
})
function onClose(): void {
emit('close')
}
function close(): void {
if (props.isAutoClose) {
visible.value = false
} else {
if (popupRef.value != null) {
(popupRef.value as ComponentPublicInstance).$callMethod('close')
}
}
emit('close')
}
function hide(): void {
visible.value = false
}
function open(): void {
visible.value = true
}
function cancel(): void {
if (props.isAutoClose) {
visible.value = false
}
},
methods: {
close () {
this.$refs.tips.close();
this.$emit("close");
},
open () {
this.$refs.tips.open();
},
cancel () {
if (this.isAutoClose) this.$refs.tips.close();
this.$emit("cancel");
},
confirm () {
if (this.isAutoClose) this.$refs.tips.close();
this.$emit("confirm");
},
},
};
emit('cancel')
}
function confirm(): void {
if (props.isAutoClose) {
visible.value = false
}
emit('confirm')
}
defineExpose({ open, close ,hide })
</script>
<style scoped lang="scss">
.tips-wrapper {
background: #ffffff;
border-radius: toRpx(20);
height: 100%;
.tips-content {
padding: toRpx(48);
box-sizing: border-box;
height: calc(100% - #{toRpx(100)});
position: relative;
.icon-close-box {
position: absolute;
right: 0;
top: 0;
width: toRpx(120);
height: toRpx(120);
justify-content: center;
z-index: 2;
}
.tips-title {
position: relative;
.tips-wrapper {
background: #ffffff;
border-radius: 20rpx 20rpx 0 0;
height: 100%;
flex-direction: column;
.tips-content {
width: 100%;
font-weight: 500;
font-size: toRpx(36);
color: #292d33;
text-align: center;
.icon-back {
padding: 48rpx;
box-sizing: border-box;
height: calc(100% - 100rpx);
position: relative;
flex-direction: column;
.icon-close-box {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
right: 0;
top: 0;
width: 120rpx;
height: 120rpx;
justify-content: center;
z-index: 2;
align-items: center;
}
.tips-title {
position: relative;
width: 100%;
font-weight: 500;
font-size: 36rpx;
color: #292d33;
text-align: center;
.icon-back {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
}
}
}
.tips-text {
display: block;
font-size: toRpx(30);
color: #5a5e66;
letter-spacing: toRpx(1);
text-align: center;
line-height: toRpx(40);
margin-top: toRpx(48);
}
.tips-footer {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(100);
border-top: 1px solid #e8e8e8;
.close {
color: #6c6c70;
.tips-text {
display: block;
font-size: 30rpx;
color: #5a5e66;
letter-spacing: 1rpx;
text-align: center;
line-height: 40rpx;
margin-top: 48rpx;
}
.preview {
color: #2c66f7;
.tips-footer {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
border-top: 1px solid #e8e8e8;
flex-direction: row;
.close {
color: #6c6c70;
}
.preview {
color: #2c66f7;
}
}
.tips-btn {
width: 50%;
text-align: center;
font-size: 32rpx;
text-align: center;
line-height: 44rpx;
font-weight: 500;
justify-content: center;
}
}
.tips-btn {
width: 50%;
text-align: center;
font-size: toRpx(32);
text-align: center;
line-height: toRpx(44);
font-weight: 500;
.radius{
border-radius: 20rpx;
}
}
</style>
</style>
\ No newline at end of file
<template>
<view class="tabs-component flex">
<!-- 背景层:替代 ::after 伪元素,App 端兼容 -->
<!-- <view class="tabs-bg"></view> -->
<view
v-for="(item, index) in list"
:class="['tab flex', size, { active: activeIndex == index }]"
:key="index"
@click="changeTab(index)"
class="tab-item"
>
<text class="tab-text">{{ getTabText(item) }}</text>
<view v-if="showDot(item)" class="dot"></view>
</view>
<view
class="active-btn"
:style="{
width: blockWidth,
left: activeBlockLeft
}"
></view>
</view>
</template>
<script setup lang="uts">
import { ref, computed, watch } from "vue";
/** Tab 项:对象或字符串 */
type TabItem = UTSJSONObject | string;
const props = withDefaults(
defineProps<{
/** Tab 数据列表 */
list?: TabItem[]
/** 默认选中索引 */
defaultIndex?: number
/** 显示名称的字段 key,默认 text */
tabKey?: string
/** 尺寸:normal | small */
size?: string
}>(),
{
list: () => [],
defaultIndex: 0,
tabKey: "text",
size: "normal"
}
);
const emit = defineEmits<{
changeTab: [number]
}>();
const activeIndex = ref(props.defaultIndex != null ? props.defaultIndex : 0);
/** 用 computed 包装 defaultIndex,避免 watch getter 在 UTS 下的类型推断问题 */
const defaultIndexSource = computed((): number => {
const v = props.defaultIndex;
return v != null ? v : 0;
});
watch(
defaultIndexSource,
(newVal: number) => {
activeIndex.value = newVal;
},
{ immediate: true }
);
/** 每个 tab 的宽度(百分比,自适应) */
const blockWidth = computed((): string => {
const len = props.list != null ? props.list.length : 0;
if (len <= 0) {
return "100%";
}
const pct = 100 / len;
return `${pct}%`;
});
/** 激活滑块 left 位置:按 tab 等分,统一用 % 保证 transition 在所有切换时生效(px 与 % 混用会导致过渡失效) */
const activeBlockLeft = computed((): string => {
const len = props.list != null ? props.list.length : 0;
if (len <= 0) {
return "0%";
}
const idx = activeIndex.value;
const pct = (idx * 100) / len;
return `${pct}%`;
});
/** 获取 tab 显示文本 */
function getTabText(item: TabItem): string {
if (item == null) {
return "";
}
if (typeof item == "string") {
return item;
}
const obj = item as UTSJSONObject;
const key = props.tabKey != null ? props.tabKey : "text";
const val = obj[key];
if (val == null) {
return "";
}
return `${val}`;
}
/** 是否显示红点:支持 dot 为 boolean 或可调用函数 */
function showDot(item: TabItem): boolean {
if (item == null) {
return false;
}
if (typeof item == "string") {
return false;
}
const obj = item as UTSJSONObject;
const dot = obj["dot"];
if (dot == null) {
return false;
}
if (typeof dot == "boolean") {
return dot;
}
return false;
}
function changeTab(index: number): void {
activeIndex.value = index;
emit("changeTab", index);
}
</script>
<style lang="scss">
/* 遵循 UniAppX 规范:px 单位、无 calc/伪元素、font-weight 仅 400|700、文字样式在 text 上 */
.tabs-component {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
height: 100%;
min-height: 28px;
background-color: #f5f6f7;
border-radius: 8px;
position: relative;
box-sizing: border-box;
padding: 2px;
}
// .tabs-bg {
// position: absolute;
// z-index: 0;
// left: 0;
// top: 0;
// width: 100%;
// height: 100%;
// background-color: #f5f6f7;
// border-radius: 8px;
// }
.tab-item {
flex: 1;
height: 100%;
min-height: 28px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: #666666;
z-index: 10;
position: relative;
}
.tab-item .tab-text {
font-size: 14px;
font-weight: 400;
color: #666666;
text-align: center;
}
.tab-item.normal .tab-text {
font-size: 14px;
}
.tab-item.small .tab-text {
font-size: 12px;
}
/* 仅选中态加粗 */
.tab-item.active .tab-text {
color: #1a1a1a;
}
.tab-item .dot {
position: absolute;
top: 2px;
right: 14px;
width: 6px;
height: 6px;
border-radius: 3px;
background-color: #f24724;
}
/* 选中态滑块:宽度与 tab 等分,高度自适应,白色背景,滑动过渡 */
.active-btn {
position: absolute;
top: 2px;
bottom: 2px;
opacity: 1;
background-color: #ffffff;
/* 优化滑动:Material Design 缓动 + 略长时长 + GPU 加速 */
transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transform: translateZ(0);
border-radius: 8px;
z-index: 1;
box-sizing: border-box;
font-weight: 700;
margin-left: 2px;
}
</style>
<template>
<view>
<movable-area
class="container zoom-pan-container"
@touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
<view
class="zoom-pan-container"
:style="{ 'overflow': 'hidden', 'position': 'relative', 'touch-action': 'none' }"
>
<!-- @touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd" -->
<view
class="content"
:style="contentStyle"
>
<movable-view
class="content"
:style="{ 'transform-origin': transformOriginStyle }"
:scale="!disabled"
:direction="scale == 1 ? 'none' : 'all'"
:scale-min="scaleMin"
:scale-max="scaleMax"
:disabled="disabled"
@scale="onScale"
:scale-value="defaultScale"
>
<slot name="content">
</slot>
</movable-view>
</movable-area>
<slot name="content">
</slot>
</view>
</view>
</template>
<script setup lang="uts">
import { throttle } from '@/utils/throttle.uts'
const props = defineProps({
disabled: Boolean,
scaleMax: {
type: Number,
default: 10
},
scaleMin: {
type: Number,
default: 1
}
})
import { throttle } from '@/utils/common.uts'
import { state } from "@/store/index.uts"
const scale = ref<number>(1)
const defaultScale = ref<number>(1)
const isScaling = ref<boolean>(false)
const transformOriginStyle = ref<string>('50% 50%')
type Point = {
x: number
y: number
}
const watchStatus = computed(() => {
return useStore().state.user.historyStatus
})
type TouchPoint = {
pageX: number
pageY: number
clientX: number
clientY: number
x: number
y: number
}
watch(() => watchStatus.value, (newval) => {
if (scale.value != 1) {
defaultScale.value = 1.1
}
scale.value = 1
transformOriginStyle.value = '50% 50%'
setTimeout(() => {
defaultScale.value = 1
}, 100)
}, { immediate: true })
function handleTouchStart(e: any): void {
if (props.disabled) return
if (e.touches.length === 2) {
isScaling.value = true
}
type TouchEvent = {
touches: Array<TouchPoint>
changedTouches: Array<TouchPoint>
}
const handleTouchMove = throttle(function(e: any): void {
if (props.disabled) return
if (isScaling.value && e.touches.length === 2) {
const center = getTouchCenter(e.touches)
transformOriginStyle.value = `${center.x}px ${center.y}px`
}
}, 16)
const props = defineProps({
disabled: Boolean,
scaleMax: {
type: Number,
default: 10
},
scaleMin: {
type: Number,
default: 1
}
})
function handleTouchEnd(): void {
isScaling.value = false
}
const scale = ref<number>(1)
const isScaling = ref<boolean>(false)
const initialDistance = ref<number>(0)
const initialScale = ref<number>(1)
const translateX = ref<number>(0)
const translateY = ref<number>(0)
const lastTouchCenter = ref<Point>({ x: 0, y: 0 })
const currentTouchCenter = ref<Point>({ x: 0, y: 0 })
function onScale(e: any): void {
scale.value = e.detail.scale
emit('scale', e.detail)
}
const contentStyle = computed(() => {
return {
'transform': `translate(${translateX.value}px, ${translateY.value}px) scale(${scale.value})`,
'transform-origin': 'center center',
'transition': isScaling.value ? 'none' : 'transform 0.3s ease-out',
'will-change': 'transform',
'position': 'absolute',
'left': '0',
'top': '0',
'width': '100%',
'height': '100%'
}
})
function getTouchCenter(touches: Array<any>): { x: number; y: number } {
const centerX = (touches[0].pageX + touches[1].pageX) / 2
const centerY = (touches[0].pageY + touches[1].pageY) / 2
return { x: centerX, y: centerY }
}
const watchStatus = computed(() => {
const status = state.user?.historyStatus
if (status == null) {
return false
} else if (status == 1) {
return true
} else {
return false
}
})
watch(watchStatus.value , () => {
if (scale.value != 1) {
scale.value = 1
translateX.value = 0
translateY.value = 0
}
}, { immediate: true })
// function handleTouchStart(e: TouchEvent): void {
// if (props.disabled == true) return
// if (e.touches.length === 2) {
// isScaling.value = true
// initialDistance.value = getTouchDistance(e.touches)
// initialScale.value = scale.value
// const center = getTouchCenter(e.touches)
// lastTouchCenter.value = center
// currentTouchCenter.value = center
// }
// }
// const handleTouchMove = throttle(function(e: TouchEvent): void {
// if (props.disabled == true) return
// if (isScaling.value && e.touches.length === 2) {
// const currentDistance = getTouchDistance(e.touches)
// const newScale = Math.max(
// props.scaleMin,
// Math.min(
// props.scaleMax,
// initialScale.value * (currentDistance / initialDistance.value)
// )
// )
// scale.value = newScale
const emit = defineEmits(['scale'])
// const center = getTouchCenter(e.touches)
// currentTouchCenter.value = center
// if (scale.value > 1) {
// const deltaX = center.x - lastTouchCenter.value.x
// const deltaY = center.y - lastTouchCenter.value.y
// translateX.value += deltaX
// translateY.value += deltaY
// }
// lastTouchCenter.value = center
// emit('scale', scale.value)
// }
// }, 16)
// function handleTouchEnd(): void {
// if (isScaling.value) {
// isScaling.value = false
// adjustPosition()
// }
// }
function adjustPosition(): void {
if (scale.value <= 1) {
translateX.value = 0
translateY.value = 0
scale.value = 1
}
}
function getTouchDistance(touches: Array<TouchPoint>): number {
const dx = touches[0].pageX - touches[1].pageX
const dy = touches[0].pageY - touches[1].pageY
return Math.sqrt(dx * dx + dy * dy)
}
function getTouchCenter(touches: Array<TouchPoint>): Point {
const centerX = (touches[0].pageX + touches[1].pageX) / 2
const centerY = (touches[0].pageY + touches[1].pageY) / 2
return { x: centerX, y: centerY }
}
const emit = defineEmits(['scale'])
</script>
<style lang="scss">
.zoom-pan-container {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
.content {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.zoom-pan-container {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
touch-action: none;
}
.disabled {
pointer-events: none;
}
.content {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
transform-origin: center center;
will-change: transform;
}
</style>
\ No newline at end of file
<template>
<view class="tool-box" :style="toolStyle">
<view class="tool-box" :style="(toolStyle ?? '') as string">
<view :class="['btn', { hideIcon: !show }]" @click="show = false">
<view class="icon sprite-icon icon-tool-file">
</view>
......@@ -10,14 +10,14 @@
文件夹
</view>
<view class="list-body">
<template v-for="(i, index) in data" :key="index">
<view :class="['item', { active: i[idKey] == id }]" @click="jump(i)">
<image class="icon" :src="i.shortTitleUrl" mode="scaleToFill" />
{{ i.shortTitle }}
<template v-for="(item, index) in (displayData as Array<ToolItem>)" :key="index">
<view :class="['item', { active: item.id == props.id }]" @click="jump(item)">
<image class="icon" :src="item.shortTitleUrl" mode="scaleToFill" />
{{ item.shortTitle }}
</view>
</template>
</view>
<template v-if="showPayBtn">
<template v-if="props.showPayBtn">
<view class="item" @click="toPay">
<view class="icon">
<view class="sprite-icon icon-tool-pay">
......@@ -26,7 +26,7 @@
付款方式
</view>
</template>
<template v-if="type != 'preview'">
<template v-if="props.type != 'preview'">
<view class="item" @click="finish">
<view class="icon">
<view class="sprite-icon icon-tool-finish">
......@@ -42,11 +42,21 @@
<script setup lang="uts">
import { state } from "@/store/index.uts";
const emit = defineEmits(['choose', 'finish', 'toPay'])
type ToolItem = {
id?: string | number
shortTitleUrl?: string
shortTitle?: string
}
const props = defineProps({
type: String,
data: Array,
id: [String,
Number],
data:{
type: Array,
default: () => []
},
id: [String, Number],
showPayBtn: Boolean,
idKey: {
type: String,
......@@ -57,11 +67,31 @@
const show = ref<boolean>(true)
const displayData = computed(() => {
if (props.data == null) {
return [] as Array<ToolItem>
}
return (props.data as Array<UTSJSONObject>).map(element => {
return {
id: element.id,
shortTitleUrl: element.shortTitleUrl as string,
shortTitle: element.shortTitle as string
} as ToolItem
})
})
const watchStatus = computed(() => {
return state.user.historyStatus
const status = state.user?.historyStatus
if (status == null) {
return false
} else if (status == 1) {
return true
} else {
return false
}
})
watch(() => watchStatus.value, (newval) => {
watch(watchStatus.value, () => {
show.value = true
}, { immediate: true })
......@@ -69,7 +99,21 @@
show.value = true
}
function jump(item: any): void {
function getItemTitle(item: ToolItem): string {
if (item.shortTitle == null) {
return ''
}
return item.shortTitle
}
function getItemImageUrl(item: ToolItem): string {
if (item.shortTitleUrl == null) {
return ''
}
return item.shortTitleUrl
}
function jump(item: ToolItem): void {
show.value = true
emit('choose', item)
}
......@@ -82,9 +126,9 @@
emit('toPay')
}
const emit = defineEmits(['choose',
'finish',
'toPay'])
defineExpose({ hide })
</script>
<style lang="scss">
......@@ -172,7 +216,7 @@
.list-body {
display:flex;
flex-direction:column;
max-height: 60vh;
max-height: 700rpx;
overflow-y: auto;
}
.item {
......@@ -196,7 +240,7 @@
}
.showList {
display: flex;
max-height: 1000rpx;
max-height: 1156rpx;
opacity: 1;
transform: translateY(0) scale(1);
padding-bottom: 16rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!