build(custom): 修正提交规范

This commit is contained in:
2023-11-09 19:49:24 +08:00
parent 76d57cea37
commit 29c1d4280f
105 changed files with 29374 additions and 18618 deletions

View File

@@ -1,65 +1,83 @@
<script lang="ts" setup>
import {ref, h} from 'vue'
import Taro from '@tarojs/taro'
import {getWithdrawList, addWithdraw} from '@/api/admin'
import { ref, h } from "vue";
import Taro from "@tarojs/taro";
import { getWithdrawList, addWithdraw } from "@/api/admin";
const user_info = Taro.getStorageSync('userInfo')
const user_info = Taro.getStorageSync("userInfo");
const row = ref(0)
const row = ref(0);
const basicData = ref({
num: ''
})
num: "",
});
const showPreview = ref(false)
const showPreview = ref(false);
const imgData = ref([{
src: ''
}])
const imgData = ref([
{
src: "",
},
]);
const columns = ref([
{
title: '时间',
key: 'add_time',
align: 'center'
}, {
title: '提现金额',
key: 'integral',
align: 'center',
render: (row: { integral: number; }) => {
return h('view', {}, row.integral / 100)
}
title: "时间",
key: "add_time",
align: "center",
},
{
title: '审核状态',
key: 'status',
align: 'center',
render: (row: { status: number; }) => {
return h('view', {
class: `tag ${row.status === 1 ? 'success' : row.status === 2 ? 'danger' : 'warning'}`
}, {
default: () => row.status === 1 ? '已打款' : row.status === 2 ? '已拒绝' : '待审核'
})
}
title: "提现金额",
key: "integral",
align: "center",
render: (row: { integral: number }) => {
return h("view", {}, row.integral / 100);
},
},
{
title: '备注',
key: 'img',
align: 'center',
render: (row: { status_img: string; }) => {
return h('img', {
class: 'image',
onClick: () => {
imgData.value[0].src = row.status_img
showPreview.value = true
title: "审核状态",
key: "status",
align: "center",
render: (row: { status: number }) => {
return h(
"view",
{
class: `tag ${
row.status === 1
? "success"
: row.status === 2
? "danger"
: "warning"
}`,
},
src: row.status_img
})
}
}
])
{
default: () =>
row.status === 1
? "已打款"
: row.status === 2
? "已拒绝"
: "待审核",
}
);
},
},
{
title: "备注",
key: "img",
align: "center",
render: (row: { status_img: string }) => {
return h("img", {
class: "image",
onClick: () => {
imgData.value[0].src = row.status_img;
showPreview.value = true;
},
src: row.status_img,
});
},
},
]);
const data = ref([])
const data = ref([]);
const pagination = ref({
page: 1,
@@ -67,61 +85,67 @@ const pagination = ref({
showPageSize: 5,
totalItems: 0,
change: (page: number) => {
pagination.value.page = page
getData()
}
})
pagination.value.page = page;
getData();
},
});
const hideFn = () => {
showPreview.value = false
}
showPreview.value = false;
};
Taro.useLoad(() => {
getData()
})
getData();
});
const getData = async () => {
try {
const res = await getWithdrawList({
PageNum: pagination.value.page,
PageSize: pagination.value.showPageSize,
Bid: user_info.bid
})
data.value = res.data.data || []
pagination.value.totalItems = res.data.total
row.value = res.data.integral || 0
console.log(res)
Bid: user_info.bid,
});
data.value = res.data.data || [];
pagination.value.totalItems = res.data.total;
row.value = res.data.integral || 0;
console.log(res);
} catch (e) {
throw e
throw e;
}
}
};
const add = async () => {
try {
if (Number(basicData.value.num) === 0) return Taro.showToast({
title: '提现积分需大于0',
icon: 'none'
})
if (Number(basicData.value.num) === 0)
return Taro.showToast({
title: "提现积分需大于0",
icon: "none",
});
const res = await addWithdraw({
Bid: user_info.bid,
Number: Number(basicData.value.num)
})
Number: Number(basicData.value.num),
});
Taro.showToast({
title: res.msg,
icon: 'none'
})
await getData()
icon: "none",
});
await getData();
} catch (e) {
throw e
throw e;
}
}
};
</script>
<template>
<view>
<nut-form>
<nut-form-item label="提现积分:">
<nut-input v-model="basicData.num" class="nut-input-text" placeholder="请输入提现积分" type="text"/>
<nut-input
v-model="basicData.num"
class="nut-input-text"
placeholder="请输入提现积分"
type="text"
/>
</nut-form-item>
<nut-form-item>
<view>
@@ -141,19 +165,24 @@ const add = async () => {
<view v-if="data.length > 0">
<view class="data">
<nut-table :columns="columns" :data="data"></nut-table>
<nut-pagination class="pagination" v-model="pagination.page" :total-items="pagination.totalItems"
:items-per-page="pagination.itemsPerPage" :show-page-size="pagination.showPageSize"
@change="pagination.change" :bordered="false"/>
<nut-pagination
class="pagination"
v-model="pagination.page"
:total-items="pagination.totalItems"
:items-per-page="pagination.itemsPerPage"
:show-page-size="pagination.showPageSize"
@change="pagination.change"
:bordered="false"
/>
</view>
</view>
<nut-empty v-else description="暂无提现记录"></nut-empty>
<!-- 图片预览 -->
<nut-image-preview :show="showPreview" :images="imgData" @close="hideFn"/>
<nut-image-preview :show="showPreview" :images="imgData" @close="hideFn" />
</view>
</template>
<style lang="scss">
.text-red {
color: red;
}
@@ -194,4 +223,4 @@ const add = async () => {
width: 50px;
height: 50px;
}
</style>
</style>