gjy 3 سال پیش
والد
کامیت
52e7bf3074

+ 2 - 0
components/upload.vue

@@ -283,6 +283,7 @@
 				immediate: true,
 				handler(val) {
 					val.map(value => {
+						console.log(1111)
 						this.lists.push({
 							url: value.url,
 							error: false,
@@ -522,6 +523,7 @@
 			},
 			// 预览图片
 			doPreviewImage(url, index) {
+				console.log(this.lists,url,index)
 				if (!this.previewFullImage) return;
 				const images = this.lists.map(item => item.url || item.path);
 				uni.previewImage({

+ 2 - 2
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
 	baseUrl: 'https://www.zthymaoyi.com',
-	// baseUrlNew: 'http://192.168.1.120:8090/',
-	baseUrlNew: 'http://api.eliangeyun.com/',
+	baseUrlNew: 'http://192.168.1.120:8090/',
+	// baseUrlNew: 'http://api.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 13 - 6
pages.json

@@ -22,12 +22,12 @@
 				"selectedIconPath": "static/img/jiaoyi_check.png",
 				"text": "交易"
 			},
-			// {
-			// 	"pagePath": "pages/grain_pulse/home",
-			// 	"iconPath": "static/img/liangmai.png",
-			// 	"selectedIconPath": "static/img/liangmai_check.png",
-			// 	"text": "粮脉"
-			// },
+			{
+				"pagePath": "pages/grain_pulse/home",
+				"iconPath": "static/img/liangmai.png",
+				"selectedIconPath": "static/img/liangmai_check.png",
+				"text": "粮脉"
+			},
 			{
 				"pagePath": "pages/tran/tran",
 				"iconPath": "static/img/wuliu.png",
@@ -147,6 +147,13 @@
 				"navigationBarTitleText": "我的粮脉"
 			}
 		},
+		{
+			"path": "pages/grain_pulse/editcompany",
+			"style": {
+				"enablePullDownRefresh": true,
+				"navigationBarTitleText": "我的粮脉"
+			}
+		},
 		{
 			"path": "pages/task/procurement_details",
 			"style": {

+ 841 - 0
pages/grain_pulse/editcompany.vue

@@ -0,0 +1,841 @@
+<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>
+			<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">{{position.longitude == undefined ? "未上传":'已上传'}}<text
+							class='tip_text cuIcon-right'></text></text>
+				</u-form-item>
+				<u-form-item label="所在区域" label-width="30%" class="title Regular">
+					<view style='text-align:right;width:100%;padding-right:10px;' v-if='position.province!=undefined'>
+						{{position.province}}
+					{{position.city}}
+					{{position.district}}
+					</view>
+					<view style='text-align:right;width:100%;padding-right:10px;' v-if='position.pname!=undefined'>
+						{{position.pname}}
+					{{position.cityname}}
+					{{position.adname}}
+					</view>
+					<view style='text-align:right;width:100%;padding-right:10px;' v-if='position.pname==undefined&&position.province==undefined'>
+						未上传坐标
+					</view>
+				</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 :file-list="fileList" class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+							:size-type="['compressed']" @on-success="getImgUrl" 
+							 @on-uploaded="isAdd = true" :before-upload="filterFileType"
+							:options="uploadOptions" @on-preview='onPreview' customBorder='2px dashed #D8DEF7' customBtnFontSize="14" customBtnColor="#6A7282" :customBtnHeight='custombtnheight'
+							 :customBtnWidth='custombtnwidth' customBack='#F9FAFE' :customBtnImage="custombtnimage" :customBtn='custombtn'
+							  :custom="uploadCustom" ></upload>
+					</view>
+					<view v-if="license2 != ''">
+						<upload :file-list="fileList1" class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+							:size-type="['compressed']" @on-success="getImgUrl1"
+							 @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" ></upload>
+					</view>
+				</view>
+			</view>
+			<!-- :disabled="true" -->
+			<view style='padding-bottom:10px;' class="modular">
+				<view class="title Medium">企业概况</view>
+				<!-- <u-input v-model="value" :type="type"  :height="height" :auto-height="autoHeight" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" /> -->
+				<textarea value="" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" class="areaText Regular"
+					v-model="deptList.companyContant" placeholder-style="color:#AFB3BF"/>
+				<view class="title Regular">添加标签(标签应突出企业特色,最多6个)</view>
+				<view style='flex-wrap:wrap;width: 100%;' class="flex ">
+					<view class="forLists" v-for="(item,index) in label" :Key="index">
+						<u-tag :text="item" mode="dark" class="forList Medium" shape="circle" :show="show"
+							:closeable="closeable" color="#22C572" @close="closeForList(index)" />
+					</view>
+					
+				</view>
+				<u-tag v-if='label.length<6' text="+" mode="plain" shape="circle" :show="show1" color="#2E2E2D" bg-color="#FFFFFF"
+						border-color="#F9F9FA" class="add" @click="add"></u-tag>
+				<view class="addinput addlabel flex" v-if="inputShow">
+					<u-input class='label' v-model="value" type="type" border focus v-if="inputShow"
+					 placeholder="请输入标签内容,不超过6个字" />
+					<u-button :type="types" class="inputOk" shape="circle" @click="addinput">确定</u-button>
+				</view>
+			</view>
+			<view style='padding-bottom:10px;' class="modular">
+				<view class="title Regular">场地照片(图片清晰,最多9张)</view>
+				<upload  :file-list="fileList2" class="upload" ref="upload" :action="action" :max-count="9"
+					:size-type="['compressed']" @on-success="getImgUrl2" @on-remove="onRemove"
+					@on-uploaded="isAdd = true" ></upload>
+			</view>
+			<view  style='padding-bottom:10px;' class="modular">
+				<view class="title Medium">联系方式</view>
+				<view v-for="(item,index) in Persons">
+					<view class="information flex">
+						<view class="xinxi">
+							<u-form-item label="姓名" label-width="30%" class="Regular" label-position="top"
+								style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
+								<u-input v-model="item.contacts" class="Regular" placeholder="请输入姓名" />
+							</u-form-item>
+						</view>
+						<view class="xinxi">
+							<u-form-item label="电话" label-width="30%" class="Regular" label-position="top"
+								style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
+								<u-input maxlength="15" type="digit" v-model="item.contactsPhone" class="Regular" placeholder="请输入电话" />
+							</u-form-item>
+						</view>
+						<div class="del" @click="delPerson(index)">
+							<span style="font-size: 46rpx; color: #22C572;">×</span>
+						</div>
+					</view>
+				</view>
+				<view class="addPerson" @click="addPerson">
+					<image src="../../static/img/liangmai/jia@3x.png" mode=""
+						style="width: 26rpx;height: 26rpx;top: 2rpx;"></image>
+					添加联系人
+				</view>
+			</view>
+			<view class="modular">
+				<u-form-item label="邮箱" label-width="30%" class="title Regular">
+					<u-input v-model="deptList.email" input-align="right" class="write Regular" placeholder="请输入电子邮箱" />
+				</u-form-item>
+				<u-form-item label="传真" label-width="30%" class="title Regular" :border-bottom="topBorder">
+					<u-input v-model="deptList.fax" input-align="right" class="write Regular" placeholder="请输入传真号" />
+				</u-form-item>
+			</view>
+			<u-button @click="submit" class="commit" type="success">提交</u-button>
+		</u-form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} 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": ""
+				},
+				fileList:[],
+				mainBusinessType: [],
+				uploadCustom: true,
+				deptList: {
+					compName:'',
+					title:'',
+					companyProfile:'',
+					province:'',
+					city:'',
+					area:''
+				},
+				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: [],
+				position:{
+					province:''
+				},
+				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",
+				label: [],
+				closeable: true,
+				show: true,
+				show1: true,
+				types: "",
+				inputShow: false,
+				value: "", //临时标签内容字段 后期更换
+				action: 'https://www.zthymaoyi.com/upload/admin',
+				fileList1: [],
+				imgList: [],
+				fileList2: [],
+				Persons: [{contacts:'',contactsPhone:''}],
+				topBorder: false,
+			}
+		},
+		onLoad(options) {
+			if(options.id){
+				this.id=options.id
+			}else if(this.$store.state.enter.id){
+				this.id=this.$store.state.enter.id
+			}
+			if(options.position){
+				this.position=JSON.parse(options.position)
+				this.position.city=this.position.city.toString()
+			}
+		},
+		onShow() {
+			console.log(11111)
+			this.getList()
+			if(this.$store.state.enter){
+				this.deptList.compName=this.$store.state.enter.compName
+				this.deptList.title=this.$store.state.enter.title
+				if(this.$store.state.enter.mainBusinessType){
+					this.mainBusinessType=this.$store.state.enter.mainBusinessType.split(',')
+					if(this.mainBusinessType.length>0){
+						for(var i=0;i<this.management.length;i++){
+							if(this.mainBusinessType.indexOf(this.management[i].name)!=-1){
+								this.management[i].checked=true
+							}
+						}
+					}
+				}
+				if(this.$store.state.enter.companyProfile){
+					this.deptList.companyProfile=this.$store.state.enter.companyProfile
+				}
+			}
+			
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		methods: {
+			onPreview(res,list){
+				console.log(res,list,11111)
+			},
+			getImgUrl(res) {
+				console.log(res)
+				this.deptList.attachmentAddress = res
+			},
+			getList(){
+				this.isLoadMore=true
+					this.$api.doRequest('get','/settledCompanyInfo/getSettledCompanyInfo',{id:this.id}).then(res => {
+					if(res.data.code==200){
+						this.isLoadMore=false
+						this.deptList=res.data.data
+						this.position.latitude=this.deptList.latitude
+						this.position.longitude=this.deptList.longitude
+						this.position.province=this.deptList.province
+						this.position.city=this.deptList.city
+						this.position.district=this.deptList.area
+						this.mainBusinessType=this.deptList.mainBusinessType.split(',')
+						if(this.mainBusinessType.length>0){
+							for(var i=0;i<this.management.length;i++){
+								if(this.mainBusinessType.indexOf(this.management[i].name)!=-1){
+									this.management[i].checked=true
+								}
+							}
+						}
+						this.fileList=[{url:this.deptList.attachmentAddress}]
+						this.fileList1=[{url:this.deptList.licenseAddress}]
+						console.log(this.fileList)
+						if(this.deptList.label.indexOf(',')!=-1){
+							this.label=this.deptList.label.split(',')
+						}else{
+							this.label=this.deptList.label
+						}
+						if(this.deptList.sitePhotoAddress.indexOf(',')!=-1){
+							this.imgList=this.deptList.sitePhotoAddress.split(',')
+						}else{
+							this.imgList=[this.deptList.sitePhotoAddress]
+						}
+						
+						for(var i=0;i<this.imgList.length;i++){
+							this.fileList2.push({url:this.imgList[i]})
+						}
+						this.Persons=this.deptList.settledCompanyContacts
+					}
+				})
+			},
+			naviageToPage(item) {
+				// console.log(this.enter)
+				var data={
+					compName:this.deptList.compName,
+					title:this.deptList.title,
+					mainBusinessType:this.mainBusinessType.toString(),
+					companyProfile:this.deptList.companyProfile,
+					id:this.id
+				}
+				console.log(this.$store)
+				this.$store.commit('enterchange',data)
+				// this.$store.dispatch('enterchange',data)
+				// this.enterchange()
+				var mainBusinessType=this.mainBusinessType.toString()
+				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) {
+						var data={
+							compName:'',
+							title:'',
+							mainBusinessType:'',
+							companyProfile:'',
+						}
+						that.$store.commit('enterchange',data)
+						uni.switchTab({
+							url:'/pages/grain_pulse/home'
+						})
+					}
+				})
+			},
+			upload() {
+				uni.navigateTo({
+					url: `/`
+				})
+			},
+			perfect() {
+				this.show=false
+				uni.navigateTo({
+					url: `/pages/grain_pulse/perfect?deptList=`+JSON.stringify(this.deptList)
+				})
+			},
+			add() {
+				if (this.label.length >= 6) {
+					this.inputShow = false
+				} else {
+					this.inputShow = true
+				}
+			},
+			getImgUrl2(res) {
+				console.log(res)
+				this.imgList.push(res);
+			},
+			addinput() {
+				if (!this.value) {
+					this.$api.msg('标签内容不能为空')
+					return
+				}
+				if (this.value.length < 2 || this.value.length > 6) {
+					this.$api.msg('标签内容输入有误')
+					return
+				}
+				this.label.push(this.value)
+				this.value = ""
+				this.inputShow = false
+			},
+			addPerson() {
+				this.Persons.push({
+					name: "",
+					phone: "",
+				})
+			},
+			delPerson(index) {
+				this.Persons.splice(index, 1)
+			},
+			closeForList(index) {
+				this.label.splice(index, 1)
+			},
+			onRemove(e) {
+				this.imgList.splice(e, 1)
+			},
+			uploadSuccess(e) {
+				this.imgList.push(e.url)
+			},
+			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.position.longitude&&!this.position.latitude) {
+					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=this.position.longitude
+				this.deptList.latitude=this.position.latitude
+				if(this.position.province!=undefined){
+					this.deptList.province=this.position.province
+					this.deptList.city=this.position.city
+					this.deptList.area=this.position.district
+				}else if(this.position.pname!=undefined){
+					this.deptList.province=this.position.pname
+					this.deptList.city=this.position.cityname
+					this.deptList.area=this.position.adname
+				}
+				
+				this.deptList.createPhone=this.userInfo.phone
+				
+				let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
+					for(var i=0;i<this.Persons.length;i++){
+						if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
+							this.$api.msg('联系人姓名2-10个字')
+							return
+						}
+						if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
+							this.$api.msg('联系人电话7-15位数字')
+							return
+						}
+					}
+					if(!re.test(this.deptList.email)){
+						this.$api.msg('邮箱输入错误')
+						return
+					}
+					if(this.deptList.fax.length<6||this.deptList.fax.length>20){
+						this.$api.msg('传真输入错误')
+						return
+					}
+					this.deptList.label=this.label.toString()
+					this.deptList.sitePhotoAddress=this.imgList.toString()
+					this.deptList.settledCompanyContacts=this.Persons
+				uni.showModal({
+					content: "详尽的企业信息有助于客户了解您的企业,是否确定提交?",
+					showCancel: true,
+					confirmText: '确定',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post','/settledCompanyInfo/api/editSettledCompanyInfo',that.deptList).then(res => {
+								if(res.data.code==200){
+									this.$api.msg('提交成功')
+								}else{
+									this.$api.msg(res.data.message)
+								}
+							})
+						}
+					},
+				})
+			}
+		}
+	}
+</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;
+	}
+.forList{
+    height: 32px;
+    background-color: #F4FAF8;
+    padding: 10px 15px;
+    color: #22C572;
+    margin-left: 12px;
+    text-align: center;
+}
+	.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;
+	}
+	.label{
+		padding-right:30px;
+		border:none;
+	}
+		.title {
+			margin-left: 20rpx;
+			color: #333333;
+			line-height: 70rpx;
+		}
+	
+		.write {
+			margin-right: 20px;
+			color: #71747C;
+		}
+	
+		.modular {
+			background-color: #FFFFFF;
+			border-radius: 12px;
+			margin-top: 10px;
+		}
+	
+		.areaText {
+			width: 83%;
+			padding: 30rpx;
+			border: 2rpx solid #F9F9FA;
+			background-color: #F9F9FA;
+			margin: 10rpx auto 20rpx;
+			border-radius: 20rpx;
+			color: #AFB3BF;
+			font-size: 28rpx;
+		}
+	
+		.add {
+			padding: 15rpx 30rpx;
+			width: 120rpx;
+			height: 65rpx;
+			text-align: center;
+			margin-left: 24rpx;
+			font-size: 30rpx;
+			font-weight: 600;
+			margin-bottom: 10rpx;
+			border:1px solid #DCDDDC;
+		}
+	
+		.forLists {
+			margin-bottom: 10rpx;
+		}
+	
+		.addinput {
+			width: 70%;
+			margin: 20rpx auto;
+			border-radius: 50rpx;
+		}
+	.addlabel{
+		background:#F6F6F6;
+		position:relative;
+		border-radius: 50rpx;height: 70rpx;font-size: 10px;
+		padding-right:40px;
+		line-height: 52rpx;
+		margin-bottom:10px;
+	}
+		.inputOk {
+			width: 100rpx;
+			border-radius: 40rpx;
+			background-color: #E9EAE9;
+			color: #FFFFFF;
+			height:70rpx;
+			border: none;
+			position:absolute;
+			right:0;
+		}
+		.picture {
+			width: 144rpx;
+			height: 144rpx;
+			border: 4rpx dashed #AFB3BF;
+		}
+	
+		.upload {
+			text-align: center;
+			margin: 0px 0;
+			margin-bottom: 10px;
+		}
+	
+		.addPerson {
+			width: 230rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			border: 2rpx solid #979797;
+			border-radius: 40rpx;
+			margin: 20rpx auto 20rpx;
+		}
+	
+		.information {
+			background-color: #F4FAF8;
+			width: 96%;
+			height: 180rpx;
+			margin: 0 auto;
+			border: 1rpx dashed #22C572;
+			border-radius: 10rpx;
+			margin-top: 30rpx;
+		}
+	
+		.xinxi {
+			margin-left: 70rpx;
+		}
+	
+		.del {
+			justify-content: flex-end;
+			margin: 10rpx 20rpx 0 0;
+		}
+</style>

+ 28 - 4
pages/grain_pulse/enter.vue

@@ -191,9 +191,23 @@
 			
 			if(options.position){
 				this.position=JSON.parse(options.position)
+				this.position.city=this.position.city.toString()
 			}
 		},
 		onShow() {
+			if(this.$store.state.enter){
+				this.deptList.compName=this.$store.state.enter.compName
+				this.deptList.title=this.$store.state.enter.title
+				this.mainBusinessType=this.$store.state.enter.mainBusinessType.split(',')
+				if(this.mainBusinessType.length>0){
+					for(var i=0;i<this.management.length;i++){
+						if(this.mainBusinessType.indexOf(this.management[i].name)!=-1){
+							this.management[i].checked=true
+						}
+					}
+				}
+				this.deptList.companyProfile=this.$store.state.enter.companyProfile
+			}
 			console.log(this.$store.state.enter)
 		},
 		computed: {
@@ -212,8 +226,9 @@
 					mainBusinessType:this.mainBusinessType.toString(),
 					companyProfile:this.deptList.companyProfile,
 				}
-				this.$store.dispatch('enterchange',data)
-				console.log(this.$store.state.enter)
+				console.log(this.$store)
+				this.$store.commit('enterchange',data)
+				// this.$store.dispatch('enterchange',data)
 				// this.enterchange()
 				var mainBusinessType=this.mainBusinessType.toString()
 				uni.navigateTo({
@@ -249,7 +264,16 @@
 			navBack1() {
 				this.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', this.deptList).then(res => {
 					if (res.data.code == 200) {
-						uni.navigateBack(1)
+						var data={
+							compName:'',
+							title:'',
+							mainBusinessType:'',
+							companyProfile:'',
+						}
+						that.$store.commit('enterchange',data)
+						uni.switchTab({
+							url:'/pages/grain_pulse/home'
+						})
 					}
 				})
 			},
@@ -331,7 +355,7 @@
 				
 				this.deptList.createPhone=this.userInfo.phone
 				uni.showModal({
-					content: "确定提交企业信息?",
+					content: "确定提交企业信息?",
 					showCancel: true,
 					confirmText: '确定',
 					success: function(res) {

+ 10 - 3
pages/grain_pulse/localtion/coordinate.nvue

@@ -162,9 +162,16 @@
 				// console.log("this.position",this.position)
 					// this.position.selectLocation = this.position.longitude+","+this.position.latitude
 					// console.log("this.position",this.position)
-				uni.navigateTo({
-						url:"/pages/grain_pulse/enter?position="+JSON.stringify(this.position)
-				})
+					if(this.$store.state.enter.id){
+						uni.navigateTo({
+							url:"/pages/grain_pulse/editcompany?position="+JSON.stringify(this.position)
+						})
+					}else{
+						uni.navigateTo({
+							url:"/pages/grain_pulse/enter?position="+JSON.stringify(this.position)
+						})
+					}
+				
 			}
 		}
 	}

+ 42 - 4
pages/grain_pulse/my_grain_pulse.vue

@@ -18,9 +18,10 @@
 						辽宁省营口市鲅鱼圈区xx路108号
 					</view>
 					<view>
-						<view class="button Regular">隐藏</view>
-						<view class="button Regular">编辑</view>
-						<view @click='del(item)' class="button Regular">删除</view>
+						<view v-if='item.showFlag==2' @click.stop='showHidden(item)' class="button Regular">显示</view>
+						<view v-if='item.showFlag==1' @click.stop='showHidden(item)' class="button Regular">隐藏</view>
+						<view @click.stop='edit(item)' class="button Regular">编辑</view>
+						<view @click.stop='del(item)' class="button Regular">删除</view>
 					</view>
 				</view>
 			</view>
@@ -66,6 +67,7 @@
 				currentPage: 1,
 				datalist:[],
 				status1:true,
+				isLoadMore:false,
 				searchTypes:[
 				{name:'我的企业',value:'1'},{name:'我的收藏',value:'1'}
 				],
@@ -77,16 +79,24 @@
 		},
 		onLoad(){
 			
+		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.currentPage += 1
+			}
+				this.getList()
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		methods: {
 			getList(){
+				this.isLoadMore=true
 				if(this.mainBusinessType=='我的企业'){
 					this.$api.doRequest('get','/settledCompanyInfo/selectSettledCompanyInfo',{mainBusinessType:'',pageSize: this.pageSize,
 							currentPage: this.currentPage,pcFlag:2}).then(res => {
 					if(res.data.code==200){
+						this.isLoadMore=false
 						this.datalist=res.data.data.records
 					}
 				})
@@ -108,6 +118,34 @@
 					}
 				})
 			},
+			edit(item){
+				if(item.status=='已驳回'||item.status=='已通过'){
+					uni.navigateTo({
+						url:'/pages/grain_pulse/editcompany?id='+item.id
+					})
+				}
+				
+			},
+			showHidden(item){
+				this.$api.doRequest('post','/settledCompanyInfo/api/showHidden',{id:item.id}).then(res => {
+					if(res.data.code==200){
+						if(item.showFlag==1){
+							item.showFlag=2
+							this.$api.msg('隐藏成功')
+						}else{
+							item.showFlag=1
+							this.$api.msg('显示成功')
+						}
+						
+					}else{
+						if(item.showFlag==1){
+							this.$api.msg('隐藏失败')
+						}else{
+							this.$api.msg('显示失败')
+						}
+					}
+				})
+			},
 			friendcircle(){
 				uni.navigateTo({
 					url:'/pages/grain_pulse/friendcircle'
@@ -252,7 +290,7 @@
 		border:1px solid #CDCDCD;
 		padding:6px 15px;
 		border-radius:15px;
-		margin:5px 5px;
+		margin:5px 3px;
 	}
 	.listitemStatus{
 		margin-left:2px;

+ 70 - 31
pages/grain_pulse/perfect.vue

@@ -12,14 +12,15 @@
 				<textarea value="" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" class="areaText Regular"
 					v-model="deptList.companyContant" placeholder-style="color:#AFB3BF"/>
 				<view class="title Regular">添加标签(标签应突出企业特色,最多6个)</view>
-				<view class="flex" style="width: 100%;">
+				<view style='flex-wrap:wrap;width: 100%;' class="flex ">
 					<view class="forLists" v-for="(item,index) in label" :Key="index">
 						<u-tag :text="item" mode="dark" class="forList Medium" shape="circle" :show="show"
 							:closeable="closeable" color="#22C572" @close="closeForList(index)" />
 					</view>
-					<u-tag text="+" mode="plain" shape="circle" :show="show1" color="#2E2E2D" bg-color="#FFFFFF"
-						border-color="#F9F9FA" class="add" @click="add"></u-tag>
+					
 				</view>
+				<u-tag v-if='label.length<6' text="+" mode="plain" shape="circle" :show="show1" color="#2E2E2D" bg-color="#FFFFFF"
+						border-color="#F9F9FA" class="add" @click="add"></u-tag>
 				<view class="addinput addlabel flex" v-if="inputShow">
 					<u-input class='label' v-model="value" type="type" border focus v-if="inputShow"
 					 placeholder="请输入标签内容,不超过6个字" />
@@ -28,9 +29,9 @@
 			</view>
 			<view style='padding-bottom:10px;' class="modular">
 				<view class="title Regular">场地照片(图片清晰,最多9张)</view>
-				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9"
-					:size-type="['compressed']" :options="uploadOptions" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
-					@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
+				<upload class="upload" ref="upload" :action="action" :max-count="9"
+					:size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
+					@on-uploaded="isAdd = true" ></upload>
 			</view>
 			<view  style='padding-bottom:10px;' class="modular">
 				<view class="title Medium">联系方式</view>
@@ -45,7 +46,7 @@
 						<view class="xinxi">
 							<u-form-item label="电话" label-width="30%" class="Regular" label-position="top"
 								style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
-								<u-input v-model="item.contactsPhone" class="Regular" placeholder="请输入电话" />
+								<u-input maxlength="15" type="digit" v-model="item.contactsPhone" class="Regular" placeholder="请输入电话" />
 							</u-form-item>
 						</view>
 						<div class="del" @click="delPerson(index)">
@@ -68,7 +69,7 @@
 				</u-form-item>
 			</view>
 		</u-form>
-		<u-button type="success" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
+		<u-button :type="buttonshow?'success':''" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
 	</view>
 </template>
 
@@ -91,18 +92,22 @@
 				action: 'https://www.zthymaoyi.com/upload/admin',
 				fileList: [],
 				imgList: [],
-				Persons: [],
+				Persons: [{contacts:'',contactsPhone:''}],
 				topBorder: false,
 			}
 		},
 		onLoad(options) {
-			this.deptList=JSON.parse(options.deptList)
-			console.log(this.deptList)
+			if(options.deptList){
+				this.deptList=JSON.parse(options.deptList)
+				console.log(this.deptList)
+			}
 		},
 		computed: {
-			show(){
-				if(!this.deptList.companyContant&&!this.deptList){
-					
+			buttonshow(){
+				if(!this.deptList.companyContant&&this.label.length==0&&this.imgList.length==0&&!this.deptList.email&&!this.deptList.fax){
+					return false
+				}else{
+					return true
 				}
 			}
 		},
@@ -143,31 +148,65 @@
 			closeForList(index) {
 				this.label.splice(index, 1)
 			},
-			imgRemove(e) {
+			onRemove(e) {
 				this.imgList.splice(e, 1)
 			},
 			uploadSuccess(e) {
 				this.imgList.push(e.url)
 			},
 			submit() {
-				var that=this
-				this.deptList.label=this.label.toString()
-				this.deptList.sitePhotoAddress=this.imgList.toString()
-				this.deptList.settledCompanyContacts=this.Persons
-				uni.showModal({
-					content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
-					showCancel: true,
-					confirmText: '提交',
-					success: function(res) {
-						if (res.confirm) {
-							that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
-								if (res.data.code == 200) {
-									uni.navigateBack(1)
-								}
-							})
+				
+				let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
+				if(this.buttonshow){
+					var that=this
+					for(var i=0;i<this.Persons.length;i++){
+						if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
+							this.$api.msg('联系人姓名2-10个字')
+							return
+						}
+						if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
+							this.$api.msg('联系人电话7-15位数字')
+							return
 						}
 					}
-				})
+					if(!re.test(this.deptList.email)){
+						this.$api.msg('邮箱输入错误')
+						return
+					}
+					if(this.deptList.fax.length<6||this.deptList.fax.length>20){
+						this.$api.msg('传真输入错误')
+						return
+					}
+					this.deptList.label=this.label.toString()
+					this.deptList.sitePhotoAddress=this.imgList.toString()
+					this.deptList.settledCompanyContacts=this.Persons
+					uni.showModal({
+						content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
+						showCancel: true,
+						confirmText: '提交',
+						success: function(res) {
+							if (res.confirm) {
+								that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
+									if (res.data.code == 200) {
+										var data={
+											compName:'',
+											title:'',
+											mainBusinessType:'',
+											companyProfile:'',
+										}
+										that.$store.commit('enterchange',data)
+										uni.switchTab({
+											url:'/pages/grain_pulse/home'
+										})
+									}else{
+										this.$api.msg(res.data.message)
+									}
+								})
+							}
+						}
+					})
+				}
+				
 			}
 		}
 	}

+ 9 - 15
store/index.js

@@ -11,7 +11,7 @@ try {
 }
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
-let saveStateKeys = ['firendItem','userData','userInfo','pushRes','myTip','taskTip','contractTip','liangxinTip','packet','linkItem','memberItem','memberItemIndex','chatItem','clientId','infoList'];
+let saveStateKeys = ['firendItem','userData','userInfo','enter','pushRes','myTip','taskTip','contractTip','liangxinTip','packet','linkItem','memberItem','memberItemIndex','chatItem','clientId','infoList'];
 
 // 保存变量到本地存储中
 const saveLifeData = function(key, value) {
@@ -44,12 +44,7 @@ const saveLifeData = function(key, value) {
 
 const store = new Vuex.Store({
 	state: {
-		enter:{
-			compName:'',
-			title:'',
-			mainBusinessType:'',
-			companyProfile:'',
-		},
+		enter:{},
 		hasLogin: false,
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		pushRes:lifeData.pushRes?lifeData.pushRes: {},
@@ -133,18 +128,17 @@ const store = new Vuex.Store({
 		configfreightChoice(state,val){
 			state.choice = val
 		}
+		,enterchange(state, provider) {
+	    console.log(state)
+		console.log(provider)  
+		state.enter = provider
+		console.log(state)
+		},
 		
 		
 	},
 	actions: {
-		enterchange(state, provider) {
-	    console.log(state)  
-		console.log(provider)  
-		state.compName = provider.compName;  
-		state.title = provider.title;  
-		state.mainBusinessType = provider.mainBusinessType;  
-		state.companyProfile = provider.companyProfile;  
-		},  
+		  
 	},
 	getters: {
 		getUserInfo(state) {