about.vue 3.3 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>
L
123  
linju 已提交
6
			<text class="tip" style="font-size:24upx;">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>
芊里 已提交
9
		</view>
L
123  
linju 已提交
10
		<view class="copyright">
L
123  
linju 已提交
11 12 13 14
			<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 已提交
15
			<text class="hint">Copyright © {{year}}</text>
L
123  
linju 已提交
16
			<text class="hint">{{about.company}}</text>
芊里 已提交
17 18 19 20
		</view>
	</view>
</template>
<script>
L
23  
linju 已提交
21
import baseappConfig from '@/baseapp.config.js';
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
		},
L
123  
linju 已提交
29 30 31 32
		data() {
			return {
				version:"V1.0.0",
				year:"2020",
L
123  
linju 已提交
33
				about:{}
L
123  
linju 已提交
34 35 36
			};
		},
		created() {
L
123  
linju 已提交
37
			this.about = baseappConfig.about
L
123  
linju 已提交
38 39
			this.year = (new Date).getFullYear()
		},
L
linju 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
		onNavigationBarButtonTap() {
			let {download,appName,slogan,logo} = this.about
			uniShare({
				content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
					type: 0,
					href: download,
					title: appName,
					summary: slogan,
					imageUrl: logo
				},
				menus: [{
						"img": "/static/sharemenu/wechatfriend.png",
						"text": "微信好友",
						"share": {
							"provider": "weixin",
							"scene": "WXSceneSession"
						}
					},
					{
						"img": "/static/sharemenu/wechatmoments.png",
						"text": "微信朋友圈",
						"share": {
							"provider": "weixin",
							"scene": "WXSenceTimeline"
						}
					},
					{
						"img": "/static/sharemenu/weibo.png",
						"text": "微博",
						"share": {
							"provider": "sinaweibo"
						}
					},
					{
						"img": "/static/sharemenu/qq.png",
						"text": "QQ",
						"share": {
							"provider": "qq"
						}
					},
					{
						"img": "/static/sharemenu/copyurl.png",
						"text": "复制",
						"share": "copyurl"
					},
					{
						"img": "/static/sharemenu/more.png",
						"text": "更多",
						"share": "shareSystem"
					}
				],
				cancelText: "取消分享",
			}, e => { //callback
				console.log(e);
			})
		},
L
123  
linju 已提交
96
		methods:{
L
123  
linju 已提交
97
			navigateTo({url,title}){
L
123  
linju 已提交
98 99 100 101 102
				uni.navigateTo({
					url: '/pages/common/webview/webview?url='+url+'&title='+title,
					success: res => {},
					fail: () => {},
					complete: () => {}
芊里 已提交
103 104 105 106 107
				});
			}
		}
	}
</script>
L
123  
linju 已提交
108
<style lang="scss" scoped>
L
123  
linju 已提交
109
.about {
L
123  
linju 已提交
110 111 112
	width: 750upx;
	flex-direction: column;
}
L
linju 已提交
113 114
.box {
	margin-top: 100px;
L
123  
linju 已提交
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
.logoImg{
	margin-bottom: 10upx;
	width:160upx;
	height:160upx;
	border-radius: 15px;
}
.appName{
	margin-top: 20px;
	margin-bottom:5px;
	font-size:42rpx;
	font-weight: 500;
}
L
linju 已提交
131 132 133
.qrcode{
	margin-top: 50px;
}
L
123  
linju 已提交
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
.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>