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

170 行
3.9 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. },
  87. //提现按钮
  88. withdraw(){
  89. console.log(this.data.cashOutOpenNickName)
  90. tt.navigateTo({
  91. url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`,
  92. })
  93. },
  94. /**
  95. * 查询是否有修改账户权限
  96. */
  97. findJurisdiction(){
  98. Http.get({
  99. url: config.api.permitModifiy,
  100. }).then(res => {
  101. console.log(res)
  102. /**
  103. * data:true
  104. * 如有:显示
  105. * 没有;不显示
  106. */
  107. if (res && res.data == true) {
  108. this.setData({
  109. haveData: true,
  110. })
  111. } else {
  112. this.setData({
  113. haveData: false,
  114. })
  115. }
  116. }).catch(error => {
  117. console.log(error)
  118. })
  119. },
  120. goWebView(e){
  121. tt.showLoading({
  122. title: "获取中!",
  123. });
  124. let type = e.currentTarget.dataset.type
  125. this.findAccountById(this.data.userInfo.merchant_id,type)
  126. },
  127. /**
  128. * 查询收款账户状态
  129. */
  130. findAccountById(merchant_id,type){
  131. Http.get({
  132. url: config.api.findTt,
  133. data:{
  134. id: merchant_id,
  135. urlType:type
  136. }
  137. }).then(res=>{
  138. tt.hideLoading()
  139. console.log();
  140. /**
  141. * receiverAccount
  142. * 如有:已设置收款账户
  143. * 没有;未设置收款账户
  144. */
  145. tt.setClipboardData({
  146. data: res.data,
  147. success: function() {
  148. tt.showToast({
  149. title: '复制成功 请到浏览器打开',
  150. icon: "none",
  151. duration: 3000,
  152. })
  153. }
  154. })
  155. }).catch(err=>{
  156. tt.hideLoading()
  157. tt.showToast({
  158. title: err.message,
  159. icon:"none",
  160. duration:2000
  161. })
  162. })
  163. }
  164. })