ZZ 1 hari lalu
induk
melakukan
862a805ad1
1 mengubah file dengan 33 tambahan dan 24 penghapusan
  1. 33 24
      mer_uniapp/components/discoverDetails/index.vue

+ 33 - 24
mer_uniapp/components/discoverDetails/index.vue

@@ -610,20 +610,29 @@ export default {
 		},
 		onJoin() {
 			let that = this;
-			// this.$refs.joinDialog.open();
-			myGameJoinIdApi(that.noteDetails.id)
-			.then((res) => {
-				that.$util.Tips({
-					title: "加入成功",
-				});
-				that.noteDetails.userIsJoin = !that.noteDetails.userIsJoin;
-			})
-			.catch((err) => {
-				uni.showToast({
-					title: err,
-					icon: "none",
-				});
+			uni.showModal({
+				content: "确定要加入么?",
+				success: function (res) {
+					if (res.confirm) {
+						myGameJoinIdApi(that.noteDetails.id)
+						.then((res) => {
+							that.$util.Tips({
+								title: "加入成功",
+							});
+							that.noteDetails.userIsJoin = !that.noteDetails.userIsJoin;
+						})
+						.catch((err) => {
+							uni.showToast({
+								title: err,
+								icon: "none",
+							});
+						});
+					} else if (res.cancel) {
+						console.log("用户点击取消");
+					}
+				},
 			});
+			// this.$refs.joinDialog.open();
 		},
 		onJoinColse() {
 			let that = this;
@@ -632,18 +641,18 @@ export default {
 				success: function (res) {
 					if (res.confirm) {
 						myGameJoinIdApi(that.noteDetails.id)
-							.then((res) => {
-								that.$util.Tips({
-									title: "取消成功",
-								});
-								that.noteDetails.userIsJoin = !that.noteDetails.userIsJoin;
-							})
-							.catch((err) => {
-								uni.showToast({
-									title: err,
-									icon: "none",
-								});
+						.then((res) => {
+							that.$util.Tips({
+								title: "取消成功",
+							});
+							that.noteDetails.userIsJoin = !that.noteDetails.userIsJoin;
+						})
+						.catch((err) => {
+							uni.showToast({
+								title: err,
+								icon: "none",
 							});
+						});
 					} else if (res.cancel) {
 						console.log("用户点击取消");
 					}