choosePart.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <view class="flex flex_column choosePartByVin">
  3. <!-- 头部车辆信息 -->
  4. <div class="flex align-center cpb_header" v-if="carInfo">
  5. <div>
  6. <u-image border-radius="30" :src="carInfo.icon" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  7. </div>
  8. <div>
  9. <div class="flex align-center">
  10. <div class="carTits ellipsis-two">{{modelLabel||''}}</div>
  11. </div>
  12. <div class="flex align-center">
  13. <div>VIN码:{{vinNumber}}</div>
  14. <div class="copyText" @click="copyVin"><span>复制</span></div>
  15. </div>
  16. <view style="font-size: 0.8em;color: dodgerblue;margin-top: 0.5em;" v-if="dealerPhone" @click="callPhone()">
  17. <u-icon size="30" name="phone" color="dodgerblue"></u-icon><text>联系汽配商</text>
  18. </view>
  19. </div>
  20. </div>
  21. <!-- 配件列表 -->
  22. <div class="cpb_middle flex">
  23. <div class="slider-bar">
  24. <div class="tabs">
  25. <view :class="[curLeve2 == 'all' ? 'active' : '']" @click="selLeve2('all')">
  26. 全部
  27. </view>
  28. <view :class="[curLeve2 == item.id ? 'active' : '']" v-for="(item, index) in leve2Data" :key="index" @click="selLeve2(item.id)">
  29. {{item.label}}
  30. </view>
  31. </div>
  32. </div>
  33. <div class="right-list">
  34. <scroll-view
  35. class="right-list-content"
  36. scroll-y
  37. @scrolltolower="onreachBottom">
  38. <!-- vin适配配件 -->
  39. <view>
  40. <view class="nav-right-title">适配推荐</view>
  41. <view class="nav-right-item flex" v-for="(item, index) in vinPartList" :key="item.productSn">
  42. <view class="uni-col-2">
  43. <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" @click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  44. </view>
  45. <view class="item-info uni-col-10">
  46. <view class="item-name">
  47. <text>{{item.name}}</text>
  48. </view>
  49. <view class="item-detail">
  50. <view class="item-detail-info">
  51. <view class="flex justify_between">
  52. <text class="item-detail-text flex_1">{{item.code}}</text>
  53. <text class="item-detail-text" v-if="item.affiliation=='SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  54. </view>
  55. <view class="flex justify_between">
  56. <view class="item-detail-text flex_1" v-if="item.affiliation=='SHELF'">
  57. <view v-if="showPrice[0]">
  58. <view v-if="showPrice[1]=='PURCHASES_PRICE'">
  59. <text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
  60. </view>
  61. <text v-else class="item-price">¥{{item.price||0}}</text>
  62. </view>
  63. </view>
  64. <view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
  65. <view v-if="showPrice[0]">
  66. <text class="item-price" v-if="showPrice[1]!='PURCHASES_PRICE'">¥{{item.price||0}}</text>
  67. <text class="item-price" v-else></text>
  68. </view>
  69. </view>
  70. <view class="item-detail-text" v-if="item.currentInven">
  71. <u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
  72. <u-icon name="plus" color="#fff" size="28"></u-icon>
  73. </u-button>
  74. <u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
  75. </view>
  76. <view class="item-detail-text" v-if="item.affiliation=='SUPER_CATALOGUE'||!item.currentInven">
  77. <text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要临配</text>
  78. <u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="nav-right-item-btns flex align_center justify_between">
  83. <view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <view v-if="vinPartList&&vinPartList.length==0">
  90. <u-empty v-if="vinStatus!='loading'" :src="`/static/nodata.png`" icon-size="180" text="暂无适配推荐" mode="list" :margin-top="30"></u-empty>
  91. </view>
  92. <view style="padding: 20upx;">
  93. <u-loadmore v-if="vinStatus=='loading'" :status="vinStatus" />
  94. </view>
  95. </view>
  96. <!-- 其它配件 -->
  97. <view class="nav-right-title flex align_center justify_between" @click="showOther=!showOther" style="margin-top: 20rpx;">
  98. 其它配件
  99. <text>{{showOther?'隐藏':'展开'}}</text>
  100. </view>
  101. <view class="nav-right-item flex" v-if="showOther" v-for="(item, index) in partList" :key="item.productSn">
  102. <view class="uni-col-2">
  103. <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" @click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  104. </view>
  105. <view class="item-info uni-col-10">
  106. <view class="item-name">
  107. <text>{{item.name}}</text>
  108. </view>
  109. <view class="item-detail">
  110. <view class="item-detail-info">
  111. <view class="flex justify_between">
  112. <text class="item-detail-text flex_1">{{item.code}}</text>
  113. <text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  114. </view>
  115. <view class="flex justify_between">
  116. <view class="item-detail-text flex_1" v-if="showPrice[0]">
  117. <view v-if="showPrice[1]=='PURCHASES_PRICE'">
  118. <text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
  119. </view>
  120. <text v-else class="item-price">¥{{item.price||0}}</text>
  121. </view>
  122. <view class="item-detail-text flex_1" v-else></view>
  123. <view class="item-detail-text" v-if="item.currentInven">
  124. <u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx',background:'#066cff'}" type="primary" size="mini">
  125. <u-icon name="plus" color="#fff" size="28"></u-icon>
  126. </u-button>
  127. <u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
  128. </view>
  129. <view class="item-detail-text" v-else>
  130. <text @click="addPart(item)" v-if="!item.checked" class="phtxt">我要临配</text>
  131. <u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="nav-right-item-btns flex align_center justify_between">
  136. <view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view v-if="partList&&partList.length==0">
  143. <u-empty v-if="status!='loading'" :src="`/static/nodata.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="150"></u-empty>
  144. </view>
  145. <view style="padding: 20upx;">
  146. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  147. </view>
  148. </scroll-view>
  149. </div>
  150. </div>
  151. <!-- 底部提交按钮 -->
  152. <div class="cpb_footer flex align-center" :class="isIphoneXup?'isIPXup':''">
  153. <div>
  154. <div class="cpb_cart" @click="openCart">
  155. <u-badge type="error" :count="cartNums" :offset="[-4,-4]" bgColor="#FF5200"></u-badge>
  156. <u-image width="44" height="44" :src="`/static/icon_shopping@3x.png`"></u-image>
  157. </div>
  158. </div>
  159. <div>
  160. <u-button type="primary" :loading="saveLoading" @click="submitForm" :custom-style="{background:'#066cff',fontSize:'32rpx'}" shape="circle">立即提交</u-button>
  161. </div>
  162. </div>
  163. <!-- 已选配件 购物车 -->
  164. <div class="cpb_cart-mask" v-if="showCart">
  165. <div class="cpb_cart-box">
  166. <div class="cpb_close flex align-center justify_center" @click="showCart=false"><u-icon name="close"></u-icon></div>
  167. <div class="cpb_cart-tit">
  168. 已选配件
  169. </div>
  170. <div class="cpb_cart-list">
  171. <view class="nav-right-item flex" v-for="(item, index) in partListData" :key="item.productSn">
  172. <view class="uni-col-2">
  173. <u-image border-radius="30" :src="item.images" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  174. </view>
  175. <view class="item-info uni-col-10">
  176. <view class="item-name">
  177. <text class="item-tempPart" v-if="!item.currentInven">临配</text>
  178. <text>{{item.name}}</text>
  179. </view>
  180. <view class="item-detail">
  181. <view class="item-detail-info">
  182. <view class="flex justify_between">
  183. <text class="item-detail-text flex_1">{{item.code}}</text>
  184. <text class="item-detail-text" v-if="item.affiliation!='SUPER_CATALOGUE'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  185. </view>
  186. <view class="flex justify_between">
  187. <view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
  188. <view v-if="showPrice[0]">
  189. <text class="item-price" v-if="showPrice[1]=='CAR_OWNER_PRICE'">¥{{item.price||0}}</text>
  190. <text class="item-price" v-else></text>
  191. </view>
  192. </view>
  193. <view class="item-detail-text flex_1" v-else>
  194. <view v-if="showPrice[0]">
  195. <view v-if="showPrice[1]=='PURCHASES_PRICE'">
  196. <text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
  197. </view>
  198. <text v-else class="item-price">¥{{item.price||0}}</text>
  199. </view>
  200. </view>
  201. <view class="item-detail-text">
  202. <u-number-box @change="updateCartNums" @blur="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. </view>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- 去认证 -->
  213. <u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
  214. <view style="background-color: #fff;padding:1rem;">
  215. <u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
  216. <view style="padding-top:1rem;" class="flex justify_center">
  217. <u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
  218. </view>
  219. </view>
  220. </u-popup>
  221. </view>
  222. </template>
  223. <script>
  224. import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, saveShelfOrder } from '@/api/shelf'
  225. export default {
  226. data() {
  227. return {
  228. showOther: false,
  229. theme: '',
  230. vinNumber: '',
  231. leve2Data: [], // 二级菜单数据
  232. curLeve2: '', // 当前所选二级菜单
  233. carInfo: null,
  234. status: 'loading',
  235. vinStatus: 'loading',
  236. noDataText: '暂无配件',
  237. pageNo: 1,
  238. pageSize: 10,
  239. total: 0, // 列表总数
  240. noMore: false ,// 没有更多
  241. showCart: false, // 购物车
  242. carList:[], // 车型列表
  243. partList: [], // 配件列表
  244. partListData: [], // 已选配件
  245. vinPartList: [],
  246. isIphoneXup: false,
  247. saveLoading: false,
  248. showPopup: false
  249. }
  250. },
  251. computed:{
  252. modelLabel(){
  253. return this.carInfo&&this.carInfo.text||''
  254. },
  255. cartNums(){
  256. let ret = 0
  257. this.partListData.map(item => {
  258. ret = ret + item.qty
  259. })
  260. return ret
  261. },
  262. dealerPhone(){
  263. const shelfInfo = this.$store.state.vuex_storeShelf
  264. return shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
  265. },
  266. userInfo(){
  267. return this.$store.state.vuex_userInfo
  268. },
  269. storeApply(){
  270. return this.$store.state.vuex_storeAuthInfo || null
  271. },
  272. showPrice(){
  273. return this.$store.state.vuex_showPrice
  274. },
  275. isAdmin(){
  276. return this.userInfo.superAdmin == 1
  277. }
  278. },
  279. onLoad(opts) {
  280. this.theme = getApp().globalData.theme
  281. this.vinNumber = opts.vinNumber
  282. this.carInfo = opts.carList?JSON.parse(decodeURIComponent(opts.carList)):null
  283. // 获取vin 对应code
  284. this.getCarCodeByVin()
  285. console.log(this.$store.state.vuex_showPrice)
  286. // 游客
  287. if(this.userInfo.sysUserFlag == '0'){
  288. // 未认证
  289. if(!this.storeApply || this.storeApply&&!this.storeApply.auditStatus){
  290. this.showPopup = true
  291. }
  292. }
  293. },
  294. onShow() {
  295. this.$store.state.vuex_shelfChoosePart = []
  296. },
  297. methods: {
  298. toAuthStore(){
  299. this.showPopup = false
  300. uni.redirectTo({
  301. url: '/pages/storeManage/storeAuth'
  302. })
  303. },
  304. callPhone() {
  305. if(this.dealerPhone!=''){
  306. uni.makePhoneCall({
  307. phoneNumber: this.dealerPhone
  308. })
  309. }
  310. },
  311. viewImg(item){
  312. uni.previewImage({
  313. urls: [item.images]
  314. })
  315. },
  316. // 复制
  317. copyVin(){
  318. uni.setClipboardData({
  319. data: this.vinNumber||'',
  320. })
  321. },
  322. // 格式化标签数据和配件分类数据一样
  323. labelToPart(data){
  324. let arr = []
  325. data.map(item => {
  326. arr.push({
  327. id: item.id || item.productTypeSn,
  328. label: item.name
  329. })
  330. })
  331. return arr
  332. },
  333. getCarCodeByVin(){
  334. queryPartCodeByVin({vinNumber:this.vinNumber}).then(res => {
  335. console.log(res,'this.vinCode')
  336. this.vinCode = res.data
  337. this.getShelfProductType()
  338. })
  339. },
  340. // 获取数字货架分类作为二级分类
  341. getShelfProductType(){
  342. const storeShelf = this.$store.state.vuex_storeShelf
  343. getShelfProductType({
  344. codeList: this.vinCode,
  345. shelfSn: storeShelf?storeShelf.shelfSn:''
  346. }).then(res => {
  347. console.log(res,'getShelfProductType')
  348. this.leve2Data = this.labelToPart(res.data || [])
  349. // 默认该车适用或全部
  350. this.selLeve2('all')
  351. })
  352. },
  353. // 单击二级菜单
  354. selLeve2 (v) {
  355. this.pageNo = 1
  356. this.partList = []
  357. this.vinPartList = []
  358. this.curLeve2 = v
  359. if(this.vinNumber){
  360. this.getVinShelfPartList()
  361. }
  362. this.getShelfProductList()
  363. },
  364. // 获取数字货架配件列表
  365. getShelfProductList(){
  366. const _this = this
  367. let params = {
  368. pageNo: this.pageNo,
  369. pageSize: this.pageSize,
  370. excludeCodeList: this.vinCode,
  371. productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2
  372. }
  373. _this.status = 'loading'
  374. getShelfProductList(params).then(res => {
  375. console.log(res,'获取数字货架配件列表')
  376. uni.hideLoading()
  377. if(res.status == 200){
  378. let list = res.data.list
  379. if (list && list.length){
  380. // 分页 拼接数据
  381. if (_this.pageNo != 1) {
  382. _this.partList = _this.partList ? _this.partList.concat(this.fiterChecked(list)) : this.fiterChecked(list)
  383. } else {
  384. _this.partList = this.fiterChecked(list)
  385. }
  386. this.total = res.data.count
  387. if (_this.partList.length == res.data.count) {
  388. _this.status = 'nomore'
  389. } else {
  390. _this.status = 'loadmore'
  391. }
  392. } else {
  393. _this.partList = list || []
  394. this.total = 0
  395. _this.status = 'nomore'
  396. }
  397. _this.noDataText = '暂无配件'
  398. }else{
  399. _this.status = 'loadmore'
  400. _this.partList = []
  401. this.total = 0
  402. _this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
  403. }
  404. })
  405. },
  406. // 根据客户vin查询该车可用数字货架中的配件
  407. getVinShelfPartList(){
  408. let params = {
  409. queryWord: this.queryWord,
  410. productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2,
  411. codeList: this.vinCode
  412. }
  413. this.vinStatus = 'loading'
  414. getShelfQueryList(params).then(res => {
  415. this.vinPartList = this.fiterChecked(res.data || [])
  416. this.vinStatus = 'nomore'
  417. })
  418. },
  419. // 过滤已选择的
  420. fiterChecked (list){
  421. this.partListData.map(item => {
  422. let p = list.find(k => {
  423. return k.productSn == item.productSn
  424. })
  425. if (p){
  426. p.checked = true
  427. p.qty = item.qty
  428. }
  429. })
  430. return list
  431. },
  432. // 加载更多
  433. onreachBottom () {
  434. if(this.partList.length < this.total ){
  435. this.pageNo++
  436. this.getShelfProductList()
  437. }else{
  438. this.status = "nomore"
  439. }
  440. },
  441. // 添加到购物车
  442. addPart(item){
  443. item.checked = true
  444. item.qty = 1
  445. this.partListData.unshift({
  446. id: item.id,
  447. productSn: item.productSn,
  448. name: item.name,
  449. unit: item.unit,
  450. price: item.price,
  451. cost: item.cost,
  452. currentInven: item.currentInven,
  453. code: item.code,
  454. qty: item.qty,
  455. images: item.images,
  456. checked: true,
  457. affiliation: item.affiliation
  458. })
  459. },
  460. // 更新配件列表数量
  461. updatePartList(data,type){
  462. const prow = this[type].find(item => item.productSn == data.index)
  463. const index = this.partListData.findIndex(item => item.productSn == data.index)
  464. // 删除
  465. if(!data.value){
  466. prow.checked = false
  467. if(index>=0){
  468. this.partListData.splice(index,1)
  469. }
  470. if(this.partListData.length==0){
  471. this.showCart = false
  472. }
  473. }else{
  474. this.partListData[index].qty = data.value
  475. this.partListData.splice()
  476. }
  477. },
  478. // 修改适配配件上数量
  479. updateVinNums(data){
  480. this.updatePartList(data,'vinPartList')
  481. },
  482. // 修改其它配件上的数量
  483. updateNums(data){
  484. this.updatePartList(data,'partList')
  485. },
  486. // 点击购物车修改数量
  487. updateCartNums(data){
  488. console.log(data)
  489. if(!data.value){
  490. const index = this.partListData.findIndex(item => 'cart_'+item.productSn == data.index)
  491. if(index>=0){
  492. this.partListData.splice(index,1)
  493. }
  494. if(this.partListData.length==0){
  495. this.showCart = false
  496. }
  497. }
  498. // 同步更新Vin适配配件列表上的
  499. const vinprow = this.vinPartList.find(item => 'cart_'+item.productSn == data.index)
  500. if(vinprow){
  501. vinprow.qty = data.value
  502. vinprow.checked = !!data.value
  503. this.vinPartList.splice()
  504. }
  505. // 同步更新其它配件列表上的
  506. const prow = this.partList.find(item => 'cart_'+item.productSn == data.index)
  507. if(prow){
  508. prow.qty = data.value
  509. prow.checked = !!data.value
  510. this.partList.splice()
  511. }
  512. },
  513. // 打开购物车
  514. openCart(){
  515. if(this.partListData.length){
  516. this.showCart=!this.showCart
  517. }else{
  518. uni.showToast({
  519. icon: 'none',
  520. title: '请选择配件'
  521. })
  522. }
  523. },
  524. // 格式化数据
  525. formatData(){
  526. const partList = []
  527. const tempList = []
  528. this.partListData.map(item => {
  529. if(item.currentInven){
  530. partList.push({
  531. "productSn": item.productSn,
  532. "totalQty": item.qty
  533. })
  534. }else{
  535. tempList.push({
  536. "productSn": item.productSn,
  537. "qty": item.qty,
  538. "price": item.cost
  539. })
  540. }
  541. })
  542. return [partList,tempList]
  543. },
  544. // 立即提交
  545. submitForm(){
  546. // 游客去认证
  547. if(this.userInfo.sysUserFlag == '0'){
  548. // 未认证
  549. if(!this.storeApply || this.storeApply&&(!this.storeApply.auditStatus || this.storeApply.auditStatus == 'REFUSE')){
  550. this.showPopup = true
  551. }
  552. // 认证通过
  553. if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
  554. uni.showModal({
  555. title: '提示',
  556. content: '门店认证资料审核中,请耐心等待!',
  557. confirmText: '好的',
  558. showCancel: false
  559. })
  560. }
  561. }else{
  562. // 已认证用户
  563. if(this.partListData.length==0){
  564. uni.showToast({
  565. icon: 'none',
  566. title: '请选择配件'
  567. })
  568. return
  569. }
  570. // 开始提交
  571. const params = {
  572. shelfOrderDetailList: this.formatData()[0],
  573. tempBillDetailList: this.formatData()[1],
  574. vin: this.vinNumber,
  575. vehicleModel: this.modelLabel || '',
  576. vehicleLogo: this.carInfo.icon||'',
  577. }
  578. console.log(params,'立即提交')
  579. this.saveLoading = true
  580. saveShelfOrder(params).then(res => {
  581. console.log(res,'saveShelfOrder')
  582. if(res.status == 200){
  583. // 提交成功
  584. uni.redirectTo({
  585. url:"/pages/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify(res.data))+"&state=1"
  586. })
  587. }else{
  588. // 或失败
  589. uni.redirectTo({
  590. url:"/pages/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify({shelfOrder:{remindMessage:res.message}}))+"&state=0"
  591. })
  592. }
  593. this.saveLoading = false
  594. })
  595. }
  596. }
  597. }
  598. }
  599. </script>
  600. <style lang="less">
  601. .choosePartByVin{
  602. height: 100vh;
  603. .cpb_header{
  604. background-color: #FFFFFF;
  605. padding: 10rpx;
  606. align-items: center;
  607. > div{
  608. padding: 10rpx;
  609. align-items: center;
  610. &:first-child{
  611. padding-right: 20rpx;
  612. }
  613. > div{
  614. &:first-child{
  615. padding-right: 20rpx;
  616. flex-grow: 1;
  617. color: #818b94;
  618. font-size: 24rpx;
  619. }
  620. }
  621. }
  622. .copyText{
  623. background-color: #EBEBEB;
  624. border-radius: 100rpx;
  625. padding: 0 20rpx;
  626. color: #033692;
  627. font-size: 20rpx;
  628. display: flex;
  629. align-items: center;
  630. justify-content: center;
  631. margin-left: 20rpx;
  632. }
  633. .carTits{
  634. font-size: 32rpx;
  635. font-weight: bold;
  636. color: #222222;
  637. line-height: normal;
  638. margin-bottom: 10rpx;
  639. flex-grow: 1;
  640. }
  641. .qhbtns{
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. font-size: 20rpx;
  646. color: #0485F6;
  647. border:2rpx solid #0485F6;
  648. border-radius: 50rpx;
  649. background: rgba(88, 177, 255, 0.2);
  650. width: 200rpx;
  651. height: 36rpx;
  652. margin-left: 10rpx;
  653. }
  654. }
  655. .cpb_middle{
  656. flex-grow: 1;
  657. padding-top: 10rpx;
  658. overflow: auto;
  659. .slider-bar{
  660. width: 25%;
  661. background: #F5F6F7;
  662. height: 100%;
  663. overflow: auto;
  664. .tabs{
  665. > view{
  666. border-left: 6rpx solid #F5F6F7;
  667. padding: 30rpx 10rpx;
  668. font-size: 30rpx;
  669. color: #666E75;
  670. }
  671. .active{
  672. border-color: #0485F6;
  673. color: #0485F6;
  674. background: #fff;
  675. }
  676. }
  677. }
  678. .right-list{
  679. flex-grow: 1;
  680. background: #fff;
  681. height: 100%;
  682. width: 75%;
  683. .right-list-content{
  684. height: 100%;
  685. .nav-right-title{
  686. font-weight: bold;
  687. padding: 5upx 25upx;
  688. > text{
  689. color: #9E9E9E;
  690. font-weight: normal;
  691. }
  692. }
  693. .nav-right-item{
  694. padding: 15upx 25upx;
  695. border-bottom: 2rpx solid #f5f5f5;
  696. .item-info{
  697. padding-left: 20upx;
  698. flex-grow: 1;
  699. .item-name{
  700. font-size: 32upx;
  701. color: #191919;
  702. display: flex;
  703. align-items: center;
  704. >image{
  705. width: 38rpx;
  706. height: 38rpx;
  707. margin-right: 10rpx;
  708. }
  709. >text{
  710. flex: 1;
  711. word-break: break-all;
  712. }
  713. }
  714. .item-detail{
  715. .item-detail-info{
  716. padding: 10upx 0 4upx;
  717. > view{
  718. padding-bottom: 10rpx;
  719. align-items: center;
  720. .item-detail-text{
  721. color: #999;
  722. .phtxt{
  723. color: #0485F6;
  724. font-size: 28upx;
  725. }
  726. .item-price{
  727. color: #FB1E1E;
  728. font-size: 28upx;
  729. }
  730. }
  731. }
  732. }
  733. }
  734. }
  735. }
  736. }
  737. }
  738. }
  739. .cpb_footer{
  740. padding: 20rpx;
  741. background-color: #fff;
  742. align-items: center;
  743. justify-content: space-between;
  744. .cpb_cart{
  745. width: 84rpx;
  746. height: 84rpx;
  747. background-color: #0485F6;
  748. border-radius: 200rpx;
  749. display: flex;
  750. align-items: center;
  751. justify-content: center;
  752. position: relative;
  753. }
  754. > div{
  755. &:last-child{
  756. width: 40%;
  757. }
  758. }
  759. }
  760. .cpb_cart-mask{
  761. position: fixed;
  762. width: 100%;
  763. background: rgba(0,0,0,0.5);
  764. z-index: 900;
  765. bottom: 120rpx;
  766. top: 0;
  767. }
  768. .cpb_cart-box{
  769. background-color: #fff;
  770. position: absolute;
  771. width: 100%;
  772. z-index: 1000;
  773. bottom: 0;
  774. padding: 20rpx 0;
  775. border-radius: 30rpx 30rpx 0 0;
  776. max-height: 70vh;
  777. display: flex;
  778. flex-direction: column;
  779. .cpb_close{
  780. position: absolute;
  781. top: 20rpx;
  782. right: 20rpx;
  783. width: 70rpx;
  784. height: 70rpx;
  785. font-size: 32rpx;
  786. color: #999;
  787. }
  788. .cpb_cart-tit{
  789. text-align: center;
  790. padding: 20rpx;
  791. font-size: 36rpx;
  792. }
  793. .cpb_cart-list{
  794. padding: 20rpx 30rpx;
  795. overflow: auto;
  796. flex-grow: 1;
  797. > view{
  798. margin-bottom: 30rpx;
  799. }
  800. .item-name{
  801. font-size: 32rpx;
  802. .item-tempPart{
  803. background: #0055ff;
  804. color: #fff;
  805. border-radius: 1em;
  806. font-size: 0.8em;
  807. padding: 0 0.5em;
  808. }
  809. }
  810. .item-info{
  811. border-bottom:2rpx solid #f8f8f8;
  812. flex-grow: 1;
  813. padding-left: 0.8em;
  814. }
  815. .item-detail{
  816. .item-detail-info{
  817. padding: 10upx 0 4upx;
  818. > view{
  819. padding-bottom: 30rpx;
  820. align-items: center;
  821. .item-detail-text{
  822. color: #999;
  823. .phtxt{
  824. color: #0485F6;
  825. font-size: 28upx;
  826. }
  827. .item-price{
  828. color: #FB1E1E;
  829. font-size: 28upx;
  830. }
  831. }
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. </style>