index.vue 23 KB

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