|
@@ -17,99 +17,122 @@
|
|
|
<text v-if="isHasRider.haveBindRider && pageInfo.name">{{pageInfo.name}}</text>
|
|
|
<text v-else>{{mobile}}</text>
|
|
|
</view>
|
|
|
+
|
|
|
<!-- 表单 -->
|
|
|
- <view class="list-container">
|
|
|
- <view class="list-item">
|
|
|
- <view class="list-item-left phone flex align_center">
|
|
|
- <text>联系电话</text>
|
|
|
- <u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 16rpx 10rpx;"></u-image>
|
|
|
- </view>
|
|
|
- <view class="list-item-right flex_1">
|
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="form.mobile" placeholder="请输入联系电话" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="list-item">
|
|
|
- <view class="list-item-left">
|
|
|
- <text>通信地址</text>
|
|
|
- </view>
|
|
|
- <view class="list-item-right flex_1">
|
|
|
- <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>
|
|
|
- <view class="list-item">
|
|
|
- <view class="list-item-left">
|
|
|
- <text>详细地址</text>
|
|
|
+ <view v-if="!isHasOrder">
|
|
|
+ <view class="list-container">
|
|
|
+ <view class="list-item">
|
|
|
+ <view class="list-item-left phone flex align_center">
|
|
|
+ <text>联系电话</text>
|
|
|
+ <u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 16rpx 10rpx;"></u-image>
|
|
|
+ </view>
|
|
|
+ <view class="list-item-right flex_1">
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="form.mobile" placeholder="请输入联系电话" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="list-item-right flex_1">
|
|
|
- <u-input class="flex_1" :custom-style="inputClass" v-model="reverseReceiveAddress.receiveAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 一键预约 -->
|
|
|
- <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>
|
|
|
- <!-- 纸张类 -->
|
|
|
- <view class="statistics-box" v-if="rubbishPaperList.length">
|
|
|
- <view class="rubbishType-type">
|
|
|
- {{rubbishPaperName ? rubbishPaperName :''}}
|
|
|
+ <view class="list-item">
|
|
|
+ <view class="list-item-left">
|
|
|
+ <text>通信地址</text>
|
|
|
+ </view>
|
|
|
+ <view class="list-item-right flex_1">
|
|
|
+ <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>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishPaperList" class="rubbishType-item">
|
|
|
- <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
- <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ <view class="list-item">
|
|
|
+ <view class="list-item-left">
|
|
|
+ <text>详细地址</text>
|
|
|
</view>
|
|
|
+ <view class="list-item-right flex_1">
|
|
|
+ <u-input class="flex_1" :custom-style="inputClass" v-model="reverseReceiveAddress.receiveAddress" placeholder="街道,楼牌号等" placeholder-style="color:'#bbb';font-size:18px"/>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- 塑料类 -->
|
|
|
- <view class="statistics-box" v-if="rubbishSLList.length">
|
|
|
- <view class="rubbishType-type">
|
|
|
- {{rubbishSLName ? rubbishSLName :''}}
|
|
|
+ <!-- 一键预约 -->
|
|
|
+ <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 >
|
|
|
+ <!-- 纸张类 -->
|
|
|
+ <view class="statistics-box" v-if="rubbishPaperList.length">
|
|
|
+ <view class="rubbishType-type">
|
|
|
+ {{rubbishPaperName ? rubbishPaperName :''}}
|
|
|
+ </view>
|
|
|
+ <view class="flex rubbish">
|
|
|
+ <view v-for="item in rubbishPaperList" class="rubbishType-item">
|
|
|
+ <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
+ <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishSLList" class="rubbishType-item">
|
|
|
- <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
- <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ <!-- 塑料类 -->
|
|
|
+ <view class="statistics-box" v-if="rubbishSLList.length">
|
|
|
+ <view class="rubbishType-type">
|
|
|
+ {{rubbishSLName ? rubbishSLName :''}}
|
|
|
+ </view>
|
|
|
+ <view class="flex rubbish">
|
|
|
+ <view v-for="item in rubbishSLList" class="rubbishType-item">
|
|
|
+ <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
+ <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <!-- 金属类 -->
|
|
|
- <view class="statistics-box" v-if="rubbishJSList.length">
|
|
|
- <view class="rubbishType-type">
|
|
|
- {{rubbishJSName ? rubbishJSName :''}}
|
|
|
+ <!-- 金属类 -->
|
|
|
+ <view class="statistics-box" v-if="rubbishJSList.length">
|
|
|
+ <view class="rubbishType-type">
|
|
|
+ {{rubbishJSName ? rubbishJSName :''}}
|
|
|
+ </view>
|
|
|
+ <view class="flex rubbish">
|
|
|
+ <view v-for="item in rubbishJSList" class="rubbishType-item">
|
|
|
+ <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
+ <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishJSList" class="rubbishType-item">
|
|
|
- <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
- <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ <!-- 衣物类 -->
|
|
|
+ <view class="statistics-box" v-if="rubbishYWList.length">
|
|
|
+ <view class="rubbishType-type">
|
|
|
+ {{rubbishYWName ? rubbishYWName :''}}
|
|
|
+ </view>
|
|
|
+ <view class="flex rubbish">
|
|
|
+ <view v-for="item in rubbishYWList" class="rubbishType-item">
|
|
|
+ <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
+ <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <!-- 衣物类 -->
|
|
|
- <view class="statistics-box" v-if="rubbishYWList.length">
|
|
|
- <view class="rubbishType-type">
|
|
|
- {{rubbishYWName ? rubbishYWName :''}}
|
|
|
+ <view class="nodata" v-if="rubbishPriceList.length==0">
|
|
|
+ <u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishYWList" class="rubbishType-item">
|
|
|
- <u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
- <span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 订单完成 -->
|
|
|
+ <view v-if="isHasOrder">
|
|
|
+ <view class="body-state">
|
|
|
+ <!-- <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>
|
|
|
+ </view> -->
|
|
|
+ <view class="result">
|
|
|
+ 您于<text>{{createDate|| ''}}</text>下单成功, 点击<text style="color:#1995FF" @click="checkOrderDetail">查看详情</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="content-footer" @itemChange="chooseReason">
|
|
|
+ <v-select :showSelete="false" :showBtn="true" code="CANCEL_REASON" @itemChange="chooseReason" ></v-select>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="nodata" v-if="rubbishPriceList.length==0">
|
|
|
- <u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
+ <!-- 取消订单弹窗 -->
|
|
|
+ <uni-popup ref="openModal" type="center">
|
|
|
+ <uni-popup-dialog content="您确定要取消此订单吗?" @confirm="onOk" title="取消订单"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -118,9 +141,13 @@
|
|
|
import {geRubbishType} from '@/api/index'
|
|
|
import {orderInfoSave,searchRider} from '@/api/data.js'
|
|
|
import { checkLogin } from '@/api/login.js'
|
|
|
- import {saomaOrder} from '@/api/order.js'
|
|
|
+ import {saomaOrder,hasOrder} from '@/api/order.js'
|
|
|
+ import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
+ import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
|
|
|
+ import {cancelOrder} from '@/api/order.js'
|
|
|
+ import vSelect from '@/components/select/v-select.vue'
|
|
|
export default{
|
|
|
- components: {uniNavBar},
|
|
|
+ components: {uniPopup,uniPopupDialog,vSelect,uniNavBar},
|
|
|
data(){
|
|
|
return{
|
|
|
yuYueBtn:{
|
|
@@ -142,21 +169,17 @@
|
|
|
mobile:'', // 手机号码
|
|
|
},
|
|
|
reverseReceiveAddress: {
|
|
|
- // provinceName: '',// 省
|
|
|
- // cityName: '',// 市
|
|
|
- // districtName: '', // 区
|
|
|
receiveAddress: '',// 详细地址
|
|
|
receiveAreasName:'',
|
|
|
lat:'',
|
|
|
lng:''
|
|
|
},
|
|
|
area:{},
|
|
|
- statusBarHeight:0,
|
|
|
- // toBar:44
|
|
|
- // statusBarHeight:20,
|
|
|
+ statusBarHeight:20,
|
|
|
toBarHeight:44,
|
|
|
- pageInfo:{},
|
|
|
- isHasRider:{} // 是否有绑定的骑手或3公里有可分配的骑手
|
|
|
+ pageInfo:null,
|
|
|
+ isHasRider:null ,// 是否有绑定的骑手或3公里有可分配的骑手
|
|
|
+ isHasOrder:false,
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -187,14 +210,14 @@
|
|
|
})
|
|
|
},
|
|
|
computed: {
|
|
|
- // user() {
|
|
|
- // return this.userData
|
|
|
- // },
|
|
|
- // name(){
|
|
|
- // return this.$store.state.vuex_userInfoData.contactName
|
|
|
- // },
|
|
|
mobile(){
|
|
|
return this.$store.state.vuex_userInfoData.contactMobile
|
|
|
+ },
|
|
|
+ orderId(){
|
|
|
+ return this.$store.state.vuex_orderInfo.id
|
|
|
+ },
|
|
|
+ createDate(){
|
|
|
+ return this.$store.state.vuex_orderInfo.createDate
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -202,8 +225,48 @@
|
|
|
this.geRubbishTypeList()
|
|
|
this.getSaomaInfo()
|
|
|
this.getHasRider()
|
|
|
+ this.getOrderNum()
|
|
|
// this.checkUpdate()
|
|
|
},
|
|
|
+ // 查看是否有待完成订单
|
|
|
+ getOrderNum(){
|
|
|
+ hasOrder().then(res=>{
|
|
|
+ if(res.status==200){
|
|
|
+ this.isHasOrder=res.data>0
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(res,'===========')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看订单详情
|
|
|
+ checkOrderDetail(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:`/pages/order/orderDetails?id=${this.orderId}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 取消订单
|
|
|
+ chooseReason(e){
|
|
|
+ console.log(e,'-------取消订单')
|
|
|
+ cancelOrder({id:this.orderId,cancelReason:e}).then(res=>{
|
|
|
+ if(res.status==200){
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ this.getOrderNum()
|
|
|
+ setTimeout(()=>{
|
|
|
+ uni.switchTab({
|
|
|
+ url:'/pages/index/index'
|
|
|
+ })
|
|
|
+ },200)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
// 返回
|
|
|
onClickBack(){
|
|
|
uni.switchTab({
|
|
@@ -386,12 +449,15 @@
|
|
|
params.lng=this.reverseReceiveAddress.lng?this.reverseReceiveAddress.lng:''
|
|
|
orderInfoSave(params).then(res=>{
|
|
|
if(res.status==200){
|
|
|
- const id=res.data?res.data.id:''
|
|
|
- setTimeout(()=>{
|
|
|
- uni.navigateTo({
|
|
|
- url:`/pages/index/yuyueResult?id=${id}`
|
|
|
- })
|
|
|
- },300)
|
|
|
+ this.getOrderNum()
|
|
|
+ this.$u.vuex('vuex_orderInfo',res.data)
|
|
|
+ // this.orderId=res.data?res.data.id:''
|
|
|
+ // this.orderCreateTime=res.data? res.data.createDate:""
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:`/pages/index/yuyueResult?id=${id}`
|
|
|
+ // })
|
|
|
+ // },300)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -528,6 +594,41 @@
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
}
|
|
|
+ .body-state{
|
|
|
+ flex: 1;
|
|
|
+ overflow-y:scroll;
|
|
|
+ padding: 0 26rpx 30rpx;
|
|
|
+ }
|
|
|
+ // .store-image{
|
|
|
+ // // display:table-cell;
|
|
|
+ // padding:60upx 0;
|
|
|
+ // text-align: center;
|
|
|
+ // }
|
|
|
+ .result{
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ padding: 30upx;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+ .content-footer{
|
|
|
+ width: 100%;
|
|
|
+ padding: 12upx 32upx 32upx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ .cancelBtn{
|
|
|
+ width: 100%;
|
|
|
+ height: 84upx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ // background: #E5E5E5;
|
|
|
+ color: #666;
|
|
|
+ border-radius: 16upx;
|
|
|
+ font-size: 36upx;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
.yuyueBtn{
|
|
|
width: 100%;
|
|
|
.title{
|