AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

151 lines
3.0 KiB

  1. <template>
  2. <view class="pages">
  3. <view class="header">
  4. <view class="items" @tap="totalTimeShow = true">
  5. {{ showTimeCalender }}
  6. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  7. </view>
  8. <view class="items" style="color: #1890FF;" @tap="jumpPage">
  9. 明细
  10. </view>
  11. </view>
  12. <view class="wordslist">
  13. <!-- block -->
  14. <block v-for="(data, index) in pageData">
  15. <view class="item" :key="data.id" @click="jumpPage(data, index)">
  16. <view :class="{noneColor: index == 0 }" class="lside blue">{{ data.words }}</view>
  17. <view class="rside">{{ data.sumNum }}</view>
  18. </view>
  19. </block>
  20. </view>
  21. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. pageParams: {
  29. statDateStart: '', //开始时间
  30. statDateEnd: '', //结束时间
  31. projectId: uni.getStorageSync("buildingID").id, //项目id
  32. },
  33. showTimeCalender: '选择日期', //
  34. totalTimeShow: false, // 自定义时间
  35. pageData: [], // 页面数据
  36. inParams: '', // 入参
  37. };
  38. },
  39. onLoad(option) {
  40. if (option) {
  41. this.inParams = this.params(option)
  42. }
  43. this.findSensitiveWordsData()
  44. },
  45. methods: {
  46. // 对象转url参数F
  47. params(json) {
  48. return Object.keys(json).map(key => key + '=' + json[key]).join('&');
  49. },
  50. jumpPage(data) {
  51. uni.navigateTo({
  52. url: `/pages/center/prohibited/index?refresh=refresh&staTime=${this.pageParams.statDateStart}&endtime=${this.pageParams.statDateEnd}&words=${data.words}`
  53. });
  54. },
  55. // findSensitiveWordsData
  56. findSensitiveWordsData() {
  57. this.$u.post('/customer/findSensitiveWordsData', this.pageParams).then(res => {
  58. console.log(res)
  59. res.unshift({
  60. words: '违禁词',
  61. id: new Date().getTime(),
  62. sumNum: '违禁次数'
  63. })
  64. this.pageData = res
  65. console.log(this.pageData, '123321s')
  66. })
  67. },
  68. // 自定义时间
  69. totalTimeChange(e) {
  70. console.log(e)
  71. this.pageParams.statDateStart = e.startDate
  72. this.pageParams.statDateEnd = e.endDate
  73. this.showTimeCalender = `${e.startDate}-${e.endDate}`
  74. this.findSensitiveWordsData()
  75. },
  76. }
  77. }
  78. </script>
  79. <style lang="scss">
  80. .pages {
  81. width: 100vw;
  82. min-height: 100vh;
  83. display: flex;
  84. flex-direction: column;
  85. .header {
  86. width: 100%;
  87. height: 90rpx;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. .items {
  92. height: 100%;
  93. flex-grow: 1;
  94. display: flex;
  95. align-items: center;
  96. justify-content: center;
  97. color: #666666;
  98. font-size: 28rpx;
  99. }
  100. }
  101. .wordslist {
  102. width: 100%;
  103. padding: 20rpx;
  104. .item {
  105. width: 100%;
  106. height: 90rpx;
  107. font-size: 32rpx;
  108. display: flex;
  109. align-items: center;
  110. .lside {
  111. flex-grow: 1;
  112. &.blue {
  113. color: #1890FF;
  114. }
  115. &.noneColor {
  116. color: #333;
  117. }
  118. }
  119. .rside {
  120. flex-shrink: 0;
  121. width: 200rpx;
  122. text-align: right;
  123. }
  124. }
  125. }
  126. }
  127. </style>