yichael 4 лет назад
Родитель
Сommit
ec86a4a5c2
3 измененных файлов с 25 добавлено и 5 удалено
  1. 24 2
      components/home/simulation.vue
  2. 1 1
      components/home/sy.vue
  3. 0 2
      components/user/user.vue

+ 24 - 2
components/home/simulation.vue

@@ -15,7 +15,7 @@
 		</view>
 
 		<view class="s_footer" style="text-align: center;padding: 80rpx;">
-			<button size="mini" class="m_btn_download" style="">客户端下载</button>
+			<button size="mini" class="m_btn_download" style="" @click="onClick_download_btn">客户端下载</button>
 		</view>
 	</view>
 </template>
@@ -32,7 +32,29 @@
 
 		},
 		methods: {
-
+			onClick_download_btn(){
+				let url = this.$Api + "/file/simulationexe";
+				uni.request({
+				    url: url, //仅为示例,并非真实接口地址。
+				    success: (res) => {
+				        console.log('get成功');
+				        console.log(res.data);
+						
+						uni.downloadFile({
+						    url: res.data, //仅为示例,并非真实的资源
+						    success: (res) => {
+						        if (res.statusCode === 200) {
+						            console.log('下载成功');
+						        }
+						    }
+						});
+				    },
+				    fail:(res)=>{
+				        console.log('get失败');
+				        console.log(res.data);
+				    }
+				});
+			}
 		}
 	}
 </script>

+ 1 - 1
components/home/sy.vue

@@ -57,7 +57,7 @@
 		components: {
 
 		},
-		onLoad() {
+		mounted() {
 
 		},
 		data() {

+ 0 - 2
components/user/user.vue

@@ -228,8 +228,6 @@
 										console.log("fail+**+*", res)
 									}
 								});
-									
-								
 								
 							}
 						}