博客
关于我
微信小程序--自定义新用户引导页面
阅读量:418 次
发布时间:2019-03-06

本文共 1324 字,大约阅读时间需要 4 分钟。

效果展示

Demo代码

wxml

添加「海轰Pro」小程序 坚持每天学习
1
点击右上角
2
点击“添加我的小程序”
3
回到微信首页下拉聊天列表,
3
从“我的小程序”里打开“海轰Pro”
我的小程序
海轰Pro
我的小程序
小程序
记住了 我去试试
测试界面

js

//index.js//获取应用实例const app = getApp()Page({  data:{    isTiptrue: true,  },  onLoad: function (query) {      let firstOpen = wx.getStorageSync("loadOpen")      console.log("是否首次打开本页面==",firstOpen)      if (firstOpen == undefined || firstOpen == '') { //根据缓存周期决定是否显示新手引导        this.setData({          isTiptrue: true,        })      } else {        this.setData({          isTiptrue: false,        })      }   },  closeThis(e){    console.log("s")      wx.setStorage({        key: 'loadOpen',        data: 'OpenTwo'      })      this.setData({        isTiptrue:false      })    },})

wxss

完整源码获取途径见文末引言

转载地址:http://mbxuz.baihongyu.com/

你可能感兴趣的文章