first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/user/balance/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/user/balance/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
72797958-702a-4874-803a-a2da5bd27707
|
||||
120
衣莎项目/源码/YiShaXiYi/user/balance/balance.js
Normal file
120
衣莎项目/源码/YiShaXiYi/user/balance/balance.js
Normal file
@@ -0,0 +1,120 @@
|
||||
// user/balance/balance.js
|
||||
const app = getApp();
|
||||
const util = app.loadUtils("util")
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
const model = app.loadModel("index")
|
||||
const http = app.loadHttp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
system: app.globalData.system, //设备相关信息
|
||||
pageTitle: "我的余额", //头部标题
|
||||
isBack: true,//显示返回
|
||||
current_scroll: 1,//tab选中
|
||||
cardData: [],//卡列表
|
||||
userInfo: {},//用户信息
|
||||
},
|
||||
// tab切换
|
||||
handleChangeScroll({ detail }) {
|
||||
this.setData({
|
||||
current_scroll: detail.key
|
||||
});
|
||||
this.getUserCard()
|
||||
},
|
||||
// 获取卡劵列表
|
||||
async getUserCard() {
|
||||
let res = await http.http.request2({ url: `${http.api.getCard}`, method: "POST", data: { type: this.data.current_scroll } })
|
||||
let rel = res.data.data
|
||||
if (res.data.status == 1) {
|
||||
rel.map((v, i) => {
|
||||
rel[i].create_time = v.create_time.slice(0, 10)
|
||||
})
|
||||
this.setData({
|
||||
cardData: rel
|
||||
})
|
||||
}
|
||||
if (rel.length <= 0) {
|
||||
wx.showToast({
|
||||
title: '无此会员卡',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
// 跳转页面方法
|
||||
goUrl(e) {
|
||||
let url = e.currentTarget.dataset.url
|
||||
let index = this.data.current_scroll
|
||||
wx.navigateTo({
|
||||
url: `${url}?index=${index}`
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
if (options['index']) {
|
||||
this.setData({
|
||||
current_scroll: options.index
|
||||
})
|
||||
}
|
||||
this.getUserCard()
|
||||
app.setWatching('userInfo', (v) => {
|
||||
this.setData({
|
||||
userInfo: v
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
6
衣莎项目/源码/YiShaXiYi/user/balance/balance.json
Normal file
6
衣莎项目/源码/YiShaXiYi/user/balance/balance.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"i-tabs": "../../extend/iview/dist/tabs/index",
|
||||
"i-tab": "../../extend/iview/dist/tab/index"
|
||||
}
|
||||
}
|
||||
65
衣莎项目/源码/YiShaXiYi/user/balance/balance.wxml
Normal file
65
衣莎项目/源码/YiShaXiYi/user/balance/balance.wxml
Normal file
@@ -0,0 +1,65 @@
|
||||
<!-- 头部 -->
|
||||
<nav-bar isBack="{{isBack}}" pageTitle="{{pageTitle}}" system="{{system}}"></nav-bar>
|
||||
<!-- user/balance/balance.wxml -->
|
||||
<view class="balance">
|
||||
<!-- <view class="balance-tit flex-con2">
|
||||
<view>
|
||||
<view class="balance-tit-p">总金额(元)</view>
|
||||
<view class="balance-tit-mon">{{userInfo.money}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="mt20">
|
||||
<i-tabs current="{{ current_scroll }}" scroll bindchange="handleChangeScroll">
|
||||
<i-tab key="1" title="会员卡"></i-tab>
|
||||
<i-tab key="2" title="礼品卡"></i-tab>
|
||||
<i-tab key="3" title="团体卡"></i-tab>
|
||||
<!-- <i-tab key="4" title="充值卡"></i-tab> -->
|
||||
</i-tabs>
|
||||
</view>
|
||||
<view wx:if="{{cardData.length > 0}}" class="mt20 balance-List">
|
||||
<view class="balance-row mt30" wx:for="{{cardData}}" wx:key>
|
||||
<view class="balance-row-img">
|
||||
<image src="{{item.src}}" />
|
||||
</view>
|
||||
<view class="balance-row-pa flex-con2">
|
||||
<view class="dis-flex pd30 w100">
|
||||
<view class="balance-row-vip nt2">
|
||||
<!-- <image src="/static/img/icon/vip.png" /> -->
|
||||
</view>
|
||||
<view class="flex1 ml10">
|
||||
<view class="balance-row-p1">
|
||||
{{item.title}}{{item.discount>=99.99?'':'('+item.discount/10+'折)'}}
|
||||
</view>
|
||||
<view wx:if="{{item.is_upgrade == 0}}" class="balance-row-p2 mt10">
|
||||
余额 ¥{{item.money}}
|
||||
</view>
|
||||
<view wx:else class="balance-row-p2 mt10">您还不是伊莎洗衣{{item.title}}VIP</view>
|
||||
<view wx:if="{{item.is_upgrade == 0}}" class="balance-row-p2 mt5">
|
||||
发卡时间 {{item.create_time}}
|
||||
</view>
|
||||
<view wx:if="{{item.is_upgrade == 2}}" class="balance-row-p2 mt7">
|
||||
现在购买只需{{item.recharge_money}}元<span wx:if="{{current_scroll==2}}">,并赠送{{item.give_money}}元</span>
|
||||
</view>
|
||||
<!-- <view wx:if="{{item.is_upgrade == 0 && item.level < 4 && current_scroll == 1}}" class="balance-row-p2 mt7">
|
||||
现在升级只需{{item.recharge_money}}元
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="balance-row-sub flex-con6">
|
||||
<view wx:if="{{item.is_upgrade == 2}}" class="balance-row-sub-p flex-con3 colorAsh" data-url="/user/upgradeCart/upgradeCart?type={{current_scroll}}&openType=1&is_upgrade=2" catchtap="goUrl">
|
||||
办卡
|
||||
</view>
|
||||
<view wx:if="{{item.is_upgrade == 0 && current_scroll !== '3' && item.card_id!=29}}" class="balance-row-sub-p flex-con3" data-url="/user/recharge/recharge" catchtap="goUrl">
|
||||
充值
|
||||
</view>
|
||||
<view wx:if="{{item.is_upgrade == 0 && item.level < 4 && current_scroll == '1'}}" class="balance-row-sub-p flex-con3 colorAsh mr30" data-url="/user/upgradeCart/upgradeCart?type={{current_scroll}}&openType=0&is_upgrade=0&card_upgrade={{item.id}}&card_id={{item.card_id}}" catchtap="goUrl">
|
||||
升级
|
||||
</view>
|
||||
<!-- <view class="balance-row-sub-p colorRed">立即充值</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- toasta提示 -->
|
||||
<i-toast id="toast" />
|
||||
116
衣莎项目/源码/YiShaXiYi/user/balance/balance.wxss
Normal file
116
衣莎项目/源码/YiShaXiYi/user/balance/balance.wxss
Normal file
@@ -0,0 +1,116 @@
|
||||
/* user/balance/balance.wxss */
|
||||
|
||||
/* 头部 */
|
||||
|
||||
.balance-tit {
|
||||
width: 750rpx;
|
||||
height: 210rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
border-top: 2rpx solid #ebebeb;
|
||||
}
|
||||
|
||||
.balance-tit-p {
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.balance-tit-mon {
|
||||
font-family: PingFang-SC-Bold;
|
||||
font-size: 55rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
|
||||
.balance-List {
|
||||
background-color: #fff;
|
||||
padding: 10rpx 30rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.balance-row {
|
||||
height: 200rpx;
|
||||
border-radius: 15rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.balance-row-img{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.balance-row-img image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.balance-row-pa{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.balance-row-p1 {
|
||||
font-family: PingFang-SC-Bold;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
font-stretch: normal;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.balance-row-p2 {
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
color: #fff;
|
||||
}
|
||||
.balance-row-vip{
|
||||
padding-top: 5rpx;
|
||||
}
|
||||
.balance-row-vip image {
|
||||
width: 43rpx;
|
||||
height: 43rpx;
|
||||
}
|
||||
|
||||
.balance-row-sub {
|
||||
/* width: 300rpx; */
|
||||
}
|
||||
|
||||
.balance-row-sub-p {
|
||||
width: 115rpx;
|
||||
height: 50rpx;
|
||||
border:solid 2rpx #ffffff;
|
||||
border-radius: 25rpx;
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.colorAsh {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
/* 修改tabs样式 */
|
||||
|
||||
i-tab {
|
||||
width: 33.33%;
|
||||
display: inline-block;
|
||||
}
|
||||
Reference in New Issue
Block a user