service.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="service">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="container">
  11. <view v-for="(cell, index) in messageList" class="info-card" :key="index">
  12. <view class="tui-notice clearfix">
  13. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  14. <template v-slot:content>
  15. <notice-cell :cellType="1" :cell="cell" @trampInfo="trampInfo"></notice-cell>
  16. </template>
  17. <template v-slot:button>
  18. <view class="tui-custom-btn_box">
  19. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  20. <text class="iconfont icon-shanchu3"></text>
  21. </view>
  22. </view>
  23. </template>
  24. </tui-swipe-action>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { mapState, mapMutations } from 'vuex'
  32. import noticeCell from '../components/notice-cell.vue'
  33. export default {
  34. components: {
  35. noticeCell
  36. },
  37. data() {
  38. return {
  39. skeletonShow: false, // 刷新
  40. params: {
  41. messageType: 3,
  42. pageNum: 1,
  43. pageSize: 10,
  44. source: 2,
  45. commonId: ''
  46. },
  47. messageList: [
  48. {
  49. id: 1,
  50. shopTieredType: 7,
  51. time: '2023年8月29日',
  52. content: '大黄蜂'
  53. }
  54. ], // 信息列表
  55. userInfo: {},
  56. isLastPage: false, // 是否是最后一页
  57. }
  58. },
  59. mounted() {
  60. this.getMessageList()
  61. },
  62. methods: {
  63. // 请求信息列表
  64. async getMessageList() {
  65. this.userInfo = uni.getStorageSync('userInfo')
  66. this.params.commonId = this.userInfo.serviceProviderId
  67. const { data } = await this.SellerService.getSellerNotice(this.params)
  68. this.messageList = [...this.messageList, ...data.list]
  69. this.isLastPage = data.isLastPage
  70. },
  71. // 删除
  72. deleteBtn(id, index) {
  73. // 删除通知消息
  74. this.UserService.authDeleteMessage({ id: id })
  75. .then(response => {
  76. uni.vibrateShort({
  77. success: () => {
  78. this.params.pageSize = this.params.pageNum * this.params.pageSize
  79. this.params.pageNum = 1
  80. this.getMessageList()
  81. }
  82. })
  83. })
  84. .catch(error => {
  85. console.log('error=>', error.msg)
  86. })
  87. },
  88. // 详情
  89. trampInfo($event) {
  90. const time = $event.time.replace(/[年月日]/g, '-')
  91. if ($event.shopTieredType === 7) {
  92. this.$api.navigateTo(
  93. '/pages/seller/notice/service/Institutional_visits?spId=' +
  94. this.userInfo.serviceProviderId +
  95. '&accDateTime=' +
  96. time.substr(0, time.length - 1)
  97. )
  98. } else {
  99. this.$api.navigateTo('/pages/seller/club/club-portrait?userId=' + $event.clubId)
  100. }
  101. }
  102. },
  103. onPullDownRefresh() {
  104. this.params.pageSize = 10
  105. this.params.pageNum = 1
  106. this.getMessageList()
  107. uni.stopPullDownRefresh()
  108. },
  109. onReachBottom() {
  110. if (this.isLastPage) {
  111. this.params.pageNum += 1
  112. this.getMessageList()
  113. }
  114. }
  115. }
  116. </script>
  117. <style scopde lang="scss">
  118. .container {
  119. padding: 24rpx;
  120. box-sizing: border-box;
  121. }
  122. .info-card {
  123. margin-bottom: 24rpx;
  124. box-sizing: border-box;
  125. }
  126. page {
  127. background-color: #f7f7f7;
  128. }
  129. .container-main {
  130. width: 100%;
  131. box-sizing: border-box;
  132. padding: 24rpx 0;
  133. .empty-container-image {
  134. width: 260rpx;
  135. height: 260rpx;
  136. margin-top: -300rpx;
  137. }
  138. }
  139. .tui-swipeout-content {
  140. white-space: normal !important;
  141. }
  142. .tui-notice {
  143. margin-bottom: 24rpx;
  144. }
  145. .tui-notice-cell {
  146. width: 702rpx;
  147. height: auto;
  148. background-color: #ffffff;
  149. border-radius: 16rpx;
  150. box-sizing: border-box;
  151. padding: 24rpx;
  152. margin: 0 auto;
  153. .tui-cell-top {
  154. width: 100%;
  155. height: 105rpx;
  156. line-height: 105rpx;
  157. border-bottom: 1px solid #ccc;
  158. margin-bottom: 33rpx;
  159. .cell-title {
  160. font-size: 32rpx;
  161. color: #333333;
  162. float: left;
  163. font-weight: bold;
  164. }
  165. .cell-time {
  166. font-size: 24rpx;
  167. color: #999999;
  168. float: right;
  169. }
  170. }
  171. .tui-cell-content {
  172. width: 100%;
  173. height: auto;
  174. box-sizing: border-box;
  175. border-radius: 8rpx;
  176. line-height: 44rpx;
  177. padding: 24rpx;
  178. background-color: #f7f7f7;
  179. font-size: 28rpx;
  180. color: #333333;
  181. text-align: justify;
  182. }
  183. }
  184. .tui-custom-btn_box {
  185. width: 80px;
  186. height: 100%;
  187. padding: 0 20rpx;
  188. box-sizing: border-box;
  189. display: flex;
  190. align-items: center;
  191. justify-content: center;
  192. background-color: #f7f7f7;
  193. }
  194. .tui-custom-btn {
  195. width: 56rpx;
  196. height: 56rpx;
  197. border-radius: 50%;
  198. background-color: #f94b4b;
  199. color: #ffffff;
  200. display: flex;
  201. align-items: center;
  202. justify-content: center;
  203. flex-shrink: 0;
  204. .icon-shanchu3 {
  205. font-size: 32rpx;
  206. }
  207. }
  208. </style>