抖音b端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

171 Zeilen
4.0 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. ttBalanceUrl: "", //余额链接
  20. ttImportUrl: "", //进件链接
  21. },
  22. toDetail() {
  23. tt.navigateTo({
  24. url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}`
  25. })
  26. },
  27. phone(e) {
  28. tt.makePhoneCall({
  29. phoneNumber: e.currentTarget.dataset.phone
  30. })
  31. },
  32. toExit() {
  33. console.log(1)
  34. tt.reLaunch({
  35. url: '/pages/index/index',
  36. })
  37. },
  38. showVersion: function () {
  39. /**
  40. * 长按显示版本号
  41. */
  42. let that = this;
  43. if (that.data.flag == 'hidden') {
  44. that.setData({
  45. flag: 'show'
  46. });
  47. }
  48. console.log(that.data.flag)
  49. },
  50. //获取提现信息
  51. getTx() {
  52. Http.get({
  53. url: config.api.balance
  54. }).then(res => {
  55. console.log(111)
  56. this.setData({
  57. cashOutCount: res.data.cashOutCount, //当日已提现次数
  58. cashOutNumber: res.data.cashOutNumber, // 可提现余额
  59. cashOutSupport: res.data.cashOutSupport, // 1 - 支持提现 0-不支持提现
  60. cashOutLimit: res.data.cashOutLimit, // 当日提现次数限制
  61. withdrawNun: res.data.cashOutLimit - res.data.cashOutCount,
  62. cashOutOpenHeadImg: res.data.cashOutOpenHeadImg,
  63. cashOutOpenNickName: res.data.cashOutOpenNickName
  64. })
  65. }).catch(err => {
  66. // tt.showToast({
  67. // title: err.message,
  68. // icon:"none",
  69. // duration:2000
  70. // })
  71. })
  72. },
  73. onLoad() {
  74. // this.findJurisdiction()
  75. },
  76. onShow() {
  77. // this.getTx()
  78. app.globalData.userInfo().then(res => {
  79. this.setData({
  80. userInfo: res
  81. })
  82. })
  83. // this.setData({
  84. // appVersion:appVersion
  85. // })
  86. console.log(app.globalData.isAdmin);
  87. },
  88. //提现按钮
  89. withdraw() {
  90. console.log(this.data.cashOutOpenNickName)
  91. tt.navigateTo({
  92. url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`,
  93. })
  94. },
  95. /**
  96. * 查询是否有修改账户权限
  97. */
  98. findJurisdiction() {
  99. Http.get({
  100. url: config.api.permitModifiy,
  101. }).then(res => {
  102. console.log(res)
  103. /**
  104. * data:true
  105. * 如有:显示
  106. * 没有;不显示
  107. */
  108. if (res && res.data == true) {
  109. this.setData({
  110. haveData: true,
  111. })
  112. } else {
  113. this.setData({
  114. haveData: false,
  115. })
  116. }
  117. }).catch(error => {
  118. console.log(error)
  119. })
  120. },
  121. goWebView(e) {
  122. tt.showLoading({
  123. title: "获取中!",
  124. });
  125. let type = e.currentTarget.dataset.type
  126. this.findAccountById(this.data.userInfo.merchant_id, type)
  127. },
  128. /**
  129. * 查询收款账户状态
  130. */
  131. findAccountById(merchant_id, type) {
  132. Http.get({
  133. url: config.api.findTt,
  134. data: {
  135. id: merchant_id,
  136. urlType: type
  137. }
  138. }).then(res => {
  139. tt.hideLoading()
  140. console.log();
  141. /**
  142. * receiverAccount
  143. * 如有:已设置收款账户
  144. * 没有;未设置收款账户
  145. */
  146. tt.setClipboardData({
  147. data: res.data,
  148. success: function () {
  149. tt.showToast({
  150. title: '复制成功 请到浏览器打开',
  151. icon: "none",
  152. duration: 3000,
  153. })
  154. }
  155. })
  156. }).catch(err => {
  157. tt.hideLoading()
  158. tt.showToast({
  159. title: err.message,
  160. icon: "none",
  161. duration: 2000
  162. })
  163. })
  164. }
  165. })