218 lines
4.4 KiB
Vue
218 lines
4.4 KiB
Vue
<template>
|
|
<view class="about-page">
|
|
<page-nav title="关于"></page-nav>
|
|
<view class="about-content">
|
|
<view class="about-logo">
|
|
<u-icon name="info-circle" size="80" color="#2979ff"></u-icon>
|
|
</view>
|
|
<text class="about-name">WMS PDA</text>
|
|
<text class="about-version">版本 {{ appVersion }}</text>
|
|
|
|
<view class="about-list">
|
|
<u-cell-group :border="false">
|
|
<u-cell title="项目名称" value="天豹云仓WMS_PDA"></u-cell>
|
|
<u-cell title="技术框架" value="uni-app + uView UI"></u-cell>
|
|
<u-cell title="运行平台" value="Android / iOS"></u-cell>
|
|
</u-cell-group>
|
|
</view>
|
|
|
|
<view v-if="hasUpdate" class="about-update">
|
|
<text class="about-update__title">发现新版本 {{ latestVersion }}</text>
|
|
<text class="about-update__desc">请扫描二维码下载更新</text>
|
|
<image
|
|
class="about-update__qr"
|
|
:src="qrCodeUrl"
|
|
mode="aspectFit"
|
|
@click="previewQr"
|
|
></image>
|
|
<text class="about-update__link" @click="copyDownloadUrl">{{ downloadUrl }}</text>
|
|
</view>
|
|
|
|
<view class="about-actions">
|
|
<u-button type="primary" plain size="small" @click="checkUpdate" :loading="updateChecking">
|
|
检查更新
|
|
</u-button>
|
|
</view>
|
|
|
|
<view class="about-footer">
|
|
<text class="about-copyright">© 2026 天豹云仓</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
appVersion: '',
|
|
updateChecking: false,
|
|
hasUpdate: false,
|
|
latestVersion: '',
|
|
downloadUrl: '',
|
|
qrCodeUrl: ''
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.getAppVersion();
|
|
this.checkUpdate();
|
|
},
|
|
methods: {
|
|
getAppVersion() {
|
|
// #ifdef APP-PLUS
|
|
try {
|
|
plus.runtime.getProperty(plus.runtime.appid, (info) => {
|
|
this.appVersion = info.version || '';
|
|
});
|
|
} catch (error) {
|
|
this.appVersion = '1.0.8';
|
|
}
|
|
// #endif
|
|
// #ifndef APP-PLUS
|
|
this.appVersion = '1.0.8';
|
|
// #endif
|
|
},
|
|
checkUpdate() {
|
|
this.updateChecking = true;
|
|
// #ifdef APP-PLUS
|
|
try {
|
|
plus.runtime.getProperty(plus.runtime.appid, (info) => {
|
|
this.updateChecking = false;
|
|
const currentVersion = info.version || '';
|
|
// TODO: 替换为实际更新接口
|
|
// this.fetchUpdateInfo(currentVersion);
|
|
this.setNoUpdate();
|
|
});
|
|
} catch (error) {
|
|
this.updateChecking = false;
|
|
this.setNoUpdate();
|
|
}
|
|
// #endif
|
|
// #ifndef APP-PLUS
|
|
setTimeout(() => {
|
|
this.updateChecking = false;
|
|
this.setNoUpdate();
|
|
}, 800);
|
|
// #endif
|
|
},
|
|
setNoUpdate() {
|
|
// 暂无更新时清除
|
|
this.hasUpdate = false;
|
|
},
|
|
setUpdateAvailable(latestVersion, downloadUrl) {
|
|
this.hasUpdate = true;
|
|
this.latestVersion = latestVersion;
|
|
this.downloadUrl = downloadUrl;
|
|
this.qrCodeUrl = `https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=${encodeURIComponent(downloadUrl)}`;
|
|
},
|
|
previewQr() {
|
|
if (!this.qrCodeUrl) return;
|
|
uni.previewImage({
|
|
urls: [this.qrCodeUrl],
|
|
current: this.qrCodeUrl
|
|
});
|
|
},
|
|
copyDownloadUrl() {
|
|
if (!this.downloadUrl) return;
|
|
uni.setClipboardData({
|
|
data: this.downloadUrl,
|
|
success: () => {
|
|
uni.showToast({ title: '下载链接已复制', icon: 'success' });
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.about-page {
|
|
height: 100vh;
|
|
background: #f8f9fa;
|
|
}
|
|
|
|
.about-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 40rpx 0;
|
|
}
|
|
|
|
.about-logo {
|
|
margin-bottom: 24rpx;
|
|
}
|
|
|
|
.about-name {
|
|
font-size: 38rpx;
|
|
font-weight: 600;
|
|
color: #303133;
|
|
margin-bottom: 8rpx;
|
|
}
|
|
|
|
.about-version {
|
|
font-size: 26rpx;
|
|
color: #909399;
|
|
margin-bottom: 32rpx;
|
|
}
|
|
|
|
.about-list {
|
|
width: 100%;
|
|
padding: 0 24rpx;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.about-update {
|
|
width: 100%;
|
|
padding: 32rpx 24rpx 0;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.about-update__title {
|
|
font-size: 32rpx;
|
|
font-weight: 600;
|
|
color: #f56c6c;
|
|
margin-bottom: 8rpx;
|
|
}
|
|
|
|
.about-update__desc {
|
|
font-size: 26rpx;
|
|
color: #909399;
|
|
margin-bottom: 24rpx;
|
|
}
|
|
|
|
.about-update__qr {
|
|
width: 400rpx;
|
|
height: 400rpx;
|
|
border-radius: 12rpx;
|
|
border: 2rpx solid #ebeef5;
|
|
}
|
|
|
|
.about-update__link {
|
|
font-size: 24rpx;
|
|
color: #2979ff;
|
|
margin-top: 16rpx;
|
|
text-decoration: underline;
|
|
word-break: break-all;
|
|
text-align: center;
|
|
padding: 0 24rpx;
|
|
}
|
|
|
|
.about-actions {
|
|
padding: 48rpx 24rpx 0;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.about-footer {
|
|
margin-top: 60rpx;
|
|
}
|
|
|
|
.about-copyright {
|
|
font-size: 24rpx;
|
|
color: #c0c4cc;
|
|
}
|
|
</style>
|