service.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. />
  10. <<<<<<< HEAD
  11. <view class="container">
  12. <tab-list v-model="params.type" />
  13. <view v-for="(cell, index) in messageList" class="info-card" :key="index">
  14. <view class="tui-notice clearfix">
  15. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  16. <template v-slot:content>
  17. <notice-cell :cellType="1" :cell="cell" @trampInfo="trampInfo"></notice-cell>
  18. </template>
  19. <template v-slot:button>
  20. <view class="tui-custom-btn_box">
  21. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  22. <text class="iconfont icon-shanchu3"></text>
  23. </view>
  24. </view>
  25. </template>
  26. </tui-swipe-action>
  27. </view>
  28. =======
  29. <view class="container" v-else>
  30. <tab-list v-model="params.type" />
  31. <template v-if="messageList.length > 0">
  32. <view v-for="(cell, index) in messageList" class="info-card" :key="index" >
  33. <view class="tui-notice clearfix">
  34. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  35. <template v-slot:content>
  36. <notice-cell :cellType="1" :cell="cell" @trampInfo="trampInfo"></notice-cell>
  37. </template>
  38. <template v-slot:button>
  39. <view class="tui-custom-btn_box">
  40. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  41. <text class="iconfont icon-shanchu3"></text>
  42. </view>
  43. </view>
  44. </template>
  45. </tui-swipe-action>
  46. </view>
  47. </view>
  48. </template>
  49. <view class="info-card-none" v-else>
  50. <image
  51. class="none-image"
  52. src="https://static.caimei365.com/app/img/icon/icon-remarks-empty@2x.png"
  53. mode=""
  54. ></image>
  55. <view class="none-text">暂无通知~</view>
  56. >>>>>>> remotes/origin/developer
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import { mapState, mapMutations } from 'vuex'
  63. import tabList from '../components/notice-server-tab.vue'
  64. import noticeCell from '../components/notice-cell.vue'
  65. export default {
  66. components: {
  67. noticeCell,
  68. tabList
  69. },
  70. data() {
  71. return {
  72. skeletonShow: true, // 刷新
  73. params: {
  74. messageType: 3,
  75. pageNum: 1,
  76. pageSize: 10,
  77. source: 2,
  78. commonId: '',
  79. type: ''
  80. },
  81. messageList: [], // 信息列表
  82. userInfo: {},
  83. isLastPage: false, // 是否是最后一页
  84. showDataBase: false
  85. }
  86. },
  87. watch: {
  88. 'params.type': {
  89. handler(val) {
  90. this.messageList = []
  91. this.getMessageList({ isRefresh: true })
  92. }
  93. }
  94. },
  95. mounted() {
  96. this.getMessageList({ isRefresh: false })
  97. },
  98. methods: {
  99. // 请求信息列表
  100. async getMessageList(options) {
  101. this.userInfo = uni.getStorageSync('userInfo')
  102. this.params.commonId = this.userInfo.serviceProviderId
  103. const { data } = await this.SellerService.getSellerNotice(this.params)
  104. if (options.isRefresh) {
  105. this.messageList = data.list
  106. }
  107. else {
  108. this.messageList = [...this.messageList, ...data.list]
  109. }
  110. this.isLastPage = data.isLastPage
  111. setTimeout(()=>{
  112. this.skeletonShow = false
  113. },1000)
  114. },
  115. // 删除
  116. deleteBtn(id, index) {
  117. // 删除通知消息
  118. this.UserService.authDeleteMessage({ id: id })
  119. .then(response => {
  120. uni.vibrateShort({
  121. success: () => {
  122. this.params.pageSize = this.params.pageNum * this.params.pageSize
  123. this.params.pageNum = 1
  124. this.getMessageList({isRefresh: true})
  125. }
  126. })
  127. })
  128. .catch(error => {
  129. console.log('error=>', error.msg)
  130. })
  131. },
  132. // 详情
  133. async trampInfo(cell) {
  134. const time = cell.time.replace(/[年月日]/g, '-')
  135. if (cell.shopTieredType === 7 || cell.shopTieredType === 10) {
  136. this.$api.navigateTo(
  137. '/pages/seller/notice/service/Institutional_visits?spId=' +
  138. this.userInfo.serviceProviderId +
  139. '&accDateTime=' +
  140. cell.time + '&type=' + this.params.type
  141. )
  142. } else if(cell.shopTieredType === 11) {
  143. this.$api.navigateTo('/pages/seller/club/club-remind')
  144. }else {
  145. const {data} = await this.SellerService.getFindUserId({id: cell.clubId, userType: 1})
  146. this.$api.navigateTo('/pages/seller/club/club-portrait?userId=' + data)
  147. }
  148. }
  149. },
  150. onPullDownRefresh() {
  151. this.params.pageSize = 10
  152. this.params.pageNum = 1
  153. this.getMessageList({isRefresh: true})
  154. uni.stopPullDownRefresh()
  155. },
  156. onReachBottom() {
  157. if (!this.isLastPage) {
  158. this.params.pageNum += 1
  159. this.getMessageList({isRefresh: false})
  160. }
  161. }
  162. }
  163. </script>
  164. <style scopde lang="scss">
  165. .container {
  166. box-sizing: border-box;
  167. }
  168. .info-card {
  169. margin-bottom: 24rpx;
  170. box-sizing: border-box;
  171. }
  172. .info-card-none{
  173. width: 100%;
  174. height: 900rpx;
  175. display: flex;
  176. align-items: center;
  177. justify-content: center;
  178. flex-direction: column;
  179. .none-image {
  180. width: 180rpx;
  181. height: 180rpx;
  182. margin-bottom: 20rpx;
  183. }
  184. .none-text {
  185. font-size: $font-size-28;
  186. color: #999999;
  187. line-height: 44rpx;
  188. }
  189. }
  190. page {
  191. background-color: #f7f7f7;
  192. }
  193. .container-main {
  194. width: 100%;
  195. box-sizing: border-box;
  196. padding: 24rpx 0;
  197. .empty-container-image {
  198. width: 260rpx;
  199. height: 260rpx;
  200. margin-top: -300rpx;
  201. }
  202. }
  203. .tui-swipeout-content {
  204. white-space: normal !important;
  205. }
  206. .tui-notice {
  207. margin-bottom: 24rpx;
  208. }
  209. .tui-notice-cell {
  210. width: 702rpx;
  211. height: auto;
  212. background-color: #ffffff;
  213. border-radius: 16rpx;
  214. box-sizing: border-box;
  215. padding: 24rpx;
  216. margin: 0 auto;
  217. .tui-cell-top {
  218. width: 100%;
  219. height: 105rpx;
  220. line-height: 105rpx;
  221. border-bottom: 1px solid #ccc;
  222. margin-bottom: 33rpx;
  223. .cell-title {
  224. font-size: 32rpx;
  225. color: #333333;
  226. float: left;
  227. font-weight: bold;
  228. }
  229. .cell-time {
  230. font-size: 24rpx;
  231. color: #999999;
  232. float: right;
  233. }
  234. }
  235. .tui-cell-content {
  236. width: 100%;
  237. height: auto;
  238. box-sizing: border-box;
  239. border-radius: 8rpx;
  240. line-height: 44rpx;
  241. padding: 24rpx;
  242. background-color: #f7f7f7;
  243. font-size: 28rpx;
  244. color: #333333;
  245. text-align: justify;
  246. }
  247. }
  248. .tui-custom-btn_box {
  249. width: 80px;
  250. height: 100%;
  251. padding: 0 20rpx;
  252. box-sizing: border-box;
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. background-color: #f7f7f7;
  257. }
  258. .tui-custom-btn {
  259. width: 56rpx;
  260. height: 56rpx;
  261. border-radius: 50%;
  262. background-color: #f94b4b;
  263. color: #ffffff;
  264. display: flex;
  265. align-items: center;
  266. justify-content: center;
  267. flex-shrink: 0;
  268. .icon-shanchu3 {
  269. font-size: 32rpx;
  270. }
  271. }
  272. </style>