This commit is contained in:
cansnow
2026-01-09 09:15:59 +08:00
parent 78386d4cc1
commit 7913a63a39
51 changed files with 1048 additions and 449 deletions
+9 -4
View File
@@ -235,6 +235,7 @@
}
},
confirm() {
const _this = this;
//console.log(this.checkedUserIDList,this.checkedGroupIDList);
//return false;
// if (this.activeTab) {
@@ -262,16 +263,20 @@
return;
}
if (this.type === ContactChooseTypes.Invite) {
console.log(_this.getCheckedUserInfo,_this.groupID);
IMSDK.asyncApi(IMSDK.IMMethods.InviteUserToGroup, IMSDK.uuid(), {
groupID: this.groupID,
groupID: _this.groupID,
reason: "",
userIDList: this.getCheckedUserInfo.map((user) => user.userID),
userIDList: _this.getCheckedUserInfo.map((user) => user.userID),
})
.then(() => {
toastWithCallback("操作成功", () => uni.navigateBack());
this.comfirmLoading = false;
_this.comfirmLoading = false;
})
.catch(() => toastWithCallback("操作失败"));
.catch((e) => {
console.log(e);
toastWithCallback("操作失败")
});
return;
}
@@ -66,8 +66,6 @@
return true;
}
return false;
console.log(friend.nickname);
return friend.nickname.indexOf(this.keyword) !==-1 || friend?.remark.indexOf(this.keyword) !==-1
}
),
],
+30 -31
View File
@@ -158,37 +158,35 @@ export default {
});
},
async startLogin() {
this.$refs.loginForm.validate().then(async (valid) => {
this.loading = true;
this.saveLoginInfo();
let data = {};
try {
data = await businessLogin({
mobile: this.loginInfo.phoneNumber,
email: this.loginInfo.email,
region: `+${this.loginInfo.region}`,
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
platform: uni.$u.os(),
type: this.active === 0 ? 'mobile' : 'email',
code: this.loginInfo.verificationCode,
});
const { imToken, userID } = data;
this.saveLoginProfile(data);
this.$store.commit("user/SET_AUTH_DATA", data);
this.loginInfo.password = "";
// #ifdef APP
// await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
// userID,
// token: imToken,
// });
plus.runtime.restart();
// #endif
} catch (err) {
console.error(err);
uni.$u.toast(checkLoginError(err));
}
this.loading = false;
});
this.loading = true;
this.saveLoginInfo();
let data = {};
try {
data = await businessLogin({
mobile: this.loginInfo.phoneNumber,
email: this.loginInfo.email,
region: `+${this.loginInfo.region}`,
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
platform: uni.$u.os(),
type: this.active === 0 ? 'mobile' : 'email',
code: this.loginInfo.verificationCode,
});
const { imToken, userID } = data;
this.saveLoginProfile(data);
this.$store.commit("user/SET_AUTH_DATA", data);
this.loginInfo.password = "";
// #ifdef APP
// await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
// userID,
// token: imToken,
// });
plus.runtime.restart();
// #endif
} catch (err) {
console.error(err);
uni.$u.toast(checkLoginError(err));
}
this.loading = false;
},
saveLoginProfile(data) {
const { imToken, token, userID } = data;
@@ -275,6 +273,7 @@ export default {
align-items: center;
img {
border-radius: 32rpx;
width: 160rpx;
height: 160rpx;
}
+100 -30
View File
@@ -1,24 +1,32 @@
<template>
<view class="m-shade n-flex-1 n-align-center n-justify-center">
<view :style="{width:'580rpx'}">
<image src="/static/image/upgrade.png" mode="widthFix"></image>
<view class="n-ps-all-ll n-ms-top-ll n-position-absolute">
<text class="n-size-mm n-weight-7 n-color-inverse">发现新版本</text>
<text class="n-size-base n-ms-top-ss n-color-inverse">V{{model.version}}</text>
</view>
<view class="n-ps-all-l n-radius-lb-base" :style="{backgroundColor:'#f3f3f3',borderRadius:'0 0 16rpx 16rpx'}">
<view :style="{height:'300rpx'}">
<scroll-view class="n-flex-1" :show-scrollbar="false" scroll-y>
<rich-text class="n-size-s" :nodes="model.content" :style="{lineHeight:'26rpx'}"></rich-text>
</scroll-view>
<view class="upgrade_page">
<uni-nav-bar left-icon="back"
@clickLeft="back"
title="系统更新"
backgroundColor="#FFF"
fixed
statusBar>
</uni-nav-bar>
<view style="flex:1;display: flex;align-items: center;justify-content: center;">
<view :style="{width:'580rpx',position:'relative'}">
<image src="/static/images/upgrade.png" :style="{width:'580rpx'}" mode="widthFix"></image>
<view class="version_info">
<text class="title">发现新版本</text>
<text class="code">V{{model.version}}</text>
</view>
<view class="n-height-base n-justify-center">
<view v-if="progress">
<uv-line-progress :percentage="value" activeColor="#fc3463"></uv-line-progress>
</view>
<view class="n-flex-row" v-else>
<uv-button class="n-flex-1 n-ms-right-ll" v-if="model.force==0" @click="cancel" :customStyle="{backgroundColor:'#f3f3f3'}" text="暂不更新" color="#fc3463" shape="circle" throttleTime="1000" plain></uv-button>
<uv-button class="n-flex-1" @click="upgrade" text="立即更新" color="#fc3463" shape="circle" throttleTime="1000"></uv-button>
<view class="detail">
<scroll-view :show-scrollbar="false" scroll-y>
<rich-text :nodes="model.content"></rich-text>
</scroll-view>
<view class="footer">
<view v-if="progress">
<u-line-progress :percentage="value" activeColor="#fc3463"></u-line-progress>
</view>
<view class="buttons" v-else>
<u-button v-if="model.force==0" @click="cancel" :customStyle="{backgroundColor:'#f3f3f3'}" text="暂不更新" color="#fc3463" shape="circle" throttleTime="1000" plain></u-button>
<u-button @click="upgrade" text="立即更新" color="#fc3463" shape="circle" throttleTime="1000"></u-button>
</view>
</view>
</view>
</view>
@@ -27,7 +35,7 @@
</template>
<script>
import util from "@/util/index.js"
export default {
data() {
return {
@@ -42,9 +50,23 @@
}
},
onLoad(evt) {
if(evt.model){
this.model = {...this.model, ...JSON.parse(evt.model)}
// if(evt.model){
// this.model = {...this.model, ...JSON.parse(evt.model)}
// }
var model = uni.getStorageSync('upgrade_model');
console.log(model);
if(model){
this.model = {...this.model, ...model};
}
// this.model = {
// "id": 1,
// "type": 1,
// "force": 1,
// "source": "https://shunliao.oss-accelerate.aliyuncs.com/files/150016c51d8672fde3d1cc6945a95089_695d97b6c0162.wgt",
// "version": "3.3.6",
// "content": "修复了一些bug",
// "source_text": null
// };
},
onBackPress() {
if(this.model.force==1){
@@ -52,6 +74,11 @@
}
},
methods: {
back(){
if(this.model.force!=1){
uni.navigateBack()
}
},
// 取消更新
cancel() {
uni.navigateBack()
@@ -80,17 +107,14 @@
// 防止强制更新无法关闭界面
this.model.force = 0
if(this.model.type==1){
uni.showToast({
title:'更新成功,软件重启'
})
util.showToast('更新成功,软件重启')
setTimeout(()=>{ plus.runtime.restart() }, 1500)
}
})
},
fail: error=>{
uni.showToast({
title:'下载失败,请检查您的网络情况'
})
util.showToast('下载失败,请检查您的网络情况')
this.model.force = 0;
}
})
// 监听下载进度
@@ -103,8 +127,54 @@
}
</script>
<style>
.m-shade{
<style lang="scss" scoped>
.upgrade_page{
display: flex;
justify-content: center;
background-color: rgba(0, 0, 0, 0.1);
height: 100vh;
width: 100vw;
.version_info{
position: absolute;
top:120rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin-left: 20rpx;
width: 100%;
.title{
color: #fff;
}
.code{
color: #fff;
}
}
.detail{
margin-top: -10rpx;
background-color:#f3f3f3;
border-radius:0 0 16rpx 16rpx;
padding: 10rpx 20rpx 30rpx;
display: flex;
flex-direction: column;
scroll-view{
flex: 1;
min-height: 300rpx;
rich-text{
font-size:32rpx;
line-height: 1.5;
}
}
.footer{
display: flex;
flex-direction: column;
justify-content: center;
gap: 20rpx;
.buttons{
width: 100%;
display: flex;
justify-content: space-around;
}
}
}
}
</style>