<template>
  <view class="regbox pregbox flexdc pr"  id="regbox" style="padding-top: 120rpx;">
	  <image :src="headimg" class="headimg flex0"></image> 
	  <view class="rbtn btn2" @click="getDown">立即下载</view>
  </view>
</template>

<script>
	import config from '@/config'
	const baseUrl = config.baseUrl
  export default {
	data(){
		return{
			headimg:require('@/static/logo.png'),
		}
	},
	
	methods:{
		isWechat() {
		    return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
		},

		getDown(){
			if (this.isWechat()) {
			    uni.showToast({
			        title: '点击右上角在浏览器中打开后下载',
			        icon: 'none',
			        duration: 3000
			    })
			    return
			}
			var url=baseUrl+"/profile/upload/2025/01/13/__UNI__9ACE566__20250113102757_20250113103455A001.apk";
			let a = document.createElement('a');
			a.setAttribute('href', url);
			a.setAttribute('download', 'downapp');
			a.innerHTML = "立即下载";
			document.body.appendChild(a);
			a.click();
			a.remove()
		}
	},
	onLoad: function() {
			
    },
  }
</script>

<style lang="scss" scoped>
.headimg{width: 200rpx;height: 200rpx;margin:0 auto 40rpx;}
.rbtn {font-size: 30rpx;
		&.btn{background: #9a9c9e;color: #ffffff;}
		&.btn2{background: $com-cd3;color: #ffffff;}
      }
</style>
