3 files added
3 files renamed
1 files modified
3 files deleted
| | |
| | | if (Tools.getTopUrlParam('query') === 'real') { |
| | | return false; |
| | | } |
| | | // 当没有 url 指定时,只有内网 ip 和 35** 的端口号,视为本地开发模式 |
| | | return /^(192|127|localhost).*?:35\d{2}$/i.test(window.location.host); |
| | | // 当没有 url 指定时,只有内网 ip 和 33** 的端口号,视为本地开发模式 |
| | | return /^(192|127|localhost).*?:33\d{2}$/i.test(window.location.host); |
| | | })(); |
| | | |
| | | |
New file |
| | |
| | | /** |
| | | * layout |
| | | * @author Tevin |
| | | */ |
| | | |
| | | import CPage from '@components/layout/h5/page/CPage.vue'; |
| | | import CNavBar from '@components/layout/h5/navBar/CNavBar.vue'; |
| | | import CContent from '@components/layout/h5/content/CContent.vue'; |
| | | |
| | | export { |
| | | CPage, |
| | | CNavBar, |
| | | CContent, |
| | | } |
New file |
| | |
| | | <template> |
| | | <view class="c-nav-bar"> |
| | | <AtNavBar |
| | | :title="title" |
| | | leftIconType="chevron-left" |
| | | :onClickLeftIcon="evt=>goBack()" |
| | | :rightFirstIconType="dropNav ? 'bullet-list' : ''" |
| | | :onClickRgIconSt="evt=>dropMenu()" |
| | | /> |
| | | <view |
| | | class="c-nav-bar-drop" |
| | | v-show="dropShow" |
| | | > |
| | | <view class="inner"> |
| | | <view class="arrow"></view> |
| | | <view class="box"> |
| | | <view |
| | | class="item" |
| | | v-for="(nav,index) in dropNav" |
| | | :key="index" |
| | | @tap="evt=>goNav(nav)" |
| | | >{{nav.title}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import { AtNavBar } from 'taro-ui-vue'; |
| | | import './cNavBar.scss'; |
| | | |
| | | export default { |
| | | name: 'CNavBar', |
| | | components: { |
| | | AtNavBar, |
| | | }, |
| | | props: { |
| | | title: String, |
| | | dropNav: Array, |
| | | }, |
| | | data() { |
| | | return { |
| | | dropShow: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | goBack() { |
| | | window.history.go(-1); |
| | | }, |
| | | goNav(nav) { |
| | | if (!nav.url) { |
| | | return; |
| | | } |
| | | this.dropShow = false; |
| | | let method = 'navigateTo'; |
| | | if (/navigate|redirect/.test(nav.method)) { |
| | | method = nav.method + 'To'; |
| | | } |
| | | Taro[method]({ url: nav.url }); |
| | | }, |
| | | dropMenu() { |
| | | this.dropShow = !this.dropShow; |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
New file |
| | |
| | | /** |
| | | * nav-bar |
| | | * @author Tevin |
| | | */ |
| | | |
| | | @import "../../../common/sassMixin"; |
| | | |
| | | .c-nav-bar { |
| | | position: relative; |
| | | .at-nav-bar { |
| | | background-color: #1e8ad2; |
| | | } |
| | | .at-nav-bar__left-view, |
| | | .at-nav-bar__right-view, |
| | | .at-nav-bar__title { |
| | | color: #fff; |
| | | } |
| | | .at-nav-bar__left-view { |
| | | &:active { |
| | | background-color: rgba(#F0F0F0, 0.5); |
| | | transition: background-color 0s; |
| | | } |
| | | } |
| | | .at-nav-bar__container { |
| | | width: 100%; |
| | | text-align: right; |
| | | &:active { |
| | | background-color: rgba(#F0F0F0, 0.5); |
| | | transition: background-color 0s; |
| | | } |
| | | .at-icon-bullet-list { |
| | | margin-right: 6PX; |
| | | } |
| | | } |
| | | .at-nav-bar__container--hide { |
| | | display: none; |
| | | } |
| | | .c-nav-bar-drop { |
| | | @include position(absolute, n n 0 0, 10); |
| | | .inner { |
| | | @include position(absolute, 0 n n 0); |
| | | padding: 0.3rem; |
| | | .arrow { |
| | | @include position(absolute, 0.15rem n n 0.65rem); |
| | | width: 0; |
| | | height: 0; |
| | | border-top: 0.6rem solid #f2f4f7; |
| | | border-right: 0.6rem solid transparent; |
| | | transform: rotate(45deg); |
| | | } |
| | | .box { |
| | | position: relative; |
| | | z-index: 2; |
| | | width: 4rem; |
| | | padding: 0.2rem 0; |
| | | background-color: #f7f8fa; |
| | | border-radius: 0.1rem; |
| | | box-shadow: rgba(#000, 0.1) 0 1PX 1PX 1PX; |
| | | .item { |
| | | padding: 0 0.4rem; |
| | | text-align: center; |
| | | line-height: 1.45rem; |
| | | font-size: 0.65rem; |
| | | @include ellipsis(100%); |
| | | box-sizing: border-box; |
| | | border-bottom: #edf0f8 1PX solid; |
| | | transition: background-color 0.3s; |
| | | &:active { |
| | | background-color: #fff; |
| | | transition: background-color 0s; |
| | | } |
| | | &:last-child { |
| | | border: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |