no message

cyl/master-apply
jscyl13849007907 2 months ago
parent 98bdd5b05e
commit 3db3ee6104

@ -1,262 +0,0 @@
<template>
<div class="g_p_10 g_position_rela">
<div class="g_bg_f g_p_10 g_radius_8">
<u-line-progress class="g_position_abso" v-if="ailoading" style="position: fixed; width: 100%; top: -2px; left: 0px; z-index: 99999" active-color="#3578f6" :percent="defaultPercent" :round="false" height="8" :show-percent="false" inactiveColor="#f5f5f5"></u-line-progress>
<gao-ChatSSEClient ref="sseTest" @onOpen="openCore" @onError="errorCore" @onMessage="messageCore" @onFinish="finishCore" />
<div class="g_pb_8" v-if="currentImg" @click="currentImg = ''">
<img :src="currentImg" class="g_w_48 g_h_48 g_radius_8" alt />
</div>
<textarea class data-type="desp" v-model="aitext" placeholder="粘贴工友信息, 用AI识别 " placeholder-style="color:#999" :maxlength="-1" :style="{ width: '100%', 'height': true ? '84px' : '84px' }"></textarea>
<div class>
<view class="g_flex_row_end flex_center">
<view class="iconfont icon-jia1 g_c_9 g_mr_8 g_fs_20 g_position_rela biggerSize" @click="chooseImgShow = true"></view>
<view class="g_mr_8 g_w_72 g_fw_600">
<rh-button primaryColor='#00b666' size="small_auto" type="default" height="24" :fontSize="12" @clickBtn="getClipboard" :btnText="(aitext ? '清空' : '粘贴') + '内容'"></rh-button>
</view>
<view class="g_w_72 g_fw_600">
<rh-button primaryColor='#00b666' size="small_auto" gradual="linear-gradient(-130deg, #5c6cf7, #9963f9)" icon="icon-aitubiao" type="gradual" height="24" :fontSize="12" btnText="AI识别" @clickBtn="getCoze"></rh-button>
</view>
</view>
</div>
</div>
<u-popup v-model="chooseImgShow" mode="bottom" z-index="999999" border-radius="12" :closeable="false" :mask-close-able="true" @close="chooseImgShow = false">
<div class="g_text_c g_bg_f_5 g_fs_17">
<div class="g_bg_f">
<div class="g_c_3">
<div class="g_p_16 g_border_e_t" @click="uploadPhoto('camera')"></div>
<div class="g_p_16 g_border_e_t" @click="uploadPhotoByChat"></div>
<div class="g_p_16 g_border_e_t" @click="uploadPhoto('album')"></div>
</div>
</div>
<div class="g_p_16 g_mt_10 g_bg_f" style="padding-bottom: calc(constant(safe-area-inset-bottom) + 16px); padding-bottom: calc(env(safe-area-inset-bottom) + 16px)" @click="chooseImgShow = false">取消</div>
</div>
</u-popup>
</div>
</template>
<script>
export default {
data() {
return {
aitext: "",
timer: null,
timer1: null,
defaultPercent: 0,
ailoading: false,
aiConfig: {
token: "",
id: "",
},
chooseImgShow: false,
currentImg: "",
};
},
created() {
this.getAiToken();
},
methods: {
openCore(respons) {
// console.log("open sse", respons);
},
errorCore(err) {
// console.log("error sse", err);
},
messageCore(msg) {
let that = this;
// console.log("message sse", msg);
if (msg.event == "Done") {
clearInterval(that.timer);
that.ailoading = false;
} else if (msg.event == "Message") {
let info = JSON.parse(msg.data);
if (info.node_type == "End") {
this.setInfo(info);
}
}
},
getAiToken() {
let that = this;
that.G.Get("/yishoudan/common/structure/getConfig", {}, (res) => {
// console.log("res", res);
that.aiConfig = {
token: res.token,
id: res.workflowId,
};
});
},
uploadPhoto($sourceType) {
let that = this;
// console.log("$sourceType", $sourceType);
uni.chooseImage({
count: 1, //9
sizeType: ["original"], //
sourceType: [$sourceType], //album camera 使
success: function (res) {
// console.log("", res);
that.uploadCozeFile(res.tempFilePaths[0]);
},
});
},
uploadCozeFile(tempFilePath) {
let that = this;
that.chooseImgShow = false;
that.currentImg = tempFilePath;
uni.uploadFile({
url: "https://api.coze.cn/v1/files/upload",
method: "POST",
filePath: tempFilePath,
name: "file",
header: {
Authorization: "Bearer " + that.aiConfig.token,
"Content-Type": "multipart/form-data",
},
formData: {},
success: function (res) {
// console.log("", res);
let data = JSON.parse(res.data);
that.appCoze(data.data.id);
},
fail: function (err) {
// console.log(err);
},
});
},
uploadPhotoByChat() {
let that = this;
uni.chooseMessageFile({
count: 1,
type: "image",
success(res) {
// console.log("resresresresresres", res);
if (res.errMsg == "chooseMessageFile:ok") {
// console.log("res", res);
that.uploadCozeFile(res.tempFiles[0].path);
}
},
});
},
getClipboard() {
let that = this;
if (this.aitext) {
this.aitext = "";
} else {
uni.getClipboardData({
success(res) {
// console.log(res);
if (res.data) {
that.aitext = res.data;
} else {
uni.showToast({
title: "请先复制内容",
icon: "none",
});
}
},
fail() {
uni.showToast({
title: "读取剪切板失败",
icon: "none",
});
},
});
}
},
setInfo(parsed) {
let that = this;
const finalData = JSON.parse(parsed.content);
if (finalData) {
// console.log(":", finalData);
let info = {
idCard: finalData.idcard,
address: finalData.address,
name: finalData.username,
nation: finalData.nation,
userName: finalData.username,
sex: finalData.sex ? (finalData.sex == "男" ? 1 : 2) : "",
age: finalData.age,
tel: finalData.tel,
};
// uni.$emit('getTownsman', { info })
that.$emit("outputInfo", info);
//
that.ailoading = false;
} else {
that.ailoading = false;
}
clearInterval(that.timer);
},
getCoze() {
let that = this;
if (!that.aitext) {
uni.showToast({
title: "请粘贴内容",
icon: "none",
});
return false;
}
this.appCoze();
},
appCoze(_id) {
let that = this;
let parameters = {};
//
that.ailoading = true;
that.defaultPercent = 3;
that.timer = setInterval(() => {
that.defaultPercent = that.defaultPercent < 15 ? (that.defaultPercent = 15) : that.defaultPercent + 3;
// // console.log('12313123123123123')
if (that.defaultPercent >= 99) {
clearInterval(that.timer);
}
}, 150);
that.timer1 = setTimeout(() => {
// console.log("5687678678678678678");
that.ailoading = false;
clearInterval(that.timer);
// setLoading()
}, 30000);
if (_id) {
parameters = {
img: {
file_id: _id,
},
};
} else {
parameters = {
txt: that.aitext,
};
}
this.$refs.sseTest.startChat({
/**
* 将它换成你的地址
* 注意
* 如果使用 sse-server.js 要在手机端使用的话请确保你的手机和电脑处在一个局域网下并且是正常的ip地址
*/
url: "https://api.coze.cn/v1/workflow/stream_run",
//
headers: {
// that.aiConfig.token
Authorization: "Bearer " + that.aiConfig.token,
"Content-Type": "application/json",
},
// post
method: "post",
body: {
parameters,
// workflow_id: that.aiConfig.id,
workflow_id: "7520814905613664310",
// workflow_id: '7492238568816656410',
},
});
},
ressetAitext() {
this.aitext = "";
},
},
};
</script>
<style></style>

@ -1,11 +0,0 @@
<template>
<div class="p-apply-form" data-remark=''>
</div>
</template>
<script>
</script>
<style>
</style>

@ -1,9 +1,9 @@
<template>
<view :class="isLogin ? '' : 'm-login-false'">
<g-loading paddingBottom="g_pb_120" v-if="loading && speed == -1" />
<rh-loading paddingBottom="g_pb_120" v-if="loading && speed == -1" />
<view class="m-panel" :class="!loading && speed == 0 ? 'g_bg_f_5' : ''">
<view class="link" :class="!loading && speed == 0 ? '' : ''">
<!-- <g-loading bg="#ededed" v-if="loading && speed == -1" /> -->
<!-- <rh-loading bg="#ededed" v-if="loading && speed == -1" /> -->
<view v-if="!loading && speed == 0 && isLogin" style="background-color: #ededed">
<view>
<view class="g_h_100"></view>

@ -1,6 +1,6 @@
<template>
<view class="g-components-yi-list-job g_bg_f_5">
<g-loading paddingBottom="g_pb_120" v-if="loading && speed == -1" />
<rh-loading paddingBottom="g_pb_120" v-if="loading && speed == -1" />
<!-- loading && speed == -1 -->
<view v-if="!loading && speed == 0 && isLogin" style="width: calc(100% - 20px); margin: 0 auto" class="g_h_all g_flex_row_center">
<!-- <view class="g_h_all" style="" v-if="!isLogin">

@ -1,52 +0,0 @@
<template>
<view
class="g-components-loading g_w_all g_h_all g_flex_c"
:style="{
'min-height': minHeight ? minHeight + 'rpx' : '0rpx',
'background-color':bg ? bg : 'auto'
}"
>
<view :class="paddingBottom">
<view class="g_flex_row_center g_mb_10">
<u-loading mode="circle" color="#00B666"></u-loading>
</view>
<view class="g_fs_14 g_c_9 g_flex_row_center" v-if="text != 'empty'">{{ text }}</view>
</view>
</view>
</template>
<script>
/* 自定义loading */
export default {
props: {
loading: {
type: Boolean,
default: () => {
return true;
},
},
minHeight: {
default: () => {
return 500;
},
},
text: {
default: () => {
return "加载中...";
},
},
paddingBottom: { // loading
default: () => {
return 0;
},
},
bg:{
default: () => {
return 'auto';
},
}
},
};
</script>
<style lang="scss"></style>

@ -57,7 +57,7 @@
</view>
</view>
<view v-if="speed == 0" class="g_flex_c g_h_28">
<g-loading minHeight="0" text="empty" />
<rh-loading minHeight="0" text="empty" />
</view>
</view>
<!-- 高度比较高的情况 -->
@ -85,7 +85,7 @@
</view>
</view>
<view v-if="speed == 0" class="g_flex_c g_h_48">
<g-loading minHeight="0" text="empty" />
<rh-loading minHeight="0" text="empty" />
</view>
</view>
<view class="g_flex_row_center g_fs_14 g_c_6 g_mt_2" :class="[`g_mb_${marginBottom}`]">{{ item.name }}</view>
@ -105,11 +105,7 @@
<script>
/*
*/
import gLoading from "@/components/loading.vue";
export default {
components: {
gLoading,
},
data() {
return {
cdnBaseImg: this.G.store().cdnBaseImg,

@ -8,7 +8,6 @@ import wyyx from './utils/wyyx.js';
import apiInfo from './api/index.js';
// import gTabbar from './components/customTabbar.vue';
import gLoading from './components/loading.vue';
import gListJob from './components/list/job.vue';
import gListApply from './components/list/apply.vue';
import gPanelFormItem from './components/panel/formItem.vue';
@ -24,7 +23,6 @@ export function createApp () {
app.config.productionTip = false;
// app.component('g-tabbar', gTabbar);
app.component('g-loading', gLoading);
app.component('g-list-job', gListJob);
app.component('g-list-apply', gListApply);
app.component('g-panel-form-item', gPanelFormItem);

@ -1,7 +1,7 @@
<template>
<div class="p-home-inedx g_w_all g_bg_f_5 g_kuaishou" :class="computeCode == -1 ? 'g_flex_column_center' : ''">
<div v-show="computeCode == -1" class="g_flex_column_center">
<g-loading marginBottom="g_mb_130" />
<rh-loading marginBottom="g_mb_130" />
</div>
<view class="g_h_all" v-show="!isLogin">
<rh-login-false-list />

@ -42,7 +42,7 @@
<view class="tip g_w_16 g_h_16 g_bg_f0a g_c_f g_flex_c g_fs_14 g_radius_50">{{ waitNum_ups }}</view>
</view>
</view>
<g-loading :loading="loading" v-if="loading && speed == -1" />
<rh-loading :loading="loading" v-if="loading && speed == -1" />
<view v-if="!loading && speed == 0 && inviteNum <= 0" class="g_pt_130" style="padding-top: 130px">
<rh-empty :text="isLogin ? '暂无数据' : '请登录'" />
</view>

@ -1,6 +1,6 @@
<template>
<view class="p-root-bind-apply g_w_all g_h_all g_bg_f_5 g_kuaishou">
<g-loading :loading='loading' v-if="loading && speed == -1"/>
<rh-loading :loading='loading' v-if="loading && speed == -1"/>
<view class="g_pt_130" v-if="!loading && speed == 0">
<rh-empty />
</view>

@ -19,7 +19,7 @@
<!-- 列表区 -->
<view class="m-list">
<view class="link" :class="isShow ? '' : ''">
<g-loading :loading="loading" v-if="loading && speed == -1" />
<rh-loading :loading="loading" v-if="loading && speed == -1" />
<view v-if="!loading && speed == 0" class="g_pt_130">
<rh-empty :text="isLogin ? '暂无数据' : '请登录'" />
</view>

@ -46,7 +46,7 @@
<view class="tip g_w_16 g_h_16 g_bg_f0a g_c_f g_flex_c g_fs_14 g_radius_50">{{ waitNum_ups }}</view>
</view>
</view>
<g-loading :loading="loading" v-if="loading && speed == -1" />
<rh-loading :loading="loading" v-if="loading && speed == -1" />
<view v-if="!loading && speed == 0" class="g_pt_130">
<rh-empty :text="isLogin ? '暂无数据' : '请登录'" />
</view>

@ -32,7 +32,7 @@
<view class="tip g_w_16 g_h_16 g_bg_f0a g_c_f g_flex_c g_fs_14 g_radius_50">{{ waitNum_ups }}</view>
</view>
</view>
<g-loading :loading="loading" v-if="loading && speed == -1" />
<rh-loading :loading="loading" v-if="loading && speed == -1" />
<view v-if="!loading && speed == 0 && inviteNum <= 0" class="g_pt_130" style="padding-top:130px">
<rh-empty :text="isLogin ? '暂无数据' : '请登录'" />
</view>

@ -1,7 +1,7 @@
<template>
<view class="p-root-detail-apply g_w_all g_h_all g_bg_f_5 g_kuaishou">
<view v-if="speed == 0">
<g-loading />
<rh-loading />
</view>
<view v-if="speed > 0">
<!-- 状态信息 -->

@ -4,7 +4,7 @@
<!-- {{ selfJob }} -->
<div v-if="speed == 0">
<g-loading />
<rh-loading />
</div>
<div v-if="speed == 1">
<!-- 基本信息 -->

@ -5,7 +5,7 @@
<!-- {{ selfJob }} -->
<div v-if="speed == 0">
<g-loading />
<rh-loading />
</div>
<div v-if="speed == 1">

@ -1,6 +1,6 @@
<template>
<div class="g_flex_row_center" style="margin-top: 120px" v-if="!showPage">
<g-loading text="加载中..."></g-loading>
<rh-loading text="加载中..."></rh-loading>
</div>
<div class="p-root-detail-user g_w_all g_bg_page g_kuaishou" v-if="showPage">
<u-navbar backIconColor="#333" :borderBottom="false" :immersive="true" :customBack="goHome" :background="{ background: navColor }" :backIconName="fromShare ? 'home' : 'arrow-left'"></u-navbar>

@ -1,6 +1,6 @@
<template>
<div class="g_flex_row_center" style="margin-top: 120px" v-if="!showPage">
<g-loading text="加载中..."></g-loading>
<rh-loading text="加载中..."></rh-loading>
</div>
<div class="p-root-detail-user g_w_all g_bg_page g_kuaishou" v-if="showPage">
<view class="background-container g_position_fixed" style="width: 100%; overflow: hidden; z-index: 0">

@ -1,7 +1,7 @@
<template>
<view class="p-root-detail-fellow g_w_all g_bg_page g_kuaishou">
<view style="padding-bottom: 200rpx">
<AiApply class @outputInfo="getTownsManInfo" />
<rh-ai-super-input class @outputInfo="getTownsManInfo" />
<view class="g_h_10"></view>
<rh-form-slot
:list="[
@ -143,12 +143,8 @@
</template>
<script>
import AiApply from "../../components/AiApply.vue";
import { nationlist } from "../../utils/nation.js";
export default {
components: {
AiApply,
},
onReady() {
this.G.setNavStyle();
},

@ -1,6 +1,6 @@
<template>
<view class="p-root-home-quick g_w_all g_bg_f_5 g_kuaishou">
<AiApply class="" @outputInfo="getTownsManInfo" ref="AiApplyRef" />
<rh-ai-super-input class="" @outputInfo="getTownsManInfo" ref="AiApplyRef" />
<view class="">
<view class="card-tip g_pt_12 g_pb_8 g_pl_20 g_c_6">工友信息</view>

Loading…
Cancel
Save