Commit ec1c512f by 张立顺

feat 代码综合优化

1 parent 2fbe173f
Showing 334 changed files with 740 additions and 128 deletions
{"containers":[],"config":{}}
\ No newline at end of file \ No newline at end of file
...@@ -26,7 +26,7 @@ setSystem_info(); // 存储设备信息 ...@@ -26,7 +26,7 @@ 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')
...@@ -92,10 +92,9 @@ App({ ...@@ -92,10 +92,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
......
...@@ -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,12 +283,10 @@ ...@@ -289,12 +283,10 @@
"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/Calendar/Calendar", "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", "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",
...@@ -309,10 +301,9 @@ ...@@ -309,10 +301,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": {
......
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>
......
...@@ -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。
*/
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
wx.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;
}
}
<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 }}" />
......
/**
* @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, ' ') : ''
......
<!-- 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">
......
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.js // components/SideSelectPopup/SideSelectPopup.js
import { IMG_URL } from '~/utils/imageBase.js'
import api from '~/api/api' import api from '~/api/api'
import sceneData from '~/pages/constant/data' import sceneData from '~/pages/constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
const SCENE_NAME_MAP = (sceneData?.sceneList || []).reduce((acc, cur) => { const SCENE_NAME_MAP = (sceneData?.sceneList || []).reduce((acc, cur) => {
if (cur && cur.sceneType != null) acc[cur.sceneType] = cur.sceneName if (cur && cur.sceneType != null) acc[cur.sceneType] = cur.sceneName
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,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>
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
<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>
......
// components/SideSelectPopup/SideSelectPopup.js // components/SideSelectPopup/SideSelectPopup.js
import { IMG_URL } from '~/utils/imageBase.js'
import api from '~/api/api' import api from '~/api/api'
import sceneData from '~/pages/constant/data' import sceneData from '~/pages/constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
const SCENE_NAME_MAP = (sceneData?.sceneList || []).reduce((acc, cur) => { const SCENE_NAME_MAP = (sceneData?.sceneList || []).reduce((acc, cur) => {
if (cur && cur.sceneType != null) acc[cur.sceneType] = cur.sceneName if (cur && cur.sceneType != null) acc[cur.sceneType] = cur.sceneName
......
...@@ -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,10 +48,10 @@ ...@@ -48,10 +48,10 @@
<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>
......
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() {
......
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'
const app = getApp() const app = getApp()
...@@ -19,6 +20,7 @@ Component({ ...@@ -19,6 +20,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
// navigationBarHeight: 70 // navigationBarHeight: 70
// // 状态栏高度 // // 状态栏高度
// statusBarHeight: app.globalData.statusBarHeight, // statusBarHeight: app.globalData.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>
......
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>
......
import { IMG_URL } from '../../utils/imageBase.js'
// packageEquity/components/storePicker/storePicker.js // packageEquity/components/storePicker/storePicker.js
Component({ Component({
options: { options: {
...@@ -29,6 +30,7 @@ Component({ ...@@ -29,6 +30,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMG_URL,
searchValue: '', searchValue: '',
selectStoreIndex: '', selectStoreIndex: '',
edit: false edit: false
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,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>
......
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1; let index = 2;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
# 静态图 CDN 迁移 — 全对话改动总览
本文档记录本对话中**主包体积优化相关的静态图 CDN 迁移**及关联修复。WXS 上传编译修复见独立文档 [WXS-UPLOAD-FIX.md](./WXS-UPLOAD-FIX.md)(**已验证**)。
## 背景
为减小主包体积,将原工程根目录 `images/` 及权益分包内大量本地静态图迁移至 CDN,运行时通过 `IMG_URL` 或专用 helper 拼接 URL。
**CDN 基址**([`config.js`](../config.js)):
```
https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat
```
---
## 改动阶段概览
| 阶段 | 内容 | 关键文件 |
|------|------|---------|
| 1 | 权益分包 `pages/image`、OCR 贴图迁 CDN | [`packageEquity/config/imageCdn.js`](../packageEquity/config/imageCdn.js) |
| 2 | 根 `images/` 批量迁 CDN | [`utils/imageBase.js`](../utils/imageBase.js)、62 wxml + 37 js |
| 3 | CDN 404 / 双 URL 修复 | `SideSelectPopup`、`GlImage`、`tabIndex` order 快捷入口 |
| 4 | WXML 混用引号编译错误修复 | 5 个 wxml |
| 5 | WXS 上传 `index.wxs not found` | [WXS-UPLOAD-FIX.md](./WXS-UPLOAD-FIX.md)(已验证) |
---
## 工具模块
### [`utils/imageBase.js`](../utils/imageBase.js)
主包及多分包共用的根 `images/` CDN 前缀:
```javascript
export const IMG_URL = `${ImgUrl}/` // 末尾带 /
export const rootImageUrl = name => `${ImgUrl}/images/${name}`
```
**WXML 用法**:页面 js 注入 `data.IMG_URL`,模板中:
```html
<image src="{{ IMG_URL }}images/search.png" />
```
**约定**:`IMG_URL` 已含末尾 `/`,拼接路径不要再多加 `/`。
### [`packageEquity/config/imageCdn.js`](../packageEquity/config/imageCdn.js)
权益分包专用静态图路径:
| 函数 | CDN 前缀 | 用途 |
|------|---------|------|
| `equityImageUrl(name)` | `.../packageEquity/images/` | 分包根级 images |
| `pagesImageUrl(name)` | `.../packageEquity/pages/image/` | 招聘/薪酬等页图标 |
| `ocrImageUrl(name)` | `.../packageEquity/pages/ocrEquityModules/image/` | OCR 相机贴图 |
WXML 中亦常见:`{{ IMG_URL }}packageEquity/pages/image/xxx.png`(`IMG_URL` 与 CDN 根路径等价)。
---
## 根 `images/` 迁移
### wxml
- 模式:`/images/xxx` → `{{ IMG_URL }}images/xxx`
- 约 **62** 个 wxml 文件已批量替换
### js
- 约 **37** 个页面/组件 js 从 `imageBase.js` 引入 `IMG_URL` 并写入 `data`
- 模式:`import { IMG_URL } from '~/utils/imageBase.js'`(或相对路径)
### 保留本地文件
[`app.json`](../app.json) 主 TabBar **仍使用本地** `images/tab-*.png`(共 **10** 个文件),未删除:
- `tab-home`、`tab-date`、`tab-order`、`tab-repair`、`tab-mine` 及对应 `-active` 图标
### 分包自定义 TabBar(已改 CDN)
以下 Tab 页 `iconPath` 使用 `IMG_URL + 'images/tab-*.png'`:
- [`packageEquity/pages/TabBar/equityPage.js`](../packageEquity/pages/TabBar/equityPage.js)
- [`packageCrowdFunding/pages/TabBar/crowdFundingPage.js`](../packageCrowdFunding/pages/TabBar/crowdFundingPage.js)
- [`subvehicleConversion/pages/TabBar/conversionPage.js`](../subvehicleConversion/pages/TabBar/conversionPage.js)
- [`packageUsedCar/pages/TabBar/usedCarPage.js`](../packageUsedCar/pages/TabBar/usedCarPage.js)
---
## tabIndex 首页
[`tabIndex/pages/index/index.wxml`](../tabIndex/pages/index/index.wxml):
| 资源 | 引用方式 |
|------|---------|
| `arrow-bottom.png`、`server-center-icons.png`、`arrSolid.png` | `{{ IMG_URL }}images/...` |
| order1 / order3 快捷入口 | `<gl-image src="/miniProgram/order1.png">`(相对 CDN 路径,**不要**写完整 `https://`) |
`arrSolid.png` 运维待上传目录:[`cdn-upload/images/arrSolid.png`](../cdn-upload/images/arrSolid.png)
---
## gl-image 组件
[`components/GlImage/index.js`](../components/GlImage/index.js):
- 非 `http(s)://` 的 `src`:拼接 `ImgUrl + src`(如 `/miniProgram/order1.png`)
- **已是绝对 URL**:直接使用,避免 `work-wechathttps://...` 双拼
```javascript
const isAbsolute = /^https?:\/\//.test(url)
imagePath: isAbsolute ? url : `${ImgUrl}${url}`
```
---
## SideSelect 搜索图 404 修复
[`components/SideSelectPopup/SideSelectPopup.js`](../components/SideSelectPopup/SideSelectPopup.js)、[`SideSelectByPagePopup.js`](../components/SideSelectByPagePopup/SideSelectByPagePopup.js):
- 从 [`utils/imageBase.js`](../utils/imageBase.js) 引入 `IMG_URL`(带末尾 `/`)
- 修复错误拼接 `...work-wechatimages/search.png`(缺少 `/`)
---
## WXML 引号修复(批量替换副作用)
以下文件曾出现 `src="{{ IMG_URL }}...'` 混用引号导致编译失败,已改为统一双引号:
| 文件 |
|------|
| `components/SideSelectPopup/SideSelectPopup.wxml` |
| `components/SideSelectByPagePopup/SideSelectByPagePopup.wxml` |
| `pages/merchantList/merchantList.wxml` |
| `packageCrowdFunding/.../activityDetail/activityDetail.wxml` |
| `subvehicleConversion/.../supplementaryOrderList/supplementaryOrderList.wxml` |
---
## 迁移脚本(一次性,勿重复执行)
| 脚本 | 作用 |
|------|------|
| [`scripts/migrate-root-images-cdn.mjs`](../scripts/migrate-root-images-cdn.mjs) | wxml `/images/` → `{{ IMG_URL }}images/` |
| [`scripts/inject-img-url.mjs`](../scripts/inject-img-url.mjs) | js 页注入 `IMG_URL` |
---
## WXS 上传修复(已验证)
组件 `src="index.wxs"` 在 `ignoreUploadUnusedFiles: true` 时易被剔除。已改为绝对路径并删 3 个重复 wxs。
**详见**:[WXS-UPLOAD-FIX.md](./WXS-UPLOAD-FIX.md)
---
## 运维:CDN 上传清单
部署前确认以下路径在 CDN 上可访问(基址 + 相对路径):
| CDN 路径 | 说明 |
|---------|------|
| `images/search.png`、`images/clear.png`、`images/filter.png` 等 | 原根 `images/` 已迁走资源 |
| `images/arrow-bottom.png`、`images/server-center-icons.png`、`images/arrSolid.png` | 首页 |
| `images/tab-*.png` | 分包 TabBar 使用(主包 tab 仍读本地) |
| `packageEquity/pages/image/*` | 招聘/车权益等页图标 |
| `packageEquity/images/*` | 权益分包根级图 |
| `packageEquity/pages/ocrEquityModules/image/*` | OCR 贴图 |
| `miniProgram/order1.png`、`miniProgram/order3.png` | 首页 gl-image 快捷入口 |
本地待上传 staging:[`cdn-upload/`](../cdn-upload/)
---
## 自动化测试
| 范围 | 命令 | 用例 |
|------|------|------|
| imageBase | `npm run test:equity` | IT-IMG-BASE-001/002(`IMG_URL` 末尾 `/`、`rootImageUrl` 路径) |
| wxs 纯函数 | `node --test tests/wxsFilters.test.mjs` | IT-WXS-PRICE/PCT/GOODS 共 4 项 |
| 全量 | `npm test` | 含上述 + 各分包测试 |
### 测试执行记录
| 日期 | 命令 | 结果 |
|------|------|------|
| 2026-06-24 | `npm run test:equity` | **83/83 通过**(含 imageBase) |
| 2026-06-24 | `node --test tests/wxsFilters.test.mjs` | **4/4 通过** |
| 2026-06-24 | `npm test` | **672/673 通过**;1 失败为 `packageDynamicForm` 既有 `daily-report-calendar`(日期周界,与本次无关) |
---
## 手动回归测试清单
### 必测 — CDN / 上传
| # | 页面/功能 | 操作 | 预期 |
|---|----------|------|------|
| 1 | **微信上传** | 上传代码 | 无 wxml 编译错误 |
| 2 | **精品首页** `tabIndex/pages/index` | 打开首页 | 门店箭头、服务中心图标、`arrSolid` **不 404** |
| 3 | 同上 | 底部 order1 / order3 快捷入口 | 图标正常,无双 URL |
| 4 | **SideSelectPopup** | 首页切店 / 店面列表弹窗 | `search.png` 正常 |
| 5 | **主 TabBar** | 切换 5 个 tab | 本地 `images/tab-*.png` 正常 |
### 搜索框 / 筛选图(抽测)
含 `{{ IMG_URL }}images/search.png` 的页面抽测:
- `pages/tabRepairOrder` 施工单列表
- `packageEquity/clueList` 线索列表
- `subvehicleConversion/activityManagement` 活动管理
- `tabWorkOrder/residentManage` 驻店商户
- `components/storePicker` 门店选择
验证:`search.png`、`clear.png`、`filter.png` 显示正常。
### 权益分包静态图 CDN
| 页面 | 验证点 |
|------|--------|
| `recruitManage` / `recruitDetail` / `recruitResult` | 电话、箭头、空状态等 `pages/image` 图标 |
| `carEquity/previewList` | preview / download webp |
| `carEquity/ShadeTip` | success / error 图标 |
| OCR 权益相机页 | `ocrEquityModules/image` 贴图 |
### 分包自定义 TabBar
| Tab 页 | 验证点 |
|--------|--------|
| `packageEquity/TabBar/equityPage` | 5 tab CDN 图标 |
| `packageCrowdFunding/TabBar/crowdFundingPage` | 3 tab |
| `subvehicleConversion/TabBar/conversionPage` | 4 tab |
| `packageUsedCar/TabBar/usedCarPage` | 4 tab |
### WXS(已验证 — 可跳过)
详见 [WXS-UPLOAD-FIX.md](./WXS-UPLOAD-FIX.md)「快速冒烟」章节。
### 快速冒烟(CDN,约 5 分钟)
1. 上传编译通过
2. 精品首页 + 切店弹窗搜索图标
3. order1 / order3 快捷图标
4. 权益 `recruitManage` 右下角插入按钮图
5. 权益分包 Tab 切换一眼
---
## 维护约定
1. 新增静态图优先上传 CDN,WXML 使用 `{{ IMG_URL }}...` 或分包 `imageCdn.js` helper
2. `gl-image` 的 `src` 使用 `/miniProgram/...` 等相对 CDN 路径,避免在属性里写完整 `https://`
3. 组件引用 wxs 使用绝对路径 `/分包/.../xxx.wxs`(见 WXS 文档)
4. 修改 `priceFilter` 等 wxs 算法时同步 `balanceNote.js` 与 `tests/wxsFilters.test.mjs`
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
| [延保 & 权益 — 园区店 ID 使用清单](./YQ-MERCHANT-ID-USAGE.md) | 延保/权益场景下哪些功能与 API 用到园区店 ID | | [延保 & 权益 — 园区店 ID 使用清单](./YQ-MERCHANT-ID-USAGE.md) | 延保/权益场景下哪些功能与 API 用到园区店 ID |
| [packageEquity sceneType:0 专章](./EQUITY-SCENE0-YQ-MERCHANT-ID.md) | 权益本包 + 关联分包/页面的园区店 ID 清单 | | [packageEquity sceneType:0 专章](./EQUITY-SCENE0-YQ-MERCHANT-ID.md) | 权益本包 + 关联分包/页面的园区店 ID 清单 |
| [服务中心公告弹窗 — 精品 vs 权益](./SERVICE-CENTER-NOTICE-POPUP.md) | 两首页 `checkServiceNotice` 行为差异与版本变更记录 | | [服务中心公告弹窗 — 精品 vs 权益](./SERVICE-CENTER-NOTICE-POPUP.md) | 两首页 `checkServiceNotice` 行为差异与版本变更记录 |
| [静态图 CDN 迁移总览](./CDN-IMAGE-MIGRATION.md) | 根 images/、权益分包图、gl-image、SideSelect 404 等全对话改动与回归清单 |
| [WXS 上传编译修复](./WXS-UPLOAD-FIX.md) | 组件 wxs 绝对路径规范、改动映射表与手动回归清单 |
## 分包文档 ## 分包文档
......
...@@ -5,11 +5,8 @@ ...@@ -5,11 +5,8 @@
"packages": { "packages": {
"": { "": {
"dependencies": { "dependencies": {
"@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24", "@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0",
"glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0", "number-precision": "^1.6.0",
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
}, },
...@@ -126,11 +123,6 @@ ...@@ -126,11 +123,6 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@vant/area-data": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/@vant/area-data/-/area-data-1.5.2.tgz",
"integrity": "sha512-Gtxgt6Rjgopt6234ANpO0bBsSwtjZ23lBlVDHIy8Mi2NJqyoj1vgVWY0dri8/2LCZAWzQ6EnwRrUVViUZ0cvMA=="
},
"node_modules/@vant/weapp": { "node_modules/@vant/weapp": {
"version": "1.11.7", "version": "1.11.7",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.7.tgz", "resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.7.tgz",
...@@ -148,16 +140,6 @@ ...@@ -148,16 +140,6 @@
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
}, },
"node_modules/glsk-applet-component": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/glsk-applet-component/-/glsk-applet-component-1.0.0.tgz",
"integrity": "sha512-ulz1OquWy4y4Q26Zu4FLDWzyqK+sInPWs4o8MKj2N8V/TnYQlUXoWkkgKh8fERK8A+rsusf3eiyZB0odchKk8g=="
},
"node_modules/glsx-common-sdk": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.8.tgz",
"integrity": "sha512-qCDUBRvJwE2Gs1PLwB+fHOSFPgB5W5fwYC3GSBSjMQOxs4keeOvd7o5wIb7bNakp0xF6ARPqpC/xm3hZ9TRW6A=="
},
"node_modules/jsesc": { "node_modules/jsesc": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
......
{ {
"dependencies": { "dependencies": {
"@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24", "@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0",
"glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0", "number-precision": "^1.6.0",
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
}, },
...@@ -15,7 +12,7 @@ ...@@ -15,7 +12,7 @@
"prettier-plugin-mp": "^2.5.0" "prettier-plugin-mp": "^2.5.0"
}, },
"scripts": { "scripts": {
"test": "node --test packageDynamicForm/tests/**/*.test.mjs tabIndex/tests/**/*.test.mjs packageEquity/tests/**/*.test.mjs tabWorkOrder/pages/createOrder/tests/**/*.test.mjs", "test": "node --test packageDynamicForm/tests/**/*.test.mjs tabIndex/tests/**/*.test.mjs packageEquity/tests/**/*.test.mjs tabWorkOrder/pages/createOrder/tests/**/*.test.mjs tests/**/*.test.mjs",
"test:tabIndex": "node --test tabIndex/tests/**/*.test.mjs", "test:tabIndex": "node --test tabIndex/tests/**/*.test.mjs",
"test:equity": "node --test packageEquity/tests/**/*.test.mjs", "test:equity": "node --test packageEquity/tests/**/*.test.mjs",
"test:dynamicForm": "node --test packageDynamicForm/tests/**/*.test.mjs", "test:dynamicForm": "node --test packageDynamicForm/tests/**/*.test.mjs",
......
<!--packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.wxml--> <!--packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.wxml-->
<wxs src="index.wxs" module="filter" /> <wxs src="/packageCrowdFunding/pages/activityPage/balanceNote/index.wxs" module="filter" />
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%" title="请选择交易参考号"> <popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%" title="请选择交易参考号">
<view class="sub-title"> <view class="sub-title">
<!-- <view>{{title}}</view> --> <!-- <view>{{title}}</view> -->
......
var priceFilter = function (num) {
// 处理金额分转元并补零
var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2)
}
module.exports = {
priceFilter: priceFilter
}
\ No newline at end of file \ No newline at end of file
// pages/equity/index.js // pages/equity/index.js
import { IMG_URL } from '~/utils/imageBase.js'
import { get4SStoreList } from '~/store/index' import { get4SStoreList } from '~/store/index'
import { waitinputorder } from '../../api' import { waitinputorder } from '../../api'
const app = getApp() const app = getApp()
...@@ -11,18 +12,18 @@ Page({ ...@@ -11,18 +12,18 @@ Page({
tabBarList: [ tabBarList: [
{ {
name: '首页', name: '首页',
iconPath: '/images/tab-home.png', iconPath: IMG_URL + 'images/tab-home.png',
selectedIconPath: '/images/tab-home-active.png' selectedIconPath: IMG_URL + 'images/tab-home-active.png'
}, },
{ {
name: '活动管理', name: '活动管理',
iconPath: '/images/tab-date.png', iconPath: IMG_URL + 'images/tab-date.png',
selectedIconPath: '/images/tab-date-active.png' selectedIconPath: IMG_URL + 'images/tab-date-active.png'
}, },
{ {
name: '个人中心', name: '个人中心',
iconPath: '/images/tab-mine.png', iconPath: IMG_URL + 'images/tab-mine.png',
selectedIconPath: '/images/tab-mine-active.png' selectedIconPath: IMG_URL + 'images/tab-mine-active.png'
} }
], ],
tabIndex: 0, tabIndex: 0,
......
import { IMG_URL } from '../../../../utils/imageBase.js'
// packageCrowdFunding/pages/activityList/activityList.js // packageCrowdFunding/pages/activityList/activityList.js
import api from '~/packageCrowdFunding/api' import api from '~/packageCrowdFunding/api'
const app = getApp() const app = getApp()
...@@ -6,6 +7,7 @@ Page({ ...@@ -6,6 +7,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL,
tabIndex: 0, tabIndex: 0,
navBarHeight: 0, navBarHeight: 0,
defaultOderSelect: '', defaultOderSelect: '',
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="navigation-title" bindtap="showActivityPicker"> <view class="navigation-title" bindtap="showActivityPicker">
<view class="navigation-title-text text-hide">{{activityName}}</view> <view class="navigation-title-text text-hide">{{activityName}}</view>
<view class="arrow"> <view class="arrow">
<image src="/images/back.png"/> <image src="{{ IMG_URL }}images/back.png"/>
</view> </view>
</view> </view>
</navigation-bar> </navigation-bar>
......
import { IMG_URL } from '../../../../utils/imageBase.js'
// packageCrowdFunding/pages/balanceNote/balanceNote.js // packageCrowdFunding/pages/balanceNote/balanceNote.js
// import constantData from "../additionRecordOrder/constant/data"; // import constantData from "../additionRecordOrder/constant/data";
import constantData from './constant/data' import constantData from './constant/data'
...@@ -11,6 +12,7 @@ Page({ ...@@ -11,6 +12,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL,
orderObj: constantData.orderObj, orderObj: constantData.orderObj,
showStatus: false, showStatus: false,
orderNoPopup: false, orderNoPopup: false,
...@@ -58,6 +60,11 @@ Page({ ...@@ -58,6 +60,11 @@ Page({
orderNoPopup: true orderNoPopup: true
}) })
}, },
/**
* 金额分转元(与 balanceNote/index.wxs `priceFilter` 算法一致,修改时需同步 wxs 与 tests/wxsFilters.test.mjs)
* @param {number} num 金额(分)
* @returns {string} 元,保留两位小数
*/
priceFilter(num) { priceFilter(num) {
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2) return (Math.round(num / 100 * pow) / pow).toFixed(2)
......
<!--packageCrowdFunding/pages/balanceNote/balanceNote.wxml--> <!--packageCrowdFunding/pages/balanceNote/balanceNote.wxml-->
<wxs src="index.wxs" module="filter" /> <wxs src="/packageCrowdFunding/pages/activityPage/balanceNote/index.wxs" module="filter" />
<navigation-bar showBack navStyle="{{navStyle}}" bindback="back">去支付</navigation-bar> <navigation-bar showBack navStyle="{{navStyle}}" bindback="back">去支付</navigation-bar>
<view class="big-img page-box isFullSucreen"> <view class="big-img page-box isFullSucreen">
<!-- <view class="titleBox"> <!-- <view class="titleBox">
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
{{orderInfo.outTradeNo}} {{orderInfo.outTradeNo}}
</view> </view>
<view wx:else class="placeholder-class">{{item.placeholder || '请选择'}}</view> <view wx:else class="placeholder-class">{{item.placeholder || '请选择'}}</view>
<image class="right" src="/images/arrow-right.png"/> <image class="right" src="{{ IMG_URL }}images/arrow-right.png"/>
</view> </view>
</view> </view>
</view> </view>
......
/**
* @file 众筹尾款笔记页 wxs 过滤器(分包 canonical priceFilter)
* 用法:<wxs src="/packageCrowdFunding/pages/activityPage/balanceNote/index.wxs" module="filter" />
* 被 activityDetail、OrderNoPopup、balanceNote 等引用;上传时需绝对路径避免 wxs 被剔除。
*
* @param {number} num 金额(分)
* @returns {string} 元,保留两位小数
*/
var priceFilter = function (num) { var priceFilter = function (num) {
// 处理金额分转元并补零 // 处理金额分转元并补零
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
......
<wxs src="../../../../../utils/permission.wxs" module="perm" /> <wxs src="../../../../../utils/permission.wxs" module="perm" />
<wxs src="index.wxs" module="filter" /> <wxs src="/packageCrowdFunding/pages/activityPage/balanceNote/index.wxs" module="filter" />
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<!-- <view class="headerBar"> <!-- <view class="headerBar">
<view class="totalCount"> <view class="totalCount">
<view class="left box"> <view class="left box">
...@@ -36,7 +35,7 @@ ...@@ -36,7 +35,7 @@
<view class='select_box'> <view class='select_box'>
<view class='select' catchtap='selectTap'> <view class='select' catchtap='selectTap'>
<view class='select_text'>{{selectData[selectIndex]}}</view> <view class='select_text'>{{selectData[selectIndex]}}</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}}" style="padding: {{ showSelect ? 'var(--fontSize20) var(--fontSize34)' : ''}}"> <view class='option_box' wx:if="{{showSelect}}" style="padding: {{ showSelect ? 'var(--fontSize20) var(--fontSize34)' : ''}}">
<view class='option' wx:for='{{selectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view> <view class='option' wx:for='{{selectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view>
...@@ -44,10 +43,10 @@ ...@@ -44,10 +43,10 @@
<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="请输入{{selectData[selectIndex]}}搜索" class="input" confirm-type="search" value="{{inputValue}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" /> <input type="text" placeholder="请输入{{selectData[selectIndex]}}搜索" class="input" confirm-type="search" value="{{inputValue}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{inputValue}}"> <block wx:if="{{inputValue}}">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset" /> <image src="{{ IMG_URL }}images/clear.png" class="search-clear" bindtap="handleReset" />
</block> </block>
</view> </view>
</view> </view>
......
var priceFilter = function (num) {
// 处理金额分转元并补零
var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2)
}
module.exports = {
priceFilter: priceFilter
}
\ No newline at end of file \ No newline at end of file
<!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml--> <!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml-->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="auto" title="上传付款凭证"> <popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="auto" title="上传付款凭证">
<view class="input-box"> <view class="input-box">
<view class="input-item"> <view class="input-item">
......
<!--packageCrowdFunding/pages/newOrder/newOrder.wxml--> <!--packageCrowdFunding/pages/newOrder/newOrder.wxml-->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar <navigation-bar
class="navigation-header" class="navigation-header"
bindnavbarReady="navbarReady" bindnavbarReady="navbarReady"
......
import { IMG_URL } from '../../../../utils/imageBase.js'
// import activityList from './constant/data' // import activityList from './constant/data'
import activityApi from '~/packageCrowdFunding/api' import activityApi from '~/packageCrowdFunding/api'
import {getStaffListByMerchant} from "~/store/index" import {getStaffListByMerchant} from "~/store/index"
...@@ -7,6 +8,7 @@ Component({ ...@@ -7,6 +8,7 @@ Component({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL,
searchObj: {}, searchObj: {},
activityName: '', activityName: '',
list: [], list: [],
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<view class="to-box"> <view class="to-box">
<view class="search-box"> <view class="search-box">
<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="请输入活动名称搜索" class="input" confirm-type="search" <input type="text" placeholder="请输入活动名称搜索" class="input" confirm-type="search"
value="{{activityName}}" placeholder-class="input-placeholder" bindinput="input" value="{{activityName}}" placeholder-class="input-placeholder" bindinput="input"
bindconfirm="search"/> bindconfirm="search"/>
<block wx:if="{{activityName}}"> <block wx:if="{{activityName}}">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset"/> <image src="{{ IMG_URL }}images/clear.png" class="search-clear" bindtap="handleReset"/>
</block> </block>
</view> </view>
......
import { IMG_URL } from '../../../utils/imageBase.js'
const { buildRowValuesFromFields } = require('../../utils/order-list-params.js') const { buildRowValuesFromFields } = require('../../utils/order-list-params.js')
const { resolveSubformMaxRows } = require('../../form-engine/subform-limits.js') const { resolveSubformMaxRows } = require('../../form-engine/subform-limits.js')
const { const {
...@@ -43,6 +44,7 @@ Component({ ...@@ -43,6 +44,7 @@ Component({
}, },
data: { data: {
IMG_URL,
rowValues: {}, rowValues: {},
canAdd: true, canAdd: true,
navIconLeft: '', navIconLeft: '',
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<view wx:if="{{ !disabled }}" class="group-repeater__delete" bindtap="onRemove"> <view wx:if="{{ !disabled }}" class="group-repeater__delete" bindtap="onRemove">
<image <image
class="group-repeater__delete-icon" class="group-repeater__delete-icon"
src="/images/delete.png" src="{{ IMG_URL }}images/delete.png"
mode="aspectFit" mode="aspectFit"
/> />
</view> </view>
......
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
- **弹层**:组件 [`today-plan-customer-popup`](../components/today-plan-customer-popup/);日期 ±7 天切换;多选后「添加到洽谈明细」 - **弹层**:组件 [`today-plan-customer-popup`](../components/today-plan-customer-popup/);日期 ±7 天切换;多选后「添加到洽谈明细」
- **导入规则**([`negotiationCustomerImport.js`](../services/negotiationCustomerImport.js)): - **导入规则**([`negotiationCustomerImport.js`](../services/negotiationCustomerImport.js)):
- 仅写入**当前可见** F3 subform(F3-1~F3-4) - 仅写入**当前可见** F3 subform(F3-1~F3-4)
- 全有或全无;任一可见 subform 超 20 行 → `wx.showModal`「添加失败」 - 全有或全无;任一可见 subform 超 20 行 → `wx.showModal`「添加失败」,文案为**对应 F3 子表单 `label`**(如「问界鸿蒙洽谈明细 (延保)一次最多添加20个客户」)
- 允许 partial carInfo(三级车系);导入成功**无 toast** - 允许 partial carInfo(三级车系);导入成功**无 toast**
- **接口**:`dj.api.smartcarlife.customer.todayPlanStore.count` / `.list`;参数 `merchantId`、`advanceUserId`(= `staffUuid`)、`inviteDate` - **接口**:`dj.api.smartcarlife.customer.todayPlanStore.count` / `.list`;参数 `merchantId`、`advanceUserId`(= `staffUuid`)、`inviteDate`
- **apiSwitch**:`NEGOTIATION_DAILY_API_SWITCH.todayPlanStore`(当前 `real`) - **apiSwitch**:`NEGOTIATION_DAILY_API_SWITCH.todayPlanStore`(当前 `real`)
......
...@@ -939,11 +939,27 @@ Page({ ...@@ -939,11 +939,27 @@ Page({
this.setData({ showTodayPlanPopup: false }) this.setData({ showTodayPlanPopup: false })
}, },
/** 添加失败:任一可见 subform 超 20 行 */ /**
showCustomerImportMaxLengthError(groupLabel) { * 解析导入失败提示用的子表单展示名
* @param {string} [groupKey] F3-1 ~ F3-4
* @param {string} [groupLabel] 服务层带回的 label
* @returns {string}
*/
resolveCustomerImportGroupLabel(groupKey, groupLabel) {
const fromPage = groupKey ? this.findGroupByKey(groupKey)?.label : ''
return fromPage || groupLabel || groupKey || '当前子表单'
},
/**
* 添加失败:任一可见 subform 超 20 行
* @param {string} [groupKey] 触发上限的 F3 key
* @param {string} [groupLabel] 服务层带回的 subform label
*/
showCustomerImportMaxLengthError(groupKey, groupLabel) {
const name = this.resolveCustomerImportGroupLabel(groupKey, groupLabel)
wx.showModal({ wx.showModal({
title: '添加失败', title: '添加失败',
content: `${groupLabel || '洽谈明细'}一次最多添加20个客户`, content: `${name}一次最多添加20个客户`,
showCancel: false, showCancel: false,
confirmText: '知道了' confirmText: '知道了'
}) })
...@@ -962,7 +978,7 @@ Page({ ...@@ -962,7 +978,7 @@ Page({
} }
const result = applyCustomersToEngine(this.engine, customers) const result = applyCustomersToEngine(this.engine, customers)
if (!result.ok) { if (!result.ok) {
this.showCustomerImportMaxLengthError(result.groupLabel) this.showCustomerImportMaxLengthError(result.groupKey, result.groupLabel)
return return
} }
const groupActiveIndex = { ...(this.data.groupActiveIndex || {}) } const groupActiveIndex = { ...(this.data.groupActiveIndex || {}) }
......
...@@ -131,17 +131,21 @@ function buildCustomerRowValueMap(customer = {}, groupKey) { ...@@ -131,17 +131,21 @@ function buildCustomerRowValueMap(customer = {}, groupKey) {
* @param {Array} visibleSubforms * @param {Array} visibleSubforms
* @param {Object} rowCounts groupKey → 当前行数 * @param {Object} rowCounts groupKey → 当前行数
* @param {number} selectedCount * @param {number} selectedCount
* @returns {{ok: boolean, groupLabel?: string}} * @returns {{ok: boolean, groupKey?: string, groupLabel?: string}}
*/ */
function validateCustomerImportCapacity(visibleSubforms = [], rowCounts = {}, selectedCount = 0) { function validateCustomerImportCapacity(visibleSubforms = [], rowCounts = {}, selectedCount = 0) {
if (!selectedCount) { if (!selectedCount) {
return { ok: false, groupLabel: '' } return { ok: false, groupKey: '', groupLabel: '' }
} }
for (const group of visibleSubforms) { for (const group of visibleSubforms) {
const maxLength = resolveSubformMaxRows(group) const maxLength = resolveSubformMaxRows(group)
const current = Number(rowCounts[group.key]) || 0 const current = Number(rowCounts[group.key]) || 0
if (current + selectedCount > maxLength) { if (current + selectedCount > maxLength) {
return { ok: false, groupLabel: group.label || group.key } return {
ok: false,
groupKey: group.key,
groupLabel: group.label || group.key
}
} }
} }
return { ok: true } return { ok: true }
...@@ -151,12 +155,12 @@ function validateCustomerImportCapacity(visibleSubforms = [], rowCounts = {}, se ...@@ -151,12 +155,12 @@ function validateCustomerImportCapacity(visibleSubforms = [], rowCounts = {}, se
* 批量将选中客户写入所有可见 F3 subform(全有或全无) * 批量将选中客户写入所有可见 F3 subform(全有或全无)
* @param {Object} engine formEngine 实例 * @param {Object} engine formEngine 实例
* @param {Array} customers 选中客户列表 * @param {Array} customers 选中客户列表
* @returns {{ok: boolean, groupLabel?: string, viewState?: Object, changedGroupKeys?: string[]}} * @returns {{ok: boolean, groupKey?: string, groupLabel?: string, viewState?: Object, changedGroupKeys?: string[]}}
*/ */
function applyCustomersToEngine(engine, customers = []) { function applyCustomersToEngine(engine, customers = []) {
const visibleSubforms = getVisibleSubformGroups(engine) const visibleSubforms = getVisibleSubformGroups(engine)
if (!visibleSubforms.length) { if (!visibleSubforms.length) {
return { ok: false, groupLabel: '洽谈明细' } return { ok: false, groupKey: '', groupLabel: '' }
} }
const selectedCount = customers.length const selectedCount = customers.length
const viewState = engine.getViewState() const viewState = engine.getViewState()
...@@ -183,7 +187,11 @@ function applyCustomersToEngine(engine, customers = []) { ...@@ -183,7 +187,11 @@ function applyCustomersToEngine(engine, customers = []) {
const result = engine.appendGroupRows(group.key, valueMaps) const result = engine.appendGroupRows(group.key, valueMaps)
const addedCount = result.addedCount ?? 0 const addedCount = result.addedCount ?? 0
if (addedCount < selectedCount) { if (addedCount < selectedCount) {
return { ok: false, groupLabel: group.label || group.key } return {
ok: false,
groupKey: group.key,
groupLabel: group.label || group.key
}
} }
lastViewState = result lastViewState = result
changedGroupKeys.push(group.key) changedGroupKeys.push(group.key)
......
...@@ -57,11 +57,21 @@ describe('negotiationCustomerImport', () => { ...@@ -57,11 +57,21 @@ describe('negotiationCustomerImport', () => {
it('IT-PLAN-IMPORT-002: validateCustomerImportCapacity blocks over 20', () => { it('IT-PLAN-IMPORT-002: validateCustomerImportCapacity blocks over 20', () => {
const fail = validateCustomerImportCapacity([subformGroup], { 'F3-2': 18 }, 3) const fail = validateCustomerImportCapacity([subformGroup], { 'F3-2': 18 }, 3)
assert.equal(fail.ok, false) assert.equal(fail.ok, false)
assert.equal(fail.groupKey, 'F3-2')
assert.match(fail.groupLabel, /问界/) assert.match(fail.groupLabel, /问界/)
const ok = validateCustomerImportCapacity([subformGroup], { 'F3-2': 18 }, 2) const ok = validateCustomerImportCapacity([subformGroup], { 'F3-2': 18 }, 2)
assert.equal(ok.ok, true) assert.equal(ok.ok, true)
}) })
it('IT-PLAN-IMPORT-004: applyCustomersToEngine no visible subform returns empty label', () => {
const engine = createFormEngine({ list: [], version: 1 })
engine.init({ list: [] }, { initialValues: {} })
const result = applyCustomersToEngine(engine, [sampleCustomer])
assert.equal(result.ok, false)
assert.equal(result.groupKey, '')
assert.equal(result.groupLabel, '')
})
it('IT-PLAN-IMPORT-003: applyCustomersToEngine appends rows', () => { it('IT-PLAN-IMPORT-003: applyCustomersToEngine appends rows', () => {
const engine = createFormEngine({ const engine = createFormEngine({
list: [subformGroup], list: [subformGroup],
......
// packageEquity/pages/carEquity/components/GLForm/GLForm.js // packageEquity/pages/carEquity/components/GLForm/GLForm.js
const { getAreaList } = require('~/utils/areaList') const { loadAreaList } = require('~/utils/areaList')
Component({ Component({
externalClasses: ['custom-class'], externalClasses: ['custom-class'],
...@@ -204,11 +204,21 @@ Component({ ...@@ -204,11 +204,21 @@ Component({
} }
}, },
showAreaFun() { showAreaFun() {
let { const { showArea, areaList } = this.data
showArea, const needLoad = !areaList || !areaList.province_list
areaList if (needLoad) {
} = this.data loadAreaList()
if (!areaList.length) areaList = getAreaList() // 省市区数据 .then(list => {
this.setData({
showArea: !showArea,
areaList: list
})
})
.catch(() => {
wx.$util?.showToast?.('省市区数据加载失败,请稍后重试')
})
return
}
this.setData({ this.setData({
showArea: !showArea, showArea: !showArea,
areaList areaList
......
<!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml --> <!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml -->
<wxs src="./GLForm.wxs" module="filterUtils" /> <wxs src="/packageEquity/components/GLForm/GLForm.wxs" module="filterUtils" />
<view wx:for="{{formDataList}}" wx:key="index" class="custom-class gl-form"> <view wx:for="{{formDataList}}" wx:key="index" class="custom-class gl-form">
<gl-cell wx:if="{{filterUtils.isShowFn(formData, item) && item.type != 'otherSlot'}}" border="{{!item.noBorder}}" class="{{item.name}}" haveArrow="{{item.haveArrow || false}}" valueAlign="right" label="{{item.label}}" labelWidth="{{item.labelWidth || labelWidth}}" placeholder="{{item.placeholder || ''}}" bindclick="handleCellClick" data-target="{{item}}" data-idx="{{index}}" background="{{background}}" required="{{item.required}}" requiredAfter="{{item.requiredAfter}}" cellHeight="{{!item.noCellHeight}}" cellStyle="{{item.cellStyle||''}}" labelStyle="{{item.labelStyle}}" cellBoxStyle="{{item.cellBoxStyle||''}}"> <gl-cell wx:if="{{filterUtils.isShowFn(formData, item) && item.type != 'otherSlot'}}" border="{{!item.noBorder}}" class="{{item.name}}" haveArrow="{{item.haveArrow || false}}" valueAlign="right" label="{{item.label}}" labelWidth="{{item.labelWidth || labelWidth}}" placeholder="{{item.placeholder || ''}}" bindclick="handleCellClick" data-target="{{item}}" data-idx="{{index}}" background="{{background}}" required="{{item.required}}" requiredAfter="{{item.requiredAfter}}" cellHeight="{{!item.noCellHeight}}" cellStyle="{{item.cellStyle||''}}" labelStyle="{{item.labelStyle}}" cellBoxStyle="{{item.cellBoxStyle||''}}">
<!-- slot --> <!-- slot -->
......
/**
* @file 权益动态表单 GLForm wxs
* 用法:<wxs src="/packageEquity/components/GLForm/GLForm.wxs" module="filterUtils" />
*
* isShowFn:按 isShowObj 控制字段显隐
* getPickerIndex:select 类型字段的 picker 默认选中索引
*/
var isShowFn = function (formData, targetItem) { var isShowFn = function (formData, targetItem) {
var flag = false; var flag = false;
if (targetItem.isShowObj && formData) { if (targetItem.isShowObj && formData) {
......
<!--packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.wxml--> <!--packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.wxml-->
<wxs src="index.wxs" module="filter" /> <wxs src="/packageEquity/components/OrderNoPopup/index.wxs" module="filter" />
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="80%" title="{{title}}"> <popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="80%" title="{{title}}">
<view class="switch-box"> <view class="switch-box">
<view class="block text-center {{ switchValue== 1?'':'labelRight' }}" /> <view class="block text-center {{ switchValue== 1?'':'labelRight' }}" />
......
/**
* @file 权益分包订单号弹窗 wxs(金额分转元)
* 用法:<wxs src="/packageEquity/components/OrderNoPopup/index.wxs" module="filter" />
*
* @param {number} num 金额(分)
* @returns {string} 元,保留两位小数
*/
var priceFilter = function (num) { var priceFilter = function (num) {
// 处理金额分转元并补零 // 处理金额分转元并补零
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
......
import { ImgUrl } from '~/config' import { ImgUrl } from '~/config'
const EQUITY_IMAGE_PREFIX = `${ImgUrl}/packageEquity/images/` const EQUITY_IMAGE_PREFIX = `${ImgUrl}/packageEquity/images/`
const EQUITY_PAGES_IMAGE_PREFIX = `${ImgUrl}/packageEquity/pages/image/`
const EQUITY_OCR_IMAGE_PREFIX = `${ImgUrl}/packageEquity/pages/ocrEquityModules/image/`
/**
* 权益分包根级 images/ 目录 CDN 地址(主包体积优化后本地已移除)
* @param {string} name 文件名
* @returns {string}
*/
function equityImageUrl(name) { function equityImageUrl(name) {
return `${EQUITY_IMAGE_PREFIX}${name}` return `${EQUITY_IMAGE_PREFIX}${name}`
} }
/**
* 招聘/薪酬等页使用的 pages/image 静态图 CDN 地址
* @param {string} name 文件名
* @returns {string}
*/
function pagesImageUrl(name) {
return `${EQUITY_PAGES_IMAGE_PREFIX}${name}`
}
/**
* OCR 权益模块相机页贴图 CDN 地址
* @param {string} name 文件名
* @returns {string}
*/
function ocrImageUrl(name) {
return `${EQUITY_OCR_IMAGE_PREFIX}${name}`
}
module.exports = { module.exports = {
EQUITY_IMAGE_PREFIX, EQUITY_IMAGE_PREFIX,
equityImageUrl EQUITY_PAGES_IMAGE_PREFIX,
EQUITY_OCR_IMAGE_PREFIX,
equityImageUrl,
pagesImageUrl,
ocrImageUrl
} }
// pages/equity/index.js // pages/equity/index.js
import { IMG_URL } from '~/utils/imageBase.js'
import { get4SStoreList } from '~/store/index' import { get4SStoreList } from '~/store/index'
import { checkDailyReport } from '~/store/ModalToQueueControl' import { checkDailyReport } from '~/store/ModalToQueueControl'
import api from '~/api/api.js' import api from '~/api/api.js'
...@@ -39,28 +40,28 @@ Page({ ...@@ -39,28 +40,28 @@ Page({
tabBarList: [ tabBarList: [
{ {
name: '首页', name: '首页',
iconPath: '/images/tab-home.png', iconPath: IMG_URL + 'images/tab-home.png',
selectedIconPath: '/images/tab-home-active.png' selectedIconPath: IMG_URL + 'images/tab-home-active.png'
}, },
{ {
name: '工单管理', name: '工单管理',
iconPath: '/images/tab-order.png', iconPath: IMG_URL + 'images/tab-order.png',
selectedIconPath: '/images/tab-order-active.png' selectedIconPath: IMG_URL + 'images/tab-order-active.png'
}, },
{ {
name: '权益提单', name: '权益提单',
iconPath: '/images/tab-equity.png', iconPath: IMG_URL + 'images/tab-equity.png',
selectedIconPath: '/images/tab-equity-active.png' selectedIconPath: IMG_URL + 'images/tab-equity-active.png'
}, },
{ {
name: '营销素材', name: '营销素材',
iconPath: '/images/tab-material.png', iconPath: IMG_URL + 'images/tab-material.png',
selectedIconPath: '/images/tab-material-active.png' selectedIconPath: IMG_URL + 'images/tab-material-active.png'
}, },
{ {
name: '个人中心', name: '个人中心',
iconPath: '/images/tab-mine.png', iconPath: IMG_URL + 'images/tab-mine.png',
selectedIconPath: '/images/tab-mine-active.png' selectedIconPath: IMG_URL + 'images/tab-mine-active.png'
} }
], ],
tipsPropsConfig: { tipsPropsConfig: {
......
import { IMG_URL } from '../../../../utils/imageBase.js'
// packageEquity/pages/aiExcercise/ai/ai.js // packageEquity/pages/aiExcercise/ai/ai.js
import carLifeApi from '../../../carEquityApi' import carLifeApi from '../../../carEquityApi'
import NP from 'number-precision' import NP from 'number-precision'
...@@ -7,6 +8,7 @@ Page({ ...@@ -7,6 +8,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL,
statusEnum: { statusEnum: {
0: '未完成', 0: '未完成',
1: '已完成', 1: '已完成',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!