Browse Source

modify

master
slj 3 years ago
parent
commit
3a84b58e41
  1. 3
      app.js
  2. 4
      pages/article/index.js
  3. 21
      pages/billboards/index.js
  4. 9
      pages/home/index.js
  5. 5
      pages/service/service.js
  6. 35
      pages/topics/activity/activityDetail/index.js
  7. 4
      pages/topics/activity/activityDetail/index.wxss
  8. 7
      pages/topics/attract/oceanDetail/index.js
  9. 7
      pages/topics/attract/spaceDetail/index.js
  10. 22
      pages/topics/index.js
  11. 53
      pages/user/index.js
  12. 3
      project.config.json

3
app.js

@ -26,6 +26,7 @@ App({
}) })
http.getConfig(res=>{ http.getConfig(res=>{
console.log(res)
if(res.result.projectFlag == 1){ if(res.result.projectFlag == 1){
this.globalData.flag = 1; this.globalData.flag = 1;
} }
@ -44,5 +45,5 @@ App({
screenHeight:'', screenHeight:'',
flag:0, flag:0,
currentTab:'' currentTab:''
} },
}) })

4
pages/article/index.js

@ -71,6 +71,10 @@ Page({
aId: id aId: id
}) })
this.fetchArticeApi() this.fetchArticeApi()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
}, },
fetchArticeApi () { fetchArticeApi () {
// wx.showLoading({ // wx.showLoading({

21
pages/billboards/index.js

@ -15,7 +15,28 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
}, },
onShareAppMessage: function (res) {
return {
title: '市北人才赋能平台',
path: 'pages/home/index',
}
},
// onShareTimeline: function (res) {
// return {
// title: '市北人才赋能平台',
// success: function (res) {
// // 转发成功
// },
// fail: function (res) {
// // 转发失败
// }
// }
// },
onClickItem (e) { onClickItem (e) {
const {index} = e.currentTarget.dataset const {index} = e.currentTarget.dataset
console.log(index) console.log(index)

9
pages/home/index.js

@ -35,6 +35,11 @@ Page({
this.fetchHomeBanner() this.fetchHomeBanner()
this.fetchHomeHot() this.fetchHomeHot()
}) })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
@ -238,5 +243,7 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/pages/resource/navigate/index?url=' + encodeURIComponent(this.data.web) url: '/pages/resource/navigate/index?url=' + encodeURIComponent(this.data.web)
}) })
} },
}) })

5
pages/service/service.js

@ -29,8 +29,11 @@ Page({
} }
}) })
// wx.showShareMenu({
// withShareTicket: true,
// menus: ['shareAppMessage', 'shareTimeline']
// });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

35
pages/topics/activity/activityDetail/index.js

@ -44,25 +44,42 @@ Page({
confirmTag: true, confirmTag: true,
showMsg:false, showMsg:false,
flagShow: 0, flagShow: 0,
// scene:null
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
this.setData({ this.setData({
activityId: options.activityId, activityId: options.activityId,
flagShow: app.globalData.flag flagShow: app.globalData.flag
}) })
this.fetchDetail() this.fetchDetail()
this.fetchDetailMessage() this.fetchDetailMessage()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
var obj = wx.getLaunchOptionsSync()
console.log('启动小程序场景-->:', obj)
// let scene=null
// //部分版本在无referrerInfo的时候会返回 undefined,可以做一下判断
// if (options.referrerInfo && options.referrerInfo.appId) {
// scene=obj.scene
// }
// scene=obj.scene
// this.setData({
// scene:obj.scene
// })
}, },
//活动详情 //活动详情
fetchDetail() { fetchDetail() {
let activityId = this.data.activityId let activityId = this.data.activityId
// console.log('来活动详情' + activityId) console.log('来活动详情1' + activityId)
topicModel.getActivityDetail(activityId, res => { topicModel.getActivityDetail(activityId, res => {
console.log('来活动详情', res) console.log('来活动详情2', res)
let data = res.result let data = res.result
const date = dayjs(data.createTime).format('MM月DD日') const date = dayjs(data.createTime).format('MM月DD日')
if(data.flag == 0 || data.flag == 1){ if(data.flag == 0 || data.flag == 1){
@ -421,7 +438,17 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage(res) {
return {
title:this.data.title,
url: `/pages/topics/activity/activityDetail/index?activityId=${this.data.activityId}`
} }
},
// onShareTimeline: function () {
// return {
// title: this.data.title, // 可不填
// query:`activityId=${this.data.activityId}`, // 可不填 传递的参数,只能是这种格式
// // imageUrl: 'https://www.baidu.com/my/active3.png' // 可不填,可以是网络路径也可以是本地路径,分享到朋友圈显示的图标
// }
// },
}) })

4
pages/topics/activity/activityDetail/index.wxss

@ -221,3 +221,7 @@
width: 100%; width: 100%;
height: 160rpx; height: 160rpx;
} }
.singleton-mode{
width: 100%;
height: 100%;
}

7
pages/topics/attract/oceanDetail/index.js

@ -45,6 +45,13 @@ Page({
path: `/pages/article/index?id=${this.data.aId}` path: `/pages/article/index?id=${this.data.aId}`
} }
}, },
// onShareTimeline: function () {
// return {
// title: this.data.title, // 可不填
// query: `id=${this.data.aId}`, // 可不填 传递的参数,只能是这种格式
// // imageUrl: 'https://www.baidu.com/my/active3.png' // 可不填,可以是网络路径也可以是本地路径,分享到朋友圈显示的图标
// }
// },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

7
pages/topics/attract/spaceDetail/index.js

@ -41,6 +41,13 @@ Page({
path: `/pages/article/index?id=${this.data.aId}` path: `/pages/article/index?id=${this.data.aId}`
} }
}, },
// onShareTimeline: function () {
// return {
// title: this.data.title, // 可不填
// query: `id=${this.data.aId}`, // 可不填 传递的参数,只能是这种格式
// // imageUrl: 'https://www.baidu.com/my/active3.png' // 可不填,可以是网络路径也可以是本地路径,分享到朋友圈显示的图标
// }
// },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

22
pages/topics/index.js

@ -49,8 +49,28 @@ Page({
this.setData({ this.setData({
flag: app.globalData.flag flag: app.globalData.flag
}) })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
}, },
onShareAppMessage: function (res) {
return {
title: '市北人才赋能平台',
path: 'pages/home/index'
}
},
// onShareTimeline: function (res) {
// return {
// title: '市北人才赋能平台',
// success: function (res) {
// // 转发成功
// },
// fail: function (res) {
// // 转发失败
// }
// }
// },
//进入页面判断是否绑定微信号,如果绑定手机号根据segmentIndex的数值fetch留言互动和赋能中心的资源,否则退回注册页面或者首页 //进入页面判断是否绑定微信号,如果绑定手机号根据segmentIndex的数值fetch留言互动和赋能中心的资源,否则退回注册页面或者首页
onShow: function () { onShow: function () {
//文章关联链接跳转 显示 报需求 还是来活动 tab //文章关联链接跳转 显示 报需求 还是来活动 tab

53
pages/user/index.js

@ -13,7 +13,10 @@ import {
AuthModel AuthModel
} from '../../models/auth.js' } from '../../models/auth.js'
let authModel = new AuthModel() let authModel = new AuthModel()
import {
HomeModel
} from '../../models/home.js'
let homeModel = new HomeModel()
import { import {
ServiceModel ServiceModel
} from '../../models/service.js' } from '../../models/service.js'
@ -146,7 +149,8 @@ Page({
}, },
], ],
talentsType: -1, talentsType: -1,
shield: '../../images/shield.png' shield: '../../images/shield.png',
banners: [],
}, },
@ -187,6 +191,51 @@ Page({
}) })
// console.log(this.data.servicePublic) // console.log(this.data.servicePublic)
}) })
// this.fetchHomeBanner()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
},
onShareAppMessage: function (res) {
return {
title: '市北人才赋能平台',
path: 'pages/home/index',
// imageUrl:this.data.banners[0].image?this.data.banners[0].image:''
}
},
// onShareTimeline: function (res) {
// return {
// title: '市北人才赋能平台',
// success: function (res) {
// // 转发成功
// },
// fail: function (res) {
// // 转发失败
// }
// }
// },
fetchHomeBanner() {
this.setData({
banners: []
})
homeModel.getHomeBanner(res => {
//console.log('Banner')
console.log(res)
const datas = res.list
let tempBanners = []
datas.forEach(item => {
tempBanners.push({
id: item.id,
image: item.titlePic,
title: item.title,
type: item.type
})
})
this.setData({
banners: tempBanners
})
})
}, },
onShow: function () { onShow: function () {
if (store.hasBindUserInfo()) { if (store.hasBindUserInfo()) {

3
project.config.json

@ -40,7 +40,8 @@
"showES6CompileOption": false, "showES6CompileOption": false,
"disableUseStrict": false, "disableUseStrict": false,
"useStaticServer": true, "useStaticServer": true,
"useCompilerPlugins": false "useCompilerPlugins": false,
"minifyWXML": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.1", "libVersion": "2.8.1",

Loading…
Cancel
Save