service.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. }
  57. },
  58. mounted() {
  59. this.getMessageList()
  60. },
  61. methods: {
  62. // 请求信息列表
  63. async getMessageList() {
  64. this.userInfo = uni.getStorageSync('userInfo')
  65. this.params.commonId = this.userInfo.serviceProviderId
  66. const { data } = await this.SellerService.getSellerNotice(this.params)
  67. this.messageList = [...this.messageList, ...data.list]
  68. },
  69. // 删除
  70. deleteBtn(id, index) {
  71. // 删除通知消息
  72. this.UserService.authDeleteMessage({ id: id })
  73. .then(response => {
  74. uni.vibrateShort({
  75. success: () => {
  76. this.params.pageSize = this.params.pageNum * this.params.pageSize
  77. this.params.pageNum = 1
  78. this.getMessageList()
  79. }
  80. })
  81. })
  82. .catch(error => {
  83. console.log('error=>', error.msg)
  84. })
  85. },
  86. // 详情
  87. trampInfo($event) {
  88. const time = $event.time.replace(/[年月日]/g, '-')
  89. if ($event.shopTieredType === 7) {
  90. this.$api.navigateTo(
  91. '/pages/seller/notice/service/Institutional_visits?spId=' +
  92. this.userInfo.serviceProviderId +
  93. '&accDateTime=' +
  94. time.substr(0, time.length - 1)
  95. )
  96. } else {
  97. this.$api.navigateTo('/pages/seller/club/club-portrait?userId=' + $event.clubId)
  98. }
  99. }
  100. },
  101. onPullDownRefresh() {
  102. this.params.pageSize = 10
  103. this.params.pageNum = 1
  104. this.getMessageList()
  105. uni.stopPullDownRefresh()
  106. },
  107. onReachBottom() {
  108. this.params.pageNum += 1
  109. this.getMessageList()
  110. }
  111. }
  112. </script>
  113. <style scopde lang="scss">
  114. .container {
  115. padding: 24rpx;
  116. box-sizing: border-box;
  117. }
  118. .info-card {
  119. margin-bottom: 24rpx;
  120. box-sizing: border-box;
  121. }
  122. page {
  123. background-color: #f7f7f7;
  124. }
  125. .container-main {
  126. width: 100%;
  127. box-sizing: border-box;
  128. padding: 24rpx 0;
  129. .empty-container-image {
  130. width: 260rpx;
  131. height: 260rpx;
  132. margin-top: -300rpx;
  133. }
  134. }
  135. .tui-swipeout-content {
  136. white-space: normal !important;
  137. }
  138. .tui-notice {
  139. margin-bottom: 24rpx;
  140. }
  141. .tui-notice-cell {
  142. width: 702rpx;
  143. height: auto;
  144. background-color: #ffffff;
  145. border-radius: 16rpx;
  146. box-sizing: border-box;
  147. padding: 24rpx;
  148. margin: 0 auto;
  149. .tui-cell-top {
  150. width: 100%;
  151. height: 105rpx;
  152. line-height: 105rpx;
  153. border-bottom: 1px solid #ccc;
  154. margin-bottom: 33rpx;
  155. .cell-title {
  156. font-size: 32rpx;
  157. color: #333333;
  158. float: left;
  159. font-weight: bold;
  160. }
  161. .cell-time {
  162. font-size: 24rpx;
  163. color: #999999;
  164. float: right;
  165. }
  166. }
  167. .tui-cell-content {
  168. width: 100%;
  169. height: auto;
  170. box-sizing: border-box;
  171. border-radius: 8rpx;
  172. line-height: 44rpx;
  173. padding: 24rpx;
  174. background-color: #f7f7f7;
  175. font-size: 28rpx;
  176. color: #333333;
  177. text-align: justify;
  178. }
  179. }
  180. .tui-custom-btn_box {
  181. width: 80px;
  182. height: 100%;
  183. padding: 0 20rpx;
  184. box-sizing: border-box;
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. background-color: #f7f7f7;
  189. }
  190. .tui-custom-btn {
  191. width: 56rpx;
  192. height: 56rpx;
  193. border-radius: 50%;
  194. background-color: #f94b4b;
  195. color: #ffffff;
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. flex-shrink: 0;
  200. .icon-shanchu3 {
  201. font-size: 32rpx;
  202. }
  203. }
  204. </style>