Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

110 rader
3.1 KiB

  1. <template>
  2. <view class="translation">
  3. <view style="width: 690rpx;margin: 0 auto;margin-top: 10rpx;">
  4. <view style="width: 100%;border-bottom: 1px solid #E0E0E0;display: flex;padding-bottom: 10rpx;margin-top: 40rpx;"
  5. v-for="(item,index) in listarr" :key='index' @click="toaidoinfo(item.Content,item.corpusId,item.index)">
  6. <view style="width: 26rpx;height: 36rpx;margin-top: 4rpx;">
  7. <image style="width: 26rpx;height: 28rpx;" src="../../../static/images/testimg.png" mode=""></image>
  8. </view>
  9. <view v-html="item.Content.onebest" style="color: #666666;font-size: 28rpx;line-height: 36rpx;margin-left: 10rpx;width: 80%;"></view>
  10. <view style="font-size: 28rpx;width: 10%;width: 14%;text-align: right;">{{item.Content.time}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. var util = require("../../../utils/util.js");
  17. var config = require("../../../config");
  18. export default {
  19. data() {
  20. return {
  21. customerId:'',
  22. listarr:[],
  23. id:'',
  24. tipsFncName: '', // 提醒页面变更的值
  25. from: '', // 标记需要刷新的来源
  26. };
  27. },
  28. onLoad: function(options) {
  29. this.customerId = options.customerId;
  30. this.id=options.id;
  31. if (options.UpDateEvent) this.tipsFncName = options.UpDateEvent
  32. if (options.from) this.from = options.from
  33. this.searchinfo()
  34. },
  35. methods: {
  36. formatTime(num) {
  37. //格式化时间格式
  38. num = num.toFixed(0);
  39. let second = num % 60;
  40. if (second < 10) second = '0' + second;
  41. let min = Math.floor(num / 60);
  42. if (min < 10) min = '0' + min;
  43. return min + ":" + second;
  44. },
  45. //搜索
  46. searchinfo(){
  47. let parames={
  48. marketingId:this.id,
  49. customerId:this.customerId
  50. }
  51. this.$u.post("/corpus/pinWordMatching", parames).then(res => {
  52. res.forEach(item=>{
  53. item.Content=JSON.parse(item.transferContent)
  54. })
  55. res.forEach(cet=>{
  56. cet.Content.time=this.formatTime(cet.Content.bg/1000)
  57. })
  58. this.listarr=res;
  59. })
  60. },
  61. //跳转
  62. toaidoinfo(item,id,index){
  63. item.customerId=this.customerId;
  64. item.id=id;
  65. item.index=index;
  66. this.infostust(item)
  67. },
  68. //只有一条的时候
  69. infostust(item){
  70. console.log("zobudao")
  71. let d = JSON.parse(JSON.stringify([item]))
  72. d[0].onebest=""
  73. const parames = {
  74. pageNum: 1,
  75. pageSize: 100,
  76. query: {
  77. customerId: this.customerId,
  78. }
  79. }
  80. this.$u.post("/corpus/findByPage", parames).then(res => {
  81. if(res[0].merge==0){
  82. let newobj = res[0];
  83. if (this.tipsFncName) {
  84. uni.$emit(this.tipsFncName, d[0])
  85. uni.$emit('newobjStatus', newobj.status)
  86. uni.navigateBack()
  87. return
  88. }
  89. uni.navigateTo({
  90. url: `/pages/main/details2?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${'2'}`
  91. })
  92. }else{
  93. let newobj = res[0];
  94. uni.navigateTo({
  95. url: `/pages/main/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${'2'}`
  96. })
  97. }
  98. })
  99. },
  100. },
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. </style>