抖音b端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

115 satır
2.9 KiB

  1. // pages/Add/index.js
  2. const config = require('../../config/config.js')
  3. const Http = require('../../utils/http.js')
  4. const HttpBasics = require('../../utils/HttpBasics.js')
  5. const util = require('../../utils/util.js')
  6. var app = getApp()
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. paramData:null,
  13. isAdmin:null,
  14. userData:null,
  15. phoneIf:false,
  16. businessId:''
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function (options) {
  22. console.log(options,88888888888888888)
  23. let phoneIf = options.phone != 'undefined' ? true : false
  24. options.phone = (options.phone != 'undefined' ? options.phone:'未绑定')
  25. this.setData({
  26. paramData:options,
  27. phoneIf
  28. });
  29. console.log(options,"options")
  30. this.getUserInfo()
  31. },
  32. getUserInfo(){
  33. let _this=this;
  34. app.globalData.userInfo().then(res => {
  35. console.log(res)
  36. if (res.businessId == 3){
  37. _this.setData({
  38. businessId:3
  39. })
  40. }
  41. _this.setData({
  42. userData:res
  43. })
  44. }).catch(err=>{
  45. tt.showToast({
  46. title: '商户信息获取出错',
  47. icon: 'none',
  48. duration: 2000,
  49. mask: false
  50. });
  51. })
  52. },
  53. gotoScore(e){
  54. // console.log(e.currentTarget.id,6666666666)
  55. if (e.currentTarget.id == '1') {
  56. tt.navigateTo({
  57. url: `/pages/operation/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&isAdmin=${this.data.userData.is_admin}&merchant_id=${this.data.userData.merchant_id}&businessId=${this.data.businessId}`
  58. })
  59. } else {
  60. tt.navigateTo({
  61. url: `/pages/exchange/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&merchant_id=${this.data.userData.merchant_id}`
  62. })
  63. }
  64. },
  65. /**
  66. * 生命周期函数--监听页面初次渲染完成
  67. */
  68. onReady: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面显示
  72. */
  73. onShow: function () {
  74. },
  75. /**
  76. * 生命周期函数--监听页面隐藏
  77. */
  78. onHide: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload: function () {
  84. },
  85. /**
  86. * 页面相关事件处理函数--监听用户下拉动作
  87. */
  88. onPullDownRefresh: function () {
  89. },
  90. /**
  91. * 页面上拉触底事件的处理函数
  92. */
  93. onReachBottom: function () {
  94. },
  95. /**
  96. * 用户点击右上角分享
  97. */
  98. onShareAppMessage: function () {
  99. }
  100. })