吉福庄APP,基于若依原版开发
zhangmeng
2024-04-19 99af75c6c0bbc04e73fb71fd39ac41cabb89447c
测算成本,页面开发未完
1 files added
3 files modified
156 ■■■■■ changed files
config.js 2 ●●● patch | view | raw | blame | history
pages.json 5 ●●●●● patch | view | raw | blame | history
pages/calc/food/calc.vue 128 ●●●●● patch | view | raw | blame | history
pages/work/index.vue 21 ●●●●● patch | view | raw | blame | history
config.js
@@ -1,7 +1,7 @@
// 应用全局配置
module.exports = {
  //baseUrl: 'https://vue.ruoyi.vip/prod-api',
  baseUrl: 'http://localhost:8080',
  baseUrl: 'http://192.168.0.101:8080',
  // 应用信息
  appInfo: {
    // 应用名称
pages.json
@@ -70,6 +70,11 @@
    "style": {
      "navigationBarTitleText": "浏览文本"
    }
  }, {
    "path": "pages/calc/food/calc",
    "style": {
      "navigationBarTitleText": "测算成本"
    }
  }],
  "tabBar": {
    "color": "#000000",
pages/calc/food/calc.vue
New file
@@ -0,0 +1,128 @@
<template>
  <view class="container">
    <view class="example">
      <uni-forms ref="form" :model="food" labelWidth="100px">
        <uni-forms-item label="整只鸡腿卷" name="zhengzhitui">
          <uni-easyinput type="number" placeholder="请输入一个数量" v-model="food.zhengZhiTui" />
        </uni-forms-item>
        <uni-forms-item label="田园半腿卷" name="banzhitui">
          <uni-easyinput type="number" placeholder="请输入一个数量" v-model="food.banZhiTui" />
        </uni-forms-item>
      </uni-forms>
      <button type="primary" @click="submit">提交</button>
    </view>
  </view>
</template>
<script>
  import { getUserProfile } from "@/api/system/user"
  import { updateUserProfile } from "@/api/system/user"
  export default {
    data() {
      return {
        food: {
          zhengZhiTui: 0,
          banZhiTui: 8,
          zhiShi: 0,
          boLuo: 0,
          qingShi: 0,
          baoLa: 0,
          tengJiao: 0
        },
        sexs: [{
          text: '男',
          value: "0"
        }, {
          text: '女',
          value: "1"
        }],
        rules: {
          nickName: {
            rules: [{
              required: true,
              errorMessage: '用户昵称不能为空'
            }]
          },
          phonenumber: {
            rules: [{
              required: true,
              errorMessage: '手机号码不能为空'
            }, {
              pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
              errorMessage: '请输入正确的手机号码'
            }]
          },
          email: {
            rules: [{
              required: true,
              errorMessage: '邮箱地址不能为空'
            }, {
              format: 'email',
              errorMessage: '请输入正确的邮箱地址'
            }]
          }
        }
      }
    },
    onLoad() {
      this.getUser()
    },
    onReady() {
      this.$refs.form.setRules(this.rules)
    },
    methods: {
      getUser() {
        getUserProfile().then(response => {
          this.user = response.data
        })
      },
      submit(ref) {
        this.$refs.form.validate().then(res => {
          updateUserProfile(this.user).then(response => {
            this.$modal.msgSuccess("修改成功")
          })
        })
      }
    }
  }
</script>
<style lang="scss">
  page {
    background-color: #ffffff;
  }
  .example {
    padding: 15px;
    background-color: #fff;
  }
  .segmented-control {
    margin-bottom: 15px;
  }
  .button-group {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
  }
  .form-item {
    display: flex;
    align-items: center;
    flex: 1;
  }
  .button {
    display: flex;
    align-items: center;
    height: 35px;
    line-height: 35px;
    margin-left: 10px;
  }
  .number-box{
    width:80px;
  }
</style>
pages/work/index.vue
@@ -10,7 +10,18 @@
        </swiper-item>
      </swiper>
    </uni-swiper-dot>
    <!-- 宫格组件 -->
    <uni-section title="业务系统" type="line"></uni-section>
    <view class="grid-body">
        <uni-grid :column="4" :showBorder="false" @change="changeGrid">
          <uni-grid-item>
            <view class="grid-item-box">
              <uni-icons type="calendar" size="30"></uni-icons>
              <text class="text">测算成本</text>
            </view>
          </uni-grid-item>
        </uni-grid>
    </view>
    <!-- 宫格组件 -->
    <uni-section title="系统管理" type="line"></uni-section>
    <view class="grid-body">
@@ -100,7 +111,13 @@
        this.current = e.detail.current
      },
      changeGrid(e) {
        this.$modal.showToast('模块建设中~')
        switch(e.detail.index){
            case 0:
                this.$tab.navigateTo('/pages/calc/food/calc');
                break;
            default:
                this.$modal.showToast('模块建设中~')
        }
      }
    }
  }