Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序转taro出现的报错 #2277

Closed
Three-H opened this issue Feb 27, 2019 · 7 comments
Closed

微信小程序转taro出现的报错 #2277

Three-H opened this issue Feb 27, 2019 · 7 comments
Assignees

Comments

@Three-H
Copy link

Three-H commented Feb 27, 2019

错误 页面转换 pages/ScheduleList/NoOrder/index.js
{ SyntaxError: Unexpected token, expected "}" (610:4774)
608 | selectInd: selectInd
609 | } = this.state;
出现这种报错,小程序都是正常运行的

@taro-bot
Copy link

taro-bot bot commented Feb 27, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Feb 27, 2019

你得带上错误页面的源码,只有报错是没有任何意义的

@Three-H
Copy link
Author

Three-H commented Feb 27, 2019

@yuche js 源码

util(currentStatu, currentType, id) {
var that=this
setTimeout(function() {
if (currentStatu == 'close') {
this.setData({
showModalStatus: false,
showSumModalStatus: false,
showDisModalStatus: false,
showInsurance: false,
mImgPath: '../../../image/SetOrder/path_up.png'
})
if (currentType == '4') {
var f = ''
var price = 0
for (var i = 0; i < that.data.insurances.length; i++) {
if (that.data.insurances[i].id == id) {
f = that.data.insurances[i].Name
price = that.data.insurances[i].Price
}
}
that.setData({
insurance: f,
selectInd: id,
selectIndPrice: price
})
selectIndPrice = price
that.bindManual()
}
}
}, 100)

if (currentStatu == 'open') {
  if (currentType == '1') {
    this.setData({
      showModalStatus: true
    })
  }
  if (currentType == '3') {
    if(this.data.disList.length==0){ return}
    this.setData({
      showDisModalStatus: true
    })
  }
  if (currentType == '4') {
    this.setData({
      showInsurance: true
    })
  }
  if (currentType == '2') {
    if (this.data.showSumModalStatus){
      this.setData({
        showSumModalStatus: false,
        mImgPath: '../../../image/SetOrder/path_up.png'
      })
      return
    }
    this.setData({
      showSumModalStatus: true,
      mImgPath: '../../../image/SetOrder/path_down.png'
    })
  }
}

}
wxml 源码

{{item.Des}} {{item.Price}}元

@Three-H Three-H closed this as completed Feb 27, 2019
@Three-H Three-H reopened this Feb 27, 2019
@yuche
Copy link
Contributor

yuche commented Feb 27, 2019

整个报错的 js和 wxml 都要 发一下,注意缩进,你现在这样可能会丢内容

@yuche yuche added the taroize label Feb 28, 2019
@yuche yuche self-assigned this Feb 28, 2019
@yuche
Copy link
Contributor

yuche commented Mar 1, 2019

https://github.com/Three-H/proplem/blob/master/wxtaroProplem.html#L96

你这个 catchtap='checkInsura nce' 跑不了

还有你发出来的 js 文件也少了一行……

@Three-H
Copy link
Author

Three-H commented Mar 1, 2019

很感谢,就是多了那个空格已经转换成功了。用"-"连接是计算符 @yuche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants