index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view>
  3. <view class="search-box ddflex">
  4. <view class="search-input ddflex fflex">
  5. <image src="/static/images/ssico.png"></image>
  6. <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
  7. placeholder="请输入关键词" />
  8. </view>
  9. </view>
  10. <view style="height: 120rpx;"></view>
  11. <view class="ddflex" style="padding: 30rpx;">
  12. <view class="poster-item" v-for="item in 36">
  13. <image class="poster-item-pic" src="http://img.zhiqiyun.com/test/2023/07/31/8b7ed072b68fe70f0d6f409a71a8b17b.png" mode="aspectFill"></image>
  14. <view class="poster-item-title tover">年度理赔账单</view>
  15. <view class="zhuanfa" @click="download('http://img.zhiqiyun.com/test/2023/07/31/8b7ed072b68fe70f0d6f409a71a8b17b.png')">转发</view>
  16. <!-- <view class="poster-item-use">2056 人正在使用</view> -->
  17. </view>
  18. </view>
  19. <view class="act-create" @click="showBtn">
  20. <image src="../static/images/add.png"></image>
  21. <view>发布</view>
  22. </view>
  23. <view class="ceng" v-if="isShowbtn" @click="hideBtn"></view>
  24. <view class="side ddflex" v-if="isShowbtn">
  25. <view class="li" @click="jumpUrl('/library/longPosterService/longPosterService?type=1')">
  26. <image src="/static/images/ll_dt.png"></image>
  27. <view>年度账单</view>
  28. </view>
  29. <view class="li" @click="jumpUrl('/library/longPosterService/longPosterService?type=2')">
  30. <image src="/static/images/ll_cz.png"></image>
  31. <view>日/月/年报</view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. const app = getApp();
  38. const req = require("../../utils/request.js");
  39. export default {
  40. components: {},
  41. props: {},
  42. data() {
  43. return {
  44. isShowbtn:false
  45. }
  46. },
  47. onLoad(options) {
  48. },
  49. onShow() {
  50. },
  51. onHide() {
  52. this.hideBtn()
  53. },
  54. methods: {
  55. jumpUrl(url){
  56. uni.navigateTo({
  57. url:url
  58. })
  59. },
  60. showBtn() {
  61. this.isShowbtn = true;
  62. },
  63. hideBtn() {
  64. this.isShowbtn = false;
  65. },
  66. download(url){
  67. uni.downloadFile({
  68. url: url, //仅为示例,并非真实的资源
  69. success: (res) => {
  70. console.log(res)
  71. if (res.statusCode === 200) {
  72. console.log('下载成功');
  73. var oA = document.createElement("a");
  74. oA.download = ''; // 设置下载的文件名,默认是'下载'
  75. oA.href = res.tempFilePath; //临时路径再保存到本地
  76. document.body.appendChild(oA);
  77. oA.click();
  78. oA.remove(); // 下载之后把创建的元素删除
  79. req.msg('已保存')
  80. }
  81. }
  82. });
  83. }
  84. },
  85. mounted() {
  86. },
  87. onPageScroll: function(e) {
  88. }
  89. }
  90. </script>
  91. <style>
  92. @import "./index.css";
  93. </style>