4.18(优化

This commit is contained in:
Hong
2024-04-18 19:14:52 +08:00
parent 6a4d0339c9
commit acefcd1112
10 changed files with 281 additions and 109 deletions

View File

@@ -70,4 +70,14 @@ export function getCleanUnRead() {
url: '/api/front/user/center/clean/unRead',
method: 'get',
})
}
/**
* 撤回消息
*/
export function immsgRecall(id) {
return request({
url:`/api/front/immsg/recall/${id}`,
method: 'get',
})
}

View File

@@ -216,9 +216,9 @@
</z-paging>
<!-- 视频播放控件 @play="handleVideoClick" @pause="currentVideoIndex = -1"-->
<view class="video-flex">
<video v-if="currentVideo" :src="currentVideo" :enable-progress-gesture="false" initial-time="1s" id="video1" ref="video1"
:poster="currentCover" class="video-box" :loop="false" @fullscreenchange="fullscreenchangeFn"
@pause="pauseFn">
<video v-if="currentVideo" :src="currentVideo" :enable-progress-gesture="false" initial-time="1s"
id="video1" ref="video1" :poster="currentCover" class="video-box" :loop="false"
@fullscreenchange="fullscreenchangeFn" @pause="pauseFn">
</video>
</view>
<promptBox ref="pbox" @confirm="confirm"></promptBox>
@@ -344,7 +344,7 @@
let detail = e.detail
if (detail.direction == 'vertical') {
this.currentVideo = ''
this.currentCover=''
this.currentCover = ''
uni.createVideoContext('video1', this).pause()
} else {
this.videoContext = uni.createVideoContext('video1', this);
@@ -386,17 +386,39 @@
},
//分享
shareFn(item) {
let shareData = {
href: 'http',
type: item.image.length ? 0 : 1,
imageUrl: item.image.length ? item.image[0] : '',
summary: item.content ? item.content : '分享图片'
}
shareApi('WXSceneSession', shareData).then(res => {
getNoteShare(item.id).then(res => {
console.log(res, '分享成功');
})
})
// let shareData = {
// href: '@/pages/index/index',
// type: 5,
// imageUrl: item.image.length ? item.image[0] : '',
// summary: item.content ? item.content : '分享图片'
// }
console.log('分享');
uni.share({
provider: 'weixin',
scene: "WXSceneSession",
type: 5,
imageUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/share-logo@3.png',
title: '欢迎体验uniapp',
miniProgram: {
id: 'gh_5a2fb63d6c4a',
path: 'pages/index/index',
type: 1,
webUrl: 'WWW.diyouzhijia.com'
},
success: (res) => {
uni.hideLoading();
},
complete: (isok) => {
uni.hideLoading();
console.log(isok);
// reject(isok)
},
});
// shareApi('WXSceneSession', shareData).then(res => {
// getNoteShare(item.id).then(res => {
// console.log(res, '分享成功');
// })
// })
},
//三个点
reportFn(item) {
@@ -769,6 +791,7 @@
}
}
}
.line-five {
display: -webkit-box;
/* 必须 */
@@ -783,6 +806,7 @@
-webkit-box-orient: vertical;
/* 必须 */
}
.content-title {
margin-top: 16rpx;
font-size: 36rpx;

View File

@@ -90,7 +90,7 @@
</view>
<view class="bottom-butt-caozuo f-jce">
<view class="flex">
<u-button v-if="formData.giveStatus==1" type="primary" text="查看原因" color="#13AFA8" shape="circle" @click=""
<u-button v-if="formData.giveStatus==1" type="primary" text="查看原因" color="#13AFA8" shape="circle" @click="navAdvancedFn"
:customStyle="{width:'192rpx',height:'80rpx',marginLeft: '24rpx',}"></u-button>
<u-button type="primary" text="查看合同" color="#13AFA8" shape="circle" @click="examineContractFn"
:customStyle="{width:'192rpx',height:'80rpx',marginLeft: '24rpx'}"></u-button>
@@ -122,12 +122,12 @@
url: `/pages/carShop/order/car_rental/car_submit?id=${this.formData.id}`
})
},
//提前还车
navInAdvanceFn() {
///提前还车详情
navAdvancedFn() {
uni.navigateTo({
url: '/pages/driver/mine/my_order/rentCars/in_advance'
url: `/pages/carShop/order/car_rental/advanced?id=${this.formData.id}`
})
}
},
},
onLoad(options) {
console.log(options.id);

View File

@@ -12,7 +12,7 @@
<view class="c000 f-34 fw-6">租车订单
<text v-if="information.orderQuantity">({{information.orderQuantity}})</text>
</view>
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
<image style="width: 15rpx;height: 30rpx;" src="@/static/images/icon/arrow-right.png" mode=""></image>
</view>
<view v-if="information.title" class="car-rental-order"
@click="navOrderListFn('/pages/carShop/order/car_rental/car_rental_order')">
@@ -41,7 +41,7 @@
({{product.orderQuantity}})
</text>
</view>
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
<image style="width: 15rpx;height: 30rpx;" src="@/static/images/icon/arrow-right.png" mode=""></image>
</view>
<view v-if="product.title" class="buy-cars-order"
@click="navOrderListFn('/pages/carShop/order/car_sell/car_sell_order')">

View File

@@ -292,7 +292,7 @@
<image @click="showComment=false" class="r_img_1"
src="@/static/images/app/icon/report_close.png" mode=""></image>
</view>
<scroll-view :scroll-y="true" class="all_con" :style="{height:windowHeight-120+'rpx'}">
<scroll-view :scroll-y="true" class="all_con" :style="{height:windowHeight -(inputHeight * 2) - 120+'rpx'}">
<view class="pop_content">
<view class="con_l">
<image :src="itemObj.avatar" class="imgRadius" mode="aspectFill"></image>
@@ -355,18 +355,16 @@
</view>
</scroll-view>
<view class="pop_bottom">
<!-- <chatInputBar @sendSMS="sendSMSFn" @keyboardheightchange="keyboardheightchange" @gridItemTap="gridItemTap"
ref="chatInputBar" /> -->
<!-- <text class="pop_bot_txt" @click="replyToComments(itemObj,1)"> 发表评论 </text> -->
<view class="bottom_l" :style="{width:'540rpx'}">
<textarea ref="textarea2" autoHeight fixed :showConfirmBar="false" border="none" confirmHold
:autoFocus="autoFocus" adjust-position :placeholder="placeholder" maxlength="300"
:cursor-spacing="20" v-model="popupValue" :style="{width:'540rpx'}"
style="background-color: #f2f0f4;border-radius:80rpx;padding:0 24rpx;border: 1rpx solid red;"></textarea>
style="background-color: #f2f0f4;border-radius:80rpx;padding:0 24rpx;"
@focus="textareaFocusFns" @keyboardheightchange="keyboardheightchangeFn"></textarea>
</view>
<view class="bottom_send">
<!--表情按钮 -->
<view style="margin-left: 20rpx;" @click.stop="emojiShow2 = !emojiShow2,openExpression2()">
<view style="margin-left: 20rpx;" @click.stop="emojiShow2 = !emojiShow2;openExpression2()">
<image src="https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/expression.png"
style="width: 58rpx;height: 58rpx;" />
</view>
@@ -377,22 +375,19 @@
style="width: 58rpx;height: 58rpx;" />
</view>
</view>
<!-- @keyboardheightchange="keyboardheightchangeFn" auto-blur @focus="textareaFocusFn" -->
<template v-if="emojiShow">
<view style="width: 690rpx;">
<waterfall column-count="8" column-width="auto" column-gap="0" left-gap="10"
style="height: 400rpx;background-color: #fff;">
<cell v-for="(item,index) in emoicon" :key="index" style="padding: 10rpx;"
@click="contentValue += item">
<text style="font-size: 54rpx;">{{item}}</text>
</cell>
</waterfall>
</view>
</template>
</view>
</view>
<template v-if="emojiShow2">
<view style="width: 690rpx;height: 400rpx;">
<waterfall column-count="8" column-width="auto" column-gap="0" left-gap="10"
style="height: 400rpx;background-color: #fff;">
<cell v-for="(item,index) in emoicon" :key="index" style="padding: 10rpx;"
@click="popupValue += item">
<text style="font-size: 54rpx;">{{item}}</text>
</cell>
</waterfall>
</view>
</template>
<!-- <view style="height: 200rpx;"></view> -->
</u-popup>
</cell>
@@ -432,6 +427,12 @@
export default {
components: {
chatInputBar
},
computed: {
},
watch: {
},
filters: {
filtersTime(value) {
@@ -442,7 +443,7 @@
filtersLikeNum(value) {
if (!value) return '0';
return formatNumber(value);
}
},
},
data() {
return {
@@ -515,7 +516,7 @@
//输入框高度
inputHeight: 0,
//试图高度
windowHeight: 0
windowHeight: 0,
}
},
onLoad(query) {
@@ -534,7 +535,6 @@
methods: {
//评论框聚焦
textareaFocusFn(e) {
// console.log(2, this.emojiShow)
this.textareaFlag = true
if (this.emojiShow) {
this.emojiShow = false;
@@ -544,8 +544,20 @@
}, 500);
}
// console.log('焦点', this.replyType, e);
if (this.replyType == 2) {
this.replyAddData.noteId = this.noteId
// if (this.replyType == 2) {
// }
},
//弹出层聚焦
textareaFocusFns(e) {
console.log('弹出层');
if (this.emojiShow2) {
this.emojiShow2 = false;
uni.hideKeyboard();
uni.$u.debounce(() => {
this.$refs.textarea.focus();
}, 500);
}
},
//去个人信息
@@ -594,7 +606,7 @@
//分享
shareFn(type) {
let shareData = {
href: 'http',
href: '#小程序://滴友/wCVymJEiWqUKm0A',
type: this.detailObj.image.length ? 0 : 1,
imageUrl: this.detaImage.length ? this.detaImage[0] : '',
summary: this.detailObj.content ? this.detailObj.content : '分享图片'
@@ -814,10 +826,12 @@
},
//键盘高度
keyboardheightchangeFn(e) {
// console.log('键盘收起打开',e.detail.height);
this.inputHeight = e.detail.height
if (e.detail.height == 0) {
this.$refs.textarea.blur();
if(this.$refs.textarea2){
this.$refs.textarea2.blur();
}
this.replyType = 2
} else {
// this.emojiShow=false
@@ -854,22 +868,33 @@
},
//表情按钮
openExpression() {
this.$refs.textarea.focus();
uni.hideKeyboard();
if (!this.emojiShow) {
this.$refs.textarea.focus();
} else {
uni.hideKeyboard();
}
},
//弹出层表情按钮
openExpression2() {
this.$refs.textarea2.focus();
uni.hideKeyboard();
if (!this.emojiShow2) {
this.$refs.textarea2.focus();
} else {
uni.hideKeyboard();
}
},
//弹窗回复评论
replyToCommentsFn() {
replyToCommentsFn(ele,num) {
this.$refs.textarea2.focus();
this.placeholder = '回复' + ' ' + ele.nickname + ' ' + ':'
//回复的评论i
this.replyAddData.replyId = ele.id
this.replyAddData.userId = this.myInfo.id
this.getDetail(this.noteId)
},
//弹出层发送按钮
sendSMSFn() {
console.log(this.popupValue);
console.log(this.itemObj);
// console.log(this.popupValue);
// console.log(this.itemObj);
// "authorUserId": 49,
// "content": "来咯来咯",
// "noteId": 109,
@@ -1039,7 +1064,7 @@
width: 750rpx;
background-color: #ffffff;
z-index: 99;
padding: 43rpx 24rpx;
padding: 24rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
display: flex;
flex-direction: row;
@@ -1060,7 +1085,7 @@
.all_con {
height: 1000rpx;
padding: 120rpx 0 120rpx;
padding: 70rpx 0 130rpx;
}
.pop_content {

View File

@@ -240,9 +240,7 @@
page: pageNo,
limit: pageSize
}).then(res => {
console.log(res.data.list);
res.data.list.forEach(item => {
console.log(item.msgType);
if (item.msgType == 1) {
item.content = '图片'
}

View File

@@ -6,7 +6,7 @@
<view class="u-flex u-flex-items-center"
style="background-color: #FFFFFF;">
<!-- 输入框 -->
<view style="flex: 1;position: relative;overflow: hidden;" @click.stop="openPinglun">
<view style="flex: 1;position: relative;overflow: hidden;padding: 8rpx 0;background-color: #f2f0f4;" :style="'border-radius:'+ borderRadius +'rpx;'" @click.stop="openPinglun">
<u--textarea
autoHeight
fixed

View File

@@ -1,21 +1,28 @@
<!-- 聊天item -->
<template>
<view class="chat-item">
<view v-if="copyFlag" class="chat-content-operate"
:class="[item.selfStatus?'chat-content-operate-r':'chat-content-operate-l']">
<text class="chat-content-operate-text" @click="copyFn">复制</text>
<text class="chat-content-operate-text" @click="withdrawFn"
style="border-left: 1rpx solid #eeeeee;">撤回</text>
</view>
<text class="chat-time" v-if="item.chatTime&&item.chatTime.length">
{{item.chatTime}}
</text>
<view :class="{'chat-container':true,'chat-location-me':item.selfStatus}">
<view class="chat-icon-container" @click="navUserFn(item)">
<view class="chat-icon-container" @click="navUserFn(item)">
<image class="chat-icon" :src="item.avatar" mode="aspectFill" />
</view>
<view class="chat-content-container">
<view class="chat-content-container" @longpress="showActions()" @click="copyFlag=false">
<!-- <text :class="{'chat-user-name':true,'chat-location-me':item.selfStatus}">
{{item.nickname}}
</text> -->
<image v-if="item.selfStatus===true" class="mess_l" src="@/static/images/app/icon/mess_r.png" mode=""></image>
<image v-if="item.selfStatus===true" class="mess_l" src="@/static/images/app/icon/mess_r.png" mode="">
</image>
<image v-else class="mess_r" src="@/static/images/app/icon/mess_l.png" mode=""></image>
<template v-if="item.msgType ===0">
<view :class="{'chat-text-container':true,'chat-text-container-me':item.selfStatus}">
<view :class="{'chat-text-container':true,'chat-text-container-me':item.selfStatus}">
<text :class="{'char-text':true,'char-text-me':item.selfStatus}"
:style="'font-size:36rpx;color:'+(item.selfStatus?'#000;':'#333;')">{{item.content}}</text>
</view>
@@ -33,7 +40,8 @@
style="position: relative;">
<image @click.stop="videoPlay(item.content)"
:src="item.content+'?x-oss-process=video/snapshot,t_1000,m_fast'"
style="width: 170rpx;height:262rpx;overflow: hidden;" :style="{borderRadius:'16rpx 16rpx 16rpx 16rpx'}" />
style="width: 170rpx;height:262rpx;overflow: hidden;"
:style="{borderRadius:'16rpx 16rpx 16rpx 16rpx'}" />
<view :class="{'chat-video-container-me':item.selfStatus,'chat-video-container':true}"
@click.stop="videoPlay(item.content)">
<image mode="aspectFit"
@@ -73,39 +81,42 @@
</view>
</template>
<template v-else-if="item.msgType === 6">
<!-- :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" -->
<!-- :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" -->
<view
:class="item.selfStatus===true?'chat-text-container-me-border-radius':'chat-text-container-border-radius'"
style="position: relative;"
@click.stop="Navto({url:`/pages/driver/mine/my_activity/detail?type=help&id=${JSON.parse(item.content).id}&uid=${item.uid}&fromUid=${JSON.parse(item.content).fromUid}`,type:'redirectTo',params:{noteId:discoverVideo(item.content).id}})">
<!-- <view class="activity-box"> -->
<view>
<text style="font-size: 24rpx;">点击助力好友</text>
</view>
<view class="activity-item">
<image style="width: 350rpx;height: 350rpx;" :src="JSON.parse(item.content).cover"
mode=""></image>
<view class="activity-item-info">
<view class="activity-item-name">
<text
style="font-size: 32rpx;font-weight: 500;color: #000000;">{{JSON.parse(item.content).name}}</text>
</view>
<view class="activity-item-intro">
<text
style="font-size: 28rpx;font-weight: 500;color: #444444;">{{JSON.parse(item.content).intro}}</text>
</view>
<view>
<text style="font-size: 24rpx;">点击助力好友</text>
</view>
<view class="activity-item">
<image style="width: 350rpx;height: 350rpx;" :src="JSON.parse(item.content).cover" mode="">
</image>
<view class="activity-item-info">
<view class="activity-item-name">
<text
style="font-size: 32rpx;font-weight: 500;color: #000000;">{{JSON.parse(item.content).name}}</text>
</view>
<view class="activity-item-intro">
<text
style="font-size: 28rpx;font-weight: 500;color: #444444;">{{JSON.parse(item.content).intro}}</text>
</view>
</view>
</view>
<!-- </view> -->
</view>
</template>
</view>
</view>
</view>
</template>
<script>
import {
immsgRecall
} from '@/api/message/index.js';
export default {
name: "chat-item",
props: {
@@ -117,7 +128,7 @@
avatar: '',
nickname: '',
content: '',
selfStatus: false
selfStatus: false,
}
}
},
@@ -125,7 +136,7 @@
},
data() {
return {
copyFlag: false,
};
},
mounted() {
@@ -146,10 +157,43 @@
}
},
methods: {
navUserFn(item){
//复制
copyFn() {
console.log('复制', this.item);
this.copyFlag = false
uni.setClipboardData({
data: this.item.content,
success: () => {
uni.showToast({
title: '复制成功',
duration: 2000,
})
}
});
},
//撤回
withdrawFn() {
console.log('//撤回', this.item);
this.copyFlag = false
console.log(this.item.id);
immsgRecall(this.item.id).then(res=>{
console.log(res);
this.getMsgListFns()
uni.showToast({
title: '撤回成功',
duration: 2000,
})
})
},
//长嗯
showActions() {
console.log('长嗯', this.copyFlag, this.item);
this.copyFlag = true
},
navUserFn(item) {
console.log(item);
uni.navigateTo({
url:`/pages/driver/mine/personal_center/personal_center?uid=${item.srcUid}`
url: `/pages/driver/mine/personal_center/personal_center?uid=${item.srcUid}`
})
},
previewImage(img) {
@@ -162,6 +206,10 @@
videoPlay(e) {
this.$emit('videoPlay', e)
},
//撤回数据
getMsgListFns(e) {
this.$emit('getMsgListFns', this.index)
},
//跳转
Navto(url) {
uni.$u.route(url)
@@ -176,6 +224,37 @@
display: flex;
flex-direction: column;
padding: 20rpx;
position: relative;
}
.chat-content-operate {
position: absolute;
height: 70rpx;
/* width: 120rpx; */
top: 30rpx;
background: #888888;
z-index: 99;
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-around;
border-radius: 16rpx;
}
.chat-content-operate-l {
left: 120rpx;
}
.chat-content-operate-r {
right: 120rpx;
}
.chat-content-operate-text {
padding: 0 16rpx;
/* border-radius: 16rpx; */
font-size: 24rpx;
color: #eee;
}
.chat-time {
@@ -255,7 +334,7 @@
.chat-text-container {
background-color: #FFF;
border-radius:8rpx 8rpx 8rpx 8rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 22rpx 24rpx;
margin: 10rpx 0 0 10rpx;
max-width: 500rpx;
@@ -264,14 +343,14 @@
.chat-text-container-me {
background-color: #84D2CF;
border-radius:8rpx 8rpx 8rpx 8rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-right: 10rpx;
max-width: 500rpx;
/* border: 1px solid black; */
}
.mess_r{
.mess_r {
position: absolute;
top: 18rpx;
left: 0rpx;
@@ -281,7 +360,7 @@
/* border: 1px solid black; */
}
.mess_l{
.mess_l {
position: absolute;
top: 18rpx;
right: 0rpx;

View File

@@ -18,9 +18,9 @@
</view>
</template>
<!-- 聊天item -->
<template>
<cell :id="`z-paging-${index}`" v-for="(item,index) in mainList" :style="cellStyle" :key="index">
<chatItem :item="item" :index="index" @videoPlay="videoPlay" />
<template >
<cell @click="clickItemFn" :id="`z-paging-${index}`" v-for="(item,index) in mainList" :style="cellStyle" :key="index">
<chatItem ref="chatItem" :item="item" :index="index" @videoPlay="videoPlay" @getMsgListFns="getMsgListFns"/>
</cell>
</template>
<!-- 底部聊天输入框 -->
@@ -109,17 +109,7 @@
return
}
if (this.charSn) {
getMsgList({
charSn: this.charSn,
limit: 10,
page: 1
}).then(res => {
let Stutas = this.mainList.some(item => item.chatTime == res.data.list[0]
.chatTime);
if (!Stutas && !res.data.list[0].selfStatus) {
this.$refs.paging.addChatRecordData(res.data.list[0]);
}
});
this.getMsgListFn()
}
}, 3000);
uni.$emit('Chat', {
@@ -128,6 +118,29 @@
});
},
methods: {
//子组件刷新
getMsgListFns(index){
this.mainList.splice(index,1)
// this.mainList.forEach((item,index)=>{
// if(e.id==item.id){
// }
// })
},
//刷新数据
getMsgListFn(){
getMsgList({
charSn: this.charSn,
limit: 10,
page: 1
}).then(res => {
let Stutas = this.mainList.some(item => item.chatTime == res.data.list[0]
.chatTime);
if (!Stutas && !res.data.list[0].selfStatus) {
this.$refs.paging.addChatRecordData(res.data.list[0]);
}
});
},
//监听全屏
fullscreenchange(e) {
if (!e.detail.fullScreen) {
@@ -136,6 +149,14 @@
this.videoContext.play();
}
},
//点击
clickItemFn(){
// console.log(this.$refs.chatItem.length);
this.$refs.chatItem.forEach(item=>{
// console.log(item.copyFlag);
item.copyFlag=false
})
},
//播放视频自动进入全屏
videoPlay(url) {
this.videoUrl = url;
@@ -191,6 +212,7 @@
content: e.msg
}).then(res => {
this.charSn = res.data.chatSn;
console.log(res.data);
try {
this.$refs.paging.addChatRecordData({
//this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'
@@ -199,7 +221,8 @@
nickname: userInfo.nickname,
msgType: e.msgType,
content: e.msg,
selfStatus: true
selfStatus: true,
id:res.data.id
});
} catch (e) {
// console.log(e);

View File

@@ -41,7 +41,7 @@
</view>
<view class="user-data-name">{{informationData.carDealerName}}</view>
</view>
<view :class="['f-a-i','car-rental']">
<view :class="['f-a-i','car-rental']" @click="navParticularFn(1)">
<image :src="informationData.image" mode=""></image>
<view class="car-rental-cont">
<view class="car-rental-cont-name">{{informationData.title}}</view>
@@ -67,7 +67,7 @@
</view>
<view class="user-data-name">{{productData.carDealerName}}</view>
</view>
<view :class="['f-a-i','car-rental']">
<view :class="['f-a-i','car-rental']" @click="navParticularFn(2)">
<image :src="productData.mainImage" mode=""></image>
<view class="car-rental-cont">
<view class="car-rental-cont-name">{{productData.title}}</view>
@@ -134,6 +134,19 @@
})
},
methods: {
//租车卖车
navParticularFn(type){
if(type==1){
uni.navigateTo({
url: `/pages/driver/mine/my_order/rentCars/rent_particulars?id=${this.informationData.id}`
})
}else{
uni.navigateTo({
url: `/pages/driver/mine/my_order/buyCars/buy_cars_particulars?id=${this.productData.id}`
})
}
},
//
getDetail() {
orderNum().then(res => {
this.cardData = res.data