Commit 5d6200770a061398e95377f8a27f548b025ef18a
1 parent
e7121c7107
Exists in
master
改冲突
Showing
3 changed files
with
4 additions
and
144 deletions
Show diff stats
src/components/Wuc-tab/Wuc-tab.vue
| ... | ... | @@ -1,138 +0,0 @@ |
| 1 | -<template> | |
| 2 | - <scroll-view class="wuc-tab" :class="tabClass" :style="tabStyle" scroll-with-animation scroll-x :scroll-left="scrollLeft"> | |
| 3 | - <div v-if="!textFlex" class="wuc-tab-wrap"> | |
| 4 | - <div class="wuc-tab-item" :class="[index === tabCur ? selectClass + ' cur':'']" v-for="(item,index) in tabList" :key="index" :id="index" @tap="tabSelect(index,$event)"> | |
| 5 | - <text :class="item.icon"></text> | |
| 6 | - <span>{{item.name}}</span> | |
| 7 | - </div> | |
| 8 | - </div> | |
| 9 | - | |
| 10 | - <div class="flex text-center" v-if="textFlex"> | |
| 11 | - <div class="wuc-tab-item flex-sub" :class="index === tabCur ? selectClass + ' cur':''" v-for="(item,index) in tabList" :key="index" :id="index" @tap="tabSelect(index,$event)"> | |
| 12 | - <text :class="item.icon"></text> | |
| 13 | - <span>{{item.name}}</span> | |
| 14 | - </div> | |
| 15 | - </div> | |
| 16 | - </scroll-view> | |
| 17 | -</template> | |
| 18 | -<script> | |
| 19 | -export default { | |
| 20 | - name: 'Wuc-tab', | |
| 21 | - data() { | |
| 22 | - return {}; | |
| 23 | - }, | |
| 24 | - props: { | |
| 25 | - tabList: { | |
| 26 | - type: Array, | |
| 27 | - default() { | |
| 28 | - return []; | |
| 29 | - } | |
| 30 | - }, | |
| 31 | - tabCur: { | |
| 32 | - type: Number, | |
| 33 | - default() { | |
| 34 | - return 0; | |
| 35 | - } | |
| 36 | - }, | |
| 37 | - tabClass: { | |
| 38 | - type: String, | |
| 39 | - default() { | |
| 40 | - return ''; | |
| 41 | - } | |
| 42 | - }, | |
| 43 | - tabStyle: { | |
| 44 | - type: String, | |
| 45 | - default() { | |
| 46 | - return ''; | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - textFlex: { | |
| 50 | - type: Boolean, | |
| 51 | - default() { | |
| 52 | - return false; | |
| 53 | - } | |
| 54 | - }, | |
| 55 | - selectClass: { | |
| 56 | - type: String, | |
| 57 | - default() { | |
| 58 | - return 'text-blue'; | |
| 59 | - } | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - methods: { | |
| 63 | - tabSelect(index, e) { | |
| 64 | - if (this.currentTab === index) return false; | |
| 65 | - this.$emit('update:tabCur', index); | |
| 66 | - this.$emit('change', index); | |
| 67 | - } | |
| 68 | - }, | |
| 69 | - computed: { | |
| 70 | - scrollLeft() { | |
| 71 | - return (this.tabCur - 1) * 60; | |
| 72 | - } | |
| 73 | - } | |
| 74 | -}; | |
| 75 | -</script> | |
| 76 | -<style> | |
| 77 | -div, | |
| 78 | -scroll-view, | |
| 79 | -swiper { | |
| 80 | - box-sizing: border-box; | |
| 81 | -} | |
| 82 | -.wuc-tab { | |
| 83 | - white-space: nowrap; | |
| 84 | - margin-bottom: 24rpx; | |
| 85 | -} | |
| 86 | -.wuc-tab-wrap{ | |
| 87 | - display: flex; | |
| 88 | - justify-content: space-between; | |
| 89 | -} | |
| 90 | -.wuc-tab-item { | |
| 91 | - height: 48rpx; | |
| 92 | - display: inline-block; | |
| 93 | - line-height: 48rpx; | |
| 94 | - font-size: 14px; | |
| 95 | - color: #333333; | |
| 96 | -} | |
| 97 | - | |
| 98 | -.wuc-tab-item.cur { | |
| 99 | - border-bottom: 4rpx solid #FF6B4A; | |
| 100 | -} | |
| 101 | - | |
| 102 | -.wuc-tab.fixed { | |
| 103 | - position: fixed; | |
| 104 | - width: 100%; | |
| 105 | - top: 0; | |
| 106 | - z-index: 1024; | |
| 107 | - box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); | |
| 108 | -} | |
| 109 | - | |
| 110 | -.flex { | |
| 111 | - display: flex; | |
| 112 | -} | |
| 113 | -.text-center { | |
| 114 | - text-align: center; | |
| 115 | -} | |
| 116 | -.flex-sub { | |
| 117 | - flex: 1; | |
| 118 | -} | |
| 119 | -.text-blue{ | |
| 120 | - color:#333333; | |
| 121 | -} | |
| 122 | -.text-white{ | |
| 123 | - color:#ffffff; | |
| 124 | -} | |
| 125 | -.bg-white{ | |
| 126 | - background-color: #ffffff; | |
| 127 | -} | |
| 128 | -.bg-blue{ | |
| 129 | - background-color: #333333; | |
| 130 | -} | |
| 131 | -.text-orange{ | |
| 132 | - color: #f37b1d | |
| 133 | -} | |
| 134 | - | |
| 135 | -.text-xl { | |
| 136 | - font-size: 36upx; | |
| 137 | -} | |
| 138 | -</style> |
src/pages.json
| 1 | 1 | { |
| 2 | 2 | "pages": [ |
| 3 | 3 | { |
| 4 | - "path": "pages/detail/detail", | |
| 4 | + "path": "pages/index/index", | |
| 5 | 5 | "style": { |
| 6 | - "navigationBarTitleText": "产品详情" | |
| 6 | + "navigationBarTitleText": "商城一览" | |
| 7 | 7 | } |
| 8 | 8 | }, |
| 9 | 9 | { |
| 10 | - "path": "pages/index/index", | |
| 10 | + "path": "pages/detail/detail", | |
| 11 | 11 | "style": { |
| 12 | - "navigationBarTitleText": "商城一览" | |
| 12 | + "navigationBarTitleText": "产品详情" | |
| 13 | 13 | } |
| 14 | 14 | }, |
| 15 | 15 | { | ... | ... |
src/pages/detail/detail.vue