Commit c3a95dfc authored by xieyishang's avatar xieyishang

addxx

parent 3195aa15
......@@ -2,8 +2,8 @@
"name" : "鹿马商家助手",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "商家",
"versionName" : "1.168",
"versionCode" : 1168,
"versionName" : "1.170",
"versionCode" : 1170,
"transformPx" : false,
"compatible" : {
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
......
......@@ -122,28 +122,11 @@
<view v-if="item.elemType==3" class="item flex_col" :class="item.isSelf == true ? 'push':'pull' ">
<image :src="item.userAvatar" mode="aspectFill" class="pic"></image>
<view class="contentss">
<view class="xiaoxineir" v-if="item.imageElem && item.myimgfile">
<image @tap="showimgdetaile(item)" style="width: 100upx;" class="xiaoxiimgs"
:src="item.myimgfile.path | parsepath" mode="widthFix">
<view class="xiaoxineir" >
<image @load="loadimgbefor" @tap="showimgdetaile(item)" class="xiaoxiimgs" style="width: 100upx;"
:src="item | geturlfun" mode="widthFix">
</image>
</view>
<view class="xiaoxineir" v-else-if="item.imageElem.path">
<image @tap="showimgdetaile(item)" class="xiaoxiimgs" style="width: 100upx;"
:src="item.imageElem.path | parsepath" mode="widthFix">
</image>
</view>
<view class="xiaoxineir" v-else-if="item.imageElem.imageList">
<image v-if="item.imageElem.imageList.length!=0" @tap="showimgdetaile(item)"
class="xiaoxiimgs" style="width: 100upx;"
:src="item.imageElem.imageList[0].url | parsepath" mode="widthFix">
</image>
<image v-else class="xiaoxiimgs" style="width: 100upx;"
src="/static/chat/imgloaderr.png" mode="widthFix"></image>
</view>
<view class="xiaoxineir" v-else>
<image class="xiaoxiimgs" style="width: 100upx;" src="/static/chat/imgloaderr.png"
mode="widthFix"></image>
</view>
</view>
</view>
<!-- 语音消息 4 -->
......@@ -310,6 +293,40 @@
},
dateFormat(value) {
return timestampToTime(value);
},
//过滤器加载图片
geturlfun(item) {
try {
let url = "";
// #ifndef APP-PLUS
if (item.payload.imageInfoArray) {
url = item.payload.imageInfoArray[0].url
};
// #endif
// #ifdef APP-PLUS
//两种形式的图片
if (item.imageElem) {
if (item.imageElem.path) {
if (item.imageElem.path.indexOf("http") != -1) {
url = item.imageElem.path;
} else {
url = "file://" + item.imageElem.path;
}
}
}
//网络资源图片
if(item.url_imageList){
if(item.url_imageList.length!=0){
url = item.url_imageList[0].url;
}
}
// #endif
// console.info("url",url);
return url;
} catch (err) {
return "/static/chat/imgloaderr.png";
}
}
},
data() {
......@@ -475,6 +492,11 @@
}
},
methods: {
//图片加载完成
loadimgbefor(){
// console.info('图片加载完成');
this.ToTheBottom();
},
//发送快捷语
shendkjy(item) {
this.content = item.name;
......@@ -886,8 +908,6 @@
//item.imageElem.path
//item.imageElem.path
if (item.imageElem) {
// this.$api.msg("1");
// return false;
if (item.imageElem.path) {
if (item.imageElem.path.indexOf("http") != -1) {
url = item.imageElem.path;
......@@ -897,13 +917,10 @@
}
}
if (item.myimgfile) {
if (item.myimgfile.path) {
if (item.myimgfile.path.indexOf("http") != -1) {
url = item.myimgfile.path;
} else {
url = "file://" + item.myimgfile.path;
}
//网络资源图片
if(item.url_imageList){
if(item.url_imageList.length!=0){
url = item.url_imageList[0].url;
}
}
// #endif
......
......@@ -27,8 +27,14 @@
<view v-if="item.lastMessage" class="istimes">{{item.lastMessage.time|dateFormat}}</view>
</view>
<view v-if="item.lastMessage" class="isliaotcon oneline">
<text v-show="item.unreadCount==0">[已读]</text>
<text v-show="item.unreadCount!=0">[未读]</text>
<text v-show="item.unreadCount==0 && item.lastMessage.isSelf==false && item.type==1">[已读]</text>
<text v-show="item.unreadCount!=0 && item.lastMessage.isSelf==false && item.type==1">[未读]</text>
<!-- 不是自己发的 -->
<text v-show="item.lastMessage.isPeerRead==true && item.lastMessage.isSelf==true && item.type==1">[已读]</text>
<text v-show="item.lastMessage.isPeerRead!=true && item.lastMessage.isSelf==true && item.type==1">[未读]</text>
<!-- 自己发的 -->
<text v-if="item.lastMessage.textElem && (item.type==1 || item.type==2)">{{item.lastMessage.textElem.msg}}</text>
<text v-if="item.lastMessage.elemType==2">[自定义消息]</text>
<text v-if="item.lastMessage.elemType==3">[图片消息]</text>
......@@ -121,7 +127,7 @@
//获取会话列表 APP
getConversationList() {
this.$store.dispatch("getConversationList", {}).then((res)=>{
console.info("APP获取会话列表成功",res);
// console.info("APP获取会话列表成功",res);
}); //获取会话列表
},
tochats(item) {
......
......@@ -135,13 +135,14 @@ const Im_store = {
store.dispatch("messageTisfun", {}); //播放提醒消息
}
}else if(result.type=='onRecvC2CReadReceipt'){
if (store.state.dfuserId == result.receiptList[0].userId) {
store.dispatch("getC2CHistoryMessageList", {msgId:""}).then((res) => {}); //去刷新聊天界面的消息
store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
} else {
store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
store.dispatch("messageTisfun", {}); //播放提醒消息
}
// if (store.state.dfuserId == result.receiptList[0].userId) {
// store.dispatch("getC2CHistoryMessageList", {msgId:""}).then((res) => {}); //去刷新聊天界面的消息
// store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
// } else {
// store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
// store.dispatch("messageTisfun", {}); //播放提醒消息
// }
return false;
}else{
store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
store.dispatch("messageTisfun", {}); //播放提醒消息
......@@ -307,25 +308,9 @@ const Im_store = {
msgs.reverse(); //数组逆序一下
msgs = msgs.map((msg, index) => {
if (msg.elemType == 3) {
txIm.downloadImage({
"msgId": msg.msgId
}, progressResult => {
}, succResult => {
//下载成功
if (succResult.path) {
msg.myimgfile = succResult;
}
}, failResult => {
})
//获取图片资源
txIm.getImageUrl({"msgId":msg.msgId},result=>{
if(result.code==0){
msg.url_imageList = result.imageList;
}
msg.url_imageList = result.imageList;
})
} else if (msg.elemType == 4) {
......@@ -412,26 +397,9 @@ const Im_store = {
if (msg.elemType == 3) {
//下载图片
txIm.downloadImage({
"msgId": msg.msgId
}, progressResult => {
// console.info("progressResult",progressResult);
}, succResult => {
//下载成功
if (succResult.path) {
// console.info("succResult",succResult)
msg.myimgfile = succResult;
}
}, failResult => {
//下载失败
})
//获取图片资源
txIm.getImageUrl({"msgId":msg.msgId},result=>{
if(result.code==0){
msg.url_imageList = result.imageList;
}
msg.url_imageList = result.imageList;
})
} else if (msg.elemType == 4) {
......
......@@ -76,7 +76,7 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
//return false;
// uni.hideLoading();
console.info("ssss");
// console.info("ssss");
}
}
......@@ -119,8 +119,8 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
header: header,
data: data || {},
success: (res) => {
console.info("data",data);
console.info("res",res);
// console.info("data",data);
// console.info("res",res);
// uni.hideLoading();
if (noVerify)
reslove(res.data, res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment