Commit ec24a999 by 前端

Merge branch 'develop' into 'master'

上线合并

See merge request !540
2 parents e9914e62 20bfb3a0
Showing 707 changed files with 1576 additions and 2240 deletions
{"containers":[],"config":{}}
\ No newline at end of file \ No newline at end of file
...@@ -35,14 +35,29 @@ alwaysApply: true ...@@ -35,14 +35,29 @@ alwaysApply: true
## C. 测试(改后必做) ## C. 测试(改后必做)
- **纯函数 / service**:在 `tests/` 下补 `*.test.mjs`(`node:test` + `createRequire`),运行并报告结果 - **纯函数 / service**:在 `tests/` 下补 `*.test.mjs`(`node:test`,优先 ES `import` 被测模块),运行并报告结果
- **createOrder services**:`npm run test:createOrder` - **createOrder services**:`npm run test:createOrder`
- **全量**:`npm test` - **全量**:`npm test`
- 无测试的新纯函数应补最小覆盖 - 无测试的新纯函数应补最小覆盖
- 页面/UI 逻辑无法自动化时,列出手动回归路径 - 页面/UI 逻辑无法自动化时,列出手动回归路径
## D. 模块导出(页面 services / 组件 helper)
- 页面 `services/`、组件 `.helpers.js` / `.pagination.js` 等纯函数模块:**必须使用 ES `export`**,禁止 `module.exports`
- 页面/组件引用 helper:**优先 ES `import`**,避免 `import` 引用 `module.exports` 混用导致微信依赖分析误判
- 保持 `project.config.json` 中 `ignoreUploadUnusedFiles: true`(上传过滤无依赖文件以控制包体);新增页面 helper 须 ES export,必要时在 `packOptions.include` 登记兜底
- 开发/测试/元数据文件走 `packOptions.ignore`(如 `tests/`、`package-lock.json`、`.cursor/`)
## E. Tab 页生命周期(防重复请求)
- **列表/统计 API 仅在 `onShow` → `loadPageData` 调用**;`onLoad` 只做静态初始化
- **`onRoute`(router 注入)只同步 `$query` / `userInfo`,禁止 `search` 或列表 API**
- **`wx.$dateListRefresh` / `wx.$orderListRefresh` 仅在目标页 `onShow` 消费**(见 `utils/util.js` `refreshPageData`)
- 用户主动操作(筛选、下拉、切子 Tab)可直接调 `search()`,与生命周期入口分离
## 改动自检清单 ## 改动自检清单
- [ ] 新增/修改函数已补 JSDoc - [ ] 新增/修改函数已补 JSDoc
- [ ] 新增/修改 helper 使用 ES export(见 D)
- [ ] 已检索跨页引用并说明影响面 - [ ] 已检索跨页引用并说明影响面
- [ ] 已运行相关测试(或说明手动回归项) - [ ] 已运行相关测试(或说明手动回归项)
# 项目名 精品升级小程序 小程序搜索精品升级 # 项目名 精品升级小程序 小程序搜索精品升级
# 环境初始化(SAAS+V5.8.3 等含二手车分包的分支)
克隆或切换分支并 `git pull` 后,在项目根目录执行:
```bash
npm install
```
根目录 `npm install` 会自动通过 `postinstall` 安装 `packageUsedCar` 依赖(含 `glsk-map-jssdk`)。也可执行 `npm run setup`,效果相同。
可选校验:
```bash
npm run verify:npm-config # 检查 project.config 引用的 package.json 是否存在
```
微信开发者工具:**工具 → 构建 npm**(主包与 `packageUsedCar` 分包均需构建)。`npm install` 只安装 `node_modules`,不会生成 `miniprogram_npm`。
从 `package.json` **移除 npm 依赖**后,微信「构建 npm」**不会自动删除** `miniprogram_npm` 里已废弃的包目录(例如历史上并存的 `glsk-applet-component` / `glsx-applet-component`)。建议先删再建:
```powershell
# PowerShell(项目根目录)
Remove-Item -Recurse -Force miniprogram_npm -ErrorAction SilentlyContinue
npm install
```
然后在开发者工具中重新 **工具 → 构建 npm**。重建后主包 `miniprogram_npm` 应仅剩当前 `package.json` 中的依赖(如 `@vant/weapp`、`dayjs` 等)。
若报错 `packageUsedCar/package.json not found`:
```bash
git checkout HEAD -- project.config.json packageUsedCar/package.json packageUsedCar/package-lock.json
npm install
```
若报错 `node_modules of ... packageUsedCar/package.json is not found`:
```bash
npm install
```
然后在开发者工具中重新「构建 npm」;仍异常可 **清缓存 → 全部清除** 后重开项目。
# 账号登录可以使用以下(验证码 开发和测试环境任意输入即可): # 账号登录可以使用以下(验证码 开发和测试环境任意输入即可):
超级管理员:13022223223(测试环境) 13476670746(开发环境) 超级管理员:13022223223(测试环境) 13476670746(开发环境)
......
...@@ -319,12 +319,19 @@ module.exports = { ...@@ -319,12 +319,19 @@ module.exports = {
/** /**
* 员工登录日志记录保存 * 员工登录日志记录保存
* @param {object} data
* @param {string} [name] 调用来源;`loading` 时静默失败,不弹 Toast
*/ */
loginRecordSave(data, name) { loginRecordSave(data, name) {
// console.log(name, 'loginRecordSave'); const failTips = name !== "loading";
// debugger return api.post(
return api.post("dj.api.smartcarlife.staff.login.record.save", data); "dj.api.smartcarlife.staff.login.record.save",
//selectMerchantScene data,
[],
undefined,
undefined,
failTips
);
}, },
// 获取侧边栏切换门店4s店列表 // 获取侧边栏切换门店4s店列表
getCurShopList(data) { getCurShopList(data) {
......
//app.js //app.js
// 初始化sentry // 初始化sentry
import sentryInit from "~/utils/sentryConfig/sentryInit"; import sentryInit from "~/utils/sentryConfig/sentryInit";
import { getSystemInfoSync } from "~/utils/systemInfo";
const sentry = sentryInit(); const sentry = sentryInit();
wx.$sendSentry = function (e) { wx.$sendSentry = function (e) {
sentry.captureException(e); sentry.captureException(e);
...@@ -26,10 +27,12 @@ setSystem_info(); // 存储设备信息 ...@@ -26,10 +27,12 @@ setSystem_info(); // 存储设备信息
import { checkYqdSuper, checkScene } from "~/store/index"; import { checkYqdSuper, checkScene } from "~/store/index";
import eventbus from "./utils/eventbus"; import eventbus from "./utils/eventbus";
import api from "./api/api"; import api from "./api/api";
import { Version } from "glsx-common-sdk"; const { createVersionConfig } = require('./utils/versionConfig.js')
// 预加载:多分包共用,满足主包依赖链(上传质量检测) // 预加载:多分包共用,满足主包依赖链(上传质量检测)
require('./utils/vinVaildate.js') require('./utils/vinVaildate.js')
require('./utils/timeFormat/time-utils.js') require('./utils/timeFormat/time-utils.js')
// 省市区 CDN 加载:GLForm/GLCustForm 分包共用,满足主包依赖链
require('./utils/areaList.js')
require('@vant/weapp/dialog/dialog') require('@vant/weapp/dialog/dialog')
import globalDataFunction from './mixins/globalDataFunction' import globalDataFunction from './mixins/globalDataFunction'
...@@ -63,9 +66,19 @@ const debouncedReNoSignIn = debounce(function (noSignInUuid, that) { ...@@ -63,9 +66,19 @@ const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
removeSystemStorage(); removeSystemStorage();
that.login(false); that.login(false);
} }
})
.catch((err) => {
const errMsg = err?.errMsg || String(err || "");
const isTimeout = /timeout/i.test(errMsg) || err?.errno === 5;
console.warn("[reNoSignIn fail]", { isTimeout, errMsg }, err);
// 网络超时等瞬时错误不强制登出,避免初始化阶段反复弹窗
if (!isTimeout) {
util.removeStorage();
removeSystemStorage();
that.login(false);
}
}); });
}, 0); // 设置防抖时间为 0 秒 }, 300);
// }, 0); // 设置防抖时间为 5 秒
// 定义一个防抖函数 // 定义一个防抖函数
function debounce(func, timeout) { function debounce(func, timeout) {
let timer; let timer;
...@@ -92,10 +105,9 @@ App({ ...@@ -92,10 +105,9 @@ App({
let userInfo = util.getStorageSync("dj_boutique_user_info"); let userInfo = util.getStorageSync("dj_boutique_user_info");
// ,this.globalData, userInfo // ,this.globalData, userInfo
userInfo && this.gobalCheckYqdSuper(userInfo); userInfo && this.gobalCheckYqdSuper(userInfo);
wx.$versionConfig = new Version({ wx.$versionConfig = createVersionConfig({
request: { request: {
baseUrl: "https://config-center-backend.glsx.com.cn/glsxAdmin/config", baseUrl: "https://config-center-backend.glsx.com.cn/glsxAdmin/config",
isSign: false,
}, },
}); });
wx.$globalDataFunction = globalDataFunction wx.$globalDataFunction = globalDataFunction
...@@ -136,7 +148,7 @@ App({ ...@@ -136,7 +148,7 @@ App({
// } // }
// } // }
if (options) { if (options) {
console.log('options', options) // console.log('options', options)
let res = checkScene(options); let res = checkScene(options);
// console.log(res, 'res') // console.log(res, 'res')
...@@ -204,7 +216,7 @@ App({ ...@@ -204,7 +216,7 @@ App({
}, },
globalData: { globalData: {
statusBarHeight: wx.getSystemInfoSync()["statusBarHeight"], // 头部导航栏的高度 statusBarHeight: getSystemInfoSync().statusBarHeight, // 头部导航栏的高度
yqdInfo: {}, yqdInfo: {},
isYqdSuper: true, isYqdSuper: true,
isStaff: false, isStaff: false,
......
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
"pages/tabWorkOrder/pages/index/index", "pages/tabWorkOrder/pages/index/index",
"pages/tabMine/pages/index/index", "pages/tabMine/pages/index/index",
"pages/tabDateIndex/pages/tabDateIndex", "pages/tabDateIndex/pages/tabDateIndex",
"pages/log/log",
"pages/changeScene/changeScene", "pages/changeScene/changeScene",
"pages/materails/index",
"pages/h5AuthPhone/h5AuthPhone", "pages/h5AuthPhone/h5AuthPhone",
"pages/tabRepairOrder/pages/index/index" "pages/tabRepairOrder/pages/index/index"
], ],
...@@ -92,7 +90,8 @@ ...@@ -92,7 +90,8 @@
"pages": [ "pages": [
"pages/technicianSetup/technicianSetup", "pages/technicianSetup/technicianSetup",
"pages/completeBuild/completeBuild", "pages/completeBuild/completeBuild",
"pages/collectCoupons/collectCoupons" "pages/collectCoupons/collectCoupons",
"pages/log/log"
] ]
}, },
{ {
...@@ -136,7 +135,8 @@ ...@@ -136,7 +135,8 @@
"pages/refundOperationList/refundOperationList", "pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList", "pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply", "pages/refundApply/refundApply",
"pages/createAConstructionOrder/createAConstructionOrder" "pages/createAConstructionOrder/createAConstructionOrder",
"pages/materails/index"
] ]
}, },
{ {
...@@ -145,7 +145,6 @@ ...@@ -145,7 +145,6 @@
"pages": [ "pages": [
"pages/carQuotation/signature/signature", "pages/carQuotation/signature/signature",
"pages/carQuotation/index/index", "pages/carQuotation/index/index",
"pages/carQuotation/relevanceOrderSelect/index",
"pages/carQuotation/fullSignture/fullSignture", "pages/carQuotation/fullSignture/fullSignture",
"pages/carQuotation/schemeConfirmation/schemeConfirmation", "pages/carQuotation/schemeConfirmation/schemeConfirmation",
"pages/carQuotation/CarQuotationDetail/CarQuotationDetail", "pages/carQuotation/CarQuotationDetail/CarQuotationDetail",
...@@ -159,15 +158,12 @@ ...@@ -159,15 +158,12 @@
"pages/carEquity/carBrands/carBrands", "pages/carEquity/carBrands/carBrands",
"pages/carEquity/carSeries/carSeries", "pages/carEquity/carSeries/carSeries",
"pages/TabBar/equityPage", "pages/TabBar/equityPage",
"pages/carEquity/previewContract/previewContract",
"pages/collegeScene/collegeScene", "pages/collegeScene/collegeScene",
"pages/clueList/clueList", "pages/clueList/clueList",
"pages/clueDetail/clueDetail", "pages/clueDetail/clueDetail",
"pages/residentTarget/residentTarget", "pages/residentTarget/residentTarget",
"pages/aiInspection/aiInspection",
"pages/aiInspectionDetail/aiInspectionDetail", "pages/aiInspectionDetail/aiInspectionDetail",
"pages/aiInspectionReception/aiInspectionReception", "pages/aiInspectionReception/aiInspectionReception",
"pages/employeeInspection/employeeInspection",
"pages/trainingMaterials/trainingMaterials", "pages/trainingMaterials/trainingMaterials",
"pages/trainingMaterials/pages/playVideo/index", "pages/trainingMaterials/pages/playVideo/index",
"pages/createDeafeatOrder/createDeafeatOrder", "pages/createDeafeatOrder/createDeafeatOrder",
...@@ -183,8 +179,6 @@ ...@@ -183,8 +179,6 @@
"pages/aiCheck/result/result", "pages/aiCheck/result/result",
"pages/aiCheck/scene/scene", "pages/aiCheck/scene/scene",
"pages/aiCheck/start/start", "pages/aiCheck/start/start",
"pages/orderList/orderList",
"pages/equityQualityOrderList/equityQualityOrderList",
"pages/createDeafeatOrderBefore/createDeafeatOrderBefore", "pages/createDeafeatOrderBefore/createDeafeatOrderBefore",
"pages/receptionRecords/receptionRecords", "pages/receptionRecords/receptionRecords",
"pages/aiCheck/redundance/redundance", "pages/aiCheck/redundance/redundance",
...@@ -289,17 +283,12 @@ ...@@ -289,17 +283,12 @@
"usingComponents": { "usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell", "gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm", "calendar": "/components/CalendarMonth/CalendarMonth",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar", "navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput", "search-input": "/components/SearchInput/SearchInput",
"order-popup": "/components/OrderPopup/OrderPopup",
"date-picker": "/components/DatePicker/DatePicker",
"remark-popup": "/components/RemarkPopup/RemarkPopup", "remark-popup": "/components/RemarkPopup/RemarkPopup",
"tab-bar": "/components/TabBar/TabBar", "tab-bar": "/components/TabBar/TabBar",
"order-confirm": "/components/Confirm/Confirm",
"qr-box": "components/Qrbox/Qrbox",
"modal": "components/modal/modal", "modal": "components/modal/modal",
"tips-bottom": "components/tipsBottom/index", "tips-bottom": "components/tipsBottom/index",
"gl-image": "components/GlImage/index", "gl-image": "components/GlImage/index",
...@@ -309,10 +298,9 @@ ...@@ -309,10 +298,9 @@
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index", "van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index", "glsx-privacy": "/components/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData", "empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index", "van-switch": "@vant/weapp/switch/index"
"inventory-info": "components/InventoryInfo/InventoryInfo"
}, },
"preloadRule": { "preloadRule": {
"pages/tabWorkOrder/pages/index/index": { "pages/tabWorkOrder/pages/index/index": {
......
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
// components/subShopMerchant/subShopMerchant.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) {
let {
copyArtificerList,
artificerSelectObj,
disabledSelectObj,
deputyFlag
} = this.data
const selectArr = Array.isArray(artificerSelectObj)
? artificerSelectObj?.map(val => {
return val.technicianId || val.id
})
: [artificerSelectObj?.technicianId]
const selectedList = Array.isArray(artificerSelectObj)
? artificerSelectObj
: artificerSelectObj
? [artificerSelectObj]
: []
const ratioMap = selectedList.reduce((m, v) => {
const k = v.technicianId || v.id
m[k] = v.shareRatio
return m
}, {})
copyArtificerList = copyArtificerList.map(i => {
const active = selectArr?.includes(i.id)
const disabled =
disabledSelectObj?.findIndex(val => val.uuid == i.uuid) > -1
const shareRatio = active ? ratioMap[i.id] ?? '' : ''
return { ...i, active, disabled, shareRatio }
})
// 是副手技师选中两个后其余置灰
if (selectArr.length == 2 && deputyFlag) {
copyArtificerList.forEach(i => {
if (!selectArr.includes(i.id)) i.disabled = true
})
}
const sum = (copyArtificerList || [])
.filter(i => i.active)
.map(i => parseInt(i.shareRatio || 0))
.reduce((a, b) => a + (isNaN(b) ? 0 : b), 0)
let showMainShareRatio = 100 - sum
if (showMainShareRatio < 0) showMainShareRatio = 0
if (showMainShareRatio > 100) showMainShareRatio = 100
console.log(copyArtificerList, 'copyArtificerList')
this.setData({
artificerList: wx.$util.deepClone(copyArtificerList),
copyArtificerList,
selectedTechnicianId: selectArr,
searchValue: '',
showMainShareRatio
})
}
}
},
title: String,
orderInfo: Object,
artificerSelectObj: Object,
copyArtificerList: Array,
multiple: Boolean,
disabledSelectObj: {
type: Array
},
deputyFlag: Boolean // 是否选择副手技师
},
/**
* 组件的初始数据
*/
data: {
orderObj: {},
IMG_URL,
artificerList: [],
searchValue: '',
showMainShareRatio: 100
},
/**
* 组件的方法列表
*/
methods: {
noop() {},
changeShareRatio(e) {
let { value } = e.detail
let { index } = e.currentTarget.dataset
let { artificerList, copyArtificerList } = this.data
let v = parseInt(value, 10)
if (isNaN(v)) v = 0
if (v > 100) v = 100
const sumOthers = (artificerList || [])
.filter((i, idx) => i.active && idx !== index)
.map(i => parseInt(i.shareRatio || 0))
.reduce((a, b) => a + (isNaN(b) ? 0 : b), 0)
const allowed = Math.max(0, 100 - sumOthers)
v = Math.min(v, allowed)
artificerList[index].shareRatio = v
const targetId = artificerList[index]?.id
if (Array.isArray(copyArtificerList)) {
const ci = copyArtificerList.findIndex(i => i.id === targetId)
if (ci >= 0) copyArtificerList[ci].shareRatio = v
}
const sum = sumOthers + v
let showMainShareRatio = 100 - sum
if (showMainShareRatio < 0) showMainShareRatio = 0
if (showMainShareRatio > 100) showMainShareRatio = 100
this.setData({
artificerList,
copyArtificerList,
showMainShareRatio
})
},
search(e) {
let { copyArtificerList } = wx.$util.deepClone(this.data)
let { selectedTechnicianId } = this.data
console.log(selectedTechnicianId)
let { value } = e.detail
if (!value) {
copyArtificerList.map(i => {
i.active = false
if (selectedTechnicianId.includes(i.id)) i.active = true
return i
})
this.setData({
artificerList: copyArtificerList
})
} else {
let arr = []
copyArtificerList.map(i => {
i.active = false
if (selectedTechnicianId.includes(i.id)) i.active = true
if (i.staffName.indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
artificerList: arr
})
}
},
changeItem(e) {
let { target } = e.currentTarget.dataset
let { artificerList, multiple, deputyFlag, disabledSelectObj } = this.data
let { copyArtificerList } = wx.$util.deepClone(this.data)
// 禁用项不允许点击切换
if (target.disabled) return
const targetId = target?.id
// 同步切换 active 状态;在单选模式下,其他项自动取消激活
// 对未激活项清空 shareRatio,保持分成比例与选中状态一致
const updateList = list =>
list.map(i => {
const active =
i.id === targetId ? !i.active : multiple ? i.active : false
return { ...i, active, shareRatio: active ? i.shareRatio : '' }
})
artificerList = updateList(artificerList)
copyArtificerList = updateList(copyArtificerList)
// 当前选中的技师 id 集合
const arr = copyArtificerList.filter(v => v.active).map(v => v.id)
// 副手模式:选满两个后将其他置灰;未满两个时根据预设禁用恢复
if (deputyFlag) {
if (arr.length === 2) {
const disableIfNotSelected = i => ({
...i,
disabled: !arr.includes(i.id)
})
artificerList = artificerList.map(disableIfNotSelected)
copyArtificerList = copyArtificerList.map(disableIfNotSelected)
} else {
const isPresetDisabled = i =>
disabledSelectObj?.findIndex(val => val.uuid == i.uuid) > -1
const enableWithPreset = i => ({
...i,
disabled: isPresetDisabled(i)
})
artificerList = artificerList.map(enableWithPreset)
copyArtificerList = copyArtificerList.map(enableWithPreset)
}
}
// 更新视图与选中集合(单选返回当前 id,多选返回所有选中)
const sum = (artificerList || [])
.filter(i => i.active)
.map(i => parseInt(i.shareRatio || 0))
.reduce((a, b) => a + (isNaN(b) ? 0 : b), 0)
let showMainShareRatio = 100 - sum
if (showMainShareRatio < 0) showMainShareRatio = 0
if (showMainShareRatio > 100) showMainShareRatio = 100
this.setData({
artificerList,
copyArtificerList,
selectedTechnicianId: multiple ? arr : [targetId],
showMainShareRatio
})
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
artificerSelectPopup: false
})
this.triggerEvent('cancel')
},
// 打开生意助手小程序
goMiniprogram() {
wx.navigateToMiniProgram({
appId: 'wx2c28337db96364d2'
})
},
async confirm() {
let {
copyArtificerList,
orderInfo,
artificerSelectObj,
selectedTechnicianId,
deputyFlag
} = this.data
let arr = copyArtificerList?.filter(v => v.active) || []
console.log(arr, 'arr')
if (!arr.length) {
// 未选技师 将selectedTechnicianId清除
this.setData({
selectedTechnicianId: []
})
return wx.$util.showToast('请选择技师')
}
if (deputyFlag) {
const invalid = arr.some(
v =>
v.shareRatio === '' ||
v.shareRatio === undefined ||
v.shareRatio === null
)
if (invalid) {
return wx.$util.showToast('请填写副手技师分成比例')
}
}
let obj = {
...artificerSelectObj,
technicianUuid: arr[0]?.uuid || '',
technicianId: arr[0]?.id || '',
technicianName: arr[0]?.staffName || '',
selectedTechnicians: arr
}
// orderInfo.technicianUuid = arr[0]?.uuid || ''
// orderInfo.technicianId = arr[0]?.id || ''
// orderInfo.technicianName = arr[0]?.staffName || ''
this.triggerEvent('confirm', obj)
}
}
})
/* components/subShopMerchant/subShopMerchant.wxss */
.artificer-select-popup-box {
height: 100%;
width: calc(100% + var(--fontSize64));
transform: translateX(calc(-1 * var(--fontSize32)));
}
.sub-title {
height: var(--fontSize100);
font-size: var(--fontSize32);
color: #333333;
background-color: #fff;
z-index: 2;
border-bottom: var(--fontSize2) solid #F9F9F9;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.box {
height: 100%;
padding: 0 var(--fontSize32);
}
.artificer-box {
height: calc(100% - var(--fontSize102));
overflow: hidden;
transition: all .25s;
}
.box-title {
color: #333333;
font-size: var(--fontSize32);
height: var(--fontSize88);
line-height: var(--fontSize88);
display: flex;
align-items: center;
/* justify-content: space-between; */
}
.box-title .tips {
font-size: 24rpx;
margin-left: 8rpx;
color: #888888;
}
.box-title .tips text {
color: #347BFF;
}
.artificerList {
width: calc(100% - var(--fontSize50));
height: var(--fontSize98);
display: flex;
align-items: center;
font-size: var(--fontSize28);
font-size: 28rpx;
color: #292D33;
padding: 0 var(--fontSize25);
transition: all .5s;
.shareRatioBox {
display: flex;
font-size: 24rpx;
color: #5A5E66;
align-items: center;
font-weight: 400;
.shareRatioInput {
box-sizing: border-box;
width: 88rpx;
height: 68rpx;
margin: 0 8rpx;
background: #FFFFFF;
padding: 0 16rpx;
border: 2rpx solid #EFF0F2;
border-radius: 12rpx;
}
}
}
.checked_img {
width: var(--fontSize32);
height: var(--fontSize32);
flex-shrink: 0;
margin-right: var(--fontSize20);
}
.artificerList .text_box {
flex: 1;
border-bottom: var(--fontSize2) solid #F9F9F9;
height: 100%;
line-height: var(--fontSize98);
}
.artificerList .text_box .disabled {
opacity: .5;
}
.artificerList.active {
color: #347BFF;
font-weight: 700;
position: relative;
}
.bottomTips {
text-align: center;
color: #5a5e66;
font-size: 24rpx;
margin-top: 10rpx;
.text {
color: #347bff;
}
}
\ No newline at end of file \ No newline at end of file
<popup
show="{{ show }}"
bindconfirm="confirm"
bindcancel="cancel"
height="85%"
slotStyle="height: calc(100% - var(--fontSize150));"
>
<view class="artificer-select-popup-box">
<view class="box">
<view class="sub-title text-center">{{title}}</view>
<view class="artificer-box">
<search-input bindsearch="search" value="{{ searchValue }}" />
<view class="box-title">
<view>技师</view>
<!-- <view class="tips">使用<text bind:tap="goMiniprogram">生意助手小程序</text>登录创建技师</view> -->
<view class="tips" wx:if="{{ multiple && deputyFlag }}">产生副手技师,请主技师为副手技师分配整单提成比例</view>
</view>
<block wx:if="{{ artificerList.length }}">
<scroll-view
scroll-y
style="{{ multiple? 'height: calc(100% - var(--fontSize236))':'height: calc(100% - var(--fontSize194))' }}"
enhanced="{{ true }}"
show-scrollbar="{{ false }}"
>
<block wx:for="{{ artificerList }}" wx:key="index">
<view
class="artificerList {{ item.active?'active':'' }}"
bindtap="changeItem"
data-target="{{ item }}"
data-index="{{ index }}"
>
<view class="checked_img">
<block wx:if="{{ multiple }}">
<image src="{{ item.active ? '../images/radio.png' : '../images/radio_icon.png' }}" />
</block>
<block wx:else>
<image wx:if="{{ item.active }}" src="{{ IMG_URL }}checked.png"></image>
</block>
</view>
<view class="text_box">
<view class="text-hide {{ item.disabled ? 'disabled' : '' }}">{{item.staffName}}</view>
</view>
<view class="shareRatioBox" wx:if="{{ multiple && item.active && deputyFlag }}">
整单分成比例
<input
placeholder="整数"
class="shareRatioInput"
type="number"
maxlength="3"
value="{{ item.shareRatio }}"
placeholder-style="color:#BEC1C7"
catchinput="changeShareRatio"
catchtap="noop"
data-index="{{ index }}"
/>
%
</view>
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<empty-data style="width: 100%;" />
</block>
<view class="tips bottomTips" wx:if="{{ multiple && deputyFlag }}">
主技师整单分成比例
<text class="text">{{ showMainShareRatio }}%</text>
</view>
</view>
</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() { },
/** 日期手动改 */
resetData(date) {
// let _this = this[_CalendarObject_]
let { monthList, current } = this.data
console.log(monthList)
console.log(date)
// return
monthList.map(x => {
x.data.map(i => (i.active = false))
})
monthList.map((item, index) => {
item.data.map(ele => {
if (ele.data == date) {
console.log(ele.data)
console.log(current)
ele.active = true
current = index
}
})
})
this.setData({
monthList,
current
})
},
// resetData(date) {
// // console.log(this.resetData)
// // this.getUserDayReport(n)[CalendarFunction]
// // this[CalendarFunction].resetData(date)
// // console.log(date)
// // console.log(this[CalendarFunction].setCalenderBodyHeight)
// },
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
console.log(e)
let { disabled } = this.data
if (disabled) return false;
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
},
dateChange(e) {
let { current, source } = e.detail
/**
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
*/
source == 'touch' &&
this.setData({
current
})
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
this.setData({
current: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
}
},
ready() {
this[CalendarFunction] = new Calendar(this)
}
})
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot/>
</view>
<!-- 弹框模式 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)? "isFullSucreen":""}} ' style="height:{{height}};">
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<block wx:if="{{rangeAll && dateType == 'range'}}">
<view class="calender-all" style="color:{{calenderColor}};" bindtap="chooseAll">累计</view>
</block>
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="../images/close.png" class='calender-close-image' />
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<picker
class='calender-subtitle'
bindchange="changeDate"
bindcancel='showShortcutPicker'
value="{{current}}"
range="{{dateList}}"
wx:if='{{shortcut}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}' />
</view>
</picker>
<view class='calender-subtitle' wx:else>{{dateList[current]}}</view>
</block>
<view class='calendar-weekdays'>
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<swiper
class='calender-swiper'
bindchange='dateChange'
current='{{current}}'
vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block
wx:for='{{item.data}}'
wx:for-item='i'
wx:for-index='ind'
wx:key='ind'>
<view
class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}'
style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}"
bindtap="choose"
data-index='{{index}}'
data-ind='{{ind}}'
data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
width: 100%;
height: 100%;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, 0.5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender 0.5s forwards;
color: #333;
}
.calender-view.true {
border-radius: var(--fontSize40) var(--fontSize40) 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender 0.5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 var(--fontSize4) var(--fontSize20) rgba(0, 0, 0, 0.1);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: var(--fontSize88);
text-align: center;
position: relative;
font-size: var(--fontSize32);
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: var(--fontSize40);
transform: translateY(-50%);
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: var(--fontSize28);
}
.calender-subtitle .arrow {
width: var(--fontSize14);
height: var(--fontSize14);
border-top: var(--fontSize2) solid transparent;
border-right: var(--fontSize2) solid #ccc;
border-bottom: var(--fontSize2) solid #ccc;
border-left: var(--fontSize2) solid transparent;
transform: rotate(45deg) translateY(calc(-1 * var(--fontSize4)));
margin-left: var(--fontSize16);
transition: all 0.3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(calc(-1 * var(--fontSize4)));
}
.calender-close {
position: absolute;
width: var(--fontSize40);
height: var(--fontSize40);
top: 50%;
right: var(--fontSize24);
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: var(--fontSize24);
height: var(--fontSize24);
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: var(--fontSize24);
line-height: var(--fontSize60);
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: var(--fontSize20) 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: #f2f3f5;
text-shadow: 0 var(--fontSize4) var(--fontSize20) #f2f3f5;
font-size: var(--fontSize320);
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: var(--fontSize32);
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: var(--fontSize8);
}
.calender-day.disable {
opacity: 0.25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: var(--fontSize14);
}
@media screen and (min-width: 1000px) {
.calender-day .text {
display: flex;
justify-content: center;
align-items: center;
}
.calender-tips {
margin-left: var(--fontSize5);
}
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: var(--fontSize14) var(--fontSize32);
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: var(--fontSize72);
font-size: var(--fontSize28);
color: #fff;
border-radius: var(--fontSize999);
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: 0.3;
}
\ No newline at end of file \ No newline at end of file
export default {
properties: {
calenderHeight: {
// 兼容新版本不能使用type 改用optionalTypes 属性避免提示错误
type: String,
optionalTypes: [Number]
// optionalTypes: [String]
},
title: String, // 标题名称
disabled: {
type: Boolean,
value: false
}, //是否能选中
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: Number,
optionalTypes: [Number],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean,
isComponents: Boolean,
maxDayRange: Number, // 最大可选范围长度
maxDayRangeType: String // 最大可选范围类型
// dataDateStr: {
// type: String,
// observer: function (n) {
// // console.log(n)
// this.resetData(n)
// }
// } //日期变化
// forceFullSucreen: {
// // 兼容isFullSucreen 属性不准确的情况
// type: Boolean,
// value: false
// }
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: []
}
}
// components/Calendar/Calendar.js // components/CalendarMonth/CalendarMonth.js
import Calendar from './Calendar_Function' import Calendar from './Calendar_Function'
import CalendarMonthOnly from './Calendar_Function_monthOnly'
import _component_ from './Static_Properties' import _component_ from './Static_Properties'
import { CLOSE_ICON_URL } from '../../utils/imageBase.js'
import {
getInitialDayType,
resolveMonthOnly,
resolveDayOnly,
buildMonthSetDataPayload,
shouldUseSingleMonthView,
shouldRebuildMonthListOnBoundsChange
} from './calendarMonth.helpers.js'
const CalendarFunction = Symbol('CalendarFunction') const CalendarFunction = Symbol('CalendarFunction')
Component({ Component({
/**
* 组件的属性列表
*/
properties: _component_.properties, properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data, data: _component_.data,
/**
* 组件的方法列表
*/
methods: { methods: {
noScroll() {}, noScroll() {},
/** 确保月份数据已 lazy 构建 */
ensureMonthListReady() {
if (this._monthListReady || this._monthOnlyMode) return
this[CalendarFunction].setMonthList()
this._monthListReady = true
},
/** 日期手动改(原全局 Calendar API,createArchives/defeatOrder 等仍调用) */
resetData(date) {
this.ensureMonthListReady()
let { monthList, current } = this.data
monthList.map(x => {
x.data.map(i => {
i.active = false
i.rangeLabel = ''
})
})
monthList.map((item, index) => {
item.data.map(ele => {
if (ele.data == date) {
ele.active = true
current = index
}
})
})
this.setData(buildMonthSetDataPayload(this.data, { monthList, current }))
},
setCalenderBodyHeight() { setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight() this[CalendarFunction].setCalenderBodyHeight()
}, },
showCalendar(e) { showCalendar(e) {
if (this.data.disabled) return false
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || '' let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show' let result = type === 'show'
if (!result) { if (!result) {
this.setData({ this.setData({ hideCalendar: true })
hideCalendar: true
})
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
show: result, show: result,
...@@ -36,91 +64,156 @@ Component({ ...@@ -36,91 +64,156 @@ Component({
}) })
}, 300) }, 300)
} else { } else {
this.setData({ if (!this._monthOnlyMode) {
show: result this.ensureMonthListReady()
}) }
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight() this.setData({ show: result })
if (!this.data.calenderBodyHeight) {
this[CalendarFunction].setCalenderBodyHeight()
}
} }
this.triggerEvent('tapCalendar') this.triggerEvent('tapCalendar')
}, },
dateChange(e) { dateChange(e) {
let { current, source } = e.detail let { current, source } = e.detail
let {dayType} = this.data let { dayType, dayOnly } = this.data
// console.log(source) if (source !== 'touch') return
// console.log(current)
/** if (dayType) {
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。 if (!shouldUseSingleMonthView(dayOnly, false, false)) {
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制 this[CalendarFunction].onSwiperDateChange(current)
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug }
*/ } else {
source == 'touch' && this.setData({ yearCurrent: current })
this.setData({ }
[dayType?'current':'yearCurrent']:current
})
}, },
bindDateChange: function (e) { bindDateChange: function (e) {
var date = e.detail.value var date = e.detail.value
console.log(date) this.setData({ date: date })
this.setData({
date: date
})
this.post_data.year = date this.post_data.year = date
this.renderHtml() this.renderHtml()
}, },
choose(e) { choose(e) {
let { dateType, minDate, maxDate } = this.data let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset let { data } = e.currentTarget.dataset
// console.log((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) if (
console.log(minDate && Date.parse(minDate) > Date.parse(data)) (minDate && Date.parse(minDate) > Date.parse(data)) ||
console.log(maxDate && Date.parse(maxDate) < Date.parse(data)) (maxDate && Date.parse(maxDate) < Date.parse(data))
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return ) {
return
}
this[CalendarFunction][dateType](e) this[CalendarFunction][dateType](e)
}, },
monChoose(e) { monChoose(e) {
let { data, type } = e.currentTarget.dataset const { data, type } = e.currentTarget.dataset
if (data.disable) return false if (data.disable) return false
if (this._monthOnlyMode) {
this[CalendarFunction][this.properties.dateType](e)
return
}
this[CalendarFunction][type](e) this[CalendarFunction][type](e)
}, },
done() { done() {
let { dateType } = this.data if (this._monthOnlyMode) {
this[CalendarFunction].done(dateType) this[CalendarFunction].done()
return
}
this[CalendarFunction].done(this.data.dateType)
}, },
changeDate(e) { changeDate(e) {
let { value } = e.detail let { value } = e.detail
console.log(value) if (this._monthOnlyMode) {
this.setData({ this.setData({ current: value })
current: value return
}) }
this[CalendarFunction].onPickerMonthChange(Number(value))
}, },
bindYearChange(e) { bindYearChange(e) {
let { value } = e.detail let { value } = e.detail
this.setData({ this.setData({ yearCurrent: value })
yearCurrent: value
})
}, },
showShortcutPicker() { showShortcutPicker() {
this.setData({ this.setData({ showShortcut: !this.data.showShortcut })
showShortcut: !this.data.showShortcut
})
}, },
showShortcutPickerYear() { showShortcutPickerYear() {
this.setData({ this.setData({ showShortcutYear: !this.data.showShortcutYear })
showShortcutYear: !this.data.showShortcutYear
})
}, },
chooseAll() { chooseAll() {
this.ensureMonthListReady()
this[CalendarFunction].chooseAll() this[CalendarFunction].chooseAll()
}, },
changeModel() { changeModel() {
let { dayType } = this.data let { dayType } = this.data
this.setData({ this.setData({ dayType: dayType == 0 ? 1 : 0 })
dayType: dayType == 0 ? 1 : 0 },
})
/**
* minDate/maxDate 变更时失效 lazy monthList,弹层打开时立即重建
* @param {string} minDate
* @param {string} maxDate
*/
onCalendarBoundsChange(minDate, maxDate) {
if (!this[CalendarFunction]) return
const prevMin = this._lastBoundsMin
const prevMax = this._lastBoundsMax
this._lastBoundsMin = minDate
this._lastBoundsMax = maxDate
if (prevMin === undefined && prevMax === undefined) return
if (
!shouldRebuildMonthListOnBoundsChange(prevMin, prevMax, minDate, maxDate)
) {
return
}
this._monthListReady = false
if (this.data.show && !this._monthOnlyMode) {
this[CalendarFunction].setMonthList()
this._monthListReady = true
}
} }
}, },
ready() {
// console.log(this) observers: {
// return 'minDate, maxDate': function (minDate, maxDate) {
this.onCalendarBoundsChange(minDate, maxDate)
}
},
attached() {
const monthOnly = resolveMonthOnly(
this.properties.monthOnly,
this.properties.monType
)
const dayOnly = resolveDayOnly(this.properties.dayOnly, monthOnly)
this._monthOnlyMode = monthOnly
this._dayOnlyMode = dayOnly
this._monthListReady = false
if (monthOnly) {
this.setData({
dayType: getInitialDayType({ monthOnly: true }),
closeIconUrl: CLOSE_ICON_URL,
dayOnly: false
})
this[CalendarFunction] = new CalendarMonthOnly(this)
this._monthListReady = true
} else {
this.setData({
dayType: getInitialDayType({ monthOnly: false, dayOnly }),
closeIconUrl: CLOSE_ICON_URL,
dayOnly
})
this[CalendarFunction] = new Calendar(this) this[CalendarFunction] = new Calendar(this)
} }
}
}) })
<view class='calender-picker' bindtap="showCalendar" data-type='show'> <view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot /> <slot />
</view> </view>
<!-- 弹框模式 --> <view class='calender-box' wx:if="{{show}}" catchtouchmove="noScroll">
<!-- 先取消 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" /> <view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} ' style="height:{{height}};"> <view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} {{ monthOnly || monType ? "calender-view--monthOnly" : "" }}' style="height:{{height}};--calender-color:{{calenderColor}};">
<!-- 按日期选择 开始 -->
<view class='calender-header'> <view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'> <view class='calender-title' wx:if='{{showTitle}}'>
<!-- <block wx:if="{{rangeAll && dateType == 'range'}}"> --> <view wx:if="{{!monthOnly && !monType && !dayOnly}}" class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
<!-- bindtap="chooseAll" -->
<view class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
{{dateObj['tips'][dayType]}} {{dateObj['tips'][dayType]}}
</view> </view>
<!-- </block> -->
{{title||'日期选择'}} {{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar"> <view class='calender-close' bindtap="showCalendar">
<image src="./images/close.png" class='calender-close-image' /> <image src="{{ closeIconUrl }}" class='calender-close-image' mode="aspectFit" />
</view> </view>
</view> </view>
<block wx:if='{{showSubTitle}}'> <block wx:if='{{showSubTitle}}'>
<!-- <block hidden="{{!dayType}}"> --> <picker wx:if="{{!monthOnly && !monType && shortcut && dayType}}" class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}">
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut&&dayType}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker"> <view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}} {{dateList[current]}}
<view class='arrow {{showShortcut}}' /> <view class='arrow {{showShortcut}}' />
</view> </view>
</picker> </picker>
<picker class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" wx:elif='{{shortcut&&!dayType}}' bindchange="bindYearChange"> <picker wx:elif="{{shortcut && (!dayType || monthOnly || monType)}}" class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" bindchange="bindYearChange">
<view class='calender-subtitle-text' bindtap="showShortcutPickerYear`"> <view class='calender-subtitle-text' bindtap="showShortcutPickerYear">
{{monPickList[yearCurrent]}} {{monPickList[yearCurrent]}}
<view class='arrow {{showShortcutYear}}' /> <view class='arrow {{showShortcutYear}}' />
</view> </view>
</picker> </picker>
<view class='calender-subtitle' wx:else>{{monPickList[current]}}</view> <view class='calender-subtitle' wx:else>{{monPickList[current]}}</view>
<!-- </block> -->
<!-- <block hidden="{{dayType}}"> -->
<!-- </block> -->
</block> </block>
<view class='calendar-weekdays' hidden="{{!dayType}}"> <view class='calendar-weekdays' hidden="{{!dayType || monthOnly || monType}}">
<block wx:for='{{weekdays}}' wx:key='index'> <block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view> <view class='calendar-weekday'>{{item}}</view>
</block> </block>
</view> </view>
</view> </view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})"> <view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<!-- 日期 --> <block wx:if="{{dayOnly || (!monthOnly && !monType)}}">
<swiper hidden="{{!dayType}}" class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'> <!-- dayOnly:单月渲染,无全量 swiper -->
<block wx:for='{{monthList}}' wx:key='index'> <view wx:if="{{dayOnly && dayType && monthList.length}}" class="calender-month-panel">
<swiper-item> <view class='calender-mark box-center' wx:if="{{!hideMark}}">{{monthList[current].mark}}</view>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'> <view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'> <view wx:for='{{monthList[current].data}}' wx:for-item='i' wx:for-index='ind' wx:key='data' class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}} {{i.middle?"calender-day--middle":""}}' bindtap="choose" data-index='{{current}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'> <text class="calender-day-text">{{i.day}}<text wx:if="{{i.rangeLabel}}" class="calender-tips">{{i.rangeLabel}}</text></text>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view> </view>
</view> </view>
</view> </view>
</block> <!-- 全功能:三窗 swiper -->
<swiper wx:elif="{{dayType && displayMonths.length}}" class='calender-swiper' bindchange='dateChange' current='{{swiperCurrent}}' vertical='{{vertical}}'>
<swiper-item wx:for='{{displayMonths}}' wx:key='monthIndex'>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<view wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='data' class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}} {{i.middle?"calender-day--middle":""}}' bindtap="choose" data-index='{{item.monthIndex}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<text class="calender-day-text">{{i.day}}<text wx:if="{{i.rangeLabel}}" class="calender-tips">{{i.rangeLabel}}</text></text>
</view>
</view> </view>
</swiper-item> </swiper-item>
</block>
</swiper> </swiper>
<!-- 月份 wx:if="{{!dayType}}" --> </block>
<div class='calenderMonth'> <div class='calenderMonth' wx:if="{{monthOnly || monType || (!dayOnly && !dayType)}}">
<swiper hidden="{{dayType}}" class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'> <swiper class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'>
<block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item class="calenderMonth"> <swiper-item class="calenderMonth">
<block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex"> <block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex">
<view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{monItem.start?'active':''}} {{monItem.select?'select':''}} {{monItem.end?'end':''}} {{monItem.disable?'disable':''}}"> <view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{ monthOnly || monType ? (monItem.active?'active':'') : (monItem.start?'active':'') }} {{ !monthOnly && !monType && monItem.select ? 'select' : '' }} {{ !monthOnly && !monType && monItem.end ? 'end' : '' }} {{monItem.disable?'disable':''}}">
<view>{{monItem.label}}</view> <view>{{monItem.label}}</view>
<view class="text" wx:if="{{monItem.start}}">开始</view> <view class="text" wx:if="{{!monthOnly && !monType && monItem.start}}">开始</view>
<view class="text" wx:if="{{monItem.end}}">结束</view> <view class="text" wx:if="{{!monthOnly && !monType && monItem.end}}">结束</view>
</view> </view>
</block> </block>
</swiper-item> </swiper-item>
...@@ -85,7 +74,6 @@ ...@@ -85,7 +74,6 @@
</swiper> </swiper>
</div> </div>
</view> </view>
<!-- 月份 结束 -->
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'> <view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done"> <view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}} {{confirmText||'确定'}}
......
...@@ -178,27 +178,52 @@ ...@@ -178,27 +178,52 @@
display: flex; display: flex;
} }
.calender-month-panel {
height: 100%;
position: relative;
}
.calender-day.active { .calender-day.active {
color: #fff; color: #fff;
border-radius: var(--fontSize8); border-radius: var(--fontSize8);
background: var(--calender-color, #00A479);
} }
.calender-day.disable { .calender-day.disable {
opacity: .25; opacity: .25;
} }
.calender-day .calender-middle { .calender-day--middle {
color: var(--calender-color, #00A479);
}
.calender-day--middle::before {
content: '';
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
background: var(--calender-color, #00A479);
opacity: 0.1; opacity: 0.1;
} }
.calender-day .text { .calender-day-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center; text-align: center;
width: 100%; width: 100%;
font-size: var(--fontSize32);
}
.calender-day .calender-middle {
display: none;
}
.calender-day .text {
display: none;
} }
.calender-tips { .calender-tips {
...@@ -289,6 +314,11 @@ flex-wrap: wrap; */ ...@@ -289,6 +314,11 @@ flex-wrap: wrap; */
border-radius: 8px 0px 0px 8px; border-radius: 8px 0px 0px 8px;
} }
/* monthOnly 单选:四角圆角,非范围起点样式(对齐原 CalendarMonthSingle) */
.calender-view--monthOnly .monItem.active {
border-radius: 8px;
}
.monItem.end { .monItem.end {
color: #fff; color: #fff;
background: #347BFF; background: #347BFF;
......
...@@ -77,11 +77,26 @@ export default { ...@@ -77,11 +77,26 @@ export default {
maxDate: String, maxDate: String,
/**隐藏水印 */ /**隐藏水印 */
hideMark: Boolean, hideMark: Boolean,
isComponents: Boolean isComponents: Boolean,
disabled: {
type: Boolean,
value: false
},
maxDayRange: Number,
maxDayRangeType: String,
/** 仅日期模式(合并原全局 Calendar,隐藏日/月切换) */
dayOnly: { type: Boolean, value: true },
/** 仅月份模式(合并原 CalendarMonthSingle) */
monthOnly: { type: Boolean, value: false },
/** @deprecated 兼容 tabIndex,等同 monthOnly */
monType: Boolean
}, },
data: { data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'], weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [], monthList: [],
/** 三窗 swiper 可见月份(全功能模式) */
displayMonths: [],
swiperCurrent: 1,
dateList: [], dateList: [],
monPickList: [], monPickList: [],
current: 0, current: 0,
...@@ -179,6 +194,7 @@ export default { ...@@ -179,6 +194,7 @@ export default {
// } // }
// ], // ],
dayType: 1, // 1 日期 0 月份 默认日期 dayType: 1, // 1 日期 0 月份 默认日期
closeIconUrl: '',
dateObj: { dateObj: {
// switch:'按月份', // switch:'按月份',
// type:'day', // type:'day',
......
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
this.triggerEvent('tapCalendar')
},
dateChange(e) {
let { current, source } = e.detail
// console.log(source)
console.log(current)
/**
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
*/
source == 'touch' &&
this.setData({
current
})
},
bindDateChange: function (e) {
var date = e.detail.value
console.log(date)
this.setData({
date: date
})
this.post_data.year = date
this.renderHtml()
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
// console.log((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data)))
console.log(minDate && Date.parse(minDate) > Date.parse(data))
console.log(maxDate && Date.parse(maxDate) < Date.parse(data))
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
monChoose(e) {
let { dateType } = this.data
let { data, type } = e.currentTarget.dataset
if (data.disable) return false
this[CalendarFunction][dateType](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
console.log(value)
this.setData({
current: value
})
},
bindYearChange(e) {
let { value } = e.detail
this.setData({
yearCurrent: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
showShortcutPickerYear() {
this.setData({
showShortcutYear: !this.data.showShortcutYear
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
},
changeModel() {
let { dayType } = this.data
this.setData({
dayType: dayType == 0 ? 1 : 0
})
}
},
ready() {
// console.log(this)
// return
this[CalendarFunction] = new Calendar(this)
}
})
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot />
</view>
<!-- 弹框模式 -->
<!-- 先取消 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} ' style="height:{{height}};">
<!-- 按日期选择 开始 -->
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<!-- <block wx:if="{{rangeAll && dateType == 'range'}}"> -->
<!-- bindtap="chooseAll" -->
<!-- <view class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
{{dateObj['tips'][dayType]}}
</view> -->
<!-- </block> -->
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="./images/close.png" class='calender-close-image' />
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<!-- <block hidden="{{!dayType}}"> -->
<!-- <picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut&&dayType}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}' />
</view>
</picker> -->
<!-- wx:elif='{{shortcut&&!dayType}}' -->
<picker class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" bindchange="bindYearChange">
<view class='calender-subtitle-text' bindtap="showShortcutPickerYear`">
{{monPickList[yearCurrent]}}
<view class='arrow {{showShortcutYear}}' />
</view>
</picker>
</block>
<view class='calendar-weekdays' hidden="{{!dayType}}">
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<!-- 日期 -->
<!-- <swiper hidden="{{!dayType}}" class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper> -->
<!-- 月份 wx:if="{{!dayType}}" hidden="{{dayType}}" -->
<div class='calenderMonth'>
<swiper class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'>
<block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item class="calenderMonth">
<block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex">
<!-- {{monItem.end?'end':''}} {{monItem.select?'select':''}}-->
<view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{monItem.active?'active':''}} {{monItem.disable?'disable':''}}">
<view>{{monItem.label}}</view>
<!-- <view class="text" wx:if="{{monItem.start}}">开始</view>
<view class="text" wx:if="{{monItem.end}}">结束</view> -->
</view>
</block>
</swiper-item>
</block>
</swiper>
</div>
</view>
<!-- 月份 结束 -->
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 100%;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: var(--fontSize40) var(--fontSize40) 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 var(--fontSize4) var(--fontSize20) rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: var(--fontSize88);
text-align: center;
position: relative;
font-size: var(--fontSize32);
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: var(--fontSize40);
transform: translateY(-50%);
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: var(--fontSize28);
}
.calender-subtitle .arrow {
width: var(--fontSize14);
height: var(--fontSize14);
border-top: var(--fontSize2) solid transparent;
border-right: var(--fontSize2) solid #ccc;
border-bottom: var(--fontSize2) solid #ccc;
border-left: var(--fontSize2) solid transparent;
transform: rotate(45deg) translateY(calc(-1 * var(--fontSize4)));
margin-left: var(--fontSize16);
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(calc(-1 * var(--fontSize4)));
}
.calender-close {
position: absolute;
width: var(--fontSize40);
height: var(--fontSize40);
top: 50%;
right: var(--fontSize24);
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: var(--fontSize24);
height: var(--fontSize24);
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: var(--fontSize24);
line-height: var(--fontSize60);
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: var(--fontSize20) 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: #F2F3F5;
text-shadow: 0 var(--fontSize4) var(--fontSize20) #F2F3F5;
font-size: var(--fontSize320);
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: var(--fontSize32);
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: var(--fontSize8);
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: var(--fontSize14);
}
@media screen and (min-width: 1000px) {
.calender-day .text {
display: flex;
justify-content: center;
align-items: center;
}
.calender-tips {
margin-left: var(--fontSize5);
}
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-year {
/* display: flex;
flex-wrap: wrap; */
width: 100%;
height: 100%;
}
.calenderMonth {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
}
.monItem {
box-sizing: border-box;
width: 25%;
height: var(--fontSize186);
font-size: var(--fontSize32);
/* text-align: center; */
/* line-height: var(--fontSize186); */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-wrap: wrap;
color: #666666;
border: var(--fontSize1) solid #fff;
}
.monItem .text {
font-size: var(--fontSize20);
margin-top: var(--fontSize5);
}
.monItem.select {
color: #347BFF;
/* background: #347BFF;
opacity: 0.1; */
background-color: rgba(53, 130, 238, .1);
}
.monItem.active {
color: #fff;
background: #347BFF;
/* border-radius: 8px 0px 0px 8px; */
border-radius: 8px ;
}
.monItem.end {
color: #fff;
background: #347BFF;
border-radius: 0px 8px 8px 0px;
}
.monItem.disable {
color: #C8C9CC;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: var(--fontSize14) var(--fontSize32);
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: var(--fontSize72);
font-size: var(--fontSize28);
color: #fff;
border-radius: var(--fontSize999);
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file \ No newline at end of file
export default {
properties: {
calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: String,
optionalTypes: [Number]
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: Number,
optionalTypes: [Number],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean,
isComponents: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
monPickList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: [],
date: '',
yearCurrent: 0,
yearList: [],
rangeMonth: {},
// MonthShowList: [
// {
// label: '1月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '2月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '3月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '4月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '5月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '6月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '7月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '8月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '9月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '10月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '11月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '12月',
// disable: false,
// start: false,
// end: false,
// select: false
// }
// ],
dayType: 1, // 1 日期 0 月份 默认日期
dateObj: {
// switch:'按月份',
// type:'day',
tips: ['按日期', '按月份']
}
}
}
...@@ -360,6 +360,11 @@ Component({ ...@@ -360,6 +360,11 @@ Component({
chooseItem, chooseItem,
}); });
}, },
/** 取消时通知父页面关闭弹框;内部 show 兼容未绑 cancel 的引用页 */
onPopupCancel() {
this.setData({ show: false })
this.triggerEvent('cancel')
},
confirm() { confirm() {
let { chooseItem, equityFlag } = this.data; let { chooseItem, equityFlag } = this.data;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
title="选择车型" title="选择车型"
show="{{show}}" show="{{show}}"
bindconfirm="confirm" bindconfirm="confirm"
bindcancel="onPopupCancel"
height="{{ equityFlag ? '85%' : '90%' }}"> height="{{ equityFlag ? '85%' : '90%' }}">
<view class="car-brands-box"> <view class="car-brands-box">
<search-input bindsearch="searchCar" /> <search-input bindsearch="searchCar" />
......
import { IMG_URL } from '../../utils/imageBase.js'
// components/Confirm/Confirm.js // components/Confirm/Confirm.js
// import order_mixins from '../../tabWorkOrder/pages/order_mixins' // import order_mixins from '../../tabWorkOrder/pages/order_mixins'
import { form } from './form' import { form } from './form'
...@@ -47,6 +48,7 @@ Component({ ...@@ -47,6 +48,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
form, form,
merchantIndex: 0, merchantIndex: 0,
index_4s: 0, index_4s: 0,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="picker-box"> <view class="picker-box">
<view class="picker-text text-hide">{{form.merchantRange.data[merchantIndex].merchantName}}</view> <view class="picker-text text-hide">{{form.merchantRange.data[merchantIndex].merchantName}}</view>
<view class="arrow {{m_moveArrow?'move':''}}"> <view class="arrow {{m_moveArrow?'move':''}}">
<image src="/images/arrow-bottom.png"></image> <image src="{{ IMG_URL }}images/arrow-bottom.png"></image>
</view> </view>
</view> </view>
</picker> </picker>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="picker-box"> <view class="picker-box">
<view class="picker-text text-hide">{{form.range_4s.data[index_4s].merchantName}}</view> <view class="picker-text text-hide">{{form.range_4s.data[index_4s].merchantName}}</view>
<view class="arrow {{moveArrow?'move':''}}"> <view class="arrow {{moveArrow?'move':''}}">
<image src="/images/arrow-bottom.png"></image> <image src="{{ IMG_URL }}images/arrow-bottom.png"></image>
</view> </view>
</view> </view>
</picker> </picker>
......
module.exports = { export const form = {
form: {
merchantRange: { merchantRange: {
data: [], data: [],
key: 'sellerMerchantId', key: 'sellerMerchantId',
...@@ -53,5 +52,4 @@ module.exports = { ...@@ -53,5 +52,4 @@ module.exports = {
key: 'baseSceneCode', key: 'baseSceneCode',
type: 'array' type: 'array'
}, },
},
} }
\ No newline at end of file \ No newline at end of file
// components/CarBrands/CarBrands.js /**
* @file 客户档案选择弹框:分页拉取工单客户列表,不调 setData 外的页面实例。
*/
import api from '../../api/api.js' import api from '../../api/api.js'
// import carLifeApi from '~/packageEquity/carEquityApi' import {
DEFAULT_PAGE_SIZE,
canLoadMorePage,
mapCustomerListWithCarType
} from './customerInfo.pagination.js'
let isNum, num, y, time
Component({ Component({
/**
* 组件的属性列表
*/
properties: { properties: {
show: { show: {
type: Boolean, type: Boolean,
observer: function (n) { observer(n) {
let { if (n) {
isFirst wx.$util.pointRecord(19)
} = this.data
n && wx.$util.pointRecord(19)
if (n && isFirst) {
this.init() this.init()
this.setData({ return
isFirst: false
})
} }
this.resetList()
this.setData({ orderInfo: {} })
} }
}, },
merchantId: { merchantId: {
type: Number, type: Number,
observer: function (n) { observer(n) {
if (n) { if (n) {
// 销售顾问切换门店 获取新的顾客数据 // 销售顾问切换门店时重新拉取顾客数据
this.init() this.init()
} }
} }
...@@ -35,115 +34,157 @@ Component({ ...@@ -35,115 +34,157 @@ Component({
apiType: Number apiType: Number
}, },
/**
* 组件的初始数据
*/
data: { data: {
orderInfo: {}, orderInfo: {},
// storageData: null,
customerList: [], customerList: [],
isFirst: true pageNum: 1,
total: 0,
nothing: false,
keyword: '',
loading: false
}, },
pageLifetimes: { pageLifetimes: {
show: function () { }, show() {},
hide: function () { } hide() {}
}, },
methods: {
/** 阻止弹框列表滚到底后 touchmove 穿透到底层页面 */
noScroll() {},
/** /**
* 组件的方法列表 * 首次打开 / 搜索 / 切换门店入口,重置后加载第一页
* @param {string} [keyword] 搜索关键字
*/ */
methods: {
init(keyword) { init(keyword) {
// console.log('getBrandList') const { apiType } = this.data
// console.log(storageData) if (apiType == 2) {
let { this.loadCustomerFileList(keyword)
merchantId, return
apiType }
} = this.data this.resetList(keyword)
let userInfo = wx.$util.getUserInfo() this.loadList()
let params = { },
merchantId: merchantId || userInfo?.shopMerchantId,
pageSize: 999999, /**
* 重置分页状态(搜索或重新筛选时)
* @param {string} [keyword]
*/
resetList(keyword = '') {
this.setData({
pageNum: 1, pageNum: 1,
// upgradeFinishFlag: 'R', total: 0,
nothing: false,
keyword: keyword || '',
customerList: []
})
},
/**
* 按当前 pageNum 请求一页并追加到 customerList
*/
loadList() {
const { merchantId, pageNum, keyword, loading } = this.data
if (loading) return
const userInfo = wx.$util.getUserInfo()
const params = {
merchantId: merchantId || userInfo?.shopMerchantId,
pageNum,
pageSize: 20,
statusList: [1], statusList: [1],
// ...data
keyword keyword
} }
this.setData({ loading: true })
wx.$util.showLoading()
api.getWorkPackageGoodsList(params).then((res) => {
wx.$util.hideLoading()
const { data, code } = res
let { customerList, total } = this.data
if (code == 0 && data) {
total = data.total || 0
const pageItems = mapCustomerListWithCarType(data.list || [])
customerList = pageNum === 1 ? pageItems : customerList.concat(pageItems)
}
const nothing = !canLoadMorePage(total, pageNum, DEFAULT_PAGE_SIZE)
this.setData({
customerList,
total,
nothing,
loading: false
})
}).catch(() => {
wx.$util.hideLoading()
this.setData({ loading: false })
})
},
/**
* apiType=2 时走客户档案独立接口,保持原全量逻辑
* @param {string} [keyword]
*/
loadCustomerFileList(keyword) {
const { merchantId } = this.data
const userInfo = wx.$util.getUserInfo()
let customerList = [] let customerList = []
//客户线索1.1 、2.1客户列表
wx.$util.showLoading() wx.$util.showLoading()
if (apiType == 2) api.getCustomerFileList({ api.getCustomerFileList({
currentPage: 1, currentPage: 1,
merchantId: merchantId || userInfo?.shopMerchantId, merchantId: merchantId || userInfo?.shopMerchantId,
pageSize: 999999, pageSize: 999999,
search: keyword, search: keyword
}).then(({ code, data }) => { }).then(({ code, data }) => {
wx.$util.hideLoading() wx.$util.hideLoading()
if (code == 0 && data?.list.length) { if (code == 0 && data?.list?.length) {
data.list.map(item => { data.list.forEach((item) => {
customerList.push({ customerList.push({
customer: item, customer: item,
carType: `${item.carBrand || ''}-${item.carChildsBrandName || ''}-${item.carSeriesName || ''}` carType: `${item.carBrand || ''}-${item.carChildsBrandName || ''}-${item.carSeriesName || ''}`
}) })
}) })
} }
this.setData({ this.setData({ customerList })
customerList }).catch(() => {
})
})
else api.getWorkPackageGoodsList(params).then(res => {
wx.$util.hideLoading() wx.$util.hideLoading()
// console.log(res)
// this.setCar(res.data, changeMerchantId)
// console.log(res)
let {
data,
code
} = res
if (code == 0 && data?.list.length) {
data.list = data.list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
}) })
customerList = data.list
}
this.setData({
customerList
})
})
}, },
searchCar(e) { searchCar(e) {
let { const { value } = e.detail
value
} = e.detail
this.init(value) this.init(value)
}, },
/** scroll-view 触底加载下一页 */
scrolltolower() {
const { total, pageNum, nothing, loading } = this.data
if (loading || nothing) return
if (canLoadMorePage(total, pageNum, DEFAULT_PAGE_SIZE)) {
this.setData({ pageNum: pageNum + 1 }, () => this.loadList())
} else {
this.setData({ nothing: true })
}
},
choose(e) { choose(e) {
let { const { item, index } = e.currentTarget.dataset
item, let { customerList } = this.data
index customerList = customerList.map((row) => {
} = e.currentTarget.dataset row.active = false
console.log(item, index) return row
let {
customerList
} = this.data
customerList = customerList.map(item => {
item.active = false
return item
}) })
customerList[index].active = true customerList[index].active = true
let orderInfo = item const orderInfo = item
orderInfo.orderSource = 4 orderInfo.orderSource = 4
// delete orderInfo.orderCode const deleteList = ['associateOrderCode', 'merchantDistributionList', 'expenseCategoryList', 'profitAllocatinList']
// 去除掉错误订单对应的关联码 for (let i = 0; i < deleteList.length; i++) {
// delete orderInfo.associateOrderCode
// 'orderCode',
let deleteList = ['associateOrderCode', 'merchantDistributionList', 'expenseCategoryList', 'profitAllocatinList']
for (var i = 0; i < deleteList.length; i++) {
// console.log(arr[i])
delete orderInfo[deleteList[i]] delete orderInfo[deleteList[i]]
} }
this.setData({ this.setData({
...@@ -151,22 +192,20 @@ Component({ ...@@ -151,22 +192,20 @@ Component({
orderInfo orderInfo
}) })
}, },
/** 取消时通知父页面关闭,便于 page-meta 解锁 */
onPopupCancel() {
this.triggerEvent('cancel')
},
confirm() { confirm() {
let { const { orderInfo, customerList } = this.data
orderInfo, const flag = customerList.some((item) => item.active)
customerList
} = this.data
let flag = customerList.some(item => {
return item.active
})
if (!flag) { if (!flag) {
return wx.$util.showToast('请选择客户') return wx.$util.showToast('请选择客户')
} }
this.triggerEvent('confirm', orderInfo) this.triggerEvent('confirm', orderInfo)
this.setData({
show: false
})
} }
} }
}) })
<popup title="选择客户" show="{{show}}" bindconfirm="confirm" height="90%"> <popup title="选择客户" show="{{show}}" bindconfirm="confirm" bindcancel="onPopupCancel" height="90%">
<view class="car-brands-box"> <view class="car-brands-box">
<search-input bindsearch="searchCar" /> <search-input bindsearch="searchCar" />
<view class="car-brands"> <view class="car-brands" catchtouchmove="noScroll">
<view class="label title y-center"> <view class="label title y-center">
<span class="labelName">姓名</span> <span class="labelName">姓名</span>
<span class="labelPhone">| 手机号</span> <span class="labelPhone">| 手机号</span>
</view> </view>
<scroll-view style="height: calc(100% - var(--fontSize88))" scroll-y scroll-into-view="{{letter}}"> <scroll-view style="height: calc(100% - var(--fontSize88))" scroll-y enhanced="{{ true }}" show-scrollbar="{{ false }}" scroll-into-view="{{letter}}" bindscrolltolower="scrolltolower" lower-threshold="100">
<block wx:if="{{customerList.length > 0}}"> <block wx:if="{{customerList.length > 0}}">
<view class="box"> <view class="box">
<block wx:for="{{customerList}}" wx:for-item="item" wx:key="ind" wx:for-index="ind"> <block wx:for="{{customerList}}" wx:for-item="item" wx:key="ind" wx:for-index="ind">
...@@ -18,15 +18,17 @@ ...@@ -18,15 +18,17 @@
<view>)</view> <view>)</view>
</span> </span>
<span class="phone">{{item.customer.customerPhone}}</span> <span class="phone">{{item.customer.customerPhone}}</span>
<!-- {{c.name}} {{c.active?'active':''}} {{c.isTitle?'title':''}} -->
<view class="icon"> <view class="icon">
<image src="../images/choose.png" /> <image src="../images/choose.png" />
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block> </block>
<block wx:if="{{ brandList.length <= 0}}"> </block>
<block wx:if="{{ customerList.length <= 0 && !loading }}">
<view class="nothing">暂无数据</view> <view class="nothing">暂无数据</view>
</block> </block>
</scroll-view> </scroll-view>
......
...@@ -146,3 +146,10 @@ ...@@ -146,3 +146,10 @@
text-align: center; text-align: center;
color: #999; color: #999;
} }
.list-nothing {
padding: var(--fontSize32) 0 var(--fontSize48);
text-align: center;
font-size: var(--fontSize24);
color: #999;
}
\ No newline at end of file \ No newline at end of file
/**
* @file 客户档案弹框分页纯函数,供 CustomerInfo 组件与单测复用。
*/
/** 客户档案弹框每页条数 */
const DEFAULT_PAGE_SIZE = 20
/**
* 是否还能加载下一页(与工单首页 onReachBottom 判断一致)
* @param {number} total 总条数
* @param {number} pageNum 当前已加载页码
* @param {number} [pageSize=20] 每页条数
* @returns {boolean}
*/
function canLoadMorePage(total, pageNum, pageSize = DEFAULT_PAGE_SIZE) {
if (!total || !pageNum) return false
return Math.ceil(total / pageSize) > pageNum
}
/**
* 为订单列表项补充车型展示字段
* @param {Array} list 接口返回的 list
* @returns {Array}
*/
function mapCustomerListWithCarType(list) {
if (!list?.length) return []
return list.map((item) => {
if (item.customer?.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
})
}
export {
DEFAULT_PAGE_SIZE,
canLoadMorePage,
mapCustomerListWithCarType
}
...@@ -13,10 +13,11 @@ Component({ ...@@ -13,10 +13,11 @@ Component({
observer: function (url, o) { observer: function (url, o) {
if (url) { if (url) {
let isWebp = url.includes('webp') let isWebp = url.includes('webp')
// 已是 http(s) 完整 URL 时不再拼 ImgUrl,避免 tabIndex 等场景出现双 CDN 前缀
const isAbsolute = /^https?:\/\//.test(url)
this.setData({ this.setData({
isWebp, isWebp,
// imagePath: `${ImgUrl}${url}?v=` + IMG_VERSION() imagePath: isAbsolute ? url : `${ImgUrl}${url}`
imagePath: `${ImgUrl}${url}`
}) })
} }
} }
......
/**
* @file 微信隐私授权弹窗(自 glsk-applet-component/GlsxPrivacy 内联,仅主包引用)
* 监听 wx.onNeedPrivacyAuthorization,在当前页展示用户隐私保护指引同意/拒绝 UI。
*/
import { getSystemInfo } from '~/utils/systemInfo'
let privacyHandler
const privacyResolves = new Set()
const closeOtherPagePopUpHooks = new Set()
if (wx.onNeedPrivacyAuthorization) {
wx.onNeedPrivacyAuthorization(resolve => {
if (typeof privacyHandler === 'function') {
privacyHandler(resolve)
}
})
}
/** 关闭其它页面上的隐私弹窗,保证单例展示 */
function closeOtherPagePopUp(closePopUp) {
closeOtherPagePopUpHooks.forEach(hook => {
if (closePopUp !== hook) {
hook()
}
})
}
Component({
properties: {
appletName: {
type: String,
value: ''
},
text: {
type: String,
value: ''
}
},
data: {
showPrivacy: false,
isIPad: false
},
pageLifetimes: {
show() {
const closePopUp = () => {
this.disPopUp()
}
privacyHandler = resolve => {
privacyResolves.add(resolve)
this.popUp()
closeOtherPagePopUp(closePopUp)
}
closeOtherPagePopUpHooks.add(closePopUp)
this.closePopUp = closePopUp
getSystemInfo({
success: res => {
this.setData({
isIPad: res.screenWidth > 700
})
}
})
},
hide() {
closeOtherPagePopUpHooks.delete(this.closePopUp)
}
},
methods: {
handleAgree() {
this.disPopUp()
privacyResolves.forEach(resolve => {
resolve({
event: 'agree',
buttonId: 'agree-btn'
})
})
privacyResolves.clear()
this.triggerEvent('agreeClick')
},
handleDisagree() {
this.disPopUp()
privacyResolves.forEach(resolve => {
resolve({
event: 'disagree'
})
})
privacyResolves.clear()
this.triggerEvent('disagreeClick')
},
popUp() {
if (this.data.showPrivacy === false) {
this.setData({
showPrivacy: true
})
}
},
disPopUp() {
if (this.data.showPrivacy === true) {
this.setData({
showPrivacy: false
})
}
},
handleOpenPrivacyContract() {
wx.openPrivacyContract({
success() {},
fail() {},
complete() {}
})
}
}
})
<cover-view hidden="{{!showPrivacy}}" class="pop-wrapper">
<cover-view class="'pop-box {{isIPad ? 'ipad-box' : ''}}">
<cover-view class="pop-content">
<cover-view class="pop-title">{{appletName ? appletName : '隐私协议'}}</cover-view>
<cover-view class="pop-text">{{ text ? text : '在您使用' + appletName + '服务之前,请仔细阅读《用户隐私保护指引》。如您同意协议内容,请点击“同意”开始使用' + appletName + '。' }}</cover-view>
<cover-view class="pop-privacy" bindtap="handleOpenPrivacyContract">《用户隐私保护指引》</cover-view>
</cover-view>
<cover-view class="pop-bottom">
<button id="disagree-btn"
type="default"
class="pop-btn disagree-btn"
bindtap="handleDisagree"
>拒绝</button>
<button id="agree-btn"
type="default"
open-type="agreePrivacyAuthorization"
class="pop-btn agree-btn"
bindagreeprivacyauthorization="handleAgree"
>同意</button>
</cover-view>
</cover-view>
</cover-view>
.pop-wrapper {
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 99999999;
}
.pop-box {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 85%;
/* height: 640rpx; */
background: #FFFFFF;
border-radius: 16rpx;
}
.pop-content {
padding: 64rpx 48rpx;
box-sizing: border-box;
}
.pop-title {
width: 100%;
height: 48rpx;
text-align: center;
font-weight: 500;
font-size: 34rpx;
color: rgba(0, 0, 0, 0.9);
}
.pop-text {
margin: 32rpx 0 32rpx;
word-wrap: break-word;
word-break: break-all;
white-space: pre-wrap;
font-weight: 400;
font-size: 34rpx;
color: rgba(0, 0, 0, 0.5);
line-height: 48rpx;
letter-spacing: 0;
}
.pop-privacy {
font-weight: 400;
font-size: 30rpx;
color: #576B95;
letter-spacing: 0;
margin-top: 16rpx;
}
.pop-bottom {
display: flex;
border-top: 1px solid #ededed;
height: 112rpx;
/* border-radius: 0 0 16rpx 16rpx; */
}
.pop-btn {
width: 50%;
background-color: #fff !important;
font-weight: 500;
font-size: 34rpx;
letter-spacing: 2rpx;
line-height: 48rpx;
padding: 32rpx 0;
}
.disagree-btn {
width: 50%;
border-right: 2rpx solid #ededed;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
color: #000 !important;
}
.agree-btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
color: #576B95 !important;
}
.pop-btn::after {
border: none;
}
/* iPad样式覆盖 */
.ipad-box.pop-box {
width: 352rpx;
}
.ipad-box .pop-content {
padding: 24rpx;
}
.ipad-box .pop-title {
font-size: 16rpx;
height: auto;
}
.ipad-box .pop-text {
text-align: center;
font-size: 15rpx;
margin: 12rpx 0;
line-height: 20rpx;
}
.ipad-box .pop-privacy {
font-size: 16rpx;
text-align: center;
color: #347BFF;
}
.ipad-box .pop-bottom {
display: flex;
/* 使用flex布局 */
align-items: center;
/* 垂直居中子元素 */
justify-content: center;
/* 水平居中子元素,如果需要 */
height: 50rpx;
}
.ipad-box .pop-btn {
display: flex;
align-items: center;
/* 垂直居中按钮内容 */
justify-content: center;
/* 水平居中按钮内容,如果需要 */
height: 100%;
font-size: 16rpx;
line-height: 22rpx;
}
.ipad-box .disagree-btn {
color: #292D33 !important;
}
.ipad-box .agree-btn {
color: #347BFF !important;
}
/* 横屏 */
@media (min-width: 800px) {
/* 仅在 800px 或更宽的屏幕上生效的样式规则 */
.ipad-box .pop-title {
font-size: 16rpx;
height: auto;
}
}
import { ensureCatalogUpgradePrice, seedMarketingActivitySellPrice } from '~/utils/orderSubOrderExtras'
import { normalizeMarketingFlagOnItem } from '~/utils/marketingFlag'
Component({ Component({
options: { options: {
styleIsolation: 'isolated' //表示样式隔离,默认隔离 styleIsolation: 'isolated' //表示样式隔离,默认隔离
...@@ -112,6 +115,12 @@ Component({ ...@@ -112,6 +115,12 @@ Component({
if (goodsArr.length == 1) { if (goodsArr.length == 1) {
goodsList[index].active = true goodsList[index].active = true
goodsList[index].multipleSpecificationsGoods.goods = goodsArr[0] goodsList[index].multipleSpecificationsGoods.goods = goodsArr[0]
seedMarketingActivitySellPrice(
goodsList[index].multipleSpecificationsGoods.goods
)
ensureCatalogUpgradePrice(
goodsList[index].multipleSpecificationsGoods.goods
)
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.goodsId =
goodsList[ goodsList[
index index
...@@ -128,6 +137,8 @@ Component({ ...@@ -128,6 +137,8 @@ Component({
//多个多规格商品时出现弹窗 //多个多规格商品时出现弹窗
goodsList[index].active = false goodsList[index].active = false
goodsArr.forEach(item => { goodsArr.forEach(item => {
seedMarketingActivitySellPrice(item)
ensureCatalogUpgradePrice(item)
item.count = 1 item.count = 1
item.active = false item.active = false
item.goodsId = item.merchantGoodsId item.goodsId = item.merchantGoodsId
...@@ -276,8 +287,13 @@ Component({ ...@@ -276,8 +287,13 @@ Component({
} }
}, },
getOrderBaseGoodsList(data) { getOrderBaseGoodsList(data) {
const goodsList = (data || []).map((item) => {
const next = { ...item }
normalizeMarketingFlagOnItem(next)
return next
})
this.setData({ this.setData({
goodsList: data goodsList
}) })
}, },
circulation(data, str) { circulation(data, str) {
...@@ -376,6 +392,8 @@ Component({ ...@@ -376,6 +392,8 @@ Component({
if (c.active) { if (c.active) {
if (c.goods) { if (c.goods) {
if (!c.count) c.count = 1 if (!c.count) c.count = 1
ensureCatalogUpgradePrice(c.goods)
seedMarketingActivitySellPrice(c.goods)
c.goods.price = c.goods.sellPrice || 0 c.goods.price = c.goods.sellPrice || 0
if (chooseGoodsList.length > 0) { if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => { chooseGoodsList.map(x => {
...@@ -589,10 +607,10 @@ Component({ ...@@ -589,10 +607,10 @@ Component({
goodsList: arr goodsList: arr
}) })
}, },
/** 取消时通知父页面关闭弹框;内部 show 兼容未绑 cancel 的引用页 */
cancel() { cancel() {
this.setData({ this.setData({ show: false })
show: false this.triggerEvent('cancel')
})
}, },
async confirm() { async confirm() {
let chooseList = await this.getChooseList(true) let chooseList = await this.getChooseList(true)
...@@ -607,10 +625,11 @@ Component({ ...@@ -607,10 +625,11 @@ Component({
thisPage.setData({ thisPage.setData({
goodsList: chooseList goodsList: chooseList
}) })
this.triggerEvent('confirm', chooseList) thisPage?.syncMarketingFlags?.(thisPage.data.orderObj?.merchantId, {
this.setData({ goodsList: chooseList
show: false
}) })
this.triggerEvent('confirm', chooseList)
this.setData({ show: false })
} }
} }
}) })
...@@ -46,7 +46,35 @@ ...@@ -46,7 +46,35 @@
.item .value .name { .item .value .name {
max-width: 85%; max-width: 85%;
width: calc(100vw - var(--fontSize100)); min-width: 0;
flex: 1;
}
.item .value .name.goods-name {
display: flex;
align-items: center;
flex-wrap: wrap;
overflow: hidden;
}
.item .value .name .goods-name-with-icon {
display: flex;
align-items: center;
flex: 0 1 auto;
max-width: 100%;
min-width: 0;
}
.item .value .name .goods-name-text {
flex: 0 1 auto;
min-width: 0;
}
.item .value .name .marketing-icon {
width: var(--fontSize56);
height: var(--fontSize28);
flex-shrink: 0;
margin-left: var(--fontSize8);
} }
.item .value .name .warning_text { .item .value .name .warning_text {
......
<wxs src="index.wxs" module="filter" /> <wxs src="/components/Goods/index.wxs" module="filter" />
<popup show="{{ show }}" title="选择商品" bindconfirm="confirm" bindcancel="cancel"> <popup show="{{ show }}" title="选择商品" bindconfirm="confirm" bindcancel="cancel">
<view class="coupon-box"> <view class="coupon-box">
<search-input bindsearch="searchGoods" value="{{ keyWord }}" /> <search-input bindsearch="searchGoods" value="{{ keyWord }}" />
...@@ -15,8 +15,11 @@ ...@@ -15,8 +15,11 @@
<block wx:if="{{ i.goodsFlag==1 }}"> <block wx:if="{{ i.goodsFlag==1 }}">
<view class="item {{ minPrice?(minPrice/100)>= i.minSellPrice ?'':'disableSelect':'' }}"> <view class="item {{ minPrice?(minPrice/100)>= i.minSellPrice ?'':'disableSelect':'' }}">
<view class="value {{ i.active?'labelWidth':'' }}" catchtap="choose" data-ind="{{ ind }}" data-item="{{ i }}"> <view class="value {{ i.active?'labelWidth':'' }}" catchtap="choose" data-ind="{{ ind }}" data-item="{{ i }}">
<view class="name text-hide {{ i.active?'textWidth':'' }}"> <view class="name goods-name {{ i.active?'textWidth':'' }}">
<text>{{filter.replaceItemText(i.goods.goodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</text> <view class="goods-name-with-icon">
<text class="goods-name-text text-hide">{{filter.replaceItemText(i.goods.goodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goods.goodsInfo.goodsName)}}</text>
<image wx:if="{{ filter.isMarketingActive(i) }}" class="marketing-icon" src="/tabWorkOrder/images/activeIcon.png" mode="aspectFit" />
</view>
<text wx:if="{{ i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType) }}">{{'「' + i.goods.positionStr+'」'}}</text> <text wx:if="{{ i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType) }}">{{'「' + i.goods.positionStr+'」'}}</text>
<text class="warning_text" wx:if="{{ !i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType) }}">无部位</text> <text class="warning_text" wx:if="{{ !i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType) }}">无部位</text>
</view> </view>
...@@ -39,22 +42,17 @@ ...@@ -39,22 +42,17 @@
<view class="add" catchtap="addCount" data-count="{{ 1 }}" data-ind="{{ ind }}" data-item="{{ i }}">+</view> <view class="add" catchtap="addCount" data-count="{{ 1 }}" data-ind="{{ ind }}" data-item="{{ i }}">+</view>
</view> </view>
</block> </block>
<!-- <view class=" choose" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="../images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view> -->
</view> </view>
</block> </block>
<!-- 多规格 --> <!-- 多规格 -->
<block wx:if="{{ i.goodsFlag==2 }}"> <block wx:if="{{ i.goodsFlag==2 }}">
<view class="item {{ minPrice?(minPrice/100)>= i.minSellPrice ?'':'disableSelect':'' }}"> <view class="item {{ minPrice?(minPrice/100)>= i.minSellPrice ?'':'disableSelect':'' }}">
<view class="value {{ i.active?'labelWidth':'' }}" catchtap="choose" data-ind="{{ ind }}" data-item="{{ i }}"> <view class="value {{ i.active?'labelWidth':'' }}" catchtap="choose" data-ind="{{ ind }}" data-item="{{ i }}">
<view class="name text-hide {{ i.active?'textWidth':'' }}"> <view class="name goods-name {{ i.active?'textWidth':'' }}">
<text>{{i.multipleSpecificationsGoods.baseGoodsName }}</text> <view class="goods-name-with-icon">
<text class="goods-name-text text-hide">{{i.multipleSpecificationsGoods.baseGoodsName }}</text>
<image wx:if="{{ filter.isMarketingActive(i) }}" class="marketing-icon" src="/tabWorkOrder/images/activeIcon.png" mode="aspectFit" />
</view>
</view> </view>
<view class="last" wx:if="{{ !i.active }}"> <view class="last" wx:if="{{ !i.active }}">
<text class="price" wx:if="{{ i.multipleSpecificationsGoods.goods.sellPrice }}">¥{{i.multipleSpecificationsGoods.goods.sellPrice}}</text> <text class="price" wx:if="{{ i.multipleSpecificationsGoods.goods.sellPrice }}">¥{{i.multipleSpecificationsGoods.goods.sellPrice}}</text>
......
/**
* @file 全局商品组件 wxs
* 用法:<wxs src="/components/Goods/index.wxs" module="filter" />
*
* replaceItemText:将商品名中的 ;~; 分隔符显示为空格
* getImageSrc:单选按钮图(带时间戳防缓存)
*/
var replaceItemText = function (item) { var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g') var reg = getRegExp(';~;', 'g')
return item ? item.replace(reg, ' ') : '' return item ? item.replace(reg, ' ') : ''
...@@ -9,10 +16,52 @@ var getImageSrc = function (active) { ...@@ -9,10 +16,52 @@ var getImageSrc = function (active) {
return baseImagePath + '?t=' + timestamp; // 使用字符串拼接 return baseImagePath + '?t=' + timestamp; // 使用字符串拼接
} }
/**
* 活动标:兼容顶层/子对象字段及 string 类型
* @param {object} item selectOrderGoods.list 单项
*/
var isMarketingActive = function (item) {
if (!item) return false
if (item.marketingFlag == 1 || item.marketingFlag == '1') return true
var orderChildren = item.packageGoodsOrderList || item.goodsList || []
for (var j = 0; j < orderChildren.length; j++) {
if (orderChildren[j].marketingFlag == 1 || orderChildren[j].marketingFlag == '1') return true
}
if (item.packageGoods) {
if (item.packageGoods.marketingFlag == 1 || item.packageGoods.marketingFlag == '1') {
return true
}
var list = item.packageGoods.goodsList || item.packageGoods.packageGoodsOrderList || []
for (var i = 0; i < list.length; i++) {
if (list[i].marketingFlag == 1 || list[i].marketingFlag == '1') return true
}
}
if (item.goods && (item.goods.marketingFlag == 1 || item.goods.marketingFlag == '1')) {
return true
}
if (
item.multipleSpecificationsGoods &&
(item.multipleSpecificationsGoods.marketingFlag == 1 ||
item.multipleSpecificationsGoods.marketingFlag == '1')
) {
return true
}
if (
item.multipleSpecificationsGoods &&
item.multipleSpecificationsGoods.goods &&
(item.multipleSpecificationsGoods.goods.marketingFlag == 1 ||
item.multipleSpecificationsGoods.goods.marketingFlag == '1')
) {
return true
}
return false
}
/* /*
* 导出 * 导出
*/ */
module.exports = { module.exports = {
replaceItemText: replaceItemText, replaceItemText: replaceItemText,
getImageSrc: getImageSrc getImageSrc: getImageSrc,
isMarketingActive: isMarketingActive
} }
<!-- components/InventoryInfo/InventoryInfo.wxml --> <!-- components/InventoryInfo/InventoryInfo.wxml -->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="inventory-info-container" wx:if="{{isShowing}}"> <view class="inventory-info-container" wx:if="{{isShowing}}">
<view class="overlay" bindtap="onClose"></view> <view class="overlay" bindtap="onClose"></view>
<view class="popup"> <view class="popup">
......
...@@ -33,6 +33,7 @@ Component({ ...@@ -33,6 +33,7 @@ Component({
orderObj: { orderObj: {
type: Object, type: Object,
value: {},
}, },
type: Number, //1.销售顾问,2.转化人员3交付专员 type: Number, //1.销售顾问,2.转化人员3交付专员
// order:Object, // order:Object,
...@@ -78,7 +79,6 @@ Component({ ...@@ -78,7 +79,6 @@ Component({
data: { data: {
merchantList: [], merchantList: [],
selesList: [], selesList: [],
orderObj: {},
isFirst: true, isFirst: true,
sellerUserId: "", //转化人员 sellerUserId: "", //转化人员
orderSellerInfo: "", orderSellerInfo: "",
...@@ -227,7 +227,7 @@ Component({ ...@@ -227,7 +227,7 @@ Component({
[targetId]: merchantId, [targetId]: merchantId,
[targetName]: merchantName, [targetName]: merchantName,
merchantList: data, merchantList: data,
orderSellerInfo, orderSellerInfo: orderSellerInfo || '',
}, },
() => { () => {
this.getConversionEmployeeList(merchantId); this.getConversionEmployeeList(merchantId);
......
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js /**
* @file 底部弹层 Popup — 合并 tipsPopup / tabPopup / 分包 Popup 变体
* footerMode: default | none | tips
*/
import { CLOSE_ICON_URL } from '../../utils/imageBase.js'
import {
getPopupSlotClass,
shouldShowCloseIcon,
shouldShowFooter,
shouldShowTips
} from './popup.helpers.js'
Component({ Component({
externalClasses: ['popup-slot-class'], externalClasses: ['popup-slot-class'],
/**
* 组件的属性列表
*/
properties: { properties: {
show: { show: {
type: Boolean, type: Boolean,
value: false, value: false,
observer: function (n, o) { observer(n) {
n && wx.hideKeyboard() n && wx.hideKeyboard()
this.setData({ this.setData({ showPopup: n })
showPopup: n
})
} }
}, },
title: String, title: String,
height: { height: { type: String, value: '85%' },
slotStyle: String,
/** default=双按钮 none=仅关闭图标 tips=提示+双按钮 */
footerMode: {
type: String, type: String,
value: '85%' value: 'default',
observer() {
this._syncFooterUi()
}
}, },
slotStyle: String showCloseIcon: {
type: Boolean,
value: false,
observer() {
this._syncFooterUi()
}
},
tips: {
type: String,
observer() {
this._syncFooterUi()
}
},
cancelText: { type: String, value: '取消' },
confirmText: { type: String, value: '确认' },
cancelStyle: String,
confirmStyle: String,
singleButton: { type: Boolean, value: false }
},
data: {
showPopup: false,
isFullSucreen: false,
showFooter: true,
showTitleClose: false,
showTipsArea: false,
slotClass: 'popup-slot',
footerLayoutClass: '',
closeIconUrl: ''
}, },
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: { methods: {
noScroll() { }, _syncFooterUi() {
hidePopup() { const { footerMode, tips, showCloseIcon } = this.properties
const hasTips = shouldShowTips(footerMode, tips)
let slotClass = getPopupSlotClass(footerMode, hasTips)
if (footerMode === 'none') {
slotClass += ' popup-slot--noneFooter'
}
this.setData({ this.setData({
show: false showFooter: shouldShowFooter(footerMode),
showTitleClose: shouldShowCloseIcon(footerMode, showCloseIcon),
showTipsArea: hasTips,
slotClass,
footerLayoutClass: footerMode === 'tips' ? 'popup-footer--tips' : ''
}) })
},
noScroll() {},
hidePopup() {
this.setData({ show: false })
this.triggerEvent('cancel') this.triggerEvent('cancel')
}, },
confirm() { confirm() {
...@@ -45,7 +88,9 @@ Component({ ...@@ -45,7 +88,9 @@ Component({
}, },
attached() { attached() {
this.setData({ this.setData({
isFullSucreen: wx.$util.isFullSucreen(true) isFullSucreen: wx.$util.isFullSucreen(true),
closeIconUrl: CLOSE_ICON_URL
}) })
this._syncFooterUi()
} }
}) })
...@@ -2,14 +2,22 @@ ...@@ -2,14 +2,22 @@
<view class="popup-bg" bindtap="hidePopup"></view> <view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content" style="height:{{ height }}"> <view class="popup-content" style="height:{{ height }}">
<block wx:if="{{ title }}"> <block wx:if="{{ title }}">
<view class="popup-title text-center">{{title}}</view> <view class="popup-title text-center {{ showTitleClose ? 'popup-title--closable' : '' }}">
{{ title }}
<view wx:if="{{ showTitleClose }}" class="close" bindtap="hidePopup">
<image src="{{ closeIconUrl }}" class="close-image" mode="aspectFit" />
</view>
</view>
</block> </block>
<view class="popup-slot popup-slot-class {{ isFullSucreen?title?'isFullSucreen':'isFullSucreen-notitle':'' }}" style="{{slotStyle}}"> <view class="{{ slotClass }} popup-slot-class {{ isFullSucreen ? title ? 'isFullSucreen' : 'isFullSucreen-notitle' : '' }}" style="{{ slotStyle }}">
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer {{ isFullSucreen?'isFullSucreen':'' }}"> <block wx:if="{{ showTipsArea }}">
<view class="cancel btn text-center" bind:tap="hidePopup">取消</view> <view class="tips text-center">{{ tips }}</view>
<view class="confirm btn text-center" bind:tap="confirm">确认</view> </block>
<view wx:if="{{ showFooter }}" class="popup-footer {{ footerLayoutClass }} {{ isFullSucreen ? 'isFullSucreen' : '' }}">
<view wx:if="{{ !singleButton }}" class="cancel btn text-center" style="{{ cancelStyle }}" bind:tap="hidePopup">{{ cancelText }}</view>
<view class="confirm btn text-center {{ singleButton ? 'confirm--full' : '' }}" style="{{ confirmStyle }}" bind:tap="confirm">{{ confirmText }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -42,6 +42,65 @@ ...@@ -42,6 +42,65 @@
border-bottom: var(--fontSize2) solid #EBEDF0; border-bottom: var(--fontSize2) solid #EBEDF0;
} }
.popup-title--closable {
position: relative;
}
.close {
position: absolute;
right: 0;
top: 50%;
height: 100%;
width: var(--fontSize100);
transform: translateY(-50%);
}
.close-image {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
width: var(--fontSize24);
height: var(--fontSize24);
}
.popup-slot-other {
height: calc(100% - var(--fontSize200) - var(--fontSize71));
overflow: scroll;
}
/* 原 tipsPopup:无 footer,slot 带内边距 */
.popup-slot--noneFooter {
height: calc(100% - var(--fontSize200));
padding: var(--fontSize50) var(--fontSize40);
box-sizing: border-box;
}
.popup-content .tips {
color: #999;
font-size: var(--fontSize24);
margin-bottom: var(--fontSize40);
}
/* 原 tabPopup:footer 按钮样式 */
.popup-footer--tips .btn {
font-size: var(--fontSize28);
}
.popup-footer--tips .cancel {
color: #323233;
border: var(--fontSize2) solid #DCDEE0;
background: transparent;
}
.popup-footer--hidden {
display: none;
}
.confirm--full {
width: 100% !important;
}
.popup-slot { .popup-slot {
height: calc(100% - var(--fontSize214)); height: calc(100% - var(--fontSize214));
} }
......
/**
* @file Popup 变体合并 — footer 与关闭按钮可见性纯逻辑
*/
/** @typedef {'default' | 'none' | 'tips'} PopupFooterMode */
/**
* 是否显示底部取消/确认按钮
* @param {PopupFooterMode} footerMode
* @returns {boolean}
*/
export function shouldShowFooter(footerMode) {
return footerMode === 'default' || footerMode === 'tips'
}
/**
* 是否显示标题栏关闭图标(tipsPopup 风格)
* @param {PopupFooterMode} footerMode
* @param {boolean} showCloseIcon
* @returns {boolean}
*/
export function shouldShowCloseIcon(footerMode, showCloseIcon) {
return footerMode === 'none' || showCloseIcon
}
/**
* 是否显示 tips 文案区域
* @param {PopupFooterMode} footerMode
* @param {string} [tips]
* @returns {boolean}
*/
export function shouldShowTips(footerMode, tips) {
return footerMode === 'tips' && Boolean(tips)
}
/**
* slot 区域 class:tips 模式用更高 scroll 区域
* @param {PopupFooterMode} footerMode
* @param {boolean} hasTips
* @returns {'popup-slot' | 'popup-slot-other'}
*/
export function getPopupSlotClass(footerMode, hasTips) {
return footerMode === 'tips' && hasTips ? 'popup-slot-other' : 'popup-slot'
}
import { IMG_URL } from '../../utils/imageBase.js'
// components/SearchInput/SearchInput.js // components/SearchInput/SearchInput.js
Component({ Component({
// options: { // options: {
...@@ -28,6 +29,7 @@ Component({ ...@@ -28,6 +29,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{{value}} {{value}}
</block> </block>
<block wx:else> <block wx:else>
<image src="../../images/search.png" class="icon"></image> <image src="{{ IMG_URL }}images/search.png" class="icon"></image>
{{placeholder||'查找'}} {{placeholder||'查找'}}
</block> </block>
</view> </view>
......
<!--components/SideSelectPopup/SideSelectPopup.wxml-->
<van-popup custom-style="height: 100%;width:var(--fontSize560);" z-index="999999" custom-class="popclass" bind:click-overlay="closeMenu" position="left" bind:before-enter="hideTabBar" bind:after-leave="showTabBar" show="{{ show }}">
<view class="wrapper">
<view class="title_box">
<view class="title">店面列表</view>
</view>
<view class="search-box">
<view class='select_box' wx:if="{{userInfo.sceneType == 1}}">
<view class='select' catchtap='selectTap'>
<view class='select_text'>{{searchSelectData[searchSelectIndex]}}</view>
<image class='select_img {{showSelect&&"select_img_rotate"}}' src='/images/arrow-right.png'></image>
</view>
<view class='option_box' wx:if="{{showSelect}}">
<view class='option {{searchSelectIndex == index ? "active" : ""}}' wx:for='{{searchSelectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view>
</view>
<view class="mask_class" wx:if="{{showSelect}}" bindtap="closeSelect"></view>
</view>
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="{{searchSelectIndex == 0 ? '搜索门店名称/商户号' : '搜索客户姓名/手机号'}}" class="input" confirm-type="search" value="{{searchValue}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="inputConfifm" />
<block wx:if="{{searchValue}}">
<image src="/images/clear.png" class="search-clear" bindtap="clearInputText" />
</block>
</view>
</view>
<!-- 搜门店 -->
<scroll-view wx:if="{{searchSelectIndex == 0}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-top="{{scrollTop}}" bindscrolltolower="scrollonReachBottom">
<block wx:for="{{storeRangeList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element {{item.actived ? 'active' : ''}}">
<view>
<image src="{{IMG_URL}}/store_icon_nobg.png"></image>
</view>
<view class="text_box">
<view class="label">{{item.merchantName}}</view>
<view class="scene_label" wx:if="{{item.sceneName}}">场景:{{item.sceneName}}</view>
<view class="label_no" wx:if="{{item.merchantId}}">商户号:{{item.merchantId}}</view>
</view>
</view>
</block>
</scroll-view>
<!-- 搜客户 -->
<scroll-view wx:if="{{customStoreList.length && searchSelectIndex == 1 && userInfo.sceneType == 1}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}" bindscrolltolower="scrollonReachBottom">
<block wx:for="{{customStoreList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element custom_element {{item.actived ? 'active' : ''}}">
<view>
<image src="{{IMG_URL}}/user_avatar.png"></image>
</view>
<view class="text_box">
<view class="custom_text">
<view class="name_phone">
<text class="custom_name">{{item.customer.customerName}}</text>
<text class="custom_phone">{{item.customer.customerPhone}}</text>
</view>
<view class="status_text status_text_{{item.listStatus}}">{{statusText[item.listStatus]}}</view>
</view>
<view class="label">{{item.merchantName}}</view>
<view class="scene_label" wx:if="{{item.sceneName}}">场景:{{item.sceneName}}</view>
<view class="label_no" wx:if="{{item.merchantId}}">商户号:{{item.merchantId}}</view>
</view>
</view>
</block>
</scroll-view>
<block wx:if="{{(!customStoreList.length && searchSelectIndex == 1) || (!storeRangeList.length && searchSelectIndex == 0)}}">
<view class="list_not">
<image class="list_nothing_img {{customSearchFlag ? '' : 'big_list_nothing_img'}}" src="{{IMG_URL}}/{{customSearchFlag ? 'no_data_bg' : 'search_icon_bg'}}.png" mode="" />
<view class="list_not_text">{{customSearchFlag ? '您搜索的内容暂无结果' : '快去搜索看看'}}</view>
</view>
</block>
</view>
</van-popup>
\ No newline at end of file \ No newline at end of file
@import "../SideSelectPopup/SideSelectPopup.wxss";
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="input {{ searchValue?'':'placeholder' }}" bindtap="open"> <view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{ searchValue }}">{{searchValue}}</block> <block wx:if="{{ searchValue }}">{{searchValue}}</block>
<block wx:else> <block wx:else>
<image src="/images/search.png" class="icon"></image> <image src="{{ IMG_URL }}images/search.png" class="icon"></image>
{{'搜索门店名称/商户号'}} {{'搜索门店名称/商户号'}}
</block> </block>
</view> </view>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
bindblur="inputBlur" bindblur="inputBlur"
bindconfirm="inputConfifm" bindconfirm="inputConfifm"
/> />
<image src="/images/clear.png" bindtap="clearInputText" wx:if="{{searchValue}}" class="clear_icon" mode=""/> <image src="{{ IMG_URL }}images/clear.png" bindtap="clearInputText" wx:if="{{searchValue}}" class="clear_icon" mode=""/>
</view> </view>
</block> </block>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<view class='select_box' wx:if="{{userInfo.sceneType == 1}}"> <view class='select_box' wx:if="{{userInfo.sceneType == 1}}">
<view class='select' catchtap='selectTap'> <view class='select' catchtap='selectTap'>
<view class='select_text'>{{searchSelectData[searchSelectIndex]}}</view> <view class='select_text'>{{searchSelectData[searchSelectIndex]}}</view>
<image class='select_img {{showSelect&&"select_img_rotate"}}' src='/images/arrow-right.png'></image> <image class='select_img {{showSelect&&"select_img_rotate"}}' src="{{ IMG_URL }}images/arrow-right.png"></image>
</view> </view>
<view class='option_box' wx:if="{{showSelect}}"> <view class='option_box' wx:if="{{showSelect}}">
<view class='option {{searchSelectIndex == index ? "active" : ""}}' wx:for='{{searchSelectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view> <view class='option {{searchSelectIndex == index ? "active" : ""}}' wx:for='{{searchSelectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view>
...@@ -48,18 +48,31 @@ ...@@ -48,18 +48,31 @@
<view class="mask_class" wx:if="{{showSelect}}" bindtap="closeSelect"></view> <view class="mask_class" wx:if="{{showSelect}}" bindtap="closeSelect"></view>
</view> </view>
<view class="search-input"> <view class="search-input">
<image src="/images/search.png" class="search-icon" /> <image src="{{ IMG_URL }}images/search.png" class="search-icon" />
<input type="text" placeholder="{{searchSelectIndex == 0 ? '搜索门店名称/商户号' : '搜索客户姓名/手机号'}}" class="input" confirm-type="search" value="{{searchValue}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="inputConfifm" /> <input type="text" placeholder="{{searchSelectIndex == 0 ? '搜索门店名称/商户号' : '搜索客户姓名/手机号'}}" class="input" confirm-type="search" value="{{searchValue}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="inputConfifm" />
<block wx:if="{{searchValue}}"> <block wx:if="{{searchValue}}">
<image src="/images/clear.png" class="search-clear" bindtap="clearInputText" /> <image src="{{ IMG_URL }}images/clear.png" class="search-clear" bindtap="clearInputText" />
</block> </block>
</view> </view>
</view> </view>
<!-- 搜门店 --> <!-- 搜门店 prop 模式 -->
<scroll-view wx:if="{{copyStoreList.length && searchSelectIndex == 0}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}"> <scroll-view wx:if="{{dataSource !== 'page' && copyStoreList.length && searchSelectIndex == 0}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{copyStoreList}}" wx:key="index" wx:for-index="index"> <block wx:for="{{copyStoreList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element {{item.actived ? 'active' : ''}}"> <view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element {{item.actived ? 'active' : ''}}">
<view><image src="{{IMG_URL}}/store_icon_nobg.png"></image></view> <view><image class="element-icon" src="{{IMG_URL}}/store_icon_nobg.png"></image></view>
<view class="text_box">
<view class="label">{{item.merchantName}}</view>
<view class="scene_label" wx:if="{{item.sceneName}}">场景:{{item.sceneName}}</view>
<view class="label_no" wx:if="{{item.merchantId}}">商户号:{{item.merchantId}}</view>
</view>
</view>
</block>
</scroll-view>
<!-- 搜门店 page 模式 -->
<scroll-view wx:if="{{dataSource === 'page' && searchSelectIndex == 0}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-top="{{scrollTop}}" bindscrolltolower="scrollonReachBottom">
<block wx:for="{{storeRangeList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element {{item.actived ? 'active' : ''}}">
<view><image class="element-icon" src="{{IMG_URL}}/store_icon_nobg.png"></image></view>
<view class="text_box"> <view class="text_box">
<view class="label">{{item.merchantName}}</view> <view class="label">{{item.merchantName}}</view>
<view class="scene_label" wx:if="{{item.sceneName}}">场景:{{item.sceneName}}</view> <view class="scene_label" wx:if="{{item.sceneName}}">场景:{{item.sceneName}}</view>
...@@ -72,7 +85,7 @@ ...@@ -72,7 +85,7 @@
<scroll-view wx:if="{{customStoreList.length && searchSelectIndex == 1 && userInfo.sceneType == 1}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}" bindscrolltolower="scrollonReachBottom"> <scroll-view wx:if="{{customStoreList.length && searchSelectIndex == 1 && userInfo.sceneType == 1}}" scroll-y style="height: calc(100vh - var(--fontSize264) - var(--fontSize88));" enhanced="{{true}}" show-scrollbar="{{false}}" bindscrolltolower="scrollonReachBottom">
<block wx:for="{{customStoreList}}" wx:key="index" wx:for-index="index"> <block wx:for="{{customStoreList}}" wx:key="index" wx:for-index="index">
<view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element custom_element {{item.actived ? 'active' : ''}}"> <view catch:tap="selectStore" data-item="{{item}}" data-selectindex="{{index}}" class="element custom_element {{item.actived ? 'active' : ''}}">
<view><image src="{{IMG_URL}}/user_avatar.png"></image></view> <view><image class="element-icon" src="{{IMG_URL}}/user_avatar.png"></image></view>
<view class="text_box"> <view class="text_box">
<view class="custom_text"> <view class="custom_text">
<view class="name_phone"> <view class="name_phone">
...@@ -88,7 +101,7 @@ ...@@ -88,7 +101,7 @@
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<block wx:if="{{(!customStoreList.length && searchSelectIndex == 1) || (!copyStoreList.length && searchSelectIndex == 0)}}"> <block wx:if="{{(!customStoreList.length && searchSelectIndex == 1) || (dataSource !== 'page' && !copyStoreList.length && searchSelectIndex == 0) || (dataSource === 'page' && !storeRangeList.length && searchSelectIndex == 0)}}">
<view class="list_not"> <view class="list_not">
<image class="list_nothing_img {{customSearchFlag ? '' : 'big_list_nothing_img'}}" src="{{IMG_URL}}/{{customSearchFlag ? 'no_data_bg' : 'search_icon_bg'}}.png" mode=""/> <image class="list_nothing_img {{customSearchFlag ? '' : 'big_list_nothing_img'}}" src="{{IMG_URL}}/{{customSearchFlag ? 'no_data_bg' : 'search_icon_bg'}}.png" mode=""/>
<view class="list_not_text">{{customSearchFlag ? '您搜索的内容暂无结果' : '快去搜索看看'}}</view> <view class="list_not_text">{{customSearchFlag ? '您搜索的内容暂无结果' : '快去搜索看看'}}</view>
......
...@@ -198,7 +198,8 @@ ...@@ -198,7 +198,8 @@
font-size: var(--fontSize28); font-size: var(--fontSize28);
} }
.wrapper .search_box image{ .wrapper .search_box .icon,
.wrapper .search_box .clear_icon{
width: var(--fontSize32); width: var(--fontSize32);
height: var(--fontSize32); height: var(--fontSize32);
} }
...@@ -339,7 +340,7 @@ ...@@ -339,7 +340,7 @@
margin-top: 0; margin-top: 0;
} }
.wrapper .element image{ .wrapper .element .element-icon{
width: var(--fontSize96); width: var(--fontSize96);
height: var(--fontSize96); height: var(--fontSize96);
margin-right: var(--fontSize30); margin-right: var(--fontSize30);
...@@ -417,7 +418,7 @@ ...@@ -417,7 +418,7 @@
.wrapper .element{ .wrapper .element{
padding: var(--fontSize20); padding: var(--fontSize20);
} }
.wrapper .element image{ .wrapper .element .element-icon{
width: var(--fontSize70); width: var(--fontSize70);
height: var(--fontSize70); height: var(--fontSize70);
} }
......
/**
* @file SideSelectPopup 纯逻辑 — dataSource 分支与 prop 模式门店高亮
* 供 SideSelect/SideSelectByPage 合并后单测;组件内 setData 前调用。
*/
/**
* 是否分页自拉门店列表
* @param {string} dataSource
* @returns {boolean}
*/
export function shouldUsePageDataSource(dataSource) {
return dataSource === 'page'
}
/**
* show=true 时重置的 UI 状态(prop/page 共用)
* @param {boolean} show
* @returns {object|null}
*/
export function getInitialPageState(show) {
if (!show) return null
return {
searchValue: '',
edit: false,
customSearchFlag: false,
showSelect: false,
nothing: false,
pageNum: 1
}
}
/**
* prop 模式:对 storeList 计算 actived 高亮
* @param {object[]} storeList
* @param {object} userInfo
* @param {number} subIndex
* @param {string} sceneName
* @param {boolean} isSuper
* @returns {object[]}
*/
export function mapStoreActived(storeList, userInfo, subIndex, sceneName, isSuper) {
return (storeList || []).map((val, index) => {
const item = {
...val,
actived: false,
index,
sceneName: val.sceneName || sceneName
}
if (userInfo?.sceneType == 1) {
if (isSuper && userInfo?.shopMerchantId == val.merchantId) item.actived = true
else if (!isSuper && val.merchantId == userInfo?.shopMerchantId) item.actived = true
} else {
const matchDefault4S =
(userInfo?.sceneType == 0 &&
userInfo?.default4SStoreInfo?.merchantId == val.merchantId) ||
(userInfo?.sceneType == 3 &&
userInfo?.default4SStoreInfo_crowdFunding?.merchantId == val.merchantId) ||
(userInfo?.sceneType == 2 &&
userInfo?.default4SStoreInfo_newCarConversion?.merchantId == val.merchantId)
if (isSuper && matchDefault4S) item.actived = true
else if (!isSuper && val.merchantId == userInfo?.shopMerchantId) item.actived = true
}
return item
})
}
/**
* 按属性去重(page 模式门店列表)
* @param {object[]} arr
* @param {string} prop
* @returns {object[]}
*/
export function uniqueByProperty(arr, prop) {
const map = new Map()
;(arr || []).forEach(obj => {
map.set(obj[prop], obj)
})
return Array.from(map.values())
}
/**
* page 模式 API 返回列表后处理:prepend「全部」、补当前店、高亮
* @param {object[]} tempList
* @param {object} userInfo
* @param {string} sceneName
* @param {string} searchValue
* @returns {object[]}
*/
export function finalizePageModeStoreList(tempList, userInfo, sceneName, searchValue) {
let list = [...(tempList || [])]
if (!searchValue) {
if (!list.some(v => v.merchantName === '全部')) {
list.unshift({ merchantName: '全部' })
}
if (
userInfo?.shopMerchantId &&
!list.some(v => v.merchantId === userInfo.shopMerchantId)
) {
list.push({
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
})
}
}
list = uniqueByProperty(list, 'merchantId')
return list.map(v => ({
...v,
actived:
userInfo?.shopMerchantId === v.merchantId ||
(!userInfo?.shopMerchantId && !v.merchantId),
sceneName: v.sceneName || sceneName
}))
}
// packageEquity/pages/carQuotation/components/skuGoods/Goods.js // packageEquity/pages/carQuotation/components/skuGoods/Goods.js
import { getSystemInfoSync } from '~/utils/systemInfo'
import { normalizeMarketingMetaOnItem } from '~/utils/marketingFlag'
import { seedMarketingActivitySellPrice } from '~/utils/orderSubOrderExtras'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -114,6 +117,11 @@ Component({ ...@@ -114,6 +117,11 @@ Component({
selectList = [] selectList = []
goodsData.multipleSpecificationsGoods.skuGoodsList.forEach(c => { goodsData.multipleSpecificationsGoods.skuGoodsList.forEach(c => {
if (c.active) { if (c.active) {
const specRoot = goodsData.multipleSpecificationsGoods || {}
const marketingFlag =
goodsData.marketingFlag ?? specRoot.marketingFlag ?? c.marketingFlag ?? 0
const activityId =
goodsData.activityId ?? specRoot.activityId ?? c.activityId ?? null
//构建多规格需要的数据格式 //构建多规格需要的数据格式
selectList.push({ selectList.push({
active: true, active: true,
...@@ -121,15 +129,21 @@ Component({ ...@@ -121,15 +129,21 @@ Component({
goods: null, goods: null,
goodsFlag: 2, goodsFlag: 2,
isFlag: true, isFlag: true,
marketingFlag: marketingFlag == 1 || marketingFlag === '1' ? 1 : 0,
activityId,
multipleSpecificationsGoods: { multipleSpecificationsGoods: {
baseGoodsName: baseGoodsName: specRoot.baseGoodsName,
goodsData.multipleSpecificationsGoods.baseGoodsName, id: specRoot.id,
id: goodsData.multipleSpecificationsGoods.id, marketingFlag:
specificationGoodsMap: specRoot.marketingFlag ?? (marketingFlag == 1 || marketingFlag === '1' ? 1 : 0),
goodsData.multipleSpecificationsGoods.specificationGoodsMap, activityId,
specificationList: specificationGoodsMap: specRoot.specificationGoodsMap,
goodsData.multipleSpecificationsGoods.specificationList, specificationList: specRoot.specificationList,
goods: c goods: {
...c,
marketingFlag: c.marketingFlag ?? specRoot.marketingFlag ?? marketingFlag,
activityId: c.activityId ?? specRoot.activityId ?? activityId
}
} }
}) })
} }
...@@ -145,6 +159,7 @@ Component({ ...@@ -145,6 +159,7 @@ Component({
price = Math.round(price * 100) price = Math.round(price * 100)
} }
c.multipleSpecificationsGoods.goods.price = price c.multipleSpecificationsGoods.goods.price = price
seedMarketingActivitySellPrice(c.multipleSpecificationsGoods.goods)
if (chooseGoodsList.length > 0) { if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => { chooseGoodsList.map(x => {
if (x.goodsFlag == 2 && x.multipleSpecificationsGoods) { if (x.goodsFlag == 2 && x.multipleSpecificationsGoods) {
...@@ -192,6 +207,7 @@ Component({ ...@@ -192,6 +207,7 @@ Component({
console.log(chooseList, 'chooseList') console.log(chooseList, 'chooseList')
chooseList = chooseList.concat(chooseGoodsList) chooseList = chooseList.concat(chooseGoodsList)
chooseList.forEach(item => normalizeMarketingMetaOnItem(item))
console.log(chooseList, 'chooseList') console.log(chooseList, 'chooseList')
return [selectList, chooseList] return [selectList, chooseList]
}, },
...@@ -227,7 +243,7 @@ Component({ ...@@ -227,7 +243,7 @@ Component({
attached() { attached() {
console.log(77777) console.log(77777)
this.setData({ this.setData({
windowHight: wx.getSystemInfoSync().windowHeight windowHight: getSystemInfoSync().windowHeight
}) })
} }
} }
......
import { IMG_URL } from '../../utils/imageBase.js'
// components/StoreSelectPopup/StoreSelectPopup.js // components/StoreSelectPopup/StoreSelectPopup.js
import api from '~/api/api' import api from '~/api/api'
Component({ Component({
...@@ -28,6 +29,7 @@ Component({ ...@@ -28,6 +29,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
pageNum: 1, pageNum: 1,
scrollTop: 0, scrollTop: 0,
nothing: false nothing: false
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="input {{ searchValue?'':'placeholder' }}" bindtap="open"> <view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{ searchValue }}">{{searchValue}}</block> <block wx:if="{{ searchValue }}">{{searchValue}}</block>
<block wx:else> <block wx:else>
<image src="/images/search.png" class="icon"></image> <image src="{{ IMG_URL }}images/search.png" class="icon"></image>
查找 查找
</block> </block>
</view> </view>
......
...@@ -165,7 +165,7 @@ Component({ ...@@ -165,7 +165,7 @@ Component({
}, },
// 更新日志 // 更新日志
goVersionPage() { goVersionPage() {
wx.$router.go('pages.log') wx.$router.go('tabMine.log')
}, },
// 切换场景 // 切换场景
changeScene() { changeScene() {
......
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
</view> </view>
</view> </view>
<view class="logout-box"> <view class="logout-box">
<view class="logout text-center" bindtap="changeAccount">切换账号</view> <view class="logout logout-first text-center" bindtap="changeAccount">切换账号</view>
<view class="logout text-center" bindtap="logout">退出账号</view> <view class="logout text-center" bindtap="logout">退出账号</view>
<view class="message-box"> <view class="message-box">
<!-- <view class="message">为保障你的合法权益,请阅读并同意</view> --> <!-- <view class="message">为保障你的合法权益,请阅读并同意</view> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text> <text class="agreement-link" catchtap="jump" data-url="privacy">《隐私协议》</text>
和 和
<text catchtap="jump" data-url="agreement">《用户协议》</text> <text class="agreement-link" catchtap="jump" data-url="agreement">《用户协议》</text>
</view> </view>
</view> </view>
</view> </view>
......
/* tabComponents/pages/index/index.wxss */ /* tabComponents/pages/index/index.wxss */
page {
background: #F7F8FA;
}
.pagedetail { .pagedetail {
position: relative; position: relative;
...@@ -10,6 +7,7 @@ page { ...@@ -10,6 +7,7 @@ page {
.layout_box { .layout_box {
height: 100%; height: 100%;
overflow: scroll; overflow: scroll;
background: #F7F8FA;
} }
.main { .main {
...@@ -387,7 +385,7 @@ page { ...@@ -387,7 +385,7 @@ page {
font-size: var(--fontSize28); font-size: var(--fontSize28);
} }
.logout-box :first-child { .logout-box .logout-first {
border-bottom: 1rpx solid #E4E8EE; border-bottom: 1rpx solid #E4E8EE;
} }
...@@ -399,7 +397,7 @@ page { ...@@ -399,7 +397,7 @@ page {
transform: translateX(-50%); transform: translateX(-50%);
} }
.message-box text { .message-box .agreement-link {
color: #5092FF; color: #5092FF;
} }
.text-center { .text-center {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="box-title"> <view class="box-title">
<view>技师</view> <view>技师</view>
<!-- <view class="tips">使用<text bind:tap="goMiniprogram">生意助手小程序</text>登录创建技师</view> --> <!-- <view class="tips">使用<text bind:tap="goMiniprogram">生意助手小程序</text>登录创建技师</view> -->
<view class="tips" wx:if="{{ multiple }}">产生副手技师,请主技师为副手技师分配整单提成比例</view> <view class="tips" wx:if="{{ multiple && deputyFlag }}">产生副手技师,请主技师为副手技师分配整单提成比例</view>
</view> </view>
<block wx:if="{{ artificerList.length }}"> <block wx:if="{{ artificerList.length }}">
<scroll-view <scroll-view
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<view class="text_box"> <view class="text_box">
<view class="text-hide {{ item.disabled ? 'disabled' : '' }}">{{item.staffName}}</view> <view class="text-hide {{ item.disabled ? 'disabled' : '' }}">{{item.staffName}}</view>
</view> </view>
<view class="shareRatioBox" wx:if="{{ multiple && item.active }}"> <view class="shareRatioBox" wx:if="{{ multiple && item.active && deputyFlag }}">
整单分成比例 整单分成比例
<input <input
placeholder="整数" placeholder="整数"
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<block wx:else> <block wx:else>
<empty-data style="width: 100%;" /> <empty-data style="width: 100%;" />
</block> </block>
<view class="tips bottomTips" wx:if="{{ multiple }}"> <view class="tips bottomTips" wx:if="{{ multiple && deputyFlag }}">
主技师整单分成比例 主技师整单分成比例
<text class="text">{{ showMainShareRatio }}%</text> <text class="text">{{ showMainShareRatio }}%</text>
</view> </view>
......
/**
* @file 技师选择弹层纯逻辑 — idKey 分支、列表映射、confirm 载荷
* 供 Artificer/Technician 合并后单测;组件内 setData 前调用。
*/
/**
* 从选中对象取 identity key
* @param {object} item
* @param {'technicianId'|'uuid'} idKey
* @returns {string|number|undefined}
*/
export function getItemKey(item, idKey) {
if (!item) return undefined
if (idKey === 'uuid') return item.uuid
return item.technicianId || item.id
}
/**
* 从 artificerSelectObj 构建选中 id 数组
* @param {object|object[]} artificerSelectObj
* @param {'technicianId'|'uuid'} idKey
* @returns {Array<string|number>}
*/
export function buildSelectArr(artificerSelectObj, idKey) {
if (Array.isArray(artificerSelectObj)) {
return artificerSelectObj.map(val => getItemKey(val, idKey)).filter(k => k != null)
}
const key = getItemKey(artificerSelectObj, idKey)
return key != null ? [key] : []
}
/**
* 选中项 shareRatio 映射
* @param {object[]} selectedList
* @param {'technicianId'|'uuid'} idKey
* @returns {Record<string|number, *>}
*/
export function buildRatioMap(selectedList, idKey) {
return selectedList.reduce((m, v) => {
const k = getItemKey(v, idKey)
if (k != null) m[k] = v.shareRatio
return m
}, {})
}
/**
* 打开弹层时映射技师列表 active/disabled/shareRatio
* @param {object[]} copyArtificerList
* @param {object} options
* @returns {object[]}
*/
export function mapArtificerList(copyArtificerList, options) {
const {
artificerSelectObj,
selectArr,
ratioMap,
idKey,
disabledSelectObj,
deputyFlag
} = options
const selectedList = Array.isArray(artificerSelectObj)
? artificerSelectObj
: artificerSelectObj
? [artificerSelectObj]
: []
let list = (copyArtificerList || []).map(i => {
let item = { ...i }
if (idKey === 'uuid' && selectedList.length) {
const matched = selectedList.find(v => v.uuid == i.uuid)
if (matched?.id !== undefined) item.id = matched.id
}
const itemKey = idKey === 'uuid' ? i.uuid : i.id
const active = selectArr?.includes(itemKey)
const disabled =
disabledSelectObj?.findIndex(val => val.uuid == i.uuid) > -1
const shareRatio = active ? ratioMap[itemKey] ?? '' : ''
return { ...item, active, disabled, shareRatio }
})
if (selectArr.length === 2 && deputyFlag) {
list = list.map(i => {
const itemKey = idKey === 'uuid' ? i.uuid : i.id
if (!selectArr.includes(itemKey)) return { ...i, disabled: true }
return i
})
}
return list
}
/**
* 计算主技师剩余分成比例
* @param {object[]} list
* @returns {number}
*/
export function calcShowMainShareRatio(list) {
const sum = (list || [])
.filter(i => i.active)
.map(i => parseInt(i.shareRatio || 0, 10))
.reduce((a, b) => a + (isNaN(b) ? 0 : b), 0)
let showMainShareRatio = 100 - sum
if (showMainShareRatio < 0) showMainShareRatio = 0
if (showMainShareRatio > 100) showMainShareRatio = 100
return showMainShareRatio
}
/**
* 确认时构建 payload;空选时 deputy 模式允许清空
* @param {object} params
* @returns {{ ok: boolean, reason?: string, payload?: object }}
*/
export function buildConfirmPayload({ artificerSelectObj, activeArr, idKey, deputyFlag }) {
if (!activeArr?.length) {
if (deputyFlag) {
return {
ok: true,
payload: {
...artificerSelectObj,
technicianUuid: '',
technicianName: '',
selectedTechnicians: []
}
}
}
return { ok: false, reason: 'empty' }
}
if (deputyFlag) {
const invalid = activeArr.some(
v =>
v.shareRatio === '' ||
v.shareRatio === undefined ||
v.shareRatio === null
)
if (invalid) return { ok: false, reason: 'invalid_ratio' }
}
const payload = {
...artificerSelectObj,
technicianUuid: activeArr[0]?.uuid || '',
technicianName: activeArr[0]?.staffName || '',
selectedTechnicians: activeArr
}
if (idKey === 'technicianId') {
payload.technicianId = activeArr[0]?.id || ''
}
return { ok: true, payload }
}
...@@ -98,7 +98,6 @@ Component({ ...@@ -98,7 +98,6 @@ Component({
_btnTextColor: ['#A2A2A8', '#333333', '#303030'], _btnTextColor: ['#A2A2A8', '#333333', '#303030'],
maskAnimate: [], maskAnimate: [],
frameAnimate: [], frameAnimate: [],
title: '', // 提示弹框
success: () => {}, // 成功 success: () => {}, // 成功
error: () => {} // 失败 error: () => {} // 失败
}, },
......
import { IMG_URL } from '../../utils/imageBase.js'
// components/navigationBar/navigationBar.js // components/navigationBar/navigationBar.js
import util from '../../utils/util' import util from '../../utils/util'
import { getSystemInfo, getSystemInfoSync } from '~/utils/systemInfo'
const app = getApp() const app = getApp()
Component({ Component({
options: { options: {
...@@ -19,6 +21,7 @@ Component({ ...@@ -19,6 +21,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
// navigationBarHeight: 70 // navigationBarHeight: 70
// // 状态栏高度 // // 状态栏高度
// statusBarHeight: app.globalData.statusBarHeight, // statusBarHeight: app.globalData.statusBarHeight,
...@@ -45,11 +48,11 @@ Component({ ...@@ -45,11 +48,11 @@ Component({
*/ */
let _this = this let _this = this
// 获取屏幕宽度和高度 // 获取屏幕宽度和高度
const { windowWidth, windowHeight } = wx.getSystemInfoSync() const { windowWidth, windowHeight } = getSystemInfoSync()
// 判断屏幕方向 // 判断屏幕方向
const isLandscape = windowWidth > windowHeight // '横屏' : '竖屏' const isLandscape = windowWidth > windowHeight // '横屏' : '竖屏'
wx.getSystemInfo({ getSystemInfo({
success(res) { success(res) {
let { let {
fontSizeSetting, fontSizeSetting,
...@@ -106,7 +109,7 @@ Component({ ...@@ -106,7 +109,7 @@ Component({
}) })
}, },
getFallbackNavBarRect() { getFallbackNavBarRect() {
const sys = wx.getSystemInfoSync() const sys = getSystemInfoSync()
const menu = wx.getMenuButtonBoundingClientRect() const menu = wx.getMenuButtonBoundingClientRect()
const statusBarHeight = const statusBarHeight =
sys.platform === 'ios' ? sys.safeArea?.top ?? sys.statusBarHeight : sys.statusBarHeight sys.platform === 'ios' ? sys.safeArea?.top ?? sys.statusBarHeight : sys.statusBarHeight
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<block wx:if="{{ showBack }}"> <block wx:if="{{ showBack }}">
<view class="back-box" bindtap="back"> <view class="back-box" bindtap="back">
<view class="back"> <view class="back">
<image src="../../images/back.png" /> <image src="{{ IMG_URL }}images/back.png" />
</view> </view>
</view> </view>
</block> </block>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
border-radius: 50%; border-radius: 50%;
border: var(--fontSize2) solid #E3E3E6; border: var(--fontSize2) solid #E3E3E6;
} }
image{ .radio-icon{
width: var(--fontSize32); width: var(--fontSize32);
height: var(--fontSize32); height: var(--fontSize32);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="prompt_content"> <view class="prompt_content">
<view class="select_item"> <view class="select_item">
<block wx:if="{{infoData.payFlag == 1}}"> <block wx:if="{{infoData.payFlag == 1}}">
<image src="/components/images/radio.png" /> <image class="radio-icon" src="/components/images/radio.png" />
</block> </block>
<block wx:else> <block wx:else>
<view class="arc" bindtap="chooseParent" data-type="1" /> <view class="arc" bindtap="chooseParent" data-type="1" />
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
<view class="select_item" style="border-bottom: 0rpx;"> <view class="select_item" style="border-bottom: 0rpx;">
<block wx:if="{{infoData.payFlag == 2}}"> <block wx:if="{{infoData.payFlag == 2}}">
<image src="/components/images/radio.png" /> <image class="radio-icon" src="/components/images/radio.png" />
</block> </block>
<block wx:else> <block wx:else>
<view class="arc" bindtap="chooseParent" data-type="2" /> <view class="arc" bindtap="chooseParent" data-type="2" />
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="child_select_content" wx:if="{{infoData.payFlag == 2}}"> <view class="child_select_content" wx:if="{{infoData.payFlag == 2}}">
<view wx:for="{{payTypeList}}" class="child_select_item" wx:key="index"> <view wx:for="{{payTypeList}}" class="child_select_item" wx:key="index">
<block wx:if="{{infoData.payType == item.value}}"> <block wx:if="{{infoData.payType == item.value}}">
<image src="/components/images/radio.png" /> <image class="radio-icon" src="/components/images/radio.png" />
</block> </block>
<block wx:else> <block wx:else>
<view class="arc" bindtap="chooseChild" data-type="{{item.value}}" /> <view class="arc" bindtap="chooseChild" data-type="{{item.value}}" />
......
import { IMG_URL } from '../../utils/imageBase.js'
Component({ Component({
data: {
IMG_URL,
},
properties: { properties: {
show: { show: {
type: Boolean, type: Boolean,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="template-item" bindtap="onSelect" data-item="{{item}}"> <view class="template-item" bindtap="onSelect" data-item="{{item}}">
<view class="item-name">{{item.name}}</view> <view class="item-name">{{item.name}}</view>
<view class="arrow-right"> <view class="arrow-right">
<image src="/images/arrow-right.png" class="arrow-img" /> <image src="{{ IMG_URL }}images/arrow-right.png" class="arrow-img" />
</view> </view>
</view> </view>
</block> </block>
......
/**
* @file storePicker 纯逻辑 — confirm/toast 与 show 重置
* 供全局 storePicker 合并 staffDaily 副本后单测。
*/
/**
* 未选时的 toast 文案
* @param {string|undefined} pickerType - 'merchant' | 'staff'
* @returns {string}
*/
export function getConfirmToast(pickerType) {
if (pickerType === 'staff') return '请选择员工'
return '请选择门店'
}
/**
* confirm 时是否额外 trigger search(operatingShow 默认 true)
* @param {string|undefined} pickerType
* @returns {boolean}
*/
export function shouldEmitSearchOnConfirm(pickerType) {
return !pickerType
}
/**
* show=true 时是否清空搜索并 emit search
* @param {boolean} show
* @returns {{ searchValue: string, shouldEmitSearch: boolean }|null}
*/
export function getShowResetSearchState(show) {
if (!show) return null
return { searchValue: '', shouldEmitSearch: true }
}
/**
* 搜索 confirm 时是否重置 picker 选中索引为 0(staffDaily 行为)
* @param {string} type - input 事件 type
* @returns {boolean}
*/
export function shouldResetSelectOnSearchConfirm(type) {
return type === 'confirm'
}
// packageEquity/components/storePicker/storePicker.js import { IMG_URL } from '../../utils/imageBase.js'
import {
getConfirmToast,
shouldEmitSearchOnConfirm,
getShowResetSearchState,
shouldResetSelectOnSearchConfirm
} from './storePicker.helpers.js'
Component({ Component({
options: { options: {
// 在组件定义时的选项中启用多slot支持 multipleSlots: true
multipleSlots: true,
}, },
/**
* 组件的属性列表
*/
properties: { properties: {
subIndex: { subIndex: {
type: Number, type: Number,
// value: [],
observer: function (n) { observer: function (n) {
this.setData({ this.setData({ selectStoreIndex: [n] })
selectStoreIndex: [n]
})
} }
}, },
pickList: { pickList: {
type: Array, type: Array,
value: [] value: [],
observer: function () {
if (this.properties.pickerType) {
this.setData({ selectStoreIndex: this.data.selectStoreIndex })
}
}
}, },
show: { show: {
type: Boolean type: Boolean,
observer: function (n) {
const reset = getShowResetSearchState(n)
if (!reset) return
this.setData({ searchValue: reset.searchValue })
if (reset.shouldEmitSearch && this.properties.pickerType) {
this.triggerEvent('search', { value: '' })
}
}
},
/** staffDaily:merchant | staff;不传则 operatingShow 默认行为 */
pickerType: {
type: String,
observer: function () {
if (!this.properties.pickerType) return
let thisPage = wx.$router.getPageInstance()
if (this.data.searchValue) thisPage.setData({ subIndex: 0 })
this.setData({ searchValue: '' })
this.triggerEvent('search', { value: '' })
}
},
merchantRangeListTotal: {
type: Number
} }
}, },
/**
* 组件的初始数据
*/
data: { data: {
IMG_URL,
searchValue: '', searchValue: '',
selectStoreIndex: '', selectStoreIndex: '',
edit: false edit: false
}, },
/**
* 组件的方法列表
*/
methods: { methods: {
open() { open() {
if (this.data.disabled) return if (this.data.disabled) return
this.setData({ this.setData({ edit: true, inputFocus: true })
edit: true,
inputFocus: true
})
}, },
setValue(value) { setValue(value) {
if (this.properties.filterEmoji) { if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value) if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
} }
this.setData({ this.setData({ searchValue: value })
searchValue: value
})
}, },
input(e) { input(e) {
let { value } = e.detail let { value } = e.detail
this.setValue(value) this.setValue(value)
this.triggerEvent('input', { this.triggerEvent('input', { value })
value
})
}, },
inputBlur(e) { inputBlur(e) {
this.emit(e) this.emit(e)
...@@ -70,33 +85,33 @@ Component({ ...@@ -70,33 +85,33 @@ Component({
detail: { value }, detail: { value },
type type
} = e } = e
this.setData({ this.setData({ edit: false })
edit: false if (shouldResetSelectOnSearchConfirm(type) && this.properties.pickerType) {
}) this.setData({ selectStoreIndex: [0] })
}
this.setValue(value) this.setValue(value)
console.log('123')
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', { value }) this.triggerEvent(type == 'confirm' ? 'search' : 'blur', { value })
}, },
confirm() { confirm() {
let { selectStoreIndex, pickList } = this.data let { selectStoreIndex, pickList, pickerType } = this.data
let value = selectStoreIndex[0] let value = selectStoreIndex[0]
console.log(value) const item = pickList[value]
console.log(pickList) const hasSelection =
if (!pickList[value]?.merchantName) { pickerType === 'staff' ? item?.staffName : item?.merchantName
return wx.$util.showToast('请选择门店') if (!hasSelection) {
return wx.$util.showToast(getConfirmToast(pickerType))
} }
// console.log(value)
this.triggerEvent('confirm', { value }) this.triggerEvent('confirm', { value })
if (shouldEmitSearchOnConfirm(pickerType)) {
this.triggerEvent('search', { value }) this.triggerEvent('search', { value })
this.setData({ }
show: false this.setData({ show: false })
}) },
cancel() {
this.triggerEvent('cancel')
}, },
changeStore(e) { changeStore(e) {
// console.log(e.detail.value[0]) this.setData({ selectStoreIndex: [e.detail.value[0]] })
this.setData({
selectStoreIndex: [e.detail.value[0]]
})
} }
} }
}) })
<!--packageEquity/components/storePicker/storePicker.wxml--> <!--components/storePicker/storePicker.wxml-->
<popup class="date-background" popup-slot-class="popup-style" show="{{ show }}" bindconfirm="confirm" height="80%"> <popup
class="date-background"
popup-slot-class="popup-style"
show="{{ show }}"
bindconfirm="confirm"
bindcancel="cancel"
height="{{ pickerType ? 'var(--fontSize800)' : '80%' }}"
>
<view class="date-container"> <view class="date-container">
<view class="date-confirm"> <view class="date-confirm">
<view class="search-box"> <view class="search-box">
...@@ -8,8 +15,10 @@ ...@@ -8,8 +15,10 @@
<view class="input {{ searchValue?'':'placeholder' }}" bindtap="open"> <view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{ searchValue }}">{{searchValue}}</block> <block wx:if="{{ searchValue }}">{{searchValue}}</block>
<block wx:else> <block wx:else>
<image src="/images/search.png" class="icon"></image> <image src="{{ IMG_URL }}images/search.png" class="icon"></image>
{{'请输入门店'}} <block wx:if="{{ pickerType == 'staff' }}">请输入员工姓名</block>
<block wx:elif="{{ pickerType == 'merchant' }}">请输入门店</block>
<block wx:else>请输入门店</block>
</block> </block>
</view> </view>
</block> </block>
...@@ -38,10 +47,14 @@ ...@@ -38,10 +47,14 @@
> >
<picker-view-column> <picker-view-column>
<block wx:for="{{ pickList }}" wx:key="merchantId"> <block wx:for="{{ pickList }}" wx:key="merchantId">
<view class="view pickViewColumn">{{item.merchantName}}</view> <view class="view pickViewColumn">
<block wx:if="{{ pickerType == 'staff' }}">{{item.staffName}}</block>
<block wx:else>{{item.merchantName}}</block>
</view>
</block> </block>
</picker-view-column> </picker-view-column>
</picker-view> </picker-view>
</view> </view>
<view class="totalCount" wx:if="{{ pickerType == 'merchant' }}">共计{{merchantRangeListTotal}}家门店</view>
</view> </view>
</popup> </popup>
...@@ -65,3 +65,9 @@ ...@@ -65,3 +65,9 @@
.popup-style{ .popup-style{
height: calc(100% - var(--fontSize100))!important; height: calc(100% - var(--fontSize100))!important;
} }
.totalCount {
text-align: center;
margin-top: 100rpx;
color: #347BFF;
}
\ No newline at end of file \ No newline at end of file

857 Bytes | W: | H:

3.91 KB | W: | H:

tabWorkOrder/images/activeIcon.png
tabWorkOrder/images/activeIcon.png
tabWorkOrder/images/activeIcon.png
tabWorkOrder/images/activeIcon.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!