index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <div class="agent-layout">
  3. <div class="mobile1">
  4. <div class="top">
  5. <img class="top-bg" src="@/assets/images/refactor/agent/banner.png" alt />
  6. </div>
  7. </div>
  8. <div class="mobile2">
  9. <h1 class="common-title">{{ $t('agent.planTitle') }}</h1>
  10. <p>{{ $t('agent.planDesc1') }}</p>
  11. <p>{{ $t('agent.planDesc2') }}</p>
  12. <p>{{ $t('agent.planDesc3') }}</p>
  13. <p>{{ $t('agent.planDesc4') }}</p>
  14. </div>
  15. <div class="mobile3">
  16. <h1 class="common-title">{{ $t('agent.advanTitle') }}</h1>
  17. <ul class="benefits">
  18. <li v-for="(item, index) in benefitGroup" :key="index">
  19. <div class="icon-bg" :style="{'background-image': `url(${item.img})`}"></div>
  20. <h4>{{ item.title }}</h4>
  21. <p>{{ item.sub }}</p>
  22. </li>
  23. </ul>
  24. </div>
  25. <div class="mobile4">
  26. <p class="common-title">{{ $t('agent.jinxiaoTitle') }}</p>
  27. <div class="info">
  28. <div class="input-con">
  29. <div class="f-title">{{langAgent.jingxiaoshang.companytitle}}</div>
  30. <p class="p-line"></p>
  31. <div class="s-title required">{{langAgent.jingxiaoshang.company.name.title}}</div>
  32. <div class="ant-input">
  33. <input v-model="form.name" :placeholder="langAgent.jingxiaoshang.company.name.placeholder" type="text" />
  34. </div>
  35. <div class="s-title required">{{langAgent.jingxiaoshang.company.address.title}}</div>
  36. <div class="divide">
  37. <div class="ant-input">
  38. <input v-model="form.country" :placeholder="langAgent.jingxiaoshang.company.address.placeholder" type="text" />
  39. </div>
  40. <div class="ant-input">
  41. <input v-model="form.region" :placeholder="langAgent.jingxiaoshang.company.address.placeholder2" type="text" />
  42. </div>
  43. </div>
  44. <div class="ant-input">
  45. <input v-model="form.address" :placeholder="langAgent.jingxiaoshang.company.address.placeholder3" type="text" />
  46. </div>
  47. <div class="s-title">{{langAgent.jingxiaoshang.company.store.title}}</div>
  48. <div class="select-btns">
  49. <div @click="form.type=1" :class="{'b-default':form.type!==1}">{{langAgent.jingxiaoshang.company.store.type1}}</div>
  50. <div @click="form.type=2" :class="{'b-default':form.type!==2}">{{langAgent.jingxiaoshang.company.store.type2}}</div>
  51. </div>
  52. <div class="ant-input">
  53. <input v-model="form.storeAddress" :placeholder="langAgent.jingxiaoshang.company.store.placeholder" type="text" />
  54. </div>
  55. </div>
  56. </div>
  57. <div class="info s-info">
  58. <div class="input-con">
  59. <div class="f-title">{{langAgent.jingxiaoshang.applytitle}}</div>
  60. <p class="p-line"></p>
  61. <div class="with-divide">
  62. <div>
  63. <p class="s-title required">{{langAgent.jingxiaoshang.apply.name.xing}}</p>
  64. <div class="ant-input">
  65. <input v-model="form.surName" :placeholder="langAgent.jingxiaoshang.apply.name.placeholder" type="text" />
  66. </div>
  67. </div>
  68. <div>
  69. <p class="s-title required">{{langAgent.jingxiaoshang.apply.name.ming}}</p>
  70. <div class="ant-input">
  71. <input v-model="form.userName" :placeholder="langAgent.jingxiaoshang.apply.name.placeholder1" type="text" />
  72. </div>
  73. </div>
  74. </div>
  75. <div class="s-title required">{{langAgent.jingxiaoshang.apply.position.title}}</div>
  76. <div class="ant-input">
  77. <input v-model="form.post" :placeholder="langAgent.jingxiaoshang.apply.position.placeholder" type="text" />
  78. </div>
  79. <div class="s-title required">{{langAgent.jingxiaoshang.apply.phone.title}}</div>
  80. <div class="divide phone-divide">
  81. <div class="ant-input area-div" ref="quhaoMenu" @click="showSelect=!showSelect">
  82. <span>{{codeActive[1]}}</span>
  83. <ul v-if="showSelect">
  84. <li
  85. @click="selectItem(item)"
  86. v-for="(item,i) in selectCall"
  87. :key="i"
  88. >{{language==='en'?item[2]:item[0]}}{{item[1]}}</li>
  89. </ul>
  90. </div>
  91. <div class="ant-input">
  92. <input
  93. v-model="form.phone"
  94. oninput="value=value.replace(/[^\d]/g,'')"
  95. maxlength="11"
  96. :placeholder="langAgent.jingxiaoshang.apply.phone.placeholder"
  97. type="text"
  98. />
  99. </div>
  100. </div>
  101. <div class="s-title required">{{langAgent.jingxiaoshang.apply.email.title}}</div>
  102. <div class="ant-input">
  103. <input v-model="form.email" :placeholder="langAgent.jingxiaoshang.apply.email.placeholder" type="text" />
  104. </div>
  105. </div>
  106. </div>
  107. <div class="btns-con">
  108. <div class="btns" @click="submit">{{ $t('agent.jinxiaoForm.submit') }}</div>
  109. </div>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import selectCall from '@/util/country.js'
  115. import {reg} from '@/util'
  116. import { mapState } from 'vuex'
  117. import { i18n } from '@/lang'
  118. export default {
  119. computed: {
  120. ...mapState({
  121. langAgent: state => state.language.home.agent,
  122. langToast: state => state.language.home.toast,
  123. language: state => state.language.current
  124. })
  125. },
  126. data () {
  127. let benefitGroup = [
  128. {
  129. img: require('@/assets/images/refactor/agent/ad1.png'),
  130. title: i18n.t('agent.advan.item1Title'),
  131. sub: i18n.t('agent.advan.item1Sub')
  132. },
  133. {
  134. img: require('@/assets/images/refactor/agent/ad2.png'),
  135. title: i18n.t('agent.advan.item2Title'),
  136. sub: i18n.t('agent.advan.item2Sub')
  137. },
  138. {
  139. img: require('@/assets/images/refactor/agent/ad3.png'),
  140. title: i18n.t('agent.advan.item3Title'),
  141. sub: i18n.t('agent.advan.item3Sub')
  142. },
  143. {
  144. img: require('@/assets/images/refactor/agent/ad4.png'),
  145. title: i18n.t('agent.advan.item4Title'),
  146. sub: i18n.t('agent.advan.item4Sub')
  147. },
  148. {
  149. img: require('@/assets/images/refactor/agent/ad5.png'),
  150. title: i18n.t('agent.advan.item5Title'),
  151. sub: i18n.t('agent.advan.item5Sub')
  152. }
  153. ]
  154. return {
  155. selectCall,
  156. showSelect: false,
  157. codeActive: ['中国', '+86', 'China'],
  158. form: {
  159. name: '',
  160. country: '',
  161. region: '',
  162. address: '',
  163. type: 1,
  164. storeAddress: '',
  165. surName: '',
  166. userName: '',
  167. post: '',
  168. areaCode: '',
  169. phone: '',
  170. email: ''
  171. },
  172. benefitGroup,
  173. agent: {
  174. title: '四维看看经销商计划概述',
  175. label:
  176. '四维时代独创的AI空间重构算法技术已屡获殊荣,并累计在全球范围采集超过30万个空间模型。<br/>这种全新的空间记录方式正在逐步改变各行各业的业务模式(房地产、建筑、文博、旅游、新闻、保险理赔、刑侦记录等等)。<br/>四维看看经销商计划诚邀各业界专业人士,参与到未来的“数字万物”的进程中,共同开拓市场,分享利润。<br/>如果您对3D捕捉世界的想法很感兴趣,并愿将其纳入到您的事业规划中,这是一个绝佳的合作机会'
  177. },
  178. jingxiaoshang: {
  179. title: '成为四维看看经销商'
  180. }
  181. }
  182. },
  183. methods: {
  184. selectItem (item) {
  185. this.codeActive = item
  186. this.showSelect = false
  187. },
  188. async submit () {
  189. let check = value => {
  190. for (let i = 0, len = value.length; i < len; i++) {
  191. if (!value[i].val) {
  192. return this.$toast.show('warn', (this.language === 'en' ? value[i].En : value[i].name) + this.langToast['7'])
  193. }
  194. }
  195. return true
  196. }
  197. let {
  198. name,
  199. country,
  200. region,
  201. address,
  202. type,
  203. storeAddress,
  204. surName,
  205. userName,
  206. post,
  207. phone,
  208. email
  209. } = this.form
  210. let checkStr = [
  211. {
  212. name: '公司注册名称',
  213. En: 'Registered Company Name',
  214. val: name
  215. },
  216. {
  217. name: '国家',
  218. En: 'Country',
  219. val: country
  220. },
  221. {
  222. name: '地区',
  223. En: 'Region',
  224. val: region
  225. },
  226. {
  227. name: '公司地址',
  228. En: 'Address',
  229. val: address
  230. },
  231. // {
  232. // name: '门店地址',
  233. // En:'',
  234. // val: storeAddress
  235. // },
  236. {
  237. name: '姓',
  238. En: 'Last Name',
  239. val: surName
  240. },
  241. {
  242. name: '名',
  243. En: 'First Name',
  244. val: userName
  245. },
  246. {
  247. name: '职位',
  248. En: 'Title',
  249. val: post
  250. },
  251. {
  252. name: '电话',
  253. En: 'Phone',
  254. val: phone
  255. },
  256. {
  257. name: '电子邮箱',
  258. En: 'Email',
  259. val: email
  260. }
  261. ]
  262. if (!check(checkStr)) {
  263. return
  264. }
  265. if (!reg.email.test(email)) {
  266. return this.$toast.show('warn', this.langToast['8'])
  267. }
  268. let areaCode = Number(this.codeActive[1].substr(1))
  269. let params = {
  270. name,
  271. country,
  272. region,
  273. address,
  274. type,
  275. storeAddress,
  276. surName,
  277. userName,
  278. post,
  279. areaCode,
  280. phone,
  281. email
  282. }
  283. let res = await this.$http({
  284. method: 'post',
  285. data: params,
  286. url: '/agentAduit/save'
  287. })
  288. let response = res.data
  289. if (response.code !== 0) {
  290. return this.$toast.show('warn', this.langToast[response.code])
  291. }
  292. this.$toast.show('warn', this.langToast['9'], () => {
  293. this.form = {
  294. name: '',
  295. country: '',
  296. region: '',
  297. address: '',
  298. type: 1,
  299. storeAddress: '',
  300. surName: '',
  301. userName: '',
  302. post: '',
  303. areaCode: '',
  304. phone: '',
  305. email: ''
  306. }
  307. })
  308. }
  309. },
  310. mounted () {
  311. document.addEventListener('click', e => {
  312. if (this.$refs.quhaoMenu) {
  313. if (!this.$refs.quhaoMenu.contains(e.target)) {
  314. this.showSelect = false
  315. }
  316. }
  317. })
  318. }
  319. }
  320. </script>
  321. <style lang="scss" scoped>
  322. @import "./style.scss";
  323. </style>