agree.js 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const app = getApp();
  2. Page({
  3. data:{
  4. currentTime:10,
  5. prevUrl:'',
  6. },
  7. onLoad:function(options){
  8. app.getMakerInfo( res =>{
  9. this.setData( {prevUrl: res.contract_img })
  10. if( !res.contract_img ){
  11. this.shartTick()
  12. }
  13. })
  14. },
  15. onReady:function(){
  16. // 页面渲染完成
  17. },
  18. gotoSign(){
  19. wx.navigateTo({
  20. url: '/pages/tool/sign/signature',
  21. })
  22. },
  23. preview(){
  24. let previewUrl =this.data.prevUrl||app.globalData.signUrl;
  25. wx.previewImage({
  26. urls: [previewUrl], //预览图片 数组
  27. })
  28. },
  29. shartTick:function(){
  30. let currentTime= 10
  31. let _this = this
  32. let interval = setInterval(function() {
  33. currentTime--;
  34. _this.setData({ currentTime})
  35. if( currentTime <1){
  36. clearInterval( interval )
  37. }
  38. console.log( currentTime )
  39. }, 1000)
  40. // 页面显示
  41. },
  42. onHide:function(){
  43. // 页面隐藏
  44. },
  45. onUnload:function(){
  46. // 页面关闭
  47. }
  48. })