diff --git a/src/App.vue b/src/App.vue index d9ad0b8..aa74039 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,8 +16,10 @@ onHide(() => { @import "@/sheep/scss/global.scss"; @import url(@/uni_modules/tm-ui/css/remixicon.min.css); + $theme-green: #06be36; $theme-blue: #0094ff; +$theme-gray: #999; .botder_btn { border: 1px solid #999; diff --git a/src/pages.json b/src/pages.json index 75b5cfc..10ad755 100644 --- a/src/pages.json +++ b/src/pages.json @@ -110,6 +110,13 @@ "navigationBarTitleText": "", "disableScroll": true } + }, + { + "path": "apply-list", + "style": { + "navigationBarTitleText": "", + "disableScroll": true + } } ] }, diff --git a/src/pages/boxes/apply-list.vue b/src/pages/boxes/apply-list.vue new file mode 100644 index 0000000..be1056c --- /dev/null +++ b/src/pages/boxes/apply-list.vue @@ -0,0 +1,70 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/boxes/apply.vue b/src/pages/boxes/apply.vue index 8ff1f90..bddeac2 100644 --- a/src/pages/boxes/apply.vue +++ b/src/pages/boxes/apply.vue @@ -4,7 +4,7 @@ import { onLoad, onShow } from "@dcloudio/uni-app"; import { isEmpty, max, min } from "radash" import dayjs from "dayjs" -import { hooks } from "@@/index" +import { hooks, router } from "@@/index" import { boxesApi } from "@@/api" const data = { @@ -104,8 +104,30 @@ const doTimeItem = (v: any) => { state.selectRechargeIdList = state.selectRechargeList.map(v => v.id) } +const applyFormRef = ref(null) const doSubmit = async () => { - + applyFormRef.value.submit() + const { isPass } = applyFormRef.value.validate() + if (!isPass) return + try { + const { hour: hourMax } = max(state.selectRechargeList, (i: any) => i.timestamp) + const { hour: hourMin } = min(state.selectRechargeList, (i: any) => i.timestamp) + const _pa = { + boxesId: state.detailId, + startTime: hourMin, + endTime: hourMax, + bxDate: applyForm.bxDate, + } + const { data, code }: any = await boxesApi.apply(_pa) + if (code != 0) throw new Error() + uni.showLoading({ title: '预定中...', mask: false }) + uni.hideLoading() + uni.showToast({ title: '申请成功', icon: "none" }) + router.jump("/pages/boxes/apply-list") + } catch (error) { + console.error(error); + uni.hideLoading() + } } @@ -134,7 +156,8 @@ const doSubmit = async () => { 时间段 - {{ v.bxDate }} {{ v.hour }} @@ -166,6 +189,15 @@ const doSubmit = async () => { } } +.recharge_item_disabled { + background: #999; + border: 1px solid #999 !important; + + &>text { + color: white !important; + } +} + .recharge { display: grid; grid-template-columns: repeat(3, 1fr);