|
|
@@ -35,7 +35,7 @@ Page({
|
|
|
this.setData({
|
|
|
userInfo: app.globalData.userInfo
|
|
|
})
|
|
|
- this.fetchData()
|
|
|
+ this.start()
|
|
|
} else if (this.data.canIUse) {
|
|
|
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
|
|
// 所以此处加入 callback 以防止这种情况
|
|
|
@@ -44,7 +44,7 @@ Page({
|
|
|
this.setData({
|
|
|
userInfo: app.globalData.userInfo
|
|
|
})
|
|
|
- this.fetchData()
|
|
|
+ this.start()
|
|
|
}
|
|
|
} else {
|
|
|
// 在没有 open-type=getUserInfo 版本的兼容处理
|
|
|
@@ -55,42 +55,188 @@ Page({
|
|
|
this.setData({
|
|
|
userInfo: app.globalData.userInfo
|
|
|
})
|
|
|
- this.fetchData()
|
|
|
+ this.start()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ this.setData({
|
|
|
+ hasAuth: true
|
|
|
+ })
|
|
|
},
|
|
|
+
|
|
|
+ start() {
|
|
|
+ Promise.all([this.fetchData()]).then(data => {
|
|
|
+ let posterConfig = {
|
|
|
+ width: 700,
|
|
|
+ height: 950,
|
|
|
+ debug: false,
|
|
|
+ texts: [{
|
|
|
+ x: 54,
|
|
|
+ y: 260,
|
|
|
+ baseLine: 'middle',
|
|
|
+ text: this.data.userInfo.nickName,
|
|
|
+ fontSize: 38,
|
|
|
+ color: '#ffffff',
|
|
|
+ lineHeight: 30,
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 54,
|
|
|
+ y: 316,
|
|
|
+ baseLine: 'middle',
|
|
|
+ text: '“我在找好友一起上班!”',
|
|
|
+ fontSize: 26,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 350,
|
|
|
+ y: 446,
|
|
|
+ baseLine: 'middle',
|
|
|
+ textAlign: "center",
|
|
|
+ width: 700,
|
|
|
+ text: this.data.postitionDetail.position.positionName,
|
|
|
+ fontSize: 38,
|
|
|
+ color: '#ffffff',
|
|
|
+ lineHeight: 38,
|
|
|
+ zIndex: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 350,
|
|
|
+ y: 494,
|
|
|
+ baseLine: 'middle',
|
|
|
+ textAlign: "center",
|
|
|
+ width: 700,
|
|
|
+ text: this.data.postitionDetail.position.hpCompany.companyName,
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 350,
|
|
|
+ y: 542,
|
|
|
+ baseLine: 'middle',
|
|
|
+ textAlign: "center",
|
|
|
+ width: 700,
|
|
|
+ text: this.data.postitionDetail.position.totalSalary ? this.data.postitionDetail.position.totalSalary : this.data.postitionDetail.position.basicSalary,
|
|
|
+ fontSize: 50,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 62,
|
|
|
+ y: 828,
|
|
|
+ baseLine: 'middle',
|
|
|
+ text: '专属客服,全程服务',
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 434,
|
|
|
+ y: 786,
|
|
|
+ baseLine: 'middle',
|
|
|
+ text: '识别右侧二维码,',
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ x: 434,
|
|
|
+ y: 812,
|
|
|
+ baseLine: 'middle',
|
|
|
+ text: '即可参与我发起的拼工!',
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#ffffff',
|
|
|
+ zIndex: 2,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ images: [{
|
|
|
+ width: 700,
|
|
|
+ height: 950,
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ url: `${imgServerUrl}/images/pt/bg.png`,
|
|
|
+ zIndex: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 218,
|
|
|
+ height: 218,
|
|
|
+ x: 400,
|
|
|
+ y: 160,
|
|
|
+ url: app.globalData.userInfo.avatarUrl,
|
|
|
+ borderRadius: 222,
|
|
|
+ zIndex: 2,
|
|
|
+ borderWidth: 12,
|
|
|
+ borderColor: '#fff',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 196,
|
|
|
+ height: 40,
|
|
|
+ x: 50,
|
|
|
+ y: 772,
|
|
|
+ url: '/images/happyjob/logo.png',
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ height: 120,
|
|
|
+ x: 280,
|
|
|
+ y: 744,
|
|
|
+ url: app.globalData.userInfo.avatarUrl, //二维码
|
|
|
+ zIndex: 2,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ console.log("sd", posterConfig)
|
|
|
+ this.setData({
|
|
|
+ posterConfig
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
//获取历史记录
|
|
|
fetchData() {
|
|
|
- let paramsObj = {
|
|
|
- positionCategory: this.data.positionCategory,
|
|
|
- positionId: this.data.positionId,
|
|
|
- groupId: this.data.hpPositionGroupId,
|
|
|
- user_id: app.globalData.userId,
|
|
|
- user_token: app.globalData.userToken
|
|
|
- }
|
|
|
- Object.assign(paramsObj);
|
|
|
- getGroupDetail(paramsObj).then(data => {
|
|
|
- console.log("groupDetail", data)
|
|
|
- var leftTime = data.data.position.groupEndTime
|
|
|
- this.setData({
|
|
|
- postitionDetail: data.data
|
|
|
+ wx.showLoading({
|
|
|
+ title: 'loading',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ var that = this
|
|
|
+ return new Promise(function(resolve, reject) {
|
|
|
+ let paramsObj = {
|
|
|
+ positionCategory: that.data.positionCategory,
|
|
|
+ positionId: that.data.positionId,
|
|
|
+ groupId: that.data.hpPositionGroupId,
|
|
|
+ user_id: app.globalData.userId,
|
|
|
+ user_token: app.globalData.userToken
|
|
|
+ }
|
|
|
+ Object.assign(paramsObj);
|
|
|
+ getGroupDetail(paramsObj).then(data => {
|
|
|
+ console.log("groupDetail", data)
|
|
|
+ var leftTime = data.data.position.groupEndTime
|
|
|
+ that.setData({
|
|
|
+ postitionDetail: data.data
|
|
|
+ })
|
|
|
+ resolve(true)
|
|
|
+ }).catch(data => {
|
|
|
+ console.log(data)
|
|
|
+ reject(data)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
|
|
|
onPosterSuccess(e) {
|
|
|
- console.log(e)
|
|
|
- const {
|
|
|
- detail
|
|
|
- } = e;
|
|
|
+ console.log("dddf", e)
|
|
|
+ var detail = e.detail;
|
|
|
+ console.log("df", detail)
|
|
|
var that = this
|
|
|
wx.saveImageToPhotosAlbum({
|
|
|
filePath: detail,
|
|
|
success(res) {
|
|
|
console.log(res)
|
|
|
wx.hideLoading();
|
|
|
- showToast('已保存到相册,快去分享吧!', 'success', 3000)
|
|
|
+ showToast('已保存到相册,快去分享吧!')
|
|
|
},
|
|
|
fail(err) {
|
|
|
wx.hideLoading();
|
|
|
@@ -111,29 +257,19 @@ Page({
|
|
|
onCreatePoster() {
|
|
|
Poster.create();
|
|
|
},
|
|
|
- getCode() {
|
|
|
- wx.showLoading({
|
|
|
- title: 'loading',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- var that = this
|
|
|
- return new Promise(function(resolve, reject) {
|
|
|
- let targetUrl = 'pages/pt-detail/index?hpPositionGroupId=' + that.data.hpPositionGroupId + '&shareToken=' + updataStorageData('shareToken')
|
|
|
- shareQrCodeB(targetUrl).then(data => {
|
|
|
- that.setData({
|
|
|
- qrCode: data.data.imgUrl
|
|
|
- })
|
|
|
- resolve(true)
|
|
|
- }).catch(data => {
|
|
|
- console.log(data)
|
|
|
- reject(data)
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
qrcodeLoad(e) {
|
|
|
wx.hideLoading()
|
|
|
},
|
|
|
|
|
|
+ onShareAppMessage: function() {
|
|
|
+ return {
|
|
|
+ title: '开心工作参团有奖',
|
|
|
+ path: '/pages/pt-detail/index?gd=' + this.data.hpPositionGroupId + '&pc=' + this.data.positionCategory + '&pd=' + this.data.positionId,
|
|
|
+ imageUrl: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
onError(err) {
|
|
|
app.aldstat.sendEvent('报错', {
|
|
|
'err': err
|