修改:积分管理修改 - 冻结积分修改为平台积分。积分获得栏目修改为商户积分栏目

This commit is contained in:
wuhui_zzw 2023-11-10 16:11:56 +08:00
parent e849f617a9
commit d08c3c375f
2 changed files with 702 additions and 381 deletions

View File

@ -168,7 +168,6 @@ export function extractLst(data) {
export function getIntegralList(data) {
return request.get("user/integral/lst", data);
}
/**
* 获取分销海报图片
*
@ -696,9 +695,14 @@ export function getCustomList(merId, data) {
export function customIntegralChange(merId, data) {
return request.post("custom/integral_change/"+merId, data);
}
// 积分中心 - 获取商户积分记录
export function getMerchantIntegral(data) {
return request.post("user/integral/mer_list", data);
}
// 积分中心 - 转换积分
export function convertMerchantIntegral(merId,data) {
return request.post("user/integral/integral_convert/"+merId, data);
}

View File

@ -15,21 +15,22 @@
<view>累计消费</view>
</view>
<view class='item'>
<view class='num'>{{userInfo.lockIntegral || 0}}</view>
<view>冻结积分</view>
<view class='num'>{{userInfo.platform_integral || 0}}</view>
<view>平台积分</view>
</view>
</view>
</view>
<view class='wrapper'>
<view class='nav acea-row'>
<view class='item acea-row row-center-wrapper' :class='current==index?"on":""' v-for="(item,index) in navList" :key='index'
@click='nav(index)'><text class='iconfont' :class="item.icon"></text>{{item.name}}</view>
<view class='item acea-row row-center-wrapper' :class='current==index?"on":""' v-for="(item,index) in navList" :key='index' @click='nav(index)'>
<text class='iconfont' :class="item.icon"></text>{{item.name}}
</view>
</view>
<view class='list' :hidden='current != 0' >
<view class='tip' v-if="userInfo.clear && userInfo.clear.status && userInfo.clear.nextClearIntegral > 0"><text class='iconfont icon-shuoming'></text>
<!--<view class='tip' v-if="userInfo.clear && userInfo.clear.status && userInfo.clear.nextClearIntegral > 0"><text class='iconfont icon-shuoming'></text>
<text class="tip-text">提示您有部分积分将于{{userInfo.clear.nextClearDay}}过期请尽快使用</text>
</view>
</view>-->
<view class='item acea-row row-between-wrapper' v-for="(item,index) in integralList" :key="index">
<view>
<view class='state'>{{item.mark}}</view>
@ -46,7 +47,8 @@
</view>
</view>
<view v-if="integral_status" class='list2' :hidden='current!=1'>
<!-- <view v-if="integral_status" class='list2' :hidden='current!=1'>
<navigator class='item acea-row row-between-wrapper' open-type='switchTab' hover-class='none' url='/pages/index/index'>
<view class='pictrue'>
<image src='../../../static/images/score.png'></image>
@ -61,7 +63,7 @@
<view class='name'>每日签到可获得积分奖励</view>
<view class='earn'>赚积分</view>
</navigator>
<!--#ifndef APP-PLUS-->
&lt;!&ndash;#ifndef APP-PLUS&ndash;&gt;
<view class='item acea-row row-between-wrapper' @click="shareIntegral">
<view class='pictrue'>
<image src='../../../static/images/score.png'></image>
@ -69,8 +71,34 @@
<view class='name'>邀请好友可获得积分奖励</view>
<view class='earn'>赚积分</view>
</view>
<!--#endif-->
&lt;!&ndash;#endif&ndash;&gt;
</view>-->
<view class='list2' :hidden='current != 1'>
<view v-if="Object.keys(mer_integral_list).length > 0" class="mer-integral-list">
<view class="list-item" v-for="(item,index) in mer_integral_list" :key="index">
<view class="left-avatar">
<image v-if="item.mer_avatar.length > 10" :src="item.mer_avatar" mode="widthFix"/>
</view>
<view class="center-info">
<view class="info-top">
<view class="nickname">{{ item.mer_name }}</view>
<view class="custom-id">{{ item.mer_id}}</view>
</view>
<view class="info-bottom">积分{{ item.number }}</view>
</view>
<view class="right-btn">
<view v-if="item.mer_integral_platform_rate > 0" class="give-btn" @click="showIntegralConvertPopup(item)">转换积分</view>
<view v-else class="give-btn">转换积分</view>
</view>
</view>
</view>
<view v-else>
<emptyPage title="暂无积分记录哦~"></emptyPage>
</view>
</view>
</view>
</view>
<view class="instructions" v-if="showProtocol">
@ -83,6 +111,43 @@
</view>
</view>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- 转换积分弹框 -->
<uni-popup ref="integralChangePopup">
<view class="integral-change">
<view class="integral-change-content">
<view class="title">转换积分</view>
<view class="form-content">
<view class="form-content-box">
<view class="box-title">商户名称</view>
<view class="box-value">{{ current_mer_info.mer_name }}</view>
</view>
<view class="form-content-box">
<view class="box-title">当前持有该积分</view>
<view class="box-value">{{ current_mer_info.number }}</view>
</view>
<view class="form-content-box">
<view class="box-title">转换比例</view>
<view class="box-value">1 : {{ current_mer_info.mer_integral_platform_rate }}</view>
</view>
<view class="form-content-box">
<view class="box-title">转换数量</view>
<view class="box-value">
<input type='number' placeholder='请输入转换数量' v-model.number="convert_integral" />
</view>
</view>
<view class="form-content-box" v-if="expected_acquisition > 0">
<view class="box-title">预计获得</view>
<view class="box-value">{{ expected_acquisition }} 平台积分</view>
</view>
</view>
<view class="submit-button">
<view class="submit-btn" @click="submitConvertIntegral">提交</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -96,13 +161,14 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import { getIntegralInfo, getIntegralList, getAgreementApi } from '@/api/user.js';
import {getIntegralInfo, getIntegralList, getAgreementApi, getMerchantIntegral, convertMerchantIntegral} from '@/api/user.js';
import {
mapGetters
} from "vuex";
import authorize from '@/components/Authorize';
import emptyPage from '@/components/emptyPage.vue';
import parser from "@/components/jyf-parser/jyf-parser";
const app = getApp();
export default {
components: {
@ -114,11 +180,11 @@
return {
navList: [{
'name': '分值明细',
'icon': 'icon-mingxi'
// 'icon': 'icon-mingxi'
},
{
'name': '分值提升',
'icon': 'icon-tishengfenzhi'
'name': '商户积分',
// 'icon': 'icon-tishengfenzhi'
}
],
current: 0,
@ -138,9 +204,22 @@
video: 'width:100%;'
},
integral_status: true,
//
mer_integral_list: [],
mer_page: 1,
convert_integral: 0,//
current_mer_info: {},//
};
},
computed: mapGetters(['isLogin','viewColor']),
// computed: mapGetters(['isLogin', 'viewColor']),
computed: {
expected_acquisition: function() {
let expectedAcquisition = Math.ceil(this.current_mer_info.mer_integral_platform_rate * this.convert_integral);
return isNaN(expectedAcquisition) ? 0 : expectedAcquisition;
},
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad() {
if (this.isLogin) {
this.getUserInfo();
@ -150,12 +229,9 @@
}
this.getAgreement();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getIntegralList();
this.getMerchantIntegral();
},
methods: {
/**
@ -173,7 +249,8 @@
let that = this;
getIntegralInfo().then(function (res) {
that.$set(that, 'userInfo', res.data);
that.getIntegralList()
that.getIntegralList();
that.getMerchantIntegral();
}).catch(res => {
this.integral_status = false
return that.$util.Tips({
@ -222,6 +299,48 @@
},
nav: function (current) {
this.current = current;
},
//
getMerchantIntegral() {
let _this = this;
//
getMerchantIntegral({ page: _this.mer_page }).then(res => {
let list = res.data.list || {};
if(Object.values(list).length > 0){
_this.mer_integral_list = _this.$util.SplitArray(list, _this.mer_integral_list);
_this.$set(_this, 'mer_integral_list', _this.mer_integral_list);
_this.mer_page++;
}
}).catch(err => {
console.log("错误 catch",err);
})
},
// -
showIntegralConvertPopup(item){
let _this = this;
_this.convert_integral = 0;
_this.current_mer_info = item;
_this.$refs.integralChangePopup.open('center');
},
// -
submitConvertIntegral(){
let _this = this;
//
convertMerchantIntegral(_this.current_mer_info.mer_id, { convert_integral: _this.convert_integral }).then(res => {
//
_this.$refs.integralChangePopup.close();
//
_this.mer_integral_list = [];
_this.mer_page = 1;
_this.getMerchantIntegral();
//
uni.showModal({
title: '提示',
content: res.message,
});
}).catch(err => {
console.log("错误 catch",err);
})
}
}
}
@ -244,7 +363,6 @@
box-sizing: border-box;
text-align: center;
}
.integral-details .header .currentScore {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.8);
@ -263,36 +381,30 @@
color: var(--view-theme);
margin-left: 4rpx;
}
.wenhao {
margin-top: -10rpx;
}
.integral-details .header .line {
width: 60rpx;
height: 3rpx;
background-color: #fff;
margin: 20rpx auto 0 auto;
}
.integral-details .header .nav {
font-size: 22rpx;
color: rgba(255, 255, 255, 0.8);
flex: 1;
margin-top: 35rpx;
}
.integral-details .header .nav .item {
width: 33.33%;
text-align: center;
}
.integral-details .header .nav .item .num {
color: #fff;
font-size: 40rpx;
margin-bottom: 5rpx;
}
.integral-details .wrapper .nav {
flex: 1;
width: 690rpx;
@ -303,12 +415,10 @@
font-size: 30rpx;
color: #bbb;
}
.integral-details .wrapper .nav .item {
text-align: center;
width: 50%;
}
.integral-details .wrapper .nav .item.on {
background-color: #fff;
color: var(--view-theme);
@ -321,17 +431,14 @@
.integral-details .wrapper .nav .item:nth-of-type(2).on {
border-radius: 0 20rpx 0 0;
}
.integral-details .wrapper .nav .item .iconfont {
font-size: 38rpx;
margin-right: 10rpx;
}
.integral-details .wrapper .list {
background-color: #fff;
padding: 24rpx 30rpx;
}
.integral-details .wrapper .list .tip {
font-size: 25rpx;
width: 690rpx;
@ -357,22 +464,18 @@
font-size: 24rpx;
color: #999;
}
.integral-details .wrapper .list .item .state {
font-size: 28rpx;
color: #282828;
margin-bottom: 8rpx;
}
.integral-details .wrapper .list .item .num {
font-size: 36rpx;
}
.integral-details .wrapper .list2 {
background-color: #fff;
padding: 24rpx 0;
}
.integral-details .wrapper .list2 .item {
background-image: linear-gradient(to right, #fff7e7 0%, #fffdf9 100%);
width: 690rpx;
@ -383,7 +486,6 @@
padding: 0 25rpx 0 180rpx;
box-sizing: border-box;
}
.integral-details .wrapper .list2 .item .pictrue {
width: 90rpx;
height: 150rpx;
@ -391,19 +493,16 @@
bottom: 0;
left: 45rpx;
}
.integral-details .wrapper .list2 .item .pictrue image {
width: 100%;
height: 100%;
}
.integral-details .wrapper .list2 .item .name {
width: 285rpx;
font-size: 30rpx;
font-weight: bold;
color: #c8a86b;
}
.integral-details .wrapper .list2 .item .earn {
font-size: 26rpx;
color: #c8a86b;
@ -437,13 +536,16 @@
-moz-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
overflow: hidden;
.content {
height: 900rpx;
overflow-y: scroll;
/deep/ p {
font-size: 13px;
line-height: 22px;
}
/deep/ img {
max-width: 100%;
}
@ -456,7 +558,6 @@
top: 15rpx;
right: 15rpx;
}
.instructions .setAgCount .title {
color: #333;
font-size: 32rpx;
@ -473,4 +574,220 @@
height: 756rpx;
overflow-y: scroll;
}
.mer-integral-list{
width: 100vw;
background: #FFFFFF;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
.list-item:not(:last-child){
border-bottom: 2rpx solid #f6f6f6;// #f6f6f6
}
.list-item{
--item-height-value-: 100rpx;
width: 100vw;
padding: 20rpx 30rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.left-avatar{
width: 100rpx;
height: var(--item-height-value-);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
image{
width: 80rpx !important;
height: 80rpx !important;
border-radius: 50% !important;
}
}
.center-info{
width: calc(100% - 100rpx - 150rpx);
height: var(--item-height-value-);
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: center;
padding-left: 10rpx;
.info-top{
width: 100%;
height: calc(100rpx - 40rpx);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
.nickname{
font-size: 28rpx;
}
.custom-id{
background: #ffeed5;
padding: 0rpx 8rpx;
border-radius: 50rpx;
font-size: 23rpx;
color: #f8cc88;
width: max-content;
height: 30rpx;
line-height: 30rpx;
margin-left: 10rpx;
}
}
.info-bottom{
width: 100%;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #9e9e9e;
}
}
.right-btn{
width: 150rpx;
height: var(--item-height-value-);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
.give-btn{
background: #ea9a1f;
padding: 6rpx 15rpx;
border-radius: 50rpx;
font-size: 26rpx;
color: #FFFFFF;
width: max-content;
}
}
}
}
.integral-change{
width: 100vw;
display: inline-flex;
flex-direction: row;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
.integral-change-content{
width: calc(100vw - (20rpx * 2) - (30rpx * 2));
background: #FFFFFF;
border-radius: 20rpx;
padding: 20rpx;
.title{
width: 100%;
text-align: center;
font-size: 30rpx;
font-weight: 600;
height: 60rpx;
line-height: 45rpx;
margin-bottom: 35rpx;
}
.form-content{
width: 100%;
display: inline-flex;
flex-direction: column;
justify-content: center;
flex-wrap: nowrap;
align-items: flex-start;
.form-content-box:not(:last-child){
margin-bottom: 20rpx;
}
.form-content-box{
--box-width-: 240rpx;
width: 100%;
display: inline-flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: nowrap;
align-items: center;
line-height: 60rpx;
.box-title{
width: var(--box-width-);
text-align: right;
font-size: 28rpx;
}
.box-value{
width: calc(100% - var(--box-width-));
.image-size-set{
width: 210rpx;
height: 210rpx;
border: 2rpx solid #dddddd;
border-radius: 8rpx;
display: inline-flex;
flex-direction: row;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
image{
max-width: 100% !important;
max-height: 100% !important;
}
}
.upload-btn-box{
font-size: 24rpx;
color: #999999;
display: inline-flex;
flex-direction: column!important;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
.upload-btn-icon{
width: 45rpx !important;
}
}
}
}
.image-img{
position: relative;
border: unset!important;
.change-image-btn{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
font-size: 24rpx!important;
height: 40rpx;
line-height: 40rpx;
background: rgba(0,0,0,.5);
color: #FFFFFF;
}
}
}
.submit-button{
width: 100%;
margin-top: 60rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
.submit-btn{
color: #fff;
background-color: #437ffd;
border-color: #437ffd;
padding: 10rpx 25rpx;
font-size: 24rpx;
border-radius: 6rpx;
}
}
}
}
</style>