choosePart.vue 25 KB

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