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