抖音小程序C端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

75 行
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: function() {
  11. tt.navigateBack({
  12. delta: 1,
  13. success: (res) => {
  14. },
  15. fail: (res) => {
  16. },
  17. });
  18. },
  19. bindGetUserInfo(e){
  20. let that = this;
  21. tt.getUserInfo({
  22. withCredentials:true,
  23. success:function(res){
  24. console.log(res,"res");
  25. Http.post({
  26. url:config.api.getUserInfo,
  27. data: {
  28. encryptedData: res.encryptedData,
  29. iv: res.iv
  30. }
  31. }).then(res=>{
  32. that.backHome()
  33. }).catch(err=>{
  34. tt.showToast({
  35. title: err.message?err.message:err.data,
  36. icon: 'none',
  37. duration: 2000,
  38. mask: false
  39. });
  40. })
  41. },
  42. fail(err) {
  43. console.log(err,` 调用失败`);
  44. },
  45. })
  46. },
  47. onLoad: function (options) {
  48. Http.get({
  49. url: config.api.marketicon,
  50. data: {
  51. appId: 'ttef6599d8705b49b101'
  52. }
  53. }).then(res => {
  54. this.setData({
  55. mallImgUrl: res.data.mallImgUrl
  56. });
  57. tt.setNavigationBarTitle({
  58. title: res.data.mallName
  59. })
  60. })
  61. .catch(err => {
  62. tt.showToast({
  63. title: err.message?err.message:err.data,
  64. icon: 'none',
  65. duration: 2000,
  66. mask: false
  67. });
  68. })
  69. }
  70. })