初始化商家端

This commit is contained in:
wangxiaowei
2025-04-30 14:08:39 +08:00
commit 68b408b1e7
568 changed files with 118884 additions and 0 deletions

View File

@ -0,0 +1,700 @@
<template>
<view class="page" :style="themeColor">
<view class="flex flex-wrap align-end benben-position-layout flex businessSettings_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub businessSettings_fd0_0'>
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
<text class='fu-iconfont2 businessSettings_fd0_0_c0_c0'>&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
<text class='businessSettings_fd0_0_c1_c0'>营业设置</text>
</view>
<view class='flex flex-wrap align-center businessSettings_fd0_0_c2'>
<text @tap="sureTap">保存</text>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
<!---flex布局flex布局开始-->
<view class="flex benben-flex-layout flex-wrap align-center businessSettings_flex_1">
<view class='flex flex-direction flex-wrap align-stretch flex-sub businessSettings_fd1_0'>
<view class='flex flex-wrap align-center justify-between businessSettings_fd1_0_c0'>
<view class='flex flex-wrap align-center'>
<text class='businessSettings_fd1_0_c0_c0_c0'>起送价</text>
</view>
<view class='flex flex-wrap align-center'>
<input class="businessSettings_fd1_0_c0_c1_c0" maxlength="4" type="digit" v-model="start_price" placeholder="起送价">
<image class='businessSettings_fd1_0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"89.png"'>
</image>
</view>
</view>
<view class='flex flex-wrap align-center justify-between businessSettings_fd1_0_c1'>
<view class='flex flex-wrap align-center'>
<text class='businessSettings_fd1_0_c1_c0_c0'>人均价格</text>
</view>
<view class='flex flex-wrap align-center'>
<input class="businessSettings_fd1_0_c0_c1_c0" maxlength="4" type="digit" v-model="per_capita" placeholder="人均价格">
<image class='businessSettings_fd1_0_c1_c1_c1' mode="aspectFit" :src='STATIC_URL+"89.png"'>
</image>
</view>
</view>
<view class='flex flex-wrap align-center justify-between businessSettings_fd1_0_c1'>
<view class='flex flex-wrap align-center'>
<text class='businessSettings_fd1_0_c1_c0_c0'>积分</text>
</view>
<view class='flex flex-wrap align-center'>
<input class="businessSettings_fd1_0_c0_c1_c0" disabled="disabled" maxlength="3" type="number" v-model="score_rate" placeholder="积分比例">
<!-- <image class='businessSettings_fd1_0_c1_c1_c1' mode="aspectFit" :src='STATIC_URL+"89.png"'>
</image> -->
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch'>
<view class='flex flex-wrap iNeedFeedback_fd1_3_c0'>
<textarea class='flex iNeedFeedback_input_fd1_3_c0' confirm-type="done"
:placeholder="'店铺公告'" :maxlength="240"
placeholder-style="color:#999;font-size:28rpx" v-model="notice" />
</view>
</view>
</view>
</view>
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout businessSettings_flex_2">
<view class='flex flex-wrap align-center'>
<text class='businessSettings_fd2_0_c0'>营业时间</text>
</view>
<view>
<benben-flex-tabs class-name='businessSettings_benbenTabsfd2_1' v-model="tabls" ref="benben_tabsfd2_1"
select-mark="benben_tabsfd2_1" key="benben_tabsfd2_1" :open-title-type='false' :open-sticky='true'
:top='88' :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd2_1">
<scroll-view @scroll="tabsInfofd2_1.scrollX = $event.detail.scrollLeft" id="benben_tabsfd2_1"
class="benben-tabs" style="width:750rpx" :scroll-x="true"
:scroll-left.sync="tabsInfofd2_1.moveX" scroll-with-animation="all .3s ease">
<view class="benben-tabs-content" id="benben_tabsfd2_1-content">
<view id="benben_tabsfd2_1-title" class="benben-tabs-title flex align-center flex ">
<view
:class="{ 'checkTitlefd2_1': tabls == '1', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c3': true }"
@tap="weekTap(1)" :id="`benben_tabsfd2_1-title-item-${'1'}`">
<text>周一</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '2', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c4': true }"
@tap="weekTap(2)" :id="`benben_tabsfd2_1-title-item-${'2'}`">
<text>周二</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '3', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c5': true }"
@tap="weekTap(3)" :id="`benben_tabsfd2_1-title-item-${'3'}`">
<text>周三</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '4', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c6': true }"
@tap="weekTap(4)" :id="`benben_tabsfd2_1-title-item-${'4'}`">
<text>周四</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '5', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c7': true }"
@tap="weekTap(5)" :id="`benben_tabsfd2_1-title-item-${'5'}`">
<text>周五</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '6', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c8': true }"
@tap="weekTap(6)" :id="`benben_tabsfd2_1-title-item-${'6'}`">
<text>周六</text>
</view>
<view
:class="{ 'checkTitlefd2_1': tabls == '-1', 'flex flex-wrap align-center justify-center businessSettings_titlefd2_1_c9': true }"
@tap="weekTap(-1)" :id="`benben_tabsfd2_1-title-item-${'-1'}`">
<text class='businessSettings_titleItemfd2_1_c9_c0'>周日</text>
</view>
</view>
<view :style="{ left: tabsInfofd2_1.lineleft, maxWidth: tabsInfofd2_1.lineWidth }"
id="benben_tabsfd2_1-line" class="benben-tabs-line flex benben-flex-tabs-line"></view>
</view>
</scroll-view>
</benben-flex-tabs>
</view>
</view>
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout businessSettings_flex_3">
<view class='flex flex-wrap align-center justify-around businessSettings_fd3_0' v-for="(item,index) in timeList" :key="index">
<view class='flex flex-wrap align-center' @tap.stop="satTime(item,index)">
<text class='businessSettings_fd3_0_c0_c0'>{{item.start_time || '开始时间'}}</text>
<!-- <input class='businessSettings_fd3_0_c0_c0' type="text" placeholder="开始时间" confirm-type="done"
:maxlength="-1" :disabled='true'
placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="item.start_time" /> -->
</view>
<text class='businessSettings_fd3_0_c1'></text>
<view class='flex flex-wrap align-center' @tap.stop="endTime(item,index)">
<text class='businessSettings_fd3_0_c0_c0'>{{item.end_time || '结束时间'}}</text>
<!-- <input class='businessSettings_fd3_0_c2_c0' type="text" placeholder="结束时间" confirm-type="done"
:maxlength="-1" :disabled='true'
placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="item.end_time" /> -->
</view>
<image @tap.stop="delTap(item,index)" class='close' mode="aspectFit" :src='STATIC_URL+"17.png"'></image>
</view>
<!-- <view class='flex flex-wrap align-center justify-around businessSettings_fd3_0'>
<view class='flex flex-wrap align-center' @tap.stop="pickerDiy1684392640820=true">
<input class='businessSettings_fd3_0_c0_c0' type="text" placeholder="开始时间" confirm-type="done"
:maxlength="-1" :disabled='true'
placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="begin" />
</view>
<text class='businessSettings_fd3_0_c1'></text>
<view class='flex flex-wrap align-center' @tap.stop="endTime">
<input class='businessSettings_fd3_0_c2_c0' type="text" placeholder="结束时间" confirm-type="done"
:maxlength="-1" :disabled='true'
placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="over" />
</view>
</view> -->
<view class='flex flex-wrap align-center justify-center businessSettings_fd3_1' @tap="addTap">
<button class='businessSettings_fd3_1_c0'>+添加时间段</button>
</view>
</view>
<!---flex布局flex布局结束-->
<!--开始时间开始 -->
<benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1684392640820"
mode='time' :mask-show='true' :timeout='true' :picker-height='88' :current='true' :second='false' @change="beginChange">
<template #picker-header>
<view class='flex flex-wrap align-center justify-between businessSettings_picker4_0'>
<text @tap="$refs.benbenWritePickerCodepicker4.cancel()">取消</text>
<text>开始时间</text>
<text class='businessSettings_picker4_0_c2'
@tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()">确认</text>
</view>
</template>
</benben-picker>
<!--开始时间结束 -->
<!--结束时间开始 -->
<benben-picker ref="benbenWritePickerCodepicker5" :visible.sync="pickerDiy1684392695273"
mode='time' :mask-show='true' :timeout='true' :picker-height='88' :current='true' :second='false' @change="endChange">
<template #picker-header>
<view class='flex flex-wrap align-center justify-between businessSettings_picker5_0'>
<text @tap="$refs.benbenWritePickerCodepicker5.cancel()">取消</text>
<text>结束时间</text>
<text class='businessSettings_picker5_0_c2'
@tap="$refs.benbenWritePickerCodepicker5.pickerConfirm()">确认</text>
</view>
</template>
</benben-picker>
<!--结束时间结束 -->
</view>
</template>
<script>
export default {
components: {},
data() {
return {
"pickerDiy1684392695273": false,
"pickerDiy1684392640820": false,
"tabsInfofd2_1": {
lineleft: '',
lineWidth: '',
moveX: 0,
scrollX: 0,
PageScrollX: 0
},
"tabls": "1",
"begin": "",
"over": "",
per_capita:"",
start_price:"",
timeList:[],
aid:"",
timeindex:"",
score_rate:"",
notice:"",
is_check:false
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
this.getStore()
this.post648687ea70bc9()
},
methods: {
//选择结束时间
satTime(item,index){
console.log(123);
this.aid = item.aid?item.aid:""
this.timeindex = index
this.pickerDiy1684392640820 = true
},
//选择结束时间
endTime(item,index){
this.timeindex = index
if(!this.timeList[this.timeindex].start_time) return this.$message.info('请选择开始时间')
this.aid = item.aid?item.aid:""
this.pickerDiy1684392695273 = true
},
//开始时间确定
beginChange(e){
console.log(e)
if((this.timeList[this.timeindex].end_time < e.result) && this.timeList[this.timeindex].end_time) return this.$message.info('结束时间必须大于开始时间')
// this.begin = e.result
console.log(this.timeindex)
this.timeList[this.timeindex].start_time = e.result
if(this.aid){
this.post648d0d73c1d23()
}
},
//结束时间确定
endChange(e){
if(this.timeList[this.timeindex].start_time > e.result) return this.$message.info('结束时间必须大于开始时间')
this.over = e.result
this.timeList[this.timeindex].end_time = e.result
if(this.aid){
this.post648d0d73c1d23()
}else{
this.post6486873b6ee87()
}
},
//修改时间
post648d0d73c1d23(){
this.$api.post(global.apiUrls.post648d0d73c1d23,{
week:this.tabls.toString(),
start_time:this.timeList[this.timeindex].start_time,
end_time:this.timeList[this.timeindex].end_time,
aid:this.aid
}).then(res=>{
console.log(res);
if (res.data.code == 0) return this.$message.info(res.data.msg)
this.post648687ea70bc9()
})
},
//添加时间
post6486873b6ee87(){
this.$api.post(global.apiUrls.post6486873b6ee87,{
week:this.tabls.toString(),
start_time:this.timeList[this.timeindex].start_time,
end_time:this.timeList[this.timeindex].end_time
}).then(res=>{
console.log(res);
if (res.data.code == 0) return this.$message.info(res.data.msg)
this.post648687ea70bc9()
})
},
//删除时间段
delTap(item,index){
console.log(item.aid)
if(item.aid){
this.$api.post(global.apiUrls.post648687a2c8509,{
aid:item.aid
}).then(res=>{
if(res.data.code==1){
this.timeList.splice(index,1)
}
})
}else{
this.timeList.splice(index,1)
}
},
//添加时间段数组
addTap(){
this.timeList.push({
start_time:"",
end_time:""
})
},
//获取营业时间
post648687ea70bc9(){
this.$api.post(global.apiUrls.post648687ea70bc9,{
week:this.tabls.toString()
}).then(res=>{
if(res.data.code==1){
this.timeList = res.data.data
}
})
},
weekTap(type){
this.tabls = type
this.post648687ea70bc9()
},
//获取店铺信息
getStore() {
this.$api.post(global.apiUrls.postGetShopInfo)
.then(res => {
if (res.data.code == 1) {
this.start_price = res.data.data.start_price;
this.per_capita=res.data.data.per_capita;
this.score_rate=res.data.data.score_rate;
this.notice=res.data.data.notice;
}
console.log(res.data)
})
},
sureTap(){
if(this.is_check) return
if(this.score_rate > 100) return this.$message.info('积分比例不能大于100')
let rep = /[\.]/;
if(rep.test(this.score_rate)) return this.$message.info('积分比例只能是整数')
this.is_check = true
this.$api.post(global.apiUrls.Get64868bb21965a,{
start_price:this.start_price,
per_capita:this.per_capita,
score_rate:this.score_rate,
notice:this.notice,
}).then(res => {
this.$message.info(res.data.msg)
if (res.data.code == 1) {
this.getStore()
this.is_check = false
}else{
this.is_check = false
}
console.log(res.data)
})
}
// Get64868bb21965a
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: rgba(248, 248, 248, 1);
background-size: 100% auto !important;
}
.iNeedFeedback_fd1_2 {
font-size: 32rpx;
font-weight: 500;
color: #1A1A1A;
line-height: 109rpx;
margin: 0rpx 32rpx 0rpx 32rpx;
}
.iNeedFeedback_fd1_3 {
margin: 0rpx 0rpx 32rpx 0rpx;
}
.iNeedFeedback_fd1_3_c0 {
width: 686rpx;
border-radius: 10rpx 10rpx 10rpx 10rpx;
// margin: 0rpx 0rpx 0rpx 32rpx;
padding: 20rpx 0rpx 24rpx 0rpx;
}
.iNeedFeedback_input_fd1_3_c0 {
width: 100%;
height: 166rpx;
font-size: 28rpx;
font-weight: 400;
color: #333;
}
.businessSettings_flex_0 {
background: #fff;
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
background-size: 100% auto !important;
}
.businessSettings_fd0_0_c2 {
width: 80rpx;
height: 32rpx;
text-align: right;
color: #ff9300;
}
.businessSettings_fd0_0_c1_c0 {
font-size: 36rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.businessSettings_fd0_0_c0_c0 {
font-size: 32rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.businessSettings_fd0_0 {
width: 80rpx;
margin: 0rpx 32rpx 0rpx 32rpx;
}
.businessSettings_flex_1 {
padding: 24rpx 24rpx 20rpx 24rpx;
}
.businessSettings_fd1_0_c1_c1_c1 {
width: 17rpx;
height: 40rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 13rpx;
}
.businessSettings_fd1_0_c1_c1_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 400;
line-height: 28rpx;
}
.businessSettings_fd1_0_c1_c0_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 400;
line-height: 38rpx;
}
.businessSettings_fd1_0_c1 {
border-bottom: 1px solid #eee;
padding: 32rpx 0rpx 32rpx 0rpx;
}
.businessSettings_fd1_0_c0_c1_c1 {
width: 17rpx;
height: 40rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 13rpx;
}
.businessSettings_fd1_0_c0_c1_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 400;
line-height: 28rpx;
text-align: right
}
.businessSettings_fd1_0_c0_c0_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 400;
line-height: 38rpx;
}
.businessSettings_fd1_0_c0 {
border-bottom: 1px solid #eee;
padding: 32rpx 0rpx 32rpx 0rpx;
}
.businessSettings_fd1_0 {
background: rgba(255, 255, 255, 1);
border-radius: 16rpx 16rpx 16rpx 16rpx;
background-size: 100% auto !important;
padding: 0rpx 24rpx 0rpx 24rpx;
}
.businessSettings_flex_2 {
padding: 0rpx 0rpx 0rpx 24rpx;
}
.businessSettings_titleItemfd2_1_c9_c0 {
margin: 0rpx 12rpx 0rpx 0rpx;
}
.businessSettings_titlefd2_1_c9 {
background: rgba(255, 255, 255, 1);
width: 128rpx;
height: 60rpx;
margin: 0rpx 12rpx 0rpx 0rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c8 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c7 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c6 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c5 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c4 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.businessSettings_titlefd2_1_c3 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 12rpx 0rpx 0rpx;
width: 128rpx;
height: 60rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-size: 100% auto !important;
}
.checkTitlefd2_1 {
font-weight: 500 !important;
font-size: 28rpx !important;
color: rgba(255, 255, 255, 1) !important;
background-color: rgba(255, 147, 0, 1) !important;
}
::v-deep .businessSettings_benbenTabsfd2_1 {
width: 750rpx;
height: 99rpx;
white-space: nowrap;
text-align: center;
font-size: 24rpx;
font-weight: 500;
color: #666666;
}
.businessSettings_fd2_0_c0 {
color: #0E0E0C;
font-size: 28rpx;
font-weight: 500;
line-height: 38rpx;
}
.businessSettings_flex_3 {
padding: 0rpx 24rpx 0rpx 24rpx;
}
.businessSettings_fd3_1_c0 {
border: 1px solid rgba(255, 147, 0, 1);
background: rgba(255, 255, 255, 1);
border-radius: 36rpx 36rpx 36rpx 36rpx;
font-size: 24rpx;
color: rgba(255, 147, 0, 1);
width: 260rpx;
height: 72rpx;
line-height: 72rpx;
}
.businessSettings_fd3_1 {
margin: 16rpx 0rpx 0rpx 0rpx;
}
.businessSettings_fd3_0_c2_c0 {
width: 170rpx;
text-align: center;
}
.businessSettings_fd3_0_c1 {
color: #999999;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.businessSettings_fd3_0_c0_c0 {
width: 170rpx;
text-align: center;
}
.businessSettings_fd3_0 {
background: rgba(255, 255, 255, 1);
border-radius: 16rpx 16rpx 16rpx 16rpx;
background-size: 100% auto !important;
padding: 24rpx 0rpx 24rpx 0rpx;
margin: 0rpx 0rpx 16rpx 0rpx;
position: relative;
}
.close{
width: 32rpx;
height: 32rpx;
position: absolute;
top: 30rpx;
right: 24rpx;
}
.businessSettings_picker4_0_c2 {
color: rgba(255, 147, 0, 1);
}
.businessSettings_picker4_0 {
border-bottom: 1px solid #eee;
background: #fff;
padding: 0rpx 32rpx 0rpx 32rpx;
line-height: 88rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
background-size: 100% auto !important;
}
.businessSettings_picker5_0_c2 {
color: rgba(255, 147, 0, 1);
}
.businessSettings_picker5_0 {
border-bottom: 1px solid #eee;
background: #fff;
padding: 0rpx 32rpx 0rpx 32rpx;
line-height: 88rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
background-size: 100% auto !important;
}
</style>