订单列表显示,修改bug
parent
cfb4310d6f
commit
8c33b899bf
|
@ -71,4 +71,12 @@ export function jumpObtain(skuId, goodsId) {
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 清除未读
|
||||||
|
// /im/message/clean/unred
|
||||||
|
export function clearmeaager() {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message/clean/unred`,
|
||||||
|
method: Method.PUT,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="wrapper">
|
||||||
<u-navbar class="my-title" title-size="32" back-text="" :title="toUser.name"></u-navbar>
|
<u-navbar class="my-title" title-size="32" back-text="" :title="toUser.name"></u-navbar>
|
||||||
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
||||||
<view :animation="anData" style="height:0;">
|
<view :animation="anData" style="height:0;">
|
||||||
|
@ -22,25 +22,39 @@
|
||||||
<view class="user-name">{{ user.nickName }}</view>
|
<view class="user-name">{{ user.nickName }}</view>
|
||||||
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
||||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
||||||
<view v-else>
|
<view v-if="item.messageType == 'GOODS'">
|
||||||
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic">
|
||||||
<image class="image" :src="JSON.parse(item.text).thumbnail" mode="widthFix"></image>
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
JSON.parse(item.text).goodsName
|
JSON.parse(item.text)['goodsName']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
||||||
style="font-size:20rpx;">¥{{
|
style="font-size:20rpx;">¥{{
|
||||||
JSON.parse(item.text).price
|
JSON.parse(item.text)['price']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="item.messageType === 'ORDER'">
|
||||||
|
<view class="orderSn">
|
||||||
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
|
<view class="oederList">
|
||||||
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
|
<view class="groupNameOrTime">
|
||||||
|
<text @click="linkTosOrders(JSON.parse(item.text)['sn'])">{{ JSON.parse(item.text)['groupName']
|
||||||
|
}}</text>
|
||||||
|
<view class="orderTime"> <text>{{ JSON.parse(item.text)['paymentTime'] }}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -65,31 +79,48 @@
|
||||||
<view class="other-name">{{ toUser.name }}</view>
|
<view class="other-name">{{ toUser.name }}</view>
|
||||||
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
||||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
||||||
<view v-else>
|
<view v-if="item.messageType === 'GOODS'">
|
||||||
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic">
|
||||||
<image class="image" :src="JSON.parse(item.text).thumbnail" mode="widthFix"></image>
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
JSON.parse(item.text).goodsName
|
JSON.parse(item.text)['goodsName']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
||||||
style="font-size:20rpx;">¥{{
|
style="font-size:20rpx;">¥{{
|
||||||
JSON.parse(item.text).price
|
JSON.parse(item.text)['price']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="item.messageType === 'ORDER'">
|
||||||
|
<view class="orderSn">
|
||||||
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
|
<view class="oederList">
|
||||||
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
|
<view class="groupNameOrTime">
|
||||||
|
<text @click="linkTosOrders(JSON.parse(item.text)['sn'])">{{ JSON.parse(item.text)['groupName']
|
||||||
|
}}</text>
|
||||||
|
<view class="orderTime"> <text>{{ JSON.parse(item.text)['paymentTime'] }}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 如果没有聊天记录,定位到底部 -->
|
||||||
|
<view
|
||||||
|
:style="{ position: msgList.length == 0 ? 'fixed' : '', bottom: msgList.length == 0 ? '50px' : '', width: msgList.length == 0 ? '100%' : '' }">
|
||||||
<view class="cartMessage" v-if="showHide && !localImGoodsId && showHideModel">
|
<view class="cartMessage" v-if="showHide && !localImGoodsId && showHideModel">
|
||||||
<view class="goodsCard u-flex u-row-between u-p-b-0">
|
<view class="goodsCard u-flex u-row-between u-p-b-0">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic">
|
||||||
|
@ -97,7 +128,6 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
|
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
goodLiistData.goodsName
|
goodLiistData.goodsName
|
||||||
}}</text>
|
}}</text>
|
||||||
|
@ -113,6 +143,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<!-- loading是显示 -->
|
<!-- loading是显示 -->
|
||||||
<view v-show="msgLoad" class="flex-row-start margin-left margin-top">
|
<view v-show="msgLoad" class="flex-row-start margin-left margin-top">
|
||||||
<view class="chat-img flex-row-center">
|
<view class="chat-img flex-row-center">
|
||||||
|
@ -233,6 +264,9 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
fixed: 'fixed',
|
||||||
|
bottom: '50px',
|
||||||
|
width: '100%',
|
||||||
showHideModel: undefined,
|
showHideModel: undefined,
|
||||||
localImGoodsId: '',
|
localImGoodsId: '',
|
||||||
showHide: true,
|
showHide: true,
|
||||||
|
@ -274,6 +308,14 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//订单详情
|
||||||
|
linkTosOrders (val) {
|
||||||
|
console.log(val);
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/order/orderDetail?sn=' + val,
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
// 跳转商品详情页
|
// 跳转商品详情页
|
||||||
jumpGoodDelic () {
|
jumpGoodDelic () {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -294,6 +336,14 @@ export default {
|
||||||
this.msgList.push({ "text": JSON.stringify(this.goodLiistData), "my": true, "messageType": 'GOODS' })
|
this.msgList.push({ "text": JSON.stringify(this.goodLiistData), "my": true, "messageType": 'GOODS' })
|
||||||
this.showHide = false
|
this.showHide = false
|
||||||
storage.setImGoodsLink(this.params.talkId)
|
storage.setImGoodsLink(this.params.talkId)
|
||||||
|
//成功发送商品连接后,滚动到底部
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 2000000,
|
||||||
|
duration: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//取消发送
|
//取消发送
|
||||||
cancenModel () {
|
cancenModel () {
|
||||||
|
@ -331,12 +381,12 @@ export default {
|
||||||
},
|
},
|
||||||
// 保持消息体可见
|
// 保持消息体可见
|
||||||
msgGo (type) {
|
msgGo (type) {
|
||||||
|
console.log(type, 'typetypetype');
|
||||||
const query = uni.createSelectorQuery()
|
const query = uni.createSelectorQuery()
|
||||||
// 延时100ms保证是最新的高度
|
// 延时100ms保证是最新的高度
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 获取消息体高度
|
// 获取消息体高度
|
||||||
query.select('#msgList').boundingClientRect(data => {
|
query.select('#msgList').boundingClientRect(data => {
|
||||||
|
|
||||||
// 如果超过scorll高度就滚动scorll
|
// 如果超过scorll高度就滚动scorll
|
||||||
if (type == 'up') {
|
if (type == 'up') {
|
||||||
this.go = data.height - this.oldHeight
|
this.go = data.height - this.oldHeight
|
||||||
|
@ -454,6 +504,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.msgGo(type)
|
this.msgGo(type)
|
||||||
},
|
},
|
||||||
touchMoreMessage (e) {
|
touchMoreMessage (e) {
|
||||||
|
@ -546,6 +597,43 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.orderTime {
|
||||||
|
margin-top: 15rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oederList {
|
||||||
|
display: flex;
|
||||||
|
color: black;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderSn {
|
||||||
|
width: 350rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.groupNameOrTime {
|
||||||
|
margin: 15rpx 15rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderGood {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
.goodsCard {
|
.goodsCard {
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
margin-top: 15rpx;
|
margin-top: 15rpx;
|
||||||
|
@ -556,7 +644,8 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
color: #302c2b;
|
color: #302c2b;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
|
|
||||||
.imagebox {
|
.imagebox {
|
||||||
width: 122rpx;
|
width: 122rpx;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<view class="talk-message">
|
<view class="talk-message">
|
||||||
<span v-if="item.lastMessageType == 'MESSAGE'">{{ item.lastTalkMessage }}</span>
|
<span v-if="item.lastMessageType == 'MESSAGE'">{{ item.lastTalkMessage }}</span>
|
||||||
<span v-if="item.lastMessageType == 'GOODS'">[商品链接]</span>
|
<span v-if="item.lastMessageType == 'GOODS'">[商品链接]</span>
|
||||||
|
<span v-if="item.lastMessageType == 'ORDER'">[订单信息]</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="talk-time">
|
<view class="talk-time">
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTalkList } from "@/api/im.js";
|
import { getTalkList, clearmeaager } from "@/api/im.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import { beautifyTime } from "@/utils/filters.js"
|
import { beautifyTime } from "@/utils/filters.js"
|
||||||
export default {
|
export default {
|
||||||
|
@ -112,6 +113,7 @@ export default {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.talkList = res.data.result;
|
this.talkList = res.data.result;
|
||||||
|
console.log(this.talkList, 'this.talkListthis.talkList');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -121,7 +123,16 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cleanUnread () {
|
cleanUnread () {
|
||||||
alert(1)
|
clearmeaager().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.userTalkList();
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: res.data.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue