Selaa lähdekoodia

perf: 优化暂存

lizhaocai 3 kuukautta sitten
vanhempi
commit
6ce1297535

+ 72 - 18
circlePages/addShare.vue

@@ -9,7 +9,7 @@
 				<view style="flex:1;margin-left:25px">
 					<text>发布供应</text>
 				</view>
-				<view v-if="(selectValue=='个人'&&stepIndex==3)||(selectValue=='公司'&&stepIndex==3)">
+				<view>
 					<button plain="true" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#1d60b1;border-color:#1d60b1;" @click="saveForm(1)">暂存</button>
 					<!-- <text style="margin-right: 4px;padding: 6px 15px;background-color:#00000026;border-radius: 30px;color: #3D7EFF;" @click="saveForm(1)">暂存</text> -->
 				</view>
@@ -452,11 +452,7 @@
 						text: '其他'
 					}
 				],
-				extList: [{
-					prodDesc: "",
-					prodName: "",
-					prodSpec: "",
-				}],
+				extList: [],
 				// 机械五金/仪器仪表/耗材/其他
 				formInfo: {
 					jobTitle: '',
@@ -521,6 +517,8 @@
 				searchValue: '',
 				items: [],
 				org: {},
+				isEdit:false,
+				editItem:{}
 			}
 		},
 		watch: {
@@ -535,7 +533,50 @@
 				
 			}
 		},
-		onLoad() {
+		onLoad(props) {
+			console.error(props.sid);
+			if(props.sid){
+				this.isEdit = true;
+				this.editItem = JSON.parse(uni.getStorageSync(props.sid)||'{}');
+				
+				this.content = this.editItem.content;
+				this.selectValue2 = this.editItem.type==1?'产品':'服务';
+				this.selectValue3 = this.editItem.secType;
+				this.brand = this.editItem.brand;
+				this.selectValue = this.editItem.subject=='1'?'公司':'个人';
+				
+				
+				this.fileDetailList = this.editItem.fileDetailList;
+				
+				for(let i=0;i<this.fileDetailList.length;i++){
+					this.fileDetailList[i].path = this.fileDetailList[i].ftpUrl
+					if(this.isImage(this.fileDetailList[i].fileName)){
+						this.imgList.push({
+							name: this.fileDetailList[i].fileName,
+							url: this.fileDetailList[i].ftpUrl,
+							path: this.fileDetailList[i].path
+						})
+					}else{
+						this.imgList.push({
+							name: this.fileDetailList[i].fileName,
+							url: this.fileDetailList[i].ftpUrl,
+							path: this.fileDetailList[i].path
+						})
+					}
+				}
+				
+				if(this.selectValue2=='产品'){
+					this.selectValue4 = this.editItem.secType;
+				    this.isMedical = this.editItem.isMedical;
+					this.extList = this.editItem.shareExt;
+				}
+				
+				this.org.name = this.editItem.company;
+				this.formInfo.jobTitle = this.editItem.jobTitle;
+				this.formInfo.contactPerson = this.editItem.contactPerson;
+				this.formInfo.contactMethod = this.editItem.contactMethod;
+				this.formInfo.contactNickName = this.formInfo.contactNickName;
+			}
 			this.getCompany();
 		},
 		methods: {
@@ -545,6 +586,13 @@
 			nextStep() {
 				//todo 检查
 				 let that = this;
+				 if(this.stepIndex==1&&this.extList.length==0){
+					 this.extList.push({
+					 	prodDesc: "",
+					 	prodName: "",
+					 	prodSpec: "",
+					 })
+				 }
 					if(this.stepIndex==2&&that.selectValue2=='产品'){
 						for(let i=0;i<this.extList.length;i++){
 							if(!this.extList[i].prodName||!this.extList[i].prodSpec){
@@ -556,6 +604,7 @@
 								return false;
 							}
 						}
+						
 					}
 					if(this.stepIndex==2&&that.selectValue2=='服务'){
 						 
@@ -631,15 +680,8 @@
 					return false;
 				}
 				let that = this;
-				if(this.formInfo.agree.length<1){
-					uni.showToast({
-						title: '请勾选同意平台核查所填信息的真实性',
-						duration: 2000,
-						icon:'none'
-					});
-					return false;
-				}
-				if(that.selectValue2=='服务'){
+				
+				if(status!=1&&that.selectValue2=='服务'){
 					if(!this.content&&this.fileDetailList.length<1){
 						uni.showToast({
 							title: '请输入服务介绍或上传图片/文件',
@@ -650,7 +692,7 @@
 					}
 				}
 				
-				if(that.selectValue2=='产品'){
+				if(status!=1&&that.selectValue2=='产品'){
 					 
 					for(let i=0;i<this.extList.length;i++){
 						if(!this.extList[i].prodName||!this.extList[i].prodSpec){
@@ -664,6 +706,15 @@
 					}
 				}
 				
+				if(status!=1&&this.formInfo.agree.length<1){
+					uni.showToast({
+						title: '请勾选同意平台核查所填信息的真实性',
+						duration: 2000,
+						icon:'none'
+					});
+					return false;
+				}
+				
 				let params = {
 
 				};
@@ -680,6 +731,9 @@
 						userNo: uni.getStorageSync('userNo'),
 						status: status==1?status:undefined,
 						brand: that.brand,
+						id: that.isEdit?that.editItem.id:undefined,
+						bisNo: that.isEdit?that.editItem.bisNo:undefined,
+						version: that.isEdit?that.editItem.version:undefined
 				}
 				if(that.selectValue=='公司'){
 					postData.companyEntity = {};
@@ -725,7 +779,7 @@
 					icon:'none'
 				});
 				that.canSave = false;
-				request.post('/slbResourceShare/add', params).then(res => {
+				request.post(that.isEdit?'/slbResourceShare/update':'/slbResourceShare/add', params).then(res => {
 					that.canSave = true;
 					if (res.success) {
 						uni.showToast({

+ 6 - 6
circlePages/circle.vue

@@ -11,7 +11,7 @@
 				<view style="flex:1;margin-left:25px">
 					<text>发布需求</text>
 				</view>
-				<view v-if="stepIndex==2">
+				<view>
 					<button plain="true" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#1d60b1;border-color:#1d60b1;" @click="saveForm(1)">暂存</button>
 <!-- 					<text style="margin-right: 4px;padding: 6px 15px;background-color:#00000026;border-radius: 30px;color: #3D7EFF;" @click="saveForm(1)">暂存</text> -->
 				</view>
@@ -379,7 +379,7 @@
 					
 				};
 				
-				if(!this.org.name){
+				if(status!=1&&!this.org.name){
 					uni.showToast({
 						title: '请检查公司名称是否准确',
 						duration: 2000,
@@ -390,7 +390,7 @@
 				
 				
 				
-				if(this.formInfo.jobTitle.length<1){
+				if(status!=1&&this.formInfo.jobTitle.length<1){
 					uni.showToast({
 						title: '请输入您的职称',
 						duration: 2000,
@@ -398,7 +398,7 @@
 					});
 					return false;
 				}
-				if(this.formInfo.contactPerson.length<1){
+				if(status!=1&&this.formInfo.contactPerson.length<1){
 					uni.showToast({
 						title: '请输入联系人姓名',
 						duration: 2000,
@@ -406,7 +406,7 @@
 					});
 					return false;
 				}
-				if(this.formInfo.contactMethod.length<1){
+				if(status!=1&&this.formInfo.contactMethod.length<1){
 					uni.showToast({
 						title: '请输入联系手机/微信/邮箱',
 						duration: 2000,
@@ -415,7 +415,7 @@
 					return false;
 				}
 				
-				if(this.formInfo.agree.length<1){
+				if(status!=1&&this.formInfo.agree.length<1){
 					uni.showToast({
 						title: '请勾选同意平台核查所填信息的真实性',
 						duration: 2000,

+ 56 - 0
pages/mine/share.vue

@@ -39,6 +39,49 @@
 								</view>
 							</view>
 						</view>
+						 
+										<!-- 状态(1:暂存,2:待处理,3:审核中,4:已通过,9:已拒绝,10:已取消) -->
+										<view v-if="item.status=='1'"
+											class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
+											<text class="" style="background: #3F51B542;font-size: 12px;
+									padding: 8px;
+									color: #333333;
+									border-radius: 24px;
+									 ">暂存</text>
+										</view>
+										<view v-if="item.status=='3'"
+												class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
+												<text class="" style="background: #3f51b56b;font-size: 12px;
+										padding: 8px;
+										color: #ff0;
+										border-radius: 24px;
+										 ">审核中</text>
+											</view>
+										<view v-if="item.status=='4'&&item.showFlag!='否'"
+												class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
+												<text class="" style="background: #3F51B542;font-size: 12px;
+										padding: 8px;
+										color: #007000;
+										border-radius: 24px;
+										 ">已通过</text>
+											</view>
+										<view v-if="item.status=='9'"
+												class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
+												<text class="" style="background: #3F51B542;font-size: 12px;
+										padding: 8px;
+										color: #d23920;
+										border-radius: 24px;
+										 "  @click="showTips(item)">已拒绝</text>
+											</view>
+											<view v-if="item.status=='10'"
+													class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
+													<text class="" style="background: #3F51B542;font-size: 12px;
+											padding: 8px;
+											color: #333333;
+											border-radius: 24px;
+											 ">已取消</text>
+												</view>
+									 
 						<view v-if="item.status=='4'&&item.showFlag=='否'"
 										class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
 										<text class="" style="background: #3F51B542;font-size: 12px;
@@ -151,6 +194,13 @@
 								<!-- <tn-button shadow shape="round" fontColor="tn-color-white" backgroundColor="tn-bg-blue" :fontSize="24" height="auto" padding="10rpx 18rpx" @click="finishItem(item)">下架</tn-button> -->
 								<button type="warn" plain="true" size="mini" @click="finishItem(item)">下架供应</button>
 							</view>
+							<view class="justify-content-item tn-flex tn-flex-col-center" v-if="item.status==1||item.status==9">
+								<button type="warn" plain="true" size="mini" @click="editItem(item)">编辑</button>
+								<!-- <tn-button shadow shape="round" fontColor="tn-color-white" backgroundColor="tn-bg-blue"
+									:fontSize="24" height="auto" padding="10rpx 18rpx"
+									@click="finishItem(item)">结束需求</tn-button> -->
+							
+							</view>
 						</view>
 					</view>
 				</view>
@@ -366,6 +416,12 @@
 				})
 				
 			},
+			editItem(item){
+				uni.setStorageSync(item.bisNo,JSON.stringify(item))
+				uni.navigateTo({
+					url: '/circlePages/addShare?sid=' + item.bisNo,
+				})
+			}
 		}
 	}
 </script>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/addShare.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/circle.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/share.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.wxml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/circle.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/circle.wxml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/share.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/share.wxml