南通市网站,免费的wordpress账号,做公装的什么网站好,好看的博客页面这里写目录标题 微信小程序上传头像使用button按钮包裹img 微信小程序内接小程序客服使用button按钮跳转客服 微信小程序上传头像 使用button按钮包裹img
原本思路是只使用image标签再加上chooseImg#xff0c;但发现使用button标签上传头像这种方法更实用。微信小程序文档上… 这里写目录标题 微信小程序上传头像使用button按钮包裹img 微信小程序内接小程序客服使用button按钮跳转客服 微信小程序上传头像 使用button按钮包裹img
原本思路是只使用image标签再加上chooseImg但发现使用button标签上传头像这种方法更实用。微信小程序文档上button的 open-type 功能有很多 buttonstyleborder-radius: 50%;open-typechooseAvatarbindchooseavatargetPropertyPortraitimage stylemargin: 0rpx; src{{headimg?headimg:https://ys.zye.com/upload/touxiang.png }}/image/button// 上传头像getPropertyPortrait(e){var that this;var image e.detail.avatarUrl;// 调用上传函数imageUpload.uploadImage(/api/upload/headimg, image, file, {}).then((response) {console.log(上传成功, response);that.setData({headimg: https://ys.zye.com response.data.pic_path})//上传之后在调用修改头像函数that.updePropertyPortrait(https://ys.zye.com response.data.pic_path);}).catch((error) {console.error(上传失败, error);toast.showError(error.errMsg);});},// 修改头像updePropertyPortrait(pic_path){var that this;var data {token:app.globalData.token,headimg:pic_path}api.post(/api/member/moheadimg, JSON.stringify(data)).then((response) {console.log(修改头像》,response);if(response.code 0){that.getPropertyDetails();}else{toast.showError(response.message);}}).catch((error) {toast.showError(error.errMsg);});},微信小程序内接小程序客服
内接公司内部的小程序客服先在微信公众平台设置小程序客服然后使用button的open-type设置成contact再进行事件对接。 使用button按钮跳转客服 button classcontainedwhdopen-typecontactsend-message-title客服show-message-cardtruebindcontactcontactEventimage classleft_ls srchttps://ys.ziye.com/upload/iocn/kefu.png/imageview classkeda客服/view/buttonPage({// 客服contactEvent(e){console.log(e,客服)console.log(e.detail.path)console.log(e.detail.query)},
})