lilei пре 2 година
родитељ
комит
a4f278d4e8
6 измењених фајлова са 34 додато и 13 уклоњено
  1. 2 2
      App.vue
  2. 7 0
      api/car.js
  3. 20 7
      pages/index/index.vue
  4. 2 2
      pages/scan-frame/scan-frame.vue
  5. 2 2
      pages/vinInput/confirmVin.vue
  6. 1 0
      store/index.js

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.0.103:9110/saas/clz/', // 本地
-			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			// baseUrl: 'http://192.168.0.103:9110/saas/clz/', // 本地
+			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 7 - 0
api/car.js

@@ -245,4 +245,11 @@ export const getScanVinQty = (params) => {
     url: `scanVinLog/getScanVinQty`,
     method: 'get'
   })
+}
+// 扫描最大限制数
+export const getScanGetMaxQty = (params) => {
+  return request({
+    url: `scanVinLog/getMaxQty`,
+    method: 'get'
+  })
 }

+ 20 - 7
pages/index/index.vue

@@ -99,7 +99,7 @@
 	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty } from '@/api/shelf.js'
 	import { xprhStoreApplyRead } from '@/api/xprh.js'
 	import { listLookUp, getLookUpDatas } from '@/api/data.js';
-	import { scanVinLogQueryRoll, getScanVinLogList }from '@/api/car.js'
+	import { scanVinLogQueryRoll, getScanVinLogList, getScanGetMaxQty }from '@/api/car.js'
 	export default {
 		components: {
 			scrollBox,
@@ -114,7 +114,8 @@
 				vinList: [],
 				orderTodo: null,
 				avatarUrl:'',
-				navHeight: '44'
+				navHeight: '44',
+				scanMaxNums: 10
 			}
 		},
 		computed: {
@@ -177,15 +178,20 @@
 			pageInit(){
 				if(this.hasLogin){
 					this.avatarUrl = this.userInfo.avatarUrl
+					// 获取扫描记录
+					this.getVinLog()
+					
 					// 非游客
 					if(this.userInfo.sysUserFlag == '1'){
 						// 查询是否有数字货架
 						this.getStoreShelf()
+					}else{
+						// 获取扫描次数
+						this.$store.dispatch("getScanNums")
+						// 获取最大扫描次数
+						this.getMaxQty()
 					}
-					// 获取扫描记录
-					this.getVinLog()
-					// 获取扫描次数
-					this.$store.dispatch("getScanNums")
+					
 					// 查询门店认证信息
 					this.findLastApply()
 				}else{
@@ -209,6 +215,13 @@
 					}
 				});
 			},
+			// 获取最大扫描数
+			getMaxQty(){
+				getScanGetMaxQty().then(res => {
+					this.scanMaxNums = res.data || 10
+					this.$store.state.vuex_scanMaxNums = this.scanMaxNums
+				})
+			},
 			// 获取最新申请门店
 			findLastApply(){
 				const mobile = this.userInfo.mobile
@@ -294,7 +307,7 @@
 			openCamera(){
 				if(this.hasLogin){
 					if(this.userInfo.sysUserFlag == '0'){
-						if(this.vuex_vinScanNums < 10){
+						if(this.vuex_vinScanNums < this.scanMaxNums){
 							uni.navigateTo({
 								url: "/pages/scan-frame/scan-frame"
 							})

+ 2 - 2
pages/scan-frame/scan-frame.vue

@@ -55,7 +55,7 @@ export default {
   	})
   },
   computed: {
-  	...mapState(['hasLogin','vuex_vinScanNums']),
+  	...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums']),
   	userInfo(){
   		return this.$store.state.vuex_userInfo
   	}
@@ -174,7 +174,7 @@ export default {
 			this.scanShow = true
 			// 此处为后端接口 传base64图片 进行ocr识别
 			if(this.userInfo.sysUserFlag == '0'){
-				if(this.vuex_vinScanNums < 10){
+				if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
 					this.parseVinNo(base.data)
 				}else{
 					uni.showModal({

+ 2 - 2
pages/vinInput/confirmVin.vue

@@ -50,7 +50,7 @@
 			}
 		},
 		computed: {
-			...mapState(['hasLogin','vuex_vinScanNums']),
+			...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums']),
 			userInfo(){
 				return this.$store.state.vuex_userInfo
 			},
@@ -90,7 +90,7 @@
 			// 重新扫描
 			toScan(){
 				if(this.userInfo.sysUserFlag == '0'){
-					if(this.vuex_vinScanNums < 10){
+					if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
 						uni.redirectTo({
 							url: "/pages/scan-frame/scan-frame"
 						})

+ 1 - 0
store/index.js

@@ -53,6 +53,7 @@ const store = new Vuex.Store({
 		vuex_openid: "",
 		vuex_nowStaffData: null, // 员工临时数据
 		vuex_vinScanNums:null, // 扫描次数
+		vuex_scanMaxNums: 10, // 最大扫描次数
 		vuex_storeAuthInfo: null // 门店认证状态信息
     },
 	getters:{