This commit is contained in:
duan
2024-10-23 17:26:35 +08:00
3 changed files with 213 additions and 0 deletions

33
http/yskApi/bwc.js Normal file
View File

@@ -0,0 +1,33 @@
import http from './http.js'
const request = http.request
/**
* 商品报损
* @returns
*/
export function get(params) {
return request({
url: `/freeDine`,
method: 'get',
params: {
shopId: uni.getStorageSync('shopId'),
...params
}
})
}
/**
* 耗材报损
* @returns
*/
export function edit(data) {
return request({
url: `/freeDine`,
method: 'put',
params: {
shopId: uni.getStorageSync('shopId'),
...data
}
})
}

169
pageBwc/index/index.vue Normal file
View File

@@ -0,0 +1,169 @@
<template>
<view class="boxconstant">
<view class="boxconstantbox"
style="border-radius: 18px 18px 0 0;padding:32rpx 24rpx 0 24rpx;border-bottom: 2rpx solid #E5E5E5;">
<view class="boxconstantbox_one">
充值设置
</view>
<view class="boxconstantbox_tow">
<text>用户消费结账时成功充值成功</text>
<input class="text" v-model="form.rechargeTimes"></input>
<text>倍的金额本单即可享受免单</text>
</view>
</view>
<view class="boxconstantbox" style="padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
<view class="boxconstantbox_one">
充值门槛
</view>
<view class="boxconstantbox_tow">
<text>订单支付金额需满</text>
<input class="text" v-model="form.rechargeThreshold"></input>
<text> 才能使用</text>
</view>
</view>
<view class="oneboxconstant">
<view class="oneboxconstant_one">
功能启用
</view>
<up-switch v-model="form.enable" size="18"></up-switch>
</view>
<view class="boxconstantbox"
style="margin-top:24rpx; padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
<view class="boxconstantbox_one">
充值说明
</view>
<view class="boxconstantbox_tow">
<up-textarea v-model="form.rechargeDesc" placeholder="请输入内容"></up-textarea>
</view>
</view>
<view class="save" @click="editlist">
保存
</view>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import {
get,
edit
} from '@/http/yskApi/bwc.js'
const form = reactive({
id: '',
enable: '',
rechargeTimes: '',
rechargeThreshold: '',
withCoupon: '',
withPoints: '',
rechargeDesc: '',
useTypeList: [],
childShopIdList: '',
});
const getlist = async () => {
let res = await get()
console.log(res)
Object.assign(form, res)
}
const editlist = async () => {
let res = await edit(form)
uni.showToast({
title: '保存成功'
})
Object.assign(form, res)
}
onShow(() => {
getlist()
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxconstant {
padding: 32rpx 28rpx;
.boxconstantbox {
padding: 32rpx 24rpx;
width: 100%;
background: #FFFFFF;
.boxconstantbox_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
.boxconstantbox_tow {
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
padding-bottom: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #333333;
box-sizing: border-box;
.text {
margin: 0 12rpx;
width: 118rpx;
height: 48rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #E5E5E5;
}
}
}
.oneboxconstant {
margin-top: 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
padding: 32rpx 24rpx;
.oneboxconstant_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.save {
margin: 100rpx auto 50rpx auto;
width: 530rpx;
height: 80rpx;
background: #318AFE;
border-radius: 56rpx 56rpx 56rpx 56rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
}
}
</style>

View File

@@ -1138,6 +1138,17 @@
]
},
{
"root": "pageBwc",
"pages": [{
"pageId": "PAGES_BWC",
"path": "index/index",
"style": {
"navigationBarTitleText": "霸王餐"
}
}
]
},
{
"root": "pageBooking",
"pages": [{