123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <template>
- <view class='content'>
- <view class='wrap'>
- <view>
- {{currectData.shopNames}}
- <image src="@/static/image/yjt.png" mode="" style="margin-left:10rpx;width:12rpx;height: 21rpx;"></image>
- </view>
- <view class='title'>营业管理</view>
- <u-cell-group>
- <u-cell title="营业时间" :isLink="true" arrow-direction="right">
- <view @click='selectTime' slot="title" class="u-slot-title flex justify-space-between">
- <view>营业时间</view>
- {{currectData.startDate}}~{{currectData.endDate}}
- </view>
- </u-cell>
- <u-cell title="店铺上架" :isLink="true" arrow-direction="right">
- <!-- <u-badge count="99" :absolute="false" slot="right-icon"></u-badge> -->
- <view slot="title" class="u-slot-title flex justify-space-between align-item-center">
- <view class="">
- 店铺上架
- </view>
- <view class='flex align-item-center'>
- <view style='margin-right:10rpx;'>{{currectData.status}}</view>
- <u-switch @change="change" slot="right-icon" v-model="checked"></u-switch>
- </view>
- </view>
- </u-cell>
- <u-cell title="删除店铺" :isLink="true" arrow-direction="right">
- <view @click='del' slot="title" class="u-slot-title">
- <view class="">
- 删除店铺
- </view>
- </view>
- </u-cell>
- </u-cell-group>
- <view class='title'>店铺信息</view>
- <u-cell-group>
- <u-cell title="店铺信息" :isLink="true" arrow-direction="right">
- <view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editShopInformation")' slot="title" class="u-slot-title">
- <view class="">
- 店铺信息
- </view>
- </view>
- </u-cell>
- <u-cell title="店铺图片" :isLink="true" arrow-direction="right">
- <view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editShopImage")' slot="title" class="u-slot-title">
- <view class="">
- 店铺图片
- </view>
- </view>
- </u-cell>
- <u-cell title="证照图片" :isLink="true" arrow-direction="right">
- <view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editCertificate")' slot="title" class="u-slot-title">
- <view class="">
- 证照图片
- </view>
- </view>
- </u-cell>
-
- <u-cell @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editFoodClassify")' title="菜品分类" :isLink="true" arrow-direction="right">
- <view slot="title" class="u-slot-title">
- <view class="">
- 菜品分类
- </view>
- </view>
- </u-cell>
- <u-cell title="允许用户查看菜品价格" :isLink="true" arrow-direction="right">
- <view slot="title" class="u-slot-title flex justify-space-between">
- <view class="">
- 允许用户查看菜品价格
- </view>
- <u-switch @change='change1' slot="right-icon" v-model="checked1"></u-switch>
- </view>
- </u-cell>
-
- </u-cell-group>
- </view>
- <view style='margin:10px;' class='flex justify-space-between align-item-center'>
- <view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/foodInfomation")' class='mercharts_button'>菜品信息</view>
- <!-- <view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editFoodClassify")' class='mercharts_button'>团购信息</view> -->
- </view>
- <smh-time-range :is-under='show' :time="time" @confrim="confrim" @cancel="cancel"></smh-time-range>
- <u-modal :show="isSubmit" :content='content' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
- @cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
- <u-modal :show="isDel" content='确定删除店铺?' @confirm="$u.debounce(confirmDelSubmit, 500)" showCancelButton
- @cancel="isDel=false" @close="isDel=false" closeOnClickOverlay></u-modal>
- <u-modal :show="isStatus" :content='content' @confirm="$u.debounce(confirmStatusSubmit, 500)" showCancelButton
- @cancel="isStatus=false" @close="isStatus=false" closeOnClickOverlay></u-modal>
- </view>
- </template>
- <script>
- var that
- export default {
- data() {
- return {
- content:'确定下架店铺?',
- isSubmit:false,
- isStatus:false,
- isDel:false,
- checked:true,
- checked1:true,
- show:false,
- time:[],
- currectStatus:1,
- currectData:{
-
- },
- hoursList:[
- '00:00',
- '00:30',
- '01:00',
- '01:30',
- '02:00',
- '02:30',
- '03:00',
- '03:30',
- '04:00',
- '04:30',
- '05:00',
- '05:30',
- '06:00',
- '06:30',
- '07:00',
- '07:30',
- '08:00',
- '08:30',
- '09:00',
- '09:30',
- '10:00',
- '10:00',
- '11:00',
- '11:30',
- '12:00',
- '12:30',
- '13:00',
- '13:30',
- '14:00',
- '14:30',
- '15:00',
- '15:30',
- '16:00',
- '16:30',
- '17:00',
- '17:30',
- '18:00',
- '18:30',
- '19:00',
- '19:30',
- '20:00',
- '20:30',
- '21:00',
- '21:30',
- '22:00',
- '22:30',
- '23:00',
- '23:30',
- '24:00'],
- }
- },
- onLoad() {
- that = this
- },
- onShow(){
- if(uni.getStorageSync('myCateringdustry')){
- this.currectData=JSON.parse(uni.getStorageSync('myCateringdustry'))
- var start = 0,end = 0
- for(var i=0;i<this.hoursList.length;i++){
- if(this.currectData.startDate==this.hoursList[i]){
- start = i
- }
- if(this.currectData.endDate==this.hoursList[i]){
- end = i
- }
- }
- if(this.currectData.status=='显示中'){
- this.checked=true
- }else if(this.currectData.status=='已隐藏'){
- this.checked=false
- }
- if(this.currectData.lookFlag==0){
- this.checked1 =true
- }else{
- this.checked1 =false
- }
- this.time=[start,'0',end]
- console.log(this.time)
- }
- },
- methods: {
- change1(e){
- console.log(1111111)
- this.currectStatus = 2
- if(!this.checked1){
- this.content='确定禁止用户查看菜品价格?'
- this.isStatus = true
- }else{
- this.confirmStatusSubmit()
- }
- },
- toDetail(url){
- uni.navigateTo({
- url:url
- })
- },
- del(){
- uni.showModal({
- title: '提示',
- content: '确定删除店铺?',
- success (res) {
- if (res.confirm) {
- that.$u.debounce(confirmDelSubmit, 500)
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- },
- change(e){
- this.currectStatus = 1
- console.log(e,this.checked)
- if(!this.checked){
- this.content='确定下架店铺?'
- this.isStatus = true
- }else{
- this.confirmStatusSubmit()
- }
- },
- confirmDelSubmit(){
- this.$request.baseRequest('admin.tourism.foodInfo', 'delete', {
- id: this.currectData.id
- }, failres => {
- uni.showToast({
- icon: "none",
- title: failres.errmsg,
- duration: 3000
- });
-
- uni.hideLoading()
- }).then(res => {
- uni.showToast({
- icon: "success",
- title: '删除成功',
- duration: 2000
- });
- this.isStatus = false
- uni.navigateBack()
- })
- },
- confirmStatusSubmit(){
- if(this.currectStatus==1){
- if(!this.checked){
- this.currectData.status='已隐藏'
- }else{
- this.currectData.status='显示中'
- }
- }else{
- if(!this.checked1){
- this.currectData.lookFlag=1
- }else{
- this.currectData.lookFlag=0
- }
- }
- this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
- foodInfo: JSON.stringify(this.currectData)
- }, failres => {
- uni.showToast({
- icon: "none",
- title: failres.errmsg,
- duration: 3000
- });
-
- uni.hideLoading()
- }).then(res => {
- uni.showToast({
- icon: "success",
- title: this.currectStatus==1?this.checked?'店铺已上架':'店铺已下架':this.checked1?'开启成功':'关闭成功',
- duration: 2000
- });
- uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
- this.isStatus = false
- })
- },
- selectTime(){
- this.show = true
- },
- confrim(e){
- this.currectData.startDate=e.start
- this.currectData.endDate=e.end
- this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
- foodInfo: JSON.stringify(this.currectData)
- }, failres => {
- uni.showToast({
- icon: "none",
- title: failres.errmsg,
- duration: 3000
- });
-
- uni.hideLoading()
- }).then(res => {
- uni.showToast({
- icon: "success",
- title: '修改营业时间成功',
- duration: 2000
- });
- this.show = false
- uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
- })
- },
- cancel(){
- this.show = false
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- .title{
- padding:20rpx;
- font-weight:600;
- }
- .mercharts_button {
- font-size: 32rpx;
- padding: 20rpx 40rpx;
- background-color: #5F7DE9;
- color: #fff;
- border-radius: 20rpx;
- }
- </style>
|