|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- // const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync() : {}
- // let appVersion = extConfig.appVersion;
- var app = getApp();
- const config = require('../../config/config.js')
- const Http = require('../../utils/HttpBasics.js')
-
- Page({
- data: {
- cashOutOpenHeadImg:"",//用户头像
- cashOutOpenNickName:"",//用户名
- cashOutCount: "",//当日已提现次数
- cashOutNumber: "", // 可提现余额
- cashOutSupport: "",// 1 - 支持提现 0-不支持提现
- cashOutLimit: "",// 当日提现次数限制
- city: '',
- userInfo: {},
- flag: 'hidden',
- isSet:false,
- haveData: false,
- ttBalanceUrl:"",//余额链接
- ttImportUrl:"",//进件链接
-
- },
-
- toDetail() {
- tt.navigateTo({
- url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}`
- })
- },
- phone(e){
- tt.makePhoneCall({
- phoneNumber: e.currentTarget.dataset.phone
- })
- },
- toExit() {
- console.log(1)
- tt.reLaunch({
- url: '/pages/index/index',
- })
- },
- showVersion: function () {
- /**
- * 长按显示版本号
- */
- let that = this;
- if (that.data.flag == 'hidden') {
- that.setData({
- flag: 'show'
- });
- }
- console.log(that.data.flag)
- },
- //获取提现信息
- getTx(){
- Http.get({
- url: config.api.balance
- }).then(res=>{
- console.log(111)
- this.setData({
- cashOutCount: res.data.cashOutCount,//当日已提现次数
- cashOutNumber: res.data.cashOutNumber, // 可提现余额
- cashOutSupport: res.data.cashOutSupport,// 1 - 支持提现 0-不支持提现
- cashOutLimit: res.data.cashOutLimit,// 当日提现次数限制
- withdrawNun: res.data.cashOutLimit - res.data.cashOutCount,
- cashOutOpenHeadImg: res.data.cashOutOpenHeadImg,
- cashOutOpenNickName: res.data.cashOutOpenNickName
- })
- }).catch(err=>{
- // tt.showToast({
- // title: err.message,
- // icon:"none",
- // duration:2000
- // })
- })
- },
- onLoad(){
- // this.findJurisdiction()
- },
- onShow(){
- // this.getTx()
- app.globalData.userInfo().then(res => {
- this.setData({
- userInfo: res
- })
- })
- // this.setData({
- // appVersion:appVersion
- // })
- },
- //提现按钮
- withdraw(){
- console.log(this.data.cashOutOpenNickName)
- tt.navigateTo({
- url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`,
- })
- },
- /**
- * 查询是否有修改账户权限
- */
- findJurisdiction(){
- Http.get({
- url: config.api.permitModifiy,
- }).then(res => {
- console.log(res)
- /**
- * data:true
- * 如有:显示
- * 没有;不显示
- */
- if (res && res.data == true) {
- this.setData({
- haveData: true,
- })
- } else {
- this.setData({
- haveData: false,
- })
- }
- }).catch(error => {
- console.log(error)
- })
- },
-
- goWebView(e){
- tt.showLoading({
- title: "获取中!",
- });
- let type = e.currentTarget.dataset.type
- this.findAccountById(this.data.userInfo.merchant_id,type)
-
- },
-
- /**
- * 查询收款账户状态
- */
- findAccountById(merchant_id,type){
- Http.get({
- url: config.api.findTt,
- data:{
- id: merchant_id,
- urlType:type
- }
- }).then(res=>{
- tt.hideLoading()
- console.log();
- /**
- * receiverAccount
- * 如有:已设置收款账户
- * 没有;未设置收款账户
- */
- tt.setClipboardData({
- data: res.data,
- success: function() {
- tt.showToast({
- title: '复制成功 请到浏览器打开',
- icon: "none",
- duration: 3000,
- })
- }
- })
- }).catch(err=>{
- tt.hideLoading()
- tt.showToast({
- title: err.message,
- icon:"none",
- duration:2000
- })
- })
- }
- })
|