You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

account-opening-template.vue 963B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div></div>
  3. </template>
  4. <script setup lang='ts'>
  5. const tools = require("../../../static/etcUtil/tools.js");
  6. function downAuth() {
  7. tools.showLoadingAlert("加载中");
  8. console.log(uni.env.USER_DATA_PATH + '/' + '授权书.docx')
  9. uni.downloadFile({
  10. url: this.data.wordUrl,
  11. filePath: uni.env.USER_DATA_PATH + '/' + '授权书.docx',
  12. success(res) {
  13. const filePath = res.filePath
  14. uni.openDocument({
  15. filePath: filePath,
  16. fileType: 'docx',
  17. showMenu: true, //关键点
  18. success: function(res) {
  19. tools.showToastAlert("打开文档成功");
  20. },
  21. fail: function(err) {
  22. tools.showToastAlert("打开文档失败");
  23. uni.navigateBack()
  24. }
  25. });
  26. },
  27. fail: function(err) {
  28. tools.showToastAlert("下载文档失败");
  29. console.log("err", err)
  30. uni.navigateBack()
  31. },
  32. complete(res) {
  33. tools.hideLoadingAlert();
  34. }
  35. });
  36. }
  37. </script>
  38. <style lang='scss' scoped>
  39. </style>