Commit 65ab7ebc by zhangzhen

功能优化

parent 704f6e29
......@@ -31,7 +31,7 @@ export const computePrice=(data)=>{
return http.post(url,data)
}
// 需要授权
export const openDoor=(orderNo)=>{
let url=`/order/open/door?orderNo=${orderNo}`
return http.get(url)
......@@ -52,3 +52,14 @@ export const recordsList=(data,)=>{
let url=`/records/list`
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 @@
<view v-if="list.length == 0" class="empty-box">
<!-- 列表数量为0时 -->
<u-empty text="暂无数据" textColor='#C1C1C1' width="60"
:icon="storeListBlankImage">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<!-- 当数据没有更多时 -->
......@@ -62,7 +62,7 @@
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '已展示全部门店',
nomoreText: '已展示全部',
scrollTop: 0,
current: '',
hostUrl: indexConfig.hostUrl,
......@@ -79,6 +79,7 @@
eventChannel:null,
tipText:"",
show:false,
listBlankImage:indexConfig.assetsPath+'/no_data_icon.png',
};
},
components: {
......
......@@ -319,7 +319,6 @@
},
onGetSortDistance(i = 0){
if(i >= this.roomVoList.length){
console.log(this.roomVoList,909090)
// this.$forceUpdate();
return
}
......
......@@ -82,7 +82,7 @@
<text class="text-title">联系我们</text>
</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">
<image :src="assetsPath+'/my_list_4.png'" class="png" mode="aspectFit"></image>
<text class="text-title">设备控制</text>
......
......@@ -15,7 +15,7 @@
</view>
</view>
<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>
</view>
</view>
......@@ -319,6 +319,22 @@
></uni-popup-dialog>
</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>
</template>
......@@ -480,6 +496,7 @@
}
},
onLoad(option) {
// this.$refs.popupMessage.open();
uni.showLoading({
title: "加载中"
})
......@@ -693,6 +710,7 @@
}
if(index >= this.dateIntervalList.length-1){
if(!this.addM && this.dateIntervalList[0].status){
console.log(this.startTime,909090)
this.addM = true
// 开始时间加一分钟
let arr = this.startTime.split(":");
......@@ -867,7 +885,7 @@
}else{
that.selectCouponIndex = -1
}
that.onComputePrice();
}
},
success(res) {
......@@ -1259,9 +1277,9 @@
title: res.data.msg || "下单失败",
duration:2000,
success: () => {
setTimeout(()=>{
this.onGetSortDistance()
},2000)
// setTimeout(()=>{
// this.onGetSortDistance()
// },2000)
}
})
}
......@@ -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>
\ No newline at end of file
......@@ -102,7 +102,13 @@
</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;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
......@@ -172,7 +178,8 @@ import NoLogin from "@/components/noLogin/noLogin"
2:'退款中',
3:'已退款',
4:'拒绝退款'
}
},
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
......@@ -203,7 +210,6 @@ import NoLogin from "@/components/noLogin/noLogin"
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.refundStatusEnum = getDictItem(dicts, "order_refund_status");
this.onLoading()
})
}
......
......@@ -135,7 +135,7 @@
<script>
import {getDictItem} from "@/utils/tools.js"
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 config from "@/config/index.config"
import {listSortDistance} from "@/api/store.js";
......@@ -167,11 +167,13 @@
this.orderNo = option.orderNo;
if(option.share && option.share =="share"){
this.shareOrder = true
this.onGetOrderInfo()
}else{
this.shareOrder = false
this.onLoading();
}
this.onGetDicts()
this.onLoading();
if(option.success){
this.onMessagePush()
}
......@@ -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(){
// uni.navigateTo({
// url:"/pages/share/share?orderNo="+this.orderNo
......@@ -236,6 +251,21 @@
title:"开门中..."
})
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=>{
uni.hideLoading()
uni.showToast({
......@@ -250,6 +280,7 @@
},5000)
})
}
}
},
onNavToMap() {
uni.openLocation({
......
......@@ -19,7 +19,11 @@
</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;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
......@@ -29,6 +33,7 @@
</template>
<script>
import config from "@/config/index.config"
import {
recordsList
} from "@/api/order.js"
......@@ -84,7 +89,8 @@ import NoLogin from "@/components/noLogin/noLogin"
payStatus:{
expenditure:'-',
income:'+'
}
},
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
......
......@@ -28,7 +28,7 @@
</view>
<view v-if="list.length == 0" class="empty-box">
<!-- 列表数量为0时 -->
<u-empty text="暂无门店数据" textColor='#C1C1C1' width="60"
<u-empty text="暂无门店数据" textColor='#C1C1C1' width="120"
:icon="storeListBlankImage">
</u-empty>
</view>
......@@ -79,7 +79,7 @@
show:true,
timer:null,
storeTypeEnum:{},
storeListBlankImage:config.assetsPath+'/store_blank.png',
storeListBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
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