4.1(优化

This commit is contained in:
Hong
2024-04-01 19:05:57 +08:00
parent 0f8d33ec8f
commit 071b33ec66
12 changed files with 206 additions and 104 deletions

View File

@@ -139,7 +139,7 @@ export function plazaNoteAdd(data) {
})
}
/**
* 举报帖子
* 举报用户
*/
export function reportAdd(data) {
return request({
@@ -148,6 +148,16 @@ export function reportAdd(data) {
data
})
}
/**
* 举报帖子
*/
export function noteReportAdd(data) {
return request({
url: '/api/front/community/note/report/add',
method: 'post',
data
})
}
/**
* 点赞帖子
*/

View File

@@ -1,10 +1,10 @@
// 应用全局配置
module.exports = {
//正式
// baseUrl: 'https://wxapp.diyouzhijia.com/car_app_api',
baseUrl: 'https://wxapp.diyouzhijia.com/car_app_api',
TOKENNAME: 'Authori-zation',
//薛磊测试
baseUrl: 'http://192.168.31.226:8081/car_app_api',
// baseUrl: 'http://192.168.31.226:8081/car_app_api',
fileUploadUrl: 'https://wxapp.diyouzhijia.com/car_app_api/api/front/upload/image',
WebSocketUrl: 'ws://121.199.24.205:9107/lxk/websocket',
WebSocketOpen: false,

View File

@@ -2,8 +2,8 @@
"name" : "滴友之家",
"appid" : "__UNI__F2BE74F",
"description" : "",
"versionName" : "1.1.3",
"versionCode" : 113,
"versionName" : "1.1.5",
"versionCode" : 115,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,

View File

@@ -70,7 +70,8 @@
<script>
import {
reportAdd
reportAdd,
noteReportAdd
} from "@/api/discover/discover.js"
import {
reportTypeList
@@ -91,7 +92,11 @@
reportShow: false,
reportCategoryData: {
name: '违法信息'
}
},
//举报类型
reportType: 1,
//帖子id
noteId:''
};
},
methods: {
@@ -105,26 +110,37 @@
reportClose() {
this.reportShow = false
},
reportOpen(e) {
},
reportOpen(e) {},
//发布
issueFn() {
uni.showLoading({
title: '举报中...'
});
let obj={
let obj = {
reason: this.content,
toUid: this.toUid,
reportCategoryId: this.reportCategoryData.id,
reportImg:this.picList
reportImg: this.picList,
noteId:this.noteId
}
console.log(obj);
reportAdd(obj).then(res => {
uni.hideLoading();
uni.redirectTo({
url:'/pages/driver/index/report_result'
if (this.reportType == 2) {
reportAdd(obj).then(res => {
console.log('用户');
uni.hideLoading();
uni.redirectTo({
url: '/pages/driver/index/report_result'
})
})
})
} else {
noteReportAdd(obj).then(res => {
console.log('贴子');
uni.hideLoading();
uni.redirectTo({
url: '/pages/driver/index/report_result'
})
})
}
},
//传图片
getImage() {
@@ -147,7 +163,10 @@
}
},
onLoad(options) {
console.log(options);
this.toUid = options.id
this.reportType = options.reportType
this.noteId=options.noteId
// 获取举报类型列表
categoryReportList().then(res => {
if (res.data.length) {

View File

@@ -235,7 +235,8 @@
chatType: item.chatType,
toUid: item.toUid,
toUidNickname: item.toUidNickname,
index: i
index: i,
isConcerned:item.isConcerned
});
},

View File

@@ -402,12 +402,13 @@
},
//三个点
reportFn(item) {
console.log(item);
uni.showActionSheet({
itemList: ['举报'],
success: (res) => {
if (res.tapIndex == 0) {
uni.navigateTo({
url: '/pages/carShop/community/report?id=' + item.id
url: `/pages/carShop/community/report?id=${item.id}&reportType=1&noteId=${item.id}`
})
}
},

View File

@@ -215,7 +215,7 @@
// 获取消息内,各种未读数量
getUnRead() {
getUnReadAPI().then(res => {
console.log('未读', res.data);
// console.log('未读', res.data);
this.unreadData = res.data
//系统消息
this.groupList[0].unReadCount=res.data.systemArticleUnReadNum
@@ -265,12 +265,14 @@
// toUidNickname: item.toUidNickname,
// index: i
// });
console.log(item.isConcerned);
this.$u.route(url, {
charSn: JSON.stringify(encodeURIComponent(item.chatSn)),
chatType: item.chatType,
toUid: item.toUid,
toUidNickname: item.toUidNickname,
index: i
index: i,
isConcerned:item.isConcerned
});
},

View File

@@ -109,8 +109,8 @@
{img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/album.png',text:'相册'},
{img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/video.png',text:'视频'},
// {img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/redEnvelope.png',text:'红包'},
{img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/phone.png',text:'语音通话'},
{img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/video.png',text:'视频通话'}
// {img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/phone.png',text:'语音通话'},
// {img:'https://jimte.oss-cn-hangzhou.aliyuncs.com/xcximage/douyin/video.png',text:'视频通话'}
]
};
},

View File

@@ -15,67 +15,81 @@
<template v-if="item.msgType ===0">
<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:30rpx;color:'+(item.selfStatus?'#000;':'#333;')" >{{item.content}}</text>
:style="'font-size:30rpx;color:'+(item.selfStatus?'#000;':'#333;')">{{item.content}}</text>
</view>
</template>
<template v-else-if="item.msgType ===1">
<view :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
@click.stop="previewImage(item.content)">
<u--image :src="item.content" width="85" height="131"/>
<view
:class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
@click.stop="previewImage(item.content)">
<u--image :radius="item.selfStatus?'16rpx 0 16rpx 16rpx':'0 16rpx 16rpx 16rpx'" :src="item.content" width="85" height="131" />
</view>
</template>
<template v-else-if="item.msgType ===2">
<view :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" style="position: relative;">
<view
:class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
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;border-radius: 16rpx;overflow: hidden;"/>
<view :class="{'chat-video-container-me':item.selfStatus,'chat-video-container':true}" @click.stop="videoPlay(item.content)">
<image
mode="aspectFit"
:src="item.content+'?x-oss-process=video/snapshot,t_1000,m_fast'"
style="width: 170rpx;height:262rpx;overflow: hidden;" :style="{borderRadius:item.selfStatus?'16rpx 0 16rpx 16rpx':'0 16rpx 16rpx 16rpx'}" />
<view :class="{'chat-video-container-me':item.selfStatus,'chat-video-container':true}"
@click.stop="videoPlay(item.content)">
<image mode="aspectFit"
src="https://qicheoss.oss-cn-shanghai.aliyuncs.com/xcximage/douyin/play.png"
style="width: 60rpx;height: 60rpx;opacity: 0.6;"/>
style="width: 60rpx;height: 60rpx;opacity: 0.6;" />
</view>
</view>
</template>
<template v-else-if="item.msgType ===4">
<view :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" style="position: relative;"
@click="Navto({url:'/pages/driver/goods/goods_details/index',type:'redirectTo',params:{id:goodsDetai(item.content).id}})">
<u--image :src="goodsDetai(item.content).image" width="85" height="131"/>
<view style="position: absolute;bottom: 0;left: 0;padding: 8rpx 4rpx;background-color: rgba(0, 0, 0, 0.5);border-radius: 14rpx;">
<u--text :text="goodsDetai(item.content).name" size="10" lines="1" color="#fff"/>
<view
:class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
style="position: relative;"
@click="Navto({url:'/pages/driver/goods/goods_details/index',type:'redirectTo',params:{id:goodsDetai(item.content).id}})">
<u--image :src="goodsDetai(item.content).image" width="85" height="131" />
<view
style="position: absolute;bottom: 0;left: 0;padding: 8rpx 4rpx;background-color: rgba(0, 0, 0, 0.5);border-radius: 16rpx 0 16rpx 16rpx;">
<u--text :text="goodsDetai(item.content).name" size="10" lines="1" color="#fff" />
</view>
</view>
</template>
<template v-else-if="item.msgType ===5">
<view :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" style="position: relative;"
@click.stop="Navto({url:'/pages/driver/discover/discover_video/index',type:'redirectTo',params:{noteId:discoverVideo(item.content).id}})">
<image
:src="discoverVideo(item.content).image" style="width: 170rpx;height:262rpx;border-radius: 16rpx;overflow: hidden;"/>
<view
:class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
style="position: relative;"
@click.stop="Navto({url:'/pages/driver/discover/discover_video/index',type:'redirectTo',params:{noteId:discoverVideo(item.content).id}})">
<image :src="discoverVideo(item.content).image"
style="width: 170rpx;height:262rpx;border-radius: 16rpx;overflow: hidden;" />
<view :class="{'chat-video-container-me':item.selfStatus,'chat-video-container':true}">
<image
mode="aspectFit"
<image mode="aspectFit"
src="https://qicheoss.oss-cn-shanghai.aliyuncs.com/xcximage/douyin/play.png"
style="width: 60rpx;height: 60rpx;opacity: 0.6;"/>
style="width: 60rpx;height: 60rpx;opacity: 0.6;" />
</view>
<view style="position: absolute;bottom: 8rpx;left: 0;padding: 8rpx 4rpx;background-color: rgba(0, 0, 0, 0.5);border-radius: 14rpx;">
<u--text :text="discoverVideo(item.content).name" size="10" lines="1" color="#fff"/>
<view
style="position: absolute;bottom: 8rpx;left: 0;padding: 8rpx 4rpx;background-color: rgba(0, 0, 0, 0.5);border-radius: 14rpx;">
<u--text :text="discoverVideo(item.content).name" size="10" lines="1" color="#fff" />
</view>
</view>
</template>
<template v-else-if="item.msgType === 6">
<view :class="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}" 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="{'chat-text-container-me-border-radius':item.selfStatus,'chat-text-container-border-radius':true}"
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>
<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>
<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>
<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>
<text
style="font-size: 28rpx;font-weight: 500;color: #444444;">{{JSON.parse(item.content).intro}}</text>
</view>
</view>
</view>
@@ -84,16 +98,17 @@
</template>
</view>
</view>
</view>
</template>
<script>
export default {
name:"chat-item",
name: "chat-item",
props: {
item: {
type: Object,
default(){
default () {
return {
chatTime: '',
avatar: '',
@@ -103,75 +118,80 @@
}
}
},
index:0
index: 0
},
data() {
return {
};
},
mounted() {
// console.log('vue,',this.item);
},
computed:{
computed: {
//商品详情
goodsDetai(){
return (val)=>{
goodsDetai() {
return (val) => {
return JSON.parse(val)
}
},
//短视频详情
discoverVideo(){
return (val)=>{
discoverVideo() {
return (val) => {
return JSON.parse(val)
}
}
},
methods:{
previewImage(img){
methods: {
previewImage(img) {
uni.previewImage({
urls:[img],
current:0
urls: [img],
current: 0
});
},
//播放视频
videoPlay(e){
this.$emit('videoPlay',e)
videoPlay(e) {
this.$emit('videoPlay', e)
},
//跳转
Navto(url){uni.$u.route(url)},
Navto(url) {
uni.$u.route(url)
},
},
onLoad() {
}
onLoad() {}
}
</script>
<style scoped>
.chat-item{
.chat-item {
display: flex;
flex-direction: column;
padding: 20rpx;
}
.chat-time{
.chat-time {
padding: 24rpx 0rpx;
text-align: center;
font-size: 22rpx;
color: #aaa;
}
.chat-container{
.chat-container {
display: flex;
flex-direction: row;
}
.chat-video-container-me{
.chat-video-container-me {
margin-left: 0;
/* #ifdef H5 */
right:50rpx;
right: 50rpx;
/*#endif*/
/* #ifdef MP */
right:100rpx;
right: 100rpx;
/*#endif*/
}
.chat-video-container{
.chat-video-container {
position: absolute;
top: 100rpx;
flex: 1;
@@ -179,64 +199,79 @@
margin-left: 50rpx;
align-items: center;
}
.chat-text-container-me-border-radius{
border-radius:16rpx 0 16rpx 16rpx;
.chat-text-container-me-border-radius {
border-radius: 16rpx 0 16rpx 16rpx;
overflow: hidden;
}
.chat-text-container-border-radius{
border-radius:0 16rpx 16rpx 16rpx;
.chat-text-container-border-radius {
border-radius: 0 16rpx 16rpx 16rpx;
overflow: hidden;
}
.chat-location-me{
.chat-location-me {
flex-direction: row-reverse;
text-align: right;
}
.chat-icon-container{
.chat-icon-container {
margin-top: 12rpx;
}
.chat-icon{
.chat-icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background-color: #eee;
}
.chat-content-container{
.chat-content-container {
margin: 0rpx 15rpx;
}
.chat-user-name{
.chat-user-name {
font-size: 26rpx;
color: #888;
}
.chat-text-container{
.chat-text-container {
background-color: #FFF;
border-radius: 8rpx;
border-radius: 0 8rpx 8rpx 8rpx;
padding: 22rpx 24rpx;
margin-top: 10rpx;
/* #ifndef APP-NVUE */
max-width: 500rpx;
/* #endif */
}
.chat-text-container-me{
.chat-text-container-me {
background-color: #84D2CF;
border-radius: 8rpx 0 8rpx 8rpx;
}
.char-text{
.char-text {
font-size: 28rpx;
/* #ifndef APP-NVUE */
max-width: 500rpx;
word-break: break-all;
/* #endif */
}
.char-text-me{
.char-text-me {
color: white;
}
.video{
.video {
width: 170rpx;
height:262rpx;
height: 262rpx;
}
.activity-box {
padding: 16rpx;
background-color: #FFF;
}
.activity-item {
margin-top: 16rpx;
background: #F5F5F5;
@@ -258,6 +293,7 @@
height: 124rpx;
} */
}
.activity-item-info {
width: 350rpx;
line-height: 44rpx;

View File

@@ -23,13 +23,18 @@
</template>
<script>
import {parseTime} from "@/utils/index.js";
import {
parseTime
} from "@/utils/index.js";
import chatItem from "./components/chat-item/chat-item.vue";
import chatInputBar from "./components/chat-input-bar/chat-input-bar.vue";
import {
getMsgList,
SendMmsg
} from '@/api/message/index.js';
import {
concernedAuthor,
} from "@/api/discover/discover.js"
export default {
components: {
chatItem,
@@ -45,9 +50,35 @@
toUid: 0,
time: null,
videoUrl: '',
videoContext: null
videoContext: null,
postFlag: true,
//是否关注
isConcerned: 'false'
}
},
onNavigationBarButtonTap(e) {
console.log(this.isConcerned);
uni.showActionSheet({
itemList: [this.isConcerned == 'true' ? '取消关注' : '关注', '举报'],
success: (res) => {
if (res.tapIndex + 1 == 2) {
uni.navigateTo({
url: `/pages/carShop/community/report?id=${this.toUid}&reportType=2`
})
} else {
concernedAuthor(this.toUid).then(res => {
if(this.isConcerned == 'true'){
this.isConcerned = 'false'
}else{
this.isConcerned = 'true'
}
})
}
},
fail: function(err) {
}
});
},
onUnload() {
clearInterval(this.time);
this.time = null;
@@ -56,6 +87,7 @@
if (opt.charSn) this.charSn = JSON.parse(decodeURIComponent(opt.charSn));
this.chatType = opt.chatType || 0;
this.toUid = opt.toUid || 0;
this.isConcerned = opt.isConcerned
uni.setNavigationBarTitle({
title: `${decodeURIComponent(opt.toUidNickname)||'加载中...'}`
});
@@ -120,6 +152,7 @@
limit: pageSize,
page: pageNo
}).then(res => {
console.log('111', res.data.list);
this.$refs.paging.complete(res.data.list);
});
}, 0);
@@ -150,18 +183,18 @@
content: e.msg
}).then(res => {
this.charSn = res.data.chatSn;
try{
try {
this.$refs.paging.addChatRecordData({
//this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'
chatTime: parseTime(new Date(),'{y}-{m}-{d} {h}:{i}:{s}'),
chatTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
avatar: userInfo.avatar,
nickname: userInfo.nickname,
msgType: e.msgType,
content: e.msg,
selfStatus: true
});
}catch(e){
// console.log(e);
} catch (e) {
// console.log(e);
}
}).catch(err => {
this.$u.toast(err.message);

View File

@@ -166,7 +166,7 @@
width: 100%;
.tabs_list {
width: 200rpx;
width: 150rpx;
text-align: center;
position: relative;
padding: 24rpx 0;
@@ -185,11 +185,11 @@
}
.active-style {
width: 80rpx;
width: 60rpx;
position: absolute;
background: #13AFA8;
height: 6rpx;
left: 60rpx;
left: 45rpx;
bottom: 0;
}
}

View File

@@ -283,11 +283,11 @@
color="#13AFA8">立即订车</u-button>
</view>
</view>
<u-picker keyName="carDealerName" :visibleItemCount="keyName == 'city' ? 3 : 5" @change="changeHandler"
<u-picker keyName="carDealerName" :visibleItemCount="keyName == 'city' ? 5 : 5" @change="changeHandler"
@cancel="show = false" @confirm="confirm" confirmColor="#13AFA8" :title="title" :show="show" round="16"
:columns="columns"></u-picker>
<u-picker keyName="carDealerName" @confirm="attrConfirm" confirmColor="#13AFA8" :title="title" :show="attrShow"
<u-picker keyName="carDealerName" @confirm="attrConfirm" confirmColor="#13AFA8" :title="title" :show="attrShow"
round="16" :columns="attrListData"></u-picker>
<!-- 支付方式 -->
<u-popup :show="topUpTypeShow" @close="topUpTypeClose" round="16" closeOnClickOverlay>