@@ -13,6 +13,10 @@ App({ | |||
if (userMobile){ | |||
this.globalData.userMobile = userMobile; | |||
} | |||
var friendOpenid = wx.getStorageSync('friendOpenid'); | |||
if (friendOpenid) { | |||
this.globalData.friendOpenid = friendOpenid; | |||
} | |||
var userInfoData = wx.getStorageSync("userInfoData"); | |||
if (userInfoData){ | |||
this.globalData.userInfoData = {}; |
@@ -13,7 +13,8 @@ | |||
"pages/coupon/coupon", | |||
"pages/receiveRegister/receiveRegister", | |||
"pages/address/address", | |||
"pages/mobileVerification/mobileVerification" | |||
"pages/mobileVerification/mobileVerification", | |||
"pages/agreement/agreement" | |||
], | |||
"window": { | |||
"backgroundTextStyle": "light", |
@@ -0,0 +1,26 @@ | |||
// pages/agreement/agreement.js | |||
const app = getApp() | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
closeXieyi:function(){ | |||
this.triggerEvent('myevent') | |||
} | |||
}, | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,12 @@ | |||
<!--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> |
@@ -0,0 +1,53 @@ | |||
/* 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; | |||
} |
@@ -7,15 +7,22 @@ Page({ | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
friendOpenid:null,//朋友的openid | |||
countNum:0, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
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; | |||
} | |||
}, | |||
@@ -68,9 +75,34 @@ Page({ | |||
return app.sharePack(); | |||
}, | |||
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) | |||
} | |||
}) |
@@ -5,7 +5,7 @@ | |||
<view class="prizeFrame"> | |||
<image class="coupon" src="{{imgUrl+'/images/coupon.png'}}"></image> | |||
<view class="getPrizeNumGroup"> | |||
<view class="getPrizeNum">全国已有 581人获得了500元启辰星购车券</view> | |||
<view class="getPrizeNum">全国已有 {{countNum}}人获得了500元启辰星购车券</view> | |||
</view> | |||
<view bindtap="receive" class="receiveBtn">立即领取</view> | |||
</view> |
@@ -7,7 +7,8 @@ Page({ | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
showClose:false, | |||
showRule:false,//是否显示游戏规则 | |||
showClose:true, | |||
maskShow: false, | |||
taskShow: false, | |||
taskName:'', | |||
@@ -16,7 +17,6 @@ Page({ | |||
isShare:false, | |||
picturlList: [], | |||
picturlCurrent:0, | |||
isRegister:false,//是否已注册 | |||
shareId:null, | |||
isFriendShare:false,//是否朋友分享过来的 | |||
isAddress:false,//是否有地址 | |||
@@ -101,8 +101,7 @@ Page({ | |||
}, | |||
loadFun: function () { | |||
this.getTaskProgress(); | |||
this.getOrderInfo(); | |||
this.getShareId(); | |||
this.getSignInfo(); | |||
this.getAddress(); | |||
if (this.data.isFriendShare) { | |||
this.useShareId(); | |||
@@ -153,11 +152,15 @@ Page({ | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
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 () {//获取任务完成度 | |||
@@ -174,21 +177,6 @@ Page({ | |||
} | |||
}, 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(){//领取购车红包 | |||
this.getTaskAward(); | |||
}, | |||
@@ -209,25 +197,13 @@ Page({ | |||
getTaskAward:function(){//领取购车券 | |||
wx.wxRequest(app.globalData.urlRoot + "task/getTaskAward", { awardGiveId: this.data.picturlList[this.data.picturlCurrent]['awardGiveId']},res=>{ | |||
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({ | |||
url: '../myCenter/myCenter' | |||
url: '/pages/myCenter/myCenter' | |||
}) | |||
// } | |||
}else{ | |||
wx.navigateTo({ | |||
url: '../receiveRegister/receiveRegister', | |||
url: '/pages/address/address', | |||
}) | |||
} | |||
}else{ | |||
@@ -240,6 +216,7 @@ Page({ | |||
}, | |||
getSignInfo: function () {//查看当日是否签到 | |||
app.wxRequest(app.globalData.urlRoot + "task/getSignInfo", {}, res => { | |||
this.getShareId(); | |||
if(res.code==200){ | |||
if (res.data.state==0) {//未签到 | |||
this.setData({ | |||
@@ -248,23 +225,21 @@ Page({ | |||
taskShow: true, | |||
isSign: true | |||
}) | |||
}else{ | |||
if (this.data.shareId){ | |||
this.setData({ | |||
showClose: true, | |||
maskShow: true, | |||
taskShow: true, | |||
isShare: true | |||
}) | |||
} | |||
} | |||
} | |||
},this) | |||
}, | |||
getShareId: function () {//获取分享id(查询今日是否已被助力) | |||
app.wxRequest(app.globalData.urlRoot + "task/getShareId", {}, res => { | |||
this.getSignInfo(); | |||
if (res.code == 200) { | |||
if (res.data.shareId){ | |||
this.setData({ | |||
showClose: true, | |||
maskShow: true, | |||
taskShow: true, | |||
isShare: true | |||
}) | |||
} | |||
this.setData({ | |||
taskName: "集齐启辰星【" + res.data.shortName+"】碎片1/4", | |||
taskImgUrl: res.data.popPicUrl, | |||
@@ -287,5 +262,10 @@ Page({ | |||
picturlCurrent: e.detail.current, | |||
}) | |||
} | |||
}, | |||
ruleControl:function(e){ | |||
this.setData({ | |||
showRule: e.currentTarget.dataset.state | |||
}) | |||
} | |||
}) |
@@ -1,7 +1,7 @@ | |||
<!--pages/everyday/everyday.wxml--> | |||
<view id="everyday" class="showView"> | |||
<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="menuBox"> | |||
<image class="menu" src="{{imgUrl+'/star/everyday/menu.png'}}"></image> | |||
@@ -45,8 +45,8 @@ | |||
</swiper-item> | |||
</block> | |||
</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 class="btnBox" wx:if="{{picturlList[picturlCurrent]['awardState']==0}}"> | |||
<view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | |||
@@ -60,19 +60,26 @@ | |||
</view> | |||
<view class="mask" wx:if="{{maskShow}}"> | |||
<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="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="btn" wx:if="{{isSign}}" bindtap="signIn">签到解锁</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> | |||
</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> |
@@ -315,4 +315,47 @@ | |||
margin: 42rpx auto 0 auto; | |||
background-color: #345486; | |||
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%; | |||
} |
@@ -7,7 +7,7 @@ Page({ | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
ruleShow: true,//是否显示游戏玩法 | |||
ruleShow: false,//是否显示游戏玩法 | |||
ruleCloseShow: false,//是否显示游戏玩法关闭按钮 | |||
clawTop:95,//爪子的top值 | |||
clawLeft: 293,//爪子的left值 | |||
@@ -25,6 +25,15 @@ Page({ | |||
gameState:false,//游戏状态 | |||
endGameData:null,//中奖数据 | |||
isAddress:false,//是否有地址 | |||
configure:{ | |||
page:1, | |||
count:10 | |||
}, | |||
gameAwardList:[], | |||
userData:null, | |||
scrollNum:0, | |||
setInt:null, | |||
isMore:true | |||
}, | |||
/** | |||
@@ -33,12 +42,21 @@ Page({ | |||
onLoad: function (options) { | |||
app.globalData.nowPage = 3; | |||
if (app.globalData.openid) { | |||
this.getAddress(); | |||
this.loadFun(); | |||
} 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(); | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
@@ -242,7 +260,6 @@ Page({ | |||
downNum: this.data.downNum | |||
}) | |||
if (this.data.downNum < 1) { | |||
// this.closeSetInt(); | |||
this.getClaw(); | |||
} | |||
},1000); | |||
@@ -270,7 +287,7 @@ Page({ | |||
} | |||
}, | |||
getAddress: function () {//获取地址 | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | |||
app.wxRequest(app.globalData.urlRoot + "address/getAddress", {}, res => { | |||
if (res.code == 200) { | |||
if (res.data) { | |||
this.data.isAddress = true; | |||
@@ -295,5 +312,57 @@ Page({ | |||
this.setData({ | |||
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(); | |||
} | |||
}) |
@@ -14,7 +14,8 @@ | |||
<view class="prizeTipLine"></view> | |||
</view> | |||
<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 class="prizeLookGroup"> | |||
<view class="prizeLook" bindtap="prizeLook">活动奖品</view> | |||
@@ -35,7 +36,7 @@ | |||
<view class="ruleGroup"> | |||
<image class="gameRuleIcon" src="{{imgUrl+'/images/gameRuleDesc.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 class="gameRuleDesc" style="background-color:rgba(000,000,000,0)" wx:if="{{false}}"> |
@@ -310,13 +310,23 @@ view{ | |||
align-items: center; | |||
justify-content: center; | |||
border-radius: 20rpx; | |||
overflow: hidden; | |||
position: relative; | |||
} | |||
/* .tipContentGroup::-webkit-scrollbar { | |||
display:none; | |||
width:0; | |||
height:0; | |||
color:transparent; | |||
} */ | |||
.tipContent{ | |||
font-size:21rpx; | |||
font-family:PingFangSC; | |||
font-weight:400; | |||
color:rgba(21,83,136,1); | |||
line-height:21rpx; | |||
line-height:62rpx; | |||
padding-right: 10rpx; | |||
white-space: nowrap; | |||
} | |||
.prizeLookGroup{ | |||
padding-top:40rpx; | |||
@@ -343,4 +353,31 @@ view{ | |||
top: 0; | |||
z-index: 2; | |||
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; | |||
} |
@@ -13,6 +13,7 @@ Page({ | |||
mobileText:"",//手机号 | |||
verificationText:null, | |||
getMobileBtnShow:true, | |||
agreement:false,//是否显示协议 | |||
}, | |||
/** | |||
@@ -200,5 +201,10 @@ Page({ | |||
} | |||
}, this) | |||
} | |||
}, | |||
agreementControl:function(){ | |||
this.setData({ | |||
agreement: !this.data.agreement | |||
}) | |||
} | |||
}) |
@@ -1,6 +1,7 @@ | |||
{ | |||
"navigationBarTitleText": "东风启辰“星探计划”", | |||
"usingComponents": { | |||
"tabBar": "../component/tabBar/index" | |||
"tabBar": "../component/tabBar/index", | |||
"agreement":"../agreement/agreement" | |||
} | |||
} |
@@ -22,12 +22,13 @@ | |||
<view class="codeSty" bindtap="getCode">{{verificationCode}}</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 class="submitBtn" bindtap="submitMobile">提交</view> | |||
</view> | |||
</view> | |||
<agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | |||
<tabBar></tabBar> | |||
</view> |
@@ -126,6 +126,8 @@ view{ | |||
font-family:PingFangSC; | |||
font-weight:300; | |||
color:rgba(156,157,157,1); | |||
display: flex; | |||
align-items: center; | |||
} | |||
.getMobileBtn{ | |||
position: absolute; |
@@ -47,7 +47,8 @@ Page({ | |||
}, | |||
noData:false, | |||
optionsData:null, | |||
lookDescId:null, | |||
lookDescId: null, | |||
agreement: false,//是否显示协议 | |||
}, | |||
/** | |||
@@ -520,5 +521,10 @@ Page({ | |||
this.setData({ | |||
isAgreement: !this.data.isAgreement | |||
}) | |||
}, | |||
agreementControl: function () { | |||
this.setData({ | |||
agreement: !this.data.agreement | |||
}) | |||
} | |||
}) |
@@ -2,6 +2,7 @@ | |||
"navigationBarTitleText": "个人中心", | |||
"usingComponents": { | |||
"service": "../component/service/index", | |||
"tabBar": "../component/tabBar/index" | |||
"tabBar": "../component/tabBar/index", | |||
"agreement": "../agreement/agreement" | |||
} | |||
} |
@@ -98,7 +98,7 @@ | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{userData.avatarUrl&&recordNow!=1?userData.avatarUrl:imgUrl+'/images/defaultHead.png'}}"></image> | |||
</view> | |||
<view class="recordMainGroup"> | |||
<view class="recordMainGroup" style="width:230rpx;"> | |||
<view class="rewardName">{{item.awardName}}</view> | |||
<view class="rewardTerm">{{item.cdate}}</view> | |||
</view> | |||
@@ -164,9 +164,9 @@ | |||
</view> | |||
</picker> | |||
</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 class="subscribeBtn" bindtap="subscribeFun">登录/注册</view> | |||
<view class="subscribeBtn">查看更多车型</view> | |||
@@ -202,5 +202,6 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | |||
<tabBar></tabBar> | |||
</view> |
@@ -608,4 +608,6 @@ view{ | |||
font-family:PingFangSC; | |||
font-weight:300; | |||
color:rgba(156,157,157,1); | |||
display: flex; | |||
align-items: center; | |||
} |
@@ -18,6 +18,7 @@ Page({ | |||
posterUrl:[],//海报图片 | |||
canvasShow: true,//是否渲染canvas | |||
swiperCurrent: 0,//swiper选中的元素下标 | |||
userInfoData: app.globalData.userInfoData | |||
}, | |||
/** | |||
@@ -32,7 +33,11 @@ Page({ | |||
*/ | |||
onReady: function () { | |||
this.data.canvasContron = wx.createCanvasContext('myCanvas'); | |||
this.getCertificationCount(); | |||
if (app.globalData.openid) { | |||
this.getCertificationCount(); | |||
} else { | |||
app.globalData.openidSuccessFuc = this.getCertificationCount; | |||
} | |||
}, | |||
cacheFun:function(){ | |||
wx.getSystemInfo({ | |||
@@ -145,35 +150,43 @@ Page({ | |||
}, | |||
fail:res=>{ | |||
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" | |||
// }) | |||
// } | |||
// } | |||
// }) | |||
// } | |||
// }) | |||
} | |||
}) | |||
}, |
@@ -3,15 +3,33 @@ | |||
<view class="main"> | |||
<view class="swiperFrame"> | |||
<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':''}}"> | |||
<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> | |||
</view> | |||
</swiper-item> | |||
</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> | |||
<canvas wx:if="{{canvasShow}}" class="canvasDraw" canvas-id="myCanvas"></canvas> | |||
<view class="lookBigPic" bindtap="savePoster"> |
@@ -125,4 +125,77 @@ view{ | |||
top:50%; | |||
right: 23rpx; | |||
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; | |||
} |
@@ -107,7 +107,13 @@ | |||
"name": "手机验证", | |||
"pathName": "pages/mobileVerification/mobileVerification", | |||
"query": "" | |||
} | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "用户协议与隐私政策", | |||
"pathName": "pages/agreement/agreement", | |||
"query": "" | |||
} | |||
] | |||
} | |||
} |