Initial Commit

This commit is contained in:
quantulr
2024-05-06 15:34:15 +08:00
commit e3a0666d5a
307 changed files with 28969 additions and 0 deletions

121
pages/my/my_bill/my_bill.js Normal file
View File

@ -0,0 +1,121 @@
// pages/my/my_bill/my_bill.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
typeActive:0,
state:0,//0全部 1套餐券 2折扣券 3现金券 4积分 5微信支付
typeShow:false,
name:'全部',
type:[
{name:'全部',state:0},
{name:'套餐券',state:1},
{name:'折扣券',state:2},
{name:'现金券',state:3},
{name:'积分',state:4},
{name:'微信支付',state:5},
],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.dataList()
},
//分类显示
typeShow(){
this.setData({
typeShow:true
})
},
typeActive(e){
let index = e.currentTarget.dataset.index;
let name = e.currentTarget.dataset.name;
let state = e.currentTarget.dataset.state;
this.setData({
typeActive:index,
name:name,
typeShow:false,
state:state,
})
this.dataList()
},
dataList(e){
wx.showLoading({
title: '加载中..',
})
wx.request({
url: app.globalData.ip + '/wisdommining/api/user/getBill',
method: 'GET',
header: {
"content-type": "application/x-www-form-urlencoded",
},
data: {
userId: app.globalData.userId,
category:this.data.state
},
success: res => {
wx.hideLoading()
console.log(res)
if (res.data.code == 1) {
this.setData({
dataList: res.data.value,
})
} else {
wx.showModal({
title: '提示!',
content: res.data.message,
showCancel: false,
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的账单"
}

View File

@ -0,0 +1,57 @@
<!--pages/my/my_bill/my_bill.wxml-->
<view style='height:30rpx;background-color:#f5f5f5;'></view>
<view class="all">
<view class="title display_J_B display_A_C">
<view class="title-l">账户明细</view>
<view class="title-r display_A_C" catchtap="typeShow">{{name}} <image src="/icon/right.png"></image>
</view>
<view class="t-type__all" wx:if='{{typeShow}}'>
<view class="t-type {{typeActive==index?'t-type__active':''}}" catchtap="typeActive" data-index='{{index}}'
data-name='{{item.name}}' data-state='{{item.state}}' wx:for='{{type}}' wx:key='index'>{{item.name}}</view>
</view>
</view>
<view class="cont display_J_B" wx:for='{{dataList}}' wx:key='index'>
<view class="cont-l">
<view class="content GStitleOne">{{item.billIntroduction}}</view>
<view class="number" wx:if="{{item.billOrderNumber}}">订单编号:{{item.billOrderNumber}}</view>
<view class="time">{{item.createTime}}</view>
</view>
<!-- 套餐券 -->
<view class="cont-r" wx:if="{{item.billCategory==1}}">
<view class="type">套餐券1张</view>
<view class="state">已使用</view>
</view>
<!-- 折扣券 -->
<view class="cont-r" wx:if="{{item.billCategory==2}}">{{}}
<view class="type">{{item.billType==1?'+':'-'}}¥{{item.billDiscount}}折扣券{{item.billPay==0||item.billPay==null?'':'+¥'+item.billPay+'微信支付'}}</view>
<view class="state">{{item.billType==1?'收入':'支出'}}</view>
</view>
<!-- 现金券 -->
<view class="cont-r" wx:if="{{item.billCategory==3}}">
<view class="type">{{item.billType==1?'+':'-'}}¥{{item.billVolume}}现金券{{item.billPay==0||item.billPay==null?'':'+¥'+item.billPay+'微信支付'}}</view>
<view class="state">{{item.billType==1?'收入':'支出'}}</view>
</view>
<!-- 积分 -->
<view class="cont-r" wx:if="{{item.billCategory==4}}">
<view class="type type_1">{{item.billType==1?'+':'-'}}{{item.billIntegral}}积分</view>
<view class="state">{{item.billType==1?'收入':'支出'}}</view>
</view>
<!-- 分享得积分 -->
<view class="cont-r" wx:if="{{item.billCategory==44}}">
<view class="type type_1">{{item.billType==1?'+':'-'}}{{item.billIntegral}}积分</view>
<view class="state">{{item.billType==1?'收入':'支出'}}</view>
</view>
<!-- 微信支付 -->
<view class="cont-r" wx:if="{{item.billCategory==5}}">
<view class="type">{{item.billType==1?'+':'-'}}¥{{item.billPay}}</view>
<view class="state">{{item.billType==1?'收入':'支出'}}</view>
</view>
<!-- 分润 -->
<view class="cont-r" wx:if="{{item.billCategory==6}}">
<view class="type">+¥{{item.billBalance==null?'0':item.billBalance}}</view>
<view class="state">已到账</view>
</view>
</view>
<view class="empty" wx:if="{{dataList.length==0}}">暂无记录~</view>
</view>

View File

@ -0,0 +1,115 @@
/* pages/my/my_bill/my_bill.wxss */
.all {
width: 690rpx;
padding: 0 30rpx;
}
.title {
width: 100%;
height: 90rpx;
position: relative;
}
.title-l {
font-size: 32rpx;
color: #333333;
}
.title-r {
font-size: 24rpx;
letter-spacing: 1rpx;
color: #333333;
}
.title-r image {
width: 30rpx;
height: 30rpx;
}
.t-type__all {
width: 150rpx;
background-color: #ffffff;
border-radius: 10rpx;
border: solid 1rpx #e5e5e5;
position: absolute;
right: 0;
top: 90rpx;
}
.t-type {
height: 54rpx;
line-height: 54rpx;
text-align: center;
font-size: 24rpx;
letter-spacing: 1rpx;
color: #333333;
border-bottom: solid 1rpx #e5e5e5;
}
.t-type__active{
color: #ee7b1e;
}
.t-type:first-child {
border-radius: 10rpx 10rpx 0 0;
}
.t-type:last-child {
border-radius: 0 0 10rpx 10rpx;
border-bottom: none;
}
.cont{
margin: 0 auto 30rpx;
width: 650rpx;
background-color: #fefaf6;
border-radius: 10rpx;
padding: 20rpx;
}
.cont-l{
width: 400rpx;
}
.content{
font-size: 24rpx;
color: #333333;
margin: 20rpx 0;
width: 400rpx;
}
.number{
margin-bottom: 15rpx;
font-size: 20rpx;
color: #999999;
}
.time{
font-size: 20rpx;
color: #999999;
}
.cont-r{
width:250rpx;
display: flex;
flex-wrap: wrap;
align-content: flex-end;
text-align: right;
}
.type{
font-size: 24rpx;
color: #333333;
width:250rpx;
}
.type_1{
color: #ee7b1e;
}
.state{
font-size: 24rpx;
color: #999999;
margin-top: 30rpx;
width:250rpx;
}
.empty{
font-size: 28rpx;
letter-spacing: 3rpx;
color: #999;
text-align: center;
margin: 150rpx 0;
}