perfect.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="center">
  3. <u-form>
  4. <view class="modular">
  5. <u-form-item label="公司名称" label-width="30%" class="title Regular" :border-bottom="topBorder">
  6. <u-input v-model="deptList.name" input-align="right" class="write Regular" placeholder="请输入公司名称" />
  7. </u-form-item>
  8. </view>
  9. <view class="modular">
  10. <view class="title Regular">企业概况</view>
  11. <textarea value="" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" class="areaText Regular"
  12. v-model="deptList.a" />
  13. <view class="title Regular">添加标签(标签应突出企业特色,最多6个)</view>
  14. <view class="flex">
  15. <view class="forLists" v-for="(item,index) in label" :Key="index">
  16. <u-tag :text="item" mode="dark" class="forList Medium" shape="circle" :show="show"
  17. :closeable="closeable" color="#22C572" @close="closeForList(index)" />
  18. </view>
  19. <u-tag text="+" mode="plain" shape="circle" :show="show1" color="#2E2E2D" bg-color="#FFFFFF"
  20. border-color="#F9F9FA" class="add" @click="add"></u-tag>
  21. </view>
  22. <view class="addinput flex" v-if="inputShow">
  23. <u-input v-model="value" type="type" border focus v-if="inputShow"
  24. style="border-radius: 50rpx;line-height: 70rpx;font-size: 10px;" placeholder="请输入标签内容,不超过6个字" />
  25. <u-button :type="types" class="inputOk" shape="circle" @click="addinput">确定</u-button>
  26. </view>
  27. </view>
  28. <view class="modular">
  29. <view class="title Regular">场地照片(图片清晰,最多9张)</view>
  30. <u-upload :action="action" :file-list="fileList" @on-success="uploadSuccess" @on-remove="imgRemove"
  31. :max-count="9"></u-upload>
  32. </view>
  33. <view class="modular">
  34. <view class="title Regular">联系方式</view>
  35. <view v-for="(item,index) in Persons">
  36. <view class="information flex">
  37. <view class="xinxi">
  38. <u-form-item label="姓名" label-width="30%" class="Regular" label-position="top"
  39. style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
  40. <u-input v-model="item.name" class="Regular" placeholder="请输入姓名" />
  41. </u-form-item>
  42. </view>
  43. <view class="xinxi">
  44. <u-form-item label="电话" label-width="30%" class="Regular" label-position="top"
  45. style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
  46. <u-input v-model="item.phone" class="Regular" placeholder="请输入电话" />
  47. </u-form-item>
  48. </view>
  49. <div class="del" @click="delPerson(index)">
  50. <span style="font-size: 46rpx; color: #22C572;">×</span>
  51. </div>
  52. </view>
  53. </view>
  54. <view class="addPerson" @click="addPerson">
  55. <image src="../../static/img/liangmai/jia@3x.png" mode=""
  56. style="width: 26rpx;height: 26rpx;top: 2rpx;"></image>
  57. 添加联系人
  58. </view>
  59. </view>
  60. <view class="modular">
  61. <u-form-item label="邮箱" label-width="30%" class="title Regular">
  62. <u-input v-model="deptList.name" input-align="right" class="write Regular" placeholder="请输入电子邮箱" />
  63. </u-form-item>
  64. <u-form-item label="传真" label-width="30%" class="title Regular" :border-bottom="topBorder">
  65. <u-input v-model="deptList.name" input-align="right" class="write Regular" placeholder="请输入传真号" />
  66. </u-form-item>
  67. </view>
  68. </u-form>
  69. <u-button type="success" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. deptList: {},
  77. label: ["世界一流", "世界500强"],
  78. closeable: true,
  79. show: true,
  80. show1: true,
  81. types: "",
  82. inputShow: false,
  83. value: "", //临时标签内容字段 后期更换
  84. action: 'https://www.zthymaoyi.com/upload/admin',
  85. fileList: [],
  86. imgList: [],
  87. Persons: [{
  88. name: "张良",
  89. phone: "1365411111"
  90. }],
  91. topBorder: false,
  92. }
  93. },
  94. methods: {
  95. add() {
  96. if (this.label.length >= 6) {
  97. this.inputShow = false
  98. } else {
  99. this.inputShow = true
  100. }
  101. },
  102. addinput() {
  103. if (!this.value) {
  104. this.$api.msg('标签内容不能为空')
  105. return
  106. }
  107. if (this.value.length < 2 || this.value.length > 6) {
  108. this.$api.msg('标签内容输入有误')
  109. return
  110. }
  111. this.label.push(this.value)
  112. this.value = ""
  113. this.inputShow = false
  114. },
  115. addPerson() {
  116. this.Persons.push({
  117. name: "",
  118. phone: "",
  119. })
  120. },
  121. delPerson(index) {
  122. this.Persons.splice(index, 1)
  123. },
  124. closeForList(index) {
  125. this.label.splice(index, 1)
  126. },
  127. imgRemove(e) {
  128. this.imgList.splice(e, 1)
  129. },
  130. uploadSuccess(e) {
  131. this.imgList.push(e.url)
  132. },
  133. submit() {
  134. uni.showModal({
  135. content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
  136. showCancel: true,
  137. confirmText: '提交',
  138. success: function(res) {
  139. if (res.confirm) {
  140. }
  141. }
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .center {
  149. padding: 10rpx 20rpx;
  150. }
  151. .title {
  152. margin-left: 20rpx;
  153. color: #71747C;
  154. line-height: 70rpx;
  155. }
  156. .write {
  157. margin-right: 20px;
  158. color: #71747C;
  159. }
  160. .modular {
  161. background-color: #FFFFFF;
  162. border-radius: 20px;
  163. margin-top: 20px;
  164. }
  165. .areaText {
  166. width: 90%;
  167. padding: 30rpx;
  168. border: 2rpx solid #F9F9FA;
  169. background-color: #F9F9FA;
  170. margin: 10rpx auto 20rpx;
  171. border-radius: 20rpx;
  172. color: #AFB3BF;
  173. font-size: 28rpx;
  174. }
  175. .add {
  176. padding: 15rpx 30rpx;
  177. width: 120rpx;
  178. height: 65rpx;
  179. text-align: center;
  180. margin-left: 24rpx;
  181. font-size: 30rpx;
  182. font-weight: 600;
  183. }
  184. .forLists {
  185. margin-bottom: 10rpx;
  186. }
  187. .forList {
  188. background-color: #F4FAF8;
  189. padding: 20rpx 30rpx;
  190. color: #22C572;
  191. margin-left: 24rpx;
  192. text-align: center;
  193. }
  194. .addinput {
  195. width: 70%;
  196. margin: 20rpx auto;
  197. border-radius: 50rpx;
  198. }
  199. .inputOk {
  200. width: 100rpx;
  201. border-radius: 40rpx;
  202. background-color: #E9EAE9;
  203. color: #FFFFFF;
  204. border: none;
  205. }
  206. .picture {
  207. width: 144rpx;
  208. height: 144rpx;
  209. border: 4rpx dashed #AFB3BF;
  210. }
  211. .upload {
  212. height: 140rpx;
  213. text-align: center;
  214. margin: 20px 0;
  215. margin-bottom: 20px;
  216. }
  217. .addPerson {
  218. width: 230rpx;
  219. height: 80rpx;
  220. line-height: 80rpx;
  221. text-align: center;
  222. border: 2rpx solid #979797;
  223. border-radius: 40rpx;
  224. margin: 20rpx auto 20rpx;
  225. }
  226. .information {
  227. background-color: #F4FAF8;
  228. width: 96%;
  229. height: 180rpx;
  230. margin: 0 auto;
  231. border: 2rpx dashed #22C572;
  232. border-radius: 10rpx;
  233. margin-top: 30rpx;
  234. }
  235. .xinxi {
  236. margin-left: 70rpx;
  237. }
  238. .del {
  239. justify-content: flex-end;
  240. margin: 10rpx 20rpx 0 0;
  241. }
  242. </style>