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.
 
 
 

117 rader
3.3 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. type:'',
  25. tipsFncName: '', // 提醒页面变更的值
  26. from: '', // 标记需要刷新的来源
  27. };
  28. },
  29. onLoad: function(options) {
  30. this.customerId = options.customerId;
  31. this.id=options.id;
  32. this.type=options.type;
  33. if (options.UpDateEvent) this.tipsFncName = options.UpDateEvent
  34. if (options.from) this.from = options.from
  35. this.searchinfo()
  36. },
  37. methods: {
  38. formatTime(num) {
  39. //格式化时间格式
  40. num = num.toFixed(0);
  41. let second = num % 60;
  42. if (second < 10) second = '0' + second;
  43. let min = Math.floor(num / 60);
  44. if (min < 10) min = '0' + min;
  45. return min + ":" + second;
  46. },
  47. //搜索
  48. searchinfo(){
  49. let parames={
  50. marketingId:this.id,
  51. customerId:this.customerId,
  52. type:this.type
  53. }
  54. this.$u.post("/corpus/pinWordMatching", parames).then(res => {
  55. res.forEach(item=>{
  56. item.Content=JSON.parse(item.transferContent)
  57. })
  58. res.forEach(cet=>{
  59. cet.Content.time=this.formatTime(cet.Content.bg/1000)
  60. })
  61. this.listarr=res;
  62. })
  63. },
  64. //跳转
  65. toaidoinfo(item,id,index){
  66. item.customerId=this.customerId;
  67. item.id=id;
  68. item.index=index;
  69. this.infostust(item)
  70. },
  71. //只有一条的时候
  72. infostust(item){
  73. console.log("zobudao")
  74. let d = JSON.parse(JSON.stringify([item]))
  75. d[0].onebest="";
  76. console.log(d)
  77. const parames = {
  78. pageNum: 1,
  79. pageSize: 100,
  80. query: {
  81. customerId: this.customerId,
  82. }
  83. }
  84. this.$u.post("/corpus/findByPage", parames).then(res => {
  85. uni.setStorageSync("entrance", 2); //写入缓存
  86. uni.setStorageSync("searchobj", d[0]); //写入缓存
  87. if(res[0].merge==0){
  88. let newobj = res[0];
  89. if (this.tipsFncName) {
  90. uni.$emit(this.tipsFncName, d[0])
  91. uni.$emit('newobjStatus', newobj.status)
  92. uni.navigateBack()
  93. return
  94. }
  95. uni.navigateTo({
  96. url: `/pages/mine/details2?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${'2'}`
  97. })
  98. }else{
  99. let newobj = res[0];
  100. uni.navigateTo({
  101. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${'2'}`
  102. })
  103. }
  104. })
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. </style>