wupengfei
2025-11-25 7ad6378880f03400bc9c9878d753412d0121243a
apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue
@@ -126,9 +126,11 @@
  GetTaskInfoQueryResultHireButton,
  GetTaskInfoQueryResultApplyButton,
  EnumTaskCheckReceiveMethod,
  subscribeMessageTemplateIds,
} from '@12333/constants';
import { useAccessLogin } from '@/hooks';
import { useTaskInfo } from '@12333/hooks';
import _ from 'lodash';
defineOptions({
  name: 'InnerPage',
@@ -162,20 +164,50 @@
  }
});
const handleApply = useAccessReal(
  async () => {
    try {
      let params: API.ApplyTaskCommand = {
        ids: [id],
      };
      let res = await taskUserServices.applyTask(params);
      if (res) {
        Message.success('报名成功');
        refetch({ type: 'inactive' });
      }
    } catch (error) {}
  },
  { message: '实名成功后才可报名,请前往实名认证' }
const tmplIds = ['T7Gta6H6TROZjcqeSWVTG2wWGGInWh0fGTOgCCgVBuk'];
const handleApply = _.debounce(
  useAccessReal(
    async () => {
      try {
        // if (!Taro.requestSubscribeMessage) {
        //   await Message.confirm({ message: '你的微信版本过低,不支持订阅消息,是否继续报名' });
        // }
        // const res = await Taro.getSetting({
        //   withSubscriptions: true,
        // });
        // let setting: boolean[] = [];
        // if (res.subscriptionsSetting && res.subscriptionsSetting.itemSettings) {
        //   setting = tmplIds
        //     .map((id) => res.subscriptionsSetting.itemSettings[id] !== 'accept')
        //     .filter(Boolean);
        // }
        // console.log('setting: ', setting);
        // if (setting.length > 0) {
        //   Taro.requestSubscribeMessage({
        //     tmplIds: tmplIds,
        //     success: function (res) {
        //       console.log('res: ', res);
        //     },
        //   });
        // }
        let params: API.ApplyTaskCommand = {
          ids: [id],
        };
        let res = await taskUserServices.applyTask(params);
        if (res) {
          Message.success('报名成功');
          refetch({ type: 'inactive' });
        }
      } catch (error) {}
    },
    { message: '实名成功后才可报名,请前往实名认证' }
  ),
  1000,
  {
    leading: true,
    trailing: false,
  }
);
const handleAttention = useAccessLogin(async () => {