Commit 6a9ff6c8 by zhangzhen

功能较大优化

parent af5ed6ad
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
this.$refs.popupPhone.close() this.$refs.popupPhone.close()
}, },
onGetPhoneNumber(e){ onGetPhoneNumber(e){
let that = this;
this.phoneCode = e.detail.code; this.phoneCode = e.detail.code;
wx.login({ wx.login({
success: (res) => { success: (res) => {
...@@ -81,8 +82,8 @@ ...@@ -81,8 +82,8 @@
key: uni.getStorageSync('tokenHeaders'), key: uni.getStorageSync('tokenHeaders'),
data: res.data.data.token, data: res.data.data.token,
success: (res) => { success: (res) => {
this.$refs.popupPhone.close()
that.$emit('success') that.$emit('success')
this.$refs.popupPhone.close()
} }
}) })
} }
......
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
imgUrl: config.assetsPath+'/order_2_icon.png', imgUrl: config.assetsPath+'/order_2_icon.png',
sortName:"续" sortName:"续"
}, },
{ // {
name:"验券", // name:"验券",
url:config.assetsPath+'/tool_3.png', // url:config.assetsPath+'/tool_3.png',
imgUrl: config.assetsPath+'/scan_code_icon.png', // imgUrl: config.assetsPath+'/scan_code_icon.png',
sortName:"验", // sortName:"验",
routePath:"/pages/useCouponIllustrate/useCouponIllustrate?keyData=coupon_use_process" // routePath:"/pages/useCouponIllustrate/useCouponIllustrate?keyData=coupon_use_process"
}, // },
{ {
name:"客服", name:"客服",
url:config.assetsPath+'/tool_4.png', url:config.assetsPath+'/tool_4.png',
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
} }
}, },
onHandle(val,index){ onHandle(val,index){
if(index===3){ if(index===2){
this.onGetSysConfig() this.onGetSysConfig()
return return
}; };
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</view> </view>
<view v-for="(item,index) in roomVoList" :key="index" class="list-item-box" <view v-for="(item,index) in roomVoList" :key="index" class="list-item-box"
@tap="onNavToOrder(item)"> @tap="onNavToOrder(item)">
<view class="itemRow listStyle"> <view class="itemRow listStyle">
<view class="relative part-top"> <view class="relative part-top">
<image class="room-img" :src="item.images[0]" mode="aspectFill" @tap.stop="onPreview(item.images)"></image> <image class="room-img" :src="item.images[0]" mode="aspectFill" @tap.stop="onPreview(item.images)"></image>
</view> </view>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<text>{{facilitieList[val]}}</text> <text>{{facilitieList[val]}}</text>
</view> </view>
</view> </view>
<view class="item-Go"> <view class="item-Go">
<view class="flex-row room-type"> <view class="flex-row room-type">
<view class="flex-col"> <view class="flex-col">
...@@ -78,13 +78,13 @@ ...@@ -78,13 +78,13 @@
<view class="part-2"> <view class="part-2">
<text class="text-sm">{{val.duration}}小时套餐:</text> <text class="text-sm">{{val.duration}}小时套餐:</text>
<text class="text-red text-bold text-xl">{{val.price}}</text> <text class="text-red text-bold text-xl">{{val.price}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="flex-between confirm-box"> <view class="flex-between confirm-box">
<view class="flex-priceBox"></view> <view class="flex-priceBox"></view>
<view class="confirm"> <view class="confirm">
...@@ -95,10 +95,10 @@ ...@@ -95,10 +95,10 @@
</view> </view>
<view class="flex-row list-point-box"> <view class="flex-row list-point-box">
<view v-for="(val,k) in list" :key="k" class="flex-1 flex-col"> <view v-for="(val,k) in list" :key="k" class="flex-1 flex-col">
<view class="box" :class="objListDate.length && objListDate[index] && objListDate[index].length && objListDate[index][k].status==1&& objListDate[index][k+1].status==1?'bg-pink':'bg-gray'"> <view class="box" :class="item.list && item.list[val].status==1 && item.list[val+1].status==1?'bg-pink':'bg-gray'">
</view> </view>
<text class="text-gray text-sm">{{val>=24? val-24:val}}</text> <text class="text-gray text-sm">{{val==24?'次日':val>24?val-24:val}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -156,11 +156,6 @@ ...@@ -156,11 +156,6 @@
LoginPop LoginPop
}, },
data() { data() {
let h = new Date().getHours();
let list = []
for(let i=0;i<24;i++){
list.push(h+i)
}
return { return {
scrollTop: 0, scrollTop: 0,
storeId: '', storeId: '',
...@@ -214,13 +209,14 @@ ...@@ -214,13 +209,14 @@
show: true, show: true,
timer: null, timer: null,
roomVoList:[], roomVoList:[],
list, list:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],
objListDate:[] objListDate:[]
} }
}, },
onShow() { onShow() {
this.onGetSysConfig(); this.onGetSysConfig();
this.onLoading() this.list = [];
this.onSetShowPoint()
}, },
onReachBottom() { onReachBottom() {
if (this.status == 'loadmore') { if (this.status == 'loadmore') {
...@@ -238,6 +234,15 @@ ...@@ -238,6 +234,15 @@
this.onGetDicts(); this.onGetDicts();
}, },
methods: { methods: {
onSetShowPoint(){
let h = new Date().getHours();
let list = []
for(let i=0;i<24;i++){
list.push(h+i)
}
this.list = list;
this.onLoading()
},
onGetSysConfig(){ onGetSysConfig(){
systemConfig().then(res=>{ systemConfig().then(res=>{
uni.setStorage({ uni.setStorage({
...@@ -254,12 +259,15 @@ ...@@ -254,12 +259,15 @@
this.facilitieList = getDictItem(dicts, "indoor_facilities"); this.facilitieList = getDictItem(dicts, "indoor_facilities");
this.roomTypeEnum = getDictItem(dicts, "store_room_type"); this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.roomStatusEnum = getDictItem(dicts, "store_room_status"); this.roomStatusEnum = getDictItem(dicts, "store_room_status");
if(this.roomVoList.length){
this.$forceUpdate()
}
}) })
}, },
onLoading() { onLoading() {
uni.showLoading({ uni.showLoading({
title:'加载中' title:'加载中'
}) })
uni.getLocation({ uni.getLocation({
type: "gcj02", type: "gcj02",
complete: (res) => { complete: (res) => {
...@@ -283,14 +291,13 @@ ...@@ -283,14 +291,13 @@
nowLatitude: this.latitude, nowLatitude: this.latitude,
nowLongitude: this.longitude nowLongitude: this.longitude
}).then(res => { }).then(res => {
uni.hideLoading()
if (res.data.code == 200 && res.data.data.length) { if (res.data.code == 200 && res.data.data.length) {
this.storeList = res.data.data; this.storeList = res.data.data;
let obj = {} let obj = {}
if(uni.getStorageSync("storeId")){ if(uni.getStorageSync("storeId")){
obj = this.storeList.find(item=>item.id === uni.getStorageSync("storeId")) obj = this.storeList.find(item=>item.id === uni.getStorageSync("storeId"))
}else{ }else{
obj = res.data.data[0]; obj = res.data.data[0];
} }
that.storeInfo = { that.storeInfo = {
...obj, ...obj,
...@@ -304,6 +311,7 @@ ...@@ -304,6 +311,7 @@
images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : [] images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : []
} }
}) })
uni.hideLoading()
that.onGetSortDistance(0); that.onGetSortDistance(0);
} }
} }
...@@ -311,7 +319,7 @@ ...@@ -311,7 +319,7 @@
}, },
onGetSortDistance(i = 0){ onGetSortDistance(i = 0){
if(i >= this.roomVoList.length){ if(i >= this.roomVoList.length){
this.$forceUpdate(); // this.$forceUpdate();
return return
} }
listSortDistance({ listSortDistance({
...@@ -320,8 +328,13 @@ ...@@ -320,8 +328,13 @@
day: moment().format("YYYY-MM-DD"), day: moment().format("YYYY-MM-DD"),
orderType:1 orderType:1
}).then(res=>{ }).then(res=>{
if(res.data.code == 200 && i <= this.roomVoList.length-1){ if(res.data.code == 200){
this.objListDate[i] = this.list.map(val=>res.data.data[val]) this.roomVoList = this.roomVoList.map((item,k)=>{
return {
...item,
list: i === k? res.data.data: item.list && item.list.length? item.list: []
}
})
this.onGetSortDistance(++i) this.onGetSortDistance(++i)
} }
}) })
...@@ -353,7 +366,7 @@ ...@@ -353,7 +366,7 @@
scale: 18, scale: 18,
name: this.storeInfo.address, name: this.storeInfo.address,
complete: (res) => { complete: (res) => {
} }
}) })
}, },
...@@ -361,12 +374,12 @@ ...@@ -361,12 +374,12 @@
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.storeInfo.phone, phoneNumber: this.storeInfo.phone,
complete: (res) => { complete: (res) => {
} }
}) })
}, },
onTouchStart() { onTouchStart() {
this.timer = null; this.timer = null;
this.show = true; this.show = true;
}, },
...@@ -403,7 +416,7 @@ ...@@ -403,7 +416,7 @@
if(res.authSetting['scope.userLocation']){ if(res.authSetting['scope.userLocation']){
this.onClose(); this.onClose();
this.onLoading() this.onLoading()
} }
} }
}) })
}, },
...@@ -439,7 +452,7 @@ ...@@ -439,7 +452,7 @@
display: flex; display: flex;
flex: 1; flex: 1;
width: 100vw; width: 100vw;
.content-box { .content-box {
position: absolute; position: absolute;
...@@ -509,7 +522,7 @@ ...@@ -509,7 +522,7 @@
margin-left: 158rpx; margin-left: 158rpx;
flex: 1; flex: 1;
} }
.cu-btn { .cu-btn {
background: linear-gradient(to right,rgba(250, 219, 73, 1),rgba(250, 219, 75, 1),rgba(255, 167, 81, 1)); background: linear-gradient(to right,rgba(250, 219, 73, 1),rgba(250, 219, 75, 1),rgba(255, 167, 81, 1));
box-shadow: 0 0 6px rgba(0, 0, 0, 0.3); box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
...@@ -789,7 +802,7 @@ ...@@ -789,7 +802,7 @@
font-weight: 500 !important; font-weight: 500 !important;
} }
} }
.text-dw{ .text-dw{
font-size: 36rpx; font-size: 36rpx;
margin-left: -4rpx; margin-left: -4rpx;
...@@ -818,11 +831,11 @@ ...@@ -818,11 +831,11 @@
.part-bottom{ .part-bottom{
display: flex; display: flex;
flex: 1; flex: 1;
border: 0 !important; border: 0 !important;
border-radius: 0rpx !important; border-radius: 0rpx !important;
padding-left: 20rpx; padding-left: 20rpx;
.room-title{ .room-title{
padding: 0 !important; padding: 0 !important;
display: flex; display: flex;
...@@ -832,7 +845,7 @@ ...@@ -832,7 +845,7 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
text{ text{
color: #9e9e9e; color: #9e9e9e;
} }
} }
// 标签 // 标签
...@@ -861,7 +874,7 @@ ...@@ -861,7 +874,7 @@
font-size: 40rpx; font-size: 40rpx;
color: #e70486; color: #e70486;
} }
} }
} }
} }
...@@ -907,7 +920,7 @@ ...@@ -907,7 +920,7 @@
// } // }
// } // }
} }
.room-type { .room-type {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -925,7 +938,7 @@ ...@@ -925,7 +938,7 @@
// border: 2rpx solid #fc3f21; // border: 2rpx solid #fc3f21;
margin: 0 1%; margin: 0 1%;
overflow: hidden; overflow: hidden;
.part-1{ .part-1{
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -986,20 +999,21 @@ ...@@ -986,20 +999,21 @@
margin-bottom: 4upx; margin-bottom: 4upx;
margin-right: 4upx; margin-right: 4upx;
} }
} }
.list-point-box{ .list-point-box{
width: 100%; width: 100%;
margin-bottom: 20upx; margin-bottom: 20upx;
.flex-col{ .flex-col{
text-align: center; align-items: center;
} }
.box{ .box{
margin: 0 4upx 6upx; margin: 0 2upx 6upx;
height: 20upx; width: 10px;
border-radius: 8upx; height: 10px;
border-radius: 5px;
} }
.text-sm{ .text-sm{
font-size: 20upx; font-size: 20upx;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
<text class="text-gray">修改资料</text> <text class="text-gray">修改资料</text>
</view> </view>
</view> </view>
<view v-else class="none-login margin-left"> <view v-else class="none-login margin-left" @tap="onNavToLogin">
<view class="cu-avatar xl round"> <view class="cu-avatar xl round">
<image class="avatar-img" :src=" assetsPath+'/avatar_no.png'" mode="scaleToFill"></image> <image class="avatar-img" :src=" assetsPath+'/avatar_no.png'" mode="scaleToFill"></image>
</view> </view>
<text class="text-gray margin-left" @tap="onNavToLogin">未授权</text> <text class="text-gray margin-left" >授权登录</text>
</view> </view>
<view class="flex-between amount-coupon" :style="{background:'url('+assetsPath+'/my_coupon_bg.png) 0 0 / 100% 100% no-repeat'}"> <view class="flex-between amount-coupon" :style="{background:'url('+assetsPath+'/my_coupon_bg.png) 0 0 / 100% 100% no-repeat'}">
<view class="part-left"> <view class="part-left">
...@@ -216,11 +216,14 @@ ...@@ -216,11 +216,14 @@
}, },
onCheckUserLogin() { onCheckUserLogin() {
let tokenHeaders = uni.getStorageSync("tokenHeaders"); let tokenHeaders = uni.getStorageSync("tokenHeaders");
console.log(tokenHeaders, 909090)
if (tokenHeaders) { if (tokenHeaders) {
this.onGetUserInfo(); this.onGetUserInfo();
} else { } else {
this.loginStatus = false; this.loginStatus = false;
uni.removeStorage({
key:'userInfo'
})
this.userInfo = {}
} }
}, },
onGetUserInfo() { onGetUserInfo() {
......
...@@ -97,10 +97,10 @@ ...@@ -97,10 +97,10 @@
<view class="part"> <view class="part">
<button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button> <button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button>
</view> </view>
<view class="part"> <view v-if="userInfo.id == orderInfo.consumerId" class="part">
<button class="cu-btn block round line-pink lg" open-type="share">分享好友</button> <button class="cu-btn block round line-pink lg" open-type="share">分享好友</button>
</view> </view>
<view v-if="orderInfo.status === 1" class="part"> <view v-if="orderInfo.status === 1 && userInfo.id == orderInfo.consumerId" class="part">
<button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button> <button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button>
</view> </view>
</view> </view>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
</view> </view>
</view> </view>
<view v-if="orderInfo.status ===0 && orderInfo.isRefund" class="cancle-btn-box"> <view v-if="orderInfo.status ===0 && orderInfo.isRefund && !shareOrder" class="cancle-btn-box">
<button class="cu-btn bg-pink round block lg" @tap="onOrderRefund">立即退单</button> <button class="cu-btn bg-pink round block lg" @tap="onOrderRefund">立即退单</button>
</view> </view>
</view> </view>
...@@ -133,14 +133,12 @@ ...@@ -133,14 +133,12 @@
</template> </template>
<script> <script>
import { import {getDictItem} from "@/utils/tools.js"
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} from "@/api/order.js" import {getOrderInfoByNo,orderRefund,openDoor} from "@/api/order.js"
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import {openDoor} from "@/api/order.js"
import config from "@/config/index.config" import config from "@/config/index.config"
import {listSortDistance} from "@/api/store.js";
export default { export default {
components:{ components:{
...@@ -154,11 +152,24 @@ ...@@ -154,11 +152,24 @@
hostUrl:config.hostUrl, hostUrl:config.hostUrl,
orderStatusEnum:{}, orderStatusEnum:{},
roomTypeEnum:{}, roomTypeEnum:{},
openDoorStatus:false openDoorStatus:false,
shareOrder:false,
userInfo:{
id:''
}
}; };
}, },
onLoad(option) { onLoad(option) {
this.userInfo = uni.getStorageSync('userInfo')
console.log(this.userInfo,"用户信息")
this.orderNo = option.orderNo; this.orderNo = option.orderNo;
if(option.share && option.share =="share"){
this.shareOrder = true
}else{
this.shareOrder = false
}
this.onGetDicts() this.onGetDicts()
this.onLoading(); this.onLoading();
if(option.success){ if(option.success){
...@@ -169,7 +180,7 @@ ...@@ -169,7 +180,7 @@
onShareAppMessage() { onShareAppMessage() {
return { return {
title: `${this.orderInfo.storeName}-${this.orderInfo.roomName}${this.orderInfo.roomTypeName}】`, title: `${this.orderInfo.storeName}-${this.orderInfo.roomName}${this.orderInfo.roomTypeName}】`,
path: `/pages/orderResult/orderResult?orderNo=${this.orderNo}` path: `/pages/orderResult/orderResult?orderNo=${this.orderNo}&share=share`
} }
}, },
methods:{ methods:{
...@@ -231,6 +242,9 @@ ...@@ -231,6 +242,9 @@
icon:"none", icon:"none",
title:res.data.msg title:res.data.msg
}) })
if(res.data.code == 200){
this.onLoading();
}
setTimeout(()=>{ setTimeout(()=>{
this.openDoorStatus = false; this.openDoorStatus = false;
},5000) },5000)
...@@ -249,8 +263,33 @@ ...@@ -249,8 +263,33 @@
}) })
}, },
onNavToOrder(){ onNavToOrder(){
uni.navigateTo({ listSortDistance({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}` storeId: this.orderInfo.storeId,
roomId: this.orderInfo.roomId,
day: this.orderInfo.endDate,
orderType:2
}).then(res=>{
let h = this.orderInfo.endTime.split(":").map(item=>Number(item))
if(res.data.code == 200){
let val = res.data.data[h[0]+1];
if(val.status ===0){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else if(val.status ===1){
let nextStartH = moment(val.startHoldTime).format("HH:mm").split(":").map(item=>Number(item))
if(nextStartH[1]>h[1]){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
uni.showToast({
icon:"none",
title:"此订单已无可续单时段"
})
}
}
}
}) })
}, },
onOrderRefund(){ onOrderRefund(){
...@@ -298,6 +337,7 @@ ...@@ -298,6 +337,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100vw; width: 100vw;
padding-bottom: 120upx;
.order-info-content{ .order-info-content{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
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