enter.vue 9.4 KB

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