微信小程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

noLoginIndex.js 1.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // pages/noLoginIndex.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. showList:false,
  8. showListText:'更多',
  9. num:1
  10. },
  11. openView(){
  12. var that = this;
  13. let num = that.data.num;
  14. console.log((num%2));
  15. if( (num%2) > 0 ){
  16. num++;
  17. that.setData({
  18. showList:true,
  19. showListText:'收起',
  20. num:num
  21. })
  22. }else{
  23. num++;
  24. that.setData({
  25. showList:false,
  26. showListText:'更多',
  27. num:num
  28. })
  29. }
  30. },
  31. goLogin(){
  32. wx.showModal({
  33. title: '提示',
  34. content: '登录后可使用全部功能,是否前往登录?',
  35. success (res) {
  36. if (res.confirm) {
  37. wx.navigateTo({
  38. url: 'user/login/login',
  39. })
  40. } else if (res.cancel) {
  41. console.log('用户点击取消')
  42. }
  43. }
  44. })
  45. },
  46. /**
  47. * 生命周期函数--监听页面加载
  48. */
  49. onLoad(options) {
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide() {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload() {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh() {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom() {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage() {
  85. }
  86. })