| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- <template>
- <div class="component-detail">
- <div class="base-detail">
- <div class="base-detail-item" v-if="component.kind.nameCn">
- <span>类目:</span>
- <span>{{component.kind.nameCn}}</span>
- </div>
- <div class="base-detail-item" v-if="component.brand.nameCn">
- <span>品牌:</span>
- <span>{{component.brand.nameCn}}</span>
- </div>
- <div class="base-detail-item attach" @click="goAttach(component.attach)">
- <span>规格书:</span>
- <i class="icon-chakan iconfont"></i>
- </div>
- <div class="base-detail-item" v-if="component.description">
- <span class="description">产品描述:{{component.description}}</span>
- </div>
- </div>
- <div class="product-switch-item">
- <span :class="activeType=='param'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='param'">参数</span>
- <span :class="activeType=='store'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='store'">商家</span>
- </div>
- <div class="product-params" v-if="activeType == 'param'">
- <div class="param-item" v-if="prop.value && prop.value!=''" v-for="prop in component.properties">
- <span class="prop-name">{{prop.property.labelCn}}</span>
- <span class="prop-value">{{prop.value}}</span>
- </div>
- </div>
- <div class="product-store" v-if="activeType == 'store'">
- <table v-if="storeList.content&&storeList.content.length > 0">
- <thead>
- <tr>
- <th>商家</th>
- <th>包装</th>
- <th>数量</th>
- <th>单价</th>
- <th>交期(天)</th>
- </tr>
- </thead>
- <tbody>
- <tr v-for="store in storeList.content">
- <td>{{store.storeName || '-'}}</td>
- <td>
- <div v-if="!store.packaging && !store.breakUp && !store.produceDate">-</div>
- <div>{{store.packaging}}</div>
- <div>{{store.breakUp?'可拆卖':'不可拆卖'}}</div>
- <div>{{store.produceDate}}</div>
- </td>
- <td>
- <div v-if="!store.prices || store.prices.length == 0">-</div>
- <div v-for="price in store.prices">{{price.start}}+</div>
- </td>
- <td>
- <div v-if="!store.prices || store.prices.length == 0">
- <span>—</span>
- </div>
- <div v-for="price in store.prices">
- <span v-if="store.currencyName.indexOf('RMB')!==-1">¥{{price.rMBPrice | currency}}</span>
- <span v-if="store.currencyName.indexOf('USD')!==-1">${{price.uSDPrice | currency}}</span>
- </div>
- </td>
- <td>
- <div v-if="store.b2cMinDelivery">
- <span>交期:</span>
- <span>{{store.b2cMinDelivery}}</span>
- <span v-if="store.b2cMaxDelivery && store.b2cMaxDelivery !== store.b2cMinDelivery">-</span>
- <span v-if="store.b2cMaxDelivery && store.b2cMaxDelivery !== store.b2cMinDelivery">{{store.b2cMaxDelivery}}</span>
- </div>
- <div v-if="store.minBuyQty">{{store.minBuyQty}}起订</div>
- <div v-if="!store.b2cMinDelivery">
- <span>—</span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- <div v-if="!storeList.content || storeList.content.length == 0" class="no-store">
- <img src="/images/mobile/@2x/car@2x.png" alt="">
- <div>抱歉,暂无商家出售此型号!</div>
- <div>您可前往<a href="http://www.usoftmall.com" class="link-url">www.usoftmall.com</a>网页版进行“发布求购”或“产品上架”操作!</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data () {
- return {
- activeType: 'param',
- storeIds: [],
- UmallExist: false,
- storeExist: false,
- params: {
- count: 10,
- page: 1,
- sorting: {'minPriceRMB': 'ASC'},
- filter: {
- uuid: this.$route.params.uuid,
- ignoreUMall: false,
- ignoreStore: false,
- storeIds: ''
- }
- }
- }
- },
- computed: {
- component () {
- return this.$store.state.componentDetail.detail.data
- },
- // stores () {
- // console.log(this.$store.state.componentStore.store.data)
- // return this.$store.state.componentStore.store.data
- // },
- storeList () {
- let storeList = this.$store.state.componentInformation.information.data
- let _self = this
- if (storeList.content) {
- storeList.content.forEach(function (item) {
- _self.storeIds.push(item.storeid)
- })
- }
- if (this.storeIds.length > 0) {
- if (this.storeIds.indexOf(this.storeId) === -1) {
- this.storeExist = true
- } else {
- this.storeIds.splice(this.storeIds.indexOf(this.storeId), 1)
- if (this.storeIds.length > 0) {
- this.storeExist = true
- }
- this.UmallExist = true
- }
- }
- return storeList
- }
- },
- filters: {
- currency: function (num) {
- if (typeof num === 'number') {
- if (num <= 0.000001) {
- num = 0.000001
- } else {
- if (num.toString().indexOf('.') === -1) {
- num += '.00'
- } else {
- let inputStr = num.toString()
- let arr = inputStr.split('.')
- let floatNum = arr[1]
- if (floatNum.length > 6) {
- num = inputStr.substring(0, arr[0].length + 7)
- if (Number(floatNum.charAt(6)) > 4) {
- num = (Number(num) * 1000000 + 1) / 1000000
- }
- } else if (floatNum.length === 1) {
- num = num + '0'
- }
- }
- }
- }
- return num
- }
- },
- methods: {
- goAttach: function (url) {
- if (url !== '1') {
- window.location.href = url
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .component-detail {
- font-size: .28rem;
- margin-top: .88rem;
- margin-bottom: 1.2rem;
- .base-detail {
- margin: 0 .66rem .34rem .40rem;
- padding-top: .34rem;
- .base-detail-item {
- margin-bottom: .3rem;
- position: relative;
- &.attach {
- display: inline-block;
- }
- i {
- font-size: .55rem;
- color: #6fcafe;
- position: absolute;
- top: -.13rem;
- }
- &:last-child {
- margin-bottom: 0;
- }
- .description {
- line-height: .4rem;
- max-height: 1.2rem;
- word-break: break-all;
- overflow : hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 3;
- -webkit-box-orient: vertical;
- }
- }
- }
- .product-switch-item {
- text-align: center;
- .mobile-switch-btn {
- background: #e75610;
- color: #fff;
- display: inline-block;
- height: .68rem;
- font-size: .28rem;
- padding: .19rem .53rem;
- position: relative;
- &:first-child {
- background: #fff;
- color: #e75610;
- border: .01rem solid #e75610;
- border-left: none;
- padding-left: .30rem;
- }
- &:first-child.active {
- background: #e75610;
- color: #fff;
- border: .01rem solid #e75610;
- padding-left: .30rem;
- }
- &:last-child {
- background: #fff;
- color: #e75610;
- border: .01rem solid #e75610;
- border-right: none;
- padding-right: .35rem;
- }
- &:last-child.active {
- background: #e75610;
- color: #fff;
- border: .01rem solid #e75610;
- border-right: none;
- padding-right: .35rem;
- }
- &:first-child:before {
- content: '';
- background: #fff;
- border: .01rem solid #e75610;
- width: .64rem;
- height: .68rem;
- border-radius: 100%;
- position: absolute;
- left: -.33rem;
- top: -.01rem;
- z-index: -5;
- }
- &:first-child.active:before {
- content: '';
- background: #e75610;
- border: .01rem solid #e75610;
- width: .64rem;
- height: .68rem;
- border-radius: 100%;
- position: absolute;
- left: -.33rem;
- top: -.01rem;
- }
- &:last-child:before {
- content: '';
- background: #fff;
- width: .64rem;
- height: .68rem;
- border-radius: 100%;
- position: absolute;
- border: .01rem solid #e75610;
- left: 1.04rem;
- z-index: -5;
- top: -.01rem;
- }
- &:last-child.active:before {
- content: '';
- background: #e75610;
- width: .64rem;
- height: .68rem;
- border-radius: 100%;
- position: absolute;
- border: .01rem solid #e75610;
- left: 1.04rem;
- z-index: -5;
- top: -.01rem;
- }
- }
- }
- .product-params {
- line-height: .28rem;
- margin-top: .19rem;
- .param-item {
- padding: .19rem .4rem;
- &:nth-child(even) {
- background: #eee;
- }
- .prop-name {
- width: 3.72rem;
- display: inline-block;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- .prop-value {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- display: inline-block;
- width: 2.69rem;
- float: right;
- }
- }
- }
- .product-store {
- margin: .38rem .2rem;
- table {
- width: 100%;
- font-size: .28rem;
- thead {
- tr {
- th {
- padding-bottom: .2rem;
- font-weight: bold;
- text-align: center;
- }
- }
- }
- tbody {
- tr {
- border-top: .01rem solid rgb(174,175,176);
- td {
- padding-top: .2rem;
- div {
- padding-left: .4rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-bottom: .2rem;
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- }
- }
- }
- .no-store {
- margin-top: .89rem;
- img {
- display: block;
- text-align: center;
- margin: 0 auto;
- margin-bottom: .45rem;
- width: 1.97rem;
- height: 1.8rem;
- }
- div {
- width: 5.27rem;
- margin: 0 auto;
- text-align: center;
- line-height: .4rem;
- .link-url {
- color: #01a44e;
- }
- }
- }
- }
- }
- </style>
|