Browse Source

支付 发票

Roebin 3 years ago
parent
commit
72aa69e979

+ 45 - 0
App.vue

xqd xqd
@@ -1,9 +1,11 @@
 <script>
 	export default {
 		onLaunch: function() {
+			
 			console.log('App Launch')
 		},
 		onShow: function() {
+			
 			console.log('App Show')
 		},
 		onHide: function() {
@@ -15,4 +17,47 @@
 <style lang="scss">
 	/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
 	@import "uview-ui/index.scss";
+	
+	.paddingsafe{
+		padding-bottom:30rpx;
+	}
+	@font-face {
+	  font-family: "iconfont"; /* Project id 3359844 */
+	  src: url('//at.alicdn.com/t/font_3359844_hlep4lorjik.woff2?t=1654565402983') format('woff2'),
+	       url('//at.alicdn.com/t/font_3359844_hlep4lorjik.woff?t=1654565402983') format('woff'),
+	       url('//at.alicdn.com/t/font_3359844_hlep4lorjik.ttf?t=1654565402983') format('truetype');
+	}
+	
+	.iconfont {
+	  font-family: "iconfont" !important;
+	  font-size: 16px;
+	  font-style: normal;
+	  -webkit-font-smoothing: antialiased;
+	  -moz-osx-font-smoothing: grayscale;
+	}
+	
+	.icon-sangedian:before {
+	  content: "\e613";
+	}
+	
+	.icon-aomenwaimaishouji:before {
+	  content: "\e65f";
+	}
+	
+	.icon-dizhi:before {
+	  content: "\e622";
+	}
+	
+	.icon-back:before {
+	  content: "\e679";
+	}
+	
+	.icon-lingdang:before {
+	  content: "\e625";
+	}
+	.statues_bar{
+		height: var(--status-bar-height);
+		width: 100%;
+	}
+	
 </style>

+ 61 - 0
common/util.js

xqd
@@ -0,0 +1,61 @@
+export default {
+	// 密码只能是6位数字
+	sixNum(str) {
+		let reg = /^\d{6}$/;
+		if (!reg.test(str)) {
+			return false
+		} else {
+			return true
+		}
+	},
+	// 密码由6-12位数字和字母组成
+	numLetter(str) {
+		let reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/
+		if (!reg.test(str)) {
+			return false
+		} else {
+			return true
+		}
+	},
+	// // 字符串只能由1-10位中文、数字、英文组成,且必须有中文
+	// chineseNumLetter(str) {
+	// 	let reg = /^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9]){1,10}$/
+	// 	if (reg.test(str)) {
+	// 		// console.log('第一层通过')
+	// 		let reg1 = new RegExp("[\\u4E00-\\u9FFF]+", "g");
+	// 		if (reg1.test(str)) {
+	// 			// console.log('第二层通过')
+	// 			return true
+	// 		} else {
+	// 			return false
+	// 		}
+	// 	} else {
+	// 		return false
+	// 	}
+	// },
+	phone(str) {	
+		let reg =/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
+		if (reg.test(str)) {
+			return true
+		} else {
+			return false
+		}
+	},
+	email(str) {
+		let reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
+		if (reg.test(str)) {
+			// console.log('第二层通过')
+			return true
+		} else {
+			return false
+		}
+	},
+	idCard(str) {
+		let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; 
+		if (reg.test(str)) {
+			return true
+		} else {
+			return false
+		}
+	}
+}

+ 29 - 1
main.js

xqd xqd
@@ -1,7 +1,7 @@
 import App from './App'
 // import {post} from "http/request.post.js"
 import store from './store'
-
+import util from './common/util.js'
 // #ifndef VUE3
 import Vue from 'vue'
 Vue.config.productionTip = false
@@ -11,6 +11,34 @@ const app = new Vue({
     ...App
 })
 
+Vue.prototype.$toast = function(msg, callback = false) {
+	uni.showToast({
+		icon: 'none',
+		title: msg,
+	})
+	if (callback !== false) {
+		setTimeout(() => {
+			callback()
+		}, 2000)
+	}
+}
+Vue.prototype.$showLoadding = function(msg, callback = false) {
+	uni.showLoading({
+		title:msg,
+		mask:true
+	})
+	if (callback !== false) {
+		setTimeout(() => {
+			callback()
+		}, 2000)
+	}
+}
+Vue.prototype.$back = function() {
+	uni.navigateBack({
+		delta: 1
+	})
+}
+Vue.prototype.$util = util;
 import uView from "uview-ui";
 Vue.use(uView)
 uni.$u.config.unit = 'rpx'

+ 12 - 2
manifest.json

xqd xqd
@@ -17,7 +17,9 @@
             "delay" : 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Payment" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */
@@ -43,7 +45,15 @@
             /* ios打包配置 */
             "ios" : {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "payment" : {
+                    "weixin" : {
+                        "__platform__" : [ "ios", "android" ],
+                        "appid" : "wxb0048c8654f52eeb",
+                        "UniversalLinks" : ""
+                    }
+                }
+            }
         }
     },
     /* 快应用特有相关 */

+ 1 - 0
node_modules/uview-ui/components/u-swiper/u-swiper.vue

xqd
@@ -52,6 +52,7 @@
 							height: $u.addUnit(height),
 							borderRadius: $u.addUnit(radius)
 						}"
+						lazy-load="true"
 					></image>
 					<video
 						class="u-swiper__wrapper__item__wrapper__video"

+ 1 - 1
node_modules/uview-ui/components/u-tabs/u-tabs.vue

xqd
@@ -166,7 +166,7 @@
 					.reduce((total, curr) => total + curr.rect.width, 0);
                 // 获取下划线的数值px表示法
 				const lineWidth = uni.$u.getPx(this.lineWidth);
-				this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth + 25) / 2
+				this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth +26) / 2
 				// #ifdef APP-NVUE
 				// 第一次移动滑块,无需过渡时间
 				this.animation(this.lineOffsetLeft, this.firstTime ? 0 : parseInt(this.duration))

+ 22 - 2
pages.json

xqd xqd xqd xqd xqd
@@ -100,6 +100,12 @@
 				"navigationBarTextStyle": "black",
 				"navigationBarTitleText":"完善信息"
 			}
+		},{
+			"path": "editMsg",
+			"style": {
+				"navigationBarTextStyle": "black",
+				"navigationBarTitleText":"修改信息"
+			}
 		},{
 			"path": "notification",
 			"style": {
@@ -175,6 +181,16 @@
 				"navigationBarTextStyle": "black",
 				"navigationBarTitleText":"专属森林向导"
 			}
+		}
+		,{
+			"path": "successpay",
+			"style": {
+				"navigationBarTextStyle": "black",
+				// "navigationBarTitleText":"专属森林向导"
+				// #ifdef MP-WEIXIN
+				"navigationStyle": "custom"
+				// #endif
+			}
 		},{
 			"path": "orderDetails",
 			"style": {
@@ -209,6 +225,7 @@
 			"style": {
 				"navigationBarTextStyle": "black",
 				"navigationBarTitleText":"抬头管理"
+				
 			}
 		},{
 			"path": "invoiceHistory",
@@ -226,7 +243,10 @@
 			"path": "applyInvoice",
 			"style": {
 				"navigationBarTextStyle": "black",
-				"navigationBarTitleText":"申请发票"
+				// "navigationBarTitleText":"申请发票"
+				// #ifdef MP-WEIXIN
+				    "navigationStyle": "custom"
+				// #endif
 			}
 		}
 	    ]
@@ -251,7 +271,7 @@
 			},
 	      {
 	        "pagePath": "pages/travel",
-	        "text": "旅行",
+	        "text": "森林康养",
 	        "iconPath": "static/tabbaricon/森林康养.png",
 	        "selectedIconPath": "static/tabbaricon/森林康养@2x.png"
 	      },

+ 7 - 3
pages/customerService.vue

xqd xqd
@@ -12,7 +12,7 @@
 			</view>
 		</view>
 		<view class="footer">
-			<view class="number" v-for="item,index in list" :key="index">
+			<view class="number" v-for="item,index in list" :key="index" @click="toPhone(item)">
 				<view class="num">
 					<image src="../static/mobile@2x.png" ></image>
 					<text class="" style="margin-left: 20rpx;">
@@ -41,9 +41,13 @@
 			init(){
 				let list=uni.getStorageSync("data")
 				// console.log(list[5])
-				this.list=list[5].value
+				this.list=list[5].value.phone
+			},
+			toPhone(item){
+				uni.makePhoneCall({
+					phoneNumber: item //仅为示例
+				});
 			}
-			
 		}
 	}
 </script>

+ 70 - 26
pages/index/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -4,13 +4,13 @@
 			<u-swiper :list="swiper"  keyName="url" height="100%" ></u-swiper>
 			<view class="banner">
 				<view class="logo">
-					<image src="../../static/LOGO@2x.png" mode="widthFix"></image>
+					<image :src="msg.logo" mode="widthFix"></image>
 				</view>
 				<view class="bannertitle">
-					遇见森林瑜伽
+					{{msg.title?msg.title:''}}
 				</view>
 				<view class="subtitle">
-					明心静待花开
+					{{msg.subtitle?msg.subtitle:''}}
 				</view>
 			</view>
 		</view>
@@ -30,25 +30,27 @@
 				</view>
 			</view>
 			
-			<view class="list">
-				<view class="video">
-					<!-- 这是视频 -->
-					<video poster=""></video>
-				</view>
-				<view class="contentfooter">
-					<view class="contentfooter-title">
-						森林瑜伽
+			<view class="videobox">
+				<view class="list" v-for="(item,index) in video" :key="index">
+					<view class="video">
+						<!-- 这是视频 -->
+						<video :src="item.url" object-fit="fill"></video>
 					</view>
-					<view class="contentfooter-subtitle">
-						夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松
+					<view class="contentfooter">
+						<view class="contentfooter-title">
+							{{item.title}}
+						</view>
+						<view class="contentfooter-subtitle">
+							{{item.description}}
+						</view>
 					</view>
 				</view>
 			</view>
-			<view class="list">
+			
+			<!-- <view class="list">
 				<view class="video">
-					<!-- 这是视频 -->
-					<video poster=""></video>
-				</view>
+					<video src="https://zhengda.oss-cn-chengdu.aliyuncs.com/riyuexia/Worker%20on%20Tulum%20Beach.mp4" object-fit="fill"></video>
+				</view>		
 				<view class="contentfooter">
 					<view class="contentfooter-title">
 						森林瑜伽
@@ -57,8 +59,8 @@
 						夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松
 					</view>
 				</view>
-			</view>
-			<view class="" style="padding-top: 100rpx;width: 100%;"></view>
+			</view> -->
+			<view class="" style="padding-top: 80rpx;width: 100%;"></view>
 	</view>
 </template>
 
@@ -67,15 +69,48 @@
 		data() {
 			return {
 				swiper: [
-					""
+					
 				],
+				msg:null,
+				video:null
 			}
 		},
 		onLoad() {
 			this.init()
+			
 		},
+		
+		  onShareTimeline() {
+		    return {
+		     title: '日月峽',
+		     path: '/pages/index/index'
+		    }
+		  },
+		 onShareAppMessage(res) {
+		    
+		    return {
+		      title: '日月峽',
+		      path: '/pages/index/index'
+		    }
+		  },
 		methods: {
 			init(){
+				// uni.showLoading()
+				uni.$u.http.post('/api/config/home',{
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.setStorageSync("home",res)
+					let home=uni.getStorageSync("home")
+					this.msg=res.page
+					this.video=res.videos
+					this.swiper.push(res.page.bg_picture)
+					// uni.hideLoading()
+				}).catch((err) => {
+					console.log( err)
+				})
+				
 				let phone=uni.getStorageSync("phone")
 				let code=uni.getStorageSync("code")
 				uni.$u.http.post('/api/config/list',{phone,code},{
@@ -83,10 +118,11 @@
 						auth: true
 					}
 				}).then((res) => {
-					console.log(res)
+					// console.log(res)
 					// this.swiper=res[9].value
 					uni.setStorageSync("data",res)
 				}).catch((err) => {
+					
 					console.log( err)
 				})
 			}
@@ -115,13 +151,15 @@
 			// text-align: center;
 			padding-top:160rpx;
 			image{
-				width: 114rpx;	
+				width: 114rpx;
+				height: 106rpx;
 			}
 		}
 		.bannertitle{
 			font-size: 64rpx;
 			// text-align: center;
 			margin: 138rpx 0 37rpx;
+			margin-bottom: 30rpx;
 			color: #FFFFFF;
 		}
 		.subtitle{
@@ -168,17 +206,22 @@
 			}
 		}
 	 }
+	 .videobox{
+		 // &:first-child{
+		 	margin-top: 92rpx;
+		 // }
+	 }
 	.list{
 		background-color: #FCFCFC;
-		margin-top: 92rpx;
+		// margin-top: 92rpx;
 		width: 100%;
-		// margin-bottom: 40rpx;
+		margin-bottom: 40rpx;
 		// background-color: #fff;
 		border-radius:0px 0px 16rpx 100rpx;;
 		box-shadow: 0px 8rpx 14rpx 0px rgba(0, 21, 3, 0.08);
 		.video{
 				margin: 0 30rpx;
-				height: 410rpx;
+				height: 390rpx;
 				// background-color: skyblue;
 				video{
 					width: 100%;
@@ -192,7 +235,7 @@
 					font-weight: bold;
 					color: #333333;
 					text-shadow: 0px 8rpx 14rpx rgba(0, 21, 3, 0.05);
-					margin: 40rpx 0rpx 24rpx 56rpx;
+					margin: 40rpx 0rpx 20rpx 56rpx;
 				}
 				.contentfooter-subtitle{
 					font-size: 26rpx;
@@ -204,6 +247,7 @@
 					padding: 0rpx 71rpx 40rpx 56rpx;
 				}
 		    }
+			
 		}
 		
 </style>

+ 122 - 23
pages/invoice/applyInvoice.vue

xqd xqd xqd xqd
@@ -1,11 +1,22 @@
 <template>
 	<view class="">
+		<u-navbar
+		            title="个人中心"
+		            :safeAreaInsetTop="true"
+					leftIconSize="45"
+					:titleStyle="{'font-size':'28rpx'}"
+					leftIcon="arrow-left"
+					@leftClick="backBtn()"
+		        >
+		            
+		        </u-navbar>
+		<!-- <view class="statues_bar"></view> -->
 		<view class="top">
 			<view class="" style="width: 40%;">
 				开票金额共
 			</view>
 			<view class="">
-				¥2538
+				¥{{total}}
 			</view>
 		</view>
 		<view class="form" >
@@ -18,43 +29,55 @@
 					<view :class="state==1?'btn-item-active':'btn-item'" @click="state=1">个人</view>
 			   	</view>
 			
-			    <u-form-item  label="发票抬头" prop="userInfo.me" borderBottom  ref="item1" labelWidth="160rpx">
-					<u-input v-model="model1.userInfo.me"  disabledColor="#ffffff" :placeholder="state==0?'请输入公司姓名':'请输入个人姓名'" border="none" placeholderStyle="color: #555555">
+			    
+				<u-form-item  label="发票抬头" prop="presonalname" borderBottom  ref="item1" labelWidth="160rpx" v-if="state==1">
+					<u-input v-model="presonalname"  disabledColor="#ffffff" placeholder="请输入个人姓名" border="none" placeholderStyle="color: #555555">
 						<template slot="suffix"><text @click="goinvoiceList">抬头薄</text> </template>
 					</u-input>
 				</u-form-item>
-				
+				<u-form-item  label="发送邮箱" prop="prsonalemail" borderBottom  ref="item1" labelWidth="160rpx" v-if="state==1">
+					<u-input v-model="prsonalemail"  disabledColor="#ffffff" placeholder="请输入接收邮箱" border="none" placeholderStyle="color: #555555">
+						<template slot="suffix"><text @click="goinvoiceList"></text> </template>
+					</u-input>
+				</u-form-item>
 				<view class="" v-if="state==0">
-					<u-form-item  label="纳税税号" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" placeholder="请输入税号" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item  label="发票抬头" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
+						<u-input v-model="model1.userInfo.name"  disabledColor="#ffffff" :placeholder="state==0?'请输入公司姓名':'请输入个人姓名'" border="none" placeholderStyle="color: #555555">
+							<template slot="suffix"><text @click="goinvoiceList">抬头薄</text> </template>
+						</u-input>
+					</u-form-item>
+					<u-form-item  label="纳税税号" prop="userInfo.tax_no" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.tax_no"  disabledColor="#ffffff" placeholder="请输入税号" border="none" placeholderStyle="color: #555555"></u--input>
+					</u-form-item>
+					<u-form-item  label="注册地址" prop="userInfo.address" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.address"  disabledColor="#ffffff" placeholder="请输入注册地址" border="none" placeholderStyle="color: #555555"></u--input>
 					</u-form-item>
-					<u-form-item  label="注册地址" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" placeholder="请输入注册地址" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item  label="电话" prop="userInfo.phone" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.phone"  disabledColor="#ffffff" placeholder="请输入电话" border="none" placeholderStyle="color: #555555" type="number"></u--input>
 					</u-form-item>
-					<u-form-item  label="电话" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" placeholder="请输入电话" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item  label="开户银行" prop="userInfo.bank_name" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.bank_name"  disabledColor="#ffffff" placeholder="请输入开户银行" border="none" placeholderStyle="color: #555555"></u--input>
 					</u-form-item>
-					<u-form-item  label="开户银行" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" placeholder="请输入开户银行" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item  label="银行账号" prop="userInfo.bank_no" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.bank_no"  disabledColor="#ffffff" placeholder="请输入银行账号" border="none" placeholderStyle="color: #555555" type="number"></u--input>
+						
 					</u-form-item>
-					<u-form-item  label="银行账号" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" placeholder="请输入银行账号" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item   label="发送邮箱" prop="userInfo.mail" borderBottom  ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.mail"  disabledColor="#ffffff" placeholder="请输入接收邮箱" placeholderStyle="color: #555555" border="none" ></u--input>
 					</u-form-item>
 				</view>
 			
-					<u-form-item   label="发送邮箱" prop="userInfo.idcard" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.idcard"  disabledColor="#ffffff" placeholder="输入接收邮箱" placeholderStyle="color: #555555" border="none" ></u--input>
-					</u-form-item>
+					
 			
 				
 				<view class="" style="margin: 30rpx 0;">
 					备注信息(选填)
 				</view>
-				<u--textarea v-model="value2" :customStyle="{'background':'#F4F4F4','border-radius': '0px 32rpx 8rpx 32rpx'}" placeholder="输入备注信息" placeholderStyle="color: #555555"  height=120 border="none"></u--textarea>
+				<u--textarea v-model="model1.userInfo.memo" :customStyle="{'background':'#F4F4F4','border-radius': '0px 32rpx 8rpx 32rpx'}" placeholder="输入备注信息" placeholderStyle="color: #555555"  height=120 border="none"></u--textarea>
 			</u--form>
 		</view>
 		<view class="" style="margin-bottom: 144rpx;"></view>
-	<view class="navbar">
+	<view class="navbar" @click="submitApply">
 		提交申请
 	</view>
 	</view>
@@ -66,22 +89,97 @@
 			return{
 				state:0,
 				showSex:false,
+				presonalname:'',
+				prsonalemail:'',
+				ids:[],
+				total:0,
 				model1: {
 					userInfo: {
-						invoice:'',
 						name: '',
+						tax_no: '',
+						address: '',
+						phone: '',
+						bank_name: '',
+						bank_no: '',
 						type: '',
-						me:'',
-						
+						email:'',
+						memo:'',
+						orders:[]
 					},
 				}
 			}	
 		},
+		onLoad(o){
+				let order=uni.getStorageSync("order")
+				this.ids=order.ids
+				this.total=order.total
+				
+			if(o.obj){
+				let userInfo=JSON.parse(o.obj)
+				if(userInfo.type=="企业"){
+					this.model1.userInfo=userInfo
+					this.state=0
+				}else{
+					this.state=1
+					this.presonalname=userInfo.name
+				}
+			}
+		},
 		methods:{
 			// 跳转抬头列表
 			goinvoiceList(){
+				let obj={
+					choose:true,
+					state:this.state
+				}
+				uni.navigateTo({
+					url:"/pages/invoice/invoiceAdmin?obj="+JSON.stringify(obj)
+				})
+			},
+			backBtn(){
 				uni.navigateTo({
-					url:"/pages/invoice/invoiceAdmin"
+					url:"/pages/invoice/invoiceList"
+				})
+			},
+			submitApply(){
+				uni.showLoading({})
+				if(this.state==0){
+					var form = this.model1.userInfo
+					 this.model1.userInfo.orders=this.ids
+					form.type=2
+				}else{
+					var form={
+						type:1,
+						name:this.presonalname,
+						email:this.prsonalemail,
+						orders:this.ids
+					}
+				}
+				if(!this.$util.email(form.email)){
+					this.$toast("请输入正确的邮箱号码")
+					return
+				}
+				uni.$u.http.post('/api/bill/add', form, {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					console.log(res)
+					uni.showToast({
+						icon: "success",
+						title: "申请成功",
+					})
+					setTimeout(() => {
+						uni.navigateTo({
+							url:"/pages/invoice/invoiceList"
+						})
+					}, 1500)
+				
+				}).catch((err) => {
+					uni.showToast({
+						icon: "error",
+						title: err.message,
+					})
 				})
 			}
 	    },
@@ -100,6 +198,7 @@
 			margin: 30rpx;
 			padding: 40rpx;
 			display: flex;
+			margin-top: 160rpx;
 		}
 	page{
 		background-color: #F4F4F4;

+ 164 - 90
pages/invoice/invoiceAdmin.vue

xqd xqd
@@ -1,163 +1,237 @@
 <template>
 	<view class="curpage">
-		<view class="list" v-for="item,index in list" :key="index">
-			<view class="title">
-				<view class="">
-					{{item.name}}
-				</view>
-				<view class="" style="margin: 10rpx 0;">
-					<text style="color: #666666;">类型:</text>
-					{{item.type}}
-				</view>
-				<view class="" v-if="item.type=='企业'">
-					<text style="color: #666666;">税号:</text>
-					{{item.tax_no}}
+		<radio-group @change="radioChange">
+			<label v-for="(item, index) in list" :key="index">
+				<view class="list">
+					<view class="title">
+						<view v-show="choose">
+							<radio :value="index" :checked="index === current" />
+						</view>
+						<view style="padding-left: 20rpx;">
+							<view class="">
+								{{item.name}}
+							</view>
+							<view class="" style="margin: 10rpx 0;">
+								<text style="color: #666666;">类型:</text>
+								{{item.type}}
+							</view>
+							<view class="" v-if="item.type=='企业'">
+								<text style="color: #666666;">税号:</text>
+								{{item.tax_no}}
+							</view>
+						</view>
+
+					</view>
+					<view class="icon">
+						<text @click="goendit(item)">
+							编辑
+						</text>
+						<text class="line"></text>
+						<text class="dele" @click="dele(item.id)">
+							删除
+						</text>
+					</view>
 				</view>
-			</view>
-			<view class="icon">
-				<text @click="goendit(item)">
-					编辑
-				</text>
-				<text class="line"></text>
-				<text class="dele" @click="dele(item.id)">
-					删除
-				</text>
-			</view>
-		</view>
-	<u-loadmore v-if="list.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无发票"/>
-		
+
+			</label>
+		</radio-group>
+		<!-- <view class="list" v-for="item,index in list" :key="index">
+			
+		</view> -->
+		<u-loadmore v-if="list.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无发票" />
+
 		<view class="" style="height: 1rpx;margin-bottom: 144rpx;"></view>
-		<view class="navbar" @click="add">
+		<view class="navbar" @click="add" v-show="!choose">
 			+ 新增常用发票
 		</view>
-		
+		<view class="navbar" @click="makSure" v-show="choose">
+			确认
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
-		data(){
-			return{
+		data() {
+			return {
 				showSex: false,
-				
-				id:1,
-				list:[]
+				choose: false,
+				id: 1,
+				list: [],
+				state: 0
 			}
 		},
-		onLoad() {
+		onLoad(o) {
+			console.log(o)
+			if (o.obj) {
+				let obj = JSON.parse(o.obj)
+				// console.log(obj, 888)
+				this.choose = obj.choose
+				this.state = obj.state
+				console.log(obj)
+			}
+			
 			this.init()
 		},
 		onShow() {
-			let token=uni.getStorageSync("token")
+			let token = uni.getStorageSync("token")
 			if (!token) {
 				//未登录
 				uni.showToast({
 					title: "请先登录",
 					icon: 'none'
 				})
-				setTimeout(()=>{
-					uni.navigateBack({
-						delta:1
+				setTimeout(() => {
+					uni.navigateTo({
+						url: "/pages/login"
 					})
-				},1500)
-				
+				}, 1500)
+
 				return false
 			}
-			uni.showLoading({
-				title: '加载中'
-			});
-			this.init()
+			// uni.showLoading({
+			// 	title: '加载中'
+			// });
+			// this.init()
 		},
-        methods:{
-			init(){
-				uni.$u.http.post('/api/invoice/list',{
-				        custom: {
-					    auth: true
-				    }
-				}).then((res) => {
-				console.log(res)
-				res.forEach(item=>{
-					if(item.type==1){
-						item.type="个人"
-					}else if(item.type==2){
-						item.type="企业"
+		methods: {
+			init() {
+				uni.$u.http.post('/api/invoice/list', {
+					custom: {
+						auth: true
 					}
-				})
-					this.list=res
+				}).then((res) => {
 					uni.hideLoading();
+					console.log(res)
+					res.forEach(item => {
+						if (item.type == 1) {
+							item.type = "个人"
+						} else if (item.type == 2) {
+							item.type = "企业"
+						}
+					})
+					if (this.choose) {
+						if (this.state == 0) {
+							res.forEach(item=>{
+								if(item.type=="企业"){
+									this.list.push(item)
+								}
+							})
+						} else if (this.state == 1) {
+							res.forEach(item=>{
+								if(item.type=="个人"){
+									this.list.push(item)
+								}
+							})
+						}
+					} else {
+						this.list = res
+					}
+
+
 				}).catch((err) => {
 					console.log(err)
 				})
 			},
+			makSure() {
+				let obj = this.list[this.current]
+				console.log(obj,88888)
+				uni.navigateTo({
+					url: '/pages/invoice/applyInvoice?obj=' + JSON.stringify(obj)
+				})
+			},
+			radioChange(e) {
+				this.current = e.detail.value
+				console.log(e)
+			},
 			// 编辑发票
-			goendit(item){
+			goendit(item) {
 				uni.navigateTo({
-					url:`/pages/invoice/invoiceEndit?state=0&info=${JSON.stringify(item)}`
+					url: `/pages/invoice/invoiceEndit?state=0&info=${JSON.stringify(item)}`
 				})
 			},
 			// 增加发票
-            add(){
+			add() {
 				uni.navigateTo({
-					url:"/pages/invoice/invoiceEndit?state=1"
+					url: "/pages/invoice/invoiceEndit?state=1"
 				})
 			},
 			// 删除发票
-			dele(id){
-				uni.$u.http.post('/api/invoice/delete',{id},{
-				        custom: {
-					    auth: true
-				    }
-				}).then((res) => {
-				console.log(res)
-					this.init()
-				}).catch((err) => {
-					console.log( err)
-					uni.showToast({
-						icon:"error",
-						title:err.message,
-					})
+			dele(id) {
+				uni.showModal({
+					title: "提示",
+					content: "确认删除吗?",
+					success: (res) => {
+						if (res.confirm) {
+							this.$showLoadding("删除中")
+							uni.$u.http.post('/api/invoice/delete', {
+								id
+							}, {
+								custom: {
+									auth: true
+								}
+							}).then((res) => {
+								uni.hideLoading()
+								this.$toast("删除成功")
+								this.init()
+							}).catch((err) => {
+								console.log(err)
+								uni.showToast({
+									icon: "error",
+									title: err.message,
+								})
+							})
+						}
+					}
 				})
 			}
-        }
+		}
 	}
 </script>
 
 <style lang="less">
-	page{
-		background-color: #F4F4F4 ;
+	page {
+		background-color: #F4F4F4;
 		font-size: 28rpx;
 	}
-	.curpage{
-		.list{
+
+	.curpage {
+		.list {
 			background: #FFFFFF;
 			box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
 			border-radius: 16rpx 16rpx 16rpx 32rpx;
 			margin: 30rpx;
-			.title{
+
+			.title {
+				display: flex;
+				align-items: center;
 				padding: 30rpx;
 				border-bottom: 1rpx solid #E3E3E3;
 			}
-			.dele{
+
+			.dele {
 				// border-left: 1rpx solid #1E9F6A;
 				// padding-left: 40rpx;
 				margin-right: 40rpx;
 			}
-			
-			.icon{
+
+			.icon {
 				text-align: right;
 				padding: 40rpx 0rpx;
 				color: #1E9F6A;
-				.line{
+
+				.line {
 					display: inline-block;
-					width: 1px;height: 30rpx;
+					width: 1px;
+					height: 30rpx;
 					background-color: #1E9F6A;
-					margin:0 40rpx -4rpx;
+					margin: 0 40rpx -4rpx;
 				}
 			}
 		}
 	}
 
-	.navbar{
+	.navbar {
 		padding: 30rpx 0;
 		text-align: center;
 		background: #fff;
@@ -168,6 +242,6 @@
 		position: fixed;
 		width: 100%;
 		// margin-top: 144rpx;
-		
+
 	}
 </style>

+ 140 - 114
pages/invoice/invoiceEndit.vue

xqd xqd xqd xqd xqd
@@ -8,47 +8,58 @@
 				¥2538
 			</view>
 		</view> -->
-		<view class="form" >
-			<u--form labelPosition="left" :model="model1"  ref="form1">
-			  <view class="">
-			  	抬头类型
-			  </view>
-			   	<view class="btn">
-			   		<view :class="model1.userInfo.type==2?'btn-item-active':'btn-item'" @click="model1.userInfo.type=2">企业</view>	
-					<view :class="model1.userInfo.type==1?'btn-item-active':'btn-item'" @click="model1.userInfo.type=1">个人</view>
-			   	</view>
-
-                <u-form-item  label="发票抬头" prop="userInfo.name" borderBottom  ref="item1" labelWidth="160rpx">
-					<u--input v-model="model1.userInfo.name"  disabledColor="#ffffff" :placeholder="model1.userInfo.type==2?'请输入公司名称':'请输入个人姓名'" border="none" placeholderStyle="color: #555555"></u--input>
+		<view class="form">
+			<u--form labelPosition="left" :model="model1" ref="form1">
+				<view class="">
+					抬头类型
+				</view>
+				<view class="btn">
+					<view :class="model1.userInfo.type==2?'btn-item-active':'btn-item'" @click="model1.userInfo.type=2">
+						企业</view>
+					<view :class="model1.userInfo.type==1?'btn-item-active':'btn-item'" @click="model1.userInfo.type=1">
+						个人</view>
+				</view>
+
+				<u-form-item label="发票抬头" prop="userInfo.name" borderBottom ref="item1" labelWidth="160rpx">
+					<u--input v-model="model1.userInfo.name" disabledColor="#ffffff"
+						:placeholder="model1.userInfo.type==2?'请输入公司名称':'请输入个人姓名'" border="none"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
+
 				<view class="" v-if="model1.userInfo.type==2">
-					<u-form-item  label="纳税税号" prop="userInfo.tax_no" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.tax_no"  disabledColor="#ffffff" placeholder="请输入税号" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item label="纳税税号" prop="userInfo.tax_no" borderBottom ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.tax_no" disabledColor="#ffffff" placeholder="请输入税号"
+							border="none" placeholderStyle="color: #555555"></u--input>
 					</u-form-item>
-					<u-form-item  label="注册地址" prop="userInfo.address" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.address"  disabledColor="#ffffff" placeholder="请输入注册地址" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item label="注册地址" prop="userInfo.address" borderBottom ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.address" disabledColor="#ffffff" placeholder="请输入注册地址"
+							border="none" placeholderStyle="color: #555555"></u--input>
 					</u-form-item>
-					<u-form-item  label="电话" prop="userInfo.phone" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.phone"  disabledColor="#ffffff" placeholder="请输入电话" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item label="电话" prop="userInfo.phone" borderBottom ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.phone" disabledColor="#ffffff" placeholder="请输入电话"
+							border="none" placeholderStyle="color: #555555" type="number"></u--input>
 					</u-form-item>
-					<u-form-item  label="开户银行" prop="userInfo.bank_name" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.bank_name"  disabledColor="#ffffff" placeholder="请输入开户银行" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item label="开户银行" prop="userInfo.bank_name" borderBottom ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.bank_name" disabledColor="#ffffff" placeholder="请输入开户银行"
+							border="none" placeholderStyle="color: #555555" ></u--input>
 					</u-form-item>
-					<u-form-item  label="银行账号" prop="userInfo.bank_no" borderBottom  ref="item1" labelWidth="160rpx">
-						<u--input v-model="model1.userInfo.bank_no"  disabledColor="#ffffff" placeholder="请输入银行账号" border="none" placeholderStyle="color: #555555"></u--input>
+					<u-form-item label="银行账号" prop="userInfo.bank_no" borderBottom ref="item1" labelWidth="160rpx">
+						<u--input v-model="model1.userInfo.bank_no" disabledColor="#ffffff" placeholder="请输入银行账号"
+							border="none" placeholderStyle="color: #555555" type="number"></u--input>
 					</u-form-item>
 				</view>
 
-					<!-- <u-form-item  v-if="index==0" label="发送邮箱" prop="userInfo.idcard" borderBottom  ref="item1" labelWidth="160rpx">
+				<!-- <u-form-item  v-if="index==0" label="发送邮箱" prop="userInfo.idcard" borderBottom  ref="item1" labelWidth="160rpx">
 						<u--input v-model="model1.userInfo.idcard"  disabledColor="#ffffff" placeholder="输入接收邮箱" placeholderStyle="color: #555555" border="none" ></u--input>
 					</u-form-item> -->
 
-				
+
 				<view class="" style="margin: 30rpx 0;">
 					备注信息(选填)
 				</view>
-				<u--textarea v-model="model1.userInfo.memo" placeholder="输入备注信息" :customStyle="{'background':'#F4F4F4','border-radius': '0px 32rpx 8rpx 32rpx'}" placeholderStyle="color: #555555"  height=120 border="none"></u--textarea>
+				<u--textarea v-model="model1.userInfo.memo" placeholder="输入备注信息"
+					:customStyle="{'background':'#F4F4F4','border-radius': '0px 32rpx 8rpx 32rpx'}"
+					placeholderStyle="color: #555555" height=120 border="none"></u--textarea>
 			</u--form>
 		</view>
 		<view class="tips">
@@ -61,43 +72,49 @@
 		<view v-if="state==0" class="navbar" @click="editsubmit">
 			保存
 		</view>
-	<view v-if="state==1" class="navbar" @click="submit">
-		添加抬头
-	</view>
+		<view v-if="state==1" class="navbar" @click="submit">
+			添加抬头
+		</view>
+		<view class="paddingsafe"></view>
 	</view>
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
+	export default {
+		data() {
+			return {
 				// 编辑与添加状态 0保存 1添加
-				state:0,
-				showSex:false,
+				state: 0,
+				showSex: false,
 				model1: {
 					userInfo: {
-						name:'',
+						name: '',
 						tax_no: '',
-						address:'',
-						phone:'',
-						bank_name:"",
-						bank_no:'',
+						address: '',
+						phone: '',
+						bank_name: "",
+						bank_no: '',
 						type: 2,
-						memo:"",
+						memo: "",
 					},
 				},
-				index:1
-			}	
+				index: 1
+			}
 		},
 		onLoad(options) {
-			this.state=options.state
-			let info=JSON.parse(options.info)
-			if(info.type=="个人"){
-				info.type=1
-			}else if(info.type=="企业"){
-				info.type=2
+
+			this.state = options.state
+			if (options.info) {
+				let info = JSON.parse(options.info)
+				if (info.type == "个人") {
+					info.type = 1
+				} else if (info.type == "企业") {
+					info.type = 2
+				}
+				this.model1.userInfo = info
 			}
-			this.model1.userInfo=info
+
+
 			// id=0 申请发票跳转 index=0   
 			// id=1 抬头管理跳转 index=1
 			// if(options.id==0){
@@ -106,57 +123,58 @@
 			// 	this.index=1
 			// }
 		},
-		methods:{
+		methods: {
 			// 修改
-			editsubmit(){
-				let form=this.model1.userInfo
-				
-				console.log(form,"<=================修改")
-				uni.$u.http.post('/api/invoice/edit',form,{
-				        custom: {
-					    auth: true
-				        }
-				    }).then((res) => {
-				console.log(res)
-				uni.showToast({
-					icon:"success",
-					title:"修改成功",
-				})
-				setTimeout(()=>{
-					uni.navigateBack({
-						delta:1
+			editsubmit() {
+				let form = this.model1.userInfo
+
+				console.log(form, "<=================修改")
+				uni.$u.http.post('/api/invoice/edit', form, {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					console.log(res)
+					uni.showToast({
+						icon: "success",
+						title: "修改成功",
 					})
-				},1500)
-							
+					setTimeout(() => {
+						uni.navigateBack({
+							delta: 1
+						})
+					}, 1500)
+
 				}).catch((err) => {
 					console.log(err)
-				})	
+				})
 			},
 			// 添加抬头
-			submit(){
-				let form=this.model1.userInfo
-				console.log(form)
-			    uni.$u.http.post('/api/invoice/add',form,{
-				        custom: {
-					    auth: true
-				        }
-			        }).then((res) => {
-				console.log(res)
-				uni.showToast({
-					icon:"success",
-					title:"添加成功",
-				})
-				setTimeout(()=>{
-					uni.navigateBack({
-						delta:1
+			submit() {
+				let form = this.model1.userInfo
+				uni.$u.http.post('/api/invoice/add', form, {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.showToast({
+						icon: "success",
+						title: "添加成功",
 					})
-				},1500)
-			
-			    }).catch((err) => {
-					console.log(err)
-				})	
+					setTimeout(() => {
+						uni.navigateBack({
+							delta: 1
+						})
+					}, 1500)
+
+				}).catch((err) => {
+					uni.showToast({
+						icon: "error",
+						title: err.message,
+					})
+				})
 			}
-	    },
+		},
 	}
 </script>
 
@@ -168,38 +186,43 @@
 	// 	background-color:#F4F4F4 !important; 
 	// 	border-radius: 0px 32rpx 8rpx 32rpx !important;
 	// }
-	page{
+	page {
 		background-color: #F4F4F4;
 		font-size: 30rpx;
 	}
-	.top{
-			background: #FFFFFF;
-			border-radius: 8rpx 32rpx 8rpx 8rpx;
-			margin: 30rpx;
-			padding: 40rpx;
-			display: flex;
-		}
-	.form{
+
+	.top {
+		background: #FFFFFF;
+		border-radius: 8rpx 32rpx 8rpx 8rpx;
+		margin: 30rpx;
+		padding: 40rpx;
+		display: flex;
+	}
+
+	.form {
 		background-color: #fff;
 		padding: 30rpx;
 		margin: 30rpx;
 		border-radius: 8rpx 32rpx 8rpx 32rpx;
-		
+
 	}
-	.btn{
+
+	.btn {
 		display: flex;
 		border-bottom: 1rpx solid #E3E3E3;
 		padding: 30rpx 0;
-		.btn-item{
+
+		.btn-item {
 			text-align: center;
 			line-height: 60rpx;
 			width: 176rpx;
 			height: 60rpx;
 			background: #F4F4F4;
 			border-radius: 30rpx;
-			margin:0 10rpx;
+			margin: 0 10rpx;
 		}
-		.btn-item-active{
+
+		.btn-item-active {
 			text-align: center;
 			line-height: 58rpx;
 			width: 174rpx;
@@ -208,26 +231,29 @@
 			border-radius: 30rpx;
 			border: 1px solid #1E9F6A;
 			color: #1E9F6A;
-			margin:0 10rpx;
+			margin: 0 10rpx;
 		}
 	}
-	.email{
+
+	.email {
 		background-color: #fff;
 		margin: 20rpx 0;
 		padding: 20rpx;
 	}
-	.tips{
+
+	.tips {
 		display: flex;
-		align-items: center;	
-		padding:0 30rpx;
+		align-items: center;
+		padding: 0 30rpx;
 		color: #999999;
 		font-size: 26rpx;
-		
+
 	}
-	.navbar{
+
+	.navbar {
 		padding: 30rpx 0;
 		text-align: center;
-		background:#1E9F6A ;
+		background: #1E9F6A;
 		color: #fff;
 		bottom: 0;
 		margin: 0 auto;

+ 63 - 5
pages/invoice/invoiceHistory.vue

xqd xqd xqd
@@ -1,9 +1,9 @@
 <template>
 	<view class="curpage">
-	<view class="list">
+	<view class="list" v-for="(item,index) in bill">
 		<view class="flex">
 			<view class="">
-				公司名称xxx
+				{{item.name}}
 			</view>
 			<view class="" style="color: #1E9F6A;">
 				已开票
@@ -12,14 +12,14 @@
 		<view class="content">
 			<view class="">
 				<text style="color: #666666 ;">电子发票 | 发票金额 :</text>
-				 ¥2345
+				 ¥{{item.amount}}
 			</view>
 			<view class="" style="margin: 20rpx 0;">
 				<text style="color: #666666 ;">申请时间:</text>
-				2022-01-05
+				{{item.created_at.slice(0,10)}}
 			</view>
 		</view>
-		<view class="btn">
+		<view class="btn" @click="sendEmail(item.id)">
 			发送至邮箱
 		</view>
 	</view>
@@ -28,6 +28,64 @@
 </template>
 
 <script>
+	export default {
+		data(){
+			return{
+				bill:[],
+				keyword:'',
+				 checkboxValue1:[],
+			}
+		},
+		onLoad() {
+			this.loadLsit()
+		},
+		methods:{
+			loadLsit(){
+				this.$showLoadding("加载中")
+				uni.$u.http.post('/api/bill/list',{
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.hideLoading()
+					console.log(res)
+					this.bill=res
+				}).catch((err) => {
+					uni.hideLoading()
+					this.$toast(err.message)
+				})
+			},
+			sendEmail(id){
+				uni.$u.http.post('/api/bill/send', {id:id}, {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					console.log(res)
+					uni.showToast({
+						icon: "success",
+						title: "发送成功",
+					})
+					setTimeout(() => {
+						this.loadLsit()
+					}, 500)
+				
+				}).catch((err) => {
+					this.$toast(err.message)
+				})
+			},
+			 checkboxChange(n) {
+			            console.log('change', n);
+			        },
+					// 跳转抬头管理
+			choose(){
+				
+				uni.navigateTo({
+					url:"/pages/invoice/applyInvoice"
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="less">

+ 117 - 57
pages/invoice/invoiceList.vue

xqd xqd xqd
@@ -1,63 +1,115 @@
 <template>
 	<view class="curpage">
 		<view class="search" style="margin-bottom: 24rpx;">
-				<u-search placeholder="请输入单号"  v-model="keyword" borderColor="#A8A8A8" height="64rpx"></u-search>
+			<u-search placeholder="请输入单号" v-model="keyword" borderColor="#A8A8A8" height="64rpx"></u-search>
 		</view>
-		<view class="list">
-			<u-checkbox-group  v-model="checkboxValue1"  placement="column"  @change="checkboxChange" shape="circle" size=32>
-			  	<view class="content">
-			  		<view class="flextop">
-			  			<view class="">		
-			  				单号  RYX202213582
-			  			</view>
-			  			<view class="price" >
-			  				订单金额 <text style="font-weight: 700;font-size: 28rpx;margin-left: 10rpx;">¥1690</text>
-			  			</view>
-			  		</view>
-			  		<view class="detail">
-						<u-checkbox  iconSize=32 style="padding: 0 100rpx;" activeColor="#1E9F6A"></u-checkbox  >
-			  			<view class="" style="margin-left: 30rpx;">
-			  				<view class="" style="font-weight: 700;font-size: 36rpx;">
-			  					夕阳红康养团7日游
-			  				</view>
-			  				<view class="" style="margin: 24rpx 0;">
-			  					日期:2022-04-25 ~ 2022-05-01
-			  				</view>
-			  				<view class="">
-			  					数量     1
-			  				</view>
-			  			</view>
-			  		</view>
-			  	</view>
-			</u-checkbox-group>
+		<view class="list" v-for="(item,index) in bill " :key="index">
+			<view class="content">
+				<view class="flextop">
+					<view class="">
+						单号 {{item.code}}
+					</view>
+					<view class="price">
+						订单金额 <text style="font-weight: 700;font-size: 28rpx;margin-left: 10rpx;">¥{{item.amount}}</text>
+					</view>
+				</view>
+				<view class="detail">
+					<radio color="#1E9F6A" style="font-size: 26rpx;" :checked="item.checked" :value="index"
+						@click="checkbox(index)"></radio>
+					<!-- <u-checkbox  iconSize=32 style="padding: 0 100rpx;" activeColor="#1E9F6A" :key="index" :name="item.amount"></u-checkbox> -->
+					<view class="" style="margin-left: 30rpx;">
+						<view class="" style="font-weight: 700;font-size: 36rpx;">
+							夕阳红康养团7日游
+						</view>
+						<view class="" style="margin: 24rpx 0;">
+							日期:{{item.start_at}} ~ {{item.end_at}}
+						</view>
+						<view class="">
+							数量 {{item.number}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="navbar">
+			<view class="navbar-item">
+				总金额 ¥{{total}}
+			</view>
+			<view class="navbar-item want" @click="choose">
+				选择抬头
+			</view>
 		</view>
-		 <view class="navbar">
-		     <view class="navbar-item">
-		 		总金额  ¥12929
-		 	</view>
-		 	<view class="navbar-item want" @click="choose"  >
-		 		选择抬头
-		 	</view>
-		 </view>
 	</view>
 </template>
 
 <script>
 	export default {
-		data(){
-			return{
-				keyword:'',
-				 checkboxValue1:[],
+		data() {
+			return {
+				bill: [],
+				keyword: '',
+				checkboxValue1: [],
+				ids:[]
 			}
 		},
-		methods:{
-			 checkboxChange(n) {
-			            console.log('change', n);
-			        },
-					// 跳转抬头管理
-			choose(){
+		onLoad() {
+			this.loadLsit()
+		},
+		computed:{
+			total(){
+				let allprice=0
+				this.bill.forEach(item=>{
+					if(item.checked){
+						allprice+=Number(item.price)
+					}
+				})
+				return allprice
+			}
+		},
+		
+		methods: {
+			loadLsit() {
+				this.$showLoadding("加载中")
+				uni.$u.http.post('/api/order/bill', {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.hideLoading()
+					let nawarr = res
+					nawarr.forEach(item => {
+						item.checked = false
+					})
+					this.bill = nawarr
+				}).catch((err) => {
+					uni.hideLoading()
+					console.log(err)
+				})
+			},
+			checkbox(n) {
+				let data = this.bill
+				if (data[n].checked) {
+					data[n].checked = false;
+				} else {
+					data[n].checked = true;
+				}
+				this.ids=[]
+				data.forEach(item=>{
+					if(item.checked){
+						this.ids.push(item.id)
+					}
+				})
+				console.log('ids',this.ids);
+			},
+			// 跳转抬头管理
+			choose() {
+				let order={
+					ids:this.ids,
+					total:this.total
+				}
+				uni.setStorageSync("order",order)
 				uni.navigateTo({
-					url:"/pages/invoice/applyInvoice"
+					url: "/pages/invoice/applyInvoice"
 				})
 			}
 		}
@@ -65,28 +117,34 @@
 </script>
 
 <style lang="less">
-	page{
+	page {
 		background-color: #F4F4F4;
 		font-size: 26rpx;
 	}
-	.curpage{
-		padding:24rpx 30rpx;
-		.list{
+
+	.curpage {
+		padding: 24rpx 30rpx;
+
+		.list {
 			box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
 			border-radius: 8rpx 8rpx 8rpx 32rpx;
 			background-color: #fff;
-			.flextop{
+			margin-bottom: 20rpx;
+			.flextop {
 				display: flex;
 				justify-content: space-between;
 				border-bottom: 1rpx solid #E3E3E3;
 				padding: 30rpx;
 			}
-			.detail{
+
+			.detail {
 				padding: 30rpx;
 				display: flex;
+				align-items: center;
 			}
 		}
-		.navbar{
+
+		.navbar {
 			display: flex;
 			font-size: 30rpx;
 			align-items: center;
@@ -98,11 +156,13 @@
 			background: #1E9F6A;
 			border-radius: 16rpx 16rpx 0px 0px;
 			color: #ffffff;
-			.navbar-item{
+
+			.navbar-item {
 				flex: 1;
 				text-align: center;
-			}	
-			.want{
+			}
+
+			.want {
 				border-left: 1rpx solid #FFFFFF;
 			}
 		}

+ 130 - 105
pages/login.vue

xqd xqd xqd xqd xqd xqd
@@ -1,14 +1,20 @@
 <template>
-	<view class="loginPage" >
-		
-		<image src="https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531915411.png" mode="" class="image"></image>
-		<view class="" style="text-align: center;margin: 100rpx;">日月峡康养旅行</view>
+	<view class="loginPage">
+
+		<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/riyuexia/login_bg.png" mode="aspectFill"
+			class="image"></image>
+		<view class="titleflex" style="margin: 60rpx 0 140rpx 0; ">
+			<text class="iconfont icon-back pdas" @click="$back"></text>
+			<text class="pdas">日月峡康养旅行</text>
+			<text class="pdas"></text>
+		</view>
 		<view class="logo">
-			<image src="../static/login/LOGO@2x.png" mode="widthFix"></image>
+			<image src="../static/login/LOGO@2x.png" mode="aspectFill"></image>
 		</view>
 		<!-- 选择登陆方式 -->
 		<view class="btn">
-			<button class="phoneNumber" open-type="getPhoneNumber"  @getphonenumber="getPhoneNumber" withCredentials="true">手机号一键登录</button>
+			<button class="phoneNumber" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
+				withCredentials="true">手机号一键登录</button>
 			<!-- <view  @click="gologin">
 				手机号一键登录
 			</view> -->
@@ -16,12 +22,12 @@
 				<view class="icon">
 					<image src="../static/login/iconS@2x.png" mode="widthFix"></image>
 				</view>
-				<view class="" >
+				<view class="">
 					其他手机号登陆
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="aggre">
 			登录即代表您同意我们的
 			<text class="underline" @click="terms">用户协议</text>和
@@ -31,116 +37,119 @@
 </template>
 
 <script>
-	import  WXBizDataCrypt from "@/static/js/WXBizDataCrypt.js"
-	export default{
-		data(){
-			return{
-				tips:"获取验证码",
+	import WXBizDataCrypt from "@/static/js/WXBizDataCrypt.js"
+	export default {
+		data() {
+			return {
+				tips: "获取验证码",
 				value: '',
 				// 输入的验证码
-				code:'',
+				code: '',
 				// 获取微信登录的code
-				wxCode:'',
+				wxCode: '',
 				// 解密密钥
-				session_key:'',
+				session_key: '',
 				// 手机号
-				phone:'',
-				encryptedData:"",
-				iv:'',
-				openid:"",
-				unionid:'',
-				nickName:''
-				
+				phone: '',
+				encryptedData: "",
+				iv: '',
+				openid: "",
+				unionid: '',
+				nickName: ''
+
 			}
 		},
 		onLoad() {
-			 this.initLogin()
+			this.initLogin()
 		},
-		methods:{
+		methods: {
 			// 获取微信登录的code以及发送请求
-		initLogin() {
-			uni.login({
-			    success: (res) => {
-					// console.log(res)
-				    if (res.code) { //微信登录成功 已拿到code  
-						this.wxCode = res.code //保存获取到的code  
-						console.log(res.code,"WXcode");
-					} else {
-						console.log('登录失败!' + res.errMsg)
-				    }
-				}
-			})
-		},
-	getPhoneNumber (e) {
-	  if(e.detail.errMsg=="getPhoneNumber:ok"){
-		/*uni.login({
-		    success: (res) => {
-				// console.log(res)
-			    if (res.code) { //微信登录成功 已拿到code  
-					this.wxCode = res.code //保存获取到的code  */
-					
-					uni.$u.http.post('/api/login/phone',{
-						code:this.wxCode,
-						iv:e.detail.iv,
-						enc:e.detail.encryptedData
-					}).then(res=>{
+			initLogin() {
+				uni.login({
+					success: (res) => {
+						// console.log(res)
+				  if (res.code) { //微信登录成功 已拿到code  
+							this.wxCode = res.code //保存获取到的code  
+							console.log(res.code, "WXcode");
+							
+
+						} else {
+							console.log('登录失败!' + res.errMsg)
+						}
+					}
+				})
+			},
+			getPhoneNumber(e) {
+				if (e.detail.errMsg == "getPhoneNumber:ok") {
+					/*uni.login({
+					    success: (res) => {
+							// console.log(res)
+						    if (res.code) { //微信登录成功 已拿到code  
+								this.wxCode = res.code //保存获取到的code  */
+
+					uni.$u.http.post('/api/login/phone', {
+						code: this.wxCode,
+						iv: e.detail.iv,
+						enc: e.detail.encryptedData
+					}).then(res => {
 						console.log(res)
 						uni.setStorageSync('token', res.token)
 						uni.setStorageSync('phone', res.user.phone)
 						this.$store.commit('setToken', res.token)
 						this.$store.commit('loginState', res.token)
-						this.$store.commit('getUserInfo',{
+						this.$store.commit('getUserInfo', {
 							//code:this.wxCode,
-							phone:res.user.phone,
+							phone: res.user.phone,
 						})
 						
 						uni.showToast({
-						 	title: '登录成功',
-						 	icon:"success",
-						 	duration: 1000
+							title: '登录成功',
+							icon: "success",
+							duration: 1000
 						})
-						uni.reLaunch({
-							url:"/pages/index/index"
-						})
-					}).catch(err=>{
+						setTimeout(()=>{
+							this.$back()
+						},500)
+						
+					}).catch(err => {
 						console.log(err)
 						uni.showToast({
-							icon:"error",
-							title:err.message,
+							icon: "error",
+							title: err.message,
 						})
 					})
-				
-			
-	   
-	    }else{
-	        console.log('用户点击了拒绝') ;  
-	    }
-	},
-	// getUserInfo(e){
-	// 	uni.getUserInfo({
-	// 		 success:(res)=>{
-	// 		     console.log(res)                                                   
-	// 		     // var userInfo = res.userInfo;                                          
-	// 		}
-	// 	})
-	// },
-				
+
+
+
+				} else {
+					console.log('用户点击了拒绝');
+				}
+			},
+			// getUserInfo(e){
+			// 	uni.getUserInfo({
+			// 		 success:(res)=>{
+			// 		     console.log(res)                                                   
+			// 		     // var userInfo = res.userInfo;                                          
+			// 		}
+			// 	})
+			// },
+
 			// 其他电话号码登录
-			gootherNuber(){
+			gootherNuber() {
 				uni.navigateTo({
-					url:"otherNumlogin"
+					url: "otherNumlogin"
 				})
 			},
 			// 政策
-			Policy(){
+			Policy() {
 				uni.navigateTo({
-					url:"/pages/userCenter/Policy"
+					url: "/pages/userCenter/Policy"
 				})
 			},
 			// 政策
-			terms(){
+			terms() {
 				uni.navigateTo({
-					url:"/pages/userCenter/Terms"
+					url: "/pages/userCenter/Terms"
 				})
 			},
 		}
@@ -148,29 +157,41 @@
 </script>
 
 <style lang="less">
-	page{
+	page {
 		color: #ffffff;
 	}
-		.image{
-			position: fixed;
-			    width: 100%;
-			    height: 100%;
-			    top: 0;
-			    left: 0;
-			    z-index: -1;
-		}
-	
-	.logo{
+	.titleflex{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+	.pdas{
+		padding:0 20rpx;
+	}
+	.image {
+		position: fixed;
+		width: 100%;
+		height: 100%;
+		top: 0;
+		left: 0;
+		z-index: -1;
+	}
+
+	.logo {
 		text-align: center;
 		margin-top: 197rpx;
-		image{
+
+		image {
 			width: 114rpx;
+			height: 114rpx;
 		}
 	}
-	.btn{
+
+	.btn {
 		text-align: center;
 		margin-top: 117rpx;
-		.phoneNumber{
+
+		.phoneNumber {
 			margin: 0 auto;
 			width: 654rpx;
 			height: 92rpx;
@@ -179,7 +200,8 @@
 			color: #FFFFFF;
 			border-radius: 8rpx 32rpx 8rpx 32rpx;
 		}
-		.otherNumber{
+
+		.otherNumber {
 			display: flex;
 			justify-content: center;
 			align-items: center;
@@ -188,25 +210,28 @@
 			height: 92rpx;
 			line-height: 92rpx;
 			background: rgba(255, 255, 255, 0.16);
-            border-radius: 8rpx 32rpx 8rpx 32rpx;
+			border-radius: 8rpx 32rpx 8rpx 32rpx;
 			border: 1px solid #E2E2E3;
-			.icon{
-				image{
+
+			.icon {
+				image {
 					width: 38rpx;
 					margin: 40rpx 30rpx 0 0;
 				}
 			}
 		}
 	}
-	.aggre{
+
+	.aggre {
 		margin-top: 400rpx;
 		text-align: center;
 		font-family: PingFang-SC-Medium, PingFang-SC;
 		font-weight: 500;
 		color: #E2E2E2;
 		font-size: 26rpx;
-		.underline{
-			text-decoration:underline;
+
+		.underline {
+			text-decoration: underline;
 			padding: 0 6rpx;
 		}
 	}

+ 149 - 86
pages/order/applyAfterSale.vue

xqd xqd xqd xqd
@@ -3,101 +3,112 @@
 		<view class="applyAfterSale-top">
 			<view class="l">
 				<view class="" style="font-size: 36rpx;font-weight: 600;color: #333333;">
-					夕阳红康养团7日游
+					{{msg.good_name}}
 				</view>
 				<view class="" style="font-size: 22rpx;margin: 20rpx 0;">
-					出行日期:2022-04-25
+					出行日期:{{msg.start_at}}
 				</view>
-				<view class=""  style="font-size: 22rpx;">
-					数量  1
+				<view class="" style="font-size: 22rpx;">
+					数量 {{msg.number}}
 				</view>
 			</view>
 			<view class="r">
-				<image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png" mode="widthFix"></image>
+				<image :src="msg.cover_picture" mode="aspectFill"></image>
 				<view class="" style="margin-top: 20rpx;">
-					
-					<text style="font-size: 22rpx;">订单金额</text><text style="font-size: 32rpx;font-weight: 600;">¥12121</text>
+
+					<text style="font-size: 22rpx;">订单金额</text><text
+						style="font-size: 32rpx;font-weight: 600;padding-left: 10rpx;">¥{{msg.amount}}</text>
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="applyAfterSale-center">
 			<u--form :model="form">
-			<u-form-item label="退款原因" labelWidth=200 prop="userInfo.name" borderBottom ref="item1">
-				<picker @change="bindPickerChange" :value="form.userInfo.name" :range="Array">
-					<view class="" style="display: flex;">
-						<u--input v-model="form.userInfo.name" disabled disabledColor="#ffffff" border="none" placeholder="请输入退款原因" placeholderStyle="color: #555555"></u--input>
-						<u-icon slot="right" name="arrow-right"></u-icon>
+				<u-form-item label="退款原因" labelWidth=200 prop="info.reason" borderBottom ref="item1">
+					<picker @change="bindPickerChange" :value="info.reason" :range="Array">
+						<view class="" style="display: flex;">
+							<u--input v-model="info.reason" disabled disabledColor="#ffffff" border="none"
+								placeholder="请输入退款原因" placeholderStyle="color: #555555"></u--input>
+							<u-icon slot="right" name="arrow-right"></u-icon>
+						</view>
+					</picker>
+
+				</u-form-item>
+				<u-form-item label="退款金额" labelWidth=200 prop="info.amount" borderBottom ref="item1">
+					<u--input v-model="info.amount" border="none" :placeholder="'最多可退款'+msg.amount"
+						placeholderStyle="color: #555555"></u--input>
+				</u-form-item>
+				<u-form-item label="备注信息" labelWidth=200 prop="info.memo" borderBottom ref="item1">
+					<u--input v-model="info.memo" border="none" placeholder="请输入备注" placeholderStyle="color: #555555">
+					</u--input>
+				</u-form-item>
+				<u-form-item label="联系方式" labelWidth=200 prop="info.phone" borderBottom ref="item1">
+					<u--input v-model="info.phone" border="none" placeholder="请输入联系方式"
+						placeholderStyle="color: #555555" type="number"></u--input>
+				</u-form-item>
+				<view class="">
+					<view class="" style="margin: 40rpx 0;">
+						备注信息
 					</view>
-				</picker>
-				
-			</u-form-item>
-			<u-form-item label="退款金额" labelWidth=200 prop="userInfo.amount" borderBottom ref="item1">
-				<u--input v-model="form.userInfo.amount" border="none" placeholder="最多可退款¥1690" placeholderStyle="color: #555555"></u--input>
-			</u-form-item>
-			<u-form-item label="备注信息" labelWidth=200 prop="userInfo.mes" borderBottom ref="item1">
-				<u--input v-model="form.userInfo.mes" border="none" placeholder="请输入备注" placeholderStyle="color: #555555"></u--input>
-			</u-form-item>
-			<u-form-item label="联系方式" labelWidth=200 prop="userInfo.number" borderBottom ref="item1">
-				<u--input v-model="form.userInfo.number" border="none" placeholder="请输入联系方式" placeholderStyle="color: #555555"></u--input>
-			</u-form-item>
-			<view class="">
-				<view class="" style="margin: 40rpx 0;">
-					备注信息
+					<u--textarea v-model="value" placeholder="请输入退款原因" :customStyle="{'background':'#F4F4F4'}"
+						placeholderStyle="color: #555555" height=160 border="none"></u--textarea>
 				</view>
-				<u--textarea v-model="value" placeholder="请输入退款原因" :customStyle="{'background':'#F4F4F4'}" placeholderStyle="color: #555555" height=160 border="none"></u--textarea>
-			</view>
-			
-			<view class="" style="font-size: 36rpx;font-weight: 600;margin: 24rpx 0;">
-				退款说明
-			</view>
-			<view class="" style="margin-bottom: 40rpx;">
-				退款将退到原账户,请知悉!
-			</view>
-			<view class="applyAfterSale-footer">
-				<view class="" style="margin: 20rpx 0;">
-					上传凭证
+
+				<view class="" style="font-size: 36rpx;font-weight: 600;margin: 24rpx 0;">
+					退款说明
+				</view>
+				<view class="" style="margin-bottom: 40rpx;">
+					退款将退到原账户,请知悉!
+				</view>
+				<view class="applyAfterSale-footer">
+					<view class="" style="margin: 20rpx 0;">
+						上传凭证
+					</view>
+					<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
+						:maxCount="6" width="200rpx" height="200rpx"></u-upload>
 				</view>
-				<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="6" width="200rpx" height="200rpx"></u-upload>
-			</view>
 			</u--form>
 		</view>
-		
+
 		<!-- 退款原因选择 -->
 		<u-picker :show="show" :columns="columns" confirmColor="#1E9F6A"></u-picker>
-		
+
 		<!-- <view class="" style="margin-bottom: 144rpx;"></view> -->
-		<view class="navbar">
+		<view class="navbar" @click="applyRefund">
 			申请退款
 		</view>
 	</view>
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
-				value:'',
+	let that
+	export default {
+		data() {
+			return {
+				msg: '',
+				value: '',
 				fileList1: [],
-				index:0,
-				form:{
-					userInfo:{
-						name:"",
-						amount:'',
-						mes:"",
-						number:''
-					}
+				index: 0,
+				info: {
+					reason: "",
+					amount: '',
+					phone: "",
+					memo: ''
 				},
 				show: false,
 				Array: ['个人', '产品', '其他'],
 			}
 		},
-		methods:{
+		onLoad(o) {
+			that=this
+			let msg = JSON.parse(o.obj)
+			this.msg = msg
+			console.log(msg)
+		},
+		methods: {
 			// 选择yuany
 			bindPickerChange(e) {
-			    console.log('picker发送选择改变,携带值为', e.detail.value)
-				// console.log(this.genderArray[e.detail.value])
-			   this.form.userInfo.name=this.Array[e.detail.value]
+				this.info.reason = this.Array[e.detail.value]
 			},
 			// 删除图片
 			deletePic(event) {
@@ -105,37 +116,42 @@
 			},
 			// 新增图片
 			async afterRead(event) {
-			// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+				// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
 				let lists = [].concat(event.file)
 				let fileListLen = this[`fileList${event.name}`].length
-				    lists.map((item) => {
-						this[`fileList${event.name}`].push({
-							...item,
-							status: 'uploading',
-							message: '上传中'
-						})
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
 					})
+				})
 				for (let i = 0; i < lists.length; i++) {
 					const result = await this.uploadFilePromise(lists[i].url)
 					let item = this[`fileList${event.name}`][fileListLen]
-						this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
-							status: 'success',
-							message: '',
-							url: result
-						}))
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
 					fileListLen++
 				}
 			},
+		
 			uploadFilePromise(url) {
 				return new Promise((resolve, reject) => {
 					let a = uni.uploadFile({
-						url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
+						url: 'https://t38.9026.com/api/common/upload', // 仅为示例,非真实的接口地址
 						filePath: url,
 						name: 'file',
+						header: {
+							Authorization: `Bearer ${token}`
+						},
 						formData: {
 							user: 'test'
 						},
 						success: (res) => {
+							console
 							setTimeout(() => {
 								resolve(res.data.data)
 							}, 1000)
@@ -143,6 +159,46 @@
 					});
 				})
 			},
+			applyRefund() {
+				if(!this.info.reason){
+					this.$toast("请选择退款原因")
+					return
+				}
+				if(!this.info.amount){
+					this.$toast("请输入退款金额")
+					return
+				}
+				if(!this.info.phone){
+					this.$toast("请输入手机号码")
+					return
+				}
+			
+				var pic=[]
+				this.fileList1.forEach(item=>{
+					pic.push(item.thumb)
+				})
+				this.info.picture=pic
+				this.info.order_id=this.msg.id
+				let form=this.info
+				uni.showLoading({})
+				uni.$u.http.post('/api/refund/add',form , {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.hideLoading()
+					// uni.hideLoading()
+					that.$toast("取消成功")
+					setTimeout(() => {
+						uni.navigateTo({
+							url: "/pages/order/order"
+						})
+					}, 500)
+				}).catch((err) => {
+					uni.hideLoading()
+					this.$toast(err.message)
+				})
+			},
 		}
 	}
 </script>
@@ -154,39 +210,46 @@
 	// .u-textarea.data-v-81cd9d32{
 	// 	background-color:#F4F4F4 !important; 
 	// }
-	page{
+	page {
 		background-color: #F4F4F4;
 		font-size: 32rpx;
 	}
-	.applyAfterSale-top{
-		margin: 24rpx  0 0;
-		padding:40rpx 30rpx;
+
+	.applyAfterSale-top {
+		margin: 24rpx 0 0;
+		padding: 40rpx 30rpx;
 		background: #FFFFFF;
 		box-shadow: 0px 2rpx 4px 0px rgba(0, 0, 0, 0.02);
 		border-radius: 16rpx 56rpx 8rpx 8rpx;
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
-		.r{
+
+		.r {
 			text-align: right;
 		}
-		image{
-			width: 140rpx;
+
+		image {
+			width: 136rpx;
+			height: 91rpx;
 			border-radius: 6rpx;
 		}
-		
+
 	}
-	.applyAfterSale-center{
+
+	.applyAfterSale-center {
 		margin-top: 24rpx;
 		padding: 30rpx;
 		background-color: #ffffff;
 		border-radius: 8rpx 8rpx 16rpx 56rpx;
-		margin-bottom: 144rpx;
+		padding-bottom: 40rpx;
+		margin-bottom: 170rpx;
 	}
-	.navbar{
+
+	.navbar {
 		padding: 30rpx 0;
 		text-align: center;
-		background:#1E9F6A ;
+		background: #1E9F6A;
 		color: #fff;
 		bottom: 0;
 		margin: 0 auto;

+ 73 - 7
pages/order/order.vue

xqd xqd xqd xqd xqd xqd
@@ -78,15 +78,27 @@
 			</view>
 
 			<view class="list-bottom">
-				<view class="list-bottom-item">
-					<image src="../../static/orderListicon/notepad@2x.png" mode="heightFix"></image>
+				<view class="list-bottom-item" v-if="item.status==4||item.status==5||item.status==3">
+					<image src="../../static/orderListicon/notepad@2x.png" mode="aspectFill"></image>
+					<text class="">
+						再次预订
+					</text>
+				</view>
+				<view class="list-bottom-item" v-if="item.status==1" @click.stop="goPay(item.id)">
+					<image src="../../static/orderListicon/notepad@2x.png" mode="aspectFill"></image>
 					<text class="">
 						去支付
 					</text>
 				</view>
-				<view class="line">
+				<view class="list-bottom-item" v-if="item.status==2" @click.stop="goAfterSale(item)">
+					<image src="../../static/orderListicon/notepad@2x.png" mode="aspectFill"></image>
+					<text class="">
+						申请退款
+					</text>
 				</view>
-				<view class="list-bottom-item" @click="goguide">
+				<view class="line" v-if="item.status==1||item.status==2">
+				</view>
+				<view class="list-bottom-item" @click.stop="goguide(item)" v-if="item.status==1||item.status==2">
 					<image src="../../static/orderListicon/bookmark@2x(1).png" mode="heightFix"></image>
 					<text class="">
 						专属森林向导
@@ -94,7 +106,10 @@
 				</view>
 			</view>
 		</view>
-		<u-loadmore v-if="orderList.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无订单"/>
+		<view style="margin-top:140rpx;" v-if="orderList.length==0">
+			<u-loadmore v-if="orderList.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无订单" />
+		</view>
+		
 	<!-- 	<view class="list" v-if="state==2 || state==0?true:false" @click="goOrderDetail1">
 			<view class="list-top">
 				<view class="">
@@ -315,11 +330,13 @@
 		},
 		methods:{
 			init(){
+				this.$showLoadding("加载中")
 				uni.$u.http.post('/api/order/list',{status:0,page:1,per_page:5},{
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
+					uni.hideLoading()
 					console.log(res)
 					this.orderList=res.data
 				}).catch((err) => {
@@ -340,6 +357,44 @@
 					this.state=4
 				}
 			},
+			goAfterSale(item){
+				uni.navigateTo({
+					url:"/pages/order/applyAfterSale?obj="+JSON.stringify(item)
+				})
+			},
+			goPay(id){
+				uni.$u.http.post('/api/order/config',{
+					order_id:id,
+				}).then(res=>{
+					// console.log(res)
+				  uni.requestPayment({
+				     provider: 'wxpay',    //支付类型-固定值
+				     timeStamp: res.timeStamp, // 时间戳(单位:秒)
+				     nonceStr: res.nonceStr, // 随机字符串
+				     package: res.package, // 固定值
+				     signType: res.signType, //固定值
+				     paySign: res.paySign, //签名
+				     success: function (res) {
+				         // console.log('success:' + JSON.stringify(res));
+				         console.log("支付成功");
+						 uni.navigateTo({
+						 	url:"/pages/order/successpay?id="+id
+						 })
+				     },
+				     fail: function (err) {
+				         console.log('fail:' + JSON.stringify(err));
+				         console.log("支付失败");
+				     }
+				 });
+				 
+				}).catch(err=>{
+					console.log(err)
+					uni.showToast({
+						icon:"error",
+						title:err.message,
+					})
+				})
+			},
 			// 跳转订单售后详情------待退框
 			goOrderAfterSale(){
 				uni.navigateTo({
@@ -353,10 +408,20 @@
 				})
 			},
 			// 跳转集合页面
-			goguide(){
-				uni.navigateTo({
+			goguide(item){
+				console.log(item)
+				if(item.status_text=="待付款"){
+					uni.showModal({
+						title:"提示",
+						content:"订单支付后可进入专属森林向导"
+					})
+					return
+				}else{
+					uni.navigateTo({
 					url:"/pages/order/guide"
 				})
+				}
+				
 			},
 			// 跳转支付订单详情
 			goOrderDetail(id){
@@ -436,6 +501,7 @@
 				color: #1E9F6A;
 				text-align: center;
 				image{
+					width: 24rpx;
 					height: 24rpx;
 					margin-right: 10rpx;
 				}

+ 337 - 165
pages/order/orderDetails.vue

xqd xqd xqd xqd xqd
@@ -1,64 +1,71 @@
-	<template>
+<template>
 		<view class="orderDetails">
-			<view class="list"  @click="goOrderDetail">
+			<view class="list" @click="goOrderDetail">
 				<view class="list-top">
 					<view class="" style="font-size: 36rpx;font-weight: bold;color: #1E9F6A;">
-						<!-- 待付款   -->  {{orderinfo.status_text}}
+						<!-- 待付款   --> {{orderinfo.status_text?orderinfo.status_text:''}}
 					</view>
 					<view class="" style="font-size: 22rpx;margin-top: 28rpx;">
-					订单号  {{orderinfo.code}}
+						订单号 {{orderinfo.code?orderinfo.code:''}}
 					</view>
 				</view>
 				<view class="listcenter">
 					<view class="l">
 						<view class="" style="font-size: 36rpx;font-weight: 600;color: #333333;">
-							<!-- 夕阳红康养团7日游 -->{{orderinfo.good_name}}
+							<!-- 夕阳红康养团7日游 -->{{orderinfo.good_name?orderinfo.good_name:''}}
 						</view>
 						<view class="" style="margin: 20rpx 0 20rpx;font-size: 22rpx;color: #333333;">
-							日期:{{orderinfo.start_at}} ~ {{orderinfo.end_at}}
+							日期:{{orderinfo.start_at?orderinfo.start_at:''}} ~ {{orderinfo.end_at?orderinfo.end_at:''}}
 						</view>
 						<view class="" style="color: #333333;">
 							<!-- 标间床位 1人 -->
-							<text >{{orderinfo.room.name}}</text>
+							<text>{{orderinfo.room.name?orderinfo.room.name:''}}</text>
 							<text style="margin-left:160rpx ;">
-								x {{orderinfo.cohabits.length}} (人)
+								x {{orderinfo.cohabits.length?orderinfo.cohabits.length:''}} (人)
 							</text>
 						</view>
-						
+
 					</view>
-					
+
 					<view class="r">
 						<view class="">
 							<image :src="orderinfo.cover_picture" mode="widthFix"></image>
 						</view>
 						<view class="" style="margin: 28rpx 0 16rpx;">
-							¥{{orderinfo.price}}
+							¥{{orderinfo.price?orderinfo.price:''}}
 						</view>
-						<view class="" >
-						合计	<text style="font-size: 36rpx;font-weight: 600;color: #333333;">¥{{orderinfo.amount}}</text>
+						<view class="">
+							合计 <text
+								style="font-size: 36rpx;font-weight: 600;color: #333333;">¥{{orderinfo.amount?orderinfo.amount:''}}</text>
 						</view>
 					</view>
 				</view>
-			
-				<view class="list-bottom" >
+
+				<view class="list-bottom">
 					<view style="margin-top: 10rpx;" v-for="item,index in orderinfo.travelers" :key="index">
-					<view class="listIcon" style="margin-bottom: 20rpx;">
-						<image src="../../static/orderListicon/user@2x.png" mode="widthFix"></image>
-						<text class="">
-							{{item.name}}
-						</text>
-					</view>
+						<view class="listIcon" style="margin-bottom: 20rpx;">
+							<view class="listIconbox">
+								<image src="../../static/orderListicon/user@2x.png" mode="aspectFit"></image>
+							</view>
+							
+							<text >
+								{{item.name?item.name:''}}
+							</text>
+						</view>
 
-					<view class="listIcon" @click="goaggMes">
-						<image src="../../static/orderListicon/mobile@2x.png" mode="widthFix"></image>
-						<text class="">
-							{{item.phone}}
-						</text>
+						<view class="listIcon" @click="goaggMes">
+							<view class="listIconbox">
+								<image src="../../static/orderListicon/mobile@2x.png" mode="aspectFit"></image>
+							</view>
+							
+							<text class="">
+								{{item.phone?item.phone:''}}
+							</text>
+						</view>
 					</view>
 				</view>
-				</view>
 			</view>
-			
+
 			<view class="travel">
 				<view class="travelList">
 					<view class="" style="font-size: 32rpx;font-weight: 600;color: #333333;margin-bottom: 70rpx;">
@@ -67,22 +74,23 @@
 					<image src="../../static/orderListicon/users02@2x.png" mode="widthFix"></image>
 				</view>
 				<view class="" v-for="item,index in orderinfo.travelers" :key="index">
-					<view class="">{{item.name}}</view>
-					<view class="" style="margin: 30rpx 0;">证件类型:{{item.certificate_type_text}}</view>
-					<view class="">性别:{{item.gender_text}}</view>
-					<view class="" style="margin: 30rpx 0;">证件号码:{{item.certificate_no}}</view>
+					<view class="">{{item.name?item.name:''}}</view>
+					<view class="" style="margin: 30rpx 0;">
+						证件类型:{{item.certificate_type_text?item.certificate_type_text:''}}</view>
+					<view class="">性别:{{item.gender_text?item.gender_text:''}}</view>
+					<view class="" style="margin: 30rpx 0;">证件号码:{{item.certificate_no?item.certificate_no:''}}</view>
 				</view>
 			</view>
-			
+
 			<view class="room">
-				<view class=" title" >
+				<view class=" title">
 					<view class="" style="font-size: 32rpx;font-weight: 600;color: #333333;">
 						同住人列表
 					</view>
-					<image src="../../static/orderListicon/users02@2x.png" mode="widthFix"></image>
+					<image src="../../static/orderListicon/users02@2x.png" mode="aspectFit"></image>
 				</view>
 				<view class="roomList" v-for="item,index in orderinfo.cohabits" :key="index">
-					<view class="" >
+					<view class="">
 						同住人{{index+1}}
 					</view>
 					<view class="">
@@ -90,54 +98,76 @@
 					</view>
 				</view>
 			</view>
-			
+
 			<!-- 待出行 -->
-			<view class="navbar">
-				<view class="navbar-item" @click="goafter" v-if="state==1">
-					<image src="../../static/orderListicon/login.png" mode="heightFix"></image>
+			<view class="navbar" v-if="state==1">
+				<view class="navbar-item" @click="goafter" >
+					<image src="../../static/orderListicon/login.png" mode="aspectFill"></image>
 					<view class="">
 						申请退款
 					</view>
 				</view>
 				<view class="line">
-					
+
 				</view>
 				<view class="navbar-item">
-					<image src="../../static/orderListicon/bookmark.png" mode="heightFix"></image>
+					<image src="../../static/orderListicon/bookmark.png" mode="aspectFill"></image>
 					<view class="" @click="goguide">
 						专属森林向导
 					</view>
 				</view>
 			</view>
-			
+
 			<!-- 待付款 -->
-			<view class="navbar" v-if="state==0">
-				<view class="navbar-item">
-					<image src="../../static/orderListicon/box-cancel.png" mode="heightFix"></image>
+			<view class="navbar" >
+				<view class="navbar-item"  @click="cancelOrder" v-if="status==1">
+					<view class="navbariconbox">
+						<image src="../../static/orderListicon/box-cancel.png" mode="aspectFill"></image>
+					</view>
 					<text class="">
 						取消订单
 					</text>
 				</view>
-				<view class="line">
-					
+				<view class="line"  v-if="status==1">
+
 				</view>
-				<view class="navbar-item">
-					<image src="../../static/orderListicon/notepad.png" mode="heightFix"></image>
+				<view class="navbar-item" @click="goPay" v-if="status==1">
+					<view class="navbariconbox">
+						<image src="../../static/orderListicon/notepad.png" mode="aspectFill"></image>
+					</view>
 					<text class="">
 						去支付
 					</text>
 				</view>
-				<view class="line">
-					
+				<view class="navbar-item" @click="buyAgin" v-if="status==4||status==3">
+					<view class="navbariconbox">
+						<image src="../../static/orderListicon/notepad.png" mode="aspectFill"></image>
+					</view>
+					<text class="">
+						再次预订
+					</text>
 				</view>
-				<view class="navbar-item">
-					<image src="../../static/orderListicon/bookmark.png" mode="heightFix"></image>
+				<view class="navbar-item"  v-if="status==2" @click="goAfterSale">
+					<view class="navbariconbox">
+						<image src="../../static/orderListicon/notepad.png" mode="aspectFill"></image>
+					</view>
+					<text class="">
+						申请退款
+					</text>
+				</view>
+				<view class="line"  v-if="status==1||status==2">
+
+				</view>
+				<view class="navbar-item" @click="moveGuide"  v-if="status==1||status==3||status==2">
+					<view class="navbariconbox">
+						<image src="../../static/orderListicon/bookmark.png" mode="aspectFill"></image>
+					</view>
 					<text class="">
 						专属森林向导
 					</text>
 				</view>
 			</view>
-			
+
 			<!-- 已退订 已完成 -->
 			<!-- <view class="navbar"  v-if="state==2">
 				<view class="navbar-item">
@@ -151,12 +181,16 @@
 	</template>
 
 	<script>
-		export default{
-			data(){
-				return{
+		let that
+		export default {
+			data() {
+				return {
 					// 0待付款 1待出行 2退框
-					state:0,
-					orderinfo:{}
+					state: 0,
+					orderinfo: {},
+					id:0,
+					status:'',
+					good_id:''
 				}
 			},
 			onLoad(options) {
@@ -167,147 +201,285 @@
 				// }if(options.id==3){
 				// 	this.state=2
 				// }
+				that=this
+				this.id=Number(options.id)
 				this.init(options.id)
 			},
-			methods:{
-				init(id){
-					uni.$u.http.post('/api/order/show',{order_id:id},{
+			methods: {
+				init(id) {
+					this.$showLoadding("加载中")
+					uni.$u.http.post('/api/order/show', {
+						order_id: id
+					}, {
 						custom: {
 							auth: true
 						}
 					}).then((res) => {
-						console.log(res)
-						this.orderinfo=res
+						uni.hideLoading()
+						// console.log(res)
+						this.orderinfo = res
+						this.status=res.status
+						this.good_id=res.good_id
+						// console.log(this.status,7788)
 					}).catch((err) => {
-						console.log( err)
+						console.log(err)
 					})
 				},
-				goguide(){
+				goAfterSale(){
 					uni.navigateTo({
-						url:"./guide"
+						url:"/pages/order/applyAfterSale?obj="+JSON.stringify(this.orderinfo)
+					})
+				},
+				goOrderDetail(){
+					uni.navigateTo({
+						url:"/pages/travel/travelDetails?id="+this.good_id
+					})
+				},
+				buyAgin(){
+					uni.navigateTo({
+						url:"/pages/travel/travelDetails?id="+this.orderinfo.good_id
+					})
+				},
+				goguide() {
+					uni.navigateTo({
+						url: "./guide"
 					})
 				},
 				// 退款
-				goafter(){
+				goafter() {
 					uni.navigateTo({
-						url:"./applyAfterSale"
+						url: "./applyAfterSale"
+					})
+				},
+				moveGuide(){
+					if (this.status == 1) {
+						uni.showModal({
+							title: "提示",
+							content: "订单支付后可进入专属森林向导"
+						})
+						return
+					} else {
+						uni.navigateTo({
+							url: "/pages/order/guide"
+						})
+					}
+				
+				},
+				goPay(){
+					uni.$u.http.post('/api/order/config',{
+						order_id:that.id,
+					}).then(res=>{
+						// console.log(res)
+					  uni.requestPayment({
+					     provider: 'wxpay',    //支付类型-固定值
+					     timeStamp: res.timeStamp, // 时间戳(单位:秒)
+					     nonceStr: res.nonceStr, // 随机字符串
+					     package: res.package, // 固定值
+					     signType: res.signType, //固定值
+					     paySign: res.paySign, //签名
+					     success: function (res) {
+							 uni.navigateTo({
+							 	url:"/pages/order/successpay?id"+that.id
+							 })
+					         // console.log('success:' + JSON.stringify(res));
+					         console.log("支付成功");
+					     },
+					     fail: function (err) {
+					         console.log('fail:' + JSON.stringify(err));
+					         console.log("支付失败");
+					     }
+					 });
+					 
+					}).catch(err=>{
+						console.log(err)
+						uni.showToast({
+							icon:"error",
+							title:err.message,
+						})
 					})
+				},
+				cancelOrder() {
+					uni.showModal({
+						title: "提示",
+						content: "是否取消订单?",
+						success:(res)=> {
+							if (res.confirm) {
+								that.$showLoadding("加载中")
+								uni.$u.http.post('/api/order/cancel', {
+									order_id: that.id
+								}, {
+									custom: {
+										auth: true
+									}
+								}).then((res) => {
+									uni.hideLoading()
+										// uni.hideLoading()
+										that.$toast("取消成功")
+										setTimeout(() => {
+											uni.navigateTo({
+												url:"/pages/order/order"
+											})
+										}, 500)
+								}).catch((err) => {
+									console.log(err)
+								})
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+
+					})
+
 				}
 			}
 		}
 	</script>
 
 	<style lang="less">
-		page{
+		page {
 			background-color: #F4F4F4;
 			font-size: 28rpx;
 			font-family: PingFang-SC-Bold, PingFang-SC;
 		}
-	.list{
-		box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
-		border-radius: 16rpx 16rpx 16rpx 56rpx;
-		background-color: #FFFFFF;
-		// padding: 30rpx;
-		margin: 57rpx 30rpx;
-		.list-top{
-			
-			padding-bottom: 20rpx;
-			border-bottom: 1px solid #efefef;
-			padding: 30rpx;
-		}
-		.listcenter{
-			display: flex;
-			justify-content: space-between;
-			// margin: 24rpx 0 40rpx;
-			padding: 30rpx;
-			.r{
-				text-align: right;
-				.image{
-					// width: 140rpx;
+
+		.list {
+			box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
+			border-radius: 16rpx 16rpx 16rpx 56rpx;
+			background-color: #FFFFFF;
+			// padding: 30rpx;
+			margin: 57rpx 30rpx;
+
+			.list-top {
+
+				padding-bottom: 20rpx;
+				border-bottom: 1px solid #efefef;
+				padding: 30rpx;
+			}
+
+			.listcenter {
+				display: flex;
+				justify-content: space-between;
+				// margin: 24rpx 0 40rpx;
+				padding: 30rpx;
+
+				.r {
+					text-align: right;
+
+					.image {
+						// width: 140rpx;
+					}
+
+					image {
+						width: 140rpx;
+						height: 84rpx;
+						border-radius: 6rpx;
+					}
 				}
-				image{
-					width: 140rpx;
-					height: 84rpx;
-					border-radius: 6rpx;
+
+			}
+
+			.list-bottom {
+				border-top: 1rpx solid #E3E3E3;
+				border-radius: 0px 0px 16rpx 56rpx;
+				background-color: #FBFBFB;
+				padding: 30rpx 0 30rpx 60rpx;
+				color: #1E9F6A;
+				font-weight: 600;
+
+				.listIcon {
+			 	display: flex;
+					align-items: center;
+					font-size: 26rpx;
+					.listIconbox{
+						width: 20rpx;
+						height: 24rpx;
+						margin-right: 10rpx;
+						image {
+							width: 100%;
+							height: 100%;
+						}
+					}
+					
 				}
+
+				
 			}
-			
 		}
-		.list-bottom{
-			border-top: 1rpx solid #E3E3E3;
-			border-radius: 0px 0px 16rpx 56rpx;
-			background-color: #FBFBFB;
-			padding: 30rpx 0 30rpx 60rpx;
-			color: #1E9F6A;
-			font-weight: 600;
-			.listIcon{
-			    display: flex;
-				align-items: center;
-				font-size: 26rpx;
-			}
-			image{
-				width: 24rpx;
-				margin-right: 10rpx;
+
+		.travel {
+			margin: 0 60rpx;
+
+			.travelList {
+				display: flex;
+				justify-content: space-between;
+
+				image {
+					width: 48rpx;
+					height: 48rpx;
+				}
 			}
 		}
-	}
-	.travel{
-		margin:0 60rpx;
-		.travelList{
-			display: flex;
-			justify-content: space-between;
-			image{
-				width: 48rpx;
+
+		.room {
+			.title {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				border-bottom: 1px solid #E3E3E3;
+				padding: 30rpx;
+				margin: 50rpx 30rpx 30rpx;
+
+				image {
+					width: 48rpx;
+					height: 48rpx;
+				}
 			}
-		}
-	}
-	.room{
-		.title{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			border-bottom: 1px solid #E3E3E3;
-			padding: 30rpx;
-			margin: 50rpx 30rpx 30rpx;
-			image{
-				width: 48rpx;
+
+			.roomList {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				margin: 20rpx 60rpx;
+
 			}
+
+			margin-bottom:200rpx;
 		}
-		.roomList{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			margin: 20rpx 60rpx;
-			
-		}
-		margin-bottom:200rpx;
-	}
-	.navbar{
-		// margin-top: 104rpx;
-		width: 100%;
-		height: 104rpx;
-		background: #1E9F6A;
-		border-radius: 16rpx 16rpx 0px 0px;
-		position: fixed;
-		left: 0;
-		bottom: 0;
-		display: flex;
-		align-items: center;
-		.line{
-			width: 1px;
-			height: 24rpx;
-			background-color: #FFFFFF;
-		}
-		.navbar-item{
+
+		.navbar {
+			// margin-top: 104rpx;
+			width: 100%;
+			height: 104rpx;
+			background: #1E9F6A;
+			border-radius: 16rpx 16rpx 0px 0px;
+			position: fixed;
+			left: 0;
+			bottom: 0;
 			display: flex;
-			color:#FFFFFF ;
-			flex: 1;
 			align-items: center;
-			justify-content: center;
-			image{
-				height: 28rpx;
-				margin-right: 10rpx;
+
+			.line {
+				width: 1px;
+				height: 24rpx;
+				background-color: #FFFFFF;
+			}
+
+			.navbar-item {
+				display: flex;
+				color: #FFFFFF;
+				flex: 1;
+				align-items: center;
+				justify-content: center;
+				.navbariconbox{
+					height: 28rpx;
+					width: 28rpx;
+					margin-right: 10rpx;
+					image {
+						width: 100%;
+						height: 100%;
+					}
+				}
+				
 			}
 		}
-	}
 	</style>

+ 102 - 0
pages/order/successpay.vue

xqd
@@ -0,0 +1,102 @@
+<template>
+	<view class="">
+		<u-navbar
+		            title="个人中心"
+		            :safeAreaInsetTop="true"
+					leftIconSize="45"
+					:titleStyle="{'font-size':'28rpx'}"
+					
+					@leftClick="backBtn()"
+		        >
+		            
+		        </u-navbar>
+		<view class="successbox flex1">
+			<view class="flex1">
+				<view class="imgbox"><image src="../../static/success.png" mode="aspectFill"></image></view>
+				<text style="padding-top: 20rpx;">订单提交成功</text>
+			</view>
+			
+			<view class="chabtn">
+				<text class="backhome" @click="goHome">回到首页</text>
+				<text class="backhome pd" @click="goDetails">查看订单</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id:''
+			}
+		},
+		onLoad(o) {
+			if(o.id){
+				this.id=o.id
+			}
+			
+		},
+		
+		methods: {
+			backBtn(){
+				
+			},
+			goHome(){
+				uni.redirectTo({
+					url:"/pages/index/index"
+				})
+			},
+			goDetails(){
+				uni.redirectTo({
+					url:"/pages/order/orderDetails?id="+this.id
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	page{
+		font-family: PingFang-SC-Heavy, PingFang-SC;
+		background: #ffffff;
+	}
+		
+	.flex1{
+		display: flex;
+		align-items: center;
+		flex-direction: column;
+		justify-content: center;
+	}
+	.successbox{
+		background-color: #FCFCFC;
+		// margin: 20rpx;
+		// border-radius: 10rpx;
+		margin-top: 240rpx;
+		
+		.imgbox{
+			width: 120rpx;
+			height: 120rpx;
+			image{
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+	.chabtn{
+		padding-top: 120rpx;
+		display: flex;
+		.backhome{
+			display: block;
+			font-size: 30rpx;
+			color:rgba(30, 159, 106, 1) ;
+			padding: 10rpx 30rpx;
+			border: 1rpx solid rgba(30, 159, 106, 1);
+			border-radius: 30rpx;
+		}
+		.pd{
+			
+			margin-left: 100rpx;
+		}
+	}
+</style>

+ 219 - 145
pages/peopleList/addPeople.vue

xqd xqd xqd xqd xqd xqd
@@ -4,70 +4,82 @@
 		<view class="" style="margin-bottom: 20rpx;background-color: #ffffff;padding: 20rpx 0;" @click="chooseImage">
 			<u-cell :border="false" size="large" title="识别身份证信息" isLink></u-cell>
 		</view>
-		<view class="form"  style="">
+		<view class="form" style="">
 			<u--form labelPosition="left" :model="form" :rules="rules" ref="form1">
-				<u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"  labelWidth="200rpx">
-				    <u--input v-model="form.userInfo.name" border="none" placeholder="填写真实姓名" placeholderStyle="color: #555555"></u--input>
+				<u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1" labelWidth="200rpx">
+					<u--input v-model="form.userInfo.name" border="none" placeholder="填写真实姓名"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
-				<u-form-item label="性别" labelWidth="200rpx"  prop="userInfo.gender" borderBottom @click="showgender = true;" ref="item1">
+
+				<u-form-item label="性别" labelWidth="200rpx" prop="userInfo.gender" borderBottom
+					@click="showgender = true;" ref="item1">
 					<picker @change="bindPickerChange" :value="index" :range="genderArray">
 						<view class="" style="display: flex;">
-							<u--input v-model="form.userInfo.gender" disabled disabledColor="#ffffff" placeholder="选择性别" placeholderStyle="color: #555555" border="none"></u--input>
+							<u--input v-model="form.userInfo.gender" disabled disabledColor="#ffffff" placeholder="选择性别"
+								placeholderStyle="color: #555555" border="none"></u--input>
 							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
 						</view>
 					</picker>
 				</u-form-item>
-				
-				<u-form-item label="出生日期" labelWidth="200rpx"  borderBottom ref="item1">
-					 <picker  mode="date" :value="form.userInfo.birthday" start="1922-01-01" @change="bindDateChange" >
-						 <view class="" style="display: flex;">
-						 	<u--input v-model="form.userInfo.birthday" disabled disabledColor="#ffffff" placeholder="选择出生日期" placeholderStyle="color: #555555" border="none" ></u--input>
-						 	<u-icon slot="right" name="arrow-right" size="28"></u-icon>
-						 </view>
-					
-					 </picker>
+
+				<u-form-item label="出生日期" labelWidth="200rpx" borderBottom ref="item1">
+					<picker  mode="date"  :value="form.userInfo.birthday"  start="1922-01-01"  @change="bindDateChange">
+						<view class="" style="display: flex;">
+							<u--input v-model="form.userInfo.birthday" disabled disabledColor="#ffffff"
+								placeholder="选择出生日期" placeholderStyle="color: #555555" border="none"></u--input>
+							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
+						</view>
+
+					</picker>
 				</u-form-item>
-				
-				<u-form-item label="证件类型" labelWidth="200rpx"  borderBottom ref="item1" prop="userInfo.certificate_type">
+
+				<u-form-item label="证件类型" labelWidth="200rpx" borderBottom ref="item1" prop="userInfo.certificate_type">
 					<picker @change="bindType" :value="index" :range="typeArray">
 						<view class="" style="display: flex;">
-							<u--input v-model="form.userInfo.certificate_type" disabled disabledColor="#ffffff" placeholder="选择证件类型" placeholderStyle="color: #555555" border="none" ></u--input>
+							<u--input v-model="form.userInfo.certificate_type" disabled disabledColor="#ffffff"
+								placeholder="选择证件类型" placeholderStyle="color: #555555" border="none"></u--input>
 							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
 						</view>
 					</picker>
 				</u-form-item>
-				
-				<u-form-item label="证件号码" labelWidth="200rpx"  prop="userInfo.certificate_no"  borderBottom ref="item1" >
-				    <u--input v-model="form.userInfo.certificate_no" border="none" placeholder="填写证件号码" placeholderStyle="color: #555555"></u--input>
+
+				<u-form-item label="证件号码" labelWidth="200rpx" prop="userInfo.certificate_no" borderBottom ref="item1">
+					<u--input v-model="form.userInfo.certificate_no" border="none" placeholder="填写证件号码"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
-				<u-form-item label="手机号码" labelWidth="200rpx"  prop="userInfo.phone"  borderBottom ref="item1" >
-				    <u--input v-model="form.userInfo.phone" border="none" placeholder="填写手机号码" placeholderStyle="color: #555555"></u--input>
+
+				<u-form-item label="手机号码" labelWidth="200rpx" prop="userInfo.phone" borderBottom ref="item1">
+					<u--input v-model="form.userInfo.phone" border="none" placeholder="填写手机号码"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
-				<u-form-item label="紧急联系人" labelWidth="200rpx"  borderBottom ref="item1" prop="userInfo.emergency_name">
-				    <u--input v-model="form.userInfo.emergency_name" border="none"  placeholder="填写紧急联系人姓名" placeholderStyle="color: #555555"></u--input>
+
+				<u-form-item label="紧急联系人" labelWidth="200rpx" borderBottom ref="item1" prop="userInfo.emergency_name">
+					<u--input v-model="form.userInfo.emergency_name" border="none" placeholder="填写紧急联系人姓名"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
-				<u-form-item label="紧急联系人" labelWidth="200rpx"  borderBottom ref="item1" prop="userInfo.emergency_phone">
-				    <u--input v-model="form.userInfo.emergency_phone" border="none"  placeholder="填写紧急联系人号码" placeholderStyle="color: #555555"></u--input>
+
+				<u-form-item label="联系人号码" labelWidth="200rpx" borderBottom ref="item1" prop="userInfo.emergency_phone">
+					<u--input v-model="form.userInfo.emergency_phone" border="none" placeholder="填写紧急联系人号码"
+						placeholderStyle="color: #555555"></u--input>
 				</u-form-item>
-				
+
 				<u-form-item>
 					<view class="" style="margin-bottom: 20rpx;">
 						饮食禁忌
 					</view>
-				    <!-- <u-textarea v-model="form.userInfo.food_taboos" placeholder="请输入内容" placeholderStyle="color: #555555" count height=120></u-textarea> -->
-					<u--textarea v-model="form.userInfo.food_taboos" :customStyle="{'background':'#F4F4F4'}" placeholder="填写饮食禁忌" placeholderStyle="color: #555555"  height=160 border="none"></u--textarea>
+					<!-- <u-textarea v-model="form.userInfo.food_taboos" placeholder="请输入内容" placeholderStyle="color: #555555" count height=120></u-textarea> -->
+					<u--textarea v-model="form.userInfo.food_taboos" :customStyle="{'background':'#F4F4F4'}"
+						placeholder="填写饮食禁忌" placeholderStyle="color: #555555" height=160 border="none"></u--textarea>
 				</u-form-item>
-				
+
 				<u-form-item>
 					<view class="" style="margin-bottom: 20rpx;">
 						期望改善建康状况
 					</view>
-					<u--textarea v-model="form.userInfo.hope_improve" :customStyle="{'background':'#F4F4F4'}" placeholder="填写期望改善的健康状况" placeholderStyle="color: #555555"  height=160 border="none"></u--textarea>
-				    <!-- <u-textarea v-model="form.userInfo.hope_improve" placeholder="请输入内容" placeholderStyle="color: #555555" count height=120></u-textarea> -->
+					<u--textarea v-model="form.userInfo.hope_improve" :customStyle="{'background':'#F4F4F4'}"
+						placeholder="填写期望改善的健康状况" placeholderStyle="color: #555555" height=160 border="none">
+					</u--textarea>
+					<!-- <u-textarea v-model="form.userInfo.hope_improve" placeholder="请输入内容" placeholderStyle="color: #555555" count height=120></u-textarea> -->
 				</u-form-item>
 			</u--form>
 		</view>
@@ -75,40 +87,42 @@
 		<view v-if="state==0" class="navbar" @click="submit">
 			保存
 		</view>
-		
+
 		<view v-if="state==1" class="navbar" @click="add">
 			添加出行人
 		</view>
 	</view>
 </template>
 
-<script >
-	export default{
-		data(){
-			return{
+<script>
+	export default {
+		data() {
+			return {
 				// 性别选择器
 				// showgender: false,
 				// 性别选择
-				 genderArray: ['男', '女'],
-				 // 证件类型
-				 typeArray:["身份证","临时身份证","士兵证","暂住证","外交护照","普通护照","台湾居民来往大陆通行证","港澳居民来往内地通行证","港澳同胞回乡证","其他证件(包括联合国通行证 欧洲共同体护照等)"],
-				 index:0,
+				genderArray: ['男', '女'],
+				// 证件类型
+				typeArray: ["身份证", "临时身份证", "士兵证", "暂住证", "外交护照", "普通护照", "台湾居民来往大陆通行证", "港澳居民来往内地通行证", "港澳同胞回乡证",
+					"其他证件(包括联合国通行证 欧洲共同体护照等)"
+				],
+				index: 0,
 				form: {
 					userInfo: {
-					name: '',
-					gender: '',
-					birthday:"",
-					certificate_type:'',
-					phone:"",
-					certificate_no:'',
-					// 联系人姓名
-					emergency_name:"",
-					// 联系人电话
-					emergency_phone:'',
-					// 饮食禁忌
-					food_taboos:'',
-					// 健康状况
-					hope_improve:''
+						name: '',
+						gender: '',
+						birthday: "",
+						certificate_type: '',
+						phone: "",
+						certificate_no: '',
+						// 联系人姓名
+						emergency_name: "",
+						// 联系人电话
+						emergency_phone: '',
+						// 饮食禁忌
+						food_taboos: '',
+						// 健康状况
+						hope_improve: ''
 					},
 				},
 				rules: {
@@ -125,33 +139,33 @@
 						message: '请选择男或女',
 						trigger: ['blur', 'change']
 					},
-					"userInfo.certificate_no":{
+					"userInfo.certificate_no": {
 						type: 'string',
 						len: 18,
 						required: true,
 						message: '请填写正确的证件号',
 						trigger: ['blur']
 					},
-					"userInfo.certificate_type":{
+					"userInfo.certificate_type": {
 						type: 'string',
 						required: true,
 						message: '请填写证件类型',
 						trigger: ['blur', 'change']
 					},
-					"userInfo.phone":{
+					"userInfo.phone": {
 						type: 'string',
 						required: true,
 						len: 11,
 						message: '请输入手机号码',
 						trigger: ['blur', 'change']
 					},
-					"userInfo.emergency_name":{
+					"userInfo.emergency_name": {
 						type: 'string',
 						required: true,
 						message: '请填写紧急人姓名',
 						trigger: ['blur']
 					},
-					"userInfo.emergency_phone":{
+					"userInfo.emergency_phone": {
 						type: 'number',
 						required: true,
 						len: 11,
@@ -162,134 +176,191 @@
 				radio: '',
 				switchVal: false,
 				// 修改 与 添加状态
-				state:1,
-				id:0
+				state: 1,
+				id: 0
 			}
 		},
 		onLoad(options) {
-			// console.log(options.info)
-			let info=JSON.parse(options.info)
-			if(info.gender==1){
-				info.gender="男"
-			}else if(info.gender==2){
-				info.gender=="女"
+			if (options.info) {
+				let info = JSON.parse(options.info)
+				if (info.gender == 1) {
+					info.gender = "男"
+				}
+				if (info.gender == 2) {
+					info.gender = "女"
+				}
+				this.id = info.id
+				this.form.userInfo = info
+				this.form.userInfo.certificate_type = info.certificate_type_text
+				this.state = options.state
 			}
-			this.id=info.id
-			this.form.userInfo=info
-			this.form.userInfo.certificate_type=info.certificate_type_text
-			this.state=options.state
-			console.log(this.state)
+
 		},
-		methods:{
+		methods: {
 			// 识别身份证
-			chooseImage(e){
+			chooseImage(e) {
 				uni.chooseImage({
-						count: 1,
-						sizeType: ['original',"compressed "],
-						sourceType: ['album',"camera"], //从相册选取
+					count: 1,
+					sizeType: ['original', "compressed "],
+					sourceType: ['album', "camera"], //从相册选取
+					success: (res) => {
+						console.log(res);
+						let url = res.tempFilePaths[0]
+						console.log(res)
+						this.uploadFilePromise(url)
+						
+
+						// }
+						// uni.$u.http.post('/api/card/info', {
+						// 	url
+						// }, {
+						// 	custom: {
+						// 		auth: true
+						// 	}
+						// }).then((res) => {
+						// 	console.log(res)
+
+						// }).catch((err) => {
+						// 	console.log(err)
+						// })
+
+
+
+
+					}
+				})
+			},
+			uploadFilePromise(url) {
+				let token = uni.getStorageSync("token")
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: 'https://t38.9026.com/api/common/upload',
+						filePath: url,
+						name: 'file',
+						header: {
+							Authorization: `Bearer ${token}`
+						},
+						formData: {
+							user: 'test'
+						},
 						success: (res) => {
-							console.log(res);
-							  let   url=res.tempFilePaths[0]
-							uni.$u.http.post('/api/card/info',{url},{
-								custom: {
-									auth: true
-								}
-							}).then((res) => {
-								console.log(res)
+							console.log(res,8888)
+							let ayu=JSON.parse(res.data)
+							if(ayu.code==401){
+								this.$toast("请先登录")
+								setTimeout(()=>{
+									uni.navigateTo({
+										url:'/pages/login'
+									})
+								})
+							}else if(ayu.code==200){
+								uni.$u.http.post('/api/card/upload', {
+									file:ayu.data.url
+								}, {
+									custom: {
+										auth: true
+									}
+								}).then((res) => {
+									console.log(res)
 								
-							}).catch((err) => {
-								console.log( err)
-							})
+								}).catch((err) => {
+									console.log(err)
+								})
+							}
+							
 							
 						}
-					})
+					});
+				})
 			},
 			// 选择性别
 			bindPickerChange(e) {
-			    console.log('picker发送选择改变,携带值为', e.detail.value)
+				console.log('picker发送选择改变,携带值为', e.detail.value)
 				console.log(this.genderArray[e.detail.value])
-			   this.form.userInfo.gender=this.genderArray[e.detail.value]
+				this.form.userInfo.gender = this.genderArray[e.detail.value]
 			},
 			// 选择护照类型
 			bindType(e) {
-			   this.form.userInfo.certificate_type=this.typeArray[e.detail.value]
+				this.form.userInfo.certificate_type = this.typeArray[e.detail.value]
 			},
 			// 选择出生日期
-			bindDateChange (e) {
-			    console.log(e)
-			    this.form.userInfo.birthday  = e.detail.value
+			bindDateChange(e) {
+				console.log(e)
+				this.form.userInfo.birthday = e.detail.value
 			},
 			// 修改出行人
-			submit(){
-				let form=JSON.parse(JSON.stringify(this.form.userInfo))
+			submit() {
+				let form = JSON.parse(JSON.stringify(this.form.userInfo))
 				// form=this.form.userInfo
 				console.log(form)
-				if(form.gender=="男"){
-					form.gender=1
-				}else if(form.gender=="女"){
-					form.gender=2
+				if (form.gender == "男") {
+					form.gender = 1
+					form.gender_text = "男"
+				} else if (form.gender == "女") {
+					form.gender = 2
+					form.gender_text = "女"
 				}
-				if(form.certificate_type=="身份证"){
-					form.certificate_type=1
+				if (form.certificate_type == "身份证") {
+					form.certificate_type = 1
 				}
-				form.id=this.id
-				uni.$u.http.post('/api/traveler/edit',form,{
+				form.id = this.id
+				uni.$u.http.post('/api/traveler/edit', form, {
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
 					// this.$store.commit("getpeopleList",res)
 					uni.showToast({
-						icon:"success",
-						title:"修改成功",
+						icon: "success",
+						title: "修改成功",
 					})
-					setTimeout(()=>{
+					setTimeout(() => {
 						uni.navigateBack({
-							delta:1
+							delta: 1
 						})
-					},1500)
-				
+					}, 1500)
+
 				}).catch((err) => {
-					
+
 				})
 			},
 			// 添加出行人
-			add(){
-				console.log(this.$store.state.token,"xxxxxxxxxxx")
-				let form=JSON.parse(JSON.stringify(this.form.userInfo))
+			add() {
+				console.log(this.$store.state.token, "xxxxxxxxxxx")
+				let form = JSON.parse(JSON.stringify(this.form.userInfo))
 				// form=this.form.userInfo
 				console.log(form)
-				if(form.gender=="男"){
-					form.gender=1
-				}else if(form.gender=="女"){
-					form.gender=2
+				if (form.gender == "男") {
+					form.gender = 1
+				} else if (form.gender == "女") {
+					form.gender = 2
 				}
-				if(form.certificate_type=="身份证"){
-					form.certificate_type=1
+				if (form.certificate_type == "身份证") {
+					form.certificate_type = 1
 				}
-				
-				
-				uni.$u.http.post('/api/traveler/add',form,{
+
+
+				uni.$u.http.post('/api/traveler/add', form, {
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
 					// console.log(res)
-				uni.showToast({
-					icon:"success",
-					title:"添加成功",
-				})
-				setTimeout(()=>{
-					uni.navigateBack({
-						delta:1
+					uni.showToast({
+						icon: "success",
+						title: "添加成功",
 					})
-				},1500)
-				
+					setTimeout(() => {
+						uni.navigateBack({
+							delta: 1
+						})
+					}, 1500)
+
 				}).catch((err) => {
-					console.log( err)
+					console.log(err)
 					uni.showToast({
-						icon:"error",
-						title:err.message,
+						icon: "error",
+						title: err.message,
 					})
 				})
 			}
@@ -298,16 +369,18 @@
 </script>
 
 <style lang="less">
-	page{
+	page {
 		background-color: #F4F4F4;
 		font-size: 30rpx;
 	}
-	.form{
+
+	.form {
 		background-color: #ffffff;
 		padding: 30rpx;
 		margin-bottom: 144rpx;
 	}
-	.navbar{
+
+	.navbar {
 		width: 100%;
 		color: #FFFFFF;
 		height: 104rpx;
@@ -316,7 +389,8 @@
 		text-align: center;
 		line-height: 104rpx;
 		position: fixed;
-		left: 0;bottom: 0;
+		left: 0;
+		bottom: 0;
 		z-index: 999;
 	}
 </style>

+ 134 - 84
pages/peopleList/peopleList.vue

xqd xqd xqd xqd xqd xqd
@@ -1,27 +1,34 @@
 <template>
 	<view class="addpeople">
-		<view class="list" >
+		<view class="list">
 			<!-- <u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange" shape="circle" size=32> -->
-				<view class="list-item" v-for="(item, index) in checkboxList" :key="index">
-					<!-- <u-checkbox v-if="peopelList" iconSize=32 style="padding: 0 100rpx;" :name="item"  activeColor="#1E9F6A"></u-checkbox> -->
-						<radio  v-if="peopelList" color="#1E9F6A" style="font-size: 26rpx;" :checked="item.checked"  :value="index" @click="checkbox(index)"></radio >
-					<view class="" style="margin:0 64rpx 0 32rpx;width: 70rpx;">
-						{{item.name}}
-					</view>
-					<view class="" >
-						{{item.phone}}
-					</view>
-					<view class="image" style="flex: 1;text-align: right;align-items: center;" >
-						<text class="" style="font-size: 28rpx;color: #1E9F6A;border-right: 1rpx solid #1E9F6A;padding-right: 30rpx;margin-right: 30rpx;" @click="dele(item.id)">
-							删除
-						</text>
-						<image src="../../static/editIcon.png" mode="widthFix" @click="edit(item)"></image>
-						<!-- <image src="../../static/editIcon.png" mode="widthFix"></image> -->
-					</view>
+			<view class="list-item" v-for="(item, index) in checkboxList" :key="index">
+				<!-- <u-checkbox v-if="peopelList" iconSize=32 style="padding: 0 100rpx;" :name="item"  activeColor="#1E9F6A"></u-checkbox> -->
+				<radio v-if="peopelList" color="#1E9F6A" style="font-size: 26rpx;" :checked="item.checked"
+					:value="index" @click="checkbox(index)"></radio>
+				<view class="" style="margin:0 64rpx 0 32rpx;width:100rpx;">
+					{{item.name}}
 				</view>
+				<view class="">
+					{{item.phone}}
+				</view>
+				<view class="image" style="flex: 1;text-align: right;align-items: center;">
+					<text class=""
+						style="font-size: 28rpx;color: #1E9F6A;border-right: 1rpx solid #1E9F6A;padding-right: 30rpx;margin-right: 30rpx;"
+						@click="dele(item.id)">
+						删除
+					</text>
+					<image src="../../static/editIcon.png" mode="widthFix" @click="edit(item)"></image>
+					<!-- <image src="../../static/editIcon.png" mode="widthFix"></image> -->
+				</view>
+			</view>
 			<!-- </u-checkbox-group> -->
 		</view>
-		<u-loadmore v-if="checkboxList.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无出行人"/>
+		
+		<view style="margin-top: 140rpx;">
+			<u-loadmore v-if="checkboxList.length==0" :status="nomore" fontSize="30" :line="true" nomoreText="暂无出行人" />
+		</view>
+
 		<view class="navbar">
 			<view class="navbar-item" @click="addpeople">
 				+ 新增出行人
@@ -35,32 +42,38 @@
 
 <script>
 	// import peopelInfo from "../components/peopleInfo.vue"
-	export default{
-		data(){
-			return{
+	export default {
+		data() {
+			return {
 				// 选择列表
-				peopelList:false,
+				peopelList: false,
 				//出行人表单显示隐藏
-				peopelInfoShow:1,
+				peopelInfoShow: 1,
 				// 出行人选择
-				 checkboxValue1:[],
+				checkboxValue1: [],
 				// 出行人列表
 				checkboxList: [
 					// {name: '吴某某',disabled: false,number:"1568945752"},
 					// {name: '吴某某',disabled: false,number:"1568945752"},
-			    ],
+				],
+				value: 0,
+				getpeopleList: [],
+				defaultIndex: ''
 			}
 		},
-		components:{
+		components: {
 			// peopelInfo
 		},
-		
+
 		onLoad(options) {
 			// console.log(options)
-			if(options.id==0){
-				this.peopelList=false
-			}else{
-				this.peopelList=true
+			if (options.id == 0) {
+				this.peopelList = false
+			} else {
+				this.peopelList = true
+			}
+			if (options.value) {
+				this.value = options.value
 			}
 			// uni.showLoading({
 			// 	title: '加载中'
@@ -68,19 +81,19 @@
 			this.init()
 		},
 		onShow() {
-			let token=uni.getStorageSync("token")
+			let token = uni.getStorageSync("token")
 			if (!token) {
 				//未登录
 				uni.showToast({
 					title: "请先登录",
 					icon: 'none'
 				})
-				setTimeout(()=>{
-					uni.navigateBack({
-						delta:1
+				setTimeout(() => {
+					uni.navigateTo({
+						url: "/pages/login"
 					})
-				},1500)
-				
+				}, 1500)
+
 				return false
 			}
 			uni.showLoading({
@@ -88,25 +101,26 @@
 			});
 			this.init()
 		},
-		methods:{
-			init(){
-				uni.$u.http.post('/api/traveler/list',{
+		methods: {
+			init() {
+				uni.$u.http.post('/api/traveler/list', {
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
 					// console.log(res)
-					this.checkboxList=res
+					this.checkboxList = res
 					// this.$store.commit("getlist",res)
-					let nawarr=this.checkboxList
-					nawarr.forEach(item=>{
-						item.checked=false
+					let nawarr = this.checkboxList
+					nawarr.forEach(item => {
+						item.checked = false
+						item.default=false
 					})
-					this.checkboxList=nawarr
+					this.checkboxList = nawarr
 					uni.hideLoading();
-					// console.log(this.checkboxList)
+
 				}).catch((err) => {
-					console.log( err)
+					console.log(err)
 				})
 			},
 			// // 选择
@@ -114,82 +128,116 @@
 			//      console.log('change', e);
 			// },
 			// 选择
-			 checkbox(index) {
-			    let data=this.checkboxList
-			    if (data[index].checked) {
-			         data[index].checked = false;
-			    }else {
-			         data[index].checked = true;
-			    }
-			    this.checkboxList=JSON.parse(JSON.stringify(data))
-				let newarr=this.checkboxList
-				let arr=[]
-				newarr.forEach(item=>{
-					if(item.checked){
+			checkbox(index) {
+
+				let data = this.checkboxList
+				if (data[index].checked) {
+					data[index].checked = false;
+				} else {
+					data[index].checked = true;
+				}
+				this.checkboxList = JSON.parse(JSON.stringify(data))
+				let newarr = this.checkboxList
+				let arr = []
+				newarr.forEach(item => {
+					if (item.checked) {
 						arr.push(item)
 					}
 				})
+				this.getpeopleList = arr
+				if (this.getpeopleList.length > this.value) {
+					this.$toast('只能选择' + this.value + '人')
+					this.defaultIndex = index
+					// return
+				}
+				console.log(this.getpeopleList, 888)
 				this.$store.commit('getpeopleList', arr)
 			},
 			// 确定添加联系人
-			surePeople(){
+			surePeople() {
 				uni.navigateBack({
 					delta: 1
 				});
 			},
 			// 查看出行人
-			edit(item){
-				let info=JSON.stringify(item)
+			edit(item) {
+				let info = JSON.stringify(item)
 				uni.navigateTo({
-					url:`/pages/peopleList/addPeople?info=${info}&state=0`
+					url: `/pages/peopleList/addPeople?info=${info}&state=0`
 				})
 			},
 			// 删除出行人
-			dele(id){
-				uni.$u.http.post('/api/traveler/delete',{id},{
-					custom: {
-						auth: true
+			dele(id) {
+				uni.showModal({
+					title: "提示",
+					content: "确认删除吗?",
+					success: (res) => {
+						if (res.confirm) {
+							this.$showLoadding("删除中")
+							uni.$u.http.post('/api/traveler/delete', {
+								id
+							}, {
+								custom: {
+									auth: true
+								}
+							}).then((res) => {
+								uni.hideLoading()
+								this.$toast("删除成功")
+								this.init()
+							}).catch((err) => {
+								console.log(err)
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
 					}
-				}).then((res) => {
-					this.init()
-					
-				}).catch((err) => {
-					console.log( err)
 				})
 			},
 			// 添加出行人
-			addpeople(){
+			addpeople() {
 				uni.navigateTo({
-					url:"/pages/peopleList/addPeople?state=1"
+					url: "/pages/peopleList/addPeople?state=1"
 				})
 			}
 		}
 	}
 </script>
 
-<style lang="less">
-	.u-cell__body--large.data-v-913eaa32{
+<style lang="scss">
+	.u-cell__body--large.data-v-913eaa32 {
 		padding: 48rpx 0 !important;
 		box-sizing: border-box;
 	}
-	page{
+
+	page {
 		font-size: 32rpx;
 	}
-	.list{
+
+	.list {
+
 		// margin: 50rpx 30rpx;
-		.list-item{
+		.list-item {
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
-			image{
+
+			image {
 				width: 36rpx;
+				height: 36rpx;
 				margin-bottom: 0;
 			}
-			border-bottom: 1rpx solid #E3E3E3;
+
+			border-top: 1rpx solid #E3E3E3;
 			padding: 30rpx;
+
+			&:first-child {
+				border-top: none
+			}
 		}
+
 	}
-	.navbar{
+
+	.navbar {
 		width: 100%;
 		height: 104rpx;
 		line-height: 104rpx;
@@ -198,12 +246,14 @@
 		position: fixed;
 		left: 0;
 		bottom: 0;
-		.navbar-item{
+
+		.navbar-item {
 			// width: 50%;
 			flex: 1;
 			text-align: center;
 		}
-		.sure{
+
+		.sure {
 			background: #1E9F6A;
 			border-radius: 0px 16rpx 0px 0px;
 			color: #FFFFFF;

+ 14 - 11
pages/travel.vue

xqd xqd xqd xqd xqd xqd
@@ -4,7 +4,7 @@
 			:poster="imgUrl"></u-swiper>
 		<u-sticky bgColor="#fff">
 			<view class="tags">
-				<u-tabs :list="list" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"  lineColor="#1E9F6A" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" :is-scroll="true"  lineWidth="80"  @change="chooseTitle">
+				<u-tabs :list="list" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"  lineColor="#1E9F6A" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" :is-scroll="true"  lineWidth="55"  @change="chooseTitle">
 				</u-tabs>
 			</view>
 		</u-sticky>
@@ -27,6 +27,7 @@
 				<!-- 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松。 -->
 			</view>
 		</view>
+		<view class="paddingsafe"></view>
 	</view>
 
 </template>
@@ -56,15 +57,18 @@
 			init() {
 				let userinfo=this.$store.state.userinfo
 				// 获取轮播图
-				let swiper=uni.getStorageSync("data")
-				//this.swiper=swiper[9].value
-				// 套餐主题
+
+				let home=uni.getStorageSync("home")
+				home.images.forEach(item=>{
+					this.swiper.push(item.url)
+				})
+
 				uni.$u.http.post('/api/category/list',userinfo,{
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
-					console.log(res)
+					// console.log(res)
 					this.list=res
 				}).catch((err) => {
 					console.log( err)
@@ -79,17 +83,17 @@
 						auth: true
 					}
 				}).then((res) => {
-					console.log(res.data)
+					// console.log(res.data)
 					this.listArr=res.data
 					this.list2=res.data.picture
-					console.log(res.data[0].picture,"详情图")
+					// console.log(res.data[0].picture,"详情图")
 				}).catch((err) => {
 					console.log( err)
 				})
 			},
 			// 切换标签
 			chooseTitle(e){
-				console.log(e)
+				// console.log(e)
 				this.lineWidth=e.rect.width
 				uni.$u.http.post('/api/good/index',{
 					category_id:e.id,
@@ -100,7 +104,7 @@
 						auth: true
 					}
 				}).then((res) => {
-					console.log(res.data)
+					// console.log(res.data)
 					this.listArr=res.data
 				}).catch((err) => {
 					console.log( err)
@@ -136,11 +140,10 @@
 			font-size: 28rpx;
 			font-family: PingFang-SC-Medium, PingFang-SC;
 			font-weight: 500;
-			;
 			margin: 40rpx 0rpx;
 			background-color: #fff;
 			border-radius: 30rpx;
-			background: #FFFFFF;
+			// background: #FFFFFF;
 			box-shadow: 0px 8rpx 14rpx 0rpx rgba(0, 21, 3, 0.05);
 			border-radius: 0px 0px 16rpx 100rpx;
 

+ 25 - 23
pages/travel/contract.vue

xqd xqd
@@ -1,29 +1,26 @@
 <template>
-	<view class="">
-		
-		<view class="content">
-			<view class="title">
-				旅游合同
-			</view>
-			  甲方:________旅行社(或公司)________________</br>
-			  地址:____________________ 邮码:___________电话:___________</br>
-			  法定代表人:________________职务:________________</br>
-			  乙方:姓名(或团体名称)________________________</br>
-			  地址:____________________ 邮码:___________电话:___________</br>
-			  根据国家有关旅游事业管理的规定,甲乙双方经协商一致,签订本合同,共同信守执行。</br>
-			  由甲方在__年__月__日至__年__月__日为乙方提供旅游服务。</br>
-			  甲方为乙方提供的旅游景点为 个。分别是________、________、________。</br>
-			  每天的时间安排为上午________时至________时,下午________时至________时。</br>
-			  甲方为乙方提供食宿,每天伙食在________元至________元标准内。</br>
-			  甲方为乙方提供导游服务,服务内容:____________________。</br>
-			  3.甲方应按本合同规定为乙方提供优质的服务。在旅游期间,甲方应派医务人员、保安人员等随行,以保证本次旅游的顺利进行。</br>
-			  4.甲方不得擅自变更或解除合同,否则按约定赔偿乙方损失额________元。</br>
-			  5.由于甲方的原因导致乙方受到财产损失和人身伤害的,甲方负赔偿责任。如因第三人的过错造成损失的,甲方在赔偿后,有权向第三人追偿。</br>
-		</view>
+	<view class="content">
+		<image :src="content" mode="widthFix"></image>
 	</view>
 </template>
 
 <script>
+	export default{
+		data(){
+			return{
+				content:''
+			}
+		},
+		onLoad() {
+			this.init()
+		},
+		methods:{
+			init(){
+				let data=uni.getStorageSync("data")
+				this.content=data[7].value
+			}
+		}
+	}
 </script>
 
 <style lang="less">
@@ -33,8 +30,13 @@
 	.content{
 		background-color: #fff;
 		padding: 20rpx;
-		margin:0 20rpx;
-		height: 100%vh;
+		// margin:0 20rpx;
+		height: 100%;
+		width: 100%;
+		image{
+			width: 100%;
+			height: 100%;
+		}
 		.title{
 			text-align: center;
 		}

+ 67 - 13
pages/travel/poster.vue

xqd xqd xqd xqd xqd
@@ -2,30 +2,36 @@
 	<view class="">
 		<view class="content">
 			<view class="poster">
-				<image src="https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png"  mode="widthFix"></image>
+				<image src="https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png"  mode="aspectFill"></image>
 				<view class="code">
-					<image src="../../static/travelD/code.png" mode="widthFix"></image>
+					<image src="../../static/travelD/code.png" mode="aspectFill"></image>
 				</view>
 			</view>
 			
 			<view class="title">
-				<view class="">
-					夕阳红康养团
+				<view class="kangyang">
+					<text>
+						{{goodsInfo.name}}
+					</text>
+					
 				</view>
 				<view class="">
-					¥668/人起
+					¥{{goodsInfo.min_price}}/人起
 				</view>
 			</view>
 			<view class="" style="font-size: 22rpx;color: #666666;">
-				2022-05-06
+				{{created_at}}
 			</view>
 		</view>
 		<view class="flex">
 			<view class="weix">
-				<image src="../../static/travelD/wxin.png"  mode="widthFix"></image>
-				<view class="text">
-					分享
-				</view>
+				<button type="default" open-type="share" style="background-color: transparent;border-style:none;border:0;padding: 0;line-height: 30rpx;">
+					<image src="../../static/travelD/wxin.png"  mode="widthFix"></image>
+					<view class="text">
+						分享
+					</view>
+				</button>
+				
 			</view>
 			<view class="xiangc">
 				<image src="../../static/travelD/album.png" mode="widthFix"></image>
@@ -34,10 +40,46 @@
 				</view>
 			</view>
 		</view>
+		<view class="paddingsafe"></view>
 	</view>
 </template>
 
 <script>
+	export default {
+		data(){
+			return{
+			goodsInfo:null
+			}
+		},
+		// #ifdef MP
+		onShareAppMessage(s= false){
+		    return this.$shareAppMessage({
+		        title: this.goodsInfo.name,
+		        imageUrl:"",
+		        path: "/pages/travel/travelDetails?id="+this.id,
+		       
+		    });
+		},
+		// #endif
+		onLoad(o) {
+			if(o.goodsInfo){
+				let goodsInfo = decodeURIComponent(o.goodsInfo)
+				this.goodsInfo = JSON.parse(goodsInfo)
+			}
+		},
+		computed:{
+			created_at(){
+				let created_at=''
+				if(this.goodsInfo.created_at){
+					created_at=this.goodsInfo.created_at.slice(0,10)
+				}
+				return created_at
+			}
+		},
+		methods:{
+			
+		}
+	}
 </script>
 
 <style lang="less">
@@ -51,7 +93,8 @@
 		margin: 24rpx 58rpx 0;
 		padding: 24rpx 24rpx 40rpx;
 		image{
-			// width: 596rpx;
+			width: 596rpx;
+			height: 874rpx;
 			width: 100%;
 			border-radius: 8rpx 20rpx 8rpx 0;
 		}
@@ -64,16 +107,22 @@
 			bottom: 41rpx;
 			image{
 				width: 120rpx;
+				height: 120rpx;
 			}
 		}
 		.title{
 			display: flex;
 			justify-content: space-between;
-			align-items: center;
+			// align-items: center;
 			font-size: 30rpx;
 			font-weight: 600;
 			color: #333333;
 			margin: 32rpx 0 16rpx;
+			.kangyang{
+				word-break:break-all;//英文
+				// padding-right: 20rpx;
+				width: 400rpx;
+			}
 		}
 	}
 	.flex{
@@ -91,13 +140,18 @@
 			margin: 30rpx 0;
 		}
 		.weix{
+			button::after {
+					border: none;
+				}
 			image{
-				width: 81rpx;
+				width: 74rpx;
+				height: 74rpx;
 			}
 		}
 		.xiangc{
 			image{
 				width: 74rpx;
+				height: 74rpx;
 			}
 		}
 	}

+ 80 - 52
pages/travel/submitOrder.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -2,51 +2,55 @@
 	<view class="">
 		<view class="top">
 			<view class="image">
-				<image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png" ></image>
+				<image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png"></image>
 			</view>
 			<view class="">
 				<view class="" style="font-size: 32rpx;font-weight: 600;">
 					{{suborder.name}}
 				</view>
 				<view class="" style="font-size: 28rpx;margin-top: 20rpx;">
-						日期:{{suborder.day}}
-				</view>			
+					日期:{{suborder.day}}
+				</view>
 			</view>
 		</view>
 		<view class="" style="padding: 0 30rpx;color: #666666;">
 			<!-- 夕阳红康养团是为中老年特别定制的康养方案这个团 非常好 -->
 			{{suborder.subtitle}}
 		</view>
-		
+
 		<view class="suborder">
 			<view class="name">
 				出行人姓名:<text v-for="(item,index) in peoplelist" :key="index" style="margin: 0 10rpx;">{{item}}</text>
 			</view>
 			<view class="contract">
 				<u-cell-group>
-					<u-cell title="合同预览" isLink url="./contract" :titleStyle="{'font-weight': 'bold'}" size="large"></u-cell>
+					<u-cell title="合同预览" isLink url="./contract" :titleStyle="{'font-weight': 'bold'}" size="large">
+					</u-cell>
 				</u-cell-group>
 			</view>
 			<view class="checkbox">
-				<u-checkbox-group v-model="agree" size="32" iconPlacement="right" placement="row">
-					<u-checkbox activeColor="#31866F" inactiveColor="#0A243F"></u-checkbox>
+				<u-checkbox-group v-model="agree" size="32" iconPlacement="right" placement="row"
+					>
+					<u-checkbox activeColor="#31866F" inactiveColor="#0A243F" :name="item.name" :checked="checked" @change="checked=!checked"></u-checkbox>
 				</u-checkbox-group>
 				<view class="text">
-					我已阅读并同意报名须知 <text style="text-decoration: underline;padding: 6rpx;" @click="notification">安全告知 </text> 和
+					我已阅读并同意报名须知 <text style="text-decoration: underline;padding: 6rpx;" @click="notification">安全告知
+					</text> 和
 					<text style="text-decoration: underline;padding: 6rpx;" @click="Policy">隐私政策</text>
 				</view>
 			</view>
 			<view class="time">
-				<view>订单支付倒计时:</view><u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
+				<view>订单支付倒计时:</view>
+				<u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
 			</view>
 		</view>
-		
-	
+
+
 		<view class="navbar">
-		    <view class="navbar-item">
-				总金额  ¥12929
+			<view class="navbar-item">
+				总金额 ¥{{suborder.total}}
 			</view>
-			<view class="navbar-item want" @click="Submit"  >
+			<view class="navbar-item want" @click="Submit">
 				去支付
 			</view>
 		</view>
@@ -54,32 +58,35 @@
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
-				suborder:{},
-				peoplelist:[]
+	let that
+	export default {
+		data() {
+			return {
+				suborder: {},
+				peoplelist: [],
+				checked:false
 			}
 		},
 		onLoad(options) {
+			that=this
 			// JSON.parse(val.content);
 			// console.log(options.suborder)
-			let suborder=JSON.parse(options.suborder)
+			let suborder = JSON.parse(options.suborder)
 			// this.init(suborder)
-			this.suborder=suborder
+			this.suborder = suborder
 			console.log(suborder)
-			this.suborder.people.forEach((item,index)=>{
+			this.suborder.people.forEach((item, index) => {
 				this.peoplelist.push(item)
 			})
-			
+
 		},
-	
+
 		// onShow() {
 		// 	const pages= getCurrentPages();//获取应用页面栈
 		// 	let aaa= pages[pages.length - 1].options//获取页面传递的信息
 		// 	console.log(aaa)
 		// },
-		methods:{
+		methods: {
 			// init(val){
 			// 	this.suborder=val
 			// 	let list=[]
@@ -87,14 +94,18 @@
 			// 		list.push(item.name)
 			// 	})
 			// 	this.peoplelist=list
-				
+
 			// },
-			gocontract(){
+			checkboxChange(n) {
+				console.log('change', n);
+			},
+			gocontract() {
 				uni.navigateTo({
-					url:"./contract"
+					url: "./contract"
 				})
 			},
 			// 支付
+
 			Submit(){
 				uni.$u.http.post('/api/order/config',{
 					order_id:this.suborder.order_id,
@@ -110,6 +121,9 @@
 				     success: function (res) {
 				         // console.log('success:' + JSON.stringify(res));
 				         console.log("支付成功");
+						 uni.navigateTo({
+						 	url:"/pages/order/successpay?id="+that.suborder.order_id
+						 })
 				     },
 				     fail: function (err) {
 				         console.log('fail:' + JSON.stringify(err));
@@ -125,14 +139,14 @@
 					})
 				})
 			},
-			notification(){
+			notification() {
 				uni.navigateTo({
-					url:"/pages/userCenter/notification"
+					url: "/pages/userCenter/notification"
 				})
 			},
-			Policy(){
+			Policy() {
 				uni.navigateTo({
-					url:"/pages/userCenter/Policy"
+					url: "/pages/userCenter/Policy"
 				})
 			}
 		}
@@ -140,56 +154,67 @@
 </script>
 
 <style lang="less">
-	.u-cell__body--large.data-v-913eaa32{
+	.u-cell__body--large.data-v-913eaa32 {
 		padding: 48rpx 0 !important;
 		box-sizing: border-box;
 	}
-	page{
+
+	page {
 		background-color: #F4F4F4;
 		font-size: 30rpx;
 	}
-	.checkbox{
+
+	.checkbox {
 		display: flex;
 		padding: 30rpx;
-		.text{
+
+		.text {
 			margin-left: 10rpx;
 			font-size: 26rpx;
 		}
 	}
-	.top{
-		
+
+	.top {
+
 		margin-top: 32rpx;
-		padding:10rpx 30rpx;
+		padding: 10rpx 30rpx;
 		display: flex;
 		align-items: center;
 		align-items: center;
 		margin-bottom: 20rpx;
-		.image{
+
+		.image {
 			margin-right: 20rpx;
-			image{
+
+			image {
 				width: 180rpx;
 				height: 110rpx;
 			}
 		}
 	}
-	.suborder{
+
+	.suborder {
 		position: relative;
 		margin-top: 30rpx;
 		padding: 48rpx 30rpx;
 		background-color: #fff;
 		border-radius: 0px 56rpx 0px 0px;
-		height:calc(100vh - 323rpx);
+		height: calc(100vh - 323rpx);
 		box-sizing: border-box;
-		.name{
+
+		.name {
 			// padding: 30rpx;
 			margin-bottom: 48rpx;
 		}
-		.contract{
+
+		.contract {
 			margin-top: 50rpx;
 		}
-		.time{
+
+		.time {
 			position: absolute;
-			left: 0;bottom: 75rpx;
+			left: 0;
+			bottom: 75rpx;
 			width: 100%;
 			background-color: #F4F4F4;
 			border-radius: 16rpx 16rpx 0px 0px;
@@ -197,8 +222,9 @@
 			padding: 24rpx 0rpx 24rpx 30rpx;
 		}
 	}
-	.navbar{
-		margin-top:104rpx;
+
+	.navbar {
+		margin-top: 104rpx;
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
@@ -210,11 +236,13 @@
 		background: #1E9F6A;
 		border-radius: 16rpx 16rpx 0px 0px;
 		color: #ffffff;
-		.navbar-item{
+
+		.navbar-item {
 			width: 50%;
 			text-align: center;
-		}	
-		.want{
+		}
+
+		.want {
 			border-left: 1rpx solid #FFFFFF;
 		}
 	}

+ 472 - 344
pages/travel/travelDetails.vue

xqd xqd
@@ -1,90 +1,106 @@
 <template>
 	<view class="detailsPage">
-		 <u-swiper height=900 :list="list2" keyName="image" showTitle :autoplay="false" circular autoplay></u-swiper>
-		 <view class="details">
-			 <view class="title flex-item">
-			 	<view class="">
-			 		{{goodsInfo.name}}
+		<u-swiper height=900 :list="list2" keyName="image" showTitle :autoplay="false" circular autoplay></u-swiper>
+		<view class="details">
+			<view class="title flex-item">
+				<view class="">
+					{{goodsInfo.name?goodsInfo.name:''}}
 					<!-- 深林康养 -->
-			 	</view>
-			 	<view >
-			 		¥{{goodsInfo.min_price}}
+				</view>
+				<view>
+					¥{{minprice}}
 					<!-- ¥300 -->
-			 	</view>
-			 </view>
-		 	
+				</view>
+			</view>
+
 			<view class="describe">
-		 		{{goodsInfo.subtitle}}
+				{{goodsInfo.subtitle?goodsInfo.subtitle:''}}
 				<!-- 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松 -->
-		 	</view>
-			<view class="flex" >
+			</view>
+			<view class="flex">
 				<view class="tags" v-for="item in tags">
-                    {{item}}
+					{{item}}
 				</view>
 				<!-- <view class="tags">
 					康养
 				</view> -->
 			</view>
-		 </view>
-		
-		  <view class="detailsContent">
-			  <u-sticky bgColor="#fff">
-			 <view class="" style="box-shadow: 0px 2rpx 8rpx 0px rgba(0, 0, 0, 0.06);">
-			 	
-			 	   <u-tabs :list="list1"  :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=50 :scrollable="false" @click="check"></u-tabs>
-			 	 
-			 </view>
-			 </u-sticky>
-		  	<view class="detailsList" >
-				
+		</view>
+
+		<view class="detailsContent">
+			<u-sticky bgColor="#fff">
+				<view class="" style="box-shadow: 0px 2rpx 8rpx 0px rgba(0, 0, 0, 0.06);">
+
+					<u-tabs :list="list1" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"
+						:inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=50
+						:scrollable="false" @click="check"></u-tabs>
+
+				</view>
+			</u-sticky>
+			<view class="detailsList">
+
 				<!-- {{goodsInfo.description}} -->
-		  		<view class="duction list-item">
+				<view class="duction list-item">
 					<u-icon name="tags" size="50" color="#1E9F6A"></u-icon>
 					<view style="margin-left: 20rpx;">套餐特色</view>
-		  		</view>
+				</view>
 				<u-parse :content="goodsInfo.description"></u-parse>
-				
+
 				<view class="trips list-item">
 					<u-icon name="calendar" size="50" color="#1E9F6A"></u-icon>
 					<view style="margin-left: 20rpx;">行程简介</view>
 				</view>
 				<view style="margin: 20rpx 0;" v-for="item,index in goodsInfo.trips" :key="index">
 					<view style="color:#1E9F6A;margin: 20rpx 0;">
-						Day{{item.day}}
+						Day{{item.day?item.day:''}}
 					</view>
 					<u-parse :content="item.content"></u-parse>
 				</view>
-				
-		  	</view>
-		  </view>
-		  <view class="" style="padding-top: 100rpx;width: 100%;"></view>
-		  
+				<view class="charge list-item">
+					<u-icon name="edit-pen" size="50" color="#1E9F6A"></u-icon>
+					<view style="margin-left: 20rpx;">费用详情</view>
+				</view>
+				<u-parse :content="goodsInfo.cost_description"></u-parse>
+				<view class="notice list-item">
+					<u-icon name="bookmark" size="50" color="#1E9F6A"></u-icon>
+					<view style="margin-left: 20rpx;">须知说明</view>
+				</view>
+				<u-parse :content="goodsInfo.instruction"></u-parse>
+			</view>
+		</view>
+		<view class="" style="padding-top: 100rpx;width: 100%;"></view>
+
 		<view class="navbar footer">
 			<view class="kefu flex">
-				<view class="" @click="gomes">
-					<image src="../../static/travelD/service.png"  mode="heightFix" ></image>
-					<view class="">
-						客服
-					</view>
+				<view class="">
+					<button open-type="contact" style="background-color: transparent;border-style:none;border:0;padding: 0;line-height: 30rpx;">
+						<image src="../../static/travelD/service.png" mode="aspectFit"></image>
+						<view class="" style="font-size: 20rpx;color: rgba(255, 255, 255, 0.8);">
+							客服
+						</view>
+					</button>
+					
 				</view>
 				<view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
 			</view>
-			
+
 			<view class="kefu haibao flex" @click="share=true">
 				<view class="" @click="goposter">
-					<image src="../../static/travelD/share.png" mode="heightFix" class="icon"></image>
-					<view class="" >
+					<image src="../../static/travelD/share.png" mode="aspectFit" class="icon"></image>
+					<view class="" style="padding-top: 0rpx;">
 						生成海报
 					</view>
 				</view>
 				<view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
 			</view>
-			<view class="kefu wxin flex" >
+			<view class="kefu wxin flex">
 				<view class="">
-					<image src="../../static/travelD/share2.png" mode="heightFix" class="icon"></image>
-					<view class="">
+					<button open-type="share" style="background-color: transparent;border-style:none;border:0;padding: 0;line-height: 30rpx;">
+					<image src="../../static/travelD/share2.png" mode="aspectFit" class="icon"></image>
+					<view class="" style="margin-top: 0rpx;font-size: 20rpx;color: rgba(255, 255, 255, 0.8);">
 						分享
 					</view>
+					</button>
 				</view>
 				<view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
 			</view>
@@ -92,400 +108,512 @@
 				我要报名
 			</view>
 		</view>
-		
-		<u-popup :show="show"  mode="bottom" @close="close" @open="open" closeIconPos :customStyle="{padding:'30rpx',borderRadius:'0px 56rpx 0px 0px'}" :zIndex="zindex">
-				<view class="flex popupTop" >
-		           <view class="image">
-		          <image :src="goodsInfo.cover_picture" ></image>
-		           </view>
-				   <view class="">
-				   	<view class="" style="font-size: 36rpx;font-weight: 600;color: #333333;margin-bottom: 18rpx;">
-				   		夕阳红康养团
-				   	</view>
-					<view class="" style="font-size: 28rpx;color: #333333;">
-						请选择出发日期:{{choosedays}}
-					</view>
-				   </view>
+
+		<u-popup :show="show" mode="bottom" @close="close" @open="open" closeIconPos
+			:customStyle="{padding:'30rpx',borderRadius:'0px 56rpx 0px 0px'}" :zIndex="zindex" :safeAreaInsetBottom="true">
+			<view class="flex popupTop">
+				<view class="image">
+					<image :src="goodsInfo.cover_picture"></image>
 				</view>
-				<view class="day" >
-					<view class="" style="font-size: 30rpx;font-weight: bold;color: #333333;">
-						出发日期
+				<view class="">
+					<view class="" style="font-size: 36rpx;font-weight: 600;color: #333333;margin-bottom: 18rpx;">
+						{{goodsInfo.name?goodsInfo.name:''}}
 					</view>
-					<view class="" style="border-bottom: 1rpx solid #E3E3E3;">
-						<u-tabs :list="month" @change="chooseDay" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A"  :scrollable="true"></u-tabs>
+					<view class="" style="font-size: 28rpx;color: #333333;">
+						{{choosedays?'已选':'请选择出发日期'}}:{{choosedays}}
 					</view>
-					<view class="item" >
-						<view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days" @click="dayItem(index,item)">
-							<view class="">
-								{{item.start_at.slice(5,10)}}
-							</view>
-							<view class="">
-								{{item.week}}
+					
+				</view>
+			</view>
+			<view class="day">
+				<view class="" style="font-size: 30rpx;font-weight: bold;color: #333333;">
+					出发日期
+				</view>
+				<view class="" style="">
+					<u-tabs :list="month" @change="chooseDay" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"
+						:inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" :scrollable="true" :key="index" lineWidth="48" lineHeight="4">
+					</u-tabs>
+				</view>
+				<view class="item">
+					<view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days"
+						@click="dayItem(index,item)">
+						<view>
+							<view class="txtgray">
+								{{item.start_at.slice(5,10)?item.start_at.slice(5,10):''}}
 							</view>
-							<view class="" style="font-size: 26rpx;font-weight: 600;">
-								¥{{item.min_price}}
+							<view class="txtgray">
+								{{item.week?item.week:''}}
 							</view>
 						</view>
+						
+						<view class="" style="font-size: 26rpx;font-weight: 600;">
+							¥{{item.min_price}}
+						</view>
 					</view>
-
 				</view>
-				<view class="navbars"  @click="isshow = true;zindex=10070">
-					<view class="price">
+
+			</view>
+			<view class="navbars" @click="isshow = true;zindex=10070">
+				<view class="price">
 					¥{{price}}
-					</view>
-					
-					<view class="choose">
-						选择房型
-					</view>
 				</view>
+
+				<view class="choose">
+					选择房型
+				</view>
+			</view>
 		</u-popup>
-		
+
 		<!-- 模态框 -->
 		<!-- <view class="model">
 				<u-modal :show="isshow" title="报名前必看" :content='content' showCancelButton @confirm="goadd" @cancel="cancel" confirmColor="#ffffff"></u-modal>
 		</view> -->
-		
-		
+
+
 		<!-- <scroll-view  scroll-y="true"  style="height: 90vh;"   scroll-with-animation="true"> -->
-			<view class="model">
-			<u-modal :show="isshow" title="报名前必看" :content='content' showCancelButton @confirm="goadd" @cancel="cancel" confirmColor="#ffffff"></u-modal>
-			</view>
+		<view class="model">
+			<u-modal :show="isshow" title="报名前必看" :content='content' showCancelButton @confirm="goadd" @cancel="cancel"
+				confirmColor="#ffffff"></u-modal>
+		</view>
 		<!-- </scroll-view> -->
 	</view>
 </template>
 
 <script>
+	let that
 	export default {
-	    data() {
-	        return {
-				share:false,
+		data() {
+			return {
+				share: false,
 				// 标签
-				tags:[],
+				tags: [],
 				// 出行时间
-				days:[],
+				days: [],
 				// 选择状态
-				dayindex:-1,
-				choosedays:'',
-	           list2: [{
-	               image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
-	           },{
-	               image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
-	               
-	           },{
-	               image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
-	               
-	           }],
-				list1: [
-					{name: '特色'},
-					{name: '行程'}, 
-					{name: '费用'}, 
-					{name: '须知'}, 
-					{name: '置顶'}
+				dayindex: -1,
+				choosedays: '',
+				list2: [{
+					image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
+				}, {
+					image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
+
+				}, {
+					image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
+
+				}],
+				list1: [{
+						name: '特色'
+					},
+					{
+						name: '行程'
+					},
+					{
+						name: '费用'
+					},
+					{
+						name: '须知'
+					},
+					{
+						name: '置顶'
+					}
 				],
 				month: [],
 				// 弹出层
-				 show: false,
-				 // 层级
-				 zindex:10075,
-				 // 模态框
-				 isshow:false,
-				 // 模态框内容
-				 content:'*以上旅游行程在实际执行中可能会根据季节气候、自然环境等不可抗因素进行调整,购买前请知悉。 *如出发地或目的地,有疫情中等风险及以上地区的,可免费转为保留金,保留支付金额,后续预订时以实际预订金额为准。 关于夕阳团的温馨提示: 1、支付完成后,我们将在1个工作日内与您确认是否预订成功。 2、夕阳团默认2个人一个房间。需报名人数满足最低发团数后发团。为了避免造成您的损失,建议您在与客服确认发团后再购买机票。 3、此产品最少需要30人报名才可出发,最多不超过40人。我们会在出发前20天与您再次确认,如届时仍未报满规定人数,则很遗 4、此产品最少需要30人报名才可出发,最多不',
-				 // 套餐内容
-				 goodsInfo:{},
-				 // 房间选择
-				 plans:{},
-				 // 
-				 scrollTop:0,
-				 price:0
-	        }
-			
-	    },
+				show: false,
+				// 层级
+				zindex: 10075,
+				// 模态框
+				isshow: false,
+				// 模态框内容
+				content: '*以上旅游行程在实际执行中可能会根据季节气候、自然环境等不可抗因素进行调整,购买前请知悉。 *如出发地或目的地,有疫情中等风险及以上地区的,可免费转为保留金,保留支付金额,后续预订时以实际预订金额为准。 关于夕阳团的温馨提示: 1、支付完成后,我们将在1个工作日内与您确认是否预订成功。 2、夕阳团默认2个人一个房间。需报名人数满足最低发团数后发团。为了避免造成您的损失,建议您在与客服确认发团后再购买机票。 3、此产品最少需要30人报名才可出发,最多不超过40人。我们会在出发前20天与您再次确认,如届时仍未报满规定人数,则很遗 4、此产品最少需要30人报名才可出发,最多不',
+				// 套餐内容
+				goodsInfo: {},
+				// 房间选择
+				plans: {},
+				// 
+				scrollTop: 0,
+				price: 0
+			}
+
+		},
 		onLoad(options) {
-			console.log(options)
-			uni.showLoading({
-				title: '加载中'
-			});
-			this.init(options.id)
+			that=this
+			if(options.id){
+				this.init(options.id)
+			}
+			
 		},
-		onPageScroll(e){
+		computed:{
+			minprice(){
+				let pr=0
+				if(this.goodsInfo.min_price){
+					pr=this.goodsInfo.min_price
+				}
+				return pr
+			}
+		},
+		onPageScroll(e) {
 			// console.log(e,"<==============距离顶部的距离")
-			this.scrollTop=e.scrollTop
+			this.scrollTop = e.scrollTop
 		},
-		methods:{
-			init(id){
-				uni.$u.http.post('/api/good/show',{good_id:id},{
+		// #ifdef MP
+		onShareAppMessage(s= false){
+		    return this.$shareAppMessage({
+		        title: that.goodsInfo.name,
+		        imageUrl:"",
+		        path: "/pages/travel/travelDetails?id="+this.id,
+		       
+		    });
+		},
+		// #endif
+		methods: {
+			
+			init(id) {
+				this.$showLoadding("加载中")
+				uni.$u.http.post('/api/good/show', {
+					good_id: id
+				}, {
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
-					console.log(res,"套餐详情")
-					this.goodsInfo=res
-					this.tags=res.tags
-					// console.log(res.plans,"===========出行日期============")
-					let newmonth=[]
-					for(let key in res.plans){
-						newmonth.push({name:res.plans[key].month,days:res.plans[key].days})
-						this.days=res.plans[5].days
-						// console.log(res.plans[key].days,"xxxxxxxxxxxx")
-					}
-					this.month=newmonth
 					uni.hideLoading();
+					this.goodsInfo = res
+					this.tags = res.tags
+					let newmonth = []
+					for (let key in res.plans) {
+						newmonth.push({
+							name: res.plans[key].month,
+							days: res.plans[key].days
+						})
+					}
+					this.month = newmonth
+					this.days = newmonth[0].days
 				}).catch((err) => {
-					console.log( err)
+					console.log(err)
 				})
 			},
 			load() {
-			 this.$refs.uReadMore.init();
+				this.$refs.uReadMore.init();
 			},
 			open() {
-				this.show=true
-			        // console.log('open');
+				this.show = true
+				// console.log('open');
 			},
 			// 关闭popup
-		    close() {
-			        this.show = false
-			        // console.log('close');
+			close() {
+				this.show = false
+				// console.log('close');
 			},
 			// 添加出行人
-			goadd(){
-				this.isshow=false
+			goadd() {
+				this.isshow = false
 				console.log(this.plans)
-				let goodsInfo={}
-				goodsInfo.cover_picture=this.goodsInfo.cover_picture
-				goodsInfo.name=this.goodsInfo.name
-				goodsInfo.id=this.goodsInfo.id
-				goodsInfo.subtitle=this.goodsInfo.subtitle
+				let goodsInfo = {}
+				goodsInfo.cover_picture = this.goodsInfo.cover_picture
+				goodsInfo.name = this.goodsInfo.name
+				goodsInfo.id = this.goodsInfo.id
+				goodsInfo.subtitle = this.goodsInfo.subtitle
+
+				// uni.navigateTo({
+				// 	url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
+				// })
+				let obj = {
+					days: this.plans,
+					goodsinfo: goodsInfo
+				}
 				uni.navigateTo({
-					url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
+					url: "/pages/travel/travelPeople?obj=" + encodeURIComponent(JSON.stringify(obj))
 				})
 			},
 			// 关闭提示框
-			cancel(){
-				this.zindex=10075;
-				this.isshow=false
+			cancel() {
+				this.zindex = 10075;
+				this.isshow = false
 			},
 			// 选择当前日期
-			dayItem(index,days){
-				this.price=days.min_price
-				this.plans=days
-				console.log(index,days)
-				let start=days.start_at.slice(0,10)
-				let  end=days.end_at.slice(0,10)
-				this.choosedays=`${start}~${end}`
-				this.dayindex=index
-				
+			dayItem(index, days) {
+				this.price = days.min_price
+				this.plans = days
+				console.log(index, days)
+				let start = days.start_at.slice(0, 10)
+				let end = days.end_at.slice(0, 10)
+				this.choosedays = `${start}~${end}`
+				this.dayindex = index
+
 			},
 			// 选择日期
-			chooseDay(item){
-				// console.log(item)
-				this.days=item.days
+			chooseDay(item,index) {
+				console.log(item,7787)
+				this.days = item.days
 			},
 			// 切换标签
-			check(item){
+			check(item) {
 				// console.log(item)
-				if(item.name=="行程"){
-					uni.createSelectorQuery().select('.trips').boundingClientRect(data=>{//目标位置的节点:类或者id
-					    uni.pageScrollTo({
-					        duration: 100,//过渡时间
-					        scrollTop:data.top + this.scrollTop - 50,//到达距离顶部的top值
-					    })
+				if (item.name == "行程") {
+					uni.createSelectorQuery().select('.trips').boundingClientRect(data => { //目标位置的节点:类或者id
+						uni.pageScrollTo({
+							duration: 200, //过渡时间
+							scrollTop: data.top + this.scrollTop - 50, //到达距离顶部的top值
+						})
 					}).exec();
-				}else if(item.name=="特色"){
-					uni.createSelectorQuery().select(".duction").boundingClientRect(res=>{//目标位置的节点:类或者id
-					    uni.pageScrollTo({
-					    duration: 100,//过渡时间
-					    scrollTop:res.top + this.scrollTop - 50,//到达距离顶部的top值
-					    })
+				} else if (item.name == "特色") {
+					uni.createSelectorQuery().select(".duction").boundingClientRect(res => { //目标位置的节点:类或者id
+						uni.pageScrollTo({
+							duration: 200, //过渡时间
+							scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
+						})
+					}).exec()
+				} else if (item.name == "费用") {
+					uni.createSelectorQuery().select(".charge").boundingClientRect(res => { //目标位置的节点:类或者id
+						uni.pageScrollTo({
+							duration: 200, //过渡时间
+							scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
+						})
 					}).exec()
-				}else if(item.name=="置顶"){
+				} else if (item.name == "须知") {
+					uni.createSelectorQuery().select(".notice").boundingClientRect(res => { //目标位置的节点:类或者id
+						uni.pageScrollTo({
+							duration: 200, //过渡时间
+							scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
+						})
+					}).exec()
+				} else if (item.name == "置顶") {
 					uni.pageScrollTo({
-					duration: 100,//过渡时间
-					scrollTop:0,//到达距离顶部的top值
+						duration: 200, //过渡时间
+						scrollTop: 0, //到达距离顶部的top值
 					})
-					
+
 				}
-				
+
 			},
 			// 生成海报
-			goposter(){
+			goposter() {
 				uni.navigateTo({
-					url:"/pages/travel/poster"
+					url: "/pages/travel/poster?goodsInfo="+encodeURIComponent(JSON.stringify(this.goodsInfo))
 				})
 			},
 			// 客服
-			gomes(){
+			gomes() {
 				uni.navigateTo({
-					url:"/pages/customerService"
+					url: "/pages/customerService"
 				})
 			}
-		}	
+		}
 	}
 </script>
 
 <style lang="less">
-	page{
+	page {
 		background-color: #f4f4f4;
 	}
-		.model{
-			// height: 500rpx !important;
-		}
-.detailsPage{
-	width: 100%;
-	
-	.flex{
-		display: flex;
-		align-items: center;
+	.txtgray{
+		color: #666666;
 	}
-	.flex-item{
-		display: flex;
-		justify-content: space-between;
-		margin: 10rpx 0;
+	.model {
+		// height: 500rpx !important;
 	}
-	.details{
-		background-color: #fff;
-		padding:40rpx 30rpx 40rpx;
-		margin: 24rpx 0;
-		font-family: PingFang-SC-Medium, PingFang-SC;
-		.title{
-			color: #333333;
-			font-size: 34rpx;
-			font-weight: 600;
-			margin-bottom: 24rpx;
+
+	.detailsPage {
+		width: 100%;
+
+		.flex {
+			display: flex;
+			align-items: center;
 		}
-		.describe{
-			font-size: 28rpx;
-			color: #666666;
-			margin-bottom: 40rpx;
+
+		.flex-item {
+			display: flex;
+			justify-content: space-between;
+			margin: 10rpx 0;
 		}
-		.tags{
-			font-size: 26rpx;
-			color: #1E9F6A;
-			height: 56rpx;
-			padding: 0 28rpx;
-			line-height: 56rpx;
-			background: rgba(30, 159, 106, 0.06);
-			margin-right: 24rpx;
+
+		.details {
+			background-color: #fff;
+			padding: 40rpx 30rpx 40rpx;
+			margin: 24rpx 0;
+			font-family: PingFang-SC-Medium, PingFang-SC;
+
+			.title {
+				color: #333333;
+				font-size: 34rpx;
+				font-weight: 600;
+				margin-bottom: 24rpx;
+			}
+
+			.describe {
+				font-size: 28rpx;
+				color: #666666;
+				margin-bottom: 40rpx;
+			}
+
+			.tags {
+				font-size: 26rpx;
+				color: #1E9F6A;
+				height: 56rpx;
+				padding: 0 28rpx;
+				line-height: 56rpx;
+				background: rgba(30, 159, 106, 0.06);
+				margin-right: 24rpx;
+			}
 		}
-	}
-	.detailsContent{
-		background-color: #fff;
-		margin-bottom: 160rpx;
-		height: 100%;
-		.detailsList{
-			padding: 20rpx;
+
+		.detailsContent {
+			background-color: #fff;
+			margin-bottom: 160rpx;
+			height: 100%;
+
+			.detailsList {
+				padding: 20rpx;
+			}
+
+			.list-item {
+				display: flex;
+				align-items: center;
+				color: #1E9F6A;
+				font-size: 36rpx;
+			}
 		}
-		.list-item{
+
+		.navbar {
+			background: #1E9F6A;
+			border-radius: 16rpx 16rpx 0px 0px;
+			color: #ffffff;
 			display: flex;
-			align-items: center;
-			color: #1E9F6A;
-			font-size: 36rpx;
-		}
-	}
-	.navbar{
-		background: #1E9F6A;
-		border-radius: 16rpx 16rpx 0px 0px;
-		color: #ffffff;
-		display: flex;
-		    bottom: 0;
-		    left: 0;
-		    position: fixed;
-		    width: 100%;
+			bottom: 0;
+			left: 0;
+			position: fixed;
+			width: 100%;
 			padding: 16rpx 40rpx;
 			box-sizing: border-box;
 			z-index: 10000;
-		.kefu{
-			image{
-				// width: 42rpx;
-				height: 44rpx;
+
+			.kefu {
+				// width: 44rpx;
+				button::after {
+						border: none;
+					}
+				image {
+					width: 44rpx;
+					height: 44rpx;
+				}
+
+				font-size: 20rpx;
+				color: rgba(255, 255, 255, 0.8);
+				text-align: center;
+
 			}
-			font-size: 20rpx;
-			color: rgba(255, 255, 255, 0.8);
-			text-align: center;
-			
-		}
-		.haibao{
-			image{
-				// width: 42rpx;
-				height: 38rpx;
+
+			.haibao {
+				image {
+					// width: 42rpx;
+					height: 38rpx;
+				}
+			}
+
+			.wxin {
+				image {
+					// width: 42rpx;
+					height: 42rpx;
+				}
+			}
+
+			.want {
+				display: flex;
+				flex: 1;
+				align-items: center;
+				justify-content: center;
+				// padding-right: 50rpx;
+				font-size: 32rpx;
+				font-weight: bold;
 			}
 		}
-		.wxin{
-			image{
-				// width: 42rpx;
-				height: 42rpx;
+
+		.popupTop {
+			padding-bottom: 24rpx;
+			color: #333333;
+			.image {
+				margin: 20rpx 20rpx 0 0;
+			}
+
+			image {
+				height: 120rpx;
+				width: 180rpx;
+				border-radius: 6rpx;
 			}
 		}
-		.want{
+
+		.day {
+			// height: 200rpx;
+			margin-bottom: 180rpx;
+		}
+
+		.item {
+			margin-top: -6rpx;
+			border-top: 1rpx solid #E3E3E3;
 			display: flex;
-			flex: 1;
-			align-items: center;
-            justify-content: center;
-			padding-right: 50rpx;
+			overflow: auto;
+			// flex-wrap: nowrap;
 		}
-	}
-	.popupTop{
-		padding-bottom: 24rpx;
-		.image{
-			margin: 20rpx 20rpx 0 0;
+		
+		.day-item-active {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-between;
+			width: 120rpx;
+			height: 164rpx;
+			border-radius: 0px 32rpx 0px 32rpx;
+			background: rgba(30, 159, 106, 0.1);
+			border: 1px solid #1E9F6A;
+			font-size: 22rpx;
+			color: #333333;
+			// text-align: center;
+			margin: 56rpx 24rpx 0 0;
+			box-sizing: border-box;
+			padding: 18rpx 20rpx 18rpx 20rpx;
 		}
-		image{
-			height: 120rpx;
-			width: 200rpx;
-			border-radius: 6rpx;
+
+		.day-item {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-between;
+			width: 122rpx;
+			height: 166rpx;
+			background: #F4F4F4;
+			border-radius: 0px 32rpx 0px 32rpx;
+			font-size: 22rpx;
+			color: #333333;
+			// text-align: center;
+			margin: 56rpx 24rpx 0 0;
+			box-sizing: border-box;
+			padding: 18rpx 20rpx 18rpx 20rpx;
+		}
+
+		.navbars {
+			box-sizing: border-box;
+			width: 100%;
+			height: 104rpx;
+			// line-height:104rpx;
+			display: flex;
+			align-items: center;
+			padding: 28rpx 0;
+			background: #1E9F6A;
+			border-radius: 16rpx 16rpx 0px 0px;
+			color: #ffffff;
+			display: flex;
+			bottom: 0;
+			left: 0;
+			position: fixed;
+
+			.price {
+				border-right: 1px solid #ffffff;
+				padding: 0 64rpx 0 30rpx;
+			}
+
+			.choose {
+				font-size: 35rpx;
+				margin: auto;
+			}
 		}
 	}
-	.day{
-		margin-bottom: 250rpx;
-	}
-	.item{
-		display: flex;
-	}
-	.day-item-active{
-		width: 120rpx;
-		height: 164rpx;
-	    border-radius: 0px 32rpx 0px 32rpx;
-		background: rgba(30, 159, 106, 0.1);
-		border: 1px solid #1E9F6A;
-		font-size: 22rpx;
-		color: #333333;
-		text-align: center;
-		margin: 56rpx 24rpx 0 0;
-		box-sizing: border-box;	
-		padding: 39rpx 0 42rpx;
-	}
-	.day-item{
-		width: 122rpx;
-		height: 166rpx;
-		background: #F4F4F4;
-		border-radius: 0px 32rpx 0px 32rpx;
-		font-size: 22rpx;
-		color: #333333;
-		text-align: center;
-		margin: 56rpx 24rpx 0 0;
-		box-sizing: border-box;	
-		padding: 39rpx 0 42rpx;
-	}
-	.navbars{
-		box-sizing: border-box;
-		width: 100%;
-		height: 104rpx;
-		// line-height:104rpx;
-		padding: 28rpx 0;
-		background: #1E9F6A;
-		border-radius: 16rpx 16rpx 0px 0px;
-		color: #ffffff;
-		display: flex;
-		    bottom: 0;
-		    left: 0;
-		    position: fixed;
-	.price{
-		border-right: 1px solid #ffffff;
-		padding: 0 64rpx 0 30rpx;
-	}
-	.choose{
-		margin: auto;
-	}
-	}
-}
 </style>

+ 294 - 181
pages/travel/travelPeople.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -3,16 +3,16 @@
 		<view class="top">
 			<view class="image">
 				<!-- <image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png" mode="widthFix"></image> -->
-				<image :src="goodsInfo.cover_picture" ></image>
+				<image :src="goodsInfo.cover_picture"></image>
 			</view>
 			<view class="">
 				<view class="" style="font-size: 32rpx;font-weight: 600;">
 					<!-- 夕阳红康养团7日游 -->
-					{{goodsInfo.name}}
+					{{goodsInfo.name?goodsInfo.name:''}}
 				</view>
 				<view class="" style="font-size: 28rpx;margin-top: 20rpx;">
-						日期:{{day}}
-				</view>			
+					日期:{{day}}
+				</view>
 			</view>
 		</view>
 		<view class="house">
@@ -20,14 +20,15 @@
 				入住房型
 			</view>
 			<view class="houseType">
-				<view :class="houseType==index?'houseType-item-active':'houseType-item'" v-for="item,index in houselist" @click="chooseHouse(index,item.price,item.room_id)">
+				<view :class="houseType==index?'houseType-item-active':'houseType-item'" v-for="item,index in houselist"
+					@click="chooseHouse(index,item.price,item.room_id)">
 					<view class="image">
-						<image :src="item.room_picture" @click="previewImg(item.img,index)"></image>
+						<image :src="item.room_picture" @touchend="dblclick(item.room_picture)" ></image>
 						<view class="surplus">
 							剩余 {{item.number}}
 						</view>
 					</view>
-					<view class="text" >
+					<view class="text">
 						{{item.room_name}}
 					</view>
 				</view>
@@ -45,18 +46,20 @@
 					<!-- ¥12399 -->
 					¥{{totalromprice}}
 				</view>
-				<u-number-box v-model="number" @change="valChange"  bgColor="#ffffff"></u-number-box>
+				<u-number-box v-model="number" @change="valChange" bgColor="#ffffff"></u-number-box>
 			</view>
 		</view>
-		
+
 		<view class="travel">
-			<u-cell title="出行人" isLink size="large" :border="false" :titleStyle="{color:'#666666'}"  value="选择出行人" @click="choosePeople"></u-cell>
+			<u-cell title="出行人" isLink size="large" :border="false" :titleStyle="{color:'#666666'}" value="选择出行人"
+				@click="choosePeople"></u-cell>
 			<u-cell-group :border="false">
-				<u-cell v-for="(item,index) in travelers" :title="item.name" isLink  size="large" :border="false" :value="item.phone"></u-cell>
+				<u-cell v-for="(item,index) in travelers" :title="item.name" isLink size="large" :border="false"
+					:value="item.phone" @click="moveAdd(index)" :key="index"></u-cell>
 			</u-cell-group>
-			
+
 		</view>
-		
+
 		<view class="Roommate">
 			<view class="roommate-top">
 				<view class="">
@@ -73,117 +76,125 @@
 			</view>
 			<view class="travelList" v-if="chooseroommate==2">
 				<view class="" style="margin: 20rpx 0;" v-for="(item,index) in cohabits" :key="index">
-					<u--input placeholder="输入同住人姓名" border="bottom" clearable  v-model="cohabits[index]" ></u--input>
-					
+					<u--input placeholder="输入同住人姓名" border="bottom" clearable v-model="cohabits[index]"></u--input>
+
 				</view>
 				<view class="addpeople" @click="addcohabits">
 					增加同住人
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="remarks">
 			<view class="text">
 				日期、房型相同的情况下可选择其他出行人同住,但有时候会出现人数不够分配的情况,会安排同性出行人同住。
 			</view>
 		</view>
-		
-		
-		
-       <view class="navbar">
-		   <view class="price">
-		   	<view class="">
-		   		总金额
-		   	</view>
-			<view class="" style="margin: 0 10rpx 0 40rpx;"  @click="details = true">
-				¥12921
+
+
+
+		<view class="navbar">
+			<view class="price">
+				<view class="">
+					总金额
+				</view>
+				<view class="" style="margin: 0 10rpx 0 40rpx;" @click="details = true">
+					¥{{totalromprice}}
+				</view>
+				<u-icon name="arrow-up" color="#ffffff" @click="details = true"></u-icon>
 			</view>
-			<u-icon name="arrow-up" color="#ffffff"  @click="details = true"></u-icon>
-		   </view>
-		    
-			<view class="next" @click="Submit"  >
+
+			<view class="next" @click="Submit">
 				提交订单
 			</view>
-	    </view>
-		
+		</view>
+
 
-		<u-popup :show="details" @close="details = false" duration="0" @open="open" :overlay="false" :customStyle="{'margin-bottom':'104rpx','background':' #F9F9F9 ','height':'104rpx'}">
-            <view class="order">
-                <view class="icon" @click="details = false">
-                	<u-icon name="arrow-down"></u-icon>
-                </view>
+		<u-popup :show="details" @close="details = false" duration="0"  :overlay="false"
+			:customStyle="{'margin-bottom':'104rpx','background':' #F9F9F9 ','height':'104rpx'}">
+			<view class="order">
+				<view class="icon" @click="details = false">
+					<u-icon name="arrow-down"></u-icon>
+				</view>
 				<view class="orderDetails">
 					<view class="">
 						数量
 					</view>
 					<view class="">
-						<text>1人</text>
-						<text>¥12399</text>
+						<text>{{value}}人</text>
+						<text>¥{{totalromprice}}</text>
 					</view>
 				</view>
-            </view>
+			</view>
 		</u-popup>
 
-		<view >
-				<u-modal :show="showMoadl" :title="title" confirmText="知道了" confirmColor="#ffffff" @confirm="showMoadl=false">
-					<view class="">
-						关注日月峡公众号
-						<text style="color: #408B68;">日月峡</text>
-							及时获取出行信息
-					</view>
-					
-				</u-modal>
-			</view>
-	</view>	
+		<view>
+			<u-modal :show="showMoadl" :title="title" confirmText="知道了" confirmColor="#ffffff"
+				@confirm="showMoadl=false">
+				<view class="">
+					关注日月峡公众号
+					<text style="color: #408B68;">日月峡</text>
+					及时获取出行信息
+				</view>
+
+			</u-modal>
+		</view>
+	</view>
 </template>
 
 <script>
+	let that
 	export default {
-		data(){
-			return{
+		data() {
+			return {
 				// 房型选择
-				houseType:0,
-				state:0,
-				show:0,
-				name:'',
+				houseType: 0,
+				state: 0,
+				show: 0,
+				name: '',
+				touchNum: 0,
 				// 房间类型
-				houselist:[
+				houselist: [
 					// {name:"多人间(上铺)",id:0,img:"../../static/house.jpg"},
 					// {name:"三人间(3人)",id:1,img:"../../static/house.jpg"},
 					// {name:"标间(2人)",id:2,img:"../../static/house.jpg"},
 					// {name:"大床房(2人)",id:3,img:"../../static/house.jpg"},
 				],
 				// 房间价格
-				roomPrice:'',
-				totalromprice:'',
+				roomPrice: '',
+				totalromprice: '',
 				// 房间数量
 				number: 0,
 				// 选择样式
-				active:false,
-             showMoadl:true,
-			title:'提示',
-			// 添加同住人/随机
-			chooseroommate:1,
-			// 金额详情
-			details:false,
-			goodsInfo:{},
-			days:{},
-			// 日期
-			day:"",
-			// 出行人
-			travelers:[],
-			// 同住人
-			cohabits:[],
-			room_id:0
+				active: false,
+				showMoadl: true,
+				title: '提示',
+				// 添加同住人/随机
+				chooseroommate: 1,
+				// 金额详情
+				details: false,
+				goodsInfo: {},
+				days: {},
+				// 日期
+				day: "",
+				// 出行人
+				travelers: [],
+				// 同住人
+				cohabits: [],
+				room_id: 0,
+				value:1
 			}
 		},
 		onLoad(options) {
-			let newdays=JSON.parse(options.days)
-			this.days=newdays
-			
-			let goodsInfo=JSON.parse(options.goodsinfo)
-			this.goodsInfo=goodsInfo
-			// console.log(options)
+			that=this
+			console.log(options)
+			let newdays = decodeURIComponent(options.obj)
+			let datainfo = JSON.parse(newdays)
+			this.days = datainfo.days
+
+			// let goodsInfo=JSON.parse(options.goodsinfo)
+			this.goodsInfo = datainfo.goodsinfo
+			console.log(datainfo.days, 748789)
 			// this.days=days
 			// 
 			// console.log(this.days,this.goodsInfo)
@@ -191,78 +202,142 @@
 		},
 		onShow() {
 			console.log(this.$store.state.peopleList)
-			this.travelers=this.$store.state.peopleList
+			this.travelers = this.$store.state.peopleList
 		},
-		methods:{
-			init(){
-				let newdays=this.days
+		
+		methods: {
+			moveAdd(index){
+				let addPel=this.travelers[index]
+				addPel.state=0
+				uni.navigateTo({
+					url:`/pages/peopleList/addPeople?state=0&info=${JSON.stringify(addPel)}`
+				})
+			},
+			dblclick(url,e) {
+				this.touchNum++
+				setTimeout(() => {
+					if (this.touchNum == 1) {
+					}
+					if (this.touchNum >= 2) {
+						let imgUrl = []
+						imgUrl.push(url)
+						console.log(imgUrl)
+						uni.previewImage({
+							current: imgUrl[0],
+							urls: imgUrl,
+						});
+					}
+					this.touchNum = 0
+				}, 250)
+
+			},
+			init() {
+				let newdays = this.days
 				console.log(newdays)
-				let start=newdays.start_at.slice(0,10)
-				let  end=newdays.end_at.slice(0,10)
-				this.day=`${start}~${end}`
-				this.houselist=newdays.rooms
-				console.log(this.day,this.houselist)
+				let start = newdays.start_at.slice(0, 10)
+				let end = newdays.end_at.slice(0, 10)
+				this.day = `${start}~${end}`
+				this.houselist = newdays.rooms
+				this.room_id=this.houselist[0].room_id
+				this.houseType=0
+				this.roomPrice=Number(this.houselist[0].price)
+				this.totalromprice=Number(this.houselist[0].price)
+				
+				console.log(this.day, this.houselist)
 			},
 			// 选择出行人
-			choosePeople(){
+			choosePeople() {
 				uni.navigateTo({
-					url:"/pages/peopleList/peopleList",
+					url: "/pages/peopleList/peopleList?value="+this.value,
 				})
 			},
 			// 查看出行人
-			edit(item){
-				let info=JSON.stringify(item)
+			edit(item) {
+				let info = JSON.stringify(item)
 				uni.navigateTo({
-					url:`/pages/peopleList/addPeople?info=${info}&state=0`
+					url: `/pages/peopleList/addPeople?info=${info}&state=0`
 				})
 			},
 			// 点击放大图片
-			previewImg(url,index){
-				let imgUrl=[]
+			previewImg(url, index) {
+				let imgUrl = []
 				imgUrl.push(url)
 				console.log(imgUrl)
 				uni.previewImage({
-						current: imgUrl[0],
-						urls: imgUrl,
-					});
+					current: imgUrl[0],
+					urls: imgUrl,
+				});
 			},
 			// 选择房间数量
 			valChange(e) {
-				// console.log(this.houselist)
-				// console.log(Number(this.roomPrice) * e.value)
-				this.totalromprice=Number(this.roomPrice) * e.value
+				this.value=e.value
+				this.totalromprice = Number(this.roomPrice) * e.value
 			},
 			// 添加同住人e
-			addcohabits(){
+			addcohabits() {
+				
+				for(let i in this.cohabits){
+					console.log(i)
+					if(this.cohabits[i]==''){
+						console.log(i)
+						this.$toast("请输入正确的同住人姓名")
+						return
+					}
+				}
 				this.cohabits.push("")
 				console.log(this.cohabits)
-			},	
-			chooseHouse(index,price,id){
-				this.houseType=index
-				this.roomPrice=price
-				this.room_id=id
-				console.log(index,price,id,"<=============")
+			},
+			chooseHouse(index, price, id) {
+				this.houseType = index
+				this.roomPrice = price
+				this.room_id = id
+				this.totalromprice = Number(this.roomPrice)*this.value
+				console.log(index, price, id, "<=============")
 			},
 			// 提交订单
-			Submit(){
-				let suborder={}
-				suborder.good_id=this.goodsInfo.id
-				suborder.start_at=this.day.slice(0,10)
-				suborder.room_id=this.room_id
-				suborder.number=this.number
-				suborder.travelers=[]
-				suborder.cohabits=this.cohabits
-				suborder.cohabit_type=this.chooseroommate
-				this.travelers.forEach((item,index)=>{
+			Submit() {
+				if(this.chooseroommate==2){
+					for(let i in this.cohabits){
+						console.log(i)
+						if(this.cohabits[i]==''){
+							console.log(i)
+							this.$toast("请输入正确的同住人姓名")
+							return
+						}
+					}
+				}
+				
+				if(this.travelers.length==0){
+					this.$toast("请选择出行人")
+					return
+				}
+				let suborder = {}
+				suborder.good_id = this.goodsInfo.id
+				suborder.start_at = this.day.slice(0, 10)
+				suborder.room_id = this.room_id
+				suborder.number = this.value
+				suborder.travelers = []
+				suborder.cohabits = this.cohabits
+				suborder.cohabit_type = this.chooseroommate
+				suborder.total=this.totalromprice
+				this.travelers.forEach((item, index) => {
 					// console.log(item.id)
 					suborder.travelers.push(item.id)
 				})
-				console.log(suborder,"<============提交订单的需要")
-				uni.$u.http.post('/api/order/add',suborder,{
+				console.log(suborder, "<============提交订单的需要")
+				uni.$u.http.post('/api/order/add', suborder, {
 					custom: {
 						auth: true
 					}
 				}).then((res) => {
+// <<<<<<< HEAD
+					// console.log(res)
+					// suborder.name = this.goodsInfo.name
+					// suborder.subtitle = this.goodsInfo.subtitle
+					// suborder.day = this.day
+					// suborder.people = []
+					// this.travelers.forEach((item, index) => {
+// =======
 					console.log(res)
 					suborder.order_id=res.id // 订单id
 					suborder.name=this.goodsInfo.name
@@ -270,103 +345,117 @@
 					suborder.day=this.day
 					suborder.people=[]
 					this.travelers.forEach((item,index)=>{
+// >>>>>>> 4815da3871d3be566f42d407886303debb6a2364
 						suborder.people.push(item.name)
 					})
 					uni.navigateTo({
-						url:`/pages/travel/submitOrder?suborder=${JSON.stringify(suborder)}`
+						url: `/pages/travel/submitOrder?suborder=${JSON.stringify(suborder)}`
 					})
 				}).catch((err) => {
-					console.log( err)
+					console.log(err)
 					uni.showToast({
-						icon:"error",
-						title:err.message,
+						icon: "error",
+						title: err.message,
 					})
 				})
-				
+
 			}
 		}
 	}
 </script>
 
 <style lang="less">
-	page{
+	page {
 		background-color: #F4F4F4;
 		font-family: PingFang-SC-Medium, PingFang-SC;
 		font-size: 32rpx;
 	}
-	.curpage{
-		.top{
+
+	.curpage {
+		.top {
 			margin-top: 32rpx;
-			padding:10rpx 30rpx;
+			padding: 10rpx 30rpx;
 			display: flex;
 			align-items: center;
 			align-items: center;
 			// background-color: #fff;
 			margin-bottom: 30rpx;
-			.image{
+
+			.image {
 				margin: 20rpx;
-				image{
+
+				image {
 					width: 180rpx;
 					height: 110rpx;
 				}
 			}
 		}
-		.house{
+
+		.house {
 			border-radius: 16rpx 56rpx 8rpx 8rpx;
 			background-color: #FFF;
 			padding: 50rpx 30rpx 40rpx;
 			box-sizing: border-box;
-			.houseType{
+
+			.houseType {
 				display: flex;
 				flex-wrap: wrap;
 				box-sizing: border-box;
-				.houseType-item-active{
+
+				.houseType-item-active {
 					width: calc(90% / 3);
 					padding: 10rpx;
-					.image{
-						width:100%;
+
+					.image {
+						width: 100%;
 						position: relative;
-						image{
+
+						image {
 							box-sizing: border-box;
 							// width: 100%;
 							width: 100%;
-							height: 208rpx;
+							height: 158rpx;
 							border-radius: 8rpx 24rpx 8rpx 24rpx;
-							border: 2rpx solid rgba(30, 159, 106, 1);
+							border: 4rpx solid rgba(30, 159, 106, 1);
 						}
 					}
-					.text{
+
+					.text {
 						font-size: 26rpx;
 						text-align: center;
 						color: #1E9F6A;
-						
+
 					}
 				}
-				
-				.houseType-item{
+
+				.houseType-item {
 					width: calc(90% / 3);
 					padding: 10rpx;
-					.image{
-						width:100%;
+
+					.image {
+						width: 100%;
 						position: relative;
-						image{
+
+						image {
 							width: 100%;
-							height: 208rpx;
+							height: 158rpx;
 							border-radius: 8rpx 24rpx 8rpx 24rpx;
 						}
 					}
-					.text{
+
+					.text {
 						font-size: 26rpx;
 						text-align: center;
-						color: #101010
-;
-						
+						color: #101010;
+
 					}
 				}
-				
-				.surplus{
+
+				.surplus {
 					width: 95rpx;
 					height: 34rpx;
+					line-height: 34rpx;
+					padding: 0 10rpx;
 					background: #030303;
 					box-shadow: 0px 2rpx 11rpx 0px rgba(30, 159, 106, 0.22);
 					border-radius: 2rpx 12rpx 2rpx 12rpx;
@@ -376,41 +465,52 @@
 					text-align: center;
 					position: absolute;
 					top: 0rpx;
-					left: 30%;
+					left: 0;
+					right: 0;
+					margin: 0 auto;
+					margin-top: 15rpx;
 				}
 			}
 		}
-		.houseNumber{
+
+		.houseNumber {
 			background-color: #ffffff;
 			margin: 20rpx 0;
 			padding: 50rpx 30rpx 40rpx;
-			.housePrice{
+
+			.housePrice {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
 			}
 		}
-		.travel{
+
+		.travel {
 			// display: flex;
 			// justify-content: space-between;
 			background-color: #ffffff;
-			padding:50rpx 0rpx;
+			padding: 50rpx 0rpx;
 		}
-		.Roommate{
-			.roommate-top{
+
+		.Roommate {
+			.roommate-top {
 				display: flex;
 				justify-content: space-between;
 				padding: 0 30rpx;
 			}
-			.travelList{
+
+			.travelList {
 				padding: 0 20rpx;
 			}
+
 			padding:50rpx 0rpx;
 			background-color: #ffffff;
 			margin: 20rpx 0;
-			.flex{
+
+			.flex {
 				display: flex;
-				.flex-item{
+
+				.flex-item {
 					margin: 0 20rpx;
 					width: 176rpx;
 					height: 60rpx;
@@ -420,7 +520,8 @@
 					font-size: 30rpx;
 					text-align: center;
 				}
-				.flex-item-active{
+
+				.flex-item-active {
 					box-sizing: border-box;
 					width: 176rpx;
 					height: 60rpx;
@@ -433,7 +534,8 @@
 					text-align: center;
 				}
 			}
-			.addpeople{
+
+			.addpeople {
 				margin: 40rpx 20rpx 0;
 				width: 176rpx;
 				height: 60rpx;
@@ -442,20 +544,24 @@
 				border-radius: 2rpx 30rpx 2rpx 30rpx;
 				font-size: 30rpx;
 				text-align: center;
-				margin-left: 490rpx;
+				margin-left: 530rpx;
 			}
 		}
-		.remarks{
+
+		.remarks {
 			background-color: #ffffff;
-			padding:50rpx 30rpx;
-			.text{
+			padding: 50rpx 30rpx;
+
+			.text {
 				background-color: #F4F4F4;
 				padding: 40rpx 24rpx;
 				font-size: 32rpx;
 			}
+
 			margin-bottom: 104rpx;
 		}
-		.navbar{
+
+		.navbar {
 			z-index: 9999;
 			box-sizing: border-box;
 			padding: 0 30rpx;
@@ -468,30 +574,37 @@
 			border-radius: 16rpx 16rpx 0px 0px;
 			color: #ffffff;
 			position: fixed;
-			bottom: 0;left: 0;
-			.next{
+			bottom: 0;
+			left: 0;
+
+			.next {
 				width: 50%;
 				// background-color: pink;
 				text-align: center;
 				border-left: 1rpx solid #ffffff;
 			}
-			.price{
+
+			.price {
 				display: flex;
 			}
 		}
 	}
-	.order{
-		margin-bottom:104rpx;
+
+	.order {
+		margin-bottom: 104rpx;
 		padding: 40rpx 30rpx 0;
-		.icon{
+
+		.icon {
 			padding-left: 50%;
 		}
-		.orderDetails{
+
+		.orderDetails {
 			display: flex;
 			justify-content: space-between;
 		}
 	}
-	.popupstyle{
+
+	.popupstyle {
 		background-color: pink;
 	}
 </style>

+ 135 - 30
pages/userCenter.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -1,55 +1,63 @@
 <template>
 	<view class="userPage">
 		<view class="userTop">
-			<image src="../static/usercenter/bg.png" mode="widthFix"></image>
+			<view class="topbg">
+				<image src="../static/usercenter/bg.png" mode="aspectFill"></image>
+			</view>
+			
 			<view class="userTop-content" v-if="loginShow">
 				<view class="avatar" @click="goEndit">
-					
+					<image :src="userMsg.avatarUrl" mode="aspectFill" v-if="userMsg.avatarUrl"></image>
+					<image src="/static/bghesd.png" mode="aspectFill" v-else></image>
 				</view>
-				<view class="userinfo">
-					<view class="">
-						去远方Y
+				<view class="userinfo" v-if="userMsg.nickName">
+					<view class="getnewname">
+						<text>{{userMsg.nickName}}</text>
+						<text class="getnew" @click="getUserProfile()">刷新</text>
 					</view>
 					<view class="phonenumber">
-						15296189206
+						{{phone}}
 					</view>
 				</view>
+				<view class="userinfo" v-if="!userMsg.nickName" @click="getUserProfile()">
+					<text>点击获取头像昵称</text>
+				</view>
 			</view>
 			
 			<view class="login" v-if="!loginShow">
 				<view class="">
-					登录日月峡森林康养旅行
+					日月峡森林康养旅行
 				</view>
 				<view class="btn" @click="gologin">
-					登录
+					登录
 				</view>
 			</view>
 		</view>
 		
 		<view class="userOrder">
-			<view class="flex-item" @click="goOrder">
-			    <image mode="widthFix" src="../static/usercenter/Tobepaid.png" style="width: 45%;margin-bottom: 5px;"></image>
+			<view class="flex-item" @click="goOrder()">
+			    <image mode="aspectFit" src="../static/usercenter/Tobepaid.png" style="width: 45%;margin-bottom: -5px;"></image>
 			         <view>待付款</view>
 			</view>
 			<view class="line">
 				
 			</view>
-			<view class="flex-item" @click="goOrder">
-			    <image mode="widthFix" src="../static/usercenter/Aftersales.png" style="width: 45%;margin-bottom: 5px;"></image>
+			<view class="flex-item" @click="goOrder()">
+			    <image mode="aspectFit" src="../static/usercenter/Aftersales.png" style="width: 45%;margin-bottom: -5px;"></image>
 			        <view>已付款</view>
 			</view>
 			<view class="line">
 				
 			</view>
 			<view class="flex-item" @click="goOrder">
-			    <image mode="widthFix" src="../static/usercenter/Tobepaid1.png" style="width: 45%;margin-bottom: 5px;"></image>
+			    <image mode="aspectFit" src="../static/usercenter/Tobepaid1.png" style="width: 45%;margin-bottom: -5px;"></image>
 			     <view>已完成</view>
 			</view>
 			<view class="line">
 				
 			</view>
 		    <view  class="flex-item " @click="goOrder">
-		        <image mode="widthFix" src="../static/usercenter/all.png" style="width: 45%;margin-bottom: 5px;"></image>
+		        <image mode="aspectFit" src="../static/usercenter/all.png" style="width: 45%;margin-bottom: -5px;"></image>
 		             <view>全部订单</view>
 		    </view>
 		    
@@ -72,21 +80,29 @@
 		<view class="signout" @click="signout" v-if="loginShow">
 			退出登录
 		</view>
-		<view class="kefuicon" @click="gomes">
+		<view class="kefuicon" >
+			<button open-type="contact" type="default" style="background-color: transparent;border-style:none;border:0;" >
 			<image src="../static/usercenter/service.png" mode="widthFix"></image>
+			</button>
 		</view>
 	</view>
 </template>
 
 <script>
+	let that
 export default {
 	data(){
 		return{
-			loginShow:this.$store.state.login
+			loginShow:this.$store.state.login,
+			getuser:this.$store.state.getuser,
+			userMsg:{},
+			phone:''
 		}
 	},
 	onLoad() {
+		that=this
 		this.init()
+		
 	},
 	onShow() {
 		this.init()
@@ -106,6 +122,12 @@ export default {
 			if(token){
 				this.loginShow=true
 			}
+			let userMsg=uni.getStorageSync("userMsg")
+			if(userMsg){
+				this.userMsg=userMsg
+			}
+			let phone=uni.getStorageSync("phone")
+			this.phone=phone
 			// if(!token){
 				
 			// }
@@ -152,15 +174,62 @@ export default {
 				url:"/pages/userCenter/aboutus"
 			})
 		},
+		// 获取用户头像
+		 getUserProfile() {
+		    var that = this;
+		          wx.getUserProfile({
+		            desc: "用于完善用户资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+		            success: (res) => {
+						that.$toast("获取成功")
+		              // that.userMsg = res.userInfo; //这个我有时候获取不到,所以没管它,但先写着
+		              uni.setStorageSync("userMsg", res.userInfo);
+					  that.init()
+		              let setNowTime = Date.now() + 3600 * 1000 * 24 * 30;  
+		              uni.setStorageSync("userInfoStorageTime", setNowTime);
+		            },
+		            fail: function (err) {
+		              console.log(err);
+		            },
+		          });
+		  },
+		  // setUserInfoStorageTime() {
+		  //     let nowTime = Date.now();
+		  //     let oldTime = uni.getStorageSync("userInfoStorageTime");
+		  //     let userInfo = uni.getStorageSync("userMsg");
+		  //     if ( userInfo.nickName != undefined && userInfo.nickName != null && userInfo.nickName != "" ) {
+		  //       if (oldTime && nowTime < oldTime) {
+		  //         that.userMsg=userInfo
+		  //         return;
+		  //       } else {
+		  //         that.getUserProfile();
+		  //       }
+		  //     } else {
+		  //       that.getUserProfile();
+		  //     }
+		  //   },
+		  // })
 		// 退出登录
 		signout(){
-			uni.removeStorageSync('token')
-			uni.removeStorageSync('code')
-			uni.removeStorageSync('phone')
-			this.$store.commit("setToken","")
-			this.$store.commit('getUserInfo',{})
-			this.$store.commit('loginState',null)
-			this.loginShow=this.$store.state.login
+			uni.showModal({
+				title:"提示",
+				content:"是否退出?",
+				success: (res) => {
+					if(res.confirm){
+						this.$toast("退出成功")
+						uni.removeStorageSync('token')
+						uni.removeStorageSync('code')
+						uni.removeStorageSync('phone')
+						uni.removeStorageSync('userMsg')
+						this.userMsg={}
+						this.$store.commit("setToken","")
+						this.$store.commit('getUserInfo',{})
+						this.$store.commit('loginState',null)
+						this.loginShow=this.$store.state.login
+						this.init()
+					}
+				}
+			})
+			
 		},
 		
 	}
@@ -182,23 +251,51 @@ export default {
 			width: 100%;
 			box-sizing: border-box;
 			padding: 50rpx 30rpx 65rpx;
-			image{
-				width: 100%;
-				position: absolute;
-				left: 0;
-				top: 0;
-				z-index: -1;
+			.topbg{
+				image{
+					width: 100%;
+					height: 288rpx;
+					position: absolute;
+					left: 0;
+					top: 0;
+					z-index: -1;
+				}
 			}
+			
 			.userTop-content{
 				display: flex;
 				align-items: center;
 			}
+			.userinfo{
+				
+			}
+			.getnewname{
+				display: flex;
+				align-items: center;
+			}
+			.getnew{
+				font-size: 22rpx;
+				display: block;
+				margin-left: 40rpx;
+				padding:5rpx 10rpx ;
+				border: 1rpx solid #555555;
+				border-radius: 8rpx;
+			}
+			.phonenumber{
+				padding-top: 10rpx;
+			}
 			.avatar{
 				width: 172rpx;
 				height: 172rpx;
 				border-radius: 50%;
-				background-color: pink;
+				// background-color: pink;
 				margin-right: 30rpx;
+				border: 5rpx solid rgba(216, 227, 224, 0.5);
+				image{
+					width: 100%;
+					height: 100%;
+					border-radius: 50%;
+				}
 			}
 			.login{
 				text-align: center;
@@ -225,6 +322,10 @@ export default {
 			text-align: center;
 			.flex-item{
 				flex: 1;
+				image{
+					width: 120rpx;
+					height: 120rpx;
+				}
 			}
 			.line{
 				width: 1px;
@@ -246,11 +347,15 @@ export default {
 		}
 		
 		.kefuicon{
+			button::after {
+					border: none;
+				}
 			position: absolute;
 			right: 30rpx;
 			bottom: 0;
 			image{
 				width: 136rpx;
+				height: 136rpx;
 			}
 		}
 	}

+ 222 - 0
pages/userCenter/editMsg.vue

xqd
@@ -0,0 +1,222 @@
+<template>
+	<view class="edit">
+		<view class="form">
+			<u--form labelPosition="left" :model="form" :rules="rules" ref="form1">
+				<u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1" labelWidth="200rpx">
+					<u--input v-model="form.userInfo.name" border="none" placeholder="填写真实姓名"
+						placeholderStyle="color: #555555"></u--input>
+				</u-form-item>
+
+				<u-form-item label="性别" labelWidth="200rpx" prop="userInfo.gender" borderBottom
+					@click="showgender = true;" ref="item1">
+					<picker @change="bindPickerChange" :value="index" :range="genderArray">
+						<view class="" style="display: flex;">
+							<u--input v-model="form.userInfo.gender" disabled disabledColor="#ffffff" placeholder="选择性别"
+								placeholderStyle="color: #555555" border="none"></u--input>
+							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
+						</view>
+					</picker>
+				</u-form-item>
+
+				<u-form-item label="出生日期" labelWidth="200rpx" borderBottom ref="item1">
+					<picker  mode="date"  :value="form.userInfo.birthday"  start="1922-01-01"  @change="bindDateChange">
+						<view class="" style="display: flex;">
+							<u--input v-model="form.userInfo.birthday" disabled disabledColor="#ffffff"
+								placeholder="选择出生日期" placeholderStyle="color: #555555" border="none"></u--input>
+							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
+						</view>
+
+					</picker>
+				</u-form-item>
+
+				<u-form-item label="邮箱" labelWidth="200rpx" borderBottom ref="item1" prop="userInfo.email">
+					<u--input v-model="form.userInfo.email" border="none" placeholder="填写邮箱"
+						placeholderStyle="color: #555555"></u--input>
+				</u-form-item>
+
+				<u-form-item label="证件类型" labelWidth="200rpx" borderBottom ref="item1" prop="userInfo.certificate_type">
+					<picker @change="bindType" :value="index" :range="typeArray">
+						<view class="" style="display: flex;">
+							<u--input v-model="form.userInfo.certificate_type" disabled disabledColor="#ffffff"
+								placeholder="选择证件类型" placeholderStyle="color: #555555" border="none"></u--input>
+							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
+						</view>
+					</picker>
+				</u-form-item>
+
+				<u-form-item label="证件号码" labelWidth="200rpx" prop="userInfo.certificate_no" borderBottom ref="item1">
+					<u--input v-model="form.userInfo.certificate_no" border="none" placeholder="填写证件号码"
+						placeholderStyle="color: #555555"></u--input>
+				</u-form-item>
+			</u--form>
+		</view>
+
+		<view class="navbar" @click="save" v-if="!editbtn">
+			保存
+		</view>
+		<view class="navbar" @click="editMsg" v-if="editbtn">
+			修改
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 性别选择
+				genderArray: ['男', '女'],
+				// 证件类型
+				typeArray: ["身份证", "临时身份证", "士兵证", "暂住证", "外交护照", "普通护照", "台湾居民来往大陆通行证", "港澳居民来往内地通行证", "港澳同胞回乡证",
+					"其他证件(包括联合国通行证 欧洲共同体护照等)"
+				],
+				// index:0,
+				form: {
+					userInfo: {
+						name: '',
+						gender: '',
+						email: '',
+						birthday: "",
+						certificate_type: '',
+						certificate_no: ''
+					},
+				},
+				actions: [{
+						name: '男',
+					},
+					{
+						name: '女',
+					}
+				],
+				rules: {
+					'userInfo.name': {
+						type: 'string',
+						required: true,
+						message: '请填写姓名',
+						trigger: ['blur', 'change']
+					},
+					'userInfo.gender': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请选择男或女',
+						trigger: ['blur', 'change']
+					},
+					'userInfo.email': {
+						type: 'string',
+						required: true,
+						message: '请填写邮箱',
+						trigger: ['blur', 'change']
+					},
+					"userInfo.certificate_no": {
+						type: 'string',
+						len: 18,
+						required: true,
+						message: '请填写正确的证件号',
+						trigger: ['blur']
+					},
+					"userInfo.certificatesType": {
+						type: 'string',
+						required: true,
+						message: '请填写证件类型',
+						trigger: ['blur', 'change']
+					},
+				},
+				radio: '',
+				switchVal: false,
+				editbtn: false
+			};
+		},
+		onLoad(o) {
+			if (o.form) {
+				let form = JSON.parse(o.form)
+				this.form.userInfo = form
+			}
+
+		},
+		methods: {
+
+			// 选择性别
+			bindPickerChange(e) {
+				console.log('picker发送选择改变,携带值为', e.detail.value)
+				console.log(this.genderArray[e.detail.value])
+				this.form.userInfo.gender = this.genderArray[e.detail.value]
+			},
+			// 选择护照类型
+			bindType(e) {
+				this.form.userInfo.certificate_type = this.typeArray[e.detail.value]
+			},
+			// 选择出生日期
+			bindDateChange(e) {
+				console.log(e)
+				this.form.userInfo.birthday = e.detail.value
+			},
+			editMsg() {
+
+			},
+			save() {
+				this.$showLoadding("加载中")
+				let form={
+					name:this.form.userInfo.name,
+					gender: this.form.userInfo.gender,
+					email: this.form.userInfo.email,
+					birthday: this.form.userInfo.birthday,
+					certificate_type:this.form.userInfo.certificate_type,
+					certificate_no: this.form.userInfo.certificate_no
+				}
+				if (this.form.userInfo.gender == "男") {
+					form.gender = 1
+				} else {
+					form.gender = 2
+				}
+				if (this.form.userInfo.certificate_type== "身份证") {
+					form.certificate_type = 1
+				}
+				uni.$u.http.post('/api/user/edit', form, {
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.hideLoading()
+					this.$toast("保存成功")
+					uni.navigateTo({
+						url: "/pages/userCenter/userEdit"
+					})
+				}).catch((err) => {
+					uni.hideLoading()
+					this.$toast(err.message)
+				})
+			}
+		}
+	};
+</script>
+
+<style lang="less">
+	.u-form-item__body.data-v-5e7216f1 {
+		padding: 18px 0 !important;
+	}
+
+	page {
+		background-color: #F4F4F4;
+	}
+
+	.form {
+		background-color: #ffffff;
+		border-radius: 8rpx 32rpx 8rpx 32rpx;
+		padding: 30rpx 30rpx 0;
+		margin: 20rpx 30rpx 0;
+	}
+
+	.navbar {
+		width: 100%;
+		height: 104rpx;
+		line-height: 104rpx;
+		background: #1E9F6A;
+		border-radius: 16rpx 16rpx 0px 0px;
+		color: #FFFFFF;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		text-align: center;
+	}
+</style>

+ 129 - 25
pages/userCenter/userEdit.vue

xqd xqd xqd xqd xqd xqd
@@ -3,13 +3,13 @@
 		<view class="form">
 			<u--form labelPosition="left" :model="form" :rules="rules" ref="form1" >
 				<u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"  labelWidth="200rpx">
-					<u--input v-model="form.userInfo.name" border="none" placeholder="填写真实姓名" placeholderStyle="color: #555555"></u--input>
+					<u--input v-model="form.userInfo.name" border="none" placeholder="填写真实姓名" placeholderStyle="color: #555555"  disabledColor="#fff" @blur="changeAll(1)"></u--input>
 				</u-form-item>
 					
 				<u-form-item label="性别" labelWidth="200rpx"  prop="userInfo.gender" borderBottom @click="showgender = true;" ref="item1">
 					<picker @change="bindPickerChange" :value="index" :range="genderArray">
 						<view class="" style="display: flex;">
-							<u--input v-model="form.userInfo.gender" disabled disabledColor="#ffffff" placeholder="选择性别" placeholderStyle="color: #555555" border="none"></u--input>
+							<u--input v-model="form.userInfo.gender" disabled disabledColor="#ffffff" placeholder="选择性别" placeholderStyle="color: #555555" border="none" ></u--input>
 							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
 						</view>
 					</picker>
@@ -18,19 +18,19 @@
 				<u-form-item label="出生日期" labelWidth="200rpx"  borderBottom ref="item1">
 					 <picker  mode="date" :value="form.userInfo.birthday" start="1922-01-01" @change="bindDateChange" >
 						 <view class="" style="display: flex;">
-						 	<u--input v-model="form.userInfo.birthday" disabled disabledColor="#ffffff" placeholder="选择出生日期" placeholderStyle="color: #555555" border="none" ></u--input>
+						 	<u--input v-model="form.userInfo.birthday" disabled disabledColor="#ffffff" placeholder="选择出生日期" placeholderStyle="color: #555555" border="none"></u--input>
 						 	<u-icon slot="right" name="arrow-right" size="28"></u-icon>
 						 </view>
 					
 					 </picker>
 				</u-form-item>
 				
-				<u-form-item label="邮箱" labelWidth="200rpx"  borderBottom ref="item1" >
-				    <u--input v-model="form.userInfo.email" border="none" placeholder="填写邮箱" placeholderStyle="color: #555555"></u--input>
+				<u-form-item label="邮箱" labelWidth="200rpx"  borderBottom ref="item1" prop="userInfo.email">
+				    <u--input v-model="form.userInfo.email" border="none" placeholder="填写邮箱" placeholderStyle="color: #555555"  disabledColor="#fff"  @blur="changeAll(2)"></u--input>
 				</u-form-item>
 				
 				<u-form-item label="证件类型" labelWidth="200rpx"  borderBottom ref="item1" prop="userInfo.certificate_type">
-					<picker @change="bindType" :value="index" :range="typeArray">
+					<picker @change="bindType" :value="index" :range="typeArray" >
 						<view class="" style="display: flex;">
 							<u--input v-model="form.userInfo.certificate_type" disabled disabledColor="#ffffff" placeholder="选择证件类型" placeholderStyle="color: #555555" border="none" ></u--input>
 							<u-icon slot="right" name="arrow-right" size="28"></u-icon>
@@ -38,16 +38,18 @@
 					</picker>
 				</u-form-item>
 				
-				<u-form-item label="证件号码" labelWidth="200rpx"  prop="userInfo.certificatesNumber"  borderBottom ref="item1" >
-				     <u--input v-model="form.userInfo.certificatesNumber" border="none" placeholder="填写证件号码" placeholderStyle="color: #555555"></u--input>
+				<u-form-item label="证件号码" labelWidth="200rpx"  prop="userInfo.certificate_no"  borderBottom ref="item1" >
+				     <u--input v-model="form.userInfo.certificate_no" border="none" placeholder="填写证件号码" placeholderStyle="color: #555555"   disabledColor="#fff"  @blur="changeAll(3)"></u--input>
 				    </u-form-item>
 			    </u--form>
 		</view>
 		
-		
-		<view class="navbar">
+		<!-- <view class="navbar" @click="save" v-if="!editbtn">
 			保存
 		</view>
+		<view class="navbar" @click="editMsg" v-if="editbtn">
+			修改
+		</view> -->
 	</view>
 </template>
 			
@@ -58,7 +60,7 @@
 				// 性别选择
 				 genderArray: ['男', '女'],
 				 // 证件类型
-				 typeArray:["居民身份证","临时身份证","士兵证","暂住证","外交护照","普通护照","台湾居民来往大陆通行证","港澳居民来往内地通行证","港澳同胞回乡证","其他证件(包括联合国通行证 欧洲共同体护照等)"],
+				 typeArray:["身份证"],
 				 // index:0,
 				form: {
 					userInfo: {
@@ -67,7 +69,7 @@
 					email:'',
 					birthday:"",
 					certificate_type:'',
-					certificatesNumber:''
+					certificate_no:''
 					},
 				},
 				actions: [
@@ -88,40 +90,142 @@
 						message: '请选择男或女',
 						trigger: ['blur', 'change']
 					},
-					"userInfo.certificatesNumber":{
-						type: 'string',
-						len: 18,
-						required: true,
-						message: '请填写正确的证件号',
-						trigger: ['blur']
-					},
-					"userInfo.certificatesType":{
+					'userInfo.email': {
 						type: 'string',
 						required: true,
-						message: '请填写证件类型',
+						message: '请填写邮箱',
 						trigger: ['blur', 'change']
 					},
+					// "userInfo.certificate_no":{
+					// 	type: 'string',
+					// 	required: true,
+					// 	message: '请填写正确的证件号',
+					// 	trigger: ['blur']
+					// },
+					// "userInfo.certificatesType":{
+					// 	type: 'string',
+					// 	required: true,
+					// 	message: '请填写证件类型',
+					// 	trigger: ['blur', 'change']
+					// },
 				},
 				radio: '',
-				switchVal: false
+				switchVal: false,
+				editbtn:false
 			};
 		},
+		onLoad() {
+			this.init()
+			
+		},
 		methods: {
+			init(){
+				this.$showLoadding("加载中")
+				uni.$u.http.post('/api/user/show',{
+					custom: {
+						auth: true
+					}
+				}).then((res) => {
+					uni.hideLoading()
+					if(res){
+						let form=res
+						
+						if(form.gender==1){
+							form.gender="男"
+						}else{
+							form.gender="女"
+						}
+						if(form.certificate_type==1){
+							form.certificate_type="身份证"
+						}
+						this.form.userInfo=form
+						this.editbtn=true
+					}
+					
+				}).catch((err) => {
+					uni.hideLoading()
+					console.log( err)
+				})
+			},
+			changeAll(e){
+				console.log(e)
+				if(e==2){
+					if(!this.$util.email(this.form.userInfo.email)){
+						console.log(8888)
+						this.$toast("请填写正确的邮箱")
+						return
+					}
+				}
+				if(e==3){
+					if(!this.$util.idCard(this.form.userInfo.certificate_no)){
+						console.log(8888)
+						this.$toast("请填写正确的身份证号码")
+						return
+					}
+				}
+				this.save()
+			},
 			// 选择性别
 			bindPickerChange(e) {
-			    console.log('picker发送选择改变,携带值为', e.detail.value)
-				console.log(this.genderArray[e.detail.value])
+			   
 			   this.form.userInfo.gender=this.genderArray[e.detail.value]
+			   this.save()
 			},
 			// 选择护照类型
 			bindType(e) {
+				
 			   this.form.userInfo.certificate_type=this.typeArray[e.detail.value]
+			   // this.save()
 			},
 			// 选择出生日期
 			bindDateChange (e) {
-			    console.log(e)
 			    this.form.userInfo.birthday  = e.detail.value
+				this.save()
 			},
+			editMsg(){
+				uni.navigateTo({
+					url:"/pages/userCenter/editMsg?form="+JSON.stringify(this.form.userInfo)
+				})
+			},
+			save(){
+				this.$showLoadding("加载中")
+				let form={
+					name:this.form.userInfo.name,
+					gender: this.form.userInfo.gender,
+					email: this.form.userInfo.email,
+					birthday: this.form.userInfo.birthday,
+					certificate_type:this.form.userInfo.certificate_type,
+					certificate_no: this.form.userInfo.certificate_no
+				}
+				if (this.form.userInfo.gender == "男") {
+					form.gender = 1
+				} else {
+					form.gender = 2
+				}
+				if (this.form.userInfo.certificate_type== "身份证") {
+					form.certificate_type = 1
+				}
+				// if(!this.$util.email(form.email)){
+				// 	this.$toast("请填写正确的邮箱")
+				// 	return
+				// }
+				
+				setTimeout(()=>{
+					uni.$u.http.post('/api/user/edit',form,{
+						custom: {
+							auth: true
+						}
+					}).then((res) => {
+						uni.hideLoading()
+						// this.init()
+						this.$toast("保存成功")
+					}).catch((err) => {
+						uni.hideLoading()
+						this.$toast(err.message)
+					})
+				},500)
+				
+			}
 		}
     };
 </script>

+ 17 - 31
project.config.json

xqd xqd
@@ -1,7 +1,8 @@
 {
-  "description": "项目配置文件",
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
   "packOptions": {
-    "ignore": []
+    "ignore": [],
+    "include": []
   },
   "setting": {
     "bundle": false,
@@ -31,39 +32,24 @@
     "packNpmRelationList": [],
     "minifyWXSS": true,
     "showES6CompileOption": false,
-    "minifyWXML": true
+    "minifyWXML": true,
+    "useStaticServer": true,
+    "checkInvalidKey": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "disableUseStrict": false,
+    "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.24.4",
   "appid": "wxdc8ecff90bf3f4c3",
   "projectname": "miniprogram-2",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "scripts": {},
-  "staticServerOptions": {
-    "baseURL": "",
-    "servePath": ""
-  },
-  "isGameTourist": false,
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "plugin": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
-    }
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
   }
 }

+ 8 - 0
project.private.config.json

xqd
@@ -0,0 +1,8 @@
+{
+  "projectname": "miniprogram-2",
+  "setting": {
+    "compileHotReLoad": true
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "libVersion": "2.23.4"
+}

BIN
static/bghesd.png


BIN
static/success.png


+ 17 - 4
store/index.js

xqd xqd xqd
@@ -16,7 +16,9 @@ const store = new Vuex.Store({
 	// 已选出行人
 	peopleList:[],
 	// c出行人列表
-	list:[]
+	list:[],
+	getuser:false,
+	userMsg:{},
   },
   mutations:{
 	setToken(state, token) {
@@ -32,7 +34,7 @@ const store = new Vuex.Store({
     loginState(state, token) {
  	state.login = token ? true : false;
  	state.token = token;
-	console.log(state.login,"<==============是否登录")
+	
  	// uni.setStorage({
  	// 	key: 'token',
  	// 	data: token,
@@ -50,15 +52,26 @@ const store = new Vuex.Store({
 	   state.peopleList=arr
 	    // console.log(state.peopleList,"<==============选择人")
    },
+   getuser(state, data) {
+       state.getuser = data;
+   },
+   getuserMsg(state,userMsg) {
+       return state.userMsg;
+   },
   },
   actions:{
  
   },
   getters:{
- 
+	getuser(state) {
+	    return state.getuser;
+	},
+	getuserMsg(state) {
+	    return state.userMsg;
+	},
   },
   modules:{
-    
+   
   }
 })
 //3.导出使用