123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="productPricing-content">
- <view class="checkbox-price">
- <u-checkbox-group placement="row" @change="checkboxChange">
- <u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in priceList" :key="index" :name="item.name" :label="item.name">{{item.name}}</u-checkbox>
- </u-checkbox-group>
- </view>
- <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
- <view class="st-detailList-main">
- <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
- <view class="st-detailList-tit">
- <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.name}}
- </view>
- <view class="st-detailList-item-con flex align_center">
- <view class="pimgs">
- <u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
- </view>
- <view class="flex_1">
- <view>产品编码:{{item.code}}</view>
- <view class="padding_3">原厂编码:{{item.origCode}}</view>
- <view class="flex align_center justify_between">
- <view class="font_13">
- 库存数量:
- <u-count-to :end-val="item.stockQty ? item.stockQty : 0" separator="," font-size="26"></u-count-to>个
- </view>
- <view class="font_13">
- 车主价:
- ¥<u-count-to :end-val="item.carOwnersPrice ? item.carOwnersPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
- </view>
- </view>
- </view>
- </view>
- <view class="price-all flex justify_between">
- <view class="price-item">
- <u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
- <view>成本价</view>
- </view>
- <view class="price-item">
- <u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
- <view>成本价</view>
- </view>
- <view class="price-item">
- <u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
- <view>成本价</view>
- </view>
- <view class="price-item">
- <u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
- <view>成本价</view>
- </view>
- </view>
- </view>
- <view v-if="listData && listData.length == 0">
- <u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import { dealerProductList } from '@/api/sales'
- export default{
- data(){
- return{
- listData:[],
- totalNum:0,
- priceList:[{name:'成本价',checked:false},{name:'市级价',checked:false},{name:'特约价',checked:false},{name:'市级终端价',checked:false}],
- pageNo:1,
- pageSize:10,
- noDataText: '暂无数据',
- theme: ''
- }
- },
- onLoad() {
- this.theme = getApp().globalData.theme
- this.getList()
- },
- methods:{
- // 价格显示
- checkboxChange(e){
- console.log(e,'val ,change')
- // if(val&&val.length>0){
- // const a= val.find(item=>{item=='成本价'})
- // }
- },
- // 列表
- getList(pageNo){
- const _this = this
- if (pageNo) {
- this.pageNo = pageNo
- }
- let params = { pageNo: this.pageNo, pageSize: this.pageSize }
- dealerProductList(params).then(res => {
- if (res.status == 200) {
- if(this.pageNo>1){
- this.listData = this.listData.concat(res.data.list || [])
- }else{
- this.listData = res.data.list || []
- }
- this.totalNum = res.data.count || 0
- } else {
- this.listData = []
- this.totalNum = 0
- this.noDataText = res.message
- }
- })
- },
- // scroll-view到底部加载更多
- onreachBottom() {
- if(this.listData.length < this.totalNum){
- this.pageNo += 1
- this.getList()
- }
- },
- }
- }
- </script>
- <style lang="scss">
- .productPricing-content{
- width:100%;
- height: 100vh;
- .checkbox-price{
- background-color: #fff;
- display: flex;
- justify-content: space-around;
- padding: 20rpx 0;
- margin-bottom: 15rpx;
- color: #191919;
- }
- .product-list{
- height: calc(100vh - 94upx);
- .st-detailList-main{
- .st-detailList-main-item{
- background: #ffffff;
- padding: 20upx;
- margin-bottom: 25upx;
- border-radius: 25upx;
- box-shadow: 1px 1px 3px #EEEEEE;
- .st-detailList-tit{
- padding-bottom: 20upx;
- border-bottom: 1px solid #e4e7ed;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- .u-line{
- display: inline-block;
- width: 6upx;
- height: 40upx;
- background-color: red;
- vertical-align: bottom;
- margin: 0 20upx 0 10upx;
- }
- }
- .st-detailList-item-con{
- padding: 20upx;
- font-size: 26upx;
- .pimgs{
- margin-right: 16upx;
- }
- .font_13{
- font-size: 26upx;
- }
- .padding_3{
- padding: 6upx 0;
- }
- }
- .price-all{
- border-top: 1px solid #e4e7ed;
- padding: 20upx 20upx 0;
- .price-item{
- width: 25%;
- border-right: 1px solid #e4e7ed;
- text-align: center;
- >view{
- color:#999;
- }
- }
- .price-item:last-child{
- border-right: none;
- }
- }
- }
- }
-
-
- }
- }
- </style>
|