抖音小程序C端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

77 rader
1.5 KiB

  1. const app = getApp()
  2. const Http = require("../../utils/HttpBasics");
  3. const config = require("../../config/config");
  4. const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
  5. Page({
  6. data: {
  7. navigationBarHeight,
  8. mallImgUrl:"",
  9. },
  10. backHome(){
  11. tt.reLaunch({
  12. url: "/index/index",
  13. success: (res) => {
  14. app.globalData.selected = 0;
  15. },
  16. fail: (res) => {
  17. },
  18. });
  19. },
  20. back: function() {
  21. tt.navigateBack({
  22. delta: 1,
  23. success: (res) => {
  24. },
  25. fail: (res) => {
  26. },
  27. });
  28. },
  29. bindPhone(e){
  30. console.log(e);
  31. Http.post({
  32. url:config.api.getUserPhone,
  33. data: {
  34. encryptedData: e.detail.encryptedData,
  35. iv: e.detail.iv
  36. }
  37. }).then(res=>{
  38. this.back()
  39. }).catch(err=>{
  40. tt.showToast({
  41. title: err.message?err.message:err.data,
  42. icon: 'none',
  43. duration: 2000,
  44. mask: false
  45. });
  46. })
  47. },
  48. onLoad: function (options) {
  49. Http.get({
  50. url: config.api.marketicon,
  51. data: {
  52. appId: 'ttef6599d8705b49b101'
  53. }
  54. }).then(res => {
  55. this.setData({
  56. mallImgUrl: res.data.mallImgUrl
  57. });
  58. tt.setNavigationBarTitle({
  59. title: res.data.mallName
  60. })
  61. })
  62. .catch(err => {
  63. tt.showToast({
  64. title: err.message?err.message:err.data,
  65. icon: 'none',
  66. duration: 2000,
  67. mask: false
  68. });
  69. })
  70. }
  71. })