|
@@ -14,7 +14,7 @@
|
|
|
<view class="content-body">
|
|
|
<view class="store-image flex flex_column justify_center align_center">
|
|
|
<u-image :src="pageInfo.receiveAddressVO.headerImageList? pageInfo.receiveAddressVO.headerImageList[0]:'/static/index/def_home_shop.png'" width="172" height="172" ></u-image>
|
|
|
- <text v-if="pageInfo.userId">骑手张三的店铺</text>
|
|
|
+ <text v-if="isHasRider.haveBindRider && pageInfo.name">{{pageInfo.name}}</text>
|
|
|
<text v-else>{{mobile}}</text>
|
|
|
</view>
|
|
|
<!-- 表单 -->
|
|
@@ -32,9 +32,8 @@
|
|
|
<view class="list-item-left">
|
|
|
<text>通信地址</text>
|
|
|
</view>
|
|
|
- <!-- {{form.receiveAddress.receiveAreasName}} -->
|
|
|
<view class="list-item-right flex_1">
|
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.receiveAddress.receiveAreasName" @click="selectAddress" :disabled="true" placeholder="请选择通信地址" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="reverseReceiveAddress.receiveAreasName" @click="selectAddress" :disabled="true" placeholder="请选择通信地址" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
<u-icon class="back-img" name="arrow-right" color="#9DA8B5" @click="selectAddress"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -43,12 +42,18 @@
|
|
|
<text>详细地址</text>
|
|
|
</view>
|
|
|
<view class="list-item-right flex_1">
|
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.receiveAddress.receiveAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="reverseReceiveAddress.receiveAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 一键预约 -->
|
|
|
- <u-button :custom-style="yuYueBtn" :hair-line="false" @click="submit">一键预约</u-button>
|
|
|
+ <view class="flex flex_column justify_center align_center yuyueBtn">
|
|
|
+ <view v-if="!isHasRider.haveBindRider && !isHasRider.haveTempRider" class="title">暂无可上门骑手,不能下单</view>
|
|
|
+ <view class="haveRiderStyle" @click="submit" v-if="isHasRider.haveBindRider || isHasRider.haveTempRider">一键预约</view>
|
|
|
+ <view class="noRiderStyle" v-if="!isHasRider.haveBindRider && !isHasRider.haveTempRider">一键预约</view>
|
|
|
+ <!-- <u-button :custom-style="yuYueBtn" :hair-line="false" >一键预约</u-button> -->
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 今日上门回收价格 -->
|
|
|
<view class="statistics-title">今日上门回收价格</view>
|
|
|
<view>
|
|
@@ -111,7 +116,7 @@
|
|
|
<script>
|
|
|
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
|
|
|
import {geRubbishType} from '@/api/index'
|
|
|
- import {userInfoSave} from '@/api/data.js'
|
|
|
+ import {orderInfoSave,searchRider} from '@/api/data.js'
|
|
|
import { checkLogin } from '@/api/login.js'
|
|
|
import {saomaOrder} from '@/api/order.js'
|
|
|
export default{
|
|
@@ -119,6 +124,7 @@
|
|
|
data(){
|
|
|
return{
|
|
|
yuYueBtn:{
|
|
|
+ width:'100%',
|
|
|
background: "#1995FF",
|
|
|
borderRadius: "8px",
|
|
|
color:'#fff',
|
|
@@ -134,22 +140,23 @@
|
|
|
rubbishPriceList:[],
|
|
|
form:{
|
|
|
mobile:'', // 手机号码
|
|
|
- receiveAddress: {
|
|
|
- provinceName: '',// 省
|
|
|
- cityName: '',// 市
|
|
|
- districtName: '', // 区
|
|
|
- receiveAddress: '',// 详细地址
|
|
|
- receiveAreasName:'',
|
|
|
- lat:'',
|
|
|
- lng:''
|
|
|
- }
|
|
|
+ },
|
|
|
+ reverseReceiveAddress: {
|
|
|
+ // provinceName: '',// 省
|
|
|
+ // cityName: '',// 市
|
|
|
+ // districtName: '', // 区
|
|
|
+ receiveAddress: '',// 详细地址
|
|
|
+ receiveAreasName:'',
|
|
|
+ lat:'',
|
|
|
+ lng:''
|
|
|
},
|
|
|
area:{},
|
|
|
statusBarHeight:0,
|
|
|
// toBar:44
|
|
|
// statusBarHeight:20,
|
|
|
toBarHeight:44,
|
|
|
- pageInfo:{}
|
|
|
+ pageInfo:{},
|
|
|
+ isHasRider:{} // 是否有绑定的骑手或3公里有可分配的骑手
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -194,6 +201,7 @@
|
|
|
pageInit() {
|
|
|
this.geRubbishTypeList()
|
|
|
this.getSaomaInfo()
|
|
|
+ this.getHasRider()
|
|
|
// this.checkUpdate()
|
|
|
},
|
|
|
// 返回
|
|
@@ -202,18 +210,31 @@
|
|
|
url:'/pages/index/index'
|
|
|
})
|
|
|
},
|
|
|
+ // 未绑定骑手 校验3公里是否有启用的骑手
|
|
|
+ getHasRider(){
|
|
|
+ searchRider().then(res=>{
|
|
|
+ console.log(res,'==================')
|
|
|
+ if(res.status==200){
|
|
|
+ this.isHasRider=res.data
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:res.message,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
// 选择通信地址
|
|
|
selectAddress(){
|
|
|
- console.log(this.form.receiveAddress.receiveAreasName,'==========')
|
|
|
+ // console.log(this.form.receiveAddress.receiveAreasName,'==========')
|
|
|
wx.chooseLocation({
|
|
|
success:(res)=>{
|
|
|
if(res){
|
|
|
- console.log(res,res.address,'----------------------')
|
|
|
- // this.getArea(res.address)
|
|
|
- // this.form.contactAddress=res.address
|
|
|
- this.form.receiveAddress.lat=res.latitude
|
|
|
- this.form.receiveAddress.lng=res.longitude
|
|
|
- this.form.receiveAddress.receiveAreasName= res.address
|
|
|
+ this.getArea(res.address)
|
|
|
+ this.reverseReceiveAddress.lat=res.latitude
|
|
|
+ this.reverseReceiveAddress.lng=res.longitude
|
|
|
+ this.reverseReceiveAddress.receiveAreasName= res.address
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -223,14 +244,9 @@
|
|
|
getSaomaInfo(){
|
|
|
saomaOrder().then(res=>{
|
|
|
if(res.status==200){
|
|
|
- // this.form=Object.assign(this.form,res.data)
|
|
|
this.pageInfo=res.data
|
|
|
this.form.mobile=res.data.mobile
|
|
|
- this.form.receiveAddress.provinceName=res.data.receiveAddressVO?res.data.receiveAddressVO.provinceName:''
|
|
|
- this.form.receiveAddress.cityName=res.data.receiveAddressVO?res.data.receiveAddressVO.cityName:''
|
|
|
- this.form.receiveAddress.districtName=res.data.receiveAddressVO?res.data.receiveAddressVO.districtName:''
|
|
|
- this.form.receiveAddress.receiveAddress=res.data.receiveAddressVO?res.data.receiveAddressVO.receiveAddress:''
|
|
|
- this.form.receiveAddress.receiveAreasName=res.data.receiveAddressVO?res.data.receiveAddressVO.receiveAreasName:''
|
|
|
+ this.reverseReceiveAddress=Object.assign(this.reverseReceiveAddress,res.data.reverseReceiveAddress||{})
|
|
|
}else{
|
|
|
uni.showToast({
|
|
|
title:res.message,
|
|
@@ -246,35 +262,35 @@
|
|
|
if (index1 == -1) {
|
|
|
index11 = str.indexOf("自治区")
|
|
|
if (index11 != -1) {
|
|
|
- this.form.receiveAddress.provinceName = str.substring(0, index11 + 3)
|
|
|
+ this.reverseReceiveAddress.provinceName = str.substring(0, index11 + 3)
|
|
|
} else {
|
|
|
- this.form.receiveAddress.provinceName= str.substring(0, 0)
|
|
|
+ this.reverseReceiveAddress.provinceName= str.substring(0, 0)
|
|
|
}
|
|
|
} else {
|
|
|
- this.form.receiveAddress.provinceName = str.substring(0, index1 + 1)
|
|
|
+ this.reverseReceiveAddress.provinceName = str.substring(0, index1 + 1)
|
|
|
}
|
|
|
|
|
|
let index2 = str.indexOf("市")
|
|
|
if (index11 == -1) {
|
|
|
- this.form.receiveAddress.cityName = str.substring(index11 + 1, index2 + 1)
|
|
|
+ this.reverseReceiveAddress.cityName = str.substring(index11 + 1, index2 + 1)
|
|
|
} else {
|
|
|
if (index11 == 0) {
|
|
|
- this.form.receiveAddress.cityName = str.substring(index1 + 1, index2 + 1)
|
|
|
+ this.reverseReceiveAddress.cityName = str.substring(index1 + 1, index2 + 1)
|
|
|
} else {
|
|
|
- this.form.receiveAddress.cityName = str.substring(index11 + 3, index2 + 1)
|
|
|
+ this.reverseReceiveAddress.cityName = str.substring(index11 + 3, index2 + 1)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let index3 = str.lastIndexOf("区")
|
|
|
if (index3 == -1) {
|
|
|
index3 = str.indexOf("县")
|
|
|
- this.form.receiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
|
+ this.reverseReceiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
|
} else {
|
|
|
- this.form.receiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
|
+ this.reverseReceiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
|
}
|
|
|
// return this.area;
|
|
|
- if(this.form.receiveAddress==''){
|
|
|
- this.form.receiveAddress.provinceName=this.form.receiveAddress.cityName
|
|
|
+ if(this.reverseReceiveAddress.provinceName==''){
|
|
|
+ this.reverseReceiveAddress.provinceName=this.reverseReceiveAddress.cityName
|
|
|
}
|
|
|
},
|
|
|
// 获取垃圾分类
|
|
@@ -362,12 +378,18 @@
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- userInfoSave(this.form).then(res=>{
|
|
|
+ const params=this.form
|
|
|
+ params.contactMobile=this.form.mobile?this.form.mobile:''
|
|
|
+ params.contactAddress=this.reverseReceiveAddress.receiveAreasName?this.reverseReceiveAddress.receiveAreasName:''
|
|
|
+ params.houseAddress=this.reverseReceiveAddress.receiveAddress?this.reverseReceiveAddress.receiveAddress:''
|
|
|
+ params.lat=this.reverseReceiveAddress.lat?this.reverseReceiveAddress.lat:''
|
|
|
+ params.lng=this.reverseReceiveAddress.lng?this.reverseReceiveAddress.lng:''
|
|
|
+ orderInfoSave(params).then(res=>{
|
|
|
if(res.status==200){
|
|
|
- // uni.$emit('pageType', {data: 'userInfo' })
|
|
|
+ const id=res.data?res.data.id:''
|
|
|
setTimeout(()=>{
|
|
|
uni.navigateTo({
|
|
|
- url:'/pages/index/yuyueResult'
|
|
|
+ url:`/pages/index/yuyueResult?id=${id}`
|
|
|
})
|
|
|
},300)
|
|
|
}
|
|
@@ -506,6 +528,34 @@
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
}
|
|
|
+ .yuyueBtn{
|
|
|
+ width: 100%;
|
|
|
+ .title{
|
|
|
+ color: red;
|
|
|
+ margin-bottom: 15rpx;
|
|
|
+ }
|
|
|
+ .haveRiderStyle{
|
|
|
+ width: 100%;
|
|
|
+ background: #1995FF;
|
|
|
+ height: 84rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ color:#fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .noRiderStyle{
|
|
|
+ width: 100%;
|
|
|
+ height: 84rpx;
|
|
|
+ background: rgba(25, 149, 255, 0.6);
|
|
|
+ color:#fff;
|
|
|
+ font-weight: 500;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
.statistics-title{
|
|
|
font-size: 36upx;
|
|
|
font-family: PingFang SC;
|