Преглед на файлове

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
网点列表修改

1004749546@qq.com преди 4 години
родител
ревизия
bbf839a2c9
променени са 11 файла, в които са добавени 153 реда и са изтрити 113 реда
  1. 1 1
      App.vue
  2. 26 1
      api/store.js
  3. 41 39
      pages/index/index.vue
  4. 0 1
      pages/order/order.vue
  5. 3 3
      pages/order/orderDetail.vue
  6. 43 14
      pages/store/storeDetail.vue
  7. 19 54
      pages/store/storeList.vue
  8. 20 0
      pages/userCenter/index.vue
  9. BIN
      static/img/carmore.png
  10. BIN
      static/img/cztis.png
  11. BIN
      static/img/zyts.png

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
-	const uat_URL = 'http://192.168.16.102:8103/cw-wechat/' // 本地
+	const uat_URL = 'http://192.168.16.104:8103/cw-wechat/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 26 - 1
api/store.js

@@ -1 +1,26 @@
-import axios from '@/libs/axios.js';
+import axios from '@/libs/axios.js';
+
+// 获取首页网点列表
+export const getMapStoreList = params => {
+  return axios.request({
+    url: `store/findList`,
+    method: 'post',
+	data: params
+  })
+};
+
+// 获取网点列表
+export const getStoreList = params => {
+  return axios.request({
+    url: `store/findSortList`,
+    method: 'post',
+	data: params
+  })
+};
+// 获取网点详情
+export const getStoreDetail = params => {
+  return axios.request({
+    url: `store/find/${params.id}`,
+    method: 'get',
+  })
+};

+ 41 - 39
pages/index/index.vue

@@ -13,7 +13,7 @@
 		</uni-nav-bar>
 		<!-- 页面主体 -->
 		<view class="pageContent">
-			<map id="map" :latitude="centerY" :longitude="centerX" scale="14" show-compass :markers="markers" @markertap="markertap"
+			<map id="map" :latitude="lat" :longitude="lng" scale="14" show-compass :markers="markers" @markertap="markertap"
 			 show-location style="width: 100%; height:100%;">
 			 <!-- 左边控件 -->
 				<view class="cover-view">
@@ -48,7 +48,7 @@
 	import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue"
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import {checkLogin} from '@/api/login.js'
-	import {getLookUpDatas} from '@/api/data.js'
+	import {getMapStoreList} from '@/api/store.js'
 	export default {
 		components: {
 			uniNavBar, uniPopup
@@ -57,8 +57,8 @@
 			return {
 				mapCtx: null, // 地图对象
 				markers: [], // 标注点
-				centerX: '',
-				centerY: '',
+				lng: '',
+				lat: '',
 				markData: [{
 						id: '1',
 						name: '洗车机',
@@ -112,25 +112,8 @@
 		},
 		onLoad() {
 			this.getUserLocation()
-			// 获取订单状态数据字典
-			this.getCodeList('ORDER_STATUS')
-			// 获取支付方式数据字典
-			this.getCodeList('PAY_TYPE')
 		},
 		methods: {
-			// 获取数据字典
-			getCodeList (code) {
-				getLookUpDatas({type:code}).then(res =>{
-					if (res.status == 200) {
-						console.log(res.data,'res.data')
-						if (code == 'ORDER_STATUS') {
-							this.$u.vuex('vuex_payStatus', res.data)
-						} else {
-							this.$u.vuex('vuex_payType', res.data)
-						}
-					}
-				})
-			},
 			// 用户位置信息授权
 			getUserLocation() {
 				let _this = this
@@ -148,8 +131,8 @@
 								},
 								// 用户拒绝授权位置信息时默认展示青海西宁位置地图
 								fail: (err) => {
-									_this.centerX = '101.760521'
-									_this.centerY = '36.636193'
+									_this.lng = '101.760521'
+									_this.lat = '36.636193'
 									_this.markers = _this.getMarkersData()
 								}
 							})
@@ -168,33 +151,52 @@
 						console.log(res,'rrrr')
 						let latitude = res.latitude;
 						let longitude = res.longitude;
-						this.centerX = longitude
-						this.centerY = latitude
+						// this.lng = longitude
+						// this.lat = latitude
+						this.lng = '116.510229'
+						this.lat = '39.848974'
 						this.markers = this.getMarkersData()
 					},
 					// 定位失败默认展示青海西宁位置地图
 					fail: (err) => {
-						this.centerX = '101.760521'
-						this.centerY = '36.636193'
+						this.lng = '101.760521'
+						this.lat = '36.636193'
 						this.markers = this.getMarkersData()
 					}
 				});
 			},
-			// 点击标点获取数据
+			// 点击标点进入网点详情
 			markertap(e) {
 				console.log(e)
 				uni.navigateTo({
 					url: `/pages/store/storeDetail?id=${e.markerId}`
 				})
 			},
-			// 获取标记点数据
+			// 获取所有标记点数据
 			getMarkersData() {
-				let markers = [];
-				for (let item of this.markData) {
-					let marker = this.createMarker(item);
-					markers.push(marker)
+				uni.showLoading({
+					title: '加载中...'
+				})
+				let params = {
+					lat: '39.848974',
+					lng: '116.510229'
 				}
-				return markers;
+				getMapStoreList(params).then(res=>{
+					uni.hideLoading()
+					if (res.status == 200) {
+						this.markData = res.data
+						let markers = [];
+						for (let item of this.markData) {
+							let marker = this.createMarker(item);
+							markers.push(marker)
+						}
+						this.markers = markers
+						console.log(this.markers,'111111')
+					} else {
+						this.toashMsg(res.message)
+					}
+				})
+				
 			},
 			// 点击回到定位坐标点
 			moveToLocation () {
@@ -267,14 +269,14 @@
 					}
 				})
 			},
-			// 创建标记点
+			// 创建标记点 OPEN :正常营业  CLOSED:暂停营业  TO_BE_OPENED:待开业
 			createMarker(point) {
-				let latitude = point.latitude;
-				let longitude = point.longitude;
+				let latitude = point.lat;
+				let longitude = point.lng;
 				let iconPath = ''
-				if (point.status===0) {
+				if (point.businessStatus==='CLOSED') {
 					iconPath = '/static/img/store-dky.png'
-				} else if (point.status===1) {
+				} else if (point.businessStatus==='OPEN') { 
 					iconPath = '/static/img/store.png'
 				} else {
 					iconPath = '/static/img/store-zt.png'

+ 0 - 1
pages/order/order.vue

@@ -88,7 +88,6 @@
 			},
 			// 滚动到底部自动加载下页
 			reachBottom() {
-				console.log(22)
 				if(this.list.length < this.count){
 					this.pageNo += 1
 					this.getList()

+ 3 - 3
pages/order/orderDetail.vue

@@ -28,7 +28,7 @@
 				¥{{orderInfo.payableAmount}}
 			</u-cell-item>
 			<u-cell-item title="优惠价" :arrow="false">
-				{{orderInfo.storeName}}
+				{{orderInfo.couponAmount?orderInfo.couponAmount:0}}
 			</u-cell-item>
 			<u-cell-item title="实付金额" :arrow="false">
 				<text class="order-price">¥{{orderInfo.payStatus=='已支付' ? orderInfo.paymentAmount : 0}}</text>
@@ -36,9 +36,9 @@
 		</u-cell-group>
 		<view class="order-photo">
 			<view>洗车前</view>
-			<u-image width="100%" height="400rpx" :src="src"></u-image>
+			<u-image width="100%" height="400rpx" :src="item.beginImage"></u-image>
 			<view>洗车后</view>
-			<u-image width="100%" height="400rpx" :src="src"></u-image>
+			<u-image width="100%" height="400rpx" :src="item.endImage"></u-image>
 		</view>
 	</view>
 </template>

+ 43 - 14
pages/store/storeDetail.vue

@@ -5,10 +5,10 @@
 				<u-image width="160rpx" height="160rpx" :border-radius="10" src="/static/img/mddef.jpg"></u-image>
 				<view class="store-info">
 					<view class="name">
-						贞观路站
+						{{storeInfo.name}}
 					</view>
 					<view class="address">
-						陕西省西安市未央区北二环贞观路陕西省西安市未央区北二环贞观路
+						{{storeInfo.addrDetail}}
 					</view>
 					<view class="location">
 						<view class="left">
@@ -17,18 +17,15 @@
 						</view>
 						<view class="right">
 							<u-icon class="icon" size="32" name="clock"></u-icon>
-							<text>8:00-22:00 营业</text>
+							<text>{{storeInfo.beginTime}}-{{storeInfo.endTime}} 营业</text>
 						</view>
 					</view>
 				</view>
 			</view>
 			<!-- 网点标签 -->
 			<view class="store-mark">
-				<text class="mark-item">
-					30分钟内免费洗车
-				</text>
-				<text class="mark-item">
-					30分钟内免费洗车
+				<text v-for="(item,index) in storeInfo.labelList" :key="index" class="mark-item">
+					{{item}}
 				</text>
 			</view>
 			<view class="store-server">
@@ -41,12 +38,18 @@
 				<view class="line-title">
 					* 路线指引 *
 				</view>
+				<view class="line-content">
+					{{storeInfo.guidance}}
+				</view>
 			</view>
 			<!-- 温馨提示 -->
 			<view class="store-rich">
 				<view class="line-title">
 					* 温馨提示 *
 				</view>
+				<view class="line-content">
+					{{storeInfo.reminder}}
+				</view>
 			</view>
 		</view>
 		<view class="footer">
@@ -60,16 +63,14 @@
 </template>
 
 <script>
+	import {getStoreDetail} from '@/api/store.js'
 	export default {
 		components: {
 		},
 		data() {
 			return {
 				showPop: false, // 是否显示排队弹窗
-				storeInfo: {
-					latitude: '34.29318',
-					longitude: '108.96712',
-				}
+				storeInfo: {}
 			}
 		},
 		onLoad(option) {
@@ -80,10 +81,38 @@
 		methods: {
 			// 获取网点详情信息
 			getStoreDetail (id) {
+				uni.showLoading({
+					title: '加载中...'
+				})
+				getStoreDetail({id:id}).then(res=>{
+					uni.hideLoading()
+					if (res.status == 200) {
+						this.storeInfo = Object.assign({},res.data)
+						if (this.storeInfo.addrDetail.indexOf("省") > 0 && this.storeInfo.addrDetail.indexOf("市") > 0 && this.storeInfo.addrDetail.indexOf("区") >
+							0) {
+							this.storeInfo.addrDetail = this.storeInfo.addrDetail
+						} else {
+							if (this.storeInfo.addrDetail.indexOf("市") > 0 && this.storeInfo.addrDetail.indexOf("区") > 0) {
+								this.storeInfo.addrDetail = this.storeInfo.addrProvinceName + this.storeInfo.addrDetail
+							} else if (this.storeInfo.addrDetail.indexOf("区") > 0) {
+								this.storeInfo.addrDetail = this.storeInfo.addrProvinceName + this.storeInfo.addrCityName + this.storeInfo.addrDetail
+							} else {
+								this.storeInfo.addrDetail = this.storeInfo.addrProvinceName + this.storeInfo.addrCityName + this.storeInfo.addrDistrictName + this.storeInfo.addrDetail
+							}
+						}
+						this.storeInfo.distance = this.storeInfo.distanct && this.storeInfo.distanct.distance ? Math.round(this.storeInfo.distanct.distance / 1000) : ''
+					} else {
+						this.toashMsg(res.message)
+					}
+				})
+			},
+			// 获取排队情况
+			getWaitPhone () {
 				
 			},
 			// 打开导航位置信息界面
 			openLocation () {
+				let data = this.storeInfo
 				uni.getLocation({
 				    type: 'gcj02', //返回可以用于uni.openLocation的经纬度
 				    success: function (res) {
@@ -92,8 +121,8 @@
 						uni.openLocation({
 							latitude: latitude,
 							longitude: longitude,
-							name: '贞观路站',
-							address: '陕西省西安市未央区北二环贞观路',
+							name: data.name,
+							address: data.addrDetail,
 							success: function () {
 								console.log('success');
 							  }

+ 19 - 54
pages/store/storeList.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
-		<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="reachBottom" @scroll="scroll">
-			<view class="list" @click="intoDetail" v-for="item in storeList" :key="item.id">
+		<scroll-view scroll-y="true" class="scroll-Y">
+			<view class="list" @click="intoDetail(item)" v-for="item in storeList" :key="item.id">
 				<u-image width="160rpx" height="160rpx" :border-radius="10" :src="item.icon?item.icon:'/static/img/mddef.jpg'"></u-image>
 				<view class="store-info">
 					<view class="name">
@@ -17,7 +17,7 @@
 						</view>
 						<view class="right">
 							<u-icon class="icon" size="32" name="clock"></u-icon>
-							<text>{{item.time}} 营业</text>
+							<text>{{item.beginTime}}-{{item.endTime}} 营业</text>
 						</view>
 					</view>
 				</view>
@@ -35,6 +35,7 @@
 
 <script>
 	import uniIcons from "@/components/uni-icons/uni-icons.vue"
+	import {getStoreList} from '@/api/store.js'
 	export default {
 		components: {
 			uniIcons
@@ -43,37 +44,11 @@
 			return {
 				noDataText: '暂无数据',
 				status: 'loadmore',
-				storeList: [{
-						id: 1,
-						icon: '',
-						addrDetail: '陕西省西安市未央区北二环贞观路',
-						name: '贞观路站',
-						distance: 0.1,
-						time: '8:00-22:00',
-						status: 1
-					},
-					{
-						id: 10,
-						icon: '',
-						addrDetail: '陕西省西安市未央区北二环贞观路二环贞观路',
-						name: '贞观路站',
-						distance: 0.1,
-						time: '8:00-22:00',
-						status: 0
-					},
-					{
-						id: 11,
-						icon: '',
-						addrDetail: '陕西省西安市未央区北二环贞观路',
-						name: '贞观路站',
-						distance: 0.1,
-						time: '8:00-22:00',
-						status: 2
-					}
-				],
+				storeList: [],
+				// 用户拒绝授权位置信息时默认展示青海西宁位置地图
 				currentPosition: {
-					lat: '0',
-					lng: '0'
+					lat: '36.636193',
+					lng: '101.760521'
 				},
 				pageNo: 1,
 				pageSize: 10,
@@ -91,7 +66,6 @@
 				success: function(res) {
 					_this.currentPosition.lat = res.latitude;
 					_this.currentPosition.lng = res.longitude;
-					_this.gpsCompletion = true;
 					// 查询门店信息
 					// _this.getStoresList()
 				},
@@ -101,6 +75,7 @@
 					// _this.getStoresList()
 				},
 			});
+			this.getStoresList()
 		},
 
 		computed: {},
@@ -109,16 +84,15 @@
 				this.status = "loading"
 				let lat = this.currentPosition.lat
 				let lng = this.currentPosition.lng
-				getStoresList({
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					lat: lat,
-					lng: lng
+				getStoreList({
+					lat: '39.848974',
+					lng: '116.510229'
 				}).then(res => {
 					console.log(res)
 					uni.hideLoading()
+					this.status = "loadmore"
 					if (res.status == 200) {
-						let list = res.data.list
+						let list = res.data
 						list.map(item => {
 							if (item.addrDetail.indexOf("省") > 0 && item.addrDetail.indexOf("市") > 0 && item.addrDetail.indexOf("区") >
 								0) {
@@ -132,7 +106,7 @@
 									item.addrDetail = item.addrProvinceName + item.addrCityName + item.addrDistrictName + item.addrDetail
 								}
 							}
-							item.distance = item.distance ? Math.round(item.distance / 1000) : ''
+							item.distance = item.distanct && item.distanct.distance ? Math.round(item.distanct.distance / 1000) : ''
 						})
 						this.storeList = this.storeList.concat(list)
 						this.total = res.data.count || 0
@@ -145,14 +119,14 @@
 			},
 			// 获取网点营业状态
 			getStoreStatus(item) {
-				switch (item.status) {
-					case 0:
+				switch (item.businessStatus) {
+					case 'CLOSED':
 						return '/static/img/ygb.png'
 						break;
-					case 1:
+					case 'OPEN':
 						return '/static/img/yyz.png'
 						break;
-					case 2:
+					case 'TO_BE_OPENED':
 						return '/static/img/dky.png'
 						break;
 					default:
@@ -165,15 +139,6 @@
 					url: `/pages/store/storeDetail?id=${item.id}`
 				})
 			},
-			// 到达底部
-			reachBottom() {
-				if(this.storeList.length < this.total){
-					this.pageNo += 1
-					this.getStoresList()
-				}else{
-					this.status = "nomore"
-				}
-			}
 
 		}
 	}

+ 20 - 0
pages/userCenter/index.vue

@@ -27,6 +27,7 @@
 
 <script>
 	import {logout} from '@/api/login.js'
+	import {getLookUpDatas} from '@/api/data.js'
 	export default {
 		data() {
 			return {
@@ -35,7 +36,26 @@
 		},
 		onShow() {
 		},
+		onLoad() {
+			// 获取订单状态数据字典
+			this.getCodeList('ORDER_STATUS')
+			// 获取支付方式数据字典
+			this.getCodeList('PAY_TYPE')
+		},
 		methods:{
+			// 获取数据字典
+			getCodeList (code) {
+				getLookUpDatas({type:code}).then(res =>{
+					if (res.status == 200) {
+						console.log(res.data,'res.data')
+						if (code == 'ORDER_STATUS') {
+							this.$u.vuex('vuex_payStatus', res.data)
+						} else {
+							this.$u.vuex('vuex_payType', res.data)
+						}
+					}
+				})
+			},
 			// 打开对应的页面
 			toPage(index){
 				let pageUrl=['/pages/coupon/index/index','/pages/order/order','/pages/agreement/agreement?fromPage=usercenter']

BIN
static/img/carmore.png


BIN
static/img/cztis.png


BIN
static/img/zyts.png