messageReminder.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="aui-news-box">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <uni-swipe-action>
  6. <!-- 基础用法 -->
  7. <uni-swipe-action-item v-for="(list, index) in lists" :key="index" :right-options="swipeOptions" @click="swipeClick($event, index)">
  8. <view class="aui-news-item">
  9. <view class="aui-news-item-hd">
  10. <image :src="list.img" mode="widthFix" lazy-load class="img"/>
  11. </view>
  12. <view class="aui-news-item-bd">
  13. <view class="title">
  14. <h4>{{list.tit1}}</h4>
  15. <span>{{list.time}}</span>
  16. </view>
  17. <view class="content">
  18. <p>{{list.tit2}}</p>
  19. </view>
  20. </view>
  21. </view>
  22. </uni-swipe-action-item>
  23. </uni-swipe-action>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. swipeOptions: [
  31. {text: '删除',value:'1', style: {backgroundColor: '#dd524d'}}
  32. ],
  33. lists: [{
  34. "tit1": "系统消息",
  35. "tit2": "七月要增员?为您献上增员神器",
  36. "time": "08:48",
  37. "img": '/static/image/messageIcon/icon-item-001.png'
  38. },
  39. {
  40. "tit1": "服务消息",
  41. "tit2": "暂无消息",
  42. "time": "08:48",
  43. "img": '/static/image/messageIcon/icon-item-002.png'
  44. },
  45. {
  46. "tit1": "订单进度",
  47. "tit2": "订单号6565413164546已撤销",
  48. "time": "昨天",
  49. "img": '/static/image/messageIcon/icon-item-003.png'
  50. },
  51. {
  52. "tit1": "保单提醒",
  53. "tit2": "您有一条保单消息,请及时查看",
  54. "time": "星期六",
  55. "img": '/static/image/messageIcon/icon-item-004.png'
  56. },
  57. {
  58. "tit1": "佣金消息",
  59. "tit2": "您有一条佣金消息,请及时查看",
  60. "time": "星期六",
  61. "img": '/static/image/messageIcon/icon-item-005.png'
  62. },{
  63. "tit1": "增员服务",
  64. "tit2": "你有一条增员记录",
  65. "time": "星期五",
  66. "img": '/static/image/messageIcon/icon-item-001.png'
  67. }
  68. ],
  69. }
  70. },
  71. onLoad() {
  72. },
  73. methods: {
  74. swipeClick(e,index) {
  75. uni.showToast({
  76. title: '点击了第'+(index+1)+'条数据的'+ e.content.text + '按钮',
  77. icon: 'none'
  78. });
  79. }
  80. }
  81. }
  82. </script>
  83. <style>
  84. .aui-news-box {
  85. margin-top: 8px;
  86. background: #fff;
  87. }
  88. .aui-news-item {
  89. padding: 30upx;
  90. position: relative;
  91. display: flex;
  92. align-items: center;
  93. }
  94. .aui-news-item-hd {
  95. margin-right: 30upx;
  96. width: 110upx;
  97. display: flex;
  98. flex-shrink: 0;
  99. background: #fff;
  100. border-radius: 30upx;
  101. }
  102. .aui-news-item-hd .img {
  103. width: 100%;
  104. }
  105. .aui-news-item-bd {
  106. display: flex;
  107. flex-direction: column;
  108. width: 550upx;
  109. }
  110. .aui-news-item-bd .title{
  111. display: flex;
  112. justify-content: space-between;
  113. padding-bottom: 10upx;
  114. }
  115. .aui-news-item-bd .title h4 {
  116. font-weight: 400;
  117. font-size: 32upx;
  118. line-height: 50upx;
  119. width: 250upx;
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. white-space: nowrap;
  123. color: #333;
  124. }
  125. .aui-news-item-bd .title span{
  126. color: #848689;
  127. }
  128. .aui-news-item-bd p {
  129. width: 100%;
  130. color: #848689;
  131. overflow: hidden;
  132. text-overflow: ellipsis;
  133. white-space: nowrap;
  134. }
  135. .aui-news-item:before {
  136. content: '';
  137. position: absolute;
  138. z-index: 2;
  139. bottom: 0;
  140. left: 0;
  141. width: 100%;
  142. height: 1px;
  143. border-bottom: 1px solid #d8d8d8;
  144. transform: scaleY(0.5);
  145. }
  146. </style>