choosePart.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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. hasRedPacket(){
  294. const rule = this.$store.state.vuex_rewardRule
  295. return rule&&rule.ruleStatus == 'release'
  296. }
  297. },
  298. onLoad(opts) {
  299. this.theme = getApp().globalData.theme
  300. this.vinNumber = opts.vinNumber
  301. this.carInfo = opts.carList?JSON.parse(decodeURIComponent(opts.carList)):null
  302. // 获取vin 对应code
  303. this.getCarCodeByVin()
  304. console.log(this.$store.state.vuex_showPrice)
  305. // 游客
  306. if(this.userInfo.sysUserFlag == '0'){
  307. // 未认证
  308. if(!this.storeApply || this.storeApply&&!this.storeApply.auditStatus){
  309. this.showPopup = true
  310. }
  311. }
  312. },
  313. onShow() {
  314. this.$store.state.vuex_shelfChoosePart = []
  315. },
  316. methods: {
  317. toAuthStore(){
  318. this.showPopup = false
  319. uni.redirectTo({
  320. url: '/pages/storeManage/storeAuth'
  321. })
  322. },
  323. callPhone() {
  324. if(this.dealerPhone!=''){
  325. uni.makePhoneCall({
  326. phoneNumber: this.dealerPhone
  327. })
  328. }
  329. },
  330. viewImg(item){
  331. uni.previewImage({
  332. urls: [item.images]
  333. })
  334. },
  335. // 复制
  336. copyVin(){
  337. uni.setClipboardData({
  338. data: this.vinNumber||'',
  339. })
  340. },
  341. // 格式化标签数据和配件分类数据一样
  342. labelToPart(data){
  343. let arr = []
  344. data.map(item => {
  345. arr.push({
  346. id: item.id || item.productTypeSn,
  347. label: item.name
  348. })
  349. })
  350. return arr
  351. },
  352. getCarCodeByVin(){
  353. queryPartCodeByVin({vinNumber:this.vinNumber}).then(res => {
  354. console.log(res,'this.vinCode')
  355. this.vinCode = res.data
  356. this.getShelfProductType()
  357. })
  358. },
  359. // 获取数字货架分类作为二级分类
  360. getShelfProductType(){
  361. const storeShelf = this.$store.state.vuex_storeShelf
  362. getShelfProductType({
  363. codeList: this.vinCode,
  364. shelfSn: storeShelf?storeShelf.shelfSn:''
  365. }).then(res => {
  366. console.log(res,'getShelfProductType')
  367. this.leve2Data = this.labelToPart(res.data || [])
  368. // 默认该车适用或全部
  369. this.selLeve2('all')
  370. })
  371. },
  372. // 单击二级菜单
  373. selLeve2 (v) {
  374. this.pageNo = 1
  375. this.partList = []
  376. this.vinPartList = []
  377. this.curLeve2 = v
  378. if(this.vinNumber){
  379. this.getVinShelfPartList()
  380. }
  381. this.getShelfProductList()
  382. },
  383. // 获取数字货架配件列表
  384. getShelfProductList(){
  385. const _this = this
  386. let params = {
  387. pageNo: this.pageNo,
  388. pageSize: this.pageSize,
  389. excludeCodeList: this.vinCode,
  390. productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2
  391. }
  392. _this.status = 'loading'
  393. getShelfProductList(params).then(res => {
  394. console.log(res,'获取数字货架配件列表')
  395. uni.hideLoading()
  396. if(res.status == 200){
  397. let list = res.data.list
  398. if (list && list.length){
  399. // 分页 拼接数据
  400. if (_this.pageNo != 1) {
  401. _this.partList = _this.partList ? _this.partList.concat(this.fiterChecked(list)) : this.fiterChecked(list)
  402. } else {
  403. _this.partList = this.fiterChecked(list)
  404. }
  405. this.total = res.data.count
  406. if (_this.partList.length == res.data.count) {
  407. _this.status = 'nomore'
  408. } else {
  409. _this.status = 'loadmore'
  410. }
  411. } else {
  412. _this.partList = list || []
  413. this.total = 0
  414. _this.status = 'nomore'
  415. }
  416. _this.noDataText = '暂无配件'
  417. }else{
  418. _this.status = 'loadmore'
  419. _this.partList = []
  420. this.total = 0
  421. _this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
  422. }
  423. })
  424. },
  425. // 根据客户vin查询该车可用数字货架中的配件
  426. getVinShelfPartList(){
  427. let params = {
  428. queryWord: this.queryWord,
  429. productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2,
  430. codeList: this.vinCode
  431. }
  432. this.vinStatus = 'loading'
  433. getShelfQueryList(params).then(res => {
  434. this.vinPartList = this.fiterChecked(res.data || [])
  435. this.vinStatus = 'nomore'
  436. })
  437. },
  438. // 过滤已选择的
  439. fiterChecked (list){
  440. this.partListData.map(item => {
  441. let p = list.find(k => {
  442. return k.productSn == item.productSn
  443. })
  444. if (p){
  445. p.checked = true
  446. p.qty = item.qty
  447. }
  448. })
  449. return list
  450. },
  451. // 加载更多
  452. onreachBottom () {
  453. if(this.partList.length < this.total ){
  454. this.pageNo++
  455. this.getShelfProductList()
  456. }else{
  457. this.status = "nomore"
  458. }
  459. },
  460. // 添加到购物车
  461. addPart(item){
  462. item.checked = true
  463. item.qty = 1
  464. this.partListData.unshift({
  465. id: item.id,
  466. productSn: item.productSn,
  467. name: item.name,
  468. unit: item.unit,
  469. price: item.price,
  470. cost: item.cost,
  471. currentInven: item.currentInven,
  472. code: item.code,
  473. qty: item.qty,
  474. images: item.images,
  475. checked: true,
  476. affiliation: item.affiliation
  477. })
  478. },
  479. // 更新配件列表数量
  480. updatePartList(data,type){
  481. const prow = this[type].find(item => item.productSn == data.index)
  482. const index = this.partListData.findIndex(item => item.productSn == data.index)
  483. // 删除
  484. if(!data.value){
  485. prow.checked = false
  486. if(index>=0){
  487. this.partListData.splice(index,1)
  488. }
  489. if(this.partListData.length==0){
  490. this.showCart = false
  491. }
  492. }else{
  493. this.partListData[index].qty = data.value
  494. this.partListData.splice()
  495. }
  496. },
  497. // 修改适配配件上数量
  498. updateVinNums(data){
  499. this.updatePartList(data,'vinPartList')
  500. },
  501. // 修改其它配件上的数量
  502. updateNums(data){
  503. this.updatePartList(data,'partList')
  504. },
  505. // 点击购物车修改数量
  506. updateCartNums(data){
  507. console.log(data)
  508. if(!data.value){
  509. const index = this.partListData.findIndex(item => 'cart_'+item.productSn == data.index)
  510. if(index>=0){
  511. this.partListData.splice(index,1)
  512. }
  513. if(this.partListData.length==0){
  514. this.showCart = false
  515. }
  516. }
  517. // 同步更新Vin适配配件列表上的
  518. const vinprow = this.vinPartList.find(item => 'cart_'+item.productSn == data.index)
  519. if(vinprow){
  520. vinprow.qty = data.value
  521. vinprow.checked = !!data.value
  522. this.vinPartList.splice()
  523. }
  524. // 同步更新其它配件列表上的
  525. const prow = this.partList.find(item => 'cart_'+item.productSn == data.index)
  526. if(prow){
  527. prow.qty = data.value
  528. prow.checked = !!data.value
  529. this.partList.splice()
  530. }
  531. },
  532. // 打开购物车
  533. openCart(){
  534. if(this.partListData.length){
  535. this.showCart=!this.showCart
  536. }else{
  537. uni.showToast({
  538. icon: 'none',
  539. title: '请选择配件'
  540. })
  541. }
  542. },
  543. // 格式化数据
  544. formatData(){
  545. const partList = []
  546. const tempList = []
  547. this.partListData.map(item => {
  548. if(item.currentInven){
  549. partList.push({
  550. "productSn": item.productSn,
  551. "totalQty": item.qty
  552. })
  553. }else{
  554. tempList.push({
  555. "productSn": item.productSn,
  556. "qty": item.qty,
  557. // "price": item.cost
  558. })
  559. }
  560. })
  561. return [partList,tempList]
  562. },
  563. // 立即提交
  564. submitForm(){
  565. // 游客去认证
  566. if(this.userInfo.sysUserFlag == '0'){
  567. // 未认证
  568. if(!this.storeApply || this.storeApply&&(!this.storeApply.auditStatus || this.storeApply.auditStatus == 'REFUSE')){
  569. this.showPopup = true
  570. }
  571. // 认证通过
  572. if(this.storeApply&&this.storeApply.auditStatus=='WAIT'){
  573. uni.showModal({
  574. title: '提示',
  575. content: '门店认证资料审核中,请耐心等待!',
  576. confirmText: '好的',
  577. showCancel: false
  578. })
  579. }
  580. }else{
  581. // 已认证用户
  582. if(this.partListData.length==0){
  583. uni.showToast({
  584. icon: 'none',
  585. title: '请选择配件'
  586. })
  587. return
  588. }
  589. // 开始提交
  590. const params = {
  591. shelfOrderDetailList: this.formatData()[0],
  592. tempBillDetailList: this.formatData()[1],
  593. vin: this.vinNumber,
  594. vehicleModel: this.modelLabel || '',
  595. vehicleLogo: this.carInfo.icon||'',
  596. billSource: 'vin'
  597. }
  598. console.log(params,'立即提交')
  599. this.saveLoading = true
  600. shelfOrderFlowCreate(params).then(res => {
  601. console.log(res,'shelfOrderFlowCreate')
  602. if(res.status == 200){
  603. // 提交成功
  604. uni.redirectTo({
  605. url:"/pagesA/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify(res.data))+"&state=1"
  606. })
  607. }else{
  608. // 或失败
  609. uni.redirectTo({
  610. url:"/pagesA/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify({shelfOrder:{remindMessage:res.message}}))+"&state=0"
  611. })
  612. }
  613. this.saveLoading = false
  614. })
  615. }
  616. },
  617. }
  618. }
  619. </script>
  620. <style lang="less">
  621. .choosePartByVin{
  622. height: 100vh;
  623. .cpb_header{
  624. background-color: #FFFFFF;
  625. padding: 10rpx;
  626. align-items: center;
  627. > div{
  628. padding: 10rpx;
  629. align-items: center;
  630. &:first-child{
  631. padding-right: 20rpx;
  632. }
  633. > div{
  634. &:first-child{
  635. padding-right: 20rpx;
  636. flex-grow: 1;
  637. color: #818b94;
  638. font-size: 24rpx;
  639. }
  640. }
  641. }
  642. .copyText{
  643. background-color: #EBEBEB;
  644. border-radius: 100rpx;
  645. padding: 0 20rpx;
  646. color: #033692;
  647. font-size: 20rpx;
  648. display: flex;
  649. align-items: center;
  650. justify-content: center;
  651. margin-left: 20rpx;
  652. }
  653. .carTits{
  654. font-size: 32rpx;
  655. font-weight: bold;
  656. color: #222222;
  657. line-height: normal;
  658. margin-bottom: 10rpx;
  659. flex-grow: 1;
  660. }
  661. .qhbtns{
  662. display: flex;
  663. align-items: center;
  664. justify-content: center;
  665. font-size: 20rpx;
  666. color: #0485F6;
  667. border:2rpx solid #0485F6;
  668. border-radius: 50rpx;
  669. background: rgba(88, 177, 255, 0.2);
  670. width: 200rpx;
  671. height: 36rpx;
  672. margin-left: 10rpx;
  673. }
  674. }
  675. .cpb_middle{
  676. flex-grow: 1;
  677. padding-top: 10rpx;
  678. overflow: auto;
  679. .slider-bar{
  680. width: 25%;
  681. background: #F5F6F7;
  682. height: 100%;
  683. overflow: auto;
  684. .tabs{
  685. > view{
  686. border-left: 6rpx solid #F5F6F7;
  687. padding: 30rpx 10rpx;
  688. font-size: 30rpx;
  689. color: #666E75;
  690. }
  691. .active{
  692. border-color: #0485F6;
  693. color: #0485F6;
  694. background: #fff;
  695. }
  696. }
  697. }
  698. .right-list{
  699. flex-grow: 1;
  700. background: #fff;
  701. height: 100%;
  702. width: 75%;
  703. .right-list-content{
  704. height: 100%;
  705. .nav-right-title{
  706. font-weight: bold;
  707. padding: 5upx 25upx;
  708. > text{
  709. color: #9E9E9E;
  710. font-weight: normal;
  711. }
  712. }
  713. .nav-right-item{
  714. padding: 15upx 25upx;
  715. border-bottom: 2rpx solid #f5f5f5;
  716. .item-info{
  717. padding-left: 20upx;
  718. flex-grow: 1;
  719. .item-name{
  720. font-size: 32upx;
  721. color: #191919;
  722. display: flex;
  723. align-items: center;
  724. >image{
  725. width: 38rpx;
  726. height: 38rpx;
  727. margin-right: 10rpx;
  728. }
  729. >text{
  730. flex: 1;
  731. word-break: break-all;
  732. }
  733. }
  734. .item-detail{
  735. .item-detail-info{
  736. padding: 10upx 0 4upx;
  737. > view{
  738. padding-bottom: 10rpx;
  739. align-items: center;
  740. .item-detail-text{
  741. color: #999;
  742. .phtxt{
  743. color: #0485F6;
  744. font-size: 28upx;
  745. }
  746. .item-price{
  747. color: #FB1E1E;
  748. font-size: 28upx;
  749. }
  750. }
  751. }
  752. }
  753. }
  754. }
  755. }
  756. }
  757. }
  758. }
  759. .cpb_footer{
  760. padding: 20rpx;
  761. background-color: #fff;
  762. align-items: center;
  763. justify-content: space-between;
  764. .cpb_cart{
  765. width: 84rpx;
  766. height: 84rpx;
  767. background-color: #0485F6;
  768. border-radius: 200rpx;
  769. display: flex;
  770. align-items: center;
  771. justify-content: center;
  772. position: relative;
  773. }
  774. > div{
  775. &:last-child{
  776. width: 40%;
  777. }
  778. }
  779. }
  780. .cpb_cart-mask{
  781. position: fixed;
  782. width: 100%;
  783. background: rgba(0,0,0,0.5);
  784. z-index: 900;
  785. bottom: 120rpx;
  786. top: 0;
  787. }
  788. .cpb_cart-box{
  789. background-color: #fff;
  790. position: absolute;
  791. width: 100%;
  792. z-index: 1000;
  793. bottom: 0;
  794. padding: 20rpx 0;
  795. border-radius: 30rpx 30rpx 0 0;
  796. max-height: 70vh;
  797. display: flex;
  798. flex-direction: column;
  799. .cpb_close{
  800. position: absolute;
  801. top: 20rpx;
  802. right: 20rpx;
  803. width: 70rpx;
  804. height: 70rpx;
  805. font-size: 32rpx;
  806. color: #999;
  807. }
  808. .cpb_cart-tit{
  809. text-align: center;
  810. padding: 20rpx;
  811. font-size: 36rpx;
  812. }
  813. .cpb_cart-list{
  814. padding: 20rpx 30rpx;
  815. overflow: auto;
  816. flex-grow: 1;
  817. > view{
  818. margin-bottom: 30rpx;
  819. }
  820. .item-name{
  821. font-size: 32rpx;
  822. .item-tempPart{
  823. background: #0055ff;
  824. color: #fff;
  825. border-radius: 1em;
  826. font-size: 0.8em;
  827. padding: 0 0.5em;
  828. }
  829. }
  830. .item-info{
  831. border-bottom:2rpx solid #f8f8f8;
  832. flex-grow: 1;
  833. padding-left: 0.8em;
  834. }
  835. .item-detail{
  836. .item-detail-info{
  837. padding: 10upx 0 4upx;
  838. > view{
  839. padding-bottom: 30rpx;
  840. align-items: center;
  841. .item-detail-text{
  842. color: #999;
  843. .phtxt{
  844. color: #0485F6;
  845. font-size: 28upx;
  846. }
  847. .item-price{
  848. color: #FB1E1E;
  849. font-size: 28upx;
  850. }
  851. }
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. </style>