v5.5.82 部分bug修改

This commit is contained in:
lanzhihui 2024-11-28 11:23:53 +08:00
parent a4459d4c2b
commit d56dbd226f
12 changed files with 742 additions and 862 deletions

1318
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ wepy.app({
}
},
globalData: {
versions: 'v5.5.80', // 版本号
versions: 'v5.5.82', // 版本号
navBarHeight: 0, // 导航栏高度
navRight: 0, // 胶囊距右方间距(方保持左、右间距一致)
navTop: 0, // 胶囊距顶部间距

View File

@ -426,7 +426,7 @@ scroll-view {
return
}
console.log(vm.from, url, type, '7777')
if (vm.from != 'dynamicDetail') {
if (vm.from != 'dynamicDetail' && vm.from != 'dynamic') {
console.log('44---')
return
}

View File

@ -56,6 +56,7 @@ wepy.component({
methods: {
chooseImageV2() { // 上传照片
let vm = this
console.log(vm.num, 'num===')
vm.$showLoading(`加载中...`)
vm.cancelFn()
wx.chooseMedia({

View File

@ -102,7 +102,7 @@ export default {
// 成功回调
wx.removeStorageSync('formId')
resolve({statusCode, ...data})
} else if (data.code === 1) {
} else if (data.code == 1) {
// resolve({statusCode, ...data})
reject(new Error(`error ${data.message}`))
if (this.$is == 'pages/service/GroupChatPage' && data.message.includes('已断开连接')) {

View File

@ -274,9 +274,9 @@ page {
<view class="cu-form-group">
<view class="grid col-04 grid-square flex-sub">
<block v-if="uploadType == 'image'">
<view class="bg-img ui-dynamic-pic-item" v-for="(item,index) in imgList" :key="index" @tap="$previewImages(item, imgList)">
<view class="bg-img ui-dynamic-pic-item" v-for="(item,index) in imgList" :key="index" @tap.stop="$previewImages(item, imgList)">
<image class="ui-dynamic-pic" :src="item" mode="aspectFill"></image>
<view class="cu-tag bg-red ui-delete-icon" @tap="delImg" data-index="{{index}}">
<view class="cu-tag bg-red ui-delete-icon" @tap.stop="delImg(index)" data-index="{{index}}">
<text class="cuIcon-close"></text>
</view>
</view>
@ -302,6 +302,7 @@ page {
<view class="issue" @tap="saveIssue">发布</view>
</view>
</view>
<view v-if="showCon" class="modal-mask" @tap="showCon = false">
<view class="modal-dialog">
<view class="modal-title">温馨提示</view>
@ -312,7 +313,7 @@ page {
</view>
</view>
</view>
<uploadPic :num="9 - imgList.length" :chooseShow.sync="choosePicsShow" @changeVal="changeVal" @closeUploadPic="closeUpload"></uploadPic>
<uploadPic :num="imgNum" :chooseShow.sync="choosePicsShow" @changeVal="changeVal" @closeUploadPic="closeUpload"></uploadPic>
<!-- <uploadVideo :chooseShow.sync="chooseVideoShow" @changeVal="changeVideoVal" @closeUploadVideo="closeUpload"></uploadVideo>-->
<uploadVideoV2 ref="uploadVideo" @uploadVideoSuccess="changeVideoVal" @closeUploadVideo="closeUpload"></uploadVideoV2>
</template>
@ -367,7 +368,6 @@ wepy.page({
if (code == 0) {
vm.$showToast('动态已发布')
setTimeout(() => {
vm.throttle = true
// 发布成功后返回列表并且切换到最新tab
const pages = getCurrentPages()
const prevPage = pages[pages.length - 2]
@ -378,6 +378,7 @@ wepy.page({
prevPage.$wepy.scrollTopHandle = -1
prevPage.$wepy.getList()
wx.navigateBack({delta: 1})
vm.throttle = true
}, 1200)
}
}).catch(() => {
@ -510,6 +511,11 @@ wepy.page({
wx.navigateTo({url: `/pages/dynamic/searchTopic`})
}
},
computed: {
imgNum: function () {
return 9 - this.imgList.length
}
},
onShow() {},
onLoad(e) {
let vm = this

View File

@ -294,7 +294,8 @@ wepy.page({
no_more: false,
loading: false,
page: 1,
list: [] // 列表数据
list: [], // 列表数据
throttle: true
},
methods: {
getList() {
@ -314,30 +315,35 @@ wepy.page({
industry_sub: vm.is_industry_sub ? vm.is_industry_sub : '',
income: vm.is_income ? vm.is_income : ''
}
if (vm.throttle) {
vm.$showLoading('加载中...')
vm.throttle = false
vm.$get({url: `${service.host}/other/user/list?keyword=${vm.inputVal}`, data}).then(({code, data}) => {
if (code === 0) {
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
} else {
data.data.map(function (item) {
vm.list.push(item)
})
}
if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true
}
setTimeout(() => {
vm.loading = true
}, 500)
vm.page++
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
}).finally(() => {
vm.throttle = true
})
}
console.log(data, '*/**********')
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/other/user/list?keyword=${vm.inputVal}`, data}).then(({code, data}) => {
if (code === 0) {
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
} else {
data.data.map(function (item) {
vm.list.push(item)
})
}
if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true
}
setTimeout(() => {
vm.loading = true
}, 500)
vm.page++
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
// 初始化列表数据
initData() {
@ -418,6 +424,7 @@ wepy.page({
let vm = this
clearTimeout(vm.timer)
vm.timer = setTimeout(() => {
vm.list = []
vm.page = 1
vm.no_more = false
vm.getList()

View File

@ -603,7 +603,7 @@ page {
<view class="ui-relative {{!item.isSelf ? 'ui-left-msg-box f-fl' : 'ui-right-msg-box f-fr'}}">
<image v-if="item.isSelf && item.isSend == 2" class="ui-error-icon" src="https://image.fulllinkai.com/202408/16/26bce9092cd2c703f7d5b2d56ef9d132.png" mode="widthFix"></image>
<image v-if="!item.isSelf && item.isSend == 2" class="ui-error-icon-v2" src="https://image.fulllinkai.com/202408/16/26bce9092cd2c703f7d5b2d56ef9d132.png" mode="widthFix"></image>
<image v-if="!item.isSelf" class="ui-user-pic" :src="item.avatar" mode="aspectFill"></image>
<image @tap="jumpPathUser" v-if="!item.isSelf" class="ui-user-pic" :src="item.avatar" mode="aspectFill"></image>
<view class="{{item.isSelf ? 'ui-pr-12' : 'ui-pl-12'}}">
<view class="ui-relative">
<!--文本加表情信息-->
@ -825,41 +825,44 @@ wepy.page({
isSend: 0,
msgType: 'text'
})
vm.toView = `id_${timeData}`
let msgIndex = 0
let msgNewObj = {}
msgIndex = vm.msgList.findIndex((e) => e.timestamp == timeData)
app.globalData.nim.msg.sendTextMsg({
scene: 'p2p',
to: vm.otherUserId,
body: vm.msg,
isSend: 0,
onSendBefore: function (msg) {
console.log('get msg before', msg)
if (/\[[^\]]+\]/.test(vm.msg)) {
vm.msg = vm.transitionMsg(vm.msg)
}
msgNewObj = {
text: vm.msg,
attach: '',
id: `id_${msg.time}`,
isSelf: true,
avatar: vm.myAvatar,
time: getTime(format(msg.time)),
showTime: timeContrast(vm.firstTime, format(msg.time)),
name: vm.myName,
userId: msg.from,
isSend: 1,
msgType: 'text'
}
setTimeout(() => {
vm.msgList.splice(msgIndex, 1, msgNewObj)
vm.firstTime = format(msg.time)
vm.lastTime = format(msg.time)
vm.callbackSend('text')
// vm.$post({url: ``, data: {}})
// .then(res => {
vm.toView = `id_${timeData}`
let msgIndex = 0
let msgNewObj = {}
msgIndex = vm.msgList.findIndex((e) => e.timestamp == timeData)
app.globalData.nim.msg.sendTextMsg({
scene: 'p2p',
to: vm.otherUserId,
body: vm.msg,
isSend: 0,
onSendBefore: function (msg) {
console.log('get msg before', msg)
if (/\[[^\]]+\]/.test(vm.msg)) {
vm.msg = vm.transitionMsg(vm.msg)
}
msgNewObj = {
text: vm.msg,
attach: '',
id: `id_${msg.time}`,
isSelf: true,
avatar: vm.myAvatar,
time: getTime(format(msg.time)),
showTime: timeContrast(vm.firstTime, format(msg.time)),
name: vm.myName,
userId: msg.from,
isSend: 1,
msgType: 'text'
}
setTimeout(() => {
vm.msgList.splice(msgIndex, 1, msgNewObj)
vm.firstTime = format(msg.time)
vm.lastTime = format(msg.time)
vm.callbackSend('text')
})
}
})
}
})
// })
},
// 发送图片消息
sendPictures(file) {
@ -1558,7 +1561,11 @@ wepy.page({
},
jumpPath(url) {
wx.navigateTo({url: url})
}
},
jumpPathUser(e) {
let vm = this
wx.navigateTo({url: `/pages/home/information?id=${vm.otherUserId}`})
}
},
onShow() {

View File

@ -353,6 +353,12 @@ page {
letter-spacing: 2rpx;
}
}
.name_width{
max-width: 190rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
<template>
<view class="ui-friendRequest">
@ -373,7 +379,7 @@ page {
</view>
<view class="rit weuis">
<view class="title">
<view class="font_32 color333 bold name">
<view class="font_32 color333 bold name_width" >
{{item.user.nickname }}
</view>
<!-- <block v-if="item.user.type !== 'single'">-->

View File

@ -701,6 +701,8 @@ wepy.page({
videoState: null,
playAudioIndex: -1,
innerAudioContext: null,
myTime: null,
audioTime: null,
audioState: null,
@ -793,41 +795,44 @@ wepy.page({
isSend: 0,
msgType: '0'
})
vm.toView = `id_${timeData}`
let msgIndex = 0
let msgNewObj = {}
msgIndex = vm.msgList.findIndex((e) => e.timestamp == timeData)
app.globalData.nim.msg.sendTextMsg({
scene: 'team',
to: vm.otherUserId,
body: vm.msg,
isSend: 0,
onSendBefore: function (msg) {
console.log('get msg before', msg)
if (/\[[^\]]+\]/.test(vm.msg)) {
vm.msg = vm.transitionMsg(vm.msg)
}
msgNewObj = {
text: vm.msg,
attach: '',
id: `id_${msg.time}`,
isSelf: true,
avatar: vm.myAvatar,
time: getTime(format(msg.time)),
showTime: timeContrast(vm.firstTime, format(msg.time)),
name: vm.myName,
userId: msg.from,
isSend: 1,
msgType: '0'
}
setTimeout(() => {
vm.msgList.splice(msgIndex, 1, msgNewObj)
vm.firstTime = format(msg.time)
vm.lastTime = format(msg.time)
vm.callbackSend('text')
// vm.$post({url: ``, data: {}})
// .then(res => {
vm.toView = `id_${timeData}`
let msgIndex = 0
let msgNewObj = {}
msgIndex = vm.msgList.findIndex((e) => e.timestamp == timeData)
app.globalData.nim.msg.sendTextMsg({
scene: 'team',
to: vm.otherUserId,
body: vm.msg,
isSend: 0,
onSendBefore: function (msg) {
console.log('get msg before', msg)
if (/\[[^\]]+\]/.test(vm.msg)) {
vm.msg = vm.transitionMsg(vm.msg)
}
msgNewObj = {
text: vm.msg,
attach: '',
id: `id_${msg.time}`,
isSelf: true,
avatar: vm.myAvatar,
time: getTime(format(msg.time)),
showTime: timeContrast(vm.firstTime, format(msg.time)),
name: vm.myName,
userId: msg.from,
isSend: 1,
msgType: '0'
}
setTimeout(() => {
vm.msgList.splice(msgIndex, 1, msgNewObj)
vm.firstTime = format(msg.time)
vm.lastTime = format(msg.time)
vm.callbackSend('text')
})
}
})
}
})
// })
},
// 发送图片消息
sendPictures(file) {
@ -1480,28 +1485,49 @@ wepy.page({
// 播放音频
playAudio(row, index) {
let vm = this
vm.audioState = !vm.audioState
if (index != vm.playAudioIndex && vm.innerAudioContext) { // 不同清除
vm.audioState = true
clearInterval(vm.myTime)
// vm.playAudioIndex = -1
vm.innerAudioContext.destroy() // 释放音频资源
vm.innerAudioContext = null
} else {
vm.audioState = !vm.audioState
}
vm.playAudioIndex = index
const innerAudioContext = wx.createInnerAudioContext({
useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
})
let myTime = null
console.log(vm.innerAudioContext)
if (vm.audioState) {
innerAudioContext.src = row.url
innerAudioContext.play() // 播放
vm.audioTime = 0
myTime = setInterval(() => {
if (!vm.innerAudioContext) {
vm.myTime = null
vm.innerAudioContext = wx.createInnerAudioContext({
useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
})
vm.audioTime = 0
vm.innerAudioContext.src = row.url
} else {
vm.audioTime = Math.floor(vm.innerAudioContext.currentTime)
}
console.log(vm.audioTime, 'vm.audioTime')
vm.innerAudioContext.play() // 播放
vm.myTime = setInterval(() => {
vm.audioTime += 1
if (vm.audioTime * 1000 > row.dur) {
clearInterval(myTime)
clearInterval(vm.myTime)
vm.audioState = false
vm.playAudioIndex = -1
vm.innerAudioContext.destroy() // 释放音频资源
vm.innerAudioContext = null
}
}, 1000)
console.log(vm.innerAudioContext, 'innerAudioContext=')
} else {
clearInterval(myTime)
vm.innerAudioContext.pause() // 停止
clearInterval(vm.myTime)
// vm.myTime = null
vm.audioState = false
vm.playAudioIndex = -1
// vm.playAudioIndex = -1
}
},
// 预览图片

View File

@ -530,7 +530,7 @@
let recordTime = String(parseFloat(new Date(repTime).getTime()) / 1000)
console.log(recordTime, 'recordTime')
self.UID = recordTime.substring(recordTime.length - 5) + String(data.user.id)
wx.setStorageSync('UID', self.user.UID)
wx.setStorageSync('UID', self.UID)
self.shareConfig.images[1].url = data.share_qrcode
self.posterConfig = self.shareConfig
console.log(self.posterConfig, '333===0999')

View File

@ -265,6 +265,9 @@
return vm.$showToast('请核查认证信息')
}
this.user = data
let userInfo = wx.getStorageSync('userInfo')
userInfo.is_real_approved = data.is_real_approved
wx.setStorageSync('userInfo', userInfo)
if (data.card_num && data.is_real_approved == 1) {
this.user.new_card_num = this.interceptAndReplace(data.card_num, 5, 2, '*')
}