|
- <template>
- <view class="translation">
- <view
- class="cont-box"
- v-for="(item, index) in listarr"
- :key="index"
- @click="toaidoinfo(item.Content, item.corpusId, item.index)"
- >
- <view class="top-cont">
- <view style="width: 26rpx; height: 36rpx; margin-top: 4rpx">
- <image
- style="width: 26rpx; height: 28rpx"
- src="../../static/images/testimg.png"
- mode=""
- ></image>
- </view>
- <view
- v-html="item.Content.onebest"
- style="
- color: #666666;
- font-size: 28rpx;
- line-height: 36rpx;
- margin-left: 10rpx;
- width: 80%;
- "
- ></view>
- <view style="font-size: 28rpx; width: 10%; width: 14%; text-align: right"
- >{{ item.Content.time }}</view>
- </view>
- <!-- 1 客户画像 2销讲词 3违禁 4 需求挖掘 -->
- <view class="newmark" v-if="item.Content.types">
- <view class="mark-item" v-for="(subitem,i) in dealTypes(item.Content.types)" :key="i">
- <image v-if="dealword(subitem)[0]==1" class="markicon" src="https://static.quhouse.com/37e0de3f8d1c421dac8bf699d5e7992d.png"></image>
- <image v-if="dealword(subitem)[0]==2" class="markicon" src="https://static.quhouse.com/b106e8e75db24a59a579a15a78830a76.png"></image>
- <image v-if="dealword(subitem)[0]==3" class="markicon" src="https://static.quhouse.com/8443a2ecb81d4639991ab29c422e9949.png"></image>
- <image v-if="dealword(subitem)[0]==4" class="markicon" src="https://static.quhouse.com/1cd794cb6c974d9dad948a6dd444518b.png"></image>
- <view class="marktext" :style="dealword(subitem)[0]==3?'color:#E7483C':'color:#3E50E8'">{{dealword(subitem)[1]}}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- var util = require("../../utils/util.js");
- var config = require("../../config");
- export default {
- data() {
- return {
- customerId: "",
- listarr: [],
- id: "",
- type: "",
- tipsFncName: "", // 提醒页面变更的值
- from: "", // 标记需要刷新的来源
- };
- },
- onLoad: function (options) {
- this.customerId = options.customerId;
- this.id = options.id;
- this.type = options.type;
- if (options.UpDateEvent) this.tipsFncName = options.UpDateEvent;
- if (options.from) this.from = options.from;
- this.searchinfo();
- },
- methods: {
- // 对话加命中标签
- dealTypes(type){
- if(type){
- let tem = type.substring(1).split(',')
- return tem
- }else{
- return []
- }
- },
- // 对话加命中标签
- dealword(type){
- if(type){
- let a = type.split('-')
- let rest = type.substring(2).split('-').join(',')
- let arr =[a[0],rest]
- return arr
- }else{
- return []
- }
- },
- formatTime(num) {
- //格式化时间格式
- num = num.toFixed(0);
- let second = num % 60;
- if (second < 10) second = "0" + second;
- let min = Math.floor(num / 60);
- if (min < 10) min = "0" + min;
- return min + ":" + second;
- },
- //搜索
- searchinfo() {
- let parames = {
- marketingId: this.id,
- customerId: this.customerId,
- type: this.type,
- };
- this.$u.post("/corpus/pinWordMatching", parames).then((res) => {
- res.forEach((item) => {
- item.Content = JSON.parse(item.transferContent);
- });
- res.forEach((cet) => {
- cet.Content.time = this.formatTime(cet.Content.bg / 1000);
- });
- this.listarr = res;
- // console.log(this.listarr);
- });
- },
- //跳转
- toaidoinfo(item, id, index) {
- item.customerId = this.customerId;
- item.id = id;
- item.index = index;
- this.infostust(item);
- },
- //只有一条的时候
- infostust(item) {
- console.log("zobudao");
- let d = JSON.parse(JSON.stringify([item]));
- d[0].onebest = "";
- // console.log(d);
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- customerId: this.customerId,
- },
- };
- this.$u.post("/corpus/findByPage", parames).then((res) => {
- uni.setStorageSync("entrance", 2); //写入缓存
- uni.setStorageSync("searchobj", d[0]); //写入缓存
- if (res[0].merge == 0) {
- let newobj = res[0];
- if (this.tipsFncName) {
- uni.$emit(this.tipsFncName, d[0]);
- uni.$emit("newobjStatus", newobj.status);
- uni.navigateBack();
- return;
- }
-
- uni.navigateTo({
- url: `/pages/mine/details2?customerId=${newobj.customerId}&status=${
- newobj.status
- }&itemobj=${JSON.stringify(d[0])}&stateisshow=${"2"}`,
- });
- } else {
- let newobj = res[0];
- uni.navigateTo({
- url: `/pages/mine/details?customerId=${newobj.customerId}&status=${
- newobj.status
- }&itemobj=${JSON.stringify(d[0])}&stateisshow=${"2"}`,
- });
- }
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .translation {
- width: 100%;
- padding: 0 30rpx;
- .cont-box {
- width: 100%;
- margin-bottom: 20rpx;
- .top-cont{
- display: flex;
- border-bottom: 1px solid #e0e0e0;
- }
- .newmark {
- margin-top: 20rpx;
- padding-left: 30rpx;
- .mark-item{
- display: flex;
- flex-wrap: wrap;
- margin-bottom: 12rpx;
- .markicon {
- width: 30rpx;
- height: 30rpx;
- margin-right: 12rpx;
- }
- .marktext{
- flex:1;
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #3E50E8;
- min-height: 30rpx;
- line-height: 30rpx;
- }
- }
- }
- }
- }
- </style>
|