Commit 36f8c454 by 前端

Merge branch 'SAAS+V5.5.1' into 'SAAS+V5.5.2'

开发提测合并

See merge request !56
2 parents bb80b812 dcd5b583
...@@ -238,5 +238,15 @@ module.exports = { ...@@ -238,5 +238,15 @@ module.exports = {
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`) .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
.join('&') .join('&')
return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true }) return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true })
},
/** 撤销合同 */
revokeSaleContract(data) {
return gscPost(
`/evalOrder/revokeSaleContract`,
{
...data
},
{ returnAll: true }
)
} }
} }
...@@ -3,22 +3,19 @@ module.exports = { ...@@ -3,22 +3,19 @@ module.exports = {
gscPost: (url, data, _config = {}) => { gscPost: (url, data, _config = {}) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.getNetworkType({ uni.getNetworkType({
success (res) { success(res) {
if (['none'].includes(res.networkType)) { if (['none'].includes(res.networkType)) {
uni.hideLoading(); uni.hideLoading()
uni.showToast({ uni.showToast({
title: '网络异常', title: '网络异常',
icon: "none", icon: 'none'
}); })
return; return
} }
if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig) if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig)
data.source = 1
resolve(uni.$signHttp.post(url, data, _config)) resolve(uni.$signHttp.post(url, data, _config))
} }
}) })
}) })
} }
} }
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
.icon-change-account { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-change-account { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.34654731457800514) calc(100vmin * (1173 / 768) * -0.3052003410059676);} background-position: calc(100vmin * (1173 / 768) * -0.34654731457800514) calc(100vmin * (1173 / 768) * -0.3052003410059676);}
.icon-clone { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-clone { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.4462915601023018) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.4663256606990622) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-collapse-all { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-collapse-all { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.4629156010230179) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.48294970161977835) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-coupon-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-coupon-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.34654731457800514) calc(100vmin * (1173 / 768) * -0.32608695652173914);} background-position: calc(100vmin * (1173 / 768) * -0.34654731457800514) calc(100vmin * (1173 / 768) * -0.32608695652173914);}
.icon-coupon { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-coupon { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
.icon-equity-order { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-equity-order { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.5907928388746803);} background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.5907928388746803);}
.icon-equityClose { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-equityClose { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.479539641943734) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.49957374254049447) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-equityTip { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-equityTip { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.4752770673486786) calc(100vmin * (1173 / 768) * -0.4113384484228474);} background-position: calc(100vmin * (1173 / 768) * -0.4752770673486786) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-evaluation-management { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-evaluation-management { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
.icon-feedback { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-feedback { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.3537936913895993) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.3537936913895993) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-feedbackIcon { width: calc(100vmin * (1173 / 768) * 0.011082693947144074); height: calc(100vmin * (1173 / 768) * 0.011082693947144074); .icon-feedbackIcon { width: calc(100vmin * (1173 / 768) * 0.011082693947144074); height: calc(100vmin * (1173 / 768) * 0.011082693947144074);
background-position: calc(100vmin * (1173 / 768) * -0.41048593350383633) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.43052003410059675) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-ffdyj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-ffdyj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.6300085251491901);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.6300085251491901);}
.icon-filter { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-filter { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
...@@ -209,12 +209,14 @@ ...@@ -209,12 +209,14 @@
background-position: calc(100vmin * (1173 / 768) * -0.15302642796248933) calc(100vmin * (1173 / 768) * -0.13256606990622335);} background-position: calc(100vmin * (1173 / 768) * -0.15302642796248933) calc(100vmin * (1173 / 768) * -0.13256606990622335);}
.icon-level { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-level { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.42114236999147486) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.42114236999147486) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-location { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5754475703324808) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-locker-icon { width: calc(100vmin * (1173 / 768) * 0.1466325660699062); height: calc(100vmin * (1173 / 768) * 0.20119352088661552); .icon-locker-icon { width: calc(100vmin * (1173 / 768) * 0.1466325660699062); height: calc(100vmin * (1173 / 768) * 0.20119352088661552);
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * 0);} background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * 0);}
.icon-logo { width: calc(100vmin * (1173 / 768) * 0.06820119352088662); height: calc(100vmin * (1173 / 768) * 0.06820119352088662); .icon-logo { width: calc(100vmin * (1173 / 768) * 0.06820119352088662); height: calc(100vmin * (1173 / 768) * 0.06820119352088662);
background-position: calc(100vmin * (1173 / 768) * -0.5647911338448423) calc(100vmin * (1173 / 768) * -0.10017050298380221);} background-position: calc(100vmin * (1173 / 768) * -0.5647911338448423) calc(100vmin * (1173 / 768) * -0.10017050298380221);}
.icon-lssl-icon { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-lssl-icon { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.30051150895140666) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.3205456095481671) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-mask-del { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331); .icon-mask-del { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.3614663256606991);} background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.3614663256606991);}
.icon-mask-edit { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331); .icon-mask-edit { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
...@@ -232,13 +234,13 @@ ...@@ -232,13 +234,13 @@
.icon-no-picture { width: calc(100vmin * (1173 / 768) * 0.021312872975277068); height: calc(100vmin * (1173 / 768) * 0.021312872975277068); .icon-no-picture { width: calc(100vmin * (1173 / 768) * 0.021312872975277068); height: calc(100vmin * (1173 / 768) * 0.021312872975277068);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.14791133844842286);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.14791133844842286);}
.icon-normal { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-normal { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.3188405797101449) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.3388746803069054) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-notice-script { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-notice-script { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.3312020460358056) calc(100vmin * (1173 / 768) * -0.5907928388746803);} background-position: calc(100vmin * (1173 / 768) * -0.3312020460358056) calc(100vmin * (1173 / 768) * -0.5907928388746803);}
.icon-notice-study { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-notice-study { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.37851662404092073) calc(100vmin * (1173 / 768) * -0.5907928388746803);} background-position: calc(100vmin * (1173 / 768) * -0.37851662404092073) calc(100vmin * (1173 / 768) * -0.5907928388746803);}
.icon-notice-success { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-notice-success { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5754475703324808) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.5954816709292413) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-notice-system { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-notice-system { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.4258312020460358) calc(100vmin * (1173 / 768) * -0.5907928388746803);} background-position: calc(100vmin * (1173 / 768) * -0.4258312020460358) calc(100vmin * (1173 / 768) * -0.5907928388746803);}
.icon-notice-violate { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-notice-violate { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
...@@ -276,9 +278,9 @@ ...@@ -276,9 +278,9 @@
.icon-points { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-points { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.4884910485933504) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.4884910485933504) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-preview { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-preview { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5954816709292413) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-previewDownLoad { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6155157715260017) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.6155157715260017) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-previewDownLoad { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6355498721227621) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-promotion { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-promotion { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.252770673486786);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.252770673486786);}
.icon-prompt { width: calc(100vmin * (1173 / 768) * 0.10230179028132992); height: calc(100vmin * (1173 / 768) * 0.10230179028132992); .icon-prompt { width: calc(100vmin * (1173 / 768) * 0.10230179028132992); height: calc(100vmin * (1173 / 768) * 0.10230179028132992);
...@@ -302,9 +304,9 @@ ...@@ -302,9 +304,9 @@
.icon-rbkk-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-rbkk-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.1875532821824382) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.1875532821824382) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-rear-gear { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-rear-gear { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6355498721227621) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-rear-window { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6555839727195226) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.6555839727195226) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-rear-window { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.675618073316283) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-reception-1 { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-reception-1 { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.30647911338448425);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.30647911338448425);}
.icon-reception-2 { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-reception-2 { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
...@@ -324,17 +326,17 @@ ...@@ -324,17 +326,17 @@
.icon-revokeOrder { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-revokeOrder { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.5558397271952259) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.5558397271952259) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-right-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-right-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.675618073316283) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.6956521739130435) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-role-1 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812); .icon-role-1 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812);
background-position: calc(100vmin * (1173 / 768) * -0.1483375959079284) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.1483375959079284) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-role-2 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812); .icon-role-2 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812);
background-position: calc(100vmin * (1173 / 768) * -0.1837169650468883) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.1837169650468883) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-rule { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-rule { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.3371696504688832) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.35720375106564367) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-scan { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-scan { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6956521739130435) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-scanIcon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-scanIcon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.020034100596760442) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-scanIconX { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-scanIconX { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.17561807331628304);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.17561807331628304);}
.icon-scene-0 { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-scene-0 { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
...@@ -346,7 +348,7 @@ ...@@ -346,7 +348,7 @@
.icon-scene-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-scene-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.10144927536231885) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.10144927536231885) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-scene-change { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-scene-change { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.020034100596760442) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.040068201193520885) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-scene { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-scene { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.15217391304347827) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.15217391304347827) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-search { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-search { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
...@@ -358,7 +360,7 @@ ...@@ -358,7 +360,7 @@
.icon-second-right { width: calc(100vmin * (1173 / 768) * 0.05456095481670929); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-second-right { width: calc(100vmin * (1173 / 768) * 0.05456095481670929); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.48934356351236147) calc(100vmin * (1173 / 768) * -0.30008525149190113);} background-position: calc(100vmin * (1173 / 768) * -0.48934356351236147) calc(100vmin * (1173 / 768) * -0.30008525149190113);}
.icon-seeIcon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-seeIcon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.040068201193520885) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.06010230179028133) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-setting { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-setting { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.5895140664961637) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.5895140664961637) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-short-first-nav { width: calc(100vmin * (1173 / 768) * 0.1773231031543052); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-short-first-nav { width: calc(100vmin * (1173 / 768) * 0.1773231031543052); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
...@@ -368,21 +370,21 @@ ...@@ -368,21 +370,21 @@
.icon-short-task-title { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-short-task-title { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.36018755328218244);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.36018755328218244);}
.icon-sign_del { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-sign_del { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.06010230179028133) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-start-text { width: calc(100vmin * (1173 / 768) * 0.0733162830349531); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-start-text { width: calc(100vmin * (1173 / 768) * 0.0733162830349531); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.4761295822676897) calc(100vmin * (1173 / 768) * -0.2659846547314578);} background-position: calc(100vmin * (1173 / 768) * -0.4761295822676897) calc(100vmin * (1173 / 768) * -0.2659846547314578);}
.icon-stick-top-blue { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-stick-top-blue { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-stick-top { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.10017050298380221) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.10017050298380221) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-store-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-stick-top { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.12020460358056266) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.12020460358056266) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-store-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-store { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-store { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.18925831202046037);} background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.18925831202046037);}
.icon-study-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-study-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.2028985507246377) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.2028985507246377) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-study-tips { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-study-tips { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.3554987212276215) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.3755328218243819) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-study { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-study { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.2536231884057971) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.2536231884057971) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-submit { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-submit { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
...@@ -392,21 +394,21 @@ ...@@ -392,21 +394,21 @@
.icon-suggestions-arrow { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-suggestions-arrow { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.47868712702472294) calc(100vmin * (1173 / 768) * -0.45865302642796246);} background-position: calc(100vmin * (1173 / 768) * -0.47868712702472294) calc(100vmin * (1173 / 768) * -0.45865302642796246);}
.icon-suggestions-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-suggestions-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-sun-roof { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.16027280477408354) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.16027280477408354) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-sun-roof { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.18030690537084398) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-tag-checked { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-tag-checked { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.44075021312872975);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.44075021312872975);}
.icon-task-pass { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-task-pass { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.37382779198635974) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.3938618925831202) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-tdcj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-tdcj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.25788576300085253) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.25788576300085253) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-time-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-time-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.18030690537084398) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.20034100596760443) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-time { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-time { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.2813299232736573) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.2813299232736573) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-tips-b { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-tips-b { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.20034100596760443) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.22037510656436488) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-tips-g { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-tips-g { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.38704177323103156);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.38704177323103156);}
.icon-tips { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331); .icon-tips { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
...@@ -420,11 +422,11 @@ ...@@ -420,11 +422,11 @@
.icon-topTipsRightIcon { width: calc(100vmin * (1173 / 768) * 0.06990622335890878); height: calc(100vmin * (1173 / 768) * 0.05115089514066496); .icon-topTipsRightIcon { width: calc(100vmin * (1173 / 768) * 0.06990622335890878); height: calc(100vmin * (1173 / 768) * 0.05115089514066496);
background-position: calc(100vmin * (1173 / 768) * -0.2855924978687127) calc(100vmin * (1173 / 768) * -0.20758738277919864);} background-position: calc(100vmin * (1173 / 768) * -0.2855924978687127) calc(100vmin * (1173 / 768) * -0.20758738277919864);}
.icon-total { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-total { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.22037510656436488) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.24040920716112532) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.4279624893435635) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.44799658994032393) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.39215686274509803) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.4121909633418585) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.30477408354646207) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.30477408354646207) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
...@@ -432,12 +434,12 @@ ...@@ -432,12 +434,12 @@
.icon-visible { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-visible { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.32821824381926684) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.32821824381926684) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-warning-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-warning-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.24040920716112532) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-work-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.26044330775788577) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.26044330775788577) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-work-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.2804774083546462) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-ybtc_icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-ybtc_icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.3516624040920716) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.3516624040920716) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.5004262574595055) calc(100vmin * (1173 / 768) * -0.45865302642796246);} background-position: calc(100vmin * (1173 / 768) * -0.5004262574595055) calc(100vmin * (1173 / 768) * -0.45865302642796246);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.2804774083546462) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file \ No newline at end of file
background-position: calc(100vmin * (1173 / 768) * -0.30051150895140666) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file \ No newline at end of file

2.94 MB | W: | H:

2.94 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3 const index = 2
/** /**
* *
0本地 0本地
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.19.0", "versionName" : "2.20.0",
"versionCode" : 2190, "versionCode" : 2200,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
...@@ -68,8 +68,10 @@ ...@@ -68,8 +68,10 @@
"ad" : {}, "ad" : {},
"speech" : {}, "speech" : {},
"geolocation" : { "geolocation" : {
"system" : { "baidu" : {
"__platform__" : [ "ios", "android" ] "__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
} }
} }
}, },
......
...@@ -32,25 +32,13 @@ ...@@ -32,25 +32,13 @@
> >
<view :class="['label',{required:i.required}]">{{ i.label }}</view> <view :class="['label',{required:i.required}]">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) && i.required },{disabled: pageParams.received}]"> <view :class="['value', { error: showError(i.key) && i.required },{disabled: pageParams.received}]">
<template v-if="i.type == 'input'"> <template v-if="i.addHtml">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
:placeholder="i.placeholder"
:disabled="pageParams.received"
@input="inputCustomer"
placeholder-style="color:#c9c9c9;"
/>
</template>
<template v-else-if="i.type == 'select'">
<view <view
:class="['select', `${customerInfo[i.key]? '' : 'placeholder'}`]" :class="['select', `${pageParams.carInfo[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i.popKey)" @click="showPopup(i.popKey)"
:key="selectKey" :key="selectKey"
> >
{{ customerInfo[i.key] || i.placeholder }} {{ pageParams.carInfo[i.key] || i.placeholder }}
<uni-icons <uni-icons
class="arrow" class="arrow"
type="down" type="down"
...@@ -59,7 +47,35 @@ ...@@ -59,7 +47,35 @@
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view class="text">{{ customerInfo[i.key] }}</view> <template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
:placeholder="i.placeholder"
:disabled="pageParams.received"
@input="inputCustomer"
placeholder-style="color:#c9c9c9;"
/>
</template>
<template v-else-if="i.type == 'select'">
<view
:class="['select', `${customerInfo[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i.popKey)"
:key="selectKey"
>
{{ customerInfo[i.key] || i.placeholder }}
<uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
</view>
</template>
<template v-else>
<view class="text">{{ customerInfo[i.key] }}</view>
</template>
</template> </template>
</view> </view>
</view> </view>
...@@ -77,7 +93,14 @@ ...@@ -77,7 +93,14 @@
:key="idx" :key="idx"
> >
<view class="label">{{ j.label }}</view> <view class="label">{{ j.label }}</view>
<view class="value-text">{{ customerInfo[j.key] || '--'}}</view> <view class="value-text">
<template v-if="j.addHtml">
{{ pageParams.carInfo[j.key] || '--'}}
</template>
<template v-else>
{{ customerInfo[j.key] || '--'}}
</template>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -147,6 +170,11 @@ ...@@ -147,6 +170,11 @@
>生成专属二维码</view> >生成专属二维码</view>
</view> </view>
</MessageBox> </MessageBox>
<car-brands
:linkage="false"
ref="carBrandListVisible"
@select="handleSelect($event, 'carBrandListVisible')"
/>
<employee <employee
ref="employeeBoxVisible" ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')" @select="handleSelect($event,'employeeBoxVisible')"
...@@ -179,6 +207,8 @@ ...@@ -179,6 +207,8 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import qrcode from '@/utils/qrcode.js' import qrcode from '@/utils/qrcode.js'
import CarBrands from '@/components/CarBrands.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import dayjs from 'dayjs' import dayjs from 'dayjs'
const formObject_boutique = [{ const formObject_boutique = [{
...@@ -201,10 +231,12 @@ const formObject_boutique = [{ ...@@ -201,10 +231,12 @@ const formObject_boutique = [{
}, },
{ {
label: "品牌车型", label: "品牌车型",
key: "carModel", type: "select",
type: "text",
popKey: "carBrandListVisible", popKey: "carBrandListVisible",
placeholder: '请选择车型' placeholder: '请选择车型',
addHtml: 'carbrand',
key: 'name',
required: true
}, },
{ {
label: "交付专员", label: "交付专员",
...@@ -233,12 +265,22 @@ export default { ...@@ -233,12 +265,22 @@ export default {
title: String, title: String,
tips: String tips: String
}, },
components: { Employee }, components: { Employee, CarBrands },
watch: { watch: {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.customerInfo = Object.assign(this.customerInfo, newval) this.customerInfo = Object.assign(this.customerInfo, newval)
if (newval.carModel) {
this.pageParams.carInfo = {
carChildsBrandId: newval.carChildsBrandId,
carChildsBrandName: newval.carChildsBrandName,
carBrandId: newval.carBrandId,
carBrand: newval.carBrand,
id: newval.carSeriesId,
name: newval.carModel
}
}
try { try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态 // 监听完成接待修改数据,同步修改生成优惠券按钮状态
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
...@@ -268,6 +310,21 @@ export default { ...@@ -268,6 +310,21 @@ export default {
}, },
show () { show () {
this.closeAllPopup() this.closeAllPopup()
},
carInfo: {
handler (newval) {
console.log(newval, '===')
this.pageParams.carInfo = {
carChildsBrandId: newval.carChildsBrandId,
carChildsBrandName: newval.carChildsBrandName,
carBrandId: newval.carBrandId,
carBrand: newval.carBrand,
id: newval.id,
name: newval.name
}
},
deep: true,
immediate: true
} }
}, },
computed: { computed: {
...@@ -419,11 +476,18 @@ export default { ...@@ -419,11 +476,18 @@ export default {
if (popkey == "employeeBoxVisible") { if (popkey == "employeeBoxVisible") {
this.customerInfo.salesUuid = item.uuid; this.customerInfo.salesUuid = item.uuid;
this.customerInfo.staffName = item.staffName; this.customerInfo.staffName = item.staffName;
this.$store.dispatch("setCustomerInfo", this.customerInfo);
} else { } else {
this.$refs.carBrandListVisible.close(); this.$refs.carBrandListVisible.close();
this.customerInfo.carModel = item.name; this.pageParams.carInfo = {
carChildsBrandId: item.carChildsBrandId,
carChildsBrandName: item.carChildsBrandName,
carBrandId: item.carBrandId,
carBrand: item.carBrand,
id: item.id,
name: item.name
}
} }
this.$store.dispatch("setCustomerInfo", this.customerInfo);
this.selectKey = Date.now() this.selectKey = Date.now()
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName this.isCheck = customerName && phoneNumber && staffName
...@@ -455,7 +519,7 @@ export default { ...@@ -455,7 +519,7 @@ export default {
if (this.pageParams.received) return if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况 if (!this.isCheck) return // 按钮置灰的情况
try { try {
const { pageParams: { clickFlag, couponId }, carInfo, customerInfo } = this, { const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"), shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate(), validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId]) checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
...@@ -512,7 +576,7 @@ export default { ...@@ -512,7 +576,7 @@ export default {
try { try {
this.pageParams.received = false this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => { this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this, const { pageParams: { couponId ,carInfo }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({ res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId, merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber, customerPhone: customerInfo.phoneNumber,
...@@ -524,7 +588,7 @@ export default { ...@@ -524,7 +588,7 @@ export default {
this.$emit('reception', { this.$emit('reception', {
item: { item: {
customerName: customerInfo.customerName, customerName: customerInfo.customerName,
carSeriesName: customerInfo.carModel, carSeriesName: carInfo.name,
customerPhone: customerInfo.phoneNumber, customerPhone: customerInfo.phoneNumber,
userId: customerInfo.salesUuid, userId: customerInfo.salesUuid,
employeeName: customerInfo.staffName, employeeName: customerInfo.staffName,
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
ref="futureCalendar" ref="futureCalendar"
:insert="false" :insert="false"
:clearDate="false" :clearDate="false"
:startDate="endDate" :startDate="startDate"
@confirm="confirmCalendar($event,'effectiveDate')" @confirm="confirmCalendar($event,'effectiveDate')"
:date="orderObj.effectiveDate" :date="orderObj.effectiveDate"
showBottomBtn showBottomBtn
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
formList: utils.deepClone(EQUITY_FORM_LIST), formList: utils.deepClone(EQUITY_FORM_LIST),
titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST), titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST),
endDate: dayjs().format('YYYY-MM-DD'), endDate: dayjs().format('YYYY-MM-DD'),
startDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
equityFormRule: utils.deepClone(EQUITY_FORM_RULE), equityFormRule: utils.deepClone(EQUITY_FORM_RULE),
orderObj: {}, orderObj: {},
loadComplete: false, loadComplete: false,
...@@ -232,7 +233,6 @@ export default { ...@@ -232,7 +233,6 @@ export default {
if (i.value == val.value) i.current = e.detail.value if (i.value == val.value) i.current = e.detail.value
}) })
}) })
this.viewKey = Date.now()
}, },
handleCell (val) { handleCell (val) {
if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open() if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open()
...@@ -246,16 +246,13 @@ export default { ...@@ -246,16 +246,13 @@ export default {
Object.assign(this.orderObj, chooseContent) Object.assign(this.orderObj, chooseContent)
this.$set(this.orderObj, 'carBrandText', this.$set(this.orderObj, 'carBrandText',
`${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`) `${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`)
this.viewKey = Date.now()
return return
} else if (_typeValue.options) { } else if (_typeValue.options) {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId']) this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId'])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel']) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel'])
this.viewKey = Date.now()
return return
} }
this.$set(this.orderObj, _typeValue.value, chooseContent) this.$set(this.orderObj, _typeValue.value, chooseContent)
this.viewKey = Date.now()
}, },
inputBlur (e, val) { inputBlur (e, val) {
this.orderObj[val.value] = this.orderObj[val.value] this.orderObj[val.value] = this.orderObj[val.value]
...@@ -367,7 +364,8 @@ export default { ...@@ -367,7 +364,8 @@ export default {
}) })
} }
let inclueType = data.addOnsFlag == 0 ? 2 : 1 let inclueType = data.addOnsFlag == 0 ? 2 : 1
Object.assign(this.orderObj, { this.orderObj = utils.deepClone({
...this.orderObj,
...data, ...data,
vin: data.vin, vin: data.vin,
invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2), invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2),
...@@ -414,7 +412,6 @@ export default { ...@@ -414,7 +412,6 @@ export default {
}, },
confirmCalendar (e, key) { confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate this.orderObj[key] = e.fulldate
this.viewKey = Date.now()
}, },
async submit (operationType) { async submit (operationType) {
// VIN车架号-动态校验 // VIN车架号-动态校验
......
<template> <template>
<view class="order"> <view class="order">
<view <view
:class="['order-box',{hide:showUpload}]" :class="['order-box',{hide:showUpload}]"
:key="formKey" :key="formKey"
> >
<view class="common-title">车险信息</view> <view class="common-title">车险信息</view>
<view class="box"> <view class="box">
<scroll-view <scroll-view
class="scroll-view" class="scroll-view"
scroll-y="true" scroll-y="true"
> >
<view class="box-content"> <view class="box-content">
<GlCell <GlCell
:formList="formList" :formList="formList"
:formData="orderObj" :formData="orderObj"
@radioChange="radioChange" @radioChange="radioChange"
@inputBlur="inputBlur" @inputBlur="inputBlur"
@handleCell="handleCell" @handleCell="handleCell"
:titleList="titleList" :titleList="titleList"
> >
<template slot="customer"> <template slot="customer">
<view class="customer-title flex"> <view class="customer-title flex">
客户信息 客户信息
<view <view
class="customer-file flex" class="customer-file flex"
@click="handleCell({ @click="handleCell({
key:'customer' key:'customer'
})" })"
> >
<view class="sprite-icon icon-customer-list"></view> <view class="sprite-icon icon-customer-list"></view>
客户档案 客户档案
</view> </view>
</view> </view>
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<template v-if="orderObj.skuGoods.length"> <template v-if="orderObj.skuGoods.length">
<SkuGoods <SkuGoods
:list="orderObj.skuGoods" :list="orderObj.skuGoods"
@changeTotalPrice="changeTotalPrice" @changeTotalPrice="changeTotalPrice"
:positionTypeList="positionTypeList" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData" :baseConfigData="baseConfigData"
></SkuGoods> ></SkuGoods>
</template> </template>
<template v-if="orderObj.total > 0"> <template v-if="orderObj.total > 0">
<view class="total"> <view class="total">
<view class="total-left">总价</view> <view class="total-left">总价</view>
<view class="total-right">¥{{ orderObj.total }}</view> <view class="total-right">¥{{ orderObj.total }}</view>
</view> </view>
</template> </template>
</template> </template>
<template slot="otherPay"> <template slot="otherPay">
<view <view
v-if="showPayTips" v-if="showPayTips"
class="pay-tips" class="pay-tips"
>其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view> >其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view>
</template> </template>
</GlCell> </GlCell>
</view> </view>
<view class="btns flex"> <view class="btns flex">
<view <view
class="btn save" class="btn save"
@click="handleEditSave" @click="handleEditSave"
>存草稿</view> >存草稿</view>
<view <view
@click="submit" @click="submit"
class="btn" class="btn"
>{{confirmText}}</view> >{{confirmText}}</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<!-- 弹窗 --> <!-- 弹窗 -->
<order-popup <order-popup
ref="orderPopup" ref="orderPopup"
:data="orderObj" :data="orderObj"
:dataKey="valueKey" :dataKey="valueKey"
@onConfirm="onConfirm" @onConfirm="onConfirm"
:externalData="externalData" :externalData="externalData"
:popupType="popupType" :popupType="popupType"
:popupTitle="popupTitle" :popupTitle="popupTitle"
/> />
<template v-if="showUpload"> <template v-if="showUpload">
<view class="upload-box"> <view class="upload-box">
<upload-proof-of-payment <upload-proof-of-payment
@back="clearPayMentDocList" @back="clearPayMentDocList"
@confirm="uploadConfirm" @confirm="uploadConfirm"
/> />
</view> </view>
</template> </template>
<!-- 支付弹框 --> <!-- 支付弹框 -->
<OrderPay <OrderPay
ref="OrderPay" ref="OrderPay"
@closePopup="closePopup" @closePopup="closePopup"
@jumpSuccess="jumpSuccess" @jumpSuccess="jumpSuccess"
/> />
</view> </view>
</template> </template>
<script> <script>
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import GlCell from '../../../../components/Form/GlCell.vue' import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue' import Product from './Product.vue'
import Package from './Package.vue' import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue' import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant' import { FORM_LIST, popupTypeEnum, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue' import UploadProofOfPayment from './UploadProofOfPayment.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import OrderPay from './OrderPay.vue' import OrderPay from './OrderPay.vue'
import NP from 'number-precision' import NP from 'number-precision'
import { validateVin, formatVinInput } from '@/utils/vinVaildate' import { validateVin, formatVinInput } from '@/utils/vinVaildate'
export default { export default {
name: 'CreateOrder', name: 'CreateOrder',
mixins: [interceptionMixin], mixins: [interceptionMixin],
components: { components: {
GlCell, GlCell,
OrderPopup, OrderPopup,
Product, Product,
Package, Package,
SkuGoods, SkuGoods,
UploadProofOfPayment, UploadProofOfPayment,
OrderPay OrderPay
}, },
props: { props: {
transmissionOfData: { transmissionOfData: {
type: Object, type: Object,
default: () => null default: () => null
} }
}, },
watch: { watch: {
'orderObj.payee': { 'orderObj.payee': {
handler (val) { handler (val) {
this.formList[4].map(e => { this.formList[4].map(e => {
if (e.value == 'pay2Time') e.label = { if (e.value == 'pay2Time') e.label = {
0: '嘀加收款时间', 0: '嘀加收款时间',
1: '4S店收款时间' 1: '4S店收款时间'
}[val] }[val]
}) })
}, },
immediate: true, immediate: true,
deep: true deep: true
}, },
'orderObj.payType': { 'orderObj.payType': {
handler (val) { handler (val) {
this.formList[4].map(e => { this.formList[4].map(e => {
if (e.value == 'notes') e.required = val == 7 if (e.value == 'notes') e.required = val == 7
if (e.value == 'pay2Time') e.hidden = ![2, 5, 6, 7].includes(+val) if (e.value == 'pay2Time') e.hidden = ![2, 5, 6, 7].includes(+val)
}) })
}, },
immediate: true, immediate: true,
deep: true deep: true
}, },
transmissionOfData: { transmissionOfData: {
handler (val) { handler (val) {
const paramsData = val?.paramsData || {} const paramsData = val?.paramsData || {}
if (paramsData && paramsData.id) this.paramsData = paramsData if (paramsData && paramsData.id) this.paramsData = paramsData
}, },
deep: true, deep: true,
immediate: true immediate: true
} }
}, },
data () { data () {
return { return {
paramsData: {}, paramsData: {},
saveStatus: false, saveStatus: false,
showUpload: false, showUpload: false,
titleList, titleList,
formList: utils.deepClone(FORM_LIST), formList: utils.deepClone(FORM_LIST),
baseConfigData: {}, baseConfigData: {},
orderObj: { orderObj: {
mode: 1, mode: 1,
payee: 0, // 收款方式 payee: 0, // 收款方式
payType: 1, // 支付方式 payType: 1, // 支付方式
insurancePrice: '', insurancePrice: '',
skuGoods: [], //商品列表 skuGoods: [], //商品列表
referrerId: '', //销售顾问id referrerId: '', //销售顾问id
referrer: '',//销售顾问名称 referrer: '',//销售顾问名称
deliveryId: '',//交付专员id deliveryId: '',//交付专员id
deliveryName: '',//交付专员名称 deliveryName: '',//交付专员名称
total: '',//总价 total: '',//总价
notes: '',//备注 notes: '',//备注
carSeriesId: '', //车系id carSeriesId: '', //车系id
seat: '5',//座位数 seat: '5',//座位数
ownerGender: '男', ownerGender: '男',
salesType: '0', salesType: '0',
carInfo: {}, carInfo: {},
price: '' price: ''
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
externalData: [], //弹窗接口数据 externalData: [], //弹窗接口数据
djPayList: [], // 嘀加收款方对应支付方式 djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式 merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式 configPayTypeList: [], // 园区店配置支持的支付方式
payTypeList, goodsList: [],
goodsList: [], subOrderList: [],
subOrderList: [], otherProduct: [],
otherProduct: [], positionTypeList: [],
positionTypeList: [], valueKey: '',
valueKey: '', popupTitle: '',
popupTitle: '', pointsMultiRole: 'Y',
pointsMultiRole: 'Y', formKey: Date.now(),
formKey: Date.now(), validateState: true
validateState: true }
}
},
}, computed: {
computed: { showPayTips () {
showPayTips () { return this.orderObj.payee == 0 && this.orderObj.payType == 7
return this.orderObj.payee == 0 && this.orderObj.payType == 7 },
}, confirmText () {
confirmText () { return [1, 3].includes(+this.orderObj.payType) ? '下一步·去支付' : '下一步·上传凭证'
return [1, 3].includes(+this.orderObj.payType) ? '下一步·去支付' : '下一步·上传凭证' },
}, userInfo () {
userInfo () { return uni.$storage.get('userInfo') || {}
return uni.$storage.get('userInfo') || {} }
} },
}, mounted () {
mounted () { this.baseConfigData = uni.$storage.get('mock_data') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {} this.initData()
this.initData()
},
}, methods: {
methods: { async getQuotationInfoById (id) {
async getQuotationInfoById (id) { try {
try { let { goodsList: quotationGoodsList } = this, data = await uni.$api.equityApi.getQuotationInfoById({ id }),
let { goodsList: quotationGoodsList } = this, data = await uni.$api.equityApi.getQuotationInfoById({ id }), { orderObj } = this,
{ orderObj } = this, { owner, insurancePrice, quotedPriceUpdate } = data
{ owner, insurancePrice, quotedPriceUpdate } = data uni.hideLoading()
uni.hideLoading() orderObj.price = this.divideByHundred(owner.price)
orderObj.price = this.divideByHundred(owner.price) orderObj.insurancePrice = this.divideByHundred(insurancePrice)
orderObj.insurancePrice = this.divideByHundred(insurancePrice) orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate)
orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate) if (!data.vdQuotationGoodsList) data.vdQuotationGoodsList = []
if(!data.vdQuotationGoodsList) data.vdQuotationGoodsList = [] orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(
orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map( item => {
item => { item.price = this.divideByHundred(item.goodsPrice)
item.price = this.divideByHundred(item.goodsPrice) return item
return item }
} )
) if (!owner.ownerGender) owner.ownerGender = '男'
if (!owner.ownerGender) owner.ownerGender = '男' if (owner.carSeriesId) {
if (owner.carSeriesId) { orderObj.carInfo = {
orderObj.carInfo = { carBrand: owner.carBrand,
carBrand: owner.carBrand, carBrandId: owner.carBrandId,
carBrandId: owner.carBrandId, carChildsBrandId: owner.carChildsBrandId,
carChildsBrandId: owner.carChildsBrandId, carChildsBrandName: owner.carChildsBrandName,
carChildsBrandName: owner.carChildsBrandName, carSeriesId: owner.carSeriesId,
carSeriesId: owner.carSeriesId, carSeriesName: owner.carSeriesName,
carSeriesName: owner.carSeriesName, }
} orderObj.carBrandText = `${owner.carBrand}-${owner.carChildsBrandName}-${owner.carSeriesName}`
orderObj.carBrandText = `${owner.carBrand}-${owner.carChildsBrandName}-${owner.carSeriesName}` }
} if (owner.city) {
if (owner.city) { let [provinceText, cityText] = owner.city.split('-')
let [provinceText, cityText] = owner.city.split('-') if (cityText) {
if (cityText) { orderObj.provinceText = provinceText
orderObj.provinceText = provinceText orderObj.cityText = cityText
orderObj.cityText = cityText } else {
} else { orderObj.provinceText = owner.city
orderObj.provinceText = owner.city orderObj.cityText = owner.city
orderObj.cityText = owner.city }
} }
} this.formList[1].map(e => {
this.formList[1].map(e => { if (e.value == 'salesType') e.current = owner.salesType
if (e.value == 'salesType') e.current = owner.salesType if (e.value == 'ownerGender') e.current = owner.ownerGender
if (e.value == 'ownerGender') e.current = owner.ownerGender })
}) orderObj.skuGoods = data.vdQuotationGoodsList.reduce((pre, item) => {
orderObj.skuGoods = data.vdQuotationGoodsList.reduce((pre, item) => { // 是普通商品
// 是普通商品 if (!item.packageName && !item.specificationsValue) {
if (!item.packageName && !item.specificationsValue) { console.log(item)
console.log(item) let obj = {
let obj = { ...item,
...item, goodsInfo: item,
goodsInfo: item, upgradeGoodsId: item.goodsId,
upgradeGoodsId: item.goodsId, merchantGoodsId: item.goodsId,
merchantGoodsId: item.goodsId, sellPrice: this.divideByHundred(item.goodsPrice),
sellPrice: this.divideByHundred(item.goodsPrice), minSellPrice: quotationGoodsList?.find(
minSellPrice: quotationGoodsList?.find( val => val?.goods?.merchantGoodsId == item.goodsId
val => val?.goods?.merchantGoodsId == item.goodsId )?.goods?.minSellPrice, // 按商品数据对比补充详情商品最低价
)?.goods?.minSellPrice, // 按商品数据对比补充详情商品最低价 validMinSellPrice: quotationGoodsList?.find(
validMinSellPrice: quotationGoodsList?.find( val => val?.goods?.merchantGoodsId == item.goodsId
val => val?.goods?.merchantGoodsId == item.goodsId )?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段 }
} pre.push({
pre.push({ goodsFlag: 1,
goodsFlag: 1, goods: obj,
goods: obj, packageGoods: null
packageGoods: null })
}) }
} //套餐
//套餐 if (item.packageName) {
if (item.packageName) { let obj = {
let obj = { ...item,
...item, merchantGoodsId: item.goodsId,
merchantGoodsId: item.goodsId, upgradeGoodsId: item.goodsId,
upgradeGoodsId: item.goodsId, sellPrice: this.divideByHundred(item.goodsPrice),
sellPrice: this.divideByHundred(item.goodsPrice), number: 1,
number: 1, minSellPrice: quotationGoodsList
minSellPrice: quotationGoodsList ?.find(
?.find( val =>
val => val.packageGoods?.goodsList?.length &&
val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId
val.packageGoods?.packageCode == item?.packageId )
) ?.packageGoods?.goodsList?.find(
?.packageGoods?.goodsList?.find( subV => subV.merchantGoodsId == item.goodsId
subV => subV.merchantGoodsId == item.goodsId )?.minSellPrice, // 按商品数据对比补充详情商品最低价
)?.minSellPrice, // 按商品数据对比补充详情商品最低价 validMinSellPrice: quotationGoodsList
validMinSellPrice: quotationGoodsList ?.find(
?.find( val =>
val => val.packageGoods?.goodsList?.length &&
val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId
val.packageGoods?.packageCode == item?.packageId )
) ?.packageGoods?.goodsList?.find(
?.packageGoods?.goodsList?.find( subV => subV.merchantGoodsId == item.goodsId
subV => subV.merchantGoodsId == item.goodsId )?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
)?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段 }
} let index = pre.findIndex(ele => {
let index = pre.findIndex(ele => { if (ele.packageGoods) {
if (ele.packageGoods) { return ele.packageGoods.packageId == item.packageId
return ele.packageGoods.packageId == item.packageId }
} })
}) if (index != -1) {
if (index != -1) { pre[index].packageGoods.goodsList.push(obj)
pre[index].packageGoods.goodsList.push(obj) pre[index].price = NP.plus(pre[index].price, obj.price)
pre[index].price = NP.plus(pre[index].price, obj.price) } else {
} else { pre.push({
pre.push({ goods: null,
goods: null, goodsFlag: 3,
goodsFlag: 3, price: item.price,
price: item.price, packageGoods: {
packageGoods: { ...item,
...item, packageCode: item.packageId,
packageCode: item.packageId, goodsList: [{
goodsList: [{ ...obj
...obj }]
}] }
} })
}) }
} }
} //多规格商品
//多规格商品 if (!item.packageName && item.specificationsValue) {
if (!item.packageName && item.specificationsValue) { let specificdata = this.handleSpecificationsEcho(item)
let specificdata = this.handleSpecificationsEcho(item) pre = pre.concat(specificdata)
pre = pre.concat(specificdata) }
}
return pre
return pre }, [])
}, [])
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer',
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer', 'deliveryId', 'deliveryName', 'notes', 'id', 'orderId'
'deliveryId', 'deliveryName', 'notes', 'id', 'orderId' ], customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', ,
], customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', , 'ownerGender', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType', 'city']
'ownerGender', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType', 'city'] keyList.map(key => {
keyList.map(key => { if (data[key] != null) orderObj[key] = data[key]
if (data[key] != null) orderObj[key] = data[key] })
}) customerKeyList.map(key => {
customerKeyList.map(key => { if (owner[key] != null) orderObj[key] = owner[key]
if (owner[key] != null) orderObj[key] = owner[key] })
}) if (owner.id) orderObj.ownerId = owner.id
if (owner.id) orderObj.ownerId = owner.id let payeeCell = this.formList[4].find(item => item.value === 'payee')
let payeeCell = this.formList[4].find(item => item.value === 'payee') if (payeeCell) payeeCell.current = orderObj.payee
if (payeeCell) payeeCell.current = orderObj.payee
this.orderObj = orderObj
this.orderObj = orderObj this.getConfig()
this.getConfig() setTimeout(() => {
setTimeout(() => { this.changeTotalPrice()
this.changeTotalPrice() }, 0)
}, 0)
} catch (error) {
} catch (error) { console.log(error)
console.log(error) uni.hideLoading()
uni.hideLoading() if (error) uni.showToast({
if (error) uni.showToast({ title: error,
title: error, icon: 'none',
icon: 'none', })
}) }
} },
}, initData () {
initData () { // 埋点
// 埋点 // uni.$track.add({ eventCode: 'app_create_order' })
// uni.$track.add({ eventCode: 'app_create_order' }) const { paramsData } = this
const { paramsData } = this this.getSelectOrderGoodsList()
this.getSelectOrderGoodsList() if (!paramsData.id) this.getConfig()
if (!paramsData.id) this.getConfig() this.getShopMerchantPointConfig()
this.getShopMerchantPointConfig() this.orderSettingList()
this.orderSettingList() },
}, async orderSettingList () {
async orderSettingList () { const { shopMerchantId } = this.userInfo,
const { shopMerchantId } = this.userInfo, params = {
params = { scene: 0,
scene: 0, isRequired: 1,
isRequired: 1, merchantId: shopMerchantId
merchantId: shopMerchantId },
}, data = await uni.$api.equityApi.orderSettingList(params)
data = await uni.$api.equityApi.orderSettingList(params) if (data) {
if (data) { let required = data.reduce((pre, item) => {
let required = data.reduce((pre, item) => { if (item.isRequired) {
if (item.isRequired) { pre.push(item.fieldKey)
pre.push(item.fieldKey) }
} return pre
return pre }, [])
}, []) if (required.includes('carBrand')) this.formList[2].map(e => {
if (required.includes('carBrand')) this.formList[2].map(e => { if (e.value == 'carBrandText') e.required = true
if (e.value == 'carBrandText') e.required = true })
}) if (required.includes('carNo')) this.formList[2].map(e => {
if (required.includes('carNo')) this.formList[2].map(e => { if (e.value == 'carVin') e.required = true
if (e.value == 'carVin') e.required = true })
}) if (required.includes('idNumber')) this.formList[1].map(e => {
if (required.includes('idNumber')) this.formList[1].map(e => { if (e.value == 'certificateNo') e.required = true
if (e.value == 'certificateNo') e.required = true })
}) }
} },
}, async getShopMerchantPointConfig () {
async getShopMerchantPointConfig () { const { shopMerchantId: merchantId } = this.userInfo,
const { shopMerchantId: merchantId } = this.userInfo, { pointsMultiRole } = await uni.$api.equityApi.getShopMerchantPointConfig({
{ pointsMultiRole } = await uni.$api.equityApi.getShopMerchantPointConfig({ merchantId
merchantId })
}) this.pointsMultiRole = pointsMultiRole
this.pointsMultiRole = pointsMultiRole if (pointsMultiRole != 'Y') this.formList[0].map(e => {
if (pointsMultiRole != 'Y') this.formList[0].map(e => { if (e.value == 'deliveryName') e.hidden = true
if (e.value == 'deliveryName') e.hidden = true if (e.value == 'referrer') e.label = '推荐人'
if (e.value == 'referrer') e.label = '推荐人' })
}) },
}, // 选择行事件
// 选择行事件 handleCell (val) {
handleCell (val) { let { payType } = this.orderObj,
let { payType } = this.orderObj, { pointsMultiRole } = this
{ pointsMultiRole } = this this.popupTitle = ''
this.popupTitle = '' // 获取当前选中的popupType
// 获取当前选中的popupType this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.key) * 1
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.key) * 1 // 获取对应的list字段
// 获取对应的list字段 const popupConfig = this.popupTypeEnum[this.popupType]
const popupConfig = this.popupTypeEnum[this.popupType] if (popupConfig && popupConfig.list) {
if (popupConfig && popupConfig.list) { this.externalData = this[popupConfig.list] || []
this.externalData = this[popupConfig.list] || [] } else {
} else { this.externalData = []
this.externalData = [] }
} // 定义产品相关字段数组
// 定义产品相关字段数组 const productFields = ['skuGoods']
const productFields = ['skuGoods'] if (productFields.includes(val.value)) {
if (productFields.includes(val.value)) { this.valueKey = val.value
this.valueKey = val.value this.externalData = utils.deepClone(this.goodsList)
this.externalData = utils.deepClone(this.goodsList) }
} this.popupTitle = {
this.popupTitle = { 0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人',
0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人', 4: '车型',
4: '车型', 13: payType == 2 ? '4S店收款时间' : '嘀加收款时间'
13: payType == 2 ? '4S店收款时间' : '嘀加收款时间' }[this.popupType]
}[this.popupType] this.$refs.orderPopup.open()
this.$refs.orderPopup.open() },
}, // 单选框change事件
// 单选框change事件 radioChange (e, val) {
radioChange (e, val) { this.$set(this.orderObj, val.value, e.detail.value)
this.$set(this.orderObj, val.value, e.detail.value) if (val.value == 'payee') this.changePayee()
if (val.value == 'payee') this.changePayee() },
}, // 弹窗确认回调
// 弹窗确认回调 onConfirm (val, flag) {
onConfirm (val, flag) { console.log(JSON.parse(JSON.stringify(val)), 'onConfirm')
console.log(JSON.parse(JSON.stringify(val)), 'onConfirm') this.externalData = []
this.externalData = [] // // const { chooseContent } = val
// // const { chooseContent } = val const chooseContent = utils.deepClone(val.chooseContent)
const chooseContent = utils.deepClone(val.chooseContent) // 根据popupTypeEnum优化处理
// 根据popupTypeEnum优化处理 const _typeValue = this.popupTypeEnum[this.popupType]
const _typeValue = this.popupTypeEnum[this.popupType] console.log(_typeValue)
console.log(_typeValue) // 定义产品相关字段数组
// 定义产品相关字段数组 if (val.popupType == 19) return this.setCustomerInfo(chooseContent)
if (val.popupType == 19) return this.setCustomerInfo(chooseContent) const productFields = ['skuGoods']
const productFields = ['skuGoods'] if (_typeValue.key == 'carBrand') {
if (_typeValue.key == 'carBrand') { // 车型
// 车型 this.$set(this.orderObj, 'carBrandText', `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
this.$set(this.orderObj, 'carBrandText', `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`) Object.assign(this.orderObj, {
Object.assign(this.orderObj, { carInfo: chooseContent
carInfo: chooseContent })
}) }
} else if (productFields.includes(_typeValue.key)) {
else if (productFields.includes(_typeValue.key)) { if (_typeValue.key == 'skuGoods') {
if (_typeValue.key == 'skuGoods') { if (!this.orderObj.skuGoods) {
if (!this.orderObj.skuGoods) { // 其他精品第一次赋值
// 其他精品第一次赋值 this.$set(this.orderObj, 'skuGoods', chooseContent)
this.$set(this.orderObj, 'skuGoods', chooseContent) } else {
} else { // 过滤出已选的goodFlag为2的对象
// 过滤出已选的goodFlag为2的对象 const selectedGoods = this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 2)
const selectedGoods = this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 2) const singleGoods = flag ? this.orderObj[_typeValue.key].filter(item => item.goodsFlag != 2) : chooseContent.filter(item => item.goodsFlag != 2)
const singleGoods = flag ? this.orderObj[_typeValue.key].filter(item => item.goodsFlag != 2) : chooseContent.filter(item => item.goodsFlag != 2) const moreGoods = chooseContent
const moreGoods = chooseContent .filter(item => item.goodsFlag === 2)
.filter(item => item.goodsFlag === 2) .filter(item => {
.filter(item => { return !selectedGoods.some(selectedItem => selectedItem.multipleSpecificationsGoods.goods.goodsId === item.multipleSpecificationsGoods.goods.goodsId)
return !selectedGoods.some(selectedItem => selectedItem.multipleSpecificationsGoods.goods.goodsId === item.multipleSpecificationsGoods.goods.goodsId) })
}) console.log(singleGoods, '===')
console.log(singleGoods, '===') // 合并已选的goodFlag为2的对象
// 合并已选的goodFlag为2的对象 this.orderObj.skuGoods = [...singleGoods, ...moreGoods, ...selectedGoods]
this.orderObj.skuGoods = [...singleGoods, ...moreGoods, ...selectedGoods] }
} }
} setTimeout(() => {
setTimeout(() => { this.changeTotalPrice()
this.changeTotalPrice() }, 0)
}, 0) }
} else {
else { if (_typeValue.key == 'city') {
if (_typeValue.key == 'city') { this.$set(this.orderObj, 'provinceText', chooseContent.province)
this.$set(this.orderObj, 'provinceText', chooseContent.province) this.$set(this.orderObj, 'cityText', chooseContent.city)
this.$set(this.orderObj, 'cityText', chooseContent.city) this.$set(this.orderObj, 'city', chooseContent.city == chooseContent.province ? chooseContent.city : `${chooseContent.province}-${chooseContent.city}`)
this.$set(this.orderObj, 'city', chooseContent.city == chooseContent.province ? chooseContent.city : `${chooseContent.province}-${chooseContent.city}`) } else if (_typeValue.key == 'todayShow') {
} else if (_typeValue.key == 'todayShow') { this.$set(this.orderObj, 'pay2Time', chooseContent)
this.$set(this.orderObj, 'pay2Time', chooseContent) } else if (_typeValue.list == 'employeeList') {
} else if (_typeValue.list == 'employeeList') { this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey])
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey]) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey]) } else this.$set(this.orderObj, _typeValue.key, chooseContent)
} else this.$set(this.orderObj, _typeValue.key, chooseContent) console.log(this.orderObj, 'this.orderObj')
console.log(this.orderObj, 'this.orderObj') }
} console.log(this.orderObj)
console.log(this.orderObj) },
}, // 输入框失去焦点事件
// 输入框失去焦点事件 inputBlur (e, val) {
inputBlur (e, val) { console.log(e, val)
console.log(e, val) if (val.value == 'price') {
if (val.value == 'price') { this.orderObj[val.value] = parseFloat(this.orderObj[val.value]) > 2000000 ? 2000000 : this.orderObj[val.value]
this.orderObj[val.value] = parseFloat(this.orderObj[val.value]) > 2000000 ? 2000000 : this.orderObj[val.value] return
return }
} this.orderObj[val.value] = this.orderObj[val.value]
this.orderObj[val.value] = this.orderObj[val.value] // VIN车架号动态校验:车架号字段,动态转换为大写
// VIN车架号动态校验:车架号字段,动态转换为大写 if (val.value === 'carVin') this.validateVin()
if (val.value === 'carVin') this.validateVin() },
}, validateVin () {
validateVin () { let carVinVal = this.orderObj.carVin;
let carVinVal = this.orderObj.carVin; if (carVinVal) {
if (carVinVal) { this.orderObj.carVin = formatVinInput(carVinVal)
this.orderObj.carVin = formatVinInput(carVinVal) validateVin(this.orderObj.carVin).then(result => {
validateVin(this.orderObj.carVin).then(result => { console.log("validateVin", result);
console.log("validateVin", result); let { valid } = result.data;
let { valid } = result.data; this.validateState = valid
this.validateState = valid // 校验成功,所有提示已在公共方法中处理
// 校验成功,所有提示已在公共方法中处理 console.log('车架号校验成功:', result)
console.log('车架号校验成功:', result) }).catch(err => {
}).catch(err => { console.log("validateVinErr", result);
console.log("validateVinErr", result); })
}) }
} },
}, // 校验必填等规则
// 校验必填等规则 checkRequired () {
checkRequired () { try {
try { const phoneRex = /^[1]([3-9])[0-9]{9}$/,
const phoneRex = /^[1]([3-9])[0-9]{9}$/, requiredArr = [],
requiredArr = [], onlyLabelItem = [],
onlyLabelItem = [], { orderObj } = this
{ orderObj } = this
this.formList.forEach(group => {
this.formList.forEach(group => { group.forEach(item => {
group.forEach(item => { if (item.required === true && item.hidden !== true) {
if (item.required === true && item.hidden !== true) { if (item.isArray) onlyLabelItem.push(item)
if (item.isArray) onlyLabelItem.push(item) else requiredArr.push(item)
else requiredArr.push(item) }
} })
}) })
}) // VIN车架号-动态校验
// VIN车架号-动态校验 const carVin = this.orderObj.carVin
const carVin = this.orderObj.carVin console.log("validateState", this.validateState);
console.log("validateState", this.validateState); if (carVin) {
if (carVin) { // 前置判断
// 前置判断 if (carVin.length !== 17) {
if (carVin.length !== 17) { uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' })
uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' }) return false
return false }
} // 根据接口校验结果判断
// 根据接口校验结果判断 if (carVin.length === 17 && !this.validateState) {
if (carVin.length === 17 && !this.validateState) { uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' })
uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' }) return false
return false }
} }
} // 遍历requiredArr,检查orderObj中是否有对应的值
// 遍历requiredArr,检查orderObj中是否有对应的值 for (let i = 0; i < requiredArr.length; i++) {
for (let i = 0; i < requiredArr.length; i++) { const item = requiredArr[i]
const item = requiredArr[i] // 兼容嵌套customer对象的情况
// 兼容嵌套customer对象的情况 let value = orderObj[item.value]
let value = orderObj[item.value] if (value === undefined || value === null || value === '') throw `${item.label}不能为空`
if (value === undefined || value === null || value === '') throw `${item.label}不能为空` // 如果是customerPhone,添加phoneRex校验
// 如果是customerPhone,添加phoneRex校验 if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}`
if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}` }
} // if (orderObj.carVin) {
// if (orderObj.carVin) { // if (!utils.validateVIN(orderObj.carVin)) throw '车架号校验不匹配,请核对后重新输入'
// if (!utils.validateVIN(orderObj.carVin)) throw '车架号校验不匹配,请核对后重新输入' // }
// }
if (onlyLabelItem.length) {
if (onlyLabelItem.length) { const labelFields = ['skuGoods']
const labelFields = ['skuGoods'] const hasValue = labelFields.some(field => {
const hasValue = labelFields.some(field => { const value = orderObj[field]
const value = orderObj[field] return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '')
return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '') })
}) if (!hasValue) throw '请选择增值车损险商品'
if (!hasValue) throw '请选择增值车损险商品' }
} if (orderObj.certificateNo && orderObj.certificateNo.length != 18) throw '请输入正确的18位证件号'
if (orderObj.certificateNo && orderObj.certificateNo.length != 18) throw '请输入正确的18位证件号' return true
return true } catch (error) {
} catch (error) { if (error) uni.showToast({
if (error) uni.showToast({ title: error,
title: error, icon: 'none'
icon: 'none' })
}) return false
return false }
} },
}, // 提交
// 提交
async submit () {
async submit () { if (!this.checkRequired() || await this.checkDailyReport()) return
if (!this.checkRequired() || await this.checkDailyReport()) return this.handleSecondConfirmCheck(true)
this.handleSecondConfirmCheck(true) },
}, async handleSecondConfirmCheck (check) {
async handleSecondConfirmCheck (check) { try {
try { let orderInfo = this.getInsurance(),
let orderInfo = this.getInsurance(), { payType } = orderInfo
{ payType } = orderInfo if (check &&
if (check && ([2, 5, 6, 7].includes(+payType)) &&
([2, 5, 6, 7].includes(+payType)) && !(orderInfo.transactionNo && orderInfo.paymentDocList.length)
!(orderInfo.transactionNo && orderInfo.paymentDocList.length) ) return this.showUpload = true
) return this.showUpload = true
if (orderInfo.pay2Time && ![1, 3].includes(+payType)) orderInfo.pay2Time = dayjs(orderInfo.pay2Time).format('YYYY-MM-DD HH:mm:ss')
if (orderInfo.pay2Time && ![1, 3].includes(+payType)) orderInfo.pay2Time = dayjs(orderInfo.pay2Time).format('YYYY-MM-DD HH:mm:ss') else delete orderInfo.pay2Time
else delete orderInfo.pay2Time uni.showLoading({
uni.showLoading({ title: `${check ? '报价' : '保存'}中...`,
title: `${check ? '报价' : '保存'}中...`, mask: true
mask: true })
}) orderInfo.check = check
orderInfo.check = check let apiName = orderInfo.id ? 'updateQuotation' : 'quotationAdd'
let apiName = orderInfo.id ? 'updateQuotation' : 'quotationAdd' const data = await uni.$api.equityApi[apiName](orderInfo)
const data = await uni.$api.equityApi[apiName](orderInfo) this.saveStatus = false
this.saveStatus = false if (data) {
if (data) { this.showUpload = false
this.showUpload = false wx.hideLoading()
wx.hideLoading() if (check) {
if (check) { if ([2, 5, 6, 7].includes(+payType)) return this.$emit('jump', 'OrderManagement')
if ([2, 5, 6, 7].includes(+payType)) return this.$emit('jump', 'OrderManagement') let status = await this.createWithPay(data)
let status = await this.createWithPay(data) if (status) this.$refs.OrderPay.open(data)
if (status) this.$refs.OrderPay.open(data) else throw false
else throw false } else this.$emit('jump', 'OrderManagement')
} else this.$emit('jump', 'OrderManagement') } else throw false
} else throw false } catch (error) {
} catch (error) { console.log(error)
console.log(error) this.saveStatus = false
this.saveStatus = false uni.hideLoading()
uni.hideLoading() uni.showToast({
uni.showToast({ title: '提交失败',
title: '提交失败', icon: 'none'
icon: 'none' })
}) }
} },
},
createWithPay (id) {
createWithPay (id) { return new Promise((resolve, reject) => {
return new Promise((resolve, reject) => { let para = {
let para = { id,
id, customerNameUrl: '',
customerNameUrl: '', orderStatus: 2
orderStatus: 2 }
} uni.$api.equityApi.quotationUpgrade(para).then(res => {
uni.$api.equityApi.quotationUpgrade(para).then(res => { resolve(res)
resolve(res) })
}) })
}) },
}, getInsurance () {
getInsurance () { let {
let { orderObj,
orderObj, userInfo
userInfo } = this,
} = this, orderInfo = utils.deepClone(orderObj),
orderInfo = utils.deepClone(orderObj), {
{ default4SStoreInfo
default4SStoreInfo } = userInfo,
} = userInfo, params = {
params = { owner: {
owner: { ...orderInfo.carInfo
...orderInfo.carInfo }
}
}
} if (orderInfo.id) params.id = orderInfo.id
if (orderInfo.id) params.id = orderInfo.id params.merchantId4s = default4SStoreInfo?.merchantId
params.merchantId4s = default4SStoreInfo?.merchantId params.merchantName4s = default4SStoreInfo?.merchantName
params.merchantName4s = default4SStoreInfo?.merchantName orderInfo.price = this.multipliedByHundred(orderInfo.price)
orderInfo.price = this.multipliedByHundred(orderInfo.price) params.insurancePrice = this.multipliedByHundred(
params.insurancePrice = this.multipliedByHundred( orderInfo.insurancePrice
orderInfo.insurancePrice )
) params.quotedPriceUpdate = this.multipliedByHundred(
params.quotedPriceUpdate = this.multipliedByHundred( orderInfo.quotedPriceUpdate
orderInfo.quotedPriceUpdate )
) params.minEquityPrice = this.multipliedByHundred(
params.minEquityPrice = this.multipliedByHundred( orderInfo.minEquityPrice
orderInfo.minEquityPrice )
) params.vdQuotationGoodsList = orderInfo.skuGoods.reduce(
params.vdQuotationGoodsList = orderInfo.skuGoods.reduce( (pre, item) => {
(pre, item) => { if (item.goods) {
if (item.goods) { item = item.goods
item = item.goods const obj = {
const obj = { goodsId: item.merchantGoodsId,
goodsId: item.merchantGoodsId, goodsName: item.goodsName,
goodsName: item.goodsName, goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias, specificationsName: item.specificationNameSequence,
specificationsName: item.specificationNameSequence, specificationsValue: item.specificationData ?
specificationsValue: item.specificationData ? item.specificationData.replace(/;~;/g, '/') : '',
item.specificationData.replace(/;~;/g, '/') : '', goodsPrice: this.multipliedByHundred(item.sellPrice)
goodsPrice: this.multipliedByHundred(item.sellPrice) }
} pre.push(obj)
pre.push(obj) }
}
if (item.packageGoods) {
if (item.packageGoods) { item = item.packageGoods
item = item.packageGoods item.goodsList.map(ele => {
item.goodsList.map(ele => { let obj = {
let obj = { packageId: item.packageCode,
packageId: item.packageCode, packageName: item.packageName,
packageName: item.packageName, packageNameAlias: item.packageAlias || item.packageNameAlias,
packageNameAlias: item.packageAlias || item.packageNameAlias, goodsId: ele.merchantGoodsId || ele.upgradeGoodsId,
goodsId: ele.merchantGoodsId || ele.upgradeGoodsId, goodsName: ele.upgradeGoodsName || ele.goodsName,
goodsName: ele.upgradeGoodsName || ele.goodsName, goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias,
goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias, specificationsName: ele.specificationNameSequence,
specificationsName: ele.specificationNameSequence, specificationsValue: ele.specificationData ?
specificationsValue: ele.specificationData ? ele.specificationData.replace(/;~;/g, '/') : '',
ele.specificationData.replace(/;~;/g, '/') : '', // specificationsValue: item.specificationData ? item.specificationData.replace(reg, ' ') : '',
// specificationsValue: item.specificationData ? item.specificationData.replace(reg, ' ') : '', goodsPrice: this.multipliedByHundred(ele.sellPrice)
goodsPrice: this.multipliedByHundred(ele.sellPrice) }
} pre.push(obj)
pre.push(obj) })
}) }
} if (item.multipleSpecificationsGoods) {
if (item.multipleSpecificationsGoods) { if (item.multipleSpecificationsGoods.goods) {
if (item.multipleSpecificationsGoods.goods) { item = item.multipleSpecificationsGoods.goods
item = item.multipleSpecificationsGoods.goods const obj = {
const obj = { goodsId: item.merchantGoodsId,
goodsId: item.merchantGoodsId, goodsName: item.upgradeGoodsName || item.goodsName,
goodsName: item.upgradeGoodsName || item.goodsName, goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias, specificationsName: item.specificationNameSequence,
specificationsName: item.specificationNameSequence, specificationsValue: item.specificationData ?
specificationsValue: item.specificationData ? item.specificationData.replace(/;~;/g, '/') : '',
item.specificationData.replace(/;~;/g, '/') : '', goodsPrice: this.multipliedByHundred(item.sellPrice)
goodsPrice: this.multipliedByHundred(item.sellPrice) }
} pre.push(obj)
pre.push(obj) }
} }
} return pre
return pre },
}, []
[] )
) let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer',
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer', 'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo',
'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo', 'transactionNo', 'paymentDocList', 'id', 'orderId', 'pay2Time'
'transactionNo', 'paymentDocList', 'id', 'orderId', 'pay2Time' ],
], customerKeyList = [
customerKeyList = [ 'owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price',
'owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price', 'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType'
'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType' ]
] keyList.map(key => {
keyList.map(key => { if (orderInfo[key] != null) params[key] = orderInfo[key]
if (orderInfo[key] != null) params[key] = orderInfo[key] })
}) customerKeyList.map(key => {
customerKeyList.map(key => { if (orderInfo[key] != null) params.owner[key] = orderInfo[key]
if (orderInfo[key] != null) params.owner[key] = orderInfo[key] })
}) if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId
if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId return params
return params },
}, // 乘以100保留两位小数点
// 乘以100保留两位小数点 multipliedByHundred (str) {
multipliedByHundred (str) { let floatVal = parseFloat(str)
let floatVal = parseFloat(str) if (isNaN(floatVal)) {
if (isNaN(floatVal)) { return 0
return 0 }
} floatVal = Math.round(str * 10000) / 100
floatVal = Math.round(str * 10000) / 100 let strVal = floatVal.toString()
let strVal = floatVal.toString() let searchVal = strVal.indexOf('.')
let searchVal = strVal.indexOf('.') if (searchVal < 0) {
if (searchVal < 0) { searchVal = strVal.length
searchVal = strVal.length strVal += '.'
strVal += '.' }
} while (strVal.length <= searchVal + 2) {
while (strVal.length <= searchVal + 2) { strVal += '0'
strVal += '0' }
} return parseFloat(strVal)
return parseFloat(strVal) },
}, // 计算所有产品的总价
// 计算所有产品的总价 changeTotalPrice () {
changeTotalPrice () { let total = 0
let total = 0 // 遍历所有商品
// 遍历所有商品 const productFields = ['skuGoods']
const productFields = ['skuGoods'] productFields.forEach(slotName => {
productFields.forEach(slotName => { const productList = this.orderObj[slotName]
const productList = this.orderObj[slotName] if (Array.isArray(productList) && productList.length > 0) {
if (Array.isArray(productList) && productList.length > 0) { // 计算每个产品的价格 * 数量,并累加到总价
// 计算每个产品的价格 * 数量,并累加到总价 productList.forEach(item => {
productList.forEach(item => { if (item.goods && item.goods.sellPrice && item.goods.number) {
if (item.goods && item.goods.sellPrice && item.goods.number) { console.log(item.goods, '---单商品')
console.log(item.goods, '---单商品') total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number))
total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number)) } else if (item.packageGoods && item.packageGoods.totalPrice) {
} else if (item.packageGoods && item.packageGoods.totalPrice) { console.log(item.packageGoods, '套餐')
console.log(item.packageGoods, '套餐') item.packageGoods.goodsList.map(i => {
total = NP.plus(total, item.packageGoods.totalPrice) total = NP.plus(total, i.sellPrice * i.number)
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) { })
console.log(item.multipleSpecificationsGoods, '多规格') } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) {
total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1)) console.log(item.multipleSpecificationsGoods, '多规格')
} total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1))
}) }
} })
}) }
console.log(total, 'total') })
// 更新总价 console.log(total, 'total')
this.orderObj.total = total.toFixed(2) // 更新总价
}, this.orderObj.total = total.toFixed(2)
},
// 获取园区店支付方式
async getConfig () { // 获取园区店支付方式
const { merchantId } = this.userInfo, async getConfig () {
res = await uni.$api.boutiqueApi.getYqStoreConfig({ this.djPayList = [
yqMerchantId: merchantId {
}) value: '1',
console.log(123) name: '微信支付'
let m = res.supportPayTypes || [] },
let n = this.payTypeList {
let list = n.filter(k => { name: '对公转账',
let idx = m.find(j => j == k.value) value: '6'
return idx >= 0 },
}) {
this.djPayList = [ name: '其它收款',
...list?.filter(v => ![2, 5].includes(Number(v.value))), value: '7'
{ },
name: '对公转账', ]
value: '6' this.merchantPayList = [{
}, value: '2',
{ name: '门店收款'
name: '其它收款', },]
value: '7' this.changePayee()
}, },
] changePayee () {
this.merchantPayList = [...list?.filter(v => v.value == 2)] const cell = this.formList[4].find(item => item.value === 'payType'),
this.changePayee() { payType } = this.orderObj
}, if (cell) {
changePayee () { cell.radioList = this.orderObj.payee == 1 ? this.merchantPayList : this.djPayList
const cell = this.formList[4].find(item => item.value === 'payType'), let index = cell.radioList.findIndex(i => i.value == payType)
{ payType } = this.orderObj if (index == -1) index = 0
if (cell) { if (cell.radioList && cell.radioList.length > 0) {
cell.radioList = this.orderObj.payee == 1 ? this.merchantPayList : this.djPayList cell.current = cell.radioList[index].value
let index = cell.radioList.findIndex(i => i.value == payType) // 使用 $set 确保响应式更新
if (index == -1) index = 0 this.$set(this.orderObj, 'payType', cell.radioList[index].value)
if (cell.radioList && cell.radioList.length > 0) { }
cell.current = cell.radioList[index].value }
// 使用 $set 确保响应式更新 },
this.$set(this.orderObj, 'payType', cell.radioList[index].value) // 商品列表
} async getSelectOrderGoodsList () {
} const { userInfo, paramsData } = this
}, if (paramsData.id) uni.showLoading({
// 商品列表 title: '加载中...',
async getSelectOrderGoodsList () { mask: true
const { userInfo, paramsData } = this })
if (paramsData.id) uni.showLoading({ const res = await uni.$api.boutiqueApi.getSelectOrderGoodsList({
title: '加载中...', merchantId: userInfo.shopMerchantId,
mask: true sceneType: userInfo.sceneType
}) })
const res = await uni.$api.boutiqueApi.getSelectOrderGoodsList({ this.goodsList = res
merchantId: userInfo.shopMerchantId, this.changeTotalPrice()
sceneType: userInfo.sceneType if (paramsData.id) this.getQuotationInfoById(paramsData.id)
}) },
this.goodsList = res handleSpecificationsEcho (item) {
this.changeTotalPrice() console.log('item', item)
if (paramsData.id) this.getQuotationInfoById(paramsData.id) let {
}, goodsList: quotationGoodsList
handleSpecificationsEcho (item) { } = this, skuArr = [],
console.log('item', item) arr = item.specificationsValue.split('/'),
let { str = arr.join(';~;');
goodsList: quotationGoodsList quotationGoodsList.forEach(data => {
} = this, skuArr = [], if (data.goodsFlag == 2) {
arr = item.specificationsValue.split('/'), let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str]
str = arr.join(';~;'); if (tempData) {
quotationGoodsList.forEach(data => { tempData.forEach(temp => {
if (data.goodsFlag == 2) {
let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str] if (temp.merchantGoodsId == item.goodsId) {
if (tempData) { let obj = {
tempData.forEach(temp => { goodsFlag: 2,
goods: null,
if (temp.merchantGoodsId == item.goodsId) { }
let obj = {
goodsFlag: 2, obj.multipleSpecificationsGoods = {
goods: null, goods: temp,
} baseGoodsName: item.goodsName
}
obj.multipleSpecificationsGoods = { temp.price = this.divideByHundred(item.goodsPrice)
goods: temp, temp.goodsId = item.goodsId
baseGoodsName: item.goodsName temp.specificationStr = item.specificationsValue
} console.log('🚀', obj)
temp.price = this.divideByHundred(item.goodsPrice) skuArr.push(obj)
temp.goodsId = item.goodsId }
temp.specificationStr = item.specificationsValue })
console.log('🚀', obj) }
skuArr.push(obj) }
} })
}) return skuArr
} },
} uploadConfirm ({
}) payVoucherList,
return skuArr outTradeNo
}, }) {
uploadConfirm ({ let paymentDocList = []
payVoucherList, payVoucherList.map(e => {
outTradeNo paymentDocList.push({
}) { paymentDocUrl: e,
let paymentDocList = [] type: 1
payVoucherList.map(e => { })
paymentDocList.push({ })
paymentDocUrl: e, this.orderObj.transactionNo = outTradeNo
type: 1 this.orderObj.tradeNo = outTradeNo
}) this.orderObj.paymentDocList = paymentDocList
}) this.submit()
this.orderObj.transactionNo = outTradeNo },
this.orderObj.tradeNo = outTradeNo setCustomerInfo (customerInfo) {
this.orderObj.paymentDocList = paymentDocList const { orderObj } = this,
this.submit() ownerGender = customerInfo.customerSex != 2 ? '男' : '女',
}, salesType = customerInfo.salesType || '0',
setCustomerInfo (customerInfo) { city = customerInfo.customerCity
const { orderObj } = this, Object.assign(orderObj, {
ownerGender = customerInfo.customerSex != 2 ? '男' : '女', customerId: customerInfo.id,
salesType = customerInfo.salesType || '0', owner: customerInfo.customerName,
city = customerInfo.customerCity phone: customerInfo.customerPhone,
Object.assign(orderObj, { ownerGender,
customerId: customerInfo.id, seat: customerInfo.carSeat || 5,
owner: customerInfo.customerName, ageRange: customerInfo.customerAgeRange,
phone: customerInfo.customerPhone, hobby: customerInfo.customerHobby,
ownerGender, companion: customerInfo.customerCompanion,
seat: customerInfo.carSeat || 5, certificateNo: customerInfo.customerCertificateNo || '',
ageRange: customerInfo.customerAgeRange, salesType,
hobby: customerInfo.customerHobby, carVin: customerInfo.carVin || '',
companion: customerInfo.customerCompanion, carColor: customerInfo.carColor || '',
certificateNo: customerInfo.customerCertificateNo || '', })
salesType, this.formList[1].map(e => {
carVin: customerInfo.carVin || '', if (e.value == 'salesType') e.current = salesType
carColor: customerInfo.carColor || '', if (e.value == 'ownerGender') e.current = ownerGender
}) })
this.formList[1].map(e => { if (city) {
if (e.value == 'salesType') e.current = salesType let [provinceText, cityText] = city.split('-')
if (e.value == 'ownerGender') e.current = ownerGender if (cityText) {
}) orderObj.provinceText = provinceText
if (city) { orderObj.cityText = cityText
let [provinceText, cityText] = city.split('-') } else {
if (cityText) { orderObj.provinceText = city
orderObj.provinceText = provinceText orderObj.cityText = city
orderObj.cityText = cityText }
} else { orderObj.city = city
orderObj.provinceText = city }
orderObj.cityText = city if (customerInfo.carPrice) orderObj.price = this.divideByHundred(customerInfo.carPrice)
} if (customerInfo.salesUuid) {
orderObj.city = city orderObj.referrerId = customerInfo.salesUuid
} orderObj.referrer = customerInfo.salesName
if (customerInfo.carPrice) orderObj.price = this.divideByHundred(customerInfo.carPrice) }
if (customerInfo.salesUuid) { if (customerInfo.carSeriesName) {
orderObj.referrerId = customerInfo.salesUuid orderObj.carInfo = {
orderObj.referrer = customerInfo.salesName carBrand: customerInfo.carBrand,
} carBrandId: customerInfo.carBrandId,
if (customerInfo.carSeriesName) { carChildsBrandId: customerInfo.carChildsBrandId,
orderObj.carInfo = { carChildsBrandName: customerInfo.carChildsBrandName,
carBrand: customerInfo.carBrand, carSeriesId: customerInfo.carSeriesId,
carBrandId: customerInfo.carBrandId, carSeriesName: customerInfo.carSeriesName,
carChildsBrandId: customerInfo.carChildsBrandId, }
carChildsBrandName: customerInfo.carChildsBrandName, orderObj.carBrandText = `${customerInfo.carBrand}-${customerInfo.carChildsBrandName}-${customerInfo.carSeriesName}`
carSeriesId: customerInfo.carSeriesId, }
carSeriesName: customerInfo.carSeriesName, this.orderObj = orderObj
} this.formKey = Date.now()
orderObj.carBrandText = `${customerInfo.carBrand}-${customerInfo.carChildsBrandName}-${customerInfo.carSeriesName}` this.validateVin()
} console.log(this.orderObj)
this.orderObj = orderObj },
this.formKey = Date.now() jumpSuccess (params) {
this.validateVin() this.$emit('jump', 'OrderDetail', params)
console.log(this.orderObj) },
}, async handleEditSave () {
jumpSuccess (params) { let {
this.$emit('jump', 'OrderDetail', params) saveStatus
}, } = this
async handleEditSave () { if (saveStatus) return false
let { this.saveStatus = true
saveStatus this.handleSecondConfirmCheck(false)
} = this },
if (saveStatus) return false divideByHundred: str => {
this.saveStatus = true let floatVal = parseFloat(str)
this.handleSecondConfirmCheck(false) if (isNaN(floatVal)) {
}, return 0
divideByHundred: str => { }
let floatVal = parseFloat(str) floatVal = Math.round(str * 100) / 10000
if (isNaN(floatVal)) { let strVal = floatVal.toString()
return 0 let searchVal = strVal.indexOf('.')
} if (searchVal < 0) {
floatVal = Math.round(str * 100) / 10000 searchVal = strVal.length
let strVal = floatVal.toString() strVal += '.'
let searchVal = strVal.indexOf('.') }
if (searchVal < 0) { while (strVal.length <= searchVal + 2) {
searchVal = strVal.length strVal += '0'
strVal += '.' }
} return parseFloat(strVal)
while (strVal.length <= searchVal + 2) { },
strVal += '0' closePopup () {
} this.$emit('jump', 'OrderManagement')
return parseFloat(strVal) },
}, clearPayMentDocList () {
closePopup () { this.showUpload = false
this.$emit('jump', 'OrderManagement') this.orderObj.paymentDocList = []
}, this.orderObj.transactionNo = ''
clearPayMentDocList () { }
this.showUpload = false }
this.orderInfo.paymentDocList = [] }
this.orderInfo.transactionNo = '' </script>
}
} <style scoped lang="scss">
} .order {
</script> height: 100%;
position: relative;
<style scoped lang="scss"> &-box {
.order { visibility: visible;
height: 100%; height: 100%;
position: relative; }
&-box { .hide {
visibility: visible; opacity: 0;
height: 100%; visibility: hidden;
} }
.hide { .upload-box {
opacity: 0; position: absolute;
visibility: hidden; left: 0;
} top: 0;
.upload-box { width: 100%;
position: absolute; height: 100%;
left: 0; }
top: 0; }
width: 100%;
height: 100%; .box {
} height: calc(100% - #{toRpx(120)});
} padding-bottom: toRpx(24);
.box { .scroll-view {
height: calc(100% - #{toRpx(120)}); height: 100%;
padding-bottom: toRpx(24); }
}
.scroll-view {
height: 100%; .box-content {
} padding: 0 toRpx(48);
} }
.box-content { .total {
padding: 0 toRpx(48); display: flex;
} justify-content: space-between;
align-items: center;
.total { padding: toRpx(24) toRpx(32) toRpx(24) 0;
display: flex; font-size: toRpx(28);
justify-content: space-between; border-bottom: toRpx(2) solid #f7f7f6;
align-items: center;
padding: toRpx(24) toRpx(32) toRpx(24) 0; &-left {
font-size: toRpx(28); color: #333;
border-bottom: toRpx(2) solid #f7f7f6; font-weight: 500;
}
&-left {
color: #333; &-right {
font-weight: 500; color: #f24724;
} font-weight: 500;
}
&-right { }
color: #f24724;
font-weight: 500; .pay-tips {
} padding: toRpx(24) toRpx(24) toRpx(24) 0;
} font-size: toRpx(24);
color: #999;
.pay-tips { }
padding: toRpx(24) toRpx(24) toRpx(24) 0; .btns {
font-size: toRpx(24); padding: toRpx(24) toRpx(128);
color: #999; gap: toRpx(32);
} .save {
.btns { background: #3b73ff1a;
padding: toRpx(24) toRpx(128); color: #4673ff;
gap: toRpx(32); font-size: toRpx(28);
.save { font-weight: 500;
background: #3b73ff1a; }
color: #4673ff; }
font-size: toRpx(28); .btn {
font-weight: 500; display: flex;
} align-items: center;
} justify-content: center;
.btn { width: toRpx(1130);
display: flex; height: toRpx(80);
align-items: center; color: #fff;
justify-content: center; border-radius: toRpx(48);
width: toRpx(1130); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
height: toRpx(80); }
color: #fff; .customer-title {
border-radius: toRpx(48); .customer-file {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); margin-left: toRpx(20);
} color: #347bff;
.customer-title { font-size: toRpx(24);
.customer-file { .sprite-icon {
margin-left: toRpx(20); margin-right: toRpx(4);
color: #347bff; }
font-size: toRpx(24); }
.sprite-icon { }
margin-right: toRpx(4); </style>
}
}
}
</style>
<template> <template>
<view> <view>
<view class="shop-list"> <view class="shop-list">
<view <view
class="shop-item" class="shop-item"
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
> >
<template v-if="item.goodsFlag == 3"> <template v-if="item.goodsFlag == 3">
<view class="package-box"> <view class="package-box">
<view class="shop-name flex"> <view class="shop-name flex">
<view <view
class="sprite-icon icon-blue-delete" class="sprite-icon icon-blue-delete"
@click="deleteGoods(index)" @click="deleteGoods(index)"
></view> ></view>
<view class="name">{{ goodsName(item) }}</view> <view class="name">{{ goodsName(item) }}</view>
<view class="total-price">{{packageTotal(item)}}</view> <view class="total-price">{{packageTotal(item)}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="package-goods-list"> <view class="package-goods-list">
<template v-for="(i,ind) in item.packageGoods.goodsList"> <template v-for="(i,ind) in item.packageGoods.goodsList">
<view <view
class="package-item flex" class="package-item flex"
:key="`package_${index}_${ind}`" :key="`package_${index}_${ind}`"
> >
<view class="package-icon"></view> <view class="package-icon"></view>
<view class="package-label">{{packageName(i,item)}}</view> <view class="package-label">{{packageName(i,item)}}</view>
<view class="package-value flex"> <view class="package-value flex">
<template v-if="i.goodsPriceModify"> <template v-if="i.goodsPriceModify">
<view class="package-price">¥{{i.sellPrice}}</view> <view class="package-price">¥{{i.sellPrice}}</view>
</template> </template>
<template v-else> <template v-else>
<view class="front-gear-input flex"> <view class="front-gear-input flex">
<view class="unit">¥</view> <view class="unit">¥</view>
<input <input
class="uni-input" class="uni-input"
type="digit" type="digit"
maxlength="9" maxlength="9"
placeholder="请输入价格" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
v-model="i.sellPrice" v-model="i.sellPrice"
@blur="validatePrice($event, item, index, ind)" @blur="validatePrice($event, item, index, ind)"
/> />
</view> </view>
</template> </template>
<view class="number">x1</view> <view class="number">x1</view>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view <view
class="sprite-icon icon-blue-delete" class="sprite-icon icon-blue-delete"
@click="deleteGoods(index)" @click="deleteGoods(index)"
></view> ></view>
<view :class="['right',{'one-line':item.goodsFlag == 1}]"> <view :class="['right',{'one-line':item.goodsFlag == 1}]">
<view :class="['shop-name',{'name-top':item.goodsFlag == 2}]">{{ goodsName(item) }}</view> <view :class="['shop-name',{'name-top':item.goodsFlag == 2}]">{{ goodsName(item) }}</view>
<view <view
class="alias" class="alias"
v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias" v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias"
>商品别名:{{ >商品别名:{{
item.multipleSpecificationsGoods.goods.goodsAlias }}</view> item.multipleSpecificationsGoods.goods.goodsAlias }}</view>
<view class="front-gear-box"> <view class="front-gear-box">
<view class="front-gear-input-box"> <view class="front-gear-input-box">
<template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr"> <template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<view class="front-gear-label"> <view class="front-gear-label">
{{item.multipleSpecificationsGoods.goods.specificationStr}} {{item.multipleSpecificationsGoods.goods.specificationStr}}
</view> </view>
</template> </template>
<view class="front-number-box flex"> <view class="front-number-box flex">
<template v-if="item.goodsFlag == 1"> <template v-if="item.goodsFlag == 1">
<template v-if="item.goods.goodsPriceModify"> <template v-if="item.goods.goodsPriceModify">
¥{{item.goods.sellPrice}} ¥{{item.goods.sellPrice}}
</template> </template>
<template v-else> <template v-else>
<view class="front-gear-input"> <view class="front-gear-input">
<view class="unit">¥</view> <view class="unit">¥</view>
<input <input
class="uni-input" class="uni-input"
type="digit" type="digit"
maxlength="9" maxlength="9"
placeholder="请输入价格" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
v-model="item.goods.sellPrice" v-model="item.goods.sellPrice"
@blur="validatePrice($event, item, index)" @blur="validatePrice($event, item, index)"
/> />
</view> </view>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.multipleSpecificationsGoods.goods.goodsPriceModify"> <template v-if="item.multipleSpecificationsGoods.goods.goodsPriceModify">
¥{{item.multipleSpecificationsGoods.goods.sellPrice}} ¥{{item.multipleSpecificationsGoods.goods.sellPrice}}
</template> </template>
<template v-else> <template v-else>
<view class="front-gear-input"> <view class="front-gear-input">
<view class="unit">¥</view> <view class="unit">¥</view>
<input <input
class="uni-input" class="uni-input"
type="digit" type="digit"
maxlength="9" maxlength="9"
placeholder="请输入价格" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
v-model="item.multipleSpecificationsGoods.goods.sellPrice" v-model="item.multipleSpecificationsGoods.goods.sellPrice"
@blur="validatePrice($event, item, index)" @blur="validatePrice($event, item, index)"
/> />
</view> </view>
</template> </template>
</template> </template>
<view class="number"> <view class="number">
x1 x1
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import NP from 'number-precision' import NP from 'number-precision'
export default { export default {
name: 'SkuGoods', name: 'SkuGoods',
props: { props: {
list: { list: {
type: Array, type: Array,
default: [] default: []
}, },
positionTypeList: { positionTypeList: {
type: Array, type: Array,
default: [] default: []
}, },
baseConfigData: { baseConfigData: {
type: Object, type: Object,
default: {} default: {}
} }
}, },
created () { created () {
// 初始化商品数量 // 初始化商品数量
this.initProductNumbers() this.initProductNumbers()
}, },
mounted () { mounted () {
// 确保每次使用组件时都检查并设置number属性 // 确保每次使用组件时都检查并设置number属性
this.initProductNumbers() this.initProductNumbers()
}, },
updated () { updated () {
// 当组件数据更新时也检查number属性 // 当组件数据更新时也检查number属性
this.initProductNumbers() this.initProductNumbers()
}, },
computed: { computed: {
}, },
methods: { methods: {
goodsName (item) { goodsName (item) {
let { goodsFlag } = item, let { goodsFlag } = item,
str = '' str = ''
if (goodsFlag == 3) str = item.packageGoods.packageAlias || item.packageGoods.packageName if (goodsFlag == 3) str = item.packageGoods.packageAlias || item.packageGoods.packageName
else str = item.multipleSpecificationsGoods ? else str = item.multipleSpecificationsGoods ?
item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName item.goods.goodsInfo.goodsName
return str return str
}, },
// 初始化商品数量方法 // 初始化商品数量方法
initProductNumbers () { initProductNumbers () {
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// 如果没有多规格商品,直接设置goods的number // 如果没有多规格商品,直接设置goods的number
if (item.goodsFlag == 1 && !item.goods.number) { if (item.goodsFlag == 1 && !item.goods.number) {
this.$set(item.goods, 'number', '1') this.$set(item.goods, 'number', '1')
} }
} else if (item.multipleSpecificationsGoods) { } else if (item.multipleSpecificationsGoods) {
// 如果有多规格商品,给multipleSpecificationsGoods中的goods添加number // 如果有多规格商品,给multipleSpecificationsGoods中的goods添加number
if (!item.multipleSpecificationsGoods.number) { if (!item.multipleSpecificationsGoods.number) {
this.$set(item.multipleSpecificationsGoods, 'number', '1') this.$set(item.multipleSpecificationsGoods, 'number', '1')
} }
} }
}) })
} }
}, },
filterIncludes (item, arr) { filterIncludes (item, arr) {
return arr.indexOf(item) > -1 return arr.indexOf(item) > -1
}, },
// 格式化位置信息 // 格式化位置信息
formatPosition (item, positionTypeList) { formatPosition (item, positionTypeList) {
const filterData = positionTypeList.filter(v => v.positionValue == item) const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || '' return (filterData.length && filterData[0] && filterData[0].positionName) || ''
}, },
// 验证价格输入 // 验证价格输入
validatePrice (event, item, index, cindex) { validatePrice (event, item, index, cindex) {
let value = event.detail.value let value = event.detail.value
// 如果为空则设置为0 // 如果为空则设置为0
if (!value || value.trim() === '') { if (!value || value.trim() === '') {
value = '0' value = '0'
} }
// 限制只能输入数字和小数点 // 限制只能输入数字和小数点
value = value.replace(/[^\d.]/g, '') value = value.replace(/[^\d.]/g, '')
// 限制只能有一个小数点 // 限制只能有一个小数点
if (value.split('.').length > 2) { if (value.split('.').length > 2) {
value = value.slice(0, value.lastIndexOf('.')) + value.slice(value.lastIndexOf('.') + 1) value = value.slice(0, value.lastIndexOf('.')) + value.slice(value.lastIndexOf('.') + 1)
} }
// 限制最多两位小数 // 限制最多两位小数
if (value.includes('.')) { if (value.includes('.')) {
const parts = value.split('.') const parts = value.split('.')
if (parts[1].length > 2) { if (parts[1].length > 2) {
parts[1] = parts[1].substring(0, 2) parts[1] = parts[1].substring(0, 2)
value = parts.join('.') value = parts.join('.')
} }
} }
// 限制最 大值为100000 // 限制最 大值为100000
if (parseFloat(value) > 100000) { if (parseFloat(value) > 100000) {
value = '100000' value = '100000'
} }
// 限制最小值为0 // 限制最小值为0
if (parseFloat(value) < 0 || parseFloat(value) == 0) { if (parseFloat(value) < 0 || parseFloat(value) == 0) {
value = '0' value = '0'
} }
// 检查最小价格 // 检查最小价格
// if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// // 普通商品的最小价格检查 if (item.packageGoods) {
// if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { item.packageGoods?.goodsList[cindex]
// uni.showToast({ let packageItem = item.packageGoods?.goodsList[cindex]
// title: '单价不可低于商品最低价', if (packageItem && packageItem.validMinSellPrice === 'N' && packageItem.minSellPrice && parseFloat(value) < parseFloat(packageItem.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.goods.minSellPrice.toString() icon: 'none'
// } })
// } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { value = packageItem.minSellPrice.toString()
// // 多规格商品的最小价格检查 }
// if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) { } else {
// uni.showToast({ // 普通商品的最小价格检查
// title: '单价不可低于商品最低价', if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.multipleSpecificationsGoods.goods.minSellPrice.toString() icon: 'none'
// } })
// } value = item.goods.minSellPrice.toString()
if (!item.multipleSpecificationsGoods) { }
if (item.goodsFlag == 1) { }
//如果没有多规格商品,更新普通商品的价格 } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
this.$set(this.list[index].goods, 'sellPrice', value) // 多规格商品的最小价格检查
} else { if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value) uni.showToast({
} title: '价格不可低于商品最低价',
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { icon: 'none'
// 如果有多规格商品,更新多规格商品的价格 })
this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value) value = item.multipleSpecificationsGoods.goods.minSellPrice.toString()
} }
this.$emit('changeTotalPrice') }
},
// 验证数量输入 if (!item.multipleSpecificationsGoods) {
validateNumber (event, item) { if (item.goodsFlag == 1) {
let value = event.detail.value //如果没有多规格商品,更新普通商品的价格
// 限制只能输入整数 this.$set(this.list[index].goods, 'sellPrice', value)
value = value.replace(/[^\d]/g, '') } else {
// 如果为空或0,设置为1 this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value)
if (!value || value.trim() === '' || parseInt(value) === 0) { }
value = '1' } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
} // 如果有多规格商品,更新多规格商品的价格
// 更新值 this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value)
if (!item.multipleSpecificationsGoods) { }
this.$set(item.goods, 'number', value) this.$emit('changeTotalPrice')
} else if (item.multipleSpecificationsGoods) { },
// 强制更新多规格商品的数量 // 验证数量输入
this.$set(item.multipleSpecificationsGoods, 'number', value) validateNumber (event, item) {
} let value = event.detail.value
this.$emit('changeTotalPrice') // 限制只能输入整数
}, value = value.replace(/[^\d]/g, '')
// 增加数量 // 如果为空或0,设置为1
increaseNumber (item) { if (!value || value.trim() === '' || parseInt(value) === 0) {
if (!item.multipleSpecificationsGoods) { value = '1'
// 处理普通商品 }
if (!item.goods.number) { // 更新值
this.$set(item.goods, 'number', '1') if (!item.multipleSpecificationsGoods) {
} else { this.$set(item.goods, 'number', value)
const currentValue = parseInt(item.goods.number) } else if (item.multipleSpecificationsGoods) {
// 限制最大数量为999 // 强制更新多规格商品的数量
const newValue = currentValue >= 999 ? 999 : currentValue + 1 this.$set(item.multipleSpecificationsGoods, 'number', value)
this.$set(item.goods, 'number', newValue.toString()) }
} this.$emit('changeTotalPrice')
} else if (item.multipleSpecificationsGoods) { },
// 处理多规格商品 // 增加数量
if (!item.multipleSpecificationsGoods.number) { increaseNumber (item) {
this.$set(item.multipleSpecificationsGoods, 'number', '1') if (!item.multipleSpecificationsGoods) {
} else { // 处理普通商品
const currentValue = parseInt(item.multipleSpecificationsGoods.number) if (!item.goods.number) {
// 限制最大数量为999 this.$set(item.goods, 'number', '1')
const newValue = currentValue >= 999 ? 999 : currentValue + 1 } else {
this.$set(item.multipleSpecificationsGoods, 'number', newValue.toString()) const currentValue = parseInt(item.goods.number)
} // 限制最大数量为999
} const newValue = currentValue >= 999 ? 999 : currentValue + 1
this.$emit('changeTotalPrice') this.$set(item.goods, 'number', newValue.toString())
}, }
// 减少数量 } else if (item.multipleSpecificationsGoods) {
decreaseNumber (item) { // 处理多规格商品
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods.number) {
// 处理普通商品 this.$set(item.multipleSpecificationsGoods, 'number', '1')
// 如果商品数量不存在或小于等于1,设置为1 } else {
if (!item.goods.number || parseInt(item.goods.number) <= 1) { const currentValue = parseInt(item.multipleSpecificationsGoods.number)
this.$set(item.goods, 'number', '1') // 限制最大数量为999
return const newValue = currentValue >= 999 ? 999 : currentValue + 1
} this.$set(item.multipleSpecificationsGoods, 'number', newValue.toString())
const currentValue = parseInt(item.goods.number) }
// 确保减少后的值不小于1 }
const newValue = Math.max(1, currentValue - 1) this.$emit('changeTotalPrice')
this.$set(item.goods, 'number', newValue.toString()) },
} else if (item.multipleSpecificationsGoods) { // 减少数量
// 处理多规格商品 decreaseNumber (item) {
// 如果商品数量不存在或小于等于1,设置为1 if (!item.multipleSpecificationsGoods) {
if (!item.multipleSpecificationsGoods.number || parseInt(item.multipleSpecificationsGoods.number) <= 1) { // 处理普通商品
this.$set(item.multipleSpecificationsGoods, 'number', '1') // 如果商品数量不存在或小于等于1,设置为1
return if (!item.goods.number || parseInt(item.goods.number) <= 1) {
} this.$set(item.goods, 'number', '1')
const currentValue = parseInt(item.multipleSpecificationsGoods.number) return
// 确保减少后的值不小于1 }
const newValue = Math.max(1, currentValue - 1) const currentValue = parseInt(item.goods.number)
this.$set(item.multipleSpecificationsGoods, 'number', newValue.toString()) // 确保减少后的值不小于1
} const newValue = Math.max(1, currentValue - 1)
this.$emit('changeTotalPrice') this.$set(item.goods, 'number', newValue.toString())
}, } else if (item.multipleSpecificationsGoods) {
// 删除商品 // 处理多规格商品
deleteGoods (index) { // 如果商品数量不存在或小于等于1,设置为1
this.list.splice(index, 1) if (!item.multipleSpecificationsGoods.number || parseInt(item.multipleSpecificationsGoods.number) <= 1) {
this.$emit('changeTotalPrice') this.$set(item.multipleSpecificationsGoods, 'number', '1')
}, return
replaceItemText (value) { }
let reg = getRegExp(';~;', 'g') const currentValue = parseInt(item.multipleSpecificationsGoods.number)
return value ? value.replace(reg, '/') : '' // 确保减少后的值不小于1
}, const newValue = Math.max(1, currentValue - 1)
packageName (item, parent) { this.$set(item.multipleSpecificationsGoods, 'number', newValue.toString())
return item.goodsAlias }
|| item.goodsNameAlias this.$emit('changeTotalPrice')
|| this.replaceItemText(item.upgradeGoodsName, (parent.specificationData ? '/' + item.specificationData : '')) },
|| this.replaceItemText(item.goodsName, (parent.specificationData ? '/' + item.specificationData : '')) // 删除商品
}, deleteGoods (index) {
packageTotal (item) { this.list.splice(index, 1)
let total = 0 this.$emit('changeTotalPrice')
item.packageGoods.goodsList.map(i => { },
total = NP.plus(total, i.sellPrice * i.number) replaceItemText (value) {
}) let reg = getRegExp(';~;', 'g')
item.packageGoods.totalPrice = total return value ? value.replace(reg, '/') : ''
return total },
}, packageName (item, parent) {
} return item.goodsAlias
} || item.goodsNameAlias
</script> || this.replaceItemText(item.upgradeGoodsName, (parent.specificationData ? '/' + item.specificationData : ''))
|| this.replaceItemText(item.goodsName, (parent.specificationData ? '/' + item.specificationData : ''))
<style scoped lang="scss"> },
.shop-list { packageTotal (item) {
padding-right: toRpx(32); let total = 0
item.packageGoods.goodsList.map(i => {
.shop-item { total = NP.plus(total, i.sellPrice * i.number)
display: flex; })
align-items: center; item.packageGoods.totalPrice = total
background-color: #f5f7fa; return total
border-radius: toRpx(16); },
margin-top: toRpx(16); }
padding: toRpx(24); }
</script>
.right {
flex: 1; <style scoped lang="scss">
font-size: toRpx(28); .shop-list {
margin-left: toRpx(24); padding-right: toRpx(32);
position: relative;
} .shop-item {
.one-line { display: flex;
display: flex; align-items: center;
align-items: center; background-color: #f5f7fa;
min-height: toRpx(72); border-radius: toRpx(16);
.front-gear-box { margin-top: toRpx(16);
margin-left: auto; padding: toRpx(24);
}
} .right {
.shop-name { flex: 1;
color: #ff781f; font-size: toRpx(28);
max-width: 70%; margin-left: toRpx(24);
word-break: break-all; position: relative;
} }
.name-top { .one-line {
margin-top: toRpx(4); display: flex;
} align-items: center;
.alias { min-height: toRpx(72);
margin-top: toRpx(12); .front-gear-box {
font-size: toRpx(24); margin-left: auto;
color: #666; }
} }
.package-box { .shop-name {
width: 100%; color: #ff781f;
.shop-name { max-width: 70%;
width: 100%; word-break: break-all;
max-width: 100%; }
.name { .name-top {
max-width: 70%; margin-top: toRpx(4);
} }
.total-price { .alias {
margin-left: auto; margin-top: toRpx(12);
color: #292d33; font-size: toRpx(24);
font-size: toRpx(28); color: #666;
font-weight: 400; }
} .package-box {
} width: 100%;
.line { .shop-name {
width: calc(100% + #{toRpx(48)}); width: 100%;
margin-left: toMinusRpx(24); max-width: 100%;
height: toRpx(2); .name {
background-color: #dce1e6; max-width: 70%;
margin-top: toRpx(24); }
} .total-price {
.package-item { margin-left: auto;
margin-top: toRpx(16); color: #292d33;
} font-size: toRpx(28);
.sprite-icon { font-weight: 400;
margin-right: toRpx(24); }
flex-shrink: 0; }
} .line {
.package-icon { width: calc(100% + #{toRpx(48)});
width: toRpx(12); margin-left: toMinusRpx(24);
height: toRpx(12); height: toRpx(2);
border-radius: 50%; background-color: #dce1e6;
background: #4673ff; margin-top: toRpx(24);
margin-right: toRpx(16); }
} .package-item {
.package-label { margin-top: toRpx(16);
color: #292d33; }
font-size: toRpx(28); .sprite-icon {
flex-shrink: 0; margin-right: toRpx(24);
max-width: 80%; flex-shrink: 0;
} }
.package-value { .package-icon {
flex-shrink: 0; width: toRpx(12);
margin-left: auto; height: toRpx(12);
} border-radius: 50%;
} background: #4673ff;
.number { margin-right: toRpx(16);
margin-left: toRpx(16); }
} .package-label {
.front-number-box{ color: #292d33;
position: absolute; font-size: toRpx(28);
top: 50%; flex-shrink: 0;
right: toRpx(24); max-width: 80%;
transform: translateY(-50%); }
.package-value {
} flex-shrink: 0;
} margin-left: auto;
} }
.front-gear-input-box { }
display: flex; .number {
align-items: center; margin-left: toRpx(16);
width: 100%; }
.front-gear-label { .front-number-box {
font-size: toRpx(24); position: absolute;
margin-right: toRpx(24); top: 50%;
color: #999999; right: toRpx(24);
} transform: translateY(-50%);
} }
.front-gear-input { }
margin-left: auto; }
position: relative; .front-gear-input-box {
display: flex; display: flex;
border: toRpx(2) solid #eff0f2; align-items: center;
background-color: #fff; width: 100%;
font-size: toRpx(28); .front-gear-label {
height: toRpx(72); font-size: toRpx(24);
width: toRpx(250); margin-right: toRpx(24);
line-height: toRpx(70); color: #999999;
text-align: right; }
border-radius: toRpx(12); }
.front-gear-input {
.uni-input { margin-left: auto;
padding: 0 toRpx(32); position: relative;
height: 100%; display: flex;
font-size: toRpx(28); border: toRpx(2) solid #eff0f2;
} background-color: #fff;
font-size: toRpx(28);
.unit { height: toRpx(72);
position: absolute; width: toRpx(250);
top: 50%; line-height: toRpx(70);
left: toRpx(24); text-align: right;
transform: translateY(-50%); border-radius: toRpx(12);
}
} .uni-input {
.front-gear-box { padding: 0 toRpx(32);
display: flex; height: 100%;
justify-content: space-between; font-size: toRpx(28);
.control { }
display: flex;
align-items: center; .unit {
position: absolute;
.control-input { top: 50%;
width: toRpx(94); left: toRpx(24);
height: toRpx(74); transform: translateY(-50%);
background-color: #fff; }
border: toRpx(2) solid #eff0f2; }
padding: 0 toRpx(10); .front-gear-box {
text-align: center; display: flex;
} justify-content: space-between;
.control {
.minus, display: flex;
.add { align-items: center;
width: toRpx(80);
height: toRpx(74); .control-input {
line-height: toRpx(70); width: toRpx(94);
text-align: center; height: toRpx(74);
background-color: #fff; background-color: #fff;
border-top: toRpx(2) solid #eff0f2; border: toRpx(2) solid #eff0f2;
border-bottom: toRpx(2) solid #eff0f2; padding: 0 toRpx(10);
} text-align: center;
}
.minus {
border-radius: toRpx(12) 0 0 toRpx(12); .minus,
border-left: toRpx(2) solid #eff0f2; .add {
} width: toRpx(80);
height: toRpx(74);
.add { line-height: toRpx(70);
border-radius: 0 toRpx(12) toRpx(12) 0; text-align: center;
border-right: toRpx(2) solid #eff0f2; background-color: #fff;
} border-top: toRpx(2) solid #eff0f2;
} border-bottom: toRpx(2) solid #eff0f2;
} }
.minus {
border-radius: toRpx(12) 0 0 toRpx(12);
border-left: toRpx(2) solid #eff0f2;
}
.add {
border-radius: 0 toRpx(12) toRpx(12) 0;
border-right: toRpx(2) solid #eff0f2;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -156,6 +156,7 @@ import permision from '@/js_sdk/wa-permission/permission.js' ...@@ -156,6 +156,7 @@ import permision from '@/js_sdk/wa-permission/permission.js'
import { sign, md532, md516 } from 'utils/common' import { sign, md532, md516 } from 'utils/common'
import { signSecretKey } from '@/env.js' import { signSecretKey } from '@/env.js'
import { validateVin, formatVinInput } from '@/utils/vinVaildate' import { validateVin, formatVinInput } from '@/utils/vinVaildate'
import { getPlateLocation } from '@/utils/licensePlateParser'
export default { export default {
name: 'AddEvaluationFrom', name: 'AddEvaluationFrom',
components: { components: {
...@@ -556,7 +557,7 @@ export default { ...@@ -556,7 +557,7 @@ export default {
uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30, fullwidth: true }], uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30, fullwidth: true }],
currentField: null, currentField: null,
query: {}, query: {},
validateState:true validateState: true
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -886,7 +887,7 @@ export default { ...@@ -886,7 +887,7 @@ export default {
// 车架号验证 - 长度17且只能包含数字和大写字母 // 车架号验证 - 长度17且只能包含数字和大写字母
// const vin = this.formData.carBaseReqDTO.vin // const vin = this.formData.carBaseReqDTO.vin
// const vinRegex = /^[A-Z0-9]+$/ // const vinRegex = /^[A-Z0-9]+$/
// if (!vinRegex.test(vin)) { // if (!vinRegex.test(vin)) {
// uni.showToast({ // uni.showToast({
// title: '车架号只能包含数字和大写字母', // title: '车架号只能包含数字和大写字母',
...@@ -901,22 +902,22 @@ export default { ...@@ -901,22 +902,22 @@ export default {
// }) // })
// return // return
// } // }
// VIN车架号-动态校验 // VIN车架号-动态校验
const carVin = this.formData.carBaseReqDTO.vin const carVin = this.formData.carBaseReqDTO.vin
console.log("validateState",this.validateState); console.log('validateState', this.validateState)
if (carVin) { if (carVin) {
// 前置判断 // 前置判断
if (carVin.length !== 17) { if (carVin.length !== 17) {
uni.showToast({title:'请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)',icon:'none'}) uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' })
return false return false
} }
// 根据接口校验结果判断 // 根据接口校验结果判断
if (carVin.length === 17 && !this.validateState) { if (carVin.length === 17 && !this.validateState) {
uni.showToast({title:'车架号校验不匹配,请核对后重新输入',icon:'none'}) uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' })
return false return false
} }
} }
const engineNumber = this.formData.carBaseReqDTO.engineNumber const engineNumber = this.formData.carBaseReqDTO.engineNumber
const engineNumberRegex = /^[A-Za-z0-9]+$/ const engineNumberRegex = /^[A-Za-z0-9]+$/
if (!engineNumberRegex.test(engineNumber)) { if (!engineNumberRegex.test(engineNumber)) {
...@@ -1018,7 +1019,7 @@ export default { ...@@ -1018,7 +1019,7 @@ export default {
}, },
handleCell(field) { handleCell(field) {
const that = this const that = this
console.log("handleCellAAAAA"); console.log('handleCellAAAAA')
if (field.isCar) { if (field.isCar) {
this.openSelectCar() this.openSelectCar()
} else if (field.isCity) { } else if (field.isCity) {
...@@ -1138,17 +1139,19 @@ export default { ...@@ -1138,17 +1139,19 @@ export default {
if (upperValue !== value) { if (upperValue !== value) {
this.$set(this.formData.carBaseReqDTO, 'vin', upperValue) this.$set(this.formData.carBaseReqDTO, 'vin', upperValue)
} }
// VIN车架号动态校验:车架号字段,动态转换为大写 // VIN车架号动态校验:车架号字段,动态转换为大写
validateVin(upperValue).then(result => { validateVin(upperValue)
console.log("validateVin",result); .then(result => {
let { valid } = result.data; console.log('validateVin', result)
this.validateState = valid let { valid } = result.data
// 校验成功,所有提示已在公共方法中处理 this.validateState = valid
console.log('车架号校验成功:', result) // 校验成功,所有提示已在公共方法中处理
}).catch(err => { console.log('车架号校验成功:', result)
console.log("validateVinErr",result); })
}) .catch(err => {
console.log('validateVinErr', result)
})
} }
if (field.key === 'mileage') { if (field.key === 'mileage') {
let numValue = Number(value) let numValue = Number(value)
...@@ -1324,15 +1327,17 @@ export default { ...@@ -1324,15 +1327,17 @@ export default {
if (res.data.code == 0) { if (res.data.code == 0) {
if (res.data.data.status == 1) { if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.vin = res.data.data.vin this.formData.carBaseReqDTO.vin = res.data.data.vin
validateVin(this.formData.carBaseReqDTO.vin).then(result => { validateVin(this.formData.carBaseReqDTO.vin)
console.log("validateVin",result); .then(result => {
let { valid } = result.data; console.log('validateVin', result)
this.validateState = valid let { valid } = result.data
// 校验成功,所有提示已在公共方法中处理 this.validateState = valid
console.log('车架号校验成功:', result) // 校验成功,所有提示已在公共方法中处理
}).catch(err => { console.log('车架号校验成功:', result)
console.log("validateVinErr",result); })
}) .catch(err => {
console.log('validateVinErr', result)
})
uni.showToast({ title: '车架号识别完成并已自动填写到表单中', icon: 'none' }) uni.showToast({ title: '车架号识别完成并已自动填写到表单中', icon: 'none' })
uni.hideLoading() uni.hideLoading()
} else { } else {
...@@ -1364,6 +1369,21 @@ export default { ...@@ -1364,6 +1369,21 @@ export default {
uni.showToast({ title: '行驶证信息识别完成,已自动填写到表单中', icon: 'none' }) uni.showToast({ title: '行驶证信息识别完成,已自动填写到表单中', icon: 'none' })
if (res.data.data.status == 1) { if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber
// 识别车牌号并解析省市回显到上牌城市
if (res.data.data.licensePlate) {
const plateLocation = getPlateLocation(res.data.data.licensePlate)
console.log('plateLocation', plateLocation)
if (plateLocation.success && plateLocation.province && plateLocation.city) {
// 清空上牌城市的ID,只保留名称
this.formData.carBaseReqDTO.registrationProvinceId = null
this.formData.carBaseReqDTO.registrationCityId = null
this.formData.carBaseReqDTO.registrationProvinceName = plateLocation.province
this.formData.carBaseReqDTO.registrationCityName = plateLocation.city
}
}
if (this.title == '新增评估单') { if (this.title == '新增评估单') {
this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate
if (res.data.data.licensePlate) { if (res.data.data.licensePlate) {
...@@ -1412,7 +1432,44 @@ export default { ...@@ -1412,7 +1432,44 @@ export default {
this.formData.carBaseReqDTO.vin = res.data.data.vin this.formData.carBaseReqDTO.vin = res.data.data.vin
this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate
this.formData.carLicenseReqDTO.previousOwnerAddress = res.data.data.previousOwnerAddress
// 处理 previousOwnerAddress,提取省市并回显到上牌城市
const previousOwnerAddress = res.data.data.previousOwnerAddress
this.formData.carLicenseReqDTO.previousOwnerAddress = previousOwnerAddress
if (previousOwnerAddress) {
// 解析地址,提取省和市(到市级)
let provinceName = ''
let cityName = ''
// 处理直辖市(北京市、上海市、天津市、重庆市)
const municipalities = ['北京市', '上海市', '天津市', '重庆市']
const municipalityMatch = municipalities.find(city => previousOwnerAddress.startsWith(city))
if (municipalityMatch) {
// 直辖市:省和市都是同一个名称
provinceName = municipalityMatch
cityName = municipalityMatch
} else {
// 普通省份:例如:"山东省济南市历下区" -> 省:"山东省",市:"济南市"
const provinceMatch = previousOwnerAddress.match(/^(.+?省)/)
const cityMatch = previousOwnerAddress.match(/省(.+?市)/)
if (provinceMatch && cityMatch) {
provinceName = provinceMatch[1]
cityName = cityMatch[1]
}
}
if (provinceName && cityName) {
// 清空上牌城市的ID,只保留名称
this.formData.carBaseReqDTO.registrationProvinceId = 0
this.formData.carBaseReqDTO.registrationCityId = 0
this.formData.carBaseReqDTO.registrationProvinceName = provinceName
this.formData.carBaseReqDTO.registrationCityName = cityName
}
}
this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName
this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName
this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote', 'app_evaluate_requote')">重新报价</view> <view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote', 'app_evaluate_requote')">重新报价</view>
<view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign', 'app_evaluate_sign')">客户签约</view> <view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign', 'app_evaluate_sign')">客户签约</view>
<view v-if="subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view> <view v-if="subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view>
<view v-if="subStatus == 1 && status == 20" class="common-btn ml-24" @click.stop="handleClick('withdrawal', 'app_evaluate_withdrawal')">撤回合同</view>
<view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view> <view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view>
<view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign', 'app_evaluate_cancel_sign')">取消签约</view> <view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign', 'app_evaluate_cancel_sign')">取消签约</view>
<view v-if="status == 31 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('signAgreement', 'app_evaluate_cancel_sign')">确认代保管</view> <view v-if="status == 31 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('signAgreement', 'app_evaluate_cancel_sign')">确认代保管</view>
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')"> <view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')">
<view class="sprite-icon icon-scanIconX"></view> <view class="sprite-icon icon-scanIconX"></view>
</view> </view>
<view v-if="field.isLocation" class="flex align-center scanBtn justify-center" @click.stop="location">
<view class="sprite-icon icon-location"></view>
</view>
<text v-if="field.isCell" class="ml-12 cellLabel" :class="{ disabled: field.disabled }">{{ field.cell }}</text> <text v-if="field.isCell" class="ml-12 cellLabel" :class="{ disabled: field.disabled }">{{ field.cell }}</text>
</template> </template>
<template v-if="field.type === 'select'"> <template v-if="field.type === 'select'">
...@@ -275,6 +278,9 @@ export default { ...@@ -275,6 +278,9 @@ export default {
scan(type) { scan(type) {
this.$emit('scan', type) this.$emit('scan', type)
}, },
location() {
this.$emit('location')
},
previewPdf(field) { previewPdf(field) {
this.$emit('previewPdf', field) this.$emit('previewPdf', field)
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<view class="car-number mr-12">{{ carInfo.registrationDateStr }}</view> <view class="car-number mr-12">{{ carInfo.registrationDateStr }}</view>
<view class="car-number mr-12">{{ carInfo.mileageStr }}</view> <view class="car-number mr-12">{{ carInfo.mileageStr }}</view>
<view class="car-number mr-12">{{ carInfo.transferCountStr }}</view> <view class="car-number mr-12">{{ carInfo.transferCountStr }}</view>
<view class="car-number">{{ vehicleCategoryMap[1] }}</view> <view class="car-number">{{ vehicleCategoryMap[carInfo.vehicleCategory] }}</view>
</view> </view>
<view class="info-row flex mb-30"> <view class="info-row flex mb-30">
<view class="info-item flex align-center"> <view class="info-item flex align-center">
......
...@@ -136,6 +136,12 @@ export default { ...@@ -136,6 +136,12 @@ export default {
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
console.log('选择图片成功', res) console.log('选择图片成功', res)
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) { for (const file of res.tempFiles) {
...@@ -218,6 +224,12 @@ export default { ...@@ -218,6 +224,12 @@ export default {
compressed: false, compressed: false,
success: async res => { success: async res => {
console.log('拍摄视频成功', res) console.log('拍摄视频成功', res)
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
}
})
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) { if (res.size > MAX_VIDEO_SIZE) {
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</view> </view>
</view> </view>
<view class="fromBox"> <view class="fromBox">
<FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @previewPdf="previewPdf" @deletePdf="deletePdf" /> <FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @previewPdf="previewPdf" @deletePdf="deletePdf" @location="location" />
</view> </view>
</view> </view>
<view class="button-module flex justify-center align-center"> <view class="button-module flex justify-center align-center">
...@@ -171,7 +171,8 @@ export default { ...@@ -171,7 +171,8 @@ export default {
sourceKey: 'uuid', sourceKey: 'uuid',
targetKey: 'handoverAddress', targetKey: 'handoverAddress',
type: 'input', type: 'input',
maxlength: 43 maxlength: 43,
isLocation: true
}, },
{ {
key: 'buyerAgreementUrl', key: 'buyerAgreementUrl',
...@@ -279,10 +280,28 @@ export default { ...@@ -279,10 +280,28 @@ export default {
evalOrderNo: this.query.evalOrderNo evalOrderNo: this.query.evalOrderNo
}) })
if (res.data.code == 0) { if (res.data.code == 0) {
// this.$set(this.formData, 'handoverAddress', res.data.data.evalCarBase.carProvinceName + '-' + res.data.data.evalCarBase.carCityName) const data = res.data.data
console.log('res.data.data', JSON.parse(res.data.data.custodyContract.electronicContractField))
// this.custodianName = JSON.parse(res.data.data.custodyContract.electronicContractField).custodianName || '' // 设置交车时间
this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00') this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00')
// 处理图片回显
if (data.imageListDTO && data.imageListDTO.length > 0) {
// 行驶证图片 (fileSubtype: 21)
const drivingLicenseImages = data.imageListDTO.filter(img => img.fileSubtype === 21).map(img => img.fileUrl)
if (drivingLicenseImages.length > 0) {
this.$set(this.uploadedImages, 'motorRegistrationCertificateUrl', drivingLicenseImages)
this.formData.motorRegistrationCertificateUrl = drivingLicenseImages.join(',')
}
// 登记证图片 (fileSubtype: 22)
const registrationImages = data.imageListDTO.filter(img => img.fileSubtype === 22).map(img => img.fileUrl)
if (registrationImages.length > 0) {
this.$set(this.uploadedImages, 'motorBookUrl', registrationImages)
this.formData.motorBookUrl = registrationImages.join(',')
}
}
// this.evalOrderSimpleDetail = res.data.data // this.evalOrderSimpleDetail = res.data.data
} else { } else {
uni.hideLoading() uni.hideLoading()
...@@ -473,6 +492,12 @@ export default { ...@@ -473,6 +492,12 @@ export default {
sizeType: ['original'], sizeType: ['original'],
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) { for (const file of res.tempFiles) {
...@@ -542,6 +567,12 @@ export default { ...@@ -542,6 +567,12 @@ export default {
compressed: false, compressed: false,
success: async res => { success: async res => {
console.log('拍摄视频成功', res) console.log('拍摄视频成功', res)
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
}
})
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) { if (res.size > MAX_VIDEO_SIZE) {
...@@ -679,6 +710,22 @@ export default { ...@@ -679,6 +710,22 @@ export default {
console.log(successDate) console.log(successDate)
this.$set(this.formData, 'handoverTime', successDate) this.$set(this.formData, 'handoverTime', successDate)
this.show = false this.show = false
},
location() {
const that = this
uni.showLoading({ title: '定位中...' })
uni.getLocation({
type: 'gcj02',
geocode: true,
success: function (res) {
uni.hideLoading()
that.$set(that.formData, 'handoverAddress', res.address.province + res.address.city)
},
fail: function (err) {
uni.hideLoading()
uni.showToast({ title: '定位失败', icon: 'none' })
}
})
} }
}, },
watch: {}, watch: {},
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<view class="upload-images-wrapper" v-if="getImageBySubtype(field.key)"> <view class="upload-images-wrapper" v-if="getImageBySubtype(field.key)">
<view class="uploaded-media-container"> <view class="uploaded-media-container">
<view class="video-container"> <view class="video-container">
<image :src="getImageBySubtype(field.key).fileUrl + videoProcess" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 2)"></image> <image :src="getVideoThumbnail(getImageBySubtype(field.key).fileUrl)" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 2)"></image>
<!-- <video :src="getImageBySubtype(field.key).fileUrl" mode="aspectFill" controls class="uploaded-media"></video> --> <!-- <video :src="getImageBySubtype(field.key).fileUrl" mode="aspectFill" controls class="uploaded-media"></video> -->
<view class="video-play-icon"> <view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view> <view class="sprite-icon icon-upload-play"></view>
...@@ -173,10 +173,19 @@ ...@@ -173,10 +173,19 @@
<view class="tab-panel-title">二手车转让协议</view> <view class="tab-panel-title">二手车转让协议</view>
<view class="gridBoxNoPadding"> <view class="gridBoxNoPadding">
<template v-for="(item, index) in vehicleItems"> <template v-for="(item, index) in vehicleItems">
<view v-if="!detailsInfo.signingInfo.saleContract.depositPrice ? item.key !== 'signingInfo.saleContract.depositPrice' && item.key !== 'signingInfo.saleContract.finalPrice' : item.key !== 'signingInfo.saleContract.fullPrice'" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]"> <view v-if="(!detailsInfo.signingInfo.saleContract.depositPrice ? item.key !== 'signingInfo.saleContract.depositPrice' && item.key !== 'signingInfo.saleContract.finalPrice' : item.key !== 'signingInfo.saleContract.fullPrice') && (item.key !== 'signingInfo.saleContract.thirdPartyTransactionVoucher' || formatValue(item, detailsInfo))" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]">
<view class="title-label-see mr-16">{{ item.label }}</view> <view class="title-label-see mr-16">{{ item.label }}</view>
<view v-if="item.type == 'image'"> <view v-if="item.type == 'image'">
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image> <!-- 三方/委托交易凭证可能是视频 -->
<view v-if="item.key === 'signingInfo.saleContract.thirdPartyTransactionVoucher' && isVideoUrl(formatValue(item, detailsInfo))" class="uploaded-media-container">
<view class="video-container">
<image :src="getVideoThumbnail(formatValue(item, detailsInfo))" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
</view>
<image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</view> </view>
<view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)"> <view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)">
<view class="pdf-box flex align-center justify-between"> <view class="pdf-box flex align-center justify-between">
...@@ -311,7 +320,15 @@ ...@@ -311,7 +320,15 @@
<image @click.stop="previewMedia(url, 1)" v-for="(url, idx) in splitMediaUrls(formatValue(item, detailsInfo))" :key="idx" :src="url" mode="aspectFill" style="margin-right: 10px"></image> <image @click.stop="previewMedia(url, 1)" v-for="(url, idx) in splitMediaUrls(formatValue(item, detailsInfo))" :key="idx" :src="url" mode="aspectFill" style="margin-right: 10px"></image>
</template> </template>
<template v-else> <template v-else>
<image v-if="formatValue(item, detailsInfo).includes('mp4')" :src="formatValue(item, detailsInfo) + videoProcess" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image> <!-- 过户授权委托书可能是视频 -->
<view v-if="item.key === 'carHandoverInfo.transferPhotoUrl' && isVideoUrl(formatValue(item, detailsInfo))" class="uploaded-media-container">
<view class="video-container">
<image :src="getVideoThumbnail(formatValue(item, detailsInfo))" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
</view>
<image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image> <image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</template> </template>
</view> </view>
...@@ -393,7 +410,7 @@ ...@@ -393,7 +410,7 @@
</template> </template>
</view> </view>
<view v-else-if="item.fieldType == 'video'"> <view v-else-if="item.fieldType == 'video'">
<image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldBeforeValue)" :key="idx" :src="url + videoProcess" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image> <image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldBeforeValue)" :key="idx" :src="getVideoThumbnail(url)" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image>
</view> </view>
</template> </template>
</view> </view>
...@@ -409,7 +426,7 @@ ...@@ -409,7 +426,7 @@
</template> </template>
</view> </view>
<view v-else-if="item.fieldType == 'video'"> <view v-else-if="item.fieldType == 'video'">
<image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldAfterValue)" :key="idx" :src="url + videoProcess" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image> <image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldAfterValue)" :key="idx" :src="getVideoThumbnail(url)" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image>
</view> </view>
</template> </template>
</view> </view>
...@@ -553,6 +570,7 @@ export default { ...@@ -553,6 +570,7 @@ export default {
{ label: '交车地点', key: 'signingInfo.saleContract.handoverAddress' }, { label: '交车地点', key: 'signingInfo.saleContract.handoverAddress' },
{ label: '身份证国徽面', key: 'signingInfo.saleContract.idCardFrontUrl', type: 'image' }, { label: '身份证国徽面', key: 'signingInfo.saleContract.idCardFrontUrl', type: 'image' },
{ label: '身份证人像面', key: 'signingInfo.saleContract.idCardBackUrl', type: 'image' }, { label: '身份证人像面', key: 'signingInfo.saleContract.idCardBackUrl', type: 'image' },
{ label: '三方/委托交易凭证', key: 'signingInfo.saleContract.thirdPartyTransactionVoucher', type: 'image' },
{ label: '查阅合同', key: 'signingInfo.saleContract.contractUrl', type: 'link' } { label: '查阅合同', key: 'signingInfo.saleContract.contractUrl', type: 'link' }
], ],
payeeItems: [ payeeItems: [
...@@ -708,6 +726,45 @@ export default { ...@@ -708,6 +726,45 @@ export default {
.map(url => url.trim()) .map(url => url.trim())
.filter(url => url) .filter(url => url)
}, },
// 判断URL是否是视频
isVideoUrl(url) {
if (!url) return false
// 1. 检查是否包含阿里云视频处理参数
if (url.includes(this.videoProcess)) {
return true
}
// 2. 检查文件扩展名(视频格式)
const videoExtensions = ['.mp4', '.mov', '.avi', '.wmv', '.flv', '.m4v', '.3gp', '.mkv', '.webm']
const urlLower = url.toLowerCase()
const hasVideoExtension = videoExtensions.some(ext => {
// 检查扩展名,需要排除查询参数
const urlWithoutQuery = urlLower.split('?')[0].split('#')[0]
return urlWithoutQuery.endsWith(ext)
})
return hasVideoExtension
},
// 获取视频缩略图URL
getVideoThumbnail(url) {
if (!url) return ''
// 如果已经是阿里云链接且包含videoProcess,直接返回
if (url.includes(this.videoProcess)) {
return url
}
// 如果是阿里云OSS链接,添加videoProcess参数
if (url.includes('aliyuncs.com') || url.includes('oss-')) {
// 如果URL已经有查询参数,用&连接;否则用?连接
const separator = url.includes('?') ? '&' : '?'
return url + separator + this.videoProcess.replace('?', '')
}
// 如果不是阿里云链接(如小程序上传),返回默认视频图片
return 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/video_default.png'
},
statusClass(status) { statusClass(status) {
return status > 0 ? `status-${status}` : 'status-0' return status > 0 ? `status-${status}` : 'status-0'
}, },
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
</view> </view>
</template> </template>
</GeneralPopup> </GeneralPopup>
<NoticePopup ref="notice" title="重要提示" text="确定要撤回合同吗?" type="warning"></NoticePopup>
<OrderPopup ref="orderPopup" :data="custodyAgreementObj" :isDefeatOrder="true" :externalData="[]" @onConfirm="onConfirm" :popupType="14" idKey="id" /> <OrderPopup ref="orderPopup" :data="custodyAgreementObj" :isDefeatOrder="true" :externalData="[]" @onConfirm="onConfirm" :popupType="14" idKey="id" />
</view> </view>
</template> </template>
...@@ -165,7 +166,7 @@ import EvaluationCard from './components/evaluationCard.vue' ...@@ -165,7 +166,7 @@ import EvaluationCard from './components/evaluationCard.vue'
import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin' import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
import GeneralPopup from './components/GeneralPopup.vue' import GeneralPopup from './components/GeneralPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import { set } from 'lodash' import NoticePopup from '@/components/NoticePopup.vue'
export default { export default {
name: 'EvaluationFormList', name: 'EvaluationFormList',
mixins: [ZPMixin], mixins: [ZPMixin],
...@@ -175,7 +176,8 @@ export default { ...@@ -175,7 +176,8 @@ export default {
TypeTabComponent, TypeTabComponent,
EvaluationCard, EvaluationCard,
GeneralPopup, GeneralPopup,
OrderPopup OrderPopup,
NoticePopup
}, },
data() { data() {
return { return {
...@@ -391,8 +393,55 @@ export default { ...@@ -391,8 +393,55 @@ export default {
this.reSubmit(e) this.reSubmit(e)
} else if (e.type === 'signAgreement') { } else if (e.type === 'signAgreement') {
this.signAgreement(e) this.signAgreement(e)
} else if (e.type === 'withdrawal') {
this.withdrawal(e)
} }
}, },
async withdrawal(e) {
this.$refs.notice.buttonsList = [
{
text: '取消',
type: 'default',
callback: () => {
this.$refs.notice.close()
}
},
{
text: '确定',
type: 'primary',
callback: async () => {
uni.showLoading()
const res = await uni.$api.evaluationApi.revokeSaleContract({
saleContractNo: e.saleContractNo
})
console.log('res:', res)
if (res.data.code == 0) {
this.$refs.notice.close()
uni.hideLoading()
uni.showToast({
title: '撤回合同成功',
icon: 'none'
})
setTimeout(() => {
this.currentPage = 1
this.search()
}, 1000)
} else {
this.$refs.notice.close()
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
}
}
]
// 打开弹窗
this.$refs.notice.open()
},
async reSubmit(e) { async reSubmit(e) {
uni.showLoading() uni.showLoading()
const res = await uni.$api.evaluationApi.evalOrderConfirmVehicleDelivery({ const res = await uni.$api.evaluationApi.evalOrderConfirmVehicleDelivery({
...@@ -734,11 +783,13 @@ export default { ...@@ -734,11 +783,13 @@ export default {
border-radius: toRpx(42); border-radius: toRpx(42);
background: rgb(255, 255, 255) !important; background: rgb(255, 255, 255) !important;
.tipsPopupBg { .tipsPopupBg {
border-radius: toRpx(42) toRpx(42) 0 0; border-radius: toRpx(42) toRpx(42) 0 0;
width: 100%; width: 100%;
height: toRpx(244); height: toRpx(244);
} }
.title { .title {
color: #333333; color: #333333;
font-size: toRpx(40); font-size: toRpx(40);
...@@ -746,6 +797,7 @@ export default { ...@@ -746,6 +797,7 @@ export default {
text-align: center; text-align: center;
margin-top: toRpx(48); margin-top: toRpx(48);
} }
.tipsConent { .tipsConent {
color: #666666; color: #666666;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -753,14 +805,17 @@ export default { ...@@ -753,14 +805,17 @@ export default {
padding: toRpx(16) toRpx(64); padding: toRpx(16) toRpx(64);
line-height: toRpx(48); line-height: toRpx(48);
text-align: center; text-align: center;
text { text {
color: #347bff; color: #347bff;
} }
} }
.footer-box { .footer-box {
height: toRpx(154); height: toRpx(154);
} }
} }
.evaluation-form-list { .evaluation-form-list {
position: relative; position: relative;
width: 100vw; width: 100vw;
...@@ -775,6 +830,7 @@ export default { ...@@ -775,6 +830,7 @@ export default {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
.box-class { .box-class {
height: calc(100% - #{toRpx(110)}); height: calc(100% - #{toRpx(110)});
background: #ffffff59; background: #ffffff59;
...@@ -782,24 +838,29 @@ export default { ...@@ -782,24 +838,29 @@ export default {
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
overflow: hidden; overflow: hidden;
.paging-class { .paging-class {
background-color: #fff; background-color: #fff;
height: calc(100% - #{toRpx(96)}); height: calc(100% - #{toRpx(96)});
box-sizing: border-box; box-sizing: border-box;
border-radius: toRpx(32); border-radius: toRpx(32);
} }
.no-br { .no-br {
border-radius: 0 toRpx(32) toRpx(32) toRpx(32); border-radius: 0 toRpx(32) toRpx(32) toRpx(32);
} }
.no-br1 { .no-br1 {
border-radius: toRpx(32) 0 toRpx(32) toRpx(32); border-radius: toRpx(32) 0 toRpx(32) toRpx(32);
} }
.mask-box { .mask-box {
height: calc(100% - #{toRpx(96)}); height: calc(100% - #{toRpx(96)});
width: 100%; width: 100%;
background: #fff; background: #fff;
border-radius: toRpx(48); border-radius: toRpx(48);
color: #808291; color: #808291;
.noDataImg { .noDataImg {
width: toRpx(480); width: toRpx(480);
height: toRpx(240); height: toRpx(240);
...@@ -807,9 +868,11 @@ export default { ...@@ -807,9 +868,11 @@ export default {
} }
} }
} }
.signAgreement-content { .signAgreement-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
.signAgreement-label { .signAgreement-label {
color: #999999; color: #999999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -817,12 +880,14 @@ export default { ...@@ -817,12 +880,14 @@ export default {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.requiredLabel { .requiredLabel {
color: #f24724; color: #f24724;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(8); margin-left: toRpx(8);
} }
.from-value { .from-value {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -832,16 +897,19 @@ export default { ...@@ -832,16 +897,19 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(28) toRpx(24); padding: toRpx(28) toRpx(24);
flex: 1; flex: 1;
.sprite-icon { .sprite-icon {
margin-bottom: toRpx(2); margin-bottom: toRpx(2);
} }
} }
.btn { .btn {
color: #3b73ff; color: #3b73ff;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(24); margin-left: toRpx(24);
} }
.placeholder { .placeholder {
color: #999; color: #999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -861,6 +929,7 @@ export default { ...@@ -861,6 +929,7 @@ export default {
.requote-content { .requote-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
.requote-label { .requote-label {
color: #333333; color: #333333;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -868,12 +937,14 @@ export default { ...@@ -868,12 +937,14 @@ export default {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.requiredLabel { .requiredLabel {
color: #f24724; color: #f24724;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(8); margin-left: toRpx(8);
} }
::v-deep .intention-input { ::v-deep .intention-input {
height: toRpx(96); height: toRpx(96);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -882,11 +953,13 @@ export default { ...@@ -882,11 +953,13 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.uni-input-placeholder { .uni-input-placeholder {
margin-left: toRpx(24); margin-left: toRpx(24);
} }
} }
} }
.intention-input-cell { .intention-input-cell {
height: toRpx(96); height: toRpx(96);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -894,6 +967,7 @@ export default { ...@@ -894,6 +967,7 @@ export default {
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
} }
::v-deep .feedback-textarea { ::v-deep .feedback-textarea {
height: toRpx(288); height: toRpx(288);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -901,6 +975,7 @@ export default { ...@@ -901,6 +975,7 @@ export default {
width: 100%; width: 100%;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.uni-input-wrapper { .uni-input-wrapper {
background: #f4f5f7; background: #f4f5f7;
} }
...@@ -915,6 +990,7 @@ export default { ...@@ -915,6 +990,7 @@ export default {
background: #f1f7fe; background: #f1f7fe;
padding-left: toRpx(32); padding-left: toRpx(32);
box-sizing: border-box; box-sizing: border-box;
.amount-title { .amount-title {
color: #333333; color: #333333;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -922,12 +998,14 @@ export default { ...@@ -922,12 +998,14 @@ export default {
margin-right: toRpx(16); margin-right: toRpx(16);
width: toRpx(168); width: toRpx(168);
} }
.amount-value { .amount-value {
color: #3b73ff; color: #3b73ff;
font-size: toRpx(36); font-size: toRpx(36);
font-weight: 700; font-weight: 700;
} }
} }
.popup-cell-title { .popup-cell-title {
color: #999; color: #999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -935,14 +1013,17 @@ export default { ...@@ -935,14 +1013,17 @@ export default {
margin-right: toRpx(16); margin-right: toRpx(16);
width: toRpx(168); width: toRpx(168);
} }
.popup-cell-value { .popup-cell-value {
color: #222; color: #222;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
} }
.light-title { .light-title {
color: #333333; color: #333333;
} }
.light-value { .light-value {
color: #4673ff; color: #4673ff;
} }
......
...@@ -76,6 +76,38 @@ ...@@ -76,6 +76,38 @@
</template> </template>
</view> </view>
</view> </view>
<view class="upload-container mb-24">
<view class="form-item flex align-start justify-between">
<view class="from-label">
三方/委托交易凭证
<!-- <text class="requiredLabel">*</text> -->
</view>
<template>
<!-- 判断是否已上传 -->
<view v-if="formData.thirdPartyTransactionVoucher" class="uploaded-item">
<!-- 视频显示 -->
<view v-if="formData.thirdPartyTransactionVoucher.includes(videoProcess)" class="video-container">
<image :src="formData.thirdPartyTransactionVoucher" mode="aspectFit" @click.stop="previewMedia(formData.thirdPartyTransactionVoucher, 2)"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
<!-- 图片显示 -->
<image v-else :src="formData.thirdPartyTransactionVoucher" mode="aspectFit" @click.stop="previewMedia(formData.thirdPartyTransactionVoucher, 1)"></image>
<view class="delete-icon" @click.stop="removeMedia('thirdPartyTransactionVoucher')">
<view class="sprite-icon icon-icon-circle-error"></view>
</view>
</view>
<view v-else class="upload-item" @click.stop="handleMediaUpload('thirdPartyTransactionVoucher')">
<view class="upload-placeholder">
<view class="sprite-icon icon-uploadAdd"></view>
<text class="upload-text">上传图片/视频</text>
</view>
</view>
</template>
</view>
</view>
<FormCell :formFields="formFields2" :formData="formData" @handleCell="handleCell" /> <FormCell :formFields="formFields2" :formData="formData" @handleCell="handleCell" />
<view class="upload-container"> <view class="upload-container">
<view class="form-item flex align-start justify-between"> <view class="form-item flex align-start justify-between">
...@@ -145,14 +177,14 @@ ...@@ -145,14 +177,14 @@
<checkbox class="sign-checkbox" style="transform: scale(0.7)" activeBackgroundColor="#4673FF" iconColor="#fff" :value="item.value" :checked="item.checked" :disabled="item.disabled" /> <checkbox class="sign-checkbox" style="transform: scale(0.7)" activeBackgroundColor="#4673FF" iconColor="#fff" :value="item.value" :checked="item.checked" :disabled="item.disabled" />
</view> </view>
<view class="checkbox-name">{{ item.name }}</view> <view class="checkbox-name">{{ item.name }}</view>
<input class="checkbox-input" v-if="item.isShowInput && item.key != 'other'" v-model="formData[item.inputValue]" placeholder="请输入" type="number" maxlength="1" /> <input class="checkbox-input" @click.stop="" v-if="item.isShowInput && item.key != 'other'" v-model="formData[item.inputValue]" placeholder="请输入" type="number" maxlength="1" :disabled="!item.checked" />
<input class="checkbox-input" @click.stop="" v-if="item.isShowInput && item.key == 'other'" v-model="formData[item.inputValue]" placeholder="请输入" maxlength="28" @blur="e => handleBlur(e, item)" /> <input class="checkbox-input" @click.stop="" v-if="item.isShowInput && item.key == 'other'" v-model="formData[item.inputValue]" placeholder="请输入" maxlength="28" @blur="e => handleBlur(e, item)" :disabled="!item.checked" />
</label> </label>
</checkbox-group> </checkbox-group>
</template> </template>
</view> </view>
</view> </view>
<FormCell :formFields="formFields1" :formData="formData" @handleCell="handleCell" class="mb-24" /> <FormCell :formFields="formFields1" :formData="formData" @handleCell="handleCell" @location="location" class="mb-24" />
<FormCell :formFields="formFields3" :formData="formData" @handleCell="handleCell" /> <FormCell :formFields="formFields3" :formData="formData" @handleCell="handleCell" />
</view> </view>
<view v-else class="flex flex-col align-center justify-center no-data"> <view v-else class="flex flex-col align-center justify-center no-data">
...@@ -213,6 +245,18 @@ ...@@ -213,6 +245,18 @@
<view class="title-label-see mr-16">身份证人像面</view> <view class="title-label-see mr-16">身份证人像面</view>
<image :src="formData.idCardBackUrl" @click.stop="previewMedia(formData.idCardBackUrl, 1)"></image> <image :src="formData.idCardBackUrl" @click.stop="previewMedia(formData.idCardBackUrl, 1)"></image>
</view> </view>
<view class="flex align-start" v-if="formData.thirdPartyTransactionVoucher">
<view class="title-label-see mr-16">三方/委托交易 凭证</view>
<!-- 视频显示 -->
<view v-if="formData.thirdPartyTransactionVoucher.includes(videoProcess)" class="video-preview" @click.stop="previewMedia(formData.thirdPartyTransactionVoucher, 2)">
<image :src="formData.thirdPartyTransactionVoucher"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
<!-- 图片显示 -->
<image v-else :src="formData.thirdPartyTransactionVoucher" @click.stop="previewMedia(formData.thirdPartyTransactionVoucher, 1)"></image>
</view>
</view> </view>
<view class="flex align-center gridBox mb-32"> <view class="flex align-center gridBox mb-32">
<view class="flex align-center"> <view class="flex align-center">
...@@ -297,6 +341,7 @@ export default { ...@@ -297,6 +341,7 @@ export default {
}, },
data() { data() {
return { return {
videoProcess: '?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast',
comfirmPage: false, comfirmPage: false,
signInfo: {}, signInfo: {},
title: '签约信息', title: '签约信息',
...@@ -321,36 +366,31 @@ export default { ...@@ -321,36 +366,31 @@ export default {
key: 'motorBook', key: 'motorBook',
value: 'motorBook', value: 'motorBook',
name: '机动车登记本', name: '机动车登记本',
checked: true, checked: false
disabled: true
}, },
{ {
value: 'motorRegistrationCertificate', value: 'motorRegistrationCertificate',
name: '机动车行驶证', name: '机动车行驶证',
key: 'motorRegistrationCertificate', key: 'motorRegistrationCertificate',
checked: true, checked: false
disabled: true
}, },
{ {
value: 'trafficScreenshot', value: 'trafficScreenshot',
name: '交管12123截图', name: '交管12123截图',
key: 'trafficScreenshot', key: 'trafficScreenshot',
checked: true, checked: false
disabled: true
}, },
{ {
value: 'trafficInsurance', value: 'trafficInsurance',
name: '交强险', name: '交强险',
key: 'trafficInsurance', key: 'trafficInsurance',
checked: true, checked: false
disabled: true
}, },
{ {
value: 'carKey', value: 'carKey',
name: '车钥匙', name: '车钥匙',
key: 'carKey', key: 'carKey',
checked: true, checked: false,
disabled: true,
isShowInput: true, isShowInput: true,
inputValue: 'carKeyCount' inputValue: 'carKeyCount'
}, },
...@@ -376,8 +416,7 @@ export default { ...@@ -376,8 +416,7 @@ export default {
value: 'transferPhoto', value: 'transferPhoto',
name: '过户授权委托书照片', name: '过户授权委托书照片',
key: 'transferPhoto', key: 'transferPhoto',
checked: true, checked: false
disabled: true
}, },
{ {
value: 'other', value: 'other',
...@@ -451,7 +490,8 @@ export default { ...@@ -451,7 +490,8 @@ export default {
sourceKey: 'uuid', sourceKey: 'uuid',
targetKey: 'handoverAddress', targetKey: 'handoverAddress',
type: 'input', type: 'input',
maxlength: 43 maxlength: 43,
isLocation: true
} }
], ],
formFields2: [ formFields2: [
...@@ -854,13 +894,12 @@ export default { ...@@ -854,13 +894,12 @@ export default {
const isSelected = e.detail.value.some(value => value === item.value) const isSelected = e.detail.value.some(value => value === item.value)
resultObject[itemKey] = isSelected ? '1' : '0' resultObject[itemKey] = isSelected ? '1' : '0'
item.checked = isSelected item.checked = isSelected
})
const otherItem = this.checkboxList.find(item => item.name === '其他') // 如果取消勾选且该项有输入框,清空输入值
const otherIndex = this.checkboxList.indexOf(otherItem) if (!isSelected && item.isShowInput && item.inputValue) {
if (otherItem && !otherItem.checked) { this.formData[item.inputValue] = ''
this.formData[this.checkboxList[otherIndex].inputValue] = '' }
} })
// 更新formData // 更新formData
this.formData = { ...this.formData, ...resultObject } this.formData = { ...this.formData, ...resultObject }
...@@ -877,6 +916,47 @@ export default { ...@@ -877,6 +916,47 @@ export default {
.map(item => item.name) .map(item => item.name)
.join(', ') .join(', ')
}, },
// 处理图片/视频上传(用于三方/委托交易凭证)
async handleMediaUpload(field) {
// #ifdef APP-PLUS
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) {
uni.showToast({ title: '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限', icon: 'none' })
return
}
if (camera != 1) {
uni.showToast({ title: '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限', icon: 'none' })
return
}
if (!isOnline) {
uni.showToast({ title: '当前无网络连接,请连接网络后重试', icon: 'none' })
return
}
// #endif
uni.showActionSheet({
itemList: ['拍照', '从相册选择图片', '拍摄视频', '从相册选择视频'],
success: res => {
if (res.tapIndex === 0) {
// 拍照
this.takePhoto(field)
} else if (res.tapIndex === 1) {
// 从相册选择图片
this.chooseImageFromAlbum(field)
} else if (res.tapIndex === 2) {
// 拍摄视频
this.takeVideo(field)
} else if (res.tapIndex === 3) {
// 从相册选择视频
this.chooseVideoFromAlbum(field)
}
},
fail: err => {
console.log('选择操作失败', err)
}
})
},
async handleImageUpload(field) { async handleImageUpload(field) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE') const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
...@@ -919,6 +999,13 @@ export default { ...@@ -919,6 +999,13 @@ export default {
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
try { try {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) { for (const file of res.tempFiles) {
if (file.size > MAX_IMAGE_SIZE) { if (file.size > MAX_IMAGE_SIZE) {
...@@ -926,11 +1013,12 @@ export default { ...@@ -926,11 +1013,12 @@ export default {
return return
} }
} }
uni.showLoading({ title: '上传中...', mask: true })
// 上传所有选择的图片 // 上传所有选择的图片
for (const tempFilePath of res.tempFilePaths) { for (let i = 0; i < res.tempFilePaths.length; i++) {
console.log('上传图片开始', tempFilePath) const url = await uploadFile(res.tempFiles[i], res.tempFilePaths[i])
const url = await uploadFile(tempFilePath)
console.log('上传图片成功', url) console.log('上传图片成功', url)
uni.hideLoading()
this.addMedia(field, { url, fileFormat: 'png', type: 'image', name: field.label }) this.addMedia(field, { url, fileFormat: 'png', type: 'image', name: field.label })
} }
} catch (error) { } catch (error) {
...@@ -981,6 +1069,95 @@ export default { ...@@ -981,6 +1069,95 @@ export default {
} }
}) })
}, },
// 拍摄视频
takeVideo(field) {
uni.chooseVideo({
sourceType: ['camera'],
maxDuration: 60,
camera: 'back',
compressed: false,
success: async res => {
console.log('拍摄视频成功', res)
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
}
})
try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) {
uni.showToast({ title: '视频上传最大100MB', icon: 'none' })
return
}
uni.showLoading({ title: '上传中...' })
// let url = await uploadFile(null, res.tempFilePath)
// #ifdef H5
let url = await uploadFile(res.tempFile, res.tempFilePath)
// #endif
// #ifdef APP-PLUS
let url = await uploadFile(null, res.tempFilePath)
// #endif
url = url + this.videoProcess
console.log('上传视频成功', url)
this.$set(this.formData, field, url)
uni.hideLoading()
uni.showToast({ title: '上传成功', icon: 'success' })
} catch (error) {
console.log('上传视频失败', error)
uni.hideLoading()
uni.showToast({ title: '视频上传失败,请重试', icon: 'none' })
}
},
fail: err => {
console.log('拍摄视频失败', err)
if (err.errMsg.indexOf('cancel') === -1) {
uni.showToast({ title: '拍摄视频失败', icon: 'none' })
}
}
})
},
// 从相册选择视频
chooseVideoFromAlbum(field) {
uni.chooseVideo({
sourceType: ['album'],
compressed: false,
maxDuration: 60,
success: async res => {
console.log('选择视频成功', res)
try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) {
uni.showToast({ title: '视频上传最大100MB', icon: 'none' })
return
}
uni.showLoading({ title: '上传中...' })
// #ifdef H5
let url = await uploadFile(res.tempFile, res.tempFilePath)
// #endif
// #ifdef APP-PLUS
let url = await uploadFile(null, res.tempFilePath)
// #endif
url = url + this.videoProcess
console.log('上传视频成功', url)
this.$set(this.formData, field, url)
uni.hideLoading()
uni.showToast({ title: '上传成功', icon: 'success' })
} catch (error) {
console.log('上传视频失败', error)
uni.hideLoading()
uni.showToast({ title: '视频上传失败,请重试', icon: 'none' })
}
},
fail: err => {
console.log('选择视频失败', err)
if (err.errMsg.indexOf('cancel') === -1) {
uni.showToast({ title: '选择视频失败', icon: 'none' })
}
}
})
},
addMedia(field, media) { addMedia(field, media) {
this.$set(this.formData, field, media.url) this.$set(this.formData, field, media.url)
}, },
...@@ -988,7 +1165,7 @@ export default { ...@@ -988,7 +1165,7 @@ export default {
// 显示确认对话框 // 显示确认对话框
uni.showModal({ uni.showModal({
title: '确认删除', title: '确认删除',
content: '确定要删除此图片吗?', content: '确定要删除此图片/视频吗?',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
// 用户确认删除 // 用户确认删除
...@@ -1096,21 +1273,39 @@ export default { ...@@ -1096,21 +1273,39 @@ export default {
}) })
return return
} }
if (!this.formData.carKeyCount) {
// 验证随车材料:至少选择一项
const checkedItems = this.checkboxList.filter(item => item.checked)
if (checkedItems.length === 0) {
uni.showToast({
title: '请至少选择一项随车材料',
icon: 'none'
})
return
}
// 验证车钥匙:如果勾选了车钥匙,必须输入数量
const carKeyItem = this.checkboxList.find(item => item.key === 'carKey')
if (carKeyItem && carKeyItem.checked && !this.formData.carKeyCount) {
uni.showToast({ uni.showToast({
title: '请输入车钥匙数量', title: '请输入车钥匙数量',
icon: 'none' icon: 'none'
}) })
return return
} }
if (this.selectedItemsText.indexOf('其他') !== -1) {
if (!this.formData.otherText) { // 验证其他:如果勾选了其他,必须输入内容
uni.showToast({ const otherItem = this.checkboxList.find(item => item.key === 'other')
title: '请完善随车材料', if (otherItem && otherItem.checked && !this.formData.otherText) {
icon: 'none' uni.showToast({
}) title: '请输入其他随车材料内容',
return icon: 'none'
} })
return
}
// 更新 selectedItemsText
if (this.selectedItemsText.indexOf('其他') !== -1 && this.formData.otherText) {
this.selectedItemsText = this.selectedItemsText.replace('其他', '') this.selectedItemsText = this.selectedItemsText.replace('其他', '')
this.selectedItemsText += this.formData.otherText this.selectedItemsText += this.formData.otherText
} }
...@@ -1124,8 +1319,24 @@ export default { ...@@ -1124,8 +1319,24 @@ export default {
delete this.formData.depositPrice delete this.formData.depositPrice
delete this.formData.finalPrice delete this.formData.finalPrice
} }
// 处理视频 URL,去掉 videoProcess 后缀
const submitData = { ...this.formData }
if (submitData.thirdPartyTransactionVoucher && submitData.thirdPartyTransactionVoucher.includes(this.videoProcess)) {
submitData.thirdPartyTransactionVoucher = submitData.thirdPartyTransactionVoucher.replace(this.videoProcess, '')
}
// 只提交勾选的随车材料,未勾选的设为 '0'
this.checkboxList.forEach(item => {
if (item.key) {
if (!item.checked) {
submitData[item.key] = '0'
}
}
})
uni.showLoading() uni.showLoading()
uni.$api.evaluationApi.evalOrderSignContract({ ...this.formData, evalOrderNo: this.query.evalOrderNo }).then(res => { uni.$api.evaluationApi.evalOrderSignContract({ ...submitData, evalOrderNo: this.query.evalOrderNo }).then(res => {
console.log('res:', res) console.log('res:', res)
if (res.data.code == 0) { if (res.data.code == 0) {
uni.hideLoading() uni.hideLoading()
...@@ -1177,6 +1388,22 @@ export default { ...@@ -1177,6 +1388,22 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `${url}` url: `${url}`
}) })
},
location() {
const that = this
uni.showLoading({ title: '定位中...' })
uni.getLocation({
type: 'gcj02',
geocode: true,
success: function (res) {
uni.hideLoading()
that.$set(that.formData, 'handoverAddress', res.address.province + res.address.city)
},
fail: function (err) {
uni.hideLoading()
uni.showToast({ title: '定位失败', icon: 'none' })
}
})
} }
} }
} }
...@@ -1400,6 +1627,26 @@ export default { ...@@ -1400,6 +1627,26 @@ export default {
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
.video-container {
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.video-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
}
.delete-icon { .delete-icon {
position: absolute; position: absolute;
top: toRpx(8); top: toRpx(8);
...@@ -1501,6 +1748,35 @@ export default { ...@@ -1501,6 +1748,35 @@ export default {
border-radius: toRpx(12); border-radius: toRpx(12);
background: #f4f5f7; background: #f4f5f7;
} }
.video-preview {
position: relative;
width: toRpx(240);
height: toRpx(240);
border-radius: toRpx(12);
background: #f4f5f7;
display: flex;
align-items: center;
justify-content: center;
image {
width: 100%;
height: 100%;
object-fit: contain;
}
.video-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
}
}
.full-width { .full-width {
grid-column: 1 / -1; grid-column: 1 / -1;
} }
......
<template> <template>
<view class="uni-calendar"> <view class="uni-calendar">
<view <view
v-if="!insert&&show" v-if="!insert&&show"
class="uni-calendar__mask" class="uni-calendar__mask"
:class="[{'uni-calendar--mask-show':aniMaskShow},{'uni-calendar--mask-bg-hide':hideMask}]" :class="[{'uni-calendar--mask-show':aniMaskShow},{'uni-calendar--mask-bg-hide':hideMask}]"
@click="clean" @click="clean"
></view> ></view>
<view <view
v-if="insert || show" v-if="insert || show"
class="uni-calendar__content" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}"
:style="[{backgroundColor:backgroundColor}]" :style="[{backgroundColor:backgroundColor}]"
> >
<view <view
v-if="!insert" v-if="!insert"
class="uni-calendar__header uni-calendar--fixed-top" class="uni-calendar__header uni-calendar--fixed-top"
> >
<template v-if="!showBottomBtn"> <template v-if="!showBottomBtn">
<view <view
class="uni-calendar__header-btn-box" class="uni-calendar__header-btn-box"
@click="close" @click="close"
> >
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text> <text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text>
</view> </view>
</template> </template>
<viw :class="['uni-calendar__header-title',{'header-title-center':showBottomBtn}]">{{title}}</viw> <viw :class="['uni-calendar__header-title',{'header-title-center':showBottomBtn}]">{{title}}</viw>
<template v-if="!showBottomBtn"> <template v-if="!showBottomBtn">
<view <view
class="uni-calendar__header-btn-box" class="uni-calendar__header-btn-box"
@click="confirm" @click="confirm"
> >
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text> <text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text>
</view> </view>
</template> </template>
<template v-if="showBottomBtn"> <template v-if="showBottomBtn">
<view <view
class="popup-close" class="popup-close"
@click="close" @click="close"
> >
<uni-icons <uni-icons
type="closeempty" type="closeempty"
size="18" size="18"
></uni-icons> ></uni-icons>
</view> </view>
</template> </template>
</view> </view>
<view class="uni-calendar__header"> <view class="uni-calendar__header">
<view <view
class="uni-calendar__header-btn-box" :class="['uni-calendar__header-btn-box prev-btn',{'show-prev-btn':showPreBtn}]"
@click.stop="pre" @click.stop="pre"
> >
<view class="uni-calendar__header-btn uni-calendar--left"></view> <view class="uni-calendar__header-btn uni-calendar--left"></view>
</view> </view>
<picker <picker
mode="date" mode="date"
:value="date" :value="date"
:end="endDate" :end="endDate"
fields="month" fields="month"
@change="bindDateChange" @change="bindDateChange"
> >
<text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text> <text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
</picker> </picker>
<view <view
:class="['uni-calendar__header-btn-box next-btn',{'show-next-btn':showNextBtn}]" :class="['uni-calendar__header-btn-box next-btn',{'show-next-btn':showNextBtn}]"
@click.stop="next" @click.stop="next"
> >
<view class="uni-calendar__header-btn uni-calendar--right"></view> <view class="uni-calendar__header-btn uni-calendar--right"></view>
</view> </view>
<text <text
class="uni-calendar__backtoday" class="uni-calendar__backtoday"
@click="backToday" @click="backToday"
v-if="!hideTodayBtn" v-if="!hideTodayBtn"
>{{todayText}}</text> >{{todayText}}</text>
</view> </view>
<view class="uni-calendar__box"> <view class="uni-calendar__box">
<view <view
v-if="showMonth" v-if="showMonth"
class="uni-calendar__box-bg" class="uni-calendar__box-bg"
> >
<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text> <text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
</view> </view>
<view class="uni-calendar__weeks"> <view class="uni-calendar__weeks">
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{SUNText}}</text> <text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{monText}}</text> <text class="uni-calendar__weeks-day-text">{{monText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{TUEText}}</text> <text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{WEDText}}</text> <text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{THUText}}</text> <text class="uni-calendar__weeks-day-text">{{THUText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{FRIText}}</text> <text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{SATText}}</text> <text class="uni-calendar__weeks-day-text">{{SATText}}</text>
</view> </view>
</view> </view>
<view <view
class="uni-calendar__weeks" class="uni-calendar__weeks"
v-for="(item,weekIndex) in weeks" v-for="(item,weekIndex) in weeks"
:key="weekIndex" :key="weekIndex"
> >
<view <view
class="uni-calendar__weeks-item" class="uni-calendar__weeks-item"
v-for="(weeks,weeksIndex) in item" v-for="(weeks,weeksIndex) in item"
:key="weeksIndex" :key="weeksIndex"
> >
<calendar-item <calendar-item
class="uni-calendar-item--hook" class="uni-calendar-item--hook"
:weeks="weeks" :weeks="weeks"
:calendar="calendar" :calendar="calendar"
:selected="selected" :selected="selected"
:lunar="lunar" :lunar="lunar"
@change="choiceDate" @change="choiceDate"
></calendar-item> ></calendar-item>
</view> </view>
</view> </view>
</view> </view>
<template v-if="showBottomBtn"> <template v-if="showBottomBtn">
<view class="uni-calendar__footer_btns"> <view class="uni-calendar__footer_btns">
<view <view
class="uni-calendar__footer_btn" class="uni-calendar__footer_btn"
@click="close" @click="close"
>取消</view> >取消</view>
<view <view
class="uni-calendar__footer_btn uni-calendar__footer_btn-primary" class="uni-calendar__footer_btn uni-calendar__footer_btn-primary"
@click="confirm" @click="confirm"
>确定</view> >确定</view>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import Calendar from './util.js'; import Calendar from './util.js';
import CalendarItem from './uni-calendar-item.vue' import CalendarItem from './uni-calendar-item.vue'
import { initVueI18n } from '@dcloudio/uni-i18n' import { initVueI18n } from '@dcloudio/uni-i18n'
import i18nMessages from './i18n/index.js' import i18nMessages from './i18n/index.js'
const { t } = initVueI18n(i18nMessages) const { t } = initVueI18n(i18nMessages)
/** /**
* Calendar 日历 * Calendar 日历
* @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等 * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
* @tutorial https://ext.dcloud.net.cn/plugin?id=56 * @tutorial https://ext.dcloud.net.cn/plugin?id=56
* @property {String} date 自定义当前时间,默认为今天 * @property {String} date 自定义当前时间,默认为今天
* @property {Boolean} lunar 显示农历 * @property {Boolean} lunar 显示农历
* @property {String} startDate 日期选择范围-开始日期 * @property {String} startDate 日期选择范围-开始日期
* @property {String} endDate 日期选择范围-结束日期 * @property {String} endDate 日期选择范围-结束日期
* @property {Boolean} range 范围选择 * @property {Boolean} range 范围选择
* @property {Boolean} insert = [true|false] 插入模式,默认为false * @property {Boolean} insert = [true|false] 插入模式,默认为false
* @value true 弹窗模式 * @value true 弹窗模式
* @value false 插入模式 * @value false 插入模式
* @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容 * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
* @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}] * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
* @property {Boolean} showMonth 是否选择月份为背景 * @property {Boolean} showMonth 是否选择月份为背景
* @event {Function} change 日期改变,`insert :ture` 时生效 * @event {Function} change 日期改变,`insert :ture` 时生效
* @event {Function} confirm 确认选择`insert :false` 时生效 * @event {Function} confirm 确认选择`insert :false` 时生效
* @event {Function} monthSwitch 切换月份时触发 * @event {Function} monthSwitch 切换月份时触发
* @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" /> * @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
*/ */
export default { export default {
components: { components: {
CalendarItem CalendarItem
}, },
emits: ['close', 'confirm', 'change', 'monthSwitch'], emits: ['close', 'confirm', 'change', 'monthSwitch'],
props: { props: {
date: { date: {
type: String, type: String,
default: '' default: ''
}, },
selected: { selected: {
type: Array, type: Array,
default () { default () {
return [] return []
} }
}, },
lunar: { lunar: {
type: Boolean, type: Boolean,
default: false default: false
}, },
startDate: { startDate: {
type: String, type: String,
default: '' default: ''
}, },
endDate: { endDate: {
type: String, type: String,
default: '' default: ''
}, },
range: { range: {
type: Boolean, type: Boolean,
default: false default: false
}, },
insert: { insert: {
type: Boolean, type: Boolean,
default: true default: true
}, },
showMonth: { showMonth: {
type: Boolean, type: Boolean,
default: true default: true
}, },
clearDate: { clearDate: {
type: Boolean, type: Boolean,
default: true default: true
}, },
rangeValue: { rangeValue: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {}
} }
}, },
backgroundColor: { backgroundColor: {
type: String, type: String,
default: '#fff' default: '#fff'
}, },
title: { title: {
type: String, type: String,
default: '选择日期' default: '选择日期'
}, },
hideTodayBtn: { hideTodayBtn: {
type: Boolean, type: Boolean,
default: true default: true
}, },
openBeforeChange: { openBeforeChange: {
type: Boolean, type: Boolean,
default: false default: false
}, },
showBottomBtn: { showBottomBtn: {
type: Boolean, type: Boolean,
default: false default: false
}, },
hideMask: { hideMask: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data () { data () {
return { return {
show: false, show: false,
weeks: [], weeks: [],
calendar: {}, calendar: {},
nowDate: '', nowDate: '',
aniMaskShow: false aniMaskShow: false
} }
}, },
computed: { computed: {
/** /**
* for i18n * for i18n
*/ */
okText () { okText () {
return t("uni-calender.ok") return t("uni-calender.ok")
}, },
cancelText () { cancelText () {
return t("uni-calender.cancel") return t("uni-calender.cancel")
}, },
todayText () { todayText () {
return t("uni-calender.today") return t("uni-calender.today")
}, },
monText () { monText () {
return t("uni-calender.MON") return t("uni-calender.MON")
}, },
TUEText () { TUEText () {
return t("uni-calender.TUE") return t("uni-calender.TUE")
}, },
WEDText () { WEDText () {
return t("uni-calender.WED") return t("uni-calender.WED")
}, },
THUText () { THUText () {
return t("uni-calender.THU") return t("uni-calender.THU")
}, },
FRIText () { FRIText () {
return t("uni-calender.FRI") return t("uni-calender.FRI")
}, },
SATText () { SATText () {
return t("uni-calender.SAT") return t("uni-calender.SAT")
}, },
SUNText () { SUNText () {
return t("uni-calender.SUN") return t("uni-calender.SUN")
}, },
showNextBtn () { showNextBtn () {
let { cale, endDate, nowDate } = this, let { cale, endDate, nowDate } = this,
maxDate = cale.getDate(endDate, -1, 'month') maxDate = cale.getDate(endDate, -1, 'month')
return cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`) return !endDate ? true :cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`)
} },
}, showPreBtn () {
watch: { let { cale, startDate, nowDate } = this,
date (newVal) { minDate = cale.getDate(startDate, -1, 'month')
this.init(newVal) return !startDate ? true : cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${minDate.year}/${minDate.month}`)
}, }
startDate (val) { },
this.cale.resetSatrtDate(val) watch: {
this.cale.setDate(this.nowDate.fullDate) date (newVal) {
this.weeks = this.cale.weeks this.init(newVal)
}, },
endDate (val) { startDate (val) {
this.cale.resetEndDate(val) this.cale.resetSatrtDate(val)
this.cale.setDate(this.nowDate.fullDate) this.cale.setDate(this.nowDate.fullDate)
this.weeks = this.cale.weeks this.weeks = this.cale.weeks
}, },
selected (newVal) { endDate (val) {
this.cale.setSelectInfo(this.nowDate.fullDate, newVal) this.cale.resetEndDate(val)
this.weeks = this.cale.weeks this.cale.setDate(this.nowDate.fullDate)
}, this.weeks = this.cale.weeks
nowDate: { },
handler (val) { selected (newVal) {
if (val) { this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
let { cale, endDate } = this, this.weeks = this.cale.weeks
maxDate = cale.getDate(endDate, -1, 'month') },
cale.dateCompare(`${val.year}/${val.month}`, `${maxDate.year}/${maxDate.month}`) nowDate: {
} handler (val) {
}, if (val) {
deep: true, let { cale, endDate } = this,
immediate: true maxDate = cale.getDate(endDate, -1, 'month')
} cale.dateCompare(`${val.year}/${val.month}`, `${maxDate.year}/${maxDate.month}`)
}, }
created () { },
this.cale = new Calendar({ deep: true,
selected: this.selected, immediate: true
startDate: this.startDate, }
endDate: this.endDate, },
range: this.range, created () {
}) this.cale = new Calendar({
this.init(this.date) selected: this.selected,
}, startDate: this.startDate,
methods: { endDate: this.endDate,
// 取消穿透 range: this.range,
clean () { }, })
bindDateChange (e) { this.init(this.date)
const value = e.detail.value + '-1' },
this.setDate(value) methods: {
// 取消穿透
const { year, month } = this.cale.getDate(value) clean () { },
this.$emit('monthSwitch', { bindDateChange (e) {
year, const value = e.detail.value + '-1'
month this.setDate(value)
})
}, const { year, month } = this.cale.getDate(value)
/** this.$emit('monthSwitch', {
* 初始化日期显示 year,
* @param {Object} date month
*/ })
init (date) { },
this.cale.setDate(date) /**
this.weeks = this.cale.weeks * 初始化日期显示
this.nowDate = this.calendar = this.cale.getInfo(date) * @param {Object} date
}, */
/** init (date) {
* 手动清空数据 this.cale.setDate(date)
*/ this.weeks = this.cale.weeks
cleanDate () { this.nowDate = this.calendar = this.cale.getInfo(date)
this.cale.cleanMultipleStatus() },
this.init(this.date) /**
}, * 手动清空数据
/** */
* 打开日历弹窗 cleanDate () {
*/ this.cale.cleanMultipleStatus()
open () { this.init(this.date)
// 弹窗模式并且清理数据 },
if (this.clearDate && !this.insert) { /**
this.cale.cleanMultipleStatus() * 打开日历弹窗
// this.cale.setDate(this.date) */
this.init(this.date) open () {
} // 弹窗模式并且清理数据
let { rangeValue } = this if (this.clearDate && !this.insert) {
if (Object.keys(rangeValue).length) { this.cale.cleanMultipleStatus()
uni.showLoading({ // this.cale.setDate(this.date)
mask: true this.init(this.date)
}) }
let before = { let { rangeValue } = this
fullDate: rangeValue.before if (Object.keys(rangeValue).length) {
}, uni.showLoading({
after = { mask: true
fullDate: rangeValue.after })
} let before = {
this.choiceDate(before) fullDate: rangeValue.before
setTimeout(() => { },
uni.hideLoading() after = {
this.choiceDate(after) fullDate: rangeValue.after
}, 100) }
} this.choiceDate(before)
this.show = true setTimeout(() => {
this.$nextTick(() => { uni.hideLoading()
setTimeout(() => { this.choiceDate(after)
this.aniMaskShow = true }, 100)
}, 50) }
}) this.show = true
}, this.$nextTick(() => {
/** setTimeout(() => {
* 关闭日历弹窗 this.aniMaskShow = true
*/ }, 50)
close () { })
this.aniMaskShow = false },
this.$nextTick(() => { /**
setTimeout(() => { * 关闭日历弹窗
this.show = false */
this.$emit('close') close () {
}, 300) this.aniMaskShow = false
}) this.$nextTick(() => {
}, setTimeout(() => {
/** this.show = false
* 确认按钮 this.$emit('close')
*/ }, 300)
confirm () { })
this.setEmit('confirm') },
this.close() /**
}, * 确认按钮
/** */
* 变化触发 confirm () {
*/ this.setEmit('confirm')
change () { this.close()
if (!this.insert) return },
this.setEmit('change') /**
}, * 变化触发
/** */
* 选择月份触发 change () {
*/ if (!this.insert) return
monthSwitch () { this.setEmit('change')
let { },
year, /**
month * 选择月份触发
} = this.nowDate */
this.$emit('monthSwitch', { monthSwitch () {
year, let {
month: Number(month) year,
}) month
}, } = this.nowDate
/** this.$emit('monthSwitch', {
* 派发事件 year,
* @param {Object} name month: Number(month)
*/ })
setEmit (name) { },
let { /**
year, * 派发事件
month, * @param {Object} name
date, */
fullDate, setEmit (name) {
lunar, let {
extraInfo year,
} = this.calendar month,
this.$emit(name, { date,
range: this.cale.multipleStatus, fullDate,
year, lunar,
month, extraInfo
date, } = this.calendar
fulldate: fullDate, this.$emit(name, {
lunar, range: this.cale.multipleStatus,
extraInfo: extraInfo || {} year,
}) month,
}, date,
/** fulldate: fullDate,
* 选择天触发 lunar,
* @param {Object} weeks extraInfo: extraInfo || {}
*/ })
choiceDate (weeks) { },
if (weeks.disable) return /**
if (this.openBeforeChange) { * 选择天触发
// return this.setEmit('beforeChange', weeks) * @param {Object} weeks
return this.$emit('beforeChange', weeks) */
} choiceDate (weeks) {
this.calendar = weeks if (weeks.disable) return
// 设置多选 if (this.openBeforeChange) {
this.cale.setMultiple(this.calendar.fullDate) // return this.setEmit('beforeChange', weeks)
this.weeks = this.cale.weeks return this.$emit('beforeChange', weeks)
this.change() }
}, this.calendar = weeks
/**手动触发选择天 */ // 设置多选
manualChangeDate (weeks) { this.cale.setMultiple(this.calendar.fullDate)
this.calendar = weeks this.weeks = this.cale.weeks
this.cale.setMultiple(this.calendar.fullDate) this.change()
this.weeks = this.cale.weeks },
this.change() /**手动触发选择天 */
}, manualChangeDate (weeks) {
this.calendar = weeks
/** this.cale.setMultiple(this.calendar.fullDate)
* 回到今天 this.weeks = this.cale.weeks
*/ this.change()
backToday () { },
const nowYearMonth = `${this.nowDate.year}-${this.nowDate.month}`
const date = this.cale.getDate(new Date()) /**
const todayYearMonth = `${date.year}-${date.month}` * 回到今天
*/
this.init(date.fullDate) backToday () {
const nowYearMonth = `${this.nowDate.year}-${this.nowDate.month}`
if (nowYearMonth !== todayYearMonth) { const date = this.cale.getDate(new Date())
this.monthSwitch() const todayYearMonth = `${date.year}-${date.month}`
}
this.init(date.fullDate)
this.change()
}, if (nowYearMonth !== todayYearMonth) {
/** this.monthSwitch()
* 上个月 }
*/
pre () { this.change()
const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate },
this.setDate(preDate) /**
this.monthSwitch() * 上个月
*/
}, pre () {
/** const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
* 下个月 this.setDate(preDate)
*/ this.monthSwitch()
next () {
let { showNextBtn } = this },
if (!showNextBtn) return /**
const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate * 下个月
this.setDate(nextDate) */
this.monthSwitch() next () {
}, let { showNextBtn } = this
/** if (!showNextBtn) return
* 设置日期 const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
* @param {Object} date this.setDate(nextDate)
*/ this.monthSwitch()
setDate (date) { },
this.cale.setDate(date) /**
this.weeks = this.cale.weeks * 设置日期
this.nowDate = this.cale.getInfo(date) * @param {Object} date
} */
} setDate (date) {
} this.cale.setDate(date)
</script> this.weeks = this.cale.weeks
this.nowDate = this.cale.getInfo(date)
<style lang="scss" scoped> }
$uni-bg-color-mask: rgba( }
$color: #000000, }
$alpha: 0.4 </script>
);
$uni-border-color: #ededed; <style lang="scss" scoped>
$uni-text-color: #333; $uni-bg-color-mask: rgba(
$uni-bg-color-hover: #f1f1f1; $color: #000000,
$uni-font-size-base: 14px; $alpha: 0.4
$uni-text-color-placeholder: #808080; );
$uni-color-subtitle: #555555; $uni-border-color: #ededed;
$uni-text-color-grey: #999; $uni-text-color: #333;
.uni-calendar { $uni-bg-color-hover: #f1f1f1;
/* #ifndef APP-NVUE */ $uni-font-size-base: 14px;
display: flex; $uni-text-color-placeholder: #808080;
/* #endif */ $uni-color-subtitle: #555555;
flex-direction: column; $uni-text-color-grey: #999;
} .uni-calendar {
/* #ifndef APP-NVUE */
.uni-calendar__mask { display: flex;
position: fixed; /* #endif */
bottom: 0; flex-direction: column;
top: 0; }
left: 0;
right: 0; .uni-calendar__mask {
background-color: $uni-bg-color-mask; position: fixed;
transition-property: opacity; bottom: 0;
transition-duration: 0.3s; top: 0;
opacity: 0; left: 0;
/* #ifndef APP-NVUE */ right: 0;
z-index: 99; background-color: $uni-bg-color-mask;
/* #endif */ transition-property: opacity;
} transition-duration: 0.3s;
opacity: 0;
.uni-calendar--mask-show { /* #ifndef APP-NVUE */
opacity: 1; z-index: 99;
} /* #endif */
.uni-calendar--mask-bg-hide { }
opacity: 0;
} .uni-calendar--mask-show {
.uni-calendar--fixed { opacity: 1;
position: fixed; }
/* #ifdef APP-NVUE */ .uni-calendar--mask-bg-hide {
bottom: 0; opacity: 0;
/* #endif */ }
left: 0; .uni-calendar--fixed {
right: 0; position: fixed;
transition-property: transform; /* #ifdef APP-NVUE */
transition-duration: 0.3s; bottom: 0;
transform: translateY(460px); /* #endif */
/* #ifndef APP-NVUE */ left: 0;
bottom: calc(var(--window-bottom)); right: 0;
z-index: 99; transition-property: transform;
/* #endif */ transition-duration: 0.3s;
border-radius: toRpx(32) toRpx(32) 0 0; transform: translateY(460px);
} /* #ifndef APP-NVUE */
bottom: calc(var(--window-bottom));
.uni-calendar--ani-show { z-index: 99;
transform: translateY(0); /* #endif */
} border-radius: toRpx(32) toRpx(32) 0 0;
}
.uni-calendar__content {
background-color: #fff; .uni-calendar--ani-show {
} transform: translateY(0);
}
.uni-calendar__header {
position: relative; .uni-calendar__content {
/* #ifndef APP-NVUE */ background-color: #fff;
display: flex; }
/* #endif */
flex-direction: row; .uni-calendar__header {
justify-content: center; position: relative;
align-items: center; /* #ifndef APP-NVUE */
height: 50px; display: flex;
// border-bottom-color: $uni-border-color; /* #endif */
// border-bottom-style: solid; flex-direction: row;
// border-bottom-width: 1px; justify-content: center;
} align-items: center;
height: 50px;
.uni-calendar--fixed-top { // border-bottom-color: $uni-border-color;
/* #ifndef APP-NVUE */ // border-bottom-style: solid;
display: flex; // border-bottom-width: 1px;
/* #endif */ }
flex-direction: row;
justify-content: space-between; .uni-calendar--fixed-top {
// border-top-color: $uni-border-color; /* #ifndef APP-NVUE */
// border-top-style: solid; display: flex;
// border-top-width: 1px; /* #endif */
} flex-direction: row;
justify-content: space-between;
.uni-calendar--fixed-width { // border-top-color: $uni-border-color;
width: 50px; // border-top-style: solid;
} // border-top-width: 1px;
}
.uni-calendar__backtoday {
position: absolute; .uni-calendar--fixed-width {
right: 0; width: 50px;
top: toRpx(25); }
padding: 0 5px;
padding-left: 10px; .uni-calendar__backtoday {
height: 25px; position: absolute;
line-height: 25px; right: 0;
font-size: 12px; top: toRpx(25);
border-top-left-radius: 25px; padding: 0 5px;
border-bottom-left-radius: 25px; padding-left: 10px;
color: $uni-text-color; height: 25px;
background-color: $uni-bg-color-hover; line-height: 25px;
} font-size: 12px;
border-top-left-radius: 25px;
.uni-calendar__header-text { border-bottom-left-radius: 25px;
text-align: center; color: $uni-text-color;
width: 100px; background-color: $uni-bg-color-hover;
font-size: $uni-font-size-base; }
color: $uni-text-color;
} .uni-calendar__header-text {
text-align: center;
.uni-calendar__header-btn-box { width: 100px;
/* #ifndef APP-NVUE */ font-size: $uni-font-size-base;
display: flex; color: $uni-text-color;
/* #endif */ }
flex-direction: row;
align-items: center; .uni-calendar__header-btn-box {
justify-content: center; /* #ifndef APP-NVUE */
width: 50px; display: flex;
height: 50px; /* #endif */
} flex-direction: row;
.next-btn { align-items: center;
opacity: 0; justify-content: center;
} width: 50px;
.show-next-btn { height: 50px;
opacity: 1; }
} .next-btn ,.prev-btn{
.uni-calendar__header-btn { opacity: 0;
width: 10px; }
height: 10px; .show-next-btn ,.show-prev-btn{
border-left-color: $uni-text-color-placeholder; opacity: 1;
border-left-style: solid; }
border-left-width: 2px; .uni-calendar__header-btn {
border-top-color: $uni-color-subtitle; width: 10px;
border-top-style: solid; height: 10px;
border-top-width: 2px; border-left-color: $uni-text-color-placeholder;
} border-left-style: solid;
border-left-width: 2px;
.uni-calendar--left { border-top-color: $uni-color-subtitle;
transform: rotate(-45deg); border-top-style: solid;
} border-top-width: 2px;
}
.uni-calendar--right {
transform: rotate(135deg); .uni-calendar--left {
} transform: rotate(-45deg);
}
.uni-calendar__weeks {
position: relative; .uni-calendar--right {
/* #ifndef APP-NVUE */ transform: rotate(135deg);
display: flex; }
/* #endif */
flex-direction: row; .uni-calendar__weeks {
} position: relative;
/* #ifndef APP-NVUE */
.uni-calendar__weeks-item { display: flex;
flex: 1; /* #endif */
} flex-direction: row;
}
.uni-calendar__weeks-day {
flex: 1; .uni-calendar__weeks-item {
/* #ifndef APP-NVUE */ flex: 1;
display: flex; }
/* #endif */
flex-direction: column; .uni-calendar__weeks-day {
justify-content: center; flex: 1;
align-items: center; /* #ifndef APP-NVUE */
height: 45px; display: flex;
border-bottom-color: #f5f5f5; /* #endif */
border-bottom-style: solid; flex-direction: column;
border-bottom-width: 1px; justify-content: center;
} align-items: center;
height: 45px;
.uni-calendar__weeks-day-text { border-bottom-color: #f5f5f5;
font-size: 14px; border-bottom-style: solid;
} border-bottom-width: 1px;
}
.uni-calendar__box {
position: relative; .uni-calendar__weeks-day-text {
} font-size: 14px;
}
.uni-calendar__box-bg {
/* #ifndef APP-NVUE */ .uni-calendar__box {
display: flex; position: relative;
/* #endif */ }
justify-content: center;
align-items: center; .uni-calendar__box-bg {
position: absolute; /* #ifndef APP-NVUE */
top: 0; display: flex;
left: 0; /* #endif */
right: 0; justify-content: center;
bottom: 0; align-items: center;
} position: absolute;
top: 0;
.uni-calendar__box-bg-text { left: 0;
font-size: 200px; right: 0;
font-weight: bold; bottom: 0;
color: $uni-text-color-grey; }
opacity: 0.1;
text-align: center; .uni-calendar__box-bg-text {
/* #ifndef APP-NVUE */ font-size: 200px;
line-height: 1; font-weight: bold;
/* #endif */ color: $uni-text-color-grey;
} opacity: 0.1;
.header-title-center { text-align: center;
margin: 0 auto; /* #ifndef APP-NVUE */
} line-height: 1;
.uni-calendar__footer_btns { /* #endif */
height: toRpx(176); }
display: flex; .header-title-center {
justify-content: center; margin: 0 auto;
align-items: center; }
gap: toRpx(32); .uni-calendar__footer_btns {
.uni-calendar__footer_btn { height: toRpx(176);
width: toRpx(720); display: flex;
height: toRpx(80); justify-content: center;
border-radius: toRpx(64); align-items: center;
background: #f0f1f5; gap: toRpx(32);
display: flex; .uni-calendar__footer_btn {
align-items: center; width: toRpx(720);
justify-content: center; height: toRpx(80);
color: #333333; border-radius: toRpx(64);
font-size: toRpx(32); background: #f0f1f5;
font-weight: 500; display: flex;
} align-items: center;
.uni-calendar__footer_btn-primary { justify-content: center;
color: #fff; color: #333333;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); font-size: toRpx(32);
} font-weight: 500;
} }
.popup-close { .uni-calendar__footer_btn-primary {
padding: 0 toRpx(48); color: #fff;
position: absolute; background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
right: 0; }
top: 0; }
height: 100%; .popup-close {
display: flex; padding: 0 toRpx(48);
align-items: center; position: absolute;
} right: 0;
</style> top: 0;
height: 100%;
display: flex;
align-items: center;
}
</style>
// 车牌号省市代码映射表
const licenseData = {
京: { name: '北京', cities: { A: '城区', B: '出租车', C: '城区', E: '城区', F: '城区', G: '远郊区', H: '远郊区', J: '远郊区', K: '城区', L: '城区', M: '城区', N: '城区', P: '城区', Q: '城区' } },
津: { name: '天津', cities: { A: '公交/公安', B: '城区', C: '城区', D: '城区', E: '出租车', F: '城区', G: '城区', H: '城区' } },
沪: { name: '上海', cities: { A: '市区', B: '市区', C: '郊区', D: '市区', E: '市区', F: '市区', G: '市区', H: '市区', J: '市区', K: '市区', L: '市区', M: '市区', N: '市区', R: '崇明/长兴/横沙' } },
渝: { name: '重庆', cities: { A: '市区', B: '万州', C: '永川', D: '市区', F: '涪陵', G: '黔江', H: '武隆' } },
冀: { name: '河北', cities: { A: '石家庄', B: '唐山', C: '秦皇岛', D: '邯郸', E: '邢台', F: '保定', G: '张家口', H: '承德', J: '沧州', R: '廊坊', T: '衡水' } },
豫: { name: '河南', cities: { A: '郑州', B: '开封', C: '洛阳', D: '平顶山', E: '安阳', F: '鹤壁', G: '新乡', H: '焦作', J: '濮阳', K: '许昌', L: '漯河', M: '三门峡', N: '商丘', P: '周口', Q: '驻马店', R: '南阳', S: '信阳', U: '济源' } },
云: { name: '云南', cities: { A: '昆明', C: '昭通', D: '曲靖', E: '楚雄', F: '玉溪', G: '红河', H: '文山', J: '普洱', K: '西双版纳', L: '大理', M: '保山', N: '德宏', P: '丽江', Q: '怒江', R: '迪庆', S: '临沧' } },
辽: { name: '辽宁', cities: { A: '沈阳', B: '大连', C: '鞍山', D: '抚顺', E: '本溪', F: '丹东', G: '锦州', H: '营口', J: '阜新', K: '辽阳', L: '盘锦', M: '铁岭', N: '朝阳', P: '葫芦岛' } },
黑: { name: '黑龙江', cities: { A: '哈尔滨', B: '齐齐哈尔', C: '牡丹江', D: '佳木斯', E: '大庆', F: '伊春', G: '鸡西', H: '鹤岗', J: '双鸭山', K: '七台河', L: '松原', M: '绥化', N: '黑河', P: '大兴安岭' } },
湘: { name: '湖南', cities: { A: '长沙', B: '株洲', C: '湘潭', D: '衡阳', E: '邵阳', F: '岳阳', G: '张家界', H: '益阳', J: '常德', K: '娄底', L: '郴州', M: '永州', N: '怀化', U: '湘西' } },
皖: { name: '安徽', cities: { A: '合肥', B: '芜湖', C: '蚌埠', D: '淮南', E: '马鞍山', F: '淮北', G: '铜陵', H: '安庆', J: '黄山', K: '阜阳', L: '宿州', M: '滁州', N: '六安', P: '宣城', Q: '池州', R: '亳州' } },
鲁: { name: '山东', cities: { A: '济南', B: '青岛', C: '淄博', D: '枣庄', E: '东营', F: '烟台', G: '潍坊', H: '济宁', J: '泰安', K: '威海', L: '日照', M: '滨州', N: '德州', P: '聊城', Q: '临沂', R: '菏泽', S: '莱芜', U: '青岛增补', V: '潍坊增补' } },
新: { name: '新疆', cities: { A: '乌鲁木齐', B: '昌吉', C: '石河子', D: '奎屯', E: '博尔塔拉', F: '伊犁', G: '塔城', H: '阿勒泰', J: '克拉玛依', K: '吐鲁番', L: '哈密', M: '巴音郭楞', N: '阿克苏', P: '克孜勒苏', Q: '喀什', R: '和田' } },
苏: { name: '江苏', cities: { A: '南京', B: '无锡', C: '徐州', D: '常州', E: '苏州', F: '南通', G: '连云港', H: '淮安', J: '盐城', K: '扬州', L: '镇江', M: '泰州', N: '宿迁', U: '苏州增补' } },
浙: { name: '浙江', cities: { A: '杭州', B: '宁波', C: '温州', D: '绍兴', E: '湖州', F: '嘉兴', G: '金华', H: '衢州', J: '台州', K: '丽水', L: '舟山' } },
赣: { name: '江西', cities: { A: '南昌', B: '赣州', C: '宜春', D: '吉安', E: '上饶', F: '抚州', G: '九江', H: '景德镇', J: '萍乡', K: '新余', L: '鹰潭' } },
鄂: { name: '湖北', cities: { A: '武汉', B: '黄石', C: '十堰', D: '荆州', E: '宜昌', F: '襄阳', G: '鄂州', H: '荆门', J: '黄冈', K: '孝感', L: '咸宁', M: '仙桃', N: '潜江', P: '神农架', Q: '天门', R: '恩施' } },
桂: { name: '广西', cities: { A: '南宁', B: '柳州', C: '桂林', D: '梧州', E: '北海', F: '崇左', G: '来宾', H: '桂林', J: '贺州', K: '玉林', L: '百色', M: '河池', N: '钦州', P: '防城港', R: '贵港' } },
甘: { name: '甘肃', cities: { A: '兰州', B: '嘉峪关', C: '金昌', D: '白银', E: '天水', F: '酒泉', G: '张掖', H: '平凉', J: '庆阳', K: '定西', L: '陇南', M: '临夏', N: '甘南' } },
晋: { name: '山西', cities: { A: '太原', B: '大同', C: '阳泉', D: '长治', E: '晋城', F: '朔州', H: '忻州', J: '吕梁', K: '晋中', L: '临汾', M: '运城' } },
蒙: { name: '内蒙古', cities: { A: '呼和浩特', B: '包头', C: '乌海', D: '赤峰', E: '呼伦贝尔', F: '兴安盟', G: '通辽', H: '锡林郭勒', J: '乌兰察布', K: '鄂尔多斯', L: '巴彦淖尔', M: '阿拉善' } },
陕: { name: '陕西', cities: { A: '西安', B: '铜川', C: '宝鸡', D: '咸阳', E: '渭南', F: '汉中', G: '安康', H: '商洛', J: '延安', K: '榆林', V: '杨凌' } },
吉: { name: '吉林', cities: { A: '长春', B: '吉林', C: '四平', D: '辽源', E: '通化', F: '白山', G: '白城', H: '延边', J: '松原' } },
闽: { name: '福建', cities: { A: '福州', B: '厦门', C: '宁德', D: '莆田', E: '泉州', F: '漳州', G: '龙岩', H: '三明', J: '南平' } },
贵: { name: '贵州', cities: { A: '贵阳', B: '六盘水', C: '遵义', D: '安顺', E: '铜仁', F: '毕节', G: '黔西南', H: '黔东南', J: '黔南' } },
粤: { name: '广东', cities: { A: '广州', B: '深圳', C: '珠海', D: '汕头', E: '佛山', F: '韶关', G: '湛江', H: '肇庆', J: '江门', K: '茂名', L: '惠州', M: '梅州', N: '汕尾', P: '河源', Q: '阳江', R: '清远', S: '东莞', T: '中山', U: '潮州', V: '揭阳', W: '云浮', X: '顺德', Y: '南海', Z: '港澳' } },
青: { name: '青海', cities: { A: '西宁', B: '海东', C: '海北', D: '黄南', E: '海南州', F: '果洛', G: '玉树', H: '海西' } },
藏: { name: '西藏', cities: { A: '拉萨', B: '昌都', C: '山南', D: '日喀则', E: '那曲', F: '阿里', G: '林芝' } },
川: { name: '四川', cities: { A: '成都', B: '绵阳', C: '自贡', D: '攀枝花', E: '泸州', F: '德阳', G: '成都增补', H: '广元', J: '遂宁', K: '内江', L: '乐山', M: '资阳', Q: '宜宾', R: '南充', S: '达州', T: '雅安', U: '阿坝', V: '甘孜', W: '凉山', X: '广安', Y: '巴中', Z: '眉山' } },
宁: { name: '宁夏', cities: { A: '银川', B: '石嘴山', C: '吴忠', D: '固原', E: '中卫' } },
琼: { name: '海南', cities: { A: '海口', B: '三亚', C: '三沙', D: '五指山', E: '洋浦', F: '儋州' } }
}
/**
* 解析车牌省市
* @param {string} plateStr - 车牌号 (如: "粤B12345")
* @returns {object} { province, city, success }
*/
export function getPlateLocation(plateStr) {
// 基础校验
if (!plateStr || typeof plateStr !== 'string' || plateStr.length < 2) {
return { province: '', city: '', success: false }
}
const pChar = plateStr.charAt(0) // 提取省份简称:粤
const cChar = plateStr.charAt(1).toUpperCase() // 提取地市代码:B
const provinceInfo = licenseData[pChar]
if (provinceInfo) {
const cityName = provinceInfo.cities[cChar]
if (cityName) {
// 处理省份名称,添加"省"或"市"后缀
let province = provinceInfo.name
// 直辖市不需要加"省",只需要加"市"
const municipalities = ['北京', '上海', '天津', '重庆']
if (municipalities.includes(province)) {
province = province + '市'
} else if (province === '内蒙古') {
province = province + '自治区'
} else if (province === '新疆' || province === '西藏' || province === '广西' || province === '宁夏') {
// 其他自治区,根据习惯可能需要加"自治区"或"省",这里统一加"省"
province = province + '省'
} else {
province = province + '省'
}
// 处理城市名称,添加"市"后缀(如果还没有)
let city = cityName
// 特殊情况:不需要加"市"的情况
// 1. 已经以"市"结尾
// 2. 包含特殊关键词:城区、市区、郊区、出租车、公交、增补
// 3. 包含斜杠(如:崇明/长兴/横沙)
const specialKeywords = ['城区', '市区', '郊区', '出租车', '公交', '增补']
const isSpecialCase = specialKeywords.some(keyword => city.includes(keyword)) || city.includes('/')
// 普通城市名称添加"市"后缀
if (!city.endsWith('市') && !isSpecialCase) {
city = city + '市'
}
return {
province: province,
city: city,
success: true
}
}
}
return { province: '', city: '', success: false }
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!