AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

115 行
2.7 KiB

  1. <template>
  2. <view class="help-box">
  3. <view class="search-box">
  4. <u-search placeholder="输入要搜索的问题" @change="searchFun" :show-action="true" action-text="搜索" shape="round" v-model="keyword"></u-search>
  5. </view>
  6. <view class='result-box'>
  7. <view class='list-item' @click="todetail(item)" v-for="(item,index) in list" :key="index">
  8. <view class="title u-line-2">
  9. {{keywordColor1(item.name)}}<text class="blue">{{keyword}}</text>{{keywordColor2(item.name)}}
  10. </view>
  11. <view class="desc">{{item.desc}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. let domain = require("@/utils/domain")
  18. export default {
  19. data() {
  20. return {
  21. keyword: "",
  22. list: [
  23. {name:'如何查看设备是否开启如何查看设备是否开启',desc: '1、打开小程序查看设备管理查看设备电量;'},
  24. {name:'如何查看设备开否联网',desc: '1、打开小程序查看设备管理查看设备电量;2、通过PC设备监控查看设备电量。'},
  25. {name:'如何查看设备是开了电',desc: '打开小程序查看设备管理查看设备电量。'},
  26. {name:'如何查看设备是否开电',desc: '打开小程序查看设备管理查看设备电量。'},
  27. ]
  28. };
  29. },
  30. onShow() {
  31. },
  32. computed: {
  33. },
  34. created(){
  35. },
  36. methods: {
  37. searchFun(){
  38. },
  39. todetail(item){
  40. uni.navigateTo({
  41. url: '/pages/mine/help/helpDetail'
  42. })
  43. },
  44. keywordColor1(name1){
  45. let name = name1
  46. if(!name||!this.keyword) return ''
  47. let index = name.indexOf(this.keyword)
  48. let pre = name.slice(0,index)
  49. return pre
  50. },
  51. keywordColor2(name1){
  52. let name = name1
  53. if(!name||!this.keyword) return ''
  54. let index = name.indexOf(this.keyword)
  55. let last = name.slice(index + this.keyword.length)
  56. return last
  57. },
  58. },
  59. }
  60. </script>
  61. <style lang="scss">
  62. .help-box{
  63. width: 100%;
  64. height: 100%;
  65. .search-box{
  66. width: 690rpx;
  67. height: 70rpx;
  68. margin-top: 16rpx;
  69. margin-left: 30rpx;
  70. }
  71. .result-box{
  72. width: 100%;
  73. margin-top: 36rpx;
  74. padding: 0 30rpx;
  75. .list-item{
  76. width: 690rpx;
  77. padding: 24rpx 0;
  78. border-bottom: 1rpx solid #E0E0E0;
  79. &:last-child{
  80. border: 0;
  81. }
  82. .title{
  83. width: 690rpx;
  84. height: 42rpx;
  85. font-size: 30rpx;
  86. font-family: PingFangSC-Regular, PingFang SC;
  87. font-weight: 400;
  88. color: #333333;
  89. line-height: 42rpx;
  90. margin-bottom: 16rpx;
  91. display: flex;
  92. .blue{
  93. line-height: 42rpx;
  94. color: #2671E2;
  95. display: inline-block;
  96. }
  97. }
  98. .desc{
  99. font-size: 28rpx;
  100. font-family: PingFangSC-Regular, PingFang SC;
  101. font-weight: 400;
  102. color: #666666;
  103. line-height: 40rpx;
  104. }
  105. }
  106. }
  107. }
  108. </style>