index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="visit">
  3. <view class="uni-list">
  4. <view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item, index) in studyList" :key="index" @tap="navTo(`/pages/study/detail?id=${item.id}`)">
  5. <view class="uni-media-list">
  6. <image class="uni-media-list-logo" :src="item.cover"></image>
  7. <view class="uni-media-list-body">
  8. <view class="uni-media-list-text-top">{{item.description}}</view>
  9. <view class="uni-media-list-text-bottom">
  10. <text>{{item.author}}</text>
  11. <text>{{item.created_at | time}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import moment from '@/common/moment';
  21. export default {
  22. data() {
  23. return {
  24. studyList: [{"id":"8","merchant_id":"2","title":"共创人类发展的美好未来","cover":"http://wephp-oa.oss-cn-shenzhen.aliyuncs.com/images/2020/09/10/image_1599669475_VQXiR1bX.jpg","seo_key":"","seo_content":"","cate_id":"1","description":"“十三五”期间,中国不断扩大开放,深入推进共建“一带一路”,构建人类命运共同体共识不断巩固,务实合作根基不断夯实,全球治理空间不断拓展。","position":"0","content":"","link":"","author":"","view":"473","sort":"0","status":"1","created_at":"1601956562","updated_at":"1601956617"},{"id":"7","merchant_id":"2","title":"办公系统正式开通","cover":"http://wephp-oa.oss-cn-shenzhen.aliyuncs.com/images/2020/09/10/image_1599669347_KbFsxS3m.jpg","seo_key":"","seo_content":"","cate_id":"1","description":"办公系统正式开通,请大家下载安装应用","position":"0","content":"","link":"","author":"维博网络","view":"473","sort":"0","status":"1","created_at":"1601915568","updated_at":"1606156145"}],
  25. // 控制滑动效果
  26. theIndex: null,
  27. oldIndex: null
  28. };
  29. },
  30. filters: {
  31. time(val) {
  32. return moment(val * 1000).format('YY/MM/DD');
  33. },
  34. },
  35. async onLoad(options) {
  36. await this.initData();
  37. },
  38. methods: {
  39. // 数据初始化
  40. initData() {
  41. this.hasLogin = this.$mStore.getters.hasLogin;
  42. uni.setNavigationBarColor({
  43. frontColor: '#ffffff',
  44. backgroundColor: this.themeColor.color,
  45. animation: {
  46. duration: 400,
  47. timingFunc: 'easeIn'
  48. }
  49. });
  50. },
  51. navTo(route) {
  52. this.$mRouter.push({
  53. route
  54. });
  55. }
  56. }
  57. };
  58. </script>
  59. <style lang="scss">
  60. page {
  61. background-color: $page-color-base;
  62. }
  63. .visit {
  64. .uni-media-list-logo {
  65. width: 180rpx;
  66. height: 140rpx;
  67. }
  68. .uni-media-list-body {
  69. height: auto;
  70. justify-content: space-around;
  71. }
  72. .uni-media-list-text-top {
  73. height: 74rpx;
  74. font-size: 28rpx;
  75. overflow: hidden;
  76. }
  77. .uni-media-list-text-bottom {
  78. display: flex;
  79. flex-direction: row;
  80. justify-content: space-between;
  81. }
  82. .add-round {
  83. position: fixed;
  84. z-index: 999;
  85. right: 30rpx;
  86. bottom: 30rpx;
  87. border-radius: 50%;
  88. width: 120rpx;
  89. height: 120rpx;
  90. color: #fff;
  91. text-align: center;
  92. line-height: 120rpx;
  93. font-weight: 100;
  94. font-size: 80rpx;
  95. }
  96. .notify-list {
  97. margin-top: 20upx;
  98. .read {
  99. text-align: right;
  100. margin-right: $spacing-base;
  101. margin-top: $spacing-base;
  102. margin-bottom: $spacing-sm;
  103. text {
  104. margin-left: $spacing-base;
  105. }
  106. }
  107. .row {
  108. width: calc(94%);
  109. height: calc(22vw + 40upx);
  110. margin: 0 auto $spacing-base;
  111. border-radius: 15upx;
  112. box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
  113. display: flex;
  114. align-items: center;
  115. position: relative;
  116. overflow: hidden;
  117. z-index: 4;
  118. border: 0;
  119. .menu {
  120. .iconfont {
  121. color: #fff;
  122. font-size: 60upx;
  123. }
  124. position: absolute;
  125. width: 29%;
  126. height: 100%;
  127. right: 0;
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. color: #fff;
  132. z-index: 2;
  133. }
  134. .carrier {
  135. @keyframes showMenu {
  136. 0% {
  137. transform: translateX(0);
  138. }
  139. 100% {
  140. transform: translateX(-30%);
  141. }
  142. }
  143. @keyframes closeMenu {
  144. 0% {
  145. transform: translateX(-30%);
  146. }
  147. 100% {
  148. transform: translateX(0);
  149. }
  150. }
  151. &.open {
  152. animation: showMenu 0.25s linear both;
  153. }
  154. &.close {
  155. animation: closeMenu 0.15s linear both;
  156. }
  157. background-color: #fff;
  158. position: absolute;
  159. width: 100%;
  160. padding: 0 0;
  161. height: 100%;
  162. z-index: 3;
  163. display: flex;
  164. align-items: center;
  165. }
  166. }
  167. .notify-wrapper {
  168. background-color: $color-white;
  169. width: 100%;
  170. padding: $spacing-base $spacing-lg $spacing-base $spacing-lg;
  171. margin: $spacing-base 0 0;
  172. border-radius: 15upx;
  173. position: relative;
  174. .title {
  175. font-size: $font-lg;
  176. color: $font-color-dark;
  177. font-weight: 500;
  178. margin: 0 0 $spacing-sm;
  179. }
  180. .content {
  181. font-size: $font-sm;
  182. color: $font-color-base;
  183. height: 75upx;
  184. line-height: 36upx;
  185. }
  186. .time {
  187. font-size: $font-base;
  188. color: $font-color-light;
  189. }
  190. .type {
  191. position: absolute;
  192. top: 26upx;
  193. left: -10upx;
  194. border: none;
  195. font-size: $font-sm;
  196. opacity: 0.8;
  197. }
  198. .un-read {
  199. display: inline-block;
  200. width: 12upx;
  201. height: 12upx;
  202. border-radius: 50%;
  203. position: absolute;
  204. top: 32upx;
  205. right: 30upx;
  206. }
  207. }
  208. }
  209. .notify-empty {
  210. position: fixed;
  211. left: 0;
  212. top: 0;
  213. width: 100%;
  214. height: 100vh;
  215. padding-bottom: 100upx;
  216. display: flex;
  217. justify-content: center;
  218. flex-direction: column;
  219. align-items: center;
  220. background: #fff;
  221. .iconfont {
  222. font-size: $font-lg + 100upx;
  223. }
  224. .empty-tips {
  225. display: flex;
  226. font-size: $font-sm + 2upx;
  227. color: $font-color-disabled;
  228. .navigator {
  229. margin-left: 16upx;
  230. }
  231. }
  232. }
  233. }
  234. </style>