Commit ef3812d4 by liuliufashi

updater

parent d35dd5bb
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<template v-if="column.key === 'price'"> <template v-if="column.key === 'price'">
<div>{{ record.price / 100 }}</div> <div>{{ record.price / 100 }}</div>
</template> </template>
<template v-if="column.key === 'sellamount'">
<div>{{ record.sellamount / 100 }}</div>
</template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<div v-if="record.status === 0" style="color: rgb(12, 191, 33);">正常</div> <div v-if="record.status === 0" style="color: rgb(12, 191, 33);">正常</div>
<div v-else style="color: #f56c6c;">已下架</div> <div v-else style="color: #f56c6c;">已下架</div>
...@@ -186,12 +189,12 @@ const columns = [ ...@@ -186,12 +189,12 @@ const columns = [
dataIndex: "sellcount", dataIndex: "sellcount",
}, },
{ {
title: "默认金额", title: "默认单价(元)",
key: "price", key: "price",
dataIndex: "price", dataIndex: "price",
}, },
{ {
title: "已售金额", title: "已售金额(元)",
key: "sellamount", key: "sellamount",
dataIndex: "sellamount", dataIndex: "sellamount",
}, },
......
<template> <template>
<div> <div>
<div style="display: flex;margin-bottom: 20px;"> <div style="display: flex;margin-bottom: 20px;">
<a-input-search v-model:value="value" placeholder="请输入订单号" style="width: 200px" @search="onSearchOrd" /> <a-input-search v-model:value="value" placeholder="请输入订单号" style="width: 200px" @search="onSearchOrd" />
</div> </div>
<a-table :columns="columns" :data-source="list" @change="tableChange" :pagination="pagination" :scroll="{ y: 'calc(100vh - 300px)' }"> <a-table :columns="columns" :data-source="list" @change="tableChange" :pagination="pagination"
<template #bodyCell="{ column, record }"> :scroll="{ y: 'calc(100vh - 300px)' }">
<template v-if="column.key === 'amount'"> <template #bodyCell="{ column, record }">
<div v-if="record.amount"> <template v-if="column.key === 'amount'">
<div>{{ record.amount/100 }}</div> <div v-if="record.amount">
</div> <div>{{ record.amount / 100 }}</div>
</div>
</template>
<template v-if="column.key === 'nickname'"> </template>
<div v-if="record.nickname"> <template v-if="column.key === 'nickname'">
<div>{{ record.nickname }}</div> <div v-if="record.nickname">
</div> <div>{{ record.nickname }}</div>
<div v-else> </div>
~ <div v-else>
</div> ~
</template> </div>
<template v-if="column.key === 'creator'"> </template>
<div v-if="record.creator"> <template v-if="column.key === 'creator'">
<div>{{ record.creator }}</div> <div v-if="record.creator">
</div> <div>{{ record.creator }}</div>
<div v-else> </div>
~ <div v-else>
</div> ~
</template> </div>
<template v-if="column.key === 'headimgurl'"> </template>
<div v-if="record.headimgurl"> <template v-if="column.key === 'headimgurl'">
<a-image :width="50" :src="record.headimgurl" /> <div v-if="record.headimgurl">
</div> <a-image :width="50" :src="record.headimgurl" />
<div v-else> </div>
~ <div v-else>
</div> ~
</template> </div>
</template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<div v-if="record.status === 0" style="color: rgb(245, 108, 108);"> <div v-if="record.status === 0" style="color: rgb(245, 108, 108);">
未支付 未支付
</div> </div>
<div v-else style="color: rgb(12, 191, 33);"> <div v-else style="color: rgb(12, 191, 33);">
已支付 已支付
</div> </div>
</template>
<template v-if="column.key === 'paytype'">
<div v-if="record.paytype === 1">
微信
</div>
<div v-else-if="record.paytype === 2">
支付宝
</div>
<div v-else>
未知
</div>
</template>
</template> </template>
</template> </a-table>
</a-table>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -53,22 +65,31 @@ import { onMounted, ref, defineExpose } from 'vue'; ...@@ -53,22 +65,31 @@ import { onMounted, ref, defineExpose } from 'vue';
import { onFindPayInfo, onFindPayOrderid } from '@/api/index' import { onFindPayInfo, onFindPayOrderid } from '@/api/index'
import { getUid } from '@/utils/userInfo' import { getUid } from '@/utils/userInfo'
const columns = [ const columns = [
{
title: '订单号',
dataIndex: 'id',
key: 'id',
},
{ {
title: '商品名', title: '商品名',
dataIndex: 'subject', dataIndex: 'subject',
key: 'subject', key: 'subject',
}, },
{ {
title: '金额', title: '金额(元)',
dataIndex: 'amount', dataIndex: 'amount',
key: 'amount', key: 'amount',
}, },
{ {
title: '订单号', title: '订单时间',
dataIndex: 'id', dataIndex: 'updatetime',
key: 'id', key: 'updatetime',
}, },
{
title: '头像',
dataIndex: 'headimgurl',
key: 'headimgurl',
},
{ {
title: '昵称', title: '昵称',
dataIndex: 'nickname', dataIndex: 'nickname',
...@@ -79,21 +100,19 @@ const columns = [ ...@@ -79,21 +100,19 @@ const columns = [
dataIndex: 'creator', dataIndex: 'creator',
key: 'creator', key: 'creator',
}, },
{ {
title: '头像', title: '支付渠道',
dataIndex: 'headimgurl', dataIndex: 'paytype',
key: 'headimgurl', key: 'paytype',
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
}, },
{
title: '订单时间',
dataIndex: 'updatetime',
key: 'updatetime',
},
]; ];
let list = ref<any>([]) let list = ref<any>([])
let value = ref<any>('') let value = ref<any>('')
...@@ -134,20 +153,20 @@ const onSearch = async () => { ...@@ -134,20 +153,20 @@ const onSearch = async () => {
} }
} }
} }
const onSearchOrd =async()=>{ const onSearchOrd = async () => {
const uid = getUid() const uid = getUid()
const prarms= { const prarms = {
orderid:value.value, orderid: value.value,
uid uid
} }
const data:any = await onFindPayOrderid(prarms) const data: any = await onFindPayOrderid(prarms)
if (data.state === 1) { if (data.state === 1) {
list.value = [data.data] list.value = [data.data]
pagination.value.total = data.data.count pagination.value.total = data.data.count
} }
} }
const tableChange = async (e:any) => { const tableChange = async (e: any) => {
const uid = getUid() const uid = getUid()
const prarms: any = { const prarms: any = {
page: e.current, page: e.current,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</a-checkbox> </a-checkbox>
<div style="margin-left:20px;">收款账户</div> <div style="margin-left:20px;">收款账户</div>
<div style="margin-left:20px;color: black;" v-if="listValue[index] &&listValue[index].paytype == 1">{{listValue[index].name}}</div> <div style="margin-left:20px;color: black;" v-if="listValue[index] &&listValue[index].paytype == 1">{{listValue[index].name}}</div>
<div style="margin-left:20px;color: black;" v-else-if="listValue[index] &&listValue[index].paytype == 2">{{listValue[index].payname}}</div> <div style="margin-left:20px;color: black;" v-else-if="listValue[index] &&listValue[index].paytype == 2">{{listValue[index].name}}</div>
<div style="margin-left:20px;color: black;" v-else>默认</div> <div style="margin-left:20px;color: black;" v-else>默认</div>
<div style="margin-left:20px;color: rgb(15, 64, 245);cursor: pointer;" @click="onSet(item.label)">设置</div> <div style="margin-left:20px;color: rgb(15, 64, 245);cursor: pointer;" @click="onSet(item.label)">设置</div>
</div> </div>
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<a-radio-group v-model:value="modalvalue"> <a-radio-group v-model:value="modalvalue">
<div v-for="item in list" :itemkey="item.id"> <div v-for="item in list" :itemkey="item.id">
<a-radio v-if="item.paytype == 1" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio> <a-radio v-if="item.paytype == 1" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio>
<a-radio v-else-if="item.paytype == 2" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio> <a-radio v-else-if="item.paytype == 2" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item}}</a-radio>
</div> </div>
</a-radio-group> </a-radio-group>
</a-modal> </a-modal>
......
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