commit
1004ce7613
@ -1,160 +1,139 @@ |
||||
<template> |
||||
<view class="v-pages"> |
||||
<u-list @scrolltolower="scrolltolower"> |
||||
<!-- 页面 溯源码头部 --> |
||||
<view class="v-pages-code"> |
||||
<view class="v-code-image"> |
||||
<image |
||||
src="https://sy.hbcjy.com/prod-api/admin-api/infra/file/23/get/8f3e86e379710985ecebf74f9c0ba7705eeb6b0c81e8af5f9abbbfea648414f7.png" |
||||
mode="widthFix"></image> |
||||
</view> |
||||
<view class="v-code-top"> |
||||
<view class="text"> |
||||
<text class="iconfont icon-visit text-primary m-r-mini"></text> |
||||
今日访问 |
||||
</view> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.todayScan }}</text> |
||||
次 |
||||
</view> |
||||
</view> |
||||
<view class="v-code-data"> |
||||
<view class="v-code-data-box row"> |
||||
<view class="v-code-data-item col-12"> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.yesterdayScan }}</text> |
||||
</view> |
||||
<view class="text m-t-mini">昨日访问(次)</view> |
||||
</view> |
||||
<view class="v-code-data-item col-12"> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.totalScan }}</text> |
||||
</view> |
||||
<view class="text m-t-mini">总访问量(次)</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="v-pages"> |
||||
<!-- 页面 溯源码头部 --> |
||||
<view class="v-pages-code"> |
||||
<view class="v-code-image"> |
||||
<image |
||||
src="https://sy.hbcjy.com/prod-api/admin-api/infra/file/23/get/8f3e86e379710985ecebf74f9c0ba7705eeb6b0c81e8af5f9abbbfea648414f7.png" |
||||
mode="widthFix"></image> |
||||
</view> |
||||
<view class="v-code-top"> |
||||
<view class="text"> |
||||
<text class="iconfont icon-visit text-primary m-r-mini"></text> |
||||
今日访问 |
||||
</view> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.todayScan }}</text> |
||||
次 |
||||
</view> |
||||
</view> |
||||
<view class="v-code-data"> |
||||
<view class="v-code-data-box row"> |
||||
<view class="v-code-data-item col-12"> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.yesterdayScan }}</text> |
||||
</view> |
||||
<view class="text m-t-mini">昨日访问(次)</view> |
||||
</view> |
||||
<view class="v-code-data-item col-12"> |
||||
<view class="number"> |
||||
<text>{{ StaticScanRecord.totalScan }}</text> |
||||
</view> |
||||
<view class="text m-t-mini">总访问量(次)</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- 页面 列表 --> |
||||
<view class="v-pages-list v-container"> |
||||
<view class="v-pages-list-item" v-for="item in listData" :key="item.id"> |
||||
<!-- 页面 卡片 --> |
||||
<view class="v-card"> |
||||
<image src="@/static/images/icon_select.svg" class="v-card-select"></image> |
||||
<!-- 卡片 内容 --> |
||||
<view class="v-card-content"> |
||||
<!-- 卡片 上部 --> |
||||
<view class="v-card-top row"> |
||||
<!-- 卡片 信息 --> |
||||
<view class="v-card-info col"> |
||||
<view class="v-card-title row"> |
||||
<text class="name col">{{ item.processingName }}</text> |
||||
</view> |
||||
<view class="v-card-state m-t-mini"> |
||||
<text class="state secondary" |
||||
v-if="item.speciesName">{{ item.speciesName }} |
||||
</text> |
||||
<dict-tag class="state primary" type="source_type" :value="item.sourceType"/> |
||||
</view> |
||||
<view class="v-card-code"> |
||||
<text |
||||
class="iconfont icon-code m-r-small"></text> |
||||
{{ item.traceabilityCode }} |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- 页面 列表 --> |
||||
<z-paging ref="paging" v-model="listData" :pagingStyle="padingStyle" @query="getListData"> |
||||
<view class="v-pages-list v-container"> |
||||
<view class="v-pages-list-item" v-for="item in listData" :key="item.id"> |
||||
<!-- 页面 卡片 --> |
||||
<view class="v-card"> |
||||
<image src="@/static/images/icon_select.svg" class="v-card-select"></image> |
||||
<!-- 卡片 内容 --> |
||||
<view class="v-card-content"> |
||||
<!-- 卡片 上部 --> |
||||
<view class="v-card-top row"> |
||||
<!-- 卡片 信息 --> |
||||
<view class="v-card-info col"> |
||||
<view class="v-card-title row"> |
||||
<text class="name col">{{ item.processingName }}</text> |
||||
</view> |
||||
<view class="v-card-state m-t-mini"> |
||||
<text class="state secondary" v-if="item.speciesName">{{ item.speciesName }} |
||||
</text> |
||||
<dict-tag class="state primary" type="source_type" :value="item.sourceType" /> |
||||
</view> |
||||
<view class="v-card-code"> |
||||
<text class="iconfont icon-code m-r-small"></text> |
||||
{{ item.traceabilityCode }} |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- 卡片 下部 --> |
||||
<view class="v-card-bot"> |
||||
<view class="v-page-form small row"> |
||||
<view class="v-form-item col-8"> |
||||
<text>类型:</text> |
||||
<dict-tag class="state" |
||||
type="sales_type" :value="item.salesType"/> |
||||
</view> |
||||
<view class="v-form-item col-12"> |
||||
<text>销售时间:</text> |
||||
{{ getData(item.createTime) }} |
||||
</view> |
||||
<view class="v-form-item col-4"> |
||||
<button class="v-primary-btn">分享</button> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<u-loadmore :status="status"/> |
||||
</u-list> |
||||
</view> |
||||
<!-- 卡片 下部 --> |
||||
<view class="v-card-bot"> |
||||
<view class="v-page-form small row"> |
||||
<view class="v-form-item col-8"> |
||||
<text>类型:</text> |
||||
<dict-tag class="state" type="sales_type" :value="item.salesType" /> |
||||
</view> |
||||
<view class="v-form-item col-12"> |
||||
<text>销售时间:</text> |
||||
{{ getData(item.createTime) }} |
||||
</view> |
||||
<view class="v-form-item col-4"> |
||||
<button class="v-primary-btn">分享</button> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</z-paging> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import * as ProductApi from "@/api/traceability/product" |
||||
import mix from '@/utils/mix.js' |
||||
import DictTag from "@/components/DictTag/index" |
||||
import * as ProductApi from "@/api/traceability/product" |
||||
import mix from '@/utils/mix.js' |
||||
import DictTag from "@/components/DictTag/index" |
||||
|
||||
export default { |
||||
components: { |
||||
DictTag |
||||
}, |
||||
data() { |
||||
return { |
||||
StaticScanRecord: null, |
||||
listData: [], |
||||
loadMoreStatus: 'loadmore', |
||||
queryParams: { |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
total: null |
||||
} |
||||
export default { |
||||
components: { |
||||
DictTag |
||||
}, |
||||
data() { |
||||
return { |
||||
padingStyle: { |
||||
top: '0x' |
||||
}, |
||||
StaticScanRecord: null, |
||||
listData: [], |
||||
} |
||||
}, |
||||
mixins: [mix], |
||||
onLoad: function() { |
||||
this.getStaticScanRecord() |
||||
}, |
||||
methods: { |
||||
// 获取访问量 |
||||
async getStaticScanRecord() { |
||||
try { |
||||
const res = await ProductApi.getStaticScanRecord("2") |
||||
this.StaticScanRecord = res.data |
||||
} finally {} |
||||
}, |
||||
|
||||
} |
||||
}, |
||||
mixins: [mix], |
||||
onLoad: function () { |
||||
this.getStaticScanRecord() |
||||
this.getListData() |
||||
}, |
||||
methods: { |
||||
// 获取访问量 |
||||
async getStaticScanRecord() { |
||||
try { |
||||
const res = await ProductApi.getStaticScanRecord("2") |
||||
this.StaticScanRecord = res.data |
||||
} finally { |
||||
} |
||||
}, |
||||
|
||||
// 获取产品数据 |
||||
async getListData() { |
||||
this.loadMoreStatus = 'loading'; |
||||
try { |
||||
const res = await ProductApi.getSaleRecordCodePage(this.queryParams) |
||||
this.listData = [...this.listData, ...res?.data?.list]; |
||||
this.queryParams.total = res?.data?.total; |
||||
if (this.queryParams.pageNo * this.queryParams.pageSize >= this.queryParams.total) { |
||||
this.loadMoreStatus = 'nomore'; |
||||
} else { |
||||
this.loadMoreStatus = 'loadmore'; |
||||
} |
||||
} finally { |
||||
} |
||||
}, |
||||
|
||||
//触底加载 |
||||
scrolltolower() { |
||||
if (this.loadMoreStatus == 'loading' || this.loadMoreStatus == 'nomore') { |
||||
return; |
||||
} |
||||
this.queryParams.pageNo++; |
||||
this.getListData() |
||||
} |
||||
} |
||||
} |
||||
// 获取产品数据 |
||||
async getListData(pageNo, pageSize) { |
||||
try { |
||||
const queryParams = { |
||||
pageNo: pageNo, |
||||
pageSize: pageSize, |
||||
} |
||||
const res = await ProductApi.getSaleRecordCodePage(queryParams) |
||||
this.$refs.paging.complete(res.data.list) |
||||
} catch { |
||||
this.$refs.paging.complete(false); |
||||
} |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
||||
</style> |
Loading…
Reference in new issue