Explorar o código

修改语音发送,上传头像不显示

yanjie %!s(int64=4) %!d(string=hai) anos
pai
achega
4a0b7b4d69

+ 19 - 5
pages/conversation/conversationWindow.vue

xqd xqd xqd xqd
@@ -35,20 +35,21 @@
 				</view>
 			</view>
 		</view>
-		<view :class="InputBottom!=0?'cu-bar foot tab input cur':'cu-bar foot input'" :style="'bottom:'+InputBottom+'px'"
-		 v-show="sures">
+		<view :class="InputBottom!=0?'cu-bar foot tab input cur':'cu-bar foot input'" style="padding-bottom: 45rpx;padding-top: 45rpx;"
+		 :style="'bottom:'+InputBottom+'px'" v-show="sures">
 			<view class="action" @click="sendvoice">
 				<text class="cuIcon-sound text-grey"></text>
 			</view>
 			<input v-if="!isvoice" v-model="keyword" class="solid-bottom" @focus="InputFocus" @blur="InputBlur" :disabled="isinput"
 			 :adjust-position="false" :focus="false" maxlength="300" :placeholder="textinput" cursor-spacing="10"></input>
-			<button class="flex-sub" style="font-size: 30rpx; height: 64rpx;padding: 0;"  @touchstart.stop="onRecordStart"
+			<button class="flex-sub" style="font-size: 30rpx; height: 64rpx;padding: 0;" @longpress="onRecordStart"
 			 @touchend.stop="onRecordEnd" v-else>{{audio.recording ? '松开发送':'按住发送语音'}}</button>
 			<view class="action" style="margin-right: 20rpx;" @click="sendImage">
 				<text class="cuIcon-picfill text-grey"></text>
 			</view>
 			<button class="cu-btn bg-green shadow" @click="sendMessage">发送</button>
 		</view>
+		<view class="record-loading" v-if="audio.recording"></view>
 	</view>
 </template>
 
@@ -67,7 +68,7 @@
 		onLoad: function(op) {
 			// this.messages = []
 			// this.self_messages = []
-			console.log('聊天状态',op)
+			console.log('聊天状态', op)
 			if (op.type == 2) {
 				this.sures = false;
 			}
@@ -127,7 +128,7 @@
 		},
 		onUnload() {
 			console.log("页面卸载")
-			this.messages.splice(0,this.messages.length)
+			this.messages.splice(0, this.messages.length)
 			//退出聊天页面之前,清空页面传入的监听器
 			if (this.imService) {
 				this.imService.onNewPrivateMessageReceive = (friendId, message) => {};
@@ -288,4 +289,17 @@
 		font-size: 20rpx;
 		text-align: center;
 	}
+
+	.record-loading {
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		width: 300rpx;
+		height: 300rpx;
+		margin: -150rpx -150rpx;
+		background: #262628;
+		background: url("https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/recording-loading.gif") no-repeat center;
+		background-size: 100%;
+		border-radius: 40rpx;
+	}
 </style>

+ 3 - 3
pages/information/information.vue

xqd xqd
@@ -51,7 +51,7 @@
 <script>
 	import { mapState, mapMutations, mapGetters, mapActions } from 'vuex';
 	import {
-		imglocal
+		imgHost
 	} from '@/common/env';
 	export default {
 			data() {
@@ -154,8 +154,8 @@
 					  console.log('我是file:',res.tempFilePaths[0])
 					  that.$request.upload("Common/uploadFile",that.imgList[0],{}).then(res=>{
 						 
-						  that.url = imglocal+JSON.parse(res).data.url;
-						   
+						  that.url = imgHost+JSON.parse(res).data.url;
+						   console.log(that.url)
 					  })
 				     }
 				    });