Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

221 строка
5.3 KiB

  1. <template>
  2. <view class="message_list">
  3. <!-- <u-tabs :list="list" :show-bar="false" :is-scroll="false" :current="current" @change="change"></u-tabs> -->
  4. <view class="listMain">
  5. <view class="upgradeList">
  6. <block v-if="updateAnnList.length!=0">
  7. <block v-for="(item,index) in updateAnnList" :key="index">
  8. <view class="upgradeItem" @click="goDetail(item.content,item.id,item.title)">
  9. <view class="notRead">
  10. <view v-if="item.readFlag==0" class="red"></view>
  11. </view>
  12. <view class="right">
  13. <view class="title">{{item.title}}</view>
  14. <view class="time">{{item.createTime}}</view>
  15. </view>
  16. </view>
  17. </block>
  18. </block>
  19. <block v-else>
  20. <view style=" padding: 100rpx 0;">
  21. <u-empty text="暂无数据" mode="list"></u-empty>
  22. </view>
  23. </block>
  24. </view>
  25. <!-- <view class="systemList" v-if="current==0">
  26. <block v-if="sysItemList.length!=0">
  27. <block v-for="(item,index) in sysItemList" :key="index">
  28. <view class="sysItem">
  29. <image class="headpic" src="../../static/images/function1.png"></image>
  30. <view class="right">
  31. <view class="headInfo">
  32. <view class="title">优秀案例</view>
  33. <view class="info">评价你:非常好,品牌价值观还需要补充</view>
  34. </view>
  35. <view class="content">
  36. 我的评论:非常好,品牌价值观还需要补充我的评论:非常好,品牌价值观还需要补充我的评论:非常好,品牌价值观还需要补充我的评论:非常好,品牌价值观还需要补充
  37. </view>
  38. <view class="time">
  39. 2021-01-12 12:23:01
  40. </view>
  41. </view>
  42. </view>
  43. </block>
  44. </block>
  45. <block v-else>
  46. <view style=" padding: 100rpx 0;">
  47. <u-empty text="暂无数据" mode="list"></u-empty>
  48. </view>
  49. </block>
  50. </view>
  51. <view class="upgradeList" v-if="current==1">
  52. <block v-if="updateAnnList.length!=0">
  53. <block v-for="(item,index) in updateAnnList" :key="index">
  54. <view class="upgradeItem" @click="goDetail(item.content,item.id)">
  55. <view class="notRead">
  56. <view v-if="item.readFlag==0" class="red"></view>
  57. </view>
  58. <view class="right">
  59. <view class="title">{{item.title}}</view>
  60. <view class="time">{{item.createTime}}</view>
  61. </view>
  62. </view>
  63. </block>
  64. </block>
  65. <block v-else>
  66. <view style=" padding: 100rpx 0;">
  67. <u-empty text="暂无数据" mode="list"></u-empty>
  68. </view>
  69. </block>
  70. </view>
  71. -->
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. var util = require("../../utils/util.js");
  77. var config = require("../../config");
  78. export default {
  79. data() {
  80. return {
  81. updateAnnList: [],
  82. sysItemList: [],
  83. list: [{
  84. name: '系统消息'
  85. }, {
  86. name: `升级公告`,
  87. count: "",
  88. }],
  89. current: 0
  90. };
  91. },
  92. onShow() {
  93. this.updateInit()
  94. },
  95. methods: {
  96. updateInit() {
  97. uni.request({
  98. url: config.service.updateList,
  99. method: "GET",
  100. data: {
  101. id: uni.getStorageSync('weapp_session_userInfo_data').accountId
  102. },
  103. header: {
  104. 'content-type': 'application/json',
  105. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  106. },
  107. success: (res) => {
  108. this.updateAnnList = res.data.data.list
  109. this.list[1].count = res.data.data.count
  110. }
  111. })
  112. },
  113. goDetail(text, id,title) {
  114. let link = encodeURIComponent(JSON.stringify(text))
  115. uni.navigateTo({
  116. url: "./messageDetail?content=" + link + "&id=" + id+"&tit="+title
  117. })
  118. },
  119. change(index) {
  120. this.current = index;
  121. if (this.current == 1) {
  122. this.updateInit()
  123. }
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss">
  129. .message_list {
  130. .u-tab-item {
  131. border: 0.5rpx solid #dedede;
  132. }
  133. .listMain {
  134. margin-top: 20rpx;
  135. .systemList {
  136. .sysItem {
  137. padding: 20rpx;
  138. border: 1rpx solid #ccc;
  139. display: flex;
  140. margin: 16rpx 0;
  141. .headpic {
  142. width: 70rpx;
  143. height: 70rpx;
  144. border-radius: 100%;
  145. margin-right: 30rpx;
  146. }
  147. .right {
  148. .headInfo {
  149. .title {
  150. font-size: 32rpx;
  151. font-weight: bold;
  152. margin-bottom: 8rpx;
  153. }
  154. }
  155. .content {
  156. width: 600rpx;
  157. background: #e6e6e6;
  158. padding: 10rpx;
  159. margin: 14rpx 0;
  160. overflow: hidden;
  161. text-overflow: ellipsis;
  162. white-space: nowrap;
  163. }
  164. .time {
  165. color: #6f6f6f;
  166. font-size: 24rpx;
  167. }
  168. }
  169. }
  170. }
  171. .upgradeList {
  172. .upgradeItem {
  173. padding: 20rpx;
  174. border: 1rpx solid #ccc;
  175. margin: 16rpx 0;
  176. display: flex;
  177. .notRead {
  178. width: 14rpx;
  179. height: 14rpx;
  180. margin-right: 20rpx;
  181. margin-top: 16rpx;
  182. .red {
  183. background: #FF0000;
  184. width: 100%;
  185. height: 100%;
  186. border-radius: 100%;
  187. }
  188. }
  189. .right {
  190. .title {
  191. font-size: 32rpx;
  192. font-weight: bold;
  193. margin-bottom: 8rpx;
  194. }
  195. .time {
  196. color: #6f6f6f;
  197. font-size: 24rpx;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. </style>