about.vue 3.9 KB
Newer Older
芊里 已提交
1
<template>
L
123  
linju 已提交
2
	<view class="about">
L
linju 已提交
3 4
		<view class="box">
			<image class="logoImg" :src="about.logo"></image>
L
123  
linju 已提交
5
			<text class="tip appName">{{about.appName}}</text>
DCloud_JSON's avatar
DCloud_JSON 已提交
6
			<text class="tip">Version {{version}}</text>
L
linju 已提交
7 8
			<!--Sansnn-uQRCode组件来源,插件市场:https://ext.dcloud.net.cn/plugin?id=1287 微调后-->
			<Sansnn-uQRCode :text="about.download" :makeOnLoad="true" class="qrcode"></Sansnn-uQRCode>
DCloud_JSON's avatar
DCloud_JSON 已提交
9
			<text class="tip">扫描二维码,您的朋友也可以下载{{about.appName}}客户端</text>
芊里 已提交
10
		</view>
L
123  
linju 已提交
11
		<view class="copyright">
12
			<view class="agreement-box" v-for="(agreement,index) in about.agreements" :key="index">
L
123  
linju 已提交
13 14
				<text class="agreement" @click="navigateTo(agreement)">{{agreement.title}}</text>
				<text class="hint" v-if="about.agreements.length-1>index"></text>
15
			</view>
L
123  
linju 已提交
16
			<text class="hint">Copyright © {{year}}</text>
L
123  
linju 已提交
17
			<text class="hint">{{about.company}}</text>
芊里 已提交
18 19 20 21
		</view>
	</view>
</template>
<script>
DCloud_JSON's avatar
DCloud_JSON 已提交
22
import uniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
芊里 已提交
23 24 25
	export default {
		onLoad() {
			// #ifdef APP-PLUS
L
123  
linju 已提交
26
			this.version = plus.runtime.version
芊里 已提交
27 28
			// #endif
		},
DCloud_JSON's avatar
DCloud_JSON 已提交
29
		computed:{
30
			uniStarterConfig(){
DCloud_JSON's avatar
DCloud_JSON 已提交
31 32 33 34
				console.log(getApp());
				return getApp().globalData.config
			}
		},
L
123  
linju 已提交
35 36 37 38
		data() {
			return {
				version:"V1.0.0",
				year:"2020",
L
123  
linju 已提交
39
				about:{}
L
123  
linju 已提交
40 41 42
			};
		},
		created() {
43
			this.about = this.uniStarterConfig.about
DCloud_JSON's avatar
DCloud_JSON 已提交
44 45 46
			uni.setNavigationBarTitle({
				title:'关于'+this.about.appName
			})
L
123  
linju 已提交
47 48
			this.year = (new Date).getFullYear()
		},
L
linju 已提交
49 50 51 52 53 54 55 56
		onNavigationBarButtonTap() {
			let {download,appName,slogan,logo} = this.about
			uniShare({
				content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
					type: 0,
					href: download,
					title: appName,
					summary: slogan,
57
					imageUrl: logo+'?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
L
linju 已提交
58 59
				},
				menus: [{
60
						"img": "/static/app-plus/sharemenu/wechatfriend.png",
L
linju 已提交
61 62 63 64 65 66 67
						"text": "微信好友",
						"share": {
							"provider": "weixin",
							"scene": "WXSceneSession"
						}
					},
					{
68
						"img": "/static/app-plus/sharemenu/wechatmoments.png",
L
linju 已提交
69 70 71 72 73 74 75
						"text": "微信朋友圈",
						"share": {
							"provider": "weixin",
							"scene": "WXSenceTimeline"
						}
					},
					{
76
						"img": "/static/app-plus/sharemenu/weibo.png",
L
linju 已提交
77 78 79 80 81 82
						"text": "微博",
						"share": {
							"provider": "sinaweibo"
						}
					},
					{
83
						"img": "/static/app-plus/sharemenu/qq.png",
L
linju 已提交
84 85 86 87 88 89
						"text": "QQ",
						"share": {
							"provider": "qq"
						}
					},
					{
90
						"img": "/static/app-plus/sharemenu/copyurl.png",
L
linju 已提交
91 92 93 94
						"text": "复制",
						"share": "copyurl"
					},
					{
95
						"img": "/static/app-plus/sharemenu/more.png",
L
linju 已提交
96 97 98 99 100 101 102 103 104
						"text": "更多",
						"share": "shareSystem"
					}
				],
				cancelText: "取消分享",
			}, e => { //callback
				console.log(e);
			})
		},
L
123  
linju 已提交
105
		methods:{
L
123  
linju 已提交
106
			navigateTo({url,title}){
L
123  
linju 已提交
107 108 109 110 111
				uni.navigateTo({
					url: '/pages/common/webview/webview?url='+url+'&title='+title,
					success: res => {},
					fail: () => {},
					complete: () => {}
芊里 已提交
112 113 114 115 116
				});
			}
		}
	}
</script>
L
123  
linju 已提交
117
<style lang="scss" scoped>
DCloud_JSON's avatar
DCloud_JSON 已提交
118
@import '@/common/all-flex.css';
L
123  
linju 已提交
119
.about {
L
123  
linju 已提交
120 121 122
	width: 750upx;
	flex-direction: column;
}
L
linju 已提交
123 124
.box {
	margin-top: 100px;
L
123  
linju 已提交
125 126 127 128 129 130 131 132 133 134
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
.logoImg{
	margin-bottom: 10upx;
	width:160upx;
	height:160upx;
	border-radius: 15px;
}
DCloud_JSON's avatar
DCloud_JSON 已提交
135 136 137 138
.tip{
	font-size:24rpx;
	margin-top: 10px;
}
L
123  
linju 已提交
139 140 141 142 143
.appName{
	margin-top: 20px;
	font-size:42rpx;
	font-weight: 500;
}
L
linju 已提交
144 145 146
.qrcode{
	margin-top: 50px;
}
L
123  
linju 已提交
147 148 149 150 151 152 153 154 155 156
.copyright {
	width: 750upx;
	font-size:32rpx;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	bottom:20px;
	left: 0;
	position: fixed;
}
157 158 159
.agreement-box{
	justify-content: center;
}
L
123  
linju 已提交
160 161 162 163 164
.agreement {
	color:#2285ff;
	font-size:26rpx;
}
.hint {
165
	text-align: center;
L
123  
linju 已提交
166 167 168 169
	color:#999999;
	font-size:26rpx;
}
</style>