锶源昆仑会员+体验官

This commit is contained in:
2023-07-22 19:04:56 +08:00
commit 5a6b3517e6
439 changed files with 20654 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
couponArr : [], //抵值券
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
couponId: options.couponid
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取我的抵值券
this.couponInfo();
},
// 我的抵值券
couponInfo(page){
wx.$api.user.couponList(this.data.couponId,{
page : page || 1
}).then(res => {
let listArr = this.data.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
couponArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取我的抵值券
this.couponInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "抵值券"
}

View File

@@ -0,0 +1,50 @@
<view class="list" wx:if="{{couponArr.length > 0}}">
<view class="item" wx:for="{{couponArr}}" wx:key="index">
<view class="item-label {{item.status.status != 1 ? 'active' : ''}}" wx:if="{{item.status}}">
<image class="tipsImg {{item.status.status != 1 ? 'active' : ''}}" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/coupons_tips.png" mode="widthFix"></image>
<view class="top">
<view class="left">
<view class="name">
{{item.title}}
</view>
<view class="time {{item.status.status != 1 ? 'active' : ''}}">
{{item.time.end_at}} 到期
</view>
</view>
<view class="right {{item.status.status != 1 ? 'active' : ''}}">
<view class="right-prop">
<text>¥</text>{{item.price}}
</view>
<view class="right-tips">
{{item.price_text}}
</view>
</view>
</view>
<view class="bottom {{item.status.status != 1 ? 'active' : ''}}">
<view class="tips {{item.status.status != 1 ? 'active' : ''}}">
开通季卡会员可低值
</view>
<block wx:if="{{item.status}}">
<navigator hover-class="none" url="/pages/member/index/index" class="btn" wx:if="{{item.status.status == 1}}">
立即使用
</navigator>
<view class="btn active" wx:if="{{item.status.status == 2}}">
{{item.status.text}}
</view>
</block>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,150 @@
page {
padding: 30rpx;
box-sizing: border-box;
background-color: #f5f5f5;
}
.item-label {
border-radius: 30rpx;
padding: 50rpx 40rpx 20rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
position: relative;
box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1);
background-image: linear-gradient(to top right, #f9e3b4, #ecc685);
}
.item-label.active {
background-image: linear-gradient(to top right, #c9c9c9, #b5b5b5);
}
.item-label::after,
.item-label::before {
position: absolute;
content: '';
background-color: #f5f5f5;
width: 30rpx;
height: 30rpx;
bottom: 84rpx;
border-radius: 50%;
}
.item-label::after {
left: -15rpx;
}
.item-label::before {
right: -15rpx;
}
.tipsImg {
position: absolute;
top: 0;
left: 30rpx;
width: 170rpx;
}
.tipsImg.active {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.top {
margin-bottom: 20rpx;
display: flex;
}
.left {
flex: 1;
font-weight: 600;
}
.name {
margin-bottom: 15rpx;
font-size: 34rpx;
margin-top: 10rpx;
}
.time {
background-color: #f6d4a6;
font-size: 26rpx;
display: inline-block;
color: #eb5941;
line-height: 48rpx;
padding: 0 10rpx;
border-radius: 10rpx;
}
.time.active {
background-color: #b1b1b1;
color: #464646;
}
.right {
color: #835529;
}
.right-prop {
font-size: 52rpx;
font-weight: 600;
display: flex;
}
.right-prop text {
font-size: 28rpx;
margin-top: 10rpx;
padding-right: 6rpx;
}
.right-tips {
font-size: 26rpx;
text-align: center;
}
.right.active {
color: #464646;
}
.bottom {
border-top: 2rpx dashed #dfc796;
display: flex;
font-size: 28rpx;
padding-top: 20rpx;
margin-top: 30rpx;
}
.bottom.active {
border-color: #adadad;
}
.tips {
color: #b18c5d;
line-height: 58rpx;
flex: 1;
}
.tips.active {
color: #464646;
}
.btn {
background-image: linear-gradient(to right, #d8a76a, #b37a3e);
border-radius: 70rpx;
color: #ffffff;
padding: 0 30rpx;
height: 58rpx;
line-height: 58rpx;
font-weight: 600;
border: 2rpx solid #c38d4c;
}
.btn.active {
background-image: linear-gradient(to right, #8f8f8f, #a7a7a7);
color: #000;
border-color: #a7a7a7;
}

View File

@@ -0,0 +1,72 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
couponArr : [], //抵值券
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 我的抵值券
*/
couponInfo(page){
wx.$api.user.coupon({
page : page || 1
}).then(res => {
let listArr = this.data.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.lists)
this.setData({
couponArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取我的抵值券
this.couponInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "抵值券"
}

View File

@@ -0,0 +1,41 @@
<view class="list" wx:if="{{couponArr.length > 0}}">
<view class="item" wx:for="{{couponArr}}" wx:key="couponArr">
<image class="tipsImg" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/coupons_tips.png" mode="widthFix"></image>
<view class="top">
<view class="left">
<view class="name">
{{item.title}}
</view>
<view class="time" wx:if="{{item.time}}">
{{item.time.interval}}
</view>
</view>
<view class="right">
<view class="right-prop">
<text>¥</text>{{item.price}}
</view>
<view class="right-tips">
{{item.price_text}}
</view>
</view>
</view>
<navigator hover-class="none" url="../list/index?couponid={{item.coupon_id}}" class="bottom">
<view class="tips">
共<text>{{item.coupon_count}}</text>张{{item.title}}
</view>
<image class="arrow" src="/static/icons/coupons_arrow.png"></image>
</navigator>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,114 @@
page {
padding: 30rpx;
box-sizing: border-box;
background-color: #f5f5f5;
}
.item {
border-radius: 30rpx;
padding: 50rpx 40rpx 10rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
position: relative;
box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1);
background-image: linear-gradient(to top right, #f9e3b4, #ecc685);
}
.item::after,
.item::before {
position: absolute;
content: '';
background-color: #f5f5f5;
width: 30rpx;
height: 30rpx;
bottom: 84rpx;
border-radius: 50%;
}
.item::after {
left: -15rpx;
}
.item::before {
right: -15rpx;
}
.tipsImg {
position: absolute;
top: 0;
left: 30rpx;
width: 170rpx;
}
.top {
margin-bottom: 20rpx;
display: flex;
}
.left {
flex: 1;
font-weight: 600;
}
.name {
margin-bottom: 15rpx;
font-size: 34rpx;
margin-top: 10rpx;
}
.time {
background-color: #f6d4a6;
font-size: 26rpx;
display: inline-block;
color: #eb5941;
line-height: 48rpx;
padding: 0 10rpx;
border-radius: 10rpx;
}
.right {
color: #835529;
}
.right-prop {
font-size: 50rpx;
font-weight: 600;
display: flex;
}
.right-prop text {
font-size: 28rpx;
margin-top: 10rpx;
padding-right: 6rpx;
}
.right-tips {
font-size: 26rpx;
text-align: center;
}
.bottom {
border-top: 2rpx dashed #dfc796;
display: flex;
font-size: 28rpx;
padding-top: 20rpx;
margin-top: 30rpx;
}
.tips {
color: #b18c5d;
line-height: 58rpx;
flex: 1;
}
.tips text {
font-weight: 600;
padding: 0 5rpx;
}
.arrow {
width: 32rpx;
height: 32rpx;
margin-top: 10rpx;
}