12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const app = getApp();
- Page({
- data:{
- currentTime:10,
- prevUrl:'',
- },
- onLoad:function(options){
- app.getMakerInfo( res =>{
- this.setData( {prevUrl: res.contract_img })
- if( !res.contract_img ){
- this.shartTick()
- }
- })
- },
- onReady:function(){
- // 页面渲染完成
- },
- gotoSign(){
- wx.navigateTo({
- url: '/pages/tool/sign/signature',
- })
- },
- preview(){
- let previewUrl =this.data.prevUrl||app.globalData.signUrl;
- wx.previewImage({
- urls: [previewUrl], //预览图片 数组
- })
- },
- shartTick:function(){
- let currentTime= 10
- let _this = this
- let interval = setInterval(function() {
- currentTime--;
- _this.setData({ currentTime})
- if( currentTime <1){
- clearInterval( interval )
- }
- console.log( currentTime )
- }, 1000)
- // 页面显示
- },
- onHide:function(){
- // 页面隐藏
- },
- onUnload:function(){
- // 页面关闭
- }
- })
|