C端集团版
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

86 lignes
1.8 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  2. var config = require("../../config/config.js");
  3. var app = getApp();
  4. const Http = require("../../utils/HttpBasics");
  5. Page({
  6. data: {
  7. navigationBarHeight,
  8. canIUse: wx.canIUse("button.open-type.getUserInfo"),
  9. curPhone:'',
  10. },
  11. onLoad: function(options) {
  12. var that = this;
  13. Http.get({
  14. url: config.api.marketicon,
  15. data: {
  16. appId: config.weapp.AppId
  17. }
  18. }).then(res => {
  19. that.setData({
  20. mallImgUrl: res.data.mallImgUrl
  21. });
  22. wx.setNavigationBarTitle({
  23. title: res.data.mallName
  24. })
  25. })
  26. .catch(err => {
  27. wx.showToast({
  28. title: err.errMsg,
  29. icon: 'none',
  30. duration: 2000,
  31. mask: false
  32. });
  33. })
  34. },
  35. backHome: function () {
  36. wx.switchTab({
  37. url: '/pages/index/index',
  38. })
  39. },
  40. bindGetUserInfo: function (e) {
  41. let that = this;
  42. var iv = e.detail.iv;
  43. var encryptedData = e.detail.encryptedData;
  44. wx.getUserInfo({
  45. success: function (res) {
  46. Http.post({
  47. url: config.api.getUserInfo,
  48. data: {
  49. encryptedData: encryptedData,
  50. iv: iv
  51. }
  52. })
  53. .then(
  54. function (res) {
  55. console.log("授权成功")
  56. wx.switchTab({
  57. url: `/pages/users/users`
  58. })
  59. },
  60. function (error) {
  61. console.log(error)
  62. wx.showToast({
  63. title: "请授权个人信息",
  64. icon: "none"
  65. });
  66. }
  67. )
  68. .catch(err => {
  69. wx.showToast({
  70. title: err.errMsg,
  71. icon: 'none',
  72. duration: 2000,
  73. mask: false
  74. });
  75. })
  76. }
  77. })
  78. },
  79. });