Files
smartDriveEEUniApp/pages-subpackage/ucenter/about/about.vue
2026-02-01 09:21:11 +08:00

248 lines
5.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="about">
<view class="box">
<image class="logoImg" :src="about.logo"></image>
<text class="tip appName">{{about.appName}}</text>
<text class="tip">Version {{version}}</text>
<view class="qrcode">
<!--uqrcode 组件来源插件Sansnn-uQRCode 链接地址https://ext.dcloud.net.cn/plugin?id=1287-->
<uqrcode :size="100" canvas-id="qrcode" :value="about.download"></uqrcode>
</view>
<text class="tip">{{$t('about.sacnQR')}} {{about.appName}} {{$t('about.client')}}</text>
</view>
<view class="copyright">
<view class="agreement-box" v-for="(agreement,index) in agreements" :key="index">
<text class="agreement" @click="navigateTo(agreement)">{{agreement.title}}</text>
<text class="hint" v-if="agreements.length-1>index">{{$t('about.and')}}</text>
</view>
<text class="hint">Copyright © {{year}}</text>
<text class="hint">{{about.company}}</text>
</view>
</view>
</template>
<script>
// #ifdef APP
import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
const uniShare = new UniShare()
// #endif
// 由于 about.vue 在主包中,无法直接访问子包中的 config.js
// 使用本地配置对象
const uniIdPagesConfig = {
agreements: {
serviceUrl: 'https://xxx', // 用户服务协议链接
privacyUrl: 'https://xxx' // 隐私政策条款链接
}
}
import uqrcode from "@/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode"
export default {
components:{
uqrcode
},
// #ifdef APP
onBackPress({from}) {
if(from=='backbutton'){
this.$nextTick(function(){
uniShare.hide()
})
return uniShare.isShow;
}
},
// #endif
onLoad() {
// #ifdef APP-PLUS
this.version = plus.runtime.version
// #endif
},
computed: {
uniStarterConfig() {
try {
const app = getApp({ allowDefault: true });
return app && app.globalData ? app.globalData.config : {};
} catch (e) {
return {};
}
},
agreements() {
if(!uniIdPagesConfig.agreements){
return []
}
let {serviceUrl,privacyUrl} = uniIdPagesConfig.agreements
return [
{
url:serviceUrl,
title:"用户服务协议"
},
{
url:privacyUrl,
title:"隐私政策条款"
}
]
}
},
data() {
return {
version: "V1.0.0",
year: "2020",
about: {}
};
},
created() {
this.about = this.uniStarterConfig.about
uni.setNavigationBarTitle({
title: this.$t('about.about')+ " " + this.about.appName
})
this.year = (new Date).getFullYear()
},
onNavigationBarButtonTap() {
let {
download,
appName,
slogan,
logo
} = this.about
uniShare.show({
content: { //公共的分享类型type、链接herf、标题title、summary描述、imageUrl缩略图
type: 0,
href: download,
title: appName,
summary: slogan,
imageUrl: logo + '?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决在ios端分享图过大导致的图片失效问题
},
menus: [{
"img": "/static/app/sharemenu/wechatfriend.png",
"text": this.$t('common.wechatFriends'),
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/app/sharemenu/wechatmoments.png",
"text": this.$t('common.wechatBbs'),
"share": {
"provider": "weixin",
"scene": "WXSceneTimeline"
}
},
{
"img": "/static/app/sharemenu/weibo.png",
"text": this.$t('common.weibo'),
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/app/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/app/sharemenu/copyurl.png",
"text": this.$t('common.copy'),
"share": "copyurl"
},
{
"img": "/static/app/sharemenu/more.png",
"text": this.$t('common.more'),
"share": "shareSystem"
}
],
cancelText: this.$t('common.cancelShare'),
}, e => { //callback
console.log(e);
})
},
methods: {
navigateTo({
url,
title
}) {
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/common/webview/webview?url=' + url + '&title=' + title,
success: res => {},
fail: () => {},
complete: () => {}
});
}
}
}
</script>
<style lang="scss" scoped>
/* #ifndef APP-NVUE */
view{
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.about {
flex-direction: column;
justify-content: center;
align-items: center;
}
.box {
margin-top: 60px;
flex-direction: column;
justify-content: center;
align-items: center;
}
.logoImg {
margin-bottom: 10rpx;
width: 160rpx;
height: 160rpx;
border-radius: 15px;
}
.tip {
text-align: center;
font-size: 24rpx;
margin-top: 10px;
padding: 10rpx;
}
.appName {
margin-top: 20px;
font-size: 42rpx;
font-weight: 500;
}
.qrcode ,.qrcode .uqrcode{
margin: 10px 0;
width: 100px;
height: 100px;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
}
.copyright {
font-size: 32rpx;
flex-direction: column;
justify-content: center;
align-items: center;
bottom: 20px;
// left: 0;
position: fixed;
}
.agreement-box {
justify-content: center;
}
.agreement {
color: #2285ff;
font-size: 26rpx;
}
.hint {
text-align: center;
color: #999999;
font-size: 26rpx;
}
</style>