fix(mall): 修复会员兑换碳币权限及数据展示问题- 修改会员兑换碳币权限判断逻辑,使用 withdrawState 替代 changeState
- 调整 ApiRunDataVo 中 score 和 realScore 字段含义,确保数据展示正确
- 更新 buyVipList.html 中状态颜色,以更直观地显示不同状态
3 files modified
16 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/ApiRunDataVo.java 4 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/runVip/buyVipList.html 10 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -485,7 +485,7 @@
         * 用户的等级level是否允许兑换碳币
         */
        RunVip runVip = runVipMapper.selectOne(new LambdaQueryWrapper<RunVip>().eq(RunVip::getVipCode, loginMember.getLevel()));
        if(ObjectUtil.isEmpty(runVip) || runVip.getChangeState() != YesOrNoEnum.YES.getValue()){
        if(ObjectUtil.isEmpty(runVip) || runVip.getWithdrawState() != YesOrNoEnum.YES.getValue()){
            throw new FebsException("请先升级会员");
        }
src/main/java/cc/mrbird/febs/mall/vo/ApiRunDataVo.java
@@ -11,13 +11,13 @@
public class ApiRunDataVo {
    @ApiModelProperty(value = "我的碳积分")
    private Integer score = 0;//今日累计获得
    private Integer  realScore = 0;//今日剩余
    @ApiModelProperty(value = "碳币")
    private BigDecimal  balance = BigDecimal.ZERO;
    @ApiModelProperty(value = "今日行走")
    private Integer  realScore = 0;//今日剩余
    private Integer score = 0;//今日累计获得
    @ApiModelProperty(value = "今日目标")
    private Integer  aimScore = 0;//当前等级每日获取的最大值
src/main/resources/templates/febs/views/modules/runVip/buyVipList.html
@@ -48,12 +48,12 @@
        </div>
    </div>
</div>
<script type="text/html" id="stateType">
<script type="text/html" id="statesType">
    {{#
    var state = {
    2: {title: '进行中', color: 'volcano'},
    1: {title: '成功', color: 'green'},
    0: {title: '失败', color: 'blue'}
    2: {title: '进行中', color: 'green'},
    1: {title: '成功', color: 'blue'},
    0: {title: '失败', color: 'red'}
    }[d.state];
    }}
    <span class="layui-badge febs-bg-{{state.color}}">{{ state.title }}</span>
@@ -137,7 +137,7 @@
                    {field: 'amount', title: '金额', minWidth: 100,align:'center',totalRow: '{{= parseInt(d.amount) }}'},
                    {field: 'type', title: '链', minWidth: 100,align:'center'},
                    {field: 'address', title: '地址', minWidth: 100,align:'center'},
                    {title: '状态', templet: '#stateType', minWidth: 100,align:'center'},
                    {title: '状态', templet: '#statesType', minWidth: 100,align:'center'},
                    {field: 'failTime', title: '失效时间', minWidth: 180,align:'center'},
                    {field: 'vipCnt', title: '数量', minWidth: 100,align:'center'},
                    {field: 'createdTime', title: '创建时间', minWidth: 180,align:'center'},