index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <div class="distributor-page">
  3. <div class="banner">
  4. <div class="container">{{ $t('agent.bannerTitle') }}</div>
  5. </div>
  6. <div class="container">
  7. <div class="plate">
  8. <h1 class="common-title">{{ $t('agent.planTitle') }}</h1>
  9. <ul class="plan">
  10. <li>{{ $t('agent.planDesc1') }}</li>
  11. <li>{{ $t('agent.planDesc2') }}</li>
  12. <li>{{ $t('agent.planDesc3') }}</li>
  13. <li>{{ $t('agent.planDesc4') }}</li>
  14. </ul>
  15. </div>
  16. <div class="plate">
  17. <h1 class="common-title">{{ $t('agent.advanTitle') }}</h1>
  18. <div class="benefit-w clear">
  19. <div class="benefit-item" v-for="(item, index) in benefits" :key="index">
  20. <div class="icon" :style="{backgroundImage: `url(${item.icon})`}"></div>
  21. <h6>{{ item.name }}</h6>
  22. <p>{{ item.desc }}</p>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="form-plate">
  28. <div class="container">
  29. <h1 class="common-title">{{ $t('agent.jinxiaoTitle') }}</h1>
  30. <h-row :gutter="96">
  31. <h-col :span="12">
  32. <div class="form">
  33. <p class="form-title">{{ $t('agent.jinxiaoForm.companytitle') }}</p>
  34. <div class="form-item">
  35. <p class="label">*{{ $t('agent.jinxiaoForm.companyNameLabel') }}</p>
  36. <input type="text" v-model="form.name" :placeholder="$t('agent.jinxiaoForm.companyNamePlaceholder')">
  37. </div>
  38. <div class="form-item">
  39. <p class="label">*{{ $t('agent.jinxiaoForm.addressLabel') }}</p>
  40. <h-row :gutter="10">
  41. <h-col :span="12">
  42. <input type="text" v-model="form.country" :placeholder="$t('agent.jinxiaoForm.addressPlaceholder1')">
  43. </h-col>
  44. <h-col :span="12">
  45. <input type="text" v-model="form.region" :placeholder="$t('agent.jinxiaoForm.addressPlaceholder2')">
  46. </h-col>
  47. </h-row>
  48. <input type="text" v-model="form.address" :placeholder="$t('agent.jinxiaoForm.addressPlaceholder3')">
  49. </div>
  50. <div class="form-item">
  51. <p class="label">{{ $t('agent.jinxiaoForm.storeLabel') }}</p>
  52. <h-row :gutter="10">
  53. <h-col :span="12">
  54. <div :class="`input ${form.type === 1 ? 'active' : ''}`" @click="form.type = 1">{{ $t('agent.jinxiaoForm.storeType1') }}</div>
  55. </h-col>
  56. <h-col :span="12">
  57. <div :class="`input ${form.type === 2 ? 'active' : ''}`" @click="form.type = 2">{{ $t('agent.jinxiaoForm.storeType2') }}</div>
  58. </h-col>
  59. </h-row>
  60. <input type="text" v-model="form.storeAddress" :placeholder="$t('agent.jinxiaoForm.storePlaceholder')">
  61. </div>
  62. </div>
  63. </h-col>
  64. <h-col :span="12"><div class="form">
  65. <p class="form-title">{{ $t('agent.jinxiaoForm.applytitle') }}</p>
  66. <div class="form-item">
  67. <h-row :gutter="10">
  68. <h-col :span="12">
  69. <p class="label">*{{ $t('agent.jinxiaoForm.applyNameXing') }}</p>
  70. <input type="text" v-model="form.surName" :placeholder="$t('agent.jinxiaoForm.applyNamePlaceholder')">
  71. </h-col>
  72. <h-col :span="12">
  73. <p class="label">*{{ $t('agent.jinxiaoForm.applyNameMing') }}</p>
  74. <input type="text" v-model="form.userName" :placeholder="$t('agent.jinxiaoForm.applyNamePlaceholder1')">
  75. </h-col>
  76. </h-row>
  77. </div>
  78. <div class="form-item" style="margin-bottom: 26px">
  79. <p class="label">*{{ $t('agent.jinxiaoForm.positionLabel') }}</p>
  80. <input type="text" v-model="form.post" :placeholder="$t('agent.jinxiaoForm.positionPlaceholder')">
  81. </div>
  82. <div class="form-item">
  83. <p class="label">*{{ $t('agent.jinxiaoForm.phoneLabel') }}</p>
  84. <h-row :gutter="10">
  85. <h-col :span="8">
  86. <input type="text" v-model="form.areaCode" placeholder="+86" value="+86">
  87. </h-col>
  88. <h-col :span="16">
  89. <input type="text" v-model="form.phone" :placeholder="$t('agent.jinxiaoForm.phonePlaceholder')">
  90. </h-col>
  91. </h-row>
  92. </div>
  93. <div class="form-item">
  94. <p class="label">*{{ $t('agent.jinxiaoForm.emailLabel') }}</p>
  95. <input type="text" v-model="form.email" :placeholder="$t('agent.jinxiaoForm.emailPlaceholder')">
  96. </div>
  97. </div></h-col>
  98. </h-row>
  99. <div class="submit-btn" @click="saveAduit">{{ $t('agent.jinxiaoForm.submit') }}</div>
  100. </div>
  101. </div>
  102. </div>
  103. </template>
  104. <script>
  105. import { getPosition } from '@/util'
  106. import { mapState } from 'vuex'
  107. import Api from '@/apis'
  108. export default {
  109. data () {
  110. return {
  111. form: {
  112. address: '',
  113. areaCode: '',
  114. email: '',
  115. name: '',
  116. country: '',
  117. surName: '',
  118. userName: '',
  119. post: '',
  120. phone: '',
  121. email: '',
  122. region: '',
  123. type: 1,
  124. storeAddress: ''
  125. },
  126. rules: {
  127. name: [ { required: true, message: this.$t('agent.jinxiaoForm.companyNamePlaceholder') } ],
  128. address: [ { required: true, message: this.$t('agent.jinxiaoForm.addressPlaceholder3') } ],
  129. country: [ { required: true, message: this.$t('agent.jinxiaoForm.addressPlaceholder1') } ],
  130. region: [ { required: true, message: this.$t('agent.jinxiaoForm.addressPlaceholder2') } ],
  131. userName: [ { required: true, message: this.$t('agent.jinxiaoForm.applyNamePlaceholder') } ],
  132. userName: [ { required: true, message: this.$t('agent.jinxiaoForm.applyNamePlaceholder1') } ],
  133. post: [ { required: true, message: this.$t('agent.jinxiaoForm.positionPlaceholder') } ],
  134. phone: [ { required: true, message: this.$t('agent.jinxiaoForm.phonePlaceholder') } ],
  135. email: [ { required: true, message: this.$t('agent.jinxiaoForm.emailPlaceholder') } ],
  136. },
  137. benefits: [
  138. {
  139. name: this.$t('agent.advan.item1Title'),
  140. desc: this.$t('agent.advan.item1Sub'),
  141. icon: require('@/assets/images/distributor/icon-1.png')
  142. },
  143. {
  144. name: this.$t('agent.advan.item2Title'),
  145. desc: this.$t('agent.advan.item2Sub'),
  146. icon: require('@/assets/images/distributor/icon-2.png')
  147. },
  148. {
  149. name: this.$t('agent.advan.item3Title'),
  150. desc: this.$t('agent.advan.item3Sub'),
  151. icon: require('@/assets/images/distributor/icon-3.png')
  152. },
  153. {
  154. name: this.$t('agent.advan.item4Title'),
  155. desc: this.$t('agent.advan.item4Sub'),
  156. icon: require('@/assets/images/distributor/icon-4.png')
  157. },
  158. {
  159. name: this.$t('agent.advan.item5Title'),
  160. desc: this.$t('agent.advan.item5Sub'),
  161. icon: require('@/assets/images/distributor/icon-5.png')
  162. },
  163. ]
  164. }
  165. },
  166. components: {
  167. },
  168. mounted () {
  169. },
  170. destroyed () {
  171. },
  172. methods: {
  173. saveAduit () {
  174. if (this.validator()) {
  175. return Api.saveAduit(this.form).then(res => {
  176. if (res.data.code === 0) {
  177. this.$alert('提交成功', {
  178. icon: 'success',
  179. })
  180. } else {
  181. this.$alert(res.msg)
  182. }
  183. })
  184. }
  185. },
  186. validator () {
  187. let pass = true
  188. Object.keys(this.rules).forEach(key => {
  189. if (this.rules[key][0].required && !this.form[key]) {
  190. pass = false
  191. this.$alert(this.rules[key][0].message)
  192. return
  193. }
  194. })
  195. return pass
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="scss" >
  201. .distributor-page {
  202. color: #202020;
  203. .banner {
  204. width: 100%;
  205. height: 420px;
  206. background: url(~@/assets/images/distributor/banner.jpg) no-repeat center center;
  207. margin-bottom: 110px;
  208. line-height: 420px;
  209. font-size: 40px;
  210. }
  211. .common-title {
  212. margin-bottom: 75px;
  213. margin-top: 102px;
  214. }
  215. .plan {
  216. line-height: 38px;
  217. color: #909090;
  218. }
  219. .benefit-w {
  220. padding-bottom: 113px;
  221. }
  222. .benefit-item {
  223. float: left;
  224. width: 20%;
  225. text-align: center;
  226. .icon {
  227. height: 60px;
  228. width: 100%;
  229. background-repeat: no-repeat;
  230. background-position: center center;
  231. }
  232. h6 {
  233. margin: 14px 0 10px;
  234. }
  235. p {
  236. color: #909090;
  237. width: 162px;
  238. margin: 0 auto;
  239. }
  240. }
  241. .form-plate {
  242. padding: 102px 0 160px;
  243. background: #F7F7F7;
  244. .common-title {
  245. margin-top: 0;
  246. }
  247. }
  248. .form {
  249. color: #202020;
  250. .form-title {
  251. font-weight: bold;
  252. padding-bottom: 38px;
  253. border-bottom: 1px solid #707070;
  254. margin-bottom: 30px;
  255. }
  256. .form-item {
  257. margin-bottom: 40px;
  258. }
  259. .label {
  260. margin-bottom: 3px;
  261. }
  262. input, .input {
  263. width: 100%;
  264. border:1px solid rgba(144,144,144,1);
  265. height: 40px;
  266. line-height: 38px;
  267. margin-top: 10px;
  268. font-size: 14px;
  269. padding: 0 10px;
  270. background: #fff;
  271. }
  272. }
  273. .input {
  274. cursor: pointer;
  275. color: #909090;
  276. &.active {
  277. color: #202020;
  278. border-color: #1FE4DC;
  279. }
  280. }
  281. .submit-btn {
  282. margin: 63px auto 0;
  283. width: 216px;
  284. height: 40px;
  285. line-height: 40px;
  286. text-align: center;
  287. background: #1FE4DC;
  288. font-weight: 600;
  289. cursor: pointer;
  290. }
  291. }
  292. </style>