first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/user/payment/card/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/user/payment/card/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
3b2418b1-a368-4206-aa08-66d5acbb3c65
|
||||
118
衣莎项目/源码/YiShaXiYi/user/payment/card/card.js
Normal file
118
衣莎项目/源码/YiShaXiYi/user/payment/card/card.js
Normal file
@@ -0,0 +1,118 @@
|
||||
// user/payment/card/card.js
|
||||
const app = getApp();
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
const model = app.loadModel("index")
|
||||
const http = app.loadHttp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
system: app.globalData.system, //设备相关信息
|
||||
pageTitle: "会员卡支付", //头部标题
|
||||
isBack: true,//显示返回
|
||||
current: '1',//当前所在的标签的 key 值
|
||||
cardList: [],//会员卡列表
|
||||
type: '',//1为商城订单
|
||||
},
|
||||
|
||||
// tab选中事件
|
||||
handleChange({ detail }) {
|
||||
this.setData({
|
||||
current: detail.key
|
||||
});
|
||||
this.userCard()
|
||||
},
|
||||
// 获取礼品卡
|
||||
async userCard() {
|
||||
this.setData({
|
||||
cardList: []
|
||||
})
|
||||
let res = await http.http.request2({ url: `${http.api.userCard}/${this.data.current}`, method: "POST", data: { kind: this.data.type } })
|
||||
this.setData({
|
||||
cardList: res.data.data
|
||||
})
|
||||
},
|
||||
// 选择礼品卡
|
||||
async selectGiftCard(e) {
|
||||
let item = e.currentTarget.dataset.item
|
||||
await model.storage.setStorage("itemGiftCard", item)
|
||||
let giftCard = {
|
||||
id: item.id,
|
||||
price: item.discount / 10,
|
||||
title: item.title,
|
||||
logo: item.logo
|
||||
}
|
||||
await model.storage.setStorage("giftCard", giftCard)
|
||||
wx.navigateBack({
|
||||
|
||||
})
|
||||
},
|
||||
// 办卡
|
||||
goCard(){
|
||||
wx.navigateTo({
|
||||
url:`/user/balance/balance?index=${this.data.current}`
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
if (!!options.type) {
|
||||
this.setData({
|
||||
type: options.type
|
||||
})
|
||||
}
|
||||
this.userCard()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
7
衣莎项目/源码/YiShaXiYi/user/payment/card/card.json
Normal file
7
衣莎项目/源码/YiShaXiYi/user/payment/card/card.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTextStyle": "black",
|
||||
"usingComponents": {
|
||||
"i-tabs": "../../../extend/iview/dist/tabs/index",
|
||||
"i-tab": "../../../extend/iview/dist/tab/index"
|
||||
}
|
||||
}
|
||||
113
衣莎项目/源码/YiShaXiYi/user/payment/card/card.wxml
Normal file
113
衣莎项目/源码/YiShaXiYi/user/payment/card/card.wxml
Normal file
@@ -0,0 +1,113 @@
|
||||
<!-- 头部 -->
|
||||
<nav-bar isBack="{{isBack}}" pageTitle="{{pageTitle}}" system="{{system}}"></nav-bar>
|
||||
<!-- user/payment/card/card.wxml -->
|
||||
<view class="card">
|
||||
<view class="order_tab" style="top:{{system.statusHeight+system.titleHeight+'px'}}">
|
||||
<i-tabs current="{{ current }}" scroll color="#1dbf45" bindchange="handleChange">
|
||||
<i-tab key="1" title="会员卡"></i-tab>
|
||||
<i-tab key="2" title="礼品卡"></i-tab>
|
||||
<i-tab key="3" title="团体卡"></i-tab>
|
||||
</i-tabs>
|
||||
</view>
|
||||
<view class="tab_con">
|
||||
<view wx:if="{{current == 1}}" class="con_lsit_card">
|
||||
<view class="list_card mt20" wx:for="{{cardList}}" wx:key="{{index}}" data-item="{{item}}" bind:tap="selectGiftCard">
|
||||
<view class="card_lv">
|
||||
<image src="{{item.src}}" />
|
||||
</view>
|
||||
<view class="card_lv2">
|
||||
<view class="card_text">
|
||||
<view class="text_cen">
|
||||
<view class="text_top">
|
||||
<view class="text_l">
|
||||
<image src="/static/img/icon/vip.png" />
|
||||
<span class="ml10">{{item.title}}</span>
|
||||
</view>
|
||||
<view class="text_r">
|
||||
<span>{{item.discount/10}}</span>
|
||||
折
|
||||
</view>
|
||||
</view>
|
||||
<view class="text_botton mt10">
|
||||
<view class="text_botton_l">发卡时间 {{item.create_time}}</view>
|
||||
<view class="text_botton_r">余额 ¥{{item.money}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{current == 2}}" class="con_lsit_card" wx:for="{{cardList}}" wx:key="{{index}}" data-item="{{item}}" bind:tap="selectGiftCard">
|
||||
<view class="list_card mt20">
|
||||
<view class="card_lv">
|
||||
<image src="{{item.src}}" />
|
||||
</view>
|
||||
<view class="card_lv2">
|
||||
<view class="card_text">
|
||||
<view class="text_cen">
|
||||
<view class="text_top">
|
||||
<view class="text_l">
|
||||
<image src="/static/img/icon/vip.png" />
|
||||
<span class="ml10">{{item.title}}</span>
|
||||
</view>
|
||||
<!-- <view class="text_r card2">
|
||||
余额¥
|
||||
<span>{{item.money}}</span>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="text_botton mt20">
|
||||
<view class="card2_text">
|
||||
<view class="card2_p">发卡时间{{item.create_time}}</view>
|
||||
<!-- <view class="card2_p">
|
||||
卡号 YS123456789 有效期{{item.create_time}}
|
||||
</view> -->
|
||||
<view class="text_r card2">
|
||||
余额¥
|
||||
<span>{{item.money}}</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{current == 3}}" class="con_lsit_card">
|
||||
<view class="list_card mt20" wx:for="{{cardList}}" wx:key="{{index}}" data-item="{{item}}" bind:tap="selectGiftCard">
|
||||
<view class="card_lv">
|
||||
<image src="{{item.src}}" />
|
||||
</view>
|
||||
<view class="card_lv2">
|
||||
<view class="card_text">
|
||||
<view class="text_cen">
|
||||
<view class="text_top">
|
||||
<view class="text_l">
|
||||
<image src="/static/img/icon/vip.png" />
|
||||
<span class="ml10">{{item.title}}</span>
|
||||
</view>
|
||||
<view class="text_r">
|
||||
<span>{{item.discount/10}}</span>
|
||||
折
|
||||
</view>
|
||||
</view>
|
||||
<view class="text_botton mt10">
|
||||
<view class="text_botton_l">发卡时间 {{item.create_time}}</view>
|
||||
<view class="text_botton_r">余额 ¥{{item.money}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{cardList.length <= 0}}" class="rech-nothing">
|
||||
<view class="rech-nothing-img">
|
||||
<image src="/static/img/rech-nothing-icon.png" />
|
||||
</view>
|
||||
<view class="rech-nothing-tips mt50">您还没有当前的会员卡哦~</view>
|
||||
<view class="rech-nothing-p mt10">办理会员卡,可享会员折扣</view>
|
||||
<view wx:if="{{current != 3}}" class="rech-nothing-btn" bind:tap="goCard">办卡</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- toasta提示 -->
|
||||
<i-toast id="toast" />
|
||||
164
衣莎项目/源码/YiShaXiYi/user/payment/card/card.wxss
Normal file
164
衣莎项目/源码/YiShaXiYi/user/payment/card/card.wxss
Normal file
@@ -0,0 +1,164 @@
|
||||
/* user/payment/card/card.wxss */
|
||||
.order_tab{
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
.tab_con{
|
||||
margin-top: 52px;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list_card{
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
position: relative;
|
||||
}
|
||||
.card_lv{
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 997;
|
||||
}
|
||||
.card_lv2{
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 998;
|
||||
}
|
||||
.card_lv image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.card_text{
|
||||
display: block;
|
||||
padding: 0 30rpx;
|
||||
height: 100%;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.text_cen{
|
||||
width: 100%;
|
||||
}
|
||||
.text_top{
|
||||
display: flex;
|
||||
}
|
||||
.text_l,.text_r{
|
||||
flex: 2;
|
||||
color: black;
|
||||
}
|
||||
.text_l{
|
||||
text-align: left;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
.text_l image{
|
||||
width: 43rpx;
|
||||
height: 43rpx;
|
||||
}
|
||||
.text_l span{
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
}
|
||||
.text_r{
|
||||
text-align: right;
|
||||
font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.text_r span{
|
||||
font-size: 60rpx;
|
||||
}
|
||||
.text_botton{
|
||||
display: flex;
|
||||
}
|
||||
.text_botton_l,.text_botton_r{
|
||||
flex: 2;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.text_botton_l{
|
||||
text-align: left;
|
||||
}
|
||||
.text_botton_r{
|
||||
text-align: right;
|
||||
}
|
||||
.card2{
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.card2 span{
|
||||
font-size: 40rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.card2_text{
|
||||
flex: 1;
|
||||
}
|
||||
.card2_p{
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
padding-left: 53rpx;
|
||||
}
|
||||
|
||||
/* 修改tabs样式 */
|
||||
|
||||
i-tab {
|
||||
width: 33.33%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* 无卡 */
|
||||
/* 没有会员卡 */
|
||||
.rech-nothing{
|
||||
margin-top: 150rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.rech-nothing-img{
|
||||
text-align: center;
|
||||
}
|
||||
.rech-nothing-img image{
|
||||
width: 232rpx;
|
||||
height: 232rpx;
|
||||
}
|
||||
.rech-nothing-tips{
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 36rpx;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
color: #666666;
|
||||
}
|
||||
.rech-nothing-p{
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
color: #999999;
|
||||
}
|
||||
.rech-nothing-btn{
|
||||
width: 274rpx;
|
||||
height: 75rpx;
|
||||
margin: 30rpx auto 0;
|
||||
line-height: 75rpx;
|
||||
background-color: #1dbf53;
|
||||
border-radius: 37rpx;
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
Reference in New Issue
Block a user