123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- const App = getApp();
- Component({
- options: {
- addGlobalClass: true,
- },
- /**
- * 组件的对外属性,是属性名到属性设置的映射表
- */
- properties: {
- k: String,
- },
- /**
- * 组件的内部数据,和 properties 一同用于组件的模板渲染
- */
- data: {
- s: false
- },
- // 组件数据字段监听器,用于监听 properties 和 data 的变化
- observers: {
- },
- lifetimes: {
- attached: function () {
- if (!this.data.k) {
- this.setData({
- s: true
- })
- return
- }
- const agreeYxtk = wx.getStorageSync('agreeYxtk_' + this.data.k)
- if (!agreeYxtk) {
- this.setData({
- s: true
- })
- }
- },
- detached: function () {
- // 在组件实例被从页面节点树移除时执行
- },
- },
- /**
- * 组件的方法列表
- */
- methods: {
- aggree(){
- if (this.data.k) {
- wx.setStorageSync('agreeYxtk_' + this.data.k, true)
- }
- this.setData({
- s: false
- })
- },
- notagree(){
- wx.navigateTo({
- url: '/pages/notagree/index'
- })
- },
- goYstk(e){
- const k = e.currentTarget.dataset.k
- wx.navigateTo({
- url: '/pages/about/index?key=' + k,
- })
- },
- navBack: function () {
- wx.navigateBack({
- delta: 1
- })
- },
- //回主页
- toIndex: function () {
- wx.navigateTo({
- url: '/pages/admin/home/index/index'
- })
- },
- }
- })
|