Kaynağa Gözat

常用语优化

wkw 6 ay önce
ebeveyn
işleme
3c3cc9e44b
2 değiştirilmiş dosya ile 40 ekleme ve 20 silme
  1. 27 16
      pages/msg/addmsg.vue
  2. 13 4
      pages/msg/im.vue

+ 27 - 16
pages/msg/addmsg.vue

@@ -62,19 +62,13 @@
 			<!-- 右侧内容区域 -->
 			<view class="content-area">
 				<view v-if="tabCurrentIndex == 0">
-					<view v-for="item in list" :key="item.id" @click="goAdd(1,0,item.id)">
-					<view
-						style="margin-top: 20rpx;color: #000000;display: flex;align-items: center;background: #FFFFFF;padding: 0rpx 40rpx;">
-						<view style="height: 80rpx;width: 80%;">
-							{{item.content}}
-						</view>
-						
-						<!--
-							<view style="width: 20%;display: flex;justify-content: flex-end;">
-								<image src="../../static/images/my/right_icon.png" style="width: 15rpx;height: 30rpx;"></image>
+					<view v-for="item in list" :key="item.id">
+						<view class="content-area-box flex justify-between">
+							<view @click="copyContent(item.content)">{{item.content}}</view>
+							<view class="content-area-edit" @click="goAdd(1, 0, item.id)">
+								<view>编辑<u-icon name="arrow-right"></u-icon></view>
 							</view>
-						-->
-					</view>
+						</view>
 					</view>
 					
 					<!-- 空状态显示 -->
@@ -82,9 +76,6 @@
 					
 					<!-- 自定义标签下的添加按钮 -->
 					<view class="custom-add-button" @click="goAdd(0,0,0)">
-						<!-- 
-							<u-icon name="plus" color="#fff" size="30" style="margin-right: 10upx;"></u-icon>
-						-->
 						添加常用语
 					</view>
 				</view>
@@ -169,6 +160,11 @@
 			this.loadData();
 		},
 		methods: {
+			copyContent(content){
+				const eventChannel = this.getOpenerEventChannel();
+				eventChannel.emit('selectData', content);
+				uni.navigateBack();
+			},
 			// 返回上一页
 			goBack() {
 				uni.navigateBack()
@@ -259,7 +255,21 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
+	.content-area-box{
+		margin: 40rpx 0;
+		color: #000000;
+		background: #FFFFFF;
+	}
+	.content-area-edit{
+		color: rgba(153, 153, 153, 1);
+		font-family: DM Sans;
+		font-style: Regular;
+		font-size: 24rpx;
+		font-weight: 400;
+		flex-shrink: 0;
+		margin-left: 20rpx;
+	}
 	page {
 		padding-top: 80rpx;
 	}
@@ -486,6 +496,7 @@
 
 	// 自定义添加按钮样式
 	.custom-add-button {
+		margin-top: 80rpx;
 		display: flex;
 		align-items: center;
 		justify-content: center;

+ 13 - 4
pages/msg/im.vue

@@ -691,14 +691,14 @@
 						<image src="../../static/im/changgui.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
 					</view>
 					<view class="box">
-						<input style="color: #000000;" auto-height="true" @confirm='setChatSave(1)' v-model="content"
+						<textarea style="color: #000000;" auto-height="true" @confirm='setChatSave(1)' v-model="content"
 							@focus="textareaFocus" />
 					</view>
 					<view class="em" @tap="chooseEmoji">
 						<image src="../../static/im/smail.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
 					</view>
 					<!-- #ifdef H5 -->
-					<view class="more" @tap="showMore" style="height: auto;">
+					<view class="more" @tap="showMore" style="height: 70rpx;">
 						<image src="../../static/im/buleAdd.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
 					</view>
 					<!-- #endif -->
@@ -2118,7 +2118,9 @@
 				// this.form.game = e[0].label
 				// this.form.gameId = e[0].value
 				this.content = e[0].label;
-				this.setChatSave(1);
+				this.showMore();
+				this.showChangYong = false;
+				// this.setChatSave(1);
 			},
 			getChangYong() {
 				let state = 0
@@ -2194,7 +2196,14 @@
 			goAdd() {
 				this.showMore();
 				uni.navigateTo({
-					url: '/pages/msg/addmsg'
+					url: '/pages/msg/addmsg',
+					success: (res) => {
+						// 监听返回的数据
+						res.eventChannel.on('selectData', (data) => {
+							console.log('子页面返回的数据:', data);
+							this.content = data;
+						});
+					}
 				});
 			},
 			goHistory() {