优化代码

This commit is contained in:
pengxiaolong
2025-07-29 14:23:27 +08:00
parent 36005c9604
commit 3eddd94922
38 changed files with 4423 additions and 20192 deletions

View File

@@ -148,6 +148,7 @@
type="textarea"
v-model="remarks"
placeholder="备注"
:maxlength="50"
></uni-easyinput>
</view>

View File

@@ -133,7 +133,7 @@
type="textarea"
v-model="remarks"
placeholder="备注"
maxlength="-1"
:maxlength="50"
></uni-easyinput>
</view>

View File

@@ -29,7 +29,7 @@ export default {
name: "",
id: "",
info: {},
userSig: "",
useravatar: "",
};
},
onLoad(option) {
@@ -38,13 +38,7 @@ export default {
success: (res) => {
this.id = res.data.id;
this.name = res.data.nickName;
this.userinfo = res.data.headerIcon;
},
});
uni.getStorage({
key: "userSig",
success: (res) => {
this.userSig = res.data;
this.userinfo = this.useravatar = res.data.headerIcon;
},
});
},
@@ -70,7 +64,36 @@ export default {
title: "修改中...",
mask: true,
});
if (this.useravatar == this.userinfo) {
request({
url: "user/updateUserInfo",
method: "POST",
data: {
id: this.id,
headerIcon: this.userinfo.split("/").pop(),
nickName: this.name,
},
userInfo: true,
}).then((ress) => {
if (ress.code === 200) {
uni.showToast({
title: "修改成功",
icon: "success",
});
uni.setStorageSync("userinfo", ress.data.info);
goEasylogin(this.$goeasy,String(ress.data.info.id),ress.data.info.headerIcon,ress.data.info.nickName);
uni.hideLoading();
uni.navigateBack({
delta: 1,
});
} else {
uni.showToast({
title: "修改失败",
icon: "none",
});
}
});
}else{
postFile({
path: this.userinfo,
name: generateFileName(),
@@ -83,10 +106,10 @@ export default {
id: this.id,
headerIcon: res.split("/").pop(),
nickName: this.name,
usersig: this.userSig.userSig,
},
userInfo: true,
}).then((ress) => {
console.log("修改调用返回",ress);
if (ress.code === 200) {
uni.showToast({
title: "修改成功",
@@ -109,8 +132,9 @@ export default {
});
})
.catch((err) => {
console.log(err);
console.log('上传失败', err);
});
}
},
},
};

View File

@@ -379,6 +379,9 @@ export default {
onHide() {
this.onPage = false;
},
onUnload() {
this.onPage = false;
},
onLoad(options) {
this.recorderManager.onStop((res) => {
console.log("录音结束", res);
@@ -933,12 +936,14 @@ export default {
top: 120rpx;
width: 46rpx;
height: 46rpx;
z-index: 1;
z-index: 2;
}
.title {
position: fixed;
top: 120rpx;
left: 325rpx;
left:0;
right: 0;
text-align: center;
font-size: 34rpx;
color: #100e0f;
font-weight: bold;

View File

@@ -77,20 +77,17 @@
</view>
</view>
<view class="remark">
<uni-easyinput
type="textarea"
v-model="item.remark"
placeholder="备注"
maxlength="-1"
disabled="true"
:style="style"
></uni-easyinput>
<scroll-view show-scrollbar="false" scroll-y="true" class="Remarkscroll">
<view class="Remarkscss">{{ item.remark }}</view>
</scroll-view>
</view>
<view class="buttonflex">
<view class="button" v-if="item.senderId !== id">
<button class="accept" @click="openChat()">聊了个天</button>
<button class="reject" @click="open()">立即邀请</button>
</view>
</view>
</view>
</view>
<!-- 弹窗 -->
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
@@ -122,7 +119,7 @@
mode="scaleToFill"
/>
</view>
<view>{{ TimeFormatting(item.pkTime) }}</view>
<view>{{ TimeFormatting(item.pkTime*1000) }}</view>
<view class="goldimg">
<image
style="width: 31.49rpx; height: 31.49rpx; margin-top: 4rpx"
@@ -166,12 +163,6 @@ import formatDate from "../../components/formatDate.js";
import TimeFormatting from "../../components/TimeFormatting.js";
import NewAddedPk from "../../pages/NewAddedPk/NewAddedPk.vue";
import request from "../../components/request.js";
// import Recompose from "../Mine/minecomponents/recompose/recompose.vue";
import TUIChatEngine, {
TUIStore,
StoreName,
TUIChatService,
} from "@tencentcloud/chat-uikit-engine";
export default {
data() {
return {
@@ -185,10 +176,6 @@ export default {
currentConversation: null,
inid: null,
chatPartnerinfo: {},
// parentMessage: null,
style: {
backgroundColor: "#ffffff",
},
};
},
onShareAppMessage(res) {
@@ -683,11 +670,33 @@ export default {
margin-top: 60rpx;
width: 90%;
}
.Remarkscroll{
width: 100%;
height: 300rpx;
}
.Remarkscroll ::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.Remarkscss{
padding: 20rpx;
word-break: break-all; /* 强制换行 */
white-space: pre-line; /* 保留空白符并换行 */
width: 100%;
font-size: 28rpx;
}
.buttonflex{
position: fixed;
left: 0;
right: 0;
bottom: 40rpx;
}
.button {
display: flex;
justify-content: center;
align-items: center;
margin-top: 500rpx;
}
.accept {
width: 325.38rpx;