123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <template>
- <view class="center">
- <image class='bg' src='../../static/img/liangmai/bg@3x.png'></image>
- <!-- <view class=""> -->
- <view class="back-btn cuIcon-back" @click="navBack"></view>
- <!-- <view class='title1'>入驻</view> -->
- <view class="titleUp">
- 请完善入驻信息
- </view>
- <u-form class="forList">
- <view style='padding-bottom:20px;' class="modular">
- <u-form-item label="公司名称" label-width="30%" class="title Regular">
- <u-input maxlength='25' v-model="deptList.compName" input-align="right" class="write Medium"
- placeholder="请输入公司名称" />
- </u-form-item>
- <view>
- <view class="title Regular" style="margin-top: 15rpx;">主营类型(可多选,必须为真实经营类型)</view>
- <view v-for="(item,index) in management" class="choice">
- <!-- <u-tag :type="types[index] == null ? 'info' : types[index]" :text="item" show="show"
- @click="singleClick(index)"></u-tag> -->
- <view :class="!item.checked ? '' : 'types1'" class='types' @click="singleClick(item)">
- {{item.name}}
- </view>
- </view>
- </view>
- </view>
- <view class="modular">
- <u-form-item label="标题" label-width="30%" prop="title" class="title Regular">
- <u-input maxlength="16" v-model="deptList.title" input-align="right" class="write Regular"
- placeholder="用于封面展示,2-16个字" />
- </u-form-item>
- <u-form-item label-position='top' label="公司简介" label-width="30%" class="title Regular">
- <!-- <u-input input-align="right" type="textarea"
- /> -->
- <view class='companyProfilewrap'>
- <textarea class="write Regular companyProfile"
- maxlength="60"
- placeholder="请输入企业简介,如经营项目、产品类型、企业规模等,10-60个字"
- v-model="deptList.companyProfile" name="" id="" cols="10" rows="3">
- </textarea>
- <view class='companyProfilecontent'>{{deptList.companyProfile.length}}/60个字</view>
- </view>
-
- </u-form-item>
- </view>
- <view class="modular">
- <u-form-item label="上传坐标" label-width="30%" class="title Regular">
- <text @click='naviageToPage("/pages/grain_pulse/localtion/coordinate")'
- class="con-list Regular">{{deptList.buyer == null ? "未上传":deptList.buyer}}<text
- class='tip_text cuIcon-right'></text></text>
- </u-form-item>
- <u-form-item label="所在区域" label-width="30%" class="title Regular">
- <u-input v-model="deptList.name" input-align="right" class="write Regular" disabled
- placeholder="自动获取" />
- </u-form-item>
- <u-form-item label="详细地址" label-width="30%" class="title Regular">
- <u-input v-model="deptList.detailedAddress" input-align="right" class="write Regular"
- placeholder="如街道和门牌号,2-12个字" maxlength="12" />
- </u-form-item>
- <view>
- <view class="title Regular" style="margin-top: 15rpx;">上传图片</view>
- <view v-if="license1 != ''">
- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
- :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError"
- @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
- :options="uploadOptions" customBorder='2px dashed #D8DEF7' customBtnFontSize="14" customBtnColor="#6A7282" :customBtnHeight='custombtnheight'
- :customBtnWidth='custombtnwidth' customBack='#F9FAFE' :customBtnImage="custombtnimage" :customBtn='custombtn'
- :custom="uploadCustom" @on-progress="onProgress"></upload>
- </view>
- <view v-if="license2 != ''">
- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
- :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError"
- @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
- :options="uploadOptions1" customBack='#FEF9FA' customBorder='2px dashed #F9D5DC' customBtnFontSize="14" customBtnColor="#6A7282" :customBtnHeight='custombtnheight'
- :customBtnWidth='custombtnwidth' :customBtnImage="custombtnimage" :customBtn='custombtn'
- :custom="uploadCustom" @on-progress="onProgress"></upload>
- </view>
- </view>
- </view>
- <!-- :disabled="true" -->
- <u-button @click="submit" class="commit" type="success">提交</u-button>
- </u-form>
- <view v-if="show == true">
- <u-popup v-model="show" mode="center" border-radius="20" width="560rpx" height="560rpx">
- <view class="successImg">
- <image src="../../static/img/liangmai/tijiaochenggong@3x.png" mode=""
- style="width: 180rpx;height: 180rpx;"></image>
- </view>
- <view class="successText">提交成功,等待平台审核。</view>
- <u-button type="success" style="width: 400rpx; margin: 20rpx auto; " shape="circle" @click="perfect">
- 完善更多信息</u-button>
- <view style="color: #AFB3BF;text-align: center;" @click="navBack1">返回</view>
- </u-popup>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- import upload from '@/components/upload.vue';
- export default {
- components: {
- upload
- },
- name: "buy",
- data() {
- return {
- action: this.$uploadUrl,
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- btnLoading: false,
- isAdd: true,
- uploadOptions: {
- "text": "上传封面图片",
- "bgc": ""
- },
- errorType: ['message'],
- uploadOptions1: {
- "text": "上传营业执照",
- "bgc": ""
- },
- mainBusinessType: [],
- uploadCustom: true,
- deptList: {
- companyProfile:''
- },
- management: [{
- name: "粮库",
- checked: false
- },
- {
- name: "加工厂",
- checked: false
- },
- {
- name: "烘干塔",
- checked: false
- },
- {
- name: "饲料厂",
- checked: false
- },
- {
- name: "养殖场",
- checked: false
- },
- {
- name: "粮贸",
- checked: false
- },
- {
- name: "期货",
- checked: false
- },
- ],
- types: [],
- show: false,
- // anNiuCss:"types",
- anNiuCss: [],
- custombtn:true,
- custombtnimage:'../../static/img/liangmai/ic_shanchuan@3x.png',
- custombtnwidth:50,
- custombtnheight:50,
- license1: "../../static/img/authentication/business@3x.png",
- license2: "../../static/img/authentication/business@3x.png",
- }
- },
- onLoad() {
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- getImgUrl(res) {
- console.log(res)
- this.deptList.attachmentAddress = res
- },
- naviageToPage(item) {
- uni.navigateTo({
- url: item
- })
- },
- getImgUrl1(res) {
- console.log(res)
- this.deptList.licenseAddress = res
- },
- singleClick(item) {
- if (this.mainBusinessType.indexOf(item) == -1) {
- this.mainBusinessType.push(item.name)
- item.checked = true
- }
- },
- filterFileType(index, lists) {
- if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
- lists.splice(index, 1);
- // 当前文件不支持
- uni.showModal({
- title: '暂不支持当前图片类型',
- showCancel: false
- });
- } else {
- this.isAdd = false;
- }
- },
- navBack() {
- uni.navigateBack()
- },
- navBack1() {
- this.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', this.deptList).then(res => {
- if (res.data.code == 200) {
- uni.navigateBack(1)
- }
- })
- },
- upload() {
- uni.navigateTo({
- url: `/`
- })
- },
- perfect() {
- this.show=false
- uni.navigateTo({
- url: `/pages/grain_pulse/perfect?deptList=`+JSON.stringify(this.deptList)
- })
- },
- submit() {
- var that = this
- if (!this.deptList.compName) {
- this.$api.msg('公司名称不能为空')
- return
- }
- if (this.mainBusinessType.length==0) {
- this.$api.msg('至少选择一个主营类型')
- return
- }
- if (!this.deptList.title) {
- this.$api.msg('标题不能为空')
- return
- }
- if (!this.deptList.companyProfile) {
- this.$api.msg('企业简介不能为空')
- return
- }
- if (!this.deptList.longitude&&!this.deptList.longitude) {
- this.$api.msg('上传坐标不能为空')
- return
- }
- if (!this.deptList.detailedAddress) {
- this.$api.msg('详细地址不能为空')
- return
- }
- if (!this.deptList.attachmentAddress) {
- this.$api.msg('封面照片不能为空')
- return
- }
- if (!this.deptList.licenseAddress) {
- this.$api.msg('营业执照不能为空')
- return
- }
- if (this.deptList.compName.length<2||this.deptList.compName.length>25) {
- this.$api.msg('公司名称输入错误')
- return
- }
- if (this.deptList.title.length<2||this.deptList.title.length>16) {
- this.$api.msg('标题长度2-16个字')
- return
- }
- if (this.deptList.companyProfile.length<10||this.deptList.companyProfile.length>60) {
- this.$api.msg('简介长度10-60个字')
- return
- }
- if (this.deptList.detailedAddress.length<2||this.deptList.detailedAddress.length>12) {
- this.$api.msg('详细地址2-12个字')
- return
- }
- // this.show = true
- // return
- this.deptList.mainBusinessType=this.mainBusinessType.toString()
- this.deptList.longitude='40.22077'
- this.deptList.latitude='116.23128'
- this.deptList.createPhone=this.userInfo.phone
- uni.showModal({
- content: "确定提交企业信息??",
- showCancel: true,
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- that.show = true
- // that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',that.deptList).then(res => {
- // if(res.data.code==200){
- // }
- // })
- // //成功后
- // if (res.data.code == 200) {
- // uni.showToast({
- // title: '提交成功',
- // icon: 'none',
- // duration: 2000
- // })
- // }
- }
- },
- })
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- .center {
- padding: 10rpx 20rpx;
- width: 100vw;
- height: 100vh;
- overflow: scroll;
- position:relative;z-index:2;
- }
- .bg{
- position:absolute;
- width:100%;
- left: 0;
- top:0;
- }
- .c-row {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- padding: 20rpx 30rpx;
- position: relative;
- }
- .con-list {
- -webkit-box-flex: 1;
- -webkit-flex: 1;
- flex: 1;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- -webkit-flex-direction: column;
- flex-direction: column;
- line-height: 40rpx;
- text-align: right;
- padding-right: 20rpx;
- font-size: 14px;
- }
- .con-list input {
- font-size: 14px !important;
- }
- .back-btn {
- position: absolute;
- left: 40upx;
- z-index: 9999;
- padding-top: var(--status-bar-height);
- top: 40upx;
- font-size: 40upx;
- color: #fff;
- }
- .title1 {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- top: 40upx;
- padding-top: var(--status-bar-height);
- z-index: 9999;
- color: #fff;
- font-size: 36rpx;
- }
- .choice {
- margin-top: 10px;
- display: inline-block;
- }
- .title {
- color: #71747C;
- }
- .types {
- background-color: #F4FAF8;
- text-align: center;
- border-radius: 20px;
- margin-left: 5px;
- padding:8px 19px;
- }
- .types1 {
- background-color: #22C572;
- text-align: center;
- border-radius: 20px;
- color: #FFFFFF;
- }
- .write {
- margin-right: 20px;
- color: #71747C;
- }
- .commit {
- margin-top: 20px;
- border: 0px;
- border-radius: 20px;
- }
- .modular {
- background-color: #FFFFFF;
- border-radius: 10px;
- margin-top: 10px;
- position:relative;z-index:2;
- padding:0 12.5px;
- }
- .forList {
- margin-top: 20px;
- }
- .titleUp {
- color: #FFFFFF;
- font-size: 44rpx;
- margin-top: 80px;
- margin-left: 10px;
- position: relative;
- z-index:2;
- }
- .upload {
- text-align: center;
- margin: 20px 0;
- margin-bottom: 20px;
- }
- .popups {
- width: 280px;
- height: 290px;
- border-radius: 20px;
- }
- .successImg {
- width: 90px;
- height: 90px;
- margin: 30px auto;
- }
- .successText {
- text-align: center;
- margin: 0 auto;
- font-size: 16px;
- }
- .companyProfilewrap{
- position:relative;
- width:100%;
- }
- .companyProfile{
- width:90%;height:138px;
- background:#F9F9FA;
- font-size:13px;
- padding:13px;
- border-radius:5px;
- }
- .companyProfilecontent{
- position:absolute;
- bottom:10px;
- right:15px;
- font-size:13px;
- }
- </style>
|