123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- <template>
- <div class="mobile-nav">
- <!-- <div class="mobile-modal" v-if="showStoreInfo || showShare" @click="cancelModal">
- <div class="mobile-modal-box" v-if="showStoreInfo" @click="stopPropagation($event)">
- <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
- <div class="mobile-modal-content" v-if="showDefaultAddr">
- <div>商家地址:深圳市南山区英唐大厦6楼</div>
- <div class="content-line link-url">在线咨询</div>
- <div>致电:<a href="tel:0755-96586323" class="content-line link-url">0755-96586323</a></div>
- <div>邮件:<a href="mailto:yrsc@usoftchina.com" class="content-line link-url">yrsc@usoftchina.com</a></div>
- </div>
- <div class="mobile-modal-content" v-if="!showDefaultAddr">
- <div>商家地址:{{store.enterprise.enAddress || store.enterprise.address}}</div>
- <div class="content-line link-url">在线咨询</div>
- <div>致电:<a :href="'tel:'+store.enterprise.enTel" class="content-line link-url">{{store.enterprise.enTel}}</a></div>
- <div>邮件:<a :href="'mailto:'+store.enterprise.enEmail" class="content-line link-url">{{store.enterprise.enEmail}}</a></div>
- </div>
- </div>
- <div class="mobile-share-box" v-if="showShare" @click="stopPropagation($event)">
- <div class="share-area">
- <ul>
- <li class="share-item" @click="shareWeChat">
- <i class="icon-weixin iconfont" style="color: #07af12;"></i>
- <span>微信</span>
- </li>
- <li class="share-item" @click="shareQQ">
- <i class="icon-qq1 iconfont" style="color: #5872f4;"></i>
- <span>QQ</span>
- </li>
- <li class="share-item" @click="shareWeibo">
- <i class="icon-ff0000 iconfont" style="color: #ff0000;"></i>
- <span>微博</span>
- </li>
- <li class="share-item" @click="shareMessage">
- <i class="icon-msnui-msg-invert iconfont" style="color: #25cdb7"></i>
- <span>短信</span>
- <a href="sms:" class="hide" id="share-sms"></a>
- </li>
- <li class="share-item" @click="shareEmail">
- <i class="icon-youjian iconfont" style="height: .57rem;font-size: .41rem;color:#f18215;"></i>
- <span>邮件</span>
- <a href="mailto:" class="hide" id="share-mail"></a>
- </li>
- <li class="share-item" @click="flash">
- <i class="icon-shuaxin iconfont" style="color: #2584cd;"></i>
- <span>刷新</span>
- </li>
- <li class="share-item" @click="copyLink" id="copyLink" :data-clipboard-text="url">
- <i class="icon-lianjie iconfont" style="color: #73b0df;"></i>
- <span>复制链接</span>
- </li>
- </ul>
- </div>
- <div class="cancel-share" @click="showShare=false">取消</div>
- </div>
- </div>-->
- <div class="mobile-header" :class="{'mobile-center-header': showEnHeader}" v-if="showHeader && !showMainSearch">
- <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
- <p>{{title}}
- <span @click="goMainSearch" v-if="showSearchIcon"><i class="icon-sousuo iconfont"></i>搜索</span>
- </p>
- <p v-show="showEnHeader" class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
- </div>
- <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
- <!-- <i v-show="rightIcon=='share'" class="iconfont icon-fenxiang" @click="showShare = true" @touchmove="onTouchMove($event)"></i>
- <i v-show="rightIcon=='phone'" class="iconfont icon-dianhua" @click="showLink" @touchmove="onTouchMove($event)"></i>-->
- </div>
- </template>
- <script>
- import MainSearch from '~/components/mobile/search/MainSearch.vue'
- export default {
- data () {
- return {
- showMainSearch: false,
- title: '优软商城',
- showHeader: false,
- showSearchIcon: true
- }
- },
- components: {
- MainSearch
- },
- watch: {
- $route: function (val, oldVal) {
- this.showMainSearch = false
- this.title = this.initHeader(val.path, val.query)
- }
- },
- created () {
- this.title = this.initHeader(this.$route.path, this.$route.query)
- },
- computed: {
- brandDetail () {
- return this.$store.state.brandDetail.detail.data
- },
- store () {
- return this.$store.state.shop.storeInfo.store.data
- },
- component () {
- return this.$store.state.componentDetail.detail.data
- },
- showEnHeader () {
- return this.startWith(this.$route.path, '/mobile/center') ||
- this.startWith(this.$route.path, '/mobile/order') ||
- this.startWith(this.$route.path, '/mobile/user/address')
- }
- },
- methods: {
- goLastPage: function () {
- window.history.back(-1)
- },
- initHeader: function (val, query) {
- this.showSearchIcon = false
- this.showHeader = val && val !== '/' && val !== '/mobile/applyPurchase/list' && !this.startWith(val, '/mobile/supplier')
- let title = '优软商城'
- if (this.startWith(val, '/mobile/brand/componentDetail/')) {
- title = this.component.code
- } else if (this.startWith(val, '/mobile/brand/brandCenter')) {
- title = '品牌墙'
- } else if (this.startWith(val, '/mobile/brand/')) {
- if (this.brandDetail.nameCn) {
- if (this.brandDetail.nameCn !== this.brandDetail.nameEn) {
- title = this.brandDetail.nameEn + '(' + this.brandDetail.nameCn + ')'
- } else {
- title = this.brandDetail.nameCn
- }
- } else {
- if (this.component.brand.nameCn !== this.component.brand.nameEn) {
- title = this.component.brand.nameEn + '(' + this.component.brand.nameCn + ')'
- } else {
- title = this.component.brand.nameCn
- }
- }
- } else if (this.startWith(val, '/mobile/shop/')) {
- title = this.store.storeName
- } else if (this.startWith(val, '/mobile/shop')) {
- title = '店铺列表'
- } else if (this.startWith(val, '/mobile/center/vendor/productList')) {
- title = '产品信息'
- } else if (this.startWith(val, '/mobile/center/vendor/productdetails')) {
- title = '产品信息'
- } else if (this.startWith(val, '/mobile/center/vendor/material')) {
- title = '库存管理'
- } else if (this.startWith(val, '/mobile/center/vendor/product')) {
- if (this.$route.query.providerType === 'enterprise') {
- title = '产品库'
- } else if (this.$route.query.providerType === 'person') {
- title = '出入库'
- } else {
- title = '在售产品'
- }
- } else if (this.startWith(val, '/mobile/search')) {
- title = '搜索结果'
- } else if (this.startWith(val, '/mobile/user/info/personal')) {
- this.showSearchIcon = false
- title = '个人信息'
- } else if (this.startWith(val, '/mobile/user/info/admin')) {
- this.showSearchIcon = false
- title = '管理员信息'
- } else if (this.startWith(val, '/mobile/user/address')) {
- this.showSearchIcon = false
- title = '收货地址信息'
- } else if (this.startWith(val, '/mobile/product')) {
- this.showSearchIcon = false
- title = '产品详情'
- } else if (val === '/mobile/user/bindEnterprise') {
- this.showSearchIcon = false
- title = '信息确认'
- } else if (this.startWith(val, '/mobile/center/vendor/attentionBus')) {
- this.showSearchIcon = false
- title = '优软商城'
- } else if (this.startWith(val, '/mobile/store')) {
- this.showSearchIcon = false
- title = '开店申请'
- } else if (this.startWith(val, '/mobile/center/user/cart')) {
- this.showSearchIcon = false
- title = '购物车'
- } else if (this.startWith(val, '/mobile/center/user/payCenter')) {
- this.showSearchIcon = false
- if (this.$route.query.type) {
- title = '付款账户'
- } else {
- title = '应付对账'
- }
- } else if (this.startWith(val, '/mobile/center/user/invoice')) {
- this.showSearchIcon = false
- title = '发票管理'
- } else if (this.startWith(val, '/mobile/center/vendor/payCenter')) {
- this.showSearchIcon = false
- if (this.$route.query.type) {
- title = '收款账户'
- } else {
- title = '应收对账'
- }
- } else if (this.startWith(val, '/mobile/center/user/pay')) {
- this.showSearchIcon = false
- title = '确认订单'
- } else if (this.startWith(val, '/mobile/center/user/doPay')) {
- this.showSearchIcon = false
- title = '待付款订单'
- } else if (this.startWith(val, '/mobile/order/details')) {
- this.showSearchIcon = false
- title = '订单详情'
- } else if (this.startWith(val, '/mobile/order/logistics')) {
- this.showSearchIcon = false
- title = '物流信息'
- } else if (this.startWith(val, '/mobile/order/b2border')) {
- title = '采购订单'
- } else if (this.startWith(val, '/mobile/order')) {
- this.showSearchIcon = false
- if (query.type === 'buyer') {
- title = '采购订单'
- } else {
- title = '销售订单'
- }
- } else if (this.startWith(val, '/mobile/center/vendor/invoice')) {
- this.showSearchIcon = false
- title = '发票管理'
- } else if (this.startWith(val, '/mobile/center/vendor/sample')) {
- this.showSearchIcon = false
- title = '打样管理'
- } else if (this.startWith(val, '/mobile/center/vendor/approval')) {
- this.showSearchIcon = false
- title = '打样管理'
- } else if (this.startWith(val, '/mobile/center/vendor/customer')) {
- this.showSearchIcon = false
- title = '客户资料'
- } else {
- this.showSearchIcon = true
- title = '优软商城'
- }
- return title
- },
- onCancelSearch: function () {
- this.showMainSearch = false
- },
- stopPropagation: function (event) {
- event.stopPropagation()
- },
- goMainSearch: function () {
- this.showMainSearch = true
- this.$store.dispatch('searchData/getSearchHistory')
- },
- startWith: function (str, s) {
- return this.baseUtils.startWith(str, s)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mobile-header{
- position: fixed;
- top: 0;
- z-index: 10;
- width:100%;
- height:.88rem;
- line-height: .88rem;
-
- background: #3e82f5;
- padding:0 .2rem 0 .1rem;
- color:#fff;
- }
- .mobile-header p{
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size:.36rem;
- text-align: center;
- margin: 0;
- width: 6rem;
- padding-left: 1rem;
- }
- .mobile-header a{
- font-size:.28rem;
- color:#fff;
- position: absolute;
- }
- .mobile-header a i{
- font-size: .48rem;
- margin-right: -.1rem;
- }
- .mobile-header p span {
- position: absolute;
- right: .4rem;
- font-size: .28rem;
- }
- .mobile-header p span i {
- font-size: .28rem;
- }
- .mobile-nav >i{
- font-size: .4rem;
- position: fixed;
- right: .25rem;
- top: .25rem;
- z-index: 1000;
- color: #fff;
- background: rgba( 0, 0, 0, .251 );
- width: .8rem;
- height: .8rem;
- line-height: .8rem;
- border-radius: 100%;
- padding-left: .2rem;
- }
- .hide {
- display: none;
- }
- .search-content {
- margin-left: .5rem;
- input {
- color: #333;
- }
- }
- .mobile-center-header {
- height: 1.26rem;
- line-height: 1.26rem;
- p {
- line-height: normal;
- margin-top: .13rem;
- &.en-name {
- font-size: .3rem;
- margin-top: .06rem;
- img {
- width: .31rem;
- margin-right: .05rem;
- }
- }
- }
- }
- </style>
|