lilei hace 2 años
padre
commit
f6c3db23f9
Se han modificado 7 ficheros con 65 adiciones y 117 borrados
  1. 2 2
      App.vue
  2. 0 83
      libs/axios.js
  3. 43 26
      pages/index/index.vue
  4. 1 1
      pages/login/login.vue
  5. 1 1
      pages/login/phoneLogin.vue
  6. 18 4
      pages/storeManage/storeAuth.vue
  7. BIN
      static/logo-s.png

+ 2 - 2
App.vue

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

+ 0 - 83
libs/axios.js

@@ -1,83 +0,0 @@
-import { objToUrl } from '@/libs/tools.js';
-const baseUrl = getApp().globalData.baseUrl
-//带Token请求
-const request = (opts, hasToken) => {
-	const authorization = getApp().globalData.token
-	// console.log(authorization,'authorization')
-	//  hasToken是否传入token,为true则不传token
-	const header = {
-			'content-Type': 'application/json;charset=UTF-8'
-		}
-	if(!hasToken&&authorization){
-		header['X-AUTH-TOKEN'] = authorization
-	}	
-	//此token是登录成功后后台返回保存在storage中的
-	let DefaultOpts = {
-		url: baseUrl+opts.url,
-		data: opts.data,
-		method: opts.method,
-		header: opts.header ? opts.header : header
-	}
-	let promise = new Promise(function(resolve, reject) {
-		uni.request(DefaultOpts).then(
-			(res) => {
-				console.log(res,'pppp')
-				if(res[0]&&res[0].errMsg.indexOf('request:fail')>=0){
-					resolve({
-						status: 6000,
-						message: "网络请求失败"
-					})
-				}
-				let ret = res[1]
-				if(res[1].data.status){
-					ret = res[1].data
-				}else if(res[1].status){
-					ret = res[1]
-				}
-				if(ret.status == '200'){
-					resolve(ret)
-				}else{
-					if(ret.status != '401'){
-						uni.showToast({
-							icon:'none',
-							title: ret.message,
-							mask: true,
-							duration: 3000
-						})
-					}
-					resolve(ret)
-				}
-				resolve(ret)
-			}
-		).catch(
-			(response) => {
-				reject(response)
-			}
-		)
-	})
-	return promise
-}
-function getRoutePath() {
-  // eslint-disable-next-line no-undef
-  const pages = getCurrentPages(); // 获取加载的页面
-  const currentPage = pages[pages.length - 1]; // 获取当前页面的对象
-  let url = currentPage.route; // 当前页面url
-  const options = objToUrl(currentPage.options); // 如果要获取url中所带的参数可以查看options
-
-  const lanuch = [
-    'pages/index/index'
-  ].includes(url);
-  url = '/' + url;
-  if (options.length) {
-    url += '?' + options;
-  }
-  return {
-    url,
-    lanuch
-  };
-}
-
-export default {
-	baseUrl,
-	request
-}

+ 43 - 26
pages/index/index.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="header-box">
 			<UniStatusBar></UniStatusBar>
-			<view class="title">
+			<view class="title flex align_center" :style="{height:(navHeight+'px')}">
 				<u-image src="/static/logo-h.png" width="349" height='40'></u-image>
 			</view>
 		</view>
@@ -39,7 +39,7 @@
 					</view>
 				</view>
 				<view>
-					<text v-if="userInfo.identifyType=='VISITOR'" class="user-rz">
+					<text v-if="userInfo&&userInfo.identifyType=='VISITOR'" class="user-rz">
 						认证成为门店
 					</text>
 					<u-icon name="arrow-right"></u-icon>
@@ -59,7 +59,7 @@
 		<view class="list-box">
 			<!-- 扫描记录 -->
 			<u-cell-group :border="false">
-				<u-cell-item title="VIN查询历史" @click="toAllRecord" :title-style="{fontSize:'1em'}" :value="userInfo.identifyType=='VISITOR'?'':'全部'">
+				<u-cell-item title="VIN查询历史" @click="toAllRecord" :title-style="{fontSize:'1em'}" :value="userInfo&&userInfo.identifyType=='VISITOR'?'':'全部'">
 					<u-icon slot="icon" size="38" color="#066cff" style="margin-right: 0.3em;" name="order"></u-icon>
 				</u-cell-item>
 			</u-cell-group>
@@ -69,7 +69,7 @@
 				:key="item.id" 
 				:title="item.vinCode" 
 				:title-style="{fontSize:'1em'}" 
-				:label="userInfo.identifyType=='VISITOR' ? '' : (item.brandName +' '+item.modelName)">
+				:label="userInfo&&userInfo.identifyType=='VISITOR' ? '' : (item.brandName +' '+item.modelName)">
 					<text slot="icon"></text>
 				</u-cell-item>
 				<view style="padding: 20upx;">
@@ -107,7 +107,8 @@
 				list:[],
 				vinList: [],
 				orderTodo: null,
-				avatarUrl:''
+				avatarUrl:'',
+				navHeight: '44'
 			}
 		},
 		computed: {
@@ -124,8 +125,16 @@
 			this.$store.dispatch('checkLogin',()=>{
 				this.pageInit()
 			})
-			
 			this.getScrollLog()
+			
+			// 获取导航栏高度
+			const res = uni.getSystemInfoSync()
+			const system = res.platform
+			if (system === 'android') {
+				this.navHeight = 48
+			} else if (system === 'ios') {
+				this.navHeight = 44
+			}
 		},
 		onLoad() {
 			// 获取数据字典
@@ -160,6 +169,8 @@
 					this.getVinLog()
 					// 获取扫描次数
 					this.$store.dispatch("getScanNums")
+				}else{
+					uni.removeStorageSync('token')
 				}
 			},
 			//  获取数据字典
@@ -244,28 +255,34 @@
 			},
 			// 去扫描
 			openCamera(){
-				if(this.userInfo.identifyType=='VISITOR'){
-					if(this.vuex_vinScanNums < 10){
-						uni.navigateTo({
-							url: this.hasLogin ? "/pages/scan-frame/scan-frame" : '/pages/login/login'
-						})
-					}else{
-						uni.showModal({
-							title: '提示',
-							content: '个人用户扫描VIN限10次/天,您的次数已用完!',
-							confirmText: '去认证',
-							success(res) {
-								if(res.confirm) {  
-									uni.navigateTo({
-										url: '/pages/storeManage/storeAuth'
-									})
+				if(this.hasLogin){
+					if(this.userInfo.identifyType=='VISITOR'){
+						if(this.vuex_vinScanNums < 10){
+							uni.navigateTo({
+								url: "/pages/scan-frame/scan-frame"
+							})
+						}else{
+							uni.showModal({
+								title: '提示',
+								content: '个人用户扫描VIN限10次/天,您的次数已用完!',
+								confirmText: '去认证',
+								success(res) {
+									if(res.confirm) {  
+										uni.navigateTo({
+											url: '/pages/storeManage/storeAuth'
+										})
+									}
 								}
-							}
+							})
+						}
+					}else{
+						uni.navigateTo({
+							url: "/pages/scan-frame/scan-frame"
 						})
 					}
 				}else{
 					uni.navigateTo({
-						url: this.hasLogin ? "/pages/scan-frame/scan-frame" : '/pages/login/login'
+						url: '/pages/login/login'
 					})
 				}
 			},
@@ -316,10 +333,10 @@
 		background-image: linear-gradient(#86defa 0%,#cdeff9 25%,#ffffff 40%);
 		.header-box{
 			z-index: 5;
-			padding: 0.3em 1em;
+			padding: 0em 1em;
 			background: #066cff;
 			 .title{
-				 padding: 0.5em 0;
+				 padding: 0;
 			 }
 		}
 		.cbody{
@@ -328,7 +345,7 @@
 			overflow-x: hidden;
 		}
 		.body-box{
-			padding: 0.5em 1em;
+			padding: 0em 1em 0.8em;
 			z-index: 4;
 			.notices{
 				padding: 0.5em 0 0;

+ 1 - 1
pages/login/login.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content-body">
 			<view class="login-logo">
-				<u-image src="/static/logo-s.png"  width="240" height="240" class="logo"></u-image>
+				<u-image src="/static/logo-s.png"  width="382" height="248" class="logo"></u-image>
 			</view>
 		    <view class="login-btns">
 				<u-button shape="circle" :custom-style="wxButton" class="login-btn" type="success" :hair-line="false" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">

+ 1 - 1
pages/login/phoneLogin.vue

@@ -2,7 +2,7 @@
 	<view class="phone-login content">
 		<view class="login-content">
 			<view class="login-logo">
-				<u-image src="/static/logo-s.png"  width="240" height="240" class="logo"></u-image>
+				<u-image src="/static/logo-s.png"  width="382" height="248" class="logo"></u-image>
 			</view>
 			<u-form ref="uForm">
 				<u-form-item>

+ 18 - 4
pages/storeManage/storeAuth.vue

@@ -26,17 +26,17 @@
 					upload-text="上传营业执照"
 					max-count="1"></u-upload>
 				</u-form-item>
-				<u-form-item label="门店名称">
+				<u-form-item label="门店名称" required prop="name">
 					<u-input v-model="form.name" maxlength="30" placeholder="请输入门店名称(最多30个字符)"/>
 				</u-form-item>
-				<u-form-item label="所在地区">
+				<u-form-item label="所在地区" required prop="label">
 					<u-input v-model="form.label" placeholder="请选择省市区" :disabled="true" @click="openAddress"/>
 					<Address ref="applyAddress" @onConfirm="areaConfirm"></Address>
 				</u-form-item>
-				<u-form-item label="详细地址">
+				<u-form-item label="详细地址" required prop="addrDetail">
 					<u-input v-model="form.addrDetail" placeholder="请输入详细地址"/>
 				</u-form-item>
-				<u-form-item label="联系人姓名" prop="userName">
+				<u-form-item label="联系人姓名" required prop="userName">
 					<u-input v-model="form.userName" placeholder="请输入联系人姓名"/>
 				</u-form-item>
 				<u-form-item label="联系人手机">
@@ -86,6 +86,20 @@
 							trigger: ['change','blur'],
 						}
 					],
+					label: [
+						{
+							required: true, 
+							message: '请选择所在地区', 
+							trigger: 'change'
+						}
+					],
+					addrDetail: [
+						{
+							required: true, 
+							message: '请输入详细地址', 
+							trigger: 'change'
+						}
+					],
 				},
 				areaIdArr: [],  //  省市区id数组
 				action: baseUrl + '/upload',

BIN
static/logo-s.png