filesonic.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view>
  3. <u-navbar title="分享空间"></u-navbar>
  4. <!-- 图片 -->
  5. <view class="image" v-if="false">
  6. <u-image width="100%" height="200rpx" :src="src" border-radius="16"></u-image>
  7. </view>
  8. <view class="tabs" v-if="false">
  9. <u-tabs bar-width="60" :bold="false" inactive-color="#B3B3B3" active-color="#333333" height="88"
  10. :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
  11. </view>
  12. <!-- 分享内容 -->
  13. <view class="share-content">
  14. <view class="item" v-for="(item,i) in list" :key="i" @click="ckItem(item)">
  15. <view class="infos">
  16. <view class="person">
  17. <view class="photo">
  18. <img v-if="item.regUser" :src="item.regUser.headImg" alt="">
  19. </view>
  20. <view class="name">
  21. {{item.createName}}
  22. </view>
  23. </view>
  24. <view class="date">
  25. {{item.createTime}}
  26. </view>
  27. </view>
  28. <view class="share-text">
  29. {{item.synopsis}}
  30. </view>
  31. <view class="pictures" >
  32. <template v-for="(pic,i2) in item.listShareFiles" >
  33. <img v-if="isPic" :key="i2"
  34. @click="previewImage(item.listShareFiles,i2)"
  35. :src="pic.url" alt="">
  36. <video :key="i2" :src="pic.url"
  37. enable-danmu danmu-btn controls></video>
  38. </template>
  39. </view>
  40. <view class="tag" :class="item.activityId" >
  41. <text class="symbol">#</text>
  42. <text class="text">{{item.activityName}}</text>
  43. <text class="icon" v-if="false">
  44. <u-icon size="28" color="#cccccc" name="arrow-right"></u-icon>
  45. </text>
  46. </view>
  47. </view>
  48. </view>
  49. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  50. <view class="bottom" @click="gotoUrl('pages/mine/issue')" >
  51. <img src="../../assets/img/riFill-camera-fill@2x.png">
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import * as API from '@/apis/pagejs/share.js'
  57. export default {
  58. data() {
  59. return {
  60. listForm:{
  61. pageIndex:1,
  62. pageSize:20,
  63. },
  64. list:[],
  65. recordsTotal:0,
  66. tabList: [{
  67. name: '全部'
  68. }, {
  69. name: '体育健身'
  70. }, {
  71. name: '摄影摄像',
  72. }, {
  73. name: '书法绘画',
  74. }, {
  75. name: '其他',
  76. }],
  77. current: 0
  78. }
  79. },
  80. onLoad(op){
  81. this.getList()
  82. },
  83. onReachBottom() {
  84. if (this.list.length < this.recordsTotal) {
  85. this.myLoadmore();
  86. }
  87. },
  88. methods: {
  89. previewImage(img,i) {
  90. let imgs = [];
  91. img.forEach(it=>{
  92. imgs.push(it.url)
  93. })
  94. uni.previewImage({
  95. indicator:"default",
  96. loop:true,
  97. urls: imgs,
  98. current: i
  99. })
  100. },
  101. ckItem(item){
  102. },
  103. getList(){
  104. uni.showLoading({
  105. title: "加载中",
  106. mask: true,
  107. })
  108. API.pageList(this.listForm).then((res) => {
  109. uni.hideLoading();
  110. //this.list=response.data.data
  111. if(this.listForm.pageIndex==1){
  112. this.list = res.data.data;
  113. }else{
  114. this.list = [
  115. ...this.list,
  116. ...res.data.data
  117. ];
  118. }
  119. this.recordsTotal = res.data.recordsTotal;
  120. }).catch(error => {
  121. uni.showToast({
  122. title: error,
  123. icon: "none"
  124. })
  125. })
  126. },
  127. myLoadmore(){
  128. this.listForm.pageIndex += 1;
  129. this.getList();
  130. },
  131. change(index) {
  132. this.current = index;
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. page {
  139. background-color: #fff;
  140. padding-bottom: 100px;
  141. }
  142. .image {
  143. padding: 0 32rpx;
  144. margin: 24rpx 0;
  145. }
  146. .tabs {
  147. background-color: rgba(255, 255, 255, 1);
  148. padding: 0 32rpx;
  149. /deep/.u-tab-item {
  150. flex: none !important;
  151. margin-right: 32rpx;
  152. }
  153. /deep/.u-tabs-scorll-flex {
  154. justify-content: start;
  155. }
  156. }
  157. // 分享内容
  158. .share-content {
  159. margin: 48rpx 32rpx 0 32rpx;
  160. .item {
  161. padding-bottom: 32rpx;
  162. border-bottom: 1px solid rgba(232, 232, 232, 1);
  163. margin-top: 48rpx;
  164. .infos {
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. .person {
  169. display: flex;
  170. align-items: center;
  171. .photo {
  172. img {
  173. width: 64rpx;
  174. height: 64rpx;
  175. border-radius: 50px;
  176. }
  177. }
  178. .name {
  179. color: rgba(51, 51, 51, 1);
  180. font-size: 16px;
  181. margin-left: 24rpx;
  182. }
  183. }
  184. }
  185. .share-text {
  186. margin-top: 24rpx;
  187. color: #101010;
  188. font-size: 16px;
  189. line-height: 22px;
  190. }
  191. .pictures {
  192. display: flex;
  193. justify-content: start;
  194. flex-wrap: wrap;
  195. margin-top: 16rpx;
  196. video {
  197. width: 100%;
  198. height: 216rpx;
  199. border-radius: 16rpx;
  200. margin-bottom: 16rpx;
  201. margin-left: 16rpx;
  202. }
  203. img {
  204. width: 31%;
  205. height: 216rpx;
  206. border-radius: 16rpx;
  207. margin-bottom: 16rpx;
  208. margin-left: 16rpx;
  209. }
  210. }
  211. .video{
  212. margin-top: 16rpx;
  213. uni-video{
  214. width: 100%;
  215. height: 380rpx;
  216. border-radius: 8px;
  217. }
  218. }
  219. .tag {
  220. margin-top: 16rpx;
  221. line-height: 24px;
  222. .symbol {
  223. color: rgba(31, 74, 153, 100);
  224. font-size: 16px
  225. }
  226. .text {
  227. color: rgba(31, 74, 153, 1);
  228. margin-left: 14rpx;
  229. }
  230. }
  231. }
  232. }
  233. .item:last-of-type {
  234. border: none;
  235. margin-bottom: 26rpx;
  236. }
  237. .bottom{
  238. z-index: 999;
  239. background: linear-gradient(223.81deg, rgba(0,90,217,1) 14.24%,rgba(0,52,148,1) 86.67%);
  240. width: 104rpx;
  241. height: 104rpx;
  242. border-radius: 50px;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. position: fixed;
  247. right: 72rpx;
  248. bottom: 72rpx;
  249. img{
  250. width: 56rpx;
  251. height: 56rpx;
  252. }
  253. }
  254. </style>