lilei 3 年之前
父節點
當前提交
48aac91706
共有 5 個文件被更改,包括 152 次插入318 次删除
  1. 1 1
      App.vue
  2. 28 0
      api/bundel.js
  3. 0 240
      api/car.js
  4. 19 23
      pages/bundelDetail/index.vue
  5. 104 54
      pages/index/index.vue

+ 1 - 1
App.vue

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

+ 28 - 0
api/bundel.js

@@ -0,0 +1,28 @@
+import request from './request';
+
+//  request()  第二个参数若为true则表示不传token
+ 
+// 客户套餐列表
+export const getCustomerBundle = params => {
+  return request({
+    url: `customerBundle/queryPage/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
+  })
+}
+// 套餐明细
+export const getCustomerBundleDetail = params => {
+  return request({
+    url: `customerBundle/detail/queryPage/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
+  })
+}
+// 使用记录
+export const getCustomerUseHistory = params => {
+  return request({
+    url: `customerBundle/useHistory/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
+  })
+}

+ 0 - 240
api/car.js

@@ -1,240 +0,0 @@
-import request from './request';
-
-//  request()  第二个参数若为true则表示不传token
-
-// 生成手机号码
-export const getMobileVirtual = (params) => {
-  return request({
-    url: `customerVehicle/getMobileVirtual`,
-    method: 'get',
-    data: {}
-  })
-}
-// 车辆和客户列表
-export const  getCustomerCarList = params => {
-  return request({
-    url: `customerVehicle/findPage/${params.pageNo}/${params.pageSize}`,
-    method: 'post',
-    data: {
-      condition: params.condition
-    }
-  })
-}
-
-// 车辆和客户列表明细查询
-export const  getCustomerCarListDetail = params => {
-  return request({
-    url: `customerVehicle/findDetail`,
-    method: 'post',
-    data: params
-  })
-}
-// 门店车辆--根据车牌查询车辆信息
-export const  getCarData = params => {
-  return request({
-    url: `vehicle/findByNumber?number=${params}`,
-    method: 'get',
-    data: ''
-  })
-}
-
-// 门店客户--根据电话查询客户信息
-export const  getPhone = params => {
-  return request({
-    url: `customer/findByMobile?mobile=${params}`,
-    method: 'get',
-    data: ''
-  })
-}
-
-// 门店客户车辆--保存客户车辆
-export const  saveCustomerCar = (params) => {
-  return request({
-    url: `customerVehicle/save`,
-    method: 'post',
-    data: params
-  })
-}
-
-// 精确查询客户车辆列表
-export const  searchCustomerList = (params) => {
-  return request({
-    url: `customerVehicle/findList`,
-    method: 'post',
-    data: params
-  })
-}
-//车辆列表
-export const  getCarList = params => {
-  return request({
-    url: `vehicle/query/${params.pageNo}/${params.pageSize}`,
-    method: 'post',
-    data: {
-      "source":params.source?params.source:"",
-      "queryWord":params.queryWord,
-      "level":params.level,
-    },
-  })
-}
-
-//删除车辆
-export const  deletesCar = params => {
-  return request({
-    url: `vehicle/del/${params.id}`,
-    method: 'get',
-  })
-}
-//查询省
-export const  getProvince = () => {
-  return request({
-    url: `area/PROVINCE`,
-    method: 'get'
-  }, true)
-}
-//查询市
-export const  getCityByPro = params => {
-  return request({
-    url: `area/CITY/${params.id}`,
-    method: 'get'
-  }, true)
-}
-//查询区
-export const  getDistrictByCity = params => {
-  return request({
-    url: `area/DISTRICT/${params.id}`,
-    method: 'get'
-  }, true)
-}
-//品牌
-export const  findBrand = params => {
-  return request({
-    url: `vehicleModel/findBrand`,
-    method: 'post',
-    data: params,
-  })
-}
-//车系
-export const  findSeries = brandId => {
-  return request({
-    url: `vehicleModel/findSeries/${brandId}`,
-    method: 'post',
-    data: {},
-  })
-}
-//排量
-export const  findDisplacement = (brandId,seriesId) => {
-  return request({
-    url: `vehicleModel/findDisplacement/${brandId}/${seriesId}`,
-    method: 'post',
-    data: {},
-  })
-}
-//生产年份
-export const  findYear = (brandId,seriesId,displacement) => {
-  return request({
-    url: `vehicleModel/findYear/${brandId}/${seriesId}/${displacement}`,
-    method: 'post',
-    data: {},
-  })
-}
-//车型
-export const  findModel = (brandId,seriesId,displacement,year) => {
-  return request({
-    url: `vehicleModel/findModel/${brandId}/${seriesId}/${displacement}/${year}`,
-    method: 'post',
-    data: {},
-  })
-}
-//带出车辆分类和厂商指导价
-export const  findVehicleModel = (id) => {
-  return request({
-    url: `vehicleModel/findDetail/${id}`,
-    method: 'post',
-    data: {},
-  })
-}
-//新增车辆
-export const  addCar = (params,carId) => {
-  if(carId != undefined && carId != '') {
-    params.id = carId
-  }
-  return request({
-    url: `vehicle/save`,
-    method: 'post',
-    data: params,
-  })
-}
-//查询车辆详情
-export const  getCarDetails = (id) => {
-  return request({
-    url: `vehicle/${id}`,
-    method: 'get',
-  })
-}
-
-//识别车牌
-export const licensePlate = (params) => {
-  return request({
-    url: `vehicleIdentify/licensePlate`,
-    method: 'post',
-    data: params,
-  })
-}
-//识别VIN码
-export const vinCode = (params) => {
-  return request({
-    url: `vehicleIdentify/vinCode`,
-    method: 'post',
-    data: params,
-  })
-}
-
-//拍照识别的车牌号保存
-export const saveIdentityVehicle = (params) => {
-  return request({
-    url: `index/saveIdentityVehicle`,
-    method: 'post',
-    data: params
-  })
-}
-
-// by vin 查询车辆信息
-export const  getVehicleInfoByVin = (params) => {
-  return request({
-    url: `vehicleIdentify/getVehicleInfoByVin?vinCode=${params.vin}`,
-    method: 'get',
-  })
-}
-
-// by mobile 查询客户车辆信息是否存在
-export const findCustomerCarIsOnly = (params) => {
-  return request({
-    url: `customerVehicle/findByMobile?mobile=${params}`,
-    method: 'get',
-  })
-}
-
-// 扫描记录
-export const scanVinLog = (params) => {
-  return request({
-    url: `scanVinLog/create`,
-    data: params,
-    method: 'post'
-  })
-}
-// 滚动扫描记录
-export const scanVinLogQueryRoll = (params) => {
-  return request({
-    url: `scanVinLog/queryRoll/${params.pageNo}/${params.pageSize}`,
-    data: params,
-    method: 'post'
-  })
-}
-// vin查询记录分页
-export const getScanVinLogList = (params) => {
-  return request({
-    url: `scanVinLog/queryPage/${params.pageNo}/${params.pageSize}`,
-    data: params,
-    method: 'post'
-  })
-}

+ 19 - 23
pages/bundelDetail/index.vue

@@ -10,17 +10,17 @@
 						<view  
 						class="check-order-list" 
 						v-if="index==current"
-						v-for="(item,sindex) in 35" 
+						v-for="(item,sindex) in list" 
 						:key="item.id+'-'+sindex"
 						> 
 							<view v-if="current==0" class="flex align_center justify_between">
-								<view class="l_box">钜惠礼(首单满2000元减300)</view>
-								<view class="r_box">剩余1次</view>
+								<view class="l_box">{{item.detailName}}</view>
+								<view class="r_box">剩余{{item.currentQty}}次</view>
 							</view>
 							<view v-if="current==1">
-								<view class="l_box">钜惠礼(首单满2000元减300)</view>
+								<view class="l_box">{{item.detailName}}</view>
 								<view class="flex align_center justify_between" style="padding-top: 0.2em;">
-									<view class="r_box">剩余1次</view>
+									<view class="r_box">剩余{{item.useQty}}次</view>
 									<view class="r_box">2022-15-25</view>
 								</view>
 							</view>
@@ -28,7 +28,7 @@
 						  
 						 <view style="padding: 20upx;">
 						 	<u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
-						 	<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
+						 	<u-loadmore v-if="list.length" :status="status" />
 						 </view>
 					</scroll-view>
 				</swiper-item>
@@ -37,6 +37,7 @@
 </template>
 
 <script>
+	import { getCustomerBundleDetail,getCustomerUseHistory } from '@/api/bundel.js'
 	export default {
 		components: {
 		},
@@ -59,33 +60,23 @@
 				current: 0,
 				swiperCurrent: 0,
 				pageNo: 1,
-				pageSize: 6,
+				pageSize: 15,
 				list: [],
 				total: 0,
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
-				statusList: [], // 问题状态数据字典
-				sourceTypeList: [] // 问题来源数据字典
+				customerBundleId:''
 			}
 		},
-		onLoad() {
+		onLoad(opts) {
+			this.customerBundleId = opts.customerBundleId
 			// 监听整改完成后刷新事件
 			uni.$on('refreshBL',this.getRow)
-			this.statusList = this.$store.state.vuex_backLogStatusList
-			this.sourceTypeList = this.$store.state.vuex_backLogSourceTypeList
 			this.getRow(1)
 		},
 		onUnload() {
 			uni.$off('refreshBL',this.getRow)
 		},
 		methods:{
-			getsourceType(value) {
-				let type = this.sourceTypeList.find(a=>a.code==value)
-				return type ? type.dispName : '--'
-			},
-			getstatus(value) {
-				let status = this.statusList.find(a=>a.code==value)
-				return status ? status.dispName : '--'
-			},
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index;
@@ -131,10 +122,11 @@
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
-			    reformState: this.tabList[this.current].queryLabel, // tab分类
+			    customerBundleId: this.customerBundleId, // tab分类
 			  }
+			  const url = [getCustomerBundleDetail,getCustomerUseHistory]
 			  this.status = "loading"
-			  getBackLogList(params).then(res => {
+			  url[this.current](params).then(res => {
 				console.log(params,res.data.list,'+++++++++++')
 				if (res.status == 200) {
 				  if(this.pageNo>1){
@@ -148,7 +140,11 @@
 				  this.total = 0
 				  this.noDataText = res.message
 				}
-				this.status = "loadmore"
+				if(this.list.length<this.total){
+					this.status = "loadmore"
+				}else{
+					this.status = "nomore"
+				}
 			  })
 			},
 			resetPage(){

+ 104 - 54
pages/index/index.vue

@@ -25,25 +25,29 @@
 		</view>
 		<!-- 套餐记录 -->
 		<view class="list-box">
-			<view class="scroll-box">
-				<view class="flex align_center justify_between item-box" v-for="item in 26" @click="toDetail(item)">
-					<view class="l_box">99会员礼包</view>
-					<view class="flex align_center r_box">
-						<view>
-							<view>2022-05-28</view>
-							<view>高新天佑店</view>
-						</view>
-						<view>
-							<u-icon name="arrow-right"></u-icon>
-						</view>
-					</view>
-				</view>
-				<!-- <view style="padding: 20upx;">
-					<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>
-					<u-loadmore v-if="status=='loading'" :status="status" />
-				</view> -->
-				<view class="des">请登录后查看套餐记录</view>
-			</view>
+			<swiper-item class="swiper-item">
+					<scroll-view scroll-y class="scroll-box" @scrolltolower="onreachBottom">
+						 <view class="flex align_center justify_between item-box" v-for="item in list" :key="item.id" @click="toDetail(item)">
+						 	<view class="l_box">{{item.bundleName}}</view>
+						 	<view class="flex align_center r_box">
+						 		<view>
+						 			<view>{{item.createDate.split(' ')[0]}}</view>
+						 			<view>{{item.store.name}}</view>
+						 		</view>
+						 		<view>
+						 			<u-icon name="arrow-right"></u-icon>
+						 		</view>
+						 	</view>
+						 </view>
+						  
+						 <view style="padding: 20upx;">
+						 	<u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
+						 	<u-loadmore v-if="list.length" :status="status" />
+						 </view>
+						 <view v-if="!hasLogin" class="des">请登录后查看套餐记录</view>
+					</scroll-view>
+				</swiper-item>
+			</swiper>
 		</view>
 		<uni-popup ref="openModal" type="center">
 			<uni-popup-dialog content="确定退出登录吗?" @confirm="onOk" title="提示"></uni-popup-dialog>
@@ -59,6 +63,7 @@
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
 	import { listLookUp, getLookUpDatas } from '@/api/data.js';
+	import { getCustomerBundle } from '@/api/bundel.js'
 	export default {
 		components: {
 			uniPopup,uniPopupDialog
@@ -67,7 +72,10 @@
 			return {
 				status: 'loading',
 				noDataText: '暂无数据',
-				vinList: [],
+				pageNo: 1,
+				pageSize: 15,
+				list: [],
+				total: 0,
 			}
 		},
 		computed: {
@@ -107,7 +115,7 @@
 			pageInit(){
 				if(this.hasLogin){
 					// 获取扫描记录
-					this.getVinLog()
+					this.getbundle(1)
 				}
 			},
 			//  获取数据字典
@@ -127,14 +135,47 @@
 					}
 				});
 			},
-			getVinLog(){
-				this.vinList  = []
-				this.status = "loading"
-				getScanVinLogList({pageNo:1,pageSize:10}).then(res => {
-					this.vinList = res.data.list || []
-					this.vinList = this.vinList.filter(item => item.vinCode)
-					this.status = 'nomore'
-				})
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				console.log(this.list.length < this.total)
+				if(this.list.length < this.total){
+					this.status = 'loading';
+					this.pageNo += 1
+					this.getbundle()
+				}else{
+					this.status = "nomore"
+				}
+			},
+			// 查询列表
+			getbundle (pageNo) {
+			  if (pageNo) {
+			    this.pageNo = pageNo
+			  }
+			  let params = {
+			    pageNo: this.pageNo,
+			    pageSize: this.pageSize,
+			  }
+			  this.status = "loading"
+			  getCustomerBundle(params).then(res => {
+				console.log(params,res,'+++++++++++')
+				if (res.status == 200) {
+				  if(this.pageNo>1){
+					  this.list = this.list.concat(res.data.list || [])
+				  }else{
+					  this.list = res.data.list || []
+				  }
+				  this.total = res.data.count || 0
+				} else {
+				  this.list = []
+				  this.total = 0
+				  this.noDataText = res.message
+				}
+				if(this.list.length<this.total){
+					this.status = "loadmore"
+				}else{
+					this.status = "nomore"
+				}
+			  })
 			},
 			toUser(){
 				if(!this.hasLogin){
@@ -157,7 +198,7 @@
 			},
 			toDetail(item){
 				uni.navigateTo({
-					url:"/pages/bundelDetail/index"
+					url:"/pages/bundelDetail/index?customerBundleId="+item.id
 				})
 			}
 		}
@@ -198,31 +239,40 @@
 		.list-box{
 			flex-grow: 1;
 			overflow: auto;
-			.scroll-box{
+			position: relative;
+			.swiper-item{
+				width: 100%;
 				height: 100%;
-				.item-box{
-					border-bottom: 1px solid #eee;
-					padding: 1em;
-					&:active{
-						background: #f8f8f8;
-					}
-					.l_box{
-						font-size: 1.1em;
-						flex-grow: 1;
-					}
-					.r_box{
-						color: #999;
-						> view{
-							padding: 0 0.1em;
-						}
-					}
-				}
-				.des{
-					text-align: center;
-					padding: 3em 0;
-					color: #999;
-					font-size: 0.9em;
-				}
+				overflow: hidden;
+				 .scroll-box{
+				 	width: 100%;
+				 	height: 100%;
+				 	overflow: auto;
+				 	.item-box{
+				 		border-bottom: 1px solid #eee;
+				 		padding: 1em;
+				 		&:active{
+				 			background: #f8f8f8;
+				 		}
+				 		.l_box{
+				 			font-size: 1.1em;
+				 			flex-grow: 1;
+				 		}
+				 		.r_box{
+				 			color: #999;
+				 			> view{
+				 				padding: 0 0.1em;
+								text-align: right;
+				 			}
+				 		}
+				 	}
+				 	.des{
+				 		text-align: center;
+				 		padding: 3em 0;
+				 		color: #999;
+				 		font-size: 0.9em;
+				 	}
+				 }
 			}
 		}
 	}