代码中的问题是在methods中的getActivity方法中,使用了this.form,但是this指向的是undefined,导致无法读取form属性。这可能是因为在调用getActivity方法之前没有正确地绑定this。可以尝试在methods中的getActivity方法前面添加箭头函数来确保正确地绑定this,如下所示:

getActivity: () => {
  const url_params = Object.fromEntries(window.location.search.slice(1).split('&').map(v => v.split('=')));
  uni.request({
    url: config.baseUrl + `/activity/` + url_params.activityId,
    method: 'GET',
    success: res => {
      if (res.data.code === 200) {
        this.form = res.data.data
      }
    }
  })
}

另外,还需要确保调用getActivity方法的地方已经正确地绑定了this

filters 设置最大可选			selectNamecompositionId 				let num = parseIntcompositionId;				if thisformonceVoteAmount 0 && thisformonceVoteAmount == thischeckedValueslength 					for var t in thischeckedValues

原文地址: https://www.cveoy.top/t/topic/imrq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录