From 800f10a99a19f4936dd2394d0e764a4c7ed7998a Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 05 九月 2025 18:31:49 +0800
Subject: [PATCH] 修BUG

---
 small-program/pages/index/index.vue |  832 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 634 insertions(+), 198 deletions(-)

diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 1c2ed91..a5e872a 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -1,7 +1,11 @@
 <template>
 	<view class="index">
 		<!-- 鎺ュ崟鏂� -->
-		<view class="index-j" v-if="typeViewId === 1">
+		<view class="index-j" v-if="userInfo && userInfo.useIdentity === 1">
+			<view class="kefubtn" @click="contactPhone()">
+				<image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image>
+				<text>瀹㈡湇</text>
+			</view>
 			<view class="index-j-head">
 				<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
 				<view class="index-c-title" :style="{ height: navHeight + 'px' }">
@@ -20,78 +24,88 @@
 				</view>
 			</view>
 			<view class="index-j-list">
-				<view class="index-list-item" v-for="(item, index) in orderList" :key="index">
-					<view class="index-list-item-head">
-						<view class="index-list-item-head-l">
-							<view class="xoam"></view>
-							<text v-if="item.type === 0 && item.workType === 0">鐢ㄥ伐鍗� - 閲囨憳宸�</text>
-							<text v-else-if="item.type === 0 && item.workType === 1">鐢ㄥ伐鍗� - 鍒嗘嫞宸�</text>
-							<text v-else-if="item.type === 0 && item.workType === 2">鐢ㄥ伐鍗� - 鍖呰宸�</text>
-							
-							<text v-else-if="item.type === 1">杩愯揣鍗�-{{item.categoryName}}-{{item.carUnit}}</text>
-							
-							<text v-else-if="item.type === 2">璁㈤鍗�</text>
+				<view class="index-list-item" v-if="orderList && orderList.length" v-for="(item, index) in orderList" :key="index">
+					<view  @click="goOrderDetail(item.id)">
+						<view class="index-list-item-head" >
+							<view class="index-list-item-head-l">
+								<view class="xoam"></view>
+								<text v-if="item.type === 0 && item.workType === 0">鐢ㄥ伐鍗� - 閲囨憳宸�</text>
+								<text v-else-if="item.type === 0 && item.workType === 1">鐢ㄥ伐鍗� - 鍒嗘嫞宸�</text>
+								<text v-else-if="item.type === 0 && item.workType === 2">鐢ㄥ伐鍗� - 鍖呰宸�</text>
+								<text v-else-if="item.type === 1">杩愯揣鍗�-{{item.categoryName}}</text>
+								<text v-else-if="item.type === 2">璁㈤鍗�</text>
+							</view>
+							<view class="index-list-item-head-r">{{item.distance}}km</view>
 						</view>
-						<view class="index-list-item-head-r">璺濈 {{item.distance}}km</view>
-					</view>
-					<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 0">
-						{{item.categoryName}}锝渰{item.priceNum1}}鏂�
-					</view>
-					<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 1">
-						{{item.categoryName}}锝渰{item.priceNum1}}浜�
-					</view>
-					<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2">
-						{{item.categoryName}}锝渰{item.priceNum1}}浜�
-					</view>
-					<view class="index-list-item-info" v-if="item.type === 1">
-						{{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}锝滅敤杞{item.priceNum1}}澶�
-					</view>
-					<view class="index-list-item-info" v-if="item.type === 2">
-						{{item.wayInfoCopy}}
-					</view>
-					
-					<view class="address" v-if="item.type === 1">
-						<view class="address-xian"></view>
-						<view class="address-row" v-for="(address, i) in item.wayInfo" :key="i">
-							<image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image>
-							<image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image>
-							<image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image>
-							<text>{{item.location}}</text>
+						<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 0">
+							{{item.categoryName}}锝渰{item.priceNum1}}鏂�
 						</view>
-					</view>
-					<template v-if="[0, 2].includes(item.type)">
-						<view class="index-list-item-dz">
-							<image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image>
-							<text>{{item.location}}</text>
+						<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 1">
+							{{item.categoryName}}锝渰{item.priceNum2}}浜�
 						</view>
-						<view class="index-list-item-dz">
-							<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
-							<text>{{item.startDate}} 鑷� {{item.endDate}}锛坽{item.totalDays}}澶╋級</text>
+						<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 0">
+							{{item.categoryName}}锝渰{item.priceNum1}}澶� 锝渰{item.priceNum2}}浜�
 						</view>
-					</template>
-					<view class="index-list-item-price">
-						<text>棰勪及锛�</text>
-						<text>楼{{item.estimatedAccount / 100}}</text>
+						<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 1">
+							{{item.categoryName}}锝渰{item.priceNum1}}灏忔椂 锝渰{item.priceNum2}}浜�
+						</view>
+						<view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 2">
+							{{item.categoryName}}锝渰{item.priceNum1}}鏂� 
+						</view> 
+						<view class="index-list-item-info" v-if="item.type === 1">
+							{{item.carUnit}} | {{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}锝滅敤杞{item.priceNum1}}{{item.carType === 0?"澶�":"娆�"}}
+						</view>
+						<view class="index-list-item-info" v-if="item.type === 2">
+							{{item.wayInfoCopy}}
+						</view>
+						
+						<view class="address" v-if="item.type === 1">
+							<view class="address-xian"></view>
+							<view class="address-row" v-if="item.wayInfo" v-for="(address, i) in item.wayInfo" :key="i">
+								<image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image>
+								<image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image>
+								<image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image>
+								<text>{{address.location}}</text>
+							</view>
+						</view>
+						<template v-if="[0, 2].includes(item.type)">
+							<view class="index-list-item-dz">
+								<image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image>
+								<text>{{item.location}}</text>
+							</view>
+							<view class="index-list-item-dz">
+								<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
+								<text>{{item.startDate}} 鑷� {{item.endDate}}锛坽{item.totalDays}}澶╋級</text>
+							</view>
+						</template>
+						<view class="index-list-item-price">
+							<text>棰勪及锛�</text>
+							<text>楼{{item.estimatedAccount / 100}}</text>
+						</view>
 					</view>
 					<view class="eidt">
-						<sunui-mverify @change="getaccept($event, item.id, index)"></sunui-mverify>
+						<!-- <sunui-mverify @change="getaccept($event, item.id, index)"></sunui-mverify> -->
+						<view class="eidt-btn" @click="show1 = true, orderId = item.id">鎶㈠崟</view>
 					</view>
 				</view>
+				<view v-if="orderList && orderList.length&& !next" class="more">宸插姞杞藉叏閮�</view>
+				<view v-if="(!orderList || !orderList.length)&& !next"  class="more">鏆傛棤璁㈠崟鍝�</view>
 			</view>
 		</view>
 		
-		<!-- 鍙戝崟鏂� -->
-		<view class="index-c" v-if="typeViewId === 0">
+		<!-- 鍙戝崟鏂�  -->
+		<view class="index-c" v-if="!isLogin || !userInfo || userInfo.useIdentity === 0">
 			<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
-			<view class="index-c-title" :style="{ height: navHeight + 'px' }" @click="selectAddress">
+			<view class="index-c-title" :style="{ height: navHeight + 'px' }" @click="selectAddress(-1)">
 				<text class="index-c-title-logo">杩戝揩</text>
 				<image class="dingwei" src="/static/icon/home_ic_location@2x.png" mode="widthFix"></image>
-				<text>瑗挎箹鍥介檯骞垮満</text>
+				<text>{{location.address || address || '鑾峰彇鍦板潃澶辫触'}}</text>
 				<image class="qu" src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image>
 			</view>
 			
 			<view class="index-c-cate">
 				<view
+					v-if="type"
 					:class="typeId === item.id ? 'index-c-cate-item active' : 'index-c-cate-item'"
 					v-for="(item, index) in type"
 					:key="index"
@@ -115,16 +129,17 @@
 						<view class="list-item-row">
 							<view class="list-item-row-label">鐢ㄩ鏃堕棿<b>*</b></view>
 							<view class="list-item-row-radio">
-								<view class="radio-item" v-for="(item, index) in orderFood" :key="index">
+								<view class="radio-item" v-if="orderFood" v-for="(item, index) in orderFood" :key="index">
 									<view class="radio-item-label">{{item.name}}</view>
 									<view class="radio-item-list">
 										<view class="radio-item-list-l">
-											<view :class="child.active ? 'radio-item-list-item active' : 'radio-item-list-item'" v-for="(child, childIndex) in item.list" :key="childIndex" @click="selectMenu(index, childIndex)">{{child.price}}鍏�</view>
+											<view v-if="item.list" :class="child.active ? 'radio-item-list-item active' : 'radio-item-list-item'" v-for="(child, childIndex) in item.list" :key="childIndex" @click="selectMenu(index, childIndex)">{{child.price||0}}鍏�</view>
 										</view>
 										<view class="radio-item-list-data">
-											<text>浠芥暟锛�</text>
+											<text style="flex-shrink: 0;">浠芥暟锛�</text>
 											<input type="number" v-model="item.num" placeholder="璇疯緭鍏�">
 											<text style="color: #999999;">浠�</text>
+											<view class="radio-item-list-data-btn" @click="clear(index)">鍙栨秷</view>
 										</view>
 									</view>
 								</view>
@@ -143,16 +158,16 @@
 								<input type="text" v-model="form.locationRemark" placeholder="璇疯緭鍏�" />
 							</view>
 						</view>
-						<view class="list-item-row" v-if="viewStatus">
+						<view class="list-item-row"  >
 							<view class="list-item-row-label">闇�姹傝ˉ鍏�</view>
 							<view class="list-item-row-val">
 								<textarea v-model="form.supplement" cols="30" rows="10" placeholder="璇疯緭鍏�" maxlength="200"></textarea>
 							</view>
 						</view>
-						<view class="list-item-row" v-if="viewStatus">
+						<view class="list-item-row"  >
 							<view class="list-item-row-label">鍥剧墖</view>
 							<view class="list-item-row-upload">
-								<view class="upload-item" v-for="(item, index) in form.multifileList" :key="index">
+								<view class="upload-item" v-if=" form.multifileList" v-for="(item, index) in form.multifileList" :key="index">
 									<image :src="item.url" mode="widthFix"></image>
 									<image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image>
 								</view>
@@ -162,10 +177,10 @@
 								</view>
 							</view>
 						</view>
-						<view class="list-item-zk" @click="viewStatus = !viewStatus">
+						<!-- <view class="list-item-zk" @click="viewStatus = !viewStatus">
 							<text>{{viewStatus ? '鏀惰捣' : '琛ュ厖闇�姹�'}}</text>
 							<u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon>
-						</view>
+						</view> -->
 					</view>
 					<view class="list-item">
 						<view class="list-item-label">鑱旂郴浜轰俊鎭�</view>
@@ -193,8 +208,8 @@
 						</view>
 					</view>
 					<view class="box-hz-btn" :style="{ backgroundImage: 'url(' + btn + ')' }">
-						<view class="box-hz-btn-kf">瀹㈡湇</view>
-						<view class="box-hz-btn-next" @click="submit">涓嬩竴姝�</view>
+						<view class="box-hz-btn-kf" @click="contactPhone()">瀹㈡湇</view>
+						<view class="box-hz-btn-next" @click="submit">绔嬪嵆涓嬪崟</view>
 					</view>
 				</view>
 			</template>
@@ -205,7 +220,7 @@
 					<!-- 鐢ㄥ伐 -->
 					<template v-if="typeId === 0">
 						<view class="box-hz-cate">
-							<view :class="form.workType === item.id ? 'box-hz-cate-item active' : 'box-hz-cate-item'" v-for="(item, index) in typeWork" :key="index" @click="clickTypeWork(item.id)">
+							<view v-if="typeWork" :class="form.workType === item.id ? 'box-hz-cate-item active' : 'box-hz-cate-item'" v-for="(item, index) in typeWork" :key="index" @click="clickTypeWork(item.id)">
 								<text>{{item.name}}</text>
 								<view class="box-hz-cate-item-x" v-if="form.workType === item.id"></view>
 							</view>
@@ -236,12 +251,13 @@
 					
 					<!-- 杩愯揣 -->
 					<template v-if="typeId === 1">
-						<view class="box-hz-cate">
-							<view :class="form.categoryId === item.id ? 'box-hz-cate-item active' : 'box-hz-cate-item'" v-for="(item, index) in car" :key="index" @click="clickCar(item)">
+						<scroll-view class="nav-scroll" scroll-x="true">
+							<view v-if="car" :class="form.categoryId === item.id ? 'nav-item active' : 'nav-item'" v-for="(item, index) in car" :key="index" @click="clickCar(item)">
 								<text>{{item.name}}</text>
-								<view class="box-hz-cate-item-x" v-if="form.categoryId === item.id"></view>
+								<view class="nav-item-x" v-if="form.categoryId === item.id"></view>
 							</view>
-						</view>
+						</scroll-view>
+						
 						<view class="box-hz-car">
 							<view class="box-hz-car-image">
 								<image :src="carImage" mode="widthFix"></image>
@@ -256,14 +272,14 @@
 								<view :class="form.startDate ? 'box-hz-list-item-val active' : 'box-hz-list-item-val'">
 									<view class="box-hz-list-item-val-left">
 										<image class="icon" src="/static/icon/ic_time@2x.png" mode="widthFix"></image>
-										<text>{{ form.startDate ? form.startDate + ' 鑷� ' + form.endDate : '璇烽�夋嫨鐢ㄥ伐鏃堕棿'}}</text>
+										<text>{{ form.startDate ? form.startDate + ' 鑷� ' + form.endDate : '璇烽�夋嫨鐢ㄨ溅鏃堕棿'}}</text>
 									</view>
 									<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
 								</view>
 							</view>
 							<view class="box-hz-list-item">
 								<view class="box-hz-list-item-label">
-									<text>鐢ㄨ溅鏃堕棿锛�</text>
+									<text>鐢ㄨ溅鍦扮偣锛�</text>
 									<text @click="addAddr">+澧炲姞閫旂粡鐐�</text>
 								</view>
 								<view class="item-d">
@@ -276,7 +292,7 @@
 											<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
 										</view>
 									</view>
-									<view class="item-d-row" v-for="(item, index) in form.wayInfoDTOList" :key="index" @click="selectAddress(4, index)">
+									<view class="item-d-row" v-if="form.wayInfoDTOList" v-for="(item, index) in form.wayInfoDTOList" :key="index" @click="selectAddress(4, index)">
 										<view class="item-d-row-icon">
 											<image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image>
 										</view>
@@ -301,36 +317,99 @@
 							</view>
 						</view>
 					</template>
-					
 					<view class="box-hz-btn" :style="{ backgroundImage: 'url(' + btn + ')' }">
-						<view class="box-hz-btn-kf">瀹㈡湇</view>
-						<view class="box-hz-btn-next" @click="jump()">涓嬩竴姝�</view>
+						<view class="box-hz-btn-kf"  @click="contactPhone()" >瀹㈡湇</view>
+						<view class="box-hz-btn-next"  @click="jump()" v-if="typeId  == 2">绔嬪嵆涓嬪崟</view>
+						<view class="box-hz-btn-next"  @click="jump()" v-if="typeId !== 2">涓嬩竴姝�</view>
 					</view>
 				</view>
 			</view>
 		</view>
 		
 		<!-- 閫夋嫨鏃ユ湡鑼冨洿 -->
-		<u-calendar :show="show" color="#00BC12" mode="range" @close="show = false" @confirm="confirmDate"></u-calendar>
+		<u-calendar :show="show" color="#00BC12" :allowSameDay="true" mode="range" @close="show = false" @confirm="confirmDate"></u-calendar>
+		
+		<u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true"  @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
+			<view class="phone">
+				<view class="phone-head">
+					<view></view>
+					<text>鑱旂郴瀹㈡湇</text> 
+				</view>
+				<view class="phone-item">
+					<view>
+						<image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image>
+						<button open-type="contact" plain="true" bindcontact="handleContact">鍦ㄧ嚎瀹㈡湇</button>
+					</view>
+					 <view class="line" v-if="serverPhone && serverPhone.length"></view>
+				</view>
+				 <view class="phone-item" v-if="serverPhone" v-for="(item,index) in serverPhone"  :key="item" @click="contactPhoneDo(item)">
+				 	<view>
+						<image src="/static/icon/ic_call@2x.png" mode="widthFix"></image>
+						<text>{{item}}</text> 
+					</view>
+					 <view class="line" v-if="index<serverPhone.length-1"></view>
+				 </view>  
+				 <view style="width: 100%; height: 30rpx;"></view>
+				<!-- <view class="phone-botton"  @click="contactPhone()" >鍏抽棴</view> -->
+			</view>
+		</u-popup>
+		
+		<u-modal
+			title="娓╅Θ鎻愮ず"
+			:show="show1"
+			closeOnClickOverlay
+			showCancelButton
+		>
+			<view class="slot-content">
+				鏄惁纭鎶㈠崟锛�
+			</view>
+			<view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+				<view class="btn1" @click="show1 = false">鍙栨秷</view>
+				<view class="btn2" @click="getaccept1">纭</view>
+			</view>
+		</u-modal>
+		<u-modal
+			title="鏀粯鏈垚鍔�"
+			:show="show2"
+			closeOnClickOverlay
+			showCancelButton
+		>
+			<view class="slot-content">
+				璇风‘璁ゆ槸鍚﹀彇娑堟敮浠樻垨鏌ョ湅璁㈠崟缁х画鏀粯锛�
+			</view>
+			<view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+				<view class="btn1" @click="show2 = false;payOrderId=null">鍙栨秷鏀粯</view>
+				<view class="btn2" @click="goOrderDetail(payOrderId)">鏌ョ湅璁㈠崟</view>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
 <script>
 	import { mapState } from 'vuex'
 	import sunuiMverify from '@/components/sunui-mverify/sunui-mverify.vue';
+	var QQMapWX = require('@/utils/qqmap-wx-jssdk.js');
 	export default {
 		components: { sunuiMverify },
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude']),
+			...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude','address']),
 			totalPrice() {
 				return this.form.estimatedAccount / 100
 			}
 		},
 		data() {
 			return {
+				showPhone:false,
+				serverPhone:[],
 				show: false,
 				isLogin: false,
 				typeId: 0,
+				qqmapsdk: null,
+				location:{
+					latitude:null,
+					longitude:null,
+					address:null,
+				},
 				type: [
 					{ name: '鐢ㄥ伐', id: 0 },
 					{ name: '杩愯揣', id: 1 },
@@ -359,7 +438,7 @@
 				carRemark: '',
 				
 				orderFood: [],
-				viewStatus: false,
+				viewStatus: true,
 				
 				form: {
 					startDate: '',
@@ -379,7 +458,8 @@
 					linkName: '',
 					linkPhone: '',
 					estimatedAccount: '',
-					price: ''
+					price: '',
+					address: ''
 				},
 				sortType: 0,
 				orderList: [],
@@ -387,50 +467,86 @@
 				page: 1,
 				next: true,
 				
-				isOnce: true
+				isOnce: true,
+				show1: false,
+				show2: false,
+				orderId: null,
+				payOrderId:null
 			}
 		},
-		async onLoad() {
+		async onLoad() { 
 			await this.$onLaunched;
+			console.log('2')
+			// if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}' && this.userInfo.useIdentity === 1) {
+			// 	this.getOrderList()
+			// }
+			
 			this.getCategoryLists()
-			this.getOrderList()
-			this.form.linkPhone = this.userInfo.telephone
+			this.getDictInfo()
+			
+			if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
+				this.form.linkPhone = this.userInfo.telephone || ''
+				this.form.linkName = this.userInfo.name || ''
+			}
+			
+			this.qqmapsdk = new QQMapWX({
+				key: '4PXBZ-JLBC7-LCLXG-P2SZX-C4HYE-LDBLQ'
+			});
+			
+			uni.$on('clear', (data) => {
+				this.form.startDate = ''
+				this.form.endDate = ''
+				this.form.latitude = ''
+				this.form.longitude = ''
+				this.form.location = ''
+				this.form.locationEnd = ''
+				this.form.wayInfoDTOList = []
+				this.form.workType = 0 
+				this.form.days = ''
+				this.form.locationRemark = ''
+				this.form.supplement = ''
+				this.form.multifileList = []
+				this.form.estimatedAccount = ''
+				this.form.price = ''
+				this.form.address = ''
+				this.clearAll()
+			})
+			// 鍒锋柊棣栭〉鏁版嵁
+			uni.$on('refresh', () => {
+				this.getCategoryLists()
+				this.getDictInfo()
+				
+				if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
+					this.form.linkPhone = this.userInfo.telephone
+				}
+			})
 		},
-		onShow(options) {
-			this.typeViewId = 0
-			if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
+		async onShow(options) {
+			await this.$onLaunched;
+			if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
+				console.log('宸茬櫥闄�')
 				this.isLogin = true
+				
+				// this.typeViewId = this.userInfo.useIdentity
+				// !this.isOnce && 
+				if (this.userInfo.useIdentity === 1) {
+					console.log('宸茬櫥闄�111')
+					this.page = 1
+					this.next = true
+					this.orderList = []
+					this.getOrderList()
+				}
+				
+			} else {
+				this.isLogin = false
+				console.log('鏈櫥闄�')
 			}
-			if (this.userInfo && this.userInfo.useIdentity == 1) {
-				this.typeViewId = 1
-			}
-			if (!this.isOnce && this.userInfo.useIdentity == 1) {
-				this.page = 1
-				this.next = true
-				this.orderList = []
-				this.getOrderList()
-			}
+			// this.payOrderId=null 
 		},
 		watch: {
 			typeId: {
 				handler(news, old) {
-					this.form.startDate = ''
-					
-					this.form.endDate = ''
-					this.form.latitude = ''
-					this.form.longitude = ''
-					this.form.location = ''
-					this.form.locationEnd = ''
-					this.form.wayInfoDTOList = ''
-					this.form.workType = ''
-					this.form.days = ''
-					this.form.locationRemark = ''
-					this.form.supplement = ''
-					this.form.multifileList = []
-					this.form.linkName = ''
-					this.form.estimatedAccount = ''
-					this.form.price = ''
-					this.viewStatus = false
+					this.clearFormParam()
 				}
 			},
 			orderFood: {
@@ -448,35 +564,116 @@
 							price += num * item.num
 						}
 					})
+					console.log("========================",price)
 					this.form.price = price
 				}
 			},
 			'form.price': {
 				handler(news, old) {
-					if (news > 0) {
+					console.log(news,"==========",old)
+					if (news != old) {
 						this.getPrice()
 					}
 				}
 			}
 		},
 		onReachBottom() {
-			this.getOrderList()
+			if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}' && this.userInfo.useIdentity === 1) {
+				this.getOrderList()
+			}
 		},
 		methods: {
+			goOrderDetail(id){
+				uni.navigateTo({
+					url: '/pages/order-details/order-details?id='+id
+				})
+				var that =this
+				setTimeout(function(){
+					that.orderId=null
+					that.payOrderId=null 
+					that.show2=false
+				},1000)
+				
+			},
+			clearFormParam(){
+				this.form.startDate = ''
+				this.form.address = ''
+				this.form.endDate = ''
+				this.form.latitude = ''
+				this.form.longitude = ''
+				this.form.location = ''
+				this.form.locationEnd = ''
+				this.form.wayInfoDTOList = []
+				this.form.workType = 0
+				this.form.days = ''
+				this.form.locationRemark = ''
+				this.form.supplement = ''
+				this.form.multifileList = []
+				this.form.estimatedAccount = ''
+				this.form.price = ''
+				this.viewStatus = false
+				this.clearAll()
+			},
+			clear(index) {
+				this.orderFood[index].num = ''
+				this.orderFood[index].list.forEach(item => {
+					item.active = false
+				}) 
+			},
+			clearAll() { 
+				this.orderFood.forEach(p=>{
+					p.num=null
+					p.list.forEach(item => {
+						item.active = false
+					})
+				})				
+			},
+			getDictInfo(){
+				var that = this;
+				this.$u.api.getPlatformAboutUs({}).then(res =>{ 
+					  that.serverPhone = (res.data.serverPhone||'').split(",") 
+				})
+			},
+			contactPhone(){
+				 this.showPhone = !this.showPhone
+				 console.log("==================================",this.showPhone)
+			},
+			contactPhoneDo(phone){ 
+				if(phone !=null && phone!=''){
+					uni.makePhoneCall({
+					   phoneNumber: phone  
+					})
+				}
+			},
 			// 鎵嬪姩鎺ュ崟
-			getaccept(e, orderId, index) {
-				this.$u.api.accept({ orderId })
-					.then(res => {
-						if (res.code === 200) {
+			getaccept() {
+				var that = this;
+				that.$u.api.accept({ orderId: this.orderId })
+					.then(res1 => {
+						if (res1.code === 200) {
 							uni.showToast({ title: '鎶㈠崟鎴愬姛锛�', icon: 'success', duration: 2000 })
 							setTimeout(() => {
-								this.page = 1
-								this.next = true
-								this.orderList = []
-								this.getOrderList()
+								that.page = 1
+								that.next = true
+								that.orderList = []
+								that.getOrderList()
+								that.goOrderDetail(that.orderId)
 							}, 2000)
 						}
 					})
+			},
+			getaccept1() {
+				var that = this;
+				this.show1 = false
+				uni.requestSubscribeMessage({
+					tmplIds: ['AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8','3YSC7gouRlSjHXz4CrWOGFzPmGwEBtFj4snwdfMvKHk','tDpYImlrdv-0d3euTrHbYZ1cEZvjVHTNlqHvV0tpLHg'],
+					success(res) {
+						that.getaccept()
+					},
+					fail(err) {
+						that.getaccept()
+					}
+				})
 			},
 			clickSort(id) {
 				this.sortType = id
@@ -502,8 +699,8 @@
 						queryMyOrderType: 2,
 						type: this.typeVal,
 						sortType: this.sortType,
-						queryLat: this.latitude,
-						queryLgt: this.longitude
+						queryLat: uni.getStorageSync('address').latitude,
+						queryLgt: uni.getStorageSync('address').longitude
 					}
 				}).then(res => {
 					if (res.code !== 200) return;
@@ -530,11 +727,36 @@
 			},
 			// 鎻愪氦璁㈠崟
 			submit() {
+				var that = this
+				this.payOrderId=null
 				if (!this.form.startDate) {
 					return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏃堕棿', icon: 'none' })
+				} 
+				let cateringDTOList = []
+				let valid = true
+				let msg ='璇烽�夋嫨'
+				that.orderFood.forEach(item => {
+					item.list.forEach(child => {
+						if (child.active) {
+							// (Number(child.price) * Number(item.num))
+							if( !item.num){								 
+								msg =msg +'銆�'+item.name+'銆�';
+								valid =false  		 
+							}
+							cateringDTOList.push({
+								id:item.id,
+								name: item.name,
+								num: item.num,
+								price: child.price * 100
+							})
+						}
+					})
+				})
+				if(!valid){
+					return uni.showToast({ title: msg+'鐢ㄩ浠芥暟', icon: 'none' })
 				}
-				if (this.form.price === 0) {
-					return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏃堕棿', icon: 'none' })
+				if (cateringDTOList.length === 0) {
+					return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏍囧噯', icon: 'none' })
 				}
 				if (!this.form.address) {
 					return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鍦扮偣', icon: 'none' })
@@ -542,74 +764,74 @@
 				if (!this.form.linkPhone) {
 					return uni.showToast({ title: '璇疯緭鍏ヨ仈绯荤數璇�', icon: 'none' })
 				}
-				let cateringDTOList = []
-				this.orderFood.forEach(item => {
-					item.list.forEach(child => {
-						if (child.active) {
-							cateringDTOList.push({
-								name: item.name,
-								num: item.num,
-								price: (Number(child.price) * Number(item.num)) * 100
-							})
-						}
-					})
-				})
-				this.$u.api.release({
-					...this.form,
-					type: 2,
-					price: Number(this.form.price) * 100,
-					priceNum1: this.form.days,
-					location: this.form.address,
-					lat: this.form.latitude,
-					lgt: this.form.longitude,
-					cateringDTOList
-				}).then(res => {
-					if (res.code == 200) {
-						wx.requestPayment({
-							timeStamp: res.data.object.timeStamp,
-							nonceStr: res.data.object.nonceStr,
-							package: res.data.object.packageVal,
-							signType: res.data.object.signType,
-							paySign: res.data.object.paySign,
-							success (res1) {
-								if (res1.errMsg = 'requestPayment:ok') {
-									uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
-									setTimeout(() => {
-										uni.navigateTo({
-											url: `/pages/success/success?orderId=${res.data.id}`
-										})
-									}, 1500)
-								}
-							},
-							fail(err) {
-								console.log(err)
+				uni.requestSubscribeMessage({
+					tmplIds: ['oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg','AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8'],
+					success(res) { 
+						that.$u.api.release({
+							...that.form,
+							type: 2,
+							price: Number(that.form.price) * 100,
+							priceNum1: that.form.days,
+							location: that.form.address,
+							lat: that.form.latitude,
+							lgt: that.form.longitude,
+							cateringDTOList
+						}).then(res => {
+							if (res.code == 200) {
+								that.clearFormParam();
+								wx.requestPayment({
+									timeStamp: res.data.object.timeStamp,
+									nonceStr: res.data.object.nonceStr,
+									package: res.data.object.packageVal,
+									signType: res.data.object.signType,
+									paySign: res.data.object.paySign,
+									success (res1) {
+										if (res1.errMsg = 'requestPayment:ok') {
+											uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+											setTimeout(() => {
+												uni.navigateTo({
+													url: `/pages/success/success?orderId=${res.data.id}`
+												})
+											}, 1500)
+										}
+									},
+									fail(err) {
+										that.payOrderId = res.data.id
+										that.show2=true
+										console.log("=====================",	 res.data.id,that.payOrderId,err)
+									}
+								})
 							}
 						})
+						console.log(cateringDTOList)
+					},
+					fail(err) {
+						console.log(err)
 					}
 				})
-				console.log(cateringDTOList)
 			},
 			uploadImg() {
 				uni.chooseImage({
 					success: (chooseImageRes) => {
-						const tempFilePaths = chooseImageRes.tempFilePaths;
-						uni.uploadFile({
-							url: this.$baseUrl + '/web/public/upload',
-							filePath: tempFilePaths[0],
-							name: 'file',
-							formData: {
-								'folder': 'orders'
-							},
-							success: (uploadFileRes) => {
-								const res = JSON.parse(uploadFileRes.data)
-								this.form.multifileList.push({
-									fileurl: res.data.imgaddr,
-									name: res.data.originname,
-									url: res.data.url,
-									type: 0
-								})
-							}
-						});
+						for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
+							uni.uploadFile({
+								url: this.$baseUrl + '/web/public/upload',
+								filePath: chooseImageRes.tempFilePaths[i],
+								name: 'file',
+								formData: {
+									'folder': 'orders'
+								},
+								success: (uploadFileRes) => {
+									const res = JSON.parse(uploadFileRes.data)
+									this.form.multifileList.push({
+										fileurl: res.data.imgaddr,
+										name: res.data.originname,
+										url: res.data.url,
+										type: 0
+									})
+								}
+							});
+						}
 					}
 				});
 			},
@@ -626,6 +848,8 @@
 							that.form.estimatedAccount = res.data
 						}
 					})
+				}else{
+					that.form.estimatedAccount = 0
 				}
 			},
 			addAddr() {
@@ -638,7 +862,10 @@
 			confirmDate(e) {
 				this.form.startDate = e[0]
 				this.form.endDate = e[e.length - 1]
-				this.form.days = e.length;
+				
+				let time = this.form.startDate == this.form.endDate ? 1 : 0
+				
+				this.form.days = e.length - time;
 				this.show = false
 				if (this.typeId === 2) {
 					this.getPrice()
@@ -646,24 +873,36 @@
 			},
 			selectAddress(type, index) {
 				uni.chooseLocation({
-					success: (res) => {
+					success: (res) => { 
+						console.log("==================",res)
 						if ([1,2].includes(type)) {
 							this.form.latitude = res.latitude
 							this.form.longitude = res.longitude
-							this.form.address = res.address
+							this.form.address = res.name ||res.address
 						} else if (type === 3) {
-							this.form.locationEnd = res.address
+							this.form.locationEnd = res.name ||res.address
 							this.form.latEnd = res.latitude
 							this.form.lgtEnd = res.longitude
 						} else if (type === 4) {
-							this.form.wayInfoDTOList[0].lat = res.latitude
-							this.form.wayInfoDTOList[0].lgt = res.longitude
-							this.form.wayInfoDTOList[0].location = res.address
-						}
+							this.form.wayInfoDTOList[index].lat = res.latitude
+							this.form.wayInfoDTOList[index].lgt = res.longitude
+							this.form.wayInfoDTOList[index].location = res.name||  res.address
+						}else if (type == -1) {
+							console.log(res)
+							this.location.latitude = res.latitude
+							this.location.longitude = res.longitude
+							this.location.address =res.name ||  res.address
+						} 
 					}
 				});
 			},
 			clickType(e) {
+				if (!this.token) {
+					uni.navigateTo({
+						url: '/pages/login/login'
+					})
+					return
+				}
 				this.typeId = e
 				if (e === 2) {
 					this.form.categoryId = this.car[0].id
@@ -799,7 +1038,64 @@
 <style lang="scss" scoped>
 	.index {
 		width: 100%;
+		.slot-content {
+			width: 100%;
+			text-align: center;
+			font-weight: 400;
+			font-size: 30rpx;
+			color: #333333;
+			margin: 30rpx 0;
+		}
+		.btn1 {
+			width: 264rpx;
+			height: 88rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-weight: 400;
+			font-size: 32rpx;
+			color: #666666;
+			border-radius: 44rpx;
+			border: 1rpx solid #B2B2B2;
+		}
+		.btn2 {
+			width: 264rpx;
+			height: 88rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-weight: 500;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			background: #00BC12;
+			border-radius: 44rpx;
+		}
 		.index-j {
+			.kefubtn{
+				background-color: white;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				position: fixed;
+				bottom: 100rpx;
+				flex-direction: column;
+				right:30rpx;
+				height: 88rpx;
+				width: 88rpx;
+				border: 1rpx solid #f2f2f2;
+				border-radius: 50%;
+				image{
+					width: 36rpx;
+					width: 36rpx;
+				}
+				text{
+					width: 44rpx;
+					height: 32rpx;
+					font-weight: 400;
+					font-size: 22rpx;
+					color: #222222;
+					line-height: 32rpx;
+					text-align: center;
+				}
+			}
 			width: 100%;
 			.index-j-head {
 				width: 100%;
@@ -887,6 +1183,13 @@
 				width: 100%;
 				padding: 24rpx 30rpx;
 				box-sizing: border-box;
+				.more{
+					width: 100%;
+					margin-top: 40rpx;
+					text-align: center;
+					font-size: 24rpx;
+					color: #666666;
+				}
 				.index-list-item {
 					width: 100%;
 					padding: 30rpx;
@@ -905,6 +1208,17 @@
 						display: flex;
 						align-items: center;
 						justify-content: center;
+						.eidt-btn {
+							width: 100%;
+							height: 88rpx;
+							line-height: 88rpx;
+							text-align: center;
+							background: #00BC12;
+							border-radius: 44rpx;
+							font-weight: 500;
+							font-size: 32rpx;
+							color: #FFFFFF;
+						}
 						// background: #00BC12;
 						// border-radius: 50rpx;
 						// text {
@@ -1051,7 +1365,7 @@
 				padding: 0 30rpx;
 				box-sizing: border-box;
 				display: flex;
-				align-items: center;
+				align-items: center; 				
 				.index-c-title-logo {
 					font-weight: bold;
 					font-size: 40rpx;
@@ -1068,6 +1382,10 @@
 					font-size: 32rpx;
 					color: #ffffff;
 					margin-right: 12rpx;
+					max-width: 280rpx;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
 				}
 				.qu {
 					width: 22rpx;
@@ -1166,12 +1484,16 @@
 							padding: 30rpx 0;
 							box-sizing: border-box;
 							flex-direction: column;
-							border-bottom: 1rpx solid #E5E5E5;
+							// border-bottom: 1rpx solid #E5E5E5;
 							.radio-item {
 								width: 100%;
 								display: flex;
-								align-items: self-end;
+								align-items: flex-start;
 								margin-bottom: 30rpx;
+								border-bottom: 1rpx solid #E5E5E5;
+								&:last-child {
+									border: none;
+								}
 								&:last-child {
 									margin: 0 !important;
 								}
@@ -1224,6 +1546,19 @@
 										align-items: center;
 										justify-content: flex-end;
 										margin-top: 42rpx;
+										margin-bottom: 34rpx;
+										.radio-item-list-data-btn {
+											width: 110rpx;
+											height: 64rpx;
+											line-height: 64rpx;
+											margin-left: 20rpx;
+											font-weight: 400;
+											font-size: 24rpx;
+											color: #666666;
+											text-align: center;
+											border: 1rpx solid #B2B2B2;
+											border-radius: 34rpx;
+										}
 										text {
 											font-weight: 400;
 											font-size: 30rpx;
@@ -1499,6 +1834,44 @@
 							margin-top: 30rpx;
 						}
 					}
+					.nav-scroll {
+					    white-space: nowrap; /* 闃叉瀵艰埅椤规崲琛� */						
+						margin-bottom: 50rpx;
+						height: 66rpx;
+					    overflow: auto; /* 鍏佽婊氬姩鏉″嚭鐜� */
+						.nav-item {
+						  display: inline-block; /* 浣垮鑸」姘村钩鎺掑垪 */
+						  margin-right: 60rpx;
+						  position: relative;
+						  text {
+						  	font-weight: 400;
+						  	font-size: 30rpx;
+						  	color: #666666;
+						  }
+						  .nav-item-x {
+						  	width: 40rpx;
+						  	height: 6rpx;
+						  	position: absolute;
+						  	bottom: -10rpx;
+						  	left: 50%;
+						  	transform: translate(-50%, 0);
+						  	background: #FF5A40;
+						  	border-radius: 3rpx;
+						  }
+						  // padding: 10px 20px; /* 璁剧疆鍐呰竟璺� */
+						  // margin-right: 10px; /* 璁剧疆鍙宠竟璺� */
+						  // background-color: #f0f0f0; /* 璁剧疆鑳屾櫙鑹� */
+						  // border: 1px solid #ddd; /* 璁剧疆杈规 */
+						  // border-radius: 5px; /* 璁剧疆鍦嗚 */
+					  }
+					  .active {
+					  	text {
+					  		font-weight: 600 !important;
+					  		font-size: 32rpx !important;
+					  		color: #222222 !important;
+					  	}
+					  }
+					}
 					.box-hz-cate {
 						width: 100%;
 						display: flex;
@@ -1631,7 +2004,7 @@
 										flex-shrink: 0;
 									}
 									text {
-										flex: 1;
+										width: 470rpx;
 										overflow: hidden;
 										text-overflow: ellipsis;
 										white-space: nowrap;
@@ -1686,5 +2059,68 @@
 				}
 			}
 		}
+		.phone {
+			width: 100%;
+			padding-top: 40rpx;
+			box-sizing: border-box;
+			.phone-botton {
+				width: 100%;
+				height: 88rpx;
+				line-height: 88rpx;
+				text-align: center;
+				font-weight: 500;
+				font-size: 32rpx;
+				color: #FFFFFF;
+				background: #00BC12;
+				border-radius: 44rpx;
+				margin-top: 60rpx;
+			}
+			.phone-head {
+				width: 100%;
+				text-align: center;
+				justify-content: space-between; 
+				margin-bottom: 40rpx;
+				text {
+					font-weight: 800;
+					font-size: 32rpx;
+					color: #222222;
+				}
+			}
+			 
+			.phone-item {
+				width: 100%;
+				text-align: center;
+				display: flex;
+				justify-content: center;
+				flex-direction: column;
+				// border-bottom: 1rpx solid #eeeeee;
+				line-height: 78rpx;
+				button{
+					border: 1rpx white solid;
+					display: inline;
+					width: 300rpx;
+					font-weight: 500;
+					font-size: 32rpx;
+					line-height: 32rpx;
+					color: #222222;
+				}
+				image{
+					width: 28rpx;
+					height: 28rpx;
+					margin-right: 30rpx;
+				}
+				.line{
+					width: 100%;
+					height: 1rpx;
+					background-color: #f2f2f2
+				}
+				text {
+					font-weight: 500;
+					font-size: 28rpx;
+					line-height: 28rpx;
+					color: #222222;
+				}
+			}
+		}
 	}
 </style>

--
Gitblit v1.9.3