| @@ -82,6 +82,7 @@ App({ | |||||
| wx.setStorageSync('completionContentCount', res.data.completionContentCount) | wx.setStorageSync('completionContentCount', res.data.completionContentCount) | ||||
| that.globalData.completionContentCount = res.data.completionContentCount | that.globalData.completionContentCount = res.data.completionContentCount | ||||
| }).catch(err => { | }).catch(err => { | ||||
| console.log(err, 'err'); | console.log(err, 'err'); | ||||
| }) | }) | ||||
| @@ -48,7 +48,7 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| makePhoneCall(e){ | |||||
| makePhoneCall(e) { | |||||
| wx.makePhoneCall({ | wx.makePhoneCall({ | ||||
| phoneNumber: e.currentTarget.dataset.phone | phoneNumber: e.currentTarget.dataset.phone | ||||
| }) | }) | ||||
| @@ -97,10 +97,30 @@ Page({ | |||||
| }, | }, | ||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage() { | onShareAppMessage() { | ||||
| const promise = new Promise(resolve => { | |||||
| setTimeout(() => { | |||||
| resolve({ | |||||
| title: '小闲聊' | |||||
| }) | |||||
| }, 500) | |||||
| }) | |||||
| return { | |||||
| title: '小闲聊', | |||||
| promise | |||||
| } | |||||
| }, | |||||
| onShareTimeline() { | |||||
| const promise = new Promise(resolve => { | |||||
| setTimeout(() => { | |||||
| resolve({ | |||||
| title: '小闲聊' | |||||
| }) | |||||
| }, 500) | |||||
| }) | |||||
| return { | |||||
| title: '小闲聊', | |||||
| promise | |||||
| } | |||||
| } | } | ||||
| }) | }) | ||||
| @@ -43,7 +43,7 @@ Page({ | |||||
| const that = this | const that = this | ||||
| return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
| const data = { | const data = { | ||||
| appId: 'wxf288a9b8167ff2ca', | |||||
| appId: 'wxedb9fb309728a9f1', | |||||
| message | message | ||||
| } | } | ||||
| request.post({ | request.post({ | ||||
| @@ -440,10 +440,30 @@ Page({ | |||||
| }, | }, | ||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage() { | onShareAppMessage() { | ||||
| const promise = new Promise(resolve => { | |||||
| setTimeout(() => { | |||||
| resolve({ | |||||
| title: '小闲聊' | |||||
| }) | |||||
| }, 500) | |||||
| }) | |||||
| return { | |||||
| title: '小闲聊', | |||||
| promise | |||||
| } | |||||
| }, | |||||
| onShareTimeline() { | |||||
| const promise = new Promise(resolve => { | |||||
| setTimeout(() => { | |||||
| resolve({ | |||||
| title: '小闲聊' | |||||
| }) | |||||
| }, 500) | |||||
| }) | |||||
| return { | |||||
| title: '小闲聊', | |||||
| promise | |||||
| } | |||||
| } | } | ||||
| }) | }) | ||||
| @@ -29,19 +29,28 @@ Page({ | |||||
| this.checkUserInfo() | this.checkUserInfo() | ||||
| } | } | ||||
| const that = this | const that = this | ||||
| app.userInfoCallback = res => { | |||||
| console.log(res, 'userInfoCallback') | |||||
| that.setData({ | |||||
| userInfo: res.data, | |||||
| isPhone: that.data.userInfo.phone ? true : false | |||||
| }) | |||||
| if (app.globalData.noticeText) { | |||||
| if (!this.data.checkUserInfo) { | |||||
| app.userInfoCallback = res => { | |||||
| console.log(res, 'userInfoCallback') | |||||
| that.setData({ | that.setData({ | ||||
| noticeText: app.globalData.noticeText | |||||
| userInfo: res.data, | |||||
| isPhone: that.data.userInfo.phone ? true : false | |||||
| }) | }) | ||||
| if (app.globalData.noticeText) { | |||||
| that.setData({ | |||||
| noticeText: app.globalData.noticeText | |||||
| }) | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| onShow() { | |||||
| if (!this.data.checkUserInfo) { | |||||
| this.getNoticeText() | |||||
| } | |||||
| }, | |||||
| getUserProfile() { | getUserProfile() { | ||||
| // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 | // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 | ||||
| wx.getUserProfile({ | wx.getUserProfile({ | ||||
| @@ -226,6 +235,31 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| /** | |||||
| * @description 获取通知栏信息文本 | |||||
| * @returns list | |||||
| */ | |||||
| getNoticeText() { | |||||
| const that = this | |||||
| request.get({ | |||||
| url: '/api/notice/list' | |||||
| }).then(res => { | |||||
| console.log(res, 'getNoticeText'); | |||||
| let noticeText = '' | |||||
| res.data.forEach((item, index) => { | |||||
| noticeText += index + 1 + '、' + item.content + ' ' | |||||
| }) | |||||
| app.globalData.noticeText = noticeText | |||||
| that.setData({ | |||||
| noticeText: noticeText | |||||
| }) | |||||
| // 检查用户信息 | |||||
| that.checkUserInfo() | |||||
| }).catch(err => { | |||||
| console.log(err, 'err'); | |||||
| }) | |||||
| }, | |||||
| onShareAppMessage() { | onShareAppMessage() { | ||||
| const promise = new Promise(resolve => { | const promise = new Promise(resolve => { | ||||
| setTimeout(() => { | setTimeout(() => { | ||||
| @@ -236,7 +270,6 @@ Page({ | |||||
| }) | }) | ||||
| return { | return { | ||||
| title: '小闲聊', | title: '小闲聊', | ||||
| path: '/pages/index/index', | |||||
| promise | promise | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -250,7 +283,6 @@ Page({ | |||||
| }) | }) | ||||
| return { | return { | ||||
| title: '小闲聊', | title: '小闲聊', | ||||
| path: '/pages/index/index', | |||||
| promise | promise | ||||
| } | } | ||||
| } | } | ||||
| @@ -33,9 +33,9 @@ class request { | |||||
| /** | /** | ||||
| * @description 小程序appId | * @description 小程序appId | ||||
| * @returns {string} wxf288a9b8167ff2ca | |||||
| * @returns {string} wxedb9fb309728a9f1 | |||||
| */ | */ | ||||
| appId = 'wxf288a9b8167ff2ca'; | |||||
| appId = 'wxedb9fb309728a9f1'; | |||||
| /** | /** | ||||
| * @description get | * @description get | ||||
| @@ -31,7 +31,7 @@ | |||||
| "simulatorPluginLibVersion": {}, | "simulatorPluginLibVersion": {}, | ||||
| "condition": {}, | "condition": {}, | ||||
| "srcMiniprogramRoot": "miniprogram/", | "srcMiniprogramRoot": "miniprogram/", | ||||
| "appid": "wxf288a9b8167ff2ca", | |||||
| "appid": "wxedb9fb309728a9f1", | |||||
| "libVersion": "2.31.0", | "libVersion": "2.31.0", | ||||
| "editorSetting": { | "editorSetting": { | ||||
| "tabIndent": "insertSpaces", | "tabIndent": "insertSpaces", | ||||