瀏覽代碼

Merge branch 'master' of http://git.zthymaoyi.com/gongdc/pinche

gongdecai 2 年之前
父節點
當前提交
9e5580ae15

+ 88 - 0
pinche/common/appUpdate.js

@@ -0,0 +1,88 @@
+
+//APP更新
+
+import * as config from '../config'
+export default function appUpdate() {
+		
+	let baseUrlNew = config.def().baseUrlNew
+	console.log('id',plus.runtime.appid)
+	console.log('version',plus.runtime.version)
+	
+	uni.request({
+	    url: 'https://apitest.eliangeyun.com/appVersion/selectInfo',
+	    data: {
+	    	appid: plus.runtime.appid,
+	    	version: plus.runtime.version,
+	    	imei: "1",
+			type:'hz'
+	    },
+	    method: 'GET',
+	    success: (res) => {			
+			console.log(222222222222222222222222222)
+	    	if (res.statusCode === 200) {
+				console.log("uni.request update success",res)
+				plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
+					let client_version = wgtinfo.version
+					var flag_update = client_version.split(".").splice(0, 2).join(".") != res.data.data.version.split(".").splice(0, 2)
+						.join(".")
+					var flag_hot = (Number(client_version.split(".")[2]) < Number(res.data.data.version.split(".")[2])) & !flag_update
+					console.log("client_version",client_version) 
+					console.log("flag_update",flag_update)
+					console.log("flag_hot",flag_hot)
+				
+					if (flag_update) {
+						console.log("更新弹窗")
+						// 提醒用户更新
+						uni.showModal({
+							title: '更新提示',
+							content: res.data.data.note,
+							success: (showResult) => {
+								if (showResult.confirm) {
+									plus.nativeUI.toast("正在准备环境,请稍后!");
+									console.log(res.data.data.url, )
+									var dtask = plus.downloader.createDownload(res.data.data.url, {
+										method: 'GET',
+										filename: '_doc/update/'
+									}, function(d, status) {
+										if (status == 200) {
+											var path = d.filename; //下载apk
+											plus.runtime.install(path); // 自动安装apk文件
+										} else {
+											plus.nativeUI.alert('版本更新失败:' + status);
+										}
+									});
+									dtask.start();
+								}
+							}
+						})
+					} else if (flag_hot) {
+						console.log("热更新") 
+						uni.downloadFile({
+							url: res.data.data.wgtUrl,
+							success: (downloadResult) => {
+								console.log(downloadResult.tempFilePath)
+								if (downloadResult.statusCode === 200) {
+									plus.nativeUI.toast(`正在热更新!${res.data.data.versionCode}`);
+									plus.runtime.install(downloadResult.tempFilePath, {
+										force: false
+									}, function() {
+										plus.nativeUI.toast("热更新成功");
+										plus.runtime.restart();
+									}, function(e) {
+										console.log(e)
+										plus.nativeUI.toast(`热更新失败:${e.message}`);
+									});
+								}
+							}
+						});
+					}
+				
+				});
+	    	}
+	    },fail(res) {
+	    	console.log(222222222222222222222222222)
+			console.log(res)
+	    }
+	})
+
+}

+ 361 - 0
pinche/common/components/uni-rate.vue

@@ -0,0 +1,361 @@
+<template>
+	<view>
+		<view ref="uni-rate" class="uni-rate">
+			<view class="uni-rate__icon" :class="{'uni-cursor-not-allowed': disabled}"
+				:style="{ 'margin-right': marginNumber + 'px' }" v-for="(star, index) in stars" :key="index"
+				@touchstart.stop="touchstart" @touchmove.stop="touchmove" @mousedown.stop="mousedown"
+				@mousemove.stop="mousemove" @mouseleave="mouseleave">
+				<uni-icons :color="color" :size="size" :type="isFill ? 'star-filled' : 'star'" />
+				<!-- #ifdef APP-NVUE -->
+				<view :style="{ width: star.activeWitch.replace('%','')*size/100+'px'}" class="uni-rate__icon-on">
+					<uni-icons style="text-align: left;" :color="disabled?'#ccc':activeColor" :size="size"
+						type="star-filled" />
+				</view>
+				<!-- #endif -->
+				<!-- #ifndef APP-NVUE -->
+				<view :style="{ width: star.activeWitch}" class="uni-rate__icon-on">
+					<uni-icons :color="disabled?disabledColor:activeColor" :size="size" type="star-filled" />
+				</view>
+				<!-- #endif -->
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	// #ifdef APP-NVUE
+	const dom = uni.requireNativePlugin('dom');
+	// #endif
+	/**
+	 * Rate 评分
+	 * @description 评分组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=33
+	 * @property {Boolean} 	isFill = [true|false] 		星星的类型,是否为实心类型, 默认为实心
+	 * @property {String} 	color 						未选中状态的星星颜色,默认为 "#ececec"
+	 * @property {String} 	activeColor 				选中状态的星星颜色,默认为 "#ffca3e"
+	 * @property {String} 	disabledColor 				禁用状态的星星颜色,默认为 "#c0c0c0"
+	 * @property {Number} 	size 						星星的大小
+	 * @property {Number} 	value/v-model 				当前评分
+	 * @property {Number} 	max 						最大评分评分数量,目前一分一颗星
+	 * @property {Number} 	margin 						星星的间距,单位 px
+	 * @property {Boolean} 	disabled = [true|false] 	是否为禁用状态,默认为 false
+	 * @property {Boolean} 	readonly = [true|false] 	是否为只读状态,默认为 false
+	 * @property {Boolean} 	allowHalf = [true|false] 	是否实现半星,默认为 false
+	 * @property {Boolean} 	touchable = [true|false] 	是否支持滑动手势,默认为 true
+	 * @event {Function} change 						uniRate 的 value 改变时触发事件,e={value:Number}
+	 */
+
+	export default {
+		name: "UniRate",
+		props: {
+			isFill: {
+				// 星星的类型,是否镂空
+				type: [Boolean, String],
+				default: true
+			},
+			color: {
+				// 星星未选中的颜色
+				type: String,
+				default: "#ececec"
+			},
+			activeColor: {
+				// 星星选中状态颜色
+				type: String,
+				default: "#ffca3e"
+			},
+			disabledColor: {
+				// 星星禁用状态颜色
+				type: String,
+				default: "#c0c0c0"
+			},
+			size: {
+				// 星星的大小
+				type: [Number, String],
+				default: 24
+			},
+			value: {
+				// 当前评分
+				type: [Number, String],
+				default: 0
+			},
+			modelValue: {
+				// 当前评分
+				type: [Number, String],
+				default: 0
+			},
+			max: {
+				// 最大评分
+				type: [Number, String],
+				default: 5
+			},
+			margin: {
+				// 星星的间距
+				type: [Number, String],
+				default: 0
+			},
+			disabled: {
+				// 是否可点击
+				type: [Boolean, String],
+				default: false
+			},
+			readonly: {
+				// 是否只读
+				type: [Boolean, String],
+				default: false
+			},
+			allowHalf: {
+				// 是否显示半星
+				type: [Boolean, String],
+				default: false
+			},
+			touchable: {
+				// 是否支持滑动手势
+				type: [Boolean, String],
+				default: true
+			}
+		},
+		data() {
+			return {
+				valueSync: "",
+				userMouseFristMove: true,
+				userRated: false,
+				userLastRate: 1
+			};
+		},
+		watch: {
+			value(newVal) {
+				this.valueSync = Number(newVal);
+			},
+			modelValue(newVal) {
+				this.valueSync = Number(newVal);
+			},
+		},
+		computed: {
+			stars() {
+				const value = this.valueSync ? this.valueSync : 0;
+				const starList = [];
+				const floorValue = Math.floor(value);
+				const ceilValue = Math.ceil(value);
+				for (let i = 0; i < this.max; i++) {
+					if (floorValue > i) {
+						starList.push({
+							activeWitch: "100%"
+						});
+					} else if (ceilValue - 1 === i) {
+						starList.push({
+							activeWitch: (value - floorValue) * 100 + "%"
+						});
+					} else {
+						starList.push({
+							activeWitch: "0"
+						});
+					}
+				}
+				return starList;
+			},
+
+			marginNumber() {
+				return Number(this.margin)
+			}
+		},
+		created() {
+			this.valueSync = Number(this.value || this.modelValue);
+			this._rateBoxLeft = 0
+			this._oldValue = null
+		},
+		mounted() {
+			setTimeout(() => {
+				this._getSize()
+			}, 100)
+			// #ifdef H5
+			this.PC = this.IsPC()
+			// #endif
+		},
+		methods: {
+			touchstart(e) {
+				// #ifdef H5
+				if (this.IsPC()) return
+				// #endif
+				if (this.readonly || this.disabled) return
+				const {
+					clientX,
+					screenX
+				} = e.changedTouches[0]
+				// TODO 做一下兼容,只有 Nvue 下才有 screenX,其他平台式 clientX
+				this._getRateCount(clientX || screenX)
+			},
+			touchmove(e) {
+				// #ifdef H5
+				if (this.IsPC()) return
+				// #endif
+				if (this.readonly || this.disabled || !this.touchable) return
+				const {
+					clientX,
+					screenX
+				} = e.changedTouches[0]
+				this._getRateCount(clientX || screenX)
+			},
+
+			/**
+			 * 兼容 PC @tian
+			 */
+
+			mousedown(e) {
+				// #ifdef H5
+				if (!this.IsPC()) return
+				if (this.readonly || this.disabled) return
+				const {
+					clientX,
+				} = e
+				this.userLastRate = this.valueSync
+				this._getRateCount(clientX)
+				this.userRated = true
+				// #endif
+			},
+			mousemove(e) {
+				// #ifdef H5
+				if (!this.IsPC()) return
+				if (this.userRated) return
+				if (this.userMouseFristMove) {
+					console.log('---mousemove----', this.valueSync);
+					this.userLastRate = this.valueSync
+					this.userMouseFristMove = false
+				}
+				if (this.readonly || this.disabled || !this.touchable) return
+				const {
+					clientX,
+				} = e
+				this._getRateCount(clientX)
+				// #endif
+			},
+			mouseleave(e) {
+				// #ifdef H5
+				if (!this.IsPC()) return
+				if (this.readonly || this.disabled || !this.touchable) return
+				if (this.userRated) {
+					this.userRated = false
+					return
+				}
+				this.valueSync = this.userLastRate
+				// #endif
+			},
+			// #ifdef H5
+			IsPC() {
+				var userAgentInfo = navigator.userAgent;
+				var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+				var flag = true;
+				for (let v = 0; v < Agents.length - 1; v++) {
+					if (userAgentInfo.indexOf(Agents[v]) > 0) {
+						flag = false;
+						break;
+					}
+				}
+				return flag;
+			},
+			// #endif
+
+			/**
+			 * 获取星星个数
+			 */
+			_getRateCount(clientX) {
+				this._getSize()
+				const size = Number(this.size)
+				if (size === NaN) {
+					return new Error('size 属性只能设置为数字')
+				}
+				const rateMoveRange = clientX - this._rateBoxLeft
+				let index = parseInt(rateMoveRange / (size + this.marginNumber))
+				index = index < 0 ? 0 : index;
+				index = index > this.max ? this.max : index;
+				const range = parseInt(rateMoveRange - (size + this.marginNumber) * index);
+				let value = 0;
+				if (this._oldValue === index && !this.PC) return;
+				this._oldValue = index;
+				if (this.allowHalf) {
+					if (range > (size / 2)) {
+						value = index + 1
+					} else {
+						value = index + 0.5
+					}
+				} else {
+					value = index + 1
+				}
+
+				value = Math.max(0.5, Math.min(value, this.max))
+				this.valueSync = value
+				this._onChange()
+			},
+
+			/**
+			 * 触发动态修改
+			 */
+			_onChange() {
+
+				this.$emit("input", this.valueSync);
+				this.$emit("update:modelValue", this.valueSync);
+				this.$emit("change", {
+					value: this.valueSync
+				});
+			},
+			/**
+			 * 获取星星距离屏幕左侧距离
+			 */
+			_getSize() {
+				// #ifndef APP-NVUE
+				uni.createSelectorQuery()
+					.in(this)
+					.select('.uni-rate')
+					.boundingClientRect()
+					.exec(ret => {
+						if (ret) {
+							this._rateBoxLeft = ret[0].left
+						}
+					})
+				// #endif
+				// #ifdef APP-NVUE
+				dom.getComponentRect(this.$refs['uni-rate'], (ret) => {
+					const size = ret.size
+					if (size) {
+						this._rateBoxLeft = size.left
+					}
+				})
+				// #endif
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.uni-rate {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		line-height: 1;
+		font-size: 0;
+		flex-direction: row;
+		/* #ifdef H5 */
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-rate__icon {
+		position: relative;
+		line-height: 1;
+		font-size: 0;
+	}
+
+	.uni-rate__icon-on {
+		overflow: hidden;
+		position: absolute;
+		top: 0;
+		left: 0;
+		line-height: 1;
+		text-align: left;
+	}
+
+	.uni-cursor-not-allowed {
+		/* #ifdef H5 */
+		cursor: not-allowed !important;
+		/* #endif */
+	}
+</style>

+ 325 - 0
pinche/common/helper.js

@@ -0,0 +1,325 @@
+import * as config from '../config'
+const rolesList = []
+const ossUploadUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/';
+const chooseImage = {
+	count: '1',
+	sizeType: ['original', 'compressed'],
+	sourceType: ['album'],
+}
+const imgType = '请选择图片来源'
+const imgTypeList = [{
+		name: '相册',
+	},
+	{
+		name: '拍照',
+	}
+]
+const makeValidityPeriod = function(type, name) {
+	//获取当前年
+	let nowDate = new Date();
+	let year = nowDate.getFullYear()
+	let _list = []
+	let _list1 = []
+	// let _list2 = ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]
+	let _list2 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
+	let _list3 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14",
+		"15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
+		"31"
+	]
+	let _ValidityPeriod = []
+	for (let i = 0; i < 30; i++) {
+		_list1.push(year + i)
+	}
+	if (type == 0) {
+		_list1.unshift(name)
+		_list2.unshift('')
+		_list3.unshift('')
+	}
+	_list.push(_list1, _list2, _list3)
+	return _list
+}
+
+const getListByUserId = function() {
+	let baseUrlNew = config.def().baseUrlNew
+	var userInfo = uni.getStorageSync("userInfo")
+	console.log("------", userInfo)
+	if (userInfo) {
+		uni.request({
+			url: baseUrlNew + '/roleMenu/query/getListByUserId',
+			data: {
+				userId: userInfo.id ? userInfo.id : userInfo.data.id
+			},
+			method: 'GET',
+			success: (res) => {
+				if (res.statusCode === 200) {
+					uni.setStorageSync("jurisdiction", res.data.data)
+					let list = getUserAllRoles(res.data.data);
+					uni.setStorageSync("rolesList", list)
+
+				}
+			}
+		})
+	}
+}
+const getUserAllRoles = (item) => {
+	console.log(item)
+
+	for (let i = 0; i < item.length; i++) {
+		rolesList.push(item[i].name)
+		// console.log('用户权限',rolesList)
+		if (item[i].children && item[i].children.length > 0) {
+			getUserAllRoles(item[i].children)
+		}
+	}
+	return rolesList;
+}
+const setAudit = (item) => {
+	let _list = uni.getStorageSync("copyTaskInfo")
+	let _isShowbtn = true
+	if (_list.length == 0) {
+		_isShowbtn = false
+	}
+	for (let i = 0; i < _list.length; i++) {
+		if (_list[i].businessId == item.id) {
+			_list.splice(i, 1)
+			uni.setStorageSync("copyTaskInfo", _list)
+		}
+	}
+	if (_list.length > 0) {
+		uni.navigateTo({
+			url: _list[0].itemUrl + '&isShowbtn=' + _isShowbtn,
+		})
+	}
+	console.log(item)
+}
+const contactCustomerService = (item) => {
+	console.log(item)
+	if (!item) {
+		item = '110'
+	}
+	console.log("联系客服")
+	uni.makePhoneCall({
+		phoneNumber: item,
+		success: (res) => {
+			console.log('调用成功!')
+		},
+		// 失败回调
+		fail: (res) => {
+			console.log('调用失败!')
+			contactCustomerService(item)
+		}
+	});
+}
+// 获取市、区简称
+const filterUrban = (s) => {
+	if (s.lastIndexOf('市') != -1) {
+		return s.substring(0, s.length - 1)
+	}
+	return s
+}
+const filterArea = (q) => {
+	if (q.lastIndexOf('区') != -1) {
+		return q.substring(0, q.length - 1)
+	}
+	return q
+}
+// const getAddress = (item) => {
+// 	let regex = "(?<province>[^省]+省|.+自治区)(?<city>[^自治州]+自治州|[^市]+市|[^盟]+盟|[^地区]+地区|.+区划)(?<county>[^市]+市|[^县]+县|[^旗]+旗|.+区)?(?<town>[^区]+区|.+镇)?(?<village>.*)";
+// 	return item.match(regex).groups
+// }
+
+const formatLocation = (str) => {
+	// console.log('``````')
+	// console.log(str)
+	let area = {}
+	let index11 = 0
+	let index1 = str.indexOf("省")
+	if (index1 == -1) {
+		index11 = str.indexOf("自治区")
+		if (index11 != -1) {
+			area.Province = str.substring(0, index11 + 3)
+		} else {
+			area.Province = str.substring(0, 0)
+		}
+	} else {
+		area.Province = str.substring(0, index1 + 1)
+	}
+
+	let index2 = str.indexOf("市")
+	if (index11 == -1) {
+		area.City = str.substring(index11 + 1, index2 + 1)
+	} else {
+		if (index11 == 0) {
+			area.City = str.substring(index1 + 1, index2 + 1)
+		} else {
+			area.City = str.substring(index11 + 3, index2 + 1)
+		}
+	}
+
+	let index3 = str.indexOf("区")
+	if (index3 == -1) {
+		index3 = str.indexOf("县")
+		area.Country = str.substring(index2 + 1, index3 + 1)
+	} else {
+		area.Country = str.substring(index2 + 1, index3 + 1)
+	}
+	area.Village = str.substring(index3 + 1, str.length)
+	return area;
+}
+
+
+
+//获取省份简称
+const getProvinceAbbreviation = (province) => {
+	// console.log(province)
+	if (province == "北京市" || province == "北京")
+		return "京";
+	else if (province == "天津市" || province == "天津")
+		return "津";
+	else if (province == "重庆市" || province == "重庆")
+		return "渝";
+	else if (province == "上海市" || province == "上海")
+		return "沪";
+	else if (province == "河北省" || province == "河北")
+		return "冀";
+	else if (province == "山西省" || province == "山西")
+		return "晋";
+	else if (province == "辽宁省" || province == "辽宁")
+		return "辽";
+	else if (province == "吉林省" || province == "吉林")
+		return "吉";
+	else if (province == "黑龙江省" || province == "黑龙江")
+		return "黑";
+	else if (province == "江苏省" || province == "江苏")
+		return "苏";
+	else if (province == "浙江省" || province == "浙江")
+		return "浙";
+	else if (province == "安徽省" || province == "安徽")
+		return "皖";
+	else if (province == "福建省" || province == "福建")
+		return "闽";
+	else if (province == "江西省" || province == "江西")
+		return "赣";
+	else if (province == "山东省" || province == "山东")
+		return "鲁";
+	else if (province == "河南省" || province == "河南")
+		return "豫";
+	else if (province == "湖北省" || province == "湖北")
+		return "鄂";
+	else if (province == "湖南省" || province == "湖南")
+		return "湘";
+	else if (province == "广东省" || province == "广东")
+		return "粤";
+	else if (province == "海南省" || province == "海南")
+		return "琼";
+	else if (province == "四川省" || province == "四川")
+		return "川";
+	else if (province == "贵州省" || province == "贵州")
+		return "贵";
+	else if (province == "云南省" || province == "云南")
+		return "云";
+	else if (province == "陕西省" || province == "陕西")
+		return "陕";
+	else if (province == "甘肃省" || province == "甘肃")
+		return "甘";
+	else if (province == "青海省" || province == "青海")
+		return "青";
+	else if (province == "台湾省" || province == "台湾")
+		return "台";
+	else if (province == "内蒙古自治区" || province == "内蒙古")
+		return "蒙";
+	else if (province == "广西壮族自治区" || province == "广西")
+		return "桂";
+	else if (province == "宁夏回族自治区" || province == "宁夏")
+		return "宁";
+	else if (province == "新疆维吾尔自治区" || province == "新疆")
+		return "新";
+	else if (province == "西藏自治区" || province == "西藏")
+		return "藏";
+	else if (province == "香港特别行政区" || province == "香港")
+		return "港";
+	else if (province == "澳门特别行政区" || province == "澳门")
+		return "澳";
+
+}
+const getDistance = (lat1, lng1, lat2, lng2) => {
+	function Rad(d) {
+		return d * Math.PI / 180.0;
+	}
+	if (!lat1 || !lng1) {
+		return '';
+	}
+	// lat1用户的纬度
+	// lng1用户的经度
+	// lat2商家的纬度
+	// lng2商家的经度
+	let radLat1 = Rad(lat1);
+	let radLat2 = Rad(lat2);
+	let a = radLat1 - radLat2;
+	let b = Rad(lng1) - Rad(lng2);
+	let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) *
+		Math.pow(
+			Math.sin(b / 2), 2)));
+	s = s * 6378.137;
+	s = Math.round(s * 10000) / 10000;
+	s = s.toFixed(2) //保留两位小数
+	return s
+}
+const logout = () => {
+	uni.removeStorage({
+		key: 'userInfo'
+	})
+}
+const haveUser = () => {
+	if (uni.getStorageSync("userInfo").phone) return uni.getStorageSync("userInfo")
+	return false
+}
+
+const formatDate = (value) => {
+	var date = new Date(value);
+	var y = date.getFullYear(),
+		m = date.getMonth() + 1,
+		d = date.getDate()
+	// h = date.getHours(),
+	// i = date.getMinutes(),
+	// s = date.getSeconds();
+	if (m < 10) {
+		m = '0' + m;
+	}
+	if (d < 10) {
+		d = '0' + d;
+	}
+	// if (h < 10) {
+	// 	h = '0' + h;
+	// }
+	// if (i < 10) {
+	// 	i = '0' + i;
+	// }
+	// if (s < 10) {
+	// 	s = '0' + s;
+	// }
+	// var t = y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
+	var t = y + '-' + m + '-' + d;
+	return t;
+}
+
+export default {
+	getListByUserId,
+	setAudit,
+	ossUploadUrl,
+	contactCustomerService,
+	chooseImage,
+	imgType,
+	imgTypeList,
+	makeValidityPeriod,
+	getProvinceAbbreviation,
+	// getAddress,
+	formatLocation,
+	getDistance,
+	logout,
+	filterUrban,
+	filterArea,
+	formatDate,
+	haveUser
+
+}

+ 2 - 2
pinche/config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	baseUrlNew: 'http://121.5.163.150:8181',
-	// baseUrlNew: 'http://192.168.110.67:8081',
+	// baseUrlNew: 'http://121.5.163.150:8181',
+	baseUrlNew: 'http://192.168.110.82:8099',
 	// baseUrlNew: 'https://api.thesunbelt.shop',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false

+ 0 - 0
pinche/js_sdk/js-amap/__MACOSX/amap-wx.130.js


+ 31 - 0
pinche/js_sdk/js-amap/amap-wx.130.js

@@ -0,0 +1,31 @@
+function AMapWX(a){this.key=a.key;this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};this.MeRequestConfig={key:a.key,serviceName:"https://restapi.amap.com/rest/me"}}
+AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(c){c=c.longitude+","+c.latitude;wx.setStorage({key:"userLocation",data:c});b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(d){d.data&&b(d.data)}});a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getMEKeywordsSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.city&&(d.city=b.city);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);b.sig&&(d.sig=
+b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/local",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEIdSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.id&&(d.id=b.id);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/id",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&
+0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEPolygonSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.polygon&&(d.polygon=b.polygon);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);
+b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/polygon",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEaroundSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.center&&(d.center=b.center);b.radius&&(d.radius=b.radius);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&
+(d.pageSize=b.pageSize);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/around",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getGeo=function(a){var b=this.requestConfig,c=a.options;b={key:this.key,extensions:"all",s:b.s,platform:b.platform,appname:this.key,sdkversion:b.sdkversion,logversion:b.logversion};c.address&&(b.address=c.address);c.city&&(b.city=c.city);c.batch&&(b.batch=c.batch);c.sig&&(b.sig=c.sig);wx.request({url:"https://restapi.amap.com/v3/geocode/geo",data:b,method:"GET",header:{"content-type":"application/json"},success:function(d){(d=d.data)&&d.status&&"1"===d.status?a.success(d):a.fail({errCode:"0",
+errMsg:d})},fail:function(d){a.fail({errCode:"0",errMsg:d.errMsg||""})}})};
+AMapWX.prototype.getRegeo=function(a){function b(d){var e=c.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:c.key,location:d,extensions:"all",s:e.s,platform:e.platform,appname:c.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){g=g.data.regeocode;var h=g.addressComponent,f=[],k=g.roads[0].name+"\u9644\u8fd1",m=d.split(",")[0],n=d.split(",")[1];if(g.pois&&
+g.pois[0]){k=g.pois[0].name+"\u9644\u8fd1";var l=g.pois[0].location;l&&(m=parseFloat(l.split(",")[0]),n=parseFloat(l.split(",")[1]))}h.provice&&f.push(h.provice);h.city&&f.push(h.city);h.district&&f.push(h.district);h.streetNumber&&h.streetNumber.street&&h.streetNumber.number?(f.push(h.streetNumber.street),f.push(h.streetNumber.number)):f.push(g.roads[0].name);f=f.join("");a.success([{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:k,longitude:m,latitude:n,id:0,regeocodeData:g}])}else a.fail({errCode:g.data.infocode,
+errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this;a.location?b(a.location):c.getWxLocation(a,function(d){b(d)})};
+AMapWX.prototype.getWeather=function(a){function b(g){var h="base";a.type&&"forecast"==a.type&&(h="all");wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:d.key,city:g,extensions:h,s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(f){if(f.data.status&&"1"==f.data.status)if(f.data.lives){if((f=f.data.lives)&&0<f.length){f=f[0];var k={city:{text:"\u57ce\u5e02",data:f.city},
+weather:{text:"\u5929\u6c14",data:f.weather},temperature:{text:"\u6e29\u5ea6",data:f.temperature},winddirection:{text:"\u98ce\u5411",data:f.winddirection+"\u98ce"},windpower:{text:"\u98ce\u529b",data:f.windpower+"\u7ea7"},humidity:{text:"\u6e7f\u5ea6",data:f.humidity+"%"}};k.liveData=f;a.success(k)}}else f.data.forecasts&&f.data.forecasts[0]&&a.success({forecast:f.data.forecasts[0]});else a.fail({errCode:f.data.infocode,errMsg:f.data.info})},fail:function(f){a.fail({errCode:"0",errMsg:f.errMsg||""})}})}
+function c(g){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:d.key,location:g,extensions:"all",s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(h){if(h.data.status&&"1"==h.data.status){h=h.data.regeocode;if(h.addressComponent)var f=h.addressComponent.adcode;else h.aois&&0<h.aois.length&&(f=h.aois[0].adcode);b(f)}else a.fail({errCode:h.data.infocode,errMsg:h.data.info})},
+fail:function(h){a.fail({errCode:"0",errMsg:h.errMsg||""})}})}var d=this,e=d.requestConfig;a.city?b(a.city):d.getWxLocation(a,function(g){c(g)})};
+AMapWX.prototype.getPoiAround=function(a){function b(e){e={key:c.key,location:e,s:d.s,platform:d.platform,appname:c.key,sdkversion:d.sdkversion,logversion:d.logversion};a.querytypes&&(e.types=a.querytypes);a.querykeywords&&(e.keywords=a.querykeywords);wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){if((g=g.data)&&g.pois){for(var h=[],f=0;f<g.pois.length;f++){var k=0==
+f?a.iconPathSelected:a.iconPath;h.push({latitude:parseFloat(g.pois[f].location.split(",")[1]),longitude:parseFloat(g.pois[f].location.split(",")[0]),iconPath:k,width:22,height:32,id:f,name:g.pois[f].name,address:g.pois[f].address})}a.success({markers:h,poisData:g.pois})}}else a.fail({errCode:g.data.infocode,errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this,d=c.requestConfig;a.location?b(a.location):c.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getStaticmap=function(a){function b(e){c.push("location="+e);a.zoom&&c.push("zoom="+a.zoom);a.size&&c.push("size="+a.size);a.scale&&c.push("scale="+a.scale);a.markers&&c.push("markers="+a.markers);a.labels&&c.push("labels="+a.labels);a.paths&&c.push("paths="+a.paths);a.traffic&&c.push("traffic="+a.traffic);e="https://restapi.amap.com/v3/staticmap?"+c.join("&");a.success({url:e})}var c=[];c.push("key="+this.key);var d=this.requestConfig;c.push("s="+d.s);c.push("platform="+d.platform);
+c.push("appname="+d.appname);c.push("sdkversion="+d.sdkversion);c.push("logversion="+d.logversion);a.location?b(a.location):this.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getInputtips=function(a){var b=Object.assign({},this.requestConfig);a.location&&(b.location=a.location);a.keywords&&(b.keywords=a.keywords);a.type&&(b.type=a.type);a.city&&(b.city=a.city);a.citylimit&&(b.citylimit=a.citylimit);wx.request({url:"https://restapi.amap.com/v3/assistant/inputtips",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.tips&&a.success({tips:c.data.tips})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||
+""})}})};
+AMapWX.prototype.getDrivingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.waypoints&&(b.waypoints=a.waypoints);a.avoidpolygons&&(b.avoidpolygons=a.avoidpolygons);a.avoidroad&&(b.avoidroad=a.avoidroad);wx.request({url:"https://restapi.amap.com/v3/direction/driving",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths,
+taxi_cost:c.data.route.taxi_cost||""})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getWalkingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/walking",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getTransitRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.city&&(b.city=a.city);a.cityd&&(b.cityd=a.cityd);wx.request({url:"https://restapi.amap.com/v3/direction/transit/integrated",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&(c=c.data.route,a.success({distance:c.distance||"",taxi_cost:c.taxi_cost||
+"",transits:c.transits}))},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getRidingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/riding",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};module.exports.AMapWX=AMapWX;

+ 1122 - 0
pinche/js_sdk/qqmap-wx-jssdk.js

@@ -0,0 +1,1122 @@
+/**
+ * 微信小程序JavaScriptSDK
+ * 
+ * @version 1.2
+ * @date 2019-03-06
+ */
+
+var ERROR_CONF = {
+    KEY_ERR: 311,
+    KEY_ERR_MSG: 'key格式错误',
+    PARAM_ERR: 310,
+    PARAM_ERR_MSG: '请求参数信息有误',
+    SYSTEM_ERR: 600,
+    SYSTEM_ERR_MSG: '系统错误',
+    WX_ERR_CODE: 1000,
+    WX_OK_CODE: 200
+};
+var BASE_URL = 'https://apis.map.qq.com/ws/';
+var URL_SEARCH = BASE_URL + 'place/v1/search';
+var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
+var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
+var URL_CITY_LIST = BASE_URL + 'district/v1/list';
+var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
+var URL_DISTANCE = BASE_URL + 'distance/v1/';
+var URL_DIRECTION = BASE_URL + 'direction/v1/';
+var MODE = {
+  driving: 'driving',
+  transit: 'transit'
+};
+var EARTH_RADIUS = 6378136.49;
+var Utils = {
+  /**
+  * md5加密方法
+  * 版权所有©2011 Sebastian Tschan,https://blueimp.net
+  */
+  safeAdd(x, y) {
+    var lsw = (x & 0xffff) + (y & 0xffff);
+    var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+    return (msw << 16) | (lsw & 0xffff);
+  },
+  bitRotateLeft(num, cnt) {
+    return (num << cnt) | (num >>> (32 - cnt));
+  },
+  md5cmn(q, a, b, x, s, t) {
+    return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b);
+  },
+  md5ff(a, b, c, d, x, s, t) {
+    return this.md5cmn((b & c) | (~b & d), a, b, x, s, t);
+  },
+  md5gg(a, b, c, d, x, s, t) {
+    return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t);
+  },
+  md5hh(a, b, c, d, x, s, t) {
+    return this.md5cmn(b ^ c ^ d, a, b, x, s, t);
+  },
+  md5ii(a, b, c, d, x, s, t) {
+    return this.md5cmn(c ^ (b | ~d), a, b, x, s, t);
+  },
+  binlMD5(x, len) {
+    /* append padding */
+    x[len >> 5] |= 0x80 << (len % 32);
+    x[((len + 64) >>> 9 << 4) + 14] = len;
+
+    var i;
+    var olda;
+    var oldb;
+    var oldc;
+    var oldd;
+    var a = 1732584193;
+    var b = -271733879;
+    var c = -1732584194;
+    var d = 271733878;
+
+    for (i = 0; i < x.length; i += 16) {
+      olda = a;
+      oldb = b;
+      oldc = c;
+      oldd = d;
+
+      a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
+      d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
+      c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
+      b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
+      a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
+      d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
+      c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
+      b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
+      a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
+      d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
+      c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
+      b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
+      a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
+      d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
+      c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
+      b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
+
+      a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
+      d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
+      c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
+      b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
+      a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
+      d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
+      c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
+      b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
+      a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
+      d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
+      c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
+      b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
+      a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
+      d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
+      c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
+      b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
+
+      a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
+      d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
+      c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
+      b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
+      a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
+      d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
+      c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
+      b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
+      a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
+      d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
+      c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
+      b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
+      a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
+      d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
+      c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
+      b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
+
+      a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
+      d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
+      c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
+      b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
+      a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
+      d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
+      c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
+      b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
+      a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
+      d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
+      c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
+      b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
+      a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
+      d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
+      c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
+      b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
+
+      a = this.safeAdd(a, olda);
+      b = this.safeAdd(b, oldb);
+      c = this.safeAdd(c, oldc);
+      d = this.safeAdd(d, oldd);
+    }
+    return [a, b, c, d];
+  },
+  binl2rstr(input) {
+    var i;
+    var output = '';
+    var length32 = input.length * 32;
+    for (i = 0; i < length32; i += 8) {
+      output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
+    }
+    return output;
+  },
+  rstr2binl(input) {
+    var i;
+    var output = [];
+    output[(input.length >> 2) - 1] = undefined;
+    for (i = 0; i < output.length; i += 1) {
+      output[i] = 0;
+    }
+    var length8 = input.length * 8;
+    for (i = 0; i < length8; i += 8) {
+      output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
+    }
+    return output;
+  },
+  rstrMD5(s) {
+    return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8));
+  },
+  rstrHMACMD5(key, data) {
+    var i;
+    var bkey = this.rstr2binl(key);
+    var ipad = [];
+    var opad = [];
+    var hash;
+    ipad[15] = opad[15] = undefined;
+    if (bkey.length > 16) {
+      bkey = this.binlMD5(bkey, key.length * 8);
+    }
+    for (i = 0; i < 16; i += 1) {
+      ipad[i] = bkey[i] ^ 0x36363636;
+      opad[i] = bkey[i] ^ 0x5c5c5c5c;
+    }
+    hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
+    return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128));
+  },
+  rstr2hex(input) {
+    var hexTab = '0123456789abcdef';
+    var output = '';
+    var x;
+    var i;
+    for (i = 0; i < input.length; i += 1) {
+      x = input.charCodeAt(i);
+      output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
+    }
+    return output;
+  },
+  str2rstrUTF8(input) {
+    return unescape(encodeURIComponent(input));
+  },
+  rawMD5(s) {
+    return this.rstrMD5(this.str2rstrUTF8(s));
+  },
+  hexMD5(s) {
+    return this.rstr2hex(this.rawMD5(s));
+  },
+  rawHMACMD5(k, d) {
+    return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d));
+  },
+  hexHMACMD5(k, d) {
+    return this.rstr2hex(this.rawHMACMD5(k, d));
+  },
+
+  md5(string, key, raw) {
+    if (!key) {
+      if (!raw) {
+        return this.hexMD5(string);
+      }
+      return this.rawMD5(string);
+    }
+    if (!raw) {
+      return this.hexHMACMD5(key, string);
+    }
+    return this.rawHMACMD5(key, string);
+  },
+  /**
+   * 得到md5加密后的sig参数
+   * @param {Object} requestParam 接口参数
+   * @param {String} sk签名字符串
+   * @param {String} featrue 方法名
+   * @return 返回加密后的sig参数
+   */
+  getSig(requestParam, sk, feature, mode) {
+    var sig = null;
+    var requestArr = [];
+    Object.keys(requestParam).sort().forEach(function(key){
+      requestArr.push(key + '=' + requestParam[key]);
+    });
+    if (feature == 'search') {
+      sig = '/ws/place/v1/search?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'suggest') {
+      sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'reverseGeocoder') {
+      sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'geocoder') {
+      sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'getCityList') {
+      sig = '/ws/district/v1/list?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'getDistrictByCityId') {
+      sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'calculateDistance') {
+      sig = '/ws/distance/v1/?' + requestArr.join('&') + sk;
+    }
+    if (feature == 'direction') {
+      sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk;
+    }
+    sig = this.md5(sig);
+    return sig;
+  },
+    /**
+     * 得到终点query字符串
+     * @param {Array|String} 检索数据
+     */
+    location2query(data) {
+        if (typeof data == 'string') {
+            return data;
+        }
+        var query = '';
+        for (var i = 0; i < data.length; i++) {
+            var d = data[i];
+            if (!!query) {
+                query += ';';
+            }
+            if (d.location) {
+                query = query + d.location.lat + ',' + d.location.lng;
+            }
+            if (d.latitude && d.longitude) {
+                query = query + d.latitude + ',' + d.longitude;
+            }
+        }
+        return query;
+    },
+
+    /**
+     * 计算角度
+     */
+    rad(d) {
+      return d * Math.PI / 180.0;
+    },  
+    /**
+     * 处理终点location数组
+     * @return 返回终点数组
+     */
+    getEndLocation(location){
+      var to = location.split(';');
+      var endLocation = [];
+      for (var i = 0; i < to.length; i++) {
+        endLocation.push({
+          lat: parseFloat(to[i].split(',')[0]),
+          lng: parseFloat(to[i].split(',')[1])
+        })
+      }
+      return endLocation;
+    },
+
+    /**
+     * 计算两点间直线距离
+     * @param a 表示纬度差
+     * @param b 表示经度差
+     * @return 返回的是距离,单位m
+     */
+    getDistance(latFrom, lngFrom, latTo, lngTo) {
+      var radLatFrom = this.rad(latFrom);
+      var radLatTo = this.rad(latTo);
+      var a = radLatFrom - radLatTo;
+      var b = this.rad(lngFrom) - this.rad(lngTo);
+      var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+      distance = distance * EARTH_RADIUS;
+      distance = Math.round(distance * 10000) / 10000;
+      return parseFloat(distance.toFixed(0));
+    },
+    /**
+     * 使用微信接口进行定位
+     */
+    getWXLocation(success, fail, complete) {
+        wx.getLocation({
+            type: 'gcj02',
+            success: success,
+            fail: fail,
+            complete: complete
+        });
+    },
+
+    /**
+     * 获取location参数
+     */
+    getLocationParam(location) {
+        if (typeof location == 'string') {
+            var locationArr = location.split(',');
+            if (locationArr.length === 2) {
+                location = {
+                    latitude: location.split(',')[0],
+                    longitude: location.split(',')[1]
+                };
+            } else {
+                location = {};
+            }
+        }
+        return location;
+    },
+
+    /**
+     * 回调函数默认处理
+     */
+    polyfillParam(param) {
+        param.success = param.success || function () { };
+        param.fail = param.fail || function () { };
+        param.complete = param.complete || function () { };
+    },
+
+    /**
+     * 验证param对应的key值是否为空
+     * 
+     * @param {Object} param 接口参数
+     * @param {String} key 对应参数的key
+     */
+    checkParamKeyEmpty(param, key) {
+        if (!param[key]) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return true;
+        }
+        return false;
+    },
+
+    /**
+     * 验证参数中是否存在检索词keyword
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkKeyword(param){
+        return !this.checkParamKeyEmpty(param, 'keyword');
+    },
+
+    /**
+     * 验证location值
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkLocation(param) {
+        var location = this.getLocationParam(param.location);
+        if (!location || !location.latitude || !location.longitude) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return false;
+        }
+        return true;
+    },
+
+    /**
+     * 构造错误数据结构
+     * @param {Number} errCode 错误码
+     * @param {Number} errMsg 错误描述
+     */
+    buildErrorConfig(errCode, errMsg) {
+        return {
+            status: errCode,
+            message: errMsg
+        };
+    },
+
+    /**
+     * 
+     * 数据处理函数
+     * 根据传入参数不同处理不同数据
+     * @param {String} feature 功能名称
+     * search 地点搜索
+     * suggest关键词提示
+     * reverseGeocoder逆地址解析
+     * geocoder地址解析
+     * getCityList获取城市列表:父集
+     * getDistrictByCityId获取区县列表:子集
+     * calculateDistance距离计算
+     * @param {Object} param 接口参数
+     * @param {Object} data 数据
+     */
+    handleData(param,data,feature){
+      if (feature == 'search') {
+        var searchResult = data.data;
+        var searchSimplify = [];
+        for (var i = 0; i < searchResult.length; i++) {
+          searchSimplify.push({
+            id: searchResult[i].id || null,
+            title: searchResult[i].title || null,
+            latitude: searchResult[i].location && searchResult[i].location.lat || null,
+            longitude: searchResult[i].location && searchResult[i].location.lng || null,
+            address: searchResult[i].address || null,
+            category: searchResult[i].category || null,
+            tel: searchResult[i].tel || null,
+            adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+            city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+            district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+            province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+          })
+        }
+        param.success(data, {
+          searchResult: searchResult,
+          searchSimplify: searchSimplify
+        })
+      } else if (feature == 'suggest') {
+        var suggestResult = data.data;
+        var suggestSimplify = [];
+        for (var i = 0; i < suggestResult.length; i++) {
+          suggestSimplify.push({
+            adcode: suggestResult[i].adcode || null,
+            address: suggestResult[i].address || null,
+            category: suggestResult[i].category || null,
+            city: suggestResult[i].city || null,
+            district: suggestResult[i].district || null,
+            id: suggestResult[i].id || null,
+            latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+            longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+            province: suggestResult[i].province || null,
+            title: suggestResult[i].title || null,
+            type: suggestResult[i].type || null
+          })
+        }
+        param.success(data, {
+          suggestResult: suggestResult,
+          suggestSimplify: suggestSimplify
+          })
+      } else if (feature == 'reverseGeocoder') {
+        var reverseGeocoderResult = data.result;
+        var reverseGeocoderSimplify = {
+          address: reverseGeocoderResult.address || null,
+          latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+          longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+          adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+          city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+          district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+          nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+          province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+          street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+          street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+          recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+          rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+        };
+        if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+          var pois = reverseGeocoderResult.pois;
+          var poisSimplify = [];
+          for (var i = 0;i < pois.length;i++) {
+            poisSimplify.push({
+              id: pois[i].id || null,
+              title: pois[i].title || null,
+              latitude: pois[i].location && pois[i].location.lat || null,
+              longitude: pois[i].location && pois[i].location.lng || null,
+              address: pois[i].address || null,
+              category: pois[i].category || null,
+              adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+              city: pois[i].ad_info && pois[i].ad_info.city || null,
+              district: pois[i].ad_info && pois[i].ad_info.district || null,
+              province: pois[i].ad_info && pois[i].ad_info.province || null
+            })
+          }
+          param.success(data,{
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify,
+            pois: pois,
+            poisSimplify: poisSimplify
+          })
+        } else {
+          param.success(data, {
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify
+          })
+        }
+      } else if (feature == 'geocoder') {
+        var geocoderResult = data.result;
+        var geocoderSimplify = {
+          title: geocoderResult.title || null,
+          latitude: geocoderResult.location && geocoderResult.location.lat || null,
+          longitude: geocoderResult.location && geocoderResult.location.lng || null,
+          adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+          province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+          city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+          district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+          street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+          street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+          level: geocoderResult.level || null
+        };
+        param.success(data,{
+          geocoderResult: geocoderResult,
+          geocoderSimplify: geocoderSimplify
+        });
+      } else if (feature == 'getCityList') {
+        var provinceResult = data.result[0];
+        var cityResult = data.result[1];
+        var districtResult = data.result[2];
+        param.success(data,{
+          provinceResult: provinceResult,
+          cityResult: cityResult,
+          districtResult: districtResult
+        });
+      } else if (feature == 'getDistrictByCityId') {
+        var districtByCity = data.result[0];
+        param.success(data, districtByCity);
+      } else if (feature == 'calculateDistance') {
+        var calculateDistanceResult = data.result.elements;  
+        var distance = [];
+        for (var i = 0; i < calculateDistanceResult.length; i++){
+          distance.push(calculateDistanceResult[i].distance);
+        }   
+        param.success(data, {
+          calculateDistanceResult: calculateDistanceResult,
+          distance: distance
+          });
+      } else if (feature == 'direction') {
+        var direction = data.result.routes;
+        param.success(data,direction);
+      } else {
+        param.success(data);
+      }
+    },
+
+    /**
+     * 构造微信请求参数,公共属性处理
+     * 
+     * @param {Object} param 接口参数
+     * @param {Object} param 配置项
+     * @param {String} feature 方法名
+     */
+    buildWxRequestConfig(param, options, feature) {
+        var that = this;
+        options.header = { "content-type": "application/json" };
+        options.method = 'GET';
+        options.success = function (res) {
+            var data = res.data;
+            if (data.status === 0) {
+              that.handleData(param, data, feature);
+            } else {
+                param.fail(data);
+            }
+        };
+        options.fail = function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        options.complete = function (res) {
+            var statusCode = +res.statusCode;
+            switch(statusCode) {
+                case ERROR_CONF.WX_ERR_CODE: {
+                    param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+                    break;
+                }
+                case ERROR_CONF.WX_OK_CODE: {
+                    var data = res.data;
+                    if (data.status === 0) {
+                        param.complete(data);
+                    } else {
+                        param.complete(that.buildErrorConfig(data.status, data.message));
+                    }
+                    break;
+                }
+                default:{
+                    param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+                }
+
+            }
+        };
+        return options;
+    },
+
+    /**
+     * 处理用户参数是否传入坐标进行不同的处理
+     */
+    locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+        var that = this;
+        locationfail = locationfail || function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        locationcomplete = locationcomplete || function (res) {
+            if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+                param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+            }
+        };
+        if (!param.location) {
+            that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+        } else if (that.checkLocation(param)) {
+            var location = Utils.getLocationParam(param.location);
+            locationsuccess(location);
+        }
+    }
+};
+
+
+class QQMapWX {
+
+    /**
+     * 构造函数
+     * 
+     * @param {Object} options 接口参数,key 为必选参数
+     */
+    constructor(options) {
+        if (!options.key) {
+            throw Error('key值不能为空');
+        }
+        this.key = options.key;
+    };
+
+    /**
+     * POI周边检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * @see http://lbs.qq.com/webservice_v1/guide-search.html
+     */
+    search(options) {
+        var that = this;
+        options = options || {};
+
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            orderby: options.orderby || '_distance',
+            page_size: options.page_size || 10,
+            page_index: options.page_index || 1,
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.address_format) {
+            requestParam.address_format = options.address_format;
+        }
+
+        if (options.filter) {
+            requestParam.filter = options.filter;
+        }
+
+        var distance = options.distance || "1000";
+        var auto_extend = options.auto_extend || 1;
+        var region = null;
+        var rectangle = null;
+
+        //判断城市限定参数
+        if (options.region) {
+          region = options.region;
+        }
+
+        //矩形限定坐标(暂时只支持字符串格式)
+        if (options.rectangle) {
+          rectangle = options.rectangle;
+        }
+
+        var locationsuccess = function (result) {        
+          if (region && !rectangle) {
+            //城市限定参数拼接
+            requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+            if (options.sig) {
+              requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+            }
+          } else if (rectangle && !region) {
+            //矩形搜索
+            requestParam.boundary = "rectangle(" + rectangle + ")";
+            if (options.sig) {
+              requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+            }
+            } else {
+              requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+            if (options.sig) {
+              requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+            }
+            }            
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_SEARCH,
+                data: requestParam
+            }, 'search'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * sug模糊检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+     */
+    getSuggestion(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            region: options.region || '全国',
+            region_fix: options.region_fix || 0,
+            policy: options.policy || 0,
+            page_size: options.page_size || 10,//控制显示条数
+            page_index: options.page_index || 1,//控制页数
+            get_subpois : options.get_subpois || 0,//返回子地点
+            output: 'json',
+            key: that.key
+        };
+        //长地址
+        if (options.address_format) {
+          requestParam.address_format = options.address_format;
+        }
+        //过滤
+        if (options.filter) {
+          requestParam.filter = options.filter;
+        }
+        //排序
+        if (options.location) {
+          var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+            if (options.sig) {
+              requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+            }
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_SUGGESTION,
+              data: requestParam
+            }, "suggest"));      
+          };
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          if (options.sig) {
+            requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+          }
+          wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_SUGGESTION,
+            data: requestParam
+          }, "suggest"));      
+        }        
+    };
+
+    /**
+     * 逆地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+     */
+    reverseGeocoder(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            coord_type: options.coord_type || 5,
+            get_poi: options.get_poi || 0,
+            output: 'json',
+            key: that.key
+        };
+        if (options.poi_options) {
+            requestParam.poi_options = options.poi_options
+        }
+
+        var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+          if (options.sig) {
+            requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder');
+          }
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_GET_GEOCODER,
+                data: requestParam
+            }, 'reverseGeocoder'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * 地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+     */
+    geocoder(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'address')) {
+            return;
+        }
+
+        var requestParam = {
+            address: options.address,
+            output: 'json',
+            key: that.key
+        };
+
+        //城市限定
+        if (options.region) {
+          requestParam.region = options.region;
+        }
+
+        if (options.sig) {
+          requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder');
+        }
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_GET_GEOCODER,
+            data: requestParam
+        },'geocoder'));
+    };
+
+
+    /**
+     * 获取城市列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getCityList(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.sig) {
+          requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList');
+        }
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_CITY_LIST,
+            data: requestParam
+        },'getCityList'));
+    };
+
+    /**
+     * 获取对应城市ID的区县列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getDistrictByCityId(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'id')) {
+            return;
+        }
+
+        var requestParam = {
+            id: options.id || '',
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.sig) {
+          requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId');
+        }
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_AREA_LIST,
+            data: requestParam
+        },'getDistrictByCityId'));
+    };
+
+    /**
+     * 用于单起点到多终点的路线距离(非直线距离)计算:
+     * 支持两种距离计算方式:步行和驾车。
+     * 起点到终点最大限制直线距离10公里。
+     *
+     * 新增直线距离计算。
+     * 
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-distance.html
+     */
+    calculateDistance(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'to')) {
+            return;
+        }
+
+        var requestParam = {
+            mode: options.mode || 'walking',
+            to: Utils.location2query(options.to),
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.from) {
+          options.location = options.from;
+        }
+
+        //计算直线距离
+        if(requestParam.mode == 'straight'){        
+          var locationsuccess = function (result) {
+            var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+            var data = {
+              message:"query ok",
+              result:{
+                elements:[]
+              },
+              status:0
+            };
+            for (var i = 0; i < locationTo.length; i++) {
+              data.result.elements.push({//将坐标存入
+                distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+                duration:0,
+                from:{
+                  lat: result.latitude,
+                  lng:result.longitude
+                },
+                to:{
+                  lat: locationTo[i].lat,
+                  lng: locationTo[i].lng
+                }
+              });            
+            }
+            var calculateResult = data.result.elements;
+            var distanceResult = [];
+            for (var i = 0; i < calculateResult.length; i++) {
+              distanceResult.push(calculateResult[i].distance);
+            }  
+            return options.success(data,{
+              calculateResult: calculateResult,
+              distanceResult: distanceResult
+            });
+          };
+          
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          var locationsuccess = function (result) {
+            requestParam.from = result.latitude + ',' + result.longitude;
+            if (options.sig) {
+              requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance');
+            }
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_DISTANCE,
+              data: requestParam
+            },'calculateDistance'));
+          };
+
+          Utils.locationProcess(options, locationsuccess);
+        }      
+    };
+
+  /**
+   * 路线规划:
+   * 
+   * @param {Object} options 接口参数对象
+   * 
+   * 请求参数结构可以参考
+   * https://lbs.qq.com/webservice_v1/guide-road.html
+   */
+  direction(options) {
+    var that = this;
+    options = options || {};
+    Utils.polyfillParam(options);
+
+    if (Utils.checkParamKeyEmpty(options, 'to')) {
+      return;
+    }
+
+    var requestParam = {
+      output: 'json',
+      key: that.key
+    };
+
+    //to格式处理
+    if (typeof options.to == 'string') {
+      requestParam.to = options.to;
+    } else {
+      requestParam.to = options.to.latitude + ',' + options.to.longitude;
+    }
+    //初始化局部请求域名
+    var SET_URL_DIRECTION = null;
+    //设置默认mode属性
+    options.mode = options.mode || MODE.driving;
+
+    //设置请求域名
+    SET_URL_DIRECTION = URL_DIRECTION + options.mode;
+
+    if (options.from) {
+      options.location = options.from;
+    }
+
+    if (options.mode == MODE.driving) {
+      if (options.from_poi) {
+        requestParam.from_poi = options.from_poi;
+      }
+      if (options.heading) {
+        requestParam.heading = options.heading;
+      }
+      if (options.speed) {
+        requestParam.speed = options.speed;
+      }
+      if (options.accuracy) {
+        requestParam.accuracy = options.accuracy;
+      }
+      if (options.road_type) {
+        requestParam.road_type = options.road_type;
+      }
+      if (options.to_poi) {
+        requestParam.to_poi = options.to_poi;
+      }
+      if (options.from_track) {
+        requestParam.from_track = options.from_track;
+      }
+      if (options.waypoints) {
+        requestParam.waypoints = options.waypoints;
+      }
+      if (options.policy) {
+        requestParam.policy = options.policy;
+      }
+      if (options.plate_number) {
+        requestParam.plate_number = options.plate_number;
+      }
+    }
+
+    if (options.mode == MODE.transit) {
+      if (options.departure_time) {
+        requestParam.departure_time = options.departure_time;
+      }
+      if (options.policy) {
+        requestParam.policy = options.policy;
+      }
+    } 
+
+    var locationsuccess = function (result) {
+      requestParam.from = result.latitude + ',' + result.longitude;
+      if (options.sig) {
+        requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode);
+      }
+      wx.request(Utils.buildWxRequestConfig(options, {
+        url: SET_URL_DIRECTION,
+        data: requestParam
+      }, 'direction'));
+    };
+
+    Utils.locationProcess(options, locationsuccess);
+  }
+};
+
+module.exports = QQMapWX;

文件差異過大導致無法顯示
+ 0 - 0
pinche/js_sdk/qqmap-wx-jssdk.min.js


+ 272 - 0
pinche/js_sdk/wa-permission/permission.js

@@ -0,0 +1,272 @@
+/**
+ * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
+ */
+
+var isIos
+// #ifdef APP-PLUS
+isIos = (plus.os.name == "iOS")
+// #endif
+
+// 判断推送权限是否开启
+function judgeIosPermissionPush() {
+	var result = false;
+	var UIApplication = plus.ios.import("UIApplication");
+	var app = UIApplication.sharedApplication();
+	var enabledTypes = 0;
+	if (app.currentUserNotificationSettings) {
+		var settings = app.currentUserNotificationSettings();
+		enabledTypes = settings.plusGetAttribute("types");
+		console.log("enabledTypes1:" + enabledTypes);
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		plus.ios.deleteObject(settings);
+	} else {
+		enabledTypes = app.enabledRemoteNotificationTypes();
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启!");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		console.log("enabledTypes2:" + enabledTypes);
+	}
+	plus.ios.deleteObject(app);
+	plus.ios.deleteObject(UIApplication);
+	return result;
+}
+
+// 判断定位权限是否开启
+function judgeIosPermissionLocation() {
+	var result = false;
+	var cllocationManger = plus.ios.import("CLLocationManager");
+	var status = cllocationManger.authorizationStatus();
+	result = (status != 2)
+	console.log("定位权限开启:" + result);
+	// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
+	/* var enable = cllocationManger.locationServicesEnabled();
+	var status = cllocationManger.authorizationStatus();
+	console.log("enable:" + enable);
+	console.log("status:" + status);
+	if (enable && status != 2) {
+		result = true;
+		console.log("手机定位服务已开启且已授予定位权限");
+	} else {
+		console.log("手机系统的定位没有打开或未给予定位权限");
+	} */
+	plus.ios.deleteObject(cllocationManger);
+	return result;
+}
+
+// 判断麦克风权限是否开启
+function judgeIosPermissionRecord() {
+	var result = false;
+	var avaudiosession = plus.ios.import("AVAudioSession");
+	var avaudio = avaudiosession.sharedInstance();
+	var permissionStatus = avaudio.recordPermission();
+	console.log("permissionStatus:" + permissionStatus);
+	if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
+		console.log("麦克风权限没有开启");
+	} else {
+		result = true;
+		console.log("麦克风权限已经开启");
+	}
+	plus.ios.deleteObject(avaudiosession);
+	return result;
+}
+
+// 判断相机权限是否开启
+function judgeIosPermissionCamera() {
+	var result = false;
+	var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
+	var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相机权限已经开启");
+	} else {
+		console.log("相机权限没有开启");
+	}
+	plus.ios.deleteObject(AVCaptureDevice);
+	return result;
+}
+
+// 判断相册权限是否开启
+function judgeIosPermissionPhotoLibrary() {
+	var result = false;
+	var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
+	var authStatus = PHPhotoLibrary.authorizationStatus();
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相册权限已经开启");
+	} else {
+		console.log("相册权限没有开启");
+	}
+	plus.ios.deleteObject(PHPhotoLibrary);
+	return result;
+}
+
+// 判断通讯录权限是否开启
+function judgeIosPermissionContact() {
+	var result = false;
+	var CNContactStore = plus.ios.import("CNContactStore");
+	var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
+	if (cnAuthStatus == 3) {
+		result = true;
+		console.log("通讯录权限已经开启");
+	} else {
+		console.log("通讯录权限没有开启");
+	}
+	plus.ios.deleteObject(CNContactStore);
+	return result;
+}
+
+// 判断日历权限是否开启
+function judgeIosPermissionCalendar() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("日历权限已经开启");
+	} else {
+		console.log("日历权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// 判断备忘录权限是否开启
+function judgeIosPermissionMemo() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("备忘录权限已经开启");
+	} else {
+		console.log("备忘录权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// Android权限查询
+function requestAndroidPermission(permissionID) {
+	return new Promise((resolve, reject) => {
+		plus.android.requestPermissions(
+			[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+			function(resultObj) {
+				var result = 0;
+				for (var i = 0; i < resultObj.granted.length; i++) {
+					var grantedPermission = resultObj.granted[i];
+					console.log('已获取的权限:' + grantedPermission);
+					result = 1
+				}
+				for (var i = 0; i < resultObj.deniedPresent.length; i++) {
+					var deniedPresentPermission = resultObj.deniedPresent[i];
+					console.log('拒绝本次申请的权限:' + deniedPresentPermission);
+					result = 0
+				}
+				for (var i = 0; i < resultObj.deniedAlways.length; i++) {
+					var deniedAlwaysPermission = resultObj.deniedAlways[i];
+					console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
+					result = -1
+				}
+				resolve(result);
+				// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
+				// if (result != 1) {
+				// gotoAppPermissionSetting()
+				// }
+			},
+			function(error) {
+				console.log('申请权限错误:' + error.code + " = " + error.message);
+				resolve({
+					code: error.code,
+					message: error.message
+				});
+			}
+		);
+	});
+}
+
+// 使用一个方法,根据参数判断权限
+function judgeIosPermission(permissionID) {
+	if (permissionID == "location") {
+		return judgeIosPermissionLocation()
+	} else if (permissionID == "camera") {
+		return judgeIosPermissionCamera()
+	} else if (permissionID == "photoLibrary") {
+		return judgeIosPermissionPhotoLibrary()
+	} else if (permissionID == "record") {
+		return judgeIosPermissionRecord()
+	} else if (permissionID == "push") {
+		return judgeIosPermissionPush()
+	} else if (permissionID == "contact") {
+		return judgeIosPermissionContact()
+	} else if (permissionID == "calendar") {
+		return judgeIosPermissionCalendar()
+	} else if (permissionID == "memo") {
+		return judgeIosPermissionMemo()
+	}
+	return false;
+}
+
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+	if (isIos) {
+		var UIApplication = plus.ios.import("UIApplication");
+		var application2 = UIApplication.sharedApplication();
+		var NSURL2 = plus.ios.import("NSURL");
+		// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");		
+		var setting2 = NSURL2.URLWithString("app-settings:");
+		application2.openURL(setting2);
+
+		plus.ios.deleteObject(setting2);
+		plus.ios.deleteObject(NSURL2);
+		plus.ios.deleteObject(application2);
+	} else {
+		// console.log(plus.device.vendor);
+		var Intent = plus.android.importClass("android.content.Intent");
+		var Settings = plus.android.importClass("android.provider.Settings");
+		var Uri = plus.android.importClass("android.net.Uri");
+		var mainActivity = plus.android.runtimeMainActivity();
+		var intent = new Intent();
+		intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+		var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
+		intent.setData(uri);
+		mainActivity.startActivity(intent);
+	}
+}
+
+// 检查系统的设备服务是否开启
+// var checkSystemEnableLocation = async function () {
+function checkSystemEnableLocation() {
+	if (isIos) {
+		var result = false;
+		var cllocationManger = plus.ios.import("CLLocationManager");
+		var result = cllocationManger.locationServicesEnabled();
+		console.log("系统定位开启:" + result);
+		plus.ios.deleteObject(cllocationManger);
+		return result;
+	} else {
+		var context = plus.android.importClass("android.content.Context");
+		var locationManager = plus.android.importClass("android.location.LocationManager");
+		var main = plus.android.runtimeMainActivity();
+		var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+		var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
+		console.log("系统定位开启:" + result);
+		return result
+	}
+}
+
+module.exports = {
+	judgeIosPermission: judgeIosPermission,
+	requestAndroidPermission: requestAndroidPermission,
+	checkSystemEnableLocation: checkSystemEnableLocation,
+	gotoAppPermissionSetting: gotoAppPermissionSetting
+}

+ 594 - 0
pinche/js_sdk/xfl-DateFormat/DateFormat.js

@@ -0,0 +1,594 @@
+
+
+/**
+ * 日期格式转换模块,还可以从字符串中提取日期,同时提供了几个数字格式转换函数。 
+ * 2019.5.12  v1.0.0
+ * 
+## 背景
+当需要将日期转换为指定的格式时,或者需要从某个字符串中按照指定的格式提取日期,均可使用本模块。
+
+## 使用说明  
+格式标记的含意:   
+yyyy-四位阿拉伯数字的年份,如: 2018  
+YYYY-四位中文数字的年份,如: 二零一八  
+yy-两位阿拉伯数字的年份,如: 18  
+YY-两位中文数字的年份,如: 一八  
+mm-一位或两位阿拉伯数字的月数,如: 3 、 12   
+0m-两位阿拉伯数字的月数,如: 03 、 12  
+MM-一位或两位中文数字的月数,如:  三、 十二   
+dd-一位或两位阿拉伯数字的日数,如: 3 、 12   
+0d-两位阿拉伯数字的日数,如: 03 、 12、28   
+DD-中文数字的日数,如:  三、 十二、二十八   
+hh-一位或两位阿拉伯数字的小时数,如: 3 、 12   
+0h-两位阿拉伯数字的小时数,如: 03 、 12   
+HH-中文数字的小时数,如:  三、 十二、二十三   
+ff-一位或两位阿拉伯数字的分钟数,如: 3 、 12、56  
+0f-两位阿拉伯数字的分钟数,如: 03 、 12  
+0F-中文数字的分钟,如:  零三、 十二、二十三  
+FF-中文数字的分钟,如:  三、 十二、二十三   
+ss-一位或两位阿拉伯数字的秒数,如: 3 、 12   
+0s-两位阿拉伯数字的秒数,如: 03 、 12   
+0S-中文数字的秒数,如:  零三、 十二、二十三   
+SS-中文数字的秒数,如:  三、 十二、二十三   
+w-阿拉伯数字的星期数,如:  1、6、7  
+W-中文数字的星期数,如:  一、三、六、日   
+WT-中文数字的星期数,如:  一、三、六、天   
+  
+### 属性  
+这些属性是可读可写的,如果直接更改,则会自动计算其关联的其它值。  
+dataformat.year; //年 [1000, 3000]  
+dataformat.moth; //月 [1, 12]  
+dataformat.day; //日 [1, 31]  
+dataformat.hour; //时 [0, 23]  
+dataformat.minute; //分 [0, 59]  
+dataformat.second; //秒 [0, 59]  
+dataformat.mscond; //毫秒 [0, 999]  
+dataformat.week; //星期 [1, 7]  
+dataformat.timestamp; //时间戳  
+
+### 构造函数
+构造函数内部直接调用的 setTime(ms, formatStr);
+  
+### toString(formatStr)  
+  
+使用举例:   
+1. toString() //结果: '2014-11-7 03:08:01'  
+2. toString('yyyy-mm-dd hh:ff:ss') //结果: '2014-11-11 13:12:34'  
+3. toString('yyyy年mm月dd日') //结果: '2014年11月11日'  
+4. toString('yy年mm月dd日') //结果: '14年11月11日'  
+5. toString('YY年MM月DD日') //结果: '一四年十一月八日'  
+6. toString('星期W') //结果: '星期日'  或 '星期三'
+7. toString('星期WT')  //结果: '星期天'  或 '星期三'
+8. toString('星期w') //结果: '星期1'   或 '星期7'
+9. toString('hh:0f:ss') //结果: '3:04:5'  
+10. toString('date') //结果: '2014-11-7'  
+11. toString('time') //结果: '03:08:01'  
+  
+### setTime(ms, formtStr)  
+设置时间。如果存在 formatStr, 则表示从字符串 ms 中按 formatStr中的规则提取时间。  
+  
+使用举例:  
+1. setTime( new Date() ); //传入一个时间对象  
+2. setTime( new Date().getTime() ); //传入一个毫秒数  
+3. setTime( new Date().getTime() ); //传入一个毫秒数  
+4. setTime( new Date().getTime() + '' ); //传入一个毫秒数的字符串  
+5. setTime(); //传入其它的值或不传入,则创建当前时间  
+6. setTime(str, formatStr); //传入两个参数,第一个为字符串,第二个为格式规则,表示按照规则从字符串中提取时间  
+7. setTime('今天是2014年8月9号,天气特别好,但明天是2014年8月10号,....', '明天是yyyy年mm月dd号');  // 得到  2014.8.10 0:0:0
+  
+### fillChar(num, len, char)  
+字符填充  
+  
+使用举例:   
+1. fillChar(44, 5, '*'); //结果: '***44'   
+2. fillChar(44, 5); //结果: '00044'   
+3. fillChar('44', 5); //结果: '   44'   
+4. fillChar('aaa', 5); //结果: '   aa'   
+5. fillChar('aaa', 5, '$'); //结果: '$$aaa'   
+5. fillChar('aaa', 1, '$'); //结果: 'aaa'  //指定的长度太小,不做任何操作。  
+  
+### perNumToChinese(num)  
+将阿拉伯数字每一位对应转换为中文的格式。  
+  
+使用举例:   
+1. perNumToChinese(34); //结果: '三四'  
+2. perNumToChinese(3874); //结果: '三八七四'  
+3. perNumToChinese('3874'); //结果: '三八七四'  
+4. perNumToChinese('404'); //结果: '四零四'    
+5. perNumToChinese('0  04   '); //结果: '零零四'  
+6. perNumToChinese('  '); //结果: ''  
+  
+### perChineseToNum(numStr)
+将中文的格式的数字每一位对应转换为阿拉伯数字。 是perNumToChinese(num)的逆操作。  
+  
+使用举例:   
+1. perChineseToNum('三四'); //结果: 34  
+2. perChineseToNum('三八七四'); //结果: 3874  
+3. perChineseToNum('四零四'); //结果: 404  
+4. perChineseToNum('零零四'); //结果: 4  
+5. perChineseToNum('  '); //结果: NaN  
+  
+### numToChinese(num)  
+将阿拉伯数字转换为中文的格式 , 最多只能处理13位数(万亿)  
+  
+使用举例:   
+1. numToChinese(0); //结果: '零'  
+2. numToChinese(5); //结果: '五'  
+3. numToChinese(16); //结果: '十六'  
+4. numToChinese(34); //结果: '三十四'  
+5. numToChinese(106); //结果: '一百零六'  
+6. numToChinese(886); //结果: '八百八十六'  
+7. numToChinese(1004); //结果: '一千零四'  
+8. numToChinese(1000); //结果: '一千'  
+9. numToChinese(9904); //结果: '九千九百零四'  
+10. numToChinese(19904); //结果: '一万九千九百零四'  
+11. numToChinese(10004); //结果: '一万零四'  
+12. numToChinese(10000); //结果: '一万'  
+13. numToChinese(100404); //结果: '十万零四百零四'  
+14. numToChinese(9000000); //结果: '九百万'  
+15. numToChinese(90000000); //结果: '九千万'  
+16. numToChinese(900000000); //结果: '九亿'  
+17. numToChinese(9000000000); //结果: '九十亿'  
+18. numToChinese(9020030401); //结果: '九十亿零二千零三万零四百零一'  
+19. numToChinese(90000000000); //结果: '九百亿'  
+20. numToChinese(900000000000); //结果: '九千亿'  
+21. numToChinese(9000000000000); //结果: '九万亿'  
+22. numToChinese(90000000000000); //结果: undefined  
+  
+  
+### chineseToNum (numStr)
+将中文的格式的数字转换为阿拉伯数字, 最多只能处理13位数(万亿)。 是 numToChinese(num) 函数的逆操作。  
+  
+使用举例:   
+1. chineseToNum('十六'); //结果: 16  
+2. chineseToNum('一万九千九百零四'); //结果: 19904  
+3. chineseToNum('十万零四百零四'); //结果: 100404   
+4. chineseToNum('九十亿零二千零三万零四百零一'); //结果: 9020030401  
+ */
+export default class DateFormat{
+    constructor(ms, formatStr){
+        this.setTime(ms, formatStr);
+    }
+
+    set year(y){ if(this.y !== y){ this.__date.setFullYear(y); this.setTime(this.__date); }  }
+    get year(){ return this.y; }
+
+    set month(y){ if(this.m !== y){ this.__date.setMonth(y-1); this.setTime(this.__date); }  }
+    get month(){ return this.m; }
+
+    set day(y){ if(this.d !== y){ this.__date.setDate(y); this.setTime(this.__date); }  }
+    get day(){ return this.d; }
+
+    set hour(y){ if(this.h !== y){ this.__date.setHours(y); this.setTime(this.__date); }  }
+    get hour(){ return this.h; }
+
+    set minute(y){ if(this.f !== y){ this.__date.setMinutes(y); this.setTime(this.__date); }  }
+    get minute(){ return this.f; }
+
+    set second(y){ if(this.s !== y){ this.__date.setSeconds(y); this.setTime(this.__date); }  }
+    get second(){ return this.s; }
+
+    set msecond(y){ if(this.ms !== y){ this.__date.setMilliseconds(y); this.setTime(this.__date); }  }
+    get msecond(){ return this.ms; }
+
+    get week(){ return this.w; }
+
+     setTime(ms, formatStr){  //切换时间
+        if(formatStr && typeof ms === 'string'){
+            let result;
+            if(this.__analysis){
+                result = this.__analysis(ms, formatStr);
+            }
+            if(!result){
+                console.log('匹配时间失败,默认设置为当前时间');
+                ms = '';
+            }else{
+                ms = result;
+            }
+        }
+        let date;
+        if(ms instanceof Date){
+            date = ms;
+        }else if(typeof ms === 'number'){
+            date = new Date(ms);
+        }else if( parseInt(ms) > 0 ){
+            date = new Date(parseInt(ms));
+        }else{
+            if(typeof ms === 'object' && ms.y && ms.m && ms.d){
+                date = new Date(ms.y, ms.m-1, ms.d, ms.h || 0, ms.f || 0, ms.s || 0, ms.ms || 0);
+            }else{
+                date = new Date();
+            }
+        }
+
+        this.y = date.getFullYear(), //年 [1000, 3000]
+        this.m = date.getMonth() + 1, //月 [1, 12]
+        this.d = date.getDate(), //日 [1, 31]
+        this.h = date.getHours(), //时 [0, 23]
+        this.f = date.getMinutes(), //分 [0, 59]
+        this.s = date.getSeconds(), //秒 [0, 59]
+        this.ms = date.getMilliseconds(), //秒 [0, 9999]
+        this.w = date.getDay(); //星期 [1, 7]
+        if(this.w === 0){  //0表示星期天
+            this.w = 7;
+        }
+        this.timestamp = date.getTime(); //时间戳
+
+        this.__date = date;
+        
+        return this;
+     }
+
+/***************************************************** 时间格式化 *********************************************** */
+     toString(formatStr){  //将时间转换为格式的字符串
+         if(formatStr){
+            if(formatStr === 'time'){
+                //03:00:01
+                return this.fillChar(this.h, 2) + ':' + this.fillChar(this.f, 2) + ':' + this.fillChar(this.s, 2);
+            }else if(formatStr === 'date'){
+                //2014-11-7
+                return this.y + '-' + this.m + '-' + this.d;
+            }else{
+               return this.__replaceTime(formatStr);
+            }
+            
+        }else{
+            //2014-11-7 03:00:01
+            return this.y + '-' + this.m + '-' + this.d + ' ' + this.fillChar(this.h, 2) + ':' + this.fillChar(this.f, 2) + ':' + this.fillChar(this.s, 2);
+        }
+     }
+
+     valueOf(){
+         return this.toString();
+     }
+ 
+     __replaceTime(format){
+        var str = 
+        'y{4}|Y{4}|y{2}|Y{2}|mm|MM|0m|dd|DD|0d|hh|HH|0h|ff|FF|0F|0f|ss|SS|0S|0s|w|WT|W';
+        var reg = new RegExp(str, 'g');
+
+
+        format = format.replace(reg, (mstr)=>{
+           switch(mstr){
+              case 'yyyy': return this.y;                        // [0000, 9999]
+              case 'YYYY': return this.perNumToChinese(this.y);  // [零零零零-九九九九]   
+              case 'yy': return ('' + this.y).slice(-2);         // [00, 99]
+              case 'YY': return this.perNumToChinese( +('' + this.y).slice(-2) ); // [零零-九九]    
+              case 'mm': return this.m;                          // [1, 12]
+              case 'MM': return this.numToChinese(this.m);       // [一-十二]    
+              case '0m': return this.m < 10 ? '0'+ this.m : this.m; // [01, 12]
+              case 'dd': return this.d;                          // [1, 31]
+              case 'DD': return this.numToChinese(this.d);       // [一-三十一]  
+              case '0d': return this.d < 10 ? '0' + this.d : this.d; // [01, 31]
+              case 'hh': return this.h;                          // [0, 24]
+              case 'HH': return this.numToChinese(this.h);       // [零-二十四]  
+              case '0h': return this.h < 10 ? '0' + this.h : this.h; // [00, 24]
+              case 'ff': return this.f;                          // [0, 60]
+              case 'FF': return this.numToChinese(this.f);       // [零-六十]
+              case '0F': return this.f<10&&this.f>0 ? ('零' + this.numToChinese(this.f) ):this.numToChinese(this.f); // [零零-六十]   
+              case '0f': return this.f < 10 ? '0' + this.f : this.f; // [00, 60]
+              case 'ss': return this.s;                          // [0, 60]
+              case 'SS': return this.numToChinese(this.s);       // [零-六十]
+              case '0S': return this.s<10&&this.s>0 ? ('零' + this.numToChinese(this.s) ):this.numToChinese(this.s); // [零零-六十]    
+              case '0s': return this.s < 10 ? '0' + this.s : this.s;  // [00, 60]
+              case 'w': return this.w;                           // [7]
+              case 'W': return this.w == 7 ? '日' : this.numToChinese(this.w);  // [天|日]
+              case 'WT': return this.w == 7 ? '天' : this.numToChinese(this.w);  // [天|日]
+           }
+        });
+         return format;
+     }
+
+/***************************************************** 时间提取 *********************************************** */
+     __analysis(str, rule){  //从指定的字符串中根据规则提取日期和时间。
+         let resultObj;
+        if(typeof rule === 'function'){
+            resultObj = rule(str);
+            if(!resultObj){
+                return null;
+            }
+        }else{
+            resultObj = {};
+            var str11 = 
+            'y{4}|Y{4}|y{2}|Y{2}|mm|MM|0m|dd|DD|0d|hh|HH|0h|ff|FF|0F|0f|ss|SS|0S|0s|w|WT|W';
+            var reg = new RegExp(str11, 'g');
+
+            // rule = 'yyyy年mm月'
+            var namesArr = [null];   // [null, 'yyyy', 'mm']
+            rule = rule.replace(reg, (mstr)=>{
+                var result = this.__ANALYREGSTR[mstr];
+                if(result){
+                    namesArr.push(mstr);
+                    return `(${result})`;
+                }
+             });
+            //  rule = '(\\d{4})年([1-9]|1[012])月'
+
+            var resultArr = str.match( new RegExp(rule) );
+             if(resultArr){
+                for(let i=1,val; i<namesArr.length; i++){
+                    val = resultArr[i];
+                    if(val == null){
+                        continue;
+                    }
+                    switch(namesArr[i]){
+                        case 'yyyy': resultObj.y = +val; break;                        // [0000, 9999]
+                        case 'YYYY': resultObj.y = this.perChineseToNum(val); break;   // [零零零零-九九九九]   
+                        case 'yy': resultObj.y = +val + 2000; break;          // [00, 99]
+                        case 'YY': resultObj.y = this.perChineseToNum(val) + 2000; break;  // [零零-九九]    
+                        case 'mm': resultObj.m = +val;    break;                        // [1, 12]
+                        case 'MM': resultObj.m = this.chineseToNum(val);  break;       // [一-十二]    
+                        case '0m': resultObj.m = +val;  break; // [01, 12]
+                        case 'dd': resultObj.d = +val; break;                           // [1, 31]
+                        case 'DD': resultObj.d = this.chineseToNum(val); break;        // [一-三十一]  
+                        case '0d': resultObj.d = +val; break;  // [01, 31]
+                        case 'hh': resultObj.h = +val;  break;                           // [0, 24]
+                        case 'HH': resultObj.h = this.chineseToNum(val); break;        // [零-二十四]  
+                        case '0h': resultObj.h = +val; break;  // [00, 24]
+                        case 'ff': resultObj.f = +val;   break;                         // [0, 60]
+                        case 'FF': resultObj.f = this.chineseToNum(val); break;        // [零-六十]
+                        case '0F': resultObj.f = this.chineseToNum(val); break;  // [零零-六十]   
+                        case '0f': resultObj.f = +val; break;   // [00, 60]
+                        case 'ss': resultObj.s = +val;   break;                         // [0, 60]
+                        case 'SS': resultObj.s = this.chineseToNum(val);  break;       // [零-六十]
+                        case '0S': resultObj.s = this.chineseToNum(val); break;  // [零零-六十]    
+                        case '0s': resultObj.s = +val; break;    // [00, 60]
+                        case 'w': resultObj.w = 7; break;                             // [7]
+                        case 'W': resultObj.w = 7; break;      // [天|日]
+                        case 'WT': resultObj.w = 7; break;      // [天|日]
+                    }
+                }
+             }else{
+                return null;
+             }
+             
+        }
+        //   'yyyy年mm月'  '(\\d{4})年([1-9]|1[012])月'
+        return resultObj;
+     }
+
+     __ANALYREGSTR = {
+         'yyyy': '\\d{4}',                   // [0000, 9999]
+         'YYYY': '[零一二三四五六七八九]{4}',              // [零零零零-九九九九]    
+         'yy': '\\d{2}',                     // [00, 99]
+         'YY': '[零一二三四五六七八九]{2}',                // [零零-九九]    
+         'mm': '[1-9]|1[012]',               // [1, 12]
+         'MM': '十[一二]?|[一二三四五六七八九]',// [一-十二]    
+         '0m': '[0][1-9]|1[012]',             // [01, 12]
+         'dd': '3[01]|[12]0|[12]?[1-9]',            //  [1, 31]
+         'DD': '三十[一]?|二?十[一二三四五六七八九]|[零一二三四五六七八九十]',     // [一-三十一]  
+         '0d': '[012][0-9]|3[01]',            //  [01, 31]
+         'hh': '2[0-4]|[1]?[0-9]',            //  [0, 24]
+         'HH': '二十[一二三]?|十[一二三四五六七八九]|[零一二三四五六七八九十]',   // [零-二十四]  
+         '0h': '[01][0-9]|2[0-4]',             // [00, 24]
+         'ff': '60|[1-5]?[0-9]',               // [0, 60]
+         'FF': '[二三四五]十[一二三四五六七八九]|十[一二三四五六七八九]|[二三四五六]十|[零一二三四五六七八九十]',    // [零-六十]
+         '0F': '零[零一二三四五六七八九]|十[一二三四五六七八九]|[二三四五]十[一二三四五六七八九]|[二三四五六]十|十', // [零零-六十]     
+         '0f': '[0-5][0-9]|60',               // [00, 60]
+         'ss': '60|[1-5]?[0-9]',              // [0, 60]
+         'SS': '[二三四五]十[一二三四五六七八九]|十[一二三四五六七八九]|[二三四五六]十|[零一二三四五六七八九十]',    // [零-六十] 
+         '0S': '零[零一二三四五六七八九]|十[一二三四五六七八九]|[二三四五]十[一二三四五六七八九]|[二三四五六]十|十', // [零零-六十]    
+         '0s': '[0-5][0-9]|60',               // [00, 60]
+         'w': '7',                            // [7]
+         'W': '日',                        //[天|日]
+         'WT': '天',                        //[天|日]
+     }
+
+/***************************************************** 字符填充部分 *********************************************** */
+      /**
+     * 在一个字符前面补充指定个数的字符。
+     * <br><font color="red">ref: null</font> <br>
+     * @public
+     * @param {string|number} num -  要操作的数字或字符串。
+     * @param {number} len -  要保留的最大长度。如果指定的长度不比传入的参数的本身的长度大,则不做任何操作。
+     * @param {string} [char=' '|'0'] -  当长度不足时,要在最前面补足的字符。第一个参数为数字时,默认为0,否则默认为' '。
+     * @example
+       1. fillChar(44, 5, '*'); //结果: '***44' 
+       2. fillChar(44, 5); //结果: '00044' 
+       3. fillChar('44', 5); //结果: '   44' 
+       4. fillChar('aaa', 5); //结果: '   aa' 
+       5. fillChar('aaa', 5, '$'); //结果: '$$aaa' 
+       5. fillChar('aaa', 1, '$'); //结果: 'aaa'  //指定的长度太小,不做任何操作。
+     */
+    fillChar(num, len, char){
+        if(typeof num === 'number'){
+            char = char || '0';
+        }else{
+            char = char || ' ';
+        }
+        let str = '' + num, charStr = '';
+
+        if(str.length < len){
+            for(let i=0, len1=len-str.length; i<len1; i++){
+                charStr += char;
+            }
+            return charStr + str;
+        }
+
+        return str;
+    }
+
+/***************************************************** 数字转换部分 *********************************************** */
+
+    __SIZEPOW = {'十': 1, '百': 2, '千': 3, '万': 4, '亿': 8};
+    /** 
+     * 将中文的格式的数字转换为阿拉伯数字, 最多只能处理13位数(万亿)。 是 numToChinese(num) 函数的逆操作。 
+     *  @example
+        1. chineseToNum('十六'); //结果: 16  
+        2. chineseToNum('一万九千九百零四'); //结果: 19904  
+        3. chineseToNum('十万零四百零四'); //结果: 100404   
+        4. chineseToNum('九十亿零二千零三万零四百零一'); //结果: 9020030401  
+     */
+    chineseToNum (numStr){   //目前只能处理万亿以下的数据
+        if(numStr.length === 1){
+            return this.perChineseToNum(numStr);
+        }
+        if(numStr.length === 2 && numStr[0] === '十'){
+            return this.perChineseToNum(numStr[1]) + 10;
+        }
+
+        let arr;
+        if(!numStr.match(/[亿万]/)){
+            arr = numStr.split('零'); 
+            let num = 0, val = 0;
+            for(let i=0, str=''; i<arr.length; i++){
+                str = arr[i];
+                for(let j=0; j<str.length; j++){
+                    if(str[j].match(/[一二三四五六七八九]/)){
+                        num += val;
+                        val = 1;
+                        val *= this.perChineseToNum(str[j]);
+                    }else{
+                        val *= Math.pow(10, this.__SIZEPOW[str[j]] )
+                    }
+                }
+            }
+            num += val;
+            return num;
+        }else{
+            arr = numStr.split('亿');
+            if(arr.length > 1){
+                var arr1 = arr[1].split('万');
+                return this.chineseToNum(arr[0])*Math.pow(10, 8) + this.chineseToNum(arr1[0])*10000 + this.chineseToNum(arr1[1]);
+            }else{
+                return this.chineseToNum(arr[0])*Math.pow(10, 8) + this.chineseToNum(arr[1]);
+            }
+        }
+    }
+
+     /** 
+     * 将中文的格式的数字每一位对应转换为阿拉伯数字。 是perNumToChinese(num)的逆操作。  
+     *  @example
+    1. perChineseToNum('三四'); //结果: 34  
+    2. perChineseToNum('三八七四'); //结果: 3874  
+    3. perChineseToNum('四零四'); //结果: 404  
+    4. perChineseToNum('零零四'); //结果: 4  
+    5. perChineseToNum('  '); //结果: NaN  
+     */
+    perChineseToNum(numStr){
+        return +numStr.replace(/[零一二三四五六七八九十\s]/g, (str)=>{
+            var index =  this.__CHINANUM.indexOf(str);
+            return index == null ? '' : index;
+        });
+    }
+
+    /**
+    * 将阿拉伯数字转换为对应的汉字, 最多只能处理13位数(万亿)。
+    * <br><font color="red">ref: this.numToChina()、 this.weiNum() </font> <br>
+    * @public
+    * @param {number} num - 要转换的数字
+    * @example
+        1. numToChinese(0); //结果: '零'  
+        2. numToChinese(5); //结果: '五'  
+        3. numToChinese(16); //结果: '十六'  
+        4. numToChinese(34); //结果: '三十四'  
+        5. numToChinese(106); //结果: '一百零六'  
+        6. numToChinese(886); //结果: '八百八十六'  
+        7. numToChinese(1004); //结果: '一千零四'  
+        8. numToChinese(1000); //结果: '一千'  
+        9. numToChinese(9904); //结果: '九千九百零四'  
+        10. numToChinese(19904); //结果: '一万九千九百零四'  
+        11. numToChinese(10004); //结果: '一万零四'  
+        12. numToChinese(10000); //结果: '一万'  
+        13. numToChinese(100404); //结果: '十万零四百零四'  
+        14. numToChinese(9000000); //结果: '九百万'  
+        15. numToChinese(90000000); //结果: '九千万'  
+        16. numToChinese(900000000); //结果: '九亿'  
+        17. numToChinese(9000000000); //结果: '九十亿'  
+        18. numToChinese(9020030401); //结果: '九十亿零二千零三万零四百零一'  
+        19. numToChinese(90000000000); //结果: '九百亿'  
+        20. numToChinese(900000000000); //结果: '九千亿'  
+        21. numToChinese(9000000000000); //结果: '九万亿'  
+        22. numToChinese(90000000000000); //结果: undefined  
+    */
+    numToChinese (num){
+        let numStr = '' + num;
+        let len = numStr.length, result;
+        if(num <= 10){ //处理0~9
+            return this.__CHINANUM[num]; 
+        }else if(num < 20){ //处理10~20
+            return '十' + this.__CHINANUM[numStr[1]]; 
+        }else if(len < 6){ //处理5位数(万)及以下
+            if(!this.__WEIARR){
+                this.__WEIARR = this.__WEISTR.split(', ');
+            }
+            let lastStr, resultStr = '', index;
+            for(let i=0; i<len; i++){
+                lastStr = this.__CHINANUM[numStr[i]];
+                if(numStr[i] === '0'){
+                    index = null;
+                    for(let j=i+1; j<len; j++){
+                        if( numStr[j] !== '0' ){
+                            index = j - 1;
+                            break;
+                        }
+                    }
+                    if(index === null){
+                        break;
+                    }else{
+                        i = index;
+                        resultStr += '零';
+                    }
+                }else{
+                    resultStr += ( lastStr + this.__WEIARR[len - i - 1] );
+                }
+            }
+            return resultStr;
+        }else if(len < 9){ //处理8位数(千万)及以下
+            let low4Str = numStr.slice(-4), heigh4Str = numStr.slice(0, -4), isZero = '';
+            isZero = heigh4Str.slice(-1) === '0' ? '零' : ''; //必须用这个,如504000,应该是 五十万零四千 而不是 五十万四千
+            if(isZero){
+                low4Str = +low4Str;
+                if(low4Str === 0){
+                    isZero = '';
+                }
+            }
+            if(+heigh4Str !== 0){
+                isZero = '万' + isZero;
+            }
+            result = this.numToChinese( +heigh4Str ) + isZero  + this.numToChinese( +low4Str );
+            return result.slice(-1) === '零' ? result.slice(0, -1) : result;
+
+        }else if(len < 14){ //处理13位数(万亿)及以下
+            let low8Str = numStr.slice(-8), heigh4Str = numStr.slice(0, -8),  isZero = '';
+            isZero = heigh4Str.slice(-1) === '0' ? '零' : ''; //必须用这个
+            if(isZero){
+                low8Str = +low8Str;
+                if(low8Str === 0){
+                    isZero = '';
+                }
+            }
+            if(+heigh4Str !== 0){
+                isZero = '亿' + isZero;
+            }
+            result = this.numToChinese( +heigh4Str ) + isZero  + this.numToChinese( +low8Str );
+            return result.slice(-1) === '零' ? result.slice(0, -1) : result;
+        }
+    }
+
+    /**
+     * 按数字的位数将每一位数字转换为中文(注意,可以转换多位数字)
+     * <br><font color="red">ref: this.numToChina() </font> <br>
+     * @public
+     * @param {number|string} num - 要转换的数字
+     * @example
+    1. perNumToChinese(34); //结果: '三四'
+    2. perNumToChinese(3874); //结果: '三八七四'
+    3. perNumToChinese('3874'); //结果: '三八七四'
+    4. perNumToChinese('404'); //结果: '四零四'
+    5. perNumToChinese('0  04   '); //结果: '零零四'
+    6. perNumToChinese('  '); //结果: ''
+    */
+    perNumToChinese(num){
+        return ('' + num).replace(/[\d\s]/g, (index)=>{
+            var result = this.__CHINANUM[index];
+            return result ? result : '';
+        });
+    }
+    __CHINANUM =  '零一二三四五六七八九十'; 
+    __WEISTR =', 十, 百, 千, 万, 十万, 百万, 千万, 亿, 十亿, 百亿, 千亿, 万亿, 十万亿, 百万亿, 千万亿, 亿亿, 十亿亿, 百亿亿, 千亿亿, 万亿亿';
+    __WEIARR = null;
+ 
+ }
+
+

+ 76 - 70
pinche/manifest.json

@@ -1,72 +1,78 @@
 {
-    "name" : "yinyuan",
-    "appid" : "__UNI__09F605B",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
-    /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        /* 模块配置 */
-        "modules" : {},
-        /* 应用发布信息 */
-        "distribute" : {
-            /* android打包配置 */
-            "android" : {
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            /* ios打包配置 */
-            "ios" : {},
-            /* SDK配置 */
-            "sdkConfigs" : {}
-        }
-    },
-    /* 快应用特有相关 */
-    "quickapp" : {},
-    /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "",
-        "setting" : {
-            "urlCheck" : false
-        },
-        "usingComponents" : true
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "uniStatistics" : {
-        "enable" : false
-    },
-    "vueVersion" : "2"
+	"name": "pinche",
+	"appid": "__UNI__09F605B",
+	"description": "",
+	"versionName": "1.0.0",
+	"versionCode": "100",
+	"transformPx": false,
+	/* 5+App特有相关 */
+	"app-plus": {
+		"usingComponents": true,
+		"nvueStyleCompiler": "uni-app",
+		"compilerVersion": 3,
+		"splashscreen": {
+			"alwaysShowBeforeRender": true,
+			"waiting": true,
+			"autoclose": true,
+			"delay": 0
+		},
+		/* 模块配置 */
+		"modules": {},
+		/* 应用发布信息 */
+		"distribute": {
+			/* android打包配置 */
+			"android": {
+				"permissions": [
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
+					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+					"<uses-feature android:name=\"android.hardware.camera\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			/* ios打包配置 */
+			"ios": {},
+			/* SDK配置 */
+			"sdkConfigs": {}
+		}
+	},
+	/* 快应用特有相关 */
+	"quickapp": {},
+	/* 小程序特有相关 */
+	"mp-weixin": {
+		"appid": "wxbb0159a7c59b2c03",
+		"setting": {
+			"urlCheck": false
+		},
+		"usingComponents": true,
+		"permission": {
+			"scope.userLocation": {
+				"desc": "为用户提供给接送服务,需要定位信息"
+			}
+		},
+		"requiredPrivateInfos": ["chooseLocation", "getLocation"]
+	},
+	"mp-alipay": {
+		"usingComponents": true
+	},
+	"mp-baidu": {
+		"usingComponents": true
+	},
+	"mp-toutiao": {
+		"usingComponents": true
+	},
+	"uniStatistics": {
+		"enable": false
+	},
+	"vueVersion": "2"
 }

+ 31 - 2
pinche/pages.json

@@ -23,9 +23,38 @@
 		{
 			"path": "pages/mine/index",
 			"style": {
-				"navigationBarTitleText": "我的",
-				"navigationStyle": "custom"
+				"navigationBarTitleText": "我的"
+				// "navigationStyle": "custom"
 			}
+		}, {
+			"path": "pages/info/add",
+			"style": {
+				"navigationBarTitleText": "发布",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/info/lookOrder",
+			"style": {
+				"navigationBarTitleText": "查看预定",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/index/yuding",
+			"style": {
+				"navigationBarTitleText": "预定",
+				"enablePullDownRefresh": false
+			}
+
 		}
 	],
 	"tabBar": {

+ 156 - 127
pinche/pages/index/index.vue

@@ -1,8 +1,9 @@
 <template>
 	<view class="content">
 		<view class="content1">
-			<view class="nav" v-for="(item,index) in navList">
-				{{item.name}}
+			<view class="nav" v-for="(item,index) in navList" @click="clickNav(item,index)"
+				:class="navIndex==index?'nav-active':''">
+				{{item.route}}
 			</view>
 		</view>
 		<u-line color="#dfe2e5"></u-line>
@@ -14,23 +15,43 @@
 			</u-radio-group>
 		</view>
 		<u-line color="#dfe2e5"></u-line>
-		<mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback">
-			<view class="content3 infoList" v-for="(item,index) in infoList">
-				<view class="item">
-					<view class="title">
-						{{item.title}}({{item.type}})
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
+			<view class="content3" v-for="(item,index) in infoList">
+				<view style="border-bottom: 1px solid #dfe2e5;
+			padding-bottom: 20rpx;
+			padding: 20rpx;">
+					<view class="" style="display: flex;justify-content: space-between;">
+						<view class="">
+							<view class="title">
+								{{item.remark2}}<text
+									style="color:#19be6b;">({{item.carpoolingType=='车找人'?'车主':'乘客'}})</text>
+							</view>
+							<view class="">
+								{{item.explain?item.explain:'无备注'}}
+							</view>
+						</view>
+						<view class="">
+							{{item.departureTime}}
+						</view>
 					</view>
 					<view class="">
-						{{item.content}}
+
 					</view>
-					<view class="call" @tap="call(item)">
-						电话咨询
-						<!-- {{item.phone}} -->
+					<view class="btn-row">
+						<view class="btn-yd" @tap="ydOrder(item)" v-if="item.carpoolingType=='车找人'">
+							预定
+							<!-- {{item.phone}} -->
+						</view>
+						<view class="call" @tap="call(item)">
+							电话咨询
+							<!-- {{item.phone}} -->
+						</view>
 					</view>
 				</view>
 			</view>
-
 		</mescroll-body>
+		<u-modal :show="showAlert" title="提示" content='确认预定拼车信息?' closeOnClickOverlay showCancelButton
+			confirmColor="#19be6b" @cancel="showAlert=false" @close="showAlert=false" @confirm="submit"></u-modal>
 	</view>
 </template>
 
@@ -61,6 +82,11 @@
 		},
 		data() {
 			return {
+				selectData: {},
+				route: '',
+				type: '',
+				navIndex: 0,
+				showAlert: false,
 				navList: [{
 						name: "曲阳⇋北京"
 					},
@@ -104,55 +130,47 @@
 			}
 		},
 		onLoad() {
-			// uni.showLoading({
-			// 	title: '数据加载中'
-			// })
-			// this.$request.baseRequest('admin.gubi.gubiTypeInfo', 'list', {
-			// 		page: 1,
-			// 		limit: 1000
-			// 	},
-			// 	failres => {
-			// 		console.log('res+++++', failres.errmsg)
-			// 		this.$refs.uToast.show({
-			// 			type: 'error',
-			// 			message: failres.errmsg,
-			// 		})
-			// 		uni.hideLoading()
-			// 	}).then(res => {
-			// 	// if (res.errno == 200) {
-			// 	uni.hideLoading()
-			// 	console.log(11)
-			// 	console.log(res.data.items)
-			// 	this.typeOneData = res.data.items
-			// 	this.$request.baseRequest('admin.gubi.gubiTypeSecond', 'list', {
-			// 			page: 1,
-			// 			limit: 1000,
-			// 			typeId: this.typeOneData[0].id
-			// 		},
-			// 		failres => {
-			// 			console.log('res+++++', failres.errmsg)
-			// 			this.$refs.uToast.show({
-			// 				type: 'error',
-			// 				message: failres.errmsg,
-			// 			})
-			// 			uni.hideLoading()
-			// 		}).then(res => {
-			// 		// if (res.errno == 200) {
-			// 		uni.hideLoading()
-			// 		console.log(11)
-			// 		console.log(res.data.items)
-			// 		this.typeTwoData = res.data.items
-			// 		// this.makeData(res.data)
-			// 		// }
-
-			// 	})
-			// 	// this.makeData(res.data)
-			// 	// }
 
-			// })
 
 		},
 		methods: {
+			downCallback() {
+				this.mescroll.resetUpScroll()
+			},
+			clickNav(val, index) {
+				uni.setStorageSync('selectRoute', this.navList[index]);
+				this.navIndex = index
+				this.mescroll.resetUpScroll() // 再刷新列表数据
+			},
+			submit() {
+				console.log("selectData", this.selectData)
+				this.$request.baseRequest('pincheMakeAppointmentApp', 'add', {
+						pincheMakeAppointment: JSON.stringify(this.pincheCarSharing)
+					},
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
+					// if (res.errno == 200) {
+					uni.hideLoading()
+					console.log(11)
+					this.showAlert = false
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+				})
+			},
+			ydOrder(val) {
+				// this.showAlert = true
+				uni.navigateTo({
+					url: "/pages/index/yuding?id=" + val.id
+				})
+				this.selectData = val
+			},
 			call(val) {
 				uni.makePhoneCall({
 					phoneNumber: val.phone
@@ -160,86 +178,75 @@
 			},
 			groupChange(n) {
 				console.log('groupChange', n);
+				if (n == '找车主') {
+					this.type = '车找人'
+				} else {
+					this.type = '人找车'
+				}
+
+				this.mescroll.resetUpScroll() // 再刷新列表数据
 			},
 			upCallback(page) {
-				this.$request.baseRequest('admin.gubi.gubiTransaction', 'list', {
-					pageNum: page.num,
-					pageSize: page.size,
-				}, failres => {
-					console.log('res+++++', failres.errmsg)
-					this.$refs.uToast.show({
-						type: 'error',
-						message: failres.errmsg,
-					})
-					uni.hideLoading()
-				}).then(res => {
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				this.$request.baseRequest('pincheRoutePriceApp', 'list',
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
 					// if (res.errno == 200) {
 					uni.hideLoading()
 					console.log(11)
-					let curPageData = res.data.items;
-					let totalPage = res.data.total;
-					let curPageLen = curPageData.length;
-					this.mescroll.endByPage(curPageLen, totalPage);
-					console.log(res.data)
-					// this.makeData(res.data)
-					if (page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
-					this.dataList = this.dataList.concat(curPageData); //追加新数据
-					for (let i = 0; i < this.dataList.length; i++) {
-						// this.dataList[i].urlPath = this.dataList[i].urlPath.split(",")
+					console.log(res.data.items)
+					this.navList = res.data.items
+					uni.setStorageSync('selectRoute', this.navList[this.navIndex]);
+					this.route = this.navList[this.navIndex].route
+					if (this.radiovalue1 == '找车主') {
+						this.type = '车找人'
+					} else {
+						this.type = '人找车'
 					}
-					// }
+					console.log(this.navList, this.navIndex)
+					this.$request.baseRequest('pincheCarSharingApp', 'list', {
+						remark2: this.route,
+						carpoolingType: this.type,
+						pageNum: page.num,
+						pageSize: page.size,
+					}, failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
+						// if (res.errno == 200) {
+						uni.hideLoading()
+						console.log(11)
+						let curPageData = res.data.items;
+						let totalPage = res.data.total;
+						let curPageLen = curPageData.length;
+						this.mescroll.endByPage(curPageLen, totalPage);
+						console.log(res.data)
+						// this.makeData(res.data)
+						if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
+						this.infoList = this.infoList.concat(curPageData); //追加新数据
+						// }
+
+					})
 
 				})
-				// // 此处可以继续请求其他接口
-				// // if(page.num == 1){
-				// // 	// 请求其他接口...
-				// // }
 
-				// // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
-				// // if(!this.isInitxx){
-				// // 	apiGetxx().then(res=>{
-				// // 		this.isInitxx = true
-				// // 		this.mescroll.resetUpScroll() // 重新触发upCallback
-				// // 	}).catch(()=>{
-				// // 		this.mescroll.endErr()
-				// // 	})
-				// // 	return // 此处return,先获取xx
-				// // }
 
-				// let pageNum = page.num; // 页码, 默认从1开始
-				// let pageSize = page.size; // 页长, 默认每页10条
-				// uni.request({
-				// 	url: 'xxxx?pageNum=' + pageNum + '&pageSize=' + pageSize,
-				// 	success: (data) => {
-				// 		// 接口返回的当前页数据列表 (数组)
-				// 		// let curPageData = data.xxx;
-				// 		// // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
-				// 		// let curPageLen = curPageData.length;
-				// 		// // 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
-				// 		// let totalPage = data.xxx;
-				// 		// // 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
-				// 		// let totalSize = data.xxx;
-				// 		// // 接口返回的是否有下一页 (true/false)
-				// 		// let hasNext = data.xxx;
 
-				// 		//设置列表数据
-				// 		if (page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
-				// 		this.dataList = this.dataList.concat(curPageData); //追加新数据
 
-				// 		// 请求成功,隐藏加载状态
-				// 		//方法一(推荐): 后台接口有返回列表的总页数 totalPage
-				// 		// this.mescroll.endByPage(curPageLen, totalPage);
-				// 		this.mescroll.endByPage(0, 0);
-				// 		setTimeout(() => {
-				// 			// this.mescroll.endSuccess(curPageLen)
-				// this.mescroll.endSuccess(0)
-				// 		}, 20)
-				// 	},
-				// 	fail: () => {
-				// 		//  请求失败,隐藏加载状态
-				// 		this.mescroll.endErr()
-				// 	}
-				// })
+
+
 
 			},
 		}
@@ -264,6 +271,11 @@
 			font-size: 26rpx;
 			margin: 20rpx;
 		}
+
+		.nav-active {
+			background: #19be6b;
+			color: #fff;
+		}
 	}
 
 	.content2 {
@@ -271,11 +283,12 @@
 	}
 
 	.content3 {
-		padding: 20rpx;
+
 
 		.item {
 			border-bottom: 1px solid #dfe2e5;
 			padding-bottom: 20rpx;
+			padding: 20rpx;
 		}
 
 		.call {
@@ -283,9 +296,25 @@
 			background: #f7f7f7;
 			border: 1px solid #dfe2e5;
 			border-radius: 10rpx;
-			padding: 20rpx 8rpx;
+			padding: 20rpx 30rpx;
 			font-size: 26rpx;
 			margin: 20rpx;
 		}
 	}
+
+	.btn-row {
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.btn-yd {
+			color: white;
+			text-align: center;
+			background: #19be6b;
+			border: 1px solid #19be6b;
+			border-radius: 10rpx;
+			padding: 20rpx 30rpx;
+			font-size: 26rpx;
+		}
+	}
 </style>

+ 500 - 0
pinche/pages/index/yuding.vue

@@ -0,0 +1,500 @@
+<template>
+	<view class="content">
+		<view class="content1">
+			<view class="row">
+				<view class="">
+					{{pincheMakeAppointment.route}}
+				</view>
+			</view>
+		</view>
+		<view class="content2">
+			<u--form labelPosition="left" :model="pincheMakeAppointment" ref="form1" labelWidth='100px'>
+				<u-form-item label="拼车类型" prop="pincheMakeAppointment.carpoolingType" borderBottom>
+					<u--input v-model="pincheMakeAppointment.carpoolingType" border="none" disabled
+						disabledColor="#ffffff" placeholder="拼车类型"></u--input>
+				</u-form-item>
+				<u-form-item label="预约人" prop="appointedBy" borderBottom ref="item1" v-if='showInfo!=1'>
+					<u--input v-model="pincheMakeAppointment.appointedBy" border="none" disabled disabledColor="#ffffff"
+						placeholder="预约人"></u--input>
+				</u-form-item>
+				<u-form-item label="我的电话" prop="phone" borderBottom ref="item1">
+					<u--input v-model="pincheMakeAppointment.phone" border="none" disabled></u--input>
+				</u-form-item>
+				<!-- <u-form-item label="司机号码" prop="phone" borderBottom ref="item1">
+					<u--input v-model="pincheMakeAppointment.phone" border="none" disabled></u--input>
+				</u-form-item> -->
+				<u-form-item label="拼车费用" prop="remark1" borderBottom ref="item1" v-if='showInfo!=1'>
+					<u--input v-model="pincheMakeAppointment.remark1" border="none" disabled disabledColor="#ffffff"
+						placeholder="根据出发,到达地点计算价格"></u--input>
+				</u-form-item>
+				<u-form-item label="座位数量" prop="remark1" borderBottom ref="item1" v-if='showInfo==1'>
+					<u--input v-model="pincheMakeAppointment.remark1" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="出发时间" prop="pincheMakeAppointment.time" borderBottom
+					@click="show = true; hideKeyboard()" ref="item1">
+					<u--input v-model="pincheMakeAppointment.departureTime" disabled disabledColor="#ffffff"
+						placeholder="请选择出发时间" border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="出发地点" prop="pincheMakeAppointment.startPlace" borderBottom
+					@click="selectStartPlace(); hideKeyboard()" ref="item1">
+					<u--input v-model="pincheMakeAppointment.startPlace" disabled disabledColor="#ffffff"
+						placeholder="请选择出发地点" border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="到达地点" prop="pincheMakeAppointment.endPlace" borderBottom
+					@click="selectendPlace(); hideKeyboard()" ref="item1">
+					<u--input v-model="pincheMakeAppointment.endPlace" disabled disabledColor="#ffffff"
+						placeholder="请选择到达地点" border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="人数" prop="numberPeople" ref="item1" v-if='showInfo!=1'>
+					<u-number-box button-size="36" color="#ffffff" bgColor="#19be6b" iconStyle="color: #fff"
+						v-model="pincheMakeAppointment.numberPeople" @change='changeNumber' min='1'>
+					</u-number-box>
+				</u-form-item>
+				<u-form-item>
+					<text
+						style="color: #fff;background:#19be6b;border-radius: 20rpx;padding:10rpx 20rpx;width: 140rpx;text-align: center;"
+						@click="jsPrcie()">计算价格</text>
+				</u-form-item>
+			</u--form>
+			<u-datetime-picker :show="show" v-model="value1" mode="datetime" @cancel="show=false" @confirm="confirmTime"
+				:closeOnClickOverlay='true' @close="show=false" :formatter="formatter">
+			</u-datetime-picker>
+		</view>
+		<view class="sm">
+			说明
+		</view>
+		<u--textarea placeholder="其他内容,可选" confirmType="done" count v-model="pincheCarSharing.explain"></u--textarea>
+		<!-- <view class="content3">
+			<u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange"
+				activeColor="#19be6b">
+				<u-checkbox label="阅读并同意" name="阅读并同意">
+				</u-checkbox>
+			</u-checkbox-group>
+			<view class="">
+				《相关拼车条款》
+			</view>
+		</view> -->
+		<view class="content4">
+			被举报黑车,高价,与发布金额不符,将受到处罚或者拉黑,请勿轻易越过红线。
+		</view>
+		<u-button text="预定拼车" type="success" class="custom-style" @click='fbClick' color="#19be6b"></u-button>
+		<u-modal :show="showAlert" title="提示" content='确认预定拼车信息?' closeOnClickOverlay showCancelButton
+			confirmColor="#19be6b" @cancel="showAlert=false" @close="showAlert=false" @confirm="submit"></u-modal>
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+
+<script>
+	var qqmapsdk;
+	import QQMapWX from '../../js_sdk/qqmap-wx-jssdk.min.js'
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		components: {
+
+		},
+		computed: {
+			...mapState(['hasLogin'])
+		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// this.$refs.form1.setRules(this.rules)
+		},
+		onShow() {
+			// if (this.hasLogin || uni.getStorageSync("pincheCarSharing").username) {
+			// 	this.pincheCarSharing = uni.getStorageSync("pincheCarSharing")
+			// } else {
+			// 	uni.navigateTo({
+			// 		url: "/pages/login/login"
+			// 	})
+			// 	// uni.({
+			// 	// 	url: '/pages/index/index'
+			// 	// })
+			// }
+		},
+		data() {
+			return {
+				userInfo: {},
+				getData: {},
+				onePersonPrice: null,
+				placeTo: {},
+				placeFrom: {},
+				routeIndex: 0,
+				startRoute: '',
+				endRoute: '',
+				showAlert: false,
+				showInfo: 0,
+				checkboxValue1: [],
+				show: false,
+				value1: Number(new Date()),
+				isShow: false,
+				showSex: false,
+				pincheMakeAppointment: {
+					startPlace: '',
+					endPlace: '',
+					numberPeople: 1,
+					route: '',
+					appointedBy: '',
+					carpoolingType: '',
+					phone: '',
+					departureTime: '',
+					price: '200',
+					unitPrice: '',
+
+				},
+
+				actions: [{
+						name: '车找人',
+					},
+					{
+						name: '人找车',
+					}
+				],
+				// rules: {
+				// 	'route': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择路线',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// 	'carpoolingType': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择男或女',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// 	'phone': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择男或女',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// },
+				radio: '',
+				switchVal: false
+
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			if (this.hasLogin || uni.getStorageSync("userInfo").phone) {
+				this.userInfo = uni.getStorageSync("userInfo")
+				// this.init()
+				this.init()
+				qqmapsdk = new QQMapWX({
+					key: '5HXBZ-A5UK6-5VLSP-EPCV2-4WMSQ-PLFCP'
+				});
+			} else {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			}
+		},
+		methods: {
+			init() {
+				this.$request.baseRequest('pincheCarSharingApp', 'get', {
+						id: this.id
+					},
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
+					console.log(res.data)
+					this.pincheMakeAppointment.carpoolingType = res.data.carpoolingType
+					this.pincheMakeAppointment.route = res.data.route
+					this.pincheMakeAppointment.unitPrice = res.data.unitPrice
+					this.pincheMakeAppointment.appointedBy = this.userInfo.nickname
+					this.pincheMakeAppointment.phone = this.userInfo.phone
+					this.pincheMakeAppointment.remark3 = res.data.phone
+					this.pincheMakeAppointment.remark2 = res.data.id
+					this.pincheMakeAppointment.remark1 = this.userInfo.id
+
+					// this.pincheMakeAppointment.price =
+
+
+
+
+
+				})
+			},
+			changeNumber(e) {
+				console.log(e)
+				// this.onePersonPrice = this.pincheMakeAppointment.unitPrice
+				// if (this.onePersonPrice) {
+				this.pincheMakeAppointment.price = this.onePersonPrice * e.value
+				// }
+			},
+			jsPrcie() {
+				if (this.pincheMakeAppointment.startPlace && this.pincheMakeAppointment.endPlace) {
+					console.log('调用腾讯地图api')
+					qqmapsdk.calculateDistance({
+						mode: 'driving',
+						from: this.placeFrom,
+						to: [this.placeTo],
+						success: function(res) {
+
+							console.log("腾讯地图获取的距离")
+							console.log(res)
+							let _km = Number(res.result.elements[0].distance * 0.001)
+								.toFixed(2)
+							console.log("km", _km)
+							this.onePersonPrice = Number(Number(_km * this.pincheMakeAppointment.unitPrice)
+								.toFixed(
+									2))
+							this.pincheMakeAppointment.price = Number(Number(_km * this.pincheMakeAppointment
+								.unitPrice).toFixed(
+								2) * this.pincheMakeAppointment.numberPeople)
+							console.log("this.pincheMakeAppointment.price", this
+								.pincheMakeAppointment.price)
+						},
+						fail: function(err) {
+							console.log("腾讯地图获取距离失败")
+							console.log(err)
+
+						}
+					})
+				} else {
+					uni.showToast({
+						title: "未选择出发地或到达地",
+						mask: true,
+						icon: 'none'
+					})
+				}
+			},
+			selectStartPlace() {
+				console.log(123)
+				let that = this
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						that.pincheMakeAppointment.startPlace = res.address
+						that.placeFrom = {
+							latitude: res.latitude,
+							longitude: res.longitude
+						}
+					}
+				});
+			},
+			selectendPlace() {
+				console.log(123)
+				let that = this
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						that.pincheMakeAppointment.endPlace = res.address
+						that.placeTo = {
+							latitude: res.latitude,
+							longitude: res.longitude
+						}
+						if (that.pincheMakeAppointment.startPlace && that.pincheMakeAppointment.endPlace) {
+							console.log('调用腾讯地图api')
+							qqmapsdk.calculateDistance({
+								mode: 'driving',
+								from: that.placeFrom,
+								to: [that.placeTo],
+								success: function(res) {
+
+									console.log("腾讯地图获取的距离")
+									console.log(res)
+									let _km = Number(res.result.elements[0].distance * 0.001)
+										.toFixed(2)
+									console.log("km", _km)
+									that.pincheMakeAppointment.remark1 = Number(Number(_km * uni
+										.getStorageSync('selectRoute').remark1).toFixed(
+										2))
+									console.log("that.pincheMakeAppointment.remark1", that
+										.pincheMakeAppointment.remark1)
+								},
+								fail: function(err) {
+									console.log("腾讯地图获取距离失败")
+									console.log(err)
+
+								}
+							})
+						}
+					}
+				});
+			},
+			routeClick(type) {
+				console.log(type)
+				this.routeIndex = type
+
+				if (type == 1) {
+					this.pincheMakeAppointment.route = this.startRoute + '→' + this.endRoute
+				} else if (type == 2) {
+					this.pincheMakeAppointment.route = this.endRoute + '→' + this.startRoute
+				}
+
+			},
+			fbClick() {
+				console.log(1)
+				this.showAlert = true
+			},
+			submit() {
+				console.log(this.pincheMakeAppointment)
+				this.$request.baseRequest('pincheMakeAppointmentApp', 'add', {
+						pincheMakeAppointment: JSON.stringify(this.pincheMakeAppointment)
+					},
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
+					// if (res.errno == 200) {
+					uni.showToast({
+						mask: true,
+						title: '预定成功!'
+					})
+					uni.hideLoading()
+					console.log(11)
+					this.showAlert = false
+					uni.switchTab({
+						url: '/pages/order/order'
+					})
+					// console.log(res.data.items)
+					// this.typeTwoData = res.data.items
+					// this.makeData(res.data)
+					// }
+
+				})
+				// console.log(1)
+				// this.showAlert = true
+			},
+			checkboxChange(n) {
+				console.log('change', n);
+			},
+			formatter(type, value) {
+				if (type === 'year') {
+					return `${value}年`
+				}
+				if (type === 'month') {
+					return `${value}月`
+				}
+				if (type === 'day') {
+					return `${value}日`
+				}
+				return value
+			},
+			confirmTime(e) {
+				console.log(this.result(e.value, e.mode))
+				this.pincheMakeAppointment.departureTime = this.result(e.value, e.mode)
+				this.show = false
+
+			},
+			result(time, mode) {
+				const timeFormat = uni.$u.timeFormat,
+					toast = uni.$u.toast
+				switch (mode) {
+					case 'datetime':
+						return timeFormat(time, 'yyyy-mm-dd hh:MM')
+
+				}
+			},
+			setInfo() {
+				this.isShow = true
+			},
+			sexSelect(e) {
+				console.log(e)
+				this.pincheMakeAppointment.carpoolingType = e.name
+				this.$refs.form1.validateField('pincheMakeAppointment.carpoolingType')
+
+				if (e.name == '车找人') {
+					this.showInfo = 1
+				} else {
+					this.showInfo = 2
+				}
+			},
+			hideKeyboard() {
+				uni.hideKeyboard()
+			},
+		}
+
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		padding-bottom: 40rpx;
+		box-sizing: border-box;
+	}
+
+	.content1 {
+		.row {
+			background: #fff;
+			border-bottom: 1px solid #dfe2e5;
+			padding: 20rpx;
+			display: flex;
+			justify-content: space-between;
+		}
+	}
+
+	.content2 {
+		margin-top: 20rpx;
+		padding: 20rpx;
+		background: #fff;
+	}
+
+	.sm {
+		margin: 20rpx;
+	}
+
+	.content3 {
+		display: flex;
+		align-items: center;
+		margin: 20rpx;
+	}
+
+	.content4 {
+		color: red;
+		padding: 0 20rpx;
+	}
+
+	.custom-style {
+		width: 90%;
+		margin-top: 20rpx;
+	}
+
+	.fbxc {
+		color: #19be6b;
+		border: 1px solid #19be6b;
+		border-radius: 20rpx;
+		padding: 20rpx;
+		margin: 20rpx;
+		display: flex;
+		justify-content: center;
+	}
+
+	/deep/view,
+	/deep/scroll-view,
+	/deep/swiper-item {
+		display: flex;
+		flex-direction: column;
+		flex-shrink: 0;
+		flex-grow: 0;
+		flex-basis: auto;
+		align-items: stretch;
+		align-content: flex-start;
+	}
+</style>

+ 468 - 0
pinche/pages/info/add.vue

@@ -0,0 +1,468 @@
+<template>
+	<view class="content">
+		<view class="content1">
+			<view class="row" @click="routeClick(1)">
+				<view class="">
+					{{startRoute}}→{{endRoute}}
+				</view>
+				<u-icon name="checkbox-mark" color="#19be6b" size="20" v-if="routeIndex==1">
+				</u-icon>
+
+			</view>
+			<view class="row" @click="routeClick(2)">
+				<view class="">
+					{{endRoute}}→{{startRoute}}
+				</view>
+				<u-icon name="checkbox-mark" color="#19be6b" size="20" v-if="routeIndex==2">
+				</u-icon>
+			</view>
+		</view>
+		<view class="content2">
+			<u--form labelPosition="left" :model="pincheCarSharing" ref="form1" labelWidth='100px'>
+				<u-form-item label="拼车类型" prop="pincheCarSharing.carpoolingType" borderBottom
+					@click="showSex = true; hideKeyboard()" ref="item1">
+					<u--input v-model="pincheCarSharing.carpoolingType" disabled disabledColor="#ffffff"
+						placeholder="请选择拼车类型" border="none"></u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="拼车费用" prop="remark1" borderBottom ref="item1" v-if='showInfo!=1'>
+					<u--input v-model="pincheCarSharing.remark1" border="none" disabled disabledColor="#ffffff"
+						placeholder="根据出发,到达地点计算价格" style='width: 70%;'></u--input>
+
+				</u-form-item>
+				<u-form-item label="座位数量" prop="remark1" borderBottom ref="item1" v-if='showInfo==1'>
+					<u--input v-model="pincheCarSharing.remark1" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="出发时间" prop="pincheCarSharing.time" borderBottom @click="show = true; hideKeyboard()"
+					ref="item1">
+					<u--input v-model="pincheCarSharing.departureTime" disabled disabledColor="#ffffff"
+						placeholder="请选择出发时间" border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="手机号码" prop="phone" borderBottom ref="item1">
+					<u--input v-model="pincheCarSharing.phone" border="none" disabled></u--input>
+				</u-form-item>
+				<u-form-item label="出发地点" prop="pincheCarSharing.startPlace" borderBottom
+					@click="selectStartPlace(); hideKeyboard()" ref="item1">
+					<u--input v-model="pincheCarSharing.startPlace" disabled disabledColor="#ffffff"
+						placeholder="请选择出发地点" border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="到达地点" prop="pincheCarSharing.endPlace" borderBottom
+					@click="selectendPlace(); hideKeyboard()" ref="item1">
+					<u--input v-model="pincheCarSharing.endPlace" disabled disabledColor="#ffffff" placeholder="请选择到达地点"
+						border="none">
+					</u--input>
+					<u-icon slot="right" name="arrow-right"></u-icon>
+				</u-form-item>
+				<u-form-item label="人数" prop="numberPeople" ref="item1" v-if='showInfo!=1'>
+					<u-number-box button-size="36" color="#ffffff" bgColor="#19be6b" iconStyle="color: #fff"
+						v-model="pincheCarSharing.numberPeople" @change='changeNumber' min='1'>
+					</u-number-box>
+				</u-form-item>
+				<u-form-item v-if='showInfo!=1'>
+					<text
+						style="color: #fff;background:#19be6b;border-radius: 20rpx;padding:10rpx 20rpx;width: 100rpx;text-align: center;"
+						@click="jsPrcie()">计算价格</text>
+				</u-form-item>
+
+			</u--form>
+			<u-action-sheet :show="showSex" :actions="actions" title="请选拼车类型" @close="showSex = false"
+				@select="sexSelect">
+			</u-action-sheet>
+			<u-datetime-picker :show="show" v-model="value1" mode="datetime" @cancel="show=false" @confirm="confirmTime"
+				:closeOnClickOverlay='true' @close="show=false" :formatter="formatter">
+			</u-datetime-picker>
+		</view>
+		<view class="sm">
+			说明
+		</view>
+		<u--textarea placeholder="其他内容,可选" confirmType="done" count v-model="pincheCarSharing.explain"></u--textarea>
+		<!-- <view class="content3">
+			<u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange"
+				activeColor="#19be6b">
+				<u-checkbox label="阅读并同意" name="阅读并同意">
+				</u-checkbox>
+			</u-checkbox-group>
+			<view class="">
+				《相关拼车条款》
+			</view>
+		</view> -->
+		<view class="content4">
+			被举报黑车,高价,与发布金额不符,将受到处罚或者拉黑,请勿轻易越过红线。
+		</view>
+		<u-button text="发布拼车" type="success" class="custom-style" @click='fbClick'></u-button>
+		<u-modal :show="showAlert" title="提示" content='确认发布拼车信息?' closeOnClickOverlay showCancelButton
+			confirmColor="#19be6b" @cancel="showAlert=false" @close="showAlert=false" @confirm="submit"></u-modal>
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+
+<script>
+	var qqmapsdk;
+	import QQMapWX from '../../js_sdk/qqmap-wx-jssdk.min.js'
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		components: {
+
+		},
+		computed: {
+			...mapState(['hasLogin'])
+		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// this.$refs.form1.setRules(this.rules)
+		},
+		onShow() {
+			// if (this.hasLogin || uni.getStorageSync("pincheCarSharing").username) {
+			// 	this.pincheCarSharing = uni.getStorageSync("pincheCarSharing")
+			// } else {
+			// 	uni.navigateTo({
+			// 		url: "/pages/login/login"
+			// 	})
+			// 	// uni.({
+			// 	// 	url: '/pages/index/index'
+			// 	// })
+			// }
+		},
+		data() {
+			return {
+				onePersonPrice: null,
+				placeTo: {},
+				placeFrom: {},
+				routeIndex: 0,
+				startRoute: '',
+				endRoute: '',
+				showAlert: false,
+				showInfo: 0,
+				checkboxValue1: [],
+				show: false,
+				value1: Number(new Date()),
+				isShow: false,
+				showSex: false,
+				pincheCarSharing: {
+					startPlace: '',
+					endPlace: '',
+					numberPeople: 1
+				},
+
+				actions: [{
+						name: '车找人',
+					},
+					{
+						name: '人找车',
+					}
+				],
+				// rules: {
+				// 	'route': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择路线',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// 	'carpoolingType': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择男或女',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// 	'phone': {
+				// 		type: 'string',
+				// 		required: true,
+				// 		message: '请选择男或女',
+				// 		trigger: ['blur', 'change']
+				// 	},
+				// },
+				radio: '',
+				switchVal: false
+
+			}
+		},
+		onLoad() {
+			if (this.hasLogin || uni.getStorageSync("userInfo").phone) {
+				this.userInfo = uni.getStorageSync("userInfo")
+				// this.init()
+				console.log(this.userInfo)
+				this.pincheCarSharing.phone = this.userInfo.phone
+				this.startRoute = uni.getStorageSync('selectRoute').route.split('⇋')[0]
+				this.endRoute = uni.getStorageSync('selectRoute').route.split('⇋')[1]
+				this.pincheCarSharing.remark2 = uni.getStorageSync('selectRoute').route
+				this.pincheCarSharing.unitPrice = uni.getStorageSync('selectRoute').unitPrice
+				qqmapsdk = new QQMapWX({
+					key: '5HXBZ-A5UK6-5VLSP-EPCV2-4WMSQ-PLFCP'
+				});
+			} else {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			}
+
+		},
+		methods: {
+			changeNumber(e) {
+				console.log(e)
+				this.onePersonPrice = 100
+				if (this.onePersonPrice) {
+					this.pincheCarSharing.remark1 = this.onePersonPrice * e.value
+				}
+			},
+			jsPrcie() {
+				if (this.pincheCarSharing.startPlace && this.pincheCarSharing.endPlace) {
+					console.log('调用腾讯地图api')
+					qqmapsdk.calculateDistance({
+						mode: 'driving',
+						from: this.placeFrom,
+						to: [this.placeTo],
+						success: function(res) {
+
+							console.log("腾讯地图获取的距离")
+							console.log(res)
+							let _km = Number(res.result.elements[0].distance * 0.001)
+								.toFixed(2)
+							console.log("km", _km)
+							this.onePersonPrice = Number(Number(_km * uni
+								.getStorageSync('selectRoute').remark1).toFixed(
+								2))
+							this.pincheCarSharing.remark1 = Number(Number(_km * uni
+								.getStorageSync('selectRoute').remark1).toFixed(
+								2) * this.pincheCarSharing.numberPeople)
+							console.log("this.pincheCarSharing.remark1", this
+								.pincheCarSharing.remark1)
+						},
+						fail: function(err) {
+							console.log("腾讯地图获取距离失败")
+							console.log(err)
+
+						}
+					})
+				} else {
+					uni.showToast({
+						title: "未选择出发地或到达地",
+						mask: true,
+						icon: 'none'
+					})
+				}
+			},
+			selectStartPlace() {
+				console.log(123)
+				let that = this
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						that.pincheCarSharing.startPlace = res.address
+						that.placeFrom = {
+							latitude: res.latitude,
+							longitude: res.longitude
+						}
+					}
+				});
+			},
+			selectendPlace() {
+				console.log(123)
+				let that = this
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						that.pincheCarSharing.endPlace = res.address
+						that.placeTo = {
+							latitude: res.latitude,
+							longitude: res.longitude
+						}
+						if (that.pincheCarSharing.startPlace && that.pincheCarSharing.endPlace) {
+							console.log('调用腾讯地图api')
+							qqmapsdk.calculateDistance({
+								mode: 'driving',
+								from: that.placeFrom,
+								to: [that.placeTo],
+								success: function(res) {
+
+									console.log("腾讯地图获取的距离")
+									console.log(res)
+									let _km = Number(res.result.elements[0].distance * 0.001)
+										.toFixed(2)
+									console.log("km", _km)
+									that.pincheCarSharing.remark1 = Number(Number(_km * uni
+										.getStorageSync('selectRoute').remark1).toFixed(
+										2))
+									console.log("that.pincheCarSharing.remark1", that
+										.pincheCarSharing.remark1)
+								},
+								fail: function(err) {
+									console.log("腾讯地图获取距离失败")
+									console.log(err)
+
+								}
+							})
+						}
+					}
+				});
+			},
+			routeClick(type) {
+				console.log(type)
+				this.routeIndex = type
+
+				if (type == 1) {
+					this.pincheCarSharing.route = this.startRoute + '→' + this.endRoute
+				} else if (type == 2) {
+					this.pincheCarSharing.route = this.endRoute + '→' + this.startRoute
+				}
+
+			},
+			fbClick() {
+				console.log(1)
+				this.showAlert = true
+			},
+			submit() {
+				this.$request.baseRequest('pincheCarSharingApp', 'add', {
+						pincheCarSharing: JSON.stringify(this.pincheCarSharing)
+					},
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+						uni.hideLoading()
+					}).then(res => {
+					// if (res.errno == 200) {
+					uni.hideLoading()
+					console.log(11)
+					this.showAlert = false
+					uni.switchTab({
+						url: '/pages/info/info'
+					})
+					// console.log(res.data.items)
+					// this.typeTwoData = res.data.items
+					// this.makeData(res.data)
+					// }
+
+				})
+				// console.log(1)
+				// this.showAlert = true
+			},
+			checkboxChange(n) {
+				console.log('change', n);
+			},
+			formatter(type, value) {
+				if (type === 'year') {
+					return `${value}年`
+				}
+				if (type === 'month') {
+					return `${value}月`
+				}
+				if (type === 'day') {
+					return `${value}日`
+				}
+				return value
+			},
+			confirmTime(e) {
+				console.log(this.result(e.value, e.mode))
+				this.pincheCarSharing.departureTime = this.result(e.value, e.mode)
+				this.show = false
+
+			},
+			result(time, mode) {
+				const timeFormat = uni.$u.timeFormat,
+					toast = uni.$u.toast
+				switch (mode) {
+					case 'datetime':
+						return timeFormat(time, 'yyyy-mm-dd hh:MM')
+
+				}
+			},
+			setInfo() {
+				this.isShow = true
+			},
+			sexSelect(e) {
+				console.log(e)
+				this.pincheCarSharing.carpoolingType = e.name
+				// this.$refs.form1.validateField('pincheCarSharing.carpoolingType')
+
+				if (e.name == '车找人') {
+					this.showInfo = 1
+				} else {
+					this.showInfo = 2
+				}
+			},
+			hideKeyboard() {
+				uni.hideKeyboard()
+			},
+		}
+
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		padding-bottom: 40rpx;
+		box-sizing: border-box;
+	}
+
+	.content1 {
+		.row {
+			background: #fff;
+			border-bottom: 1px solid #dfe2e5;
+			padding: 20rpx;
+			display: flex;
+			justify-content: space-between;
+		}
+	}
+
+	.content2 {
+		margin-top: 20rpx;
+		padding: 20rpx;
+		background: #fff;
+	}
+
+	.sm {
+		margin: 20rpx;
+	}
+
+	.content3 {
+		display: flex;
+		align-items: center;
+		margin: 20rpx;
+	}
+
+	.content4 {
+		color: red;
+		padding: 0 20rpx;
+	}
+
+	.custom-style {
+		width: 90%;
+		margin-top: 20rpx;
+	}
+
+	.fbxc {
+		color: #19be6b;
+		border: 1px solid #19be6b;
+		border-radius: 20rpx;
+		padding: 20rpx;
+		margin: 20rpx;
+		display: flex;
+		justify-content: center;
+	}
+
+	/deep/.swiper-item {
+		display: flex;
+		flex-direction: row;
+		flex-shrink: 0;
+		flex-grow: 0;
+		flex-basis: auto;
+		align-items: stretch;
+		align-content: flex-start;
+	}
+</style>

+ 329 - 186
pinche/pages/info/info.vue

@@ -1,80 +1,91 @@
 <template>
 	<view class="warp">
-		<u-button :plain="true" text="发布行程" color="#19be6b" @click="setInfo" v-if="!isShow"
-			customStyle="margin-top:40rpx"></u-button>
-		<view class="content" v-if="isShow">
-			<view class="content1">
-				<view class="row">
-					北京→定州
+		<view @click="setInfo" class="fbxc">发布行程</view>
+		<mescroll-body ref="mescrollRef" @up="upCallback" @down="downCallback">
+			<view class="content3 infoList" v-for="(item,index) in infoList" :key="index">
+				<view class="row1">
+					<view class="left">
+						{{item.departureTime}}
+					</view>
+					<view class="right" v-if="item.status=='进行中'" style="color:#19be6b;">
+						{{item.status}}
+					</view>
+					<view class="right" v-if="item.status=='已取消'" style="color:gray;">
+						{{item.status}}
+					</view>
 				</view>
-				<view class="row">
-					北京→定州
+				<view class="row2">
+					路线:{{item.route}}
+				</view>
+				<view class="type" style="margin: 20rpx 0; color: gray;font-weight: 700;">
+					{{item.carpoolingType}}
+				</view>
+				<view class="detail" v-if="item.carpoolingType=='人找车'">
+					<view class="left" @click="detail(item)">
+						查看详情
+					</view>
+					<view class="right" @click="cancalWay(item)" v-if="item.status=='进行中'">
+						取消行程
+					</view>
+				</view>
+				<view class="row3" v-if="item.carpoolingType=='车找人'">
+					已预定座位:0 【剩余座位{{item.remark1}}】
+				</view>
+				<view class="row4" v-if="item.carpoolingType=='车找人'">
+					<view class="btn" @click="changeSit(item)">
+						调整座位
+					</view>
+					<view class="btn" @click="cancalWay(item)">
+						取消行程
+					</view>
+					<view class="btn" @click="lookOrder(item)">
+						查看预定>
+					</view>
 				</view>
 			</view>
-			<view class="content2">
-				<u--form labelPosition="left" :model="model1" :rules="rules" ref="form1" labelWidth='100px'>
-					<u-form-item label="拼车类型" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()"
-						ref="item1">
-						<u--input v-model="model1.userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择拼车类型"
-							border="none"></u--input>
-						<u-icon slot="right" name="arrow-right"></u-icon>
-					</u-form-item>
-					<u-form-item label="出发时间" prop="userInfo.time" borderBottom @click="show = true; hideKeyboard()"
-						ref="item1">
-						<u--input v-model="selectTime" disabled disabledColor="#ffffff" placeholder="请选择出发时间"
-							border="none">
-						</u--input>
-						<u-icon slot="right" name="arrow-right"></u-icon>
-					</u-form-item>
-					<u-form-item label="手机号码" prop="userInfo.name" borderBottom ref="item1">
-						<u--input v-model="model1.userInfo.name" border="none"></u--input>
-					</u-form-item>
-					<u-form-item label="出发地点" prop="userInfo.name" borderBottom ref="item1">
-						<u--input v-model="model1.userInfo.name" border="none"></u--input>
-					</u-form-item>
-					<u-form-item label="到达地点" prop="userInfo.name" borderBottom ref="item1">
-						<u--input v-model="model1.userInfo.name" border="none"></u--input>
-					</u-form-item>
-					<u-form-item label="人数" prop="userInfo.name" ref="item1">
-						<u-number-box button-size="36" color="#ffffff" bgColor="#19be6b" iconStyle="color: #fff">
-						</u-number-box>
-					</u-form-item>
-
-				</u--form>
-				<u-action-sheet :show="showSex" :actions="actions" title="请选拼车类型" @close="showSex = false"
-					@select="sexSelect">
-				</u-action-sheet>
-				<u-datetime-picker :show="show" v-model="value1" mode="datetime" @cancel="show=false"
-					@confirm="confirmTime" :closeOnClickOverlay='true' @close="show=false" :formatter="formatter">
-				</u-datetime-picker>
-			</view>
-			<view class="sm">
-				说明
+
+		</mescroll-body>
+		<u-popup :show="showDetail" @close="close" @open="open" mode="center" customStyle="width:70%" :round="10">
+			<u-cell-group>
+				<u-cell title="类型:" :value="selectItem.carpoolingType"></u-cell>
+				<u-cell title="方向:" :value="selectItem.route"></u-cell>
+				<u-cell title="时间:" :value="selectItem.departureTime"></u-cell>
+				<u-cell title="出发:" :value="selectItem.startPlace"></u-cell>
+				<u-cell title="到达:" :value="selectItem.endPlace"></u-cell>
+				<u-cell title="手机:" :value="selectItem.phone"></u-cell>
+				<u-cell title="人数:" :value="selectItem.numberPeople"></u-cell>
+				<!-- <u-cell title="说明:" :value="selectItem.explain"></u-cell> -->
+			</u-cell-group>
+		</u-popup>
+		<u-popup :show="showSit" @close="close1" @open="open1" mode="center" customStyle="width:80%;padding:20rpx"
+			:round="10" class='sit'>
+			<view class="title">
+				调整座位
 			</view>
-			<u--textarea placeholder="其他内容,可选" confirmType="done" count></u--textarea>
-			<view class="content3">
-				<u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange"
-					activeColor="#19be6b">
-					<u-checkbox label="阅读并同意" name="阅读并同意">
-					</u-checkbox>
-				</u-checkbox-group>
-				<view class="">
-					《相关拼车条款》
-				</view>
+			<view class="title2">
+				输入最新剩余座位数,如车满设置为0
 			</view>
-			<view class="content4">
-				被举报黑车,高价,与发布金额不符,将受到处罚或者拉黑,请勿轻易越过红线。
+			<u--input placeholder="请输入内容" border="surround" v-model="value" @change="change"></u--input>
+			<view class="btn-list">
+				<u-button text="取消" class='btn' @click="qx"></u-button>
+				<u-button type="primary" :plain="true" text="确定" color="#19be6b" class='btn' @click="sitSubmit">
+				</u-button>
 			</view>
-			<u-button text="发布拼车" type="success" class="custom-style"></u-button>
-		</view>
+		</u-popup>
+		<u-toast ref="uToast"></u-toast>
+		<u-modal :show="showAlert" title="提示" content='确认取消行程?' closeOnClickOverlay showCancelButton
+			confirmColor="#19be6b" @cancel="showAlert=false" @close="showAlert=false" @confirm="submit">
+		</u-modal>
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import {
 		mapState
 	} from 'vuex';
 	export default {
+		mixins: [MescrollMixin], // 使用mixin
 		components: {
 
 		},
@@ -99,53 +110,123 @@
 		},
 		data() {
 			return {
-				checkboxValue1: [],
-				selectTime: '',
-				show: false,
-				value1: Number(new Date()),
-				isShow: false,
-				showSex: false,
-				model1: {
-					userInfo: {
-						name: 'uView UI',
-						sex: '',
-					},
-				},
-				actions: [{
-						name: '车找人',
-					},
-					{
-						name: '人找车',
-					}
-				],
-				rules: {
-					'userInfo.name': {
-						type: 'string',
-						required: true,
-						message: '请填写姓名',
-						trigger: ['blur', 'change']
-					},
-					'userInfo.sex': {
-						type: 'string',
-						required: true,
-						message: '请选择男或女',
-						trigger: ['blur', 'change']
-					},
-				},
-				radio: '',
-				switchVal: false
+				mescroll: null,
+				value: '',
+				showSit: false,
+				showAlert: false,
+				selectItem: {},
+				showDetail: false,
+				startRoute: '',
+				endRoute: '',
+				infoList: []
 
 			}
 		},
 		onLoad() {
-			uni.showLoading({
-				title: '数据加载中'
-			})
-			this.$request.baseRequest('admin.gubi.gubiTypeInfo', 'list', {
-					page: 1,
-					limit: 1000
-				},
-				failres => {
+			if (this.hasLogin || uni.getStorageSync("userInfo").phone) {
+				this.userInfo = uni.getStorageSync("userInfo")
+				console.log(this.userInfo)
+
+			} else {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			}
+		},
+		methods: {
+			mescrollInit(mescroll) {
+				console.log("mescroll", mescroll)
+				this.mescroll = mescroll;
+			},
+			qx() {
+				this.showSit = false
+			},
+			sitSubmit() {
+
+				this.$request.baseRequest('pincheCarSharingApp', 'update', {
+					pincheCarSharing: JSON.stringify({
+						id: this.selectItem.id,
+						remark1: this.value,
+					})
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					console.log(res)
+					this.showSit = false
+					this.mescroll.resetUpScroll();
+
+				})
+			},
+			change(e) {
+				console.log('change', e);
+			},
+			changeSit(val) {
+				this.showSit = true
+				this.selectItem = val
+			},
+			open() {
+				console.log('open');
+			},
+			close() {
+				this.showDetail = false
+				// this.showSit = false
+				// console.log('close');
+			},
+			open1() {
+				console.log('open');
+			},
+			close1() {
+				this.showDetail = false
+				// console.log('close');
+			},
+
+			detail(val) {
+				this.showDetail = true
+				this.selectItem = val
+				console.log(this.selectItem)
+			},
+			submit() {
+
+				this.$request.baseRequest('pincheCarSharingApp', 'update', {
+					pincheCarSharing: JSON.stringify({
+						id: this.selectItem.id,
+						carpoolingType: this.selectItem.carpoolingType,
+						status: '已取消'
+					})
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					console.log(res)
+					this.showAlert = false
+					this.mescroll.resetUpScroll();
+
+				})
+			},
+			cancalWay(val) {
+				this.showAlert = true
+				this.selectItem = val
+				console.log(this.selectItem)
+			},
+
+			downCallback() {
+				this.mescroll.resetUpScroll();
+			},
+			upCallback(page) {
+				this.$request.baseRequest('pincheCarSharingApp', 'list', {
+					pageNum: page.num,
+					pageSize: page.size,
+					phone: this.userInfo.phone
+				}, failres => {
 					console.log('res+++++', failres.errmsg)
 					this.$refs.uToast.show({
 						type: 'error',
@@ -153,125 +234,187 @@
 					})
 					uni.hideLoading()
 				}).then(res => {
-				// if (res.errno == 200) {
-				uni.hideLoading()
-				console.log(11)
-				console.log(res.data.items)
-				this.typeOneData = res.data.items
-				this.$request.baseRequest('admin.gubi.gubiTypeSecond', 'list', {
-						page: 1,
-						limit: 1000,
-						typeId: this.typeOneData[0].id
-					},
-					failres => {
-						console.log('res+++++', failres.errmsg)
-						this.$refs.uToast.show({
-							type: 'error',
-							message: failres.errmsg,
-						})
-						uni.hideLoading()
-					}).then(res => {
 					// if (res.errno == 200) {
 					uni.hideLoading()
 					console.log(11)
-					console.log(res.data.items)
-					this.typeTwoData = res.data.items
+					let curPageData = res.data.items;
+					let totalPage = res.data.total;
+					let curPageLen = curPageData.length;
+					this.mescroll.endByPage(curPageLen, totalPage);
+					console.log(res.data)
 					// this.makeData(res.data)
+					if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
+					this.infoList = this.infoList.concat(curPageData); //追加新数据
 					// }
 
 				})
-				// this.makeData(res.data)
-				// }
+				// // 此处可以继续请求其他接口
+				// // if(page.num == 1){
+				// // 	// 请求其他接口...
+				// // }
 
-			})
+				// // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
+				// // if(!this.isInitxx){
+				// // 	apiGetxx().then(res=>{
+				// // 		this.isInitxx = true
+				// // 		this.mescroll.resetUpScroll() // 重新触发upCallback
+				// // 	}).catch(()=>{
+				// // 		this.mescroll.endErr()
+				// // 	})
+				// // 	return // 此处return,先获取xx
+				// // }
 
-		},
-		methods: {
-			checkboxChange(n) {
-				console.log('change', n);
-			},
-			formatter(type, value) {
-				if (type === 'year') {
-					return `${value}年`
-				}
-				if (type === 'month') {
-					return `${value}月`
-				}
-				if (type === 'day') {
-					return `${value}日`
-				}
-				return value
-			},
-			confirmTime(e) {
-				console.log(this.result(e.value, e.mode))
-				this.selectTime = this.result(e.value, e.mode)
-				this.show = false
+				// let pageNum = page.num; // 页码, 默认从1开始
+				// let pageSize = page.size; // 页长, 默认每页10条
+				// uni.request({
+				// 	url: 'xxxx?pageNum=' + pageNum + '&pageSize=' + pageSize,
+				// 	success: (data) => {
+				// 		// 接口返回的当前页数据列表 (数组)
+				// 		// let curPageData = data.xxx;
+				// 		// // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+				// 		// let curPageLen = curPageData.length;
+				// 		// // 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+				// 		// let totalPage = data.xxx;
+				// 		// // 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+				// 		// let totalSize = data.xxx;
+				// 		// // 接口返回的是否有下一页 (true/false)
+				// 		// let hasNext = data.xxx;
+
+				// 		//设置列表数据
+				// 		if (page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+				// 		this.dataList = this.dataList.concat(curPageData); //追加新数据
+
+				// 		// 请求成功,隐藏加载状态
+				// 		//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+				// 		// this.mescroll.endByPage(curPageLen, totalPage);
+				// 		this.mescroll.endByPage(0, 0);
+				// 		setTimeout(() => {
+				// 			// this.mescroll.endSuccess(curPageLen)
+				// this.mescroll.endSuccess(0)
+				// 		}, 20)
+				// 	},
+				// 	fail: () => {
+				// 		//  请求失败,隐藏加载状态
+				// 		this.mescroll.endErr()
+				// 	}
+				// })
 
-			},
-			result(time, mode) {
-				const timeFormat = uni.$u.timeFormat,
-					toast = uni.$u.toast
-				switch (mode) {
-					case 'datetime':
-						return timeFormat(time, 'yyyy-mm-dd hh:MM')
-
-				}
 			},
 			setInfo() {
-				this.isShow = true
-			},
-			sexSelect(e) {
-				this.model1.userInfo.sex = e.name
-				this.$refs.form1.validateField('userInfo.sex')
+				uni.navigateTo({
+					url: 'add'
+				});
 			},
 			hideKeyboard() {
 				uni.hideKeyboard()
 			},
+			lookOrder(val) {
+				uni.navigateTo({
+					url: "/pages/info/lookOrder?id=" + val.id
+				})
+			}
 		}
 
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.warp {
 		padding-bottom: 40rpx;
 	}
 
-	.content {
-		// padding: 20rpx 0;
-	}
 
-	.content1 {
-		.row {
-			background: #fff;
-			border-bottom: 1px solid #dfe2e5;
-			padding: 20rpx;
+	.content3 {
+		margin: 20rpx;
+		background: #fff;
+		border-radius: 20rpx;
+		padding: 20rpx;
+
+		.row1 {
+			display: flex;
+			justify-content: space-between;
 		}
-	}
 
-	.content2 {
-		margin-top: 20rpx;
-		padding: 20rpx;
-		background: #fff;
+		.row2 {
+			color: #2979ff;
+			margin: 10rpx 0 20rpx 0;
+		}
+
+		.row3 {
+			color: #a6a699;
+		}
+
+		.row4 {
+			margin-top: 30rpx;
+			display: flex;
+			justify-content: space-around;
+
+			.btn {
+				text-align: center;
+				background: #f7f7f7;
+				border: 1px solid #dfe2e5;
+				border-radius: 10rpx;
+				padding: 20rpx 30rpx;
+				font-size: 26rpx;
+			}
+		}
 	}
 
-	.sm {
+	.fbxc {
+		color: #19be6b;
+		border: 1px solid #19be6b;
+		border-radius: 20rpx;
+		padding: 20rpx;
 		margin: 20rpx;
+		display: flex;
+		justify-content: center;
 	}
 
-	.content3 {
+	.detail {
 		display: flex;
+		justify-content: space-evenly;
 		align-items: center;
-		margin: 20rpx;
-	}
 
-	.content4 {
-		color: red;
-		padding: 0 20rpx;
+		.left {
+			background: #19be6b;
+			padding: 20rpx 30rpx;
+			color: #fff;
+			border-radius: 20rpx;
+		}
+
+		.right {
+			text-align: center;
+			background: #f7f7f7;
+			border: 1px solid #dfe2e5;
+			border-radius: 10rpx;
+			padding: 20rpx 30rpx;
+			font-size: 26rpx;
+		}
 	}
 
-	.custom-style {
-		width: 90%;
-		margin-top: 20rpx;
+	.sit {
+		.title {
+			display: flex;
+			justify-content: center;
+			font-size: 40rpx;
+
+		}
+
+		.title2 {
+			font-size: 36rpx;
+			margin: 20rpx 0;
+		}
+
+		.btn-list {
+			display: flex;
+			margin: 20rpx 0;
+			width: 100%;
+			justify-content: space-between;
+
+		}
+
+		.btn {
+			width: 50%;
+		}
 	}
 </style>

+ 288 - 0
pinche/pages/info/lookOrder.vue

@@ -0,0 +1,288 @@
+<template>
+	<view class="warp">
+		<view class="nav">
+			<view class="item" :class="index==1?'item-active':''" @click="clickNav(1)">
+				预定中
+			</view>
+			<view class="item" :class="index==2?'item-active':''" @click="clickNav(2)">
+				已取消
+			</view>
+		</view>
+		<view class="content1">
+			<view class="row1">
+				<view class="left">
+					路线:北京→定州,出发时间:2022-12-03 01:01
+				</view>
+				<view class="btn" @click="toMyFb">
+					查看我的发布
+				</view>
+			</view>
+			<view class="row2">
+				重要提示:请确认已经和预订乘客电话确认拼车,乘客预订列表只作为车主查看记录,方便出发前联系使用,具体以电话确认拼车为准,如电话确认不拼车就取消乘客的预订即可,确认拼车可要求乘客在线预付定金。
+			</view>
+		</view>
+		<mescroll-body ref="mescrollRef" @up="upCallback">
+			<view class="content3 infoList" v-for="(item,index) in infoList">
+				<view class="row1">
+					<view class="left">
+						2022-12-03 01:01 (周六)
+					</view>
+				</view>
+				<view class="row2">
+					路线:北京→定州
+				</view>
+				<view class="row3">
+					出发地
+				</view>
+				<view class="row3">
+					到达地
+				</view>
+				<view class="">
+					手机
+				</view>
+				<view class="">
+					人数
+				</view>
+				<view class="">
+					说明
+				</view>
+				<view class="row4">
+					<view class="btn">
+						接受
+					</view>
+					<view class="btn">
+						拒绝
+					</view>
+
+				</view>
+			</view>
+
+		</mescroll-body>
+	</view>
+</template>
+
+<script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		components: {
+
+		},
+		computed: {
+			...mapState(['hasLogin'])
+		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// this.$refs.form1.setRules(this.rules)
+		},
+		onShow() {
+			// if (this.hasLogin || uni.getStorageSync("userInfo").username) {
+			// 	this.userInfo = uni.getStorageSync("userInfo")
+			// } else {
+			// 	uni.navigateTo({
+			// 		url: "/pages/login/login"
+			// 	})
+			// 	// uni.({
+			// 	// 	url: '/pages/index/index'
+			// 	// })
+			// }
+		},
+		data() {
+			return {
+				index: 1,
+				infoList: []
+
+			}
+		},
+		onLoad() {},
+		methods: {
+			upCallback(page) {
+				this.$request.baseRequest('admin.gubi.gubiTransaction', 'list', {
+					pageNum: page.num,
+					pageSize: page.size,
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					// if (res.errno == 200) {
+					uni.hideLoading()
+					console.log(11)
+					let curPageData = res.data.items;
+					let totalPage = res.data.total;
+					let curPageLen = curPageData.length;
+					this.mescroll.endByPage(curPageLen, totalPage);
+					console.log(res.data)
+					// this.makeData(res.data)
+					if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
+					this.infoList = this.infoList.concat(curPageData); //追加新数据
+					// }
+
+				})
+				// // 此处可以继续请求其他接口
+				// // if(page.num == 1){
+				// // 	// 请求其他接口...
+				// // }
+
+				// // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
+				// // if(!this.isInitxx){
+				// // 	apiGetxx().then(res=>{
+				// // 		this.isInitxx = true
+				// // 		this.mescroll.resetUpScroll() // 重新触发upCallback
+				// // 	}).catch(()=>{
+				// // 		this.mescroll.endErr()
+				// // 	})
+				// // 	return // 此处return,先获取xx
+				// // }
+
+				// let pageNum = page.num; // 页码, 默认从1开始
+				// let pageSize = page.size; // 页长, 默认每页10条
+				// uni.request({
+				// 	url: 'xxxx?pageNum=' + pageNum + '&pageSize=' + pageSize,
+				// 	success: (data) => {
+				// 		// 接口返回的当前页数据列表 (数组)
+				// 		// let curPageData = data.xxx;
+				// 		// // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+				// 		// let curPageLen = curPageData.length;
+				// 		// // 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+				// 		// let totalPage = data.xxx;
+				// 		// // 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+				// 		// let totalSize = data.xxx;
+				// 		// // 接口返回的是否有下一页 (true/false)
+				// 		// let hasNext = data.xxx;
+
+				// 		//设置列表数据
+				// 		if (page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+				// 		this.dataList = this.dataList.concat(curPageData); //追加新数据
+
+				// 		// 请求成功,隐藏加载状态
+				// 		//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+				// 		// this.mescroll.endByPage(curPageLen, totalPage);
+				// 		this.mescroll.endByPage(0, 0);
+				// 		setTimeout(() => {
+				// 			// this.mescroll.endSuccess(curPageLen)
+				// this.mescroll.endSuccess(0)
+				// 		}, 20)
+				// 	},
+				// 	fail: () => {
+				// 		//  请求失败,隐藏加载状态
+				// 		this.mescroll.endErr()
+				// 	}
+				// })
+
+			},
+			clickNav(index) {
+				this.index = index
+			},
+			toMyFb() {
+				uni.switchTab({
+					url: '/pages/info/info'
+				})
+			}
+
+		}
+
+	}
+</script>
+
+<style lang="scss">
+	.warp {
+		padding-bottom: 40rpx;
+	}
+
+	.nav {
+		background: #fafafa;
+		display: flex;
+		justify-content: space-evenly;
+		padding: 20rpx 0;
+
+		.item {
+			position: relative;
+		}
+
+		.item-active {
+			color: #18b4ed;
+		}
+
+		.item-active:after {
+			content: '';
+			width: 140%;
+			height: 6rpx;
+			background: #18b4ed;
+			position: absolute;
+			bottom: -20rpx;
+			left: -20%;
+			right: 0;
+			margin: auto;
+		}
+	}
+
+	.content1 {
+		.row1 {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+
+			.left {
+				font-size: 24rpx;
+			}
+
+			.btn {
+				font-size: 24rpx;
+				color: #fff;
+				background: #19be6b;
+				padding: 10rpx 14rpx;
+				box-sizing: border-box;
+				border-radius: 20rpx;
+				margin-left: 4rpx;
+			}
+		}
+
+		.row2 {
+			color: red;
+			padding: 20rpx;
+		}
+	}
+
+	.content3 {
+		margin: 20rpx;
+		background: #fff;
+		border-radius: 20rpx;
+		padding: 20rpx;
+
+		.row1 {
+			display: flex;
+			justify-content: space-between;
+		}
+
+		.row2 {
+			color: #2979ff;
+			margin: 10rpx 0 20rpx 0;
+		}
+
+		.row3 {
+			color: #a6a699;
+		}
+
+		.row4 {
+			margin-top: 30rpx;
+			display: flex;
+			justify-content: space-around;
+
+			.btn {
+				text-align: center;
+				background: #f7f7f7;
+				border: 1px solid #dfe2e5;
+				border-radius: 10rpx;
+				padding: 20rpx 30rpx;
+				font-size: 26rpx;
+			}
+		}
+	}
+</style>

+ 120 - 31
pinche/pages/login/login.vue

@@ -4,7 +4,7 @@
 			<image src="../../static/shilu-login/logo.png"></image>
 		</view>
 
-		<view class="list">
+		<!-- <view class="list">
 			<view class="list-call">
 				<image class="img" src="/static/shilu-login/1.png"></image>
 				<input class="sl-input" v-model="userInfo.username" maxlength="11" placeholder="输入用户名" />
@@ -15,12 +15,12 @@
 					password="true" />
 			</view>
 
-		</view>
+		</view> -->
 
-		<view class="button-login" hover-class="button-hover" @tap="bindLogin()">
-			<text>登录</text>
+		<view class="button-login" hover-class="button-hover" @tap="bindLogin1()">
+			<text>企业微信登录</text>
 		</view>
-
+		<u-toast ref="uToast"></u-toast>
 		<!-- <view class="agreenment">
 			<navigator url="forget" open-type="navigate">忘记密码</navigator>
 			<text>|</text>
@@ -34,15 +34,104 @@
 		data() {
 			return {
 				userInfo: {
-					username: '',
-					password: '',
-					verifyCode: 666666
+					openId: '123456',
+					phone: '15555555555',
+					name: '15555555555',
 				}
 
 			};
 		},
 		methods: {
+			bindLogin1() {
+				this.$request.baseRequest('user', 'addUser', this.userInfo,
+					failres => {
+						console.log('res+++++', failres.errmsg)
+						uni.showToast({
+							mask: true,
+							title: failres.errmsg
+						})
+						uni.hideLoading()
+					}).then(res => {
+					console.log(res.data)
+					uni.setStorageSync('userInfo', res.data)
+					this.$store.commit('login', res.data)
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+				})
+			},
 			bindLogin() {
+				console.log(111)
+				//#ifdef MP-WEIXIN
+				const sinfo = uni.getSystemInfoSync();
+				console.log(sinfo, "sinfo") //
+				let that = this
+				// if (sinfo.environment == 'wxwork') { //企业微信端
+				//企业微信端逻辑处理
+				wx.qy.login({
+					success: function(res) {
+						console.log(res.code, "登录企业微信成功标志")
+						if (res.code) {
+							//发起网络请求
+							that.$request.baseRequest('user', 'appletLogin', {
+									code: res.code
+								},
+								failres => {
+									console.log('res+++++', failres.errmsg)
+									uni.showToast({
+										mask: true,
+										title: failres.errmsg
+									})
+									uni.hideLoading()
+								}).then(res => {
+								// if (res.errno == 200) {
+								uni.hideLoading()
+								console.log(res, '系统内部的登录结果')
+								//获取企业微信姓名
+								wx.qy.getEnterpriseUserInfo({
+									success: function(res) {
+										var userInfo = res.userInfo
+										var name = userInfo.name
+										var gender = userInfo.gender //性别 0:未知、1:男、2:女
+										//获取手机号
+										wx.qy.getMobile({
+											success: function(res) {
+												console.log(res.encryptedData)
+												console.log(res.iv)
+												//更新用户信息
+
+											}
+										})
+
+									}
+								})
+
+							})
+							// uni.request({
+							// 	url: "",
+							// 	method: 'POST',
+							// 	header: {
+							// 		'content-type': 'application/x-www-form-urlencoded'
+							// 	},
+							// 	data: {
+							// 		code: res.code
+							// 	},
+							// 	success(res) {
+							// 		console.log(res, '系统内部的登录结果')
+							// 		// 将res.data.data作为appletToken 存入全局变量
+							// 		getApp().globalData.appletToken = res.data.data
+							// 		console.log(getApp().globalData.appletToken)
+							// 	}
+							// })
+						} else {
+							console.log('登录失败!' + res.errMsg)
+							that.open()
+						}
+					}
+				});
+				// }
+				//#endif
+
 				// if (this.phone.length) {
 				// 	uni.showToast({
 				// 		icon: 'none',
@@ -64,30 +153,30 @@
 				// 	sex: '1'
 				// })
 				// }
-				uni.showLoading({
-					mask: true,
-					title: "加载中"
-				})
-				this.$request.baseRequest('admin', 'login', this.userInfo, failres => {
-					console.log('res+++++', failres.errmsg)
-					this.$refs.uToast.show({
-						type: 'error',
-						message: failres.errmsg,
-					})
-					uni.hideLoading()
-				}).then(res => {
-					console.log(res)
-					if (res.errno == 200) {
-						uni.hideLoading()
-						uni.setStorageSync('userInfo', this.userInfo)
-						this.$store.commit('login', this.userInfo)
-						// that.$api.setUserInfo(that.userInfo)
-						uni.switchTab({
-							url: '/pages/index/index'
-						})
-					}
+				// uni.showLoading({
+				// 	mask: true,
+				// 	title: "加载中"
+				// })
+				// this.$request.baseRequest('admin', 'login', this.userInfo, failres => {
+				// 	console.log('res+++++', failres.errmsg)
+				// 	this.$refs.uToast.show({
+				// 		type: 'error',
+				// 		message: failres.errmsg,
+				// 	})
+				// 	uni.hideLoading()
+				// }).then(res => {
+				// 	console.log(res)
+				// 	if (res.errno == 200) {
+				// 		uni.hideLoading()
+				// 		uni.setStorageSync('userInfo', this.userInfo)
+				// 		this.$store.commit('login', this.userInfo)
+				// 		// that.$api.setUserInfo(that.userInfo)
+				// 		uni.switchTab({
+				// 			url: '/pages/index/index'
+				// 		})
+				// 	}
 
-				})
+				// })
 			}
 		}
 	}

+ 65 - 57
pinche/pages/mine/index.vue

@@ -1,77 +1,101 @@
 <template>
 	<view>
-
+		<view class="personal">
+			<view class="personal-main">
+				<!-- <u-avatar :src="avatar" mode="square" size="60" class="u-avatar"></u-avatar> -->
+				<view class="personal-info">
+					<view class="">昵称</view>
+					<view class="">{{userInfo.phone}}</view>
+				</view>
+			</view>
+		</view>
+		<view class="n-p" v-for="(item,index) in list" :key="index" hover-class="hover-class" @click="onClick(item)">
+			<view class="p-right">
+				<view class="p-right-main">
+					<view class="p-right-main-name" v-if="item.name=='退出登录'" @click="layout" style="width: 100%;">
+						{{item.name}}
+					</view>
+					<view class="p-right-main-name" v-else>{{item.name}}</view>
+				</view>
+
+				<view class="lfet-a">
+					<view style="position: relative">
+					</view>
+					<u-icon name="arrow-right" class="p-right-icon"></u-icon>
+				</view>
+			</view>
+		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	var that;
 	import {
 		mapState
 	} from 'vuex';
 	export default {
-		computed: {
-			...mapState(['hasLogin'])
-		},
-		onShow() {
-			if (this.hasLogin || uni.getStorageSync("userInfo").username) {
-				this.userInfo = uni.getStorageSync("userInfo")
-			} else {
-				uni.navigateTo({
-					url: "/pages/login/login"
-				})
-				// uni.({
-				// 	url: '/pages/index/index'
-				// })
-			}
-		},
 		data() {
 			return {
 				userInfo: {},
-				avatar: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1730713693,2130926401&fm=26&gp=0.jpg',
-				list: [
-					// 	{
-					// 	name: '收藏',
-					// 	id: 'favorites',
-					// 	icon: 'star-fill',
-					// 	iconBackground: '#398c0c',
-					// }, 
+				list: [{
+						name: '我的发布',
+						id: 'favorites',
+						icon: 'star-fill',
+						iconBackground: '#398c0c',
+					}, {
+						name: '我的预定',
+						id: 'photoAlbum',
+						icon: 'photo-fill',
+						iconBackground: '#5e2d88',
+					},
 					// {
-					// 	name: '相册',
-					// 	id: 'photoAlbum',
-					// 	icon: 'photo-fill',
-					// 	iconBackground: '#5e2d88',
-					// }, {
-					// 	name: '卡包',
+					// 	name: '换绑手机号',
 					// 	id: 'cardPackage',
 					// 	icon: 'grid-fill',
 					// 	iconBackground: '#33696c',
-					// }, {
-					// 	name: '表情',
+					// },
+					// {
+					// 	name: '免责声明',
 					// 	id: 'expression',
 					// 	icon: 'gift-fill',
 					// 	iconBackground: '#833456',
 					// },
 					{
-						name: '修改密码',
-						id: 'setUp',
-						icon: 'setting-fill',
-						iconBackground: '#3b2021',
+						name: '退出登录',
 					},
+					{
+						name: '登录',
+						src: '/pages/login/login'
+					}
 				],
 			}
 		},
+		computed: {
+			...mapState(['hasLogin'])
+		},
+		onLoad(options) {
+			this.price = options.price
+			this.id = options.id
+			that = this
+			if (this.hasLogin || uni.getStorageSync("userInfo").phone) {
+				this.userInfo = uni.getStorageSync("userInfo")
+				// this.init()
+				console.log(this.userInfo)
+			}
+		},
 		methods: {
 			layout() {
 				this.$store.commit('logout', {})
 				uni.clearStorageSync();
-				uni.navigateTo({
-					url: "/pages/login/login"
+				uni.showToast({
+					mask: true,
+					title: '退出成功!'
 				})
-
 			},
 			onClick(item) {
 				uni.navigateTo({
-					url: "/pages/login/forget"
+					url: item.src
 				})
 			},
 		}
@@ -121,6 +145,7 @@
 		align-items: center;
 		background-color: #ffffff;
 		margin-bottom: 20rpx;
+		padding-left: 20rpx;
 	}
 
 	.p-right-icon {
@@ -155,28 +180,11 @@
 	}
 
 	.p-right-main-name {
-		font-size: 36rpx;
 		font-weight: 500;
 	}
 
 	.p-right-main-time {
 		margin-right: 20rpx;
-		font-size: 24rpx;
 		color: #9d9d9d;
 	}
-
-	.button-login {
-		color: #FFFFFF;
-		font-size: 34rpx;
-		width: 470rpx;
-		height: 100rpx;
-		background: linear-gradient(-90deg, rgba(63, 205, 235, 1), rgba(188, 226, 158, 1));
-		box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(164, 217, 228, 0.2);
-		border-radius: 50rpx;
-		line-height: 100rpx;
-		text-align: center;
-		margin-left: auto;
-		margin-right: auto;
-		margin-top: 100rpx;
-	}
 </style>

+ 310 - 45
pinche/pages/order/order.vue

@@ -1,19 +1,111 @@
 <template>
-	<view class="content">
+	<view class="warp">
+		<!-- 		<view class="nav">
+			<view class="item" :class="index==1?'item-active':''" @click="clickNav(1)">
+				预定中
+			</view>
+			<view class="item" :class="index==2?'item-active':''" @click="clickNav(2)">
+				已取消
+			</view>
+		</view> -->
+		<!-- 		<view class="content1">
+			<view class="row1">
+				<view class="left">
+					路线:北京→定州,出发时间:2022-12-03 01:01
+				</view>
+				<view class="btn" @click="toMyFb">
+					查看我的发布
+				</view>
+			</view>
+			<view class="row2">
+				重要提示:请确认已经和预订乘客电话确认拼车,乘客预订列表只作为车主查看记录,方便出发前联系使用,具体以电话确认拼车为准,如电话确认不拼车就取消乘客的预订即可,确认拼车可要求乘客在线预付定金。
+			</view>
+		</view> -->
+		<mescroll-body ref="mescrollRef" @up="upCallback" @down="downCallback">
+			<view class="content3 infoList" v-for="(item,index) in infoList">
+				<view class="row1 row">
+					<view class="left">
+						预约时间
+					</view>
+					<view class="right">
+						{{item.departureTime}}
+					</view>
+				</view>
+				<view class="row2 row">
+					<view class="left">
+						路线:
+					</view>
+					<view class="right">
+						{{item.route}}
+					</view>
+				</view>
+				<view class="row3 row">
+					<view class="left" style="width: 200rpx;">
+						出发地:
+					</view>
+					<view class="right">
+						{{item.startPlace}}
+					</view>
+				</view>
+				<view class="row3 row">
+					<view class="left" style="width: 200rpx;">
+						到达地:
+					</view>
+					<view class="right">
+						{{item.endPlace}}
+					</view>
+				</view>
+				<view class="row">
+					<view class="left">
+						司机电话:
+					</view>
+					<view class="right">{{item.remark3}}
+					</view>
+				</view>
+				<view class="row">
+					<view class="left">
+						人数:
+					</view>
+					<view class="right">{{item.numberPeople}}
+					</view>
+				</view>
+				<view class="row">
+					<view class="left">
+						总价:
+					</view>
+					<view class="right">{{item.price}}
+					</view>
+				</view>
+				<view class="row4">
+					<view class="btn" @click="cancalWay(item)">
+						取消预定
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+		<u-modal :show="showAlert" title="提示" content='确认取消预定?' closeOnClickOverlay showCancelButton
+			confirmColor="#19be6b" @cancel="showAlert=false" @close="showAlert=false" @confirm="submit">
+		</u-modal>
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import {
 		mapState
 	} from 'vuex';
 	export default {
+		mixins: [MescrollMixin], // 使用mixin
 		components: {
 
 		},
 		computed: {
 			...mapState(['hasLogin'])
 		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// this.$refs.form1.setRules(this.rules)
+		},
 		onShow() {
 			// if (this.hasLogin || uni.getStorageSync("userInfo").username) {
 			// 	this.userInfo = uni.getStorageSync("userInfo")
@@ -27,17 +119,63 @@
 			// }
 		},
 		data() {
-			return {}
+			return {
+				index: 1,
+				infoList: [],
+				userInfo: {},
+				showAlert: false,
+				selectItem: {},
+
+			}
 		},
 		onLoad() {
-			uni.showLoading({
-				title: '数据加载中'
-			})
-			this.$request.baseRequest('admin.gubi.gubiTypeInfo', 'list', {
-					page: 1,
-					limit: 1000
-				},
-				failres => {
+			if (this.hasLogin || uni.getStorageSync("userInfo").phone) {
+				this.userInfo = uni.getStorageSync("userInfo")
+				console.log(this.userInfo)
+
+			} else {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			}
+		},
+		methods: {
+			downCallback() {
+				this.mescroll.resetUpScroll()
+			},
+			submit() {
+
+				this.$request.baseRequest('pincheMakeAppointmentApp', 'delete', {
+					id: this.selectItem.id,
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					uni.showToast({
+						mask: true,
+						title: "取消预约成功!"
+					})
+					console.log(res)
+					this.showAlert = false
+					this.mescroll.resetUpScroll();
+
+				})
+			},
+			cancalWay(val) {
+				this.showAlert = true
+				this.selectItem = val
+				console.log(this.selectItem)
+			},
+			upCallback(page) {
+				this.$request.baseRequest('pincheMakeAppointmentApp', 'list', {
+					pageNum: page.num,
+					pageSize: page.size,
+					phone: this.userInfo.phone
+				}, failres => {
 					console.log('res+++++', failres.errmsg)
 					this.$refs.uToast.show({
 						type: 'error',
@@ -45,59 +183,186 @@
 					})
 					uni.hideLoading()
 				}).then(res => {
-				// if (res.errno == 200) {
-				uni.hideLoading()
-				console.log(11)
-				console.log(res.data.items)
-				this.typeOneData = res.data.items
-				this.$request.baseRequest('admin.gubi.gubiTypeSecond', 'list', {
-						page: 1,
-						limit: 1000,
-						typeId: this.typeOneData[0].id
-					},
-					failres => {
-						console.log('res+++++', failres.errmsg)
-						this.$refs.uToast.show({
-							type: 'error',
-							message: failres.errmsg,
-						})
-						uni.hideLoading()
-					}).then(res => {
 					// if (res.errno == 200) {
 					uni.hideLoading()
 					console.log(11)
-					console.log(res.data.items)
-					this.typeTwoData = res.data.items
+					let curPageData = res.data.items;
+					let totalPage = res.data.total;
+					let curPageLen = curPageData.length;
+					this.mescroll.endByPage(curPageLen, totalPage);
+					console.log(curPageData)
 					// this.makeData(res.data)
+					if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
+					this.infoList = this.infoList.concat(curPageData); //追加新数据
 					// }
 
 				})
-				// this.makeData(res.data)
-				// }
+				// // 此处可以继续请求其他接口
+				// // if(page.num == 1){
+				// // 	// 请求其他接口...
+				// // }
 
-			})
+				// // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
+				// // if(!this.isInitxx){
+				// // 	apiGetxx().then(res=>{
+				// // 		this.isInitxx = true
+				// // 		this.mescroll.resetUpScroll() // 重新触发upCallback
+				// // 	}).catch(()=>{
+				// // 		this.mescroll.endErr()
+				// // 	})
+				// // 	return // 此处return,先获取xx
+				// // }
 
-		},
-		methods: {}
+				// let pageNum = page.num; // 页码, 默认从1开始
+				// let pageSize = page.size; // 页长, 默认每页10条
+				// uni.request({
+				// 	url: 'xxxx?pageNum=' + pageNum + '&pageSize=' + pageSize,
+				// 	success: (data) => {
+				// 		// 接口返回的当前页数据列表 (数组)
+				// 		// let curPageData = data.xxx;
+				// 		// // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+				// 		// let curPageLen = curPageData.length;
+				// 		// // 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+				// 		// let totalPage = data.xxx;
+				// 		// // 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+				// 		// let totalSize = data.xxx;
+				// 		// // 接口返回的是否有下一页 (true/false)
+				// 		// let hasNext = data.xxx;
+
+				// 		//设置列表数据
+				// 		if (page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+				// 		this.dataList = this.dataList.concat(curPageData); //追加新数据
+
+				// 		// 请求成功,隐藏加载状态
+				// 		//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+				// 		// this.mescroll.endByPage(curPageLen, totalPage);
+				// 		this.mescroll.endByPage(0, 0);
+				// 		setTimeout(() => {
+				// 			// this.mescroll.endSuccess(curPageLen)
+				// this.mescroll.endSuccess(0)
+				// 		}, 20)
+				// 	},
+				// 	fail: () => {
+				// 		//  请求失败,隐藏加载状态
+				// 		this.mescroll.endErr()
+				// 	}
+				// })
+
+			},
+			clickNav(index) {
+				this.index = index
+			},
+			toMyFb() {
+				uni.switchTab({
+					url: '/pages/info/info'
+				})
+			}
+
+		}
 
 	}
 </script>
 
-<style>
-	.content {}
+<style lang="scss">
+	.warp {
+		padding-bottom: 40rpx;
+	}
 
-	.top {
+	.nav {
+		background: #fafafa;
 		display: flex;
-		background: #ececec;
-		padding: 20rpx;
-		position: fixed;
-		z-index: 999;
-		width: 100%;
+		justify-content: space-evenly;
+		padding: 20rpx 0;
 
+		.item {
+			position: relative;
+		}
+
+		.item-active {
+			color: #18b4ed;
+		}
+
+		.item-active:after {
+			content: '';
+			width: 140%;
+			height: 6rpx;
+			background: #18b4ed;
+			position: absolute;
+			bottom: -20rpx;
+			left: -20%;
+			right: 0;
+			margin: auto;
+		}
 	}
 
+	.content1 {
+		.row1 {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+
+			.left {
+				font-size: 24rpx;
+			}
+
+			.btn {
+				font-size: 24rpx;
+				color: #fff;
+				background: #19be6b;
+				padding: 10rpx 14rpx;
+				box-sizing: border-box;
+				border-radius: 20rpx;
+				margin-left: 4rpx;
+			}
+		}
+
+		.row2 {
+			color: red;
+			padding: 20rpx;
+		}
+	}
+
+	.content3 {
+		margin: 20rpx;
+		background: #fff;
+		border-radius: 20rpx;
+		padding: 20rpx;
+
+		.row {
+			display: flex;
+
+			.left {
+				// width: 240rpx;
+			}
+		}
+
+		.row1 {
+			display: flex;
+			justify-content: space-between;
+		}
+
+		.row2 {
+			color: #2979ff;
+			margin: 10rpx 0 20rpx 0;
+		}
+
+		.row3 {
+			color: #a6a699;
+		}
+
+		.row4 {
+			margin-top: 30rpx;
+			display: flex;
+			justify-content: space-around;
 
-	.head-img {
-		width: 100rpx;
+			.btn {
+				text-align: center;
+				background: #f7f7f7;
+				border: 1px solid #dfe2e5;
+				border-radius: 10rpx;
+				padding: 20rpx 30rpx;
+				font-size: 26rpx;
+			}
+		}
 	}
 </style>

+ 32 - 17
unimall-admin/src/router/route.json

@@ -23,29 +23,44 @@
         "alwaysShow": true
     }, {
         "redirect": "noredirect",
-        "name": "mask",
-        "path": "/mask",
+        "name": "appointment",
+        "path": "/appointment",
         "meta": {
             "icon": "log",
-            "title": "口罩管理"
+            "title": "拼车管理"
         },
         "alwaysShow": true,
         "children": [{
-            "path": "mask",
-            "name": "mask",
-            "page": "/kouzhao/kouzhaoInfo/index",
-            "meta": {
-                "title": "自定义口罩",
-                "icon": "logininfor",
-                "noCache": true,
-                "perms": [
-                    "log:logininfor:list",
-                    "log:logininfor:create",
-                    "log:logininfor:delete",
-                    "log:logininfor:update"
-                ]
+                "path": "appointment",
+                "name": "appointment",
+                "page": "/appointment/index",
+                "meta": {
+                    "title": "预约信息",
+                    "icon": "logininfor",
+                    "noCache": true
+                }
+            },
+            {
+                "path": "price",
+                "name": "price",
+                "page": "/price/index",
+                "meta": {
+                    "title": "路线管理",
+                    "icon": "logininfor",
+                    "noCache": true
+                }
+            },
+            {
+                "path": "sharing",
+                "name": "sharing",
+                "page": "/sharing/index",
+                "meta": {
+                    "title": "发布信息",
+                    "icon": "logininfor",
+                    "noCache": true
+                }
             }
-        }]
+        ]
     },
     {
         "redirect": "noredirect",

+ 101 - 89
unimall-admin/src/views/appointment/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
       <el-form-item label="" prop="companyId">
         <el-input
           v-model="queryParams.companyId"
@@ -19,7 +19,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-        <el-form-item label="拼车类型" prop="carpoolingType">
+      <el-form-item label="拼车类型" prop="carpoolingType">
         <el-select v-model="queryParams.carpoolingType" placeholder="请选择拼车类型" clearable size="small">
           <el-option label="请选择字典生成" value="" />
         </el-select>
@@ -79,12 +79,14 @@
         />
       </el-form-item>
       <el-form-item label="出发时间" prop="departureTime">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.departureTime"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择出发时间">
-        </el-date-picker>
+          placeholder="选择出发时间"/>
       </el-form-item>
       <el-form-item label="人数" prop="numberPeople">
         <el-input
@@ -113,7 +115,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-        <el-form-item label="状态" prop="status">
+      <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option label="请选择字典生成" value="" />
         </el-select>
@@ -128,20 +130,24 @@
         />
       </el-form-item>
       <el-form-item label="" prop="gmtCreate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtCreate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="gmtUpdate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtUpdate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="userId">
         <el-input
@@ -170,40 +176,40 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:appointment:add']"
           type="primary"
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-permission="['unimall:appointment:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:appointment:edit']"
+          :disabled="single"
           type="success"
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
           @click="handleUpdate"
-          v-permission="['unimall:appointment:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:appointment:remove']"
+          :disabled="multiple"
           type="danger"
           icon="el-icon-delete"
           size="mini"
-          :disabled="multiple"
           @click="handleDelete"
-          v-permission="['unimall:appointment:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:appointment:export']"
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-permission="['unimall:appointment:export']"
         >导出</el-button>
       </el-col>
     </el-row>
@@ -249,23 +255,23 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-permission="['unimall:appointment:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-permission="['unimall:appointment:edit']"
           >修改</el-button>
           <el-button
+            v-permission="['unimall:appointment:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-permission="['unimall:appointment:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -307,12 +313,14 @@
           <el-input v-model="form.latitudeArrival" placeholder="请输入到达经纬度" />
         </el-form-item>
         <el-form-item label="出发时间" prop="departureTime">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.departureTime"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择出发时间">
-          </el-date-picker>
+            placeholder="选择出发时间"/>
         </el-form-item>
         <el-form-item label="人数" prop="numberPeople">
           <el-input v-model="form.numberPeople" placeholder="请输入人数" />
@@ -344,20 +352,24 @@
           <el-input v-model="form.deleteFlag" placeholder="请输入0:否" />
         </el-form-item>
         <el-form-item label="" prop="gmtCreate">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.gmtCreate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
+            placeholder="选择"/>
         </el-form-item>
         <el-form-item label="" prop="gmtUpdate">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.gmtUpdate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
+            placeholder="选择"/>
         </el-form-item>
         <el-form-item label="" prop="userId">
           <el-input v-model="form.userId" placeholder="请输入" />
@@ -375,7 +387,7 @@
 </template>
 
 <script>
-import { listAppointment, getAppointment, delAppointment, addAppointment, updateAppointment, exportAppointment } from "@/api/unimall/appointment";
+import { listAppointment, getAppointment, delAppointment, addAppointment, updateAppointment, exportAppointment } from '@/api/pinche/appointment'
 
 export default {
   data() {
@@ -393,7 +405,7 @@ export default {
       // 预约信息表格数据
       appointmentList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -429,27 +441,27 @@ export default {
       // 表单校验
       rules: {
         deleteFlag: [
-          { required: true, message: "0:否(默认) 1:是不能为空", trigger: "blur" }
-        ],      }
-    };
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ] }
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     /** 查询预约信息列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listAppointment(this.queryParams).then(response => {
         this.appointmentList = response.data.data.items
         this.total = response.data.data.count
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -469,7 +481,7 @@ export default {
         explain: undefined,
         unitPrice: undefined,
         price: undefined,
-        status: "0",
+        status: '0',
         remark1: undefined,
         remark2: undefined,
         remark3: undefined,
@@ -478,18 +490,18 @@ export default {
         gmtUpdate: undefined,
         userId: undefined,
         adminId: undefined
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -499,75 +511,75 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加预约信息";
+      this.reset()
+      this.open = true
+      this.title = '添加预约信息'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids.join(',')
       getAppointment(id).then(response => {
         this.form = response.data.data
-        this.open = true;
-        this.title = "修改预约信息";
-      });
+        this.open = true
+        this.title = '修改预约信息'
+      })
     },
     /** 提交按钮 */
     submitForm: function() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != undefined) {
             updateAppointment(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           } else {
             addAppointment(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids.join(',')
-      this.$confirm('是否确认删除预约信息编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delAppointment(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
+      this.$confirm('是否确认删除预约信息编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delAppointment(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function() {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有预约信息数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportAppointment(queryParams);
-        }).then(response => {
-          this.download(response.data.data);
-        }).catch(function() {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有预约信息数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportAppointment(queryParams)
+      }).then(response => {
+        this.download(response.data.data)
+      }).catch(function() {})
     }
   }
-};
-</script>
+}
+</script>

+ 119 - 106
unimall-admin/src/views/price/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
-      <el-form-item label="" prop="companyId">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
+      <!-- <el-form-item label="" prop="companyId">
         <el-input
           v-model="queryParams.companyId"
           placeholder="请输入"
@@ -9,7 +9,7 @@
           size="small"
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="路线" prop="route">
         <el-input
           v-model="queryParams.route"
@@ -19,7 +19,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="单价" prop="unitPrice">
+      <!-- <el-form-item label="单价" prop="unitPrice">
         <el-input
           v-model="queryParams.unitPrice"
           placeholder="请输入单价"
@@ -38,20 +38,24 @@
         />
       </el-form-item>
       <el-form-item label="" prop="gmtCreate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtCreate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="gmtUpdate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtUpdate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="userId">
         <el-input
@@ -70,7 +74,7 @@
           size="small"
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -80,55 +84,55 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:price:add']"
           type="primary"
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-permission="['unimall:price:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:price:edit']"
+          :disabled="single"
           type="success"
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
           @click="handleUpdate"
-          v-permission="['unimall:price:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:price:remove']"
+          :disabled="multiple"
           type="danger"
           icon="el-icon-delete"
           size="mini"
-          :disabled="multiple"
           @click="handleDelete"
-          v-permission="['unimall:price:remove']"
         >删除</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:price:export']"
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-permission="['unimall:price:export']"
         >导出</el-button>
-      </el-col>
+      </el-col> -->
     </el-row>
 
     <el-table v-loading="loading" :data="priceList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="" align="center" prop="id" />
-      <el-table-column label="" align="center" prop="companyId" />
+      <!-- <el-table-column label="" align="center" prop="id" />
+      <el-table-column label="" align="center" prop="companyId" /> -->
       <el-table-column label="路线" align="center" prop="route" />
       <el-table-column label="单价" align="center" prop="unitPrice" />
       <el-table-column label="备注1" align="center" prop="remark1" />
       <el-table-column label="备注2" align="center" prop="remark2" />
       <el-table-column label="备注3" align="center" prop="remark3" />
-      <el-table-column label="0:否" align="center" prop="deleteFlag" />
-      <el-table-column label="" align="center" prop="gmtCreate" width="180">
+      <!-- <el-table-column label="0:否" align="center" prop="deleteFlag" /> -->
+      <!-- <el-table-column label="" align="center" prop="gmtCreate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.gmtCreate) }}</span>
         </template>
@@ -137,29 +141,29 @@
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.gmtUpdate) }}</span>
         </template>
-      </el-table-column>
-      <el-table-column label="" align="center" prop="userId" />
-      <el-table-column label="" align="center" prop="adminId" />
+      </el-table-column> -->
+      <!-- <el-table-column label="" align="center" prop="userId" />
+      <el-table-column label="" align="center" prop="adminId" /> -->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-permission="['unimall:price:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-permission="['unimall:price:edit']"
           >修改</el-button>
           <el-button
+            v-permission="['unimall:price:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-permission="['unimall:price:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -170,16 +174,21 @@
 
     <!-- 添加或修改路线价格对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px">
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="" prop="companyId">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <!-- <el-form-item label="" prop="companyId">
           <el-input v-model="form.companyId" placeholder="请输入" />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="路线" prop="route">
-          <el-input v-model="form.route" placeholder="请输入路线" />
-        </el-form-item>
-        <el-form-item label="单价" prop="unitPrice">
-          <el-input v-model="form.unitPrice" placeholder="请输入单价" />
+          <el-input
+            v-model="form.route"
+            placeholder="请输入路线,例如:北京⇋上海" />
         </el-form-item>
+        <el-form-item
+          label="
+            单价(每公里)"
+          prop="unitPrice">
+          <el-input v-model="form.unitPrice" placeholder="请输入金额" />
+        </el-input></el-form-item>
         <el-form-item label="备注1" prop="remark1">
           <el-input v-model="form.remark1" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -189,31 +198,35 @@
         <el-form-item label="备注3" prop="remark3">
           <el-input v-model="form.remark3" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="0:否" prop="deleteFlag">
+        <!-- <el-form-item label="0:否" prop="deleteFlag">
           <el-input v-model="form.deleteFlag" placeholder="请输入0:否" />
-        </el-form-item>
-        <el-form-item label="" prop="gmtCreate">
-          <el-date-picker clearable size="small" style="width: 200px"
+        </el-form-item> -->
+        <!-- <el-form-item label="" prop="gmtCreate">
+          <el-date-picker
             v-model="form.gmtCreate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="" prop="gmtUpdate">
-          <el-date-picker clearable size="small" style="width: 200px"
+            placeholder="选择"/>
+        </el-form-item> -->
+        <!-- <el-form-item label="" prop="gmtUpdate">
+          <el-date-picker
             v-model="form.gmtUpdate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
+            placeholder="选择"/>
         </el-form-item>
         <el-form-item label="" prop="userId">
           <el-input v-model="form.userId" placeholder="请输入" />
         </el-form-item>
         <el-form-item label="" prop="adminId">
           <el-input v-model="form.adminId" placeholder="请输入" />
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -224,7 +237,7 @@
 </template>
 
 <script>
-import { listPrice, getPrice, delPrice, addPrice, updatePrice, exportPrice } from "@/api/unimall/price";
+import { listPrice, getPrice, delPrice, addPrice, updatePrice, exportPrice } from '@/api/pinche/price'
 
 export default {
   data() {
@@ -242,7 +255,7 @@ export default {
       // 路线价格表格数据
       priceList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -266,27 +279,27 @@ export default {
       // 表单校验
       rules: {
         deleteFlag: [
-          { required: true, message: "0:否(默认) 1:是不能为空", trigger: "blur" }
-        ],      }
-    };
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ] }
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     /** 查询路线价格列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listPrice(this.queryParams).then(response => {
         this.priceList = response.data.data.items
         this.total = response.data.data.count
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -303,18 +316,18 @@ export default {
         gmtUpdate: undefined,
         userId: undefined,
         adminId: undefined
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -324,75 +337,75 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加路线价格";
+      this.reset()
+      this.open = true
+      this.title = '添加路线价格'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids.join(',')
       getPrice(id).then(response => {
         this.form = response.data.data
-        this.open = true;
-        this.title = "修改路线价格";
-      });
+        this.open = true
+        this.title = '修改路线价格'
+      })
     },
     /** 提交按钮 */
     submitForm: function() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != undefined) {
             updatePrice(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           } else {
             addPrice(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids.join(',')
-      this.$confirm('是否确认删除路线价格编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPrice(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
+      this.$confirm('是否确认删除路线价格编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delPrice(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function() {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有路线价格数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportPrice(queryParams);
-        }).then(response => {
-          this.download(response.data.data);
-        }).catch(function() {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有路线价格数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportPrice(queryParams)
+      }).then(response => {
+        this.download(response.data.data)
+      }).catch(function() {})
     }
   }
-};
-</script>
+}
+</script>

+ 101 - 89
unimall-admin/src/views/sharing/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
       <el-form-item label="" prop="companyId">
         <el-input
           v-model="queryParams.companyId"
@@ -10,7 +10,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-        <el-form-item label="拼车类型" prop="carpoolingType">
+      <el-form-item label="拼车类型" prop="carpoolingType">
         <el-select v-model="queryParams.carpoolingType" placeholder="请选择拼车类型" clearable size="small">
           <el-option label="请选择字典生成" value="" />
         </el-select>
@@ -70,12 +70,14 @@
         />
       </el-form-item>
       <el-form-item label="出发时间" prop="departureTime">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.departureTime"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择出发时间">
-        </el-date-picker>
+          placeholder="选择出发时间"/>
       </el-form-item>
       <el-form-item label="人数" prop="numberPeople">
         <el-input
@@ -104,7 +106,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-        <el-form-item label="状态" prop="status">
+      <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option label="请选择字典生成" value="" />
         </el-select>
@@ -119,20 +121,24 @@
         />
       </el-form-item>
       <el-form-item label="" prop="gmtCreate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtCreate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="gmtUpdate">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.gmtUpdate"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择">
-        </el-date-picker>
+          placeholder="选择"/>
       </el-form-item>
       <el-form-item label="" prop="userId">
         <el-input
@@ -161,40 +167,40 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:sharing:add']"
           type="primary"
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-permission="['unimall:sharing:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:sharing:edit']"
+          :disabled="single"
           type="success"
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
           @click="handleUpdate"
-          v-permission="['unimall:sharing:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:sharing:remove']"
+          :disabled="multiple"
           type="danger"
           icon="el-icon-delete"
           size="mini"
-          :disabled="multiple"
           @click="handleDelete"
-          v-permission="['unimall:sharing:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['unimall:sharing:export']"
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-permission="['unimall:sharing:export']"
         >导出</el-button>
       </el-col>
     </el-row>
@@ -239,23 +245,23 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-permission="['unimall:sharing:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-permission="['unimall:sharing:edit']"
           >修改</el-button>
           <el-button
+            v-permission="['unimall:sharing:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-permission="['unimall:sharing:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -294,12 +300,14 @@
           <el-input v-model="form.latitudeArrival" placeholder="请输入到达经纬度" />
         </el-form-item>
         <el-form-item label="出发时间" prop="departureTime">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.departureTime"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择出发时间">
-          </el-date-picker>
+            placeholder="选择出发时间"/>
         </el-form-item>
         <el-form-item label="人数" prop="numberPeople">
           <el-input v-model="form.numberPeople" placeholder="请输入人数" />
@@ -331,20 +339,24 @@
           <el-input v-model="form.deleteFlag" placeholder="请输入0:否" />
         </el-form-item>
         <el-form-item label="" prop="gmtCreate">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.gmtCreate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
+            placeholder="选择"/>
         </el-form-item>
         <el-form-item label="" prop="gmtUpdate">
-          <el-date-picker clearable size="small" style="width: 200px"
+          <el-date-picker
             v-model="form.gmtUpdate"
+            clearable
+            size="small"
+            style="width: 200px"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择">
-          </el-date-picker>
+            placeholder="选择"/>
         </el-form-item>
         <el-form-item label="" prop="userId">
           <el-input v-model="form.userId" placeholder="请输入" />
@@ -362,7 +374,7 @@
 </template>
 
 <script>
-import { listSharing, getSharing, delSharing, addSharing, updateSharing, exportSharing } from "@/api/unimall/sharing";
+import { listSharing, getSharing, delSharing, addSharing, updateSharing, exportSharing } from '@/api/pinche/sharing'
 
 export default {
   data() {
@@ -380,7 +392,7 @@ export default {
       // 发布信息表格数据
       sharingList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -415,27 +427,27 @@ export default {
       // 表单校验
       rules: {
         deleteFlag: [
-          { required: true, message: "0:否(默认) 1:是不能为空", trigger: "blur" }
-        ],      }
-    };
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ] }
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     /** 查询发布信息列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listSharing(this.queryParams).then(response => {
         this.sharingList = response.data.data.items
         this.total = response.data.data.count
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -454,7 +466,7 @@ export default {
         explain: undefined,
         unitPrice: undefined,
         price: undefined,
-        status: "0",
+        status: '0',
         remark1: undefined,
         remark2: undefined,
         remark3: undefined,
@@ -463,18 +475,18 @@ export default {
         gmtUpdate: undefined,
         userId: undefined,
         adminId: undefined
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -484,75 +496,75 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加发布信息";
+      this.reset()
+      this.open = true
+      this.title = '添加发布信息'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids.join(',')
       getSharing(id).then(response => {
         this.form = response.data.data
-        this.open = true;
-        this.title = "修改发布信息";
-      });
+        this.open = true
+        this.title = '修改发布信息'
+      })
     },
     /** 提交按钮 */
     submitForm: function() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != undefined) {
             updateSharing(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           } else {
             addSharing(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids.join(',')
-      this.$confirm('是否确认删除发布信息编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delSharing(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
+      this.$confirm('是否确认删除发布信息编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delSharing(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function() {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有发布信息数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportSharing(queryParams);
-        }).then(response => {
-          this.download(response.data.data);
-        }).catch(function() {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有发布信息数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportSharing(queryParams)
+      }).then(response => {
+        this.download(response.data.data)
+      }).catch(function() {})
     }
   }
-};
-</script>
+}
+</script>

部分文件因文件數量過多而無法顯示