[图片][图片] 编译的 预览的
小程序 单词查找功能 编译和真机调试都没问题, 但是预览出现问题,怎么解决?data: { voteTitle:null, simple:false, } voteTitle: function (e) { this.setData({ simple:true,voteTitle:e.detail.value}) var that = this wx.request({ url: 'https://api.shanbay.com/bdc/search/?word=' + this.data.voteTitle.toLowerCase(), data: {}, method: 'GET', success: function (res) { that.setData({ word: res.data.data.content, pron: res.data.data.pronunciation, definition: res.data.data.definition, pron_audio: res.data.data.audio }) } }) this.setData({ simple: true }) }, read(){ const innerAudioContext = wx.createInnerAudioContext() innerAudioContext.autoplay = true innerAudioContext.src = this.data.pron_audio }, }) <view class="page"> <view class="input_counter"> <input class="input" placeholder="输入要查询的单词" bindinput="voteTitle"> </input> </view> <view wx:if="{{simple}}" class="simple_look"> <view style="font-size:45rpx;" bindtap="read"> {{word}} 【{{pron}}】</view> <view style="height:10px;"></view> <view>{{definition}}</view> </view> </view>
2020-05-11