wangguoyu 2 月之前
父节点
当前提交
a7d21bfcd0
共有 1 个文件被更改,包括 20 次插入3 次删除
  1. 20 3
      pages/admin/Jiazheng/kechengBind.vue

+ 20 - 3
pages/admin/Jiazheng/kechengBind.vue

@@ -49,6 +49,8 @@
 				</template>
 			</uni-list-item>
 		</uni-list>
+		<common-dialog ref="commonDialogRef" :title="deleteTitle" :content="deleteConcent"
+			@confirm-btn="deleteQuerenBtn"></common-dialog>
 	</view>
 </template>
 
@@ -71,7 +73,10 @@
 				id: '',
 				current: 0,
 				list: [],
-				listYx: [],
+				listYx: [],	
+				 deleteTitle :'删除',
+				 kcId :'',
+				 deleteConcent :'你确定要执行这个操作吗',		
 				tabs: [{
 						id: 1,
 						name: '未绑定课程',
@@ -106,13 +111,17 @@
 							icon: 'success'
 						});
 					} else {
+						uni.showToast({
+							title: '添加失败',
+							icon: 'success'
+						});
 						return false
 					}
 				})
 			},
-			toDelete(data) {
+			deleteQuerenBtn(){
 				let req = {
-					kcId: data.kcId,
+					kcId: this.kcId,
 					id: this.id
 				}
 				jiazhengKcDelete(req).then(res => {
@@ -123,10 +132,18 @@
 							icon: 'success'
 						});
 					} else {
+						uni.showToast({
+							title: '删除失败',
+							icon: 'success'
+						});
 						return false
 					}
 				})
 			},
+			toDelete(data) {
+				this.kcId = data.kcId
+				this.$refs.commonDialogRef.handleShow();
+			},
 			changeTab(data) {
 				this.current = data
 				if (this.current == 0) {