|
@@ -0,0 +1,333 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="zh-CN" style="font-size: 50px;">
|
|
|
+
|
|
|
+<head>
|
|
|
+ <title>完善信息</title>
|
|
|
+ <meta name="viewport"
|
|
|
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
+ <meta name="format-detection" content="telephone=yes"/>
|
|
|
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
|
+ <meta name="referrer" content="always">
|
|
|
+ <!--引入公共资源头部-->
|
|
|
+ {{include "/big-member/meta.html"}}
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="/big-member/js/rem.js"></script>
|
|
|
+ {{include "/common/weixin.html"}}
|
|
|
+
|
|
|
+ <!--S-当前页必定需要预加载的资源-->
|
|
|
+ <link rel="preload" as="style" href='//cdn.jsdelivr.net/npm/vant@2.8.2/lib/index.css'/>
|
|
|
+ <link rel="preload" as="style" href='//cdn.jsdelivr.net/npm/vant@2.8.2/lib/icon/local.css'/>
|
|
|
+ <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/weixin/css/public.css?v={{Msg "seo" "version"}}'>
|
|
|
+ <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
|
|
|
+ <!--E-当前页必定需要预加载的资源-->
|
|
|
+
|
|
|
+
|
|
|
+ <!--S-当前页面的css资源-->
|
|
|
+ <link rel="stylesheet" href='//cdn.jsdelivr.net/npm/vant@2.8.2/lib/index.css'/>
|
|
|
+ <link rel="stylesheet" href='//cdn.jsdelivr.net/npm/vant@2.8.2/lib/icon/local.css'/>
|
|
|
+ <link rel="stylesheet"
|
|
|
+ href='{{Msg "seo" "cdn"}}/common-module/perfect-info/index.css?v={{Msg "seo" "version"}}'/>
|
|
|
+ <!--E-当前页面的css资源-->
|
|
|
+ <script>
|
|
|
+ try {
|
|
|
+ window.JyObj.hiddenBottom('0')
|
|
|
+ } catch (e) {
|
|
|
+ console.log('error: app not function')
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
+
|
|
|
+<body>
|
|
|
+<div class="j-container">
|
|
|
+ {{include "/big-member/header.html"}}
|
|
|
+ <div class="j-main perfect-info-group" id="perfect-info-page" v-cloak>
|
|
|
+ <div class="j-container">
|
|
|
+ <div class="j-main info-collect">
|
|
|
+ <div class="form-card-group">
|
|
|
+ <div class="form-title">基本信息</div>
|
|
|
+ <div class="form-content-card">
|
|
|
+ <van-field v-model.trim="infoMap.name" label="姓名" @focus="infoCheckMap.name = ''" @blur="getCheckMap('name')"
|
|
|
+ :error-message="infoCheckMap.name" required placeholder="请输入姓名"></van-field>
|
|
|
+ <van-field v-model.trim="infoMap.phone" label="手机号" @focus="infoCheckMap.phone = ''"
|
|
|
+ @blur="getCheckMap('phone')" :error-message="infoCheckMap.phone" required
|
|
|
+ placeholder="常用手机号码"></van-field>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-card-group">
|
|
|
+ <div class="form-title">公司信息</div>
|
|
|
+ <div class="form-content-card">
|
|
|
+ <div class="associate-ent-group" v-show="isAssociateShow">
|
|
|
+ <div class="associate-ent-item" @click="selectEnt(item)" v-for="(item, i) in searchList" v-bind:key="i" v-html="highlightText(item, infoMap.company)"></div>
|
|
|
+ </div>
|
|
|
+ <van-field @input="entOnChange('input')" @blur="entOnChange('blur')" @focus="infoCheckMap.company = ''"
|
|
|
+ :error-message="infoCheckMap.company" v-model.trim="infoMap.company" label="公司名称" placeholder="请输入公司名称"></van-field>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-footer">
|
|
|
+ <div class="j-button-group">
|
|
|
+ <button class="j-button-cancel" @click="cancelForm">暂不提供</button>
|
|
|
+ <button class="j-button-confirm" :disabled="isSubmitDisabled" @click="submitForm">提交</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-popup v-model="commitshow" class="commitdialog" :close-on-click-overlay="overlayShow" style="height: 5.6rem;">
|
|
|
+ <div class="j-container">
|
|
|
+ <div class="j-main com-main" style="padding: .48rem .56rem;">
|
|
|
+ <div class="img-duihao">
|
|
|
+ <img src="/structuredata/mobile/image/choose.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="commit_success">提交成功</div>
|
|
|
+ <div class="commit_tip" style="text-align: left;">我们的客户经理会在24小时内尽快与您联系。</div>
|
|
|
+ <div class="commit_know">
|
|
|
+ <button class="commit_btn" @click="history.back()">我知道了</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<script rel="preload" as="script" src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
|
|
|
+<script rel="preload" as="script" src=//cdn-common.jianyu360.com/cdn/lib/vant/2.8.2/vant.min.js></script>
|
|
|
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
|
|
|
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.8.2/vant.min.js></script>
|
|
|
+<script src='{{Msg "seo" "cdn"}}/common-module/mainSearch/js/utils.js'></script>
|
|
|
+{{include "/big-member/commonjs.html"}}
|
|
|
+
|
|
|
+<script>
|
|
|
+ var vNode = {
|
|
|
+ delimiters: ['@@', '@@'],
|
|
|
+ el: '#perfect-info-page',
|
|
|
+ data: {
|
|
|
+ commitshow: false, // 提交成功显示弹窗
|
|
|
+ overlayShow: false,
|
|
|
+ searchList: [],
|
|
|
+ isAssociateShow: false,
|
|
|
+ isAssociateUpTime: -1,
|
|
|
+ infoMap: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ company: '',
|
|
|
+ },
|
|
|
+ infoCheckMap: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ company: '',
|
|
|
+ },
|
|
|
+ isEchoInfoLoading: true,
|
|
|
+ ajaxParams: {
|
|
|
+ "name": "",
|
|
|
+ "phone": "",
|
|
|
+ "source": utils.getParam('source'), // 推送消息点进来的
|
|
|
+ "company": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // source=message_bigmember app消息大会员留资地
|
|
|
+ // source=message_structeddata app消息结构化数据留资地
|
|
|
+ this.ajaxGetEchoInfo()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ checkName () {
|
|
|
+ if (this.infoMap.name.length > 10) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ var namereg = /^[\u4E00-\u9FA5A-Za-z\s]+(·[\u4E00-\u9FA5A-Za-z]+)*$/;//中英文或加.的少数民族名字
|
|
|
+ return namereg.test(this.infoMap.name)
|
|
|
+ },
|
|
|
+ checkPhone () {
|
|
|
+ return /^1[3|7|8]\d{9}$|^19[8-9]\d{8}$|^166\d{8}|^15[0-3|5-9]\d{8}|^14[5|7]\d{8}$/.test(this.infoMap.phone)
|
|
|
+ },
|
|
|
+ checkEntName () {
|
|
|
+ if (this.infoMap.company.trim().length > 50 || this.infoMap.company.trim().length < 2) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ isSubmitDisabled () {
|
|
|
+ return !this.checkName || !this.checkPhone
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ajaxFn: function (url, data, callback, type) {
|
|
|
+ return $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: url,
|
|
|
+ contentType: type ? 'application/x-www-form-urlencoded' : "application/json;charset=utf-8",
|
|
|
+ data: type ? data : JSON.stringify(data),
|
|
|
+ dataType: "json",
|
|
|
+ success: typeof callback === 'function' ? callback.bind(this) : new Function()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxGetEchoInfo() {
|
|
|
+ this.isEchoInfoLoading = true
|
|
|
+ let _this = this
|
|
|
+ this.ajaxFn('/salesLeads/echoInfo', {}, function (r) {
|
|
|
+ this.isEchoInfoLoading = false
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ if(r.data.phone != '') {
|
|
|
+ _this.vercodecor = true
|
|
|
+ _this.setcodeShow = false
|
|
|
+ sessionStorage.setItem('strud_phone', r.data.phone)
|
|
|
+ } else {
|
|
|
+ _this.setcodeShow = true
|
|
|
+ }
|
|
|
+ this.setEchoInfo(r.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ highlightText (value, keyStr) {
|
|
|
+ return utils.replaceKeyword(value, keyStr, '<span class="highlight-text">' + keyStr + '</span>')
|
|
|
+ },
|
|
|
+ entOnChange (type) {
|
|
|
+ if (type === 'blur') {
|
|
|
+ // this.getCheckMap('company')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isAssociateShow = false
|
|
|
+ this.searchList = []
|
|
|
+ }, 300)
|
|
|
+ } else {
|
|
|
+ clearTimeout(this.isAssociateUpTime)
|
|
|
+ this.isAssociateUpTime = setTimeout(() => {
|
|
|
+ this.ajaxEntList(this.infoMap.company)
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectEnt (item) {
|
|
|
+ console.log('item', item)
|
|
|
+ this.infoMap.company = item
|
|
|
+ this.isAssociateShow = false
|
|
|
+ this.searchList = []
|
|
|
+ },
|
|
|
+ ajaxEntList (str) {
|
|
|
+ if (str.length <= 2) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.ajaxFn('/jypay/user/company/association', { name: str }, function (r) {
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ this.isAssociateShow = true
|
|
|
+ this.searchList = r.data
|
|
|
+ }
|
|
|
+ }, true)
|
|
|
+ },
|
|
|
+ setEchoInfo (data) {
|
|
|
+ if (data.name) {
|
|
|
+ this.setCheckForData('name', 'name', data.name)
|
|
|
+ }
|
|
|
+ if (data.phone) {
|
|
|
+ this.setCheckForData('phone', 'phone', data.phone)
|
|
|
+ }
|
|
|
+ if (data.company) {
|
|
|
+ this.setCheckForData('company', 'company', data.company)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ setCheckForData (aKey, iKey, cKey, label) {
|
|
|
+ this.ajaxParams[aKey] = cKey
|
|
|
+ this.infoMap[iKey] = cKey
|
|
|
+ if (label) {
|
|
|
+ var checkDatas = [cKey]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSelectItem (item, index) {
|
|
|
+ if (this.isMoreSelect) {
|
|
|
+ item.checked = !item.checked
|
|
|
+ } else {
|
|
|
+ item.checked = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getCheckMap (type) {
|
|
|
+ switch (type) {
|
|
|
+ case 'name': {
|
|
|
+ this.infoCheckMap.name = this.infoMap.name === '' ? '姓名为必填项' : ''
|
|
|
+ if (this.infoCheckMap.name === '' && !this.checkName) {
|
|
|
+ this.infoCheckMap.name = '请输入正确格式的姓名'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'phone': {
|
|
|
+ this.infoCheckMap.phone = this.infoMap.phone === '' ? '手机号码为必填项' : ''
|
|
|
+ if (this.infoCheckMap.phone === '' && !this.checkPhone) {
|
|
|
+ this.infoCheckMap.phone = '请输入正确格式的手机号码'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'company': {
|
|
|
+ this.infoCheckMap.company = this.infoMap.company === '' ? '公司名称为必填项' : ''
|
|
|
+ if (this.infoCheckMap.company === '' && !this.checkEntName) {
|
|
|
+ this.infoCheckMap.company = '请输入正确格式的公司名称'
|
|
|
+ if (this.infoMap.company.length < 2) {
|
|
|
+ this.infoCheckMap.company = '公司名称至少输入2个字'
|
|
|
+ }
|
|
|
+ if (this.infoMap.company.length > 50) {
|
|
|
+ this.infoCheckMap.company = '公司名称最多输入50个字'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancelForm () {
|
|
|
+ history.back()
|
|
|
+ },
|
|
|
+ submitForm () {
|
|
|
+ this.ajaxParams.name = this.infoMap.name
|
|
|
+ this.ajaxParams.phone = this.infoMap.phone
|
|
|
+ this.ajaxParams.company = this.infoMap.company
|
|
|
+ this.ajaxParams.platform = "wx"
|
|
|
+ var _this = this
|
|
|
+ var loading = _this.showLoading()
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: '/salesLeads/collectInfo',
|
|
|
+ contentType: "application/json;charset=utf-8",
|
|
|
+ data: JSON.stringify(_this.ajaxParams),
|
|
|
+ success: function(r) {
|
|
|
+ loading.clear()
|
|
|
+ if (r.error_msg === '' || r.data) {
|
|
|
+ _this.commitshow = true
|
|
|
+ } else {
|
|
|
+ _this.showToast(r.error_msg || '提交失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(err) {
|
|
|
+ loading.clear()
|
|
|
+ _this.showToast('提交失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showLoading: function () {
|
|
|
+ var loading = this.$toast.loading({
|
|
|
+ duration: 0,
|
|
|
+ forbidClick: true,
|
|
|
+ message: '提交中...',
|
|
|
+ })
|
|
|
+ return loading
|
|
|
+ },
|
|
|
+ showToast: function (message) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 1500,
|
|
|
+ forbidClick: true,
|
|
|
+ message: message,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var vPerfect = new Vue(vNode)
|
|
|
+</script>
|
|
|
+<script>
|
|
|
+ $(function () {
|
|
|
+ $("#perfect-info-page").on('click tap', '.infor-icon-close', function(e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ history.back()
|
|
|
+ })
|
|
|
+ })
|
|
|
+</script>
|
|
|
+{{include "/common/baiducc.html"}}
|
|
|
+</body>
|
|
|
+
|
|
|
+</html>
|