Bläddra i källkod

前端小程序sdy

zhongtianhaoyuan 3 år sedan
förälder
incheckning
5d1de1d3bf
2 ändrade filer med 70 tillägg och 18 borttagningar
  1. 4 4
      pageD/myRelease/buyGrain.vue
  2. 66 14
      pages/release/release.vue

+ 4 - 4
pageD/myRelease/buyGrain.vue

@@ -316,7 +316,7 @@
 					this.$api.msg('运费承担方不能为空')
 					return
 				}
-		         this.insertProcurementPlanInfo.commonId = this.this.userInfo.id
+		         this.insertProcurementPlanInfo.commonId = this.userInfo.id
 				this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
 						.insertProcurementPlanInfo).then(res => {
 						console.log("添加成功")
@@ -332,8 +332,8 @@
 			},
 			liChange(e) {
 				this.liIndex = e.detail.value
-				this.litypes = this.typesType[this.liIndex];
-				this.deptList.grain = this.typesType[this.liIndex]
+				this.litypes = this.liType[this.liIndex];
+				this.deptList.grain = this.liType[this.liIndex]
 			},
 			pinChange(e) {
 				this.pinIndex = e.detail.value
@@ -349,7 +349,7 @@
 			baoChange(e) {
 				this.baoIndex = e.detail.value
 				this.baotypes = this.baoType[this.baoIndex];
-				this.deptList.packingType =his.chengType[this.chengIndex];
+				this.deptList.packingType = this.chengType[this.chengIndex];
 			},
 			chengChange(e) {
 				this.chengIndex = e.detail.value

+ 66 - 14
pages/release/release.vue

@@ -1,27 +1,19 @@
 <template>
 	<view class="center">
 		<view class="introduce-section">
-			<view class="informations" @click="details(item)" v-for="(item , index) in procurementPlanInfos" :Key="index">
+			<view class="informations"  v-for="(item , index) in procurementPlanInfos" :Key="index">
+				<view @click="details(item)">
 				<view class="labels">{{item.goodsName}}</view>
 				<view class="labels">{{item.weight}}</view>
 				<view class="labels">{{item.unitPrice}}</view>
 				<view class="title">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
-			    <view class='cu-tag radius line-pink'>删除</view>
+				</view>
+				<view class='cu-tag radius line-pink'>编辑</view>
+				<view class='cu-tag radius line-pink' @click="switch1(item)">显示/隐藏</view>
+			    <view class='cu-tag radius line-pink' @click="deleteRelease(item)">删除</view>
 				<view class='cu-tag radius line-pink put'>{{item.status}}</view>
 			</view>
 		</view>
-		<!-- <button type="default" class="fabuBut" @change="releaseChange">发布 -->
-		<!-- <view class="c-row b-b">
-			<text class="tit" >发布</text>
-
-			<picker @change="releaseChange" :value="releaseIndex" :range="releaseType" class="con-list">
-				<view class="picker " >
-					{{releaseIndex>-1?releaseType[releaseIndex]:'请选择发布内容'}}
-				</view>
-			</picker>
-	
-		</view> -->
-		<!-- </button> -->
 		<view class="page-bottom">
 			<view class="action-btn-group">
 				<picker style='display:inline-block;' @change="releaseChange" :value="releases" :range="releaseType">
@@ -57,6 +49,66 @@
 			this.getList()
 		},
 		methods: {
+			switch1(item){
+				if (!this.hasLogin) {
+					uni.showModal({
+						// title: '登录提示',
+						content: '隐藏后该信息不再展示给其他用户,是否确定隐藏?',
+						showCancel: true,
+						confirmText: '确定',
+						success: (e) => {
+							this.$api.doRequest('post','/procurementPlanInfo/api/editStatus',{id:item.id,flag:0}).then(res => {		
+								this.procurementPlanInfos = res.data.data.records
+								if (res.errmsg == "Success") {
+									this.$api.msg('隐藏成功!')
+									return
+								}
+								
+							})
+							.catch(res => {
+								uni.showToast({
+									title: res.errmsg,
+									icon:'none',
+									duration: 2000
+								})
+							});
+						},
+						fail: () => {},
+						complete: () => {}
+					})
+				}
+			},
+			
+			
+			deleteRelease(item){
+				if (!this.hasLogin) {
+					uni.showModal({
+						// title: '登录提示',
+						content: '确定删除该信息?',
+						showCancel: true,
+						confirmText: '确定',
+						success: (e) => {
+							this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
+								this.procurementPlanInfos = res.data.data.records
+								if (res.errmsg == "Success") {
+									this.$api.msg('删除成功!')
+									return
+								}
+								
+							})
+							.catch(res => {
+								uni.showToast({
+									title: res.errmsg,
+									icon:'none',
+									duration: 2000
+								})
+							});
+						},
+						fail: () => {},
+						complete: () => {}
+					})
+				}	
+			},
 			releaseChange(e){
 				this.receivePrivate = e.detail.value
 				this.release = this.releaseType[this.receivePrivate];