lilei 9 달 전
부모
커밋
ed7ca913dc
6개의 변경된 파일78개의 추가작업 그리고 69개의 파일을 삭제
  1. 21 3
      pages/index/index.vue
  2. 2 2
      pages/index/productItem.vue
  3. 46 28
      pages/vinInput/confirmVin.vue
  4. 1 1
      pagesB/cart/index.vue
  5. 1 5
      pagesB/cart/productitem.vue
  6. 7 30
      pagesB/shopiing/productDetail.vue

+ 21 - 3
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view class="content" :class="hasShopiing?'bg-0':'bg-1'">
+	<view class="content" :class="hasShopiing?'':'bg-1'">
 		<view class="content-body">
 		<view class="content-body">
 			<!-- 头部栏 -->
 			<!-- 头部栏 -->
 			<view class="header-box">
 			<view class="header-box">
@@ -19,7 +19,7 @@
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="cbody">
+			<view class="cbody" :class="hasShopiing?'bg-0':''">
 				<view :class="hasShopiing?'shopping':'body-box bg-blue'">
 				<view :class="hasShopiing?'shopping':'body-box bg-blue'">
 					<!-- 滚动区域 -->
 					<!-- 滚动区域 -->
 					<view class="scroll-list" v-if="!hasShopiing">
 					<view class="scroll-list" v-if="!hasShopiing">
@@ -889,7 +889,25 @@
 		background-color: #ffffff;
 		background-color: #ffffff;
 	}
 	}
 	.bg-0{
 	.bg-0{
-		background-image: linear-gradient(#86defa 0%, #ffffff 30%);
+		position: relative;
+		> view{
+			z-index:1;
+			position: relative;
+		}
+		&::after{
+			/* 这个伪类的作用就是一个圆弧的背景色 */
+			width: 130%;
+			height: 40vh;
+			position: absolute;
+			/*设置水平居中*/
+			left: -15%;
+			/* 之所以left:20%,是因为width:140%,若width:160%,那么left:30%才能水平居中 */
+			top: 0; 
+			/*层叠顺序,最底层显示*/
+			content: '';
+			/*分别对应 左上 右上 右下 左下 可以修改成其它颜色*/
+		    background: linear-gradient(to bottom, #86defa, #ffffff);  
+		}
 	}
 	}
 	.bg-1{
 	.bg-1{
 		background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);
 		background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);

+ 2 - 2
pages/index/productItem.vue

@@ -9,14 +9,14 @@
 	    :key="item.id" @click="toDetail(item)">
 	    :key="item.id" @click="toDetail(item)">
 			<view>
 			<view>
 				<image mode="aspectFit" :src="item.productMsg ? item.productMsg+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="height: 140px;width: 100%;"></image>
 				<image mode="aspectFit" :src="item.productMsg ? item.productMsg+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="height: 140px;width: 100%;"></image>
-				<view class="back-price" v-if="item.dealerScopeFlag==0">售罄</view>
+				<view class="back-price" v-if="isLogin&&sysUserFlag == '1'&&item.dealerScopeFlag==0">售罄</view>
 				<view class="product-code"><text class="ellipsis-one" overflow="ellipsis">{{item.productCode}}</text></view>
 				<view class="product-code"><text class="ellipsis-one" overflow="ellipsis">{{item.productCode}}</text></view>
 			</view>
 			</view>
 			<view>
 			<view>
 				<view class="product-name ellipsis-two">{{item.productName}}</view>
 				<view class="product-name ellipsis-two">{{item.productName}}</view>
 				<view class="product-guige" v-if="!!item.productOrigCode"><text class="ellipsis-two" max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text></view>
 				<view class="product-guige" v-if="!!item.productOrigCode"><text class="ellipsis-two" max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text></view>
 				<view class="product-button">
 				<view class="product-button">
-					<view class="price-txt flex align_center">¥<text>{{isLogin ? item.price : '***'}}</text></view>
+					<view class="price-txt flex align_center">¥<text>{{isLogin&&sysUserFlag == '1' ? item.price : '***'}}</text></view>
 					<view>
 					<view>
 						 
 						 
 					</view>
 					</view>

+ 46 - 28
pages/vinInput/confirmVin.vue

@@ -14,7 +14,7 @@
 			<u-input v-model="verifyCode" :custom-style="{fontSize:'40rpx'}" type="text" height="90" :maxlength='17' input-align="center" placeholder="请输入VIN" :border="true" />
 			<u-input v-model="verifyCode" :custom-style="{fontSize:'40rpx'}" type="text" height="90" :maxlength='17' input-align="center" placeholder="请输入VIN" :border="true" />
 		</view>
 		</view>
 		<view class="confirm-button">
 		<view class="confirm-button">
-			<u-button @click="submitForm" :loading="loading" :custom-style="{background:'#066cff'}" type="primary" shape="circle">确认</u-button>
+			<u-button @click="okBtns" :loading="loading" :custom-style="{background:'#066cff'}" type="primary" shape="circle">确认</u-button>
 		</view>
 		</view>
 		<view class="share-list flex align_center">
 		<view class="share-list flex align_center">
 			<view @click="toScan">
 			<view @click="toScan">
@@ -46,7 +46,9 @@
 			return {
 			return {
 				loading: false,
 				loading: false,
 				verifyCode: '',
 				verifyCode: '',
-				vinImg: ''
+				vinImg: '',
+				carInfo: null,
+				type: ''
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
@@ -61,13 +63,9 @@
 		onLoad(opts) {
 		onLoad(opts) {
 			this.verifyCode = opts.verifyCode || ''
 			this.verifyCode = opts.verifyCode || ''
 			this.vinImg = opts.filePath || ''
 			this.vinImg = opts.filePath || ''
-			
+			this.type = opts.type
 			// 不是手动输入
 			// 不是手动输入
 			if(opts.type == 'carmen'){
 			if(opts.type == 'carmen'){
-				// 游客需要记录扫描记录
-				if(this.userInfo.sysUserFlag == '0' && this.verifyCode){
-					this.creatRecord(null)
-				}
 				// 如果识别返回空
 				// 如果识别返回空
 				if(!this.verifyCode){
 				if(!this.verifyCode){
 					uni.showToast({
 					uni.showToast({
@@ -75,6 +73,8 @@
 						title: 'VIN识别失败,请重新扫描或手动输入VIN'
 						title: 'VIN识别失败,请重新扫描或手动输入VIN'
 					})
 					})
 				}
 				}
+				// 获取车型信息
+				this.getCarInfo()
 			}
 			}
 		},
 		},
 		// 分享
 		// 分享
@@ -142,15 +142,15 @@
 					uni.$emit("refashHome")
 					uni.$emit("refashHome")
 				})
 				})
 			},
 			},
-			// 提交并匹配车型
-			submitForm(){
-				// if(!this.hasShelf){
-				// 	uni.showToast({
-				// 		icon:'none',
-				// 		title: '门店没有关联数字货架,无法使用此功能!'
-				// 	})
-				// 	return
-				// }
+			okBtns(){
+				if(this.type == 'input'){
+					this.getCarInfo()
+				}else{
+					this.submitForm()
+				}
+			},
+			// 匹配车型
+			getCarInfo(){
 				const _this = this
 				const _this = this
 				const vinNo = this.verifyCode.toUpperCase()
 				const vinNo = this.verifyCode.toUpperCase()
 				if(vinNo.length>=17){
 				if(vinNo.length>=17){
@@ -159,20 +159,22 @@
 						vin:vinNo
 						vin:vinNo
 					}).then(res => {
 					}).then(res => {
 						if (res.status == 200&&res.data) {
 						if (res.status == 200&&res.data) {
-							_this.creatRecord(_this.userInfo.sysUserFlag == '1' ? res.data : null)
-							// 打开选择配件页面
-							uni.redirectTo({
-								url: "/pagesA/digitalShelf/choosePart?vinNumber="+vinNo+"&carList="+encodeURIComponent(JSON.stringify(res.data))+'&type=news'
-							})
-						} else {
-							uni.showModal({
-								title: '匹配错误',
-								content: '此VIN码没有匹配的车型,请检查VIN码是否正确',
-								showCancel: false,
-								confirmText: '知道了'
+							_this.carInfo = res.data
+							// 记录扫码次数
+							_this.creatRecord(res.data)
+							// 手动收入
+							if(_this.type == 'input'){
+								_this.submitForm()
+							}
+						}else{
+							uni.showToast({
+								icon: 'none',
+								title: res.message
 							})
 							})
 						}
 						}
-						this.loading = false
+						setTimeout(()=>{
+							_this.loading = false
+						},300)
 					})
 					})
 				}else{
 				}else{
 					uni.showToast({
 					uni.showToast({
@@ -180,6 +182,22 @@
 						title: '请输入正确的VIN码'
 						title: '请输入正确的VIN码'
 					})
 					})
 				}
 				}
+			},
+			submitForm(){
+				if(this.carInfo){
+					const vinNo = this.verifyCode.toUpperCase()
+					// 打开选择配件页面
+					uni.redirectTo({
+						url: "/pagesA/digitalShelf/choosePart?vinNumber="+vinNo+"&carList="+encodeURIComponent(JSON.stringify(this.carInfo))+'&type=news'
+					})
+				} else {
+					uni.showModal({
+						title: '匹配错误',
+						content: '此VIN码没有匹配的车型,请检查VIN码是否正确',
+						showCancel: false,
+						confirmText: '知道了'
+					})
+				}
 			}
 			}
 		}
 		}
 	}
 	}

+ 1 - 1
pagesB/cart/index.vue

@@ -34,7 +34,6 @@
 					<productItem
 					<productItem
 					v-for="(item, index) in list"
 					v-for="(item, index) in list"
 					:key="index"  
 					:key="index"  
-					:index="index"
 					:list="item" 
 					:list="item" 
 					@changeQty="changeQty" 
 					@changeQty="changeQty" 
 					@check="chooseItem"
 					@check="chooseItem"
@@ -175,6 +174,7 @@
 					  _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
 					  _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
 						  return {
 						  return {
 								id: key.id,
 								id: key.id,
+								edit: false,
 								checked: _this.allChecked,
 								checked: _this.allChecked,
 								cartSn: key.cartSn,
 								cartSn: key.cartSn,
 								price: key.price,
 								price: key.price,

+ 1 - 5
pagesB/cart/productitem.vue

@@ -2,7 +2,7 @@
 	<block>
 	<block>
 		<view class="choose-product-item"
 		<view class="choose-product-item"
 		v-for="(item, dix) in list"
 		v-for="(item, dix) in list"
-		:key="item.cartSn" 
+		:key="item.id" 
 		>
 		>
 			<view class="choose-product-item-check" @click="checkItem(item)">
 			<view class="choose-product-item-check" @click="checkItem(item)">
 				<uni-icons v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" type="circle-filled" size="24" color="#ccc"></uni-icons>
 				<uni-icons v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" type="circle-filled" size="24" color="#ccc"></uni-icons>
@@ -52,10 +52,6 @@
 	export default {
 	export default {
 		name: 'productItem',
 		name: 'productItem',
 		props: {
 		props: {
-			index: {
-				type: Number,
-				default: 0
-			},
 			list: {
 			list: {
 				type: Array,
 				type: Array,
 				default: () => []
 				default: () => []

+ 7 - 30
pagesB/shopiing/productDetail.vue

@@ -108,16 +108,6 @@
 				<view :style="{height:safeAreaBottom+'px'}"></view>
 				<view :style="{height:safeAreaBottom+'px'}"></view>
 			</view>
 			</view>
 		</page-container>
 		</page-container>
-		
-		<!-- 去认证弹框 -->
-		<u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
-			<view style="background-color: #fff;padding: 1rem;">
-				<u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
-				<view style="padding-top:1rem;" class="flex justify_center">
-					<u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
-				</view>
-			</view>
-		</u-popup>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -129,11 +119,11 @@
 	import { addCart, getCartCount } from '@/api/cart.js'
 	import { addCart, getCartCount } from '@/api/cart.js'
 	import { getShopDetail } from '@/api/shop.js'
 	import { getShopDetail } from '@/api/shop.js'
 	import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
 	import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
+	import { toAuthStore, toLogin } from "@/utils/index.js"
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
 				showPopu: false, // 弹框
 				showPopu: false, // 弹框
-				showPopup: false, // 去认证弹框
 				statusBarHeight: 0, // 状态栏高度
 				statusBarHeight: 0, // 状态栏高度
 				safeAreaBottom: 0, // 底部安全区域高度
 				safeAreaBottom: 0, // 底部安全区域高度
 				imgList: [],
 				imgList: [],
@@ -193,13 +183,6 @@
 					data: text,
 					data: text,
 				})
 				})
 			},
 			},
-			// 去认证
-			toAuthStore(){
-				this.showPopup = false
-				uni.navigateTo({
-					url: '/pages/storeManage/storeAuth'
-				})
-			},
 			// 产品详情
 			// 产品详情
 			getDetail(){
 			getDetail(){
 				uni.showLoading({
 				uni.showLoading({
@@ -238,7 +221,7 @@
 				if(this.hasLogin){
 				if(this.hasLogin){
 					// 游客未认证
 					// 游客未认证
 					if(this.userInfo.sysUserFlag == '0'){
 					if(this.userInfo.sysUserFlag == '0'){
-						this.showPopup = true
+						toAuthStore()
 					}else{
 					}else{
 						uni.showLoading({
 						uni.showLoading({
 							title: '加入中...',
 							title: '加入中...',
@@ -257,9 +240,7 @@
 						})
 						})
 					}
 					}
 				}else{
 				}else{
-					uni.navigateTo({
-						url: '/pages/login/login'
-					})
+					toLogin()
 				}
 				}
 			},
 			},
 			// 打开购物车
 			// 打开购物车
@@ -267,16 +248,14 @@
 				if(this.hasLogin){
 				if(this.hasLogin){
 					// 游客未认证
 					// 游客未认证
 					if(this.userInfo.sysUserFlag == '0'){
 					if(this.userInfo.sysUserFlag == '0'){
-						this.showPopup = true
+						toAuthStore()
 					}else{
 					}else{
 						uni.navigateTo({
 						uni.navigateTo({
 							url: '/pagesB/cart/index'
 							url: '/pagesB/cart/index'
 						})
 						})
 					}
 					}
 				}else{
 				}else{
-					uni.navigateTo({
-						url: '/pages/login/login'
-					})
+					toLogin()
 				}
 				}
 			},
 			},
 			// 立即购买
 			// 立即购买
@@ -284,7 +263,7 @@
 				if(this.hasLogin){
 				if(this.hasLogin){
 					// 游客未认证
 					// 游客未认证
 					if(this.userInfo.sysUserFlag == '0'){
 					if(this.userInfo.sysUserFlag == '0'){
-						this.showPopup = true
+						toAuthStore()
 					}else{
 					}else{
 						if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
 						if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
 							uni.showToast({
 							uni.showToast({
@@ -302,9 +281,7 @@
 						}
 						}
 					}
 					}
 				}else{
 				}else{
-					uni.navigateTo({
-						url: '/pages/login/login'
-					})
+					toLogin()
 				}
 				}
 			},
 			},
 			// 去结算
 			// 去结算