| @@ -619,20 +619,6 @@ Page({ | |||
| this.setData({ | |||
| mallList: mallList | |||
| }) | |||
| // if (res.data && res.data.length) { | |||
| // let merchantVoList = res.data | |||
| // let idList = [] | |||
| // merchantVoList.map(item => { | |||
| // idList.push(item.id) | |||
| // }) | |||
| // this.setData({ | |||
| // idList: idList | |||
| // }) | |||
| // this.getCouponList(idList) //获取推荐列表 | |||
| // } | |||
| // this.setData({ | |||
| // merchantVoList: res.data | |||
| // }) | |||
| }) | |||
| }, | |||
| @@ -6,94 +6,111 @@ const util = require("../../../utils/util"); | |||
| Page({ | |||
| data: { | |||
| navigationBarHeight, | |||
| boatLsit:[ | |||
| { | |||
| name:"未使用", | |||
| value:"0" | |||
| boatLsit: [{ | |||
| name: "未使用", | |||
| value: "0" | |||
| }, | |||
| { | |||
| name:"已使用", | |||
| value:"1" | |||
| name: "已使用", | |||
| value: "1" | |||
| }, | |||
| { | |||
| name:"已过期", | |||
| value:"2" | |||
| name: "已过期", | |||
| value: "2" | |||
| }, | |||
| { | |||
| name:"已退款", | |||
| value:"3" | |||
| name: "已退款", | |||
| value: "3" | |||
| }, | |||
| ], | |||
| boatFlag:"0", | |||
| content:"", | |||
| boatFlag: "0", | |||
| content: "", | |||
| loading: false, //"上拉加载"的变量,默认false,隐藏 | |||
| pageNum:1, | |||
| pageNum: 1, | |||
| allow_load: true, | |||
| list:[], | |||
| list: [], | |||
| shopList: [], | |||
| index: 0, | |||
| mallTenantId: '' | |||
| }, | |||
| setBoatFlag(e){ | |||
| setBoatFlag(e) { | |||
| let index = e.currentTarget.dataset.index | |||
| console.log(index); | |||
| this.setData({ | |||
| boatFlag:index, | |||
| pageNum:1, | |||
| list:[], | |||
| boatFlag: index, | |||
| pageNum: 1, | |||
| list: [], | |||
| allow_load: true, | |||
| loading: false, //"上拉加载"的变量,默认false,隐藏 | |||
| }) | |||
| this.getList() | |||
| }, | |||
| getList(){ | |||
| bindPickerChange(e) { | |||
| const index = e.detail.value | |||
| const mallTenantId = this.data.shopList[index].tenantId | |||
| tt.setStorageSync('mallTenantId', mallTenantId) | |||
| tt.setStorageSync('mallIndex', index) | |||
| this.setData({ | |||
| index: index, | |||
| mallTenantId: mallTenantId, | |||
| allow_load: true | |||
| }); | |||
| console.log(this.data.mallTenantId); | |||
| this.getList(this.data.boatFlag, 1); | |||
| }, | |||
| getList() { | |||
| let that = this | |||
| if (that.data.allow_load) { | |||
| that.setData({ | |||
| loading: true, | |||
| content: '小主,我在玩命加载中...' | |||
| }) | |||
| const mallTenantId = tt.getStorageSync('mallTenantId') | |||
| Http.get({ | |||
| url:config.api.couponOrderList, | |||
| data:{ | |||
| pageNum:that.data.pageNum, | |||
| url: config.api.couponOrderList, | |||
| data: { | |||
| pageNum: that.data.pageNum, | |||
| pageSize: 10, | |||
| couponOrderStatus:that.data.boatFlag=="all"?"":that.data.boatFlag, | |||
| couponOrderStatus: that.data.boatFlag == "all" ? "" : that.data.boatFlag, | |||
| mallTenantId: mallTenantId || that.data.mallTenantId | |||
| } | |||
| }).then(res=>{ | |||
| if(that.data.pageNum==1){ | |||
| }).then(res => { | |||
| if (that.data.pageNum == 1) { | |||
| that.setData({ | |||
| list: [] | |||
| }) | |||
| } | |||
| let tempArr= that.data.list | |||
| if(tempArr.length>0){ | |||
| tempArr.map(item=>{ | |||
| let tempArr = that.data.list | |||
| if (tempArr.length > 0) { | |||
| tempArr.map(item => { | |||
| item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd "); | |||
| }) | |||
| } | |||
| if(that.data.pageNum>=res.data.pages){ | |||
| if (that.data.pageNum >= res.data.pages) { | |||
| that.setData({ | |||
| allow_load: false | |||
| }) | |||
| } | |||
| if(that.data.pageNum>1){//分页 | |||
| if (that.data.pageNum > 1) { //分页 | |||
| that.setData({ | |||
| list: res.data.list?[...tempArr ,...res.data.list]:tempArr, | |||
| loading:false | |||
| list: res.data.list ? [...tempArr, ...res.data.list] : tempArr, | |||
| loading: false | |||
| }) | |||
| }else{ | |||
| let tempLsit = res.data.list?res.data.list:[] | |||
| if(tempLsit.length>0){ | |||
| tempLsit.map(item=>{ | |||
| } else { | |||
| let tempLsit = res.data.list ? res.data.list : [] | |||
| if (tempLsit.length > 0) { | |||
| tempLsit.map(item => { | |||
| item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd"); | |||
| }) | |||
| } | |||
| that.setData({ | |||
| list: tempLsit, | |||
| loading:false | |||
| loading: false | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| @@ -102,7 +119,7 @@ Page({ | |||
| icon: "none" | |||
| }); | |||
| }) | |||
| }else { | |||
| } else { | |||
| that.setData({ | |||
| loading: true, | |||
| content: "——— 再拉裤子就掉了啦 ———" | |||
| @@ -113,21 +130,31 @@ Page({ | |||
| }) | |||
| }, 1400) | |||
| } | |||
| }, | |||
| onLoad: function (options) { | |||
| Http.get({ | |||
| url: '/mall/subMall?isAll=1', | |||
| }).then(res => { | |||
| this.setData({ | |||
| shopList: res.data, | |||
| mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId | |||
| }); | |||
| console.log(this.data.shopList, 'list'); | |||
| }).catch(err => { | |||
| console.log(err, 'err'); | |||
| }) | |||
| }, | |||
| onReachBottom(){//触底 | |||
| onReachBottom() { //触底 | |||
| console.log(111); | |||
| this.setData({ | |||
| pageNum:this.data.pageNum+1 | |||
| pageNum: this.data.pageNum + 1 | |||
| }) | |||
| this.getList() | |||
| }, | |||
| onShow:function(){ | |||
| }, | |||
| onShow: function () { | |||
| this.getList() | |||
| } | |||
| } | |||
| }) | |||
| @@ -2,7 +2,7 @@ | |||
| <!-- <navbar back home text="我的券包" background='#fff' color="#000"></navbar> | |||
| <view style="height:{{navigationBarHeight}} "></view> --> | |||
| <view class="boatBoxf" > | |||
| <view class="boatBoxf"> | |||
| <view class="boatBox"> | |||
| <view class="boatItemBox" tt:for="{{boatLsit}}" tt:key="index" bindtap="setBoatFlag" data-index="{{index}}"> | |||
| <view class="{{boatFlag==item.value? 'boatTitleA':'boatTitle'}}">{{item.name}}</view> | |||
| @@ -12,6 +12,18 @@ | |||
| </view> | |||
| <view style="height:90rpx "></view> | |||
| <view class="picker" tt:if="{{shopList.length>1}}"> | |||
| <picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{shopList}}" range-key="name" | |||
| disabled="{{false}}"> | |||
| <view class="inside"> | |||
| <view class="picker_item"> | |||
| {{shopList[index].name}} | |||
| </view> | |||
| <image class="img" src="/assets/itemImg/chevron.png"></image> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="ticketList" tt:for="{{list}}" tt:key="{{index}}"> | |||
| <view class="ticketItem"> | |||
| <view class="shopImg"> | |||
| @@ -42,4 +54,4 @@ | |||
| </view> | |||
| </view> | |||
| <tabbar tt:if="{{ifshowtab}}"/> | |||
| <tabbar tt:if="{{ifshowtab}}" /> | |||
| @@ -1,66 +1,91 @@ | |||
| .boatBoxf{ | |||
| .boatBoxf { | |||
| width: 100%; | |||
| height: 90rpx; | |||
| position: fixed; | |||
| top: 0; | |||
| left: 0; | |||
| } | |||
| .boatBox{ | |||
| width: 100%; | |||
| height: 90rpx; | |||
| display: flex; | |||
| justify-content: space-around; | |||
| background-color: #fff; | |||
| } | |||
| .boatTitle{ | |||
| font-size: 30rpx; | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| color: #999; | |||
| } | |||
| .boatTitleA{ | |||
| font-size: 32rpx; | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| font-weight: 500; | |||
| } | |||
| .boatA{ | |||
| width: 80rpx; | |||
| height: 6rpx; | |||
| background-color: #fb3e5c; | |||
| margin: 0 auto; | |||
| border-radius: 20rpx; | |||
| } | |||
| .ticketList{ | |||
| width: 90%; | |||
| margin: 20rpx auto ; | |||
| overflow: hidden; | |||
| } | |||
| .ticketItem{ | |||
| float: left; | |||
| background-color: #fff; | |||
| border-radius: 20rpx; | |||
| width: 80%; | |||
| height: 140rpx; | |||
| overflow: hidden; | |||
| } | |||
| .useBtn{ | |||
| float: left; | |||
| border-radius: 20rpx; | |||
| width: 20%; | |||
| height: 140rpx; | |||
| line-height: 140rpx; | |||
| text-align: center; | |||
| color: #FFFFFF; | |||
| font-size: 30rpx; | |||
| background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%) | |||
| } | |||
| .nouseBtn{ | |||
| .boatBox { | |||
| width: 100%; | |||
| height: 90rpx; | |||
| display: flex; | |||
| justify-content: space-around; | |||
| background-color: #fff; | |||
| } | |||
| .boatTitle { | |||
| font-size: 30rpx; | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| color: #999; | |||
| } | |||
| .boatTitleA { | |||
| font-size: 32rpx; | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| font-weight: 500; | |||
| } | |||
| .picker { | |||
| margin-top: 25rpx; | |||
| padding: 25rpx 45rpx; | |||
| margin-bottom: 15rpx; | |||
| background-color: #fff; | |||
| } | |||
| .picker .inside { | |||
| display: flex; | |||
| justify-content: space-between; | |||
| } | |||
| .picker .inside .img { | |||
| width: 20rpx; | |||
| height: 40rpx; | |||
| } | |||
| .boatA { | |||
| width: 80rpx; | |||
| height: 6rpx; | |||
| background-color: #fb3e5c; | |||
| margin: 0 auto; | |||
| border-radius: 20rpx; | |||
| } | |||
| .ticketList { | |||
| width: 90%; | |||
| margin: 20rpx auto; | |||
| overflow: hidden; | |||
| } | |||
| .ticketItem { | |||
| float: left; | |||
| background-color: #fff; | |||
| border-radius: 20rpx; | |||
| width: 80%; | |||
| height: 140rpx; | |||
| overflow: hidden; | |||
| } | |||
| .useBtn { | |||
| float: left; | |||
| border-radius: 20rpx; | |||
| width: 20%; | |||
| height: 140rpx; | |||
| line-height: 140rpx; | |||
| text-align: center; | |||
| color: #FFFFFF; | |||
| font-size: 30rpx; | |||
| background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%) | |||
| } | |||
| .nouseBtn { | |||
| float: left; | |||
| border-radius: 20rpx; | |||
| width: 20%; | |||
| @@ -72,122 +97,129 @@ | |||
| background: #CECECE; | |||
| } | |||
| .shopImg{ | |||
| width: 88rpx; | |||
| height: 88rpx; | |||
| border: 1px solid #f8f8f8; | |||
| border-radius: 50rpx; | |||
| margin-left: 20rpx; | |||
| margin-top: 30rpx; | |||
| float: left; | |||
| .shopImg { | |||
| width: 88rpx; | |||
| height: 88rpx; | |||
| border: 1px solid #f8f8f8; | |||
| border-radius: 50rpx; | |||
| margin-left: 20rpx; | |||
| margin-top: 30rpx; | |||
| float: left; | |||
| } | |||
| .shopImg image{ | |||
| .shopImg image { | |||
| width: 100%; | |||
| height: 100%; | |||
| border: 1px solid #f8f8f8; | |||
| border-radius: 50rpx; | |||
| } | |||
| .ticketData{ | |||
| margin-left: 20rpx; | |||
| overflow: hidden; | |||
| float: left; | |||
| .ticketData { | |||
| margin-left: 20rpx; | |||
| overflow: hidden; | |||
| float: left; | |||
| } | |||
| .ticketTitle{ | |||
| font-size: 32rpx; | |||
| margin-top: 30rpx; | |||
| white-space: nowrap; | |||
| text-overflow: ellipsis; | |||
| overflow: hidden; | |||
| width: 270rpx; | |||
| .ticketTitle { | |||
| font-size: 32rpx; | |||
| margin-top: 30rpx; | |||
| white-space: nowrap; | |||
| text-overflow: ellipsis; | |||
| overflow: hidden; | |||
| width: 270rpx; | |||
| } | |||
| .date{ | |||
| font-size: 22rpx; | |||
| margin-top: 10rpx; | |||
| .date { | |||
| font-size: 22rpx; | |||
| margin-top: 10rpx; | |||
| } | |||
| .date::before{ | |||
| content: "有效期至:"; | |||
| font-size: 26rpx; | |||
| .date::before { | |||
| content: "有效期至:"; | |||
| font-size: 26rpx; | |||
| } | |||
| .loading { | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| font-size: 26rpx; | |||
| color: #999; | |||
| } | |||
| .loading image { | |||
| width: 60rpx; | |||
| height: 60rpx; | |||
| vertical-align: middle; | |||
| margin-right: 10rpx; | |||
| } | |||
| .dingdan { | |||
| margin-top: 33rpx; | |||
| } | |||
| .dingdan text:nth-of-type(1) { | |||
| display: block; | |||
| font-size: 34rpx; | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| text-align: center; | |||
| } | |||
| .dingdan text:nth-of-type(2) { | |||
| display: block; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| letter-spacing: 0; | |||
| text-align: center; | |||
| } | |||
| .dingdan image { | |||
| display: block; | |||
| width: 300rpx; | |||
| height: 300rpx; | |||
| margin: 0 auto 16rpx; | |||
| } | |||
| .wait{ | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| overflow: visible!important; | |||
| font-size: 28rpx; | |||
| color: #FD832D; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 28rpx!important; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| .sucess { | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| /* overflow: hidden; */ | |||
| font-family:PingFangSC-Regular; | |||
| font-size: 28rpx; | |||
| font-weight:400; | |||
| color: #2C8DFF; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 26px; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| .close { | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| overflow: hidden; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 28rpx; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| text-align: center; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| font-size: 26rpx; | |||
| color: #999; | |||
| } | |||
| .loading image { | |||
| width: 60rpx; | |||
| height: 60rpx; | |||
| vertical-align: middle; | |||
| margin-right: 10rpx; | |||
| } | |||
| .dingdan { | |||
| margin-top: 33rpx; | |||
| } | |||
| .dingdan text:nth-of-type(1) { | |||
| display: block; | |||
| font-size: 34rpx; | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| text-align: center; | |||
| } | |||
| .dingdan text:nth-of-type(2) { | |||
| display: block; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| letter-spacing: 0; | |||
| text-align: center; | |||
| } | |||
| .dingdan image { | |||
| display: block; | |||
| width: 300rpx; | |||
| height: 300rpx; | |||
| margin: 0 auto 16rpx; | |||
| } | |||
| .wait { | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| overflow: visible !important; | |||
| font-size: 28rpx; | |||
| color: #FD832D; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 28rpx !important; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| .sucess { | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| /* overflow: hidden; */ | |||
| font-family: PingFangSC-Regular; | |||
| font-size: 28rpx; | |||
| font-weight: 400; | |||
| color: #2C8DFF; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 26px; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| .close { | |||
| display: inline-block; | |||
| width: 123rpx !important; | |||
| overflow: hidden; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| letter-spacing: 0; | |||
| text-align: right; | |||
| line-height: 28rpx; | |||
| float: right; | |||
| margin: 20rpx; | |||
| } | |||
| @@ -21,11 +21,9 @@ | |||
| </view> | |||
| <image class="img" src="/assets/itemImg/chevron.png"></image> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view> | |||
| <view tt:for='{{list}}' tt:if="{{list.length!=0}}" class='section' tt:key='index'> | |||
| <view class='detail_top'> | |||