@@ -10,7 +10,8 @@ | |||
"pages/scout/share/share", | |||
"pages/prizes/prizes", | |||
"pages/poster/poster", | |||
"pages/coupon/coupon" | |||
"pages/coupon/coupon", | |||
"pages/receiveRegister/receiveRegister" | |||
], | |||
"window": { | |||
"backgroundTextStyle": "light", |
@@ -7,14 +7,18 @@ Page({ | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
showClose:false, | |||
maskShow: false, | |||
taskShow: false, | |||
taskName:'集齐启辰星【大灯】碎片', | |||
taskImgUrl:'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg1.png', | |||
isSign:true, | |||
isShare:false, | |||
picturlList: ['picturePuzzle1', 'picturePuzzle1','picturePuzzle1'], | |||
picturlName:[], | |||
picturlList: ['picturePuzzle1', 'picturePuzzle1'], | |||
picturlCurrent:0, | |||
isRegister:false,//是否已注册 | |||
shareId:null, | |||
}, | |||
/** | |||
* 关闭任务窗 | |||
@@ -28,13 +32,29 @@ Page({ | |||
/** | |||
* 签到 | |||
*/ | |||
signIn(){ | |||
this.setData({ | |||
taskName: '集齐启辰星【大灯】碎片1/4', | |||
taskImgUrl: 'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg2.png', | |||
isSign: false, | |||
isShare: true | |||
}) | |||
signIn() { | |||
app.wxRequest(app.globalData.urlRoot +"task/signToday",{},res=>{ | |||
if (res.code == 200) { | |||
if (!this.data.shareId) { | |||
this.setData({ | |||
maskShow: false | |||
}) | |||
} else { | |||
this.setData({ | |||
taskName: '集齐启辰星【大灯】碎片1/4', | |||
taskImgUrl: 'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg2.png', | |||
isSign: false, | |||
isShare: true, | |||
showClose: true | |||
}) | |||
} | |||
}else{ | |||
wx.showToast({ | |||
title: res.msg, | |||
icon:"none" | |||
}) | |||
} | |||
},this,"POST"); | |||
}, | |||
/** | |||
* 下个碎片 | |||
@@ -70,9 +90,18 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
app.globalData.nowPage = 2; | |||
if (app.globalData.openid) { | |||
this.loadFun(); | |||
} else { | |||
app.globalData.openidSuccessFuc = this.loadFun; | |||
} | |||
}, | |||
loadFun: function () { | |||
this.getTaskProgress(); | |||
this.getOrderInfo(); | |||
this.getShareId(); | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
@@ -119,6 +148,93 @@ Page({ | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
this.useShareId(); | |||
return { | |||
title: '我正在参与“星探计划”,快来帮我 解锁内饰碎片吧,共享大奖!', | |||
imageUrl: "", | |||
path: "/pages/everyday/everyday" | |||
} | |||
}, | |||
getTaskProgress: function () {//获取任务完成度 | |||
app.wxRequest(app.globalData.urlRoot + "task/getTaskProgress", { taskType: 1 }, res => { | |||
if (res.code == 200) { | |||
for(let i=0;i<res.data.length;i++){ | |||
this.data.picturlName.push(res.data[i].taskName); | |||
} | |||
this.setData({ | |||
picturlName: this.data.picturlName | |||
}) | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
}) | |||
} | |||
}, 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(){//领取购车红包 | |||
if (this.data.isRegister){ | |||
wx.redirectTo({ | |||
url: '../myCenter/myCenter' | |||
}) | |||
}else{ | |||
wx.navigateTo({ | |||
url: '../receiveRegister/receiveRegister', | |||
}) | |||
} | |||
}, | |||
getSignInfo: function () {//查看当日是否签到 | |||
app.wxRequest(app.globalData.urlRoot + "task/getSignInfo", {}, res => { | |||
if(res.code==200){ | |||
if (res.data.state==0) {//未签到 | |||
this.setData({ | |||
showClose: false, | |||
maskShow: true, | |||
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) { | |||
this.data.shareId = res.data.shareId; | |||
} | |||
}, this) | |||
}, | |||
useShareId: function () {//发起助力 | |||
app.wxRequest(app.globalData.urlRoot + "task/useShareId", { shareId:this.data.shareId}, res => { | |||
console.log(res); | |||
this.setData({ | |||
maskShow:false | |||
}) | |||
}, this,"POST") | |||
} | |||
}) |
@@ -1,4 +1,5 @@ | |||
{ | |||
"navigationBarTitleText": "东风启辰“星探计划”", | |||
"usingComponents": { | |||
"tabBar": "../component/tabBar/index" | |||
} |
@@ -5,13 +5,13 @@ | |||
<view class="title">集碎片,攒红包</view> | |||
<view class="menuBox"> | |||
<image class="menu" src="{{imgUrl+'/star/everyday/menu.png'}}"></image> | |||
<view class="leftTitle">操控</view> | |||
<view class="centerTitle">外观模块</view> | |||
<view class="rightTitle">内饰</view> | |||
<view class="leftTitle">{{picturlName[picturlCurrent-1]}}</view> | |||
<view class="centerTitle">{{picturlName[picturlCurrent]}}</view> | |||
<view class="rightTitle">{{picturlName[picturlCurrent+1]}}</view> | |||
</view> | |||
<view class="swiperBox"> | |||
<swiper current="{{picturlCurrent}}"> | |||
<block wx:for="{{picturlList}}" wx:key="*this"> | |||
<block wx:for="{{picturlList}}" wx:key="index"> | |||
<swiper-item> | |||
<view class="fragmentBox"> | |||
<image class="fragmentComplete" src="{{imgUrl+'/star/everyday/'+item+'.png'}}"></image> | |||
@@ -22,19 +22,24 @@ | |||
<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> | |||
</view> | |||
<view class="btnBox"> | |||
<!-- <view class="btnBox"> | |||
<view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | |||
<view class="btn select" style="margin-left:20rpx;">每日任务</view> | |||
</view> --> | |||
<view class="btnBox" style="width:677rpx;"> | |||
<view class="receive" bindtap="receive">领取购车红包</view> | |||
</view> | |||
<view class="mask" wx:if="{{maskShow}}"> | |||
<view class="taskBox" wx:if="{{taskShow}}"> | |||
<text class="closeBtn" style="right:-35rpx;top:-50rpx;" bindtap="hiddenTask"></text> | |||
<text wx:if="{{showClose}}" class="closeBtn" style="right:-35rpx;top:-50rpx;" bindtap="hiddenTask"></text> | |||
<view class="title">今日任务</view> | |||
<view class="contentBox"> | |||
<view class="name">{{taskName}}</view> | |||
<image class="taskImg" src="{{taskImgUrl}}"></image> | |||
<view class="btn" wx:if="{{isSign}}" bindtap="signIn">签到解锁</view> | |||
<view class="btn" wx:if="{{isShare}}">分享再获取一张碎片</view> | |||
<view class="btn" wx:if="{{isShare}}">分享再获取一张碎片 | |||
<button open-type="share" class="shareBtn" style="width:100%;height:100%;margin:0;padding:0;min-height:0;"></button> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -9,7 +9,7 @@ | |||
.ruleBtn { | |||
right: 0; | |||
top: 180rpx; | |||
position: absolute; | |||
position: fixed; | |||
width: 153rpx; | |||
height: 46rpx; | |||
line-height: 46rpx; | |||
@@ -105,7 +105,9 @@ | |||
width: 615rpx; | |||
height: 49rpx; | |||
text-align: center; | |||
margin: 48rpx auto 0 auto; | |||
padding-top: 22rpx; | |||
padding-bottom: 38rpx; | |||
margin:0 auto; | |||
} | |||
.btnBox>.btn{ | |||
display: inline-block; | |||
@@ -125,7 +127,7 @@ | |||
} | |||
.mask { | |||
position: absolute; | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
width: 100%; | |||
@@ -182,6 +184,7 @@ | |||
border-radius: 10rpx; | |||
margin: 42rpx auto 0 auto; | |||
background-color: #345486; | |||
position: relative; | |||
} | |||
.closeBtn { | |||
background: none; | |||
@@ -202,3 +205,22 @@ | |||
.closeBtn::before { | |||
content: "\2716"; | |||
} | |||
.receive{ | |||
width:677rpx; | |||
height:61rpx; | |||
background-color: #28558D; | |||
line-height: 61rpx; | |||
text-align: center; | |||
font-size:30rpx; | |||
font-family:PingFang; | |||
font-weight:400; | |||
color:rgba(255,255,255,1); | |||
border-radius: 15rpx; | |||
} | |||
.shareBtn{ | |||
position: absolute; | |||
left: 0; | |||
top: 0; | |||
z-index: 2; | |||
opacity: 0; | |||
} |
@@ -13,6 +13,7 @@ Page({ | |||
swiperCurrent:0,//swiper选中的元素下标 | |||
verificationCode: '获取验证码',//验证码文案 | |||
sendCode: true, | |||
appointment:true, | |||
subscribeData: { | |||
realname:"",//姓名 | |||
mobile:"",//手机号 | |||
@@ -25,7 +26,7 @@ Page({ | |||
startAdvertisingUrl:'',//开屏广告路径 | |||
isStartAdvertising: 1,//开屏广告透明度 | |||
isStartAdvertisingShow: true,//是否显示开屏广告 | |||
isRegister:false,//查询是否已注册 | |||
// isRegister:false,//查询是否已注册 | |||
bannerList:[],//banner列表 | |||
videoList:[],//视频列表 | |||
videoVideoControls:false,//是否显示视频控件 | |||
@@ -45,6 +46,14 @@ Page({ | |||
} | |||
}, | |||
loadFun: function () { | |||
if (app.globalData.userMobile) { | |||
this.data.subscribeData.mobile = app.globalData.userMobile; | |||
this.setData({ | |||
phoneInputShow: true, | |||
subscribeData: this.data.subscribeData | |||
}) | |||
this.getUserLocation(); | |||
} | |||
if (app.globalData.isFirstLogin) { | |||
this.getHomeBanner();//获取banner | |||
this.getHomeVideo();//获取视频 | |||
@@ -75,13 +84,13 @@ Page({ | |||
this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | |||
} | |||
} | |||
if (!app.globalData.isRegister) { | |||
this.getOrderInfo(); | |||
} | |||
// if (!app.globalData.isRegister) { | |||
// this.getOrderInfo(); | |||
// } | |||
this.setData({ | |||
mainShow: true, | |||
isStartAdvertisingShow: this.data.isOnce ? true : app.globalData.isFirstLogin, | |||
isRegister: app.globalData.isRegister | |||
// isRegister: app.globalData.isRegister | |||
}) | |||
}, | |||
provinceChane: function (e) {//选中省 | |||
@@ -206,7 +215,6 @@ Page({ | |||
} | |||
this.data.sendCode = false; | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | |||
this.data.sendCode = true; | |||
if (res.code == 200) { | |||
this.countDown(); | |||
wx.showToast({ | |||
@@ -216,7 +224,8 @@ Page({ | |||
this.setData({ | |||
verificationCode:60 | |||
}) | |||
}else{ | |||
} else { | |||
this.data.sendCode = true; | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
@@ -270,20 +279,25 @@ Page({ | |||
}) | |||
return; | |||
} | |||
if (!this.data.sendCode) { | |||
if (!this.data.appointment) { | |||
return; | |||
} | |||
this.data.sendCode = false; | |||
this.data.appointment = false; | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | |||
this.data.sendCode = true; | |||
this.data.appointment = true; | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '预约成功' | |||
}) | |||
this.data.subscribeData.realname = ""; | |||
this.data.subscribeData.captcha = ""; | |||
this.setData({ | |||
isRegister:true | |||
subscribeData: this.data.subscribeData | |||
}) | |||
app.globalData.isRegister = true; | |||
// this.setData({ | |||
// isRegister:true | |||
// }) | |||
// app.globalData.isRegister = true; | |||
app.globalData.userMobile = this.data.subscribeData.mobile; | |||
// wx.redirectTo({ | |||
// url: "../myCenter/myCenter?sourcePage='home'" | |||
@@ -353,10 +367,10 @@ Page({ | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | |||
if (res.code == 200) { | |||
if (res.data) { | |||
this.setData({ | |||
isRegister: true | |||
}) | |||
app.globalData.isRegister = true; | |||
// this.setData({ | |||
// isRegister: true | |||
// }) | |||
// app.globalData.isRegister = true; | |||
app.globalData.userMobile = res.data.mobile; | |||
}else{ | |||
if (app.globalData.userMobile) { |
@@ -23,16 +23,17 @@ | |||
<image class="indexBottom" src="{{imgUrl+'/images/indexBottom.png'}}"></image> | |||
</view> | |||
<image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | |||
<view class="msgFrame" wx:if="{{!isRegister}}"> | |||
<!-- <view class="msgFrame" wx:if="{{!isRegister}}"> --> | |||
<view class="msgFrame"> | |||
<view class="inputGroup"> | |||
<input class="inputSty" placeholder="姓名" bindinput="getRealname"></input> | |||
<input class="inputSty" placeholder="姓名" value="{{subscribeData.realname}}" bindinput="getRealname"></input> | |||
<input class="inputSty" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="电话"></input> | |||
<view class="getPhoneFrame" wx:if="{{!phoneInputShow}}"> | |||
<button class="getPhoneBtn" open-type="getPhoneNumber" bindgetphonenumber="getUserPhone"></button> | |||
</view> | |||
</view> | |||
<view class="codeGroup"> | |||
<input class="inputCode" bindinput="getCaptcha" placeholder="验证码"></input> | |||
<input class="inputCode" bindinput="getCaptcha" value="{{subscribeData.captcha}}" placeholder="验证码"></input> | |||
<view class="codeTime" bindtap="getCode">{{verificationCode}}</view> | |||
</view> | |||
<view wx:if="{{siteSelect}}"> |
@@ -22,6 +22,7 @@ Page({ | |||
storeValue: 0,//选中的店铺下标 | |||
verificationCode: '获取验证码',//验证码文案 | |||
sendCode: true, | |||
appointment: true, | |||
subscribeData: { | |||
realname: "",//姓名 | |||
mobile: "",//手机号 | |||
@@ -38,7 +39,7 @@ Page({ | |||
}, | |||
descFrameShow:false,//是否显示奖品详情 | |||
ruleShow: false,//是否显示星探等级规则 | |||
isRegister: false,//查询是否已注册 | |||
// isRegister: false,//查询是否已注册 | |||
parames:{ | |||
page:1, | |||
count:20 | |||
@@ -64,21 +65,29 @@ Page({ | |||
}, | |||
loadFun: function () { | |||
this.getUserInfo(); | |||
if (app.globalData.userMobile) { | |||
this.data.subscribeData.mobile = app.globalData.userMobile; | |||
this.setData({ | |||
phoneInputShow: true, | |||
subscribeData: this.data.subscribeData | |||
}) | |||
this.getUserLocation(); | |||
} | |||
if (app.globalData.myCenterData) { | |||
this.setData({ | |||
provinceArr: app.globalData.myCenterData.provinceArr, | |||
storeArr: app.globalData.myCenterData.storeArr, | |||
provinceValue: app.globalData.myCenterData.provinceValue, | |||
storeValue: app.globalData.myCenterData.storeValue, | |||
isRegister: app.globalData.isRegister | |||
// isRegister: app.globalData.isRegister | |||
}) | |||
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.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | |||
} | |||
if (!app.globalData.isRegister) { | |||
this.getOrderInfo(); | |||
} | |||
// if (!app.globalData.isRegister) { | |||
// this.getOrderInfo(); | |||
// } | |||
if (app.globalData.userInfoData) { | |||
this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | |||
this.data.userData.nickName = app.globalData.userInfoData.nickName; | |||
@@ -248,7 +257,6 @@ Page({ | |||
} | |||
this.data.sendCode = false; | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | |||
this.data.sendCode = true; | |||
if (res.code == 200) { | |||
this.countDown(); | |||
wx.showToast({ | |||
@@ -259,6 +267,7 @@ Page({ | |||
verificationCode: 60 | |||
}) | |||
} else { | |||
this.data.sendCode = true; | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
@@ -312,20 +321,25 @@ Page({ | |||
}) | |||
return; | |||
} | |||
if (!this.data.sendCode) { | |||
if (!this.data.appointment) { | |||
return; | |||
} | |||
this.data.sendCode = false; | |||
this.data.appointment = false; | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | |||
this.data.sendCode = true; | |||
this.data.appointment = true; | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '预约成功' | |||
}) | |||
this.data.subscribeData.realname = ""; | |||
this.data.subscribeData.captcha = ""; | |||
this.setData({ | |||
isRegister: true | |||
subscribeData: this.data.subscribeData | |||
}) | |||
app.globalData.isRegister = true; | |||
// this.setData({ | |||
// isRegister: true | |||
// }) | |||
// app.globalData.isRegister = true; | |||
app.globalData.userMobile = this.data.subscribeData.mobile; | |||
} else { | |||
wx.showToast({ |
@@ -135,9 +135,10 @@ | |||
</view> | |||
</scroll-view> | |||
</view> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4 && !isRegister}}"> | |||
<!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && !isRegister}}"> --> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4}}"> | |||
<view class="inputGroup"> | |||
<input class="inputCode" bindinput="getRealname" placeholder="请输入您的姓名"></input> | |||
<input class="inputCode" bindinput="getRealname" value="{{subscribeData.realname}}" placeholder="请输入您的姓名"></input> | |||
</view> | |||
<view class="inputGroup"> | |||
<input class="inputCode" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="请输入您的联系电话"></input> | |||
@@ -146,7 +147,7 @@ | |||
</view> | |||
</view> | |||
<view class="inputGroup"> | |||
<input class="inputCode" style="width:500rpx;" bindinput="getCaptcha" placeholder="请输入验证码"></input> | |||
<input class="inputCode" style="width:500rpx;" value="{{subscribeData.captcha}}" bindinput="getCaptcha" placeholder="请输入验证码"></input> | |||
<view class="codeTime" bindtap="getCode">{{verificationCode}}</view> | |||
</view> | |||
<view wx:if="{{siteSelect}}"> | |||
@@ -165,9 +166,9 @@ | |||
</view> | |||
<view class="subscribeBtn" bindtap="subscribeFun">预约鉴赏</view> | |||
</view> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||
<!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||
<view>已预约</view> | |||
</view> | |||
</view> --> | |||
<service></service> | |||
<view class="prizeDesc" catchtouchmove="ture" wx:if="{{descFrameShow}}"> | |||
<view class="prizeImgGroup" wx:if="{{recordList[lookDescId].awardId!=1}}"> |
@@ -131,7 +131,7 @@ Page({ | |||
onShareAppMessage: function () { | |||
return { | |||
title: '您有一份启辰星专属礼品待领取', | |||
imageUrl: this.data.imgUrl+"/images/posterShareImg.png", | |||
imageUrl: this.data.imgUrl + "/images/posterShareImg" + (this.data.swiperCurrent+1)+".jpg", | |||
path: "/pages/coupon/coupon?friendOpenid=" + app.globalData.openid | |||
} | |||
}, |
@@ -0,0 +1,294 @@ | |||
// pages/receiveRegister/receiveRegister.js | |||
const app = getApp() | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
imgUrl: app.globalData.urlStatic,//图片路径 | |||
isAgreement:true,//是否同意协议 | |||
phoneInputShow: false,//是否显示电话输入框 | |||
verificationCode: '获取验证码',//验证码文案 | |||
sendCode: true, | |||
appointment:true, | |||
provinceArr: [],//省 | |||
provinceValue: 0,//选中的省下标 | |||
storeArr: [],//店铺 | |||
storeValue: 0,//选中的店铺下标 | |||
siteSelect: false,//是否显示位置选择框 | |||
subscribeData: { | |||
realname: "",//姓名 | |||
mobile: "",//手机号 | |||
captcha: "",//验证码 | |||
province: "",//省份 | |||
agent_code: "",//经销商编码 | |||
agentDetail: "",//经销商详细信息 | |||
parentOpenid: app.globalData.friendOpenid,//好友openid | |||
}, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
app.globalData.nowPage = 2; | |||
if (app.globalData.userMobile) { | |||
this.data.subscribeData.mobile = app.globalData.userMobile; | |||
this.setData({ | |||
phoneInputShow: true, | |||
subscribeData: this.data.subscribeData | |||
}) | |||
this.getUserLocation(); | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
}, | |||
getCode: function (e) {//获取验证码 | |||
if (!app.mobileVerify(this.data.subscribeData.mobile)) { | |||
if (this.data.subscribeData.mobile) { | |||
wx.showToast({ | |||
title: '请输入正确的电话', | |||
icon: 'none' | |||
}) | |||
} else { | |||
wx.showToast({ | |||
title: '请输入电话', | |||
icon: 'none' | |||
}) | |||
} | |||
return; | |||
} | |||
if (!this.data.sendCode) { | |||
return; | |||
} | |||
this.data.sendCode = false; | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | |||
if (res.code == 200) { | |||
this.countDown(); | |||
wx.showToast({ | |||
title: '验证码获取成功', | |||
icon: "none" | |||
}) | |||
this.setData({ | |||
verificationCode: 60 | |||
}) | |||
} else { | |||
this.data.sendCode = true; | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
}) | |||
} | |||
}, this) | |||
}, | |||
countDown: function () {//倒计时 | |||
setTimeout(() => { | |||
this.setData({ | |||
verificationCode: this.data.verificationCode - 1 | |||
}) | |||
if (this.data.verificationCode > 0) { | |||
this.countDown(); | |||
} else { | |||
this.setData({ | |||
verificationCode: "获取验证码" | |||
}) | |||
this.data.sendCode = true; | |||
} | |||
}, 1000); | |||
}, | |||
getRealname: function (e) {//获取用户输入的姓名 | |||
this.data.subscribeData.realname = e.detail.value; | |||
}, | |||
getMobile: function (e) {//获取用户输入的电话 | |||
this.data.subscribeData.mobile = e.detail.value; | |||
}, | |||
getCaptcha: function (e) {//获取用户输入的验证码 | |||
this.data.subscribeData.captcha = e.detail.value; | |||
}, | |||
getUserPhone: function (e) {//获取用户手机号 | |||
this.setData({ | |||
phoneInputShow: true | |||
}) | |||
if (!app.globalData.indexData.provinceArr) { | |||
this.getUserLocation();//获取用户当前位置 | |||
} | |||
if (e.detail.errMsg == 'getPhoneNumber:ok') { | |||
app.getMobile(e.detail.encryptedData, e.detail.iv, res => { | |||
if (res.code == 200) { | |||
this.data.subscribeData.mobile = res.data.decodeData.phoneNumber; | |||
this.setData({ | |||
subscribeData: this.data.subscribeData | |||
}) | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
}) | |||
} | |||
}, this); | |||
} | |||
}, | |||
getUserLocation: function (e) { | |||
wx.getLocation({ | |||
type: 'wgs84', // | |||
success: (res) => { | |||
// console.log(res); | |||
this.getDistributorList(res.longitude, res.latitude); | |||
}, | |||
fail: (res) => { | |||
this.getDistributorList("", ""); | |||
}, | |||
complete: (res) => { | |||
this.setData({ | |||
siteSelect: true, | |||
}) | |||
} | |||
}) | |||
}, | |||
getDistributorList: function (longitude, latitude) {//获取经销商列表 | |||
app.wxRequest(app.globalData.urlRoot + "agent/getAgentList", { longitude: longitude, latitude: latitude }, res => { | |||
if (res.code == 200) { | |||
this.setData({ | |||
provinceArr: res.data.list, | |||
storeArr: res.data.list[res.data.nearData.provinceIndex].children, | |||
provinceValue: res.data.nearData.provinceIndex, | |||
storeValue: res.data.nearData.cityIndex | |||
}) | |||
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.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | |||
app.globalData.indexData.provinceArr = res.data.list; | |||
app.globalData.indexData.storeArr = res.data.list[res.data.nearData.provinceIndex].children; | |||
app.globalData.indexData.provinceValue = res.data.nearData.provinceIndex; | |||
app.globalData.indexData.storeValue = res.data.nearData.cityIndex; | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
}) | |||
} | |||
}, this); | |||
}, | |||
provinceChane: function (e) {//选中省 | |||
this.setData({ | |||
provinceValue: e.detail.value, | |||
storeArr: this.data.provinceArr[e.detail.value].children, | |||
storeValue: 0 | |||
}) | |||
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.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | |||
}, | |||
storeChane: function (e) {//选中店铺 | |||
this.setData({ | |||
storeValue: e.detail.value, | |||
}) | |||
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; | |||
}, | |||
agreementState:function(){//协议 | |||
this.setData({ | |||
isAgreement: !this.data.isAgreement | |||
}) | |||
}, | |||
subscribeFun: function (e) {//预约鉴赏 | |||
if (!this.data.subscribeData.realname) { | |||
wx.showToast({ | |||
title: '请输入姓名', | |||
icon: "none" | |||
}) | |||
return; | |||
} | |||
if (!this.data.subscribeData.mobile) { | |||
wx.showToast({ | |||
title: '请输入电话', | |||
icon: "none" | |||
}) | |||
return; | |||
} | |||
if (!this.data.subscribeData.captcha) { | |||
wx.showToast({ | |||
title: '请输入验证码', | |||
icon: "none" | |||
}) | |||
return; | |||
} | |||
if (!this.data.isAgreement) { | |||
wx.showToast({ | |||
title: '请同意协议', | |||
icon: "none" | |||
}) | |||
return; | |||
} | |||
if (!this.data.appointment) { | |||
return; | |||
} | |||
this.data.appointment = false; | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | |||
this.data.appointment = true; | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '预约成功' | |||
}) | |||
app.globalData.isRegister = true; | |||
app.globalData.userMobile = this.data.subscribeData.mobile; | |||
wx.redirectTo({ | |||
url: "../myCenter/myCenter" | |||
}) | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
icon: "none" | |||
}) | |||
} | |||
}, this, "POST") | |||
} | |||
}) |
@@ -0,0 +1,6 @@ | |||
{ | |||
"navigationBarTitleText": "东风启辰“星探计划”", | |||
"usingComponents": { | |||
"tabBar": "../component/tabBar/index" | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
<!--pages/receiveRegister/receiveRegister.wxml--> | |||
<view id="everyday" class="showView"> | |||
<image class="showImg" src="{{imgUrl+'/star/everyday/show.jpg'}}"></image> | |||
<view class="ruleBtn">游戏规则</view> | |||
<view class="userMsgGroup"> | |||
<input class="inputSty" placeholder="请输入您的姓名" bindinput="getRealname"></input> | |||
<view class="mobileGroup"> | |||
<input class="inputSty" placeholder="请输入电话" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11'></input> | |||
<button wx:if="{{!phoneInputShow}}" class="getPhoneBtn" style="margin: 0;padding: 0;width: 654rpx;height: 65rpx;min-height: 0;" open-type="getPhoneNumber" bindgetphonenumber="getUserPhone"></button> | |||
</view> | |||
<view class="codeGroup"> | |||
<input class="codeInput" placeholder="请输入您的验证码" bindinput="getCaptcha"></input> | |||
<view class="getCode" bindtap="getCode">{{verificationCode}}</view> | |||
</view> | |||
<view wx:if="{{siteSelect}}"> | |||
<picker mode='selector' range="{{provinceArr}}" range-key="province" value="{{provinceValue}}" bindchange="provinceChane"> | |||
<view class="codeGroup"> | |||
<text>{{provinceArr[provinceValue].province}}</text> | |||
<image src="{{imgUrl+'/images/selectIcon.png'}}" class="selectIcon"></image> | |||
</view> | |||
</picker> | |||
<picker mode='selector' range="{{storeArr}}" range-key="agent_detail" value="{{storeValue}}" bindchange="storeChane"> | |||
<view class="codeGroup"> | |||
<text>{{storeArr[storeValue].agent_detail}}</text> | |||
<image src="{{imgUrl+'/images/selectIcon.png'}}" class="selectIcon"></image> | |||
</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> | |||
<view class="loginBtn" bindtap="subscribeFun">登录/注册</view> | |||
</view> | |||
</view> | |||
<tabBar></tabBar> |
@@ -0,0 +1,102 @@ | |||
/* pages/receiveRegister/receiveRegister.wxss */ | |||
.showImg { | |||
position: relative; | |||
width: 750rpx; | |||
height: 616rpx; | |||
} | |||
.ruleBtn { | |||
right: 0; | |||
top: 180rpx; | |||
position: fixed; | |||
width: 153rpx; | |||
height: 46rpx; | |||
line-height: 46rpx; | |||
font-size: 24rpx; | |||
color: #fff; | |||
background-color: rgba(35, 24, 21, 0.63); | |||
border-top-left-radius: 20rpx; | |||
border-bottom-left-radius: 20rpx; | |||
padding-left: 20rpx; | |||
box-sizing: border-box; | |||
} | |||
.userMsgGroup{ | |||
padding-top: 76rpx; | |||
width: 654rpx; | |||
padding-bottom: 59rpx; | |||
margin: 0 auto; | |||
} | |||
.inputSty,.codeGroup{ | |||
width: 100%; | |||
height: 65rpx; | |||
line-height: 65rpx; | |||
border: 1rpx solid #b6b6b6; | |||
border-radius: 20rpx; | |||
padding: 0 30rpx; | |||
box-sizing: border-box; | |||
font-size:24rpx; | |||
font-family:NissanBrand; | |||
font-weight:400; | |||
color:rgba(35,33,34,1); | |||
margin-bottom: 15rpx; | |||
} | |||
.codeGroup{ | |||
display: flex; | |||
align-items: center; | |||
justify-content: space-between; | |||
} | |||
.codeInput{ | |||
width: 400rpx; | |||
} | |||
.getCode{ | |||
width: 130rpx; | |||
text-align: right; | |||
} | |||
.selectIcon{ | |||
width: 25rpx; | |||
height: 15rpx; | |||
} | |||
.loginBtn{ | |||
width: 652rpx; | |||
height: 70rpx; | |||
background-color: #2a558d; | |||
line-height: 70rpx; | |||
font-size:30rpx; | |||
font-family:PingFang; | |||
font-weight:400; | |||
color:rgba(255,255,255,1); | |||
text-align: center; | |||
border-radius: 20rpx; | |||
} | |||
.agreementGroup{ | |||
display: flex; | |||
align-items: center; | |||
justify-content: left; | |||
margin-bottom: 25rpx; | |||
} | |||
.agreeIcon{ | |||
width: 29rpx; | |||
height: 28rpx; | |||
} | |||
.agreementText{ | |||
font-size:24rpx; | |||
line-height: 24rpx; | |||
font-family:PingFang; | |||
font-weight:300; | |||
color:rgba(156,157,157,1); | |||
margin-left: 18rpx; | |||
} | |||
.mobileGroup{ | |||
position: relative; | |||
} | |||
.getPhoneBtn{ | |||
position: absolute; | |||
left: 0; | |||
top: 0; | |||
margin: 0; | |||
padding: 0; | |||
width: 654rpx; | |||
height: 65rpx; | |||
min-height: 0; | |||
opacity: 0; | |||
z-index: 2; | |||
} |
@@ -83,7 +83,19 @@ | |||
"name": "优惠券", | |||
"pathName": "pages/coupon/coupon", | |||
"query": "" | |||
} | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "集碎片", | |||
"pathName": "pages/everyday/everyday", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "领红包注册", | |||
"pathName": "pages/receiveRegister/receiveRegister", | |||
"query": "" | |||
} | |||
] | |||
} | |||
} |