AI销管
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

warningList.vue 2.7 KiB

pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="pages">
  3. <block v-for="(data, index) in list">
  4. <view class="page-box" v-if="data.list.length > 0" :key="index">
  5. <view class="title">
  6. <text class="a1">
  7. {{ data.houseName || '' }}
  8. </text>
  9. <text :style="{color: 'blue'}" @click="updateShowStatus(data)">已了解</text>
  10. </view>
  11. <u-checkbox-group @change="checkboxGroupChange" shape="circle">
  12. <block v-for="item in data.list" :key="item.id">
  13. <u-checkbox :disabled="item.showStatus == 0" @change="checkboxChange" v-model="item.checked">
  14. <view :style="{ textDecoration: item.showStatus == 0 ? 'line-through' : 'none'}">
  15. {{ item.createTime }}
  16. </view>
  17. <rich-text :style="{ textDecoration: item.showStatus == 0 ? 'line-through' : 'none'}" :nodes="item.message"></rich-text>
  18. </u-checkbox>
  19. </block>
  20. </u-checkbox-group>
  21. </view>
  22. </block>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. list: [], //
  30. }
  31. },
  32. onLoad() {
  33. this.getWarningList()
  34. },
  35. methods: {
  36. //
  37. updateShowStatus(data) {
  38. let arr = data.list.filter(item => item.checked).map(items => {return items.id})
  39. console.log(arr)
  40. if (arr.length == 0) {
  41. uni.showToast({
  42. title: '请选择已了解的消息~',
  43. icon: "none",
  44. duration: 2000,
  45. })
  46. return
  47. }
  48. this.$u.get('/customer/updateShowStatus', {
  49. ids: arr.join(',')
  50. }).then(res => {
  51. uni.showToast({
  52. title: '提交成功',
  53. icon: "none",
  54. duration: 2000,
  55. })
  56. this.list = []
  57. this.$forceUpdate()
  58. setTimeout(() => {
  59. this.getWarningList()
  60. }, 1000)
  61. })
  62. },
  63. // 项目预警列表
  64. getWarningList() {
  65. this.$u.get('/customer/warningList').then(res => {
  66. if (res) {
  67. this.list = res.records.map(item => {
  68. item.list.forEach(items => {
  69. items.checked = items.showStatus == 0 ? true : false
  70. })
  71. return item
  72. })
  73. this.$forceUpdate()
  74. }
  75. })
  76. },
  77. // 选中某个复选框时,由checkbox时触发
  78. checkboxChange(e) {
  79. console.log(e);
  80. },
  81. // 选中任一checkbox时,由checkbox-group触发
  82. checkboxGroupChange(e) {
  83. console.log(e);
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .pages {
  90. padding: 20rpx 0;
  91. width: 100vw;
  92. min-height: 100vh;
  93. background: #f2f2f2;
  94. display: flex;
  95. flex-direction: column;
  96. .page-box {
  97. margin: 0 auto 20rpx;
  98. padding: 20rpx;
  99. width: 686rpx;
  100. background: #fff;
  101. border-radius: 16rpx;
  102. box-shadow: 0rpx 0rpx 7rpx #82848A;
  103. .title {
  104. display: flex;
  105. justify-content: space-between;
  106. .a1 {
  107. font-size: 32rpx;
  108. font-weight: 600;
  109. }
  110. }
  111. }
  112. }
  113. </style>