|
@@ -13,8 +13,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="content-body">
|
|
<view class="content-body">
|
|
<view class="store-image flex flex_column justify_center align_center">
|
|
<view class="store-image flex flex_column justify_center align_center">
|
|
- <u-image src="/static/index/def_home_shop.png" width="172" height="172" ></u-image>
|
|
|
|
- <text>骑手张三的店铺</text>
|
|
|
|
|
|
+ <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>
|
|
</view>
|
|
</view>
|
|
<!-- 表单 -->
|
|
<!-- 表单 -->
|
|
<view class="list-container">
|
|
<view class="list-container">
|
|
@@ -24,7 +24,7 @@
|
|
<u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 16rpx 10rpx;"></u-image>
|
|
<u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 16rpx 10rpx;"></u-image>
|
|
</view>
|
|
</view>
|
|
<view class="list-item-right flex_1">
|
|
<view class="list-item-right flex_1">
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.contactMobile" placeholder="请输入车牌号码" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="form.mobile" placeholder="请输入联系电话" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="list-item">
|
|
<view class="list-item">
|
|
@@ -32,7 +32,7 @@
|
|
<text>通信地址</text>
|
|
<text>通信地址</text>
|
|
</view>
|
|
</view>
|
|
<view class="list-item-right flex_1">
|
|
<view class="list-item-right flex_1">
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.contactAddress" @click="selectAddress" :disabled="true" placeholder="请选择通信地址" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
|
|
|
+ <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-icon class="back-img" name="arrow-right" color="#9DA8B5" @click="selectAddress"></u-icon>
|
|
<u-icon class="back-img" name="arrow-right" color="#9DA8B5" @click="selectAddress"></u-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -41,7 +41,7 @@
|
|
<text>详细地址</text>
|
|
<text>详细地址</text>
|
|
</view>
|
|
</view>
|
|
<view class="list-item-right flex_1">
|
|
<view class="list-item-right flex_1">
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.houseAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="form.receiveAddress.receiveAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -111,6 +111,7 @@
|
|
import {geRubbishType} from '@/api/index'
|
|
import {geRubbishType} from '@/api/index'
|
|
import {userInfoSave} from '@/api/data.js'
|
|
import {userInfoSave} from '@/api/data.js'
|
|
import { checkLogin } from '@/api/login.js'
|
|
import { checkLogin } from '@/api/login.js'
|
|
|
|
+ import {saomaOrder} from '@/api/order.js'
|
|
export default{
|
|
export default{
|
|
components: {uniNavBar},
|
|
components: {uniNavBar},
|
|
data(){
|
|
data(){
|
|
@@ -129,18 +130,24 @@
|
|
rubbishYWList:[],
|
|
rubbishYWList:[],
|
|
rubbishJSList:[],
|
|
rubbishJSList:[],
|
|
rubbishPriceList:[],
|
|
rubbishPriceList:[],
|
|
- form: {
|
|
|
|
- contactMobile: '', //联系人手机
|
|
|
|
- contactAddress:'' ,// 通讯地址
|
|
|
|
- lat:'', // 通讯地址的经度
|
|
|
|
- lng:'', // 通讯地址的纬度
|
|
|
|
- houseAddress:'', // 详细地址
|
|
|
|
|
|
+ form:{
|
|
|
|
+ mobile:'', // 手机号码
|
|
|
|
+ receiveAddress: {
|
|
|
|
+ provinceName: '',// 省
|
|
|
|
+ cityName: '',// 市
|
|
|
|
+ districtName: '', // 区
|
|
|
|
+ receiveAddress: '',// 详细地址
|
|
|
|
+ receiveAreasName:'',
|
|
|
|
+ lat:'',
|
|
|
|
+ lng:''
|
|
|
|
+ }
|
|
},
|
|
},
|
|
area:{},
|
|
area:{},
|
|
statusBarHeight:0,
|
|
statusBarHeight:0,
|
|
// toBar:44
|
|
// toBar:44
|
|
// statusBarHeight:20,
|
|
// statusBarHeight:20,
|
|
- toBarHeight:44
|
|
|
|
|
|
+ toBarHeight:44,
|
|
|
|
+ pageInfo:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -166,13 +173,16 @@
|
|
if(this.hasLogin){
|
|
if(this.hasLogin){
|
|
this.pageInit()
|
|
this.pageInit()
|
|
}else{
|
|
}else{
|
|
- this.noDataText="您尚未登录或登录已过期,完成登录后可进行下单操作!"
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pages/login/login'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
pageInit() {
|
|
pageInit() {
|
|
this.geRubbishTypeList()
|
|
this.geRubbishTypeList()
|
|
|
|
+ this.getSaomaInfo()
|
|
// this.checkUpdate()
|
|
// this.checkUpdate()
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
@@ -181,7 +191,40 @@
|
|
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //截取省市区
|
|
|
|
|
|
+ // 选择通信地址
|
|
|
|
+ selectAddress(){
|
|
|
|
+ wx.chooseLocation({
|
|
|
|
+ success:(res)=>{
|
|
|
|
+ if(res){
|
|
|
|
+ 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
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 扫码下单
|
|
|
|
+ getSaomaInfo(){
|
|
|
|
+ saomaOrder().then(res=>{
|
|
|
|
+ if(res.status==200){
|
|
|
|
+ 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:''
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:res.message,
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getArea(str) {
|
|
getArea(str) {
|
|
// let area = {}
|
|
// let area = {}
|
|
let index11 = 0
|
|
let index11 = 0
|
|
@@ -189,54 +232,37 @@
|
|
if (index1 == -1) {
|
|
if (index1 == -1) {
|
|
index11 = str.indexOf("自治区")
|
|
index11 = str.indexOf("自治区")
|
|
if (index11 != -1) {
|
|
if (index11 != -1) {
|
|
- this.area.Province = str.substring(0, index11 + 3)
|
|
|
|
|
|
+ this.form.receiveAddress.provinceName = str.substring(0, index11 + 3)
|
|
} else {
|
|
} else {
|
|
- this.area.Province = str.substring(0, 0)
|
|
|
|
|
|
+ this.form.receiveAddress.provinceName= str.substring(0, 0)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- this.area.Province = str.substring(0, index1 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.provinceName = str.substring(0, index1 + 1)
|
|
}
|
|
}
|
|
|
|
|
|
let index2 = str.indexOf("市")
|
|
let index2 = str.indexOf("市")
|
|
if (index11 == -1) {
|
|
if (index11 == -1) {
|
|
- this.area.City = str.substring(index11 + 1, index2 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.cityName = str.substring(index11 + 1, index2 + 1)
|
|
} else {
|
|
} else {
|
|
if (index11 == 0) {
|
|
if (index11 == 0) {
|
|
- this.area.City = str.substring(index1 + 1, index2 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.cityName = str.substring(index1 + 1, index2 + 1)
|
|
} else {
|
|
} else {
|
|
- this.area.City = str.substring(index11 + 3, index2 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.cityName = str.substring(index11 + 3, index2 + 1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
let index3 = str.lastIndexOf("区")
|
|
let index3 = str.lastIndexOf("区")
|
|
if (index3 == -1) {
|
|
if (index3 == -1) {
|
|
index3 = str.indexOf("县")
|
|
index3 = str.indexOf("县")
|
|
- this.area.Country = str.substring(index2 + 1, index3 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
} else {
|
|
} else {
|
|
- this.area.Country = str.substring(index2 + 1, index3 + 1)
|
|
|
|
|
|
+ this.form.receiveAddress.districtName = str.substring(index2 + 1, index3 + 1)
|
|
}
|
|
}
|
|
// return this.area;
|
|
// return this.area;
|
|
- if(this.area.Province==''){
|
|
|
|
- this.area.Province=this.area.City
|
|
|
|
|
|
+ if(this.form.receiveAddress==''){
|
|
|
|
+ this.form.receiveAddress.provinceName=this.form.receiveAddress.cityName
|
|
}
|
|
}
|
|
- console.log(this.area,'---------------省市区')
|
|
|
|
},
|
|
},
|
|
- // 选择通信地址
|
|
|
|
- selectAddress(){
|
|
|
|
- wx.chooseLocation({
|
|
|
|
- success:(res)=>{
|
|
|
|
- if(res){
|
|
|
|
- this.getArea(res.address)
|
|
|
|
- console.log(res,'------------------地址信息',this.getArea(res.address))
|
|
|
|
- // this.form.contactAddress=res.address
|
|
|
|
- this.form.lat=res.latitude
|
|
|
|
- this.form.lng=res.longitude
|
|
|
|
- this.form.contactAddress=this.area.Province+this.area.City+this.area.Country
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 获取垃圾分类
|
|
// 获取垃圾分类
|
|
geRubbishTypeList(){
|
|
geRubbishTypeList(){
|
|
geRubbishType().then(res=>{
|
|
geRubbishType().then(res=>{
|
|
@@ -314,28 +340,25 @@
|
|
},
|
|
},
|
|
// 预约
|
|
// 预约
|
|
submit(){
|
|
submit(){
|
|
- uni.navigateTo({
|
|
|
|
- url:'/pages/index/yuyueResult'
|
|
|
|
|
|
+ const testVal=/^1[34578]\d{9}$/
|
|
|
|
+ if (!testVal.test(this.form.mobile)) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请输入正确的联系电话',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ const params=Object.assign(this.form)
|
|
|
|
+ userInfoSave(params).then(res=>{
|
|
|
|
+ if(res.status==200){
|
|
|
|
+ // uni.$emit('pageType', {data: 'userInfo' })
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pages/index/yuyueResult'
|
|
|
|
+ })
|
|
|
|
+ },300)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- // const testVal=/^1[34578]\d{9}$/
|
|
|
|
- // if (!testVal.test(this.form.contactMobile)) {
|
|
|
|
- // uni.showToast({
|
|
|
|
- // title: '请输入正确的联系电话',
|
|
|
|
- // icon: 'none'
|
|
|
|
- // })
|
|
|
|
- // return false
|
|
|
|
- // }
|
|
|
|
- // const params=Object.assign(this.form,{lat:this.form.lat,lng:this.form.lng})
|
|
|
|
- // userInfoSave(params).then(res=>{
|
|
|
|
- // if(res.status==200){
|
|
|
|
- // uni.$emit('pageType', {data: 'userInfo' })
|
|
|
|
- // setTimeout(()=>{
|
|
|
|
- // uni.navigateBack({
|
|
|
|
-
|
|
|
|
- // })
|
|
|
|
- // },300)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
},
|
|
},
|
|
// 未登录弹窗
|
|
// 未登录弹窗
|
|
loginModal(){
|
|
loginModal(){
|
|
@@ -368,7 +391,7 @@
|
|
height: 100vh;
|
|
height: 100vh;
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
- position: absolute;
|
|
|
|
|
|
+ // position: absolute;
|
|
.content-nav{
|
|
.content-nav{
|
|
width: 750upx;
|
|
width: 750upx;
|
|
height: 396upx ;
|
|
height: 396upx ;
|