微信小程序的启动页面问题: 在app.json里面第一项是pages/home/home,第三项是pages/index/index,在提交的体验版中,每次小程序打开出现的页面是home页面,但是审核发布后,每次打开小程序都是index页面,请问这是为什么?
微信开发者工具调用云函数失败,提示没有完成云函数初始化?1. 报错信息: index.js:118 Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -504002, error message errCode: -1 unknown error | errMsg: Cloud API isn't enabled, please call init first 请先调用 init 完成初始化后再调用其他云 API。 2. 代码 [代码]addToDB: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]newData = [代码][代码]this[代码][代码].data;[代码][代码] [代码][代码]var[代码] [代码]statusText = [代码][代码]''[代码][代码];[代码][代码] [代码][代码]if[代码] [代码](newData.status === [代码][代码]'radio1'[代码][代码]) {[代码][代码] [代码][代码]statusText = [代码][代码]'装车送出'[代码][代码];[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]statusText = [代码][代码]'卸车送达'[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log([代码][代码]"准备调用云函数"[代码][代码]);[代码][代码] [代码][代码]wx.cloud.callFunction({[代码][代码] [代码][代码]name: [代码][代码]'db'[代码][代码],[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]type: [代码][代码]'add'[代码][代码],[代码][代码] [代码][代码]carNumber: newData.carNumber,[代码][代码] [代码][代码]driver: newData.driver,[代码][代码] [代码][代码]phoneNumber: newData.phoneNumber,[代码][代码] [代码][代码]distribute: newData.distribute,[代码][代码] [代码][代码]destination: newData.destination,[代码][代码] [代码][代码]thingsName: newData.thingsName,[代码][代码] [代码][代码]manufModel: newData.manufModel,[代码][代码] [代码][代码]number: newData.number,[代码][代码] [代码][代码]status: statusText,[代码][代码] [代码][代码]saveType: [代码][代码]'formData'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'保存成功'[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]setTimeout([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]wx.navigateTo({[代码][代码] [代码][代码]url: [代码][代码]'../table/table'[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}, 1000);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](err) {[代码][代码] [代码][代码]console.log(err);[代码][代码] [代码][代码]console.log([代码][代码]'保存失败'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]uploadData: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]form = [代码][代码]this[代码][代码].data;[代码] [代码] [代码][代码]if[代码][代码](!form.carNumber || !form.driver) {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'表单不能为空'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码] [代码][代码]});[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log(form);[代码] [代码] [代码][代码]this[代码][代码].addToDB();[代码][代码] [代码][代码]}[代码] 3.项目目录 [图片] 4. 云函数控制台报错 [图片]
2019-08-04