enter.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="center">
  3. <!-- <view class=""> -->
  4. <view class="back-btn cuIcon-back" @click="navBack"></view>
  5. <!-- <view class='title1'>入驻</view> -->
  6. <view class="titleUp">
  7. 请完善入驻信息
  8. </view>
  9. <u-form class="forList">
  10. <view class="modular">
  11. <u-form-item label="公司名称" label-width="30%" class="title Regular">
  12. <u-input v-model="deptList.name" input-align="right" class="write Medium" placeholder="请输入公司名称" />
  13. </u-form-item>
  14. <view>
  15. <view class="title Regular" style="margin-top: 15rpx;">主要类型(可多选,必须为真实经营类型)</view>
  16. <view v-for="(item,index) in management" class="choice">
  17. <!-- <u-tag :type="types[index] == null ? 'info' : types[index]" :text="item" show="show"
  18. @click="singleClick(index)"></u-tag> -->
  19. <view :class="anNiuCss[index] == null ? 'types' : anNiuCss[index]" @click="singleClick(index)">
  20. {{item}}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="modular">
  26. <u-form-item label="标题" label-width="30%" class="title Regular">
  27. <u-input v-model="deptList.name" input-align="right" class="write Regular"
  28. placeholder="用于封面展示,2-16个字" />
  29. </u-form-item>
  30. <u-form-item label="公司简介" label-width="30%" class="title Regular">
  31. <u-input v-model="deptList.name" input-align="right" class="write Regular" type="textarea"
  32. placeholder="请输入企业简介,如经营项目、产品类型、企业规模等,10-60个字" />
  33. </u-form-item>
  34. </view>
  35. <view class="modular">
  36. <u-form-item label="上传坐标" label-width="30%" class="title Regular">
  37. <text @click="upload"
  38. class="con-list Regular">{{deptList.buyer == null ? "未上传":deptList.buyer}}<text
  39. class='tip_text cuIcon-right'></text></text>
  40. </u-form-item>
  41. <u-form-item label="所在区域" label-width="30%" class="title Regular">
  42. <u-input v-model="deptList.name" input-align="right" class="write Regular" disabled
  43. placeholder="自动获取" />
  44. </u-form-item>
  45. <u-form-item label="详细地址" label-width="30%" class="title Regular">
  46. <u-input v-model="deptList.name" input-align="right" class="write Regular"
  47. placeholder="如街道和门牌号,2-12个字" maxlength="12" />
  48. </u-form-item>
  49. <view>
  50. <view class="title Regular" style="margin-top: 15rpx;">上传图片</view>
  51. <view v-if="license1 != ''">
  52. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  53. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError"
  54. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  55. :options="uploadOptions" :custom="uploadCustom" @on-progress="onProgress"></upload>
  56. </view>
  57. <view v-if="license2 != ''">
  58. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  59. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError"
  60. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  61. :options="uploadOptions1" :custom="uploadCustom" @on-progress="onProgress"></upload>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- :disabled="true" -->
  66. <u-button @click="submit" class="commit" type="success">提交</u-button>
  67. </u-form>
  68. <view v-if="show == true">
  69. <u-popup v-model="show" mode="center" border-radius="20" width="560rpx" height="560rpx">
  70. <view class="successImg">
  71. <image src="../../static/img/liangmai/tijiaochenggong@3x.png" mode=""
  72. style="width: 180rpx;height: 180rpx;"></image>
  73. </view>
  74. <view class="successText">提交成功,等待平台审核。</view>
  75. <u-button type="success" style="width: 400rpx; margin: 20rpx auto; " shape="circle" @click="perfect">
  76. 完善更多信息</u-button>
  77. <view style="color: #AFB3BF;text-align: center;" @click="navBack">返回</view>
  78. </u-popup>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import upload from '@/components/upload.vue';
  84. export default {
  85. components: {
  86. upload
  87. },
  88. name: "buy",
  89. data() {
  90. return {
  91. action: this.$uploadUrl,
  92. maxSize: 5 * 1024 * 1024,
  93. btnLoading: false,
  94. isAdd: true,
  95. uploadOptions: {
  96. "text": "上传封面图片",
  97. "bgc": ""
  98. },
  99. uploadOptions1: {
  100. "text": "上传营业执照",
  101. "bgc": ""
  102. },
  103. uploadCustom: true,
  104. deptList: {},
  105. management: ["粮库", "加工厂", "烘干厂", "饲料厂", "养殖场", "粮贸", "期货"],
  106. types: [],
  107. show: false,
  108. // anNiuCss:"types",
  109. anNiuCss: [],
  110. license1: "../../static/img/authentication/business@3x.png",
  111. license2: "../../static/img/authentication/business@3x.png",
  112. }
  113. },
  114. methods: {
  115. singleClick(index) {
  116. for (let i = 0; i < this.management.length; i++) {
  117. this.anNiuCss[i] = "types"
  118. }
  119. if (this.anNiuCss[index] == null) {
  120. this.anNiuCss[index] = "types1"
  121. } else if (this.anNiuCss[index] == "types") {
  122. this.anNiuCss[index] = "types1"
  123. } else if (this.anNiuCss[index] == "types1") {
  124. this.anNiuCss[index] = "types"
  125. }
  126. },
  127. filterFileType(index, lists) {
  128. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  129. lists.splice(index, 1);
  130. // 当前文件不支持
  131. uni.showModal({
  132. title: '暂不支持当前图片类型',
  133. showCancel: false
  134. });
  135. } else {
  136. this.isAdd = false;
  137. }
  138. },
  139. navBack() {
  140. uni.navigateBack(1)
  141. },
  142. upload() {
  143. uni.navigateTo({
  144. url: `/`
  145. })
  146. },
  147. perfect() {
  148. uni.navigateTo({
  149. url: `/pages/grain_pulse/perfect`
  150. })
  151. },
  152. submit() {
  153. // if (!this.deptList.title) {
  154. // this.$api.msg('标题不能为空')
  155. // return
  156. // }
  157. this.show = true
  158. return
  159. uni.showModal({
  160. content: "确定提交企业信息??",
  161. showCancel: true,
  162. confirmText: '确定',
  163. success: function(res) {
  164. if (res.confirm) {
  165. //成功后
  166. if (res.data.code == 200) {
  167. uni.showToast({
  168. title: '提交成功',
  169. icon: 'none',
  170. duration: 2000
  171. })
  172. }
  173. }
  174. },
  175. })
  176. }
  177. }
  178. }
  179. </script>
  180. <style lang='scss' scoped>
  181. .center {
  182. padding: 10rpx 20rpx;
  183. width: 100vw;
  184. height: 100vh;
  185. overflow: scroll;
  186. background: url(../../static/img/liangmai/bg@3x.png);
  187. background-size: 100%;
  188. background-repeat: no-repeat;
  189. }
  190. .c-row {
  191. display: -webkit-box;
  192. display: -webkit-flex;
  193. display: flex;
  194. -webkit-box-align: center;
  195. -webkit-align-items: center;
  196. align-items: center;
  197. padding: 20rpx 30rpx;
  198. position: relative;
  199. }
  200. .con-list {
  201. -webkit-box-flex: 1;
  202. -webkit-flex: 1;
  203. flex: 1;
  204. display: -webkit-box;
  205. display: -webkit-flex;
  206. display: flex;
  207. -webkit-box-orient: vertical;
  208. -webkit-box-direction: normal;
  209. -webkit-flex-direction: column;
  210. flex-direction: column;
  211. line-height: 40rpx;
  212. text-align: right;
  213. padding-right: 20rpx;
  214. font-size: 14px;
  215. }
  216. .con-list input {
  217. font-size: 14px !important;
  218. }
  219. .back-btn {
  220. position: absolute;
  221. left: 40upx;
  222. z-index: 9999;
  223. padding-top: var(--status-bar-height);
  224. top: 40upx;
  225. font-size: 40upx;
  226. color: #fff;
  227. }
  228. .title1 {
  229. position: absolute;
  230. left: 50%;
  231. transform: translateX(-50%);
  232. top: 40upx;
  233. padding-top: var(--status-bar-height);
  234. z-index: 9999;
  235. color: #fff;
  236. font-size: 36rpx;
  237. }
  238. .choice {
  239. margin-top: 10px;
  240. display: inline-block;
  241. margin-bottom: 6px;
  242. }
  243. .title {
  244. margin-left: 20rpx;
  245. color: #71747C;
  246. }
  247. .types {
  248. width: 55px;
  249. height: 30px;
  250. background-color: #F4FAF8;
  251. text-align: center;
  252. line-height: 32px;
  253. border-radius: 20px;
  254. margin-left: 14px;
  255. }
  256. .types1 {
  257. width: 55px;
  258. height: 30px;
  259. background-color: #22C572;
  260. text-align: center;
  261. line-height: 32px;
  262. border-radius: 20px;
  263. margin-left: 14px;
  264. color: #FFFFFF;
  265. }
  266. .write {
  267. margin-right: 20px;
  268. color: #71747C;
  269. }
  270. .commit {
  271. margin-top: 20px;
  272. border: 0px;
  273. border-radius: 20px;
  274. }
  275. .modular {
  276. background-color: #FFFFFF;
  277. border-radius: 20px;
  278. margin-top: 20px;
  279. }
  280. .forList {
  281. margin-top: 40px;
  282. }
  283. .titleUp {
  284. color: #FFFFFF;
  285. font-size: 44rpx;
  286. margin-top: 80px;
  287. margin-left: 10px;
  288. }
  289. .upload {
  290. text-align: center;
  291. margin: 20px 0;
  292. margin-bottom: 20px;
  293. }
  294. .popups {
  295. width: 280px;
  296. height: 290px;
  297. border-radius: 20px;
  298. }
  299. .successImg {
  300. width: 90px;
  301. height: 90px;
  302. margin: 30px auto;
  303. }
  304. .successText {
  305. text-align: center;
  306. margin: 0 auto;
  307. font-size: 16px;
  308. }
  309. </style>