fix: 修复问题
This commit is contained in:
parent
384b6a08a7
commit
2bd1cd2349
@ -237,7 +237,7 @@ async function getBaseForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getCustomer() {
|
async function getCustomer() {
|
||||||
const res = await api('getRefrencePeople', { customerId: customerId.value });
|
const res = await api('getCustomerByCustomerId', { customerId: customerId.value });
|
||||||
if (res && res.success && res.data) {
|
if (res && res.success && res.data) {
|
||||||
customer.value = res.data;
|
customer.value = res.data;
|
||||||
setDisabledTitles(res.data)
|
setDisabledTitles(res.data)
|
||||||
|
|||||||
@ -30,10 +30,13 @@
|
|||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import FullPage from "@/components/full-page.vue";
|
import FullPage from "@/components/full-page.vue";
|
||||||
import api from "@/utils/api.js";
|
import api from "@/utils/api.js";
|
||||||
|
import { set } from "@/utils/cache";
|
||||||
|
import { toast } from "@/utils/widget.js";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
const { account } = storeToRefs(useAccountStore());
|
const { account } = storeToRefs(useAccountStore());
|
||||||
|
const { login } = useAccountStore()
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const error = ref("");
|
const error = ref("");
|
||||||
const articleData = ref({
|
const articleData = ref({
|
||||||
@ -102,6 +105,7 @@ const loadArticle = async () => {
|
|||||||
if (res.success && res.data) {
|
if (res.success && res.data) {
|
||||||
// 格式化日期
|
// 格式化日期
|
||||||
let date = "";
|
let date = "";
|
||||||
|
|
||||||
if (res.data.createTime) {
|
if (res.data.createTime) {
|
||||||
const d = new Date(res.data.createTime);
|
const d = new Date(res.data.createTime);
|
||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
@ -115,6 +119,34 @@ const loadArticle = async () => {
|
|||||||
content: processRichTextContent(res.data.content || ""),
|
content: processRichTextContent(res.data.content || ""),
|
||||||
date: date,
|
date: date,
|
||||||
};
|
};
|
||||||
|
if (isWechatChannels(res.data)) {
|
||||||
|
uni.openChannelsActivity({
|
||||||
|
finderUserName: res.data.wechatChannels.finderUserName,
|
||||||
|
feedId: res.data.wechatChannels.feedId,
|
||||||
|
fail: err => {
|
||||||
|
const errMsg = err.errMsg || '';
|
||||||
|
if (/cancel/i.test(errMsg)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
toast(`打开视频号失败:${errMsg}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// if (res.data.link) {
|
||||||
|
// uni.openOfficialAccountArticle({
|
||||||
|
// url: res.data.link,
|
||||||
|
// fail: err => {
|
||||||
|
// const errMsg = err.errMsg || '';
|
||||||
|
// console.error(errMsg)
|
||||||
|
// console.log(errMsg)
|
||||||
|
// if (/cancel/i.test(errMsg)) {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// toast(`打开文章失败:${errMsg}`)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
error.value = res.message || "加载文章失败";
|
error.value = res.message || "加载文章失败";
|
||||||
}
|
}
|
||||||
@ -126,11 +158,41 @@ const loadArticle = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function isWechatChannels(item) {
|
||||||
|
return item?.wechatChannels?.finderUserName && item?.wechatChannels?.feedId;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleSend(sendId) {
|
||||||
|
try {
|
||||||
|
await login();
|
||||||
|
markArticleRead(sendId);
|
||||||
|
authToTeam(sendId)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过发送记录 将微信用户关联到团队
|
||||||
|
async function authToTeam(sendId) {
|
||||||
|
const res = await api("relateWechatAccountWithTeam", {
|
||||||
|
sendId,
|
||||||
|
openid: account.value?.openid,
|
||||||
|
unionid: account.value?.unionid,
|
||||||
|
appid: account.value?.appId,
|
||||||
|
})
|
||||||
|
if (res.success) {
|
||||||
|
set('home-invite-team-info', { teamId: res.data })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
corpId.value = options.corpId;
|
corpId.value = options.corpId;
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
articleId = options.id;
|
articleId = options.id;
|
||||||
markArticleRead(options.sendId || '');
|
if (options.sendId) {
|
||||||
|
handleSend(options.sendId)
|
||||||
|
}
|
||||||
loadArticle();
|
loadArticle();
|
||||||
} else {
|
} else {
|
||||||
error.value = "文章信息不完整";
|
error.value = "文章信息不完整";
|
||||||
|
|||||||
@ -198,23 +198,23 @@ const loadArticleList = async (reset = false) => {
|
|||||||
|
|
||||||
function goToDetail(item) {
|
function goToDetail(item) {
|
||||||
if (!item?.articleId) return;
|
if (!item?.articleId) return;
|
||||||
if (isWechatChannels(item.articleInfo)) {
|
// if (isWechatChannels(item.articleInfo)) {
|
||||||
uni.openChannelsActivity({
|
// uni.openChannelsActivity({
|
||||||
finderUserName: item.articleInfo.wechatChannels.finderUserName,
|
// finderUserName: item.articleInfo.wechatChannels.finderUserName,
|
||||||
feedId: item.articleInfo.wechatChannels.feedId,
|
// feedId: item.articleInfo.wechatChannels.feedId,
|
||||||
success: () => {
|
// success: () => {
|
||||||
markArticleRead(item._id, item.articleId);
|
// markArticleRead(item._id, item.articleId);
|
||||||
},
|
// },
|
||||||
fail: err => {
|
// fail: err => {
|
||||||
const errMsg = err.errMsg || '';
|
// const errMsg = err.errMsg || '';
|
||||||
if (/cancel/i.test(errMsg)) {
|
// if (/cancel/i.test(errMsg)) {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
toast(`打开视频号失败:${errMsg}`)
|
// toast(`打开视频号失败:${errMsg}`)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
uni.navigateTo({ url: `/pages/article/article-detail?sendId=${item._id}&id=${item.articleId}&corpId=${corpId.value}` });
|
uni.navigateTo({ url: `/pages/article/article-detail?sendId=${item._id}&id=${item.articleId}&corpId=${corpId.value}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ const urlsConfig = {
|
|||||||
searchRateList: 'searchRateList',
|
searchRateList: 'searchRateList',
|
||||||
submitRateRecord: 'submitRateRecord',
|
submitRateRecord: 'submitRateRecord',
|
||||||
getRateRecord: 'getRateRecord',
|
getRateRecord: 'getRateRecord',
|
||||||
|
relateWechatAccountWithTeam: 'relateWechatAccountWithTeam'
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
addCustomer: 'add',
|
addCustomer: 'add',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user