C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

53 行
1.1 KiB

  1. var config = require("../../config/config.js");
  2. var app = getApp();
  3. const Http = require("../../utils/HttpBasics");
  4. Page({
  5. data: {
  6. canIUse: wx.canIUse("button.open-type.getUserInfo")
  7. },
  8. onLoad: function(options) {
  9. var that = this;
  10. Http.get({
  11. url: config.api.marketicon,
  12. data: {
  13. appId: config.weapp.AppId
  14. }
  15. }).then(res => {
  16. console.log(res.data.mallImgUrl);
  17. that.setData({
  18. mallImgUrl: res.data.mallImgUrl
  19. });
  20. });
  21. },
  22. bindGetUserInfo: function(e) {
  23. console.log(e);
  24. var iv = e.detail.iv;
  25. var encryptedData = e.detail.encryptedData;
  26. console.log(iv);
  27. console.log(encryptedData);
  28. Http.post({
  29. url: config.api.getUserInfo,
  30. data: {
  31. encryptedData: encryptedData,
  32. iv: iv
  33. }
  34. }).then(
  35. function(res) {
  36. console.log(res);
  37. console.log("授权个人信息返回的数据")
  38. //返回主页
  39. wx.switchTab({
  40. url: "/pages/index/index"
  41. });
  42. },
  43. function(error) {
  44. wx.showToast({
  45. title: "请授权个人信息",
  46. icon: "none"
  47. });
  48. }
  49. );
  50. }
  51. });