index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <view>
  3. <view class="content">
  4. <!-- 头部栏 -->
  5. <view class="header-box">
  6. <UniStatusBar></UniStatusBar>
  7. <view class="title flex align_center" :style="{height:(navHeight+'px')}">
  8. <u-image src="/static/logo-h.png" width="349" height='40'></u-image>
  9. </view>
  10. </view>
  11. <view class="cbody">
  12. <view class="body-box bg-blue">
  13. <!-- 滚动区域 -->
  14. <view class="scroll-list">
  15. <scrollBox v-if="list.length&&!hasRedPacket" :list="list"></scrollBox>
  16. <scrollBox v-if="slist.length&&hasRedPacket" :list="slist"></scrollBox>
  17. </view>
  18. <!-- 版本提示 -->
  19. <view class="notices flex align_center" v-if="showVersion">
  20. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 当前是体验版</view>
  21. </view>
  22. <!-- 保证金 -->
  23. <view class="notices flex align_center" v-if="bondRecord" @click="toPayBondAmount">
  24. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有一笔保证金待支付 ¥{{bondRecord.bondAmount}}</view>
  25. <!-- <text class="text">立即支付>></text> -->
  26. </view>
  27. <!-- 待取货提醒 -->
  28. <view class="notices flex align_center" v-if="!bondRecord&&orderTodo" @click="toOrder">
  29. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有待取货的货架订单哦!</view> <text class="text">立即处理>></text>
  30. </view>
  31. <!-- 门店审核不通过 -->
  32. <view class="notices flex justify_between" v-if="storeApply&&storeApply.auditStatus=='REFUSE'&&storeApply.readFlag=='0'">
  33. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 门店认证资料审核不通过,请重新提交审核!</view> <text class="text" @click="toKnow">知道了</text>
  34. </view>
  35. <!-- 名片 -->
  36. <view class="userCard flex align_center justify_between">
  37. <view class="userCard-info flex align_center">
  38. <view>
  39. <u-image shape='circle' v-if="!hasLogin" src="/static/def_personal_avatar.png" width="90" height="90"></u-image>
  40. <u-image shape='circle' v-else :src="avatarUrl||'/static/def_personal_avatar.png'" width="90" height="90"></u-image>
  41. </view>
  42. <view class="user-info" @click="toUser">
  43. <view v-if="!hasLogin" style="font-size: 40rpx;">
  44. 请点击登录
  45. </view>
  46. <view v-else>
  47. <view class="user-name">{{userInfo.userNameCN || userInfo.mobile}}</view>
  48. <view v-if="hasLogin&&userInfo&&userInfo.sysUserFlag == '0'">
  49. <u-tag text="个人用户" mode="dark" type="warning" shape="circle" size="mini" />
  50. </view>
  51. <view v-else>{{userInfo.orgName}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view @click="toUser">
  56. <text v-if="hasLogin&&userInfo&&userInfo.sysUserFlag == '0'" class="user-rz">
  57. {{storeApply&&storeApply.auditStatus=='WAIT'?'认证门店审核中':'认证成为门店'}}
  58. </text>
  59. <u-icon name="arrow-right"></u-icon>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="body-box">
  64. <!-- 扫描按钮 -->
  65. <view class="action-button flex" v-if="userInfo.sysUserFlag == '1'">
  66. <view class="f1" @click="openTakeGood(1)">
  67. <view class="icons"><u-icon name="bianmachaxun" custom-prefix="custom-icon"></u-icon></view>
  68. <view class="tits">产品编码取货</view>
  69. </view>
  70. <view class="f2" @click="openTakeGood(0)">
  71. <view class="icons"><u-icon name="saoma" custom-prefix="custom-icon"></u-icon></view>
  72. <view class="tits">二维码/条形码取货</view>
  73. </view>
  74. </view>
  75. <!-- banner -->
  76. <view style="margin-top: 20upx;">
  77. <u-swiper mode="dot" bg-color="" img-mode="widthFix" @click="clickBanner" :interval="3000" :height="374" :list="imgList"></u-swiper>
  78. </view>
  79. </view>
  80. <!-- 扫描记录 -->
  81. <view class="list-box">
  82. <!-- 扫描记录 -->
  83. <u-cell-group :border="false">
  84. <u-cell-item title="VIN查询历史" @click="toAllRecord" :title-style="{fontSize:'1em'}" value="全部">
  85. <u-icon slot="icon" size="38" color="#066cff" style="margin-right: 0.3em;" name="order"></u-icon>
  86. </u-cell-item>
  87. </u-cell-group>
  88. <u-cell-group :border="false" v-if="hasLogin">
  89. <u-cell-item v-for="item in vinList"
  90. @click="toChoosePart(item)"
  91. :key="item.id"
  92. :title="item.vinCode"
  93. :title-style="{fontSize:'1em'}"
  94. :label="userInfo&&userInfo.sysUserFlag == '0' ? item.createDate : (item.brandName +' '+item.modelName)">
  95. <text slot="icon"></text>
  96. </u-cell-item>
  97. <view style="padding: 20upx;">
  98. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="vinList.length==0 && status!='loading'" mode="list"></u-empty>
  99. <u-loadmore v-if="status=='loading'" :status="status" />
  100. </view>
  101. </u-cell-group>
  102. <view class="des" v-if="vinList.length&&hasLogin">仅展示最近5条记录,点击“全部”查看更多</view>
  103. <view class="des" v-if="!hasLogin">请登录后查看历史记录</view>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- tab栏 -->
  108. <u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :midButton="vuex_tabBarList.length==5"></u-tabbar>
  109. </view>
  110. </template>
  111. <script>
  112. import {
  113. mapState,
  114. mapMutations,
  115. } from 'vuex'
  116. import scrollBox from '@/components/scrollBox.vue'
  117. import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
  118. import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty, getProductfindByScanCode, queryQplsConfig } from '@/api/shelf.js'
  119. import { xprhStoreApplyRead } from '@/api/xprh.js'
  120. import { findCurrentRewardRule } from '@/api/rewardRule.js'
  121. import { listLookUp, getLookUpDatas, getCurrUserInfo } from '@/api/data.js';
  122. import { scanVinLogQueryRoll, getScanVinLogList, getScanGetMaxQty }from '@/api/car.js'
  123. import { promoTerminalList } from '@/api/video.js'
  124. import { getRewardRollList } from '@/api/rewardRule.js'
  125. import { openWebView } from "@/utils/index.js"
  126. export default {
  127. components: {
  128. scrollBox, // 无缝滚动组件
  129. UniStatusBar // 状态栏组件
  130. },
  131. data() {
  132. return {
  133. status: 'loading',
  134. noDataText: '暂无数据',
  135. bondRecord: null, // 保证金
  136. list:[], // 扫描记录滚动
  137. slist:[], // 红包滚动
  138. vinList: [], // 扫描记录
  139. orderTodo: null, // 待取货的货架订单信息
  140. avatarUrl:'', // 用户图像
  141. navHeight: '44', // 头部高度
  142. scanMaxNums: 10, // 扫描VIN仅限10次
  143. carouselList: [] // 修理厂促销活动列表
  144. }
  145. },
  146. computed: {
  147. ...mapState(['hasLogin','vuex_vinScanNums','vuex_tabBarList']),
  148. // 显示开发版本信息
  149. showVersion () {
  150. const baseUrl = getApp().globalData.baseUrl
  151. return baseUrl.indexOf(".test.") >= 0
  152. },
  153. // 是否有数字货架
  154. hasShelf(){
  155. return this.$store.state.vuex_storeShelf
  156. },
  157. // 登录用户信息
  158. userInfo(){
  159. return this.$store.state.vuex_userInfo
  160. },
  161. // 是否有门店申请信息
  162. storeApply(){
  163. return this.$store.state.vuex_storeAuthInfo || null
  164. },
  165. // 是否有红包
  166. hasRedPacket(){
  167. const rule = this.$store.state.vuex_rewardRule
  168. return rule&&rule.ruleStatus == 'release'
  169. },
  170. // banner 图片列表
  171. imgList(){
  172. let list = [
  173. {
  174. image: '/static/banner1.png',
  175. activeType: ''
  176. }
  177. ]
  178. if(this.hasRedPacket&&this.hasShelf){
  179. list.push(
  180. {
  181. image: '/static/banner2.png',
  182. activeType: 'redPacket'
  183. })
  184. }
  185. return list.concat(this.carouselList)
  186. }
  187. },
  188. onReady() {
  189. // 滚动扫描记录
  190. this.getScrollLog()
  191. // 获取导航栏高度
  192. const res = uni.getSystemInfoSync()
  193. const system = res.platform
  194. if (system === 'android') {
  195. this.navHeight = 48
  196. } else if (system === 'ios') {
  197. this.navHeight = 44
  198. }
  199. },
  200. onLoad() {
  201. this.orderTodo = null
  202. this.bondRecord = null
  203. this.vinList = []
  204. // 视频类型
  205. this.getLookUpList('CONTENT_CATEGORY', 'vuex_videoTypeList');
  206. // 检测是否登录
  207. this.$store.dispatch('checkLogin',()=>{
  208. // 获取数据字典
  209. this.getListLookUp();
  210. // 获取支付,收款方式
  211. this.getLookUpList('PAY_PROCUCT_TYPE', 'vuex_paymentTypeList');
  212. // 价格类型
  213. this.getLookUpList('PRICE_SHOW_TYPE', 'vuex_priceTypeList');
  214. // 初始化页面
  215. this.pageInit(false)
  216. })
  217. // 刷新首页数据
  218. uni.$on("refashHome",()=>{
  219. this.pageInit(true)
  220. })
  221. },
  222. // 页面卸载
  223. onUnload() {
  224. uni.$off('refashHome')
  225. uni.$off('refashProm')
  226. },
  227. // 下拉刷新
  228. onPullDownRefresh(){
  229. this.pageInit(true)
  230. setTimeout(function () {
  231. uni.stopPullDownRefresh();
  232. }, 1000);
  233. },
  234. onShareAppMessage() {},
  235. onShow() {
  236. // 用户头像
  237. this.avatarUrl = uni.getStorageSync('userPhoto');
  238. if(this.hasLogin){
  239. // 查询门店认证信息
  240. if(this.userInfo.sysUserFlag == '0'){
  241. this.findLastApply()
  242. }
  243. if(this.userInfo.sysUserFlag == '1'){
  244. // 查询红包活动
  245. this.getRedPacketRule()
  246. }
  247. // 重新刷新
  248. this.pageInit(true)
  249. }else{
  250. // 隐藏促销模块
  251. this.hidePromoTab()
  252. }
  253. },
  254. methods: {
  255. // 扫描vin
  256. beforeSwitch(index){
  257. const row = this.$store.state.vuex_tabBarList[index]
  258. if(row.text == '促销'){
  259. uni.$emit('refashProm')
  260. }
  261. if(row.text == '扫描VIN'){
  262. this.openCamera()
  263. }else{
  264. return true
  265. }
  266. },
  267. // 轮播图片
  268. getCarousel(){
  269. this.carouselList = []
  270. // 获取所有促销活动数据
  271. promoTerminalList({}).then(res => {
  272. if(res.status == 200){
  273. res.data&&res.data.map(item => {
  274. item.image = item.imageSet&&item.imageSet[0] // 默认取第一张图片
  275. })
  276. // 过滤掉产品促销活动
  277. // this.carouselList = res.data.filter(item => item.content.indexOf("pages/promo/index") < 0)
  278. // 所有数据
  279. this.carouselList = res.data
  280. }
  281. })
  282. },
  283. pageInit(flag){
  284. this.carouselList = []
  285. if(this.hasLogin){
  286. // 获取扫描记录
  287. this.getVinLog()
  288. // 非游客
  289. if(this.userInfo.sysUserFlag == '1'){
  290. // 查询是否有数字货架
  291. this.getStoreShelf(flag)
  292. }else{
  293. // 获取扫描次数
  294. this.$store.dispatch("getScanNums")
  295. // 获取最大扫描次数
  296. this.getMaxQty()
  297. // 查询门店认证信息
  298. this.findLastApply()
  299. }
  300. }else{
  301. uni.removeStorageSync('token')
  302. }
  303. },
  304. // 获取数据字典
  305. getListLookUp() {
  306. const _this = this;
  307. listLookUp({ pageNo: 1, pageSize: 1000 }).then(res => {
  308. if (res.status == 200) {
  309. _this.$store.state.vuex_allLookUp = res.data;
  310. }
  311. });
  312. },
  313. // 或某一项字典列表,参数code
  314. getLookUpList(code, vuexKey) {
  315. getLookUpDatas({ type: code }).then(res => {
  316. if (res.status == 200) {
  317. this.$store.state[vuexKey] = res.data || [];
  318. }
  319. });
  320. },
  321. // 获取价格配置
  322. getPriceCofig(){
  323. const data = this.$store.state.vuex_storeShelf
  324. queryQplsConfig({shelfSn: data.shelfSn}).then(res => {
  325. this.$store.state.vuex_configPrice = res.data || null
  326. })
  327. },
  328. // 最新用户信息
  329. getCurrUserInfo(){
  330. getCurrUserInfo().then(res => {
  331. if(res.data){
  332. this.$store.state.vuex_userInfo.userNameCN = res.data.name;
  333. this.$store.state.vuex_userInfo.mobile = res.data.mobile;
  334. this.$store.state.vuex_userInfo.adminId = res.data.id;
  335. this.$store.state.vuex_userPhoto = res.data.photo;
  336. uni.setStorageSync('userPhoto', res.data.photo);
  337. }
  338. })
  339. },
  340. // 获取最大扫描数
  341. getMaxQty(){
  342. getScanGetMaxQty().then(res => {
  343. this.scanMaxNums = res.data || 10
  344. this.$store.state.vuex_scanMaxNums = this.scanMaxNums
  345. })
  346. },
  347. // 获取最新申请门店
  348. findLastApply(){
  349. const mobile = this.userInfo.mobile
  350. this.$store.dispatch('getSotreAuth',mobile)
  351. },
  352. // 知道审核不通过
  353. toKnow(){
  354. uni.showLoading({
  355. title: "正在提交"
  356. })
  357. xprhStoreApplyRead({sn:this.storeApply.applySn}).then(res => {
  358. if(res.status == 200){
  359. this.findLastApply()
  360. }
  361. uni.hideLoading()
  362. })
  363. },
  364. // 待取货数量合计
  365. shelfGetTotalWaitQty(){
  366. shelfGetTotalWaitQty({billState:'WAIT'}).then(res => {
  367. if(res.status == 200){
  368. this.orderTodo = res.data;
  369. }
  370. })
  371. },
  372. // 货架订单列表
  373. toOrder(){
  374. if(this.hasShelf){
  375. uni.navigateTo({
  376. url: "/pagesA/digitalShelf/orderList"
  377. })
  378. }else{
  379. uni.showToast({
  380. icon:'none',
  381. title: '门店没有关联数字货架,无法使用此功能!'
  382. })
  383. }
  384. },
  385. // 获取上方滚动扫描记录
  386. getScrollLog(){
  387. scanVinLogQueryRoll({pageNo:1,pageSize:50}).then(res => {
  388. this.list = res.data.list || []
  389. this.list.map(item => {
  390. item.placeText = item.userName + '刚刚扫描了一个VIN'
  391. })
  392. })
  393. },
  394. // 获取当前门店扫描记录
  395. getVinLog(){
  396. this.vinList = []
  397. this.status = "loading"
  398. // VISITOR:游客,EMPLOYEE:雇员
  399. getScanVinLogList({ pageNo:1, pageSize:5, identifyType: this.userInfo.identifyType }).then(res => {
  400. this.vinList = res.data&&res.data.list || []
  401. this.vinList = this.vinList.filter(item => item.vinCode)
  402. this.status = 'nomore'
  403. })
  404. },
  405. // 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
  406. getStoreShelf(flag){
  407. findStoreShelf().then(res => {
  408. this.$store.state.vuex_storeShelf = res.data;
  409. if(res.data){
  410. if(!flag){
  411. // 更新用户信息
  412. this.getCurrUserInfo()
  413. // 显示促销模块
  414. this.showPromoTab()
  415. }
  416. // 获取价格权限配置
  417. this.getPriceCofig()
  418. // 保证金查询
  419. this.getShelfBWPayRecord()
  420. // 获取订单信息
  421. this.shelfGetTotalWaitQty()
  422. // 获取轮播数据,包括促销活动
  423. this.getCarousel()
  424. }else{
  425. // 没有数字货架,隐藏促销模块
  426. this.hidePromoTab()
  427. }
  428. })
  429. },
  430. // 显示促销模块
  431. showPromoTab(){
  432. // 添加促销模块
  433. const promoIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '促销')
  434. if(promoIndex<0){
  435. this.$store.state.vuex_tabBarList.splice(1,0,{
  436. "pagePath": "/pages/promo/index",
  437. "iconPath": "/static/tab/tab_promo_normal.png",
  438. "selectedIconPath": "/static/tab/tab_promo_pressed.png",
  439. "text": "促销",
  440. 'customIcon': false,
  441. })
  442. }
  443. // 居中透出显示扫描按钮
  444. const scanTab = this.$store.state.vuex_tabBarList.find(item => item.text == '扫描VIN')
  445. if(scanTab){
  446. scanTab.iconPath = "/static/tab/tab_scan_mid.png"
  447. scanTab.midButton = true
  448. }
  449. },
  450. // 隐藏促销模块
  451. hidePromoTab(){
  452. // 删除促销模块
  453. const promoIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '促销')
  454. if(promoIndex > -1){
  455. this.$store.state.vuex_tabBarList.splice(promoIndex,1)
  456. }
  457. // 扫描按钮不局中
  458. const scanTab = this.$store.state.vuex_tabBarList.find(item => item.text == '扫描VIN')
  459. if(scanTab){
  460. scanTab.iconPath = "/static/tab/tab_scan_normal.png"
  461. scanTab.midButton = false
  462. }
  463. },
  464. // 查询是有红包活动
  465. getRedPacketRule(){
  466. findCurrentRewardRule().then(res => {
  467. this.$store.state.vuex_rewardRule = res.data;
  468. this.getRedScroll()
  469. })
  470. },
  471. // 红包奖励信息
  472. getRedScroll(){
  473. getRewardRollList({pageNo:1,pageSize:50}).then(res => {
  474. this.slist = res.data || []
  475. this.slist.map(item => {
  476. item.placeText = item.userName + '刚刚得到了'+item.totalRewardAmount+'元 红包奖励'
  477. })
  478. })
  479. },
  480. // 获取保证金金额
  481. getShelfBWPayRecord(){
  482. const data = this.$store.state.vuex_storeShelf
  483. shelfBondRecordWaitPayRecord({shelfSn: data.shelfSn, storeSn: data.storeSn}).then(res => {
  484. console.log(res,'获取保证金金额')
  485. this.bondRecord = res.data
  486. })
  487. },
  488. // 保证金支付
  489. toPayBondAmount(){},
  490. openTakeGood(index){
  491. // 已有数字货架
  492. if(this.hasShelf){
  493. this.clickAction(index)
  494. }else{
  495. uni.showToast({
  496. icon:'none',
  497. title: '门店没有关联数字货架,无法使用此功能!'
  498. })
  499. }
  500. },
  501. // 单击banner
  502. clickBanner(index){
  503. const row = this.imgList[index]
  504. // 红包
  505. if(row.activeType == 'redPacket'){
  506. uni.navigateTo({url:"/pages/morePage/redPacket"})
  507. }
  508. // 图文
  509. if(row.contentType == 'IMAGE_CONTENT'){
  510. uni.navigateTo({url:"/pagesA/activeDetail/index?sn="+row.promoActiveSn})
  511. }
  512. // 视频
  513. if(row.contentType == 'VIDEO'){
  514. uni.navigateTo({url:"/pages/videos/detail?form=banner&&sn="+row.promoActiveSn})
  515. }
  516. // 链接
  517. if(row.contentType == 'LINK'){
  518. // 货架促销活动
  519. if(row.content.indexOf("pagesB/promoDetail") >= 0){
  520. uni.navigateTo({
  521. url: '/pagesB/promoProduct?promoActiveSn='+row.promoActiveSn+'&title='+row.title
  522. })
  523. }else{
  524. openWebView({url:row.content})
  525. }
  526. }
  527. },
  528. // 选择取货方式
  529. clickAction(index){
  530. const shelfSn = this.hasShelf.shelfSn
  531. const _this = this
  532. // 扫描
  533. if(index == 0){
  534. uni.scanCode({
  535. success: function (ret) {
  536. console.log(ret);
  537. const params = {
  538. codeType: ret.scanType == 'QR_CODE' ? 0 : 1
  539. }
  540. // 二维码
  541. if(ret.scanType == 'QR_CODE'){
  542. const result = ret.result.split("&")
  543. params.productSn = result[2] // 产品编码sn
  544. }else{
  545. params.qrCode = ret.result
  546. }
  547. uni.showLoading({
  548. title: "正在查询产品..."
  549. })
  550. // 确认取货
  551. getProductfindByScanCode(params).then(res => {
  552. if(res.status == 200 && res.data){
  553. if(res.data.currentInven){
  554. const billSource = ret.scanType == 'QR_CODE' ? 'qr_code': 'bar_code'
  555. const retData = Object.assign({shelfSn: shelfSn, billSource: billSource},res.data)
  556. _this.$store.state.vuex_tempData = retData
  557. uni.navigateTo({
  558. url: '/pagesA/queryByCode/confirmQh'
  559. })
  560. }else{
  561. uni.showModal({
  562. title: '提示',
  563. content: '产品库存为0,无法取货!',
  564. confirmText: '好的',
  565. showCancel: false
  566. })
  567. }
  568. }else{
  569. uni.showModal({
  570. title: '提示',
  571. content: '产品不属于此货架,请重新扫描!',
  572. confirmText: '好的',
  573. showCancel: false
  574. })
  575. }
  576. uni.hideLoading()
  577. })
  578. }
  579. });
  580. }else{
  581. // 按编码搜索
  582. uni.navigateTo({
  583. url: '/pagesA/queryByCode/queryByCode'
  584. })
  585. }
  586. },
  587. // 去扫VIN
  588. openCamera(){
  589. if(this.hasLogin){
  590. // 游客身份
  591. if(this.userInfo.sysUserFlag == '0'){
  592. // 最多扫10次
  593. if(this.vuex_vinScanNums < this.scanMaxNums){
  594. uni.navigateTo({
  595. url: "/pages/scan-frame/scan-frame"
  596. })
  597. }else{
  598. uni.showModal({
  599. title: '提示',
  600. content: '个人用户扫描VIN仅限10次,您的次数已用完!',
  601. confirmText: '好的',
  602. showCancel: false,
  603. success(res) {}
  604. })
  605. }
  606. }else{
  607. // 非游客,直接扫
  608. uni.navigateTo({
  609. url: "/pages/scan-frame/scan-frame"
  610. })
  611. }
  612. }else{
  613. uni.navigateTo({
  614. url: '/pages/login/login'
  615. })
  616. }
  617. },
  618. // 查看扫描VIN记录
  619. toAllRecord(){
  620. uni.navigateTo({
  621. url: this.hasLogin ? "/pagesA/vinRecord/vinRecord" : '/pages/login/login'
  622. })
  623. },
  624. // 查看用户信息
  625. toUser(){
  626. if(this.hasLogin){
  627. // 用户详细信息 或 门店认证
  628. uni.navigateTo({
  629. url: this.userInfo.sysUserFlag == '1' ? '/pages/personData/personData' : '/pages/storeManage/storeAuth'
  630. })
  631. }else{
  632. uni.navigateTo({
  633. url: '/pages/login/login'
  634. })
  635. }
  636. },
  637. // 选择配件
  638. toChoosePart(item){
  639. item.text = item.modelInfo
  640. uni.navigateTo({
  641. url: "/pagesA/digitalShelf/choosePart?vinNumber="+item.vinCode+"&carList="+encodeURIComponent(JSON.stringify(item))+'&type=log'
  642. })
  643. }
  644. }
  645. }
  646. </script>
  647. <style lang="less">
  648. page{
  649. background-color: #ffffff;
  650. }
  651. .content {
  652. margin: 0;
  653. padding: 0;
  654. height: 100vh;
  655. display: flex;
  656. flex-direction: column;
  657. background-image: linear-gradient(#86defa 0%,#cdeff9 25%,#ffffff 40%);
  658. .header-box{
  659. z-index: 5;
  660. padding: 0em 1em;
  661. background: #066cff;
  662. .title{
  663. padding: 0;
  664. }
  665. }
  666. .cbody{
  667. flex-grow: 1;
  668. overflow-y: auto;
  669. overflow-x: hidden;
  670. }
  671. .body-box{
  672. padding: 0em 1em 0.8em;
  673. z-index: 4;
  674. .notices{
  675. padding: 0.5em 0 0;
  676. font-size: 0.9em;
  677. margin-top: 0.5rem;
  678. view{
  679. color: #ffaf46;
  680. max-width: 80%;
  681. }
  682. .text{
  683. color: #ffffff;
  684. margin-left: 1em;
  685. }
  686. }
  687. .action-button{
  688. padding:40upx 0 0 0;
  689. justify-content: space-between;
  690. > view{
  691. display: flex;
  692. align-items: center;
  693. color: #fff;
  694. border-radius: 10rpx;
  695. width: 49%;
  696. box-shadow: 0rem 0.3rem 0.5rem #d9dada;
  697. }
  698. .f1{
  699. background: #2196f3;
  700. }
  701. .f2{
  702. background: #FF9800;
  703. }
  704. .icons{
  705. font-size: 50rpx;
  706. color: #fff;
  707. width: 80rpx;
  708. height: 80rpx;
  709. text-align:center;
  710. display: flex;
  711. align-items: center;
  712. flex-direction: column;
  713. justify-content: center;
  714. }
  715. .tits{
  716. font-size:28rpx;
  717. }
  718. }
  719. .scanButton{
  720. margin: 0.8em 0 0.5em;
  721. padding: 0.5em;
  722. background: #066cff;
  723. color: #fff;
  724. font-size: 1.5em;
  725. border-radius: 5em;
  726. justify-content: center;
  727. &:active{
  728. opacity: 0.8;
  729. }
  730. }
  731. .quickButton{
  732. margin: 0.8em 0 0.5em;
  733. padding: 0.5em;
  734. background: #fff;
  735. color: #333;
  736. font-size: 1.5em;
  737. border-radius: 5em;
  738. justify-content: center;
  739. border:0.1rpx solid #eee;
  740. box-shadow: 1rpx 2rpx 5rpx #f8f8f8;
  741. &:active{
  742. opacity: 0.8;
  743. }
  744. }
  745. .ml10{
  746. margin-left: 0.4em;
  747. }
  748. }
  749. .bg-blue{
  750. position: relative;
  751. > view{
  752. z-index: 100;
  753. position: relative;
  754. }
  755. &::after{
  756. /* 这个伪类的作用就是一个圆弧的背景色 */
  757. width: 130%;
  758. height: 100%;
  759. position: absolute;
  760. /*设置水平居中*/
  761. left: -15%;
  762. /* 之所以left:20%,是因为width:140%,若width:160%,那么left:30%才能水平居中 */
  763. top: -20%;
  764. /*层叠顺序,最底层显示*/
  765. content: '';
  766. border-radius: 0 0 50% 50%;
  767. /*分别对应 左上 右上 右下 左下 可以修改成其它颜色*/
  768. background: linear-gradient(to bottom, #066cff, #1d77ff);
  769. }
  770. .userCard{
  771. position:relative;
  772. left:0;
  773. bottom:-1rem;
  774. padding: 0.5rem 0.8rem;
  775. background: #fff;
  776. border-radius: 0.5rem;
  777. box-shadow: 0rem 0.5rem 0.5rem #bcdede;
  778. .userCard-info{
  779. flex-grow:1;
  780. > view{
  781. &:last-child{
  782. margin-left: 0.5em;
  783. line-height: 1.5em;
  784. .user-name{
  785. font-size: 1rem;
  786. }
  787. >view{
  788. padding: 0.2em;
  789. }
  790. }
  791. }
  792. .user-info{
  793. flex-grow:1;
  794. }
  795. }
  796. .user-rz{
  797. font-size: 0.8rem;
  798. color:#58aff5;
  799. }
  800. }
  801. }
  802. .list-box{
  803. padding: 0 1em;
  804. overflow: auto;
  805. .des{
  806. text-align: center;
  807. padding: 1em 0;
  808. color: #999;
  809. font-size: 0.8em;
  810. }
  811. }
  812. }
  813. </style>