抖音B端厂库
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.

157 lignes
3.7 KiB

  1. // const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync() : {}
  2. // let appVersion = extConfig.appVersion;
  3. var app = getApp();
  4. const config = require('../../config/config.js')
  5. const Http = require('../../utils/HttpBasics.js')
  6. Page({
  7. data: {
  8. cashOutOpenHeadImg:"",//用户头像
  9. cashOutOpenNickName:"",//用户名
  10. cashOutCount: "",//当日已提现次数
  11. cashOutNumber: "", // 可提现余额
  12. cashOutSupport: "",// 1 - 支持提现 0-不支持提现
  13. cashOutLimit: "",// 当日提现次数限制
  14. city: '',
  15. userInfo: {},
  16. flag: 'hidden',
  17. isSet:false,
  18. haveData: false
  19. },
  20. toDetail() {
  21. tt.navigateTo({
  22. url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}`
  23. })
  24. },
  25. phone(e){
  26. tt.makePhoneCall({
  27. phoneNumber: e.currentTarget.dataset.phone
  28. })
  29. },
  30. toExit() {
  31. console.log(1)
  32. tt.reLaunch({
  33. url: '/pages/login/login',
  34. })
  35. },
  36. showVersion: function () {
  37. /**
  38. * 长按显示版本号
  39. */
  40. let that = this;
  41. if (that.data.flag == 'hidden') {
  42. that.setData({
  43. flag: 'show'
  44. });
  45. }
  46. console.log(that.data.flag)
  47. },
  48. //获取提现信息
  49. getTx(){
  50. Http.get({
  51. url: config.api.balance
  52. }).then(res=>{
  53. console.log(111)
  54. this.setData({
  55. cashOutCount: res.data.cashOutCount,//当日已提现次数
  56. cashOutNumber: res.data.cashOutNumber, // 可提现余额
  57. cashOutSupport: res.data.cashOutSupport,// 1 - 支持提现 0-不支持提现
  58. cashOutLimit: res.data.cashOutLimit,// 当日提现次数限制
  59. withdrawNun: res.data.cashOutLimit - res.data.cashOutCount,
  60. cashOutOpenHeadImg: res.data.cashOutOpenHeadImg,
  61. cashOutOpenNickName: res.data.cashOutOpenNickName
  62. })
  63. }).catch(err=>{
  64. tt.showToast({
  65. title: err.message,
  66. icon:"none",
  67. duration:2000
  68. })
  69. })
  70. },
  71. onLoad(){
  72. // this.findJurisdiction()
  73. },
  74. onShow(){
  75. this.getTx()
  76. app.globalData.userInfo().then(res => {
  77. this.setData({
  78. userInfo: res
  79. })
  80. console.log(this.data.userInfo)
  81. if (this.data.userInfo.merchant_id){
  82. this.findAccountById(this.data.userInfo.merchant_id);
  83. }
  84. })
  85. // this.setData({
  86. // appVersion:appVersion
  87. // })
  88. },
  89. //提现按钮
  90. withdraw(){
  91. console.log(this.data.cashOutOpenNickName)
  92. tt.navigateTo({
  93. url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`,
  94. })
  95. },
  96. /**
  97. * 查询是否有修改账户权限
  98. */
  99. findJurisdiction(){
  100. Http.get({
  101. url: config.api.permitModifiy,
  102. }).then(res => {
  103. console.log(res)
  104. /**
  105. * data:true
  106. * 如有:显示
  107. * 没有;不显示
  108. */
  109. if (res && res.data == true) {
  110. this.setData({
  111. haveData: true,
  112. })
  113. } else {
  114. this.setData({
  115. haveData: false,
  116. })
  117. }
  118. }).catch(error => {
  119. console.log(error)
  120. })
  121. },
  122. /**
  123. * 查询收款账户状态
  124. */
  125. findAccountById(merchant_id){
  126. Http.get({
  127. url: config.api.findAccountById,
  128. data:{
  129. id: merchant_id
  130. }
  131. }).then(res=>{
  132. console.log(res)
  133. /**
  134. * receiverAccount
  135. * 如有:已设置收款账户
  136. * 没有;未设置收款账户
  137. */
  138. if (res && res.data && res.data.receiverAccount){
  139. this.setData({
  140. isSet: true,
  141. receiverAccount: res.data.receiverAccount,
  142. receiverComments: res.data.receiverComments,
  143. receiverType: res.data.receiverType
  144. })
  145. }else{
  146. this.setData({
  147. isSet: false
  148. })
  149. }
  150. }).catch(error=>{
  151. console.log(error)
  152. })
  153. }
  154. })