| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <view class="app-content">
- <view>
- <form @submit="formSubmit">
- <view class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title">预售</view>
- <view>
- <switch style="transform:scale(0.7,0.7)" :checked="form.presell == 0 ? false : true" @change="presellChange" /> {{form.presell==0 ? '关闭' : '开启'}}
- </view>
- </tui-list-cell>
- </view>
- <view class="confirm-btn">
- <button class="admin-button-com big blue" formType="submit">
- 提交
- </button>
- </view>
- </form>
- </view>
- </view>
- </template>
- <script>
- import TuiListCell from "@/components/plugin/list-cell";
- import { bookSet,getInfo } from "@/api/shop";
- export default {
- name: "bookSet",
- components: {
- TuiListCell
- },
- data() {
- return {
- form: {
- presell:0,
- }
- };
- },
- onLoad() {
- },
- onShow() {
- },
- methods: {
- presellChange(e){
- this.form.presell = e.target.value ? 1 : 0
- },
- async init() {
- const { data } = await getInfo()
- this.form.presell = data.presell
- this.$forceUpdate()
- },
- confirmFn() {
- bookSet(this.form).then((res) => {
- this.$msg(res.msg);
- if(res.code == 1){
- setTimeout(() => {
- uni.navigateBack();
- }, 1000)
- }
- });
- },
- formSubmit(e) {
- let rules = [
- {
- name: "miniKilo",
- rule: ["required"],
- msg: ["请填写起订公斤数"],
- },
- {
- name: "kiloFee",
- rule: ["required"],
- msg: ["请填写每公斤服务费"],
- },
- ];
- this.confirmFn();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .app-content {
- min-height: calc(100vh - 20upx);
- padding-top: 20upx;
- }
- .prompt-text {
- color: $fontColor3;
- padding-left: 30upx;
- margin-bottom: 30upx;
- }
- .module-com {
- margin-bottom: 20upx;
- .member-wrap {
- .member-det {
- font-size: 24upx;
- margin-left: 20upx;
- }
- }
- .remark-wrap {
- align-items: flex-start;
- .remark {
- height: 240upx;
- }
- }
- }
- // 按钮
- .confirm-btn {
- width: calc(100% - 60upx);
- margin: 60upx 30upx 20upx;
- .admin-button-com {
- width: 100%;
- }
- }
- </style>
|