Commit 9d452e3a by zqm

MM - 积分模块

parent c40da588
......@@ -2,32 +2,58 @@ let App = getApp()
Page({
data: {
imageResourcesBase: App.globalData.appResourcesBase,
showMenu: false,
menu: '全 部',
menuList: [
{id: 0, name: '全 部'},
{id: 1, name: '获 取'},
{id: 2, name: '已使用'}
menuList: [{
id: '',
name: '全 部'
},
{
id: 0,
name: '获 取'
},
{
id: 1,
name: '已使用'
}
],
pageNo: '1',
pageSize: '-1',
type: '', // "" 全部 0 获取 1消费(0 发放 1 兑换)
accumulateList: [],
selectedList: []
selectedList: [],
integral: '0',
type: ''
},
onLoad: function (options) {
let integral = options.integral
this.setData({
integral: integral
})
App.login({
timeout: 0,
success: (result) => {
this.getAccumulate()
},
})
},
// 获取积分列表
getAccumulate: function () {
wx.showLoading({
title: '加载中',
})
App.wxRequest({
url: '/api/v1/smUser/getIntegralDetails',
data: {
'pageNo': this.data.pageNo,
'pageSize': this.data.pageSize,
type: ''
type: this.data.type
},
success: (response) => {
wx.hideLoading({
success: (res) => {},
})
let accumulateList = response.data
let selectedList = accumulateList
this.setData({
......@@ -57,18 +83,23 @@ Page({
* @returns
*/
onTabMenu: function (event) {
let { index } = event.currentTarget.dataset
let {
index,
type
} = event.currentTarget.dataset
let menu = this.data.menuList[index].name
let selectedList = []
if (index === 0) {
selectedList = this.data.accumulateList
} else {
selectedList = selectedList.filter(v => v.type === index-1)
selectedList = selectedList.filter(v => v.type === index - 1)
}
this.setData({
menu,
selectedList
selectedList,
type: type
})
this.onHideMenu()
this.getAccumulate()
}
})
\ No newline at end of file
......@@ -2,10 +2,11 @@
<view class="container con-s" bindtap="onHideMenu">
<!-- 积分背景图 -->
<image class="banner" src=""></image>
<image class="banner" src="{{imageResourcesBase + 'mine/home/integral-bg.png'}}"></image>
<view class="opacity-cover"></view>
<view class="my-accumulate">
<text>1888</text>
<text>{{integral}}</text>
</view>
<view class="accumulate-tips">
......@@ -17,7 +18,8 @@
<image src="/image/icon/arrow-b-2.png"></image>
<view class="banner-menu-down col" wx:if="{{showMenu}}">
<block wx:for="{{menuList}}" wx:key="id">
<text class="{{menu === item.name ? 'selected' : ''}}" catchtap="onTabMenu" data-index="{{index}}">{{item.name}}</text>
<text class="{{menu === item.name ? 'selected' : ''}}" data-type="{{item.id}}" catchtap="onTabMenu"
data-index="{{index}}">{{item.name}}</text>
</block>
</view>
</view>
......
......@@ -9,6 +9,15 @@ page {
.banner {
position: fixed;
z-index: -2;
top: 0;
left: 0;
width: 750rpx;
height: 480rpx;
}
.opacity-cover {
position: fixed;
z-index: -1;
top: 0;
left: 0;
......@@ -54,11 +63,11 @@ page {
width: 166rpx;
height: 180rpx;
background: rgba(255, 255, 255, 0.95);
box-shadow: 10px 4px 40px 0px rgba(181,164,164,0.3);
box-shadow: 10px 4px 40px 0px rgba(181, 164, 164, 0.3);
border-radius: 4rpx;
}
.banner-menu-down text{
.banner-menu-down text {
flex: 1;
padding-left: 24rpx;
color: #959CA8;
......@@ -123,9 +132,11 @@ page {
font-size: 30rpx;
color: #E66060;
}
.accumulate-right text {
margin-left: 6rpx;
}
.accumulate-type-color {
color: #959DA9;
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ Page({
data: {
isCheckPermission: false,
imageBase: App.globalData.appImageBase,
imageResourcesBase: App.globalData.appResourcesBase,
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
......@@ -79,7 +80,8 @@ Page({
title: '日落观光游船体验活动之船行碧波共赏美景',
num: 3
}],
orderListBackup: []
orderListBackup: [],
integral: 0, //积分
},
close() {
......@@ -90,14 +92,7 @@ Page({
animation: true,
})
},
maskShow() {
this.setData({
mask: true
});
wx.hideTabBar({
animation: true,
})
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -108,6 +103,13 @@ Page({
onShow: function () {
this.setUserInfo()
},
// 查看积分明细
goIntegralDetail(event) {
let integral = event.currentTarget.dataset.integral
wx.navigateTo({
url: '/pages/mine/accumulate/accumulate?integral=' + integral,
})
},
// 去核销
goCouponInput(event) {
wx.navigateTo({
......@@ -115,7 +117,7 @@ Page({
})
},
// 获取核销权限
// api/v1/login/getPermissions权限更上去了
getPermissions() {
let that = this
App.wxRequest({
......@@ -143,6 +145,23 @@ Page({
}
})
},
// 获取积分
getIntegral() {
let that = this
App.wxRequest({
url: '/api/v1/smUser/getIntegral', //api/v1/smUser/getIntegral
data: {},
success: function (res) {
let integral = res.data ? res.data.integral : '0'
that.setData({
integral: integral
})
}
})
},
//获取待使用订单
getWillUseOrders() {
let that = this
......@@ -227,10 +246,16 @@ Page({
isRegister: true,
userInfo: funcUserInfo
})
App.login({
timeout: 0,
success: (result) => {
this.getMyActivityList()
this.getCardList()
this.getWillUseOrders()
this.getPermissions()
this.getIntegral()
},
})
} else {
this.setData({
isRegister: false,
......
......@@ -23,6 +23,26 @@
padding: 220rpx 0 0 48rpx;
}
.user-type {
width: 126rpx;
height: 40rpx;
font-weight: 500;
font-size: 22rpx;
color: #fff;
background-color: #6783AE;
text-align: center;
line-height: 40rpx;
border-radius: 4rpx;
letter-spacing: 10rpx;
margin-top: 20rpx;
}
.owner-tag {
height: 80rpx;
width: 142rpx;
/* margin-top: 8rpx!important; */
}
.mine-avatar {
z-index: 11;
margin-right: 32rpx;
......@@ -40,6 +60,43 @@
font-size: 42rpx;
font-weight: bolder;
}
.padding-l-18{
padding-left: 18rpx;
}
/* 积分 */
.integral {
color: #0D0D0E;
text-align: right;
}
.glod {
color: #F0DABB;
}
.integral-num {
font-size: 54rpx;
line-height: 76rpx;
padding-right: 80rpx;
}
.integral-title {
display: flex;
height: 80rpx;
align-items: center;
font-size: 26rpx;
line-height: 36rpx;
flex-direction: row;
justify-content: flex-end;
padding-right: 40rpx;
}
.arrow-r {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
}
.mine-info view:nth-child(1) image {
z-index: 11;
......@@ -64,7 +121,7 @@
padding: 41rpx 32rpx;
background-color: #fff;
border-radius: 4rpx;
margin-top:48rpx;
margin-top: 48rpx;
}
.cpopon-info {
......@@ -557,8 +614,6 @@
border-radius: 4rpx;
}
.appointment-activity-content {}
.appointment-activity-img {
width: 140rpx;
height: 136rpx;
......@@ -643,3 +698,16 @@ image {
width: 100%;
height: 100%;
}
.logo-box {
width: 100rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.logo-box image {
max-width: 100%!important;
max-height: 100%!important;
}
\ No newline at end of file
......@@ -344,10 +344,10 @@ page {
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.logo-box image {
max-width: 100%!important;
max-height: 100%!important;
}
\ No newline at end of file
......@@ -828,6 +828,7 @@ image {
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.logo-box image {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment