@@ -7,7 +7,10 @@ | |||
"pages/buyTicket/buyTicket", | |||
"pages/TicketDetails/TicketDetails", | |||
"pages/givePage/givePage", | |||
"pages/receiveTicket/receiveTicket" | |||
"pages/receiveTicket/receiveTicket", | |||
"pages/ticketCenter/ticketCenter", | |||
"pages/myReplace/myReplace", | |||
"pages/addScore/addScore" | |||
], | |||
"window":{ | |||
"backgroundTextStyle": "light", | |||
@@ -21,10 +24,16 @@ | |||
"selectedColor": "#eb6100", | |||
"list":[ | |||
{ | |||
"iconPath": "/pages/images/tabbar4_2.png", | |||
"selectedIconPath": "/pages/images/tabbar4_1.png", | |||
"pagePath": "pages/index/index", | |||
"text": "首页" | |||
}, | |||
{ | |||
"iconPath": "/pages/images/tabbar1_1.png", | |||
"selectedIconPath": "/pages/images/tabbar1_2.png", | |||
"pagePath": "pages/index/index", | |||
"text": "购券大厅" | |||
"pagePath": "pages/ticketCenter/ticketCenter", | |||
"text": "券中心" | |||
}, | |||
{ | |||
"iconPath": "/pages/images/tabbar2_1.png", | |||
@@ -45,4 +54,7 @@ | |||
"desc": "你的位置信息将用于小程序位置接口的效果展示" | |||
} | |||
} | |||
} |
@@ -0,0 +1,158 @@ | |||
// pages/addScore/addScore.js | |||
const app = getApp(); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
chooseWhich:1, | |||
scoreData:[], | |||
newData:[], | |||
pageNum:1, | |||
count:10, | |||
total_page:"", | |||
scrollHig:0, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
if (app.globalData.openId){ | |||
this.addScore(); | |||
}else{ | |||
app.globalData.openidSuccessFuc = this.addScore; | |||
} | |||
this.setData({ | |||
scrollHig: wx.getSystemInfoSync().windowHeight-44-41-20, | |||
}); | |||
}, | |||
addScore:function(){//积分增长 | |||
let params = { | |||
list_type:2, | |||
cur_page:this.data.pageNum, | |||
show_num:this.data.count, | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'front/point/addlist', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
if(e.data.length==0){ | |||
console.log(5555) | |||
wx.showToast({ | |||
title: e.message, | |||
icon:"none" | |||
}) | |||
return; | |||
} | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.newData.push(e.data[i]); | |||
e.data[i].add_date = e.data[i].add_date.slice(0,10); | |||
} | |||
this.setData({ | |||
scoreData:this.data.newData | |||
}) | |||
this.data.total_page = e.total_page; | |||
} | |||
}, this) | |||
}, | |||
deleScore:function(){//核销积分 | |||
let params = { | |||
list_type:2, | |||
cur_page:this.data.pageNum, | |||
show_num:this.data.count, | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'front/point/checklist', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
if(e.data.length==0){ | |||
wx.showToast({ | |||
title: e.message, | |||
icon:"none" | |||
}) | |||
return; | |||
} | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.newData.push(e.data[i]); | |||
e.data[i].check_date = e.data[i].check_date.slice(0,10); | |||
} | |||
this.setData({ | |||
scoreData:this.data.newData | |||
}) | |||
this.data.total_page = e.total_page; | |||
} | |||
}, this) | |||
}, | |||
getBot:function(){//scroll触底事件 | |||
if(this.data.pageNum<this.data.total_page){ | |||
this.data.pageNum++; | |||
this.getDataList(); | |||
}else{ | |||
wx.showToast({ | |||
title: '没有更多数据了', | |||
icon:"none" | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
}, | |||
chooseFn: function(e){//选择 | |||
this.setData({ | |||
chooseWhich:e.currentTarget.dataset.index | |||
}) | |||
this.data.pageNum = 1; | |||
this.data.scoreData = []; | |||
this.data.newData = []; | |||
if(this.data.chooseWhich==1){ | |||
this.addScore(); | |||
}else{ | |||
this.deleScore(); | |||
} | |||
}, | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,27 @@ | |||
<!--pages/addScore/addScore.wxml--> | |||
<view class="all"> | |||
<view class="choose"> | |||
<view class="hotSell" data-index="1" bindtap="chooseFn" style="color:{{chooseWhich==1?'#333333':'#999999'}}">积分增长记录</view> | |||
<view class="replace" data-index="2" bindtap="chooseFn" style="color:{{chooseWhich==2?'#333333':'#999999'}}">积分使用记录</view> | |||
<view class="yellow" style="left:{{chooseWhich==1?'105rpx':'412rpx'}}"></view> | |||
</view> | |||
<view class="menu"> | |||
<text class="timeDate">时间</text> | |||
<text class="matter" wx:if="{{chooseWhich==2}}">事项</text> | |||
<text class="scoreNum">积分</text> | |||
</view> | |||
<scroll-view class="scroll" scroll-y bindscrolltolower="getBot" style="height:{{scrollHig}}px"> | |||
<view wx:if="{{chooseWhich==1}}" class="scrollCont" wx:for="{{scoreData}}"> | |||
<text>{{item.add_date}}</text> | |||
<text>+{{item.point_add}}</text> | |||
</view> | |||
<view wx:if="{{chooseWhich==2}}" class="scrollCont" wx:for="{{scoreData}}"> | |||
<text>{{item.check_date}}</text> | |||
<text class="cash_exchange">{{item.cash_exchange}}</text> | |||
<text>-{{item.point_check}}</text> | |||
</view> | |||
</scroll-view> | |||
</view> |
@@ -0,0 +1,80 @@ | |||
/* pages/addScore/addScore.wxss */ | |||
page,.all{ | |||
width: 100%; | |||
height:100%; | |||
} | |||
.choose{ | |||
width: 100%; | |||
height: 88rpx; | |||
display: flex; | |||
justify-content: space-around; | |||
align-items: center; | |||
padding: 0 71rpx; | |||
box-sizing: border-box; | |||
background-color: #ffffff; | |||
position: relative; | |||
} | |||
.choose view{ | |||
font-size:28rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(153,153,153,1); | |||
} | |||
.yellow{ | |||
width: 240rpx; | |||
height: 8rpx; | |||
background-color: #FF7615; | |||
border-radius:4px; | |||
position: absolute; | |||
top: 78rpx; | |||
transition: left 0.5s; | |||
} | |||
.menu{ | |||
width: 100%; | |||
height: 82rpx; | |||
padding: 0 40rpx; | |||
box-sizing: border-box; | |||
background-color: #FAFAFA; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
} | |||
.menu text{ | |||
font-size:28rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(153,153,153,1); | |||
} | |||
.matter{ | |||
margin-right: 100rpx; | |||
} | |||
.scroll{ | |||
width:100%; | |||
background-color: #ffffff; | |||
padding-top: 32rpx; | |||
} | |||
.scrollCont{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
position: relative; | |||
padding: 0 40rpx; | |||
margin-bottom: 32rpx; | |||
box-sizing: border-box; | |||
} | |||
.scrollCont text{ | |||
font-size:24rpx; | |||
font-family:DINPro; | |||
font-weight:400; | |||
color:rgba(153,153,153,1); | |||
} | |||
.cash_exchange{ | |||
position: absolute; | |||
top: 0; | |||
left: 305rpx; | |||
} |
@@ -21,13 +21,21 @@ Page({ | |||
*/ | |||
onLoad: function (options) { | |||
console.log(options) | |||
this.data.id = options.index; | |||
this.data.id = options.id; | |||
if (app.globalData.openId) { | |||
this.getTicketUser() | |||
} else { | |||
app.globalData.openidSuccessFuc = this.getTicketUser; | |||
} | |||
if(options.type==1){ | |||
wx.setNavigationBarTitle({ | |||
title: "购买代金券", | |||
}) | |||
}else{ | |||
wx.setNavigationBarTitle({ | |||
title: "购买菜品券", | |||
}) | |||
} | |||
}, | |||
@@ -154,7 +162,7 @@ Page({ | |||
return; | |||
} | |||
this.data.yesClick = true; | |||
app.wxRequest(app.globalData.httpUrl + 'order/set', { coupon_sell_id: this.data.ticketUser.coupon_sell_id, buy_num: this.data.buyNumber}, e => { | |||
app.wxRequest(app.globalData.httpUrl + 'front/order/setting', { coupon_sell_id: this.data.ticketUser.coupon_sell_id, buy_num: this.data.buyNumber}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
this.setData({ | |||
@@ -189,7 +197,7 @@ Page({ | |||
}, this,"POST") | |||
}, | |||
orderPay:function(){ | |||
app.wxRequest(app.globalData.httpUrl + 'order/paid', { sign_num: this.data.sign_num}, e => { | |||
app.wxRequest(app.globalData.httpUrl + 'front/order/paidconfirm', { sign_num: this.data.sign_num}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
wx.switchTab({ |
@@ -1,4 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "购买优惠券" | |||
"navigationBarTitleText": "" | |||
} |
@@ -7,7 +7,7 @@ | |||
</view> | |||
<view class="buyNum"> | |||
<view class="circleLeft"></view> | |||
<view class="ticketName">{{ticketUser.coupon_name}}{{ticketUser.type_name}}</view> | |||
<view class="ticketName">{{ticketUser.coupon_name_detail}}</view> | |||
<view class="line"></view> | |||
<view class="chooseNum"> | |||
<view bindtap="subtractFn" class="subtractView"> | |||
@@ -35,7 +35,7 @@ | |||
<image src="../images/circle.png"></image> | |||
<text>使用条件</text> | |||
</view> | |||
<view class="specify">{{ticketUser.coupon_condition_desc}}</view> | |||
<view class="specify">{{ticketUser.coupon_memo}}</view> | |||
</view> | |||
<view> | |||
<view class="timeLimit"> |
@@ -128,8 +128,9 @@ page{ | |||
.buyBtn{ | |||
width: 100%; | |||
height: 99rpx; | |||
margin-top: 90rpx; | |||
/* margin-top: 90rpx; */ | |||
position: absolute; | |||
bottom: 0; | |||
} | |||
.botAll{ |
@@ -16,14 +16,18 @@ Page({ | |||
sellId:"",//优惠券券码 | |||
showMask:false,//弹框 | |||
yesShare:false,//防止重复点击赠送按钮 | |||
type:null,//券类型1是代金券,2是菜品券 | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
console.log(options.id) | |||
this.data.id = options.id | |||
this.setData({ | |||
type:options.type | |||
}) | |||
console.log(this.data.type) | |||
this.data.sellId = options.id; | |||
if (app.globalData.openId) { | |||
@@ -31,12 +35,21 @@ Page({ | |||
} else { | |||
app.globalData.openidSuccessFuc = this.getTicketUser; | |||
} | |||
if(options.type==1){ | |||
wx.setNavigationBarTitle({ | |||
title: "赠送代金券", | |||
}) | |||
}else{ | |||
wx.setNavigationBarTitle({ | |||
title: "赠送菜品券", | |||
}) | |||
} | |||
}, | |||
getTicketUser: function () {//获取优惠券信息 | |||
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: this.data.sellId, from: 2 }, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
e.data.original_price = parseInt(e.data.original_price); | |||
this.setData({ | |||
ticketUser: e.data, | |||
surplusNum:e.data.num, | |||
@@ -142,7 +155,7 @@ Page({ | |||
var titleWord = "";//title | |||
var shareImg = "";//分享图 | |||
if (options.from === "button"){ | |||
shareUrl = '/pages/receiveTicket/receiveTicket?shareId=' + this.data.shareId + "&number=" + this.data.buyNumber | |||
shareUrl = '/pages/receiveTicket/receiveTicket?shareId=' + this.data.shareId + "&number=" + this.data.buyNumber + "&type=" + this.data.type | |||
titleWord = "您的好友分享给您一张老门框爆肚涮肉的代金券,请您查收" | |||
shareImg = "../images/shareImg.png"; | |||
}else{ |
@@ -1,4 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "赠送优惠券" | |||
"navigationBarTitleText": "" | |||
} |
@@ -7,7 +7,8 @@ | |||
</view> | |||
<view class="buyNum"> | |||
<view class="circleLeft"></view> | |||
<view class="ticketName">{{ticketUser.coupon_name}}{{ticketUser.type_name}}</view> | |||
<view wx:if="{{type==1}}" class="ticketName">{{ticketUser.original_price}}元代金券</view> | |||
<view wx:if="{{type==2}}" class="ticketName">{{ticketUser.coupon_name_detail}}</view> | |||
<view class="line"></view> | |||
<view class="lineRig"> | |||
<text class="surplus">剩余</text> | |||
@@ -43,7 +44,7 @@ | |||
<image src="../images/circle.png"></image> | |||
<text>使用条件</text> | |||
</view> | |||
<view class="specify">{{ticketUser.coupon_condition_desc}}</view> | |||
<view class="specify">{{ticketUser.coupon_memo}}</view> | |||
</view> | |||
<view> | |||
<view class="timeLimit"> |
@@ -128,7 +128,7 @@ page{ | |||
.title{ | |||
display: inline-block; | |||
width: 100%; | |||
margin: 57rpx 0 7rpx 0; | |||
margin-bottom: 7rpx; | |||
text-align: center; | |||
font-size:30rpx; | |||
font-family:SourceHanSansCN; | |||
@@ -173,7 +173,8 @@ page{ | |||
.shareBtn{ | |||
width: 100%; | |||
height: 98rpx; | |||
margin-top: 12rpx; | |||
position: absolute; | |||
bottom: 0; | |||
padding: 0; | |||
border-radius: 0; | |||
} | |||
@@ -197,6 +198,7 @@ page{ | |||
.botAll{ | |||
background-color: #ffffff; | |||
border-radius: 30rpx; | |||
padding: 57rpx 0; | |||
} | |||
.maskView{ |
@@ -4,45 +4,39 @@ const app = getApp() | |||
Page({ | |||
data: { | |||
dataList:[], | |||
showMask:false,//规则弹窗 | |||
dataList:[],//轮播 | |||
fieryArr:[],//必点热品 | |||
}, | |||
//事件处理函数 | |||
onLoad: function () { | |||
if (app.globalData.openId){ | |||
this.getDataList(); | |||
this.fieryList(); | |||
}else{ | |||
app.globalData.openidSuccessFuc = this.getDataList; | |||
app.globalData.openidSuccessFuc = this.fieryList; | |||
} | |||
}, | |||
getDataList:function(){ | |||
app.wxRequest(app.globalData.httpUrl + 'couponsell/list', {}, e => { | |||
fieryList:function(){ | |||
app.wxRequest(app.globalData.httpUrl + 'front/banner/listing', {list_type:1}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
this.setData({ | |||
dataList:e.data[0] | |||
fieryArr:e.data | |||
}) | |||
} | |||
}, this) | |||
}, | |||
skipPage:function(e){ | |||
// console.log(e) | |||
var index = e.currentTarget.dataset.index | |||
wx.navigateTo({ | |||
url: '../buyTicket/buyTicket?index=' + index | |||
}) | |||
}, | |||
showRule:function(){//显示弹窗 | |||
this.setData({ | |||
showMask:true | |||
}) | |||
}, | |||
hiddenRule:function(){//隐藏弹窗 | |||
this.setData({ | |||
showMask: false | |||
}) | |||
getDataList:function(){ | |||
app.wxRequest(app.globalData.httpUrl + 'front/slider/listing', {list_type:1}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
this.setData({ | |||
dataList:e.data | |||
}) | |||
} | |||
}, this) | |||
}, | |||
/** | |||
* 用户点击右上角分享 |
@@ -1,4 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "购买大厅" | |||
"navigationBarTitleText": "老门框爆肚" | |||
} |
@@ -1,37 +1,38 @@ | |||
<!--index.wxml--> | |||
<view class="container"> | |||
<image class="buyBg" src="../images/buyBg.jpg"></image> | |||
<image bindtap="showRule" class="ruleBtn" src="../images/rule.png"></image> | |||
<!-- <swiper duration="500" next-margin="70rpx"> | |||
<swiper class="swiper1" indicator-dots="true" autoplay="true" interval="5000" duration="500" circular="true"> | |||
<block wx:for="{{dataList}}" wx:key="*this"> | |||
<swiper-item data-index="{{item.coupon_sell_id}}" bindtap="skipPage"> --> | |||
<view class="botCont" data-index="{{dataList.coupon_sell_id}}" bindtap="skipPage"> | |||
<image class="indexBuy" src="../images/indexBuy.png"></image> | |||
<!-- <view class="imgView"> | |||
<image src="{{dataList.coupon_img_small}}"></image> | |||
</view> --> | |||
<view class="textView"> | |||
<text class="nameText">{{dataList.coupon_name_detail}}</text> | |||
<!-- <view class="bigticketView"> | |||
<text class="maney">100</text> --> | |||
<!-- <text class="Bigticket">元</text> --> | |||
<!-- <text class="maney">100</text> --> | |||
<!-- <text class="Bigticket">代金券</text> --> | |||
<!-- </view> --> | |||
<text class="timeText">{{dataList.coupon_condition_desc}}</text> | |||
<text class="timeText">(有效期:{{dataList.duration}})</text> | |||
</view> | |||
<image class="indexBtnBuy" src="../images/indexBtnBuy.png"></image> | |||
<swiper-item> | |||
<view class="swiper-item"> | |||
<image mode="widthFix" class="swiperImg" src="{{item.slider_img}}"></image> | |||
</view> | |||
<!-- </swiper-item> | |||
</swiper-item> | |||
</block> | |||
</swiper> --> | |||
<view class="maskAll" wx:if="{{showMask}}"> | |||
<view class="maskCont"> | |||
<image class="ruleMask" src="../images/ruleMask.png"></image> | |||
<image bindtap="hiddenRule" class="hiddenIcon" src="../images/hiddenIcon.png"></image> | |||
</swiper> | |||
<view class="fiery"> | |||
<view class="fiery-top"> | |||
<text>进店必点热品</text> | |||
<image src="../images/arrowsRig.png"></image> | |||
</view> | |||
<view class="fiery-content"> | |||
<swiper class="swiper2" autoplay="true" interval="3000" duration="500" circular="true" display-multiple-items="{{fieryArr.length>3?'3':fieryArr.length}}" previous-margin="24rpx" style="width:{{fieryArr.length>=3?'100%':'520rpx'}}"> | |||
<block wx:for="{{fieryArr}}" wx:key="*this"> | |||
<swiper-item class="item2"> | |||
<view class="swiper2-item"> | |||
<view style="overflow:hidden;border-radius:30rpx"> | |||
<image class="swiperImg2" src="{{item.banner_img}}"></image> | |||
</view> | |||
<view class="banner_title">{{item.banner_title}}</view> | |||
</view> | |||
</swiper-item> | |||
</block> | |||
</swiper> | |||
</view> | |||
</view> | |||
<view class="bigPic"> | |||
<image src="http://static.jiyou-tech.com/2020/510/indexBig.jpg"></image> | |||
<image src="http://static.jiyou-tech.com/2020/510/indexBot.png"></image> | |||
</view> | |||
</view> |
@@ -6,135 +6,70 @@ page{ | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.buyBg{ | |||
width: 890rpx; | |||
height: 1000rpx; | |||
position: fixed; | |||
top:0; | |||
left: 0; | |||
.swiper1{ | |||
width: 750rpx; | |||
height: 260rpx; | |||
} | |||
/* swiper{ | |||
width: 100%; | |||
height: 437rpx; | |||
position: absolute; | |||
left: 0; | |||
bottom: 0; | |||
} */ | |||
.botCont{ | |||
/* width: 607rpx; */ | |||
width: 100%; | |||
border-radius:30rpx; | |||
background-color:#ffffff; | |||
display: flex; | |||
flex-direction: row; | |||
flex-wrap: wrap; | |||
padding-top: 70rpx; | |||
/* padding-left: 75rpx; */ | |||
padding-bottom: 40rpx; | |||
position: fixed; | |||
left: 0; | |||
bottom: 0; | |||
} | |||
.imgView{ | |||
width: 254rpx; | |||
height: 248rpx; | |||
overflow: hidden; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
border-radius:10px 0px 0px 10px; | |||
} | |||
.imgView image{ | |||
width: 387rpx; | |||
height: 342rpx; | |||
.swiper2{ | |||
width: 750rpx; | |||
height: 370rpx; | |||
} | |||
.textView{ | |||
width: 318rpx; | |||
position: absolute; | |||
left: 110rpx; | |||
top: 115rpx; | |||
.swiper2-item{ | |||
width: 218rpx; | |||
height: 360rpx; | |||
text-align: center; | |||
} | |||
.textView text{ | |||
display: block; | |||
.banner_title{ | |||
margin-top: 24rpx; | |||
} | |||
.nameText{ | |||
font-size:50rpx; | |||
font-family:DINPro; | |||
/* font-weight:bold; */ | |||
color:#8f560f; | |||
margin-bottom: 10rpx | |||
.swiperImg2{ | |||
width: 218rpx; | |||
height: 290rpx; | |||
} | |||
.bigticketView{ | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
color:#8f560f; | |||
.item2{ | |||
height: 370rpx; | |||
} | |||
.maney{ | |||
font-weight:bold; | |||
font-size:40rpx; | |||
.swiperImg{ | |||
width: 750rpx; | |||
height: 260rpx; | |||
} | |||
.Bigticket{ | |||
font-size:35rpx; | |||
font-family:DINPro; | |||
color:#8f560f; | |||
.fiery{ | |||
margin:59rpx 0; | |||
width: 100%; | |||
} | |||
.timeText{ | |||
font-size:24rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:300; | |||
color:#8f560f; | |||
.fiery-top{ | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
margin-bottom: 24rpx; | |||
padding: 0 24rpx; | |||
} | |||
.buyView{ | |||
margin-top: 40rpx; | |||
font-size:36rpx; | |||
font-family:SourceHanSansCN; | |||
.fiery-top text{ | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(0,0,0,1); | |||
color:rgba(51,51,51,1); | |||
margin-right: 19rpx; | |||
} | |||
.fiery-top image{ | |||
width: 11rpx; | |||
height: 21rpx; | |||
} | |||
.ruleBtn{ | |||
width: 117rpx; | |||
height: 37rpx; | |||
position: fixed; | |||
right: 30rpx; | |||
bottom: 480rpx; | |||
z-index: 10; | |||
.fiery-content{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
} | |||
.maskAll{ | |||
position: fixed; | |||
.bigPic image:nth-child(1){ | |||
width: 100%; | |||
height: 100%; | |||
top: 0; | |||
left: 0; | |||
background-color: rgba(0, 0, 0, 0.5); | |||
z-index: 100 | |||
} | |||
.ruleMask{ | |||
width: 576rpx; | |||
height: 947rpx; | |||
} | |||
.hiddenIcon{ | |||
width: 110rpx; | |||
height: 111rpx; | |||
margin: -12rpx auto 0 auto; | |||
display: block; | |||
} | |||
.maskCont{ | |||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
transform: translate(-50%,-50%); | |||
} | |||
.indexBuy{ | |||
width: 650rpx; | |||
height: 275rpx; | |||
margin-left: 50rpx; | |||
height: 350rpx; | |||
vertical-align: bottom; | |||
} | |||
.indexBtnBuy{ | |||
width: 368rpx; | |||
height: 73rpx; | |||
margin-left: 191rpx; | |||
.bigPic image:nth-child(2){ | |||
width: 686rpx; | |||
height: 169rpx; | |||
margin: 51rpx 32rpx; | |||
} |
@@ -0,0 +1,204 @@ | |||
// pages/myReplace/myReplace.js | |||
const app = getApp(); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
dataList:[],//需要展示的数据 | |||
newData:[], | |||
pageNum:1,//页码, | |||
count:10,//每页条数 | |||
total:0,//总条数 | |||
total_page:0,//总页数 | |||
mydeg: 0, | |||
myTicketArrows: true, | |||
historydeg: -90, | |||
historyTicketArrows: false, | |||
dataList2:[],//需要展示的数据 | |||
newData2:[], | |||
pageNum2:1,//页码, | |||
count2:10,//每页条数 | |||
total2:0,//总条数 | |||
total_page2:0,//总页数 | |||
myText:"",//"我的代金券"文案 | |||
myHistory:"", | |||
index:1,//代金券还是菜品券 | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
var index = options.index; | |||
this.data.index = index | |||
if(index==1){ | |||
this.setData({ | |||
myText:"我的代金券", | |||
myHistory:"代金券使用记录" | |||
}) | |||
}else{ | |||
this.setData({ | |||
myText:"我的菜品券", | |||
myHistory:"菜品券使用记录" | |||
}) | |||
} | |||
wx.setNavigationBarTitle({ | |||
title: this.data.myText, | |||
}) | |||
if (app.globalData.openId){ | |||
this.getDataList(); | |||
this.historyList(); | |||
}else{ | |||
app.globalData.openidSuccessFuc = this.getDataList; | |||
app.globalData.openidSuccessFuc = this.historyList; | |||
} | |||
}, | |||
getDataList:function(index){ | |||
let params = { | |||
item_type:this.data.index, | |||
cur_page:this.data.pageNum, | |||
show_num:this.data.count, | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'front/buy/pendinglist', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.newData.push(e.data[i]); | |||
} | |||
this.setData({ | |||
dataList:this.data.newData | |||
}) | |||
this.data.total_page = e.total_page; | |||
} | |||
}, this) | |||
}, | |||
getBot:function(){//scroll触底事件 | |||
if(this.data.pageNum<this.data.total_page){ | |||
this.data.pageNum++; | |||
this.getDataList(); | |||
}else{ | |||
wx.showToast({ | |||
title: '没有更多数据了', | |||
icon:"none" | |||
}) | |||
} | |||
}, | |||
lookMyTicket:function(){ | |||
this.setData({ | |||
myTicketArrows: !this.data.myTicketArrows, | |||
}) | |||
if (this.data.myTicketArrows){ | |||
this.setData({ | |||
mydeg: 0, | |||
}) | |||
}else{ | |||
this.setData({ | |||
mydeg: -90, | |||
}) | |||
} | |||
}, | |||
lookHistory:function(){ | |||
this.setData({ | |||
historyTicketArrows: !this.data.historyTicketArrows, | |||
}) | |||
if (this.data.historyTicketArrows) { | |||
this.setData({ | |||
historydeg: 0, | |||
}) | |||
} else { | |||
this.setData({ | |||
historydeg: -90, | |||
}) | |||
} | |||
}, | |||
lower:function(){//检测上拉是否到底 | |||
console.log("到底了") | |||
if(this.data.pageNum2<this.data.total_page2){ | |||
this.data.pageNum2++; | |||
this.historyList(); | |||
}else{ | |||
wx.showToast({ | |||
title: '没有更多数据了', | |||
icon:"none" | |||
}) | |||
} | |||
}, | |||
historyList:function(){ | |||
let params = { | |||
item_type:this.data.index, | |||
cur_page:this.data.pageNum2, | |||
show_num:this.data.count2, | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'front/buy/usehistory', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.newData2.push(e.data[i]); | |||
} | |||
this.setData({ | |||
dataList2:this.data.newData2 | |||
}) | |||
this.data.total_page = e.total_page2; | |||
} | |||
}, this) | |||
}, | |||
giveTicket:function(e){//赠送优惠券 | |||
var id = e.target.dataset.id; | |||
wx.navigateTo({ | |||
url: '../givePage/givePage?id=' + id+"&type="+this.data.index+"&type="+this.data.index, | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "" | |||
} |
@@ -0,0 +1,46 @@ | |||
<!--pages/myReplace/myReplace.wxml--> | |||
<view class="all"> | |||
<view class="lookTicket"> | |||
<view class="lookTicketTop" bindtap="lookMyTicket"> | |||
<image style="width:49rpx;height:30rpx" src="../images/ticketIcon.png"></image> | |||
<view class="ticketWord">{{myText}}</view> | |||
<image style="width:34rpx;height:19rpx;transform:rotate({{mydeg}}deg)" src="../images/arrows.png"></image> | |||
</view> | |||
<scroll-view class="scroll" scroll-y bindscrolltolower="getBot" style="width:100%;" wx:if="{{myTicketArrows}}"> | |||
<view class="ticketAll" wx:for="{{dataList}}"> | |||
<view class="ticketleft"> | |||
<image src="{{item.coupon_img_small}}"></image> | |||
</view> | |||
<view class="ticketRig"> | |||
<view class="ticket-title">{{item.coupon_name_detail}}</view> | |||
<view class="ticket-desc">{{item.coupon_memo}}</view> | |||
<view class="validity">有效期:{{item.duration}}</view> | |||
<view class="line"></view> | |||
<view class="giveFriend"> | |||
<text data-id="{{item.coupon_sell_id}}" bindtap="giveTicket">赠送好友</text> | |||
<image src="../images/giveFriend.png"></image> | |||
</view> | |||
</view> | |||
<view class="circle circle1"></view> | |||
<view class="circle circle2"></view> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
<view class="lookTicket"> | |||
<view class="line" style="margin:40rpx 0;background:#CCCCCC"></view> | |||
<view class="lookTicketTop" bindtap="lookHistory"> | |||
<image style="width:30rpx;height:30rpx" src="../images/historyIcon.png"></image> | |||
<view class="ticketWord" style="margin-right:360rpx">{{myHistory}}</view> | |||
<image style="width:34rpx;height:19rpx;transform:rotate({{historydeg}}deg)" src="../images/arrows.png"></image> | |||
</view> | |||
<scroll-view class="scroll" scroll-y bindscrolltolower="lower" style="width:100%;" wx:if="{{historyTicketArrows}}"> | |||
<view class="historyCont" wx:for="{{dataList2}}"> | |||
<text class="ticketCode">券码:{{item.coupon_code}}</text> | |||
<text class="ticketName">{{item.coupon_name_detail}}</text> | |||
<text class="ticketName" style="color:#EB6100">已使用</text> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
</view> |
@@ -0,0 +1,128 @@ | |||
/* pages/myReplace/myReplace.wxss */ | |||
page{ | |||
width: 100%; | |||
height: 100%; | |||
background: #fafafa; | |||
} | |||
.all{ | |||
width: 100%; | |||
height: 100%; | |||
padding: 60rpx 32rpx; | |||
box-sizing: border-box; | |||
} | |||
.lookTicketTop{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 33rpx; | |||
} | |||
.ticketWord{ | |||
margin-right: 400rpx; | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(51,51,51,1); | |||
} | |||
.ticketAll{ | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
margin-bottom: 33rpx; | |||
position: relative; | |||
} | |||
.ticketAll .circle{ | |||
width: 30rpx; | |||
height: 30rpx; | |||
border-radius: 50%; | |||
position: absolute; | |||
left: 205rpx; | |||
background:rgba(250,250,250,1); | |||
/* background:red; */ | |||
} | |||
.circle1{ | |||
top: -15rpx; | |||
} | |||
.circle2{ | |||
bottom: -15rpx; | |||
} | |||
.ticketleft,.ticketleft image{ | |||
width: 220rpx; | |||
height: 220rpx; | |||
border-radius: 20rpx; | |||
} | |||
.ticketRig{ | |||
background-color: #ffffff; | |||
/* background-color: red; */ | |||
width: 466rpx; | |||
height: 220rpx; | |||
border-radius: 20rpx; | |||
padding: 31rpx 24rpx 0rpx 24rpx; | |||
box-sizing: border-box; | |||
box-shadow: 10rpx 5rpx 20rpx 5rpx #f2f2f2; | |||
} | |||
.ticket-title{ | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(106,10,14,1); | |||
} | |||
.ticket-desc{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(51,51,51,1); | |||
} | |||
.validity{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:300; | |||
color:rgba(153,153,153,1); | |||
} | |||
.line{ | |||
width: 100%; | |||
height: 1px; | |||
background: #E6E6E6; | |||
margin-top: 24rpx; | |||
} | |||
.giveFriend{ | |||
display: flex; | |||
justify-content: flex-end; | |||
align-items: center; | |||
padding-top: 24rpx; | |||
} | |||
.giveFriend image{ | |||
width: 24rpx; | |||
height: 24rpx; | |||
margin-top: 6rpx; | |||
margin-left: 15rpx; | |||
} | |||
.giveFriend text{ | |||
font-size:24rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:300; | |||
color:rgba(235,97,0,1); | |||
} | |||
.scroll{ | |||
max-height: 500rpx; | |||
} | |||
.historyCont{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
} | |||
.ticketCode{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(153,153,153,1); | |||
} | |||
.ticketName{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(102,102,102,1); | |||
} | |||
.historyCont{ | |||
margin-top: 34rpx | |||
} |
@@ -0,0 +1,66 @@ | |||
// pages/pages/buyTicket.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,2 @@ | |||
<!--pages/pages/buyTicket.wxml--> | |||
<text>pages/pages/buyTicket.wxml</text> |
@@ -0,0 +1 @@ | |||
/* pages/pages/buyTicket.wxss */ |
@@ -0,0 +1,66 @@ | |||
// pages/pages/givePage.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,2 @@ | |||
<!--pages/pages/givePage.wxml--> | |||
<text>pages/pages/givePage.wxml</text> |
@@ -0,0 +1 @@ | |||
/* pages/pages/givePage.wxss */ |
@@ -0,0 +1,66 @@ | |||
// pages/pages/myReplace.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,2 @@ | |||
<!--pages/pages/myReplace.wxml--> | |||
<text>pages/pages/myReplace.wxml</text> |
@@ -0,0 +1 @@ | |||
/* pages/pages/myReplace.wxss */ |
@@ -0,0 +1,66 @@ | |||
// pages/pages/receiveTicket.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,2 @@ | |||
<!--pages/pages/receiveTicket.wxml--> | |||
<text>pages/pages/receiveTicket.wxml</text> |
@@ -0,0 +1 @@ | |||
/* pages/pages/receiveTicket.wxss */ |
@@ -25,14 +25,28 @@ Page({ | |||
userName:"",//昵称 | |||
noUser:false, | |||
topNum:0, | |||
showCode:false,//显示二维码 | |||
codeUrl:""//身份码地址 | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
getIDCode:function(){//获取身份码 | |||
app.wxRequest(app.globalData.httpUrl + 'front/user/usercode', {}, e => { | |||
if (e.code == 202) { | |||
this.setData({ | |||
codeUrl: e.data.user_code_url | |||
}) | |||
} | |||
setTimeout(()=>{ | |||
this.getIDCode() | |||
},10000) | |||
console.log(this.data.codeUrl) | |||
}, this) | |||
}, | |||
getToRsgisterFn:function(){//未注册点击跳到注册页 | |||
var state = wx.getStorageSync('state'); | |||
@@ -42,8 +56,8 @@ Page({ | |||
}) | |||
} | |||
}, | |||
myTicket:function(){//获取我的优惠券列表 | |||
app.wxRequest(app.globalData.httpUrl + 'couponbuy/validtype', {}, e => { | |||
myTicket:function(){//获取用户待使用代金券、菜品券数量 | |||
app.wxRequest(app.globalData.httpUrl + 'front/buy/typenum', {}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
this.setData({ | |||
@@ -52,35 +66,7 @@ Page({ | |||
} | |||
}, this) | |||
}, | |||
historyTicket: function () {//获取优惠券使用列表 | |||
this.data.getHistory = []; | |||
app.wxRequest(app.globalData.httpUrl + 'couponbuy/historyuse', {cur_page: this.data.pageNum, show_num: this.data.pageCount}, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.getHistoryArr.push(e.data[i]); | |||
} | |||
this.data.getHistory = e.data | |||
this.setData({ | |||
historyArr: this.data.getHistoryArr, | |||
}) | |||
} | |||
console.log(this.data.getHistoryArr) | |||
}, this) | |||
}, | |||
lower:function(){//检测上拉是否到底 | |||
console.log("到底了") | |||
if (this.data.getHistory.length!=0){ | |||
this.data.pageNum++; | |||
this.historyTicket() | |||
}else{ | |||
wx.showToast({ | |||
title: '没有更多数据了', | |||
icon: "none", | |||
duration: 1000 | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
@@ -99,10 +85,8 @@ Page({ | |||
this.data.getHistoryArr = []; | |||
if (app.globalData.openId) { | |||
this.myTicket(); | |||
this.historyTicket(); | |||
} else { | |||
app.globalData.openidSuccessFuc = this.myTicket; | |||
app.globalData.openidSuccessFuc = this.historyTicket; | |||
} | |||
if (!this.data.getUser) { | |||
var state = wx.getStorageSync('state'); | |||
@@ -114,13 +98,16 @@ Page({ | |||
headerImg: "../images/headerImg.png", | |||
userName: userInfo.nickName, | |||
userPhone: phone, | |||
getUserArr:userInfo, | |||
getUser: true | |||
}) | |||
console.log(this.data.getUserArr) | |||
}else{ | |||
this.setData({ | |||
headerImg: userInfo.avatarUrl, | |||
userName: userInfo.nickName, | |||
userPhone: phone, | |||
getUserArr:userInfo, | |||
getUser: true | |||
}) | |||
} | |||
@@ -151,6 +138,7 @@ Page({ | |||
headerImg: "../images/headerImg.png", | |||
userName: userInfo.nickName, | |||
userPhone: phone, | |||
getUserArr:userInfo, | |||
getUser: true | |||
}) | |||
} else { | |||
@@ -158,6 +146,7 @@ Page({ | |||
headerImg: userInfo.avatarUrl, | |||
userName: userInfo.nickName, | |||
userPhone: phone, | |||
getUserArr:userInfo, | |||
getUser: true | |||
}) | |||
} | |||
@@ -170,6 +159,7 @@ Page({ | |||
noUser: false | |||
}) | |||
} | |||
} else { | |||
this.setData({ | |||
getUser: false, | |||
@@ -220,34 +210,13 @@ Page({ | |||
}, | |||
} | |||
}, | |||
lookMyTicket:function(){ | |||
this.setData({ | |||
myTicketArrows: !this.data.myTicketArrows, | |||
}) | |||
if (this.data.myTicketArrows){ | |||
this.setData({ | |||
mydeg: 0, | |||
}) | |||
}else{ | |||
this.setData({ | |||
mydeg: -90, | |||
}) | |||
} | |||
}, | |||
lookHistory:function(){ | |||
this.setData({ | |||
historyTicketArrows: !this.data.historyTicketArrows, | |||
lookMyTicket:function(e){ | |||
var index = e.currentTarget.dataset.index; | |||
wx.navigateTo({ | |||
url: '../myReplace/myReplace?index='+index | |||
}) | |||
if (this.data.historyTicketArrows) { | |||
this.setData({ | |||
historydeg: 0, | |||
}) | |||
} else { | |||
this.setData({ | |||
historydeg: -90, | |||
}) | |||
} | |||
}, | |||
lookTicket: function (e) {//查看优惠券 | |||
console.log(e) | |||
var id = e.currentTarget.dataset.id; | |||
@@ -295,4 +264,20 @@ Page({ | |||
} | |||
}, | |||
showFn:function(){//显示二维码 | |||
this.getIDCode(); | |||
this.setData({ | |||
showCode:true | |||
}) | |||
}, | |||
hiddenCode:function(){//隐藏二维码 | |||
this.setData({ | |||
showCode:false | |||
}) | |||
}, | |||
skipScore:function(){//跳转到积分页面 | |||
wx.navigateTo({ | |||
url:"../addScore/addScore" | |||
}) | |||
} | |||
}) |
@@ -1,72 +1,94 @@ | |||
<!--pages/personalCenter/personalCenter.wxml--> | |||
<view class="all"> | |||
<image class="centerBg" src="../images/centerBg.png"></image> | |||
<image class="centerBg" src="../images/peopleCenter.jpg"></image> | |||
<view class="userMess"> | |||
<image class="userCircle" src="../images/userCircle.png"></image> | |||
<!-- <image class="userCircle" src="../images/userCircle.png"></image> --> | |||
<view class="userAll"> | |||
<view wx:if="{{!noUser}}" class="userHeader" bindtap="getToRsgisterFn"> | |||
<image class="userImg" src="{{headerImg}}"></image> | |||
<view class="userLeft"> | |||
<view wx:if="{{!noUser}}" class="userHeader" bindtap="getToRsgisterFn"> | |||
<view class="radius"> | |||
<image class="userImg" src="{{headerImg}}"></image> | |||
</view> | |||
</view> | |||
<button wx:if="{{noUser}}" class="userHeaderBtn" open-type="getUserInfo" bindgetuserinfo="getUser"> | |||
<image class="userImg" src="{{headerImg}}"></image> | |||
</button> | |||
<image wx:if="{{!getUser}}" bindtap="getToRsgisterFn" class="getToRsgister" src="../images/getHeader.png"></image> | |||
</view> | |||
<view class="userDetails"> | |||
<view wx:if="{{getUser}}" class="userName">{{userName}}</view> | |||
<button wx:if="{{noUser}}" class="noUserBtn" open-type="getUserInfo" bindgetuserinfo="getUser"> | |||
<image class="getHeader" src="../images/getHeader.png"></image> | |||
</button> | |||
<view wx:if="{{getUser}}" class="userPhone">{{userPhone}}</view> | |||
</view> | |||
<image wx:if="{{getUser}}" class="userCode" src="../images/userCode.png" bindtap="showFn"></image> | |||
</view> | |||
<view class="gradeAll"> | |||
<view class="crown-grade"> | |||
<image src="../images/crown.png"></image> | |||
<view class="grade">{{getUserArr.user_level}}</view> | |||
</view> | |||
<button wx:if="{{noUser}}" class="userHeaderBtn" open-type="getUserInfo" bindgetuserinfo="getUser"> | |||
<image class="userImg" src="{{headerImg}}"></image> | |||
</button> | |||
<button wx:if="{{noUser}}" class="noUserBtn" open-type="getUserInfo" bindgetuserinfo="getUser"> | |||
<image class="getHeader" src="../images/getHeader.png"></image> | |||
</button> | |||
<image wx:if="{{!getUser}}" bindtap="getToRsgisterFn" class="getToRsgister" src="../images/getHeader.png"></image> | |||
<view wx:if="{{getUser}}" class="userName">{{userName}}</view> | |||
<view wx:if="{{getUser}}" class="userPhone">{{userPhone}}</view> | |||
<view class="word" style="margin:0 66rpx 0 17rpx">砖石会员</view> | |||
<view> | |||
<text class="word">成长值</text> | |||
<text class="score">{{getUserArr.user_point_year}}/{{getUserArr.next_level_point_hold}}</text> | |||
</view> | |||
</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> | |||
<image style="transform:rotate({{mydeg}}deg)" class="ticketArrows" src="../images/ticketArrows.png"></image> | |||
<view class="myTicketTop" bindtap="lookMyTicket" data-index = "1"> | |||
<image class="ticketIcon" src="../images/ticketIcon1.png"></image> | |||
<view class="myTicket">代金券</view> | |||
<text class="howMany">{{myTicketArr.coupon_cash}}</text> | |||
<image class="ticketArrows" src="../images/arrowsRig.png"></image> | |||
</view> | |||
<scroll-view class="scrollY1" scroll-y="true" wx:if="{{myTicketArrows}}"> | |||
<view class="contAll" wx:for="{{myTicketArr}}"> | |||
<view class="ticketCont" bindtap="lookTicket" data-id = "{{item.coupon_sell_id}}"> | |||
<image class="centerBuy" src="../images/indexBuy.png"></image> | |||
<!-- <view class="ticketImg"> | |||
<image class="ticketImg" src="{{item.coupon_img_small}}"></image> | |||
</view> --> | |||
<view class="rigWord"> | |||
<view class="name">{{item.coupon_name}}{{item.type_name}}</view> | |||
<!-- <view class="bigticketView"> | |||
<text class="maney">92</text> | |||
<text class="Bigticket">元抵</text> | |||
<text class="maney">100</text> | |||
<text class="Bigticket">元</text> | |||
</view> --> | |||
<view class="time">{{item.coupon_condition_desc}}</view> | |||
<view class="time">(有效期:{{item.duration}})</view> | |||
</view> | |||
</view> | |||
<view class="look"> | |||
<image bindtap="lookTicket" class="lookTicket" data-id = "{{item.coupon_sell_id}}" src="../images/lookTicket.png"></image> | |||
<image bindtap="giveTicket" class="giveFrinedBtn" data-id = "{{item.coupon_sell_id}}" src="../images/giveFrinedBtn.png"></image> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
<view class="myTicketTop" style="margin:93rpx 0" bindtap="lookMyTicket" data-index = "2"> | |||
<image class="historyIcon" src="../images/ticketIcon2.png"></image> | |||
<view class="myTicket">菜品券</view> | |||
<text class="howMany">{{myTicketArr.coupon_dish}}</text> | |||
<image class="ticketArrows" src="../images/arrowsRig.png"></image> | |||
</view> | |||
<view class="service" style="margin:93rpx 0"> | |||
<image class="serviceIcon" src="../images/ticketIcon3.png"></image> | |||
<view class="serviceWord">联系客服</view> | |||
<image class="ticketArrows" src="../images/arrowsRig.png"></image> | |||
</view> | |||
</view> | |||
<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-right: 310rpx;">代金券使用记录</view> | |||
<image class="ticketArrows" src="../images/ticketArrows.png" style="transform:rotate({{historydeg}}deg)"></image> | |||
<view class="scoreAll" bindtap="skipScore"> | |||
<view class="score-left"> | |||
<image src="../images/scoreIcon.png"></image> | |||
<text>积分</text> | |||
</view> | |||
<view class="line"></view> | |||
<view class="scoreNum">{{getUserArr.user_point_all-getUserArr.user_point_use}}</view> | |||
<image class="ticketArrows" src="../images/arrowsRig.png"></image> | |||
</view> | |||
<scroll-view class="scrollY2" scroll-y="true" scroll-top='{{topNum}}' wx:if="{{historyTicketArrows}}" bindscrolltolower="lower"> | |||
<view class="history" wx:for="{{historyArr}}"> | |||
<view class="ticketCode">券码:{{item.coupon_code}}</view> | |||
<view class="tickName">{{item.coupon_name}}{{item.type_name}}</view> | |||
<view class="tickType">已使用</view> | |||
<view wx:if="{{showCode}}" class="maskCode"> | |||
<view class="maskAll"> | |||
<image class="whiteBg" src="../images/whiteBg.png"></image> | |||
<view class="maskContTop"> | |||
<view wx:if="{{!noUser}}" class="userHeader"> | |||
<view class="radius"> | |||
<image class="userImg" src="{{headerImg}}"></image> | |||
</view> | |||
</view> | |||
<view class="userDetails" style="margin-left:33rpx"> | |||
<view wx:if="{{getUser}}" class="userName" style="color:#333333">{{userName}}</view> | |||
<view wx:if="{{getUser}}" class="userPhone" style="color:#333333">{{userPhone}}</view> | |||
</view> | |||
<image bindtap="hiddenCode" class="dele" src="../images/dele.png"></image> | |||
</view> | |||
</scroll-view> | |||
<view class="codeView"> | |||
<image src="{{codeUrl}}"></image> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -20,19 +20,32 @@ page{ | |||
} | |||
.userMess{ | |||
width: 100%; | |||
height: 100%; | |||
position: absolute; | |||
top: 117rpx; | |||
top: 0; | |||
left: 0; | |||
} | |||
.userHeader{ | |||
width: 200rpx; | |||
height: 200rpx; | |||
width: 140rpx; | |||
height: 140rpx; | |||
overflow: hidden; | |||
border-radius: 50%; | |||
background-color: #ffffff; | |||
position: relative; | |||
} | |||
.radius{ | |||
width: 130rpx; | |||
height: 130rpx; | |||
overflow: hidden; | |||
border-radius: 50%; | |||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
transform: translate(-50%,-50%); | |||
} | |||
.userHeaderBtn{ | |||
width: 200rpx; | |||
height: 200rpx; | |||
width: 130rpx; | |||
height:130rpx; | |||
overflow: hidden; | |||
border-radius: 50%; | |||
margin: 0; | |||
@@ -40,7 +53,6 @@ page{ | |||
background-color: transparent; | |||
} | |||
.noUserBtn{ | |||
margin-top: 20rpx; | |||
width: 230rpx; | |||
height: 64rpx; | |||
border: none; | |||
@@ -54,213 +66,241 @@ page{ | |||
border: none | |||
} | |||
.userImg{ | |||
width: 200rpx; | |||
height: 200rpx; | |||
width: 130rpx; | |||
height: 130rpx; | |||
} | |||
.userAll{ | |||
text-align: center; | |||
/* text-align: center; */ | |||
width: 100%; | |||
box-sizing: border-box; | |||
position:absolute; | |||
top:42rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
top:125rpx; | |||
display: flex; | |||
justify-content: center; | |||
justify-content: space-between; | |||
align-items: center; | |||
flex-wrap: wrap; | |||
flex-direction: column; | |||
padding: 0 33rpx; | |||
} | |||
.userDetails{ | |||
margin-right: 240rpx; | |||
} | |||
.userCode{ | |||
width: 70rpx; | |||
height: 70rpx; | |||
} | |||
.userName{ | |||
font-size:40rpx; | |||
color:rgba(51,51,51,1); | |||
color:#ffffff; | |||
font-weight:bold; | |||
/* margin-top: 31rpx; */ | |||
margin-bottom: 16rpx; | |||
} | |||
.userPhone{ | |||
font-size:30rpx; | |||
color:rgba(102,102,102,1); | |||
color:#ffffff; | |||
} | |||
.gradeAll{ | |||
width: 100%; | |||
padding: 0 32rpx; | |||
box-sizing: border-box; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
position: absolute; | |||
top: 337rpx; | |||
} | |||
.crown-grade{ | |||
width: 46rpx; | |||
height: 36rpx; | |||
margin-bottom: 10rpx; | |||
position: relative; | |||
} | |||
.gradeAll image{ | |||
width: 46rpx; | |||
height: 36rpx; | |||
} | |||
.grade{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(255,255,255,1); | |||
position: absolute; | |||
bottom: -4rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
} | |||
.word{ | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(255,255,255,1); | |||
} | |||
.score{ | |||
font-size:30rpx; | |||
color:rgba(255,255,255,1); | |||
} | |||
.myTicketAll{ | |||
padding: 0 64rpx; | |||
width: 622rpx; | |||
width: 100%; | |||
position: absolute; | |||
top: 390rpx; | |||
top: 504rpx; | |||
padding-top: 200rpx; | |||
border-radius: 30rpx; | |||
background-color: #ffffff; | |||
} | |||
.myTicketTop{ | |||
display: flex; | |||
justify-content: space-between; | |||
justify-content: flex-start; | |||
align-items: center; | |||
width: 622rpx; | |||
width: 100%; | |||
padding: 0 32rpx 0 56rpx; | |||
box-sizing: border-box; | |||
} | |||
.ticketIcon{ | |||
width: 49rpx; | |||
height: 30rpx; | |||
width: 30rpx; | |||
height: 21rpx; | |||
} | |||
.ticketArrows{ | |||
width: 34rpx; | |||
height: 19rpx; | |||
width: 11rpx; | |||
height: 21rpx; | |||
} | |||
.myTicket{ | |||
margin-right: 350rpx; | |||
margin-left: 24rpx; | |||
margin-right: 455rpx; | |||
font-size:30rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:bold; | |||
color:rgba(51,51,51,1); | |||
} | |||
.ticketCont{ | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
} | |||
.ticketImg{ | |||
width: 254rpx; | |||
height: 248rpx; | |||
border-radius:10px 0px 0px 10px; | |||
overflow: hidden; | |||
margin-right: 32rpx; | |||
} | |||
.name{ | |||
font-size:50rpx; | |||
.howMany{ | |||
font-size:30rpx; | |||
font-family:DINPro; | |||
/* font-weight:bold; */ | |||
color:#8f560f; | |||
margin-bottom: 10rpx; | |||
} | |||
.name1,.name2{ | |||
font-size:35rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:bold; | |||
color:rgba(106,10,14,1); | |||
} | |||
.name3{ | |||
font-size:60rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:bold; | |||
color:rgba(106,10,14,1); | |||
} | |||
.time{ | |||
font-size:24rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:300; | |||
color:#8f560f; | |||
font-weight:500; | |||
color:rgba(235,97,0,1); | |||
margin-right: 39rpx; | |||
} | |||
.look{ | |||
/* display: flex; | |||
.service{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center;*/ | |||
/* margin-bottom: 33rpx; */ | |||
align-items: center; | |||
width: 100%; | |||
padding: 0 32rpx 0 56rpx; | |||
box-sizing: border-box; | |||
} | |||
.giveFrinedBtn{ | |||
width: 308rpx; | |||
height: 73rpx; | |||
float: right; | |||
.serviceIcon{ | |||
width: 31rpx; | |||
height: 30rpx | |||
} | |||
.clickLook{ | |||
.serviceWord{ | |||
margin-right: 450rpx; | |||
font-size:30rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:500; | |||
color:rgba(0,0,0,1); | |||
margin-left: 15rpx; | |||
font-weight:bold; | |||
color:rgba(51,51,51,1); | |||
} | |||
.scrollY1{ | |||
height: 360rpx; | |||
margin-top: 33rpx; | |||
} | |||
.scrollY2{ | |||
height: 200rpx; | |||
margin-top: 20rpx; | |||
} | |||
.historyIcon{ | |||
width: 30rpx; | |||
height: 30rpx; | |||
} | |||
.history{ | |||
.scoreAll{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 20rpx; | |||
} | |||
.historyLeft{ | |||
position: relative; | |||
/* width: 179rpx; */ | |||
width: 300rpx; | |||
height: 36rpx; | |||
width: 686rpx; | |||
padding: 49rpx 40rpx 45rpx 62rpx; | |||
box-sizing: border-box; | |||
background-color: #ffffff; | |||
position: absolute; | |||
top: 429rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
border-radius: 30rpx; | |||
box-shadow: 10rpx 5rpx 20rpx 5rpx #d4d2d2; | |||
} | |||
.ticketCode{ | |||
text-align: center; | |||
font-size:20rpx; | |||
font-family:DIN; | |||
font-weight:500; | |||
.score-left{ | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
flex-direction: column; | |||
} | |||
.historyTicketBg{ | |||
/* width: 179rpx; */ | |||
width: 300rpx; | |||
height: 36rpx; | |||
display: none; | |||
.score-left image{ | |||
width: 50rpx; | |||
height: 51rpx; | |||
} | |||
.tickName{ | |||
font-size:20rpx; | |||
color:rgba(102,102,102,1); | |||
.score-left text{ | |||
font-size:28rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(235,97,0,1); | |||
} | |||
.tickType{ | |||
font-size:24rpx; | |||
font-family:SourceHanSansCN; | |||
font-weight:bold; | |||
.scoreNum{ | |||
font-size:60rpx; | |||
font-family:DINPro; | |||
font-weight:400; | |||
color:rgba(235,97,0,1); | |||
margin-left: 260rpx; | |||
} | |||
.line{ | |||
width: 630rpx; | |||
height: 2rpx; | |||
background-color: #CCCCCC; | |||
margin: 0 auto 40rpx auto; | |||
} | |||
/* .contAll{ | |||
box-shadow: 50rpx 10rpx 20rpx #d4d2d2; | |||
} */ | |||
.getToRsgister{ | |||
width: 230rpx; | |||
height: 64rpx; | |||
margin-top: 20rpx; | |||
.historyIcon{ | |||
width: 30rpx; | |||
height: 21rpx; | |||
} | |||
.getHeader{ | |||
width: 230rpx; | |||
height: 64rpx; | |||
.line{ | |||
width:1px; | |||
height:79rpx; | |||
background:rgba(230,230,230,1); | |||
} | |||
.centerBuy{ | |||
width: 650rpx; | |||
height: 275rpx; | |||
.maskAll{ | |||
position: relative; | |||
width: 686rpx; | |||
margin: 0 auto; | |||
margin-top: 300rpx; | |||
border-radius:10rpx; | |||
} | |||
.rigWord{ | |||
width: 350rpx; | |||
text-align: center; | |||
position: absolute; | |||
top: 50rpx; | |||
left: 35rpx; | |||
.maskCode{ | |||
width: 100%; | |||
height: 100%; | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
background: rgba(0,0,0,0.5); | |||
} | |||
.bigticketView{ | |||
.maskContTop{ | |||
width: 686rpx; | |||
height: 212rpx; | |||
padding: 0 40rpx; | |||
box-sizing: border-box; | |||
display: flex; | |||
justify-content: center; | |||
justify-content: flex-start; | |||
align-items: center; | |||
color:#8f560f; | |||
position: absolute; | |||
} | |||
.maney{ | |||
font-weight:bold; | |||
font-size:40rpx; | |||
.codeView{ | |||
width: 100%; | |||
height: 693rpx; | |||
border-radius:10rpx; | |||
position: absolute; | |||
top: 212rpx; | |||
left: 0; | |||
} | |||
.Bigticket{ | |||
font-size:35rpx; | |||
font-family:DINPro; | |||
color:#8f560f; | |||
.codeView image{ | |||
width: 520rpx; | |||
height: 520rpx; | |||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
transform: translate(-50%,-50%); | |||
} | |||
.lookTicket{ | |||
width: 308rpx; | |||
height: 73rpx; | |||
.dele{ | |||
width: 27rpx; | |||
height: 28rpx; | |||
margin-bottom: 100rpx; | |||
} | |||
.whiteBg{ | |||
width: 686rpx; | |||
height: 906rpx; | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
} | |||
.noUserBtn image{ | |||
width: 230rpx; | |||
height: 64rpx; | |||
} |
@@ -14,6 +14,7 @@ Page({ | |||
ticketNum:0, | |||
moreClick:false,//防止重复点击领取 | |||
showAll:false, | |||
type:null, | |||
}, | |||
/** | |||
@@ -22,10 +23,16 @@ Page({ | |||
onLoad: function (options) { | |||
app.globalData.present_id = options.shareId; | |||
this.data.presentId = options.shareId; | |||
this.setData({ | |||
type:options.type | |||
}) | |||
app.globalData.number = options.number; | |||
app.globalData.type = options.type; | |||
this.setData({ | |||
ticketNum: options.number | |||
}) | |||
app.globalData.present_id = "p1591272747o13" | |||
app.globalData.number = 1 | |||
var state = wx.getStorageSync('state'); | |||
if (state == 1) {//已注册 | |||
@@ -65,6 +72,8 @@ Page({ | |||
app.wxRequest(app.globalData.httpUrl + 'couponbuy/presentvisit', { present_id: app.globalData.present_id, present_num: app.globalData.number }, e => { | |||
console.log(e) | |||
if (e.code == 201) { | |||
e.data.original_price = parseInt(e.data.original_price); | |||
e.data.coupon_price = parseInt(e.data.coupon_price); | |||
var partPhone = e.data.user_phone.slice(0, 3) + "****" + e.data.user_phone.slice(7) | |||
this.setData({ | |||
ticketUser: e.data, |
@@ -10,22 +10,24 @@ | |||
<text class="textNum">{{ticketNum}}</text> | |||
<text class="text">张</text> | |||
</view> | |||
<view class="ticketType">{{ticketUser.coupon_name}}{{ticketUser.type_name}}</view> | |||
<view wx:if="{{type==1}}" class="ticketType">{{ticketUser.original_price}}元代金券</view> | |||
<view wx:if="{{type==2}}" class="ticketType">{{ticketUser.coupon_name_detail}}</view> | |||
</view> | |||
<view class="line"></view> | |||
<view class="contBot"> | |||
<image class="receiveTicket" src="../images/indexBuy.png"></image> | |||
<view class="textView"> | |||
<text class="nameText">{{ticketUser.coupon_name}}{{ticketUser.type_name}}</text> | |||
<!-- <view class="bigticketView"> | |||
<text class="maney">92</text> | |||
<text class="Bigticket">元抵</text> | |||
<text class="maney">100</text> | |||
<text class="Bigticket">元</text> | |||
</view> --> | |||
<!-- <text class="nameText">{{ticketUser.coupon_name}}</text> --> | |||
<text class="timeText">{{ticketUser.coupon_condition_desc}}</text> | |||
<text class="timeText">(有效期:{{ticketUser.duration}})</text> | |||
<view class="picView"> | |||
<image class="receiveTicket" src="{{ticketUser.coupon_img_small}}"></image> | |||
</view> | |||
<view class="ticketRig"> | |||
<view class="ticket-title">{{ticketUser.coupon_name_detail}}</view> | |||
<view class="ticket-desc">{{ticketUser.coupon_memo}}</view> | |||
<view class="ticket-name"> | |||
<view class="ticket-name-left"> | |||
<view wx:if="{{type==1}}" class="yelloword">{{ticketUser.original_price}}元代金券</view> | |||
<view wx:if="{{type==2}}" class="yelloword">券价:{{ticketUser.coupon_price}}元</view> | |||
<view class="validity">有效期:{{ticketUser.duration}}</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<image bindtap="getTicketFn" class="getTicket" src="../images/getTicket.png"></image> |
@@ -65,8 +65,11 @@ page{ | |||
margin-top: 220rpx; | |||
} | |||
.contBot{ | |||
position: relative; | |||
text-align: center; | |||
width: 547rpx; | |||
margin: 0 auto; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
} | |||
.picView{ | |||
width: 248rpx; | |||
@@ -105,7 +108,7 @@ page{ | |||
display: block; | |||
width: 670rpx; | |||
height: 98rpx; | |||
margin: 180rpx auto 0 auto; | |||
margin: 350rpx auto 0 auto; | |||
} | |||
.errorTitle{ | |||
@@ -153,8 +156,8 @@ page{ | |||
margin: 310rpx auto 0 auto; | |||
} | |||
.receiveTicket{ | |||
width: 650rpx; | |||
height: 275rpx; | |||
width: 200rpx; | |||
height: 200rpx; | |||
} | |||
.bigticketView{ | |||
display: flex; | |||
@@ -176,4 +179,61 @@ page{ | |||
margin: 70rpx auto 20rpx auto; | |||
height: 1rpx; | |||
background-color: #cccccc; | |||
} | |||
.picView{ | |||
width: 200rpx; | |||
height: 200rpx; | |||
border-radius: 10rpx; | |||
} | |||
.ticketRig{ | |||
background-color: #ffffff; | |||
width: 347rpx; | |||
height: 200rpx; | |||
border-radius: 20rpx; | |||
padding: 31rpx 24rpx 34rpx 24rpx; | |||
box-sizing: border-box; | |||
box-shadow: 10rpx 5rpx 10rpx 5rpx #f2f2f2; | |||
} | |||
.ticket-title{ | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(106,10,14,1); | |||
} | |||
.ticket-desc{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(51,51,51,1); | |||
} | |||
.yelloword{ | |||
width: 144rpx; | |||
height: 36rpx; | |||
text-align: center; | |||
line-height: 36rpx; | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(235,97,0,1); | |||
border: 1px solid #EB6100; | |||
border-radius: 18px; | |||
margin: 5rpx 0; | |||
} | |||
.validity{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:300; | |||
color:rgba(153,153,153,1); | |||
} | |||
.shoping{ | |||
width:110rpx; | |||
height:60rpx; | |||
text-align: center; | |||
line-height: 60rpx; | |||
background:rgba(235,97,0,1); | |||
border-radius:30px; | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(255,255,255,1); | |||
} |
@@ -9,7 +9,7 @@ Page({ | |||
provinceCityArr: [],//省份城市为二维数组a[[],[]] | |||
provinceArr: [],//省 | |||
cityArr: [],//市 | |||
index:0, | |||
index:[0,0], | |||
provinceIndex:0, | |||
cityIndex:0, | |||
inputVal:"", | |||
@@ -22,6 +22,7 @@ Page({ | |||
topNum:0,//滚动条位置 | |||
latitude: 0, | |||
longitude: 0, | |||
content:"", | |||
}, | |||
bindchange:function(e){ | |||
this.data.pageNum = 1; | |||
@@ -32,7 +33,7 @@ Page({ | |||
}) | |||
this.searchShop(); | |||
}, | |||
bindcolumnchange: function (e) { | |||
bindcolumnchangeFn: function (e) { | |||
console.log(e) | |||
if (this.data.provinceCityArr[0][0] == "") { | |||
this.data.provinceCityArr[0][0] = "全部" | |||
@@ -45,22 +46,19 @@ Page({ | |||
var value = e.detail.value;//指列中的哪一个 | |||
var activeArr = [this.data.provinceArr, this.data.cityArr[value]] | |||
if (clo==0){ | |||
console.log(0) | |||
this.setData({ | |||
provinceCityArr: activeArr, | |||
index:0, | |||
provinceIndex: value, | |||
cityIndex:0, | |||
index:[value,0], | |||
// provinceIndex: clo, | |||
// cityIndex:0, | |||
}) | |||
}else{ | |||
this.setData({ | |||
index: value, | |||
index: [this.data.index[0],value], | |||
cityIndex:value | |||
}) | |||
// console.log(this.data.provinceCityArr) | |||
} | |||
// console.log(activeArr) | |||
// console.log(clo, value) | |||
console.log(this.data.index) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
@@ -99,21 +97,25 @@ Page({ | |||
shopCityAll.push(arr) | |||
shopCity.push(arr) | |||
} | |||
console.log(shopProvince) | |||
shopCityAll = shopCityAll.join(",") | |||
shopCityAll = shopCityAll.split(",") | |||
shopCity.unshift(shopCityAll); | |||
provinceCity.push(shopProvince); | |||
provinceCity.push([...shopProvince]); | |||
console.log(provinceCity) | |||
provinceCity.push(shopCity[0]); | |||
console.log(provinceCity) | |||
console.log(this.data.index) | |||
this.setData({ | |||
provinceArr: shopProvince, | |||
cityArr: shopCity, | |||
provinceCityArr: provinceCity, | |||
provinceCityArr: JSON.parse(JSON.stringify(provinceCity)), | |||
content:provinceCity[this.data.index[0]][this.data.index[1]] | |||
}) | |||
this.searchShop(); | |||
// console.log(this.data.provinceArr) | |||
// console.log(this.data.cityArr) | |||
// console.log(this.data.provinceCityArr) | |||
} | |||
}, this) | |||
}, | |||
@@ -122,13 +124,15 @@ Page({ | |||
var province = ""; | |||
var city = ""; | |||
if (this.data.provinceCityArr[0][this.data.provinceIndex] == "全部") { | |||
this.data.provinceCityArr[0][this.data.provinceIndex] = ""; | |||
} | |||
province="" | |||
} else{ | |||
province = this.data.provinceCityArr[0][this.data.index[0]]; | |||
} | |||
if (this.data.provinceCityArr[1][this.data.cityIndex] == "全部") { | |||
this.data.provinceCityArr[1][this.data.cityIndex] = ""; | |||
city="" | |||
}else{ | |||
city = this.data.provinceCityArr[1][this.data.index[1]]; | |||
} | |||
province = this.data.provinceCityArr[0][this.data.provinceIndex]; | |||
city = this.data.provinceCityArr[1][this.data.cityIndex]; | |||
var locationIndex; | |||
if (this.data.longitude){ | |||
locationIndex = 2 | |||
@@ -146,7 +150,7 @@ Page({ | |||
"lat": this.data.latitude, | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'shop/shopsearch', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
for (var i = 0; i < e.data.length;i++){ | |||
this.data.dataArr.push(e.data[i]); | |||
@@ -154,8 +158,8 @@ Page({ | |||
this.setData({ | |||
showDataArr: this.data.dataArr, | |||
getDataArr: e.data, | |||
content:this.data.provinceCityArr[1][this.data.index[1]] | |||
}) | |||
console.log(this.data.showDataArr) | |||
} else if (e.code == -200){ | |||
wx.showModal({ | |||
title: '没有搜索到匹配的门店', |
@@ -2,9 +2,9 @@ | |||
<view class="all"> | |||
<view class="searchAll"> | |||
<view class="chooseCity"> | |||
<picker mode="multiSelector" range="{{provinceCityArr}}" bindchange="bindchange" bindcolumnchange="bindcolumnchange" value="{{index}}"> | |||
<picker mode="multiSelector" range="{{provinceCityArr}}" bindchange="bindchange" bindcolumnchange="bindcolumnchangeFn" value="{{index}}"> | |||
<view class="clickChoose"> | |||
<view class="picker">{{provinceCityArr[1][index]}}</view> | |||
<view class="picker">{{content}}</view> | |||
<image class="arrows" src="../images/arrows.png"></image> | |||
</view> | |||
</picker> |
@@ -0,0 +1,149 @@ | |||
// pages/ticketCenter/ticketCenter.js | |||
const app = getApp() | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
chooseWhich:1, | |||
dataList:[],//需要展示的数据 | |||
newData:[], | |||
pageNum:1,//页码, | |||
count:10,//每页条数 | |||
total:0,//总条数 | |||
total_page:0,//总页数 | |||
scrollHig:0, | |||
type:"", | |||
hotType:2, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
if (app.globalData.openId){ | |||
this.getDataList(); | |||
}else{ | |||
app.globalData.openidSuccessFuc = this.getDataList; | |||
} | |||
console.log(wx.getSystemInfoSync().windowHeight) | |||
this.setData({ | |||
scrollHig: wx.getSystemInfoSync().windowHeight-44-12, | |||
}); | |||
}, | |||
getDataList:function(type,hotType){ | |||
if(type || hotType){ | |||
this.data.type = type | |||
this.data.hotType = hotType | |||
}else{ | |||
this.data.type = "" | |||
this.data.hotType = 2 | |||
} | |||
let params = { | |||
list_type:2, | |||
cur_page:this.data.pageNum, | |||
show_num:this.data.count, | |||
item_type:this.data.type, | |||
item_state:1, | |||
hot_state:this.data.hotType | |||
} | |||
app.wxRequest(app.globalData.httpUrl + 'front/sell/listing', params, e => { | |||
console.log(e) | |||
if (e.code == 200) { | |||
for(var i=0;i<e.data.length;i++){ | |||
this.data.newData.push(e.data[i]); | |||
} | |||
this.setData({ | |||
dataList:this.data.newData | |||
}) | |||
this.data.total_page = e.total_page; | |||
} | |||
}, this) | |||
}, | |||
getBot:function(){//scroll触底事件 | |||
if(this.data.pageNum<this.data.total_page){ | |||
this.data.pageNum++; | |||
this.getDataList(); | |||
}else{ | |||
wx.showToast({ | |||
title: '没有更多数据了', | |||
icon:"none" | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
}, | |||
chooseFn: function(e){//选择 | |||
this.setData({ | |||
chooseWhich:e.currentTarget.dataset.index | |||
}) | |||
console.log(this.data.chooseWhich) | |||
if(this.data.chooseWhich==1){ | |||
this.data.type = ""; | |||
this.data.hotType = 2; | |||
}else{ | |||
this.data.type = this.data.chooseWhich-1; | |||
this.data.hotType = ""; | |||
} | |||
this.data.pageNum = 1; | |||
this.data.dataList = []; | |||
this.data.newData = []; | |||
this.getDataList(this.data.type,this.data.hotType); | |||
}, | |||
skipPage:function(e){//跳转到购买页面 | |||
var id = e.currentTarget.dataset.id | |||
var type = e.currentTarget.dataset.type | |||
console.log(e) | |||
wx.navigateTo({ | |||
url: '../buyTicket/buyTicket?id=' + id+"&type="+type | |||
}) | |||
}, | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "券中心" | |||
} |
@@ -0,0 +1,34 @@ | |||
<!--pages/ticketCenter/ticketCenter.wxml--> | |||
<view class="all"> | |||
<view class="choose"> | |||
<view class="hotSell" data-index="1" bindtap="chooseFn" style="color:{{chooseWhich==1?'#333333':'#999999'}}">热卖</view> | |||
<view class="replace" data-index="2" bindtap="chooseFn" style="color:{{chooseWhich==2?'#333333':'#999999'}}">代金券</view> | |||
<view class="cuisine" data-index="3" bindtap="chooseFn" style="color:{{chooseWhich==3?'#333333':'#999999'}}">菜品券</view> | |||
<view class="yellow" style="left:{{chooseWhich==1?'55rpx':chooseWhich==2?'316rpx':'594rpx'}}"></view> | |||
</view> | |||
<scroll-view scroll-y class="scrollView" bindscrolltolower="getBot" style="height:{{scrollHig}}px"> | |||
<view class="ticketAll" wx:for="{{dataList}}"> | |||
<view class="ticketleft"> | |||
<image src="{{item.coupon_img_small}}"></image> | |||
</view> | |||
<view class="ticketRig"> | |||
<view class="ticket-title">{{item.coupon_name_detail}}</view> | |||
<view class="ticket-desc">{{item.coupon_memo}}</view> | |||
<view class="ticket-name"> | |||
<view class="ticket-name-left"> | |||
<view wx:if="{{item.item_type==1}}" class="yelloword">{{item.original_price}}元代金券</view> | |||
<view wx:if="{{item.item_type==2}}" style="display:flex;justify-content:flex-start;align-items:center"> | |||
<view class="yelloword" style="color:#999999;border:1px solid #999999;margin-right:8rpx">原价:{{item.original_price}}元</view> | |||
<view class="yelloword">券价:{{item.coupon_price}}元</view> | |||
</view> | |||
<view class="validity">有效期:{{item.duration}}</view> | |||
</view> | |||
<view class="shoping" bindtap="skipPage" data-id="{{item.coupon_sell_id}}" data-type="{{item.item_type}}">购买</view> | |||
</view> | |||
</view> | |||
<view class="circle circle1"></view> | |||
<view class="circle circle2"></view> | |||
</view> | |||
</scroll-view> | |||
</view> |
@@ -0,0 +1,127 @@ | |||
/* pages/ticketCenter/ticketCenter.wxss */ | |||
page,.all{ | |||
width: 100%; | |||
height:100%; | |||
background:rgba(250,250,250,1); | |||
} | |||
.choose{ | |||
width: 100%; | |||
height: 88rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
padding: 0 71rpx; | |||
box-sizing: border-box; | |||
background-color: #ffffff; | |||
position: relative; | |||
} | |||
.choose view{ | |||
font-size:28rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(153,153,153,1); | |||
} | |||
.yellow{ | |||
width: 88rpx; | |||
height: 8rpx; | |||
background-color: #FF7615; | |||
border-radius:4px; | |||
position: absolute; | |||
top: 78rpx; | |||
left: 55rpx; | |||
transition: left 0.5s; | |||
} | |||
.ticketAll{ | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
margin-bottom: 24rpx; | |||
/* overflow: hidden; */ | |||
position: relative; | |||
} | |||
.ticketAll .circle{ | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
position: absolute; | |||
left: 200rpx; | |||
background:rgba(250,250,250,1); | |||
/* background:red; */ | |||
} | |||
.circle1{ | |||
top: -20rpx; | |||
} | |||
.circle2{ | |||
bottom: -20rpx; | |||
} | |||
.ticketleft,.ticketleft image{ | |||
width: 220rpx; | |||
height: 220rpx; | |||
border-radius: 20rpx; | |||
} | |||
.ticketRig{ | |||
background-color: #ffffff; | |||
width: 466rpx; | |||
height: 220rpx; | |||
border-radius: 20rpx; | |||
padding: 31rpx 24rpx 34rpx 24rpx; | |||
box-sizing: border-box; | |||
box-shadow: -10rpx 10rpx 10rpx 0rpx #f2f2f2; | |||
} | |||
.ticket-title{ | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(106,10,14,1); | |||
} | |||
.ticket-desc{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:400; | |||
color:rgba(51,51,51,1); | |||
} | |||
.yelloword{ | |||
width: 144rpx; | |||
height: 36rpx; | |||
text-align: center; | |||
line-height: 36rpx; | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(235,97,0,1); | |||
border: 1px solid #EB6100; | |||
border-radius: 18px; | |||
margin: 15rpx 0; | |||
} | |||
.validity{ | |||
font-size:20rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:300; | |||
color:rgba(153,153,153,1); | |||
} | |||
.ticket-name{ | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: flex-end; | |||
} | |||
.shoping{ | |||
width:110rpx; | |||
height:60rpx; | |||
text-align: center; | |||
line-height: 60rpx; | |||
background:rgba(235,97,0,1); | |||
border-radius:30px; | |||
font-size:30rpx; | |||
font-family:Source Han Sans CN; | |||
font-weight:500; | |||
color:rgba(255,255,255,1); | |||
} | |||
.scrollView{ | |||
width: 100%; | |||
padding: 32rpx; | |||
padding-bottom: 0; | |||
box-sizing: border-box; | |||
} |
@@ -4,7 +4,7 @@ | |||
"ignore": [] | |||
}, | |||
"setting": { | |||
"urlCheck": true, | |||
"urlCheck": false, | |||
"es6": true, | |||
"postcss": true, | |||
"minified": true, | |||
@@ -18,7 +18,9 @@ | |||
"ignore": [], | |||
"disablePlugins": [], | |||
"outputPath": "" | |||
} | |||
}, | |||
"useCompilerModule": false, | |||
"userConfirmedUseCompilerModuleSwitch": false | |||
}, | |||
"compileType": "miniprogram", | |||
"libVersion": "2.10.2", | |||
@@ -52,13 +54,20 @@ | |||
"list": [ | |||
{ | |||
"id": 0, | |||
"name": "购券大厅", | |||
"name": "首页", | |||
"pathName": "pages/index/index", | |||
"query": "", | |||
"scene": null | |||
}, | |||
{ | |||
"id": 0, | |||
"name": "券中心", | |||
"pathName": "pages/ticketCenter/ticketCenter", | |||
"query": "", | |||
"scene": null | |||
}, | |||
{ | |||
"id": 0, | |||
"name": "购买优惠券", | |||
"pathName": "pages/buyTicket/buyTicket", | |||
"query": "", | |||
@@ -105,6 +114,20 @@ | |||
"pathName": "pages/receiveTicket/receiveTicket", | |||
"query": "", | |||
"scene": null | |||
}, | |||
{ | |||
"id": 0, | |||
"name": "我的代金券", | |||
"pathName": "pages/myReplace/myReplace", | |||
"query": "", | |||
"scene": null | |||
}, | |||
{ | |||
"id": 0, | |||
"name": "我的积分", | |||
"pathName": "pages/addScore/addScore", | |||
"query": "", | |||
"scene": null | |||
} | |||
] | |||
} |