zs há 1 ano atrás
pai
commit
c9bcddde9b

+ 5 - 8
pagesHome/friend/index.vue

@@ -15,11 +15,11 @@
 							<image :src="item.content" v-if="item.type == 'image'" @tap="onPreview(item.content)"
 								mode="widthFix">
 							</image>
-							<view class="record" v-if="item.type == 'record'" @tap="onPlay(item.voice,index)">
+							<view class="record" v-if="item.type == 'record'" @tap="onPlay(item.content,index)">
 								<uni-icons v-if="item.speaker._id != user._id" custom-prefix="iconfont"
 									type="icon-zuobofang" size="15" color="#333333">
 								</uni-icons>
-								<text class="voice">{{item.content}}</text>"
+								<text class="voice">{{item.voice}}</text>"
 								<uni-icons v-if="item.speaker._id == user._id" custom-prefix="iconfont"
 									type="icon-youbofang" size="15" color="#ffffff">
 								</uni-icons>
@@ -195,8 +195,8 @@
 					}
 					let mess = {
 						type: 'record',
-						voice: res.tempFilePath,
-						content: Math.round(res.duration / 1000), // 时长
+						voice: Math.round(res.duration / 1000), // 时长
+						content: res.tempFilePath,
 						time: new Date() - 0
 					}
 					// 写在上传回调内
@@ -240,10 +240,7 @@
 				}
 				let res = await that.$api(`/chat`, 'POST', data)
 				if (res.errcode == '0') {
-					that.list.push({
-						...e,
-						...mess
-					});
+					that.search()
 					that.$set(that, `isRecorder`, false);
 					that.poalast() // 定位消息最后一行
 				} else {

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/friend/index.js.map


+ 3 - 3
unpackage/dist/dev/mp-weixin/pagesHome/friend/index.js

@@ -389,9 +389,9 @@ var _default = {
         }
         var mess = {
           type: 'record',
-          voice: res.tempFilePath,
-          content: Math.round(res.duration / 1000),
+          voice: Math.round(res.duration / 1000),
           // 时长
+          content: res.tempFilePath,
           time: new Date() - 0
         };
         // 写在上传回调内
@@ -442,7 +442,7 @@ var _default = {
               case 5:
                 res = _context3.sent;
                 if (res.errcode == '0') {
-                  that.list.push(_objectSpread(_objectSpread({}, e), mess));
+                  that.search();
                   that.$set(that, "isRecorder", false);
                   that.poalast(); // 定位消息最后一行
                 } else {

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/friend/index.wxml