|
@@ -1,9 +1,10 @@
|
|
|
<template>
|
|
|
<view class="flex flex_column choosePartByVin">
|
|
|
+ <sklineHeader title="选择配件"></sklineHeader>
|
|
|
<!-- 头部车辆信息 -->
|
|
|
<div class="flex align-center cpb_header" v-if="carInfo">
|
|
|
<div>
|
|
|
- <u-image border-radius="30" :src="carInfo.icon" width="100" height="100" bg-color="#EBEBEB" ></u-image>
|
|
|
+ <image :src="carInfo.icon" style="width: 100rpx;height: 100rpx;border-radius: 10px;background-color: #fff;"></image>
|
|
|
</div>
|
|
|
<div>
|
|
|
<div class="flex align-center">
|
|
@@ -18,100 +19,125 @@
|
|
|
<!-- 配件列表 -->
|
|
|
<div class="cpb_middle flex">
|
|
|
<div class="slider-bar">
|
|
|
- <div class="tabs">
|
|
|
- <view :class="[curLeve2 == 'all' ? 'active' : '']" @click="selLeve2('all')">
|
|
|
+ <scroll-view type="list" style="width:100%;height:100%;" scroll-y>
|
|
|
+ <view class="tabs-item" :class="[curLeve2 == 'all' ? 'active' : '']" @click="selLeve2('all')">
|
|
|
全部
|
|
|
</view>
|
|
|
- <view :class="[curLeve2 == item.id ? 'active' : '']" v-for="(item, index) in leve2Data" :key="index" @click="selLeve2(item.id)">
|
|
|
+ <view class="tabs-item" :class="[curLeve2 == item.id ? 'active' : '']" v-for="(item, index) in leve2Data" :key="index" @click="selLeve2(item.id)">
|
|
|
{{item.label}}
|
|
|
</view>
|
|
|
- </div>
|
|
|
+ </scroll-view>
|
|
|
</div>
|
|
|
<div class="right-list">
|
|
|
<scroll-view
|
|
|
class="right-list-content"
|
|
|
scroll-y
|
|
|
+ type="custom"
|
|
|
@scrolltolower="onreachBottom">
|
|
|
<!-- vin适配配件 -->
|
|
|
- <view>
|
|
|
- <view class="nav-right-title">适配推荐</view>
|
|
|
- <vinPartItem
|
|
|
- :list="vinPartList"
|
|
|
- :commonPartCode="commonPartCodeList"
|
|
|
- :configPrice="configPrice"
|
|
|
- :showCarPrice="showCarPrice"
|
|
|
- :showCostPrice="showCostPrice"
|
|
|
- :showShelfDetial="showShelfDetial"
|
|
|
- :showNonShelfDetial="showNonShelfDetial"
|
|
|
- :priceShowVal="priceShowVal"
|
|
|
- @viewImg="viewImg"
|
|
|
- @openPrice="openPriceModal"
|
|
|
- @addPart="addPart"
|
|
|
- @updateVinNums="updateVinNums"
|
|
|
- ></vinPartItem>
|
|
|
- <view v-if="vinPartList&&vinPartList.length==0">
|
|
|
- <u-empty v-if="vinStatus!='loading'" :src="`/static/nodata.png`" icon-size="180" text="暂无适配推荐" mode="list" :margin-top="30"></u-empty>
|
|
|
- </view>
|
|
|
- <view style="padding: 20upx;" v-if="vinStatus=='loading'" >
|
|
|
- <u-loadmore :status="vinStatus" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <sticky-section>
|
|
|
+ <sticky-header>
|
|
|
+ <view class="nav-right-title">适配推荐</view>
|
|
|
+ </sticky-header>
|
|
|
+ <list-view>
|
|
|
+ <vinPartItem
|
|
|
+ v-for="(item,index) in vinPartList"
|
|
|
+ :key="index"
|
|
|
+ :list="item"
|
|
|
+ :commonPartCode="commonPartCodeList"
|
|
|
+ :configPrice="configPrice"
|
|
|
+ :showCarPrice="showCarPrice"
|
|
|
+ :showCostPrice="showCostPrice"
|
|
|
+ :showShelfDetial="showShelfDetial"
|
|
|
+ :showNonShelfDetial="showNonShelfDetial"
|
|
|
+ :priceShowVal="priceShowVal"
|
|
|
+ @viewImg="viewImg"
|
|
|
+ @openPrice="openPriceModal"
|
|
|
+ @addPart="addPart"
|
|
|
+ @updateVinNums="updateVinNums"
|
|
|
+ ></vinPartItem>
|
|
|
+ <view v-if="vinPartList&&vinPartList.length==0">
|
|
|
+ <sklineTemp v-if="vinStatus!='loading'" text="暂无适配推荐"/>
|
|
|
+ </view>
|
|
|
+ <view style="padding: 20upx;" v-if="vinStatus=='loading'" >
|
|
|
+ <uni-load-more :status="vinStatus" />
|
|
|
+ </view>
|
|
|
+ </list-view>
|
|
|
+ </sticky-section>
|
|
|
+
|
|
|
<!-- 其它配件 -->
|
|
|
- <view class="nav-right-title flex align_center justify_between" v-if="vinStatus!='loading'" @click="showOther=!showOther">
|
|
|
- 其它配件
|
|
|
- <text>{{showOther?'隐藏':'展开'}}</text>
|
|
|
- </view>
|
|
|
- <otherPartItem
|
|
|
- v-if="showOther"
|
|
|
- :list="partList"
|
|
|
- :configPrice="configPrice"
|
|
|
- :showCarPrice="showCarPrice"
|
|
|
- :showCostPrice="showCostPrice"
|
|
|
- :showShelfDetial="showShelfDetial"
|
|
|
- :priceShowVal="priceShowVal"
|
|
|
- @viewImg="viewImg"
|
|
|
- @openPrice="openPriceModal"
|
|
|
- @addPart="addPart"
|
|
|
- @updateNums="updateNums"
|
|
|
- ></otherPartItem>
|
|
|
- <view v-if="partList&&partList.length==0">
|
|
|
- <u-empty v-if="status!='loading'" :src="`/static/nodata.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="150"></u-empty>
|
|
|
- </view>
|
|
|
- <view style="padding: 20upx;" v-if="showOther">
|
|
|
- <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
|
|
|
- </view>
|
|
|
+ <sticky-section>
|
|
|
+ <sticky-header>
|
|
|
+ <view class="nav-right-title flex align_center justify_between" @click="showOther=!showOther">
|
|
|
+ 其它配件 <text>{{showOther?'隐藏':'展开'}}</text>
|
|
|
+ </view>
|
|
|
+ </sticky-header>
|
|
|
+ <list-view v-if="showOther">
|
|
|
+ <otherPartItem
|
|
|
+ v-for="(item,index) in partList"
|
|
|
+ :key="index"
|
|
|
+ :list="item"
|
|
|
+ :configPrice="configPrice"
|
|
|
+ :showCarPrice="showCarPrice"
|
|
|
+ :showCostPrice="showCostPrice"
|
|
|
+ :showShelfDetial="showShelfDetial"
|
|
|
+ :priceShowVal="priceShowVal"
|
|
|
+ @viewImg="viewImg"
|
|
|
+ @openPrice="openPriceModal"
|
|
|
+ @addPart="addPart"
|
|
|
+ @updateNums="updateNums"
|
|
|
+ ></otherPartItem>
|
|
|
+ <view v-if="total==0">
|
|
|
+ <sklineTemp v-if="status!='loading'" :text="noDataText"/>
|
|
|
+ </view>
|
|
|
+ <view style="padding: 20upx;" v-if="showOther&&total>0">
|
|
|
+ <uni-load-more :status="status"/>
|
|
|
+ </view>
|
|
|
+ </list-view>
|
|
|
+ </sticky-section>
|
|
|
</scroll-view>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 底部提交按钮 -->
|
|
|
- <div class="cpb_footer flex align-center" :class="isIphoneXup?'isIPXup':''">
|
|
|
- <div>
|
|
|
- <div class="cpb_cart" @click="openCart">
|
|
|
- <u-badge type="error" :count="cartNums" :offset="[-4,-4]" bgColor="#FF5200"></u-badge>
|
|
|
- <u-image width="44" height="44" :src="`/pagesA/static/icon_shopping@3x.png`"></u-image>
|
|
|
+ <sklineFooter></sklineFooter>
|
|
|
+ <div class="cpb_footer flex align-center flex_column">
|
|
|
+ <view class="flex align-center">
|
|
|
+ <div>
|
|
|
+ <div class="cpb_cart" @click="openCart">
|
|
|
+ <uni-badge type="error" :text="cartNums" :style="{position:'absolute',right:'3px',top:'3px'}" absolute="rightTop" size="small"></uni-badge>
|
|
|
+ <image style="width: 44rpx;height: 44rpx;" :src="`/pagesA/static/icon_shopping@3x.png`"></image>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <view>
|
|
|
- <!-- 合计:<text>¥{{totalAmount}}</text> -->
|
|
|
- <view style="font-size: 0.8em;color: dodgerblue;" v-if="dealerPhone" @click="callPhone()">
|
|
|
- <u-icon size="30" name="phone" color="dodgerblue"></u-icon><text>联系汽配商</text>
|
|
|
+ <view>
|
|
|
+ <view class="flex align_center" v-if="dealerPhone" @click="callPhone()">
|
|
|
+ <uni-icons size="18" type="phone" color="dodgerblue"></uni-icons> <view class="btnlink">联系汽配商</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <div>
|
|
|
+ <button class="submitBtn" type="primary" :loading="saveLoading" @click="submitForm">确认拿货</button>
|
|
|
+ </div>
|
|
|
</view>
|
|
|
- <div>
|
|
|
- <u-button type="primary" :loading="saveLoading" @click="submitForm" :custom-style="{background:'#066cff',fontSize:'32rpx'}" shape="circle">确认拿货</u-button>
|
|
|
- </div>
|
|
|
+ <view :style="{height:safeAreaBottom+'px'}"></view>
|
|
|
</div>
|
|
|
<!-- 已选配件 购物车 -->
|
|
|
- <div class="cpb_cart-mask" v-if="showCart">
|
|
|
+ <page-container
|
|
|
+ :show="showCart"
|
|
|
+ :round="true"
|
|
|
+ :z-index="10"
|
|
|
+ position="bottom"
|
|
|
+ custom-style="height:70%"
|
|
|
+ @afterleave="closeCart">
|
|
|
<div class="cpb_cart-box">
|
|
|
- <div class="cpb_close flex align-center justify_center" @click="showCart=false"><u-icon name="close"></u-icon></div>
|
|
|
+ <div class="cpb_close flex align_center justify_center" @click="showCart=false">
|
|
|
+ <uni-icons size="26" type="close"></uni-icons>
|
|
|
+ </div>
|
|
|
<div class="cpb_cart-tit">
|
|
|
已选配件
|
|
|
</div>
|
|
|
- <div class="cpb_cart-list">
|
|
|
+ <scroll-view type="list" scroll-y="true" class="cpb_cart-list">
|
|
|
<view class="nav-right-item flex" v-for="(item, index) in partListData" :key="item.productSn">
|
|
|
<view class="uni-col-2">
|
|
|
- <u-image border-radius="30" :src="item.images" width="150" height="150" bg-color="#EBEBEB" ></u-image>
|
|
|
+ <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_75,w_75,color_ffffff'" border-radius="30" width="150" height="150" bg-color="#EBEBEB" ></u-image>
|
|
|
</view>
|
|
|
<view class="item-info uni-col-10">
|
|
|
<view class="item-name">
|
|
@@ -125,7 +151,7 @@
|
|
|
<text class="item-detail-text" v-if="item.affiliation!='NON_SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
|
|
|
</view>
|
|
|
<view class="flex" v-if="item.productTypeSn=='543766811373752320'" style="padding-bottom: 5px;">
|
|
|
- <u-tag :text="item.origCode" mode="light" borderColor="#ffffff" shape="circle" type="success"></u-tag>
|
|
|
+ <uni-tag :text="item.origCode" inverted :circle="true" type="success"></uni-tag>
|
|
|
</view>
|
|
|
<view class="flex justify_between">
|
|
|
<view class="item-detail-text flex_1">
|
|
@@ -133,28 +159,31 @@
|
|
|
<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
|
|
|
</view>
|
|
|
<view class="item-detail-text">
|
|
|
- <u-number-box @change="updateCartNums" @blur="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
|
|
|
+ <uni-number-box @change="e=>updateCartNums({value:e,index:'cart_'+item.productSn})" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></uni-number-box>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </div>
|
|
|
+ </scroll-view>
|
|
|
+ <sklineFooter></sklineFooter>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </page-container>
|
|
|
<!-- 去认证 -->
|
|
|
- <u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
|
|
|
- <view style="background-color: #fff;padding:1rem;">
|
|
|
- <u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
|
|
|
+ <uni-popup ref="showPopup" type="center" :is-mask-click="false">
|
|
|
+ <view class="popu-modal">
|
|
|
+ <view class="popu-close" @click="$refs.showPopup.close()"><uni-icons type="close" size="26"></uni-icons></view>
|
|
|
+ <image width="533" height="415" style="width: 533rpx;height: 415rpx;" src="/static/authimg.jpg"></image>
|
|
|
<view style="padding-top:1rem;" class="flex justify_center">
|
|
|
- <u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
|
|
|
+ <button @click="toAuthStore()" shape="circle" :style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </u-popup>
|
|
|
+ </uni-popup>
|
|
|
<!-- 价格查看 -->
|
|
|
- <u-popup v-model="showPriceModal" mode="center" length="80%" closeable>
|
|
|
- <view class="show-price-modal" v-if="tempData">
|
|
|
+ <uni-popup ref="showPriceModal" type="center">
|
|
|
+ <view class="show-price-modal popu-modal" v-if="tempData">
|
|
|
+ <view class="popu-close" @click="$refs.showPriceModal.close()"><uni-icons type="close" size="26"></uni-icons></view>
|
|
|
<view class="itemlist">
|
|
|
<text>产品编码</text>
|
|
|
<text>{{tempData.code||'--'}}</text>
|
|
@@ -188,7 +217,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </u-popup>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -197,10 +226,16 @@
|
|
|
import { scanVinLogCopy } from '@/api/car'
|
|
|
import vinPartItem from './components/vinPartItem.vue'
|
|
|
import otherPartItem from './components/otherPartItem.vue'
|
|
|
+ import sklineHeader from '@/components/skline/sklineHeader.vue'
|
|
|
+ import sklineTemp from '@/components/skline/sklineTemp.vue'
|
|
|
+ import sklineFooter from '@/components/skline/sklineFooter.vue'
|
|
|
export default {
|
|
|
components:{
|
|
|
vinPartItem,
|
|
|
- otherPartItem
|
|
|
+ otherPartItem,
|
|
|
+ sklineHeader,
|
|
|
+ sklineTemp,
|
|
|
+ sklineFooter
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -215,7 +250,7 @@
|
|
|
vinStatus: 'loading',
|
|
|
noDataText: '暂无配件',
|
|
|
pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 20,
|
|
|
total: 0, // 列表总数
|
|
|
noMore: false ,// 没有更多
|
|
|
showCart: false, // 购物车
|
|
@@ -231,7 +266,8 @@
|
|
|
priceShowVal: null, // 是否可以查看所有价格
|
|
|
showCarPrice: false, // 显示车主价
|
|
|
showCostPrice: false, // 显示成本价
|
|
|
- tempData: null // 临时数据
|
|
|
+ tempData: null ,// 临时数据
|
|
|
+ safeAreaBottom:0
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -281,6 +317,8 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(opts) {
|
|
|
+ this.safeAreaBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
|
|
|
+
|
|
|
this.theme = getApp().globalData.theme
|
|
|
this.vinNumber = opts.vinNumber
|
|
|
this.carInfo = opts.carList?JSON.parse(decodeURIComponent(opts.carList)):null
|
|
@@ -294,10 +332,18 @@
|
|
|
if(this.userInfo.sysUserFlag == '0'){
|
|
|
// 未认证
|
|
|
if(!this.storeApply || this.storeApply&&!this.storeApply.auditStatus){
|
|
|
- this.showPopup = true
|
|
|
+ this.$refs.showPopup.open()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onUnload() {
|
|
|
+ this.carList = null
|
|
|
+ this.partList = null// 配件列表
|
|
|
+ this.partListData = null // 已选配件
|
|
|
+ this.vinPartList = null
|
|
|
+ this.vinCode = null
|
|
|
+ this.commonPartCodeList = null
|
|
|
+ },
|
|
|
onShow() {
|
|
|
this.$store.state.vuex_shelfChoosePart = []
|
|
|
this.getShowPriceType()
|
|
@@ -335,7 +381,7 @@
|
|
|
row.affiliation = "SHELF"
|
|
|
}
|
|
|
this.tempData = row
|
|
|
- this.showPriceModal = true
|
|
|
+ this.$refs.showPriceModal.open()
|
|
|
}
|
|
|
},
|
|
|
scanVinLogCopy(){
|
|
@@ -344,7 +390,7 @@
|
|
|
})
|
|
|
},
|
|
|
toAuthStore(){
|
|
|
- this.showPopup = false
|
|
|
+ this.$refs.showPopup.close()
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/storeManage/storeAuth'
|
|
|
})
|
|
@@ -425,30 +471,26 @@
|
|
|
console.log(res,'获取数字货架配件列表')
|
|
|
uni.hideLoading()
|
|
|
if(res.status == 200){
|
|
|
- let list = res.data.list
|
|
|
- if (list && list.length){
|
|
|
- // 分页 拼接数据
|
|
|
- if (_this.pageNo != 1) {
|
|
|
- _this.partList = _this.partList ? _this.partList.concat(this.fiterChecked(list)) : this.fiterChecked(list)
|
|
|
- } else {
|
|
|
- _this.partList = this.fiterChecked(list)
|
|
|
- }
|
|
|
- this.total = res.data.count
|
|
|
- if (_this.partList.length == res.data.count) {
|
|
|
- _this.status = 'nomore'
|
|
|
- } else {
|
|
|
- _this.status = 'loadmore'
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.partList = list || []
|
|
|
- this.total = 0
|
|
|
- _this.status = 'nomore'
|
|
|
- }
|
|
|
- _this.noDataText = '暂无配件'
|
|
|
+ _this.total = Number(res.data.count)
|
|
|
+ if(_this.total>0){
|
|
|
+ const list = res.data.list || []
|
|
|
+ // 追加数据
|
|
|
+ _this.partList.push(_this.fiterChecked(list))
|
|
|
+ // 判断是否最后一页
|
|
|
+ const maxPages = Math.ceil(_this.total / _this.pageSize)
|
|
|
+ if(this.pageNo >= maxPages){
|
|
|
+ _this.status = 'noMore'
|
|
|
+ _this.noDataText = '没有更多了'
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ _this.partList = []
|
|
|
+ _this.status = 'noMore'
|
|
|
+ _this.noDataText = '暂无配件'
|
|
|
+ }
|
|
|
+
|
|
|
}else{
|
|
|
- _this.status = 'loadmore'
|
|
|
+ _this.status = 'more'
|
|
|
_this.partList = []
|
|
|
- this.total = 0
|
|
|
_this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
|
|
|
}
|
|
|
})
|
|
@@ -466,14 +508,17 @@
|
|
|
})
|
|
|
this.vinStatus = 'loading'
|
|
|
getShelfQueryList(params).then(res => {
|
|
|
- this.vinPartList = this.fiterChecked(res.data || [])
|
|
|
- this.vinStatus = 'nomore'
|
|
|
+ const ret = this.fiterChecked(res.data || [])
|
|
|
+ for(let i=0;i<ret.length;i=i+this.pageSize){
|
|
|
+ this.vinPartList.push(ret.slice(i,(i+this.pageSize)>ret.length?ret.length:(i+this.pageSize)))
|
|
|
+ }
|
|
|
+ this.vinStatus = 'noMore'
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
},
|
|
|
// 过滤已选择的
|
|
|
fiterChecked (list){
|
|
|
- this.partListData.map(item => {
|
|
|
+ this.partListData.forEach(item => {
|
|
|
let p = list.find(k => {
|
|
|
return k.productSn == item.productSn
|
|
|
})
|
|
@@ -490,21 +535,30 @@
|
|
|
this.pageNo++
|
|
|
this.getShelfProductList()
|
|
|
}else{
|
|
|
- this.status = "nomore"
|
|
|
+ this.status = "noMore"
|
|
|
}
|
|
|
},
|
|
|
+ // 根据productSn查找
|
|
|
+ getItemById(sn,type){
|
|
|
+ const a = this[type].findIndex(k => k.find(s=> s.productSn == sn))
|
|
|
+ const b = a>=0 ? this[type][a].findIndex(s=> s.productSn == sn) : -1
|
|
|
+ return {p:a,s:b}
|
|
|
+ },
|
|
|
+ // 更新页面列表数量状态
|
|
|
+ updateListData(sn,type,qty,checked){
|
|
|
+ const row = this.getItemById(sn,type)
|
|
|
+ if(row.p>=0 && row.s>=0){
|
|
|
+ this[type][row.p][row.s].checked = checked
|
|
|
+ this[type][row.p][row.s].qty = qty
|
|
|
+ this[type][row.p].splice()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 添加到购物车
|
|
|
addPart(item,type){
|
|
|
if(type == 'vin'){
|
|
|
- const idx = this.vinPartList.findIndex(k => k.id == item.id)
|
|
|
- this.vinPartList[idx].checked = true
|
|
|
- this.vinPartList[idx].qty = 1
|
|
|
- this.vinPartList.splice()
|
|
|
+ this.updateListData(item.productSn,'vinPartList',1,true)
|
|
|
}else{
|
|
|
- const idx = this.partList.findIndex(k => k.id == item.id)
|
|
|
- this.partList[idx].checked = true
|
|
|
- this.partList[idx].qty = 1
|
|
|
- this.partList.splice()
|
|
|
+ this.updateListData(item.productSn,'partList',1,true)
|
|
|
}
|
|
|
// 已选列表
|
|
|
this.partListData.unshift({
|
|
@@ -526,18 +580,21 @@
|
|
|
},
|
|
|
// 更新配件列表数量
|
|
|
updatePartList(data,type){
|
|
|
- const prow = this[type].find(item => item.productSn == data.index)
|
|
|
const index = this.partListData.findIndex(item => item.productSn == data.index)
|
|
|
// 删除
|
|
|
if(!data.value){
|
|
|
- prow.checked = false
|
|
|
+ // 删除页面上的数量
|
|
|
+ this.updateListData(data.index,type,0,false)
|
|
|
+ // 删除已选列表
|
|
|
if(index>=0){
|
|
|
this.partListData.splice(index,1)
|
|
|
}
|
|
|
+ // 没有已选,关闭弹框
|
|
|
if(this.partListData.length==0){
|
|
|
this.showCart = false
|
|
|
}
|
|
|
}else{
|
|
|
+ // 更新数量
|
|
|
this.partListData[index].qty = data.value
|
|
|
this.partListData.splice()
|
|
|
}
|
|
@@ -563,19 +620,9 @@
|
|
|
}
|
|
|
}
|
|
|
// 同步更新Vin适配配件列表上的
|
|
|
- const vinprow = this.vinPartList.find(item => 'cart_'+item.productSn == data.index)
|
|
|
- if(vinprow){
|
|
|
- vinprow.qty = data.value
|
|
|
- vinprow.checked = !!data.value
|
|
|
- this.vinPartList.splice()
|
|
|
- }
|
|
|
+ this.updateListData(data.index.split('_')[1],'vinPartList',data.value,!!data.value)
|
|
|
// 同步更新其它配件列表上的
|
|
|
- const prow = this.partList.find(item => 'cart_'+item.productSn == data.index)
|
|
|
- if(prow){
|
|
|
- prow.qty = data.value
|
|
|
- prow.checked = !!data.value
|
|
|
- this.partList.splice()
|
|
|
- }
|
|
|
+ this.updateListData(data.index.split('_')[1],'partList',data.value,!!data.value)
|
|
|
},
|
|
|
// 打开购物车
|
|
|
openCart(){
|
|
@@ -588,6 +635,10 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 关闭购物车
|
|
|
+ closeCart(){
|
|
|
+ this.showCart = false
|
|
|
+ },
|
|
|
// 格式化数据
|
|
|
formatData(){
|
|
|
const partList = []
|
|
@@ -614,7 +665,7 @@
|
|
|
if(this.userInfo.sysUserFlag == '0'){
|
|
|
// 未认证
|
|
|
if(!this.storeApply || this.storeApply&&(!this.storeApply.auditStatus || this.storeApply.auditStatus == 'REFUSE')){
|
|
|
- this.showPopup = true
|
|
|
+ this.$refs.showPopup.open()
|
|
|
}
|
|
|
// 认证通过
|
|
|
if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
|
|
@@ -657,14 +708,16 @@
|
|
|
shelfOrderFlowCreate(params).then(res => {
|
|
|
console.log(res,'shelfOrderFlowCreate')
|
|
|
if(res.status == 200){
|
|
|
+ this.$store.state.vuex_tempData = res.data
|
|
|
// 提交成功
|
|
|
uni.redirectTo({
|
|
|
- url:"/pagesA/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify(res.data))+"&state=1"
|
|
|
+ url:"/pagesA/digitalShelf/choosePartResult?state=1"
|
|
|
})
|
|
|
}else{
|
|
|
+ this.$store.state.vuex_tempData = {shelfOrder:{remindMessage:res.message}}
|
|
|
// 或失败
|
|
|
uni.redirectTo({
|
|
|
- url:"/pagesA/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify({shelfOrder:{remindMessage:res.message}}))+"&state=0"
|
|
|
+ url:"/pagesA/digitalShelf/choosePartResult?state=0"
|
|
|
})
|
|
|
}
|
|
|
this.saveLoading = false
|
|
@@ -676,6 +729,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
+@import '/flex.css';
|
|
|
.choosePartByVin{
|
|
|
height: 100vh;
|
|
|
.cpb_header{
|
|
@@ -730,8 +784,31 @@
|
|
|
margin-left: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
- .show-price-modal{
|
|
|
+ .popu-modal{
|
|
|
+ width: 300px;
|
|
|
padding: 30px 20px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 15px;
|
|
|
+ position: relative;
|
|
|
+ .popu-close{
|
|
|
+ position: absolute;
|
|
|
+ right: 6px;
|
|
|
+ top: 6px;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .popu-title{
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .show-price-modal{
|
|
|
.itemlist{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -749,26 +826,23 @@
|
|
|
}
|
|
|
.cpb_middle{
|
|
|
flex-grow: 1;
|
|
|
- padding-top: 10rpx;
|
|
|
+ padding-top: 4rpx;
|
|
|
overflow: auto;
|
|
|
.slider-bar{
|
|
|
width: 25%;
|
|
|
background: #F5F6F7;
|
|
|
height: 100%;
|
|
|
- overflow: auto;
|
|
|
- .tabs{
|
|
|
- > view{
|
|
|
- border-left: 6rpx solid #F5F6F7;
|
|
|
- padding: 20rpx 10rpx;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #666E75;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .active{
|
|
|
- border-color: #0485F6;
|
|
|
- color: #0485F6;
|
|
|
- background: #fff;
|
|
|
- }
|
|
|
+ .tabs-item{
|
|
|
+ border-left: 6rpx solid #F5F6F7;
|
|
|
+ padding: 20rpx 10rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #666E75;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ border-color: #0485F6;
|
|
|
+ color: #0485F6;
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
}
|
|
|
.right-list{
|
|
@@ -783,69 +857,42 @@
|
|
|
font-weight: bold;
|
|
|
padding: 20upx 25upx;
|
|
|
border-bottom: 2rpx solid #eee;
|
|
|
+ background: #fff;
|
|
|
> text{
|
|
|
color: #9E9E9E;
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
}
|
|
|
- .nav-right-item{
|
|
|
- padding: 15upx 25upx;
|
|
|
- border-bottom: 2rpx solid #f5f5f5;
|
|
|
- .item-info{
|
|
|
- padding-left: 20upx;
|
|
|
- flex-grow: 1;
|
|
|
- .item-name{
|
|
|
- font-size: 30upx;
|
|
|
- color: #191919;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- >image{
|
|
|
- width: 38rpx;
|
|
|
- height: 38rpx;
|
|
|
- margin-right: 10rpx;
|
|
|
- }
|
|
|
- >text{
|
|
|
- flex: 1;
|
|
|
- word-break: break-all;
|
|
|
- }
|
|
|
- }
|
|
|
- .item-detail{
|
|
|
- .item-detail-info{
|
|
|
- padding: 10upx 0 4upx;
|
|
|
- /deep/ .u-tag{
|
|
|
- word-break: break-all;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #0fab04eee;
|
|
|
- border: 0;
|
|
|
- padding: 0.2rem 0.3rem;
|
|
|
- }
|
|
|
- > view{
|
|
|
- padding-bottom: 10rpx;
|
|
|
- align-items: center;
|
|
|
- .item-detail-text{
|
|
|
- color: #999;
|
|
|
- .phtxt{
|
|
|
- color: #0485F6;
|
|
|
- font-size: 28upx;
|
|
|
- }
|
|
|
- .item-price{
|
|
|
- color: #FB1E1E;
|
|
|
- font-size: 28upx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.cpb_footer{
|
|
|
- padding: 20rpx;
|
|
|
background-color: #fff;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
+ z-index: 1000;
|
|
|
+ position: fixed;
|
|
|
+ width: 100%;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ .btnlink{
|
|
|
+ font-size: 14px;
|
|
|
+ color: #3390e2;
|
|
|
+ }
|
|
|
+ > view{
|
|
|
+ width: 100%;
|
|
|
+ &:first-child{
|
|
|
+ padding: 0 20rpx;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 50px;
|
|
|
+ align-items: center;
|
|
|
+ .submitBtn{
|
|
|
+ background-color: #FB1E1E;
|
|
|
+ font-size: 28rpx;
|
|
|
+ border-radius: 100px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.cpb_cart{
|
|
|
width: 84rpx;
|
|
|
height: 84rpx;
|
|
@@ -862,33 +909,23 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .cpb_cart-mask{
|
|
|
- position: fixed;
|
|
|
- width: 100%;
|
|
|
- background: rgba(0,0,0,0.5);
|
|
|
- z-index: 900;
|
|
|
- bottom: 120rpx;
|
|
|
- top: 0;
|
|
|
- }
|
|
|
.cpb_cart-box{
|
|
|
background-color: #fff;
|
|
|
- position: absolute;
|
|
|
width: 100%;
|
|
|
- z-index: 1000;
|
|
|
- bottom: 0;
|
|
|
+ height: 100%;
|
|
|
padding: 0;
|
|
|
border-radius: 30rpx 30rpx 0 0;
|
|
|
- max-height: 70vh;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
.cpb_close{
|
|
|
position: absolute;
|
|
|
- top: 10rpx;
|
|
|
- right: 20rpx;
|
|
|
+ top: 3rpx;
|
|
|
+ right: 15rpx;
|
|
|
width: 70rpx;
|
|
|
height: 70rpx;
|
|
|
font-size: 32rpx;
|
|
|
color: #999;
|
|
|
+ z-index: 100;
|
|
|
}
|
|
|
.cpb_cart-tit{
|
|
|
text-align: center;
|
|
@@ -897,16 +934,13 @@
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
.cpb_cart-list{
|
|
|
- padding: 20rpx 30rpx;
|
|
|
- overflow: auto;
|
|
|
flex-grow: 1;
|
|
|
- > view{
|
|
|
- margin-bottom: 20rpx;
|
|
|
+ .nav-right-item{
|
|
|
+ padding: 10px;
|
|
|
border-bottom:2rpx solid #eee;
|
|
|
}
|
|
|
.item-name{
|
|
|
font-size: 30rpx;
|
|
|
- margin-bottom: 5px;
|
|
|
.item-tempPart{
|
|
|
background: #0055ff;
|
|
|
color: #fff;
|
|
@@ -917,12 +951,13 @@
|
|
|
}
|
|
|
.item-info{
|
|
|
flex-grow: 1;
|
|
|
- padding-left: 0.8em;
|
|
|
+ padding-left: 10px;
|
|
|
+ width: 80%;
|
|
|
}
|
|
|
.item-detail{
|
|
|
.item-detail-info{
|
|
|
padding: 10upx 0 4upx;
|
|
|
- /deep/ .u-tag{
|
|
|
+ /deep/ .uni-tag{
|
|
|
word-break: break-all;
|
|
|
font-size: 28rpx;
|
|
|
color: #0fab04eee;
|
|
@@ -930,7 +965,7 @@
|
|
|
padding: 0.2rem 0.3rem;
|
|
|
}
|
|
|
> view{
|
|
|
- padding-bottom: 20rpx;
|
|
|
+ padding-bottom: 10rpx;
|
|
|
align-items: center;
|
|
|
.item-detail-text{
|
|
|
color: #999;
|