filesonic.vue 5.1 KB

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