小程序
小游戏
企业微信
微信支付
扫描小程序码分享
现在是最新版本1.06.2307260,
上午提过好几次都成功了,代码基本没动
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你看看这个文件勒
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
今天更新了一下微信开发者工具,然后就报你这个错了。
新版本得把js转es勾选上才行。
遇到同样的问题,错误文件:
uniapp打包后的文件:
require('../../common/vendor.js');// 流程通用mixin on('flowAudit') import { flowDetail, auditAgree, auditReject, flowAudit, getFlowBase } from "@/api/api"; import { formatDate, previewFile, getImagePath, countNumber } from "@/utils"; const AnalysysAgent = uni.AnalysysAgent; const mixin = { data: function () { return { status: "loading", params: {}, baseFlow: {}, base: {}, info: {}, edit: false, auditStatus: "start", // start:准备开始 in:进行中 end:结束 }; }, methods: { dateFormat(dateTime, format = "yyyy-MM-dd") { if (dateTime) { return formatDate(dateTime, format); } return ""; }, numberSum(list) { return countNumber(list); }, formChange(key, value) { this.$set(this.form, key, value); }, formValueChange(key, event) { this.formChange(key, event.detail.value); }, bindTransfer() { // 转派 let { params } = this; uni.navigateTo({ url: `/packageB/pages/task/transfer/index?taskId=${params.taskId}` }); }, bindHideButton(audit = 'false') { this.params = { ...this.params, audit, } }, bindAgree() { // 同意 let { params } = this; uni.showLoading({ mask: true }); auditAgree(params.taskId) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("agree"); AnalysysAgent.track("ihr_flowAgree", this.base); uni.showModal({ title: "操作成功", content: "操作成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, bindReject(remark) { // 拒绝 let { params } = this; uni.showLoading({ mask: true }); let para = { "status": "REJECT", "taskId": params.taskId, "approveRemark": remark } auditReject(para) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("reject"); AnalysysAgent.track("ihr_flowReject", this.base); uni.showModal({ title: "驳回成功", content: "驳回成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, bindAudit(params) { //审核(有审核数据才用此接口) uni.showLoading({ mask: true }); flowAudit(params) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("agree"); AnalysysAgent.track("ihr_flowAudit", { base: this.base, params }); uni.showModal({ title: "操作成功", content: "操作成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, onPreview(fileId, showMenu = true) { previewFile(getImagePath(fileId), { showMenu }); }, emitSubscribe(status) { uni.$emit("taskListUpdate", { status: status }); }, initPageData() { let { procInstId } = this.params; this.status = "loading"; getFlowBase(procInstId).then(result => { this.baseFlow = result || {}; if (result?.completeFlag != true && result?.approveFlag == true) { this.bindHideButton('true'); if (result?.runTimeTasks && result?.runTimeTasks.length) { let formKey = result?.runTimeTasks[0].formKey; if (formKey) { this.params = { ...this.params, formKey, } } } } else { this.bindHideButton(); } flowDetail(result?.businessKey) .then((data) => { if (data) { this.status = "success"; this.base = data; try { this.info = JSON.parse(data.flowEntity); if (process.env.NODE_ENV !== "production") { console.info(JSON.stringify(this.info)); } } catch (e) { uni.showToast({ title: "数据异常,JSON转换失败", icon: "none" }); } if (this.initPageFinish) { this.initPageFinish(this.base, this.info); } } else { this.status = "error"; uni.showModal({ title: '数据错误', content: '流程被删除或程序意外终止导致数据异常', }) } }) .catch((error) => { this.status = "error"; uni.showToast({ title: error.message || "获取流程详情失败", icon: "none" }); console.error("获取流程详情失败:", error); }); }) .catch((error) => { this.status = "error"; uni.showToast({ title: error.message || "获取流程实例失败", icon: "none" }); console.error("获取流程详情失败:", error); }); }, initSubscribe() { //订阅审核按钮点击 uni.$on("flowAudit", (data) => { const { taskId, type } = data; if (taskId == this.params.taskId) { if (this.auditStatus !== "in") { this.auditStatus = "in"; if (type == "reject") { uni.showModal({ title: "驳回原因", editable: true, placeholderText: '请输入驳回原因', confirmColor: '#dd524d', success: (res) => { if (res.confirm) { this.bindReject(res.content); } else { this.auditStatus = "end"; } }, }); } else if (type == "agree") { if (this.edit) { this.validation() .then((values) => { if (values) { const { dataJson, variables, attachments } = values; let param = { taskId, status: "AGREE", approveRemark: "同意", attachments: attachments, dataJson: JSON.stringify(dataJson || values), variables: variables, }; uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAudit(param); } else { this.auditStatus = "end"; } }, }); } else { uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAgree(); } else { this.auditStatus = "end"; } }, }); } }) .catch((error) => { console.error(error) this.$showToast({ title: error || "验证出错啦", icon: "none" }); this.auditStatus = "end"; }); } else { uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAgree(); } else { this.auditStatus = "end"; } }, }); } } else if (type == "transfer") { this.auditStatus = "end"; this.bindTransfer(); } } } }); }, }, onLoad(option) { this.params = option; this.initPageData(); this.initSubscribe(); }, onUnload() { uni.$off(["flowAudit"]); }, }; export default mixin;
这是这个文件的内容
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你看看这个文件勒
今天更新了一下微信开发者工具,然后就报你这个错了。
新版本得把js转es勾选上才行。
遇到同样的问题,错误文件:
uniapp打包后的文件:
require('../../common/vendor.js');// 流程通用mixin on('flowAudit') import { flowDetail, auditAgree, auditReject, flowAudit, getFlowBase } from "@/api/api"; import { formatDate, previewFile, getImagePath, countNumber } from "@/utils"; const AnalysysAgent = uni.AnalysysAgent; const mixin = { data: function () { return { status: "loading", params: {}, baseFlow: {}, base: {}, info: {}, edit: false, auditStatus: "start", // start:准备开始 in:进行中 end:结束 }; }, methods: { dateFormat(dateTime, format = "yyyy-MM-dd") { if (dateTime) { return formatDate(dateTime, format); } return ""; }, numberSum(list) { return countNumber(list); }, formChange(key, value) { this.$set(this.form, key, value); }, formValueChange(key, event) { this.formChange(key, event.detail.value); }, bindTransfer() { // 转派 let { params } = this; uni.navigateTo({ url: `/packageB/pages/task/transfer/index?taskId=${params.taskId}` }); }, bindHideButton(audit = 'false') { this.params = { ...this.params, audit, } }, bindAgree() { // 同意 let { params } = this; uni.showLoading({ mask: true }); auditAgree(params.taskId) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("agree"); AnalysysAgent.track("ihr_flowAgree", this.base); uni.showModal({ title: "操作成功", content: "操作成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, bindReject(remark) { // 拒绝 let { params } = this; uni.showLoading({ mask: true }); let para = { "status": "REJECT", "taskId": params.taskId, "approveRemark": remark } auditReject(para) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("reject"); AnalysysAgent.track("ihr_flowReject", this.base); uni.showModal({ title: "驳回成功", content: "驳回成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, bindAudit(params) { //审核(有审核数据才用此接口) uni.showLoading({ mask: true }); flowAudit(params) .then(() => { uni.hideLoading(); this.bindHideButton(); this.emitSubscribe("agree"); AnalysysAgent.track("ihr_flowAudit", { base: this.base, params }); uni.showModal({ title: "操作成功", content: "操作成功,返回上一页?", showCancel: false, success: () => { uni.navigateBack(); }, }); }) .catch((error) => { uni.hideLoading(); uni.showToast({ title: error.message || "服务异常", icon: "none" }); this.auditStatus = "end"; }); }, onPreview(fileId, showMenu = true) { previewFile(getImagePath(fileId), { showMenu }); }, emitSubscribe(status) { uni.$emit("taskListUpdate", { status: status }); }, initPageData() { let { procInstId } = this.params; this.status = "loading"; getFlowBase(procInstId).then(result => { this.baseFlow = result || {}; if (result?.completeFlag != true && result?.approveFlag == true) { this.bindHideButton('true'); if (result?.runTimeTasks && result?.runTimeTasks.length) { let formKey = result?.runTimeTasks[0].formKey; if (formKey) { this.params = { ...this.params, formKey, } } } } else { this.bindHideButton(); } flowDetail(result?.businessKey) .then((data) => { if (data) { this.status = "success"; this.base = data; try { this.info = JSON.parse(data.flowEntity); if (process.env.NODE_ENV !== "production") { console.info(JSON.stringify(this.info)); } } catch (e) { uni.showToast({ title: "数据异常,JSON转换失败", icon: "none" }); } if (this.initPageFinish) { this.initPageFinish(this.base, this.info); } } else { this.status = "error"; uni.showModal({ title: '数据错误', content: '流程被删除或程序意外终止导致数据异常', }) } }) .catch((error) => { this.status = "error"; uni.showToast({ title: error.message || "获取流程详情失败", icon: "none" }); console.error("获取流程详情失败:", error); }); }) .catch((error) => { this.status = "error"; uni.showToast({ title: error.message || "获取流程实例失败", icon: "none" }); console.error("获取流程详情失败:", error); }); }, initSubscribe() { //订阅审核按钮点击 uni.$on("flowAudit", (data) => { const { taskId, type } = data; if (taskId == this.params.taskId) { if (this.auditStatus !== "in") { this.auditStatus = "in"; if (type == "reject") { uni.showModal({ title: "驳回原因", editable: true, placeholderText: '请输入驳回原因', confirmColor: '#dd524d', success: (res) => { if (res.confirm) { this.bindReject(res.content); } else { this.auditStatus = "end"; } }, }); } else if (type == "agree") { if (this.edit) { this.validation() .then((values) => { if (values) { const { dataJson, variables, attachments } = values; let param = { taskId, status: "AGREE", approveRemark: "同意", attachments: attachments, dataJson: JSON.stringify(dataJson || values), variables: variables, }; uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAudit(param); } else { this.auditStatus = "end"; } }, }); } else { uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAgree(); } else { this.auditStatus = "end"; } }, }); } }) .catch((error) => { console.error(error) this.$showToast({ title: error || "验证出错啦", icon: "none" }); this.auditStatus = "end"; }); } else { uni.showModal({ title: "提示", content: "同意通过该流程?", success: (res) => { if (res.confirm) { this.bindAgree(); } else { this.auditStatus = "end"; } }, }); } } else if (type == "transfer") { this.auditStatus = "end"; this.bindTransfer(); } } } }); }, }, onLoad(option) { this.params = option; this.initPageData(); this.initSubscribe(); }, onUnload() { uni.$off(["flowAudit"]); }, }; export default mixin;
这是这个文件的内容