gjy преди 3 години
родител
ревизия
2199badf68
променени са 6 файла, в които са добавени 85 реда и са изтрити 14 реда
  1. 1 1
      main.js
  2. 2 2
      pages/grain_pulse/details.vue
  3. 4 1
      pages/grain_pulse/enter.vue
  4. 1 1
      pages/grain_pulse/home.vue
  5. 50 8
      pages/grain_pulse/jubao.vue
  6. 27 1
      pages/grain_pulse/my_grain_pulse.vue

+ 1 - 1
main.js

@@ -37,7 +37,7 @@ let urlAddress = 'liangxin.zthymaoyi.com'
 Vue.prototype.$url = 'https://'+urlAddress+'/upload/'
 Vue.prototype.$uploadUrl = 'https://'+urlAddress+'/file/upload'
 Vue.prototype.$ws = 'wss://'+urlAddress+'/chat'
-Vue.prototype.$ossUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/appData'
+Vue.prototype.$ossUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/'
 Vue.prototype.utils = utils
 
 // let urlAddress = 'localhost'

+ 2 - 2
pages/grain_pulse/details.vue

@@ -145,11 +145,11 @@
 				console.log(e)
 				if(e[0]==1){
 					uni.navigateTo({
-						url:'/pages/grain_pulse/jubao'
+						url:'/pages/grain_pulse/jubao?id='+this.companylist.id+'&compName='+this.companylist.compName
 					})
 				}else{
 					uni.navigateTo({
-						url:'/pages/grain_pulse/errorcorrection'
+						url:'/pages/grain_pulse/errorcorrection?id='+this.companylist.id+'&compName='+this.companylist.compName
 					})
 				}
 			},

+ 4 - 1
pages/grain_pulse/enter.vue

@@ -75,7 +75,7 @@
 				<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="navBack">返回</view>
+				<view style="color: #AFB3BF;text-align: center;" @click="navBack1">返回</view>
 			</u-popup>
 
 		</view>
@@ -162,6 +162,9 @@
 					this.isAdd = false;
 				}
 			},
+			navBack() {
+				uni.navigateBack()
+			},
 			navBack() {
 				this.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',this.deptList).then(res => {
 					if(res.data.code==200){

+ 1 - 1
pages/grain_pulse/home.vue

@@ -4,7 +4,7 @@
 			<view class="flex justify-between map">
 				<view class='Medium flex align-item-center locationwrap' @click='naviageToPage("/pages/grain_pulse/position/position")'>
 					<image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
-					黑龙江中天昊元…
+					未指定位置
 				</view>
 				<view @click='naviageToPage("/pages/grain_pulse/distribution/distribution")' class='Regular flex align-item-center distribution justify-center'>
 					<image class='cangku' src="../../static/img/liangmai/cangku.png" mode=""></image>

+ 50 - 8
pages/grain_pulse/jubao.vue

@@ -1,17 +1,17 @@
 <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">
+				<u-upload  @on-remove="onRemove" @on-success="onSuccess" @on-error='onError' width='140' height='140' :file-list="fileList" :custom-btn="true"  ref="uUpload" :max-size="5 * 1024 * 1024" max-count="6" :action="$ossUrl">
 					<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>
@@ -34,19 +34,61 @@
 		data() {
 			return {
 				status:'',
-				fileList:[]
+				fileList:[],
+				jubaolist:{
+					error:''
+				}
 			}
 		},
 		onReady() {
 			// 得到整个组件对象,内部图片列表变量为"lists"
 			this.fileList = this.$refs.uUpload.lists;
 		},
-		onLoad(){
-			
+		onLoad(options){
+			this.jubaolist.id=options.id
+			this.jubaolist.compName=options.compName
 		},
 		methods: {
 			commit(){
-				console.log(this.fileList)
+				console.log(this.fileList,this.$uploadUrl)
+			},
+			//图片成功上传后的回调 data为服务器返回的数据,包括图片的存放地址和名称
+				onSuccess(data, index, lists){
+					console.log('https://taohaoliang.oss-cn-beijing.aliyuncs.com/appData/'+data.data)
+					// 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);
+				},
+				onError(res, index, lists, name){
+					console.log(res, index, lists, name)
+				},
+				//删除一张图片的回调,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);
 			}
 		}
 	}

+ 27 - 1
pages/grain_pulse/my_grain_pulse.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view style='margin-bottom:70px;'>
 		<scroll-view  scroll-x="true" scroll-with-animation="true" class='list-type'>
 			<view  v-for='item in searchTypes' @click='changetype(item)' :class='mainBusinessType==item.name?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
 		</scroll-view>
@@ -41,6 +41,9 @@
 					<view class='distance Regular'>50m</view>
 				</view>
 			</view>
+			<view v-if='mainBusinessType=="我的企业"' class='exitloginwrap'>
+				<button @click='enter()' class='exitlogin'>新增</button>
+			</view>
 		</view>
 	</view>
 </template>
@@ -109,6 +112,12 @@
 					url:item
 				})
 			},
+			enter(){
+				//入驻
+				uni.navigateTo({
+					url:'/pages/grain_pulse/enter'
+				})
+			},
 			changetype(item){
 				this.mainBusinessType=item.name
 				this.getList()
@@ -246,5 +255,22 @@
 	.listitemStatus.pass{
 		color:#22C572;
 	}
+	.exitloginwrap{
+		position:fixed;
+		bottom:0;
+		left:0;
+		width:100%;
+		padding-bottom:20px;
+	}
+	.exitlogin{
+		width:90%;
+		background:#22C572;
+		border-radius:30px;
+		color:#fff;
+		font-size:17px;
+	}
+	.exitlogin:after{
+		border:none;
+	}
 </style>