Commit 65ab7ebc by zhangzhen

功能优化

parent 704f6e29
...@@ -31,7 +31,7 @@ export const computePrice=(data)=>{ ...@@ -31,7 +31,7 @@ export const computePrice=(data)=>{
return http.post(url,data) return http.post(url,data)
} }
// 需要授权
export const openDoor=(orderNo)=>{ export const openDoor=(orderNo)=>{
let url=`/order/open/door?orderNo=${orderNo}` let url=`/order/open/door?orderNo=${orderNo}`
return http.get(url) return http.get(url)
...@@ -52,3 +52,14 @@ export const recordsList=(data,)=>{ ...@@ -52,3 +52,14 @@ export const recordsList=(data,)=>{
let url=`/records/list` let url=`/records/list`
return http.get(url,data) return http.get(url,data)
} }
// 不需要授权
export const noLoginOpenDoor=(orderNo)=>{
let url=`/openInterface/open/door?orderNo=${orderNo}`
return http.get(url)
}
export const noLoginGetOrderInfo=(id)=>{
let url=`/openInterface/order/info/`+id
return http.get(url)
}
\ No newline at end of file
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<view v-if="list.length == 0" class="empty-box"> <view v-if="list.length == 0" class="empty-box">
<!-- 列表数量为0时 --> <!-- 列表数量为0时 -->
<u-empty text="暂无数据" textColor='#C1C1C1' width="60" <u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="storeListBlankImage"> :icon="listBlankImage">
</u-empty> </u-empty>
</view> </view>
<!-- 当数据没有更多时 --> <!-- 当数据没有更多时 -->
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
status: 'nomore ', status: 'nomore ',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '上划加载', loadmoreText: '上划加载',
nomoreText: '已展示全部门店', nomoreText: '已展示全部',
scrollTop: 0, scrollTop: 0,
current: '', current: '',
hostUrl: indexConfig.hostUrl, hostUrl: indexConfig.hostUrl,
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
eventChannel:null, eventChannel:null,
tipText:"", tipText:"",
show:false, show:false,
listBlankImage:indexConfig.assetsPath+'/no_data_icon.png',
}; };
}, },
components: { components: {
......
...@@ -319,7 +319,6 @@ ...@@ -319,7 +319,6 @@
}, },
onGetSortDistance(i = 0){ onGetSortDistance(i = 0){
if(i >= this.roomVoList.length){ if(i >= this.roomVoList.length){
console.log(this.roomVoList,909090)
// this.$forceUpdate(); // this.$forceUpdate();
return return
} }
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<text class="text-title">联系我们</text> <text class="text-title">联系我们</text>
</view> </view>
</view> </view>
<view class="cu-item arrow" @tap="onHandle(5)"> <view v-if="userInfo.roleType >= 2" class="cu-item arrow" @tap="onHandle(5)">
<view class="content"> <view class="content">
<image :src="assetsPath+'/my_list_4.png'" class="png" mode="aspectFit"></image> <image :src="assetsPath+'/my_list_4.png'" class="png" mode="aspectFit"></image>
<text class="text-title">设备控制</text> <text class="text-title">设备控制</text>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
</view> </view>
<view class="part-left"> <view class="part-left">
<image :src="roomInfo.images.length?roomInfo.images[0]: assetsPath+'/blank2.jpg'" mode="widthFix"> <image :src="roomInfo.images.length?roomInfo.images[0]: assetsPath+'/banner.jpg'" mode="widthFix">
</image> </image>
</view> </view>
</view> </view>
...@@ -319,6 +319,22 @@ ...@@ -319,6 +319,22 @@
></uni-popup-dialog> ></uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-popup ref="popupMessage" type="center">
<view class="flex-col message-box">
<view class="header">
<text>提示</text>
</view>
<view class="content">
<text>
您选的预定时间已有被占用,请选择其他空闲时段
</text>
</view>
<view class="button-box">
<text>好的</text>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
...@@ -480,6 +496,7 @@ ...@@ -480,6 +496,7 @@
} }
}, },
onLoad(option) { onLoad(option) {
// this.$refs.popupMessage.open();
uni.showLoading({ uni.showLoading({
title: "加载中" title: "加载中"
}) })
...@@ -693,6 +710,7 @@ ...@@ -693,6 +710,7 @@
} }
if(index >= this.dateIntervalList.length-1){ if(index >= this.dateIntervalList.length-1){
if(!this.addM && this.dateIntervalList[0].status){ if(!this.addM && this.dateIntervalList[0].status){
console.log(this.startTime,909090)
this.addM = true this.addM = true
// 开始时间加一分钟 // 开始时间加一分钟
let arr = this.startTime.split(":"); let arr = this.startTime.split(":");
...@@ -867,7 +885,7 @@ ...@@ -867,7 +885,7 @@
}else{ }else{
that.selectCouponIndex = -1 that.selectCouponIndex = -1
} }
that.onComputePrice();
} }
}, },
success(res) { success(res) {
...@@ -1259,9 +1277,9 @@ ...@@ -1259,9 +1277,9 @@
title: res.data.msg || "下单失败", title: res.data.msg || "下单失败",
duration:2000, duration:2000,
success: () => { success: () => {
setTimeout(()=>{ // setTimeout(()=>{
this.onGetSortDistance() // this.onGetSortDistance()
},2000) // },2000)
} }
}) })
} }
...@@ -2050,4 +2068,37 @@ ...@@ -2050,4 +2068,37 @@
} }
} }
} }
.message-box{
display: flex;
width: 80%;
background-color: #ffffff;
border-radius: 12upx;
overflow: hidden;
margin: 0 auto;
.header{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 90upx;
border-bottom: 1px solid #e5e5e5;
}
.content{
display: flex;
justify-content: center;
align-items: center;
height: 240upx;
border-bottom: 1px solid #e5e5e5;
padding: 0 30upx;
}
.button-box{
display: flex;
justify-content: center;
align-items: center;
height: 90upx;
text{
color: #55aaff;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -102,7 +102,13 @@ ...@@ -102,7 +102,13 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="loginStatus && list.length == 0" text="未查询到相关订单" textColor='#C1C1C1'></u-empty>
<view v-if="loginStatus && list.length == 0" class="empty-box">
<u-empty text="未查询到相关订单" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<view v-if="loginStatus && list.length" style="padding: 12px 6% 0;"> <view v-if="loginStatus && list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText" <u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" /> :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
...@@ -172,7 +178,8 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -172,7 +178,8 @@ import NoLogin from "@/components/noLogin/noLogin"
2:'退款中', 2:'退款中',
3:'已退款', 3:'已退款',
4:'拒绝退款' 4:'拒绝退款'
} },
listBlankImage:config.assetsPath+'/no_data_icon.png',
}; };
}, },
onLoad() { onLoad() {
...@@ -203,7 +210,6 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -203,7 +210,6 @@ import NoLogin from "@/components/noLogin/noLogin"
this.orderStatusEnum = getDictItem(dicts, "store_order_status"); this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type"); this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.refundStatusEnum = getDictItem(dicts, "order_refund_status"); this.refundStatusEnum = getDictItem(dicts, "order_refund_status");
this.onLoading() this.onLoading()
}) })
} }
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<script> <script>
import {getDictItem} from "@/utils/tools.js" import {getDictItem} from "@/utils/tools.js"
import fNavbar from '@/components/module/f-navbar/f-navbar'; import fNavbar from '@/components/module/f-navbar/f-navbar';
import {getOrderInfoByNo,orderRefund,openDoor} from "@/api/order.js" import {getOrderInfoByNo,orderRefund,openDoor,noLoginOpenDoor,noLoginGetOrderInfo} from "@/api/order.js"
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import config from "@/config/index.config" import config from "@/config/index.config"
import {listSortDistance} from "@/api/store.js"; import {listSortDistance} from "@/api/store.js";
...@@ -167,11 +167,13 @@ ...@@ -167,11 +167,13 @@
this.orderNo = option.orderNo; this.orderNo = option.orderNo;
if(option.share && option.share =="share"){ if(option.share && option.share =="share"){
this.shareOrder = true this.shareOrder = true
this.onGetOrderInfo()
}else{ }else{
this.shareOrder = false this.shareOrder = false
this.onLoading();
} }
this.onGetDicts() this.onGetDicts()
this.onLoading();
if(option.success){ if(option.success){
this.onMessagePush() this.onMessagePush()
} }
...@@ -214,6 +216,19 @@ ...@@ -214,6 +216,19 @@
} }
}) })
}, },
onGetOrderInfo(){
noLoginGetOrderInfo(this.orderNo).then(res=>{
this.orderInfo = {
...res.data.data,
roomImages: res.data.data.roomImages.split(','),
startDate: res.data.data.startDate? res.data.data.startDate.split(" ")[0] : res.data.data.preStartDate.split(" ")[0],
startTime: res.data.data.startDate? res.data.data.startDate.split(" ")[1] : res.data.data.preStartDate.split(" ")[1],
endDate: res.data.data.endDate? res.data.data.endDate.split(" ")[0] : res.data.data.preEndDate.split(" ")[0],
endTime: res.data.data.endDate? res.data.data.endDate.split(" ")[1] : res.data.data.preEndDate.split(" ")[1],
payTime:res.data.data.payTime? moment(res.data.data.payTime).format("YYYY-MM-DD HH:mm:ss") :''
}
})
},
onNavToShare(){ onNavToShare(){
// uni.navigateTo({ // uni.navigateTo({
// url:"/pages/share/share?orderNo="+this.orderNo // url:"/pages/share/share?orderNo="+this.orderNo
...@@ -236,6 +251,21 @@ ...@@ -236,6 +251,21 @@
title:"开门中..." title:"开门中..."
}) })
this.openDoorStatus = true; this.openDoorStatus = true;
if(this.shareOrder){
noLoginOpenDoor(this.orderNo).then(res=>{
uni.hideLoading()
uni.showToast({
icon:"none",
title:res.data.msg
})
if(res.data.code == 200){
this.onLoading();
}
setTimeout(()=>{
this.openDoorStatus = false;
},5000)
})
}else{
openDoor(this.orderNo).then(res=>{ openDoor(this.orderNo).then(res=>{
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
...@@ -250,6 +280,7 @@ ...@@ -250,6 +280,7 @@
},5000) },5000)
}) })
} }
}
}, },
onNavToMap() { onNavToMap() {
uni.openLocation({ uni.openLocation({
......
...@@ -19,7 +19,11 @@ ...@@ -19,7 +19,11 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="loginStatus && list.length == 0" text="未查询到相关订单" textColor='#C1C1C1'></u-empty> <view v-if="loginStatus && list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<view v-if="loginStatus && list.length" style="padding: 12px 6% 0;"> <view v-if="loginStatus && list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText" <u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" /> :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
...@@ -29,6 +33,7 @@ ...@@ -29,6 +33,7 @@
</template> </template>
<script> <script>
import config from "@/config/index.config"
import { import {
recordsList recordsList
} from "@/api/order.js" } from "@/api/order.js"
...@@ -84,7 +89,8 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -84,7 +89,8 @@ import NoLogin from "@/components/noLogin/noLogin"
payStatus:{ payStatus:{
expenditure:'-', expenditure:'-',
income:'+' income:'+'
} },
listBlankImage:config.assetsPath+'/no_data_icon.png',
}; };
}, },
onLoad() { onLoad() {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</view> </view>
<view v-if="list.length == 0" class="empty-box"> <view v-if="list.length == 0" class="empty-box">
<!-- 列表数量为0时 --> <!-- 列表数量为0时 -->
<u-empty text="暂无门店数据" textColor='#C1C1C1' width="60" <u-empty text="暂无门店数据" textColor='#C1C1C1' width="120"
:icon="storeListBlankImage"> :icon="storeListBlankImage">
</u-empty> </u-empty>
</view> </view>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
show:true, show:true,
timer:null, timer:null,
storeTypeEnum:{}, storeTypeEnum:{},
storeListBlankImage:config.assetsPath+'/store_blank.png', storeListBlankImage:config.assetsPath+'/no_data_icon.png',
}; };
}, },
onLoad() { onLoad() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment