增加:酒卡额度记录和积分记录

This commit is contained in:
wuhui_zzw 2024-01-17 17:40:11 +08:00
parent 6a77ecb6ba
commit d7927434d4
7 changed files with 404 additions and 15 deletions

View File

@ -44,3 +44,15 @@ export function getSiteQrCode(data) {
export function getUserExchangeQrcode() {
return request.get(`exchange/user_qr_code`);
}
// 额度变更记录 - 统计
export function recordQuota() {
return request.get(`exchange/record_quota`);
}
// 额度变更记录 - 列表
export function recordQuotaList(data) {
return request.get(`exchange/record_quota_list`,data);
}
// 积分变更记录 - 列表
export function recordIntegralList(data) {
return request.get(`exchange/record_integral_list`,data);
}

View File

@ -6,13 +6,13 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
let openPlantGrass = '-openPlantGrass-'
// 网络接口修改此字符 小程序域名要求https
// let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
let httpApi = 'https://mp.scwmbh.cn/' // 生产
let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
// let httpApi = 'https://mp.scwmbh.cn/' // 生产
// 聊天接口修改此字符 小程序聊天要求wss 例如:
// let wsApi = 'wss://bt.test.cdlfjy.com'
let wsApi = 'wss://mp.scwmbh.cn'
let wsApi = 'wss://bt.test.cdlfjy.com'
// let wsApi = 'wss://mp.scwmbh.cn'
module.exports = {

View File

@ -555,11 +555,21 @@
{
"path": "online_payment/site/list",
"style": {
"navigationBarTitleText": "兑换站列表"
"navigationBarTitleText": "酒道馆列表"
}
},
{
"path": "online_payment/record/quota",
"style": {
"navigationBarTitleText": "酒卡变更记录"
}
},
{
"path": "online_payment/record/integral",
"style": {
"navigationBarTitleText": "积分变更记录"
}
}
]
},
{

View File

@ -60,18 +60,26 @@
</view>
</view>
<view class="num-wrapper skeleton-rect">
<view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
<!--<view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
<text class="num">{{userInfo.total_collect_product || 0}}</text>
<view class="txt">我的收藏</view>
</view>
<view v-if="hide_mer_status == 0" class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index?tab=2')">
<text class="num">{{userInfo.total_collect_store || 0}}</text>
<view class="txt">关注店铺</view>
</view>
</view>`-->
<!--<view v-if="hide_mer_status == 0" class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index?tab=2')">-->
<!-- <text class="num">{{userInfo.total_collect_store || 0}}</text>-->
<!-- <view class="txt">关注店铺</view>-->
<!--</view>-->
<view class="num-item" @click="goMenuPage('/pages/users/browsingHistory/index')">
<text class="num">{{userInfo.total_visit_product || 0}}</text>
<view class="txt">浏览记录</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/online_payment/record/quota')">
<text class="num">{{userInfo.available || 0}}</text>
<view class="txt">酒卡额度</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/online_payment/record/integral')">
<text class="num">{{userInfo.exchange_integral || 0}}</text>
<view class="txt">我的积分</view>
</view>
<!--<view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">-->
<!-- <text class="num">{{userInfo.total_coupon || 0}}</text>-->
<!-- <view class="txt">优惠券</view>-->

View File

@ -5,7 +5,7 @@
<!-- 顶部内容 -->
<view class="top">
<view class="left">
<view class="name">提货点{{ point_info.title || '请选择提货点' }}</view>
<view class="name">酒道馆{{ point_info.title || '请选择酒道馆' }}</view>
<view v-if="point_search.default_point_id <= 0" class="change-btn" @click="showPointPopup">
{{ point_info.id > 0 ? '切换' : '选择' }}
</view>
@ -69,7 +69,7 @@
<uni-popup ref="selectedPoint" type="center">
<view class="point-content">
<view class="search-content">
<input class="money-input" v-model="point_search.address" type='text' placeholder="提货点名称/提货点地址" />
<input class="money-input" v-model="point_search.address" type='text' placeholder="酒道馆名称/酒道馆地址" />
<view class="search-btn" @click="getPointList">搜索</view>
<view class="close-btn" @click="pointClosePopup">取消</view>
</view>

View File

@ -0,0 +1,129 @@
<template>
<view :style="viewColor">
<view class='content-box'>
<view v-if="Object.values(list).length > 0" class="content-list">
<view class="list-box" v-for="(item,index) in list" :key="index">
<view class="left">
<view class="title">
{{ item.remark }}
<view :class="['status',(item.change_type == 1 ? 'status-success' : 'status-error' )]">
{{ item.change_type == 1 ? '增加' : '减少' }}
</view>
</view>
<view class="time">{{ item.create_time }}</view>
</view>
<view v-if="item.change_type == 1" class="right">+{{ item.change_quantity }}</view>
<view v-else class="right status-success">-{{ item.change_quantity }}</view>
</view>
</view>
<emptyPage v-else title="暂无记录~"></emptyPage>
</view>
</view>
</template>
<script>
import { recordIntegralList } from '@/api/exchange.js';
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue';
const app = getApp();
export default {
components: {
emptyPage,
},
data() {
return {
list: [],
page: 1,
total_page: 1,
};
},
computed: {
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad(options) {
this.getPointList();
},
onReachBottom: function () {
this.getPointList();
},
methods: {
//
getPointList() {
let _this = this;
recordIntegralList({page: _this.page})
.then(res => {
let list = res.data.list || {};
if (Object.values(list).length > 0) {
_this.list = _this.$util.SplitArray(list, _this.list);
_this.$set(_this, 'list', _this.list);
_this.page++;
}
})
.catch(err => {
this.$util.Tips({
title: err
});
});
},
},
}
</script>
<style scoped lang="scss">
.list-box{
width: 100%;
padding: 20rpx;
height: 120rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.left{
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: flex-start;
.title{
font-size: 30rpx;
font-weight: bold;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.status{
font-size: 24rpx;
font-weight: initial;
margin-left: 20rpx;
height: 35rpx;
line-height: 35rpx;
padding: 0 15rpx;
border-radius: 50rpx;
}
.status-success{
background-color: #13ce66;
color: #fff;
}
.status-error{
background-color: #ff4949;
color: #fff;
}
}
.time{
font-size: 26rpx;
color: #C1C1C1;
}
}
.right{
font-size: 40rpx;
color: #ff4949;
}
.status-success{
color: #13ce66;
}
}
</style>

View File

@ -0,0 +1,230 @@
<template>
<view class="page-wrapper integral-record" :style="viewColor">
<!--统计信息-->
<view class="statistics">
<view class="statistics-content">
<view class="statistics-block" v-for="(item,index) in statistics_list" :key="index">
<view class="statistics-num">{{ item.value }}</view>
<view class="statistics-title">{{ item.title }}</view>
</view>
</view>
</view>
<!--列表记录-->
<view class="integral-list" v-if="Object.keys(list).length > 0">
<view class="integral-content">
<view class="block" v-for="(item,index) in list" :key="index">
<view class="left-content">
<view class="left-top">
{{ item.remark }}
<view class="left-tag left-tag-released" v-if="item.change_type == 1">增加</view>
<view class="left-tag left-tag-frozen" v-else>减少</view>
</view>
<view class="left-bottom">{{ item.create_time }}</view>
</view>
<view class="right-content">
<view v-if="item.change_type == 1" class="released">+{{ item.change_quantity }}</view>
<view v-else class="frozen">-{{ item.change_quantity }}</view>
</view>
</view>
</view>
</view>
<emptyPage v-else title="暂无记录~"></emptyPage>
</view>
</template>
<script>
import emptyPage from '@/components/emptyPage.vue'
import { mapGetters } from "vuex";
import {recordQuota,recordQuotaList} from "@/api/exchange";
export default{
components:{
emptyPage
},
computed: mapGetters(['isLogin','uid','viewColor']),
data(){
return {
statistics_list: {},
list: [],
searchData: {
page: 1,
limit: 20
},
total_page: 0,
allow_page: false,
}
},
onLoad(options){
this.getStatistics();
this.getList();
},
onShow() {},
methods:{
//
getStatistics(){
let _this = this;
recordQuota().then(res => {
this.statistics_list = res.data || {};
});
},
//
getList(){
let _this = this
recordQuotaList(_this.searchData).then(res => {
if(res.status === 200){
if(_this.searchData.page == 1){
_this.list = res.data.list;
}else{
_this.list = _this.list.concat(res.data.list);
}
_this.total_page = Math.ceil(res.data.count / _this.searchData.limit);
}
_this.allow_page = true;
})
},
},
//
onReachBottom() {
if(this.searchData.page < this.total_page && this.allow_page){
this.searchData.page = this.searchData.page + 1;
this.getList();
}
},
//
onPageScroll(e) {},
}
</script>
<style lang="scss" scoped>
.integral-record{
width: 100vw!important;
min-height: 100vh!important;
background: #f6f6f6;
//
.statistics{
padding: 20rpx;
.statistics-content{
width: 100%;
background: #ffffff;
border-radius: 15rpx;
padding: 20rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: wrap;
align-content: center;
justify-content: flex-start;
align-items: center;
box-shadow: 0px 0px 5px 1px #0015295e;
.statistics-block{
width: calc(100% / 3);
height: 130rpx!important;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
.statistics-num{
font-size: 34rpx;
font-weight: bold;
height: 50rpx;
line-height: 50rpx;
}
.statistics-title{
font-size: 26rpx;
color: #909399;
}
}
}
}
//
.integral-list{
.integral-content{
width: 100%;
background: #ffffff;
padding: 0 20rpx;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
.block {
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
.left-content {
width: calc(100% - 200rpx);
.left-top {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
font-size: 34rpx;
font-weight: bold;
color: #222427;
.left-tag {
font-size: 24rpx;
font-weight: unset;
margin-left: 20rpx;
padding: 5rpx 15rpx;
border-radius: 5rpx;
}
.left-tag-frozen{
background: #fceaea;
color: #fe4e4d;
}
.left-tag-released{
background: #eafbeb;
color: #5fc161;
}
.left-tag-invalid{
background: #e2e2e2;
color: #6d6d6d;
}
}
.left-bottom {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
font-size: 26rpx;
color: #b1b1b1;
.time {
width: 300rpx;
}
.legumes {
width: 50%;
}
}
}
.right-content {
font-size: 36rpx;
font-weight: bold;
width: 180rpx;
text-align: right;
.released{
color: #5fc161;
}
.invalid{
color: #6d6d6d;
}
.frozen{
color: #fe4e4d;
}
}
}
.block:not(:last-child){
border-bottom: 2rpx solid #f6f6f6;//#f6f6f6
}
}
}
}
</style>