123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <template>
- <div class="page">
- <van-list
- v-model="isLoadingMore"
- :finished="finished"
- :immediate-check="false"
- :finished-text="total ? '没有更多了' : ''"
- @load="onLoadMore"
- >
- <div class="page-top flex flex-col justify-center items-center">
- <!-- <img class="logo" :src="supplierInfo.logo" /> -->
- <div
- class="name mt-2"
- v-text="supplierInfo.shopName + '认证记录'"
- ></div>
- </div>
- <div class="page-content">
- <template v-if="list.length > 0">
- <div class="page-title">设备认证</div>
- <div
- class="device-list"
- v-for="item in list"
- :key="item.productId"
- @click="toEdit(item)"
- >
- <div class="device">
- <div class="name">
- <span class="label">设备名称:</span>
- <span class="content">{{
- item.productName ? item.productName : ''
- }}</span>
- </div>
- <div class="status" :class="auditStatusColor(item.auditStatus)">
- <span class="label">状态:</span>
- <span class="content">{{
- item.auditStatus | auditStatusFilter
- }}</span>
- </div>
- </div>
- </div>
- </template>
- <template v-else>
- <SimpleEmpty name="icon-empty-device.png" description="暂无设备~" />
- </template>
- </div>
- </van-list>
- </div>
- </template>
- <script>
- import SimpleEmpty from '@/components/SimpleEmpty'
- import { mapGetters } from 'vuex'
- export default {
- layout: 'app',
- components: {
- SimpleEmpty,
- },
- data() {
- return {
- isLoadingMore: true,
- finished: false,
- isRequest: true,
- list: [],
- listQuery: {
- authId: 0,
- listType: 2,
- pageNum: 1,
- pageSize: 10,
- },
- total: 0,
- }
- },
- filters: {
- auditStatusFilter(value) {
- // 认证状态:0审核未通过,1审核通过,2待审核
- const map = {
- 0: '审核未通过',
- 1: '审核通过',
- 2: '待审核',
- }
- return map[value]
- },
- },
- created() {
- this.initData()
- },
- computed: {
- ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'authId']),
- },
- methods: {
- toEdit(item) {
- this.$router.push(
- `${this.routePrefix}/record/device/detail?id=${item.productId}`
- )
- },
- initData() {
- this.listQuery.authId = this.$route.query.authId
- if(!this.listQuery.authId) return
- this.authProductList()
- },
- // 获取机构列表
- async authProductList() {
- try {
- this.isLoadingMore = true
- const res = await this.$http.api.getClubAuthProductList(this.listQuery)
- this.total = res.data.total
- this.list = [...this.list, ...res.data.list]
- this.finished = !res.data.hasNextPage
- this.isLoadingMore = false
- this.listQuery.pageNum += 1
- } catch (error) {
- console.log(error)
- } finally {
- this.$toast.clear()
- this.isRequest = false
- }
- },
- auditStatusColor(value) {
- // 认证状态:0 danger,1 success,2 warning
- const map = {
- 0: 'danger',
- 1: 'success',
- 2: 'warning',
- }
- return map[value]
- },
- // 加载更多
- onLoadMore() {
- this.authProductList()
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 768px) {
- .page {
- background: #fff;
- }
- .page-top {
- height: 360px;
- @include themify($themes) {
- background: themed('pc-banner-record-device');
- background-size: auto 360px;
- }
- .logo {
- display: block;
- width: 120px;
- height: 120px;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 30px;
- color: #fff;
- }
- }
- .page-content {
- width: 700px;
- margin: 0 auto;
- overflow: hidden;
- min-height: calc(100vh - 80px - 80px - 360px);
- box-sizing: border-box;
- padding-bottom: 40px;
- .page-title {
- font-size: 24px;
- font-weight: bold;
- text-align: center;
- padding: 40px 0;
- }
- .device-list {
- .device {
- position: relative;
- padding: 36px 0 12px;
- border-bottom: 1px solid #c2c2c2;
- cursor: pointer;
- .name {
- margin-bottom: 8px;
- }
- .label {
- font-size: 18px;
- color: #666;
- }
- .content {
- font-size: 18px;
- color: #282828;
- }
- .status {
- &.success {
- .content {
- color: #f3920d;
- }
- }
- &.warning {
- .content {
- color: #1890ff;
- }
- }
- &.danger {
- .content {
- color: #f94b4b;
- }
- }
- }
- &::after {
- content: '';
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- display: block;
- width: 20px;
- height: 20px;
- background: url(~assets/theme-images/common/pc-icon-detail-more.png)
- no-repeat center;
- background-size: 18px;
- }
- }
- }
- }
- }
- @media screen and (max-width: 768px) {
- .page {
- background: #fff;
- }
- .page-top {
- height: 46vw;
- @include themify($themes) {
- background: themed('h5-banner-record-device');
- background-size: auto 46vw;
- }
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- box-sizing: border-box;
- padding: 8vw 7vw;
- .page-title {
- font-size: 4.2vw;
- font-weight: bold;
- text-align: center;
- color: #282828;
- margin-bottom: 4.6vw;
- }
- .device-list {
- .device {
- position: relative;
- padding: 2.6vw 0;
- border-bottom: 0.1vw solid #c2c2c2;
- cursor: pointer;
- .name {
- margin-bottom: 2.2vw;
- }
- .label {
- font-size: 3.4vw;
- color: #666;
- }
- .content {
- font-size: 3.4vw;
- color: #282828;
- }
- .status {
- &.success {
- .content {
- color: #f3920d;
- }
- }
- &.warning {
- .content {
- color: #1890ff;
- }
- }
- &.danger {
- .content {
- color: #f94b4b;
- }
- }
- }
- &::after {
- content: '';
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- display: block;
- width: 20px;
- height: 20px;
- background: url(~assets/theme-images/common/h5-icon-detail-more.png)
- no-repeat center;
- background-size: 18px;
- }
- }
- }
- }
- }
- </style>
|