zhengyiming
2 天以前 c8a804e84c59153ae84a2a848bd03686cf9dfd04
Merge branch 'master' of http://120.26.58.240:8888/r/flexJobMiniApp
7个文件已修改
90 ■■■■ 已修改文件
apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/pages/mine/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/pages/task/InnerPage.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/Card/TaskCard.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/hooks/user.ts 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/typings.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue
@@ -24,8 +24,24 @@
      :isCollapse="true"
    >
      <template #footer>
        <PageFooterBtn v-if="userResumeInfo" type="primary" plain>解约</PageFooterBtn>
        <PageFooterBtn type="primary" @click="goToSign">签约</PageFooterBtn>
        <PageFooterBtn
          v-if="
            enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Pass
          "
          type="primary"
          plain
          @click="handleUnsign"
          >解约</PageFooterBtn
        >
        <PageFooterBtn
          type="primary"
          @click="goToSign"
          v-if="
            enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Wait ||
            enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Refuse
          "
          >签约</PageFooterBtn
        >
      </template>
    </JobDetailContent>
  </LoadingLayout>
@@ -33,8 +49,9 @@
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { useQuery } from '@tanstack/vue-query';
import { useUserResume } from '@12333/hooks';
import { EnumTaskUserSignContractStatus } from '@12333/constants';
import { useGetEnterpriseEmployee, useUserResume } from '@12333/hooks';
import { Message } from '@12333/utils';
defineOptions({
  name: 'InnerPage',
@@ -47,11 +64,21 @@
  enterpriseEmployeeId: enterpriseEmployeeId,
});
const { enterpriseEmployeeInfo } = useGetEnterpriseEmployee({
  id: enterpriseEmployeeId,
});
function goToSign() {
  Taro.navigateTo({
    url: `${RouterPath.flexJobSign}?enterpriseEmployeeId=${enterpriseEmployeeId}`,
  });
}
async function handleUnsign() {
  try {
    await Message.confirm({ message: '确定要解约吗?' });
  } catch (error) {}
}
</script>
<style lang="scss">
apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue
@@ -41,7 +41,7 @@
              class="flexJobManage-card-plain-button"
              type="default"
              plain
              @click.stop="goDetail(item)"
              @click.stop="handleUnsign(item)"
              >解约</nut-button
            >
            <nut-button type="primary" @click.stop="checkContract">查看合约</nut-button>
@@ -52,7 +52,7 @@
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Refuse
            "
            type="primary"
            @click.stop="goDetail(item)"
            @click.stop="goFlexJobSign(item)"
            >签约</nut-button
          >
        </template>
@@ -72,6 +72,7 @@
} from '@12333/constants';
import * as enterpriseEmployeeServices from '@12333/services/apiV2/enterpriseEmployee';
import Taro from '@tarojs/taro';
import { Message } from '@12333/utils';
defineOptions({
  name: 'InnerPage',
@@ -102,16 +103,22 @@
  }
);
function checkContract() {}
function goDetail(item: API.GetEnterpriseEmployeesQueryResultItem) {
  Taro.navigateTo({
    url: `${RouterPath.flexJobDetailFromManage}?enterpriseEmployeeId=${item.id}`,
  });
}
function checkContract() {}
function goSignContract(item: API.GetNewestWorkerListOutput) {
async function handleUnsign(item: API.GetEnterpriseEmployeesQueryResultItem) {
  try {
    await Message.confirm({ message: '确定要解约吗?' });
  } catch (error) {}
}
function goFlexJobSign(item: API.GetEnterpriseEmployeesQueryResultItem) {
  Taro.navigateTo({
    url: `${RouterPath.flexJobSign}`,
    url: `${RouterPath.flexJobSign}?enterpriseEmployeeId=${item.id}`,
  });
}
</script>
apps/cMiniApp/src/pages/mine/index.vue
@@ -112,8 +112,6 @@
import { useSystemStore } from '@/stores/modules/system';
import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue';
import { toThousand } from '@12333/utils';
import { useQuery } from '@tanstack/vue-query';
import * as authServices from '@12333/services/apiV2/auth';
const { userDetail, isCertified, updateUserInfo } = useUser();
const isLogin = useIsLogin();
apps/cMiniApp/src/pages/task/InnerPage.vue
@@ -48,7 +48,6 @@
const { queryState, infiniteLoadingProps } = useCheckReceiveTasks();
function goSubmitTaskDetail(item: API.GetCheckReceiveTasksQueryResultItem) {
  console.log('queryState.date: ', queryState.date);
  if (Number(queryState.checkReceiveStatus) === EnumTaskCheckReceiveStatus.WaitSubmit) {
    Taro.navigateTo({
      url: `${RouterPath.taskSubmitCheck}?id=${item.id}&date=${queryState.date}`,
packages/components/src/Card/TaskCard.vue
@@ -25,9 +25,7 @@
        </div>
      </div>
      <div class="task-card-time">
        {{ dayjs(beginTime).format('YYYY年MM月DD日') }}至{{
          dayjs(endTime).format('YYYY年MM月DD日')
        }}
        {{ dayjs(beginTime).format('YYYY年MM月D日') }}至{{ dayjs(endTime).format('YYYY年MM月D日') }}
      </div>
    </slot>
    <div class="task-card-footer">
packages/hooks/user.ts
@@ -1,5 +1,6 @@
import { MaybeRef, computed, unref } from 'vue';
import * as userResumeServices from '@12333/services/apiV2/userResume';
import * as enterpriseEmployeeServices from '@12333//services/apiV2/enterpriseEmployee';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
type UseUserResumeOptions = {
@@ -52,3 +53,32 @@
    updateUserResume,
  };
}
type UseGetEnterpriseEmployeeOptions = {
  id?: MaybeRef<string>;
};
export function useGetEnterpriseEmployee(options: UseGetEnterpriseEmployeeOptions = {}) {
  const { id } = options;
  const { data, refetch, isLoading, isError } = useQuery({
    queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployee', id],
    queryFn: async () => {
      return await enterpriseEmployeeServices.getEnterpriseEmployee(
        { id: unref(id) },
        {
          showLoading: false,
        }
      );
    },
    placeholderData: () => ({} as API.GetEnterpriseEmployeeQueryResult),
    enabled: computed(() => !!unref(id)),
  });
  return {
    enterpriseEmployeeInfo: data,
    refetch,
    isLoading,
    isError,
  };
}
packages/services/apiV2/typings.d.ts
@@ -2593,6 +2593,7 @@
    enterpriseSignContractTime?: string;
    /** 电子合同 */
    contractUrl?: string;
    userSignContractStatus?: EnumTaskUserSignContractStatus;
  }
  interface GetEnterpriseEmployeesQuery {