添加:权重值明细、转账、明细筛选

This commit is contained in:
wuhui_zzw 2023-09-27 18:10:56 +08:00
parent 52ea76344b
commit 1c9426f172
4 changed files with 1134 additions and 1 deletions

View File

@ -10338,7 +10338,38 @@ const routes = [
foot:true,
notKeepAliveKey:true
}
}
},
// 权重值相关
{
path: "/member/weight_value",
name: "weight_value",
component:()=>import("../views/member/weight_value/index"),
meta: {
title: "权重值",
foot: true
}
},
{
path: "/member/weight_value_transfer",
name: "weight_value_transfer",
component:()=>import("../views/member/weight_value/transfer"),
meta: {
title: "权重值转账",
foot: true
}
},
{
path: "/member/weight_value_detailed",
name: "weight_value_detailed",
component:()=>import("../views/member/weight_value/detailed"),
meta: {
title: "权重值明细",
foot: true
}
},
]
.concat(BlockChain)
.concat(customizedPlugin)

View File

@ -0,0 +1,315 @@
<template>
<div id="member_balance_detailed_v2">
<c-title :hide="false" :text="'权重值明细'"></c-title>
<div class="background_box"></div>
<div class="statusBox">
<div class="statusBox_left">
<div class="txt" :class="change_type == -1 ? 'showtxt' : ''" @click="selectStatus(-1)">全部</div>
<div class="txt" :class="change_type == 1 ? 'showtxt' : ''" @click="selectStatus(1)">收入</div>
<div class="txt" :class="change_type == 0 ? 'showtxt' : ''" @click="selectStatus(0)">支出</div>
</div>
</div>
<div class="timeSelect">
<div class="totalNum">支出{{expenditure}} 收入{{ income }}</div>
</div>
<div class="list">
<div class="lis" v-for="(info, index) in list" :key="index">
<div class="lisTop">
<div class="txtName">{{ info.remark }}</div>
<div class="price">{{ info.change_type == 1 ? "+" : "-" }}{{ info.change_quantity }}</div>
</div>
<div class="lisTop dob">
<div class="time">{{ info.created_at }}</div>
<div class="balance">余额{{ info.change_after }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { scrollMixin } from "utils/mixin";
export default {
mixins: [scrollMixin],
data() {
return {
//
list: [],
isLoadMore: true,
page: 1,
total_page: 0,
expenditure: 0,//
income: 0,//
change_type: -1,
};
},
methods: {
//
getData() {
let _this = this;
let json = {
search: {
change_type: _this.change_type,// 0=1=
},
page: _this.page
};
$http.post("finance.weight-value.record", json, "加载中...")
.then(response => {
if (response.result === 1) {
_this.isLoadMore = true;
if(_this.page === 1){
_this.total_page = response.data.last_page;
_this.list = response.data.list;
_this.expenditure = response.data.expenditure;//
_this.income = response.data.income;//
}else{
_this.list = _this.list.concat(response.data.list);
}
} else {
_this.noneShow = true;
_this.isLoadMore = false; //
_this.list = [];
}
})
.catch(error => {
console.log(error);
});
},
//
getMoreData() {
let _this = this;
if (!_this.isLoadMore) return;
_this.isLoadMore = false; //
if (_this.page >= _this.total_page) {
return;
} else {
_this.page += 1;
_this.getData();
}
},
//
selectStatus(key) {
this.isLoadMore = true;
this.page = 1;
this.total_page = 0;
this.list = [];
this.change_type = key;
this.getData();
},
},
activated() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.listTxt {
padding: 2rem 0;
}
@keyframes ident {
0% {
opacity: 0;
}
50% {
opacity: 0.75;
}
100% {
opacity: 1;
}
}
.showPosBox {
animation: ident 0.5s;
}
.background_box {
color: #382c0a;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
min-height: 9.25rem;
padding: 1.5938rem 1.0938rem 0 1.0938rem;
}
.statusBox {
margin: 0 0.625rem;
margin-top: -7rem;
margin-bottom: 0.625rem;
display: flex;
justify-content: space-between;
z-index: 1;
position: relative;
.statusBox_left {
display: flex;
font-size: 0.75rem;
color: #262626;
.txt {
line-height: 1.875rem;
width: 3.75rem;
}
.showtxt {
width: 3.75rem;
height: 1.875rem;
background: #fff;
border-radius: 0.9375rem;
}
}
.statusBox_right {
min-width: 5.3125rem;
height: 1.875rem;
background: #fdefbd;
border-radius: 0.3125rem;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.4688rem;
position: relative;
.txt {
flex: 1;
text-align: center;
}
.statusBox_right_pos {
background: #fdefbd;
position: absolute;
bottom: -4.3rem;
left: 0;
width: 100%;
z-index: 22222222;
border-radius: 0 0 0.3125rem 0.3125rem;
.postxt {
height: 1.5rem;
line-height: 1.5rem;
}
}
}
}
.list {
margin: 0 0.625rem;
padding: 0 0.875rem;
margin-top: 0.9375rem;
background: #fff;
border-radius: 0.625rem;
margin-bottom: 0.625rem;
.lis:first-child {
border: none;
}
.lis {
display: flex;
flex-direction: column;
padding: 0.9375rem 0;
border-bottom: 1px solid #f6f6f6;
.dob {
margin-top: 0.4688rem;
}
.lisTop {
display: flex;
justify-content: space-between;
align-items: center;
.txtName {
font-size: 14px;
}
.price {
font-size: 14px;
font-weight: 500;
color: #f20606;
}
.time {
font-size: 0.6875rem;
color: #999;
}
.balance {
font-size: 0.6875rem;
font-weight: 400;
color: #666;
}
}
}
}
.timeSelect {
margin-top: -5rem;
}
.timeSelect {
height: 2.5rem;
background: #fff;
border-radius: 0.625rem;
margin: 0 0.625rem;
display: flex;
padding: 0 0.9063rem;
align-items: center;
position: sticky;
top: 40px;
.timeBox {
flex-shrink: 0;
display: flex;
align-items: center;
.time {
margin-right: 0.5rem;
font-size: 0.8125rem;
}
}
.totalNum {
flex: 1;
text-align: right;
font-size: 14px;
color: #333;
}
}
.typeBox {
overflow-y: scroll;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
padding: 0.625rem;
padding-top: 1rem;
.lis {
width: 30%;
padding: 0.6rem 0.625rem;
border-radius: 0.1563rem;
background: #9999;
margin-right: 1rem;
margin-bottom: 0.625rem;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
.txt {
font-size: 12px;
}
}
.lis:nth-child(3n) {
margin-right: 0;
}
.lisBg {
background: var(--themeBaseColor) !important;
}
}
</style>

View File

@ -0,0 +1,360 @@
<template>
<div id="member_balance_v2">
<c-title :hide="false" text="权重值" tolink="detailed"></c-title>
<div class="background_box"></div>
<div class="contenbox">
<template>
<div class="detail">
<div class="txt">我的权重值</div>
<div class="balance">{{ dataInfo.weight_value }}</div>
<div class="detailBox">
<div class="detailBox_btn transfer" @click="goToPage('weight_value_transfer')">转账</div>
</div>
</div>
<div class="balanceDetail" v-if="Object.keys(dataInfo.list).length > 0">
<div class="title">
<div class="title_left">权重值明细</div>
<div class="title_right" @click="goToPage('weight_value_detailed')">
查看全部
<van-icon name="arrow" color="#878787" />
</div>
</div>
<div class="balanceDetail_lis" v-for="(item, index) in dataInfo.list" :key="index">
<div class="balanceDetail_lis_top">
<div class="balanceDetail_lis_top_left">{{ item.remark }}</div>
<div class="price">{{ item.change_type == 1 ? "+" : "" }}{{ item.change_quantity }}</div>
</div>
<div class="balanceDetail_lis_bottom">
<div class="time">{{ item.created_at }}</div>
<div class="balanceTxt">余额{{ item.change_after }}</div>
</div>
</div>
</div>
</template>
</div>
</div>
</template>
<script>
export default {
data() {
return {
dataInfo: {
weight_value: 0,
list: []
},
};
},
activated() {
this.getData();
},
methods: {
//
getData() {
let _this = this;
$http.get("finance.weight-value.index", {}, "加载中...").then(
(response) => {
if (response.result == 1) _this.dataInfo = response.data;
else _this.$dialog.alert({ message: response.msg });
},
function(response) {
_this.$dialog.alert({ message: response.msg });
}
);
},
//
goToPage(key, json = {}) {
this.$router.push(this.fun.getUrl(key, json));
},
}
};
</script>
<style lang="scss" scoped>
.van-dialog__message{
padding: 0 !important;
}
.icon-balance_p {
color: #f15353;
}
.icon-balance_a {
color: #6cbf6a;
}
.icon-balance_b {
color: #fac337;
}
.icon-balance_c {
color: #069ce7;
}
.background_box {
color: #382c0a;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
min-height: 12.125rem;
padding: 1.5938rem 1.0938rem 0 1.0938rem;
}
.contenbox {
padding: 0 0.625rem;
.dataStatistics {
padding: 0.75rem;
background: #fff;
margin-top: 0.5rem;
.title {
font-weight: bold;
font-size: 1rem;
text-align: left;
margin-bottom: 1.4375rem;
}
.navDateList {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 0.5rem;
.lis {
font-size: 0.75rem;
line-height: 1.03rem;
margin-right: 2rem;
padding: 0.25rem 0.75rem;
}
.lis:last-child {
margin-right: 0;
}
.isDay {
border-radius: 0.78rem;
background: var(--themeBaseColor);
color: #fff;
}
}
.list {
height: 3rem;
border-bottom: 1px solid #e7e7e7;
display: flex;
align-items: center;
justify-content: space-between;
.left {
width: 50%;
font-size: 0.81rem;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
.right {
width: 50%;
font-size: 0.81rem;
font-weight: bold;
color: #f20606;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
}
}
.list:last-child {
border-bottom: none;
}
}
.rests {
min-height: 6.875rem;
background: #fff;
border-radius: 0.625rem;
margin-top: 0.625rem;
padding: 0.9688rem 0.9063rem;
.title {
font-weight: bold;
font-size: 1rem;
text-align: left;
margin-bottom: 1.4375rem;
}
.lis {
display: flex;
flex-wrap: wrap;
.restslis {
width: 25%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.image_name {
width: 2.75rem;
height: 2.75rem;
margin-bottom: 0.7188rem;
img {
width: 100%;
height: 100%;
}
}
.image {
width: 1.5938rem;
height: 1.4688rem;
margin-bottom: 0.7188rem;
img {
width: 100%;
height: 100%;
}
}
.txt {
width: 100%;
}
}
}
}
.balanceDetail {
margin-top: 0.625rem;
border-radius: 0.625rem;
background: #fff;
padding: 0.9375rem 0.875rem;
.balanceDetail_lis {
border-bottom: 1px solid #f6f6f6;
padding: 0.9375rem 0;
.balanceDetail_lis_top,
.balanceDetail_lis_bottom {
display: flex;
justify-content: space-between;
}
.balanceDetail_lis_bottom {
margin-top: 0.625rem;
}
.balanceTxt {
font-weight: 400;
color: #666;
font-size: 0.6875rem;
}
.time {
color: #999;
font-size: 0.6875rem;
}
.balanceDetail_lis_top_left {
font-size: 0.8125rem;
font-weight: 500;
}
.price {
font-weight: 500;
color: #f20606;
font-size: 0.8125rem;
}
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
.title_left {
font-size: 1rem;
color: #333;
font-weight: bold;
}
.title_right {
color: #878787;
font-weight: 400;
font-size: 0.6875rem;
display: flex;
align-items: center;
}
}
}
.detail {
margin-top: -8rem;
background: #fff;
border-radius: 0.625rem;
// min-height: 11.25rem;
display: flex;
flex-direction: column;
align-items: center;
padding: 1.25rem 1.4063rem 0.625rem 1.4063rem;
.txt {
font-size: 0.8125rem;
color: #666;
}
.balance {
font-size: 1.375rem;
font-weight: bold;
color: #333;
}
.activityTxt {
width: 100%;
text-align: left;
font-weight: 400;
color: #f20606;
font-size: 0.625rem;
margin-top: 0.9063rem;
display: flex;
flex-wrap: wrap;
}
.detailBox {
display: flex;
width: 100%;
margin-top: 2.4rem;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
.detailBox_btn {
padding: 0.625rem 1.9375rem;
border-radius: 0.3125rem;
font-size: 0.75rem;
font-weight: 400;
}
.recharge {
border: 1px solid var(--themeBaseColor);
color: var(--themeBaseColor);
margin-right: 1.5rem;
}
.transfer {
border: 1px solid #b3b3b3;
color: #262626;
margin-right: 1.5rem;
}
.withdraw {
background: var(--themeBaseColor);
color: #fff;
}
}
}
}
</style>

View File

@ -0,0 +1,427 @@
<template>
<div id="balance_recharge">
<c-title :hide="false" text="权重值转账" tolink="detailed"></c-title>
<div class="background_box"></div>
<div class="main">
<div class="txt">当前权重值{{ weight_value }}</div>
<div class="detailBox">
<div class="zhbanlace">
<div class="title">受让人ID</div>
<input type="text" v-model.lazy="transfer_id" placeholder="请输入受让人ID" />
</div>
<ul class="personal_info" v-if="memberInfo">
<li v-if="memberInfo.nickname">
<span>昵称</span>
<span>{{ memberInfo.nickname }}</span>
</li>
<li v-if="memberInfo.realname">
<span>姓名</span>
<span>{{ memberInfo.realname }}</span>
</li>
</ul>
<div class="zzPrice">
<div class="title">转账权重值</div>
<div class="priceInpBox">
<input type="text" v-model="info_form.transfer_money" placeholder="0.00" />
</div>
</div>
<div class="btn" @click="beforeConfirm">确认转账</div>
</div>
</div>
<pay-keyboard :payKeyboardShow.sync="payKeyboardShow" @complete="payComplete"></pay-keyboard>
<van-dialog v-model="showConfirm" title="" show-cancel-button @confirm="confirm">
<div class="confirm-transfer-popup">
<div class="confirm-transfer-popup-li">受让人ID{{ transfer_id }}</div>
<div class="confirm-transfer-popup-li">受让人昵称{{ memberInfo.nickname }}</div>
<div class="confirm-transfer-popup-li">受让人姓名{{ memberInfo.realname }}</div>
<div class="confirm-transfer-popup-li">转账权重值{{ info_form.transfer_money }}</div>
<div class="confirm-transfer-popup-warn">您是否确定转账</div>
</div>
</van-dialog>
</div>
</template>
<script>
import { Toast } from "vant";
import payKeyboard from "components/payKeyboard";
import { payKeyboardAsync } from "utils/payKeyboard";
export default {
data() {
return {
weight_value: 0,
need_password: false, //
has_password: false, //
info_form: {
transfer_id: "",
transfer_money: ""
},
transfer_id: "",
memberInfo: "",
payKeyboardShow: false, //
showConfirm: false, //
deduct_point:{}
};
},
watch: {
transfer_id: function(new_transfer_id) {
var that = this;
$http
.get(
"member.member.memberInfo",
{
i: this.fun.getKeyByI(),
type: this.fun.getTyep(),
uid: this.transfer_id
},
"获取用户中"
)
.then(
function(response) {
if (response.result === 1) {
that.memberInfo = response.data;
} else {
Toast(response.msg);
}
},
function(response) {
Toast(response.msg);
}
);
}
},
computed:{
countDeduct(){
let ratio = Number(this.deduct_point.deduct_point) / Number(this.deduct_point.deduct_balance) ;
return Number(this.info_form.transfer_money * ratio).toFixed(0);
}
},
activated() {
this.getData();
},
methods: {
//
getData() {
let _this = this;
$http.get("finance.weight-value.member-weight-value", {}, " ")
.then(response => {
if (response.result === 1) {
_this.weight_value = response.data.weight_value;
_this.need_password = response.data.need_password;
_this.has_password = response.data.has_password;
} else {
_this.$dialog.alert({ message: response.msg }).then(() => {
_this.$router.go(-1);
});
}
}).catch(error => {
console.log(error);
});
},
//
beforeConfirm() {
//
if (parseFloat(this.info_form.transfer_money) > parseFloat(this.balance)) {
this.$dialog.alert({ message: "转让数量不可大于您的持有数量" });
return;
}
if (this.transfer_id == undefined || this.transfer_id <= 0 || this.transfer_id.length == 0) {
this.$dialog.alert({ message: "转让id不可为空" });
return;
}
if (this.info_form.transfer_money == undefined || this.info_form.transfer_money <= 0 || this.info_form.length == 0) {
this.$dialog.alert({ message: "转让数量不可低于等于0" });
return;
}
// if (this.need_password == true && this.has_password == false) {
// this.$dialog.confirm({ message: "" }).then(() => {
// this.$router.push(this.fun.getUrl("set_balance_password", {}));
// });
// return;
// }
this.showConfirm = true;
},
//
async confirm() {
var that = this;
let json = {
transfer_id: this.transfer_id,
transfer_money: this.info_form.transfer_money
};
// if (this.need_password == true) {
// //
// let pass = await this.getPayKeyboardPassword();
// json.password = pass;
// }
$http.get("finance.weight-value.transfer", json, " ").then(
function(response) {
if (response.result === 1) {
that.$dialog.alert({ message: response.msg }).then(() => {
that.$router.go(-1);
});
} else {
that.$dialog.alert({ message: response.msg });
}
}
).catch(error => {
console.log(error);
});
},
payComplete(text) {
console.log(text, "页面");
payKeyboardAsync.complete(text);
},
getPayKeyboardPassword() {
this.payKeyboardShow = true;
return new Promise((resove, reject) => {
payKeyboardAsync.addCompleteFn(pass => {
resove(pass);
});
});
// let pass = await this.getPayKeyboardPassword();
// console.log(pass);
},
},
components: { payKeyboard }
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#balance_recharge {
.background_box {
color: #382c0a;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
min-height: 12.125rem;
}
.main {
margin: 0 0.625rem;
margin-top: -5.5938rem;
.txt {
text-align: left;
margin-left: 0.4063rem;
}
.detailBox {
margin-top: 0.9375rem;
background: #fff;
box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, 0.11);
border-radius: 0.3125rem;
padding: 1.25rem 1.3438rem;
padding-top: 0;
.btn {
width: 17.4688rem;
height: 2.4375rem;
background: #f15353;
border-radius: 0.375rem;
font-size: 0.9688rem;
text-align: center;
line-height: 2.4375rem;
color: #fff;
margin: 0 auto;
margin-top: 2.4063rem;
}
.zzPrice {
margin-top: 1rem;
.title {
font-size: 0.8125rem;
color: #333;
text-align: left;
}
.priceInpBox {
border-bottom: 1px solid #f5f6f8;
padding-top: 1.5625rem;
// padding-bottom: 0.8438rem;
display: flex;
.priceTxt {
line-height: 2.5rem;
font-size: 0.9375rem;
}
input {
height: 100%;
flex: 1;
border: none;
width: 15.625rem;
margin-left: 1rem;
font-size: 1.5625rem;
}
}
.deduct{
text-align: left;
color: #FA8647;
}
}
.zhbanlace {
height: 2.9063rem;
display: flex;
align-items: center;
.title {
flex-shrink: 0;
font-size: 0.8125rem;
color: #333;
}
input {
height: 100%;
flex: 1;
border: none;
width: 15.625rem;
margin-left: 1rem;
border-bottom: #f5f6f8 1px solid;
}
}
.personal_info {
width: 100%;
background: #fff;
display: flex;
justify-content: center;
font-size: 0.8rem;
color: #f15353;
margin-top: 0.5625rem;
li {
display: flex;
font-size: 0.5rem;
text-align: left;
span:first-child {
display: block;
}
}
li:last-child {
margin-left: 0.625rem;
}
}
}
}
.content {
.transfer_info {
background: #fff;
padding-left: 0.875rem;
font-size: 16px;
.info_a,
.info_b {
line-height: 2.875rem;
border-bottom: solid 0.0625rem #ebebeb;
display: flex;
justify-content: flex-start;
span:first-child {
width: 6.875rem;
display: block;
text-align: left;
}
input {
border: none;
width: 15.625rem;
}
}
}
.transfer_sum {
background: #fff;
padding: 0.625rem 0.875rem;
span {
display: block;
font-size: 16px;
line-height: 2.5rem;
text-align: left;
}
.sum {
text-align: left;
font-size: 24px;
input {
margin-left: 0.375rem;
line-height: 3.75rem;
width: 90%;
font-size: 36px;
border: none;
}
}
}
.btn {
width: 21.5625rem;
margin: 1.25rem auto;
height: 2.875rem;
border-radius: 0.25rem;
font-size: 16px;
color: #fff;
background: #f15353;
border: none;
}
}
.my_wrapper {
background: #fff;
overflow: hidden;
display: flex;
padding: 0 0.875rem;
span {
text-align: left;
font-size: 16px;
/* line-height: 1; */
}
.my-value {
flex: 2;
text-align: left;
span {
color: #f15353;
}
}
}
#wrapper {
border-bottom: solid 0.0625rem #d9d9d9;
margin-top: 0.625rem;
}
.confirm-transfer-popup {
padding: 1rem;
.confirm-transfer-popup-li {
font-size: 12px;
text-align: left;
margin-bottom: 10px;
}
.confirm-transfer-popup-warn {
text-align: center;
color: #f15353;
font-size: 16px;
}
}
}
</style>