message.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="main">
  3. <view class="padding-lr">
  4. <view v-for="(item,index) in messageList" @click="gotoliaotian(item)" :key="index" class="padding-lr-sm padding-tb-sm bg-white margin-top-sm"
  5. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  6. <view class="flex justify-start align-center">
  7. <u-icon name="order"></u-icon>
  8. <text class="text-lg margin-left-xs">{{
  9. item.type==1?'医生确认接单':item.type==2?'医生确认结束':item.type==3?'系统通知':item.type==4?'下单成功':item.type==5?'服务包下单成功':item.type==6?'服务包到期':item.type==7?'充值成功':item.type==8?'余额付款成功':item.type==9?'修改密码':item.type==10?'修改绑定电话':item.type==11?'修改支付密码':item.type==12?'社区端通知':item.type==13?'后台通知':'订单通知'
  10. }}</text>
  11. <text class="flex-sub text-right">{{item.create_time}}</text>
  12. </view>
  13. <view class="margin-top-sm text-cut">
  14. {{item.content}}
  15. </view>
  16. <view class="text-right" style="position: relative">
  17. <!-- <u-badge size="mini" :absolute="false" type="error" v-if="item.status==1" :is-dot="true"></u-badge>
  18. <text class="margin-left-xs" v-if="item.status==1">未读</text>
  19. <text class="margin-left-xs" v-if="item.status==2">已读</text> -->
  20. </view>
  21. </view>
  22. </view>
  23. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  24. <view class="cu-tabbar-height"></view>
  25. <view class="cu-tabbar-height"></view>
  26. <u-no-network></u-no-network>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. onLoad(options) {
  32. },
  33. mounted() {
  34. this.getMessage()
  35. },
  36. data() {
  37. return {
  38. messageList: [],
  39. pageindex: 1,
  40. show: false
  41. }
  42. },
  43. onReachBottom() {
  44. this.getMessage()
  45. },
  46. methods: {
  47. getMessage: async function() {
  48. let res = await this.$request.post("/api/v1/user/userMessageList", {
  49. page: this.pageindex
  50. })
  51. console.log(res)
  52. if (res.status == 0) {
  53. if (this.pageindex > res.data.last_page) {
  54. uni.showToast({
  55. title: "没有更多了",
  56. icon: "none"
  57. })
  58. } else {
  59. this.messageList = this.messageList.concat(res.data.data)
  60. this.pageindex++
  61. }
  62. }
  63. if (this.messageList.length == 0) {
  64. this.show = true
  65. } else {
  66. this.show = false
  67. }
  68. },
  69. gotoliaotian(item) {
  70. if (item.type == 1 || item.type == 4) {
  71. uni.navigateTo({
  72. url: "../common_tools/my_consulting/consultingInfo?id=" + item.relation_id
  73. })
  74. } else if (item.type == 2 && item.product_type == 1 || item.type == 2 && item.product_type == 2) {
  75. uni.navigateTo({
  76. url: "../common_tools/my_consulting/opinionInfo?id=" + item.relation_id
  77. })
  78. } else if (item.type == 5 || item.type == 6) {
  79. uni.navigateTo({
  80. url:""
  81. })
  82. }
  83. }
  84. }
  85. };
  86. </script>
  87. <style scoped lang="scss">
  88. .main {}
  89. </style>