cashier_app/pages/list/render/MemberRechargeRuleRender.vue

149 lines
3.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
充值规则列表页面 数据渲染
业务 充值规则
@author terrfly
@site https://www.jeequan.com
@date 2022/11/30 07:07
-->
<template>
<view class="card">
<view class="card-content">
<view class="card-content-left">
<view class="rule">
<view class="rule-amount">
<text></text>
<text class="rule-amount-recharge">{{ cal.cert2Dollar(props.record.rechargeAmount) }}</text>
</view>
<view class="rule-amount">
<text></text>
<text class="rule-amount-give">{{ cal.cert2Dollar(props.record.giveAmount) }}</text>
</view>
</view>
<view class="rule-state">
<view class="order-spot" :style="{ backgroundColor: props.record.state ? '#09BB07' : '#CB2972' }"></view>
<text>{{ props.record.state ? '启用' : '禁用' }}</text>
</view>
</view>
<view class="card-content-right">
<image src="/static/member/edit.svg" @tap="editFunc(props.record.ruleId)"></image>
<view class="right-line"></view>
<image src="/static/member/delete.svg" @tap="deleteFunc(props.record.ruleId)"></image>
</view>
</view>
<JeepayPopupConfirm ref="jeepayPopupConfirmRef" />
</view>
</template>
<script setup>
import { reactive, ref } from 'vue'
import cal from '@/commons/utils/cal.js'
import go from '@/commons/utils/go.js'
import emit from '@/commons/utils/emit.js'
import infoBox from '@/commons/utils/infoBox.js'
import { reqLoad, API_URL_MEMBER_RECHARGE_RULES } from "@/http/apiManager.js"
const jeepayPopupConfirmRef = ref()
// 定义传入属性
const props = defineProps({
record: { type: Object, default: () => {} }, // 渲染对象
})
const editFunc = (ruleId) => {
go.to("PAGES_RECHARGE_RULE_EDIT", { ruleId: ruleId })
}
const deleteFunc = (ruleId) => {
jeepayPopupConfirmRef.value.open('确定删除规则?', { confirmColor: 'red' }).then(() => {
return reqLoad.delById(API_URL_MEMBER_RECHARGE_RULES, ruleId).then(() => {
infoBox.showSuccessToast("删除成功");
emit.pageEmit(emit.ENAME_REF_RECHARGE_RULE_LIST) // 更新列表
})
}).catch(() => {
})
}
</script>
<style lang="scss" scoped>
.card {
width: 711rpx;
margin: 0 auto;
}
.card-content {
height: 180rpx;
display: flex;
flex-direction: row;
border-radius: 20rpx;
background-color: $J-bg-ff;
margin: 20rpx 0;
}
.card-content-left {
width: 590rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 40rpx;
.rule {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
.rule-amount {
color: #808080ff;
font-size: 30rpx;
padding: 8rpx 0;
}
.rule-amount-recharge {
color: #000000ff;
font-size: 30rpx;
}
.rule-amount-give {
color: #3d8affff;
font-size: 30rpx;
}
}
.rule-state {
color: #000000ff;
font-size: 26rpx;
display: flex;
flex-direction: row;
align-items: center;
.order-spot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
}
text {
margin-left: 8rpx;
}
}
}
.card-content-right {
width: 120rpx;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
border-left: 2rpx solid rgba(0, 0, 0, 0.06);
image {
width: 40rpx;
height: 40rpx;
}
.right-line {
width: 100%;
border-bottom: 2rpx solid rgba(0, 0, 0, 0.06);
}
}
</style>