multimedia.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="bg-white">
  3. <!-- 顶部 -->
  4. <cu-custom bgColor="bg-blue" :isBack="true">
  5. <block slot="backText">影像资料</block>
  6. <block slot="content"></block>
  7. <block slot="right">
  8. <view class="flex justify-center">
  9. <!-- <button class="margin-top-ssm cu-btn round line-blue text-white">生成二维码</button> -->
  10. </view>
  11. </block>
  12. </cu-custom>
  13. <view class="text-orange title-font">
  14. *上传的单张图片大小不超过15MB,单个视频大小不超过500MB!
  15. </view>
  16. <view>
  17. <view v-for="(item,index) in list" :key="item.name">
  18. <template v-if="item.list.length >0">
  19. <view class="bg-gray padding-sm text-bold color-black">
  20. {{item.name}}
  21. </view>
  22. <view v-for="(item2,index2) in item.list" :key="item2.id" class="flex solid-bottom padding-sm justify-between align-center" @tap="toMedialist(item2)">
  23. <view class="flex align-center">
  24. <text class="text-gray icon-size" :class="[item2.fileType=='0' ? 'cuIcon-album' : 'cuIcon-video']"></text>
  25. <view>
  26. <view class="text-bold text-xl color-black">{{item2.name}}</view>
  27. <view class="text-df">{{item2.fileN}}{{item2.fileType=="0"?'张照片':'个视频'}}</view>
  28. </view>
  29. </view>
  30. <text class="lg text-gray cuIcon-right"></text>
  31. </view>
  32. </template>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. userInfo:null,
  42. project:null,
  43. list:[
  44. {
  45. name:'项目前期',
  46. list:[]
  47. },
  48. {
  49. name:'项目中期',
  50. list:[]
  51. },{
  52. name:'交工竣工',
  53. list:[]
  54. },
  55. ]
  56. }
  57. },
  58. onLoad(e) {
  59. var userInfo = uni.getStorageSync("userInfo")
  60. if(userInfo){
  61. this.userInfo = userInfo;
  62. this.project = uni.getStorageSync("porject"+"_"+userInfo.id);
  63. }
  64. },
  65. onShow() {
  66. this.loadTable();
  67. },
  68. methods: {
  69. toMedialist(item){
  70. //是否按部位保存
  71. //0是,1否
  72. if(!item.isAssociatedNode){
  73. uni.navigateTo({
  74. url: "/pages/multimedia/divide?type=" + item.fileType +"&tagId=" + item.id + "&titleName=" + encodeURIComponent(item.name)
  75. })
  76. }else{
  77. uni.navigateTo({
  78. url: "/pages/multimedia/medialist?type=" + item.fileType +"&tagId=" + item.id + "&titleName=" + encodeURIComponent(item.name)
  79. })
  80. }
  81. },
  82. loadTable(){
  83. this.http.request('/app/multimedia/list', {
  84. contractId:this.project.contractId,
  85. projectId:this.project.id,
  86. owner:this.project.contract_type
  87. }).then((result)=>{
  88. if(result.result == 1){
  89. this.list[0].list = [];
  90. this.list[1].list = [];
  91. this.list[2].list = [];
  92. for (let i = 0; i < result.datas.length; i++) {
  93. this.list[result.datas[i].period].list.push(result.datas[i]);
  94. }
  95. }
  96. })
  97. },
  98. },
  99. }
  100. </script>
  101. <style>
  102. .title-font{
  103. font-size: 30rpx;
  104. padding: 20rpx;
  105. }
  106. .color-black{
  107. color: #333333;
  108. }
  109. .icon-size{
  110. font-size: 60rpx;
  111. margin-right: 16rpx;
  112. }
  113. </style>