- usingComponents 引入页面onLoad未执行
- 当前 Bug 的表现(可附上截图) usingComponents 引入页面onLoad未执行 - 预期表现 onLoad: function(options) { console.log(111112); }, - 复现路径 /pages/landlord/myHouse/myHouse - 提供一个最简复现 Demo 在myHouse 页面 onLoad方法却未执行 这个是为什么了 如何调用onload呢 分享代码如下: https://developers.weixin.qq.com/s/rfch5Smr7Y9I [代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码][代码] [代码][代码]console.log(111112);[代码][代码]},[代码] onLoad 方法未执行 index.json 引入对应的页面 [代码]{[代码][代码] [代码][代码]"usingComponents"[代码][代码]: {[代码][代码] [代码][代码]"myHouse"[代码][代码]: [代码][代码]"/pages/landlord/myHouse/myHouse"[代码][代码],[代码][代码] [代码][代码]"contract"[代码][代码]: [代码][代码]"/pages/landlord/contract/contract"[代码][代码],[代码][代码] [代码][代码]"houseControl"[代码][代码]: [代码][代码]"/pages/landlord/houseControl/houseControl"[代码][代码],[代码][代码] [代码][代码]"rent"[代码][代码]: [代码][代码]"/pages/landlord/rent/rent"[代码][代码],[代码][代码] [代码][代码]"personal"[代码][代码]: [代码][代码]"/pages/landlord/personal/personal"[代码][代码] [代码][代码]}[代码][代码]}[代码]index.wxml [代码]<myHouse wx:[代码][代码]if[代码][代码]=[代码][代码]"{{PageCur == 'myHouse'}}"[代码][代码]></myHouse>[代码][代码]<contract wx:[代码][代码]if[代码][代码]=[代码][代码]"{{PageCur == 'contract'}}"[代码][代码]></contract>[代码][代码]<houseControl wx:[代码][代码]if[代码][代码]=[代码][代码]"{{PageCur == 'houseControl'}}"[代码][代码]></houseControl>[代码][代码]<rent wx:[代码][代码]if[代码][代码]=[代码][代码]"{{PageCur == 'rent'}}"[代码][代码]></rent>[代码][代码]<personal wx:[代码][代码]if[代码][代码]=[代码][代码]"{{PageCur == 'personal'}}"[代码][代码]></personal>[代码][代码]<view class=[代码][代码]"cu-bar tabbar shadow foot"[代码][代码]>[代码] [代码] [代码][代码]<view class=[代码][代码]"action"[代码] [代码]bindtap=[代码][代码]"NavChange"[代码] [代码]data-cur=[代码][代码]"myHouse"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<image src=[代码][代码]"/images/icon/myHouse{{PageCur=='myHouse'?'_cur':''}}.png"[代码][代码]></image>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]" {{PageCur=='myHouse'?'text-green':'text-bar'}}"[代码][代码]>我的房屋</view>[代码][代码] [代码][代码]</view>[代码] [代码] [代码][代码]<view class=[代码][代码]"action"[代码] [代码]bindtap=[代码][代码]"NavChange"[代码] [代码]data-cur=[代码][代码]"contract"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<image src=[代码][代码]"/images/icon/contract{{PageCur=='contract'?'_cur':''}}.png"[代码][代码]></image>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"{{PageCur=='contract'?'text-green':'text-bar'}}"[代码][代码]>合同管理</view>[代码][代码] [代码][代码]</view>[代码] [代码] [代码][代码]<view class=[代码][代码]"action"[代码] [代码]bindtap=[代码][代码]"NavChange"[代码] [代码]data-cur=[代码][代码]"houseControl"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<image src=[代码][代码]"/images/icon/houseControl{{PageCur=='houseControl'?'_cur':''}}.png"[代码][代码]></image>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"{{PageCur=='houseControl'?'text-green':'text-bar'}}"[代码][代码]>房控</view>[代码][代码] [代码][代码]</view>[代码] [代码] [代码][代码]<view class=[代码][代码]"action"[代码] [代码]bindtap=[代码][代码]"NavChange"[代码] [代码]data-cur=[代码][代码]"rent"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<image src=[代码][代码]"/images/icon/rent{{PageCur=='rent'?'_cur':''}}.png"[代码][代码]></image>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"{{PageCur=='rent'?'text-green':'text-bar'}}"[代码][代码]>收租</view>[代码][代码] [代码][代码]</view>[代码] [代码] [代码][代码]<view class=[代码][代码]"action"[代码] [代码]bindtap=[代码][代码]"NavChange"[代码] [代码]data-cur=[代码][代码]"personal"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<image src=[代码][代码]"/images/icon/personal{{PageCur=='personal'?'_cur':''}}.png"[代码][代码]></image>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"{{PageCur=='personal'?'text-green':'text-bar'}}"[代码][代码]>个人中心</view>[代码][代码] [代码][代码]</view>[代码] [代码]</view>[代码] index.js [代码]const app = getApp();[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]PageCur: [代码][代码]'myHouse'[代码][代码],[代码][代码] [代码][代码]// height: app.globalData.height * 2 + 24,[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面方法[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]NavChange(e) {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]PageCur: e.currentTarget.dataset.cur[代码][代码] [代码][代码]})[代码][代码] [代码][代码]let page = getCurrentPages().pop();[代码][代码] [代码][代码]if[代码] [代码](page == undefined || page == [代码][代码]null[代码][代码]) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]page.onLoad();[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]onShareAppMessage() {[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]title: [代码][代码]'我的房屋'[代码][代码],[代码][代码] [代码][代码]// imageUrl: '/images/share.jpg',[代码][代码] [代码][代码]path: [代码][代码]'pages/landlord/myHouse/myHouse'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码] [代码]})[代码] usingComponents 引入的页面 onLoad 方法未执行 这个要如何处理呢? 求大神帮帮忙 给与解答 谢谢
2019-07-15 - usingComponents 引入页面onLoad未执行
- 当前 Bug 的表现(可附上截图) usingComponents 引入页面onLoad未执行 - 预期表现 onLoad: function(options) { console.log(111112); }, - 复现路径 /pages/landlord/myHouse/myHouse - 提供一个最简复现 Demo index.wxml [代码]<[代码][代码]myHouse[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{PageCur == 'myHouse'}}"[代码][代码]></[代码][代码]myHouse[代码][代码]>[代码][代码]<[代码][代码]contract[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{PageCur == 'contract'}}"[代码][代码]></[代码][代码]contract[代码][代码]>[代码][代码]<[代码][代码]houseControl[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{PageCur == 'houseControl'}}"[代码][代码]></[代码][代码]houseControl[代码][代码]>[代码][代码]<[代码][代码]rent[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{PageCur == 'rent'}}"[代码][代码]></[代码][代码]rent[代码][代码]>[代码][代码]<[代码][代码]personal[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{PageCur == 'personal'}}"[代码][代码]></[代码][代码]personal[代码][代码]>[代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"cu-bar tabbar shadow foot"[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"action"[代码] [代码]bindtap[代码][代码]=[代码][代码]"NavChange"[代码] [代码]data-cur[代码][代码]=[代码][代码]"myHouse"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"/images/icon/myHouse{{PageCur=='myHouse'?'_cur':''}}.png"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]" {{PageCur=='myHouse'?'text-green':'text-bar'}}"[代码][代码]>我的房屋</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"action"[代码] [代码]bindtap[代码][代码]=[代码][代码]"NavChange"[代码] [代码]data-cur[代码][代码]=[代码][代码]"contract"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"/images/icon/contract{{PageCur=='contract'?'_cur':''}}.png"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"{{PageCur=='contract'?'text-green':'text-bar'}}"[代码][代码]>合同管理</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"action"[代码] [代码]bindtap[代码][代码]=[代码][代码]"NavChange"[代码] [代码]data-cur[代码][代码]=[代码][代码]"houseControl"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"/images/icon/houseControl{{PageCur=='houseControl'?'_cur':''}}.png"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"{{PageCur=='houseControl'?'text-green':'text-bar'}}"[代码][代码]>房控</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"action"[代码] [代码]bindtap[代码][代码]=[代码][代码]"NavChange"[代码] [代码]data-cur[代码][代码]=[代码][代码]"rent"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"/images/icon/rent{{PageCur=='rent'?'_cur':''}}.png"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"{{PageCur=='rent'?'text-green':'text-bar'}}"[代码][代码]>收租</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"action"[代码] [代码]bindtap[代码][代码]=[代码][代码]"NavChange"[代码] [代码]data-cur[代码][代码]=[代码][代码]"personal"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'cuIcon-cu-image'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"/images/icon/personal{{PageCur=='personal'?'_cur':''}}.png"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"{{PageCur=='personal'?'text-green':'text-bar'}}"[代码][代码]>个人中心</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码]</[代码][代码]view[代码][代码]>[代码]index.json引入相关页面 [代码]{[代码][代码] [代码][代码]"usingComponents"[代码][代码]: {[代码][代码] [代码][代码]"myHouse"[代码][代码]: [代码][代码]"/pages/landlord/myHouse/myHouse"[代码][代码],[代码][代码] [代码][代码]"contract"[代码][代码]: [代码][代码]"/pages/landlord/contract/contract"[代码][代码],[代码][代码] [代码][代码]"houseControl"[代码][代码]: [代码][代码]"/pages/landlord/houseControl/houseControl"[代码][代码],[代码][代码] [代码][代码]"rent"[代码][代码]: [代码][代码]"/pages/landlord/rent/rent"[代码][代码],[代码][代码] [代码][代码]"personal"[代码][代码]: [代码][代码]"/pages/landlord/personal/personal"[代码][代码] [代码][代码]}[代码][代码]}[代码]index.js [代码]const app = getApp();[代码] [代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]PageCur: [代码][代码]'myHouse'[代码][代码],[代码][代码] [代码][代码]// height: app.globalData.height * 2 + 24,[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面方法[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]NavChange(e) {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]PageCur: e.currentTarget.dataset.cur[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onShareAppMessage() {[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]title: [代码][代码]'我的房屋'[代码][代码],[代码][代码] [代码][代码]// imageUrl: '/images/share.jpg',[代码][代码] [代码][代码]path: [代码][代码]'pages/landlord/myHouse/myHouse'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码] [代码]})[代码] 页面如下 当加载页面 myHouse 在myHouse 页面 onLoad方法却未执行 这个是为什么了 如何调用onload呢
2019-07-12 - thirdScriptError doLogin is not defined;
在onLoad里面调用function 报错 提示 [代码]thirdScriptError[代码][代码]doLogin is not defined;at [代码][代码]"pages/common/login/login"[代码] [代码]page lifeCycleMethod onLoad [代码][代码]function[代码][代码]ReferenceError: doLogin is not defined[代码] js代码如下 [代码]const app = getApp();[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]topnavData: {[代码][代码] [代码][代码]title: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]showCapsule: 0, [代码][代码]//是否显示返回按钮 1表示显示 0表示不显示[代码][代码] [代码][代码]},[代码][代码] [代码][代码]// 此页面 页面内容距最顶部的距离[代码][代码] [代码][代码]height: app.globalData.height * 2 + 24,[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码][代码](options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]phone = wx.getStorageSync([代码][代码]"phone"[代码][代码]);[代码][代码] [代码][代码]var[代码] [代码]password = wx.getStorageSync([代码][代码]"password"[代码][代码]);[代码][代码] [代码][代码]// console.log(phone, password);[代码][代码] [代码][代码]if[代码] [代码](phone != [代码][代码]null[代码] [代码]|| password != [代码][代码]null[代码][代码]) {[代码][代码] [代码][代码]doLogin(phone, password);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]toRegister: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]wx.navigateTo({[代码][代码] [代码][代码]url: [代码][代码]'/pages/common/register/register'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面初次渲染完成[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onReady: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面显示[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onShow: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面隐藏[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onHide: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面卸载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onUnload: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面相关事件处理函数--监听用户下拉动作[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onPullDownRefresh: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面上拉触底事件的处理函数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onReachBottom: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 用户点击右上角分享[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onShareAppMessage: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]//页面跳转[代码][代码] [代码][代码]goIndex: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 登录[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]doLogin: [代码][代码]function[代码] [代码](phone, password) {[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]method: [代码][代码]'POST'[代码][代码],[代码][代码] [代码][代码]url: app.globalUrl.url + [代码][代码]'/open/api/login/login'[代码][代码],[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]'phone'[代码][代码]: phone,[代码][代码] [代码][代码]'password'[代码][代码]: password,[代码][代码] [代码][代码]'openid'[代码][代码]: app.globalData.openid[代码][代码] [代码][代码]},[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type'[代码][代码]: [代码][代码]'application/x-www-form-urlencoded'[代码] [代码]// 默认值[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]var[代码] [代码]data = res.data;[代码][代码] [代码][代码]console.log(data.data);[代码][代码] [代码][代码]if[代码] [代码](0 == data.result) {[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'token'[代码][代码], data.data.token);[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'user'[代码][代码], user);[代码][代码] [代码][代码]//页面跳转[代码][代码] [代码][代码]var[代码] [代码]roleName = wx.getStorageSync([代码][代码]'roleName'[代码][代码]);[代码][代码] [代码][代码]var[代码] [代码]url = [代码][代码]''[代码][代码];[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]"landlord"[代码] [代码]== roleName) {[代码][代码] [代码][代码]url = [代码][代码]'/pages/landlord/index/index'[代码][代码];[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码]([代码][代码]"agent"[代码] [代码]== roleName) {[代码][代码] [代码][代码]url = [代码][代码]'/pages/agent/index/index'[代码][代码];[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]url = [代码][代码]'/pages/tenants/index/index'[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log(url);[代码][代码] [代码][代码]wx.switchTab({[代码][代码] [代码][代码]url: url,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]var[代码] [代码]msg = res.data.msg;[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: msg,[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]duration: 9000 [代码][代码]//持续的时间[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]formSubmit: [代码][代码]function[代码][代码](e) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]// console.log(e.detail.value);[代码][代码] [代码][代码]//格式 Object {userName: "user", userPassword: "password"}[代码][代码] [代码][代码]//获得表单数据[代码][代码] [代码][代码]var[代码] [代码]objData = e.detail.value;[代码][代码] [代码][代码]// 同步方式存储表单数据[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'phone'[代码][代码], objData.phone);[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'password'[代码][代码], objData.password);[代码][代码] [代码][代码]doLogin(objData.phone, objData.password);[代码][代码] [代码][代码]},[代码] [代码]})[代码]我就不明白 这个function 要如何定义 还是 onLoad不能执行function?? 求解答
2019-06-26 - Error: APP-SERVICE-SDK:setStorageSync:fa
- 当前 Bug 的表现(可附上截图) 真机调试 报错 [图片] [publib]:1 thirdScriptError APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync;at pages/login/login page doLogin function Error: APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync at setStorageSync ([publib]:1:494345) at r.(anonymous function) ([publib]:1:495730) at Object.Bd.(anonymous function) [as setStorageSync] ([publib]:1:496330) at Object.<anonymous> ([publib]:1:323255) at Object.<anonymous> ([publib]:1:712488) at Function.<anonymous> ([publib]:1:712584) at Object.<anonymous> ([publib]:1:281976) at s.doLogin (weapp:///pages/login/login.js:103:8) at s.<anonymous> ([publib]:1:937239) at s.R ([publib]:1:932618) - 预期表现 存储数据 - 复现路径 - 提供一个最简复现 Demo wx.setStorageSync('phone', objData.phone); wx.setStorageSync('password', objData.password);
2019-02-25 - 真机调试 闪退
- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 手机扫描打开 - 复现路径 - 提供一个最简复现 Demo 手机扫描闪退 更新 安卓机 安装包 已解决 https://developers.weixin.qq.com/community/develop/doc/0008c20e5583d8579318596c65b801
2019-02-13 - appServiceSDKScriptError 地图调用异常
- 当前 Bug 的表现(可附上截图) 异常消息: [代码][代码]appServiceSDKScriptError Cannot read property 'mode' of undefined;at api onAppEnterBackground callback function TypeError: Cannot read property 'mode' of undefined at Bt.<anonymous> (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:525987) at Bt.emit (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:305615) at Object.emit (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:324480) at Bt.<anonymous> (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:330528) at Bt.emit (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:305657) at Object.emit (http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:324480) at http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:325658 at http://127.0.0.1:59825/appservice/__dev__/WAService.js:1:262652 at e (http://127.0.0.1:59825/appservice/appservice?t=1547280528952:1658:2640) at n.registerCallback.t (http://127.0.0.1:59825/appservice/appservice?t=1547280528952:1658:2903) [代码][代码]- 预期表现 - 复现路径 - 提供一个最简复现 Demo js 运行如下代码 就报错 [代码]positionChoose: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.chooseLocation({[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]positionData: res.name || res.address[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// fail[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// complete[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码]},[代码]
2019-01-12