about.vue 3.8 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">
L
123  
linju 已提交
12 13 14 15
			<template v-for="(agreement,index) in about.agreements">
				<text class="agreement" @click="navigateTo(agreement)">{{agreement.title}}</text>
				<text class="hint" v-if="about.agreements.length-1>index"></text>
			</template>
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>
L
linju 已提交
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 30 31 32 33 34
		computed:{
			baseappConfig(){
				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() {
DCloud_JSON's avatar
DCloud_JSON 已提交
43 44
			console.log();
			this.about = this.baseappConfig.about
DCloud_JSON's avatar
DCloud_JSON 已提交
45 46 47
			uni.setNavigationBarTitle({
				title:'关于'+this.about.appName
			})
L
123  
linju 已提交
48 49
			this.year = (new Date).getFullYear()
		},
L
linju 已提交
50 51 52 53 54 55 56 57
		onNavigationBarButtonTap() {
			let {download,appName,slogan,logo} = this.about
			uniShare({
				content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
					type: 0,
					href: download,
					title: appName,
					summary: slogan,
58
					imageUrl: logo+'?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
L
linju 已提交
59 60
				},
				menus: [{
61
						"img": "/static/app-plus/sharemenu/wechatfriend.png",
L
linju 已提交
62 63 64 65 66 67 68
						"text": "微信好友",
						"share": {
							"provider": "weixin",
							"scene": "WXSceneSession"
						}
					},
					{
69
						"img": "/static/app-plus/sharemenu/wechatmoments.png",
L
linju 已提交
70 71 72 73 74 75 76
						"text": "微信朋友圈",
						"share": {
							"provider": "weixin",
							"scene": "WXSenceTimeline"
						}
					},
					{
77
						"img": "/static/app-plus/sharemenu/weibo.png",
L
linju 已提交
78 79 80 81 82 83
						"text": "微博",
						"share": {
							"provider": "sinaweibo"
						}
					},
					{
84
						"img": "/static/app-plus/sharemenu/qq.png",
L
linju 已提交
85 86 87 88 89 90
						"text": "QQ",
						"share": {
							"provider": "qq"
						}
					},
					{
91
						"img": "/static/app-plus/sharemenu/copyurl.png",
L
linju 已提交
92 93 94 95
						"text": "复制",
						"share": "copyurl"
					},
					{
96
						"img": "/static/app-plus/sharemenu/more.png",
L
linju 已提交
97 98 99 100 101 102 103 104 105
						"text": "更多",
						"share": "shareSystem"
					}
				],
				cancelText: "取消分享",
			}, e => { //callback
				console.log(e);
			})
		},
L
123  
linju 已提交
106
		methods:{
L
123  
linju 已提交
107
			navigateTo({url,title}){
L
123  
linju 已提交
108 109 110 111 112
				uni.navigateTo({
					url: '/pages/common/webview/webview?url='+url+'&title='+title,
					success: res => {},
					fail: () => {},
					complete: () => {}
芊里 已提交
113 114 115 116 117
				});
			}
		}
	}
</script>
L
123  
linju 已提交
118
<style lang="scss" scoped>
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 157 158 159 160 161 162 163 164 165
.copyright {
	width: 750upx;
	font-size:32rpx;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	bottom:20px;
	left: 0;
	position: fixed;
}
.agreement {
	color:#2285ff;
	font-size:26rpx;
}
.hint {
	color:#999999;
	font-size:26rpx;
}
</style>