|
|
<template>
|
|
|
<view class="content" @click="concelPIC">
|
|
|
<view class="content" @click="concelPIC" >
|
|
|
<view class="topcontent" v-if="Number(index)==2">
|
|
|
<view class="leftBox">
|
|
|
<image :src="goodDatas.images" mode="" style="width:104rpx;height: 104rpx;border-radius: 8rpx;"></image>
|
...
|
...
|
@@ -18,52 +18,54 @@ |
|
|
已买
|
|
|
</view>
|
|
|
</view>
|
|
|
<view :class="Number(index)==2?'margin1':'margin0'">
|
|
|
<view class="" v-if="index==1">
|
|
|
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==1&&item.datetime?'leftItem1':item.type==1&&!item.datetime?'leftItem':item.type==0&&item.datetime?'rightItem1':item.type==0&&!item.datetime?'rightItem':''">
|
|
|
<view class="dateTime" v-if="item.datetime!==undefined">
|
|
|
{{item.datetime}}
|
|
|
</view>
|
|
|
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==1"></image>
|
|
|
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==0"></image>
|
|
|
<view :class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'"
|
|
|
style="position: relative;">
|
|
|
{{item.content}}
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
|
|
|
v-if="item.type==1">
|
|
|
|
|
|
<scroll-view scroll-y="true" id="chatList" :scroll-top='scrollTop' @scrolltolower="lower()" :style="{height:scrollH+'rpx'}">
|
|
|
<view :class="Number(index)==2?'margin1':'margin0'" >
|
|
|
<view class="" v-if="index==1">
|
|
|
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==1&&item.datetime?'leftItem1':item.type==1&&!item.datetime?'leftItem':item.type==0&&item.datetime?'rightItem1':item.type==0&&!item.datetime?'rightItem':''">
|
|
|
<view class="dateTime" v-if="item.datetime!==undefined">
|
|
|
{{item.datetime}}
|
|
|
</view>
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
|
|
|
v-if="item.type==0">
|
|
|
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==1" @click="goUser(item.user_id)"></image>
|
|
|
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==0" @click="goUser(item.user_id)"></image>
|
|
|
<view :class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'"
|
|
|
style="position: relative;">
|
|
|
{{item.content}}
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
|
|
|
v-if="item.type==1">
|
|
|
|
|
|
</view>
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
|
|
|
v-if="item.type==0">
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="" v-if="index==2">
|
|
|
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==0?'leftItem':'rightItem'">
|
|
|
<view class="dateTime" v-if="item.datetime!==undefined">
|
|
|
{{item.datetime}}
|
|
|
</view>
|
|
|
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0"></image>
|
|
|
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1"></image>
|
|
|
<view :class="item.type==0?'leftContent':'rightContent'" style="position: relative;">
|
|
|
{{item.content}}
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
|
|
|
v-if="item.type==0">
|
|
|
|
|
|
</view>
|
|
|
<view class="" v-if="index==2">
|
|
|
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==0?'leftItem':'rightItem'">
|
|
|
<view class="dateTime" v-if="item.datetime!==undefined">
|
|
|
{{item.datetime}}
|
|
|
</view>
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
|
|
|
v-if="item.type==1">
|
|
|
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0" @click="goUser(item.user_id)"></image>
|
|
|
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1" @click="goUser(item.user_id)"></image>
|
|
|
<view :class="item.type==0?'leftContent':'rightContent'" style="position: relative;">
|
|
|
{{item.content}}
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
|
|
|
v-if="item.type==0">
|
|
|
|
|
|
</view>
|
|
|
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
|
|
|
v-if="item.type==1">
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
</view>
|
|
|
<view :class="!picList?'inputBox':'inputBox inputBoxHeight'">
|
|
|
<textarea type="text" value="inputText" v-model="inputText" @input="bindInput" placeholder="请输入最新消息" cursor-spacing='40' />
|
|
|
<!-- <view class="addIcon" @click.stop="addPic" v-if="inputText==''">
|
...
|
...
|
@@ -98,8 +100,20 @@ |
|
|
}
|
|
|
},
|
|
|
onShow(){
|
|
|
|
|
|
//默认最底部
|
|
|
setTimeout(() =>{
|
|
|
this.scrollTop=9999
|
|
|
},1000)
|
|
|
},
|
|
|
computed:{
|
|
|
scrollH:function(){
|
|
|
let sys = uni.getSystemInfoSync();
|
|
|
let winWidth = sys.windowWidth;
|
|
|
let winrate = 750/winWidth;
|
|
|
let winHeight =parseInt(sys.windowHeight*winrate)
|
|
|
return winHeight
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
index:0, //判断跳转页面
|
...
|
...
|
@@ -111,7 +125,9 @@ |
|
|
fileList:[],
|
|
|
list: [],
|
|
|
goodDatas:'',
|
|
|
yimaiBtn:true //已买
|
|
|
yimaiBtn:true, //已买
|
|
|
scrollTop:0,
|
|
|
old: {scrollTop: 0}
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|
...
|
...
|
@@ -123,6 +139,16 @@ |
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
// scroll: function(e) {
|
|
|
// console.log(e)
|
|
|
// this.old.scrollTop = e.detail.scrollTop
|
|
|
// },
|
|
|
//用户主页
|
|
|
goUser(id){
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/index/user-page?id='+id
|
|
|
})
|
|
|
},
|
|
|
//已买
|
|
|
yimai(id){
|
|
|
let that=this
|
...
|
...
|
@@ -213,11 +239,17 @@ |
|
|
if(this.index==2){
|
|
|
this.buySendContent()
|
|
|
this.inputText='',
|
|
|
this.picList=true
|
|
|
this.picList=true,
|
|
|
setTimeout(() =>{
|
|
|
this.scrollTop=99999
|
|
|
},1000)
|
|
|
}else{
|
|
|
this.selSendContent()
|
|
|
this.inputText='',
|
|
|
this.picList=true
|
|
|
this.picList=true,
|
|
|
setTimeout(() =>{
|
|
|
this.scrollTop=99999
|
|
|
},1000)
|
|
|
}
|
|
|
},
|
|
|
uploadImg(){
|
...
|
...
|
|