You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

227 lines
4.4 KiB

3 weeks ago
<template>
<view class="page1">
<view class="list-box">
<view class="list-1">
<view class="list-name">
营业开始时间
</view>
<view class="list-right">
<picker mode="time" :value="shop.businessHourBegin" start="00:00" end="23:59"
@change="bindTimeChange($event,'start')">
<view class="uni-input">{{shop.businessHourBegin}}</view>
</picker>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业结束时间
</view>
<view class="list-right">
<picker mode="time" :value="shop.businessHourEnd" start="00:00" end="23:59"
@change="bindTimeChange($event,'end')">
<view class="uni-input">{{shop.businessHourEnd}}</view>
</picker>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业状态
</view>
<view class="list-right">
{{shop.status == 0?'正常营业':shop.status == 1?'暂停营业':'冻结'}}
</view>
</view>
<view class="list-1">
<view class="list-name">
拼团佣金
</view>
<view class="list-right">
{{shop.commissionRateMore}}
</view>
</view>
<view class="list-1">
<view class="list-name">
单独购买佣金
</view>
<view class="list-right">
{{shop.commissionRateOne}}
</view>
</view>
<view class="list-1">
<view class="list-name">
经营品类
</view>
<view class="list-right">
{{shop.type}}
</view>
</view>
<view class="list-1">
<view class="list-name">
是否支持配送
</view>
<view class="list-right">
{{shop.isDelivery == 0?'是':'否'}}
</view>
</view>
<view class="list-1">
<view class="list-name">
出餐时间
</view>
<view class="list-right">
{{shop.cookingTime}}分钟
</view>
</view>
<view class="list-1">
<view class="list-name">
排名
</view>
<view class="list-right">
{{shop.shoprank}}
</view>
</view>
<view class="list-1">
<view class="list-name">
是否价格锁定
</view>
<view class="list-right">
{{shop.isPriceLock== 0?'是':'否'}}
</view>
</view>
</view>
<view class="list-box">
<view class="list-2" @click="submit">
保存
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
shop: {}
}
},
onLoad() {
this.getShopMsg()
},
methods: {
getShopMsg() {
this.tui.request("/app/shoptakeaway/getByShopId", "get", {
shopId: uni.getStorageSync('shopId')
}, false, true).then((res) => {
if (res.code == 200) {
this.shop = res.result
for (let key in this.shop) {
if (this.shop[key] === null) {
delete this.shop[key];
}
}
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
bindTimeChange(e, type) {
if (type == 'start') {
this.shop.businessHourBegin = e.detail.value
} else {
this.shop.businessHourEnd = e.detail.value
}
},
submit() {
this.tui.request("/app/shoptakeaway/update", "POST", this.shop, false, true).then((res) => {
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '更新信息成功',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.navigateBack()
}
}
});
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}
}
}
</script>
<style>
page,
.page1 {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #eee;
}
.list-box {
width: 100%;
height: auto;
background: #fff;
margin-top: 20rpx;
}
.list-1 {
display: flex;
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
}
.list-2 {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
.list-icon {
width: 100rpx;
height: 100rpx;
text-align: center;
}
.list-name {
flex: 1;
padding-left: 20rpx;
}
.list-right {
flex: 1;
height: 100rpx;
text-align: right;
padding-right: 20rpx;
overflow: hidden;
}
.upload-img {
width: 60rpx;
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
}
.list-2 {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
</style>