Commit c6874dc8 authored by zhuang_cong's avatar zhuang_cong

update

parent ad6d858d
export const AsstesRecordType = { export const AssetsRecordType = {
ALIPAY_IN: 1, ALIPAY_IN: 1,
ALIPAY_OUT: 2, ALIPAY_OUT: 2,
WX_IN: 3, WX_IN: 3,
...@@ -25,95 +25,95 @@ export const AsstesRecordType = { ...@@ -25,95 +25,95 @@ export const AsstesRecordType = {
} }
export const AssetsRecordTypeObj = { export const AssetsRecordTypeObj = {
[AsstesRecordType.ALIPAY_IN]: { [AssetsRecordType.ALIPAY_IN]: {
label: "支付宝", label: "支付宝",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.ALIPAY_OUT]: { [AssetsRecordType.ALIPAY_OUT]: {
label: "支付宝", label: "支付宝",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.WX_IN]: { [AssetsRecordType.WX_IN]: {
label: "微信支付", label: "微信支付",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.WX_OUT]: { [AssetsRecordType.WX_OUT]: {
label: "微信支付", label: "微信支付",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.COIN_IN]: { [AssetsRecordType.COIN_IN]: {
label: "数字资产转入", label: "数字资产转入",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.COIN_OUT]: { [AssetsRecordType.COIN_OUT]: {
label: "数字资产转出", label: "数字资产转出",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.RECHARGE]: { [AssetsRecordType.RECHARGE]: {
label: "充值", label: "充值",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.WITHDRAW_CASH]: { [AssetsRecordType.WITHDRAW_CASH]: {
label: "提现", label: "提现",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.PAY]: { [AssetsRecordType.PAY]: {
label: "支付", label: "支付",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.REFUND]: { [AssetsRecordType.REFUND]: {
label: "退款", label: "退款",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.SALE]: { [AssetsRecordType.SALE]: {
label: "销售", label: "销售",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.RELEASE]: { [AssetsRecordType.RELEASE]: {
label: "发行", label: "发行",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.ADD_RELEASE]: { [AssetsRecordType.ADD_RELEASE]: {
label: "增发", label: "增发",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.RECOVERY]: { [AssetsRecordType.RECOVERY]: {
label: "回收", label: "回收",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.REDUCE_RELEASE]: { [AssetsRecordType.REDUCE_RELEASE]: {
label: "减发", label: "减发",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.WITHDRAW_COIN]: { [AssetsRecordType.WITHDRAW_COIN]: {
label: "提币", label: "提币",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.DEDUCTION]: { [AssetsRecordType.DEDUCTION]: {
label: "扣除", label: "扣除",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.WITHDRAW_GOODS]: { [AssetsRecordType.WITHDRAW_GOODS]: {
label: "提货", label: "提货",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.COMMENT_REWARD]: { [AssetsRecordType.COMMENT_REWARD]: {
label: "评论奖励", label: "评论奖励",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.TRANSFER_GIFT_IN]: { [AssetsRecordType.TRANSFER_GIFT_IN]: {
label: "转赠", label: "转赠",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.TRANSFER_GIFT_OUT]: { [AssetsRecordType.TRANSFER_GIFT_OUT]: {
label: "转赠", label: "转赠",
symbol: "-" symbol: "-"
}, },
[AsstesRecordType.INVITE_REGISTER_REWARD]: { [AssetsRecordType.INVITE_REGISTER_REWARD]: {
label: "邀请注册奖励", label: "邀请注册奖励",
symbol: "+" symbol: "+"
}, },
[AsstesRecordType.REGISTER_REWARD]: { [AssetsRecordType.REGISTER_REWARD]: {
label: "注册奖励", label: "注册奖励",
symbol: "+" symbol: "+"
}, },
...@@ -122,4 +122,23 @@ export const AssetsRecordTypeObj = { ...@@ -122,4 +122,23 @@ export const AssetsRecordTypeObj = {
export const TransferType = { export const TransferType = {
SINGLE: 1, SINGLE: 1,
PACKAGE: 2 PACKAGE: 2
}
export const AssetsRecordStatus = {
FAIL: 1,
SUCCESS: 2,
CONFIRM: 3
}
export const AssetsRecordStatusObj = {
[AssetsRecordStatus.FAIL]: {
label: "失败",
},
[AssetsRecordStatus.SUCCESS]: {
label: "成功",
},
[AssetsRecordStatus.CONFIRM]: {
label: "确认中",
},
} }
\ No newline at end of file
...@@ -97,6 +97,7 @@ const ViewsCom = { ...@@ -97,6 +97,7 @@ const ViewsCom = {
IntegralDetail: () => import("@/views/user-center/assets/integral/detail"), IntegralDetail: () => import("@/views/user-center/assets/integral/detail"),
IntegralTransfer: () => import("@/views/user-center/assets/integral/transfer"), IntegralTransfer: () => import("@/views/user-center/assets/integral/transfer"),
IntegralCollection: () => import("@/views/user-center/assets/integral/collection"), IntegralCollection: () => import("@/views/user-center/assets/integral/collection"),
AssetsRecordDetail: () => import("@/views/user-center/assets/record-detail"),
// 优惠券 // 优惠券
CouponList: () => import("@/views/user-center/coupon/index"), CouponList: () => import("@/views/user-center/coupon/index"),
...@@ -658,6 +659,15 @@ const routes = [ ...@@ -658,6 +659,15 @@ const routes = [
name: 'integral-collection', name: 'integral-collection',
component: ViewsCom.IntegralCollection, component: ViewsCom.IntegralCollection,
}, },
{
path: '/user-center/assets/record-detail',
name: 'assets-record-detail',
component: ViewsCom.AssetsRecordDetail,
meta: {
showNavBar: true,
title: "交易记录详情"
},
},
// 优惠券 // 优惠券
{ {
path: '/user-center/coupon/list', path: '/user-center/coupon/list',
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
:skuId="skuId" :skuId="skuId"
:tab="item" :tab="item"
:index="tabIndex" :index="tabIndex"
:assets="userAssets"
/> />
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
......
...@@ -6,13 +6,18 @@ ...@@ -6,13 +6,18 @@
:up="upOptions" :up="upOptions"
> >
<div class="list-wrap"> <div class="list-wrap">
<div class="list-item" v-for="item of ListData" :key="item.id"> <div
class="list-item"
v-for="item of ListData"
:key="item.id"
@click="goRecordDetail(item)"
>
<div class="item-top flex-default"> <div class="item-top flex-default">
<div class="number" :class="{ reduce: item.type === 18 }"> <div class="number" :class="{ reduce: item.typeObj.symbol == '-' }">
{{ AssetsRecordTypeObj[item.type].symbol }}{{ item.amount }} {{ AssetsRecordTypeObj[item.type].symbol }}{{ item.amount }}
</div> </div>
<div class="status" :class="{ fail: item.status === 1 }"> <div class="status" :class="{ fail: item.status == AssetsRecordStatus.FAIL }">
{{ item.status === 1 ? "失败" : "成功" }} {{ AssetsRecordStatusObj[item.status].label }}
</div> </div>
</div> </div>
<div class="item-footer flex-default"> <div class="item-footer flex-default">
...@@ -32,19 +37,27 @@ ...@@ -32,19 +37,27 @@
<script> <script>
import { MescrollMixin, MescrollMoreItemMixin } from "@/mixins"; import { MescrollMixin, MescrollMoreItemMixin } from "@/mixins";
import { formatTime } from "@/utils/common"; import { formatTime } from "@/utils/common";
import { AssetsRecordType, AssetsRecordTypeObj } from "@/enums"; import {
AssetsRecordType,
AssetsRecordTypeObj,
AssetsRecordStatus,
AssetsRecordStatusObj,
} from "@/enums";
export default { export default {
mixins: [MescrollMixin, MescrollMoreItemMixin], mixins: [MescrollMixin, MescrollMoreItemMixin],
props: { props: {
coin: String, coin: String,
tab: Object, tab: Object,
index: Number, index: Number,
skuId: String skuId: String,
assets: Object,
}, },
data() { data() {
return { return {
AssetsRecordType, AssetsRecordType,
AssetsRecordTypeObj, AssetsRecordTypeObj,
AssetsRecordStatus,
AssetsRecordStatusObj,
downOptions: { downOptions: {
autoShowLoading: false, autoShowLoading: false,
auto: false, auto: false,
...@@ -80,9 +93,15 @@ export default { ...@@ -80,9 +93,15 @@ export default {
payment: this.tab.payment, payment: this.tab.payment,
page: page.num, page: page.num,
size: page.size, size: page.size,
skuId: this.skuId skuId: this.skuId,
}, },
success: (res) => { success: (res) => {
if (res.data) {
res.data.forEach((item) => {
item.typeObj = { ...AssetsRecordTypeObj[item.type] } || {};
});
}
if (page.num == 1) { if (page.num == 1) {
this.ListData = res.data; this.ListData = res.data;
} else { } else {
...@@ -104,6 +123,44 @@ export default { ...@@ -104,6 +123,44 @@ export default {
upCallback(page) { upCallback(page) {
this.requestData(page); this.requestData(page);
}, },
goRecordDetail(item) {
let data = {
title: this.assets.skuVo.name,
num: (item.typeObj.symbol || "") + item.amount,
status: AssetsRecordStatusObj[item.status].label,
infoList: [
{ label: "交易类型", val: item.typeObj.label },
{ label: "TokenID", val: this.assets.coin },
{ label: "交易时间", val: formatTime(item.createTime) },
],
};
if (item.status == AssetsRecordStatus.SUCCESS && item.hash) {
data.infoList.push({ label: "交易哈希", val: item.hash, hash: true });
}
if (!item.note) {
item.note = "--";
}
switch (+item.type) {
case AssetsRecordType.TRANSFER_GIFT_IN:
data.infoList = data.infoList.concat([
{ label: "转赠人地址", val: item.otherSide },
{ label: "受赠人地址", val: this.assets.address },
{ label: "备注", val: item.note },
]);
break;
case AssetsRecordType.TRANSFER_GIFT_OUT:
data.infoList = data.infoList.concat([
{ label: "转赠人地址", val: this.assets.address },
{ label: "受赠人地址", val: item.otherSide },
{ label: "备注", val: item.note },
]);
break;
default:
break;
}
this.$router.push({ name: "assets-record-detail", query: data });
},
}, },
}; };
</script> </script>
......
<template>
<div class="assets-record-detail-con bg-grey">
<div class="detail-con">
<p class="name">{{ data.title }}</p>
<p class="num">{{ data.num }}</p>
<p class="status">{{ data.status }}</p>
<div class="info-con">
<div
class="info-item"
v-for="(item, index) of data.infoList"
:key="`info-item-${index}`"
>
<div class="label">{{ item.label }}</div>
<div
class="val"
:class="{ 'hash-link': item.hash && !!item.val }"
@click="handleClick(item)"
>
{{ item.val || "--" }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
data: {
infoList: [],
},
};
},
methods: {
handleClick(item) {
// if (item.hash && item.val) {
// this.goChainExploreTxDetail(item.val);
// }
},
},
mounted() {
this.data = this.$route.query;
},
};
</script>
<style lang="less">
.assets-record-detail-con {
padding: 0 16px;
> .detail-con {
margin-top: 50px;
padding: 30px 20px;
background: #ffffff;
border-radius: 6px;
> .name {
text-align: center;
font-weight: bold;
font-size: 14px;
margin-bottom: 15px;
}
> .num {
text-align: center;
font-size: 30px;
margin-bottom: 12px;
font-family: DINAlternate-Bold;
}
> .status {
text-align: center;
color: #999999;
font-size: 14px;
margin-bottom: 20px;
}
> .info-con {
padding-top: 20px;
border-top: 1px solid #f1f1f1;
.info-item {
display: flex;
align-items: flex-start;
margin-bottom: 12px;
}
.info-item .label {
width: 70px;
margin-right: 20px;
color: #666666;
font-size: 14px;
}
.info-item .val {
flex: 1;
word-break: break-all;
font-size: 14px;
// &.hash-link {
// color: #4a9bf7;
// }
}
}
}
}
</style>
\ No newline at end of file
...@@ -64,8 +64,8 @@ module.exports = { ...@@ -64,8 +64,8 @@ module.exports = {
// target: 'http://172.22.20.64:8100/root' // target: 'http://172.22.20.64:8100/root'
// target: 'http://172.22.17.176:12008' // target: 'http://172.22.17.176:12008'
// target: 'http://172.22.17.108:12008' // target: 'http://172.22.17.108:12008'
target: 'https://mall.inmvo.com/root' // target: 'https://mall.inmvo.com/root'
// target: 'https://testym.8n.cn/root' target: 'https://testym.8n.cn/root'
}, },
'/chat': { '/chat': {
pathRewrite: { pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment