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

56 行
1.2 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. wx.setNavigationBarTitle({
  21. title: res.data.mallName
  22. })
  23. });
  24. },
  25. bindGetUserInfo: function(e) {
  26. console.log(e);
  27. var iv = e.detail.iv;
  28. var encryptedData = e.detail.encryptedData;
  29. console.log(iv);
  30. console.log(encryptedData);
  31. Http.post({
  32. url: config.api.getUserInfo,
  33. data: {
  34. encryptedData: encryptedData,
  35. iv: iv
  36. }
  37. }).then(
  38. function(res) {
  39. console.log(res);
  40. console.log("授权个人信息返回的数据")
  41. //返回主页
  42. wx.switchTab({
  43. url: "/pages/index/index"
  44. });
  45. },
  46. function(error) {
  47. wx.showToast({
  48. title: "请授权个人信息",
  49. icon: "none"
  50. });
  51. }
  52. );
  53. }
  54. });