enterprise_form.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. {extend name="public/base_human"/}
  2. {block name="css"}
  3. <style>
  4. .btn_search_item{background:#f2f6ff;display:inline-block;border-radius:5px;line-height:35px;height:35px;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:relative;font-size:13px;width:100%;color:#666;margin-bottom:10px;}
  5. .btn_search_item.active{color:var(--blue);}
  6. .btn_search_icon{position:absolute;bottom:-3px;right:-3px;font-size:30px;}
  7. .contact {position: fixed;bottom:100px;right:20px;background: #29db6f;border-radius: 50%;color:white;}
  8. </style>
  9. {/block}
  10. {block name="body"}
  11. <van-nav-bar
  12. class="nav-theme"
  13. :fixed="true"
  14. :placeholder="true"
  15. left-text="返回"
  16. left-arrow
  17. @click-left="onBack"
  18. >
  19. <template #title>
  20. <span class="text-white">企业报名</span>
  21. </template>
  22. </van-nav-bar>
  23. <van-form @submit="onSubmit">
  24. <van-cell-group>
  25. <van-field
  26. v-model="form.name"
  27. required
  28. type="text"
  29. label="企业名称"
  30. placeholder="请输入企业名称"
  31. :rules="[{ required: true, message: '请输入企业名称' }]"
  32. ></van-field>
  33. <van-field
  34. v-model="form.join"
  35. required
  36. type="text"
  37. label="姓名"
  38. placeholder="请输入参会人姓名"
  39. :rules="[{ required: true, message: '请输入参会人姓名' }]"
  40. ></van-field>
  41. <van-field
  42. v-model="form.join_mobile"
  43. required
  44. type="mobile"
  45. label="手机号"
  46. placeholder="请输入参会人手机号"
  47. :rules="[{ required: true, message: '请输入参会人手机号' }]"
  48. ></van-field>
  49. <van-field
  50. v-model="form.wechat"
  51. type="text"
  52. label="微信号"
  53. placeholder="请输入微信号"
  54. ></van-field>
  55. <van-field
  56. v-model="form.industry"
  57. is-link
  58. readonly
  59. label="行业"
  60. placeholder="选择行业"
  61. @click="showIndustryPicker = true"
  62. ></van-field>
  63. <van-popup v-model:show="showIndustryPicker" round position="bottom">
  64. <van-picker
  65. :columns="industry_list"
  66. @cancel="showIndustryPicker = false"
  67. @confirm="onIndustryConfirm"
  68. ></van-picker>
  69. </van-popup>
  70. <van-field name="form.cooperate" label="希望合作的业务">
  71. <template #input>
  72. <van-row :gutter="10">
  73. <van-col span="8" v-for="(item) in cooperate_list">
  74. <div :class="{btn_search_item:true,active: in_array(item,form.cooperate)}"
  75. @click="selectAnimal(item)">
  76. {{item}}
  77. <van-icon v-if="in_array(item,form.cooperate)"
  78. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-blue"></van-icon>
  79. </div>
  80. </van-col>
  81. </van-row>
  82. </template>
  83. </van-field>
  84. <van-field
  85. v-model="form.capital"
  86. type="text"
  87. label="注册资本"
  88. placeholder="请输入注册资本"
  89. ></van-field>
  90. <van-field
  91. v-model="form.tel"
  92. type="text"
  93. label="联系电话"
  94. placeholder="请输入单位联系电话"
  95. ></van-field>
  96. <van-field
  97. v-model="form.address"
  98. type="text"
  99. label="企业地址"
  100. placeholder="请输入企业地址"
  101. ></van-field>
  102. <van-field
  103. v-model="form.describe"
  104. rows="3"
  105. autosize
  106. label="企业简介"
  107. type="textarea"
  108. placeholder="请输入企业简介"
  109. ></van-field>
  110. <!--<van-field
  111. v-model="form.url"
  112. type="text"
  113. label="官网"
  114. placeholder="请输入官网"
  115. ></van-field>
  116. <van-field label="附件(海报,名片等)">
  117. <template #input>
  118. <van-uploader v-model="fileList" :before-read="uploadImage" :before-delete="deleteImage"></van-uploader>
  119. </template>
  120. </van-field>-->
  121. <van-field
  122. v-model="form.suggestion"
  123. rows="3"
  124. autosize
  125. label="活动建议"
  126. type="textarea"
  127. placeholder="请输入对本次活动想说的话"
  128. ></van-field>
  129. </van-cell-group>
  130. <div style="margin: 16px;">
  131. <van-button round block type="primary" native-type="submit">
  132. 提交
  133. </van-button>
  134. </div>
  135. </van-form>
  136. <div class="contact" @click="showQrcode">
  137. <van-icon name="chat-o" size="40"></van-icon>
  138. </div>
  139. {/block}
  140. {block name="script"}
  141. <script>
  142. function v_setup() {
  143. let base = {};
  144. base.cooperate_list = {$cooperate_list};
  145. base.selectAnimal = (value) => {
  146. if (base.in_array(value,base.form.cooperate)) {
  147. base.removeByVal(base.form.cooperate,value);
  148. } else {
  149. base.form.cooperate.push(value);
  150. }
  151. }
  152. base.in_array = (search,array) => {
  153. for(let i in array){
  154. if(array[i] == search){
  155. return true;
  156. }
  157. }
  158. return false;
  159. };
  160. base.removeByVal = (arrylist , val) => {
  161. for(let i = 0; i < arrylist .length; i++) {
  162. if(arrylist[i] == val) {
  163. arrylist .splice(i, 1);
  164. break;
  165. }
  166. }
  167. }
  168. base.form = Vue.reactive({
  169. cooperate: [],
  170. images: [],
  171. });
  172. base.onBack = () => {
  173. location.href = "{:url('human/index')}";
  174. };
  175. //表单提交
  176. base.onSubmit = () => {
  177. postJson('/human/enterpriseFormPost',base.form).then(() => {
  178. vant.showDialog({
  179. title: '提示',
  180. message: '报名成功',
  181. }).then(() => {
  182. location.href = "{:url('human/tips')}";
  183. });
  184. });
  185. };
  186. //图片上传
  187. base.fileList = Vue.ref([]);
  188. base.uploadImage = (file) => {
  189. const formData = new FormData();
  190. formData.append("file", file);
  191. postFile("upload/image",formData).then(({data})=>{
  192. base.form.images.push(data.src);
  193. });
  194. return true;
  195. };
  196. base.deleteImage = (file,param) => {
  197. base.form.images.splice(param.index,1);
  198. return true;
  199. };
  200. base.showQrcode = () => {
  201. vant.showImagePreview([
  202. '/static/mobile/images/wechat_qrcode_enterprise.jpg'
  203. ]);
  204. };
  205. //行业选择
  206. base.industry_list = {$industry_list};
  207. base.showIndustryPicker = Vue.ref(false);
  208. base.onIndustryConfirm = ({ selectedOptions }) => {
  209. base.form.industry= selectedOptions[0].value
  210. base.showIndustryPicker.value = false;
  211. };
  212. return base;
  213. }
  214. </script>
  215. {/block}