个人案例
- 菜谱云平台
分享自己喜欢的菜谱,实现了菜谱的增删改查。
菜谱云平台扫码体验
- github中的git地址在哪能找到呢?
找了半天没有找到git地址,在哪藏着呢? [图片]
2019-11-14 - git里面的远程设置怎样删除?
怎样删除远程git呢? [图片]
2019-11-12 - 模拟器上传图片和手机上传图片,地址为啥不同呢?
模拟器上传图片和手机上传图片,地址为啥不同呢? [图片] 代码如下: [代码]// miniprogram/pages/addSelf/addSelf.js[代码][代码]const db=wx.cloud.database()[代码][代码]let fileManage=require([代码][代码]"../../utils/util"[代码][代码])[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]imagePath:[代码][代码]"/images/add.png"[代码][代码],[代码][代码] [代码][代码]region:[[代码][代码]"广东省"[代码][代码],[代码][代码]"广州市"[代码][代码],[代码][代码]"南沙区"[代码][代码]][代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: function (options) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]//添加图片[代码][代码] [代码][代码]addPicture:function(){[代码][代码] [代码][代码]//选择图片[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: [代码][代码]1[代码][代码],[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码],[代码][代码]'compressed'[代码][代码]],[代码][代码] [代码][代码]sourceType: [[代码][代码]'album'[代码][代码],[代码][代码]'camera'[代码][代码]],[代码][代码] [代码][代码]success: (result)=>{[代码] [代码] [代码][代码]this.setData({[代码][代码] [代码][代码]imagePath:result.tempFilePaths[[代码][代码]0[代码][代码]][代码][代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]},[代码][代码] [代码][代码]fail: ()=>{},[代码][代码] [代码][代码]complete: ()=>{}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/*提交表单*/[代码][代码] [代码][代码]bindsubmit:function(e){[代码][代码] [代码][代码]wx.showLoading({[代码][代码] [代码][代码]title: [代码][代码]"正在提交"[代码][代码],[代码][代码] [代码][代码]mask: true[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]//执行上传图片[代码][代码] [代码][代码]let data=e.detail.value;[代码][代码] [代码][代码]this.uploadImage(this.data.imagePath)[代码][代码] [代码][代码]data.image=this.data.imagePath[代码][代码] [代码] [代码] [代码][代码]db.collection([代码][代码]"users"[代码][代码]).add({[代码][代码] [代码][代码]data[代码][代码] [代码][代码]})[代码][代码] [代码][代码].then(res=>{[代码][代码] [代码][代码]wx.hideLoading()[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'成功添加'[代码][代码],[代码][代码] [代码][代码]duration: [代码][代码]1500[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]})[代码][代码] [代码][代码].catch(err=>{[代码][代码] [代码][代码]console.log(err)[代码][代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/*定义上传图片*/[代码][代码] [代码][代码]uploadImage(filename){[代码][代码] [代码][代码]//获取扩展名,并重命名[代码][代码] [代码][代码]let newname=fileManage(filename)[代码][代码] [代码][代码]//上传图片[代码][代码] [代码][代码]wx.cloud.uploadFile({[代码][代码] [代码][代码]cloudPath:[代码][代码]"images/"[代码][代码]+newname,[代码][代码] [代码][代码]filePath:filename,[代码][代码] [代码][代码]success:(res)=>{[代码][代码] [代码][代码]this.setData({[代码][代码] [代码][代码]imagePath:res.fileID[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail:(err)=>{[代码][代码] [代码][代码]console.log(err)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码] [代码]})[代码]
2019-11-11 - 云开发环境配额有效期,到期会释放空间么?
发现小程序的环境配额有效期到2019-12-08, 这个时间之后,环境会被释放么? [图片]
2019-11-11 - 每次上传云函数,总是报错“FunctionName 指定资源不存在”,怎么解决?
[图片]
2019-11-11 - 我的云函数,调用为什么不成功?
总是报错: Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -504002, error message Function not found [batchdelete]; at cloud.callFunction api; 截图如下: [图片] [图片]
2019-11-11 - 小程序中的unionID是什么?
[图片]
2019-11-11 - git报错:invalid authoracation schema,是什么地方问题?
[图片]
2019-11-10 - 我怎么获取不到用户的昵称呢?
我为什么拿不到昵称呢? [图片]
2019-11-10 - 云开发后台有批量删除数据的功能么?
云开发后台有批量删除数据的功能么?找半天没有找到。怎样做到批量删除呢? [图片]
2019-11-10