"pages/scout/share/share", | "pages/scout/share/share", | ||||
"pages/prizes/prizes", | "pages/prizes/prizes", | ||||
"pages/poster/poster", | "pages/poster/poster", | ||||
"pages/coupon/coupon" | |||||
"pages/coupon/coupon", | |||||
"pages/receiveRegister/receiveRegister" | |||||
], | ], | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "light", | "backgroundTextStyle": "light", |
*/ | */ | ||||
data: { | data: { | ||||
imgUrl: app.globalData.urlStatic,//图片路径 | imgUrl: app.globalData.urlStatic,//图片路径 | ||||
showClose:false, | |||||
maskShow: false, | maskShow: false, | ||||
taskShow: false, | taskShow: false, | ||||
taskName:'集齐启辰星【大灯】碎片', | taskName:'集齐启辰星【大灯】碎片', | ||||
taskImgUrl:'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg1.png', | taskImgUrl:'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg1.png', | ||||
isSign:true, | isSign:true, | ||||
isShare:false, | isShare:false, | ||||
picturlList: ['picturePuzzle1', 'picturePuzzle1','picturePuzzle1'], | |||||
picturlName:[], | |||||
picturlList: ['picturePuzzle1', 'picturePuzzle1'], | |||||
picturlCurrent:0, | picturlCurrent:0, | ||||
isRegister:false,//是否已注册 | |||||
shareId:null, | |||||
}, | }, | ||||
/** | /** | ||||
* 关闭任务窗 | * 关闭任务窗 | ||||
/** | /** | ||||
* 签到 | * 签到 | ||||
*/ | */ | ||||
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"); | |||||
}, | }, | ||||
/** | /** | ||||
* 下个碎片 | * 下个碎片 | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function (options) { | 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(); | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
*/ | */ | ||||
* 用户点击右上角分享 | * 用户点击右上角分享 | ||||
*/ | */ | ||||
onShareAppMessage: function () { | 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") | |||||
} | } | ||||
}) | }) |
{ | { | ||||
"navigationBarTitleText": "东风启辰“星探计划”", | |||||
"usingComponents": { | "usingComponents": { | ||||
"tabBar": "../component/tabBar/index" | "tabBar": "../component/tabBar/index" | ||||
} | } |
<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> | ||||
<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> | ||||
<view class="swiperBox"> | <view class="swiperBox"> | ||||
<swiper current="{{picturlCurrent}}"> | <swiper current="{{picturlCurrent}}"> | ||||
<block wx:for="{{picturlList}}" wx:key="*this"> | |||||
<block wx:for="{{picturlList}}" wx:key="index"> | |||||
<swiper-item> | <swiper-item> | ||||
<view class="fragmentBox"> | <view class="fragmentBox"> | ||||
<image class="fragmentComplete" src="{{imgUrl+'/star/everyday/'+item+'.png'}}"></image> | <image class="fragmentComplete" src="{{imgUrl+'/star/everyday/'+item+'.png'}}"></image> | ||||
<image class="arrowBtn" style="left:-30rpx;" src="{{imgUrl+'/star/everyday/arrowLeftBtn.png'}}" bindtap="prevPicturl"></image> | <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" style="right:-30rpx;" src="{{imgUrl+'/star/everyday/arrowRightBtn.png'}}" bindtap="nextPicturl"></image> | ||||
</view> | </view> | ||||
<view class="btnBox"> | |||||
<!-- <view class="btnBox"> | |||||
<view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | <view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | ||||
<view class="btn select" style="margin-left:20rpx;">每日任务</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> | ||||
<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 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="title">今日任务</view> | ||||
<view class="contentBox"> | <view class="contentBox"> | ||||
<view class="name">{{taskName}}</view> | <view class="name">{{taskName}}</view> | ||||
<image class="taskImg" src="{{taskImgUrl}}"></image> | <image class="taskImg" src="{{taskImgUrl}}"></image> | ||||
<view class="btn" wx:if="{{isSign}}" bindtap="signIn">签到解锁</view> | <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> | </view> | ||||
</view> | </view> |
.ruleBtn { | .ruleBtn { | ||||
right: 0; | right: 0; | ||||
top: 180rpx; | top: 180rpx; | ||||
position: absolute; | |||||
position: fixed; | |||||
width: 153rpx; | width: 153rpx; | ||||
height: 46rpx; | height: 46rpx; | ||||
line-height: 46rpx; | line-height: 46rpx; | ||||
width: 615rpx; | width: 615rpx; | ||||
height: 49rpx; | height: 49rpx; | ||||
text-align: center; | text-align: center; | ||||
margin: 48rpx auto 0 auto; | |||||
padding-top: 22rpx; | |||||
padding-bottom: 38rpx; | |||||
margin:0 auto; | |||||
} | } | ||||
.btnBox>.btn{ | .btnBox>.btn{ | ||||
display: inline-block; | display: inline-block; | ||||
} | } | ||||
.mask { | .mask { | ||||
position: absolute; | |||||
position: fixed; | |||||
left: 0; | left: 0; | ||||
top: 0; | top: 0; | ||||
width: 100%; | width: 100%; | ||||
border-radius: 10rpx; | border-radius: 10rpx; | ||||
margin: 42rpx auto 0 auto; | margin: 42rpx auto 0 auto; | ||||
background-color: #345486; | background-color: #345486; | ||||
position: relative; | |||||
} | } | ||||
.closeBtn { | .closeBtn { | ||||
background: none; | background: none; | ||||
.closeBtn::before { | .closeBtn::before { | ||||
content: "\2716"; | 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; | |||||
} |
swiperCurrent:0,//swiper选中的元素下标 | swiperCurrent:0,//swiper选中的元素下标 | ||||
verificationCode: '获取验证码',//验证码文案 | verificationCode: '获取验证码',//验证码文案 | ||||
sendCode: true, | sendCode: true, | ||||
appointment:true, | |||||
subscribeData: { | subscribeData: { | ||||
realname:"",//姓名 | realname:"",//姓名 | ||||
mobile:"",//手机号 | mobile:"",//手机号 | ||||
startAdvertisingUrl:'',//开屏广告路径 | startAdvertisingUrl:'',//开屏广告路径 | ||||
isStartAdvertising: 1,//开屏广告透明度 | isStartAdvertising: 1,//开屏广告透明度 | ||||
isStartAdvertisingShow: true,//是否显示开屏广告 | isStartAdvertisingShow: true,//是否显示开屏广告 | ||||
isRegister:false,//查询是否已注册 | |||||
// isRegister:false,//查询是否已注册 | |||||
bannerList:[],//banner列表 | bannerList:[],//banner列表 | ||||
videoList:[],//视频列表 | videoList:[],//视频列表 | ||||
videoVideoControls:false,//是否显示视频控件 | videoVideoControls:false,//是否显示视频控件 | ||||
} | } | ||||
}, | }, | ||||
loadFun: function () { | 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) { | if (app.globalData.isFirstLogin) { | ||||
this.getHomeBanner();//获取banner | this.getHomeBanner();//获取banner | ||||
this.getHomeVideo();//获取视频 | this.getHomeVideo();//获取视频 | ||||
this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | ||||
} | } | ||||
} | } | ||||
if (!app.globalData.isRegister) { | |||||
this.getOrderInfo(); | |||||
} | |||||
// if (!app.globalData.isRegister) { | |||||
// this.getOrderInfo(); | |||||
// } | |||||
this.setData({ | this.setData({ | ||||
mainShow: true, | mainShow: true, | ||||
isStartAdvertisingShow: this.data.isOnce ? true : app.globalData.isFirstLogin, | isStartAdvertisingShow: this.data.isOnce ? true : app.globalData.isFirstLogin, | ||||
isRegister: app.globalData.isRegister | |||||
// isRegister: app.globalData.isRegister | |||||
}) | }) | ||||
}, | }, | ||||
provinceChane: function (e) {//选中省 | provinceChane: function (e) {//选中省 | ||||
} | } | ||||
this.data.sendCode = false; | this.data.sendCode = false; | ||||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | ||||
this.data.sendCode = true; | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
this.countDown(); | this.countDown(); | ||||
wx.showToast({ | wx.showToast({ | ||||
this.setData({ | this.setData({ | ||||
verificationCode:60 | verificationCode:60 | ||||
}) | }) | ||||
}else{ | |||||
} else { | |||||
this.data.sendCode = true; | |||||
wx.showToast({ | wx.showToast({ | ||||
title: res.msg, | title: res.msg, | ||||
icon: "none" | icon: "none" | ||||
}) | }) | ||||
return; | return; | ||||
} | } | ||||
if (!this.data.sendCode) { | |||||
if (!this.data.appointment) { | |||||
return; | return; | ||||
} | } | ||||
this.data.sendCode = false; | |||||
this.data.appointment = false; | |||||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | ||||
this.data.sendCode = true; | |||||
this.data.appointment = true; | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: '预约成功' | title: '预约成功' | ||||
}) | }) | ||||
this.data.subscribeData.realname = ""; | |||||
this.data.subscribeData.captcha = ""; | |||||
this.setData({ | 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; | app.globalData.userMobile = this.data.subscribeData.mobile; | ||||
// wx.redirectTo({ | // wx.redirectTo({ | ||||
// url: "../myCenter/myCenter?sourcePage='home'" | // url: "../myCenter/myCenter?sourcePage='home'" | ||||
app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | ||||
if (res.code == 200) { | if (res.code == 200) { | ||||
if (res.data) { | 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; | app.globalData.userMobile = res.data.mobile; | ||||
}else{ | }else{ | ||||
if (app.globalData.userMobile) { | if (app.globalData.userMobile) { |
<image class="indexBottom" src="{{imgUrl+'/images/indexBottom.png'}}"></image> | <image class="indexBottom" src="{{imgUrl+'/images/indexBottom.png'}}"></image> | ||||
</view> | </view> | ||||
<image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | <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"> | <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> | <input class="inputSty" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="电话"></input> | ||||
<view class="getPhoneFrame" wx:if="{{!phoneInputShow}}"> | <view class="getPhoneFrame" wx:if="{{!phoneInputShow}}"> | ||||
<button class="getPhoneBtn" open-type="getPhoneNumber" bindgetphonenumber="getUserPhone"></button> | <button class="getPhoneBtn" open-type="getPhoneNumber" bindgetphonenumber="getUserPhone"></button> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="codeGroup"> | <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 class="codeTime" bindtap="getCode">{{verificationCode}}</view> | ||||
</view> | </view> | ||||
<view wx:if="{{siteSelect}}"> | <view wx:if="{{siteSelect}}"> |
storeValue: 0,//选中的店铺下标 | storeValue: 0,//选中的店铺下标 | ||||
verificationCode: '获取验证码',//验证码文案 | verificationCode: '获取验证码',//验证码文案 | ||||
sendCode: true, | sendCode: true, | ||||
appointment: true, | |||||
subscribeData: { | subscribeData: { | ||||
realname: "",//姓名 | realname: "",//姓名 | ||||
mobile: "",//手机号 | mobile: "",//手机号 | ||||
}, | }, | ||||
descFrameShow:false,//是否显示奖品详情 | descFrameShow:false,//是否显示奖品详情 | ||||
ruleShow: false,//是否显示星探等级规则 | ruleShow: false,//是否显示星探等级规则 | ||||
isRegister: false,//查询是否已注册 | |||||
// isRegister: false,//查询是否已注册 | |||||
parames:{ | parames:{ | ||||
page:1, | page:1, | ||||
count:20 | count:20 | ||||
}, | }, | ||||
loadFun: function () { | loadFun: function () { | ||||
this.getUserInfo(); | 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) { | if (app.globalData.myCenterData) { | ||||
this.setData({ | this.setData({ | ||||
provinceArr: app.globalData.myCenterData.provinceArr, | provinceArr: app.globalData.myCenterData.provinceArr, | ||||
storeArr: app.globalData.myCenterData.storeArr, | storeArr: app.globalData.myCenterData.storeArr, | ||||
provinceValue: app.globalData.myCenterData.provinceValue, | provinceValue: app.globalData.myCenterData.provinceValue, | ||||
storeValue: app.globalData.myCenterData.storeValue, | 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.province = this.data.provinceArr[this.data.provinceValue].province; | ||||
this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail; | this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail; | ||||
this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code; | ||||
} | } | ||||
if (!app.globalData.isRegister) { | |||||
this.getOrderInfo(); | |||||
} | |||||
// if (!app.globalData.isRegister) { | |||||
// this.getOrderInfo(); | |||||
// } | |||||
if (app.globalData.userInfoData) { | if (app.globalData.userInfoData) { | ||||
this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | ||||
this.data.userData.nickName = app.globalData.userInfoData.nickName; | this.data.userData.nickName = app.globalData.userInfoData.nickName; | ||||
} | } | ||||
this.data.sendCode = false; | this.data.sendCode = false; | ||||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => { | ||||
this.data.sendCode = true; | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
this.countDown(); | this.countDown(); | ||||
wx.showToast({ | wx.showToast({ | ||||
verificationCode: 60 | verificationCode: 60 | ||||
}) | }) | ||||
} else { | } else { | ||||
this.data.sendCode = true; | |||||
wx.showToast({ | wx.showToast({ | ||||
title: res.msg, | title: res.msg, | ||||
icon: "none" | icon: "none" | ||||
}) | }) | ||||
return; | return; | ||||
} | } | ||||
if (!this.data.sendCode) { | |||||
if (!this.data.appointment) { | |||||
return; | return; | ||||
} | } | ||||
this.data.sendCode = false; | |||||
this.data.appointment = false; | |||||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | ||||
this.data.sendCode = true; | |||||
this.data.appointment = true; | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: '预约成功' | title: '预约成功' | ||||
}) | }) | ||||
this.data.subscribeData.realname = ""; | |||||
this.data.subscribeData.captcha = ""; | |||||
this.setData({ | 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; | app.globalData.userMobile = this.data.subscribeData.mobile; | ||||
} else { | } else { | ||||
wx.showToast({ | wx.showToast({ |
</view> | </view> | ||||
</scroll-view> | </scroll-view> | ||||
</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"> | <view class="inputGroup"> | ||||
<input class="inputCode" bindinput="getRealname" placeholder="请输入您的姓名"></input> | |||||
<input class="inputCode" bindinput="getRealname" value="{{subscribeData.realname}}" placeholder="请输入您的姓名"></input> | |||||
</view> | </view> | ||||
<view class="inputGroup"> | <view class="inputGroup"> | ||||
<input class="inputCode" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="请输入您的联系电话"></input> | <input class="inputCode" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="请输入您的联系电话"></input> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="inputGroup"> | <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 class="codeTime" bindtap="getCode">{{verificationCode}}</view> | ||||
</view> | </view> | ||||
<view wx:if="{{siteSelect}}"> | <view wx:if="{{siteSelect}}"> | ||||
</view> | </view> | ||||
<view class="subscribeBtn" bindtap="subscribeFun">预约鉴赏</view> | <view class="subscribeBtn" bindtap="subscribeFun">预约鉴赏</view> | ||||
</view> | </view> | ||||
<view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||||
<!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||||
<view>已预约</view> | <view>已预约</view> | ||||
</view> | |||||
</view> --> | |||||
<service></service> | <service></service> | ||||
<view class="prizeDesc" catchtouchmove="ture" wx:if="{{descFrameShow}}"> | <view class="prizeDesc" catchtouchmove="ture" wx:if="{{descFrameShow}}"> | ||||
<view class="prizeImgGroup" wx:if="{{recordList[lookDescId].awardId!=1}}"> | <view class="prizeImgGroup" wx:if="{{recordList[lookDescId].awardId!=1}}"> |
onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
return { | return { | ||||
title: '您有一份启辰星专属礼品待领取', | 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 | path: "/pages/coupon/coupon?friendOpenid=" + app.globalData.openid | ||||
} | } | ||||
}, | }, |
// 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") | |||||
} | |||||
}) |
{ | |||||
"navigationBarTitleText": "东风启辰“星探计划”", | |||||
"usingComponents": { | |||||
"tabBar": "../component/tabBar/index" | |||||
} | |||||
} |
<!--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> |
/* 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; | |||||
} |
"name": "优惠券", | "name": "优惠券", | ||||
"pathName": "pages/coupon/coupon", | "pathName": "pages/coupon/coupon", | ||||
"query": "" | "query": "" | ||||
} | |||||
}, | |||||
{ | |||||
"id": -1, | |||||
"name": "集碎片", | |||||
"pathName": "pages/everyday/everyday", | |||||
"query": "" | |||||
}, | |||||
{ | |||||
"id": -1, | |||||
"name": "领红包注册", | |||||
"pathName": "pages/receiveRegister/receiveRegister", | |||||
"query": "" | |||||
} | |||||
] | ] | ||||
} | } | ||||
} | } |