抖音b端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 line
1.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. date: null,
  9. date2: null,
  10. codeUrl:'',
  11. today:'',//当天日期
  12. },
  13. bindDateChange1: function(e) {
  14. this.setData({
  15. date: e.detail.value,
  16. })
  17. },
  18. bindDateChange2: function(e) {
  19. this.setData({
  20. date2: e.detail.value
  21. })
  22. },
  23. onLoad(){
  24. let date = new Date;
  25. let year = date.getFullYear();
  26. var month = '';
  27. let day = date.getDate();
  28. if(day<10){
  29. day = '0'+day
  30. }
  31. if (date.getMonth() + 1 < 10) {
  32. var month = '0' + (date.getMonth() + 1);
  33. } else {
  34. var month = date.getMonth() + 1;
  35. }
  36. this.setData({
  37. date: year + '-' + month + '-' + day,
  38. date2: year + '-' + month + '-' + day,
  39. today: year + '-' + month + '-' + day
  40. })
  41. },
  42. onShow(){
  43. },
  44. mode(){
  45. wx.hideLoading();
  46. tt.showLoading({
  47. title: '加载中...',
  48. })
  49. console.log(config.apiPrefix);
  50. Http.get({
  51. url:config.api.exportUrl,
  52. data:{
  53. verifyStartDate:this.data.date,
  54. verifyEndDate:this.data.date2
  55. }
  56. }).then(res=>{
  57. tt.hideLoading();
  58. if(res.data){
  59. this.setData({
  60. codeUrl:config.apiPrefix+res.data
  61. })
  62. }
  63. }).catch(err=>{
  64. wx.hideLoading();
  65. tt.showToast({
  66. title: err.message?err.message:err.data,
  67. icon:"none",
  68. duration:2000
  69. })
  70. })
  71. },
  72. goWebView(e){
  73. let this_ = this;
  74. tt.setClipboardData({
  75. data: this_.data.codeUrl,
  76. success: function() {
  77. tt.showToast({
  78. title: '复制成功 请到浏览器打开',
  79. icon: "none",
  80. duration: 3000,
  81. })
  82. }
  83. })
  84. },
  85. })