C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 line
1.0 KiB

  1. var config = require('../../config/config.js');
  2. const Http = require("../../utils/HttpBasics");
  3. var app = getApp();
  4. Page({
  5. data: {
  6. canIUse: wx.canIUse('button.open-type.getPhoneNumber')
  7. },
  8. onLoad: function(options) {
  9. var that = this;
  10. },
  11. getPhoneNumber: function(e) {
  12. var that = this;
  13. var iv = e.detail.iv;
  14. var encryptedData = e.detail.encryptedData;
  15. Http.post({
  16. url: config.api.getUserPhone,
  17. data: {
  18. encryptedData: encryptedData,
  19. iv: iv,
  20. }
  21. })
  22. .then(function(res) {
  23. console.log(res);
  24. app.globalData.phone = res.data.phone;
  25. wx.showToast({
  26. title: res.data.msg,
  27. icon: "success",
  28. success: function(res) {
  29. wx.redirectTo({
  30. url: '../login/login',
  31. })
  32. }
  33. })
  34. },
  35. function(error) {
  36. wx.showToast({
  37. title: '请重新授权手机号',
  38. icon: "none",
  39. })
  40. })
  41. }
  42. })