zhangdan 4 lat temu
rodzic
commit
e959997ae3

+ 3 - 3
App.vue

@@ -1,9 +1,9 @@
 <script>
 	// const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
-	const uat_domain = 'http://192.168.16.217:8305' // 本地
+	const uat_domain = 'http://192.168.16.224:8308' // 本地
 	const pro_domain = 'https://gather.zyucgj.cn' // 生产
-	const uat_URL = uat_domain+'/gc-gather/' // 预发布
-	const pro_URL = pro_domain+'/gc-gather/'  // 生产
+	const uat_URL = uat_domain+'/gc-cust/' // 预发布
+	const pro_URL = pro_domain+'/gc-cust/'  // 生产
 	const buildType = 1 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
 	const envText = ['预发布环境','生产环境']

+ 23 - 18
api/data.js

@@ -6,32 +6,37 @@ export const getLookUpDatas = (params) => {
     method: 'get'
   })
 }
-// 开箱操作
-export const openDevice = (params) => {
+
+// 查询所有数据字典
+export const listLookUp = (params) => {
+  let url = `lookup/findAll`
   return axios.request({
-    url: `device/ctl/open`,
-    method: 'post',
-	data: params
-  })
+    url: url,
+    method: 'post'
+  }).then(res => res)
 }
-//查询省
-export const  getProvince = () => {
+
+// 
+export const userInfoSave = (params) => {
   return axios.request({
-    url: `area/PROVINCE`,
-    method: 'get'
+    url: `reserve/user/info/saveMould`,
+    method: 'post',
+	data:params
   })
 }
-//查询市
-export const  getCityByPro = params => {
+// 用户信息保存
+export const yuyueInfoSave = (params) => {
   return axios.request({
-    url: `area/CITY/${params.id}`,
-    method: 'get'
+    url: `reserve/save`,
+    method: 'post',
+	data:params
   })
 }
-//查询区
-export const  getDistrictByCity = params => {
+
+// 查询用户信息
+export const userDetail = (params) => {
   return axios.request({
-    url: `area/DISTRICT/${params.id}`,
-    method: 'get'
+    url: `reserve/user/info/findNewMould`,
+    method: 'get',
   })
 }

+ 26 - 17
api/index.js

@@ -1,35 +1,44 @@
 import axios from '@/libs/axios.js'
-// 新增采集信息
-export const gatherList = params => {
+// 获取banner数据
+export const getBannerList = params => {
   return axios.request({
-    url: `gather/query/${params.pageNo}/${params.pageSize}`,
+    url: `banner/queryList`,
     method: 'post',
-	data: params
+	data: {}
   })
 }
 
-// 查询采集信息详情
-export const gatherDetail = (params) => {
+// 获取垃圾分类
+export const geRubbishType = params => {
   return axios.request({
-    url: `gather/findById/${params.id}`,
-    method: 'get',
+    url: `rubbish/type/queryList`,
+    method: 'post',
+	data: {}
   })
 }
 
-// 采集信息总计
-export const gatherTotal = (params) => {
+// 查询附近有无骑手可接单
+export const searchRider = (params) => {
   return axios.request({
-    url: `gather/sumByOperator`,
+    url: `userExt/queryNearRiderListBoolean`,
     method: 'post',
 	data: params
   })
 }
 
-// 保存采集信息详情
-export const gatherSave = (params) => {
+
+// 查询采集信息详情
+export const gatherDetail = (params) => {
+  return axios.request({
+    url: `gather/findById/${params.id}`,
+    method: 'get',
+  })
+}
+
+// 获取订单状态
+export const orderStatus = (params) => {
   return axios.request({
-    url: `gather/save`,
-    method: 'post',
-	data:params
+    url: `reserve/findNewOne`,
+    method: 'get',
   })
-}
+}

+ 1 - 1
api/login.js

@@ -36,7 +36,7 @@ export const checkLogin = () => {
 // 获取登录用户信息
 export const getUserInfo = params => {
   return axios.request({
-    url: `user/userInfo`,
+    url: `customer/findById`,
     method: 'get'
   })
 };

+ 11 - 0
api/order.js

@@ -0,0 +1,11 @@
+import axios from '@/libs/axios.js'
+
+// 获取订单列表
+export const getOrderList = params => {
+  return axios.request({
+    url: `reserve/queryList`,
+    method: 'post',
+	data: params
+  })
+}
+

+ 119 - 0
components/select/v-select.vue

@@ -0,0 +1,119 @@
+<template>
+	<picker @change="toChange" :value="index" :range="datalist" range-key="dispName">
+		<view style="display: flex;align-items: center;justify-content: space-between;">
+			<input class="form-input" :disabled="disabled" v-model="selected" placeholder-class="form-input-placeholder placeholder" :placeholder="placeholderText" />
+			<u-icon name="arrow-right" color="#c0c4cc"></u-icon>
+		</view>
+	</picker>
+</template>
+
+<script>
+import { getLookUpDatas, listLookUp } from '@/api/data'
+export default {
+  name: 'v-select',
+  data () {
+    return {
+      selected: '',
+      datalist: [],
+      placeholderText: '请选择',
+      lookUp: [],
+	  index: 0
+    }
+  },
+  props: {
+    disabled: {
+      type: [Boolean, String],
+      default: false
+    },
+    multiple: {
+      type: [Boolean, String],
+      default: false
+    },
+    value: [String, Number, Array],
+    code: {
+      type: String,
+      required: true
+    },
+    placeholder: {
+      type: String,
+      default: ''
+    },
+    size: [String]
+  },
+  computed: {
+    getVal () {
+      return this.value
+    },
+    // getPlaceholderText () {
+    //   let _this = this
+    //   for (let i = 0; i < _this.lookUp.length; i++) {
+    //     if (_this.lookUp[i].code == _this.code) {
+    //       if (this.placeholder === '') _this.placeholderText = _this.lookUp[i].name
+    //       break
+    //     }
+    //   }
+    //   return _this.placeholderText
+    // }
+  },
+  created () {
+    if (this.code) {
+      if (this.placeholder) {
+        this.placeholderText = this.placeholder
+      }
+      getLookUpDatas({
+        type: this.code
+      }).then(result => {
+		  console.log(result, 'result')
+        if (result && result.status + '' === '200') {
+          this.datalist = result.data
+          
+        }
+      })
+    } else {
+      // console.log('请确认传递类型')
+    }
+    // 获取所有数据字典
+    this.lookUp = this.$store.state.vuex_allLookUp
+  },
+  methods: {
+    getDataList (){
+      return this.datalist
+    },
+    getOptionName (val) {
+      return this.datalist.find((item) => {
+        return item.code == val
+      })
+    },
+    getCodeByName (dispName) {
+      return this.datalist.find((item) => {
+        return item.dispName == dispName
+      })
+    },
+	resetVal(){
+		this.selected = ''
+		this.index = 0
+	},
+	// 赋值
+	setVal(code){
+		let index = this.datalist.findIndex(item=>{
+			return item.code == code
+		})
+		console.log(this.datalist,code,index)
+		this.index = index
+		this.selected = this.datalist[index].dispName
+	},
+    toChange (e) {
+		this.index = e.target.value
+		this.selected = this.datalist[this.index].dispName
+        this.$emit('itemChange', this.datalist[this.index].code)
+    }
+  }
+
+}
+</script>
+
+<style scoped>
+	/* .placeholder{
+		color:"#c0c4cc" !important
+	} */
+</style>

+ 1 - 1
package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "zxyj-rider-mini-html",
+  "name": "zxyj-cust-mini-html",
   "version": "1.0.0",
   "lockfileVersion": 1,
   "requires": true,

+ 2 - 2
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "zxyj-rider-mini-html",
+  "name": "zxyj-cust-mini-html",
   "version": "1.0.0",
   "description": "",
   "main": "main.js",
@@ -8,7 +8,7 @@
   },
   "repository": {
     "type": "git",
-    "url": "http://git.chelingzhu.com/chelingzhu-web/zxyj-rider-mini-html.git"
+    "url": "http://git.chelingzhu.com/chelingzhu-web/zxyj-cust-mini-html.git"
   },
   "keywords": [],
   "author": "",

+ 84 - 40
pages/index/index.vue

@@ -12,11 +12,11 @@
 			<view class="bottom-new-notice">
 				<view class="notice-content">
 					<view class="notice-content-item"><span class="t-icon t-icon-home_icon_bells"></span><span class="item-title">最新通知</span></view>
-					<view class="notice-content-item">骑手<span>已接单,</span>请耐心等待</view>
-					<view class="notice-content-item">2020-05-20 15:30</view>
+					<view class="notice-content-item">骑手<span>{{orderStatusText ? orderStatusText :''}},</span>请耐心等待</view>
+					<view class="notice-content-item">{{orderTime ? orderTime :''}}</view>
 				</view>
 				<view class="notice-static">
-					<span class="notice-static-text">已接单</span>
+					<span class="notice-static-text">{{orderStatusText ? orderStatusText :''}}</span>
 				</view>
 			</view>
 			<!-- 回收指引 -->
@@ -24,42 +24,47 @@
 				<u-image src="/static/houme_bg_guide.png" mode="" height="160"></u-image>
 			</view>
 			<!-- 收回统计 -->
-			<view class="statistics-title">今日回收统计</view>
-			<view class="bottom-statistics">
+			<view class="statistics-title">今日上门回收价格</view>
+			<view class="bottom-statistics" v-if="hasLogin">
 				<view class="statistics-rubbishType">
 					<view class="statistics-box">
-						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_paper" style="display: inline-block;margin: 0 10upx;"></span>纸质类</view>
+						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_paper" style="display: inline-block;margin: 0 10upx;"></span>{{rubbishPaperName ? rubbishPaperName :''}}</view>
 						<view v-for="item in rubbishPaperList" class="rubbishType-item">
-							<view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
+							<view>{{item.name ? item.name+':' :''}}{{item.customerPrice ? (item.customerPrice/1000).toFixed(2)/1 :0}} 元/kg</view>
 						</view>
 					</view>
 					<view class="statistics-box">
-						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_clothing" style="display: inline-block;margin: 0 10upx;"></span>衣物&其他</view>
+						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_clothing" style="display: inline-block;margin: 0 10upx;"></span>{{rubbishYWName ? rubbishYWName :''}}</view>
 						<view v-for="item in rubbishYWList" class="rubbishType-item">
-							<view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
+							<view>{{item.name ? item.name+':' :''}}{{item.customerPrice ? (item.customerPrice/1000).toFixed(2)/1 :0}} 元/kg</view>
 						</view>
 					</view>
 				</view>
 				<view class="statistics-rubbishType">
 					<view class="statistics-box">
-						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_plastic" style="display: inline-block;margin: 0 10upx;"></span>塑料类</view>
+						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_plastic" style="display: inline-block;margin: 0 10upx;"></span>{{rubbishSLName ? rubbishSLName :''}}</view>
 						<view v-for="item in rubbishSLList" class="rubbishType-item">
-							<view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
+							<view>{{item.name ? item.name+':' :''}}{{item.customerPrice ? (item.customerPrice/1000).toFixed(2)/1 :0}} 元/kg</view>
 						</view>
 					</view>
 					<view class="statistics-box">
-						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_metal" style="display: inline-block;margin: 0 10upx;"></span>金属类</view>
+						<view class="rubbishType-type"><span class="t-icon t-icon-home_icon_metal" style="display: inline-block;margin: 0 10upx;"></span>{{rubbishJSName ? rubbishJSName :''}}</view>
 						<view v-for="item in rubbishJSList" class="rubbishType-item">
-							<view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
+							<view>{{item.name ? item.name+':' :''}}{{item.customerPrice ? (item.customerPrice/1000).toFixed(2)/1 :0}} 元/kg</view>
 						</view>
 					</view>
 				</view>
 			</view>
+			<view class="nodata" v-if="!hasLogin">
+				<u-empty :text="noDataText" mode="data"></u-empty>
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {getBannerList,geRubbishType,orderStatus} from '@/api/index'
+	import { checkLogin } from '@/api/login.js' 
 	export default {
 		components: {  },
 		data() {
@@ -69,14 +74,23 @@
 					borderRadius: "12px",
 					color:'#fff',
 				},
-				bannerList:[{image:"/static/banner.jpg"},{image:"/static/banner.jpg"},{image:"/static/banner.jpg"}],
-				rubbishPaperList:[{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'}],
-				rubbishSLList:[{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'}],
-				rubbishYWList:[{name:'衣物',weight:'6000'}],
-				rubbishJSList:[{name:'钛',weight:'6000'},{name:'钛',weight:'6000'},{name:'钛',weight:'6000'}]
+				hasLogin:false, // 是否登录
+				noDataText:"", // 未登录提示文字
+				orderStatusText:'', // 订单状态
+				orderTime:'', // 
+				bannerList:[],
+				rubbishPaperName:"",
+				rubbishSLName:"",
+				rubbishYWName:"",
+				rubbishJSName:"",
+				rubbishPaperList:[],
+				rubbishSLList:[],
+				rubbishYWList:[],
+				rubbishJSList:[]
 			}
 		},
 		onLoad() {
+			this.pageInit()
 		},
 		onUnload() {
 			
@@ -86,30 +100,60 @@
 		onShareTimeline(res) {
 		},
 		onShow() {
-			// checkLogin().then(res => {
-			// 	this.hasLogin = res.status == 200
-			// 	if(this.hasLogin){
-			// 		// this.pageInit()
-			// 	} else {
-			// 		this.noDataText = '您尚未登录或登录已过期,完成登录后可查看录入信息!'
-			// 	}
-			// })
+			checkLogin().then(res => {
+				this.hasLogin=res.status==200
+				if(this.hasLogin){
+					this.pageInit()
+				}else{
+					this.noDataText="您尚未登录或登录已过期,完成登录后可查看数据信息!"
+				}
+			})
 		},
 		methods: {
-			// pageInit() {
-			// 	this.pageNo = 1
-			// 	this.pageSize = 10
-			// 	this.total = 0
-			// 	this.scrollTop = 0
-			// 	this.otherTotal= 0 // 其它垃圾总和
-			// 	this.jianzhuTotal= 0 // 建筑垃圾总和
-			// 	this.chuyuTotal= 0 // 厨余垃圾总和
-			// 	this.searchForm.beginDate = getDate.getRecentday().starttime
-			// 	this.searchForm.endDate = getDate.getRecentday().endtime
-			// 	console.log(this.searchForm,'this.searchForm')
-			// 	this.searchHandle()
-			// 	this.getTotal()
-			// },
+			pageInit() {
+				this.getBanner()
+				this.geRubbishTypeList()
+				this.getOrderStatus()
+			},
+			// 获取banner图
+			getBanner(){
+				getBannerList().then(res=>{
+					if(res.status==200){
+						this.bannerList=res.data || []
+					}
+					console.log(res,'-----banner')
+				})
+			},
+			// 获取订单状态
+			getOrderStatus(){
+				orderStatus().then(res=>{
+					if(res.status==200){
+						this.orderStatusText=res.data.orderStatusDictValue
+						this.orderTime=res.data.createDate
+						console.log(res,'----------订单状态')
+					}
+				})
+			},
+			// 获取垃圾分类
+			geRubbishTypeList(){
+				geRubbishType().then(res=>{
+					if(res.status==200){
+						console.log(res,'---------垃圾类型')
+						const a= res.data.find(item=>item.code=='PAPER')
+						const b= res.data.find(item=>item.code=='PLASTIC')
+						const c= res.data.find(item=>item.code=='CLOTHES')
+						const d= res.data.find(item=>item.code=='METAL')
+						this.rubbishPaperList=a.rubbishTypeVOList
+						this.rubbishSLList=b.rubbishTypeVOList
+						this.rubbishYWList=c.rubbishTypeVOList
+						this.rubbishJSList=d.rubbishTypeVOList
+						this.rubbishPaperName=a.name
+						this.rubbishSLName=b.name
+						this.rubbishYWName=c.name
+						this.rubbishJSName=d.name
+					}
+				})
+			},
 			gotoYueYu(){
 				uni.navigateTo({
 				    url: '/pages/index/yuyue'

+ 111 - 106
pages/index/userInfo.vue

@@ -3,39 +3,40 @@
 		<view class="content-form">
 			<view class="form-data">
 				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="time" label="用户类型:" >
-							<u-select v-model="show"  mode="mutil-column-auto" :list="list" @confirm="confirm"></u-select>
-							<u-input placeholder="请选择用户类型" v-model="form.time" @click="selectTime" :disabled="true"/>
-							<u-icon name="arrow-right" slot="right" @click="selectTime"></u-icon>
+						<u-form-item prop="time" label="用户类型:" required>
+							<!-- <u-select v-model="show"  mode="mutil-column-auto" :list="list" @confirm="confirm"></u-select> -->
+							 <v-select ref="addressType" placeholder="请选择用户类型" @itemChange="chooseType" code="ORDER_ADDRESS_TYPE" style="width: 100%"></v-select>	
+							<!-- <u-input placeholder="请选择用户类型" v-model="form.addressType" @click="selectTime" :disabled="true"/> -->
+							<!-- <u-icon name="arrow-right" slot="right" @click="selectTime"></u-icon> -->
 						</u-form-item>
-						<u-form-item prop="info" label="用户名称:" >
-							<u-input placeholder="请输入用户名称"  v-model="form.info"/>
+						<u-form-item prop="contactName" label="用户名称:" required>
+							<u-input placeholder="请输入用户名称"  v-model="form.contactName"/>
 						</u-form-item>
-						<u-form-item prop="info" label="联系电话:" >
-							<u-input placeholder="请输入联系电话" v-model="form.info"/>
+						<u-form-item prop="contactMobile" label="联系电话:" required>
+							<u-input placeholder="请输入联系电话" v-model="form.contactMobile"/>
 						</u-form-item>
 				</u-form>
 			</view>
 			<view class="form-data">
 				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="address" label="通讯地址:" >
-							<u-input placeholder="请选择通讯地址" v-model="form.address" @click="selectAddress" :disabled="true"/>
+						<u-form-item prop="contactAddress" label="通讯地址:" required>
+							<u-input placeholder="请选择通讯地址" v-model="form.contactAddress" @click="selectAddress" :disabled="true"/>
 							<u-icon name="arrow-right" slot="right"></u-icon>
 						</u-form-item>
-						<u-form-item prop="info" label="详细信息:" >
-							<u-input placeholder="请输入详细信息" v-model="form.info"/>
+						<u-form-item prop="houseAddress" label="详细信息:" >
+							<u-input placeholder="请输入详细信息" v-model="form.houseAddress"/>
 						</u-form-item>
 				</u-form>
 			</view>
 			<view class="form-data qyImg">
 				<view> 上传图片 <text style="color: #a6a6a6;">(仅可上传1张,10MB以内)</text></view> 
 				<view class="info-main">
-					<view v-if="photograph.length<1 && !isView" class="camera-btn">
+					<view class="camera-btn">
 						<view @click="goPhotograph" class="photograph-camera">
 							<u-icon name="camera" color="#bfbfbf" size="60" ></u-icon>
 						</view>
 					</view>
-					<view v-show="photograph.length" v-for="(item,index) in photograph" :key="index" class="photograph-con">
+					<view v-show="photograph"  class="photograph-con">
 						<u-icon v-show="!isView" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
 						<u-image width="100%" height="100%" :src="item" @click="previewPictures(item)"></u-image>
 					</view>
@@ -54,22 +55,30 @@
 <script>
 	// import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	// import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
-	import {gatherSave,gatherDetail} from '@/api/index.js'
+	import {userInfoSave} from '@/api/data.js'
 	import {saveImgToAliOss} from '@/libs/tools.js'
+	import vSelect  from  '@/components/select/v-select.vue'
 	export default {
-		// components: {
-		// 	uniPopup,uniPopupDialog
-		// },
+		components: {vSelect
+			// uniPopup,uniPopupDialog
+		},
 		data() {
 			return {
 				title:'',
 				loading:false, // 提交按钮加载圈
-				photograph: [], //  图片路径
+				photograph:[],
+				imageHeader:'', //  图片路径
 				form: {
-					time: '', // 其它垃圾
-					info: '', // 厨余垃圾
-					address:'' // 通讯地址
+					addressType:'', // 用户类型
+					contactMobile: '', //联系人手机
+					contactAddress:'' ,// 通讯地址
+					contactName:'', // 联系人名称
+					lat:'', // 通讯地址的经度
+					lng:'', // 通讯地址的纬度
+					houseAddress:'', // 详细地址
+					// imageHeader:'', // 门头照片
 				},
+				contactAddress:'' ,// 通讯地址
 				isView: false ,// 是否是查看详情
 				itemId:'',
 				submitBtn:{
@@ -78,60 +87,6 @@
 					borderRadius: '12px'
 				},
 				show: false,
-				list: [
-					{
-						value: 1,
-						label: '今天',
-						children: [
-							{
-								value: 2,
-								label: '上午(08-13点)',
-							},
-							{
-								value: 3,
-								label: '下午(13-18点)',
-							}
-						]
-					},
-					{
-						value: 4,
-						label: '明天',
-						children: [
-							{
-								value: 5,
-								label: '上午(08-13点)',
-							},
-							{
-								value: 6,
-								label: '下午(13-18点)',
-							}
-						]
-					},
-					{
-						value: 7,
-						label: '后天',
-						children: [
-							{
-								value: 8,
-								label: '上午(08-13点)',
-							},
-							{
-								value: 9,
-								label: '下午(13-18点)',
-							}
-						]
-					},
-				],
-				rules: {
-					time: [
-						{
-							required: true,
-							message: '请选择时间',
-							trigger: ['blur', 'change']
-						}
-					],
-					info:[{required:true,message:'请选择用户信息',trigger:['change']}]
-				}
 			};
 		},
 		onLoad(option) {
@@ -144,7 +99,7 @@
 			}else {
 				console.log('--------新增')
 				this.photograph = []
-				this.form.remarks = ''
+				// this.form.remarks = ''
 				this.$refs.uForm.resetFields()
 			}
 		},
@@ -159,15 +114,24 @@
 			//   	this.form[key] = ret
 			//   })
 			// },
+			// 选择用户类型
+			chooseType(v){
+				this.form.addressType = v
+			},
 			selectAddress(){
-				 wx.chooseLocation({
-				      success: function(res) {
-						  if(res){
-							this.form.address=res,address  
-						  }
-				        console.log(res,'-----------dizhi --------------')
-				      },
-				    })
+				wx.chooseLocation({
+					success:(res)=>{
+						if(res){
+							console.log(res,'--------dizhi ')
+							this.$nextTick(()=>{
+								this.form.contactAddress=res.address
+								this.form.lat=res.latitude
+								this.form.lng=res.longitude
+								console.log(res.address,'-----------res.address',this.form.contactAddress)
+							})
+						}
+					}
+				})
 			},
 			// 选择用户类型
 			selectTime(){
@@ -189,22 +153,22 @@
 				})
 			},
 			// 获取详情数据
-			getDetailData(){
-				gatherDetail({id:this.itemId}).then(res=>{
-					if(res.status==200){
-						console.log(res)
-						const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
-						const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
-						const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
-						this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
-						this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
-						this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
-						this.form.remarks=res.data.remarks
-						this.photograph=res.data.imageUrlList || []
-						console.log(this.form,'this.form')
-					}
-				})
-			},
+			// getDetailData(){
+			// 	gatherDetail({id:this.itemId}).then(res=>{
+			// 		if(res.status==200){
+			// 			console.log(res)
+			// 			const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
+			// 			const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
+			// 			const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
+			// 			this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
+			// 			this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
+			// 			this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
+			// 			this.form.remarks=res.data.remarks
+			// 			this.photograph=res.data.imageUrlList || []
+			// 			console.log(this.form,'this.form')
+			// 		}
+			// 	})
+			// },
 			// 拍照或从相册选图片
 			goPhotograph() {
 				uni.chooseImage({
@@ -213,7 +177,7 @@
 				    sourceType: ['album','camera'], //从相册选择
 				    success:  (res) =>{
 						console.log(res,'rrrrrrrrrrr')
-				        console.log(JSON.stringify(res.tempFilePaths));
+				        console.log(JSON.stringify(res.tempFilePaths),'----------------------------------');
 						console.log(this.photograph.length,'this.photograph')
 						if(res.tempFiles[0].size>10485760){
 							uni.showToast({
@@ -227,9 +191,8 @@
 							mask: true
 						})
 						saveImgToAliOss(res.tempFilePaths[0],(ret)=>{
-							// console.log(ret,'----------ret')
 							this.photograph.push(ret.data)
-							// _this.photograph = ret.data
+							// this.photograph = ret.data
 							uni.hideLoading()
 						})
 				    }
@@ -245,7 +208,7 @@
 			//  删除图片
 			cancelPhotograph(index) {
 				setTimeout(() => {
-					this.photograph.splice(index,1)
+					this.photograph.splice(index)
 				}, 500);
 			},
 			// 提交
@@ -253,6 +216,48 @@
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						console.log('验证通过');
+						if (this.form.addressType =='') {
+							uni.showToast({
+								title: '请选择用户类型',
+								icon: 'none'
+							})
+							return false
+						}
+						const testVal=/^1[34578]\d{9}$/
+						if (!testVal.test(this.form.contactMobile)) {
+							uni.showToast({
+								title: '请输入正确的联系电话',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.contactName==='') {
+							uni.showToast({
+								title: '请输入用户名称',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.contactAddress ==='') {
+							uni.showToast({
+								title: '请输入通讯地址',
+								icon: 'none'
+							})
+							return false
+						}
+						let params=this.form
+						console.log(params,'--------用户信息')
+						userInfoSave(params).then(res=>{
+							if(res.status==200){
+								setTimeout(()=>{
+									wx.navigateTo({
+										url: '/pages/index/yuyue'
+									})
+								},300)
+							}
+							console.log(res,'------------res')
+						})
+						
 					} else {
 						console.log('验证失败');
 					}
@@ -340,7 +345,7 @@
 			font-style: normal;
 		}
 		.form-data{
-			padding: 0 30upx;
+			padding: 0 30upx 0 50upx;
 			margin-bottom: 20upx;
 			background-color: #fff;
 		}

+ 165 - 54
pages/index/yuyue.vue

@@ -10,27 +10,27 @@
 			</view>
 			<view class="form-data">
 				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="time" label="预约时间:" >
+						<u-form-item prop="time" label="预约时间:" required>
 							<u-select v-model="show"  mode="mutil-column-auto" :list="list" @confirm="confirm"></u-select>
-							<u-input placeholder="请选择预约时间" v-model="form.time" @click="selectTime" :disabled="true"/>
+							<u-input placeholder="请选择预约时间" v-model="time" @click="selectTime" :disabled="true"/>
 							<u-icon name="arrow-right" slot="right"  @click="selectTime"></u-icon>
 						</u-form-item>
-						<u-form-item prop="info" label="用户信息:" >
+						<u-form-item prop="info" label="用户信息:" required>
 							<u-input placeholder="请选择用户信息" v-model="form.info" @click="selectUserInfo" :disabled="true"/>
 							<u-icon name="arrow-right" slot="right" @click="selectUserInfo"></u-icon>
 						</u-form-item>
 				</u-form>
 			</view>
 			<view class="form-data rubbishType">
-				<view class="rubbishType-title">回收分类</view>
+				<view class="rubbishType-title u-required:before">回收分类</view>
 				<view class="rubbishType-tags">
-					<u-tag text="纸质类" shape="circle" type="info" @click="chooseRubbishType"/><u-tag text="金属类" shape="circle" type="info" @click="chooseRubbishType"/><u-tag text="衣物类" shape="circle" type="info" @click="chooseRubbishType"/><u-tag text="塑料类" shape="circle" type="info" @click="chooseRubbishType"/>
+					<view :class="['item-tags', item.check ? 'active' : '']" v-for="item in rubbishTypeListData" :key="item.code" @click="itemRubbishChange(item)">{{item.dispName}}</view>
 				</view>
 			</view>
 			<view class="form-data rubbishType">
-				<view class="rubbishType-title">预估重量</view>
+				<view class="rubbishType-title u-required:before">预估重量</view>
 				<view class="rubbishType-tags">
-					<u-tag text="10-50克" shape="circle" :type="weightTagType" @click="chooseWeight(1)"/><u-tag text="50-100克" shape="circle" type="info" @click="chooseWeight(2)"/><u-tag text="100克以上" shape="circle" type="info" @click="chooseWeight(3)"/>
+					<view :class="['item-weightTags', checkWeightType == item.code ? 'active' : '']" v-for="item in rubbishweightList" :key="item.code" @click="itemRubbishWeightChange(item)">{{item.dispName}}</view>
 				</view>
 			</view>
 			<view class="form-data qyImg">
@@ -48,8 +48,9 @@
 				</view>
 			</view>
 		</view>
-		<view style="color:#FF2C5C;text-align: center;margin-bottom: 20upx;">当前地址/时段无可上门骑手,暂不能下单</view>
+		<view style="color:#FF2C5C;text-align: center;margin-bottom: 10upx;" v-if="!hasRider">当前地址/时段无可上门骑手,暂不能下单</view>
 		<view class="btns">
+			<!-- <u-button @click="submit" :loading="loading" :custom-style="submitBtn" :disabled="!hasRider">提交</u-button> -->
 			<u-button @click="submit" :loading="loading" :custom-style="submitBtn">提交</u-button>
 		</view>
 		<!-- <uni-popup ref="openModal" type="center">
@@ -61,8 +62,9 @@
 <script>
 	// import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	// import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
-	import {gatherSave,gatherDetail} from '@/api/index.js'
+	import {gatherSave,gatherDetail,searchRider} from '@/api/index.js'
 	import {saveImgToAliOss} from '@/libs/tools.js'
+	import { getLookUpDatas,userDetail,yuyueInfoSave } from '@/api/data'
 	export default {
 		// components: {
 		// 	uniPopup,uniPopupDialog
@@ -71,15 +73,28 @@
 			return {
 				title:'',
 				loading:false, // 提交按钮加载圈
+				check:'', // 是否选中
+				checkWeightType:'',
 				photograph: [], //  图片路径
 				RubbishType:[], // 回收分类
+				rubbishweightList:[], // 重量分类
 				weightType:'',
 				weightTagType:'info', // 重量按钮类型
+				latitude:'', // 当前位置经度
+				longitude:'' ,// 当前位置维度
+				day:'', // 今天、明天,后天
+				timeType:'', // 上午、下午
+				time: '', // 其它垃圾
+				rubbishTypeListData:[],
+				userDetailInfo:{}, // 用户信息
+				nowDate:null,
 				form: {
-					time: '', // 其它垃圾
 					info: '', // 厨余垃圾
 				},
+				rubbishTypeList:[], // 垃圾类型
+				reserveWeight:'',
 				isView: false ,// 是否是查看详情
+				hasRider:true, // 是否有骑手
 				itemId:'',
 				submitBtn:{
 					backgroundColor: '#4F88F7',
@@ -131,51 +146,110 @@
 						]
 					},
 				],
-				rules: {
-					time: [
-						{
-							required: true,
-							message: '请选择时间',
-							trigger: ['blur', 'change']
-						}
-					],
-					info:[{required:true,message:'请选择用户信息',trigger:['change']}]
-				}
+				// rules: {
+				// 	time: [
+				// 		{
+				// 			required: true,
+				// 			message: '请选择时间',
+				// 			trigger: ['blur', 'change']
+				// 		}
+				// 	],
+				// 	info:[{required:true,message:'请选择用户信息',trigger:['change']}]
+				// }
 			};
 		},
 		onLoad(option) {
 			console.log(option,option.id,'ppppppppp')
+			this.rubbishType()
+			this.getDetailData()
+			this.rubbishWeightType()
+			const date=new Date
+			const year=date.getFullYear()
+			const month = date.getMonth() + 1
+			const day = date.getDate()
+			this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+day:day);
+			console.log(date.getFullYear(),nowDate,date.getMonth(),'-----------日期')
 			// 查看
 			if(option && option.id){
 				this.isView = true
 				this.itemId=option.id
-				this.getDetailData()
 			}else {
 				console.log('--------新增')
 				this.photograph = []
 				this.form.remarks = ''
 				this.$refs.uForm.resetFields()
 			}
+			wx.getLocation({
+			 type: 'wgs84',
+			 success:(res=> {
+			   if(res.latitude && res.longitude){
+			     this.latitude = res.latitude
+			     this.longitude = res.longitude
+			   }
+			   console.log(res,'位置信息',this.latitude,this.longitude)
+			 })
+			})
+			setTimeout(()=>{
+				this.getRiderStatus()
+			},300)
 		},
 		onUnload() {
 		},
+		watch:{
+		},
 		methods: {
-			// 保留几位小数
-			// numberToFixed: function (key, num, max) {
-			//   let val = this.form[key]
-			//   let ret = numberToFixed(val, num, max)
-			//   this.$nextTick(() => {
-			//   	this.form[key] = ret
-			//   })
-			// },
+			// 获取垃圾分类
+			rubbishType () {
+			  let _this = this
+			  getLookUpDatas({
+			    type: 'RESERVE_RUBBISH_TYPE'
+			  }).then(result => {
+			    if (result && result.status + '' === '200') {
+					result.data.forEach(item=>{
+						item.check=false
+					})
+					this.$nextTick(()=>{
+						_this.rubbishTypeListData= result.data || []
+						console.log(_this.rubbishTypeListData,'_this.rubbishTypeListData','---------------------')
+					})
+			    }
+			  })
+			},
+			rubbishWeightType () {
+			  let _this = this
+			  getLookUpDatas({
+			    type: 'RUBBISH_WEIGHT_TEMPLATE'
+			  }).then(result => {
+			    if (result && result.status + '' === '200') {
+					_this.rubbishweightList= result.data || []
+			      
+			    }
+			  })
+			},
+			// 查询附近有无骑手可接单
+			getRiderStatus(){
+				searchRider({lng:this.longitude,lat:this.latitude}).then(res=>{
+					if(res.status==200){
+						this.hasRider=res.data
+					}
+					console.log(res,'-----------')
+				})
+			},
 			// 选择时间
 			selectTime(){
 				wx.hideKeyboard()
 				this.show=true
 			},
 			confirm(e) {
-				console.log(e);
-				this.form.time=e[0].label + e[1].label
+				if(e){
+					this.time=e[0].label + e[1].label
+					this.day=e[0].label
+					// if(e[0].label=='今天'){
+					// 	this.day
+					// }
+					this.timeType=e[1].label.substr(0, e[1].label.indexOf("(")) // 上午、下午
+					console.log(e,'----------时间',this.day,this.timeType,e[1].label)
+				}
 			},
 			// 选择用户信息
 			selectUserInfo(){
@@ -184,30 +258,27 @@
 				})
 			},
 			// 选择垃圾分类
-			chooseRubbishType(){},
+			itemRubbishChange(item){
+				item.check=!item.check
+				// this.rubbishTypeList.push(item.code)
+				console.log(item,item.code,'--------------',this.check)
+			},
+			itemRubbishWeightChange(item){
+				this.checkWeightType=item.code
+				this.reserveWeight=item.code
+				console.log(item,item.code,'--------------',this.check)
+			},
 			// 选择重量
 			chooseWeight(value){
-				if(value!=1 || value!=2 || value!=3){
-					this.weightTagType='primary'
-				}else{
-					this.weightTagType='info'
-				}
 				console.log('-------选中重量')
 			},
 			// 获取详情数据
 			getDetailData(){
-				gatherDetail({id:this.itemId}).then(res=>{
+				userDetail().then(res=>{
 					if(res.status==200){
+						this.form.info=res.data.contactName
+						this.userDetailInfo=res.data
 						console.log(res)
-						const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
-						const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
-						const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
-						this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
-						this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
-						this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
-						this.form.remarks=res.data.remarks
-						this.photograph=res.data.imageUrlList || []
-						console.log(this.form,'this.form')
 					}
 				})
 			},
@@ -233,9 +304,7 @@
 							mask: true
 						})
 						saveImgToAliOss(res.tempFilePaths[0],(ret)=>{
-							// console.log(ret,'----------ret')
 							this.photograph.push(ret.data)
-							// _this.photograph = ret.data
 							uni.hideLoading()
 						})
 				    }
@@ -256,12 +325,41 @@
 			},
 			// 提交
 			submit(){
-				uni.navigateTo({
-				    url: '/pages/index/yuyueResult'
-				})
 				this.$refs.uForm.validate(valid => {
+					const params= Object.assign(this.userDetailInfo, this.form)
+					if(this.time){
+						params.dayStr=this.day
+						params.reserveTimeType=this.timeType
+						if(params.reserveTimeType=='上午'){
+							params.beginStr='08:00:00', // 预约开始时间
+							params.endStr="12:59:59"
+						}else{
+							params.beginStr='13:00:00', // 预约开始时间
+							params.endStr="18:00:00"
+						}
+					}
+					if(this.rubbishTypeList){
+						params.rubbishTypeList=this.rubbishTypeList
+					}
+					if(this.reserveWeight){
+						params.reserveWeight=this.reserveWeight
+					}
+					console.log(params,'--------------参数')
 					if (valid) {
 						console.log('验证通过');
+						yuyueInfoSave(params).then(res=>{
+							if(res.status==200){
+								uni.showToast({
+									title: res.message,
+									icon: 'none'
+								})
+								setTimeout(()=>{
+									uni.navigateTo({
+									    url: '/pages/index/yuyueResult'
+									})
+								},500)
+							}
+						})
 					} else {
 						console.log('验证失败');
 					}
@@ -370,18 +468,31 @@
 			font-style: normal;
 		}
 		.form-data{
-			padding: 0 30upx;
+			padding:0 30upx 0 50upx;
 			margin-bottom: 20upx;
 			background-color: #fff;
 		}
 		.rubbishType{
-			padding: 30upx ;
+			padding:30upx 30upx 30upx 50upx;
 			.rubbishType-title{
 				margin-bottom: 20upx;
 			}
 			.rubbishType-tags{
 				display: flex;
 				justify-content: space-between;
+				.item-tags.active{
+					padding: 10upx;
+					background-color:rgba(79, 136, 247, 0.2);
+					border-radius: 100px;
+				}
+				.item-weightTags.active{
+					padding: 10upx;
+					background-color:rgba(79, 136, 247, 0.2);
+					border-radius: 100px;
+				}
+				.check{
+					background: #F5F5F5;
+				}
 			}
 		}
 		.qyImg{

+ 2 - 3
pages/login/login.vue

@@ -23,9 +23,7 @@
 </template>
 
 <script>
-	import {
-		login
-	} from "@/api/login"
+	import {login} from "@/api/login"
 	export default {
 		components: {},
 		data() {
@@ -105,6 +103,7 @@
 							if (res.status == '200') {
 								getApp().globalData.token = res.data
 								_this.$u.vuex('vuex_token',res.data)
+								console.log(getApp().globalData.token,'---------getApp().globalData.token','------登录token')
 								uni.$emit("getUserInfo")
 								if (_this.path === '/pages/index/index' || _this.lanuch) {
 									uni.reLaunch({

+ 72 - 15
pages/order/index.vue

@@ -3,70 +3,127 @@
 		<view v-for="item in orderList" class="order-content">
 			<view class="item-userInfo item1" @click="itemChange(item)">
 				<view class="userInfo">
-					<u-image :src="item.img" width="72" height="72" shape="circle"></u-image>
+					<u-image src="/static/order_avatar_rider.png" width="72" height="72" shape="circle"></u-image>
 					<view class="userInfo-nameOrPhone">
-						<view class="name">{{item.name}}</view>
-						<view class="phone"><u-icon name="phone"></u-icon><text>{{item.phone}}</text></view>
+						<view class="name">{{item.contactName}}</view>
+						<view class="phone"><u-icon name="phone"></u-icon><text>{{item.contactMobile}}</text></view>
 					</view>
 				</view>
 				<view>
-					<!-- <u-icon :name="nameType" color='#999' @click="isShow"></u-icon> -->
 					<u-icon v-show="item.isUp" name="arrow-up" color="#999" size="28"></u-icon>
 					<u-icon v-show="!item.isUp" name="arrow-down" color="#999" size="28"></u-icon>
-					<!-- <u-icon name="arrow-up" color='#999' @click="isShow"></u-icon> -->
 				</view>
 			</view>
 			<view v-show="item.isUp">
 				<u-line color="#e5e5e5" />
 				<view class="item-userInfo-detail">
 					<view class="detail-title">用户信息</view>
-					<view class="detail-title coucntinfo"><text class="coucntname">{{item.coucntname}}</text><text>{{item.coucntphone}}</text></view>
-					<view class="detail-title address">{{item.address}}</view>
+					<view class="detail-title coucntinfo"><text class="coucntname">{{item.contactName}}</text><text>{{item.contactMobile}}</text></view>
+					<view class="detail-title address">{{item.contactAddress}}</view>
 				</view>
 				<u-line color="#e5e5e5"/>
 				<view class="item-userInfo-detail detail-title">订单信息</view>
 				<u-line color="#e5e5e5"/>
-				<view class="item-userInfo item-userInfo-detail"><text class="address">订单编号</text><text class="detail-title">{{item.orderNo}}</text></view>
+				<view class="item-userInfo item-userInfo-detail"><text class="address">订单编号</text><text class="detail-title">{{item.orderReserveNo}}</text></view>
 				<u-line color="#e5e5e5"/>
-				<view class="item-userInfo item-userInfo-detail"><text class="address">预约时间</text><text class="detail-title">{{item.yuyueTime}}</text></view>
+				<view class="item-userInfo item-userInfo-detail"><text class="address">预约时间</text><text class="detail-title">{{item.reserveTimeType}}</text></view>
 				<u-line color="#e5e5e5"/>
-				<view class="item-userInfo item-userInfo-detail"><text class="address">下单时间</text><text class="detail-title">{{item.orderTime}}</text></view>
+				<view class="item-userInfo item-userInfo-detail"><text class="address">下单时间</text><text class="detail-title">{{item.createDate}}</text></view>
 				<u-line color="#e5e5e5"/>
 				<view class="item-userInfo item-userInfo-detail"><text class="address">预约品类</text><text class="detail-title">{{item.type}}</text></view>
 				<view class="item-userInfo-detail-image">
 					<u-image :src="img" v-for=" img in item.imgList" width="120" height="120" class="detail-image"></u-image>
 				</view>
 				<u-line color="#e5e5e5"/>
-				<view class="userInfo cancelBtn"><u-button :custom-style="cancelBtn" :hair-line="false">取消订单</u-button></view>
+				<view class="userInfo cancelBtn"><u-button :custom-style="cancelBtn" :hair-line="false"  @click="cancelOrder">取消订单</u-button></view>
+				<!-- <v-select ref="AddressType" placeholder="请选择取消原因" @itemChange="chooseType"  v-if="!showCancelBtn" code="ORDER_ADDRESS_TYPE" style="width: 100%"></v-select> -->
 			</view>
 		</view>
+		<view class="nodata" v-if="!hasLogin && orderList.length==[] ">
+			<u-empty :text="noDataText" mode="data"></u-empty>
+		</view>
+		<!-- <u-popup ref="openModal" type="center">
+			<v-select ref="AddressType" placeholder="请选择取消原因" @itemChange="chooseType"  v-if="!showCancelBtn" code="ORDER_ADDRESS_TYPE" style="width: 100%"></v-select>
+				</u-popup> -->
+		<!-- <uni-popup ref="openModal" type="center">
+			<v-select ref="AddressType" placeholder="请选择取消原因" @itemChange="chooseType" code="ORDER_ADDRESS_TYPE" style="width: 100%"></v-select>
+			<uni-popup-dialog @confirm="onOk" :title="title"></uni-popup-dialog>
+		</uni-popup> -->
 	</view>
 </template>
 
 <script>
+	import vSelect  from  '@/components/select/v-select.vue'
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
+	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
+	import {getOrderList} from '@/api/order.js'
 	export default{
+		components: {
+			uniPopup,uniPopupDialog,vSelect
+		},
 		data(){
 			return{
+				title:'提示',
+				noDataText:'',
+				showCancelBtn:true,
 				cancelBtn:{
 					width: '106px',
 					height: '38px',
 					background: '#E5E5E5',
 					borderRadius:' 6px'
 				},
-				orderList:[
-					{img:'/static/edit.png',name:'骑手1',phone:'18292887584',coucntname:'用户1',coucntphone:'15991205189',address:'陕西省西安未央区北二环华帝金座A西安车领主网络科技有限公司',orderNo:'20122536987',yuyueTime:'今天中午',orderTime:'2021-12-25 13:15:36',type:'纸质类,塑料类',isUp:true,imgList:[{img:'/static/logo.jpg'},{img:'/static/logo.jpg'},{img:'/static/logo.jpg'}]},
-					{img:'/static/edit.png',name:'骑手2',phone:'18292887584',coucntname:'用户2',coucntphone:'15991205189',address:'陕西省西安未央区北二环华帝金座A西安车领主网络科技有限公司',orderNo:'20122536987',yuyueTime:'今天中午',orderTime:'2021-12-25 13:15:36',type:'纸质类,塑料类',isUp:false,imgList:[{img:'/static/logo.jpg'},{img:'/static/logo.jpg'},{img:'/static/logo.jpg'}]}
-					]
+				orderList:[]
 			}
 		},
+		onLoad() {
+			this.getOrderListData()
+		},
+		onShow() {
+			checkLogin().then(res => {
+				this.hasLogin=res.status==200
+				if(this.hasLogin){
+					this.pageInit()
+				}else{
+					this.noDataText="您尚未登录或登录已过期,完成登录后可查看数据信息!"
+				}
+			})
+		},
 		methods:{
 			// 数据展开收起
 			itemChange(item) {
+				console.log('点击收起隐藏')
 				// item.isUp = !item.isUp
 				this.$nextTick(function(){
 					item.isUp = !item.isUp
 				})
 			},
+			// 获取订单列表
+			getOrderListData(){
+				getOrderList({orderStatus:'CONFIRM'}).then(res=>{
+					if(res.status==200){
+						if(res.data){
+							res.data.forEach(item => {
+							    item.isUp = false
+							})
+						}
+						this.$nextTick(function(){
+							this.orderList=res.data || []
+						})
+						console.log(this.orderList,'------------this.orderList')
+					}
+				})
+			},
+			// 选择用户类型
+			chooseType(v){
+				this.form.AddressType = v
+			},
+			// 取消订单
+			cancelOrder(){
+				this.$refs.openModal.open()
+			},
+			onOk() {
+				this.$refs.openModal.close()
+				}
 		}
 		}
 </script>

+ 6 - 14
pages/userCenter/index.vue

@@ -4,32 +4,23 @@
 		<view class="user-head" >
 			<view>
 				<open-data type="userAvatarUrl" class="user-photo"></open-data>
-				<!-- <u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image> -->
 			</view>
 			<view class="user-info">
 				<view>
-					<view v-if="hasLogin" class="user-info-item">{{userData.stationName || ''}}</view>
-					<view v-if="hasLogin" class="user-info-item">{{userData.gatherName||''}} {{userData.gatherPhone || ''}}</view>
+					<view v-if="hasLogin" class="user-info-item">{{userData.name ? userData.name :''}}</view>
+					<view v-if="hasLogin" class="user-info-item">{{userData.mobile? userData.mobile:''}}</view>
 					<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 				</view>
 				<view>
-					<u-tag :text="price" bg-color="#ff2c5c30" color="#FF2C5C" shape="circleLeft" mode="dark" class="tagPrice"/>
+					<u-tag v-if="hasLogin" :text="userData?userData.reserveUserHistoryAccount+'元' :0+'元'" bg-color="#ff2c5c30" color="#FF2C5C" shape="circleLeft" mode="dark" class="tagPrice"/>
 				</view>
 			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="user-list">
 			<u-cell-group>
-				<!-- <u-cell-item icon="minus-circle" icon-size="40" index="3" @click="quitSys" title="退出登录"></u-cell-item> -->
-				<!-- <u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="0" @click="toPage" title="服务协议及隐私政策"></u-cell-item> -->
-				<!-- <u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="0" v-if="hasLogin" @click="toPage" title="退出登录"></u-cell-item> -->
-				<!-- <u-cell-item  v-if="hasLogin" icon="lock" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="toPage" title="修改密码"></u-cell-item> -->
 				<u-cell-item  icon="error-circle" icon-size="38" :icon-style="{color:'#aaaaff'}" :value="version" v-if="hasLogin" @click="checkUpdate" title="版本检查"></u-cell-item>
-			</u-cell-group>
-		</view>
-		<view class="user-list quit">
-			<u-cell-group>
-				<u-cell-item  v-if="hasLogin" icon="minus-circle" icon-size="40" index="3" @click="quitSys" title="退出登录"></u-cell-item>
+				<u-cell-item  v-if="hasLogin" icon="minus-circle" icon-size="40"  @click="quitSys" title="退出登录"></u-cell-item>
 			</u-cell-group>
 		</view>
 	</view>
@@ -182,9 +173,10 @@
 			.user-info{
 				display: flex;
 				justify-content: space-between;
+				align-items: center;
 				flex-grow: 1;
 				padding-left: 20rpx;
-				color: #FFFFFF;
+				// color: #FFFFFF;
 				.user-info-item{
 					margin: 10rpx 0;
 					:first-child{

BIN
static/login_icon_logo.png


BIN
static/order_avatar_rider.png


+ 4 - 1
store/index.js

@@ -19,7 +19,8 @@ let saveStateKeys = [
 	'vuex_storeId',
 	'vuex_bizId',
 	'vuex_orderNo',
-	'vuex_orderStatus'
+	'vuex_orderStatus',
+	'vuex_userInfoData',
 ];
 
 // 保存变量到本地存储中
@@ -97,6 +98,8 @@ const store = new Vuex.Store({
 		},
 		vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
 		vuex_userData: lifeData.vuex_userData ? lifeData.vuex_userData : '',
+		// 用户信息
+		vuex_userInfoData:lifeData.vuex_userInfoData ? lifeData.vuex_userInfoData :'',
 		// 订单信息
 		vuex_storeId: lifeData.vuex_storeId ? lifeData.vuex_storeId : '',// 网点id
 		vuex_bizId: lifeData.vuex_bizId ? lifeData.vuex_bizId : '',// 设备编号