zouling 6 月之前
父節點
當前提交
a74855e48f
共有 2 個文件被更改,包括 63 次插入0 次删除
  1. 9 0
      pages.json
  2. 54 0
      pages/code.vue

+ 9 - 0
pages.json

@@ -44,6 +44,15 @@
 	  	"titleNView":false
 	  	}
     }
+  },
+  {
+    "path": "pages/code",
+    "style": {
+      "navigationBarTitleText": "下载",
+  	  "h5":{
+  	  	"titleNView":false
+  	  	}
+    }
   },
    {
      "path": "pages/success",

+ 54 - 0
pages/code.vue

@@ -0,0 +1,54 @@
+<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/2024/12/13/__UNI__FA20DEF__20241213104242_20241213110828A036.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>