pull/15/head
xiaozhiyong 8 months ago
parent 607e13f266
commit 7536516a37
  1. 18
      api/integral.js
  2. 12
      pages.json
  3. 167
      pages/tabbar/user/integralRecord.vue
  4. 40
      pages/tabbar/user/user.vue

@ -0,0 +1,18 @@
import request from '@/utils/request'
export default {
getByPage(data) {
return request({
url: '/oil-finance/oilCustomerIntegralRecord/getByPage',
method: 'post',
data: data
})
},
getByCustomerId(customerId) {
return request({
url: `/oil-finance/oilCustomerIntegralAccount/getByCustomerId/${customerId}`,
method: 'get'
})
},
}

@ -34,10 +34,14 @@
"style": {
"navigationBarTitleText": "星油云" // "enablePullDownRefresh": true
}
}
, {
},
{
"path": "pages/tabbar/user/integralRecord",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/tabbar/qrCenter/qrCenter",
"style": {
"navigationBarTitleText": "",

@ -0,0 +1,167 @@
<template>
<view class="container">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">积分记录</block>
</cu-custom>
<view class="banner">
<view>{{balance}}</view>
<view>当前积分</view>
</view>
<!-- <view class="list"> -->
<scroll-view class="list" :scroll-y="true" @scrolltolower="lower">
<view class="item" v-for="item,index in recodeList" :key="index">
<view>{{typeEnum[item.type]}}</view>
<view>{{item.createTime}}</view>
<view>{{(item.type == 1 ||item.type == 3) ? '+' : '-'}}{{item.occurAmount}}</view>
</view>
</scroll-view>
<view class="occupy"></view>
</view>
</template>
<script>
import serve from '@/api/integral.js'
export default {
data() {
return {
parameter: {
currentPage: 1,
pageSize: 20,
params: {
customerId: uni.getStorageSync('user').id
},
},
balance: 0,
recodeList: [],
typeEnum: {
1: '加油收入',
2: '加油退款',
3: '商品兑换',
4: '商品兑换退款'
},
}
},
created() {
this.getByCustomerId()
this.getByPage()
},
methods: {
getByPage() {
serve.getByPage(this.parameter).then(res => {
if (res.code === 20000) {
if (!res.data.list.length) {
uni.showToast({
title: '没有更多数据了~',
icon: 'none'
})
return
}
this.recodeList = this.recodeList.concat(res.data.list)
}
})
},
getByCustomerId() {
serve.getByCustomerId(this.parameter.params.customerId).then(res => {
if (res.code === 20000) {
this.balance = res.data.balance
}
})
},
lower() {
this.parameter.currentPage += 1
this.getByPage()
console.log('到底了')
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: #F2F2F2;
height: 100vh;
display: flex;
flex-direction: column;
.banner {
margin: 37rpx auto 0;
padding-top: 105rpx;
width: 684rpx;
height: 337rpx;
background: url('https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/integral-background.png') 100%/100% no-repeat;
border-radius: 10rpx;
>view {
text-align: center;
color: #fff;
&:nth-of-type(1) {
font-size: 64rpx;
}
&:nth-of-type(2) {
margin-top: 10rpx;
font-size: 26rpx
}
}
}
.list {
flex: 1;
overflow-y: hidden;
margin: 37rpx auto 0;
padding-bottom: 10rpx;
width: 684rpx;
background: #FFF;
border-radius: 10rpx;
.item {
position: relative;
padding: 25rpx 30rpx 0 30rpx;
width: 100%;
height: 125rpx;
>view {
&:nth-of-type(1) {
font-size: 28rpx;
color: #333;
}
&:nth-of-type(2) {
margin-top: 15rpx;
font-size: 22rpx;
color: #999;
}
&:nth-of-type(3) {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 30rpx;
font-size: 28rpx;
color: #666;
}
}
&::after {
content: '';
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
width: 632rpx;
height: 1rpx;
background: #f6f6f6;
}
}
}
.occupy {
height: 50rpx;
}
}
</style>

@ -109,24 +109,35 @@
<view class="cu-list menu">
<view class="cu-item hidden-cu-item">
</view>
<view class="cu-item arrow">
<view class="cu-item arrow" @click="goIntegral">
<view class="content">
<!-- <image :src="imgURL+'yunsite-kefu.png'" class="png" mode="aspectFit"></image> -->
<text class="text-grey padding-left-sm">我的积分</text>
</view>
<view class="action">
<!-- <button class="cu-btn oil-main-btn-color" open-type="contact" @contact="onContact"> -->
<!-- <text class="text-grey text-sm">打开会话</text> -->
<!-- </button> -->
<view>{{balance}}</view>
</view>
</view>
<view class="cu-item arrow" @click="makeCall">
<view class="content">
<image :src="starUrl+'zskf.png'" class="png" mode="aspectFit"></image>
<!-- <image :src="imgURL+'yunsite-kefu.png'" class="png" mode="aspectFit"></image> -->
<text class="text-grey padding-left-sm">专属客服</text>
</view>
<view class="action">
<!-- <button class="cu-btn oil-main-btn-color" open-type="contact" @contact="onContact"> -->
<!-- <text class="text-grey text-sm">打开会话</text> -->
<!-- </button> -->
<view class="cu-btn oil-main-btn-color" @click="makeCall">
<!-- <view class="cu-btn oil-main-btn-color" @click="makeCall">
<text class="text-grey text-sm">联系客服</text>
</view>
</view> -->
</view>
</view>
<view class="cu-item arrow">
<view class="content">
<image :src="starUrl+'gywm.png'" class="png" mode="aspectFit"></image>
<!-- <image :src="imgURL+'yunsite-about.png'" class="png" mode="aspectFit"></image> -->
<text class="text-grey padding-left-sm">关于我们</text>
</view>
</view>
@ -143,6 +154,7 @@
import oilSiteApi from '@/api/oil-site.js'
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import accountApi from '@/api/account.js'
import integralServe from '@/api/integral.js'
export default {
components: {
SwitchEnterprises
@ -163,7 +175,8 @@
isCompany: uni.getStorageSync('accountStatus'),
user: uni.getStorageSync('user'),
wxInfo: uni.getStorageSync('wxInfo'),
userTotal: {}
userTotal: {},
balance: ''
};
},
onShow() {
@ -171,8 +184,21 @@
this.getAuthInfo()
this.getAmount();
this.upadteCompanyCard()
this.getByCustomerId()
},
methods: {
goIntegral() {
uni.navigateTo({
url: './integralRecord'
})
},
getByCustomerId() {
integralServe.getByCustomerId(this.user.id).then(res => {
if (res.code === 20000) {
this.balance = res.data.balance
}
})
},
logout() {
this.isSwitchEnterprises = false
},

Loading…
Cancel
Save