dam-7 feat 优化代码

master
hou 3 years ago
parent 9f38b72dd5
commit 954571e2d7

@ -11,20 +11,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == 'en'
? index + 1 + ' ' + item.engResourceName
: index + 1 + ' ' + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">

@ -14,20 +14,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in model.menuList" :key="index"> <u-col :span="12" v-for="(item, index) in model.menuList" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: `${item.href}?childData=${JSON.stringify(item.childResource)}`, url: `${item.href}?childData=${JSON.stringify(item.childResource)}`,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == 'en'
? index + 1 + ' ' + item.engResourceName
: index + 1 + ' ' + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">

@ -11,7 +11,7 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })

@ -11,20 +11,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == 'en'
? index + 1 + ' ' + item.engResourceName
: index + 1 + ' ' + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">

@ -2,33 +2,23 @@
<view class="page-raw-warehouse"> <view class="page-raw-warehouse">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<u-icon <u-icon class="icon" name="arrow-left" @click="toPage(page.raw.index)" />
class="icon"
name="arrow-left"
@click="toPage(page.raw.index)"
/>
</view> </view>
<view class="title">{{ $t("message.subcontract") }}</view> <view class="title">{{ $t('message.subcontract') }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="container"> <view class="container">
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == "en"
? index + 1 + " " + item.engResourceName
: index + 1 + " " + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">
@ -62,9 +52,9 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from "vue-property-decorator"; import { Component } from 'vue-property-decorator';
import { BasePage } from "@/components/base/page"; import { BasePage } from '@/components/base/page';
import model from "../model"; import model from '../model';
@Component @Component
export default class RawAppointment extends BasePage { export default class RawAppointment extends BasePage {
model = model; model = model;

@ -11,20 +11,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == 'en'
? index + 1 + ' ' + item.engResourceName
: index + 1 + ' ' + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">

@ -5,7 +5,7 @@
<view class="name">Hi, {{ session.user.userName }}</view> <view class="name">Hi, {{ session.user.userName }}</view>
<view class="logout" @click="session.logout()"> <view class="logout" @click="session.logout()">
<u-icon name="info-circle"></u-icon> <u-icon name="info-circle"></u-icon>
<text>{{ $t("message.rawMenu_SignOut") }}</text> <text>{{ $t('message.rawMenu_SignOut') }}</text>
</view> </view>
</view> </view>
<view class="date">{{ today }}</view> <view class="date">{{ today }}</view>
@ -14,22 +14,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in model.menuList" :key="index"> <u-col :span="12" v-for="(item, index) in model.menuList" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: `${item.href}?childData=${JSON.stringify( url: `${item.href}?childData=${JSON.stringify(item.childResource)}`,
item.childResource
)}`,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == "en"
? index + 1 + " " + item.engResourceName
: index + 1 + " " + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">
@ -68,15 +60,15 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from "vue-property-decorator"; import { Component } from 'vue-property-decorator';
import { BasePage } from "@/components/base/page"; import { BasePage } from '@/components/base/page';
import dayjs from "dayjs"; import dayjs from 'dayjs';
import model from "./model"; import model from './model';
@Component @Component
export default class RawHome extends BasePage { export default class RawHome extends BasePage {
model = model; model = model;
today = dayjs().format("YYYY-MM-DD dddd"); today = dayjs().format('YYYY-MM-DD dddd');
onLoad() { onLoad() {
this.model.getMenuList(); this.model.getMenuList();
} }

@ -4,27 +4,21 @@
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view> </view>
<view class="title">{{ $t("message.rawMenu_ReceivingGoods") }}</view> <view class="title">{{ $t('message.rawMenu_ReceivingGoods') }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="container"> <view class="container">
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == "en"
? index + 1 + " " + item.engResourceName
: index + 1 + " " + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
@ -46,8 +40,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from "vue-property-decorator"; import { Component } from 'vue-property-decorator';
import { BasePage } from "@/components/base/page"; import { BasePage } from '@/components/base/page';
@Component @Component
export default class RawAppointment extends BasePage { export default class RawAppointment extends BasePage {
childData: any; childData: any;

@ -11,20 +11,14 @@
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index"> <u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button <u-button
@click=" @click.native="
uni.navigateTo({ uni.navigateTo({
url: item.href, url: item.href,
}) })
" "
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
{{
session.lang == 'en'
? index + 1 + ' ' + item.engResourceName
: index + 1 + ' ' + item.resourceName
}}</text
>
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">

Loading…
Cancel
Save