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.
 
 
 

201 lines
5.7 KiB

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