limingtao 11 months ago
parent da1344605a
commit cbe8166381
  1. 4
      common/globalJs/globalJs.js
  2. 4
      components/bottom-button/three2.vue
  3. 6
      manifest.json
  4. 138
      pages/index/detail.vue
  5. 83
      pages/knowledge/index.vue

@ -2,8 +2,8 @@
// #ifdef APP-PLUS || MP
// const baseUrl = "http://116.62.210.143:9002";
// const baseUrl = "http://118.89.79.160:8800/HiatmpPro";
const baseUrl = "http://49.235.207.167:8800/HiatmpPro";
// const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro";
// const baseUrl = "http://49.235.207.167:8800/HiatmpPro";
const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro";
const chatUrl = "http://219.147.31.25:30001/hitap";
// #endif
// #ifdef H5

@ -119,7 +119,7 @@ export default {
box-sizing: border-box;
text-align: center;
border-radius: 10rpx;
line-height: 60rpx;
line-height: 75rpx;
.font {
position: absolute;
top: 0;
@ -128,7 +128,7 @@ export default {
width: 100%;
height: 100%;
text-align: center;
line-height: 60rpx;
line-height: 75rpx;
}
// cover-image {
// width: 100%;

@ -1,6 +1,6 @@
{
"name" : "隐患排查",
"appid" : "__UNI__79F6C5E",
"appid" : "__UNI__68B38F3",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -135,8 +135,8 @@
"https" : false,
"proxy" : {
"/HiatmpPro" : {
"target" : "http://49.235.207.167:8800",
// "target" : "http://219.147.31.25:30001/tht-app-api",
// "target" : "http://49.235.207.167:8800",
"target" : "http://219.147.31.25:30001/tht-app-api",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {

@ -25,98 +25,57 @@
<view class="stepBox">
<view class="step" v-for="(item, index) in tablist" :key="index">
<view class="stepItem">
<view
:class="{
<view :class="{
stepCircleActive: index <= active,
stepCircle: index > active,
}"
>{{ index + 1 }}
}">{{ index + 1 }}
</view>
<view
class="stepText"
:style="{ color: index <= active ? '#000000' : '#bcc3cd' }"
>{{ item.title }}
<view class="stepText" :style="{ color: index <= active ? '#000000' : '#bcc3cd' }">{{ item.title }}
</view>
</view>
<view v-if="index !== 3" class="circles">
<view
:class="{ circleActive: index < active, circle: index >= active }"
v-for="i in 8"
:key="i"
>
<view :class="{ circleActive: index < active, circle: index >= active }" v-for="i in 8" :key="i">
</view>
</view>
</view>
</view>
<scroll-view
scroll-y="true"
:scroll-top="scrollTop"
:style="{
<scroll-view scroll-y="true" :scroll-top="scrollTop" :style="{
height: isExpanded ? 'calc(100% - 350rpx)' : 'calc(100% - 250rpx)',
}"
class="chatlist"
id="scrollView"
ref="scrollView"
@click="clickContent"
>
<view
:class="['bar', item.answerId == '0' ? 'currAnswer' : '']"
v-for="(item, i) in msgList"
:key="item.id"
>
}" class="chatlist" id="scrollView" ref="scrollView" @click="clickContent">
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="(item, i) in msgList"
:key="item.id">
<!-- <image
:src="
item.answerId == '0' ? '/static/self.png' : '/static/left_user.png'
"
class="img"
/> -->
<image
:src="
<image :src="
item.answerId == '0'
? 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMu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LTRCd69opZq5CTS8SMOSr/L50juoR1Q/wXezDsV4mIn4fYenJF3v/l3i2DR/4Y0rZfMmkGTDMZ4UIj8hR6+i1KJUUuznkWCMuMVxqtA9JtBrJf7+Yag7Px0fJYjvcmy0F4+TZl90igyCCnoSKanvGSyLgpmYSGrJVBX5PFJSMIPAS5WDBHSwUgEwkYdMoA2J2g8u1/VfDG2hxN2McuuBuk9kWTStS7+BXwZioBnkugBrzF7iWoDbUfUJFmUgOAtxO1ofg07l4BqFIkhPzUF+lo3N2WGwKeYVudfOuEUbbVeRTlAOnuwSZrDlMRtpNyc/hfAQYAFFwdv9Iba+4AAAAASUVORK5CYII='
: '/static/left_user.png'
"
class="img"
/>
" class="img" />
<view class="content">
<view style="width: 100%; overflow: hidden;">
<zeroMarkdownView :markdown="item.data" />
</view>
<!-- <ua-markdown :source="mdvalue" /> -->
<view class="btnBox">
<view
class="btn"
@click="handleBtn(text)"
v-for="(text, index) in item.options"
:key="index"
>{{ text }}</view
>
<view class="btn" @click="handleBtn(text)" v-for="(text, index) in item.options" :key="index">
{{ text }}</view>
</view>
<view
v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 1"
style="display: flex; flex-wrap: wrap;"
>
<u-checkbox-group
v-model="item.checkboxValue1"
placement="column"
iconPlacement="right"
style="width: 100%; padding: 0 15px; box-sizing: border-box"
>
<u-checkbox
:customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in item.answerOptions"
:key="index"
:label="item"
:name="item"
style="background-color: #ededed;padding: 8px;"
>
<view v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 1"
style="display: flex; flex-wrap: wrap;">
<u-checkbox-group v-model="item.checkboxValue1" placement="column" iconPlacement="right"
style="width: 100%; padding: 0 15px; box-sizing: border-box">
<u-checkbox :customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in item.answerOptions" :key="index" :label="item" :name="item"
style="background-color: #ededed;padding: 8px;">
</u-checkbox>
</u-checkbox-group>
</view>
<view
v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 0"
style="display: flex; flex-wrap: wrap;"
>
<view v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 0"
style="display: flex; flex-wrap: wrap;">
<view v-for="(item, index) in item.answerOptions" :key="index"
style="padding: 8px 8px;margin:0 0 8px 8px;background-color: #ededed;"
@click="handleGroup(item)">
@ -139,10 +98,8 @@
</u-radio>
</u-radio-group> -->
</view>
<view
class="btnBox"
v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 1"
>
<view class="btnBox"
v-if="item.answerOptions && item.answerOptions.length > 0 && item.optionType == 1">
<view class="btn" @click="handleGroup(item)">确认</view>
<view class="btn" @click="handleGroup2(i)">清空</view>
</view>
@ -154,25 +111,12 @@
<view class="bounce-dot"></view>
</view>
</scroll-view>
<view
class="input-wrapper"
:class="{ 'input-wrapper-expanded': isExpanded }"
>
<view class="input-wrapper" :class="{ 'input-wrapper-expanded': isExpanded }">
<view class="topContent">
<input
class="uni-input"
placeholder="请输入内容"
:value="inputValue"
@confirm="handleSend"
@input="onKeyInput"
/>
<uni-icons
class="uni-icon"
type="plus"
size="30"
@click="handlePlus"
></uni-icons>
<input class="uni-input" placeholder="请输入内容" :value="inputValue" @confirm="handleSend"
@input="onKeyInput" />
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus"></uni-icons>
</view>
<view v-if="isExpanded" class="expanded">
<view @click="chooseImage" class="expandedItem">
@ -197,7 +141,9 @@ import zeroMarkdownView from "../../components/zeroMarkdownView/zeroMarkdownView
// EventSourcePolyfill
// } from 'event-source-polyfill';
import $ from "../../common/globalJs/globalJs.js";
import { fetchEventSource } from "@microsoft/fetch-event-source";
import {
fetchEventSource
} from "@microsoft/fetch-event-source";
// import {
// baseUrl
// } from '../../utils/config.js';
@ -210,8 +156,7 @@ export default {
data() {
return {
active: 0,
tablist: [
{
tablist: [{
title: "信息确认",
},
{
@ -333,14 +278,12 @@ export default {
this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0;
}
if (this.msgList.length == 0) {
this.msgList = [
{
this.msgList = [{
answerId,
data: res.result.data.content,
optionType: res.result.data?.optionType,
answerOptions: res.result.data?.answerOptions || [],
},
];
}, ];
} else {
// debugger
//
@ -446,8 +389,12 @@ console.log({
if (res && res.data && res.data.code == 200) {
// console.log('request success', res.data)
const { result = {} } = res.data;
const { data = {} } = result;
const {
result = {}
} = res.data;
const {
data = {}
} = result;
if (data.tabkey - 1 != this.active) {
this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0;
}
@ -761,6 +708,7 @@ console.log({
position: absolute;
right: -4px;
bottom: -36px;
.btn {
color: #497cca;
background-color: #d8e3f8;
@ -895,6 +843,7 @@ console.log({
}
@keyframes bounce {
0%,
80%,
100% {
@ -905,4 +854,7 @@ console.log({
transform: scale(1);
}
}
/deep/ ._img{
max-width:220rpx;
}
</style>

@ -1,9 +1,10 @@
<template>
<view class="detail">
<scroll-view @scroll="handleScroll" scroll-y="true" :scroll-top="scrollTop" :style="{
<view class="detail" @touchmove="handleTouchMove">
<scroll-view scroll-y="true" :scroll-top="scrollTop" :style="{
height: isExpanded ? 'calc(100% - 1rpx)' : 'calc(100% - 1rpx)',
}" class="chatlist" :class="{ 'chatlist-wrapper-expanded': isExpanded }" id="scrollView" ref="scrollView"
@click="clickContent">
@click="clickContent"
>
<view v-if="!msgList.length" class="helloContent">
<image :src="$.imgSrc + '/left_user.png'" class="imgLeft" />
<view class="titleBox">
@ -26,7 +27,8 @@
</view>
</view>
</view>
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="item in msgList" :key="item.id">
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="(item,index) in msgList"
:key="item.id">
<!--<image :src="item.answerId == '0' ? $.imgSrc + '/self.png' : $.imgSrc + '/left_user.png'" class="img" />-->
<image :src="
item.answerId == '0'
@ -38,15 +40,13 @@
<!-- <ua-markdown :source="mdvalue" /> -->
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess">
<uni-icons
:type="iconsType == '' ? 'hand-up' : (iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')"
:color="iconsType == 'handUp' ? '#FFD131' : ''"
size="22"
@click="clickIcon('handUp', item.qaId)">
:type="item.iconsType == '' ? 'hand-up' : (item.iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')"
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" size="22"
@click="clickIcon('handUp', item.qaId,index)">
</uni-icons>
<uni-icons
:type="iconsType == '' ? 'hand-down' : (iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')"
size="22"
@click="clickIcon('handDown', item.qaId)">
:type="item.iconsType == '' ? 'hand-down' : (item.iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')"
size="22" @click="clickIcon('handDown', item.qaId,index)">
</uni-icons>
</view>
</view>
@ -139,6 +139,7 @@
lastScrollTop: 0, //
temp: 0,
iconsType: '',
isUserScrolling: false,
};
},
onLoad() {
@ -166,21 +167,26 @@
}
},
methods: {
async clickIcon(type, qaId) {
async clickIcon(type, qaId, index) {
if (this.iconsType == '') {
this.iconsType = type
this.$set(this.msgList[index], 'iconsType', type)
} else {
if (this.iconsType == 'handUp') {
if (type == 'handUp') {
this.iconsType = ''
this.$set(this.msgList[index], 'iconsType', '')
} else {
this.iconsType = 'handDown'
this.$set(this.msgList[index], 'iconsType', 'handDown')
}
} else {
if (type == 'handUp') {
this.$set(this.msgList[index], 'iconsType', 'handUp')
this.iconsType = 'handUp'
} else {
this.iconsType = ''
this.$set(this.msgList[index], 'iconsType', '')
}
}
}
@ -209,51 +215,40 @@
});
},
handleTouchStart(e) {
// this.isUserScrolling = true;
//
this.startX = e.touches[0].clientX;
this.startY = e.touches[0].clientY;
// this.isScrolling = false; //
// this.startX = e.touches[0].clientX;
// this.startY = e.touches[0].clientY;
// // this.isScrolling = false; //
},
handleTouchMove(e) {
//
let moveX = e.touches[0].clientX;
let moveY = e.touches[0].clientY;
//
let deltaX = moveX - this.startX;
let deltaY = moveY - this.startY;
// 5px
if (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5) {
// this.isScrolling = true; //
console.log(e)
// this.isUserScrolling = true
this.isHandleScroll = false
// deltaY
if (deltaY > 0) {
console.log('用户正在向下滑动');
} else if (deltaY < 0) {
console.log('用户正在向上滑动');
}
// startXstartYmoveXmoveY
//
}
// startXstartY
//
// this.startX = e.touches[0].clientX;
// this.startY = e.touches[0].clientY;
// // this.isScrolling = false; //
},
handleTouchEnd(e) {
// this.isUserScrolling = true;
// setTimeout(() => {
// this.isUserScrolling = false;
// }, 300); //
//
// startXstartY
//
},
handleScroll(event) {
console.log(event)
// event.detail
const scrollTop = event.detail.scrollTop;
if (scrollTop > this.lastScrollTop) {
console.log('向下滑动');
// this.temp=0
} else {
this.temp++
if (this.temp == 2) {
if (this.temp == 2&&this.isUserScrolling) {
this.isHandleScroll = false
}
@ -341,6 +336,7 @@
}
this.temp = 0
this.isHandleScroll = true
this.isUserScrolling = false
this.changeMsgList("0", this.inputValue || text);
this.queryChat(this.inputValue || text);
this.inputValue = "";
@ -817,6 +813,8 @@
.titleTwo {
margin: 15rpx 0;
font-size: 28rpx;
font-size: 28rpx;
line-height: 42rpx;
}
.tipItem {
@ -831,12 +829,13 @@
.text {
font-size: 28rpx;
// line-height:50rpx;
}
}
}
.text {
font-size: 32rpx;
font-size: 28rpx;
}
}
@ -1098,10 +1097,12 @@
color: #999999 !important;
}
}
.icon {
display: flex;
justify-content: flex-end;
margin: 0 15rpx 15rpx 12rpx;
.uni-icons {
margin-left: 15rpx;
}

Loading…
Cancel
Save