index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  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. },
  224. // 下拉刷新
  225. onPullDownRefresh(){
  226. this.pageInit(true)
  227. setTimeout(function () {
  228. uni.stopPullDownRefresh();
  229. }, 1000);
  230. },
  231. onShareAppMessage() {},
  232. onShow() {
  233. // 用户头像
  234. this.avatarUrl = uni.getStorageSync('userPhoto');
  235. if(this.hasLogin){
  236. // 查询门店认证信息
  237. if(this.userInfo.sysUserFlag == '0'){
  238. this.findLastApply()
  239. }
  240. if(this.userInfo.sysUserFlag == '1'){
  241. // 查询红包活动
  242. this.getRedPacketRule()
  243. }
  244. }else{
  245. // 隐藏促销模块
  246. this.hidePromoTab()
  247. }
  248. },
  249. methods: {
  250. // 扫描vin
  251. beforeSwitch(index){
  252. const row = this.$store.state.vuex_tabBarList[index]
  253. if(row.text == '扫描VIN'){
  254. this.openCamera()
  255. }else{
  256. return true
  257. }
  258. },
  259. // 轮播图片
  260. getCarousel(){
  261. this.carouselList = []
  262. // 获取所有促销活动数据
  263. promoTerminalList({}).then(res => {
  264. if(res.status == 200){
  265. res.data&&res.data.map(item => {
  266. item.image = item.imageSet&&item.imageSet[0] // 默认取第一张图片
  267. })
  268. // 过滤掉产品促销活动
  269. // this.carouselList = res.data.filter(item => item.content.indexOf("pages/promo/index") < 0)
  270. // 所有数据
  271. this.carouselList = res.data
  272. }
  273. })
  274. },
  275. pageInit(flag){
  276. this.carouselList = []
  277. if(this.hasLogin){
  278. // 获取扫描记录
  279. this.getVinLog()
  280. // 非游客
  281. if(this.userInfo.sysUserFlag == '1'){
  282. // 查询是否有数字货架
  283. this.getStoreShelf(flag)
  284. }else{
  285. // 获取扫描次数
  286. this.$store.dispatch("getScanNums")
  287. // 获取最大扫描次数
  288. this.getMaxQty()
  289. // 查询门店认证信息
  290. this.findLastApply()
  291. }
  292. }else{
  293. uni.removeStorageSync('token')
  294. }
  295. },
  296. // 获取数据字典
  297. getListLookUp() {
  298. const _this = this;
  299. listLookUp({ pageNo: 1, pageSize: 1000 }).then(res => {
  300. if (res.status == 200) {
  301. _this.$store.state.vuex_allLookUp = res.data;
  302. }
  303. });
  304. },
  305. // 或某一项字典列表,参数code
  306. getLookUpList(code, vuexKey) {
  307. getLookUpDatas({ type: code }).then(res => {
  308. if (res.status == 200) {
  309. this.$store.state[vuexKey] = res.data || [];
  310. }
  311. });
  312. },
  313. // 获取价格配置
  314. getPriceCofig(){
  315. const data = this.$store.state.vuex_storeShelf
  316. queryQplsConfig({shelfSn: data.shelfSn}).then(res => {
  317. this.$store.state.vuex_configPrice = res.data || null
  318. })
  319. },
  320. // 最新用户信息
  321. getCurrUserInfo(){
  322. getCurrUserInfo().then(res => {
  323. if(res.data){
  324. this.$store.state.vuex_userInfo.userNameCN = res.data.name;
  325. this.$store.state.vuex_userInfo.mobile = res.data.mobile;
  326. this.$store.state.vuex_userInfo.adminId = res.data.id;
  327. this.$store.state.vuex_userPhoto = res.data.photo;
  328. uni.setStorageSync('userPhoto', res.data.photo);
  329. }
  330. })
  331. },
  332. // 获取最大扫描数
  333. getMaxQty(){
  334. getScanGetMaxQty().then(res => {
  335. this.scanMaxNums = res.data || 10
  336. this.$store.state.vuex_scanMaxNums = this.scanMaxNums
  337. })
  338. },
  339. // 获取最新申请门店
  340. findLastApply(){
  341. const mobile = this.userInfo.mobile
  342. this.$store.dispatch('getSotreAuth',mobile)
  343. },
  344. // 知道审核不通过
  345. toKnow(){
  346. uni.showLoading({
  347. title: "正在提交"
  348. })
  349. xprhStoreApplyRead({sn:this.storeApply.applySn}).then(res => {
  350. if(res.status == 200){
  351. this.findLastApply()
  352. }
  353. uni.hideLoading()
  354. })
  355. },
  356. // 待取货数量合计
  357. shelfGetTotalWaitQty(){
  358. shelfGetTotalWaitQty({billState:'WAIT'}).then(res => {
  359. if(res.status == 200){
  360. this.orderTodo = res.data;
  361. }
  362. })
  363. },
  364. // 货架订单列表
  365. toOrder(){
  366. if(this.hasShelf){
  367. uni.navigateTo({
  368. url: "/pagesA/digitalShelf/orderList"
  369. })
  370. }else{
  371. uni.showToast({
  372. icon:'none',
  373. title: '门店没有关联数字货架,无法使用此功能!'
  374. })
  375. }
  376. },
  377. // 获取上方滚动扫描记录
  378. getScrollLog(){
  379. scanVinLogQueryRoll({pageNo:1,pageSize:50}).then(res => {
  380. this.list = res.data.list || []
  381. this.list.map(item => {
  382. item.placeText = item.userName + '刚刚扫描了一个VIN'
  383. })
  384. })
  385. },
  386. // 获取当前门店扫描记录
  387. getVinLog(){
  388. this.vinList = []
  389. this.status = "loading"
  390. // VISITOR:游客,EMPLOYEE:雇员
  391. getScanVinLogList({ pageNo:1, pageSize:5, identifyType: this.userInfo.identifyType }).then(res => {
  392. this.vinList = res.data&&res.data.list || []
  393. this.vinList = this.vinList.filter(item => item.vinCode)
  394. this.status = 'nomore'
  395. })
  396. },
  397. // 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
  398. getStoreShelf(flag){
  399. findStoreShelf().then(res => {
  400. this.$store.state.vuex_storeShelf = res.data;
  401. if(res.data){
  402. if(!flag){
  403. // 更新用户信息
  404. this.getCurrUserInfo()
  405. // 显示促销模块
  406. this.showPromoTab()
  407. }
  408. // 获取价格权限配置
  409. this.getPriceCofig()
  410. // 保证金查询
  411. this.getShelfBWPayRecord()
  412. // 获取订单信息
  413. this.shelfGetTotalWaitQty()
  414. // 获取轮播数据,包括促销活动
  415. this.getCarousel()
  416. }else{
  417. // 没有数字货架,隐藏促销模块
  418. this.hidePromoTab()
  419. }
  420. })
  421. },
  422. // 显示促销模块
  423. showPromoTab(){
  424. this.$store.state.vuex_tabBarList.splice(1,0,{
  425. "pagePath": "/pages/promo/index",
  426. "iconPath": "/static/tab/tab_promo_normal.png",
  427. "selectedIconPath": "/static/tab/tab_promo_pressed.png",
  428. "text": "促销",
  429. 'customIcon': false,
  430. })
  431. // 居中透出显示扫描按钮
  432. this.$store.state.vuex_tabBarList[2].iconPath = "/static/tab/tab_scan_mid.png"
  433. this.$store.state.vuex_tabBarList[2].midButton = true
  434. },
  435. // 隐藏促销模块
  436. hidePromoTab(){
  437. const promoIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '促销')
  438. if(promoIndex > -1){
  439. this.$store.state.vuex_tabBarList.splice(promoIndex,1)
  440. }
  441. const scanTab = this.$store.state.vuex_tabBarList.find(item => item.text == '扫描VIN')
  442. if(scanTab){
  443. scanTab.iconPath = "/static/tab/tab_scan_normal.png"
  444. scanTab.midButton = false
  445. }
  446. },
  447. // 查询是有红包活动
  448. getRedPacketRule(){
  449. findCurrentRewardRule().then(res => {
  450. this.$store.state.vuex_rewardRule = res.data;
  451. this.getRedScroll()
  452. })
  453. },
  454. // 红包奖励信息
  455. getRedScroll(){
  456. getRewardRollList({pageNo:1,pageSize:50}).then(res => {
  457. this.slist = res.data || []
  458. this.slist.map(item => {
  459. item.placeText = item.userName + '刚刚得到了'+item.totalRewardAmount+'元 红包奖励'
  460. })
  461. })
  462. },
  463. // 获取保证金金额
  464. getShelfBWPayRecord(){
  465. const data = this.$store.state.vuex_storeShelf
  466. shelfBondRecordWaitPayRecord({shelfSn: data.shelfSn, storeSn: data.storeSn}).then(res => {
  467. console.log(res,'获取保证金金额')
  468. this.bondRecord = res.data
  469. })
  470. },
  471. // 保证金支付
  472. toPayBondAmount(){},
  473. openTakeGood(index){
  474. // 已有数字货架
  475. if(this.hasShelf){
  476. this.clickAction(index)
  477. }else{
  478. uni.showToast({
  479. icon:'none',
  480. title: '门店没有关联数字货架,无法使用此功能!'
  481. })
  482. }
  483. },
  484. // 单击banner
  485. clickBanner(index){
  486. const row = this.imgList[index]
  487. // 红包
  488. if(row.activeType == 'redPacket'){
  489. uni.navigateTo({url:"/pages/morePage/redPacket"})
  490. }
  491. // 图文
  492. if(row.contentType == 'IMAGE_CONTENT'){
  493. uni.navigateTo({url:"/pagesA/activeDetail/index?sn="+row.promoActiveSn})
  494. }
  495. // 视频
  496. if(row.contentType == 'VIDEO'){
  497. uni.navigateTo({url:"/pages/videos/detail?form=banner&&sn="+row.promoActiveSn})
  498. }
  499. // 链接
  500. if(row.contentType == 'LINK'){
  501. // 货架促销活动
  502. if(row.content.indexOf("pagesB/promoDetail") >= 0){
  503. uni.navigateTo({
  504. url: '/pagesB/promoDetail?promoActiveSn='+row.promoActiveSn+'&title='+row.title
  505. })
  506. }else{
  507. openWebView({url:row.content})
  508. }
  509. }
  510. },
  511. // 选择取货方式
  512. clickAction(index){
  513. const shelfSn = this.hasShelf.shelfSn
  514. const _this = this
  515. // 扫描
  516. if(index == 0){
  517. uni.scanCode({
  518. success: function (ret) {
  519. console.log(ret);
  520. const params = {
  521. codeType: ret.scanType == 'QR_CODE' ? 0 : 1
  522. }
  523. // 二维码
  524. if(ret.scanType == 'QR_CODE'){
  525. const result = ret.result.split("&")
  526. params.productSn = result[2] // 产品编码sn
  527. }else{
  528. params.qrCode = ret.result
  529. }
  530. uni.showLoading({
  531. title: "正在查询产品..."
  532. })
  533. // 确认取货
  534. getProductfindByScanCode(params).then(res => {
  535. if(res.status == 200 && res.data){
  536. if(res.data.currentInven){
  537. const billSource = ret.scanType == 'QR_CODE' ? 'qr_code': 'bar_code'
  538. const retData = Object.assign({shelfSn: shelfSn, billSource: billSource},res.data)
  539. _this.$store.state.vuex_tempData = retData
  540. uni.navigateTo({
  541. url: '/pagesA/queryByCode/confirmQh'
  542. })
  543. }else{
  544. uni.showModal({
  545. title: '提示',
  546. content: '产品库存为0,无法取货!',
  547. confirmText: '好的',
  548. showCancel: false
  549. })
  550. }
  551. }else{
  552. uni.showModal({
  553. title: '提示',
  554. content: '产品不属于此货架,请重新扫描!',
  555. confirmText: '好的',
  556. showCancel: false
  557. })
  558. }
  559. uni.hideLoading()
  560. })
  561. }
  562. });
  563. }else{
  564. // 按编码搜索
  565. uni.navigateTo({
  566. url: '/pagesA/queryByCode/queryByCode'
  567. })
  568. }
  569. },
  570. // 去扫描
  571. openCamera(){
  572. if(this.hasLogin){
  573. // 游客身份
  574. if(this.userInfo.sysUserFlag == '0'){
  575. // 最多扫10次
  576. if(this.vuex_vinScanNums < this.scanMaxNums){
  577. uni.navigateTo({
  578. url: "/pages/scan-frame/scan-frame"
  579. })
  580. }else{
  581. uni.showModal({
  582. title: '提示',
  583. content: '个人用户扫描VIN仅限10次,您的次数已用完!',
  584. confirmText: '好的',
  585. showCancel: false,
  586. success(res) {}
  587. })
  588. }
  589. }else{
  590. // 非游客,直接扫
  591. uni.navigateTo({
  592. url: "/pages/scan-frame/scan-frame"
  593. })
  594. }
  595. }else{
  596. uni.navigateTo({
  597. url: '/pages/login/login'
  598. })
  599. }
  600. },
  601. // 查看扫描记录
  602. toAllRecord(){
  603. uni.navigateTo({
  604. url: this.hasLogin ? "/pagesA/vinRecord/vinRecord" : '/pages/login/login'
  605. })
  606. },
  607. // 查看用户信息
  608. toUser(){
  609. if(this.hasLogin){
  610. // 用户详细信息 或 门店认证
  611. uni.navigateTo({
  612. url: this.userInfo.sysUserFlag == '1' ? '/pages/personData/personData' : '/pages/storeManage/storeAuth'
  613. })
  614. }else{
  615. uni.navigateTo({
  616. url: '/pages/login/login'
  617. })
  618. }
  619. },
  620. // 选择配件
  621. toChoosePart(item){
  622. item.text = item.modelInfo
  623. uni.navigateTo({
  624. url: "/pagesA/digitalShelf/choosePart?vinNumber="+item.vinCode+"&carList="+encodeURIComponent(JSON.stringify(item))+'&type=log'
  625. })
  626. }
  627. }
  628. }
  629. </script>
  630. <style lang="less">
  631. page{
  632. background-color: #ffffff;
  633. }
  634. .content {
  635. margin: 0;
  636. padding: 0;
  637. height: 100vh;
  638. display: flex;
  639. flex-direction: column;
  640. background-image: linear-gradient(#86defa 0%,#cdeff9 25%,#ffffff 40%);
  641. .header-box{
  642. z-index: 5;
  643. padding: 0em 1em;
  644. background: #066cff;
  645. .title{
  646. padding: 0;
  647. }
  648. }
  649. .cbody{
  650. flex-grow: 1;
  651. overflow-y: auto;
  652. overflow-x: hidden;
  653. }
  654. .body-box{
  655. padding: 0em 1em 0.8em;
  656. z-index: 4;
  657. .notices{
  658. padding: 0.5em 0 0;
  659. font-size: 0.9em;
  660. margin-top: 0.5rem;
  661. view{
  662. color: #ffaf46;
  663. max-width: 80%;
  664. }
  665. .text{
  666. color: #ffffff;
  667. margin-left: 1em;
  668. }
  669. }
  670. .action-button{
  671. padding:40upx 0 0 0;
  672. justify-content: space-between;
  673. > view{
  674. display: flex;
  675. align-items: center;
  676. color: #fff;
  677. border-radius: 10rpx;
  678. width: 49%;
  679. box-shadow: 0rem 0.3rem 0.5rem #d9dada;
  680. }
  681. .f1{
  682. background: #2196f3;
  683. }
  684. .f2{
  685. background: #FF9800;
  686. }
  687. .icons{
  688. font-size: 50rpx;
  689. color: #fff;
  690. width: 80rpx;
  691. height: 80rpx;
  692. text-align:center;
  693. display: flex;
  694. align-items: center;
  695. flex-direction: column;
  696. justify-content: center;
  697. }
  698. .tits{
  699. font-size:28rpx;
  700. }
  701. }
  702. .scanButton{
  703. margin: 0.8em 0 0.5em;
  704. padding: 0.5em;
  705. background: #066cff;
  706. color: #fff;
  707. font-size: 1.5em;
  708. border-radius: 5em;
  709. justify-content: center;
  710. &:active{
  711. opacity: 0.8;
  712. }
  713. }
  714. .quickButton{
  715. margin: 0.8em 0 0.5em;
  716. padding: 0.5em;
  717. background: #fff;
  718. color: #333;
  719. font-size: 1.5em;
  720. border-radius: 5em;
  721. justify-content: center;
  722. border:0.1rpx solid #eee;
  723. box-shadow: 1rpx 2rpx 5rpx #f8f8f8;
  724. &:active{
  725. opacity: 0.8;
  726. }
  727. }
  728. .ml10{
  729. margin-left: 0.4em;
  730. }
  731. }
  732. .bg-blue{
  733. position: relative;
  734. > view{
  735. z-index: 100;
  736. position: relative;
  737. }
  738. &::after{
  739. /* 这个伪类的作用就是一个圆弧的背景色 */
  740. width: 130%;
  741. height: 100%;
  742. position: absolute;
  743. /*设置水平居中*/
  744. left: -15%;
  745. /* 之所以left:20%,是因为width:140%,若width:160%,那么left:30%才能水平居中 */
  746. top: -20%;
  747. /*层叠顺序,最底层显示*/
  748. content: '';
  749. border-radius: 0 0 50% 50%;
  750. /*分别对应 左上 右上 右下 左下 可以修改成其它颜色*/
  751. background: linear-gradient(to bottom, #066cff, #1d77ff);
  752. }
  753. .userCard{
  754. position:relative;
  755. left:0;
  756. bottom:-1rem;
  757. padding: 0.5rem 0.8rem;
  758. background: #fff;
  759. border-radius: 0.5rem;
  760. box-shadow: 0rem 0.5rem 0.5rem #bcdede;
  761. .userCard-info{
  762. flex-grow:1;
  763. > view{
  764. &:last-child{
  765. margin-left: 0.5em;
  766. line-height: 1.5em;
  767. .user-name{
  768. font-size: 1rem;
  769. }
  770. >view{
  771. padding: 0.2em;
  772. }
  773. }
  774. }
  775. .user-info{
  776. flex-grow:1;
  777. }
  778. }
  779. .user-rz{
  780. font-size: 0.8rem;
  781. color:#58aff5;
  782. }
  783. }
  784. }
  785. .list-box{
  786. padding: 0 1em;
  787. overflow: auto;
  788. .des{
  789. text-align: center;
  790. padding: 1em 0;
  791. color: #999;
  792. font-size: 0.8em;
  793. }
  794. }
  795. }
  796. </style>