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.
 
 
 

196 lines
5.2 KiB

  1. <template>
  2. <view class="translation">
  3. <view class="cont-box" v-for="(item, index) in listarr" :key="index"
  4. @click="toaidoinfo(item.Content, item.corpusId, item.index)">
  5. <view class="top-cont">
  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="
  10. color: #666666;
  11. font-size: 28rpx;
  12. line-height: 36rpx;
  13. margin-left: 10rpx;
  14. width: 80%;
  15. "></view>
  16. <view style="font-size: 28rpx; width: 10%; width: 14%; text-align: right">{{ item.Content.time }}</view>
  17. </view>
  18. <!-- 1 客户画像 2销讲词 3违禁 4 需求挖掘 -->
  19. <view class="newmark" v-if="item.Content.types">
  20. <view class="mark-item" v-for="(subitem,i) in dealTypes(item.Content.types)" :key="i">
  21. <image v-if="dealword(subitem)[0]==1" class="markicon"
  22. src="https://static.quhouse.com/37e0de3f8d1c421dac8bf699d5e7992d.png"></image>
  23. <image v-if="dealword(subitem)[0]==2" class="markicon"
  24. src="https://static.quhouse.com/b106e8e75db24a59a579a15a78830a76.png"></image>
  25. <image v-if="dealword(subitem)[0]==3" class="markicon"
  26. src="https://static.quhouse.com/8443a2ecb81d4639991ab29c422e9949.png"></image>
  27. <image v-if="dealword(subitem)[0]==4" class="markicon"
  28. src="https://static.quhouse.com/1cd794cb6c974d9dad948a6dd444518b.png"></image>
  29. <view class="marktext" :style="dealword(subitem)[0]==3?'color:#E7483C':'color:#3E50E8'">
  30. {{dealword(subitem)[1]}}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. var util = require("../../utils/util.js");
  39. var config = require("../../config");
  40. export default {
  41. data() {
  42. return {
  43. customerId: "",
  44. listarr: [],
  45. id: "",
  46. type: "",
  47. tipsFncName: "", // 提醒页面变更的值
  48. from: "", // 标记需要刷新的来源
  49. };
  50. },
  51. onLoad: function(options) {
  52. this.customerId = options.customerId;
  53. this.id = options.id;
  54. this.type = options.type;
  55. if (options.UpDateEvent) this.tipsFncName = options.UpDateEvent;
  56. if (options.from) this.from = options.from;
  57. this.searchinfo();
  58. },
  59. methods: {
  60. // 对话加命中标签
  61. dealTypes(type) {
  62. if (type) {
  63. let tem = type.substring(1).split(',')
  64. return tem
  65. } else {
  66. return []
  67. }
  68. },
  69. // 对话加命中标签
  70. dealword(type) {
  71. if (type) {
  72. let a = type.split('-')
  73. let rest = type.substring(2).split('-').join(',')
  74. let arr = [a[0], rest]
  75. return arr
  76. } else {
  77. return []
  78. }
  79. },
  80. formatTime(num) {
  81. //格式化时间格式
  82. num = num.toFixed(0);
  83. let second = num % 60;
  84. if (second < 10) second = "0" + second;
  85. let min = Math.floor(num / 60);
  86. if (min < 10) min = "0" + min;
  87. return min + ":" + second;
  88. },
  89. //搜索
  90. searchinfo() {
  91. let parames = {
  92. marketingId: this.id,
  93. customerId: this.customerId,
  94. type: this.type,
  95. };
  96. this.$u.post("/corpus/pinWordMatching", parames).then((res) => {
  97. res.forEach((item) => {
  98. item.Content = JSON.parse(item.transferContent);
  99. });
  100. res.forEach((cet) => {
  101. cet.Content.time = this.formatTime(cet.Content.bg / 1000);
  102. });
  103. this.listarr = res;
  104. // console.log(this.listarr);
  105. });
  106. },
  107. //跳转
  108. toaidoinfo(item, id, index) {
  109. item.customerId = this.customerId;
  110. item.id = id;
  111. item.index = index;
  112. this.infostust(item);
  113. },
  114. //只有一条的时候
  115. infostust(item) {
  116. console.log("zobudao");
  117. let d = JSON.parse(JSON.stringify([item]));
  118. d[0].onebest = "";
  119. // console.log(d);
  120. const parames = {
  121. pageNum: 1,
  122. pageSize: 100,
  123. query: {
  124. customerId: this.customerId,
  125. },
  126. };
  127. this.$u.post("/corpus/findByPage", parames).then((res) => {
  128. uni.setStorageSync("entrance", 2); //写入缓存
  129. uni.setStorageSync("searchobj", d[0]); //写入缓存
  130. if (res[0].merge == 0) {
  131. let newobj = res[0];
  132. if (this.tipsFncName) {
  133. uni.$emit(this.tipsFncName, d[0]);
  134. uni.$emit("newobjStatus", newobj.status);
  135. uni.navigateBack();
  136. return;
  137. }
  138. uni.navigateTo({
  139. url: `/pages/mine/details2?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${"2"}`
  140. });
  141. } else {
  142. let newobj = res[0];
  143. uni.navigateTo({
  144. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(d[0])}&stateisshow=${"2"}`
  145. });
  146. }
  147. });
  148. },
  149. },
  150. };
  151. </script>
  152. <style lang="scss" scoped>
  153. .translation {
  154. width: 100%;
  155. padding: 0 30rpx;
  156. .cont-box {
  157. width: 100%;
  158. margin-bottom: 20rpx;
  159. .top-cont {
  160. display: flex;
  161. border-bottom: 1px solid #e0e0e0;
  162. }
  163. .newmark {
  164. margin-top: 20rpx;
  165. padding-left: 30rpx;
  166. .mark-item {
  167. display: flex;
  168. flex-wrap: wrap;
  169. margin-bottom: 12rpx;
  170. .markicon {
  171. width: 30rpx;
  172. height: 30rpx;
  173. margin-right: 12rpx;
  174. }
  175. .marktext {
  176. flex: 1;
  177. font-size: 24rpx;
  178. font-family: PingFangSC-Regular, PingFang SC;
  179. font-weight: 400;
  180. color: #3E50E8;
  181. min-height: 30rpx;
  182. line-height: 30rpx;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>