fix: 2.45遗留bug修复
This commit is contained in:
parent
6334d7c318
commit
0378c0523c
@ -10,7 +10,8 @@
|
||||
</view>
|
||||
|
||||
<template #footer>
|
||||
<button-footer v-if="canEdit" confirmText="保存" :showCancel="false" @confirm="confirm()" />
|
||||
<button-footer v-if="canEdit" :confirmText="nextTypes.length ? '下一步' : '保存'" :showCancel="false"
|
||||
@confirm="confirm()" />
|
||||
</template>
|
||||
</full-page>
|
||||
</template>
|
||||
|
||||
@ -15,7 +15,9 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import useAccount from '@/store/account';
|
||||
import api from "@/utils/api.js";
|
||||
import { loading, toast, hideLoading } from "@/utils/widget";
|
||||
|
||||
@ -24,6 +26,8 @@ import surveyCover from "./components/survey-cover.vue";
|
||||
import surveyQuestion from "./components/survey-question.vue";
|
||||
import surveyRecord from "./components/survey-record.vue";
|
||||
|
||||
const env = __VITE_ENV__;
|
||||
const appid = env.MP_WX_APP_ID;
|
||||
const corpId = ref('');
|
||||
const surveryId = ref('');
|
||||
const answerId = ref('');
|
||||
@ -32,7 +36,7 @@ const survey = ref(null);
|
||||
const emptyTxt = ref('')
|
||||
const customerName = ref('');
|
||||
const step = ref('cover');
|
||||
|
||||
const { login, getExternalUserId } = useAccount();
|
||||
const readonly = computed(() => survey.value && survey.value.submitTime);
|
||||
const list = computed(() => survey.value && Array.isArray(survey.value.list) ? survey.value.list : []);
|
||||
const showList = computed(() => {
|
||||
@ -80,7 +84,8 @@ async function init() {
|
||||
async function getAnswerRecord() {
|
||||
const res = await api('getAnswer', { corpId: corpId.value, surveryId: surveryId.value, answerId: answerId.value, memberId: memberId.value });
|
||||
if (res && res.success) {
|
||||
return res.record
|
||||
relateWxappp(res.record)
|
||||
return res.record;
|
||||
}
|
||||
return Promise.reject();
|
||||
}
|
||||
@ -108,17 +113,34 @@ async function submit({ list, score }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function relateWxappp(record) {
|
||||
const { teamId, corpId, memberId } = record || {};
|
||||
if (!(teamId && corpId && memberId)) return;
|
||||
const account = await login();
|
||||
const externalUserId = await getExternalUserId(corpId);
|
||||
if (!externalUserId) return;
|
||||
const res = await api('relateWxappTeamByExternalUserId', {
|
||||
appid,
|
||||
openid: account.openid,
|
||||
teamId: teamId,
|
||||
corpId: corpId,
|
||||
memberId: memberId,
|
||||
externalUserId: externalUserId,
|
||||
})
|
||||
console.clear()
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
onLoad(opts => {
|
||||
corpId.value = opts.corpId;
|
||||
surveryId.value = opts.surveryId;
|
||||
answerId.value = opts.answerId;
|
||||
memberId.value = opts.memberId;
|
||||
customerName.value = opts.name;
|
||||
customerName.value = decodeURIComponent(decodeURIComponent(opts.name || ''));
|
||||
init();
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -154,6 +154,7 @@ export default defineStore("accountStore", () => {
|
||||
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
|
||||
const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : '';
|
||||
externalUserId.value = id;
|
||||
return id;
|
||||
}
|
||||
|
||||
watch(hasImCorpId, n => {
|
||||
|
||||
@ -14,7 +14,8 @@ const urlsConfig = {
|
||||
getWxappRelateTeams: 'getWxappRelateTeams',
|
||||
getTeamMemberAvatarsAndName: "getTeamMemberAvatarsAndName",
|
||||
getMiniAppHomeStats: "getMiniAppHomeStats",
|
||||
getResponsiblePerson: 'getTeamResponsiblePerson'
|
||||
getResponsiblePerson: 'getTeamResponsiblePerson',
|
||||
relateWxappTeamByExternalUserId: 'relateWxappTeamByExternalUserId'
|
||||
},
|
||||
|
||||
knowledgeBase: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user