浏览代码

修改bug

ck110 1 周之前
父节点
当前提交
00aa538bec

+ 8 - 1
common/websocketUtil.js

@@ -239,11 +239,13 @@ class websocketUtil {
 					// console.log("消息发送成功");
 				},
 				fail(e) {
-					console.log("send-err:", e);
+					console.log("send-err:", e, msg);
 					//errMsg sendSocketMessage:fail Error: SocketTask.readyState is not OPEN
 					// {"errMsg":"sendSocketMessage:fail WebSocket is not connected"}  at common/websocketUtil.js:111
 					if (e.errMsg.includes("not OPEN") || e.errMsg.includes("fail WebSocket") || e.errMsg
 						.includes("not connected")) {
+						that.close()
+
 						that.restart();
 						console.log('is now reconnect');
 						// console.log(`"${str}" 包含 "${substr}"`);
@@ -319,6 +321,7 @@ class websocketUtil {
 			console.log("连接已打开");
 			return;
 		}
+		console.log("restart")
 
 		this.autoFlag = true
 
@@ -329,11 +332,13 @@ class websocketUtil {
 	 * 关闭链接
 	 */
 	close() {
+		console.log("关闭连接")
 
 		if (this.socketStatus < 10) {
 			console.log("连接未打开");
 			return;
 		}
+		console.log("清理定时")
 
 		// heartbeatTimeOut && clearTimeout(heartbeatTimeOut)
 		this.heartbeatInterval && clearInterval(this.heartbeatInterval)
@@ -341,7 +346,9 @@ class websocketUtil {
 
 		this.autoFlag = false
 
+		this.socketStatus = 0;
 		this.socketTask.close()
+		console.log("正式关闭")
 
 	}
 

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
 	"name": "遇见玛特",
 	"appid": "__UNI__A59181F",
 	"description": "",
-	"versionName": "1.1.6",
-	"versionCode": 116,
+	"versionName": "1.2.0",
+	"versionCode": 120,
 	"transformPx": false,
 	/* 5+App特有相关 hfhz-mrro-iqmv-igdl storygarden2024@outlook.com*/
 	"app-plus": {

+ 8 - 6
pages/article/addArticle.vue

@@ -46,7 +46,7 @@
 				],
 				content: '',
 				list: [],
-				maxImageCount:6
+				maxImageCount: 6
 			}
 		},
 		onLoad() {},
@@ -82,11 +82,13 @@
 					}
 				}
 				if (str == "") {
-					uni.showToast({
-						title: "请选择图片",
-						icon: 'none'
-					});
-					return;
+					if (this.content == "") {
+						uni.showToast({
+							title: "请输入内容",
+							icon: 'none'
+						});
+						return;
+					}
 				}
 				uni.request({
 					url: this.$apiHost + '/Article/add',

+ 4 - 3
pages/chat/components/delete-conversation.vue

@@ -40,10 +40,11 @@
 
 <style lang="scss" scoped>
 	.main {
-		width: 400rpx;
-		height: 100rpx;
-		line-height: 100rpx;
+		padding: 4rpx 50rpx;
+		line-height: 80rpx;
 		text-align: center;
 		color: #8e8e8e;
+		background-color: #fff;
+		border-radius: 12rpx;
 	}
 </style>

+ 41 - 16
pages/chat/components/message.vue

@@ -139,6 +139,7 @@
 						e.create_time;
 
 					date = e.create_time;
+					console.log("ismy:", e.from + "||" + getApp().globalData.userId);
 
 					// 是否是自己
 					e._isMy = e.from == getApp().globalData.userId;
@@ -230,31 +231,37 @@
 
 			// 长按
 			longPressItem(item) {
+				// console.log('create_time:', item.create_time);
 				let actList = [];
 				switch (item._mode) {
 					case "text":
 						actList.push('复制');
 						break;
 				}
-				actList.push('撤回');
+				const result = this.isWithinLast3Minutes(item.create_time);
+
+				if (result) {
+					// actList.push('撤回');
+				}
 				let that = this;
-				uni.showActionSheet({
-					title: '',
-					itemList: actList,
-					success: function(res) {
-						if (res.tapIndex == 0) {
-							uni.setClipboardData({
-								data: item.payload.text,
-							});
-						} else {
+				if (actList.length > 0) {
+					uni.showActionSheet({
+						title: '',
+						itemList: actList,
+						success: function(res) {
+							if (res.tapIndex == 0) {
+								uni.setClipboardData({
+									data: item.payload.text,
+								});
+							} else {
 
+							}
+						},
+						fail: function(res) {
+							console.log(res.errMsg);
 						}
-					},
-					fail: function(res) {
-						console.log(res.errMsg);
-					}
-				});
-				console.log('xxx');
+					});
+				}
 			},
 
 			// 图片预览
@@ -305,6 +312,24 @@
 					e.isPlay = false;
 				});
 			},
+			isWithinLast3Minutes(timeString) {
+				// 将时间字符串转换为 Date 对象
+				const inputTime = new Date(timeString);
+
+				// 获取当前时间的 Date 对象
+				const currentTime = new Date();
+
+				// 获取时间差(以毫秒为单位)
+				const timeDifference = currentTime - inputTime;
+
+				// 将3分钟转换为毫秒
+				const threeMinutesInMilliseconds = 3 * 60 * 1000;
+
+				// 判断时间差是否在3分钟内(过去的3分钟)
+				return timeDifference >= 0 && timeDifference <= threeMinutesInMilliseconds;
+			}
+
+
 		},
 	};
 </script>

+ 14 - 1
pages/chat/groupMemlist.scss

@@ -198,4 +198,17 @@ page {
 
 	.blankHeight {
 		height: 30rpx;
-	}
+	}
+	.viewMore {
+		width: 750rpx;
+		height: 70rpx;
+		text-align: center;
+		background-color: #121212;
+		line-height: 70rpx;
+		font-size: 24rpx;
+		color:#fff;
+		display: flex;flex-direction: row;justify-content: center;align-items: center;
+		image {
+			width:36rpx;height:36rpx;
+		}
+	}

+ 26 - 6
pages/chat/groupMemlist.vue

@@ -1,21 +1,20 @@
 <template>
 	<view class="page">
 		<view class="bcenter">
-			<view class="avator" v-for="(item, index) in list" :key="index">
+			<view class="avator" v-for="(item, index) in list" :key="index" @click="actMenu(item.userID)">
 				<image :src="item.avator" mode="aspectFill" />
 				<text>{{item.nick}}</text>
-				<image v-if="is_del" class="delit" src="../../static/icon/del_mem.png"
-					@click="actMem('del',item.userID)">
+				<image v-if="is_del" class="delit" src="../../static/icon/del_mem.png">
 				</image>
 			</view>
 			<view class="avator" @click="addMember">
 				<image src="../../static/icon/icon_add.png" mode="widthFix" />
 				<text></text>
 			</view>
-			<view class="avator" @click="delMember">
+			<!-- <view class="avator" @click="delMember">
 				<image src="../../static/icon/icon_del.png" mode="widthFix" />
 				<text></text>
-			</view>
+			</view> -->
 		</view>
 
 
@@ -93,11 +92,32 @@
 					}
 				});
 			},
+			actMenu(uid) {
+				let that = this;
+				uni.showActionSheet({
+					title: '',
+					itemList: ['禁言', '移除'],
+					success: function(res) {
+						if (res.tapIndex == 0) {
+							that.actMem('lock', uid);
+						} else {
+							that.actMem('del', uid);
+						}
+					},
+					fail: function(res) {
+						console.log(res.errMsg);
+					}
+				});
+			},
 			actMem(act, uid) {
+				let tips = '确定禁言吗?';
+				if (act == 'del') {
+					tips = '您确认删除吗?';
+				}
 				let that = this;
 				this.$refs['DialogBox'].confirm({
 					title: '提示',
-					content: '请再次确认是否执行',
+					content: tips,
 					DialogType: 'inquiry',
 					btn1: '否',
 					btn2: '是',

+ 106 - 5
pages/chat/groupSetting.vue

@@ -1,21 +1,35 @@
 <template>
 	<view class="page">
+		<block v-if="have_chk > 0">
+			<view class="viewMore">
+				申请待审核
+				<image src="../../static/me/arrow_down_gray.png" mode="widthFix" />
+			</view>
+			<view class="bcenter">
+				<view class="avator" v-for="(item, index) in list0" :key="index" @click="actMenuC(item.userID)">
+					<image :src="item.avator" mode="aspectFill" />
+					<text>{{item.nick}}</text>
+				</view>
+			</view>
+			<view class="line"></view>
+			<view class="line"></view>
+			<view class="line"></view>
+		</block>
 		<view class="bcenter">
-			<view class="avator" v-for="(item, index) in list" :key="index">
+			<view class="avator" v-for="(item, index) in list" :key="index" @click="actMenu(item.userID)">
 				<image :src="item.avator" mode="aspectFill" />
 				<text>{{item.nick}}</text>
-				<image v-if="is_del" class="delit" src="../../static/icon/del_mem.png"
-					@click="actMem('del',item.userID)">
+				<image v-if="is_del" class="delit" src="../../static/icon/del_mem.png">
 				</image>
 			</view>
 			<view class="avator" @click="addMember">
 				<image src="../../static/icon/icon_add.png" mode="widthFix" />
 				<text></text>
 			</view>
-			<view class="avator" @click="delMember">
+			<!-- <view class="avator" @click="delMember">
 				<image src="../../static/icon/icon_del.png" mode="widthFix" />
 				<text></text>
-			</view>
+			</view> -->
 		</view>
 		<view class="viewMore" @click="viewMore">
 			更多群成员
@@ -57,6 +71,8 @@
 		data() {
 			return {
 				page: 1,
+				have_chk: 0,
+				list0: [],
 				list: [],
 				num_total: 0,
 				groupId: '',
@@ -117,6 +133,13 @@
 						if (res.data.list == undefined || res.data.list == null) {
 							res.data.list = []
 						}
+						this.have_chk = 0;
+						if (res.data.list0 != undefined && res.data.list0 != null) {
+							if (res.data.list0.length > 0) {
+								this.list0 = res.data.list0;
+								this.have_chk = 1;
+							}
+						}
 						this.isManage = res.data.isManage;
 						if (that.page > 1) {
 							that.list = that.list.concat(res.data.list)
@@ -232,6 +255,84 @@
 					});
 				})
 			},
+			actMenuC(uid) {
+				let that = this;
+				uni.showActionSheet({
+					title: '',
+					itemList: ['拒绝', '同意'],
+					success: function(res) {
+						if (res.tapIndex == 0) {
+							that.actMem('noagree', uid);
+						} else {
+							that.actMem('agree', uid);
+						}
+					},
+					fail: function(res) {
+						console.log(res.errMsg);
+					}
+				});
+			},
+			actMenu(uid) {
+				let that = this;
+				uni.showActionSheet({
+					title: '',
+					itemList: ['禁言', '移除'],
+					success: function(res) {
+						if (res.tapIndex == 0) {
+							that.actMem('lock', uid);
+						} else {
+							that.actMem('del', uid);
+						}
+					},
+					fail: function(res) {
+						console.log(res.errMsg);
+					}
+				});
+			},
+			actMem(act, uid) {
+				let tips = '确定禁言吗?';
+				if (act == 'del') {
+					tips = '您确认删除吗?';
+				}
+				let that = this;
+				this.$refs['DialogBox'].confirm({
+					title: '提示',
+					content: tips,
+					DialogType: 'inquiry',
+					btn1: '否',
+					btn2: '是',
+					animation: 0
+				}).then((res) => {
+					uni.showLoading({})
+					uni.request({
+						url: that.$apiHost2 + '/Chat/groupActMem', //仅为示例,并非真实接口地址。
+						data: {
+							uuid: getApp().globalData.uuid,
+							groupId: that.groupId,
+							userId: uid,
+							act: act
+						},
+						header: {
+							'content-type': 'application/json' //自定义请求头信息
+						},
+						success: (res) => {
+							console.log("----", res.data);
+							that.$refs['ToastW3'].showToast({
+								title: res.data.str,
+								animation: 0
+							});
+							if (res.data.success == "yes") {
+								this.loadData();
+							}
+						},
+						complete: (com) => {
+							uni.hideLoading();
+						},
+					});
+				})
+			},
+
+
 		}
 	}
 </script>

+ 9 - 1
pages/chat/message.scss

@@ -256,4 +256,12 @@ page {
 			}
 		}
 	}
-}
+}
+	.PopMain {
+		padding: 4rpx 50rpx;
+		line-height: 80rpx;
+		text-align: center;
+		color: #8e8e8e;
+		background-color: #fff;
+		border-radius: 12rpx;
+	}

+ 13 - 1
pages/chat/message.vue

@@ -94,6 +94,7 @@
 					</template>
 				</view>
 			</view>
+			<view style="height:100rpx;"></view>
 
 		</block>
 		<block v-if="tab == 3">
@@ -125,6 +126,11 @@
 			<view>赶紧去找人聊聊天吧~</view>
 		</view> -->
 
+		<uni-popup ref="popupDel" type="center">
+			<view class="PopMain" @click="deletes()">
+				删除会话
+			</view>
+		</uni-popup>
 		<delete-conversation ref="deleteConversation"></delete-conversation>
 	</view>
 </template>
@@ -154,6 +160,7 @@
 				hasNo: true,
 				showMore: false,
 				sysmsg_list: [],
+				conversationID: '',
 			};
 		},
 		onLoad(params) {
@@ -185,7 +192,12 @@
 		},
 		methods: {
 			deletec(conversationID) {
-				this.$refs.deleteConversation.open(conversationID);
+				this.conversationID = conversationID;
+				console.log("conversationID", conversationID);
+				this.$refs.popupDel.open();
+			},
+			deletes() {
+
 			},
 			goTab(tabb) {
 				this.tab = tabb;

+ 3 - 3
pages/index/peopleHome.vue

@@ -207,8 +207,8 @@
 				// });
 				let conversationID = "";
 				let conversationType = "C2C";
-				let userID = "123";
-				let nickName = "小李";
+				let userID = "" + this.myinfo.userID;
+				let nickName = this.myinfo.nickname;
 
 				var jsonConversationID = encodeURIComponent(JSON.stringify(conversationID));
 				var jsonConversationType = encodeURIComponent(JSON.stringify(conversationType));
@@ -227,7 +227,7 @@
 			},
 			previewOpen(imgs1, index) {
 				this.imgs = imgs1.split("|");
-				setTimeout(()=>this.$refs.previewImage.open(index),0)
+				setTimeout(() => this.$refs.previewImage.open(index), 0)
 				// 传入当前选中的图片地址或序号
 				return; //如需测试和uni原生预览差别可注释这两行
 			},

+ 1 - 1
pages/login/down.vue

@@ -68,7 +68,7 @@
 					if (browser.versions.mobile && browser.versions.ios) {
 						location.href = "https://e.yujianmate.com/web/";
 					} else {
-						location.href = "https://e.yujianmate.com/app/v100.003.apk";
+						location.href = "https://e.yujianmate.com/app/web3.0.apk";
 					}
 				}
 			},

+ 5 - 5
pages/login/reg.vue

@@ -270,11 +270,11 @@
 								title: res.data.str,
 								icon: "none",
 							});
-							// setTimeout(function() {
-							// 	uni.navigateTo({
-							// 		url: '/pages/login/down'
-							// 	})
-							// },1000);
+							setTimeout(function() {
+								uni.navigateTo({
+									url: '/pages/login/down'
+								})
+							}, 1000);
 
 							// #endif
 							// setTimeout(function() {}, 1500);

+ 8 - 3
pages/my/editInfo.vue

@@ -173,9 +173,9 @@
 					}
 					this.sel_tags = tmpTags;
 				} else {
-					if(this.sel_tags.length <= 9){
+					if (this.sel_tags.length <= 9) {
 						this.sel_tags.push(itm);
-					}else{
+					} else {
 						this.$refs['ToastW3'].showToast({
 							title: "最多选择10个标签",
 							animation: 0
@@ -287,6 +287,11 @@
 							title: res.data.str,
 							animation: 0
 						});
+						if (res.data.success == 'yes') {
+							setTimeout(function() {
+								uni.navigateBack()
+							}, 800)
+						}
 						this.getInfoData()
 					}
 				});
@@ -307,7 +312,7 @@
 							// 图片上传
 							const uploadTask = uni.uploadFile({
 								url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self
-								.skey, // post请求地址
+									.skey, // post请求地址
 								filePath: res.tempFilePaths[0],
 								name: 'file', // 待确认
 								success: function(uploadFileRes) {

+ 11 - 5
pages/my/setting.vue

@@ -90,13 +90,11 @@
 						'desc': '400-888-1688',
 						'path': ''
 					},
-				] 
+				]
 			}
 		},
 		onLoad() {
-			// #ifdef APP-PLUS
 			this.getAppVersion()
-			// #endif
 		},
 		onShow() {
 			this.loadData();
@@ -107,8 +105,15 @@
 					success: (info) => {
 						// app系统环境
 						let appPlatform = info.platform;
-						console.log("appPlatform", appPlatform)
-						// 获取本机版本号
+						console.log("appPlatform", info)
+						// #ifdef H5
+						this.list.push({
+							'name': '版本号',
+							'desc': 'V' + info.appVersion,
+							'path': ''
+						})
+						// #endif
+						// #ifdef APP-PLUS
 						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
 							this.list.push({
 								'name': '版本号',
@@ -116,6 +121,7 @@
 								'path': ''
 							})
 						});
+						// #endif
 					}
 				});
 			},

+ 3 - 3
pages/my/wishHelp.vue

@@ -52,7 +52,7 @@
 			}
 		},
 		onLoad(parms) {
-			this.id = parms.id || 11
+			this.id = parms.id || 16
 			// setTimeout(function() {
 			// 	uni.setNavigationBarColor({
 			// 		frontColor: '#ffffff',
@@ -86,7 +86,7 @@
 				let that = this;
 				this.$refs['DialogBox'].confirm({
 					title: '助力心愿',
-					content: '是否确定为TA助力心愿',
+					content: '是否消耗10M币为TA助力心愿',
 					DialogType: 'inquiry',
 					btn1: '否',
 					btn2: '是',
@@ -124,7 +124,7 @@
 			},
 			loadData() {
 				uni.request({
-					url: this.$apiHost + '/Wish/getInfo',
+					url: this.$apiHost + '/Wish/getMyInfo',
 					data: {
 						uuid: getApp().globalData.uuid,
 						id: this.id,

+ 2 - 2
pages/my/wishList.vue

@@ -17,10 +17,10 @@
 				</view>
 				<text class="right">
 					<block v-if="item.status == 1">
-						<view class="btn_submit" @click="onLinqu">邀请助力</view>
+						<view class="btn_submit">邀请助力</view>
 					</block>
 					<block v-if="item.status == 2">
-						<view class="state">待发货</view>
+						<view class="state" @click="onLinqu">待发货</view>
 					</block>
 					<block v-if="item.status == 9">
 						<view class="state">已发货</view>