报名清空老乡信息

master
wangxia 1 day ago
parent 90f98d8ab9
commit 7e0fa81ee6

@ -1,5 +1,5 @@
<template> <template>
<view class="p-root-other-more g_w_all g_h_all g_bg_f_5 g_pl_10 g_pr_10 g_kuaishou"> <view class="p-root-other-more g_w_all g_h_all g_bg_f_5 g_pl_10 g_pr_10 g_kuaishou" style="box-sizing:border-box">
<view class="g_h_10 g_w_pull"></view> <view class="g_h_10 g_w_pull"></view>
<view class="g_bg_f g_pl_16 g_pr_16 g_radius_8 g_mb_24"> <view class="g_bg_f g_pl_16 g_pr_16 g_radius_8 g_mb_24">
<view class="g_flex_row_between g_h_56" v-if="type == 1 || type == 3" :class="type == 3 ? 'g_border_e_b' : ''"> <view class="g_flex_row_between g_h_56" v-if="type == 1 || type == 3" :class="type == 3 ? 'g_border_e_b' : ''">

@ -717,7 +717,7 @@ export default {
console.log("resresresresresres++++++++++++++", that.agencyInfo); console.log("resresresresresres++++++++++++++", that.agencyInfo);
console.log("resresresresresres++++++++++++++", that.isSelf); console.log("resresresresresres++++++++++++++", that.isSelf);
that.info = res; that.info = res;
that.speed = res.jobList.length; // that.speed = res.jobList.length;
that.showPage = true; that.showPage = true;
@ -809,6 +809,7 @@ export default {
let that = this; let that = this;
console.log("eeeeeee", e); console.log("eeeeeee", e);
that.tabInfo.active = e; that.tabInfo.active = e;
that.speed = -1;
that.query.list = []; that.query.list = [];
that.query.page = 1; that.query.page = 1;
that.getDefault(); that.getDefault();

@ -34,201 +34,200 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
aitext: '', aitext: "",
timer: null, timer: null,
timer1: null, timer1: null,
defaultPercent: 0, defaultPercent: 0,
ailoading: false, ailoading: false,
aiConfig: { aiConfig: {
token: '', token: "",
id: '', id: "",
}, },
chooseImgShow: false, chooseImgShow: false,
currentImg: '', currentImg: "",
} };
}, },
created() { created() {
this.getAiToken() this.getAiToken();
}, },
methods: { methods: {
openCore(respons) { openCore(respons) {
console.log('open sse', respons) console.log("open sse", respons);
}, },
errorCore(err) { errorCore(err) {
console.log('error sse', err) console.log("error sse", err);
}, },
messageCore(msg) { messageCore(msg) {
let that = this let that = this;
console.log('message sse', msg) console.log("message sse", msg);
if (msg.event == 'Done') { if (msg.event == "Done") {
clearInterval(that.timer) clearInterval(that.timer);
that.ailoading = false that.ailoading = false;
} else if (msg.event == 'Message') { } else if (msg.event == "Message") {
let info = JSON.parse(msg.data) let info = JSON.parse(msg.data);
if (info.node_type == 'End') { if (info.node_type == "End") {
this.setInfo(info) this.setInfo(info);
} }
} }
}, },
getAiToken() { getAiToken() {
let that = this let that = this;
that.G.Get('/yishoudan/common/structure/getConfig', {}, (res) => { that.G.Get("/yishoudan/common/structure/getConfig", {}, (res) => {
console.log('res', res) console.log("res", res);
that.aiConfig = { that.aiConfig = {
token: res.token, token: res.token,
id: res.workflowId, id: res.workflowId,
} };
}) });
}, },
uploadPhoto($sourceType) { uploadPhoto($sourceType) {
let that = this let that = this;
console.log('$sourceType', $sourceType) console.log("$sourceType", $sourceType);
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original'], // sizeType: ["original"], //
sourceType: [$sourceType], //album camera 使 sourceType: [$sourceType], //album camera 使
success: function (res) { success: function (res) {
console.log('选取文件数据:', res) console.log("选取文件数据:", res);
that.uploadCozeFile(res.tempFilePaths[0]) that.uploadCozeFile(res.tempFilePaths[0]);
}, },
}) });
}, },
uploadCozeFile(tempFilePath) { uploadCozeFile(tempFilePath) {
let that = this let that = this;
that.chooseImgShow = false that.chooseImgShow = false;
that.currentImg = tempFilePath that.currentImg = tempFilePath;
uni.uploadFile({ uni.uploadFile({
url: 'https://api.coze.cn/v1/files/upload', url: "https://api.coze.cn/v1/files/upload",
method: 'POST', method: "POST",
filePath: tempFilePath, filePath: tempFilePath,
name: 'file', name: "file",
header: { header: {
Authorization: 'Bearer ' + that.aiConfig.token, Authorization: "Bearer " + that.aiConfig.token,
'Content-Type': 'multipart/form-data', "Content-Type": "multipart/form-data",
}, },
formData: {}, formData: {},
success: function (res) { success: function (res) {
console.log('文件', res) console.log("文件", res);
let data = JSON.parse(res.data) let data = JSON.parse(res.data);
that.appCoze(data.data.id) that.appCoze(data.data.id);
}, },
fail: function (err) { fail: function (err) {
console.log(err) console.log(err);
}, },
}) });
}, },
uploadPhotoByChat() { uploadPhotoByChat() {
let that = this let that = this;
uni.chooseMessageFile({ uni.chooseMessageFile({
count: 1, count: 1,
type: 'image', type: "image",
success(res) { success(res) {
console.log('resresresresresres', res) console.log("resresresresresres", res);
if (res.errMsg == 'chooseMessageFile:ok') { if (res.errMsg == "chooseMessageFile:ok") {
console.log('res', res) console.log("res", res);
that.uploadCozeFile(res.tempFiles[0].path) that.uploadCozeFile(res.tempFiles[0].path);
} }
}, },
}) });
}, },
getClipboard() { getClipboard() {
let that = this let that = this;
if (this.aitext) { if (this.aitext) {
this.aitext = '' this.aitext = "";
} else { } else {
uni.getClipboardData({ uni.getClipboardData({
success(res) { success(res) {
console.log(res) console.log(res);
if (res.data) { if (res.data) {
that.aitext = res.data that.aitext = res.data;
} else { } else {
uni.showToast({ uni.showToast({
title: '请先复制内容', title: "请先复制内容",
icon: 'none', icon: "none",
}) });
} }
}, },
fail() { fail() {
uni.showToast({ uni.showToast({
title: '读取剪切板失败', title: "读取剪切板失败",
icon: 'none', icon: "none",
}) });
}, },
}) });
} }
}, },
setInfo(parsed) { setInfo(parsed) {
let that = this let that = this;
const finalData = JSON.parse(parsed.content) const finalData = JSON.parse(parsed.content);
if (finalData) { if (finalData) {
console.log('解析后的用户信息:', finalData) console.log("解析后的用户信息:", finalData);
let info = { let info = {
idCard: finalData.idcard, idCard: finalData.idcard,
address: finalData.address, address: finalData.address,
name: finalData.username, name: finalData.username,
nation: finalData.nation, nation: finalData.nation,
userName: finalData.username, userName: finalData.username,
sex: finalData.sex ? (finalData.sex == '男' ? 1 : 2) : '', sex: finalData.sex ? (finalData.sex == "男" ? 1 : 2) : "",
age: finalData.age, age: finalData.age,
tel: finalData.tel, tel: finalData.tel,
} };
// uni.$emit('getTownsman', { info }) // uni.$emit('getTownsman', { info })
that.$emit('outputInfo', info) that.$emit("outputInfo", info);
// //
that.ailoading = false that.ailoading = false;
} else { } else {
that.ailoading = false that.ailoading = false;
} }
clearInterval(that.timer) clearInterval(that.timer);
}, },
getCoze() { getCoze() {
let that = this let that = this;
if (!that.aitext) { if (!that.aitext) {
uni.showToast({ uni.showToast({
title: '请粘贴内容', title: "请粘贴内容",
icon: 'none', icon: "none",
}) });
return false return false;
} }
this.appCoze() this.appCoze();
}, },
appCoze(_id) { appCoze(_id) {
let that = this let that = this;
let parameters = {} let parameters = {};
// //
that.ailoading = true that.ailoading = true;
that.defaultPercent = 3 that.defaultPercent = 3;
that.timer = setInterval(() => { that.timer = setInterval(() => {
that.defaultPercent = that.defaultPercent < 15 ? (that.defaultPercent = 15) : that.defaultPercent + 3 that.defaultPercent = that.defaultPercent < 15 ? (that.defaultPercent = 15) : that.defaultPercent + 3;
// console.log('12313123123123123') // console.log('12313123123123123')
if (that.defaultPercent >= 99) { if (that.defaultPercent >= 99) {
clearInterval(that.timer) clearInterval(that.timer);
} }
}, 150) }, 150);
that.timer1 = setTimeout(() => { that.timer1 = setTimeout(() => {
console.log('5687678678678678678') console.log("5687678678678678678");
that.ailoading = false that.ailoading = false;
clearInterval(that.timer) clearInterval(that.timer);
// setLoading() // setLoading()
}, 30000) }, 30000);
if (_id) { if (_id) {
parameters = { parameters = {
img: { img: {
file_id: _id, file_id: _id,
}, },
} };
} else { } else {
parameters = { parameters = {
txt: that.aitext, txt: that.aitext,
} };
} }
this.$refs.sseTest.startChat({ this.$refs.sseTest.startChat({
/** /**
@ -236,26 +235,28 @@ export default {
* 注意 * 注意
* 如果使用 sse-server.js 要在手机端使用的话请确保你的手机和电脑处在一个局域网下并且是正常的ip地址 * 如果使用 sse-server.js 要在手机端使用的话请确保你的手机和电脑处在一个局域网下并且是正常的ip地址
*/ */
url: 'https://api.coze.cn/v1/workflow/stream_run', url: "https://api.coze.cn/v1/workflow/stream_run",
// //
headers: { headers: {
// that.aiConfig.token // that.aiConfig.token
Authorization: 'Bearer ' + that.aiConfig.token, Authorization: "Bearer " + that.aiConfig.token,
'Content-Type': 'application/json', "Content-Type": "application/json",
}, },
// post // post
method: 'post', method: "post",
body: { body: {
parameters, parameters,
// workflow_id: that.aiConfig.id, // workflow_id: that.aiConfig.id,
workflow_id: '7520814905613664310', workflow_id: "7520814905613664310",
// workflow_id: '7492238568816656410', // workflow_id: '7492238568816656410',
}, },
}) });
}, },
ressetAitext() {
this.aitext = "";
}, },
} },
};
</script> </script>
<style> <style></style>
</style>

@ -1,6 +1,6 @@
<template> <template>
<view class="p-root-home-quick g_w_all g_bg_f_5 g_kuaishou"> <view class="p-root-home-quick g_w_all g_bg_f_5 g_kuaishou">
<AiApply class="" @outputInfo="getTownsManInfo" /> <AiApply class="" @outputInfo="getTownsManInfo" ref="AiApplyRef" />
<view class=""> <view class="">
<view class="card-tip g_pt_12 g_pb_8 g_pl_20 g_c_6">工友信息</view> <view class="card-tip g_pt_12 g_pb_8 g_pl_20 g_c_6">工友信息</view>
@ -465,6 +465,7 @@ export default {
handleClickMobile() {}, handleClickMobile() {},
submitForm() { submitForm() {
let that = this; let that = this;
if (!that.agreeRadio) { if (!that.agreeRadio) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -544,6 +545,7 @@ export default {
}); });
// that.persenInfo = []; // that.persenInfo = [];
that.btnLoading = false; that.btnLoading = false;
that.$refs.AiApplyRef.ressetAitext();
// that.$forceUpdate(); // that.$forceUpdate();
setTimeout(() => { setTimeout(() => {
@ -586,6 +588,7 @@ export default {
}); });
// that.persenInfo = []; // that.persenInfo = [];
that.$refs.AiApplyRef.ressetAitext();
// that.$forceUpdate(); // that.$forceUpdate();
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save