1 files added
3 files modified
| | |
| | | // 应用全局配置 |
| | | module.exports = { |
| | | //baseUrl: 'https://vue.ruoyi.vip/prod-api', |
| | | baseUrl: 'http://localhost:8080', |
| | | baseUrl: 'http://192.168.0.101:8080', |
| | | // 应用信息 |
| | | appInfo: { |
| | | // 应用名称 |
| | |
| | | "style": { |
| | | "navigationBarTitleText": "浏览文本" |
| | | } |
| | | }, { |
| | | "path": "pages/calc/food/calc", |
| | | "style": { |
| | | "navigationBarTitleText": "测算成本" |
| | | } |
| | | }], |
| | | "tabBar": { |
| | | "color": "#000000", |
New file |
| | |
| | | <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> |
| | |
| | | </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"> |
| | |
| | | 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('模块建设中~') |
| | | } |
| | | } |
| | | } |
| | | } |