wangguoyu hace 3 semanas
padre
commit
cc6554566c
Se han modificado 2 ficheros con 26 adiciones y 20 borrados
  1. 4 3
      pages/zhuanti/index.vue
  2. 22 17
      pages/zhuanti/zhuantiInfo.vue

+ 4 - 3
pages/zhuanti/index.vue

@@ -2,11 +2,12 @@
 	<view class="ezy-zhuanti-page">
 		<view class="zt-qipao-box">
 			<!-- wgy看这↓ 如果是游客的话不显示text标签内容-->
-			<view>寻觅者<text>"{{yhName}}同学"</text></view>
+			<view>寻觅者<text>"小小同学"</text></view>
 			<view>形容一下你的心情吧?</view>
 		</view>
 		<view class="zt-biaoqing-box">
-			<view v-for="(item,index) in biaoqingList" :key="index"  @click="goZhuantiInfo(item)" class="biaoqing-item-box"></view>
+			<view v-for="(item,index) in biaoqingList" :key="index" @click="goZhuantiInfo(item)"
+				class="biaoqing-item-box"></view>
 		</view>
 		<CustomTabBar :currentTabNumber="1"></CustomTabBar>
 	</view>
@@ -82,7 +83,7 @@
 	function goZhuantiInfo(data) {
 		console.log('data', data);
 		uni.redirectTo({
-			url: '/pages/zhuanti/zhuantiInfo?type='+data.type
+			url: '/pages/zhuanti/zhuantiInfo?type=' + data.type 
 		})
 	}
 </script>

+ 22 - 17
pages/zhuanti/zhuantiInfo.vue

@@ -2,8 +2,8 @@
 	<view class="ezy-biaoqing-page">
 		<view class="ezy-nav-bar-icon" @click="goUpPage"></view>
 		<view class="biaoqing-bj-box" :class="'biaoqing-bj'+ type">
-			<view v-for="(item, index) in bubbles" :key="index" 
-			class="qipao-item-box" :class="{ 'qipao-item-disabled': item.disabled }" @click="qipaoBtn(index)" >
+			<view v-for="(item, index) in bubbles" :key="index" class="qipao-item-box"
+				:class="{ 'qipao-item-disabled': item.disabled }" @click="qipaoBtn(index)">
 				<view :class="item.iconType"></view>
 				<view class="show-biaoqing-icon"></view>
 				<view class="qipao-text-row">
@@ -14,15 +14,15 @@
 			<view class="biaoqing-img"></view>
 		</view>
 		<view :class="maikeType">
-			<view class="maike-box" @touchstart="handleTouchStart" @touchend="handleTouchEnd" @touchcancel="handleTouchCancel"
-				@touchmove="handleTouchMove">
+			<view class="maike-box" @touchstart="handleTouchStart" @touchend="handleTouchEnd"
+				@touchcancel="handleTouchCancel" @touchmove="handleTouchMove">
 				<icon class="maike-icon"></icon>
 			</view>
 			<text class="maike-text" v-if="maikeType =='maike-anzhu'">{{ buttonText }}</text>
 			<text class="maike-text" v-if="maikeType =='maike-songkai'">{{ buttonText }}</text>
 		</view>
-		
-		<CustomTabBar  :currentTabNumber="1"></CustomTabBar>
+
+		<CustomTabBar :currentTabNumber="1"></CustomTabBar>
 	</view>
 
 </template>
@@ -50,10 +50,12 @@
 	const maikeType = ref('maike-anzhu');
 	// 定义气泡数据状态
 	const bubbles = reactive(
-	  Array.from({ length: 5 }, () => ({
-		disabled: false, // 是否破裂
-	    iconType: "qipao-mask",//mask
-	  }))
+		Array.from({
+			length: 5
+		}, () => ({
+			disabled: false, // 是否破裂
+			iconType: "qipao-mask", //mask
+		}))
 	);
 	const type = ref(null);
 	const showIcon = ref(null);
@@ -67,15 +69,15 @@
 		console.log('opt', options);
 		type.value = options.type
 	})
-	
+
 	// 点击气泡
 	function qipaoBtn(index) {
-	  bubbles[index].disabled = true;
-	  bubbles[index].iconType = "polie-qipao-mask"; 
-	  // wgy看这↓ 在这里播放mp3,时间一秒及删除接口
-	  
+		bubbles[index].disabled = true;
+		bubbles[index].iconType = "polie-qipao-mask";
+		// wgy看这↓ 在这里播放mp3,时间一秒及删除接口
+
 	}
-	
+
 	// 按钮状态计算
 	const buttonState = computed(() => {
 		if (isCancelled.value) return 'cancelled';
@@ -84,7 +86,7 @@
 
 	// 按钮文本
 	const buttonText = computed(() => {
-		if (isCancelled.value) return '取消';
+		if (isCancelled.value) return '松开取消';
 		return isPressing.value ? '松开发送' : '按住说话';
 	});
 
@@ -139,6 +141,8 @@
 		// 移动超过50px视为取消
 		if (moveDistance > 50) {
 			isCancelled.value = true;
+		} else if (isCancelled.value && moveDistance <= 50) {
+			isCancelled.value = false; // 当移回范围内时恢复状态
 		}
 	};
 
@@ -149,6 +153,7 @@
 			isCancelled.value = false;
 		}, 500); // 短暂保持
 	};
+
 	function goUpPage() {
 		uni.redirectTo({
 			url: `/pages/zhuanti/index`