fhrons-mobile-next 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.poc +8 -0
- package/assets/css/colors.js +6 -0
- package/assets/css/customVant.less +60 -0
- package/assets/css/extra.css +32 -0
- package/assets/css/global.css +1 -0
- package/assets/css/global.less +1637 -0
- package/assets/css/index.js +63 -0
- package/assets/css/static.less +607 -0
- package/assets/js/func.js +361 -0
- package/assets/js/globalData.js +18 -0
- package/assets/js/qywxapi.js +484 -0
- package/{packages → assets/js}/storage.js +1 -20
- package/assets/js/upload.js +269 -0
- package/assets/js/validate.js +48 -0
- package/assets/js/vant.js +39 -0
- package/assets/js/wxapi.js +297 -0
- package/assets/vantLang/index.js +172 -0
- package/assets/vantLang/lib/en-US.js +95 -0
- package/assets/vantLang/lib/es-ES.js +95 -0
- package/assets/vantLang/lib/pt-PT.js +96 -0
- package/assets/vantLang/lib/zh-CN.js +96 -0
- package/assets/vantLang/lib/zh-HK.js +96 -0
- package/assets/vantLang/locales/en_US.js +102 -0
- package/assets/vantLang/locales/es_ES.js +102 -0
- package/assets/vantLang/locales/index.js +12 -0
- package/assets/vantLang/locales/pt_PT.js +102 -0
- package/assets/vantLang/locales/zh_CN.js +102 -0
- package/assets/vantLang/locales/zh_T.js +102 -0
- package/babel.config.js +15 -0
- package/index.js +68 -33
- package/inject-env-plugin.js +29 -0
- package/package.json +46 -32
- package/packages/areaMobile/index.js +5 -0
- package/packages/areaMobile/index.vue +260 -0
- package/packages/autoGraph/VueEsign.vue +309 -0
- package/packages/autoGraph/index.js +5 -0
- package/packages/autoGraph/index.vue +472 -0
- package/packages/commonForm/CommonAsyncAreaPicker.vue +223 -0
- package/packages/commonForm/CommonDatePicker.vue +152 -0
- package/packages/commonForm/CommonForm.vue +786 -0
- package/packages/commonForm/CommonFullTimePicker.vue +137 -0
- package/packages/commonForm/CommonSinglePicker.vue +121 -0
- package/packages/commonForm/CommonYearMonthPicker.vue +127 -0
- package/packages/commonForm/index.js +33 -0
- package/packages/dialog/index.js +32 -0
- package/packages/dialog/index.vue +379 -0
- package/packages/index.js +7 -3
- package/packages/introduce/index.js +5 -0
- package/packages/introduce/index.vue +31 -0
- package/packages/loading/Loading.vue +70 -0
- package/packages/loading/index.js +43 -0
- package/packages/mindMap/index.js +5 -0
- package/packages/mindMap/index.vue +437 -0
- package/packages/pdfViewer/index.js +12 -0
- package/packages/pdfViewer/index.vue +131 -0
- package/packages/sharePanel/SheetPanel.vue +316 -0
- package/packages/sharePanel/index.js +5 -0
- package/packages/sharePanel/index.vue +476 -0
- package/packages/sharePanel/props.js +58 -0
- package/packages/sharePanel/utils/QyWxShareMixin.js +93 -0
- package/packages/sharePanel/utils/shareWay.js +81 -0
- package/packages/theme/index copy.js +89 -0
- package/packages/theme/index.js +38 -0
- package/packages/theme/theme.css +910 -0
- package/packages/theme/theme.less +26 -0
- package/packages/uploadFile/VanUploadFile.vue +80 -0
- package/packages/uploadFile/index.js +5 -0
- package/packages/uploadFile/index.vue +725 -0
- package/packages/uploadFile/vanUpload.js +5 -0
- package/packages/verify/Verify/VerifyPoints.vue +247 -0
- package/packages/verify/Verify/VerifySlide.vue +364 -0
- package/packages/verify/index.js +5 -0
- package/packages/verify/index.vue +416 -0
- package/packages/verify/utils/verify.js +53 -0
- package/packages/videoPage/index.js +5 -0
- package/packages/videoPage/index.vue +440 -0
- package/plugins/sensors/fhsensors.js +84 -0
- package/plugins/sensors/sensors.js +175 -0
- package/plugins/sensors/sensorsFun.js +1387 -0
- package/fhrons-mobile-next-2.0.0.tgz +0 -0
- package/packages/fhImage/index.js +0 -5
- package/packages/fhImage/index.vue +0 -57
- package/packages/fhPresetImage/index.js +0 -5
- package/packages/fhPresetImage/index.vue +0 -39
- package/packages/html2canvas/index.js +0 -29
- package/upload copy.js +0 -468
- package/utils/tools.js +0 -22
- /package/{dist → fhcommon/dist}/fhcommon.min.js +0 -0
- /package/{dist → fhcommon/dist}/fhcommon.min.js.LICENSE.txt +0 -0
- /package/{upload.js → fhcommon/upload.js} +0 -0
package/index.js
CHANGED
|
@@ -1,33 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
/* Automatically generated by './build/bin/build-entry.js' */
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import duration from 'dayjs/plugin/duration';
|
|
4
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
5
|
+
import isBetween from 'dayjs/plugin/isBetween';
|
|
6
|
+
dayjs.extend(duration);
|
|
7
|
+
dayjs.extend(relativeTime);
|
|
8
|
+
dayjs.extend(isBetween);
|
|
9
|
+
|
|
10
|
+
import loadGlobalData from './assets/js/globalData'
|
|
11
|
+
// import FHCommon from './fhcommon';
|
|
12
|
+
// console.log(FHCommon,'===========')
|
|
13
|
+
import './fhcommon/dist/fhcommon.min.js'
|
|
14
|
+
export const Introduce = require('./packages/introduce').default;
|
|
15
|
+
export const AreaMobile = require('./packages/areaMobile').default;
|
|
16
|
+
export const AutoGraph = require('./packages/autoGraph').default;
|
|
17
|
+
export const Verify = require('./packages/verify').default;
|
|
18
|
+
export const UploadFile = require('./packages/uploadFile').default;
|
|
19
|
+
export const VanUploadFile = require('./packages/uploadFile/vanUpload').default;
|
|
20
|
+
export const updateTheme = require('./packages/theme').default;
|
|
21
|
+
export const SharePanel = require('./packages/sharePanel').default;
|
|
22
|
+
export const VideoPage = require('./packages/videoPage').default;
|
|
23
|
+
export const CommonForm = require('./packages/commonForm').default;
|
|
24
|
+
export const CommonDialog = require('./packages/dialog').default;
|
|
25
|
+
export const PDFViewer = require('./packages/pdfViewer').default;
|
|
26
|
+
export const { CommonAsyncAreaPicker,
|
|
27
|
+
CommonDatePicker,
|
|
28
|
+
CommonFullTimePicker,
|
|
29
|
+
CommonSinglePicker,
|
|
30
|
+
CommonYearMonthPicker } = require('./packages/commonForm')
|
|
31
|
+
const totalComponents = {
|
|
32
|
+
Introduce,
|
|
33
|
+
AreaMobile,
|
|
34
|
+
AutoGraph,
|
|
35
|
+
Verify,
|
|
36
|
+
UploadFile,
|
|
37
|
+
VanUploadFile,
|
|
38
|
+
SharePanel,
|
|
39
|
+
CommonForm,
|
|
40
|
+
VideoPage,
|
|
41
|
+
CommonAsyncAreaPicker,
|
|
42
|
+
CommonDatePicker,
|
|
43
|
+
CommonFullTimePicker,
|
|
44
|
+
CommonSinglePicker,
|
|
45
|
+
CommonYearMonthPicker,
|
|
46
|
+
PDFViewer,
|
|
47
|
+
CommonDialog
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
import './assets/css/static.less'
|
|
51
|
+
import './assets/css/extra.css'
|
|
52
|
+
import './assets/css/global.css'
|
|
53
|
+
import './packages/theme/theme.css'
|
|
54
|
+
export default {
|
|
55
|
+
install: (Vue) => {
|
|
56
|
+
loadGlobalData(Vue)
|
|
57
|
+
// Vue.use(FHCommon)
|
|
58
|
+
Vue.prototype.$dayjs = dayjs;
|
|
59
|
+
Vue.directive('preventReClick', {
|
|
60
|
+
inserted: function (el, binding) {
|
|
61
|
+
preventReClick(el, binding);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
for (const i in totalComponents) {
|
|
65
|
+
totalComponents[i].install(Vue);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
|
|
3
|
+
class InjectEnvPlugin {
|
|
4
|
+
apply(compiler) {
|
|
5
|
+
compiler.hooks.emit.tapAsync('InjectEnvPlugin', (compilation, callback) => {
|
|
6
|
+
const temp = {};
|
|
7
|
+
Object.keys(process.env).forEach(key => {
|
|
8
|
+
if (key.startsWith('VUE_APP'))temp[key] = process.env[key];
|
|
9
|
+
});
|
|
10
|
+
const envVars = JSON.stringify(temp);
|
|
11
|
+
|
|
12
|
+
const script = `<script>
|
|
13
|
+
window.process = { env: ${envVars} };
|
|
14
|
+
</script>`;
|
|
15
|
+
|
|
16
|
+
const indexHtml = compilation.assets['index.html'].source();
|
|
17
|
+
const newIndexHtml = indexHtml.replace('</head>', `${script}</head>`);
|
|
18
|
+
|
|
19
|
+
compilation.assets['index.html'] = {
|
|
20
|
+
source: () => newIndexHtml,
|
|
21
|
+
size: () => newIndexHtml.length
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
callback();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = InjectEnvPlugin;
|
package/package.json
CHANGED
|
@@ -1,40 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhrons-mobile-next",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "dist/fhcommon.min.js",
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@babel/core": "^7.25.8",
|
|
9
|
-
"@babel/preset-env": "^7.25.8",
|
|
10
|
-
"babel-loader": "^9.1.3",
|
|
11
|
-
"crypto-browserify": "^3.12.0",
|
|
12
|
-
"css-loader": "^6.7.4",
|
|
13
|
-
"eslint": "^9.0.0",
|
|
14
|
-
"https-browserify": "^1.0.0",
|
|
15
|
-
"less-loader": "^11.1.4",
|
|
16
|
-
"path-browserify": "^1.0.1",
|
|
17
|
-
"stream-browserify": "^3.0.0",
|
|
18
|
-
"stream-http": "^3.2.0",
|
|
19
|
-
"style-loader": "^3.3.3",
|
|
20
|
-
"terser-webpack-plugin": "^5.3.10",
|
|
21
|
-
"timers-browserify": "^2.0.12",
|
|
22
|
-
"uglify-js": "^3.17.4",
|
|
23
|
-
"vm-browserify": "^1.1.2",
|
|
24
|
-
"vue-loader": "^15.9.8",
|
|
25
|
-
"vue-template-compiler": "^2.7.16",
|
|
26
|
-
"webpack": "^5.91.0",
|
|
27
|
-
"webpack-cli": "^5.0.0",
|
|
28
|
-
"webpack-dev-server": "^5.0.4"
|
|
29
|
-
},
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "泛华榕树组件库",
|
|
5
|
+
"main": "index.js",
|
|
30
6
|
"scripts": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
7
|
+
"serve": "vue-cli-service serve --mode dev",
|
|
8
|
+
"serve.poc": "vue-cli-service serve --mode poc",
|
|
9
|
+
"serve.doc": "vuepress dev docs --temp .temp",
|
|
10
|
+
"build": "vue-cli-service build --mode dev",
|
|
11
|
+
"build.doc": "vuepress build docs",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
33
13
|
},
|
|
34
|
-
"author": "
|
|
14
|
+
"author": "",
|
|
35
15
|
"license": "ISC",
|
|
16
|
+
"peerDependencies": {},
|
|
36
17
|
"dependencies": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
18
|
+
"@antv/f6": "0.0.19",
|
|
19
|
+
"dayjs": "^1.10.4",
|
|
20
|
+
"less": "^3.0.4",
|
|
21
|
+
"less-loader": "^5.0.0",
|
|
22
|
+
"moment": "^2.30.1",
|
|
23
|
+
"vue-i18n": "8.28.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/cli": "^7.24.1",
|
|
27
|
+
"@babel/core": "^7.24.3",
|
|
28
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
29
|
+
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
30
|
+
"@babel/preset-env": "^7.24.3",
|
|
31
|
+
"@vue/cli": "^4.5.15",
|
|
32
|
+
"@vue/cli-plugin-babel": "^4.5.19",
|
|
33
|
+
"@vue/cli-service": "^4.5.15",
|
|
34
|
+
"@vuepress/plugin-active-header-links": "^1.9.10",
|
|
35
|
+
"@vuepress/plugin-back-to-top": "^1.9.10",
|
|
36
|
+
"@vuepress/plugin-nprogress": "^1.9.10",
|
|
37
|
+
"@vuepress/plugin-register-components": "^1.9.10",
|
|
38
|
+
"babel-loader": "^8.3.0",
|
|
39
|
+
"babel-plugin-import": "^1.13.8",
|
|
40
|
+
"css-loader": "^3.6.0",
|
|
41
|
+
"directory-tree": "^2.2.7",
|
|
42
|
+
"dotenv": "^16.4.5",
|
|
43
|
+
"stylus": "^0.54.8",
|
|
44
|
+
"vue-loader": "^15.11.1",
|
|
45
|
+
"vuepress": "^1.9.10",
|
|
46
|
+
"vuepress-plugin-code-copy": "^1.0.6",
|
|
47
|
+
"vuepress-plugin-container": "^2.1.4",
|
|
48
|
+
"vuepress-plugin-nprogress": "^1.1.8",
|
|
49
|
+
"vuepress-plugin-smooth-scroll": "^0.0.10",
|
|
50
|
+
"vuepress-plugin-table-of-contents": "^1.1.7",
|
|
51
|
+
"copy-to-clipboard": "^3.3.3",
|
|
52
|
+
"webpack": "^4.47.0"
|
|
39
53
|
}
|
|
40
54
|
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<!-- 功能:区号,手机号校验; 作者:ZXS; 时间:2024年03月19日 15:40:55-->
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<div id="AreaMobile" class="van-cell van-field" :class="[cellClass,errorMessage?'error-line':'']">
|
|
5
|
+
<div class="line-height30 flex-center full-width line-height24">
|
|
6
|
+
<slot name="label"/>
|
|
7
|
+
<div class="flex-center-start phone-num-widget" :class="showAreaSelect?'':'mr8'" @click="showPopup"><span> {{ areaItem.diallingCode }}</span><i v-if="showAreaSelect" class="iconfont ft10 ml5 c-9cc icon-xiajiantoumian" /></div>
|
|
8
|
+
<slot name="widget">
|
|
9
|
+
<van-field v-model="mobile" :placeholder="placeholder" :maxlength="areaItem.maxlength" :type="type" :readonly="readonly" clearable class="area-mobile flex1" :class="inputClass" :input-align="inputAlign" @blur="changeValue" @clear="errorMessage = ''"/>
|
|
10
|
+
</slot>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div v-if="errorMessage" class="ft12 c-ff5c5c mt8" :class="cellClass.includes('plr0')?'':'pl12'">{{ errorMessage }}</div>
|
|
14
|
+
<van-popup v-model="showPop" round position="bottom" :closeable="true" get-container="#app" class="over-hidden" :item-height="`${48 / 37.5}rem`" :close-icon="'https://dop-pro-1251973116.file.myqcloud.com/upload/img/funzg/icon_zhankailine.png'" :style="{ height: '50%' }">
|
|
15
|
+
<!-- 本期没有搜索功能,后续添加 -->
|
|
16
|
+
<div class="pb6">
|
|
17
|
+
<div class="pt32 pb2 ta-c line-height24 c-43e fw-500 ft16">{{ $t("componentsfile.areamobile.i5t5q5") }}</div>
|
|
18
|
+
<!-- <van-search v-model="searchKey" class="full-width" shape="round" :placeholder="$t('areamobile.index.c636e0')" @focus="handleFocus" @search="toSearch">
|
|
19
|
+
<template #left-icon><i class="iconfont icon-sousuo ft16 c-9cc pl2" /></template>
|
|
20
|
+
</van-search> -->
|
|
21
|
+
</div>
|
|
22
|
+
<div class="bgc-f5f">
|
|
23
|
+
<van-index-bar :index-list="indexList">
|
|
24
|
+
<van-index-anchor index="">{{ $t("customerdetail.baseinfo.78da4x") }}</van-index-anchor>
|
|
25
|
+
<van-cell v-for="(item, index) in cityArr" :key="index" :title="item.name" :value="item.diallingCode" @click="getValue(item)" />
|
|
26
|
+
</van-index-bar>
|
|
27
|
+
</div>
|
|
28
|
+
</van-popup>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { getStorage } from "../../assets/js/storage";
|
|
34
|
+
import { notEmpty } from "../../assets/js/func";
|
|
35
|
+
import i18n from '../../assets/vantLang'
|
|
36
|
+
export default {
|
|
37
|
+
name: "AreaMobile",
|
|
38
|
+
props: {
|
|
39
|
+
placeholder: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: function () {
|
|
42
|
+
return i18n.t("areamobile.index.66rf2i");
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
value: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "",
|
|
48
|
+
},
|
|
49
|
+
type: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "tel",
|
|
52
|
+
},
|
|
53
|
+
readonly: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
inputClass: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "",
|
|
60
|
+
},
|
|
61
|
+
inputAlign:{
|
|
62
|
+
type: String,
|
|
63
|
+
default: "left",
|
|
64
|
+
},
|
|
65
|
+
cellClass: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "",
|
|
68
|
+
},
|
|
69
|
+
diallingCode: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: '+86'
|
|
72
|
+
},
|
|
73
|
+
showLabel: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
industry: "", // 版本类型
|
|
81
|
+
mobile: "",
|
|
82
|
+
showPop: false,
|
|
83
|
+
simInfo: "", // 卡号信息
|
|
84
|
+
searchKey: "",
|
|
85
|
+
indexList: [],
|
|
86
|
+
showSelect: false,
|
|
87
|
+
errorMessage:'',
|
|
88
|
+
areaItem: {
|
|
89
|
+
diallingCode: "+86",
|
|
90
|
+
maxlength: 11,
|
|
91
|
+
},
|
|
92
|
+
cityArr:[
|
|
93
|
+
{ name: this.$t("componentsfile.areamobile.unt8c8"), diallingCode: "+86", maxlength: "11" },
|
|
94
|
+
{ name: this.$t("componentsfile.areamobile.7hs65i"), diallingCode: "+852", maxlength: "8" },
|
|
95
|
+
]
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
computed: {
|
|
99
|
+
showAreaSelect () {
|
|
100
|
+
return this.showSelect && this.showLabel
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
watch: {
|
|
104
|
+
value: {
|
|
105
|
+
handler(newVal, oldVal) {
|
|
106
|
+
this.mobile = newVal;
|
|
107
|
+
},
|
|
108
|
+
deep: true,
|
|
109
|
+
immediate: true
|
|
110
|
+
},
|
|
111
|
+
diallingCode: {
|
|
112
|
+
handler(newVal, oldVal) {
|
|
113
|
+
if (newVal && (newVal !== oldVal)) {
|
|
114
|
+
this.getDefault();
|
|
115
|
+
this.changeValue();
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
deep: true,
|
|
119
|
+
immediate: true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
created () {
|
|
123
|
+
if (this.$globalData.isApp && window.webkit && this.$globalData.isIOS) {
|
|
124
|
+
window.AppToJSGetSimInfo = this.AppToJSGetSimInfo;
|
|
125
|
+
}
|
|
126
|
+
this.getSIM();
|
|
127
|
+
this.userInfo = getStorage({ name: 'userInfo' }) || {};
|
|
128
|
+
this.industry = getStorage({ commonKey: 'industry' }) || '';
|
|
129
|
+
// zh_CN_insurer 中国大陆保司 // zh_CN_agency 中国大陆中介 // agency,zh_T_agency 中国香港中介 // insurer,zh_T_insurer 中国香港保司
|
|
130
|
+
|
|
131
|
+
// 2024.5.13-----duz:【现在不支持+852的手机号发验证码,所以验证码登录的时候不能用香港的手机号】showSelect=false
|
|
132
|
+
// 2024.10.28-----xuehao:【测试国际短信,暂时放开】
|
|
133
|
+
this.showSelect = !this.industry.includes('zh_CN');// 是否支持选区号,非大陆版租户支持选区号
|
|
134
|
+
if (this.showSelect) {
|
|
135
|
+
this.getCityArr();
|
|
136
|
+
}
|
|
137
|
+
this.getDefault();
|
|
138
|
+
},
|
|
139
|
+
mounted() {
|
|
140
|
+
this.changeValue();
|
|
141
|
+
},
|
|
142
|
+
methods: {
|
|
143
|
+
getSIM () {
|
|
144
|
+
if (window.android && this.$globalData.isAndroid && typeof window.android.jsToAppForGetSimCountryIsoInfo === 'function') {
|
|
145
|
+
const result = window.android.jsToAppForGetSimCountryIsoInfo() || {};
|
|
146
|
+
this.simInfo = JSON.parse(result);
|
|
147
|
+
} else if (window.webkit && this.$globalData.isIOS) {
|
|
148
|
+
window.webkit.messageHandlers.JSToAppGetSimInfo.postMessage('js');
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
getCityArr () {
|
|
152
|
+
axios.get(`/funapi/config/sysIddCode/getIddListDefault/1`).then(res => {
|
|
153
|
+
const tempArr = [];
|
|
154
|
+
const list = res.sysIddCodeList || [];
|
|
155
|
+
list.forEach(item => {
|
|
156
|
+
if (item.code === '86' || item.code === '852') {
|
|
157
|
+
tempArr.push({
|
|
158
|
+
name: item.name,
|
|
159
|
+
diallingCode: '+' + item.code,
|
|
160
|
+
maxlength: item.limitLen
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
if (tempArr && tempArr.length) {
|
|
165
|
+
this.cityArr = tempArr;
|
|
166
|
+
}
|
|
167
|
+
}).catch(() => { });
|
|
168
|
+
},
|
|
169
|
+
AppToJSGetSimInfo (res) {
|
|
170
|
+
this.simInfo = res;
|
|
171
|
+
},
|
|
172
|
+
getDefault() {
|
|
173
|
+
if (this.diallingCode) { // 传入的
|
|
174
|
+
this.areaItem = this.cityArr.find(item => item.diallingCode === this.diallingCode);
|
|
175
|
+
} else if (this.$globalData.isApp && notEmpty(this.simInfo)) { // app且有运营商信息
|
|
176
|
+
const simCountryIso = this.simInfo?.simCountryIso || '';// 运营商区域
|
|
177
|
+
const simOperatorName = this.simInfo?.simOperatorName || ''; // 运营商名字
|
|
178
|
+
if (simCountryIso) {
|
|
179
|
+
this.areaItem = simCountryIso === 'cn' ? this.cityArr.find(item => item.diallingCode === '+86') : this.cityArr.find(item => item.diallingCode === '+852');
|
|
180
|
+
} else if (simOperatorName) {
|
|
181
|
+
// 这里的汉字不能翻译
|
|
182
|
+
if (simOperatorName.includes('中国电信') || simOperatorName.includes('中国联通') || simOperatorName.includes('中国移动')) {
|
|
183
|
+
this.areaItem = this.cityArr.find(item => item.diallingCode === '+86');
|
|
184
|
+
} else {
|
|
185
|
+
this.areaItem = this.cityArr.find(item => item.diallingCode === '+852');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} else { // 网页、微信、公众号等按照版本信息
|
|
189
|
+
this.relyOnIndustry();
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
relyOnIndustry() {
|
|
193
|
+
if (this.showAreaSelect) {
|
|
194
|
+
this.areaItem = this.cityArr.find(item => item.diallingCode === '+852');
|
|
195
|
+
} else {
|
|
196
|
+
this.areaItem = this.cityArr.find(item => item.diallingCode === '+86');
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
showPopup () {
|
|
200
|
+
if (this.readonly) return;
|
|
201
|
+
if (this.showAreaSelect) {
|
|
202
|
+
this.showPop = true;
|
|
203
|
+
} else {
|
|
204
|
+
this.$toast(this.$t('componentsfile.areamobile.381p3e'));
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
getValue (item) {
|
|
208
|
+
if (this.areaItem !== item) {
|
|
209
|
+
this.areaItem = item;
|
|
210
|
+
this.mobile = '';
|
|
211
|
+
}
|
|
212
|
+
this.showPop = false;
|
|
213
|
+
this.$emit('getArea', item);
|
|
214
|
+
},
|
|
215
|
+
changeValue () {
|
|
216
|
+
const item = {
|
|
217
|
+
mobile: this.mobile,
|
|
218
|
+
diallingCode: this.areaItem.diallingCode
|
|
219
|
+
};
|
|
220
|
+
this.$emit('update:value', this.mobile);
|
|
221
|
+
this.$emit('getAreaMobile', item);
|
|
222
|
+
if(this.mobile){
|
|
223
|
+
if (this.isMobile(this.mobile,this.areaItem.diallingCode)) {
|
|
224
|
+
this.errorMessage = ''
|
|
225
|
+
} else {
|
|
226
|
+
this.errorMessage = '手机号格式不正确'
|
|
227
|
+
}
|
|
228
|
+
}else{
|
|
229
|
+
this.errorMessage = ''
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
handleFocus () { },
|
|
233
|
+
toSearch () { },
|
|
234
|
+
isMobile(s, code) {
|
|
235
|
+
if (code && code === '+852') { // +852香港手机号校验规则
|
|
236
|
+
return /^[0-9]\d{7}$/.test(s);
|
|
237
|
+
}
|
|
238
|
+
return /^(13|14|15|16|17|18|19)\d{9}$/.test(s);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
</script>
|
|
243
|
+
|
|
244
|
+
<style scoped lang="less">
|
|
245
|
+
#AreaMobile {
|
|
246
|
+
.area-mobile {
|
|
247
|
+
padding: 0 !important;
|
|
248
|
+
}
|
|
249
|
+
/deep/.van-field::after{
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
.line::after{
|
|
254
|
+
display: block !important;
|
|
255
|
+
background:#e8e8e8 !important;
|
|
256
|
+
}
|
|
257
|
+
.error-line::after{
|
|
258
|
+
background: #ff5c5c !important;
|
|
259
|
+
}
|
|
260
|
+
</style>
|