|
@@ -10,6 +10,10 @@
|
|
|
}}</text>
|
|
}}</text>
|
|
|
</u-cell>
|
|
</u-cell>
|
|
|
</picker>
|
|
</picker>
|
|
|
|
|
+ <u-cell title="修改密码" :isLink="true" arrow-direction="right" @click="$refs.passwordModalRef.open()">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </u-cell>
|
|
|
<u-cell title="服务器地址" :isLink="true" arrow-direction="right" @click="handleServerSettings">
|
|
<u-cell title="服务器地址" :isLink="true" arrow-direction="right" @click="handleServerSettings">
|
|
|
<text slot="value" class="u-slot-value" :key="apiAdress">{{
|
|
<text slot="value" class="u-slot-value" :key="apiAdress">{{
|
|
|
apiAdress
|
|
apiAdress
|
|
@@ -24,12 +28,13 @@
|
|
|
<view class="flex-buttom">
|
|
<view class="flex-buttom">
|
|
|
<view class="btn" @click="loginOut"> 退出登录 </view>
|
|
<view class="btn" @click="loginOut"> 退出登录 </view>
|
|
|
<view class="copyright">
|
|
<view class="copyright">
|
|
|
- <view>版权所有© 2019-2021中赢合力</view>
|
|
|
|
|
|
|
+ <view>版权所有© 2019-2025中赢合力</view>
|
|
|
<view>湘ICP备20015098号</view>
|
|
<view>湘ICP备20015098号</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<updatePop ref="updatePop" :versionNum="versionNum" :downloadUrl="downloadUrl" :sizes="VersionInfo.fileSize">
|
|
<updatePop ref="updatePop" :versionNum="versionNum" :downloadUrl="downloadUrl" :sizes="VersionInfo.fileSize">
|
|
|
</updatePop>
|
|
</updatePop>
|
|
|
|
|
+ <passwordModal ref="passwordModalRef"></passwordModal>
|
|
|
<ServerSetting ref="serverSettingRef" @setServerStatus="setServerStatus" />
|
|
<ServerSetting ref="serverSettingRef" @setServerStatus="setServerStatus" />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -40,6 +45,7 @@
|
|
|
get
|
|
get
|
|
|
} from '@/utils/api.js'
|
|
} from '@/utils/api.js'
|
|
|
import updatePop from './components/updatePop.vue'
|
|
import updatePop from './components/updatePop.vue'
|
|
|
|
|
+ import passwordModal from './components/password-modal.vue'
|
|
|
import {
|
|
import {
|
|
|
setMemo,
|
|
setMemo,
|
|
|
isMemo,
|
|
isMemo,
|
|
@@ -52,7 +58,7 @@
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
updatePop,
|
|
updatePop,
|
|
|
- ServerSetting
|
|
|
|
|
|
|
+ ServerSetting,passwordModal
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -117,7 +123,7 @@
|
|
|
console.log(res, res.confirm, '-----确认退出登录');
|
|
console.log(res, res.confirm, '-----确认退出登录');
|
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
console.log('-----确认退出登录9999999');
|
|
console.log('-----确认退出登录9999999');
|
|
|
- uni.clearStorage()
|
|
|
|
|
|
|
+ // uni.clearStorage()
|
|
|
try {
|
|
try {
|
|
|
postJ(this.apiUrl + '/main/user/logout')
|
|
postJ(this.apiUrl + '/main/user/logout')
|
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -182,111 +188,113 @@
|
|
|
// }
|
|
// }
|
|
|
// })
|
|
// })
|
|
|
|
|
|
|
|
- // #ifdef APP-PLUS
|
|
|
|
|
- getLatestVersion().then(res => {
|
|
|
|
|
- console.log('res:', res)
|
|
|
|
|
- const {
|
|
|
|
|
- appVersion
|
|
|
|
|
- } = uni.getAppBaseInfo()
|
|
|
|
|
- if (appVersion != res.versionCode) {
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '发现新版本',
|
|
|
|
|
- content: '更新说明:' + res.releaseNotes,
|
|
|
|
|
- confirmText: '立即更新',
|
|
|
|
|
- success: (val) => {
|
|
|
|
|
- if (val.confirm) {
|
|
|
|
|
- const downloadTask = uni.downloadFile({
|
|
|
|
|
- url: `${Vue.prototype.webviewUrl}/kd-aiot/${res.fileStorePath}`,
|
|
|
|
|
- success: (data) => {
|
|
|
|
|
- if (data.statusCode === 200) {
|
|
|
|
|
- uni.saveFile({
|
|
|
|
|
- tempFilePath: data
|
|
|
|
|
- .tempFilePath,
|
|
|
|
|
- success: (saveRes) => {
|
|
|
|
|
- // uni.showToast({
|
|
|
|
|
- // title: '下载成功',
|
|
|
|
|
- // icon: 'success'
|
|
|
|
|
- // });
|
|
|
|
|
- // uni.hideLoading();
|
|
|
|
|
- // uni.showLoading({
|
|
|
|
|
- // title: "正在更新...",
|
|
|
|
|
- // mask: true,
|
|
|
|
|
- // });
|
|
|
|
|
- // 调用安装逻辑
|
|
|
|
|
- plus.runtime.install(
|
|
|
|
|
- saveRes
|
|
|
|
|
- .savedFilePath, {
|
|
|
|
|
- force: true
|
|
|
|
|
- },
|
|
|
|
|
- function() {
|
|
|
|
|
- // uni
|
|
|
|
|
- // .hideLoading();
|
|
|
|
|
- },
|
|
|
|
|
- function() {
|
|
|
|
|
- // uni
|
|
|
|
|
- // .hideLoading();
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '更新失败',
|
|
|
|
|
- icon: 'error'
|
|
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ getLatestVersion().then(res => {
|
|
|
|
|
+ console.log('res:', res)
|
|
|
|
|
+ const {
|
|
|
|
|
+ appVersion
|
|
|
|
|
+ } = uni.getAppBaseInfo()
|
|
|
|
|
+ if (appVersion != res.versionCode) {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '发现新版本',
|
|
|
|
|
+ content: '更新说明:' + res.releaseNotes,
|
|
|
|
|
+ confirmText: '立即更新',
|
|
|
|
|
+ success: (val) => {
|
|
|
|
|
+ if (val.confirm) {
|
|
|
|
|
+ const downloadTask = uni.downloadFile({
|
|
|
|
|
+ url: `${Vue.prototype.webviewUrl}/kd-aiot/${res.fileStorePath}`,
|
|
|
|
|
+ success: (data) => {
|
|
|
|
|
+ if (data.statusCode === 200) {
|
|
|
|
|
+ uni.saveFile({
|
|
|
|
|
+ tempFilePath: data
|
|
|
|
|
+ .tempFilePath,
|
|
|
|
|
+ success: (saveRes) => {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '下载成功',
|
|
|
|
|
+ // icon: 'success'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // uni.hideLoading();
|
|
|
|
|
+ // uni.showLoading({
|
|
|
|
|
+ // title: "正在更新...",
|
|
|
|
|
+ // mask: true,
|
|
|
|
|
+ // });
|
|
|
|
|
+ // 调用安装逻辑
|
|
|
|
|
+ plus.runtime.install(
|
|
|
|
|
+ saveRes
|
|
|
|
|
+ .savedFilePath, {
|
|
|
|
|
+ force: true
|
|
|
|
|
+ },
|
|
|
|
|
+ function() {
|
|
|
|
|
+ // uni
|
|
|
|
|
+ // .hideLoading();
|
|
|
|
|
+ },
|
|
|
|
|
+ function() {
|
|
|
|
|
+ // uni
|
|
|
|
|
+ // .hideLoading();
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '更新失败',
|
|
|
|
|
+ icon: 'error'
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 先显示初始的loading提示
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: "正在下载安装包: 0%",
|
|
|
|
|
+ mask: true,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 记录上次显示的进度,避免频繁更新
|
|
|
|
|
+ let lastProgress = 0;
|
|
|
|
|
+ let loadingVisible = true;
|
|
|
|
|
+
|
|
|
|
|
+ downloadTask.onProgressUpdate((ress) => {
|
|
|
|
|
+ console.log('下载进度:', ress)
|
|
|
|
|
+
|
|
|
|
|
+ // 只在进度有明显变化(每10%)或者达到100%时更新提示
|
|
|
|
|
+ if ((ress.progress > lastProgress && ress.progress %
|
|
|
|
|
+ 10 === 0) || ress.progress === 100) {
|
|
|
|
|
+ // 先隐藏再显示以更新内容
|
|
|
|
|
+ if (loadingVisible) {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ress.progress < 100) {
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: "正在下载安装包: " + ress
|
|
|
|
|
+ .progress + "%",
|
|
|
|
|
+ mask: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ loadingVisible = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ loadingVisible = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ lastProgress = ress.progress;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- // 先显示初始的loading提示
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: "正在下载安装包: 0%",
|
|
|
|
|
- mask: true,
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 记录上次显示的进度,避免频繁更新
|
|
|
|
|
- let lastProgress = 0;
|
|
|
|
|
- let loadingVisible = true;
|
|
|
|
|
-
|
|
|
|
|
- downloadTask.onProgressUpdate((ress) => {
|
|
|
|
|
- console.log('下载进度:', ress)
|
|
|
|
|
-
|
|
|
|
|
- // 只在进度有明显变化(每10%)或者达到100%时更新提示
|
|
|
|
|
- if ((ress.progress > lastProgress && ress.progress % 10 === 0) || ress.progress === 100) {
|
|
|
|
|
- // 先隐藏再显示以更新内容
|
|
|
|
|
|
|
+ // 确保任务完成时隐藏loading
|
|
|
|
|
+ downloadTask.onStop(() => {
|
|
|
if (loadingVisible) {
|
|
if (loadingVisible) {
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
|
|
+ loadingVisible = false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (ress.progress < 100) {
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: "正在下载安装包: " + ress.progress + "%",
|
|
|
|
|
- mask: true,
|
|
|
|
|
- });
|
|
|
|
|
- loadingVisible = true;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ downloadTask.onError(() => {
|
|
|
|
|
+ if (loadingVisible) {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
loadingVisible = false;
|
|
loadingVisible = false;
|
|
|
}
|
|
}
|
|
|
- lastProgress = ress.progress;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- // 确保任务完成时隐藏loading
|
|
|
|
|
- downloadTask.onStop(() => {
|
|
|
|
|
- if (loadingVisible) {
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- loadingVisible = false;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- downloadTask.onError(() => {
|
|
|
|
|
- if (loadingVisible) {
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- loadingVisible = false;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
console.log('err:', err)
|
|
console.log('err:', err)
|