* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
return app.sharePack(); | |||||
}, | }, | ||||
receive: function () {//立即领取 | receive: function () {//立即领取 | ||||
app.globalData.nowPage = 1; | app.globalData.nowPage = 1; |
{ | { | ||||
"navigationBarTitleText": "东风启辰星探计划", | |||||
"navigationBarTitleText": "东风启辰“星探计划”", | |||||
"usingComponents": { | "usingComponents": { | ||||
"tabBar": "../component/tabBar/index" | "tabBar": "../component/tabBar/index" | ||||
} | } |
if (app.globalData.isFirstLogin) { | if (app.globalData.isFirstLogin) { | ||||
this.getHomeBanner();//获取banner | this.getHomeBanner();//获取banner | ||||
this.getHomeVideo();//获取视频 | this.getHomeVideo();//获取视频 | ||||
this.getOrderInfo(); | |||||
} else { | } else { | ||||
if (app.globalData.indexData.bannerList){ | if (app.globalData.indexData.bannerList){ | ||||
this.setData({ | this.setData({ | ||||
this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | ||||
} | } | ||||
} | } | ||||
if (!app.globalData.isRegister) { | |||||
this.getOrderInfo(); | |||||
} | |||||
this.setData({ | this.setData({ | ||||
mainShow: true, | mainShow: true, | ||||
isStartAdvertisingShow: false, | isStartAdvertisingShow: false, | ||||
isRegister: app.globalData.isRegister | isRegister: app.globalData.isRegister | ||||
}) | }) | ||||
console.log(app.globalData.isRegister); | |||||
}, | }, | ||||
provinceChane: function (e) {//选中省 | provinceChane: function (e) {//选中省 | ||||
this.setData({ | this.setData({ | ||||
console.log(res.msg) | console.log(res.msg) | ||||
} | } | ||||
}, this); | }, this); | ||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
return app.sharePack(); | |||||
} | } | ||||
}) | }) |
//logs.js | |||||
const util = require('../../utils/util.js') | |||||
Page({ | |||||
data: { | |||||
logs: [] | |||||
}, | |||||
onLoad: function () { | |||||
// this.setData({ | |||||
// logs: (wx.getStorageSync('logs') || []).map(log => { | |||||
// return util.formatTime(new Date(log)) | |||||
// }) | |||||
// }) | |||||
} | |||||
}) |
{ | |||||
"navigationBarTitleText": "查看启动日志", | |||||
"usingComponents": {} | |||||
} |
<!--logs.wxml--> | |||||
<view class="container log-list"> | |||||
<block wx:for="{{logs}}" wx:for-item="log"> | |||||
<text class="log-item">{{index + 1}}. {{log}}</text> | |||||
</block> | |||||
</view> |
.log-list { | |||||
display: flex; | |||||
flex-direction: column; | |||||
padding: 40rpx; | |||||
} | |||||
.log-item { | |||||
margin: 10rpx; | |||||
} |
* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
return app.sharePack(); | |||||
}, | }, | ||||
closeRule:function(){//关闭游戏玩法 | closeRule:function(){//关闭游戏玩法 | ||||
this.setData({ | this.setData({ |
this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province; | this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province; | ||||
this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail; | this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail; | ||||
this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | ||||
}else{ | |||||
this.getOrderInfo(); | |||||
} | } | ||||
if (this.data.optionsData){ | |||||
if (this.data.optionsData == "home") { | |||||
this.setData({ | |||||
selectNow: 2 | |||||
}) | |||||
} | |||||
if (!app.globalData.isRegister) { | |||||
this.getOrderInfo(); | |||||
} | } | ||||
}, | }, | ||||
/** | /** | ||||
* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
return app.sharePack(); | |||||
}, | }, | ||||
selectChange:function(e){ | selectChange:function(e){ | ||||
this.setData({ | this.setData({ | ||||
userData: this.data.userData, | userData: this.data.userData, | ||||
isLogin: true | isLogin: true | ||||
}) | }) | ||||
app.wxRequest(app.globalData.urlRoot + "userInfo/updateUserInfo", { avatarUrl: e.detail.userInfo.avatarUrl, nickName: e.detail.userInfo.nickName},res=>{},this,"POST") | |||||
app.globalData.userInfoData = {}; | |||||
app.globalData.userInfoData.avatarUrl = e.detail.userInfo.avatarUrl; | |||||
app.globalData.userInfoData.nickName = e.detail.userInfo.nickName; | |||||
app.submitUserMsg(e.detail.userInfo.avatarUrl, e.detail.userInfo.nickName); | |||||
} | } | ||||
}, | }, | ||||
getUserInfo:function(e){//获取个人信息 | getUserInfo:function(e){//获取个人信息 | ||||
userData: this.data.userData, | userData: this.data.userData, | ||||
isLogin: true | isLogin: true | ||||
}) | }) | ||||
app.globalData.userInfoData = {}; | |||||
app.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | |||||
app.globalData.userInfoData.nickName = res.data.nickName; | |||||
} | } | ||||
} | } | ||||
},this) | },this) |
canvasContron:null,//canvas | canvasContron:null,//canvas | ||||
posterBg:[],//海报背景 | posterBg:[],//海报背景 | ||||
qrCodeUrl:"https://www.jiyou-tech.com/2020/496_qichen/static/images/testQrCode.png",//二维码图片 | qrCodeUrl:"https://www.jiyou-tech.com/2020/496_qichen/static/images/testQrCode.png",//二维码图片 | ||||
userHead: app.globalData.urlStatic + '/images/defaultHead.png',//用户头像 | |||||
userHead: app.globalData.userInfoData ? app.globalData.userInfoData.avatarUrl : null,//用户头像 | |||||
rankNum: '8908',//缓存数字 | rankNum: '8908',//缓存数字 | ||||
windowScale:0,//屏幕缩放比 | windowScale:0,//屏幕缩放比 | ||||
windowW: 0,//屏幕宽度 | windowW: 0,//屏幕宽度 | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
this.data.posterBg.push(); | |||||
}, | }, | ||||
/** | /** | ||||
*/ | */ | ||||
onReady: function () { | onReady: function () { | ||||
this.data.canvasContron = wx.createCanvasContext('myCanvas'); | this.data.canvasContron = wx.createCanvasContext('myCanvas'); | ||||
this.getCertificationCount(); | |||||
}, | |||||
cacheFun:function(){ | |||||
wx.getSystemInfo({ | wx.getSystemInfo({ | ||||
success: option => { | success: option => { | ||||
this.data.windowScale = option.windowWidth / 750; | this.data.windowScale = option.windowWidth / 750; | ||||
src: this.data.imgUrl + '/images/tempImg1.jpg', | src: this.data.imgUrl + '/images/tempImg1.jpg', | ||||
success: res => { | success: res => { | ||||
this.data.posterBg.push(res.path); | this.data.posterBg.push(res.path); | ||||
countNum+=1; | |||||
countNum += 1; | |||||
} | } | ||||
}) | }) | ||||
wx.getImageInfo({//缓存二维码 | wx.getImageInfo({//缓存二维码 | ||||
countNum += 1; | countNum += 1; | ||||
} | } | ||||
}) | }) | ||||
wx.getImageInfo({//缓存头像 | |||||
src: this.data.userHead, | |||||
success: res => { | |||||
this.data.userHead = res.path; | |||||
countNum += 1; | |||||
} | |||||
}) | |||||
if (this.data.userHead) { | |||||
wx.getImageInfo({//缓存头像 | |||||
src: this.data.userHead, | |||||
success: res => { | |||||
this.data.userHead = res.path; | |||||
countNum += 1; | |||||
} | |||||
}) | |||||
} | |||||
wx.getImageInfo({//缓存数字背景 | wx.getImageInfo({//缓存数字背景 | ||||
src: this.data.imgUrl + '/images/posterNum.png', | src: this.data.imgUrl + '/images/posterNum.png', | ||||
success: res => { | success: res => { | ||||
this.data.rankNum = this.data.rankNum.toString().split(""); | this.data.rankNum = this.data.rankNum.toString().split(""); | ||||
for (let i = 0; i < this.data.rankNum.length; i++) { | for (let i = 0; i < this.data.rankNum.length; i++) { | ||||
wx.getImageInfo({//缓存数字 | wx.getImageInfo({//缓存数字 | ||||
src: this.data.imgUrl + '/images/nums/' + this.data.rankNum[i]+'.png', | |||||
src: this.data.imgUrl + '/images/nums/' + this.data.rankNum[i] + '.png', | |||||
success: res => { | success: res => { | ||||
this.data.rankNum[i] = res.path; | this.data.rankNum[i] = res.path; | ||||
countNum += 1; | countNum += 1; | ||||
this.posterDrawing(1); | this.posterDrawing(1); | ||||
clearInterval(setInt); | clearInterval(setInt); | ||||
} | } | ||||
},50); | |||||
}, 50); | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
ctx.setFontSize(scale * 28); | ctx.setFontSize(scale * 28); | ||||
ctx.setFillStyle('#FFFFFF'); | ctx.setFillStyle('#FFFFFF'); | ||||
ctx.setTextAlign('left'); | ctx.setTextAlign('left'); | ||||
ctx.fillText("啦啦啦", scale * 102, scale *572); | |||||
ctx.fillText(app.globalData.userInfoData ? app.globalData.userInfoData.nickName : "", scale * 102, scale *572); | |||||
//我是第XXX星探 | //我是第XXX星探 | ||||
ctx.drawImage(this.data.numBg, scale * 50, scale * 598, scale * 333, scale * 74); | ctx.drawImage(this.data.numBg, scale * 50, scale * 598, scale * 333, scale * 74); | ||||
//排名数字 | //排名数字 | ||||
swiperCurrent: e.detail.current, | swiperCurrent: e.detail.current, | ||||
}) | }) | ||||
} | } | ||||
}, | |||||
getCertificationCount: function () {//获取星探计划人数 | |||||
app.wxRequest(app.globalData.urlRoot +"userInfo/getCertificationCount",{},res=>{ | |||||
this.createQrcode(); | |||||
if(res.code==200){ | |||||
this.data.rankNum = res.data.total; | |||||
} | |||||
},this) | |||||
}, | |||||
createQrcode: function () {//获取个人小程序分享码 | |||||
app.wxRequest(app.globalData.urlRoot + "wxInfo/getQrcode", {}, res => { | |||||
if (res.code = 200) { | |||||
this.data.qrCodeUrl = res.data.qrcodeUrl; | |||||
} | |||||
this.cacheFun(); | |||||
}, this) | |||||
} | } | ||||
}) | }) |
{ | { | ||||
"navigationBarTitleText": "东风启辰星探计划", | |||||
"navigationBarTitleText": "东风启辰“星探计划”", | |||||
"usingComponents": { | "usingComponents": { | ||||
"tabBar": "../component/tabBar/index" | "tabBar": "../component/tabBar/index" | ||||
} | } |
* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
return app.sharePack(); | |||||
} | } | ||||
}) | }) |