diff --git a/app.js b/app.js index f1754df..da3827a 100644 --- a/app.js +++ b/app.js @@ -18,6 +18,13 @@ App({ http.fetchAuthToken(res => { // console.log(res) }) + + http.getConfig(res=>{ + if(res.result.projectFlag == 1){ + this.globalData.flag = 1; + } + }) + }, globalData: { userInfo: null, @@ -27,6 +34,7 @@ App({ faceImg:'', }, windowHeight:'', - screenHeight:'' + screenHeight:'', + flag:0 } }) \ No newline at end of file diff --git a/images/temp_1.png b/images/temp_1.png deleted file mode 100644 index 9e369a9..0000000 Binary files a/images/temp_1.png and /dev/null differ diff --git a/pages/resource/list/index.js b/pages/resource/list/index.js index ee853af..50d952b 100644 --- a/pages/resource/list/index.js +++ b/pages/resource/list/index.js @@ -34,13 +34,26 @@ Component({ } if(this.properties.tp == '1'){ // 资源列表 - if(e.currentTarget.dataset.url){ + if(e.currentTarget.dataset.url){ // 跳转网站 wx.navigateTo({ url: '/pages/resource/navigate/index?url=' + encodeURIComponent(e.currentTarget.dataset.url) }) return; - }else{ + }else if(e.currentTarget.dataset.appid){ // 跳转小程序 + wx.navigateToMiniProgram({ + appId: e.currentTarget.dataset.appid, + // path: 'page/index/index?id=123', + extraData: { + // foo: 'bar' + }, + envVersion: 'release', + success(res) { + // 打开成功 + } + }) + return; + }else{ // 查看详情 wx.navigateTo({ url: '/pages/resource/detail/index?id=' + e.currentTarget.dataset.id }) diff --git a/pages/resource/list/index.wxml b/pages/resource/list/index.wxml index f48e3ac..16017d6 100644 --- a/pages/resource/list/index.wxml +++ b/pages/resource/list/index.wxml @@ -1,6 +1,6 @@ - + diff --git a/pages/topics/interactive/submitTopic/index.js b/pages/topics/interactive/submitTopic/index.js index dd45137..6390cde 100644 --- a/pages/topics/interactive/submitTopic/index.js +++ b/pages/topics/interactive/submitTopic/index.js @@ -3,7 +3,7 @@ import { config } from '../../../../config.js' import { store } from '../../../../utils/store.js' import { TopicModel } from '../../../../models/topic.js' let topicModel = new TopicModel() - +const app = getApp() Page({ /** @@ -12,7 +12,8 @@ Page({ data: { topicTitle:"", topicDetail:"", - files:[] + files:[], + flag:0 }, /** @@ -20,6 +21,7 @@ Page({ */ onLoad: function (options) { this.setData({ + flag:app.globalData.flag, uplaodFile: this.uplaodFile.bind(this) }) }, diff --git a/pages/topics/interactive/submitTopic/index.wxml b/pages/topics/interactive/submitTopic/index.wxml index 90a4998..617407f 100644 --- a/pages/topics/interactive/submitTopic/index.wxml +++ b/pages/topics/interactive/submitTopic/index.wxml @@ -1,22 +1,24 @@ - - - - - - - + + -