gjy 3 年 前
コミット
e13ded2ba2

+ 9 - 2
components/upload.vue

@@ -17,7 +17,7 @@
 				:src="item.url || item.path" :mode="imageMode"></image>
 		</view>
 		<slot name="file" :file="lists"></slot>
-		<view style="display: inline-block;" :class="custom&&options.bgc==''?'customStyle':'customStyleBgc'"
+		<view style="display: inline-block;" :class="custom?'customStyle':'default'"
 			@tap="selectFile" v-if="maxCount > lists.length">
 			<slot name="addBtn"></slot>
 			<img v-if="custom&&options.bgc!=''" :src="options.bgc" alt="" class="imgstyle">
@@ -26,7 +26,7 @@
 					height: width + 'rpx'
 				}">
 				<u-icon v-if="custom" name="camera-fill" class="" size="100" color="#617E8B"></u-icon>
-				<u-icon v-if="!custom" name="plus" class="u-add-btn" size="40"></u-icon>
+				<image v-if="!custom" style='width:23px;height:23px;' src="../static/img/liangmai/xiangji-2.png" mode=""></image>
 				<view v-if="!custom" class="u-add-tips">{{ uploadText }}</view>
 				<view v-if="custom" class="u-add-tips">{{ options.text }}</view>
 			</view>
@@ -720,4 +720,11 @@
 		height: 440rpx !important;
 		position: absolute;
 	}
+	.default{
+		
+		.u-list-item.u-add-wrap{
+			background:#fff;
+			border:1px dashed #AFB3BF;
+		}
+	}
 </style>

+ 67 - 16
pages/grain_pulse/details.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
-		<view class='swiper'>
+		<view v-if='sitePhotoAddress.length>0' class='swiper'>
 			<swiper class="screen-swiper header-swiper" ::class="dotStyle?'square-dot':'round-dot'"
 				:indicator-dots="false" :circular="true"  interval="5000" 
 				 :current="status" @change="topSwiperTab">
-				<swiper-item class="swiper-item" v-for="(item,index) in imagelist" :key="index"
-					:class="status==index?'text-white':''" @click="naviageToPage(item.url)">
-					<image :src="item.url"></image>
+				<swiper-item class="swiper-item" v-for="(item,index) in sitePhotoAddress" :key="index"
+					:class="status==index?'text-white':''">
+					<image :src="item"></image>
 					<!-- 	<view style='position:absolute;top:50%;left:50%;transform: translate(-50%,-50%);'>11111</view> -->
 				</swiper-item>
 			</swiper>
@@ -15,28 +15,22 @@
 			</view>
 			<view class='functionality'>
 				<image @click='show=true' class='jubao' src="../../static/img/liangmai/jubao.png" mode=""></image>
-				<image class='collect' :src="iscollect?'../../static/img/liangmai/shoucang1.png':'../../static/img/liangmai/shoucang-2.png'" mode=""></image>
+				<image @click='collect' class='collect' :src="companylist.collectionCompanyList.length>0?'../../static/img/liangmai/shoucang1.png':'../../static/img/liangmai/shoucang-2.png'" mode=""></image>
 			</view>
 		</view>
 		<view class='company'>
-			<view style='padding:21px;'>
+			<view style='padding:21px;padding-bottom:0;'>
 				<view style='font-size:24px;' class='Medium'>{{companylist.compName}}</view>
 				<view style='margin-top:3px;' class='flex'>
 					<view class='aptitude'>
 						<image class='aptitudeImage' :src="aptiutudeStatus?'../../static/img/liangmai/bg_no_check.png':'../../static/img/liangmai/bg_check.png'" mode=""></image>
 						<text class='aptitudeText Medium'>资质</text>
 					</view>
-					<view class='Regular' style='font-size:13px;'>主营:<text v-for='item in mainBusiness'> {{item}} </text></view>
+					<view class='Regular' style='font-size:13px;'>主营:<text style='display:inline-block;margin:3px;' v-for='item in mainBusiness'> {{item}} </text></view>
 				</view>
 				<view style='margin:12.5px 0;' class='flex'>
-					<view class="tag Regular">
-						超大规模
-					</view>
-					<view class="tag Regular">
-						超大规模
-					</view>
-					<view class="tag Regular">
-						超大规模
+					<view v-for='item in label' class="tag Regular">
+						{{item}}
 					</view>
 				</view>
 				
@@ -86,6 +80,9 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 	    components: {
 	        
@@ -112,12 +109,15 @@
 				show:false,
 				mainBusiness:[],
 				label:[],
+				sitePhotoAddress:[],
 				selector:['纠错','举报'],
 				aptiutudeStatus:false,
 				iscollect:false
 			}
 		},
-		
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
 		onLoad(options){
 			this.id=options.id
 		},
@@ -131,6 +131,9 @@
 					if(res.data.data.label){
 						that.label=res.data.data.label.split(',')
 					}
+					if(res.data.data.sitePhotoAddress){
+						that.sitePhotoAddress=res.data.data.sitePhotoAddress.split(',')
+					}
 				}
 			})
 			})
@@ -141,6 +144,54 @@
 				var that = this;
 				this.status = Number(e.target.current);
 			},
+			collect(){
+				var that=this
+				if(this.companylist.collectionCompanyList.length>0){
+					this.$api.doRequest('post','/settledCompanyInfo/api/collectionNot',{id:this.companylist.id,loginPhone:this.userInfo.phone}).then(res => {
+						if(res.data.code==200){
+								uni.showToast({
+									title: '取消收藏',
+									icon: 'none',
+									duration: 2000
+								})
+							that.$api.doRequest('get','/settledCompanyInfo/getSettledCompanyInfo',{id:that.id,pcFlag:2}).then(res => {
+								if(res.data.code==200){
+									that.companylist=res.data.data
+									that.mainBusiness=res.data.data.mainBusinessType.split(',')
+									if(res.data.data.label){
+										that.label=res.data.data.label.split(',')
+									}
+									if(res.data.data.sitePhotoAddress){
+										that.sitePhotoAddress=res.data.data.sitePhotoAddress.split(',')
+									}
+								}
+							})
+						}
+					})
+				}else{
+					this.$api.doRequest('post','/settledCompanyInfo/api/collection',{id:this.companylist.id,compName:this.companylist.compName,loginPhone:this.userInfo.phone}).then(res => {
+						if(res.data.code==200){
+							uni.showToast({
+								title: '收藏成功',
+								icon: 'none',
+								duration: 2000
+							})
+							that.$api.doRequest('get','/settledCompanyInfo/getSettledCompanyInfo',{id:that.id,pcFlag:2}).then(res => {
+								if(res.data.code==200){
+									that.companylist=res.data.data
+									that.mainBusiness=res.data.data.mainBusinessType.split(',')
+									if(res.data.data.label){
+										that.label=res.data.data.label.split(',')
+									}
+									if(res.data.data.sitePhotoAddress){
+										that.sitePhotoAddress=res.data.data.sitePhotoAddress.split(',')
+									}
+								}
+							})
+						}
+					})
+				}	
+			},
 			selecttype(e){
 				console.log(e)
 				if(e[0]==1){

+ 1 - 1
pages/grain_pulse/enter.vue

@@ -179,7 +179,7 @@
 			},
 			perfect() {
 				uni.navigateTo({
-					url: `/pages/grain_pulse/perfect`
+					url: `/pages/grain_pulse/perfect?deptList=`+JSON.stringify(this.deptList)
 				})
 			},
 			submit() {

+ 94 - 17
pages/grain_pulse/errorcorrection.vue

@@ -1,22 +1,19 @@
 <template>
 	<view>
-		<view class="Regular header-title">我是公司名称我是公司名称</view>
+		<view class="Regular header-title">{{jubaolist.compName}}</view>
 		<view class='content'>
 			<view class='matter'>
 				<view class="title Regular">纠错事项<text style='color:#FB1E1E;'>*</text></view>
 				<view style='position:relative;'>
-					<textarea class='textarea Regular' maxlength="150" v-model='status' placeholder="请输入举报事项" placeholder-style="color:#AFB3BF;" />
-					<view class='Regular words'>{{status.length}}/150个字</view>
+					<textarea class='textarea Regular' maxlength="150" v-model='jubaolist.error' placeholder="请输入举报事项" placeholder-style="color:#AFB3BF;" />
+					<view class='Regular words'>{{jubaolist.error.length}}/150个字</view>
 				</view>
 			</view>
 			<view class="uploading">
 				<view class="title Regular">上传图片</view>
-				<u-upload width='140' height='140' :file-list="fileList" :custom-btn="true"  :show-upload-list="showUploadList" ref="uUpload" :max-size="5 * 1024 * 1024" max-count="6" :action="$uploadUrl">
-					<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
-						<image style='width:23px;height:23px;margin-top:10px;' src="../../static/img/liangmai/xiangji-2.png" mode=""></image>
-						<view style='color:#AFB3BF;font-size:10px;' class='Medium'>上传图片</view>
-					</view>
-				</u-upload>
+				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="6"
+					: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>
 			</view>
 		</view>
 		<view class="commitwrap">
@@ -27,26 +24,106 @@
 </template>
 
 <script>
+		import upload from '@/components/upload.vue';
 	export default {
-	    components: {
-	        
-	    },
+	   components: {
+	   	upload
+	   },
 		data() {
 			return {
+				action: this.$uploadUrl,
+				maxSize: 5 * 1024 * 1024, //限制文件大小 5M
+				btnLoading: false, //防止重复点击
+				isAdd: true,
+				imgUrls: [],
 				status:'',
-				fileList:[]
+				fileList:[],
+				jubaolist:{
+					error:''
+				},
+				uploadOptions: {
+					"text": "",
+					"bgc": ""
+				},
 			}
 		},
 		onReady() {
 			// 得到整个组件对象,内部图片列表变量为"lists"
-			this.fileList = this.$refs.uUpload.lists;
+			// this.fileList = this.$refs.uUpload.lists;
 		},
-		onLoad(){
-			
+		onLoad(options){
+			this.jubaolist.id=options.id
+			this.jubaolist.compName=options.compName
 		},
 		methods: {
+			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;
+				}
+			},
+			getImgUrl(res) {
+				console.log(res)
+				console.log('------------res-----------')
+				this.imgUrls.push(res);
+			},
 			commit(){
-				console.log(this.fileList)
+				var that=this
+				this.jubaolist.address=this.imgUrls.toString()
+				uni.showModal({
+					content: "确定提交纠错内容?",
+					showCancel: true,
+					confirmText: '确定',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyError',that.jubaolist).then(res => {
+								if(res.data.code==200){
+									uni.showToast({
+									title: '感谢您的反馈,平台会尽快核实',
+									icon: 'none',
+									duration: 2000
+									})
+									uni.navigateBack({
+										
+									})
+								}else{
+									uni.showToast({
+									title: res.message,
+									icon: 'none',
+									duration: 2000
+									})
+								}
+							})
+						}
+					},
+				})
+			},
+				//删除一张图片的回调,lists这是成功删除一个图片后,还剩余的图片集合
+				onRemove(data, lists){
+				    //lists.length > 0说明删除之前已经上传了多余两张的图片
+					if(lists.length > 0 ){
+						var currentfileList = [];
+						//遍历this.fileList 与剩余的lists进行匹配,来组成一个新的格式合适的剩余图片集合
+						this.fileList.forEach((item, index)=>{
+							lists.forEach((item1, index1)=>{
+								if(item.name == JSON.parse(item1.response).name){
+									 currentfileList.push(item);
+								}
+							});
+						})
+						//删除后对图片集合及时冬天更新,即对this.fileList重新赋值
+						this.fileList = currentfileList;
+					}else{//说明删除之前只有一张图片,删除成功后把this.fileList清空即可
+						this.fileList = [];
+					}
+					this.form.pictureUrl = JSON.stringify(this.fileList)
+					//console.log("打印图片List:onRemove", this.fileList);
 			}
 		}
 	}

+ 64 - 22
pages/grain_pulse/jubao.vue

@@ -11,8 +11,9 @@
 			</view>
 			<view class="uploading">
 				<view class="title Regular">上传图片</view>
-				<upload class="upload" ref="upload" :action="$ossUrl" :max-size="maxSize" :max-count="1"
-					:size-type="['compressed']" @on-success="onSuccess"></upload>
+				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="6"
+					: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>
 			</view>
 		</view>
 		<view class="commitwrap">
@@ -23,45 +24,86 @@
 </template>
 
 <script>
-	import upload from '@/components/upload_small.vue';
+		import upload from '@/components/upload.vue';
 	export default {
-	    components: {
-	        upload
-	    },
+	   components: {
+	   	upload
+	   },
 		data() {
 			return {
+				action: this.$uploadUrl,
+				maxSize: 5 * 1024 * 1024, //限制文件大小 5M
+				btnLoading: false, //防止重复点击
+				isAdd: true,
+				imgUrls: [],
 				status:'',
 				fileList:[],
 				jubaolist:{
 					error:''
-				}
+				},
+				uploadOptions: {
+					"text": "",
+					"bgc": ""
+				},
 			}
 		},
 		onReady() {
 			// 得到整个组件对象,内部图片列表变量为"lists"
-			this.fileList = this.$refs.uUpload.lists;
+			// this.fileList = this.$refs.uUpload.lists;
 		},
 		onLoad(options){
 			this.jubaolist.id=options.id
 			this.jubaolist.compName=options.compName
 		},
 		methods: {
+			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;
+				}
+			},
+			getImgUrl(res) {
+				console.log(res)
+				console.log('------------res-----------')
+				this.imgUrls.push(res);
+			},
 			commit(){
-				console.log(this.fileList,this.$uploadUrl)
+				var that=this
+				this.jubaolist.address=this.imgUrls.toString()
+				uni.showModal({
+					content: "确定提交举报内容?",
+					showCancel: true,
+					confirmText: '确定',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyError',that.jubaolist).then(res => {
+								if(res.data.code==200){
+									uni.showToast({
+									title: '感谢您的反馈,平台会尽快核实',
+									icon: 'none',
+									duration: 2000
+									})
+									uni.navigateBack({
+										
+									})
+								}else{
+									uni.showToast({
+									title: res.message,
+									icon: 'none',
+									duration: 2000
+									})
+								}
+							})
+						}
+					},
+				})
 			},
-			//图片成功上传后的回调 data为服务器返回的数据,包括图片的存放地址和名称
-				onSuccess(data, index, lists){
-					console.log(data, index, lists)
-					//页面上定义的临时存放图片的对象,提示也保存后台返回的图片名称
-					// let currentFile = {name: '', url: ''};
-					// currentFile.name = JSON.parse(data).name;
-					// currentFile.url = JSON.parse(data).imgUrl;
-					// //成功上传一个图片就往fileList里面添加一个图片对象
-					// this.fileList.push(currentFile);
-					// //this.form.pictureUrl为后台图片字段来保存字符串类型的图片集合
-					// this.form.pictureUrl = JSON.stringify(this.fileList)
-					//console.log("打印图片List:onSuccess", this.fileList);
-				},
 				//删除一张图片的回调,lists这是成功删除一个图片后,还剩余的图片集合
 				onRemove(data, lists){
 				    //lists.length > 0说明删除之前已经上传了多余两张的图片

+ 19 - 8
pages/grain_pulse/perfect.vue

@@ -28,8 +28,9 @@
 			</view>
 			<view class="modular">
 				<view class="title Regular">场地照片(图片清晰,最多9张)</view>
-				<u-upload :action="action" :file-list="fileList" @on-success="uploadSuccess" @on-remove="imgRemove"
-					:max-count="9"></u-upload>
+				<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>
 			</view>
 			<view class="modular">
 				<view class="title Medium">联系方式</view>
@@ -72,7 +73,11 @@
 </template>
 
 <script>
+	import upload from '@/components/upload.vue';
 	export default {
+	   components: {
+	   	upload
+	   },
 		data() {
 			return {
 				deptList: {},
@@ -93,6 +98,9 @@
 				topBorder: false,
 			}
 		},
+		onLoad(options) {
+			console.log(options)
+		},
 		methods: {
 			add() {
 				if (this.label.length >= 6) {
@@ -167,11 +175,11 @@
 	.modular {
 		background-color: #FFFFFF;
 		border-radius: 12px;
-		margin-top: 20px;
+		margin-top: 10px;
 	}
 
 	.areaText {
-		width: 90%;
+		width: 83%;
 		padding: 30rpx;
 		border: 2rpx solid #F9F9FA;
 		background-color: #F9F9FA;
@@ -190,6 +198,7 @@
 		font-size: 30rpx;
 		font-weight: 600;
 		margin-bottom: 10rpx;
+		border:1px solid #DCDDDC;
 	}
 
 	.forLists {
@@ -218,7 +227,6 @@
 		color: #FFFFFF;
 		border: none;
 	}
-
 	.picture {
 		width: 144rpx;
 		height: 144rpx;
@@ -226,10 +234,10 @@
 	}
 
 	.upload {
-		height: 140rpx;
+		height: 250rpx;
 		text-align: center;
-		margin: 20px 0;
-		margin-bottom: 20px;
+		margin: 0px 0;
+		margin-bottom: 10px;
 	}
 
 	.addPerson {
@@ -254,6 +262,9 @@
 
 	.xinxi {
 		margin-left: 70rpx;
+		.u-input input{
+			font-size:17px;
+		}
 	}
 
 	.del {

+ 10 - 4
pages/public/code.vue

@@ -171,10 +171,16 @@
 					})
 					this.$api.doRequest('get','/commonUser/loginVerifyCode',{phone:this.phone,verifyCode:this.inputList,cid:this.clientId}).then(res => {
 					    if(res.data.code==200){
-							this.$api.doRequest('post','/auth/api/loginEnhanced',{companyName: "易粮易运",
-password: "y123456",
-username: "13333333333"}).then(res1 => {
-								uni.setStorageSync('pcUserInfo', res1.data.data)
+							this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.phone,
+							veriCode: "123456",}).then(res1 => {
+								if(res1.data.code==200){
+									uni.setStorageSync('pcUserInfo', res1.data.data)
+								}else{
+									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+									veriCode: "123456",}).then(res2 => {
+										uni.setStorageSync('pcUserInfo', res2.data.data)
+									})
+								}
 							})
 							uni.setStorageSync('userInfo', res.data.data)
 					        that.$store.commit('login', res.data.data)

+ 11 - 4
pages/public/login_account_number.vue

@@ -110,10 +110,17 @@
 				this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password,cid:this.clientId}).then(res => {
 					if(res.data.code==200){
 						uni.setStorageSync('userInfo', res.data.data)
-						this.$api.doRequest('post','/auth/api/loginEnhanced',{companyName: "易粮易运",
-password: "y123456",
-username: "13333333333"}).then(res1 => {
-							uni.setStorageSync('pcUserInfo', res1.data.data)
+						this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.phone,
+						veriCode: "123456",}).then(res1 => {
+							if(res1.data.code==200){
+								uni.setStorageSync('pcUserInfo', res1.data.data)
+							}else{
+								that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+								veriCode: "123456",}).then(res2 => {
+									uni.setStorageSync('pcUserInfo', res2.data.data)
+								})
+							}
+							
 						})
 						that.$store.commit('login', res.data.data)
 						var name = 'userInfo';

+ 10 - 4
pages/public/register.vue

@@ -223,10 +223,16 @@
 							
 							if(res.data.code==200){
 								// pc登录
-								this.$api.doRequest('post','/auth/api/loginEnhanced',{companyName: "易粮易运",
-password: "y123456",
-username: "13333333333"}).then(res1 => {
-									uni.setStorageSync('pcUserInfo', res1.data.data)
+							this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.phone,
+							veriCode: "123456",}).then(res1 => {
+									if(res1.data.code==200){
+										uni.setStorageSync('pcUserInfo', res1.data.data)
+									}else{
+										that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+										veriCode: "123456",}).then(res2 => {
+											uni.setStorageSync('pcUserInfo', res2.data.data)
+										})
+									}
 								})
 								uni.setStorageSync('userInfo', res.data)
 								that.$store.commit('login', res.data)

+ 10 - 4
pages/public/reset.vue

@@ -153,10 +153,16 @@
 						})
 						this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password}).then(req => {
 						if(res.data.code==200){
-							this.$api.doRequest('post','/auth/api/loginEnhanced',{companyName: "易粮易运",
-password: "y123456",
-username: "13333333333"}).then(res1 => {
-								uni.setStorageSync('pcUserInfo', res1.data.data)
+					this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.phone,
+					veriCode: "123456",}).then(res1 => {
+								if(res1.data.code==200){
+									uni.setStorageSync('pcUserInfo', res1.data.data)
+								}else{
+									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+									veriCode: "123456",}).then(res2 => {
+										uni.setStorageSync('pcUserInfo', res2.data.data)
+									})
+								}
 							})
 							uni.setStorageSync('userInfo', req.data.data)
 							that.$store.commit('login', req.data.data)