chenrui 4 years ago
parent
commit
18aef97129

+ 2 - 1
App.vue

@@ -1,5 +1,6 @@
 <script>
-	const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
+	// const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
+	const uat_URL = 'http://192.168.16.107:7300/mock/5f5af637cb0f492ad4ee858f/app/at-employee/' // mock
 	// const uat_URL = 'http://192.168.16.103:9110/saas/clz/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布

+ 6 - 0
pages.json

@@ -37,6 +37,12 @@
 				"navigationBarTitleText": "智能巡店"
 			}
 		},
+		{
+			"path": "pages/videoShopTour/videoShopTour",
+			"style": {
+				"navigationBarTitleText": "视频巡店"
+			}
+		},
 		{
 		    "path" : "pages/shopTour/shopTour",
 		    "style" : {

+ 0 - 1
pages/index/index.vue

@@ -58,7 +58,6 @@ export default {
 					icon: 'xundian',
 					color: '#00aaff',
 					name: '视频巡店',
-					// url:'/pages/shopTour/shopTour',
 					url: '/pages/videoShopTour/videoShopTour',
 					target: 'page',
 					auth: true

+ 64 - 10
pages/organization/organization.vue

@@ -2,15 +2,17 @@
 	<view class="organization-wrap">
 		<u-sticky>
 			<!-- 组织结构根节点 -->
-			<view class="organization-root-tit">车领主</view>
+			<view class="organization-root-tit">
+				<view class="structure-con" v-for="(item,index) in nowStructure" :key="index">
+					<text class="structure-name" @click="checkedStructure(index)">{{item}}</text>
+					<u-icon class="structure-icon" name="arrow-right" color="#999" size="28"></u-icon>
+				</view>
+				
+			</view>
 			<!-- 组织结构子节点 -->
 			<view class="organization-node-con">
-				<view class="organization-node-item">
-					<text class="organization-node-item-name">贷安抚记卡的</text>
-					<u-icon class="organization-node-item-icon" name="arrow-right" color="#999" size="28"></u-icon>
-				</view>
-				<view class="organization-node-item">
-					<text class="organization-node-item-name">贷安抚记卡的</text>
+				<view class="organization-node-item" v-for="(item, index) in organizationNowList" :key="index" @click="clickOrganization(item)">
+					<text class="organization-node-item-name">{{item.name}}</text>
 					<u-icon class="organization-node-item-icon" name="arrow-right" color="#999" size="28"></u-icon>
 				</view>
 			</view>
@@ -38,7 +40,7 @@
 	export default{
 		data(){
 			return{
-				list: [
+				list: [  //  门店列表
 					{ name: '常青二路店' },
 					{ name: '常青二路店常青青二路店常路店' },
 					{ name: '常青二路店' },
@@ -57,10 +59,53 @@
 					{ name: '常青二路店' },
 					{ name: '常青二路店' },
 					{ name: '常青二路店' },
-				]
+				],
+				organizationNowList: [  //  组织机构  当前显示 列表数据
+					{ name: '陕西区域', id: 1, children: [{name: '西安', id: 11},{name: '咸阳', id: 111},{name: '宝鸡', id: 1111},{name: '渭南', id: 11111},] },
+					{ name: '宁夏区域', id: 2, children: [{name: '银川', id: 21},{name: '中卫', id: 211},{name: '固原', id: 2111},] },
+					{ name: '甘肃区域', id: 3, children: [{name: '兰州', id: 31},{name: '金昌', id: 311},{name: '白银', id: 3111},{name: '天水', id: 31111},] },
+				],
+				organizationList: [  //  组织机构  总列表数据
+					{ name: '陕西区域', id: 1, children: [{name: '西安', id: 11},{name: '咸阳', id: 111},{name: '宝鸡', id: 1111},{name: '渭南', id: 11111},] },
+					{ name: '宁夏区域', id: 2, children: [{name: '银川', id: 21},{name: '中卫', id: 211},{name: '固原', id: 2111},] },
+					{ name: '甘肃区域', id: 3, children: [{name: '兰州', id: 31},{name: '金昌', id: 311},{name: '白银', id: 3111},{name: '天水', id: 31111},] },
+				],
+				nowStructure: [  //  面包屑
+					'西安车领主网络科技有限公司'
+				],
+				nowInd: []
+			}
+		},
+		methods: {
+			//  组织机构  click
+			clickOrganization(item){
+				if(item.children){
+					this.organizationNowList = item.children
+				}else{
+					this.organizationNowList = []
+				}
+				this.nowStructure.push(item.name)
+			},
+			//  切换至当前所选的组织结构
+			checkedStructure(ind){
+				
+				if(ind == 0){
+					this.nowStructure = ['西安车领主网络科技有限公司']
+				}else{
+					this.organizationNowList = this.organizationList[ind - 1].children
+					this.nowStructure = this.nowStructure.slice(0,ind+1)
+				}
 			}
 		},
-		methods: {}
+		watch: {
+			nowStructure(val){
+				if(val.length == 1){
+					this.nowStructure[0] = '西安车领主网络科技有限公司'
+				}else{
+					this.nowStructure[0] = '车领主'
+				}
+			}
+		}
 	}
 </script>
 
@@ -74,6 +119,15 @@
 			padding: 20upx 30upx;
 			background-color: #fff;
 			border-bottom: 20upx solid #f8f8f8;
+			.structure-con{
+				display: inline-block;
+				.structure-name{
+					color: 	#2979ff;
+				}
+				.structure-icon{
+					padding: 0 10upx;
+				}
+			}
 		}
 		.organization-node-con{
 			padding: 0 30upx;

+ 49 - 2
pages/searchPage/searchPage.vue

@@ -2,6 +2,19 @@
 	<view class="searchPage-wrap">
 		<!-- 搜索 -->
 		<u-search shape="square" placeholder="请输入门店名称搜索" v-model="keyword" action-text="取消" @change="change" @search="search" @custom="custom"></u-search>
+		<!-- 列表数据 -->
+		<view class="listData-con">
+			<view class="listData-item" v-for="(item, index) in list" :key="index" @click="goPage(item)">
+				<view class="listData-item-l">
+					<u-icon class="listData-item-l-icon" name="mendian" custom-prefix="xd-icon" size="40" color="#888"></u-icon>
+					<text class="listData-item-l-name">{{item.name}}</text>
+				</view>
+				<view class="listData-item-r">
+					<u-icon class="listData-item-r-icon" name="yuanchengxundian" custom-prefix="xd-icon" size="40" color="#2b85e4"></u-icon>
+				</view>
+			</view>
+			<u-empty :text="noDataText" img-width="120" v-if="list.length == 0 && status != 'loading'" :margin-top="80" mode="list"></u-empty>
+		</view>
 	</view>
 </template>
 
@@ -9,7 +22,16 @@
 	export default{
 		data(){
 			return{
-				keyword: ''
+				keyword: '',  //  关键字
+				list: [  //  数据列表
+					{ name: '常青二路店' },
+					{ name: '常青二路店常青青二路店常路店' },
+					{ name: '常青二路店' },
+					{ name: '常青二路店' },
+					{ name: '常青二路店' },
+					{ name: '常青二路店' },
+				],
+				noDataText: '暂无数据',  //  数据异常提示
 			}
 		},
 		methods: {
@@ -55,6 +77,31 @@
 		height: calc(100vh - 44px);
 	}
 	.searchPage-wrap{
-		
+		padding: 20upx 30upx 0;
+		.listData-con{
+			.listData-item{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 20upx 0;
+				border-bottom: 1upx dashed #f8f8f8;
+				&-l{
+					flex-grow: 1;
+					padding-right: 10upx;
+					position: relative;
+					padding-left: 50upx;
+					&-icon{
+						vertical-align: sub;
+						padding-right: 8upx;
+						position: absolute;
+						left: 0;
+						top: -4upx;
+					}
+				}
+				&-r{
+					flex-shrink: 0;
+				}
+			}
+		}
 	}
 </style>

+ 49 - 21
pages/videoShopTour/videoShopTour.vue

@@ -18,7 +18,7 @@
 			<view class="list-tit">门店列表</view>
 			<!-- 列表数据 -->
 			<view class="listData-con">
-				<view class="listData-item" v-for="(item, index) in list" :key="index">
+				<view class="listData-item" v-for="(item, index) in list" :key="index" @click="goPage(item)">
 					<view class="listData-item-l">
 						<u-icon class="listData-item-l-icon" name="mendian" custom-prefix="xd-icon" size="40" color="#888"></u-icon>
 						<text class="listData-item-l-name">{{item.name}}</text>
@@ -27,38 +27,44 @@
 						<u-icon class="listData-item-r-icon" name="yuanchengxundian" custom-prefix="xd-icon" size="40" color="#2b85e4"></u-icon>
 					</view>
 				</view>
+				<u-empty :text="noDataText" img-width="120" v-if="list.length == 0 && status != 'loading'" :margin-top="20" mode="list"></u-empty>
+				<u-loadmore bg-color="#f8f8f8" v-if="list.length < total || status == 'loading'" :status="status" class="loadmore" />
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import { clzConfirm } from '@/libs/tools.js'
+	import { findStoreList } from '@/api/store.js'
 	export default{
 		data(){
 			return{
-				list: [
-					{ name: '常青二路店' },
-					{ name: '常青二路店常青青二路店常路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店常青青二路店常路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店常青青二路店常路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-					{ name: '常青二路店' },
-				]
+				noDataText: '暂无数据',  //  数据异常提示
+				status: 'loadmore',  //  加载中状态
+				list: [],  //  数据列表
+				total: 0,  //  数据总条数
+				pageNo: 1,  //  当前页码
+				pageSize: 10,  //  每页条数
 			}
 		},
+		onLoad() {
+			this.init()
+		},
 		methods: {
+			//  初始
+			init(){
+				//  获取门店列表
+				findStoreList().then(res => {
+					if(res.status == 200){
+						this.list = res.data.list
+						this.total = res.data.count || 0
+					}else{
+						this.list = []
+						this.total = 0
+					}
+				})
+			},
 			//  按门店名称查询
 			goSearch(){
 				uni.navigateTo({
@@ -70,6 +76,28 @@
 				uni.navigateTo({
 					url: '/pages/organization/organization'
 				})
+			},
+			//  开始巡店
+			goPage(item){
+				//  校验是否有历史巡店记录
+				clzConfirm({
+				    title: '提示',
+				    content: '有进行中的巡店任务,是否继续?',
+					confirmText: '继续巡店',
+					cancelText: '重新开始',
+				    success: function (res) {
+				        if (res.confirm || res.index==0) {  //  继续巡店
+							uni.navigateTo({
+								url: '/pages/shopTour/shopTour?storeId=' + item.id + '&type=0'
+							})
+				        }else{  //  重新开始
+							uni.navigateTo({
+								url: '/pages/shopTour/shopTour?storeId=' + item.id + '&type=1'
+							})
+				        }
+				    }
+				})
+				
 			}
 		}
 	}