lilei 3 lat temu
rodzic
commit
6cd00c041d

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.16.103:9110/saas/clz/', // 本地
+			baseUrl: 'http://192.168.16.156:9110/saas/clz/', // 本地
 			// baseUrl: 'http://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},

+ 1 - 3
components/scrollBox.vue

@@ -27,9 +27,7 @@ export default {
 		};
 	},
 	mounted() {
-		if(this.hasLogin){
-			this.prizeScroll();
-		}
+		this.prizeScroll();
 	},
 	methods: {
 		getHeight(Class) {

+ 3 - 3
pages/index/index.vue

@@ -7,7 +7,7 @@
 		<view class="body-box">
 			<!-- 滚动区域 -->
 			<view class="scroll-list">
-				<scrollBox :list="list"></scrollBox>
+				<scrollBox v-if="list.length" :list="list"></scrollBox>
 			</view>
 			<!-- 保证金 -->
 			<view class="notices flex align_center" v-if="bondRecord" @click="toPayBondAmount">
@@ -103,12 +103,12 @@
 		},
 		onShow() {
 			if(this.hasLogin){
-				this.$store.state.vuex_userInfo = uni.getStorageSync('userInfo')
+				// 查询是否有数字货架
 				this.getStoreShelf()
 				// 获取扫描记录
-				this.getScrollLog()
 				this.getVinLog()
 			}
+			this.getScrollLog()
 		},
 		methods: {
 			//  获取数据字典

+ 11 - 5
pages/personData/personData.vue

@@ -15,7 +15,7 @@
 					<text>姓名</text>
 				</view>
 			    <view class="list-item-right">
-					<text>王杰</text>
+					<text>{{userInfo.userNameCN}}</text>
 			    </view>
 			</view>
 			<view class="list-item border-bottom">
@@ -31,7 +31,7 @@
 					<text>门店名称</text>
 				</view>
 			    <view class="list-item-right">
-					<text>宇博极速汽车维修养护中心</text>
+					<text>{{userInfo.orgName}}</text>
 			    </view>
 			</view>
 			<view class="list-item margin-bot">
@@ -39,7 +39,7 @@
 					<text>汽配经销商</text>
 				</view>
 			    <view class="list-item-right">
-			    	<text>箭冠汽配西安大兴店</text>
+			    	<text>{{shelfInfo.dealerName}}</text>
 			    </view>
 			</view>
 		</view>
@@ -67,7 +67,6 @@
         },
         data() {
             return {
-				userInfo:'',
 				title:'',
             }
         },
@@ -76,8 +75,15 @@
 			this.$store.dispatch('checkLogin')
 		},
 		computed: {
-			...mapState(['hasLogin'])
+			...mapState(['hasLogin']),
+			userInfo(){
+				return this.$store.state.vuex_userInfo
+			},
+			shelfInfo(){
+				return this.$store.state.vuex_storeShelf
+			},
 		},
+		
         methods: {
           loginOut(){
 			  this.$refs.openModal.open()

+ 7 - 8
pages/vinInput/confirmVin.vue

@@ -46,6 +46,11 @@
 				vinImg: ''
 			}
 		},
+		computed: {
+			userInfo(){
+				return this.$store.state.vuex_userInfo
+			}
+		},
 		onLoad(opts) {
 			this.verifyCode = opts.verifyCode || ''
 			this.vinImg = opts.filePath || ''
@@ -54,15 +59,9 @@
 		onShareAppMessage(e){
 			return {
 			  title: '修配一码通车架号(VIN)分享',
-			  path: '/pages/vinIput/share?userId=123&vin='+this.verifyCode,
+			  path: '/pages/vinIput/share?userName='+this.userInfo.userNameCN+'&vinNo='+this.verifyCode,
 			  imageUrl:'/static/share.png',
-			  type: '1',
-			  success(res){
-				  console.log(res)
-			  },
-			  fail(err){
-				  console.log(err)
-			  }
+			  type: '2',
 			}
 		},
 		methods: {

+ 35 - 8
pages/vinInput/share.vue

@@ -1,21 +1,21 @@
 <template>
 	<view class="share-body">
 		<view class="share-head">
-			<u-image src="@/static/share1.jpg" width='750' height="253"></u-image>
+			<u-image src="@/static/def_personal_avatar.png" width='750' height="253"></u-image>
 		</view>
 		<view class="share-info">
 			<view class="userinfo">
 				<view>
-					好友 MAK2342
+					好友 {{userName}}
 				</view>
 				<view>给您分享了一个车架号(VIN)</view>
 			</view>
 			<view class="carinfo flex flex_column align_center">
 				<view>
-					<u-image shape="circle" src="@/static/share1.jpg" width='150' height="150"></u-image>
+					<u-image shape="circle" :src="carInfo.icon||'@/static/def_imgs.png'" width='150' height="150"></u-image>
 				</view>
-				<view>VIN:LFV2A21K0G4053021</view>
-				<view>马自达 CX-5(KE 2012-2017) 2.0L | 手自一体 2014款 都市型</view>
+				<view>VIN:{{carInfo.vinNumber}}</view>
+				<view>{{carInfo.modelLabel}}</view>
 			</view>
 			<view class="cbutton flex align_center justify_between">
 				<u-button @click="copyVin" shape="circle">复制VIN</u-button>
@@ -26,27 +26,54 @@
 </template>
 
 <script>
+	import { getVehicleInfoByVin } from '@/api/car.js'
 	export default {
 		data() {
 			return {
 				carInfo: null,
-				userInfo: null
+				userName: null,
+				vinNo: ''
 			}
 		},
 		onShareAppMessage(){},
+		onLoad() {
+			this.vinNo = opts.vinNo
+			this.userName = opts.userName || ''
+		},
 		methods: {
 			// 复制vin
 			copyVin(){
 				uni.setClipboardData({
-					data: this.carInfo.vinNumber||'',
+					data: this.vinNo||'',
 				})
 			},
 			// 复制车型
 			copyCar(){
 				uni.setClipboardData({
-					data: this.carInfo.carModel||'',
+					data: this.carInfo.modelLabel||'',
 				})
 			},
+			getInfo(){
+				getVehicleInfoByVin({
+					vin:this.vinNo
+				}).then(res => {
+					if (res.status == 200&&res.data) {
+						 this.carInfo = res.data
+					} else {
+						uni.showModal({
+							title: '匹配错误',
+							content: '此VIN码没有匹配的车型,请检查VIN码是否正确',
+							showCancel: false,
+							confirmText: '知道了',
+							success() {
+								uni.reLaunch({
+									url: "/pages/index/index"
+								})
+							}
+						})
+					}
+				})
+			}
 		}
 	}
 </script>

+ 5 - 1
store/index.js

@@ -97,6 +97,10 @@ const store = new Vuex.Store({
 		isOpenLocation(state,isOpenLocation){
 			state.isOpenLocation = isOpenLocation
 		},
+		setHasLogin(state,isLogin){
+			state.hasLogin = isLogin;
+			state.vuex_userInfo = uni.getStorageSync('userInfo')
+		}
     },
 	actions: {
 		wxLogin(context,provider){
@@ -130,7 +134,7 @@ const store = new Vuex.Store({
 		checkLogin(context,data){
 			checkLogin().then(res => {
 				if(res.status == '200'){
-					// context.commit('login',res.data)
+					context.commit('setHasLogin',true)
 				}else{
 					context.commit('logout')
 				}