Explorar o código

提交一个版本

zhengkaixin %!s(int64=4) %!d(string=hai) anos
pai
achega
cf74ea0562

+ 1 - 1
.env.dev.js

@@ -1,6 +1,6 @@
 const UNI_APP = {  
 	
-    BASE_URL: 'https://xpgjapi.xiaoxinda.com/' ,
+    BASE_URL: 'https://ykt-test.xiaoxinda.com/smart-bus-server/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,//是否能 无视权限控制跳转页面
 	//企业联合会微信appid

+ 1 - 1
.env.js

@@ -1,5 +1,5 @@
 (function() {  
-    const NODE_ENV = 'test'; // dev:开发环境 | test:测试环境  
+    const NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境  
     let ENV_VAR = null;  
 	 
     if (process.env.NODE_ENV === "development") {  

+ 1 - 3
.env.prod.js

@@ -1,7 +1,5 @@
 const UNI_APP = {  
-	BASE_URL: 'https://xpgjapi.xiaoxinda.com/' ,
-	
-	
+	BASE_URL: 'https://ykt-test.xiaoxinda.com/smart-bus-server/' ,
 	NODE_ENV :"prod",
 	SIMPLE_RUN:false,
 	//企业联合会微信appid

+ 43 - 0
apis/buytickets.js

@@ -65,4 +65,47 @@ export function getPassengerInfo(data) {
 		data: Qs.stringify(data),
 		method: 'post',
 	})
+}
+
+//查询未购票人数
+export function upBusNoTicketList(data) {
+	return request({
+		url: '/mobile/passengerApi/upBusNoTicketList',
+		data: Qs.stringify(data),
+		method: 'post',
+	})
+}
+
+//创建订单
+export function createPassengerOrder(data) {
+	return request({
+		url: '/mobile/passengerApi/createPassengerOrder',
+		data: Qs.stringify(data),
+		method: 'post',
+	})
+}
+//修改订单
+export function updatePassengerOrder(data) {
+	return request({
+		url: '/mobile/passengerApi/updatePassengerOrder',
+		data: Qs.stringify(data),
+		method: 'post',
+	})
+}
+
+//查询金额
+export function ticketAmount(data) {
+	return request({
+		url: '/mobile/driverApi/ticketAmount',
+		data: Qs.stringify(data),
+		method: 'post',
+	})
+}
+// 删除订单
+export function deletePassengerOrder(data) {
+	return request({
+		url: '/mobile/passengerApi/deletePassengerOrder',
+		data: Qs.stringify(data),
+		method: 'post',
+	})
 }

+ 10 - 0
apis/weixin.js

@@ -1,6 +1,16 @@
 import request from '@/utils/request'
 import Qs from 'qs';
 
+//微信支付
+export function wxpay(orderId) {
+	return request({
+		url: '/wxPay/wxJsapiPay',
+		data: {
+			id: orderId
+		},
+		method: 'get',
+	})
+}
 //根据code换取openid
 export function getDataByCode(code) {
 	return request({

+ 4 - 1
bobo-router/index.js

@@ -48,7 +48,10 @@ const router = new Router()
 router.beforeEach(function(to, from, next) {
 	
 	console.log('前置守卫')
-	if (process.car.SIMPLE_RUN) {
+	if (process.car.SIMPLE_RUN) {
+		if (!carhelp.getOpenId()) {
+			carhelp.setOpenId("test")
+		}
 		routerBeforeEach(to, from, next);
 	} else {
 		

+ 55 - 40
components/Carmap.vue

@@ -13,12 +13,14 @@
 			return {
 				longitude: 112.276527,
 				latitude: 30.306427,
+				AMap:null,
 				//车的位置
 				car: {
 					obj:null,
 					longitude: '',
 					latitude: '',
 				},
+				
 				//个人
 				info: {
 					obj:null,
@@ -52,49 +54,61 @@
 		},
 		methods:{
 			setCar(ob){
-				this.car.longitude=ob.longitude
-				this.car.latitude=ob.latitude
-				if(!this.car.ob){
-					
-					
-					var icon0 = require("@/static/img/icon-busPosition.png");
-					
-					
-					this.car.ob= new AMap.Marker({
-						map: this.mapbus,
-						position: [this.car.longitude,this.car.latitude],
-						offset: new AMap.Pixel(-5, 15),
-						content:"<img src='"+icon0+"' style='height: 30px;width: 30px' />",
-						
-						zIndex:999,
-						autoRotation: true,
-					});
-					
-				}else{
-					this.car.ob.setPosition( [this.car.longitude,this.car.latitude]);
+				if(this.AMap==null){
+					return
 				}
+				 this.car.longitude=ob.longitude
+				 this.car.latitude=ob.latitude
+				 if(!this.car.ob){
+				 	
+				 	var icon0 = require("@/static/img/icon-busPosition.png");
+				 	
+				 	this.car.ob= new AMap.Marker({
+				 		map: this.mapbus,
+				 		position: [this.car.longitude,this.car.latitude],
+				 		offset: new AMap.Pixel(-5, -5),
+				 		
+				 		content:"<img src='"+icon0+"' style='height: 30px;width: 30px' />",
+				 		
+				 		zIndex:999,
+				 		autoRotation: true,
+				 	});
+				 	
+				 }else{
+				 	this.car.ob.setPosition( [this.car.longitude,this.car.latitude]);
+				 }
+			 
+				
 			},
 			setPerson(ob){
-				this.info.longitude=ob.longitude
-				this.info.latitude=ob.latitude
-				if(!this.info.ob){
-					
-					var icon0 = require("@/static/img/icon-userPosition.png");
-					
-					
-					this.info.ob= new AMap.Marker({
-						map: this.mapbus,
-						position: [this.info.longitude,this.info.latitude],
-						offset: new AMap.Pixel(-5, -5),
-						content:"<img src='"+icon0+"' style='height: 30px;width: 30px' />",
-						
-						zIndex:999,
-						autoRotation: true,
-					});
-					
-				}else{
-					this.info.ob.setPosition( [this.info.longitude,this.info.latitude]);
+				if(this.AMap==null){
+					return
 				}
+				
+					this.info.longitude=ob.longitude
+					this.info.latitude=ob.latitude
+					if(!this.info.ob){
+						
+						var icon0 = require("@/static/img/icon-userPosition.png");
+						
+						
+						this.info.ob= new AMap.Marker({
+							map: this.mapbus,
+							position: [this.info.longitude,this.info.latitude],
+							offset: new AMap.Pixel(-5, -5),
+							content:"<img src='"+icon0+"' style='height: 30px;width: 30px' />",
+							
+							zIndex:999,
+							autoRotation: true,
+						});
+						//this.mapbus.setCenter([this.info.longitude,this.info.latitude]); //设置地图中心点
+						this.mapbus.setCenter([ this.info.longitude,this.info.latitude]); //设置地图中心点
+
+					}else{
+						this.info.ob.setPosition( [this.info.longitude,this.info.latitude]);
+					}
+				
+				
 			},
 			initMap(point,stationList,startend){
 				var _this = this;
@@ -102,12 +116,13 @@
 				this.startend=startend;
 				MapLoader().then(AMap => {
 					
+					this.AMap=AMap;
 					_this.mapbus && _this.mapbus.destroy();
 				
 					_this.mapbus=new AMap.Map("container", {
 						resizeEnable: true,
 						center: [this.longitude, this.latitude],
-						zoom: 10
+						zoom: 14
 					});
 					var lineArr=[]
 					var icon0 = require("@/static/img/map_0.png");

+ 27 - 3
components/Common.vue

@@ -3,8 +3,10 @@
 		<u-toast ref="uToast"  />
 		<u-loading :show="false"></u-loading>
 		<u-modal v-model="show" :content="content" :confirm-text="confirmtext?confirmtext:'确定'" @confirm="confirmBtn" :title="title?title:'提示'"></u-modal>
-		<u-navbar v-if="mytitle" :title="mytitle">
-			<view class="slot-wrap"></view>		
+		<u-modal v-model="show2" :show-cancel-button="true" :content="content" :confirm-text="confirmtext?confirmtext:'确定'" :cancel-text="canceltext?canceltext:'取消'" @confirm="confirmBtn" @cancel="cancelBtn" :title="title?title:'提示'"></u-modal>
+		
+		<u-navbar v-if="mytitle" :title="mytitle" :is-back="noback" :border-bottom="!noback">
+				<view class="slot-wrap"></view>	
 		</u-navbar>
 		<view v-show="false"  :login="islogin()" ></view>	
 	</view>
@@ -18,6 +20,10 @@
 				require: false,
 				default: false,
 			},
+			noback:{
+				require: false,
+				default: true,
+			},
 			mytitle: {
 				require: false,
 				default: false,
@@ -27,11 +33,14 @@
 			return {
 				isloginBl:true,
 				show:false,
+				show2:false,
 				fnc:null,
+				fncCancel:null,
 				fncBl:false,
 				content:null,
 				confirmtext:null,
 				title:null,
+				canceltext:null,
 			};
 			
 		},methods:{
@@ -55,9 +64,10 @@
 				this.alert2(message?message:'访问链接异常','前往首页')
 				
 			},
-			setFnc(fnc){
+			setFnc(fnc,fncCancel){
 				
 				this.fnc=fnc;
+				this.fncCancel=fncCancel;
 				this.fncBl=true
 			},
 			alert2(content,confirmtext,title){
@@ -67,6 +77,20 @@
 				this.title=title;
 				 uni.hideLoading();
 			},
+			confirm(content,confirmtext,title,canceltext){
+				this.show2=true;
+				this.content=content;
+				this.confirmtext=confirmtext;
+				this.canceltext=canceltext;
+				this.title=title;
+				 uni.hideLoading();
+			},
+			cancelBtn(){
+				if(this.fncCancel){
+					this.fncCancel()
+					this.fncBl=false;	
+				}
+			},
 			confirmBtn(){
 				
 				if(this.fncBl){

+ 7 - 3
manifest.json

@@ -70,14 +70,18 @@
     },
     "h5" : {
         "devServer" : {
-            "port" : 8080,
-            "https" : false,
-			 "disableHostCheck": true
+            "port" : 80,
+            "https" : true,
+            "disableHostCheck" : true
         },
         "optimization" : {
             "treeShaking" : {
                 "enable" : true
             }
+        },
+        "title" : "车信达",
+        "router" : {
+            "base" : "./"
         }
     }
 }

+ 319 - 0
package-lock.json

@@ -185,6 +185,16 @@
         }
       }
     },
+    "@types/yauzl": {
+      "version": "2.9.1",
+      "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz",
+      "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "@types/node": "*"
+      }
+    },
     "@webassemblyjs/ast": {
       "version": "1.11.0",
       "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz",
@@ -355,6 +365,15 @@
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1.0.tgz",
       "integrity": "sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA=="
     },
+    "agent-base": {
+      "version": "6.0.2",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+      "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
+      "dev": true,
+      "requires": {
+        "debug": "4"
+      }
+    },
     "ajv": {
       "version": "6.12.6",
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -487,6 +506,12 @@
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
       "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
     },
+    "base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+      "dev": true
+    },
     "bcrypt-pbkdf": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
@@ -501,6 +526,30 @@
       "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
       "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
     },
+    "bl": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
+      "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
+      "dev": true,
+      "requires": {
+        "buffer": "^5.5.0",
+        "inherits": "^2.0.4",
+        "readable-stream": "^3.4.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "3.6.0",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+          "dev": true,
+          "requires": {
+            "inherits": "^2.0.3",
+            "string_decoder": "^1.1.1",
+            "util-deprecate": "^1.0.1"
+          }
+        }
+      }
+    },
     "bluebird": {
       "version": "3.7.2",
       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -535,6 +584,22 @@
         "node-releases": "^1.1.70"
       }
     },
+    "buffer": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+      "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+      "dev": true,
+      "requires": {
+        "base64-js": "^1.3.1",
+        "ieee754": "^1.1.13"
+      }
+    },
+    "buffer-crc32": {
+      "version": "0.2.13",
+      "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+      "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
+      "dev": true
+    },
     "buffer-from": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
@@ -821,6 +886,15 @@
         "assert-plus": "^1.0.0"
       }
     },
+    "debug": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+      "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+      "dev": true,
+      "requires": {
+        "ms": "2.1.2"
+      }
+    },
     "decamelize": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
@@ -839,6 +913,12 @@
       "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
       "dev": true
     },
+    "devtools-protocol": {
+      "version": "0.0.854822",
+      "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.854822.tgz",
+      "integrity": "sha512-xd4D8kHQtB0KtWW0c9xBZD5LVtm9chkMOfs/3Yn01RhT/sFIsVtzTtypfKoFfWBaL+7xCYLxjOLkhwPXaX/Kcg==",
+      "dev": true
+    },
     "dir-glob": {
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
@@ -1017,6 +1097,29 @@
       "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
       "dev": true
     },
+    "extract-zip": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
+      "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",
+      "dev": true,
+      "requires": {
+        "@types/yauzl": "^2.9.1",
+        "debug": "^4.1.1",
+        "get-stream": "^5.1.0",
+        "yauzl": "^2.10.0"
+      },
+      "dependencies": {
+        "get-stream": {
+          "version": "5.2.0",
+          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+          "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+          "dev": true,
+          "requires": {
+            "pump": "^3.0.0"
+          }
+        }
+      }
+    },
     "extsprintf": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
@@ -1038,6 +1141,15 @@
       "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz",
       "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow=="
     },
+    "fd-slicer": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
+      "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
+      "dev": true,
+      "requires": {
+        "pend": "~1.2.0"
+      }
+    },
     "figgy-pudding": {
       "version": "3.5.2",
       "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz",
@@ -1104,6 +1216,12 @@
         "readable-stream": "^2.0.0"
       }
     },
+    "fs-constants": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
+      "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
+      "dev": true
+    },
     "fs-extra": {
       "version": "7.0.1",
       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
@@ -1316,11 +1434,27 @@
         "sshpk": "^1.7.0"
       }
     },
+    "https-proxy-agent": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
+      "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
+      "dev": true,
+      "requires": {
+        "agent-base": "6",
+        "debug": "4"
+      }
+    },
     "human-signals": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
       "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="
     },
+    "ieee754": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+      "dev": true
+    },
     "iferr": {
       "version": "0.1.5",
       "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
@@ -1817,6 +1951,12 @@
         "minimist": "^1.2.5"
       }
     },
+    "mkdirp-classic": {
+      "version": "0.5.3",
+      "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
+      "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
+      "dev": true
+    },
     "move-concurrently": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@@ -1830,6 +1970,12 @@
         "run-queue": "^1.0.3"
       }
     },
+    "ms": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+      "dev": true
+    },
     "mutation-observer": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz",
@@ -1846,6 +1992,12 @@
       "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
       "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
     },
+    "node-fetch": {
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
+      "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
+      "dev": true
+    },
     "node-gyp": {
       "version": "7.1.2",
       "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz",
@@ -2114,6 +2266,12 @@
         }
       }
     },
+    "pend": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+      "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
+      "dev": true
+    },
     "performance-now": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -2158,11 +2316,23 @@
       "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
       "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
     },
+    "progress": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+      "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+      "dev": true
+    },
     "promise-inflight": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
       "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM="
     },
+    "proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+      "dev": true
+    },
     "prr": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@@ -2209,6 +2379,80 @@
       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
       "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
     },
+    "puppeteer": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-8.0.0.tgz",
+      "integrity": "sha512-D0RzSWlepeWkxPPdK3xhTcefj8rjah1791GE82Pdjsri49sy11ci/JQsAO8K2NRukqvwEtcI+ImP5F4ZiMvtIQ==",
+      "dev": true,
+      "requires": {
+        "debug": "^4.1.0",
+        "devtools-protocol": "0.0.854822",
+        "extract-zip": "^2.0.0",
+        "https-proxy-agent": "^5.0.0",
+        "node-fetch": "^2.6.1",
+        "pkg-dir": "^4.2.0",
+        "progress": "^2.0.1",
+        "proxy-from-env": "^1.1.0",
+        "rimraf": "^3.0.2",
+        "tar-fs": "^2.0.0",
+        "unbzip2-stream": "^1.3.3",
+        "ws": "^7.2.3"
+      },
+      "dependencies": {
+        "find-up": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+          "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+          "dev": true,
+          "requires": {
+            "locate-path": "^5.0.0",
+            "path-exists": "^4.0.0"
+          }
+        },
+        "locate-path": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+          "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+          "dev": true,
+          "requires": {
+            "p-locate": "^4.1.0"
+          }
+        },
+        "p-locate": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+          "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+          "dev": true,
+          "requires": {
+            "p-limit": "^2.2.0"
+          }
+        },
+        "path-exists": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+          "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+          "dev": true
+        },
+        "pkg-dir": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+          "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+          "dev": true,
+          "requires": {
+            "find-up": "^4.0.0"
+          }
+        },
+        "rimraf": {
+          "version": "3.0.2",
+          "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+          "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+          "dev": true,
+          "requires": {
+            "glob": "^7.1.3"
+          }
+        }
+      }
+    },
     "qs": {
       "version": "6.5.2",
       "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
@@ -2725,6 +2969,44 @@
         }
       }
     },
+    "tar-fs": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
+      "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
+      "dev": true,
+      "requires": {
+        "chownr": "^1.1.1",
+        "mkdirp-classic": "^0.5.2",
+        "pump": "^3.0.0",
+        "tar-stream": "^2.1.4"
+      }
+    },
+    "tar-stream": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
+      "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
+      "dev": true,
+      "requires": {
+        "bl": "^4.0.3",
+        "end-of-stream": "^1.4.1",
+        "fs-constants": "^1.0.0",
+        "inherits": "^2.0.3",
+        "readable-stream": "^3.1.1"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "3.6.0",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+          "dev": true,
+          "requires": {
+            "inherits": "^2.0.3",
+            "string_decoder": "^1.1.1",
+            "util-deprecate": "^1.0.1"
+          }
+        }
+      }
+    },
     "terser": {
       "version": "5.6.1",
       "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",
@@ -2783,6 +3065,12 @@
         }
       }
     },
+    "through": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+      "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
+      "dev": true
+    },
     "through2": {
       "version": "2.0.5",
       "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
@@ -2897,6 +3185,16 @@
       "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz",
       "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw=="
     },
+    "unbzip2-stream": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
+      "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
+      "dev": true,
+      "requires": {
+        "buffer": "^5.2.1",
+        "through": "^2.3.8"
+      }
+    },
     "uni-crazy-router": {
       "version": "0.0.31",
       "resolved": "https://registry.npmjs.org/uni-crazy-router/-/uni-crazy-router-0.0.31.tgz",
@@ -3004,6 +3302,11 @@
         "extsprintf": "^1.2.0"
       }
     },
+    "vue-cropper": {
+      "version": "0.5.6",
+      "resolved": "https://registry.npmjs.org/vue-cropper/-/vue-cropper-0.5.6.tgz",
+      "integrity": "sha512-54Z/AipXDBcE5nzJweTM+BryzSAcC0FCTMQLvLt6f4XanP4AWB3mPkQw3PG3NRICo7knljHO+N+pjZxYAKoTLQ=="
+    },
     "watchpack": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz",
@@ -3226,6 +3529,12 @@
       "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
       "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
     },
+    "ws": {
+      "version": "7.4.4",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz",
+      "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==",
+      "dev": true
+    },
     "xtend": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@@ -3311,6 +3620,16 @@
         }
       }
     },
+    "yauzl": {
+      "version": "2.10.0",
+      "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
+      "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
+      "dev": true,
+      "requires": {
+        "buffer-crc32": "~0.2.3",
+        "fd-slicer": "~1.1.0"
+      }
+    },
     "yocto-queue": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",

+ 1 - 1
pages/404/404.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="error">
-		<img src="/static/img/404.png" alt="">
+		<img src="static/img/404.png" alt="">
 		<h4>抱歉!您要查看的页面无法打开</h4>
 		<u-button type="primary"  shape="circle" plain>返回首页</u-button>
 	</view>

+ 1 - 1
pages/404/500.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="error">
-		<img src="/static/img/500.png" alt="">
+		<img src="static/img/500.png" alt="">
 		<h4>抱歉!服务器出错了~</h4>
 		<u-button type="primary"  shape="circle" plain>返回首页</u-button>
 	</view>

+ 93 - 41
pages/buytickets/confirm.js

@@ -1,45 +1,97 @@
 import * as API from '@/apis/buytickets.js'
-
-
-	export default {
-		data() {
-			return {
-				id:'',
-				pic:'',
-				list:[],
-			}
+
+
+export default {
+	data() {
+		return {
+			id: '',
+			num:0,
+			pic: '',
+			list: [],
+			subForm: {
+				pageIndex: 1,
+				pageSize: 20,
+				totalPage: 1
+			}
+		}
+	},
+	methods: {
+		confirmBtn() {
+			var route_path = window.location.href.split("#")[1];
+			this.carhelp.set("back_url", route_path);
+			uni.reLaunch({
+				url: '/pages/car/login?back=true'
+			})
 		},
-		methods: {
-			reload(){
-				uni.navigateBack({
-				    delta: 2
-				});
-			},
-			matchFaceImage(){
-			
-				var obj=this.carhelp.get("form");
-				if(obj&&obj.name=='buytickets'){
-					this.id=obj.id;
-					this.pic=obj.pic;
-					this.$refs.common.showLoading();
-					var form={
-						faceImageUrl:this.pic,
-						id:this.id,
-					}
-					API.matchFaceImage(form).then((res) => {
-						console.log(res)
-						this.$refs.common.showLoading(false);
-					}).catch(error => {
-						this.$refs.common.showLoading(false, error);
-					
-					})
-				}else{
-					this.$refs.alert("页面异常!");
+		submit(){
+			var obj=this.carhelp.get("form");
+			obj.oplist=[]
+			for(var i in this.list){
+				if(this.list[i].ck){
+					obj.oplist.push(this.list[i]);
 				}
 			}
-		},
-		onReady() {
-			 this.matchFaceImage()
-		}
-	}
-
+			this.carhelp.set("form",obj);
+			
+			uni.navigateTo({
+				url: '/pages/buytickets/site?id=' + this.id
+			})
+		},
+		ckBtn(item){
+			item.ck=!item.ck;
+			
+			if(item.ck){
+				this.num++;
+			}else{
+				this.num--;
+			}
+		},
+		upBusNoTicketList() {
+			this.$refs.common.showLoading();
+			this.subForm.id = this.id;
+			API.upBusNoTicketList(this.subForm).then((res) => {
+				console.log(res)
+				var list=res.data.data
+				for(var i in list ){
+					list[i].ck=false;
+				}
+				this.list= list;
+				this.$refs.common.showLoading(false);
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+
+			})
+		}
+	},
+	onLoad(op) {
+
+		this.id = op.id
+	},
+	onReady() {
+
+		if (!this.id) {
+			this.$refs.common.goError()
+		}
+		var obj = this.carhelp.get("form")
+
+		if (obj && obj.name == 'buytickets' && obj.id == this.id) {
+			//不创建新订单
+		} else {
+			this.carhelp.set("form", {
+				name: 'buytickets',
+				id: this.id,
+				oplist:[],//当前添加的2人
+				list: []  // 一共添加的人 
+			});
+		}
+
+		if (!this.carhelp.getPersonInfo()) {
+			this.$refs.common.setFnc(this.confirmBtn)
+			this.$refs.common.alert2('您还不是车信达用户,注册后再购买车票。', '前往注册', '尚未注册')
+		} else {
+			this.upBusNoTicketList();
+		}
+
+
+	}
+}

+ 13 - 10
pages/buytickets/confirm.vue

@@ -1,35 +1,38 @@
 <template>
 	<view>
-		<car-common :login="true"  mytitle="确认身份" ref="common"></car-common>
+		<car-common    mytitle="确认身份" ref="common"></car-common>
 		
 		<view class="confirm">
 			<view class="confirm-img-border2" v-if="list.length">
 				<view class="confirm-img-border">
 					<view class="confirm-img">
-						<img src="/static/img/1.jpg" alt="">
+						<img src="static/img/1.jpg" alt="">
 					</view>
 				</view>
 			</view>
 			<view class="confirm-img-border3" v-if="!list.length">
 				<view class="confirm-img-border">
 					<view class="confirm-img">
-						<img src="/static/img/discern.png" alt="">
+						<img src="static/img/discern.png" alt="">
 					</view>
 				</view>
 			</view>
 			<h3 v-if="list.length">确认以下哪张是您的照片?</h3>
 			<view class="confirm-pic" v-if="list.length">
-				<view class="confirm-pic-item active"><img src="/static/img/1.jpg" alt=""></view>
-				<view class="confirm-pic-item"><img src="/static/img/2.jpg" alt=""></view>
-				<view class="confirm-pic-item"><img src="/static/img/3.jpg" alt=""></view>
-				<view class="confirm-pic-item"><img src="/static/img/1.jpg" alt=""></view>
+				<template v-for="item in list">
+					<view class="confirm-pic-item " :class="item.ck?'active':''" @click="ckBtn(item)" >
+						<img :src="item.imageUrl" alt="">
+					</view>
+				</template>
+				
+				 
 			</view>
 		</view>
-		<view class="upload-button" v-if="list.length">
+		<view class="upload-button" v-show="num">
 			<u-button type="primary" shape="circle" @click="submit">确定</u-button>
 		</view>
-		<view class="upload-button" v-if="!list.length">
-			<u-button type="primary" shape="circle" @click="reload">重新选择</u-button>
+		<view class="upload-button" v-show="!num">
+			<u-button type="default" shape="circle" >请选择</u-button>
 		</view>
 	</view>
 </template>

+ 260 - 88
pages/buytickets/index.js

@@ -1,11 +1,16 @@
 import * as WxJsApi from '@/utils/wxJsApi.js'
 import * as API from '@/apis/buytickets.js'
-
+import * as Pay from '@/apis/weixin.js'
+import {
+	wxPayJs
+} from '@/utils/wxpay'
 import Carmap from '@/components/Carmap.vue'
 
 export default {
 	data() {
 		return {
+
+			initBl: false,
 			title: '乘车人',
 			show: false,
 			id: 0, // 使用 marker点击事件 需要填写id
@@ -22,8 +27,8 @@ export default {
 				obj: null,
 				longitude: '',
 				latitude: '',
-			},
-			stationList:[],
+			},
+			stationList: [],
 			//个人
 			info: {
 				obj: null,
@@ -31,7 +36,14 @@ export default {
 				longitude: '',
 				latitude: '',
 			},
-			myinterval:''
+			myinterval: '',
+			downId: '',
+			downName: '',
+			passengerInfo: {
+				totalAmount: 0,
+				id: '',
+				list: []
+			}
 
 		}
 	},
@@ -40,26 +52,103 @@ export default {
 	},
 
 	methods: {
-		select(uid) {
-			uni.navigateTo({
-				url: '/pages/buytickets/site?id=' + this.id + '&uid=' + uid
-			})
+		downBtn(item) {
+			if (item.status == 2) {
+				this.downId = item.id
+				this.downName = item.stationName
+
+			}
+
+		},
+		select(op) {
+			//passengerInfo
+			var obj = this.carhelp.get("form");
+			if (this.passengerInfo.id) {
+				obj.mergeOrderId = this.passengerInfo.id;
+
+			}
+
+			if (op) {
+				obj.op = op;
+				this.carhelp.set("form", obj);
+
+				uni.navigateTo({
+					url: '/pages/buytickets/site?id=' + this.id + '&uid=' + op.id
+				})
+			} else {
+				obj.op = null;
+				this.carhelp.set("form", obj);
+				uni.navigateTo({
+					url: '/pages/buytickets/confirm?id=' + this.id
+				})
+			}
+
 		},
-		add() {
-			uni.navigateTo({
-				url: '/pages/buytickets/site?id=' + this.id
+
+		selectSiteBtn() {
+
+			var obj = this.carhelp.get("form");
+			var upid = obj.oplist[0].upStationId;
+			var downid = this.downId;
+
+			this.$refs.common.showLoading();
+
+			var thisform = {
+				ticketUpStationId: upid,
+				ticketDownStationId: downid,
+				ticketDownStationName: this.downName,
+				price1: 0,
+				price2: 0
+			}
+			thisform.ticketType = 1;
+
+			API.ticketAmount(thisform).then((response) => {
+				thisform.price1 = response.data.price
+				thisform.ticketType = 2;
+				API.ticketAmount(thisform).then((response2) => {
+					thisform.price2 = response2.data.price
+					obj.ticket = thisform;
+					this.carhelp.set("form", obj);
+					//uni.navigateBack()
+					uni.navigateTo({
+						url: '/pages/buytickets/site?id=' + this.id
+					})
+				})
+
+
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+
 			})
+
 		},
 		submit() {
-			this.$refs.common.setFnc(this.confirmBtn)
-			this.$refs.common.alert2('您还不是车信达用户,注册后再购买车票。', '前往注册', '尚未注册')
+			this.$refs.common.showLoading();
+
+
+			Pay.wxpay(this.passengerInfo.id).then((response) => {
+
+				var data = response.data
+				var url = window.location.href.split("#")[0] + "/#/pages/buytickets/success";
+
+				var obj = {
+					...data,
+					url: url
+				}
+				wxPayJs(obj);
 
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+
+			})
 		},
-		drawing(point,startend) {
-			
-			this.$refs.amap.initMap(point,this.stationList,startend);
+		drawing(point, startend) {
+			if (this.$refs.amap) {
+				this.$refs.amap.initMap(point, this.stationList, startend);
+			}
 		},
-		getShiftInfoResponse(response,response2) {
+		getShiftInfoResponse(response, response2) {
+			this.$refs.common.showLoading();
 
 			var res = response.data
 			this.title = res.routeName;
@@ -79,111 +168,194 @@ export default {
 					this.latitude = sz[1]
 				}
 
-			})
-			var obj = this.carhelp.get("form")
-			
-			obj.getShiftInfo = response;
-			obj.getVehicleStationInfo = response2;
-			
-			this.stationList=obj.getVehicleStationInfo.data
-			
-			obj = this.carhelp.set("form", obj)
-			
-			var sz1=response.data.startStationCoordinate.split("|")
-			var sz2=response.data.endStationCoordinate.split("|")
-			var startend=[
-				{
-					longitude:sz1[0],
-					latitude:sz1[1],
-					name:response.data.startStation
-				},{
-					longitude:sz2[0],
-					latitude:sz2[1],
-					name:response.data.endStation
-				}
-			];
-			
-			this.drawing(point,startend);
-			this.$refs.common.showLoading(false);
-			
-			this.myinterval=setInterval(this.getPoint,10000);
-			
+			})
+			var obj = this.carhelp.get("form")
+
+			obj.getShiftInfo = response;
+			obj.getVehicleStationInfo = response2;
+
+			var list = obj.getVehicleStationInfo.data;
+			for (var i in list) {
+				list[i].status = 0;
+			}
+			this.stationList = list
+			obj = this.carhelp.set("form", obj)
+
+			var sz1 = response.data.startStationCoordinate.split("|")
+			var sz2 = response.data.endStationCoordinate.split("|")
+			var startend = [{
+				longitude: sz1[0],
+				latitude: sz1[1],
+				name: response.data.startStation
+			}, {
+				longitude: sz2[0],
+				latitude: sz2[1],
+				name: response.data.endStation
+			}];
+
+			this.drawing(point, startend);
+			//this.$refs.common.showLoading(false);
+			this.getPoint()
+
 		},
 		getShiftInfo() {
+
+			this.$refs.common.showLoading();
+
 			var obj = this.carhelp.get("form")
-			if (obj.getShiftInfo&&obj.getVehicleStationInfo) {
-				this.stationList=obj.getVehicleStationInfo.data
-				this.getShiftInfoResponse(obj.getShiftInfo,obj.getVehicleStationInfo);
+			if (obj.getShiftInfo && obj.getVehicleStationInfo) {
+				this.stationList = obj.getVehicleStationInfo.data
+				this.getShiftInfoResponse(obj.getShiftInfo, obj.getVehicleStationInfo);
 				return;
 			}
 
-			this.$refs.common.showLoading();
-			
+
 			API.getShiftInfo(this.id).then((response) => {
 				if (!response.result) {
 					this.$refs.common.goError(response.message)
 					return
 				}
-				API.getVehicleStationInfo(this.id).then((response2) => {
-					this.getShiftInfoResponse(response,response2);
-					
+				API.getVehicleStationInfo(this.id).then((response2) => {
+					this.getShiftInfoResponse(response, response2);
+
 				})
-				
+
 			}).catch(error => {
 				this.$refs.common.showLoading(false, error);
 
 			})
 		},
-		getPoint() {
-			
-			WxJsApi.getLocation().then((res) => {
+		getPassengerInfo() {
+			var thisform = {
+				id: this.id,
+				openId: this.carhelp.getOpenId()
+			}
+			this.$refs.common.showLoading()
+
+			API.getPassengerInfo(thisform).then((response) => {
+				if (!response.result) {
+					this.$refs.common.goError(response.message)
+					return
+				}
+				this.passengerInfo = response.data
+
 
-				var latitude = parseFloat(res.latitude);
-				var longitude = parseFloat(res.longitude);
+				var obj = this.carhelp.get("form");
+				obj.list = this.passengerInfo.list;
+				this.carhelp.set("form", obj);
 
-				if (!this.info.init) {
-					this.latitude = latitude;
-					this.longitude = longitude;
+				if (!response.data.id) {
+					uni.redirectTo({
+						url: '/pages/buytickets/confirm?id=' + this.id
+					})
+				} else {
+				
+					this.getShiftInfo()
 				}
-				this.info.init = true
-				this.info.latitude = latitude;
-				this.info.longitude = longitude;
-				
-				this.$refs.amap.setPerson(this.info);
+			}).catch(error => {
+
+				if (error) {
+					this.$refs.common.goError(error)
+					return
+				}
+				//this.$refs.common.showLoading(false,error)
+			})
+		},
+		getPoint() {
+
+
+			if (!this.initBl) {
+				this.$refs.common.showLoading();
+			}
+			API.getVehicleInfo(this.id).then((response) => {
+				this.car = response.data;
+				this.$refs.amap.setCar(this.car);
+				var bl = false;
+				for (var i in this.stationList) {
+					var stat = this.stationList[i];
+					stat.status = 0
+					if (bl) {
+						stat.status = 2;
+					}
+					if (stat.id == this.car.currentStationId) {
+						stat.status = 1;
+						bl = true;
+					}
+				}
+				if (!this.initBl) {
+					this.initBl = true
+
+					this.$nextTick(function() {
+						const query = uni.createSelectorQuery().in(this);
+						query.select('.map-now').boundingClientRect(data => {
+							if (data) {
+								document.getElementById('map-route-main').scrollLeft = data
+								.left;
+							}
+							this.$refs.common.showLoading(false);
+						}).exec();
+					});
+				} else {
+					this.$refs.common.showLoading(false);
+				}
+
+
+
 
 			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
 
 			})
+			if (!this.info.init) {
+				WxJsApi.getWxConfig(['getLocation']).then(() => {
+					// this.$refs.common.showLoading(false)
+					this.getLocation()
+				});
+			}else{
+					this.getLocation()
+			}
+		
+			
+
+			var pages = getCurrentPages();
+			var page = (pages[pages.length - 1]).route;
+			if (page == "pages/buytickets/index") {
+				setTimeout(this.getPoint, 10000);
+
+			}
+		},
+		getLocation(){
+			WxJsApi.getLocation().then((res) => {
+				console.log("----getLocation ok-----")
+				var latitude = parseFloat(res.latitude);
+				var longitude = parseFloat(res.longitude);
 			
+				if (!this.info.init) {
+					this.latitude = latitude;
+					this.longitude = longitude;
+				}
+				this.info.init = true
+				this.info.latitude = latitude;
+				this.info.longitude = longitude;
 			
-			API.getVehicleInfo(this.id).then((response) => {
-				this.car=response.data;
-				this.$refs.amap.setCar(this.car);
-				
-			}).catch(error => {
-				this.$refs.common.showLoading(false, error);
+				this.$refs.amap.setPerson(this.info);
 			
-			})
-		},
-
+			}).catch(error => {
+				console.log(error)
+			})
+		}
 
 	},
 	onLoad(op) {
 
 		this.id = op.id
 	},
-	onUnload(){
-		if(this.myinterval){
-			clearInterval(this.myinterval)
-		}
+	onUnload() {
+		if (this.myinterval) {
+			clearInterval(this.myinterval)
+		}
 	},
 	onReady() {
-
-
-
-		WxJsApi.getWxConfig(['getLocation']);
-		
-		this.getShiftInfo()
-
+		this.getPassengerInfo()
 	}
 }

+ 10 - 10
pages/buytickets/index.vue

@@ -9,24 +9,24 @@
 				<h4>{{shiftInfo.startStation}} → {{shiftInfo.endStation}}</h4>
 				<p>首班:{{shiftInfo.startTime}} 末班:{{shiftInfo.endTime}}</p>
 			</view>
-			<template  v-for="item in list">
-				<view class="ticket-item" @click="select">
-					<view class="ticket-item-left">
+			<template  v-for="item in passengerInfo.list">
+				<view class="ticket-item" @click="select(item)">
+					<view class="ticket-item-left"  >
 						<view class="ticket-head">
-							<u-avatar size="mini"></u-avatar>
-							<h3>玉桥 - 宿架转盘</h3>
+							<u-avatar size="mini" :src="item.imageUrl"></u-avatar>
+							<h3>{{item.ticketUpStationName}} - {{item.ticketDownStationName}}</h3>
 						</view>
 						<view class="ticket-text">
 							<view class="ticket-text-row">
-								<p>票种:</p><span>成人票</span>
+								<p>票种:</p><span>{{item.ticketTypeStr}}</span>
 							</view>
 							<view class="ticket-text-row">
-								<p>货票:</p><span>¥20.00</span>
+								<p>货票:</p><span>¥{{item.goodsTicket}}</span>
 							</view>
 						</view>
 					</view>
 					<view class="ticket-item-right">
-						<h3>26.00</h3>
+						<h3>{{item.totalFee}}</h3>
 						<p>票价</p>
 					</view>
 				</view>
@@ -34,7 +34,7 @@
 			
 			 
 			<view class="add-btn">
-				<u-button type="primary" plain @click="add()">
+				<u-button type="primary" plain @click="select()">
 					<u-icon name="man-add-fill" color="#2979ff"  size="32"></u-icon>
 					添加乘车人
 				</u-button>
@@ -42,7 +42,7 @@
 			<view class="add-foot">
 				<view class="add-foot-price">
 					<p>合计:</p>
-					<span>¥0.00</span>
+					<span>¥{{passengerInfo.totalAmount}}</span>
 				</view>
 				<view class="add-foot-btn" @click="submit()">
 					结算

+ 272 - 90
pages/buytickets/selectSite.js

@@ -1,118 +1,273 @@
 import * as WxJsApi from '@/utils/wxJsApi.js'
 import * as API from '@/apis/buytickets.js'
-import Carmap from '@/components/Carmap.vue'
- 
+
+import Carmap from '@/components/Carmap.vue'
+
 export default {
 	data() {
-		return {
+		return {
 			
+			initBl: false,
+			title: '乘车人',
 			show: false,
 			id: 0, // 使用 marker点击事件 需要填写id
-			mytitle:'乘车人',
+
 			//地图居中后的位置
 			longitude: 112.276527,
 			latitude: 30.306427,
-			shiftInfo:{
-				
-			},
-			list:[
-				{},{}
-			],
+			shiftInfo: {
+
+			},
+			list: [{}, {}],
 			//车的位置
-			car: {
-				obj:null,
+			car: {
+				obj: null,
 				longitude: '',
 				latitude: '',
 			},
+			stationList: [],
 			//个人
-			info: {
-				obj:null,
+			info: {
+				obj: null,
 				init: false,
 				longitude: '',
 				latitude: '',
 			},
-
-		
+			myinterval: '',
+			downId: '',
+			downName: '',
+			passengerInfo:{
+				totalAmount:0,
+				id:'',
+				list:[]
+			}
+			
 		}
 	},
-	components:{
-		Carmap
-	},
-	
-	methods: {
-		select(uid){
-			uni.navigateTo({
-				url: '/pages/buytickets/site?id='+this.id+'&uid='+uid
-			})
-		},
-		add(){
-			uni.navigateTo({
-				url: '/pages/buytickets/site?id='+this.id
-			})
+	components: {
+		Carmap
+	},
+
+	methods: {
+		downBtn(item) {
+			if (item.status != 0) {
+				this.downId = item.id
+				this.downName = item.stationName
+
+			}
+
 		},
-		submit() {
-			this.$refs.common.setFnc(this.confirmBtn)
-			this.$refs.common.alert2('您还不是车信达用户,注册后再购买车票。','前往注册','尚未注册')
-			 
+		select(uid) {
+			//passengerInfo
+			if(this.passengerInfo.id){
+				var obj=this.carhelp.get("form");
+				obj.mergeOrderId=this.passengerInfo.id;
+				this.carhelp.set("form",obj);
+			}
+			if(uid){
+				uni.navigateTo({
+					url: '/pages/buytickets/site?id=' + this.id + '&uid=' + uid
+				})
+			}else{
+				uni.navigateTo({
+					url: '/pages/buytickets/confirm?id=' + this.id 
+				})
+			}
+			
 		},
-		 drawing(point){
-			 this.$refs.amap.initMap(point);
-		 },
-		 getShiftInfoResponse(response){
-			 
-			 	
-			 	if(!response.result){
-			 		 
-			 		this.$refs.common.goError(response.message)
-			 		
-			 		return
-			 	}
-			 	
-			 	var res=response.data
-			 	this.title=res.routeName;
-			 	this.shiftInfo=res;
-			 	this.car.latitude = res.latitude;
-			 	this.car.longitude = res.longitude;
-			 	var point=[];
-			 	res.mapPath.split("|").forEach((item) => {
-			 		var sz = item.split(",");
-			 
-			 		point.push({
-			 			longitude: sz[0],
-			 			latitude: sz[1],
-			 		})
-			 		if (!process.car.SIMPLE_RUN) {
-			 			this.longitude = sz[0]
-			 			this.latitude = sz[1]
-			 		}
+	
+		selectSiteBtn(){
 			 
-			 	})
-			 	this.drawing(point);
-			 	this.$refs.common.showLoading(false);
-		 },
-		getShiftInfo() {
+			var obj=this.carhelp.get("form");
+			var upid='';
 			
-			var obj=this.carhelp.get("form")
-			if(obj.getShiftInfo){
-				this.getShiftInfoResponse(obj.getShiftInfo);
-				return;
+			if(obj.op){
+				upid=obj.op.ticketUpStationId;
+			}else{
+				upid=obj.oplist[0].upStationId;	
 			}
-			
-			this.$refs.common.showLoading();
-			API.getShiftInfo(this.id).then((response) => {
-				this.getShiftInfoResponse(response);
+			var downid=this.downId;
+			
+			this.$refs.common.showLoading();
+			
+			var thisform={
+				ticketUpStationId:upid,
+				ticketDownStationId:downid	,	
+				ticketDownStationName:this.downName,
+				price1:0,
+				price2:0
+			}
+			thisform.ticketType=1;
+			 
+			API.ticketAmount(thisform).then((response) => {
+				thisform.price1=response.data.price
+				thisform.ticketType=2;
+				API.ticketAmount(thisform).then((response2) => {
+					thisform.price2=response2.data.price
+					obj.ticket=thisform;
+					if(obj.op){
+						 obj.op.ticketDownStationId=this.downId;
+						obj.op.ticketDownStationName=this.downName;
+					}
+					
+					this.carhelp.set("form",obj);
+					//uni.navigateBack()
+					uni.navigateTo({
+						url: '/pages/buytickets/site?id='+this.id
+					})
+				})
 				
-				obj.getShiftInfo=response;
-				obj=this.carhelp.set("form",obj)
-				
+			
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+			
+			})
+			
+		},
+		submit() {
+			this.$refs.common.setFnc(this.confirmBtn)
+			this.$refs.common.alert2('您还不是车信达用户,注册后再购买车票。', '前往注册', '尚未注册')
+
+		},
+		drawing(point, startend) {
+			if(this.$refs.amap){
+				this.$refs.amap.initMap(point, this.stationList, startend);
+			}
+		},
+		getShiftInfoResponse(response, response2) {
+			this.$refs.common.showLoading();
+
+			var res = response.data
+			this.title = res.routeName;
+			this.shiftInfo = res;
+			this.car.latitude = res.latitude;
+			this.car.longitude = res.longitude;
+			var point = [];
+			res.mapPath.split("|").forEach((item) => {
+				var sz = item.split(",");
+
+				point.push({
+					longitude: sz[0],
+					latitude: sz[1],
+				})
+				if (!process.car.SIMPLE_RUN) {
+					this.longitude = sz[0]
+					this.latitude = sz[1]
+				}
+
+			})
+			var obj = this.carhelp.get("form")
+
+			obj.getShiftInfo = response;
+			obj.getVehicleStationInfo = response2;
+
+			var list = obj.getVehicleStationInfo.data;
+			for (var i in list) {
+				list[i].status = 0;
+			}
+			this.stationList = list
+			obj = this.carhelp.set("form", obj)
+
+			var sz1 = response.data.startStationCoordinate.split("|")
+			var sz2 = response.data.endStationCoordinate.split("|")
+			var startend = [{
+				longitude: sz1[0],
+				latitude: sz1[1],
+				name: response.data.startStation
+			}, {
+				longitude: sz2[0],
+				latitude: sz2[1],
+				name: response.data.endStation
+			}];
+
+			this.drawing(point, startend);
+			//this.$refs.common.showLoading(false);
+			this.getPoint()
+		
+
+		},
+		getShiftInfo() {
+			 
+			this.$refs.common.showLoading();
+
+			var obj = this.carhelp.get("form")
+			if (obj.getShiftInfo && obj.getVehicleStationInfo) {
+				this.stationList = obj.getVehicleStationInfo.data
+				this.getShiftInfoResponse(obj.getShiftInfo, obj.getVehicleStationInfo);
+				return;
+			}
+
+
+			API.getShiftInfo(this.id).then((response) => {
+				if (!response.result) {
+					this.$refs.common.goError(response.message)
+					return
+				}
+				API.getVehicleStationInfo(this.id).then((response2) => {
+					this.getShiftInfoResponse(response, response2);
+
+				})
+
 			}).catch(error => {
 				this.$refs.common.showLoading(false, error);
 
 			})
+		},
+		getPassengerInfo(){
+			var thisform={
+				id:this.id,
+				openId:this.carhelp.getOpenId()
+			}
+			API.getPassengerInfo(thisform).then((response) => {
+				this.passengerInfo=response.data
+			
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+			
+			})
 		},
 		getPoint() {
+			if (!this.initBl) {
+				this.$refs.common.showLoading();
+			}
+			API.getVehicleInfo(this.id).then((response) => {
+				this.car = response.data;
+				this.$refs.amap.setCar(this.car);
+				var bl = false;
+				for (var i in this.stationList) {
+					var stat = this.stationList[i];
+					stat.status = 0
+					if (bl) {
+						stat.status = 2;
+					}
+					if (stat.id == this.car.currentStationId) {
+						stat.status = 1;
+						bl = true;
+					}
+				}
+				if (!this.initBl) {
+					this.initBl = true
+					
+					this.$nextTick(function() {
+						const query = uni.createSelectorQuery().in(this);
+						query.select('.map-now').boundingClientRect(data => {
+							if(data){
+								document.getElementById('map-route-main').scrollLeft = data.left;
+							}
+							this.$refs.common.showLoading(false);
+						}).exec();
+					});
+				}else{
+					this.$refs.common.showLoading(false);
+				}
 
 
+
+
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+
+			})
 			WxJsApi.getLocation().then((res) => {
 
 				var latitude = parseFloat(res.latitude);
@@ -125,24 +280,51 @@ export default {
 				this.info.init = true
 				this.info.latitude = latitude;
 				this.info.longitude = longitude;
-				
+
+				this.$refs.amap.setPerson(this.info);
 
 			}).catch(error => {
 
-			})
+			})
+			
+			var pages = getCurrentPages();
+			var page = (pages[pages.length - 1]).route;  
+			if(page=="pages/buytickets/selectSite"){
+				setTimeout(this.getPoint, 10000);
+				
+			}
 		},
-	
+
 
 	},
-	onLoad(op) {
-		
-		this.id = op.id
-	},
+	onLoad(op) {
 
+		this.id = op.id
+		var obj=this.carhelp.get("form");
+	 
+		
+		if(obj.op){
+			
+			this.downId= obj.op.ticketDownStationId;
+			this.downName=obj.op.ticketDownStationName;
+		}
+	},
+	onUnload() {
+		if (this.myinterval) {
+			clearInterval(this.myinterval)
+		}
+	},
 	onReady() {
 
-			WxJsApi.getWxConfig([ 'getLocation']);
-			this.getPoint();
-			this.getShiftInfo()
+			this.$refs.common.showLoading()
+			 WxJsApi.getWxConfig(['getLocation']).then(()=>{
+				 this.$refs.common.showLoading(false)
+			 });
+
+	
+		this.getShiftInfo()
+		var pages = getCurrentPages();  
+		var page = (pages[pages.length - 1]).route;  
+		
 	}
 }

+ 342 - 305
pages/buytickets/selectSite.vue

@@ -1,305 +1,342 @@
-<template>
-	<view>
-		<car-common :login="true"  :mytitle="title" ref="common"></car-common>
-		<carmap ref="amap"></carmap>
-		
-		<view class="map-info">
-			<view class="map-text">
-				<h4>{{shiftInfo.startStation}} → {{shiftInfo.endStation}}</h4>
-				<p>首班:{{shiftInfo.startTime}} 末班:{{shiftInfo.endTime}}</p>
-			</view>
-			<!-- <view class="map-btn">
-				<u-icon name="swap" custom-prefix="custom-icon"  color="#2979ff"></u-icon>
-				<span>换向</span>
-			</view> -->
-		</view>
-		<view class="map-route">
-			<view class="map-route-head" v-if="false">
-				2站3公里
-			</view>
-			<view class="map-route-main">
-				<template v-for="item,i in stationList">
-					 <view class="map-route-origin" v-if="i==0">
-					 	<view class="map-route-circle"></view>
-					 	<view class="map-route-name">
-					 		1锣场
-					 	</view>
-					 </view>
-					 
-					 <view class="map-route-item map-after" v-if="item.id!=car.currentStationId">
-					 	<view class="map-route-circle"></view>
-					 	<view class="map-route-line"></view>
-					 	<view class="map-route-name">
-					 		2东方大道
-					 	</view>
-					 </view>
-					 
-				</template>
-			</view>
-			<view class="map-route-main" v-if="false">
-				<view class="map-route-origin">
-					<view class="map-route-circle"></view>
-					<view class="map-route-name">
-						1锣场
-					</view>
-				</view>
-				<view class="map-route-item map-after">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						2东方大道
-					</view>
-				</view>
-				<view class="map-route-item map-now">
-					<view class="map-route-car">
-						<img src="/static/img/car.png" alt="">
-					</view>
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						3小天鹅
-					</view>
-				</view>
-				<view class="map-route-item">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						4宿架转盘转盘
-					</view>
-				</view>
-				<view class="map-route-item">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						5荆棉
-					</view>
-				</view>
-				<view class="map-route-item map-geton">
-					<view class="map-geton-mark">
-						<img src="/static/img/down.png" alt="">
-					</view>
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						6跃进村
-					</view>
-				</view>
-				<view class="map-route-item">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						7变电站
-					</view>
-				</view>
-				<view class="map-route-item">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						8跃进村
-					</view>
-				</view>
-				<view class="map-route-item">
-					<view class="map-route-circle"></view>
-					<view class="map-route-line"></view>
-					<view class="map-route-name">
-						9变电站
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="add-foot">
-			<view class="add-foot-price">
-				<p>下站站点:棉麻</p>
-			</view>
-			<view class="add-foot-btn">
-				确认
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import api from './index.js'
-	export default api;
-</script>
-<style scoped lang="scss">
-	.map-route{
-		border-top: 10px solid #f7f7f7;
-		background-color: #fff;
-		padding-bottom: 60px;
-		.map-route-head{
-			font-size: 18px;
-			color:#007AFF;
-			text-align: center;
-			line-height: 40px;
-			border-bottom: 1px solid #eee;
-		}
-		.map-route-main{
-			padding: 10px;
-			position: relative;
-			overflow-x: scroll!important;
-			display: -webkit-box;
-		}
-	}
-	.map-info{
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		background-color: #fff;
-		padding: 20rpx;
-	}
-	.map-text{
-		h4{
-			font-size: 16px;
-		}
-		p{
-			margin-top: 10rpx;
-			color:#999;
-		}
-	}
-	.map-btn{
-		border: 1px solid #007AFF;
-		color:#007AFF;
-		padding: 5px 15px;
-		border-radius:30px ;
-		span{
-			margin-left: 6rpx;
-		}
-	}
-	.map-route-origin{
-		position: relative;
-		height: 200px;
-		width:15px;
-		.map-route-circle{
-			position: absolute;
-			left: 0;
-			top:30px;
-			height: 15px;
-			width: 15px;
-			border-radius: 50%;
-			background-color: #999;
-			border: 3px solid #fff;
-			box-shadow: 1px 1px 1px rgba(0,0,0,0.1);
-			z-index: 99;
-		}
-		.map-route-name{
-			position: absolute;
-			top: 50px;
-			width: 16px;
-			line-height: 16px; 
-			z-index: 999;
-			left: 3px;
-		}
-	}
-	.map-route-item{
-		position: relative;
-		height: 200px;
-		width: 60px;
-		.map-route-circle{
-			position: absolute;
-			right: -2px;
-			top:30px;
-			height: 15px;
-			width: 15px;
-			border-radius: 50%;
-			background-color: #fff;
-			border: 3px solid #1677ff;
-			z-index: 99;
-		}
-		.map-route-line{
-			height:6px;
-			background-color: #1677ff;
-			width:55px;
-			position: absolute;
-			left: 0px;
-			top:35px;
-			z-index: 9;
-		}
-		.map-route-name{
-			position: absolute;
-			top: 50px;
-			width: 16px;
-			line-height: 16px; 
-			z-index: 999;
-			right: -3px;
-			text-align: center;
-		}
-	}
-	.map-route-item.map-now{
-		.map-route-car{
-			height:30px;
-			width: 30px;
-			position: absolute;
-			left: 10px;
-			top: 5px;
-			img{
-				height: 100%;
-				width: 100%;
-			}
-		}
-		.map-route-circle{
-			border: 3px solid #ff6200;
-		}
-		.map-route-line{
-			background-color: #ff6200;
-		}
-	}
-	.map-route-item.map-after{
-		.map-route-circle{
-			border: 3px solid #999;
-		}
-		.map-route-line{
-			background-color: #999;
-		}
-	}
-	.map-route-item.map-geton{
-		.map-geton-mark{
-			width: 20px;
-			height: 20px;
-			right: 0;
-			position: absolute;
-			right: -4px;
-			top: 5px;
-			img{
-				height: 100%;
-				width: 100%;
-			}
-		}
-		.map-route-circle{
-			border: 3px solid #25ad3b;
-		}
-		.map-route-name{
-			color:#25ad3b
-		}
-	}
-
-	.add-foot{
-		position: fixed;
-		background-color: #fff;
-		border-top: 1px solid #eee;
-		z-index: 999;
-		bottom:0;
-		left: 0;
-		right: 0;
-		height: 90rpx;
-		display: flex;
-		justify-content: space-between;
-		.add-foot-price{
-			display: flex;
-			align-items: center;
-			padding-left: 20rpx;
-			font-size: 32rpx;
-			span{
-				color: #1677ff;
-			}
-		}
-		.add-foot-btn{
-			width: 240rpx;
-			background-color: #1677ff;
-			color:#fff;
-			font-size: 32rpx;
-			text-align: center;
-			line-height: 90rpx;
-		}
-	}
-</style>
+<template>
+	<view>
+		<car-common :login="true" :mytitle="title" ref="common"></car-common>
+		<carmap ref="amap"></carmap>
+
+		<view class="map-info">
+			<view class="map-text">
+				<h4>{{shiftInfo.startStation}} → {{shiftInfo.endStation}}</h4>
+				<p>首班:{{shiftInfo.startTime}} 末班:{{shiftInfo.endTime}}</p>
+			</view>
+			<!-- <view class="map-btn">
+				<u-icon name="swap" custom-prefix="custom-icon"  color="#2979ff"></u-icon>
+				<span>换向</span>
+			</view> -->
+		</view>
+		<view class="map-route">
+			<view class="map-route-head" v-if="false">
+				2站3公里
+			</view>
+<view class="map-route-main"  id="map-route-main">
+	
+		
+				<template v-for="item,i in stationList">
+					<view :id="item.status==1?'map-now':''" class="scroll-view-item" :class="{'map-route-origin':i==0,'map-route-item':i!=0,'map-after':item.status==0,
+						'map-now':item.status==1,'map-geton':downId==item.id}" @click="downBtn(item)">
+						
+						<view class="map-geton-mark" v-show="downId==item.id">
+							<img src="static/img/down.png" alt="">
+						</view>
+						<view class="map-route-car"   v-if="item.status==1">
+							<img src="static/img/car.png" alt="">
+						</view>
+						<view class="map-route-circle"></view>
+						<view class="map-route-line"></view>
+						<view class="map-route-name">
+							{{item.stationName}}
+						</view>
+					</view>
+
+				</template>
+
+		
+</view>	
+
+			<view class="map-route-main" v-if="false">
+				<view class="map-route-origin">
+					<view class="map-route-circle"></view>
+					<view class="map-route-name">
+						1锣场
+					</view>
+				</view>
+				<view class="map-route-item map-after">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						2东方大道
+					</view>
+				</view>
+				<view class="map-route-item map-now">
+					<view class="map-route-car">
+						<img src="static/img/car.png" alt="">
+					</view>
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						3小天鹅
+					</view>
+				</view>
+				<view class="map-route-item">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						4宿架转盘转盘
+					</view>
+				</view>
+				<view class="map-route-item">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						5荆棉
+					</view>
+				</view>
+				<view class="map-route-item map-geton">
+					<view class="map-geton-mark">
+						<img src="static/img/down.png" alt="">
+					</view>
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						6跃进村
+					</view>
+				</view>
+				<view class="map-route-item">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						7变电站
+					</view>
+				</view>
+				<view class="map-route-item">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						8跃进村
+					</view>
+				</view>
+				<view class="map-route-item">
+					<view class="map-route-circle"></view>
+					<view class="map-route-line"></view>
+					<view class="map-route-name">
+						9变电站
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="add-foot">
+			<view class="add-foot-price">
+				<p>下站站点:{{downName?downName:'点击选择站点'}}</p>
+			</view>
+			<view class="add-foot-btn" v-show="downName" @click="selectSiteBtn()">
+				确认
+			</view>
+			<view class="add-foot-btn" style="background-color: #969896;" v-show="!downName">
+				确认
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import api from './selectSite.js'
+	export default api;
+</script>
+<style scoped lang="scss">
+	
+	.map-route {
+		border-top: 10px solid #f7f7f7;
+		background-color: #fff;
+		padding-bottom: 60px;
+
+		.map-route-head {
+			font-size: 18px;
+			color: #007AFF;
+			text-align: center;
+			line-height: 40px;
+			border-bottom: 1px solid #eee;
+		}
+
+		.map-route-main {
+			padding: 10px;
+			position: relative;
+			overflow-x: scroll !important;
+			display: -webkit-box;
+		}
+	}
+
+	.map-info {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		background-color: #fff;
+		padding: 20rpx;
+	}
+
+	.map-text {
+		h4 {
+			font-size: 16px;
+		}
+
+		p {
+			margin-top: 10rpx;
+			color: #999;
+		}
+	}
+
+	.map-btn {
+		border: 1px solid #007AFF;
+		color: #007AFF;
+		padding: 5px 15px;
+		border-radius: 30px;
+
+		span {
+			margin-left: 6rpx;
+		}
+	}
+
+	.map-route-origin {
+		position: relative;
+		height: 200px;
+		width: 15px;
+
+		.map-route-circle {
+			position: absolute;
+			left: 0;
+			top: 30px;
+			height: 15px;
+			width: 15px;
+			border-radius: 50%;
+			background-color: #999;
+			border: 3px solid #fff;
+			box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
+			z-index: 99;
+		}
+
+		.map-route-name {
+			position: absolute;
+			top: 50px;
+			width: 16px;
+			line-height: 16px;
+			z-index: 999;
+			left: 3px;
+		}
+	}
+
+	.map-route-item {
+		position: relative;
+		height: 200px;
+		width: 60px;
+
+		.map-route-circle {
+			position: absolute;
+			right: -2px;
+			top: 30px;
+			height: 15px;
+			width: 15px;
+			border-radius: 50%;
+			background-color: #fff;
+			border: 3px solid #1677ff;
+			z-index: 99;
+		}
+
+		.map-route-line {
+			height: 6px;
+			background-color: #1677ff;
+			width: 55px;
+			position: absolute;
+			left: 0px;
+			top: 35px;
+			z-index: 9;
+		}
+
+		.map-route-name {
+			position: absolute;
+			top: 50px;
+			width: 16px;
+			line-height: 16px;
+			z-index: 999;
+			right: -3px;
+			text-align: center;
+		}
+	}
+
+	.map-route-item.map-now {
+		.map-route-car {
+			height: 30px;
+			width: 30px;
+			position: absolute;
+			left: 10px;
+			top: 5px;
+
+			img {
+				height: 100%;
+				width: 100%;
+			}
+		}
+
+		.map-route-circle {
+			border: 3px solid #ff6200;
+		}
+
+		.map-route-line {
+			background-color: #ff6200;
+		}
+	}
+
+	.map-route-item.map-after {
+		.map-route-circle {
+			border: 3px solid #999;
+		}
+
+		.map-route-line {
+			background-color: #999;
+		}
+	}
+
+	.map-route-item.map-geton {
+		.map-geton-mark {
+			width: 20px;
+			height: 20px;
+			right: 0;
+			position: absolute;
+			right: -4px;
+			top: 5px;
+
+			img {
+				height: 100%;
+				width: 100%;
+			}
+		}
+
+		.map-route-circle {
+			border: 3px solid #25ad3b;
+		}
+
+		.map-route-name {
+			color: #25ad3b
+		}
+	}
+
+	.add-foot {
+		position: fixed;
+		background-color: #fff;
+		border-top: 1px solid #eee;
+		z-index: 999;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		height: 90rpx;
+		display: flex;
+		justify-content: space-between;
+
+		.add-foot-price {
+			display: flex;
+			align-items: center;
+			padding-left: 20rpx;
+			font-size: 32rpx;
+
+			span {
+				color: #1677ff;
+			}
+		}
+
+		.add-foot-btn {
+			width: 240rpx;
+			background-color: #1677ff;
+			color: #fff;
+			font-size: 32rpx;
+			text-align: center;
+			line-height: 90rpx;
+		}
+	}
+</style>

+ 201 - 78
pages/buytickets/site.js

@@ -1,94 +1,217 @@
- import * as API from '@/apis/buytickets.js'
-
-export default {
-		data() {
-			return {
-				value: 0,
-				uid:'',//用户id ,有id是修改
-				id:'',//车id
-				down:{name:'美国'},
-				op:{
-					
-				}
+import * as API from '@/apis/buytickets.js'
+
+ export default {
+ 	data() {
+ 		return {
+ 			 
+ 			uid: '', //用户id ,有id是修改
+ 			id: '', //车id
+ 			type: 2,
+ 			pnum: 0,
+			personNum:0,
+ 			up: {
+ 				name: '',
+ 				id: ''
+ 			},
+ 			down: {
+ 				name: '请选择',
+ 				id: ''
+ 			},
+ 			ticket: {
+ 				price1: 0,
+ 				price2: 0,
+ 			},
+ 			underLine: 1,
+ 			op: {
+
+ 			}
+ 		}
+ 	},
+ 	computed: {
+ 		// 计算属性的 getter
+ 		total: function() {
+ 			// `this` 指向 vm 实例
+			
+			var ptotal=0;
+			if(this.underLine){
+				ptotal+=this.ticket.price2
+			}else{
+				ptotal+=this.ticket.price1
 			}
-		},
-		methods: {
-			deleteBtn(){
-				if(this.uid){
+			ptotal=ptotal*this.personNum;
+			ptotal+=this.pnum
+			
+ 			return ptotal;
+ 		}
+ 	},
+ 	methods: {
+		personDelete(){
+			this.$refs.common.showLoading();
+			
+			var obj = this.carhelp.get("form")
+			var thisform={
+				id:obj.op.id,
+				mergeOrderId:obj.mergeOrderId
+			}
+			API.deletePassengerOrder(thisform).then((response) => {
+				obj.op=null
+				obj.ticket=null;
+				obj = this.carhelp.set("form", obj)
+				this.$refs.common.alert( "操作成功",()=>{
 					uni.navigateTo({
-						url: '/pages/buytickets/index?id='+this.id
+						url: '/pages/buytickets/index?id=' + this.id 
 					})
-				}
-			},
-			select(){
-				var obj=this.carhelp.get("form")
-				obj.op=this.op;
-				obj=this.carhelp.set("form",obj)
-				
-				uni.navigateTo({
-					url: '/pages/buytickets/selectSite?id='+this.id
-				})
-			},
-			clickBtn(){
-				var obj=this.carhelp.get("form")
-				obj.op=this.op;
-				obj=this.carhelp.set("form",obj)
+				});
 				
-				if(this.uid){
-					console.log("修改人员属性。。。")
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+			
+			})	
+		},
+ 		deleteBtn() {
+			this.$refs.common.setFnc(this.personDelete)
+ 			 this.$refs.common.confirm('是否删除该乘车人信息?')
+ 		},
+ 		select() {
+ 			//var obj = this.carhelp.get("form")
+ 			//obj.op = this.op;
+ 			//obj = this.carhelp.set("form", obj)
+
+ 			uni.navigateTo({
+ 				url: '/pages/buytickets/selectSite?id=' + this.id
+ 			})
+ 		},
+ 		clickBtn() {
+ 			var obj = this.carhelp.get("form")
+ 			//obj.op = this.op;
+ 			//obj = this.carhelp.set("form", obj)
+			this.$refs.common.showLoading();
+			var arr=[]
+			for(var i in obj.oplist){
+				arr.push(obj.oplist[i].id);
+			}
+			var thisform={
+				id:this.id,
+				mergeOrderId:obj.mergeOrderId,
+				openId:this.carhelp.getOpenId(),
+				passengerIds:arr.join(),
+				ticketUpStationId:this.up.id,
+				ticketDownStationId:this.down.id,
+				ticketType:this.underLine?2:1,
+				goodsTicket:this.pnum,
+				totalFee:this.total
+			}
+			if(obj.op){
+				thisform.id=obj.op.id;
+				API.updatePassengerOrder(thisform).then((response) => {
+					obj.oplist=[];
+					obj.ticket=null;
+					obj = this.carhelp.set("form", obj)
 					uni.navigateTo({
-						url: '/pages/buytickets/index?id='+this.id
+						url: '/pages/buytickets/index?id=' + this.id 
 					})
-				}else{
+					console.log(response)
+				}).catch(error => {
+					this.$refs.common.showLoading(false, error);
+				
+				})
+			}else{
+				API.createPassengerOrder(thisform).then((response) => {
+					obj.oplist=[];
+					obj.ticket=null;
+					obj = this.carhelp.set("form", obj)
 					uni.navigateTo({
-						url: '/pages/buytickets/upload'
+						url: '/pages/buytickets/index?id=' + this.id 
 					})
-				}
-			},
-			confirmBtn() {
-				var route_path = window.location.href.split("#")[1];
-				this.carhelp.set("back_url",route_path);
-				uni.reLaunch({
-					url: '/pages/car/login?back=true'
+					console.log(response)
+				}).catch(error => {
+					this.$refs.common.showLoading(false, error);
+				
+				})
+			}
+			
+ 		},
+ 		confirmBtn() {
+ 			var route_path = window.location.href.split("#")[1];
+ 			this.carhelp.set("back_url", route_path);
+ 			uni.reLaunch({
+ 				url: '/pages/car/login?back=true'
+ 			})
+ 		},
+ 	 
+ 		underLineChange(index) {
+ 			this.underLine = index;
+ 			console.log('当前值为: ' + index)
+
+ 		},
+		ticketAmount(){
+
+			this.$refs.common.showLoading();
+			
+			var thisform={
+				ticketUpStationId:this.up.id,
+				ticketDownStationId:this.down.id,	
+				ticketDownStationName:this.down.name,
+				price1:0,
+				price2:0
+			}
+			thisform.ticketType=1;
+			var obj= this.carhelp.get("form");
+			 
+			API.ticketAmount(thisform).then((response) => {
+				thisform.price1=response.data.price
+				thisform.ticketType=2;
+				API.ticketAmount(thisform).then((response2) => {
+					thisform.price2=response2.data.price
+					this.ticket=thisform;
+					obj.ticket=thisform;
+					this.carhelp.set("form",obj);
+					this.$refs.common.showLoading(false);
+					
 				})
-			},
-			valChange(e) {
 				
-				console.log('当前值为: ' + e.value)
-			},
-			underLineChange(index) {
-				this.underLine = index == 0 ? true : false;
-			},
+			
+			}).catch(error => {
+				this.$refs.common.showLoading(false, error);
+			
+			})
+			
 		},
-	onLoad(op) {
-		this.id = op.id;
-		this.uid = op.uid;
-	},
-
-	onReady() {
+ 	},onReady(){
+		var obj = this.carhelp.get("form");
 		
-		if(!this.id){
-			this.$refs.common.goError()
+		if(this.uid && !obj.ticket){
+			this.ticketAmount();
 		}
-		var obj=this.carhelp.get("form")
 		
-		if(obj&&obj.name=='buytickets'&&obj.id==this.id){
-			//不创建新订单
+	},
+ 	onLoad(op) {
+ 		this.id = op.id;
+ 		var obj = this.carhelp.get("form");
+		if(obj.op ){
+			this.uid = obj.op.id;
+			this.up.id = obj.op.ticketUpStationId;
+			this.up.name = obj.op.ticketUpStationName;
+			
+			this.down.id = obj.op.ticketDownStationId;
+			this.down.name = obj.op.ticketDownStationName;
+			this.underLine=(obj.op.ticketType==2?1:0);
+			this.pnum=obj.op.goodsTicket;
+			
+			this.personNum=1;
 		}else{
-			this.carhelp.set("form",{
-				name:'buytickets',
-				id:this.id,
-				list:[]
-			});
+			this.up.name = obj.oplist[0].upStationName;
+			this.up.id = obj.oplist[0].upStationId;
+			this.personNum=obj.oplist.length
+			
 		}
-		
-		if (!this.carhelp.getPersonInfo()) {
-			this.$refs.common.setFnc(this.confirmBtn)
-			this.$refs.common.alert2('您还不是车信达用户,注册后再购买车票。','前往注册','尚未注册')
-		} else {
-			
-		}
-
-
-	}
-}
+ 		if (obj.ticket) {
+ 			this.ticket = obj.ticket;
+ 			this.down = {
+ 				id: obj.ticket.ticketDownStationId,
+ 				name: obj.ticket.ticketDownStationName
+ 			}
+ 		}
+ 		
+ 	}
+ }

+ 10 - 7
pages/buytickets/site.vue

@@ -19,7 +19,7 @@
 						<span>上车站点</span>
 					</view>
 					<view class="content">
-						<span>玉桥</span>
+						<span>{{up.name}}</span>
 					</view>
 				</view>
 				<view class="site-head-down">
@@ -28,27 +28,30 @@
 						<span>下车站点</span>
 					</view>
 					<view class="content" @click="select">
-						<span v-text="down?down.name:'请选择'" :style="down?'':'color:#999'">宿架转盘</span>
+						<span v-text="down.name" :style="down.id?'':'color:#999'">宿架转盘</span>
 					</view>
 				</view>
 			</view>
 			<view class="site-foot">
 				<view class="site-foot-row">
 					<span>乘客类型</span>
-					<u-subsection current="1" vibrateShort :list="['儿童票', '成人票']" @change="underLineChange"></u-subsection>
+					<u-subsection :current="underLine" @change="underLineChange" vibrateShort :list="['儿童票', '成人票']"  ></u-subsection>
 				</view>
 				<view class="site-foot-row">
 					<span>货票</span>
-					<u-number-box v-model="value" @change="valChange"></u-number-box>
+					<u-number-box v-model="pnum"  ></u-number-box>
 				</view>
 				<view class="site-foot-row">
 					<span>应付金额</span>
-					<h3>¥0.00</h3>
+					<h3>¥{{total}}</h3>
 				</view>
 			</view>
 		</view>
-		<view class="upload-button">
-			<u-button type="primary" shape="circle" @click="clickBtn" v-text="uid?'保存':'上传照片'"></u-button>
+		<view class="upload-button" v-show="down.id">
+			<u-button type="primary" shape="circle" @click="clickBtn">保存</u-button>
+		</view>
+		<view class="upload-button" v-show="!down.id">
+			<u-button type="default" shape="circle">保存</u-button>
 		</view>
 	</view>
 </template>

+ 5 - 1
pages/buytickets/success.js

@@ -7,7 +7,11 @@
 			}
 		},
 		methods: {
-			
+			backBtn(){
+				uni.switchTab({
+					 url: '/pages/index/index'
+				})
+			}
 		},
 		onLoad() {
 			 

+ 2 - 2
pages/buytickets/success.vue

@@ -27,13 +27,13 @@
 			</view>
 		</view>
 		<view class="upload-button">
-			<u-button type="primary" shape="circle">返回</u-button>
+			<u-button type="primary" shape="circle" @click="backBtn">返回</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
-	import api from './index.js'
+	import api from './success.js'
 	export default api;
 </script>
 

+ 6 - 6
pages/buytickets/upload.vue

@@ -4,22 +4,22 @@
 			<view class="upload">
 				<h4>确认本人操作</h4>
 				<view class="upload-img">
-					<img src="/static/img/face1.png" alt="" v-if="!imgBase64">
+					<img src="static/img/face1.png" alt="" v-if="!imgBase64">
 					<img :src="imgBase64" v-if="imgBase64" />
 				</view>
 				<p>1.为了确保您的乘车信息的安全和真实性,我们需要对您进行人脸信息的匹配</p>
 				<p>2.请您本人亲自完成,请将脸部置于提示框内,并按提示</p>
 				<view class="upload-step">
 					<view class="upload-step-item">
-						<img src="/static/img/icon-face-1.png" alt="">
+						<img src="static/img/icon-face-1.png" alt="">
 						<span>摘下遮挡物</span>
 					</view>
 					<view class="upload-step-item">
-						<img src="/static/img/icon-face-2.png" alt="">
+						<img src="static/img/icon-face-2.png" alt="">
 						<span>正对手机</span>
 					</view>
 					<view class="upload-step-item">
-						<img src="/static/img/icon-face-3.png" alt="">
+						<img src="static/img/icon-face-3.png" alt="">
 						<span>光线充足</span>
 					</view>
 				</view>
@@ -27,7 +27,7 @@
 			<view class="upload-button">
 				<u-button type="primary" shape="circle" @click="uploadPic">上传照片</u-button>
 			</view>
-	
+	
 		
 		
 	</view>
@@ -93,4 +93,4 @@
 		bottom: 30rpx;
 		right: 30rpx;
 	}
-</style>
+</style>

+ 2 - 2
pages/car/login.vue

@@ -1,10 +1,10 @@
 <template>
 	
 	<view class="login">
-		<car-common  mytitle="登录" ref="common"  ></car-common>
+		<car-common  mytitle="登录" :noback="false" ref="common"  ></car-common>
 		
 		<view class="login-logo">
-			<img src="/static/img/logo.png" alt="">
+			<img src="static/img/logo.png" alt="">
 		</view>
 		<view class="login-name">车信达</view>
 		<view class="login-form">

+ 6 - 3
pages/index/index.js

@@ -9,17 +9,17 @@ export default {
 				list: [{
 						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
 						title: '昨夜星辰昨夜风,画楼西畔桂堂东',
-						url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
+						url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
 					},
 					{
 						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
 						title: '身无彩凤双飞翼,心有灵犀一点通',
-						url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
+						url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
 					},
 					{
 						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
 						title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳',
-						url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
+						url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
 					}
 				],
 			}
@@ -67,6 +67,9 @@ export default {
 			}
 		},onReady(){
 			WxJsApi.getWxConfig(['scanQRCode','getLocation']);
+			console.log(this.carhelp.getOpenId());
+			console.log("111111");
+			
 			this.getPoint();
 			//清空缓存
 			this.carhelp.set("form",{});

+ 2 - 2
pages/my/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
-		<u-navbar :is-back="false" title="我的" :border-bottom="false">
-		</u-navbar>
+		<car-common :login="true" mytitle="我的" :noback="false" ref="common"></car-common>
+		
 		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-p-t-30">
 			<view class="u-m-r-20">
 				<u-avatar :src="pic" size="100"></u-avatar>

+ 1 - 1
pages/my/user/updatephone/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="updatephone">
-			<img src="/static/img/icon-phoneSafe.png" alt="">
+			<img src="static/img/icon-phoneSafe.png" alt="">
 			<h4>已绑定手机号:155****1111</h4>
 			<p>您可使用绑定的手机号登录当前账号</p>
 			<view class="updatephone-btn">

+ 3 - 0
pages/news/details.vue

@@ -1,5 +1,8 @@
 <template>
+	
 	<view>
+		<car-common :login="true" mytitle="消息详情" ref="common"></car-common>
+		
 		<view class="new-title">
 			<h3>标题标题标题标题标题标题标题标题标题标题标题</h3>
 			<p>推送时间:2021-01-20 19:30</p>

+ 2 - 0
pages/news/index.vue

@@ -1,5 +1,7 @@
 <template>
 	<view>
+		<car-common :login="true" mytitle="消息" :noback="false" ref="common"></car-common>
+ 		
 		<view class="new-time">
 			03-30 12:33
 		</view>

+ 2 - 2
pages/route/index.vue

@@ -31,7 +31,7 @@
 				</view>
 				<view class="map-route-item map-now">
 					<view class="map-route-car">
-						<img src="/static/img/car.png" alt="">
+						<img src="static/img/car.png" alt="">
 					</view>
 					<view class="map-route-circle"></view>
 					<view class="map-route-line"></view>
@@ -55,7 +55,7 @@
 				</view>
 				<view class="map-route-item map-geton">
 					<view class="map-geton-mark">
-						<img src="/static/img/up.png" alt="">
+						<img src="static/img/up.png" alt="">
 					</view>
 					<view class="map-route-circle"></view>
 					<view class="map-route-line"></view>

+ 1 - 0
utils/AMap.js

@@ -1,5 +1,6 @@
 export default function MapLoader() {
 	return new Promise((resolve, reject) => {
+		
 		if (window.AMap) {
 			resolve(window.AMap)
 		} else {

+ 1 - 2
utils/index.js

@@ -334,8 +334,7 @@ export const getDiffDate = (stime, etime) => {
 
 		//获取开始日期时间戳
 		var stime_ts = new Date(stime).getTime();
-		//console.log('当前日期:' + stime + '当前时间戳:' + stime_ts);
-
+ 
 		//增加一天时间戳后的日期
 		var next_date = stime_ts + (24 * 60 * 60 * 1000);
 

+ 6 - 0
utils/request.js

@@ -27,6 +27,12 @@ const request = (options) => {
 			if (res.data.code != 200) {
 				reject(res.data.message)
 			} else {
+				if(!res.data.result){
+					uni.showToast({
+						title: res.data.message,
+						position:'bottom'
+					})
+				}
 				resolve(res.data);
 			}
 		}).catch(error => {

+ 3 - 5
utils/wxJsApi.js

@@ -22,7 +22,7 @@ export function getWxConfig(jsApiList) {
 			console.log(jsApiList);
 			API_WeiXin.getConfig().then(response => {
 				var wxconfig = response.data.wxConfig;
-				console.log(wxconfig.nonceStr)
+			
 				wx.config({
 					debug: false, // 开启调试模式,
 					appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
@@ -58,7 +58,7 @@ export function chooseImage(count,islocalId) {
 			success: function(res) {
 				 
 				var localIds = res.localIds;
-				console.log(localIds);
+				
 				if(islocalId){
 					
 					resolve(localIds);
@@ -101,9 +101,7 @@ export function uploadPic(imgBase64) {
 		formData.append('photoName', '1.jpg');
 		formData.append('photoBase64Data', imgBase64);
 
-		console.log(formData);
-		console.log(typeof formData);
-
+	
 		API_Common.uploadBase64(formData).then(response => {
 			resolve(response);
 		}).catch(error => {

+ 2 - 3
utils/wxpay.js

@@ -1,8 +1,6 @@
-import store from '@/store'
-
+ 
 function onBridgeReady(params) {
 	//记录要回跳的url
-	store.commit('SET_WX_PAY_BACK_URL', params.url)
 	window.WeixinJSBridge.invoke(
 		'getBrandWCPayRequest', {
 			'appId': params.appId, // 公众号名称,由商户传入
@@ -27,6 +25,7 @@ function onBridgeReady(params) {
 }
 
 export const wxPayJs = (params) => {
+	
 	if (!params.url) {
 		params.url = window.location.href.split("#")[0] + "/#/";
 	}

+ 6 - 1
yarn.lock

@@ -849,7 +849,7 @@ commondir@^1.0.1:
 
 compression-webpack-plugin@^7.1.2:
   version "7.1.2"
-  resolved "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-7.1.2.tgz?cache=0&sync_timestamp=1612085346866&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompression-webpack-plugin%2Fdownload%2Fcompression-webpack-plugin-7.1.2.tgz#f9a1ba84d4879693e29726f6884b382940876597"
+  resolved "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-7.1.2.tgz?cache=0&sync_timestamp=1610367126141&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompression-webpack-plugin%2Fdownload%2Fcompression-webpack-plugin-7.1.2.tgz#f9a1ba84d4879693e29726f6884b382940876597"
   integrity sha1-+aG6hNSHlpPilyb2iEs4KUCHZZc=
   dependencies:
     schema-utils "^3.0.0"
@@ -3602,6 +3602,11 @@ vue-cli@^2.9.6:
     user-home "^2.0.0"
     validate-npm-package-name "^3.0.0"
 
+vue-cropper@^0.5.6:
+  version "0.5.6"
+  resolved "https://registry.npm.taobao.org/vue-cropper/download/vue-cropper-0.5.6.tgz#a38c98d402da1421bd5e7535e16b9723f103cafd"
+  integrity sha1-o4yY1ALaFCG9XnU14WuXI/EDyv0=
+
 vuex@^3.6.2:
   version "3.6.2"
   resolved "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz?cache=0&sync_timestamp=1612277435391&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"