setting-message.js 928 Bytes
import wx from '../../utils/wx.js';

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    showMsg: {
      type: Boolean,
      value: false
    },
    messageTitle: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    showMsg: false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    closeMsg: function() {
      this.setData({
        showMsg: false
      })
    },
    /**
     * 微信修改打开设置的机制之后按钮班定了打开设置的方法
     */
    openSetting: function () {
      wx.openSetting().then(res => {
        this.setData({
          showMsg: false
        });
        this.triggerEvent('myevent', 
        { 
          hasLocationSetting: res.authSetting['scope.userLocation'] || false,
          hasImageSetting: res.authSetting['scope.writePhotosAlbum'] || false
        }, 
        {});
      });
    },
  }
})