<template>
	<div></div>
</template>
<script setup lang='ts'>
	const tools = require("../../../static/etcUtil/tools.js");

	function downAuth() {
		tools.showLoadingAlert("加载中");
		console.log(uni.env.USER_DATA_PATH + '/' + '授权书.docx')
		uni.downloadFile({
			url: this.data.wordUrl,
			filePath: uni.env.USER_DATA_PATH + '/' + '授权书.docx',
			success(res) {
				const filePath = res.filePath
				uni.openDocument({
					filePath: filePath,
					fileType: 'docx',
					showMenu: true, //关键点
					success: function(res) {
						tools.showToastAlert("打开文档成功");
					},
					fail: function(err) {
						tools.showToastAlert("打开文档失败");
						uni.navigateBack()
					}
				});
			},
			fail: function(err) {
				tools.showToastAlert("下载文档失败");
				console.log("err", err)
				uni.navigateBack()
			},
			complete(res) {
				tools.hideLoadingAlert();
			}
		});
	}
</script>
<style lang='scss' scoped>

</style>