@@ -8,7 +8,6 @@ App({ | |||
this.wxLogin(); | |||
} else { | |||
this.globalData.openid = openid; | |||
// this.getRegionList(); | |||
} | |||
}, | |||
wxLogin() { | |||
@@ -28,9 +27,13 @@ App({ | |||
urlStatic:"https://www.jiyou-tech.com/2020/496_qichen/static",//静态资源根目录 | |||
openid: "",//OPENID | |||
session_key: "",//session_key | |||
userInfo: null,//用户信息 | |||
openidSuccessFuc: null,//方法回调 | |||
nowPage:'1',//当前tabBar | |||
isRegister:false,//是否已注册 | |||
userMobile:null,//用户手机号 | |||
isFirstLogin:true,//是否为第一次登录 | |||
indexData:{},//首页数据 | |||
myCenterData:null//个人中心数据 | |||
}, | |||
// 获取openId | |||
getOpenid: function (code) { | |||
@@ -46,7 +49,6 @@ App({ | |||
wx.setStorageSync("session_key", res.data.session_key); | |||
this.globalData.openid = res.data.openid; | |||
this.globalData.session_key = res.data.session_key; | |||
// this.getRegionList(); | |||
if (this.globalData.openidSuccessFuc) { | |||
this.globalData.openidSuccessFuc(); | |||
} | |||
@@ -162,15 +164,5 @@ App({ | |||
// } | |||
console.log(res.msg); | |||
}, this, "POST"); | |||
}, | |||
getRegionList: function () {//获取可选区域列表 | |||
this.wxRequest(this.globalData.urlRoot + "/user/getAreaList", {}, res => { | |||
if (res.code == 200) { | |||
this.globalData.cityAllData = res.data; | |||
console.log(this.globalData.cityAllData); | |||
} else { | |||
console.log(res.msg) | |||
} | |||
}, this); | |||
} | |||
}) |
@@ -7,10 +7,11 @@ | |||
width:750rpx; | |||
height:150rpx; | |||
box-sizing: border-box; | |||
border-top: 1rpx solid #B8B6B9; | |||
border-top: 4rpx solid #B8B6B9; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
z-index: 99; | |||
} | |||
.tabBarOption{ | |||
display: flex; |
@@ -10,20 +10,53 @@ Page({ | |||
provinceValue: 0,//选中的省下标 | |||
storeArr:[],//店铺 | |||
storeValue:0,//选中的店铺下标 | |||
swiperCurrent:1,//swiper选中的元素下标 | |||
swiperCurrent:0,//swiper选中的元素下标 | |||
verificationCode: '获取验证码',//验证码文案 | |||
sendCode: true, | |||
subscribeData:{ | |||
subscribeData: { | |||
realname:"",//姓名 | |||
mobile:"",//手机号 | |||
captcha:"",//验证码 | |||
province:"",//省份 | |||
agent_code: "",//经销商编码 | |||
agentDetail: "",//经销商详细信息 | |||
parentOpenid: "",//好友openid | |||
} | |||
}, | |||
startAdvertisingUrl:'',//开屏广告路径 | |||
isStartAdvertising: 1,//开屏广告透明度 | |||
isStartAdvertisingShow: true,//是否显示开屏广告 | |||
isRegister:false,//查询是否已注册 | |||
bannerList:[],//banner列表 | |||
videoList:[],//视频列表 | |||
videoVideoControls:false,//是否显示视频控件 | |||
mainShow:false, | |||
}, | |||
onLoad: function () { | |||
this.getUserLocation();//获取用户当前位置 | |||
if (app.globalData.isFirstLogin) { | |||
this.getStartAdvertising(); | |||
} | |||
}, | |||
loadFun: function () { | |||
if (app.globalData.isFirstLogin) { | |||
this.getHomeBanner();//获取banner | |||
this.getHomeVideo();//获取视频 | |||
this.getOrderInfo(); | |||
} else { | |||
this.setData({ | |||
mainShow:true, | |||
isStartAdvertisingShow:false, | |||
bannerList: app.globalData.indexData.bannerList, | |||
videoList: app.globalData.indexData.videoList, | |||
provinceArr: app.globalData.indexData.provinceArr, | |||
storeArr: app.globalData.indexData.storeArr, | |||
provinceValue: app.globalData.indexData.provinceValue, | |||
storeValue: app.globalData.indexData.storeValue, | |||
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; | |||
} | |||
}, | |||
provinceChane: function (e) {//选中省 | |||
this.setData({ | |||
@@ -33,17 +66,20 @@ Page({ | |||
}) | |||
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; | |||
}, | |||
getUserPhone:function(e){//获取用户手机号 | |||
this.setData({ | |||
phoneInputShow: true | |||
}) | |||
this.getUserLocation();//获取用户当前位置 | |||
if (e.detail.errMsg=='getPhoneNumber:ok'){ | |||
this.setData({ | |||
siteSelect: true, | |||
@@ -87,7 +123,7 @@ Page({ | |||
} | |||
}, | |||
nextImg() {//下一张图片 | |||
if (this.data.swiperCurrent < 3) { | |||
if (this.data.swiperCurrent < this.data.bannerList.length-1) { | |||
this.setData({ | |||
swiperCurrent: this.data.swiperCurrent+=1, | |||
}) | |||
@@ -111,6 +147,11 @@ Page({ | |||
}) | |||
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, | |||
@@ -137,7 +178,7 @@ Page({ | |||
if (!this.data.sendCode){ | |||
return; | |||
} | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile:'18831849567'},res=>{ | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile:this.data.subscribeData.mobile},res=>{ | |||
console.log(res); | |||
if (res.code == 200) { | |||
this.countDown(); | |||
@@ -182,11 +223,40 @@ Page({ | |||
this.data.subscribeData.captcha = e.detail.value; | |||
}, | |||
subscribeFun: function (e) {//预约鉴赏 | |||
console.log(this.data.subscribeData); | |||
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; | |||
} | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | |||
console.log(res); | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '预约成功' | |||
}) | |||
this.setData({ | |||
isRegister:true | |||
}) | |||
app.globalData.isRegister = true; | |||
app.globalData.userMobile = this.data.subscribeData.mobile; | |||
// wx.redirectTo({ | |||
// url: "../myCenter/myCenter?sourcePage='home'" | |||
// }) | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
@@ -195,4 +265,73 @@ Page({ | |||
} | |||
}, this, "POST") | |||
}, | |||
getStartAdvertising: function () {//获取开屏广告 | |||
app.wxRequest(app.globalData.urlRoot +"home/getStartAdvertising",{},res=>{ | |||
if(res.code==200){ | |||
if (app.globalData.openid) { | |||
this.loadFun(); | |||
} else { | |||
app.globalData.openidSuccessFuc = this.loadFun; | |||
} | |||
this.setData({ | |||
startAdvertisingUrl: res.data.picurl, | |||
mainShow:true | |||
}) | |||
app.globalData.isFirstLogin = false; | |||
setTimeout(() => { | |||
this.setData({ | |||
isStartAdvertising: 0 | |||
}) | |||
setTimeout(()=>{ | |||
this.setData({ | |||
isStartAdvertisingShow:false | |||
}) | |||
},1000); | |||
}, 3000); | |||
} | |||
},this); | |||
}, | |||
getHomeBanner: function () {//获取banner | |||
app.wxRequest(app.globalData.urlRoot + "home/getHomeBanner", {}, res => { | |||
if (res.code == 200) { | |||
this.setData({ | |||
bannerList:res.data | |||
}) | |||
app.globalData.indexData.bannerList = res.data; | |||
} | |||
}, this); | |||
}, | |||
getHomeVideo: function () {//获取视频 | |||
app.wxRequest(app.globalData.urlRoot + "home/getHomeVideo", {}, res => { | |||
if (res.code == 200) { | |||
this.setData({ | |||
videoList:res.data[0] | |||
}) | |||
app.globalData.indexData.videoList = res.data[0]; | |||
} | |||
}, this); | |||
}, | |||
hideVideoControls: function () {//显示视频控件 | |||
wx.createVideoContext("video").play(); | |||
this.setData({ | |||
videoVideoControls:true | |||
}) | |||
}, | |||
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); | |||
} | |||
}) |
@@ -1,4 +1,5 @@ | |||
{ | |||
"navigationBarTitleText": "启辰星", | |||
"usingComponents": { | |||
"service": "../component/service/index", | |||
"tabBar": "../component/tabBar/index" |
@@ -1,22 +1,29 @@ | |||
<!--index.wxml--> | |||
<view class="all"> | |||
<view class="main container"> | |||
<view class="all" wx:if="{{mainShow}}"> | |||
<view class="main"> | |||
<view class="contentFrame"> | |||
<video class="videoSty" src="https://www.jiyou-tech.com/2020/496_qichen/static/video1212.mp4"></video> | |||
<view class="videoSty"> | |||
<video id="video" poster="{{videoList.posterUrl}}" src="{{videoList.videoUrl}}"></video> | |||
<image wx:if="{{!videoVideoControls}}" class="videoPoster" src="{{videoList.posterUrl}}"></image> | |||
<image wx:if="{{!videoVideoControls}}" bindtap="hideVideoControls" class="videoPlay" src="{{imgUrl+'/images/videoPlay.png'}}"></image> | |||
</view> | |||
<view class="swiperFrame"> | |||
<swiper class="swiperSty" current="{{swiperCurrent}}" bindchange="swiperChange"> | |||
<swiper-item><image src="{{imgUrl+'/images/indexBottom.png'}}" style="width:100%;" mode="aspectFill"></image></swiper-item> | |||
<swiper-item><image src="{{imgUrl+'/images/indexBottom.png'}}" style="width:100%;" mode="aspectFill"></image></swiper-item> | |||
<swiper-item><image src="{{imgUrl+'/images/indexBottom.png'}}" style="width:100%;" mode="aspectFill"></image></swiper-item> | |||
<swiper-item><image src="{{imgUrl+'/images/indexBottom.png'}}" style="width:100%;" mode="aspectFill"></image></swiper-item> | |||
<swiper class="swiperSty" autoplay current="{{swiperCurrent}}" bindchange="swiperChange"> | |||
<swiper-item wx:for="{{bannerList}}" wx:key="index"><image src="{{item.bannerUrl}}" style="width:100%;" mode="aspectFill"></image></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> | |||
</view> | |||
<view class="bannerBarFrame"> | |||
<view class="bannerBarGroup"> | |||
<view class="bannerBar1 {{index==swiperCurrent?'bannerBar2':''}}" wx:for="{{bannerList}}" wx:key="index"></view> | |||
</view> | |||
<view class="bannerName">{{bannerList[swiperCurrent].bannerName}}</view> | |||
</view> | |||
<image class="indexBottom" src="{{imgUrl+'/images/indexBottom.png'}}"></image> | |||
</view> | |||
<!-- <image src="{{imgUrl+'/images/indexBg.jpg'}}" class='imgBg'></image> --> | |||
<view class="msgFrame"> | |||
<image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | |||
<view class="msgFrame" wx:if="{{!isRegister}}"> | |||
<view class="inputGroup"> | |||
<input class="inputSty" placeholder="姓名" bindinput="getRealname"></input> | |||
<input class="inputSty" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="电话"></input> |
@@ -2,9 +2,12 @@ | |||
image{ | |||
display: block; | |||
} | |||
page{ | |||
overflow: hidden; | |||
height: 100% | |||
view{ | |||
-webkit-overflow-scrolling: touch; | |||
} | |||
.main{ | |||
height: calc(100vh - 150rpx); | |||
overflow: auto; | |||
} | |||
.imgBg{ | |||
position: fixed; | |||
@@ -12,9 +15,11 @@ page{ | |||
left: 0; | |||
width: 750rpx; | |||
height: 1356rpx; | |||
transition: opacity 1000ms; | |||
z-index: 9; | |||
} | |||
.msgFrame{ | |||
position: absolute; | |||
position: fixed; | |||
bottom: 150rpx; | |||
left: 0; | |||
width:750rpx; | |||
@@ -87,16 +92,27 @@ page{ | |||
margin-top: 18rpx; | |||
border-radius: 10rpx; | |||
} | |||
/* .contentFrame{ | |||
} */ | |||
.indexBottom{ | |||
width: 750rpx; | |||
height: 353rpx; | |||
} | |||
.videoSty{ | |||
position: relative; | |||
width:750rpx; | |||
height:530rpx; | |||
margin-bottom: 18rpx; | |||
} | |||
#video{ | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.videoPlay{ | |||
width: 139rpx; | |||
height: 138rpx; | |||
position: absolute; | |||
top:50%; | |||
left: 50%; | |||
transform: translate(-50%,-50%); | |||
} | |||
.swiperFrame{ | |||
position: relative; | |||
@@ -140,4 +156,41 @@ page{ | |||
.inputCode{ | |||
height: 100%; | |||
width: 500rpx; | |||
} | |||
.bannerBarGroup{ | |||
margin-top: 23rpx; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
} | |||
.bannerBar1{ | |||
height: 5rpx; | |||
background-color: #ABABAD; | |||
width: 50rpx; | |||
transition: width 0.3s; | |||
margin-left: 5rpx; | |||
} | |||
.bannerBar1:first-child{ | |||
margin-left: 0; | |||
} | |||
.bannerBar2{ | |||
width: 80rpx; | |||
background-color: #212B53; | |||
} | |||
.bannerName{ | |||
font-size:28rpx; | |||
font-family:PingFang; | |||
font-weight:bold; | |||
color:rgba(25,47,91,1); | |||
text-align: center; | |||
line-height: 28rpx; | |||
margin-top: 21rpx; | |||
margin-bottom: 40rpx; | |||
} | |||
.videoPoster{ | |||
position: absolute; | |||
left: 0; | |||
top:0; | |||
width: 100%; | |||
height: 100%; | |||
} |
@@ -6,10 +6,10 @@ Page({ | |||
logs: [] | |||
}, | |||
onLoad: function () { | |||
this.setData({ | |||
logs: (wx.getStorageSync('logs') || []).map(log => { | |||
return util.formatTime(new Date(log)) | |||
}) | |||
}) | |||
// this.setData({ | |||
// logs: (wx.getStorageSync('logs') || []).map(log => { | |||
// return util.formatTime(new Date(log)) | |||
// }) | |||
// }) | |||
} | |||
}) |
@@ -11,15 +11,8 @@ Page({ | |||
selectNow:0,//现在的选项 | |||
taskNow:1,//现在的任务类型 | |||
recordNow: 1,//现在的记录类型 | |||
taskList: [//任务列表 | |||
{ name: "双子星LED大灯", bar: 1 }, | |||
{ name: "双子星LED大灯双子星LED大灯", bar: 2 }, | |||
{ name: "双子星LED大灯", bar: 3 }, | |||
{ name: "双子星LED大灯", bar: 4 }, | |||
{ name: "双子星LED大灯", bar: 4 }, | |||
{ name: "双子星LED大灯", bar: 4 }, | |||
{ name: "双子星LED大灯", bar: 4 }, | |||
], | |||
taskList: [],//任务列表 | |||
shareFriendList:[],//星探小分队列表 | |||
provinceArr: [],//省 | |||
provinceValue: 0,//选中的省下标 | |||
storeArr: [],//店铺 | |||
@@ -31,23 +24,72 @@ Page({ | |||
mobile: "",//手机号 | |||
captcha: "",//验证码 | |||
province: "",//省份 | |||
agent_code: "",//经销商编码 | |||
agentDetail: "",//经销商详细信息 | |||
parentOpenid: "",//好友openid | |||
} | |||
}, | |||
userData:{ | |||
avatarUrl: null, | |||
nickName: null, | |||
userLevel: 0 | |||
}, | |||
descFrameShow:false,//是否显示奖品详情 | |||
ruleShow: false,//是否显示星探等级规则 | |||
isRegister: false,//查询是否已注册 | |||
parames:{ | |||
page:1, | |||
count:20 | |||
}, | |||
noData:false, | |||
optionsData:null | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
if (options.sourcePage){ | |||
this.data.optionsData = options.sourcePage; | |||
} | |||
if (app.globalData.openid) { | |||
this.loadFun(); | |||
} else { | |||
app.globalData.openidSuccessFuc = this.loadFun; | |||
} | |||
}, | |||
loadFun: function () { | |||
this.getUserInfo(); | |||
this.getTaskProgress(); | |||
this.getShareList(); | |||
if (app.globalData.myCenterData) { | |||
this.setData({ | |||
provinceArr: app.globalData.indexData.provinceArr, | |||
storeArr: app.globalData.indexData.storeArr, | |||
provinceValue: app.globalData.indexData.provinceValue, | |||
storeValue: app.globalData.indexData.storeValue, | |||
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; | |||
}else{ | |||
app.globalData.myCenterData = {}; | |||
this.getUserLocation(); | |||
this.getOrderInfo(); | |||
} | |||
if (this.data.optionsData){ | |||
if (this.data.optionsData == "home") { | |||
this.setData({ | |||
selectNow: 2 | |||
}) | |||
} | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
this.getUserLocation(); | |||
}, | |||
/** | |||
@@ -95,8 +137,15 @@ Page({ | |||
this.setData({ | |||
selectNow: e.currentTarget.dataset.value | |||
}) | |||
if (e.currentTarget.dataset.value==3){ | |||
this.data.parames.page=0; | |||
this.data.getShareList = []; | |||
} | |||
}, | |||
selectTask: function (e) { | |||
if (e.currentTarget.dataset.type==2){ | |||
return; | |||
} | |||
this.setData({ | |||
taskNow: e.currentTarget.dataset.type | |||
}) | |||
@@ -128,6 +177,11 @@ Page({ | |||
}) | |||
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.myCenterData.provinceArr = res.data.list; | |||
app.globalData.myCenterData.storeArr = res.data.list[res.data.nearData.provinceIndex].children; | |||
app.globalData.myCenterData.provinceValue = res.data.nearData.provinceIndex; | |||
app.globalData.myCenterData.storeValue = res.data.nearData.cityIndex; | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
@@ -144,14 +198,33 @@ Page({ | |||
}) | |||
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; | |||
}, | |||
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; | |||
} | |||
app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: '18831849567' }, res => { | |||
console.log(res); | |||
if (res.code == 200) { | |||
@@ -197,11 +270,37 @@ Page({ | |||
this.data.subscribeData.captcha = e.detail.value; | |||
}, | |||
subscribeFun: function (e) {//预约鉴赏 | |||
console.log(this.data.subscribeData); | |||
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; | |||
} | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => { | |||
console.log(res); | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '预约成功' | |||
}) | |||
this.setData({ | |||
isRegister: true | |||
}) | |||
app.globalData.isRegister = true; | |||
app.globalData.userMobile = this.data.subscribeData.mobile; | |||
} else { | |||
wx.showToast({ | |||
title: res.msg, | |||
@@ -210,7 +309,91 @@ Page({ | |||
} | |||
}, this, "POST") | |||
}, | |||
getUserWxMsg:function(e){//获取用户信息 | |||
console.log(e); | |||
getUserWxMsg:function(e){//通过微信获取用户信息 | |||
if (e.detail.errMsg == "getUserInfo:ok") { | |||
this.data.userData.avatarUrl = e.detail.userInfo.avatarUrl; | |||
this.data.userData.nickName = e.detail.userInfo.nickName; | |||
this.data.userData.userLevel = 0; | |||
this.setData({ | |||
userData: this.data.userData, | |||
isLogin: true | |||
}) | |||
app.wxRequest(app.globalData.urlRoot + "userInfo/updateUserInfo", { avatarUrl: e.detail.userInfo.avatarUrl, nickName: e.detail.userInfo.nickName},res=>{},this,"POST") | |||
} | |||
}, | |||
getUserInfo:function(e){//获取个人信息 | |||
app.wxRequest(app.globalData.urlRoot + 'userInfo/getUserInfo', {}, res => { | |||
if(res.code==200){ | |||
// res.data.userLevel = 3; | |||
if(res.data.avatarUrl){ | |||
this.data.userData.avatarUrl = res.data.avatarUrl; | |||
this.data.userData.nickName = res.data.nickName; | |||
this.data.userData.userLevel = res.data.userLevel; | |||
this.setData({ | |||
userData:this.data.userData, | |||
isLogin:true | |||
}) | |||
} | |||
} | |||
},this) | |||
}, | |||
getTaskProgress: function () {//获取任务完成度 1每日任务 | |||
app.wxRequest(app.globalData.urlRoot + "task/getTaskProgress", { taskType: this.data.taskNow},res=>{ | |||
if(res.code==200){ | |||
this.setData({ | |||
taskList:res.data | |||
}) | |||
} | |||
},this) | |||
}, | |||
lookDesc:function(e){//查看奖品详情 | |||
this.setData({ | |||
descFrameShow: e.currentTarget.dataset.value | |||
}) | |||
}, | |||
lookRule: function (e) {//查看奖品详情 | |||
this.setData({ | |||
ruleShow: e.currentTarget.dataset.value | |||
}) | |||
}, | |||
getShareList: function () {//星探小分队 | |||
app.wxRequest(app.globalData.urlRoot + "share/getFriendRegisterList", this.data.parames,res=>{ | |||
console.log(res); | |||
if(res.code==200){ | |||
for(let i=0;i<res.data.length;i++){ | |||
this.data.shareFriendList.push(res.data[i]); | |||
} | |||
this.setData({ | |||
shareFriendList: this.data.shareFriendList | |||
}) | |||
if (res.data.length<this.data.parames.count){ | |||
this.setData({ | |||
noData: true | |||
}) | |||
} | |||
console.log(this.data.shareFriendList); | |||
} | |||
},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); | |||
}, | |||
scrolltolower:function(){//星探小分队滚动条触底时执行 | |||
if(!this.data.noData){ | |||
this.data.parames.page+=1; | |||
this.getShareList(); | |||
} | |||
} | |||
}) |
@@ -1,4 +1,5 @@ | |||
{ | |||
"navigationBarTitleText": "个人中心", | |||
"usingComponents": { | |||
"service": "../component/service/index", | |||
"tabBar": "../component/tabBar/index" |
@@ -1,6 +1,6 @@ | |||
<!--pages/myCenter/myCenter.wxml--> | |||
<view> | |||
<view class="main container"> | |||
<view class="main"> | |||
<view class="msgGroup" wx:if="{{!isLogin}}"> | |||
<view class="pageTitle">个人中心</view> | |||
<view class="headGroup"> | |||
@@ -12,22 +12,22 @@ | |||
<image class="userMsgBg" src="{{imgUrl+'/images/userMsgBg.png'}}"></image> | |||
<view class="pageTitle">个人中心</view> | |||
<view class="headGroup" style="margin-bottom:11rpx;"> | |||
<image class="defaultHead" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | |||
<image class="defaultHead" src="{{userData.avatarUrl}}"></image> | |||
</view> | |||
<view class="userNameGroup"> | |||
<view class="userName">啦啦啦</view> | |||
<image class="userNameEdit" src="{{imgUrl+'/images/userNameEdit.png'}}"></image> | |||
<view class="userName">{{userData.nickName}}</view> | |||
<!-- <image class="userNameEdit" src="{{imgUrl+'/images/userNameEdit.png'}}"></image> --> | |||
</view> | |||
<!-- <view class="userLevel"> | |||
<image class="userLevelIcon" src="{{imgUrl+'/images/userLevelIcon.png'}}"></image> | |||
<view class="userLevel" wx:if="{{userData.userLevel}}"> | |||
<image class="userLevelIcon" src="{{imgUrl+'/images/userLevelIcon'+userData.userLevel+'.png'}}"></image> | |||
<view class="userLevelTip">您的级别为</view> | |||
<image class="userLevelText" src="{{imgUrl+'/images/userLevelText.png'}}"></image> | |||
<image class="userLevelText" src="{{imgUrl+'/images/userLevelText'+userData.userLevel+'.png'}}"></image> | |||
<view class="lookRule">星探规则</view> | |||
</view> --> | |||
<view class="userLevel"> | |||
</view> | |||
<view class="userLevel" wx:if="{{!userData.userLevel}}"> | |||
<image class="userWaitIcon" src="{{imgUrl+'/images/userWaitIcon.png'}}"></image> | |||
<view class="userWaitText">您的星探待激活</view> | |||
<view class="lookRule">星探规则</view> | |||
<view class="lookRule" bindtap="lookRule" data-value="{{true}}">星探规则</view> | |||
</view> | |||
</view> | |||
<view class="funList"> | |||
@@ -69,10 +69,10 @@ | |||
</view> | |||
<view class="taskDetailFrame"> | |||
<view class="taskDetailGroup" wx:for="{{taskList}}" wx:key="id"> | |||
<view class="taskName">{{item.name}}</view> | |||
<view class="taskName">{{item.taskName}}</view> | |||
<view style="margin-top:12rpx;"> | |||
<view class="taskLineFrame"> | |||
<view class="taskLine" style="width:{{(item.bar*25)+'%'}}"></view> | |||
<view class="taskLine" style="width:{{(item.childIdArr.length*25)+'%'}}"></view> | |||
</view> | |||
<view class="taskSignGroup"> | |||
<image class="taskSignIcon" src="{{imgUrl+'/images/taskSignIcon.png'}}"></image> | |||
@@ -81,8 +81,8 @@ | |||
<image class="taskSignIcon" src="{{imgUrl+'/images/taskSignIcon.png'}}"></image> | |||
</view> | |||
</view> | |||
<view wx:if="{{item.bar==4}}" class="taskSuccessBtn">已完成</view> | |||
<view wx:if="{{item.bar!=4}}" class="taskWaitBtn">未完成</view> | |||
<view wx:if="{{item.childIdArr.length==4}}" class="taskSuccessBtn">已完成</view> | |||
<view wx:if="{{item.childIdArr.length!=4}}" class="taskWaitBtn">未完成</view> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -93,7 +93,7 @@ | |||
<view bindtap="selectRecord" data-type='3' class="taskText recordText {{recordNow==3?'taskText2':''}}">幸运星抓手奖品</view> | |||
</view> | |||
<view class="recordFrame"> | |||
<view class="recordGroup" wx:for="{{5}}"> | |||
<view class="recordGroup"> | |||
<view class="recordGroupLeft"> | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | |||
@@ -104,45 +104,37 @@ | |||
</view> | |||
</view> | |||
<view class="recordPic"> | |||
<image class="recordTip" src="{{imgUrl+'/images/recordTip.png'}}"></image> | |||
<image class="rewardIcon" src="{{imgUrl+'/images/jiangpin.png'}}"></image> | |||
<image class="recordTip" bindtap="lookDesc" data-value="{{true}}" src="{{imgUrl+'/images/recordTip.png'}}"></image> | |||
<image wx:if="{{false}}" class="rewardIcon" src="{{imgUrl+'/images/jiangpin.png'}}"></image> | |||
<view class="rewardCash"> | |||
<view class="cashGroup"> | |||
<view class="cashNum">500</view> | |||
<view class="cashCompany">元</view> | |||
</view> | |||
<view class="rewardCashText">购车红包</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="ranksGroup" wx:if="{{selectNow==3}}"> | |||
<view class="detachmentGroup"> | |||
<view class="detachmentGroupLeft"> | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | |||
</view> | |||
<view class="ranksName">忘却东风</view> | |||
</view> | |||
<view class="ranksName">2020.03.01</view> | |||
<view class="ranksState ranksType1">推荐已购车</view> | |||
</view> | |||
<view class="detachmentGroup"> | |||
<view class="detachmentGroupLeft"> | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | |||
</view> | |||
<view class="ranksName">忘却东风</view> | |||
</view> | |||
<view class="ranksName">2020.03.01</view> | |||
<view class="ranksState ranksType2">推荐已购车</view> | |||
</view> | |||
<view class="detachmentGroup"> | |||
<view class="detachmentGroupLeft"> | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | |||
<scroll-view class="ranksList" scroll-y bindscrolltolower="scrolltolower"> | |||
<view class="detachmentGroup" wx:for="{{shareFriendList}}" wx:key="index"> | |||
<view class="detachmentGroupLeft"> | |||
<view class="recordHeadGroup"> | |||
<image class="recordUserImg" src="{{item.avatarUrl || imgUrl+'/images/defaultHead.png'}}"></image> | |||
</view> | |||
<view class="ranksName">{{item.nickName}}</view> | |||
</view> | |||
<view class="ranksName">忘却东风</view> | |||
<view class="ranksName">{{item.cdate}}</view> | |||
<view class="ranksState ranksType1" wx:if="{{item.friendState==2}}">推荐已购车</view> | |||
<view class="ranksState ranksType2" wx:if="{{item.friendState==1}}">推荐留资有效</view> | |||
<view class="ranksState ranksType3" wx:if="{{item.friendState==-1}}">推荐留资无效</view> | |||
<view class="detachmentTip" wx:if="{{item.invalidDetail}}">{{item.invalidDetail}} * </view> | |||
</view> | |||
<view class="ranksName">2020.03.01</view> | |||
<view class="ranksState ranksType3">推荐已购车</view> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4}}"> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4 && !isRegister}}"> | |||
<view class="inputGroup"> | |||
<input class="inputCode" bindinput="getCaptcha" placeholder="请输入您的姓名"></input> | |||
</view> | |||
@@ -167,7 +159,34 @@ | |||
</picker> | |||
<view class="subscribeBtn" bindtap="subscribeFun">预约鉴赏</view> | |||
</view> | |||
<view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||
<view>已预约</view> | |||
</view> | |||
<service></service> | |||
<view class="prizeDesc" catchtouchmove="ture" wx:if="{{descFrameShow}}"> | |||
<view class="prizeImgGroup" wx:if="{{false}}"> | |||
<image class="prizeImg" src="http://www.jiyou-tech.com/2020/496_qichen/static/images/indexBg.jpg"></image> | |||
<image bindtap="lookDesc" data-value="{{false}}" class="closeDescIcon" src="{{imgUrl+'/images/closeDescIcon.png'}}"></image> | |||
</view> | |||
<view class="prizeCustomGroup"> | |||
<view class="prizeCustom"> | |||
<view class="prizeTitle">500元购车券</view> | |||
<view class="prizeDescText">恭喜您!</view> | |||
<view class="prizeDescText">500元购车券,已放入您个人中心</view> | |||
<view class="prizeDescText">此购车券仅限</view> | |||
<view class="prizeDescText">全国东风启辰专营店购买启辰星使用</view> | |||
<view class="prizeDescText">同时,您也可以加入星探计划,</view> | |||
<view class="prizeDescText">获取更多好礼</view> | |||
</view> | |||
<image bindtap="lookDesc" data-value="{{false}}" class="closeDescIcon" src="{{imgUrl+'/images/closeDescIcon.png'}}"></image> | |||
</view> | |||
</view> | |||
<view class="prizeDesc" catchtouchmove="ture" style="background-color:'rgba(000,000,000,0.8)';" wx:if="{{ruleShow}}"> | |||
<view class="ruleImgGroup"> | |||
<image class="ruleImg" src="{{imgUrl+'/images/rule.png'}}"></image> | |||
<image bindtap="lookRule" data-value="{{false}}" class="closeDescIcon" src="{{imgUrl+'/images/closeDescIcon.png'}}"></image> | |||
</view> | |||
</view> | |||
</view> | |||
<tabBar></tabBar> | |||
</view> | |||
</view> |
@@ -2,6 +2,13 @@ | |||
image{ | |||
display: block; | |||
} | |||
view{ | |||
-webkit-overflow-scrolling: touch; | |||
} | |||
.main{ | |||
height: calc(100vh - 150rpx); | |||
overflow: auto; | |||
} | |||
.msgGroup{ | |||
padding-top: 108rpx; | |||
margin-bottom: 111rpx; | |||
@@ -101,6 +108,7 @@ image{ | |||
} | |||
.myCenterBotBg{ | |||
width: 750rpx; | |||
height: 589rpx; | |||
} | |||
.taskSelect{ | |||
padding:0 72rpx; | |||
@@ -204,10 +212,46 @@ image{ | |||
height: 41rpx; | |||
margin-right: 15rpx; | |||
} | |||
.rewardIcon{ | |||
.rewardIcon,.rewardCash{ | |||
width: 163rpx; | |||
height: 69rpx; | |||
} | |||
.rewardCash{ | |||
position: relative; | |||
border-radius: 10rpx; | |||
background-color: #F15443; | |||
overflow: hidden; | |||
} | |||
.rewardCashText{ | |||
width: 100%; | |||
background-color: #D6BF95; | |||
color: white; | |||
font-size: 16rpx; | |||
height: 22rpx; | |||
line-height: 22rpx; | |||
position: absolute; | |||
left: 0; | |||
bottom: 0; | |||
text-align: center; | |||
} | |||
.cashGroup{ | |||
height: 47rpx; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
} | |||
.cashNum{ | |||
color: white; | |||
font-size: 30rpx; | |||
line-height: 30rpx; | |||
} | |||
.cashCompany{ | |||
color: white; | |||
font-size: 16rpx; | |||
line-height: 16rpx; | |||
margin-top: 7rpx; | |||
margin-left: 3rpx; | |||
} | |||
.recordHeadGroup{ | |||
width: 90rpx; | |||
height: 90rpx; | |||
@@ -220,7 +264,9 @@ image{ | |||
height: 100%; | |||
} | |||
.recordGroup{ | |||
padding: 30rpx 72rpx; | |||
margin: 0 auto; | |||
padding: 30rpx 0; | |||
width: 606rpx; | |||
box-sizing: border-box; | |||
display: flex; | |||
align-items: center; | |||
@@ -240,6 +286,7 @@ image{ | |||
font-weight: bold; | |||
} | |||
.detachmentGroup{ | |||
position: relative; | |||
padding: 30rpx 72rpx; | |||
box-sizing: border-box; | |||
display: flex; | |||
@@ -250,6 +297,13 @@ image{ | |||
display: flex; | |||
align-items: center; | |||
} | |||
.detachmentTip{ | |||
position: absolute; | |||
right:72rpx; | |||
bottom: 10rpx; | |||
font-size: 14rpx; | |||
color: #8B888B; | |||
} | |||
.ranksName{ | |||
font-size: 20rpx; | |||
} | |||
@@ -415,14 +469,35 @@ image{ | |||
} | |||
.taskGroup,.ranksGroup,.subscribeGroup{ | |||
height: 589rpx; | |||
position: relative; | |||
} | |||
/* .ranksList{ | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
width: 750rpx; | |||
height: 100%; | |||
overflow: auto; | |||
} */ | |||
.ranksList{ | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
right:0; | |||
bottom:0; | |||
width: 750rpx; | |||
} | |||
.taskGroup{ | |||
position: relative; | |||
box-sizing: border-box; | |||
padding-top:23rpx; | |||
} | |||
.recordFrame{ | |||
margin-top: 23rpx; | |||
height: 543rpx; | |||
position: absolute; | |||
top: 104rpx; | |||
left: 0; | |||
width: 750rpx; | |||
height: 485rpx; | |||
overflow: auto; | |||
} | |||
.getUserMsgBtn{ | |||
position: absolute; | |||
@@ -433,4 +508,67 @@ image{ | |||
opacity: 0; | |||
margin: 0; | |||
padding:0; | |||
} | |||
.prizeDesc{ | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
width: 100%; | |||
height: 100%; | |||
background-color: rgba(000, 000, 000, 0.34); | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
padding-bottom: 150rpx; | |||
box-sizing: border-box; | |||
} | |||
.prizeImgGroup{ | |||
width: 453rpx; | |||
position: relative; | |||
} | |||
.prizeImg{ | |||
width: 100%; | |||
} | |||
.closeDescIcon{ | |||
position: absolute; | |||
top: -37rpx; | |||
right: -38rpx; | |||
width: 38rpx; | |||
height: 37rpx; | |||
} | |||
.ruleImgGroup{ | |||
width: 500rpx; | |||
height: 864rpx; | |||
position: relative; | |||
} | |||
.ruleImg{ | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.prizeCustomGroup{ | |||
width:453rpx; | |||
height:503rpx; | |||
position: relative; | |||
} | |||
.prizeCustom{ | |||
border-radius: 10rpx; | |||
overflow: hidden; | |||
width:100%; | |||
height:100%; | |||
background-color: white; | |||
} | |||
.prizeTitle{ | |||
height: 63rpx; | |||
background-color: #005EFD; | |||
color: white; | |||
line-height: 63rpx; | |||
text-align: center; | |||
font-size: 26rpx; | |||
margin-bottom: 67rpx; | |||
} | |||
.prizeDescText{ | |||
font-size: 26rpx; | |||
line-height: 26rpx; | |||
margin-bottom: 26rpx; | |||
text-align: center; | |||
} |
@@ -23,7 +23,7 @@ | |||
} | |||
}, | |||
"compileType": "miniprogram", | |||
"libVersion": "2.10.1", | |||
"libVersion": "2.8.3", | |||
"appid": "wx5c64e733d849c3ef", | |||
"projectname": "496_dongfengqichen", | |||
"debugOptions": { |