| | |
| | | module.exports = { |
| | | env: { |
| | | NODE_ENV: '"development"', |
| | | // BASE_URL: '"http://localhost:53780"', |
| | | BASE_URL: '"https://testfj.81812333.com"', |
| | | BASE_URL: '"http://localhost:53780"', |
| | | // BASE_URL: '"https://testfj.81812333.com"', |
| | | BASE_URL_JX: '"https://api.jx818.com"', |
| | | APP_ENV: '"development"', |
| | | |
| | |
| | | }) |
| | | ); |
| | | |
| | | // if (process.env.NODE_ENV !== 'development') { |
| | | chain.merge({ |
| | | plugin: { |
| | | install: { |
| | | plugin: require('terser-webpack-plugin'), |
| | | args: [ |
| | | { |
| | | terserOptions: { |
| | | compress: true, // 默认使用terser压缩 |
| | | keep_classnames: true, // 不改变class名称 |
| | | keep_fnames: true, // 不改变函数名称 |
| | | if (process.env.NODE_ENV !== 'development') { |
| | | chain.merge({ |
| | | plugin: { |
| | | install: { |
| | | plugin: require('terser-webpack-plugin'), |
| | | args: [ |
| | | { |
| | | terserOptions: { |
| | | compress: true, // 默认使用terser压缩 |
| | | keep_classnames: true, // 不改变class名称 |
| | | keep_fnames: true, // 不改变函数名称 |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | }); |
| | | // } |
| | | }); |
| | | } |
| | | |
| | | chain.merge({ |
| | | optimization: { |
| | |
| | | } |
| | | }); |
| | | |
| | | const tmplIds = ['ziC07K27Km9OAywf-KYwHiWgn195j9tmuFKxbDZ79tg']; |
| | | 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 (!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); |
| | | }, |
| | | }); |
| | | // 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' }); |
| | | // } |
| | | let params: API.ApplyTaskCommand = { |
| | | ids: [id], |
| | | }; |
| | | let res = await taskUserServices.applyTask(params); |
| | | if (res) { |
| | | Message.success('报名成功'); |
| | | refetch({ type: 'inactive' }); |
| | | } |
| | | } catch (error) {} |
| | | }, |
| | | { message: '实名成功后才可报名,请前往实名认证' } |