if (userMobile){ | if (userMobile){ | ||||
this.globalData.userMobile = userMobile; | this.globalData.userMobile = userMobile; | ||||
} | } | ||||
var friendOpenid = wx.getStorageSync('friendOpenid'); | |||||
if (friendOpenid) { | |||||
this.globalData.friendOpenid = friendOpenid; | |||||
} | |||||
var userInfoData = wx.getStorageSync("userInfoData"); | var userInfoData = wx.getStorageSync("userInfoData"); | ||||
if (userInfoData){ | if (userInfoData){ | ||||
this.globalData.userInfoData = {}; | this.globalData.userInfoData = {}; |
"pages/coupon/coupon", | "pages/coupon/coupon", | ||||
"pages/receiveRegister/receiveRegister", | "pages/receiveRegister/receiveRegister", | ||||
"pages/address/address", | "pages/address/address", | ||||
"pages/mobileVerification/mobileVerification" | |||||
"pages/mobileVerification/mobileVerification", | |||||
"pages/agreement/agreement" | |||||
], | ], | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "light", | "backgroundTextStyle": "light", |
// pages/agreement/agreement.js | |||||
const app = getApp() | |||||
Component({ | |||||
/** | |||||
* 组件的属性列表 | |||||
*/ | |||||
properties: { | |||||
}, | |||||
/** | |||||
* 组件的初始数据 | |||||
*/ | |||||
data: { | |||||
imgUrl: app.globalData.urlStatic,//图片路径 | |||||
}, | |||||
/** | |||||
* 组件的方法列表 | |||||
*/ | |||||
methods: { | |||||
closeXieyi:function(){ | |||||
this.triggerEvent('myevent') | |||||
} | |||||
}, | |||||
}) |
{ | |||||
"component": true, | |||||
"usingComponents": {} | |||||
} |
<!--pages/agreement/agreement.wxml--> | |||||
<view class="all"> | |||||
<view class="main"> | |||||
<view class="titleText">隐私条款</view> | |||||
<view class="lineSty"></view> | |||||
<image class="closeXieyi" bindtap="closeXieyi" src="{{imgUrl+'/images/closeXieyi.png'}}"></image> | |||||
<view class="xieyiGroup"> | |||||
<image class="xieyi" src="{{imgUrl+'/images/xieyi.png'}}"></image> | |||||
</view> | |||||
</view> | |||||
<tabBar></tabBar> | |||||
</view> |
/* pages/agreement/agreement.wxss */ | |||||
image{ | |||||
display: block; | |||||
} | |||||
view{ | |||||
-webkit-overflow-scrolling: touch; | |||||
} | |||||
.main{ | |||||
width: 750rpx; | |||||
position: fixed; | |||||
left: 0; | |||||
top: 0; | |||||
height: calc(100vh - 150rpx); | |||||
overflow: auto; | |||||
background-color: white; | |||||
z-index: 99; | |||||
} | |||||
.titleText{ | |||||
width: 682rpx; | |||||
margin: 0 auto; | |||||
margin-top: 78rpx; | |||||
margin-bottom: 28rpx; | |||||
line-height: 39rpx; | |||||
font-size:39rpx; | |||||
font-family:PingFangSC; | |||||
font-weight:bold; | |||||
color:rgba(0,77,149,1); | |||||
} | |||||
.lineSty{ | |||||
width: 682rpx; | |||||
height:2rpx; | |||||
background-color: #B6B6B6; | |||||
margin: 0 auto; | |||||
margin-bottom: 45rpx; | |||||
} | |||||
.closeXieyi{ | |||||
position: absolute; | |||||
right: 48rpx; | |||||
top: 38rpx; | |||||
width: 42rpx; | |||||
height: 42rpx; | |||||
} | |||||
.xieyiGroup{ | |||||
width: 682rpx; | |||||
margin: 0 auto; | |||||
height: calc(100vh - 342rpx); | |||||
overflow: auto; | |||||
} | |||||
.xieyi{ | |||||
width: 100%; | |||||
height: 10348rpx; | |||||
padding-bottom: 30rpx; | |||||
} |
*/ | */ | ||||
data: { | data: { | ||||
imgUrl: app.globalData.urlStatic,//图片路径 | imgUrl: app.globalData.urlStatic,//图片路径 | ||||
friendOpenid:null,//朋友的openid | |||||
countNum:0, | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
app.globalData.nowPage = 0; | |||||
if (options.friendOpenid){ | |||||
app.globalData.friendOpenid = options.friendOpenid; | |||||
app.globalData.nowPage = 2; | |||||
if (options.friendOpenid) { | |||||
this.data.friendOpenid = options.friendOpenid; | |||||
} | |||||
if (app.globalData.openid) { | |||||
this.getOrderInfo(); | |||||
} else { | |||||
app.globalData.openidSuccessFuc = this.getOrderInfo; | |||||
} | } | ||||
}, | }, | ||||
return app.sharePack(); | return app.sharePack(); | ||||
}, | }, | ||||
receive: function () {//立即领取 | receive: function () {//立即领取 | ||||
app.globalData.nowPage = 1; | |||||
wx.redirectTo({ | |||||
url: '../index/index', | |||||
wx.reLaunch({ | |||||
url: '/pages/index/index', | |||||
}) | }) | ||||
}, | |||||
getOrderInfo: function () {//查询是否已注册 | |||||
app.wxRequest(app.globalData.urlRoot +"userInfo/getOrderInfo",{},res=>{ | |||||
if(res.code==200){ | |||||
if(res.data){ | |||||
wx.reLaunch({ | |||||
url: '/pages/index/index', | |||||
}) | |||||
}else{ | |||||
this.getTotalOrder(); | |||||
wx.setStorageSync("friendOpenid", this.data.friendOpenid); | |||||
app.globalData.friendOpenid = this.data.friendOpenid; | |||||
} | |||||
} | |||||
},this) | |||||
}, | |||||
getTotalOrder:function(){//获取预约人数 | |||||
app.wxRequest(app.globalData.urlRoot + "userInfo/getTotalOrder", {}, res => { | |||||
if (res.code == 200) { | |||||
if (res.data) { | |||||
this.setData({ | |||||
countNum: res.data.total | |||||
}) | |||||
} | |||||
} | |||||
}, this) | |||||
} | } | ||||
}) | }) |
<view class="prizeFrame"> | <view class="prizeFrame"> | ||||
<image class="coupon" src="{{imgUrl+'/images/coupon.png'}}"></image> | <image class="coupon" src="{{imgUrl+'/images/coupon.png'}}"></image> | ||||
<view class="getPrizeNumGroup"> | <view class="getPrizeNumGroup"> | ||||
<view class="getPrizeNum">全国已有 581人获得了500元启辰星购车券</view> | |||||
<view class="getPrizeNum">全国已有 {{countNum}}人获得了500元启辰星购车券</view> | |||||
</view> | </view> | ||||
<view bindtap="receive" class="receiveBtn">立即领取</view> | <view bindtap="receive" class="receiveBtn">立即领取</view> | ||||
</view> | </view> |
*/ | */ | ||||
data: { | data: { | ||||
imgUrl: app.globalData.urlStatic,//图片路径 | imgUrl: app.globalData.urlStatic,//图片路径 | ||||
showClose:false, | |||||
showRule:false,//是否显示游戏规则 | |||||
showClose:true, | |||||
maskShow: false, | maskShow: false, | ||||
taskShow: false, | taskShow: false, | ||||
taskName:'', | taskName:'', | ||||
isShare:false, | isShare:false, | ||||
picturlList: [], | picturlList: [], | ||||
picturlCurrent:0, | picturlCurrent:0, | ||||
isRegister:false,//是否已注册 | |||||
shareId:null, | shareId:null, | ||||
isFriendShare:false,//是否朋友分享过来的 | isFriendShare:false,//是否朋友分享过来的 | ||||
isAddress:false,//是否有地址 | isAddress:false,//是否有地址 | ||||
}, | }, | ||||
loadFun: function () { | loadFun: function () { | ||||
this.getTaskProgress(); | this.getTaskProgress(); | ||||
this.getOrderInfo(); | |||||
this.getShareId(); | |||||
this.getSignInfo(); | |||||
this.getAddress(); | this.getAddress(); | ||||
if (this.data.isFriendShare) { | if (this.data.isFriendShare) { | ||||
this.useShareId(); | this.useShareId(); | ||||
/** | /** | ||||
* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | |||||
return { | |||||
title: '我正在参与“星探计划”,快来帮我解锁拼图吧,共享大奖!', | |||||
imageUrl: this.data.imgUrl + "/shareImgs/" + Math.floor(Math.random() * 8 + 1)+".jpg", | |||||
path: this.data.shareId ? "/pages/everyday/everyday?shareId=" + this.data.shareId :"/pages/everyday/everyday" | |||||
onShareAppMessage: function (e) { | |||||
if (e.from == "button") { | |||||
return { | |||||
title: '我正在参与“星探计划”,快来帮我解锁拼图吧,共享大奖!', | |||||
imageUrl: this.data.imgUrl + "/shareImgs/" + Math.floor(Math.random() * 8 + 1) + ".jpg", | |||||
path: this.data.shareId ? "/pages/everyday/everyday?shareId=" + this.data.shareId : "/pages/everyday/everyday" | |||||
} | |||||
}else{ | |||||
return app.sharePack(); | |||||
} | } | ||||
}, | }, | ||||
getTaskProgress: function () {//获取任务完成度 | getTaskProgress: function () {//获取任务完成度 | ||||
} | } | ||||
}, this); | }, this); | ||||
}, | }, | ||||
getOrderInfo: function () {//查询是否已注册 | |||||
app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | |||||
if (res.code == 200) { | |||||
if (res.data) { | |||||
this.setData({ | |||||
isRegister: true | |||||
}) | |||||
// app.globalData.isRegister = true; | |||||
app.globalData.userMobile = res.data.mobile; | |||||
} | |||||
} else { | |||||
console.log(res.msg) | |||||
} | |||||
}, this); | |||||
}, | |||||
receive:function(){//领取购车红包 | receive:function(){//领取购车红包 | ||||
this.getTaskAward(); | this.getTaskAward(); | ||||
}, | }, | ||||
getTaskAward:function(){//领取购车券 | getTaskAward:function(){//领取购车券 | ||||
wx.wxRequest(app.globalData.urlRoot + "task/getTaskAward", { awardGiveId: this.data.picturlList[this.data.picturlCurrent]['awardGiveId']},res=>{ | wx.wxRequest(app.globalData.urlRoot + "task/getTaskAward", { awardGiveId: this.data.picturlList[this.data.picturlCurrent]['awardGiveId']},res=>{ | ||||
if(res.code==200){ | if(res.code==200){ | ||||
if (this.data.isRegister){ | |||||
// if (res.data.needAddress) { | |||||
// if (!this.data.isAddress) { | |||||
// wx.navigateTo({ | |||||
// url: '../address/address', | |||||
// }) | |||||
// }else{ | |||||
// wx.redirectTo({ | |||||
// url: '../myCenter/myCenter' | |||||
// }) | |||||
// } | |||||
// }else{ | |||||
if (this.data.isAddress){ | |||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: '../myCenter/myCenter' | |||||
url: '/pages/myCenter/myCenter' | |||||
}) | }) | ||||
// } | |||||
}else{ | }else{ | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: '../receiveRegister/receiveRegister', | |||||
url: '/pages/address/address', | |||||
}) | }) | ||||
} | } | ||||
}else{ | }else{ | ||||
}, | }, | ||||
getSignInfo: function () {//查看当日是否签到 | getSignInfo: function () {//查看当日是否签到 | ||||
app.wxRequest(app.globalData.urlRoot + "task/getSignInfo", {}, res => { | app.wxRequest(app.globalData.urlRoot + "task/getSignInfo", {}, res => { | ||||
this.getShareId(); | |||||
if(res.code==200){ | if(res.code==200){ | ||||
if (res.data.state==0) {//未签到 | if (res.data.state==0) {//未签到 | ||||
this.setData({ | this.setData({ | ||||
taskShow: true, | taskShow: true, | ||||
isSign: true | isSign: true | ||||
}) | }) | ||||
}else{ | |||||
if (this.data.shareId){ | |||||
this.setData({ | |||||
showClose: true, | |||||
maskShow: true, | |||||
taskShow: true, | |||||
isShare: true | |||||
}) | |||||
} | |||||
} | } | ||||
} | } | ||||
},this) | },this) | ||||
}, | }, | ||||
getShareId: function () {//获取分享id(查询今日是否已被助力) | getShareId: function () {//获取分享id(查询今日是否已被助力) | ||||
app.wxRequest(app.globalData.urlRoot + "task/getShareId", {}, res => { | app.wxRequest(app.globalData.urlRoot + "task/getShareId", {}, res => { | ||||
this.getSignInfo(); | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
if (res.data.shareId){ | |||||
this.setData({ | |||||
showClose: true, | |||||
maskShow: true, | |||||
taskShow: true, | |||||
isShare: true | |||||
}) | |||||
} | |||||
this.setData({ | this.setData({ | ||||
taskName: "集齐启辰星【" + res.data.shortName+"】碎片1/4", | taskName: "集齐启辰星【" + res.data.shortName+"】碎片1/4", | ||||
taskImgUrl: res.data.popPicUrl, | taskImgUrl: res.data.popPicUrl, | ||||
picturlCurrent: e.detail.current, | picturlCurrent: e.detail.current, | ||||
}) | }) | ||||
} | } | ||||
}, | |||||
ruleControl:function(e){ | |||||
this.setData({ | |||||
showRule: e.currentTarget.dataset.state | |||||
}) | |||||
} | } | ||||
}) | }) |
<!--pages/everyday/everyday.wxml--> | <!--pages/everyday/everyday.wxml--> | ||||
<view id="everyday" class="showView"> | <view id="everyday" class="showView"> | ||||
<image class="showImg" src="{{imgUrl+'/star/everyday/show.jpg'}}"></image> | <image class="showImg" src="{{imgUrl+'/star/everyday/show.jpg'}}"></image> | ||||
<view class="ruleBtn">游戏规则</view> | |||||
<view class="ruleBtn" bindtap="ruleControl" data-state="{{true}}">游戏规则</view> | |||||
<view class="title">集碎片,攒红包</view> | <view class="title">集碎片,攒红包</view> | ||||
<view class="menuBox"> | <view class="menuBox"> | ||||
<image class="menu" src="{{imgUrl+'/star/everyday/menu.png'}}"></image> | <image class="menu" src="{{imgUrl+'/star/everyday/menu.png'}}"></image> | ||||
</swiper-item> | </swiper-item> | ||||
</block> | </block> | ||||
</swiper> | </swiper> | ||||
<image class="arrowBtn" style="left:-30rpx;" src="{{imgUrl+'/star/everyday/arrowLeftBtn.png'}}" bindtap="prevPicturl"></image> | |||||
<image class="arrowBtn" style="right:-30rpx;" src="{{imgUrl+'/star/everyday/arrowRightBtn.png'}}" bindtap="nextPicturl"></image> | |||||
<image class="arrowBtn" wx:if="{{picturlCurrent!=0}}" style="left:-30rpx;" src="{{imgUrl+'/star/everyday/arrowLeftBtn.png'}}" bindtap="prevPicturl"></image> | |||||
<image class="arrowBtn" wx:if="{{picturlCurrent!=picturlList.length-1}}" style="right:-30rpx;" src="{{imgUrl+'/star/everyday/arrowRightBtn.png'}}" bindtap="nextPicturl"></image> | |||||
</view> | </view> | ||||
<view class="btnBox" wx:if="{{picturlList[picturlCurrent]['awardState']==0}}"> | <view class="btnBox" wx:if="{{picturlList[picturlCurrent]['awardState']==0}}"> | ||||
<view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | <view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | ||||
</view> | </view> | ||||
<view class="mask" wx:if="{{maskShow}}"> | <view class="mask" wx:if="{{maskShow}}"> | ||||
<view class="taskBox" wx:if="{{taskShow}}"> | <view class="taskBox" wx:if="{{taskShow}}"> | ||||
<text wx:if="{{showClose}}" class="closeBtn" style="right:-35rpx;top:-50rpx;" bindtap="hiddenTask"></text> | |||||
<text wx:if="{{!isSign}}" class="closeBtn" style="right:-35rpx;top:-50rpx;" bindtap="hiddenTask"></text> | |||||
<view class="title">今日任务</view> | <view class="title">今日任务</view> | ||||
<view class="contentBox"> | <view class="contentBox"> | ||||
<view class="name" wx:if="{{isShare}}">{{taskName}}</view> | |||||
<image class="taskImg" src="{{taskImgUrl}}" wx:if="{{isShare}}"></image> | |||||
<view class="name" wx:if="{{!isSign}}">{{taskName}}</view> | |||||
<image class="taskImg" src="{{taskImgUrl}}" wx:if="{{!isSign}}"></image> | |||||
<view class="signBtnGroup"> | <view class="signBtnGroup"> | ||||
<view class="btn" wx:if="{{isSign}}" bindtap="signIn">签到解锁</view> | <view class="btn" wx:if="{{isSign}}" bindtap="signIn">签到解锁</view> | ||||
</view> | </view> | ||||
<view class="btn" wx:if="{{isShare}}">分享再获取一张碎片 | |||||
<view class="btn" wx:if="{{!isSign}}">分享再获取一张碎片 | |||||
<button open-type="share" class="shareBtn" style="width:100%;height:100%;margin:0;padding:0;min-height:0;"></button> | <button open-type="share" class="shareBtn" style="width:100%;height:100%;margin:0;padding:0;min-height:0;"></button> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="gamaRuleFrame" wx:if="{{showRule}}"> | |||||
<view class="gameRuleGroup"> | |||||
<image class="gameRuleIcon" src="{{imgUrl+'/images/gameRuleIcon.png'}}"></image> | |||||
<image class="gameRuleClose" src="{{imgUrl+'/star/closebtn.png'}}" bindtap="ruleControl" data-state="{{false}}"></image> | |||||
<view class="openTask" bindtap="ruleControl" data-state="{{false}}">开启任务</view> | |||||
</view> | |||||
</view> | |||||
<tabBar></tabBar> | <tabBar></tabBar> |
margin: 42rpx auto 0 auto; | margin: 42rpx auto 0 auto; | ||||
background-color: #345486; | background-color: #345486; | ||||
position: relative; | position: relative; | ||||
} | |||||
.gamaRuleFrame{ | |||||
position: fixed; | |||||
left: 0; | |||||
top: 0; | |||||
width: 750rpx; | |||||
height: calc(100vh - 150rpx); | |||||
background-color: rgba(000, 000, 000, 0.2); | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
} | |||||
.gameRuleClose{ | |||||
position: absolute; | |||||
top: -10rpx; | |||||
right: -10rpx; | |||||
height: 40rpx; | |||||
width: 40rpx; | |||||
} | |||||
.openTask{ | |||||
position: absolute; | |||||
left: 50%; | |||||
bottom: 100rpx; | |||||
transform: translateX(-50%); | |||||
width: 348rpx; | |||||
height: 64rpx; | |||||
background-color: #16538A; | |||||
border-radius: 20rpx; | |||||
text-align: center; | |||||
line-height:64rpx; | |||||
font-size:30rpx; | |||||
font-family:PingFangSC; | |||||
font-weight:400; | |||||
color:rgba(255,255,255,1); | |||||
} | |||||
.gameRuleGroup{ | |||||
width: 609rpx; | |||||
height: 692rpx; | |||||
position: relative; | |||||
} | |||||
.gameRuleIcon{ | |||||
width: 100%; | |||||
height: 100%; | |||||
} | } |
*/ | */ | ||||
data: { | data: { | ||||
imgUrl: app.globalData.urlStatic,//图片路径 | imgUrl: app.globalData.urlStatic,//图片路径 | ||||
ruleShow: true,//是否显示游戏玩法 | |||||
ruleShow: false,//是否显示游戏玩法 | |||||
ruleCloseShow: false,//是否显示游戏玩法关闭按钮 | ruleCloseShow: false,//是否显示游戏玩法关闭按钮 | ||||
clawTop:95,//爪子的top值 | clawTop:95,//爪子的top值 | ||||
clawLeft: 293,//爪子的left值 | clawLeft: 293,//爪子的left值 | ||||
gameState:false,//游戏状态 | gameState:false,//游戏状态 | ||||
endGameData:null,//中奖数据 | endGameData:null,//中奖数据 | ||||
isAddress:false,//是否有地址 | isAddress:false,//是否有地址 | ||||
configure:{ | |||||
page:1, | |||||
count:10 | |||||
}, | |||||
gameAwardList:[], | |||||
userData:null, | |||||
scrollNum:0, | |||||
setInt:null, | |||||
isMore:true | |||||
}, | }, | ||||
/** | /** | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
app.globalData.nowPage = 3; | app.globalData.nowPage = 3; | ||||
if (app.globalData.openid) { | if (app.globalData.openid) { | ||||
this.getAddress(); | |||||
this.loadFun(); | |||||
} else { | } else { | ||||
app.globalData.openidSuccessFuc = this.getAddress; | |||||
app.globalData.openidSuccessFuc = this.loadFun; | |||||
} | } | ||||
}, | }, | ||||
loadFun: function () { | |||||
if (app.globalData.userInfoData) { | |||||
this.data.userData = app.globalData.userInfoData; | |||||
this.setData({ | |||||
userData: this.data.userData | |||||
}) | |||||
} | |||||
this.getAddress(); | |||||
this.getGameAwardList(); | |||||
}, | |||||
/** | /** | ||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
*/ | */ | ||||
downNum: this.data.downNum | downNum: this.data.downNum | ||||
}) | }) | ||||
if (this.data.downNum < 1) { | if (this.data.downNum < 1) { | ||||
// this.closeSetInt(); | |||||
this.getClaw(); | this.getClaw(); | ||||
} | } | ||||
},1000); | },1000); | ||||
} | } | ||||
}, | }, | ||||
getAddress: function () {//获取地址 | getAddress: function () {//获取地址 | ||||
app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | |||||
app.wxRequest(app.globalData.urlRoot + "address/getAddress", {}, res => { | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
if (res.data) { | if (res.data) { | ||||
this.data.isAddress = true; | this.data.isAddress = true; | ||||
this.setData({ | this.setData({ | ||||
pizeTip:0 | pizeTip:0 | ||||
}) | }) | ||||
}, | |||||
getGameAwardList: function () {//获取游戏中奖数据 | |||||
app.wxRequest(app.globalData.urlRoot + "award/getGameAwardList", this.data.configure,res=>{ | |||||
if(res.code==200){ | |||||
if(res.data.length<this.data.configure.count){ | |||||
this.data.isMore = false; | |||||
} | |||||
console.log(this.data.isMore); | |||||
for(let i=0;i<res.data.length;i++){ | |||||
this.data.gameAwardList.push(res.data[i]); | |||||
} | |||||
this.setData({ | |||||
gameAwardList: this.data.gameAwardList | |||||
}) | |||||
if(this.data.configure.page==1){ | |||||
this.changeScroll(); | |||||
} | |||||
} | |||||
},this) | |||||
}, | |||||
getUserWxMsg: function (e) {//通过微信获取用户信息 | |||||
if (e.detail.errMsg == "getUserInfo:ok") { | |||||
app.globalData.userInfoData = {}; | |||||
app.globalData.userInfoData.avatarUrl = e.detail.userInfo.avatarUrl; | |||||
app.globalData.userInfoData.nickName = e.detail.userInfo.nickName; | |||||
this.data.userData = app.globalData.userInfoData; | |||||
this.setData({ | |||||
userData:this.data.userData | |||||
}) | |||||
wx.setStorageSync('userInfoData', { | |||||
avatarUrl: e.detail.userInfo.avatarUrl, | |||||
nickName: e.detail.userInfo.nickName | |||||
}) | |||||
app.submitUserMsg(e.detail.userInfo.avatarUrl, e.detail.userInfo.nickName); | |||||
} | |||||
}, | |||||
changeScroll:function(){ | |||||
this.data.setInt = setInterval(()=>{ | |||||
this.setData({ | |||||
scrollNum: this.data.scrollNum+=1 | |||||
}) | |||||
},50); | |||||
}, | |||||
getMore:function(){ | |||||
if (!this.data.isMore){ | |||||
this.setData({ | |||||
scrollNum: 0 | |||||
}) | |||||
return; | |||||
} | |||||
this.data.configure.page+=1; | |||||
this.getGameAwardList(); | |||||
} | } | ||||
}) | }) |
<view class="prizeTipLine"></view> | <view class="prizeTipLine"></view> | ||||
</view> | </view> | ||||
<view class="tipContentGroup"> | <view class="tipContentGroup"> | ||||
<view class="tipContent">恭喜XXX获得头等舱机票一张,恭喜XX获得20元美团代金券一张</view> | |||||
<scroll-view class="scrollSty" bindscrolltolower="getMore" scroll-left="{{scrollNum}}" scroll-x="{{true}}"><view class="tipContent" wx:for="{{gameAwardList}}" wx:key="index">{{"恭喜"+item.nickName+"获得"+item.awardName}}</view></scroll-view> | |||||
<!-- <view class="scrollMask"></view> --> | |||||
</view> | </view> | ||||
<view class="prizeLookGroup"> | <view class="prizeLookGroup"> | ||||
<view class="prizeLook" bindtap="prizeLook">活动奖品</view> | <view class="prizeLook" bindtap="prizeLook">活动奖品</view> | ||||
<view class="ruleGroup"> | <view class="ruleGroup"> | ||||
<image class="gameRuleIcon" src="{{imgUrl+'/images/gameRuleDesc.png'}}"></image> | <image class="gameRuleIcon" src="{{imgUrl+'/images/gameRuleDesc.png'}}"></image> | ||||
<image class="gameRuleClose" wx:if="{{ruleCloseShow}}" bindtap="closeRule" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | <image class="gameRuleClose" wx:if="{{ruleCloseShow}}" bindtap="closeRule" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | ||||
<view class="gameStrat" bindtap="gameStart">开始游戏</view> | |||||
<view class="gameStrat" bindtap="gameStart">开始游戏<button wx:if="{{!userData}}" style="min-height:0;width: 277rpx;height: 50rpx;" bindgetuserinfo="getUserWxMsg" class="getUserMsgBtn" open-type="getUserInfo" lang="zh_CN"></button></view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="gameRuleDesc" style="background-color:rgba(000,000,000,0)" wx:if="{{false}}"> | <view class="gameRuleDesc" style="background-color:rgba(000,000,000,0)" wx:if="{{false}}"> |
align-items: center; | align-items: center; | ||||
justify-content: center; | justify-content: center; | ||||
border-radius: 20rpx; | border-radius: 20rpx; | ||||
overflow: hidden; | |||||
position: relative; | |||||
} | } | ||||
/* .tipContentGroup::-webkit-scrollbar { | |||||
display:none; | |||||
width:0; | |||||
height:0; | |||||
color:transparent; | |||||
} */ | |||||
.tipContent{ | .tipContent{ | ||||
font-size:21rpx; | font-size:21rpx; | ||||
font-family:PingFangSC; | font-family:PingFangSC; | ||||
font-weight:400; | font-weight:400; | ||||
color:rgba(21,83,136,1); | color:rgba(21,83,136,1); | ||||
line-height:21rpx; | |||||
line-height:62rpx; | |||||
padding-right: 10rpx; | |||||
white-space: nowrap; | |||||
} | } | ||||
.prizeLookGroup{ | .prizeLookGroup{ | ||||
padding-top:40rpx; | padding-top:40rpx; | ||||
top: 0; | top: 0; | ||||
z-index: 2; | z-index: 2; | ||||
opacity: 0; | opacity: 0; | ||||
} | |||||
.getUserMsgBtn{ | |||||
position: absolute; | |||||
left: 0; | |||||
top: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
opacity: 0; | |||||
margin: 0; | |||||
padding:0; | |||||
} | |||||
.scrollSty{ | |||||
margin-top: 10rpx; | |||||
width:672rpx; | |||||
height:72rpx; | |||||
white-space: nowrap; | |||||
} | |||||
.tipContent{ | |||||
display:inline-block; | |||||
} | |||||
.scrollMask{ | |||||
position: absolute; | |||||
left: 0; | |||||
top: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
opacity: 0; | |||||
} | } |
mobileText:"",//手机号 | mobileText:"",//手机号 | ||||
verificationText:null, | verificationText:null, | ||||
getMobileBtnShow:true, | getMobileBtnShow:true, | ||||
agreement:false,//是否显示协议 | |||||
}, | }, | ||||
/** | /** | ||||
} | } | ||||
}, this) | }, this) | ||||
} | } | ||||
}, | |||||
agreementControl:function(){ | |||||
this.setData({ | |||||
agreement: !this.data.agreement | |||||
}) | |||||
} | } | ||||
}) | }) |
{ | { | ||||
"navigationBarTitleText": "东风启辰“星探计划”", | "navigationBarTitleText": "东风启辰“星探计划”", | ||||
"usingComponents": { | "usingComponents": { | ||||
"tabBar": "../component/tabBar/index" | |||||
"tabBar": "../component/tabBar/index", | |||||
"agreement":"../agreement/agreement" | |||||
} | } | ||||
} | } |
<view class="codeSty" bindtap="getCode">{{verificationCode}}</view> | <view class="codeSty" bindtap="getCode">{{verificationCode}}</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="agreementGroup" bindtap="agreementState"> | |||||
<image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||||
<view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view> | |||||
<view class="agreementGroup"> | |||||
<image class="agreeIcon" bindtap="agreementState" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||||
<view class="agreementText"><view>我仔细阅读并接受所附的</view><view bindtap="agreementControl">《用户协议与隐私政策》</view></view> | |||||
</view> | </view> | ||||
<view class="submitBtn" bindtap="submitMobile">提交</view> | <view class="submitBtn" bindtap="submitMobile">提交</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | |||||
<tabBar></tabBar> | <tabBar></tabBar> | ||||
</view> | </view> |
font-family:PingFangSC; | font-family:PingFangSC; | ||||
font-weight:300; | font-weight:300; | ||||
color:rgba(156,157,157,1); | color:rgba(156,157,157,1); | ||||
display: flex; | |||||
align-items: center; | |||||
} | } | ||||
.getMobileBtn{ | .getMobileBtn{ | ||||
position: absolute; | position: absolute; |
}, | }, | ||||
noData:false, | noData:false, | ||||
optionsData:null, | optionsData:null, | ||||
lookDescId:null, | |||||
lookDescId: null, | |||||
agreement: false,//是否显示协议 | |||||
}, | }, | ||||
/** | /** | ||||
this.setData({ | this.setData({ | ||||
isAgreement: !this.data.isAgreement | isAgreement: !this.data.isAgreement | ||||
}) | }) | ||||
}, | |||||
agreementControl: function () { | |||||
this.setData({ | |||||
agreement: !this.data.agreement | |||||
}) | |||||
} | } | ||||
}) | }) |
"navigationBarTitleText": "个人中心", | "navigationBarTitleText": "个人中心", | ||||
"usingComponents": { | "usingComponents": { | ||||
"service": "../component/service/index", | "service": "../component/service/index", | ||||
"tabBar": "../component/tabBar/index" | |||||
"tabBar": "../component/tabBar/index", | |||||
"agreement": "../agreement/agreement" | |||||
} | } | ||||
} | } |
<view class="recordHeadGroup"> | <view class="recordHeadGroup"> | ||||
<image class="recordUserImg" src="{{userData.avatarUrl&&recordNow!=1?userData.avatarUrl:imgUrl+'/images/defaultHead.png'}}"></image> | <image class="recordUserImg" src="{{userData.avatarUrl&&recordNow!=1?userData.avatarUrl:imgUrl+'/images/defaultHead.png'}}"></image> | ||||
</view> | </view> | ||||
<view class="recordMainGroup"> | |||||
<view class="recordMainGroup" style="width:230rpx;"> | |||||
<view class="rewardName">{{item.awardName}}</view> | <view class="rewardName">{{item.awardName}}</view> | ||||
<view class="rewardTerm">{{item.cdate}}</view> | <view class="rewardTerm">{{item.cdate}}</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</picker> | </picker> | ||||
</view> | </view> | ||||
<view class="agreementGroup" bindtap="agreementState"> | |||||
<image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||||
<view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view> | |||||
<view class="agreementGroup"> | |||||
<image class="agreeIcon" bindtap="agreementState" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||||
<view class="agreementText"><view>我仔细阅读并接受所附的</view><view bindtap="agreementControl">《用户协议与隐私政策》</view></view> | |||||
</view> | </view> | ||||
<view class="subscribeBtn" bindtap="subscribeFun">登录/注册</view> | <view class="subscribeBtn" bindtap="subscribeFun">登录/注册</view> | ||||
<view class="subscribeBtn">查看更多车型</view> | <view class="subscribeBtn">查看更多车型</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | |||||
<tabBar></tabBar> | <tabBar></tabBar> | ||||
</view> | </view> |
font-family:PingFangSC; | font-family:PingFangSC; | ||||
font-weight:300; | font-weight:300; | ||||
color:rgba(156,157,157,1); | color:rgba(156,157,157,1); | ||||
display: flex; | |||||
align-items: center; | |||||
} | } |
posterUrl:[],//海报图片 | posterUrl:[],//海报图片 | ||||
canvasShow: true,//是否渲染canvas | canvasShow: true,//是否渲染canvas | ||||
swiperCurrent: 0,//swiper选中的元素下标 | swiperCurrent: 0,//swiper选中的元素下标 | ||||
userInfoData: app.globalData.userInfoData | |||||
}, | }, | ||||
/** | /** | ||||
*/ | */ | ||||
onReady: function () { | onReady: function () { | ||||
this.data.canvasContron = wx.createCanvasContext('myCanvas'); | this.data.canvasContron = wx.createCanvasContext('myCanvas'); | ||||
this.getCertificationCount(); | |||||
if (app.globalData.openid) { | |||||
this.getCertificationCount(); | |||||
} else { | |||||
app.globalData.openidSuccessFuc = this.getCertificationCount; | |||||
} | |||||
}, | }, | ||||
cacheFun:function(){ | cacheFun:function(){ | ||||
wx.getSystemInfo({ | wx.getSystemInfo({ | ||||
}, | }, | ||||
fail:res=>{ | fail:res=>{ | ||||
wx.getSetting({ | wx.getSetting({ | ||||
success:res=>{ | |||||
console.log(res); | |||||
success: res => { | |||||
if (res.authSetting['scope.writePhotosAlbum']) { | |||||
wx.showToast({ | |||||
title: '保存失败', | |||||
icon:"none" | |||||
}) | |||||
} else { | |||||
wx.showModal({ | |||||
title: '授权设置', | |||||
content: '请授权“保存到相册”', | |||||
success: (opt) => { | |||||
if (opt.confirm) { | |||||
wx.openSetting({ | |||||
success:e=>{ | |||||
if (e.authSetting['scope.writePhotosAlbum']) { | |||||
wx.saveImageToPhotosAlbum({ | |||||
filePath: this.data.posterUrl[this.data.swiperCurrent], | |||||
success(res) { | |||||
wx.showToast({ | |||||
title: '保存成功' | |||||
}) | |||||
} | |||||
}) | |||||
} else { | |||||
wx.showToast({ | |||||
title: '授权失败', | |||||
icon: "none" | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
} | |||||
} | } | ||||
}) | }) | ||||
// wx.showModal({ | |||||
// title: '设置', | |||||
// content: '请授权“保存到相册”', | |||||
// success:()=>{ | |||||
// wx.openSetting({ | |||||
// success(e){ | |||||
// if (e.scope.writePhotosAlbum){ | |||||
// wx.saveImageToPhotosAlbum({ | |||||
// filePath: this.data.posterUrl[this.data.swiperCurrent], | |||||
// success(res) { | |||||
// wx.showToast({ | |||||
// title: '保存成功' | |||||
// }) | |||||
// } | |||||
// }) | |||||
// }else{ | |||||
// wx.showToast({ | |||||
// title: '授权失败', | |||||
// icon:"none" | |||||
// }) | |||||
// } | |||||
// } | |||||
// }) | |||||
// } | |||||
// }) | |||||
} | } | ||||
}) | }) | ||||
}, | }, |
<view class="main"> | <view class="main"> | ||||
<view class="swiperFrame"> | <view class="swiperFrame"> | ||||
<swiper class="swiperSty" current="{{swiperCurrent}}" bindchange="swiperChange" previous-margin="130rpx" next-margin="130rpx"> | <swiper class="swiperSty" current="{{swiperCurrent}}" bindchange="swiperChange" previous-margin="130rpx" next-margin="130rpx"> | ||||
<swiper-item wx:for="{{posterUrl}}" wx:key="index"> | |||||
<!-- <swiper-item wx:for="{{posterUrl}}" wx:key="index"> --> | |||||
<swiper-item wx:for="{{3}}" wx:key="index"> | |||||
<view class="selectTempFrame {{index==swiperCurrent?'selectTempFrameBorder':''}}"> | <view class="selectTempFrame {{index==swiperCurrent?'selectTempFrameBorder':''}}"> | ||||
<image style="width:100%;height:100%;" src="{{item}}"></image> | |||||
<view class="imgGroup"> | |||||
<image style="width:100%;height:100%;" src="{{imgUrl+'/images/tempImg'+(index+1)+'.jpg'}}"></image> | |||||
<view class="userMsg"> | |||||
<!-- <image class="userHead" src="{{userHead}}"></image> --> | |||||
<image class="userHead" src="{{imgUrl+'/images/posterChoose.png'}}"></image> | |||||
<view class="userNickName">{{userInfoData.nickName}}</view> | |||||
</view> | |||||
<view class="userNumber"> | |||||
<image class="posterNum" src="{{imgUrl+'/images/posterNum.png'}}"></image> | |||||
<view class="numberGroup"> | |||||
<image class="numberNum numberNum1" src="{{imgUrl+'/images/nums/'+rankNum[0]+'.png'}}"></image> | |||||
<image class="numberNum numberNum2" src="{{imgUrl+'/images/nums/'+rankNum[1]+'.png'}}"></image> | |||||
<image class="numberNum numberNum3" src="{{imgUrl+'/images/nums/'+rankNum[2]+'.png'}}"></image> | |||||
<image class="numberNum numberNum4" src="{{imgUrl+'/images/nums/'+rankNum[3]+'.png'}}"></image> | |||||
</view> | |||||
</view> | |||||
<image class="userQrCode" src="{{qrCodeUrl}}"></image> | |||||
</view> | |||||
<image wx:if="{{index==swiperCurrent}}" class="posterChoose" src="{{imgUrl+'/images/posterChoose.png'}}"></image> | <image wx:if="{{index==swiperCurrent}}" class="posterChoose" src="{{imgUrl+'/images/posterChoose.png'}}"></image> | ||||
</view> | </view> | ||||
</swiper-item> | </swiper-item> | ||||
</swiper> | </swiper> | ||||
<image class="leftArrow" bindtap="prevImg" src="{{imgUrl+'/images/leftArrow.png'}}"></image> | |||||
<image class="rightArrow" bindtap="nextImg" src="{{imgUrl+'/images/rightArrow.png'}}"></image> | |||||
<image class="leftArrow" wx:if="{{swiperCurrent!=0}}" bindtap="prevImg" src="{{imgUrl+'/images/leftArrow.png'}}"></image> | |||||
<image class="rightArrow" wx:if="{{swiperCurrent!=2}}" bindtap="nextImg" src="{{imgUrl+'/images/rightArrow.png'}}"></image> | |||||
</view> | </view> | ||||
<canvas wx:if="{{canvasShow}}" class="canvasDraw" canvas-id="myCanvas"></canvas> | <canvas wx:if="{{canvasShow}}" class="canvasDraw" canvas-id="myCanvas"></canvas> | ||||
<view class="lookBigPic" bindtap="savePoster"> | <view class="lookBigPic" bindtap="savePoster"> |
top:50%; | top:50%; | ||||
right: 23rpx; | right: 23rpx; | ||||
transform: translateY(-50%); | transform: translateY(-50%); | ||||
} | |||||
.imgGroup{ | |||||
position: relative; | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.userMsg{ | |||||
position: absolute; | |||||
left: 50rpx; | |||||
top: 538rpx; | |||||
display: flex; | |||||
align-items: center; | |||||
} | |||||
.userHead{ | |||||
width: 48rpx; | |||||
height: 48rpx; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
} | |||||
.userNickName{ | |||||
margin-left: 6rpx; | |||||
line-height: 28rpx; | |||||
font-size:28rpx; | |||||
font-family:NissanBrand; | |||||
font-weight:400; | |||||
color:rgba(255,255,255,1); | |||||
} | |||||
.userQrCode{ | |||||
position: absolute; | |||||
right: 57rpx; | |||||
bottom: 39rpx; | |||||
width: 105rpx; | |||||
height: 105rpx; | |||||
} | |||||
.userNumber{ | |||||
position: absolute; | |||||
left: 50rpx; | |||||
top: 598rpx; | |||||
width: 333rpx; | |||||
height: 74rpx; | |||||
} | |||||
.posterNum{ | |||||
position: absolute; | |||||
left: 0; | |||||
top: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.numberGroup{ | |||||
width: 100%; | |||||
height: 100%; | |||||
position: relative; | |||||
} | |||||
.numberNum{ | |||||
width: 32rpx; | |||||
height: 40rpx; | |||||
position: absolute; | |||||
} | |||||
.numberNum1{ | |||||
left: 120rpx; | |||||
top: 4rpx; | |||||
} | |||||
.numberNum2{ | |||||
left: 155rpx; | |||||
top: 4rpx; | |||||
} | |||||
.numberNum3{ | |||||
left: 188rpx; | |||||
top: 4rpx; | |||||
} | |||||
.numberNum4{ | |||||
left: 223rpx; | |||||
top: 4rpx; | |||||
} | } |
"name": "手机验证", | "name": "手机验证", | ||||
"pathName": "pages/mobileVerification/mobileVerification", | "pathName": "pages/mobileVerification/mobileVerification", | ||||
"query": "" | "query": "" | ||||
} | |||||
}, | |||||
{ | |||||
"id": -1, | |||||
"name": "用户协议与隐私政策", | |||||
"pathName": "pages/agreement/agreement", | |||||
"query": "" | |||||
} | |||||
] | ] | ||||
} | } | ||||
} | } |