wx.setStorageSync('openid', e.data.data.openid) | wx.setStorageSync('openid', e.data.data.openid) | ||||
wx.setStorageSync('session_key', e.data.data.session_key) | wx.setStorageSync('session_key', e.data.data.session_key) | ||||
wx.setStorageSync('token', e.data.data.token) | wx.setStorageSync('token', e.data.data.token) | ||||
this.getUserType(); | |||||
if (this.globalData.openidSuccessFuc) { | if (this.globalData.openidSuccessFuc) { | ||||
this.globalData.openidSuccessFuc(); | this.globalData.openidSuccessFuc(); | ||||
} | } | ||||
}else{ | }else{ | ||||
this.globalData.openId = openid; | this.globalData.openId = openid; | ||||
} | } | ||||
this.getUserType(); | |||||
// 获取用户信息 | // 获取用户信息 | ||||
// wx.getSetting({ | // wx.getSetting({ | ||||
// success: res => { | // success: res => { | ||||
// } | // } | ||||
// }) | // }) | ||||
}, | }, | ||||
getUserType:function(){//获取用户注册状态 | |||||
getUserType: function () {//获取用户注册状态 | |||||
console.log(this.globalData.openId) | |||||
this.wxRequest(this.globalData.httpUrl + 'getinfo',{},e=>{ | this.wxRequest(this.globalData.httpUrl + 'getinfo',{},e=>{ | ||||
// console.log(e) | |||||
console.log(e) | |||||
if(e.code==201){//未注册跳到注册页面 | if(e.code==201){//未注册跳到注册页面 | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: '/pages/register/register' | url: '/pages/register/register' | ||||
session_key:"", | session_key:"", | ||||
token:"", | token:"", | ||||
userInfo:"", | userInfo:"", | ||||
httpUrl:"https://laomenkuang.jiyou-tech.com/apiWx/" | |||||
httpUrl:"https://laomenkuang.jiyou-tech.com/apiWx/", | |||||
getUserArr:[],//用户信息 | |||||
}, | }, | ||||
wxRequest: function (url, params, callback, thisArg, methods, openid) { | wxRequest: function (url, params, callback, thisArg, methods, openid) { | ||||
let that = this; | let that = this; | ||||
// console.log(this.globalData.openId) | |||||
var httpUrl = url; | var httpUrl = url; | ||||
var str = ""; | var str = ""; | ||||
var count = 0; | var count = 0; |
<image class="tooth" src="../images/tooth.png"></image> | <image class="tooth" src="../images/tooth.png"></image> | ||||
</view> | </view> | ||||
<view class="buyNum"> | <view class="buyNum"> | ||||
<view class="circleLeft"></view> | |||||
<view class="ticketName">{{ticketUser.coupon_type}}</view> | <view class="ticketName">{{ticketUser.coupon_type}}</view> | ||||
<view class="line"></view> | <view class="line"></view> | ||||
<view class="lineRig"> | <view class="lineRig"> | ||||
<text class="bigWord">{{ticketUser.num}}</text> | <text class="bigWord">{{ticketUser.num}}</text> | ||||
<text class="smaWord">张</text> | <text class="smaWord">张</text> | ||||
</view> | </view> | ||||
<view class="circleRig"></view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view> | |||||
<view class="botAll"> | |||||
<text class="title">使用说明</text> | <text class="title">使用说明</text> | ||||
<view> | <view> | ||||
<view class="timeLimit"> | <view class="timeLimit"> |
/* pages/TicketDetails/TicketDetails.wxss */ | /* pages/TicketDetails/TicketDetails.wxss */ | ||||
page{ | |||||
height: 100%; | |||||
background-color: #f9f6f6; | |||||
} | |||||
.ticketImg{ | .ticketImg{ | ||||
width: 100%; | width: 100%; | ||||
height: 472rpx; | height: 472rpx; | ||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
align-items: center; | align-items: center; | ||||
background-color: #ffffff; | |||||
border-radius: 30rpx; | |||||
} | } | ||||
.ticketName{ | .ticketName{ | ||||
margin-left: 96rpx; | margin-left: 96rpx; | ||||
.title{ | .title{ | ||||
display: inline-block; | display: inline-block; | ||||
width: 100%; | width: 100%; | ||||
margin: 57rpx 0 7rpx 0; | |||||
margin-bottom:7px; | |||||
text-align: center; | text-align: center; | ||||
font-size:30rpx; | font-size:30rpx; | ||||
font-family:SourceHanSansCN; | font-family:SourceHanSansCN; | ||||
.lookView{ | .lookView{ | ||||
width: 100%; | width: 100%; | ||||
text-align: center; | text-align: center; | ||||
margin-top: 100rpx; | |||||
margin-top: 20rpx; | |||||
height: 200rpx; | |||||
background-color: #fff; | |||||
border-radius: 30rpx; | |||||
display: flex; | |||||
justify-content: center; | |||||
align-items: center; | |||||
} | } | ||||
.codeImg{ | .codeImg{ | ||||
width: 200rpx; | width: 200rpx; | ||||
height: 200rpx | height: 200rpx | ||||
} | } | ||||
.botAll{ | |||||
background-color: #ffffff; | |||||
border-radius:30rpx; | |||||
margin-top: 10rpx; | |||||
padding: 50rpx 0; | |||||
} | |||||
.circleLeft{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | |||||
left: -25rpx; | |||||
} | |||||
.circleRig{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | |||||
right: -25rpx; | |||||
} | |||||
/* .scrollY{ | /* .scrollY{ | ||||
height: 200rpx; | height: 200rpx; | ||||
margin-top: 107rpx; | margin-top: 107rpx; |
<image class="tooth" src="../images/tooth.png"></image> | <image class="tooth" src="../images/tooth.png"></image> | ||||
</view> | </view> | ||||
<view class="buyNum"> | <view class="buyNum"> | ||||
<view class="circleLeft"></view> | |||||
<view class="ticketName">{{ticketUser.coupon_type}}</view> | <view class="ticketName">{{ticketUser.coupon_type}}</view> | ||||
<view class="line"></view> | <view class="line"></view> | ||||
<view class="chooseNum"> | <view class="chooseNum"> | ||||
<!-- <text class="textNum">{{buyNumber}}</text> --> | <!-- <text class="textNum">{{buyNumber}}</text> --> | ||||
<input class="inputNum" type="number" bindinput="getInputVal" value="{{buyNumber}}"></input> | <input class="inputNum" type="number" bindinput="getInputVal" value="{{buyNumber}}"></input> | ||||
<image bindtap="addFn" class="textAdd" src="../images/add.png"></image> | <image bindtap="addFn" class="textAdd" src="../images/add.png"></image> | ||||
<view class="circleRig"></view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view> | |||||
<view class="botAll"> | |||||
<text class="title">使用说明</text> | <text class="title">使用说明</text> | ||||
<view> | <view> | ||||
<view class="timeLimit"> | <view class="timeLimit"> |
/* pages/buyTicket/buyTicket.wxss */ | /* pages/buyTicket/buyTicket.wxss */ | ||||
page{ | |||||
height: 100%; | |||||
background-color: #f9f6f6; | |||||
/* background-color: red; */ | |||||
} | |||||
.ticketImg{ | .ticketImg{ | ||||
width: 100%; | width: 100%; | ||||
height: 472rpx; | height: 472rpx; | ||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
align-items: center; | align-items: center; | ||||
border-radius:30rpx; | |||||
background-color: #ffffff; | |||||
} | } | ||||
.line{ | .line{ | ||||
margin-left: 94rpx; | margin-left: 94rpx; | ||||
height: 126rpx; | height: 126rpx; | ||||
background-color: rgba(204,204,204,1); | background-color: rgba(204,204,204,1); | ||||
} | } | ||||
.chooseNum{ | |||||
display: flex; | |||||
align-items: center; | |||||
margin-right: 50rpx; | |||||
} | |||||
.chooseNum text{ | .chooseNum text{ | ||||
font-size: 30rpx; | font-size: 30rpx; | ||||
font-weight:bold; | font-weight:bold; | ||||
width: 70rpx; | width: 70rpx; | ||||
margin: 0 15rpx; | margin: 0 15rpx; | ||||
text-align: center; | text-align: center; | ||||
background-color: #f9f6f6; | |||||
} | } | ||||
.subtract{ | .subtract{ | ||||
width: 28rpx; | width: 28rpx; | ||||
margin-left:96rpx; | margin-left:96rpx; | ||||
} | } | ||||
.chooseNum{ | |||||
display: flex; | |||||
align-items: center; | |||||
margin-right: 54rpx; | |||||
border: 2rpx solid #f9f6f6; | |||||
padding: 0 20rpx; | |||||
} | |||||
.title{ | .title{ | ||||
display: inline-block; | display: inline-block; | ||||
width: 100%; | width: 100%; | ||||
margin: 57rpx 0 7rpx 0; | |||||
margin-bottom:7rpx; | |||||
text-align: center; | text-align: center; | ||||
font-size:30rpx; | font-size:30rpx; | ||||
font-family:SourceHanSansCN; | font-family:SourceHanSansCN; | ||||
.buyBtn{ | .buyBtn{ | ||||
width: 100%; | width: 100%; | ||||
height: 99rpx; | height: 99rpx; | ||||
margin-top: 140rpx; | |||||
margin-top: 90rpx; | |||||
} | } | ||||
/* .all{ | |||||
width: 100%; | |||||
.botAll{ | |||||
background-color: #ffffff; | |||||
border-radius:30rpx; | |||||
margin-top: 10rpx; | |||||
padding: 50rpx 0; | |||||
} | |||||
.circleLeft{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | |||||
left: -25rpx; | |||||
} | |||||
.circleRig{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | position: absolute; | ||||
top: 50%; | |||||
transform: translateY(-50%); | |||||
} */ | |||||
right: -25rpx; | |||||
} |
<image class="tooth" src="../images/tooth.png"></image> | <image class="tooth" src="../images/tooth.png"></image> | ||||
</view> | </view> | ||||
<view class="buyNum"> | <view class="buyNum"> | ||||
<view class="circleLeft"></view> | |||||
<view class="ticketName">{{ticketUser.coupon_type}}</view> | <view class="ticketName">{{ticketUser.coupon_type}}</view> | ||||
<view class="line"></view> | <view class="line"></view> | ||||
<view class="lineRig"> | <view class="lineRig"> | ||||
<text class="bigWord">{{surplusNum}}</text> | <text class="bigWord">{{surplusNum}}</text> | ||||
<text class="smaWord">张</text> | <text class="smaWord">张</text> | ||||
</view> | </view> | ||||
<view class="circleRig"></view> | |||||
</view> | </view> | ||||
<view class="giveFrind"> | <view class="giveFrind"> | ||||
<view class="giveView">赠送给好友</view> | <view class="giveView">赠送给好友</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view> | |||||
<view class="botAll"> | |||||
<text class="title">使用说明</text> | <text class="title">使用说明</text> | ||||
<view> | <view> | ||||
<view class="timeLimit"> | <view class="timeLimit"> |
/* pages/givePage/givePage.wxss */ | /* pages/givePage/givePage.wxss */ | ||||
page{ | page{ | ||||
height: 100%; | height: 100%; | ||||
background-color: #f9f6f6; | |||||
} | } | ||||
.all{ | .all{ | ||||
height: 100%; | height: 100%; | ||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
align-items: center; | align-items: center; | ||||
background-color: #ffffff; | |||||
border-radius: 30rpx; | |||||
} | } | ||||
.line{ | .line{ | ||||
margin-left: 94rpx; | margin-left: 94rpx; | ||||
.chooseNum{ | .chooseNum{ | ||||
display: flex; | display: flex; | ||||
align-items: center; | align-items: center; | ||||
border: 2rpx solid #f9f6f6; | |||||
padding: 0 20rpx; | |||||
} | } | ||||
.chooseNum text{ | .chooseNum text{ | ||||
font-size: 30rpx; | font-size: 30rpx; | ||||
width: 70rpx; | width: 70rpx; | ||||
margin: 0 15rpx; | margin: 0 15rpx; | ||||
text-align: center; | text-align: center; | ||||
background-color: #f9f6f6; | |||||
} | } | ||||
.subtract{ | .subtract{ | ||||
width: 28rpx; | width: 28rpx; | ||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
align-items: center; | align-items: center; | ||||
background-color: #ffffff; | |||||
border-radius: 30rpx; | |||||
margin: 8rpx 0; | |||||
} | } | ||||
.giveView{ | .giveView{ | ||||
font-size:26rpx; | font-size:26rpx; | ||||
margin-top: 12rpx; | margin-top: 12rpx; | ||||
padding: 0; | padding: 0; | ||||
border-radius: 0; | border-radius: 0; | ||||
} | |||||
.circleLeft{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | |||||
left: -25rpx; | |||||
} | |||||
.circleRig{ | |||||
background-color: #f9f6f6; | |||||
border-radius: 50%; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
position: absolute; | |||||
right: -25rpx; | |||||
} | |||||
.botAll{ | |||||
background-color: #ffffff; | |||||
border-radius: 30rpx; | |||||
} | } |
}, | }, | ||||
getUser:function(e){//点击登陆获取用户信息 | getUser:function(e){//点击登陆获取用户信息 | ||||
console.log(e) | console.log(e) | ||||
console.log(app.globalData.userInfo) | |||||
this.setData({ | |||||
getUserArr: e.detail.userInfo | |||||
}) | |||||
if (this.data.getUserArr){ | |||||
console.log(app.globalData.getUserArr) | |||||
if (app.globalData.getUserArr.length==0) { | |||||
app.globalData.getUserArr = e.detail.userInfo; | |||||
this.setData({ | |||||
getUserArr: e.detail.userInfo | |||||
}) | |||||
this.setData({ | this.setData({ | ||||
getUser: true, | |||||
userPhone: app.globalData.userInfo | |||||
userPhone: app.globalData.userInfo, | |||||
getUser :true, | |||||
}) | }) | ||||
this.submitUser(); | this.submitUser(); | ||||
} | } |
</view> | </view> | ||||
<view class="myTicketAll"> | <view class="myTicketAll"> | ||||
<view class="line"></view> | |||||
<view class="myTicketTop" bindtap="lookMyTicket"> | <view class="myTicketTop" bindtap="lookMyTicket"> | ||||
<image class="ticketIcon" src="../images/ticketIcon.png"></image> | <image class="ticketIcon" src="../images/ticketIcon.png"></image> | ||||
<view class="myTicket">我的优惠券</view> | <view class="myTicket">我的优惠券</view> | ||||
</view> | </view> | ||||
</scroll-view> | </scroll-view> | ||||
<view class="myTicketTop" style="margin-top:81rpx;" bindtap="lookHistory"> | |||||
<view class="line" style="margin-top:40rpx"></view> | |||||
<view class="myTicketTop" bindtap="lookHistory"> | |||||
<image class="historyIcon" src="../images/historyIcon.png"></image> | <image class="historyIcon" src="../images/historyIcon.png"></image> | ||||
<view class="myTicket" style="margin-left:-310rpx;">优惠券使用记录</view> | <view class="myTicket" style="margin-left:-310rpx;">优惠券使用记录</view> | ||||
<image class="ticketArrows" src="../images/ticketArrows.png" style="transform:rotate({{historydeg}}deg)"></image> | <image class="ticketArrows" src="../images/ticketArrows.png" style="transform:rotate({{historydeg}}deg)"></image> |
.myTicketAll{ | .myTicketAll{ | ||||
padding: 0 64rpx; | padding: 0 64rpx; | ||||
/* margin-top: 80rpx; */ | |||||
position: absolute; | |||||
top: 390rpx; | |||||
} | } | ||||
.myTicketTop{ | .myTicketTop{ | ||||
display: flex; | display: flex; | ||||
color:rgba(235,97,0,1); | color:rgba(235,97,0,1); | ||||
} | } | ||||
.getUser{ | |||||
.line{ | |||||
width: 630rpx; | |||||
height: 2rpx; | |||||
background-color: #CCCCCC; | |||||
margin: 0 auto 40rpx auto; | |||||
} | } |
inputVal:"", | inputVal:"", | ||||
scrollHig:0, | scrollHig:0, | ||||
pageNum:1,//页码 | pageNum:1,//页码 | ||||
count:2,//每页条数 | |||||
count:10,//每页条数 | |||||
showDataArr:[],//展示的数据列表 | showDataArr:[],//展示的数据列表 | ||||
dataArr: [],//搜索的数据列表 | dataArr: [],//搜索的数据列表 | ||||
getDataArr:[],//每次下拉获取的数据 | getDataArr:[],//每次下拉获取的数据 | ||||
}, | }, | ||||
searchShop: function (search){//搜索 | searchShop: function (search){//搜索 | ||||
console.log(this.data.provinceArr) | |||||
if (search) { | if (search) { | ||||
console.log(111) | |||||
var province = ""; | var province = ""; | ||||
var city = ""; | var city = ""; | ||||
var activeArr = [this.data.provinceArr, this.data.cityArr[0]]; | var activeArr = [this.data.provinceArr, this.data.cityArr[0]]; | ||||
provinceCityArr: activeArr, | provinceCityArr: activeArr, | ||||
}) | }) | ||||
}else{ | }else{ | ||||
console.log(222) | |||||
if (this.data.provinceCityArr[0][this.data.provinceIndex] == "全部") { | if (this.data.provinceCityArr[0][this.data.provinceIndex] == "全部") { | ||||
this.data.provinceCityArr[0][this.data.provinceIndex] = ""; | this.data.provinceCityArr[0][this.data.provinceIndex] = ""; | ||||
} | } | ||||
getDataArr: e.data, | getDataArr: e.data, | ||||
}) | }) | ||||
console.log(this.data.showDataArr) | console.log(this.data.showDataArr) | ||||
} else if (e.code == -200){ | |||||
wx.showModal({ | |||||
title: '没有搜索到匹配的门店', | |||||
}) | |||||
this.setData({ | |||||
inputVal: "" | |||||
}) | |||||
} | } | ||||
}, this) | }, this) | ||||
}, | }, |