| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <template>
- <div class="mobile-content commodity-detail">
- <div class="logo-wrap">
- <img :src="commodity.img || '/images/store/common/default.png'" alt="">
- </div>
- <div class="content-wrap">
- <div class="content-line cl-title">
- <span class="code text-ellipse inline-block">{{commodity.code}}</span>
- <div class="focus-wrap inline-block" :class="{'active': isFocus}">
- <i class="iconfont icon-shoucang" @click="collectStore"></i>
- <span>店铺关注</span>
- </div>
- </div>
- <div class="content-line cl-price1">
- <div class="fl">
- <p class="price-tag">价格:</p>
- <span>数量:</span>
- </div>
- <ul>
- <li class="text-ellipse inline-block price-level" v-for="price in priceLevel1">
- <p><span>{{isRMB ? '¥' : '$'}}</span>
- {{isRMB ? price.rMBPrice : price.uSDPrice}}
- </p>
- <span>{{price.start}}+</span>
- </li>
- </ul>
- <i :class="`iconfont icon-arrow-${isMore ? 'up' : 'down'}`" @click="isMore = !isMore" v-if="priceLevel2.length"></i>
- </div>
- <div class="content-line cl-price2" v-if="priceLevel2.length && isMore">
- <ul>
- <li class="text-ellipse inline-block price-level" v-for="price in priceLevel2">
- <p><span>$</span>159.00</p>
- <span>1+</span>
- </li>
- </ul>
- </div>
- <div class="content-line link cl-price2">
- <ul>
- <nuxt-link :to="`/mobile/shop/${storeInfo.uuid}`" tag="li" class="text-ellipse inline-block price-level">
- <i class="iconfont icon-shouye-copy"></i>
- <p>店铺</p>
- </nuxt-link>
- <li class="text-ellipse inline-block price-level" @click="showStoreInfo = true">
- <i class="iconfont icon-kefu1"></i>
- <p>联系卖家</p>
- </li>
- <li class="text-ellipse inline-block price-level active" @click="goAttach(component.attach)">
- <i class="iconfont icon-pdf"></i>
- <p>数据手册</p>
- </li>
- </ul>
- </div>
- </div>
- <div class="item-wrap">
- <p>产品信息</p>
- <div class="com-info">
- <span class="name">品牌</span>:<span v-text="commodity.brandNameEn"></span>
- </div>
- <div class="com-info">
- <span class="name no-letter">类目(产品名称)</span>:<span v-text="commodity.kindNameCn || '无类目信息'"></span>
- </div>
- <div class="com-info">
- <span class="name">规格</span>:<span v-text="commodity.spec || '无规格信息'"></span>
- </div>
- <div class="com-info">
- <span class="name">包装</span>:<span v-text="commodity.packaging || '无包装信息'"></span>
- </div>
- <div class="com-info">
- <span class="name">最小包装数</span>:<span v-text="commodity.minPackQty || '无最小包装数信息'"></span>
- </div>
- <div class="com-info">
- <span class="name">库存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
- (<span v-text="commodity.minBuyQty || 1"></span>个起订)
- <span class="can-div-sell" v-if="commodity.breakUp">可拆卖</span>
- </div>
- <div class="com-info">
- <span class="name">交期</span>:
- <div class="delivery inline-block">
- <span v-text="commodity.b2cMinDelivery || 0"></span>
- <span v-if="commodity.b2cMaxDelivery && commodity.b2cMaxDelivery !== commodity.b2cMinDelivery">-</span>
- <span v-if="commodity.b2cMaxDelivery && commodity.b2cMaxDelivery !== commodity.b2cMinDelivery" v-text="commodity.b2cMaxDelivery || 0"></span>
- <span>(天)</span>
- </div>
- </div>
- </div>
- <div class="params-wrap">
- <p>产品参数</p>
- <ul v-if="component.properties && component.properties.length">
- <li v-for="prop in component.properties" v-if="prop.property">
- <span class="inline-block text-ellipse" v-text="prop.property.labelCn"></span>
- <span class="inline-block text-ellipse" v-text="prop.value || '—'"></span>
- </li>
- </ul>
- <div class="com-none-state" v-else>
- <p>卖家上传的产品暂无参数,请 <b @click="showStoreInfo = true">联系卖家</b> 了解具体详情</p>
- </div>
- </div>
- <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
- <div class="mobile-modal-box mobile-link-en">
- <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
- <div class="mobile-modal-content">
- <!--
- <div v-if="checkInfo(storeInfo.enterprise.enAddress)">商家地址:{{storeInfo.enterprise.enAddress}}</div>
- -->
- <!--<div class="content-line link-url">在线咨询</div>-->
- <div v-if="checkInfo(storeInfo.enterprise.enTel)">致电:<a :href="'tel:' + storeInfo.enterprise.enTel" target="_blank" class="content-line link-url">{{storeInfo.enterprise.enTel}}</a></div>
- <!--
- <div v-if="checkInfo(storeInfo.enterprise.enEmail)">邮件:<a :href="'mailto:' + storeInfo.enterprise.enEmail" target="_blank" class="content-line link-url">{{storeInfo.enterprise.enEmail}}</a></div>
- -->
- </div>
- </div>
- </div>
- <remind-box :title="remindText" :timeoutCount="remindCount"></remind-box>
- <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox" :url="url"></login-box>
- </div>
- </template>
- <script>
- import {RemindBox, LoginBox} from '~components/mobile/common'
- export default {
- layout: 'mobile',
- fetch({ store, route }) {
- return Promise.all([
- store.dispatch('shop/findCommodityOnBatchInfo', route.params)
- ])
- },
- components: {
- RemindBox,
- LoginBox
- },
- data () {
- return {
- isMore: false,
- showStoreInfo: false,
- remindText: '',
- remindCount: 1,
- url: '',
- showLoginBox: false
- }
- },
- computed: {
- commodity () {
- return this.$store.state.shop.storeInfo.commodity.data
- },
- isRMB () {
- return this.commodity.currencyName === 'RMB'
- },
- commodityPrices () {
- return this.commodity.prices
- },
- priceLevel1 () {
- return this.commodityPrices.length > 3 ? this.commodityPrices.slice(0, 3) : this.commodityPrices
- },
- priceLevel2 () {
- return this.commodityPrices.length > 3 ? this.commodityPrices.slice(3, this.commodityPrices.length) : []
- },
- isFocus () {
- // console.log(this.$store.state.shop.storeInfo)
- return this.$store.state.shop.storeInfo.focusList.data === 'true'
- },
- storeInfo () {
- return this.$store.state.shop.storeInfo.store.data
- },
- component () {
- return this.$store.state.shop.storeInfo.component.data
- }
- },
- methods: {
- checkInfo: function (str) {
- return str && str.trim() !== ''
- },
- goAttach: function (url) {
- if (this.user.logged) {
- if (url && url !== '1') {
- window.open(url)
- // window.location.href = url
- } else {
- if (!url) {
- this.onRemind('该产品暂无数据手册')
- } else {
- this.onRemind('数据手册地址错误')
- }
- }
- } else {
- this.url = this.$route.fullPath
- this.showLoginBox = true
- }
- },
- collectStore: function () {
- if (this.user.logged) {
- if (!this.isFocus) {
- this.$store.dispatch('shop/StoreFocus', {storeName: this.storeInfo.storeName, storeid: this.storeInfo.id})
- .then(response => {
- this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
- this.onRemind('关注成功')
- })
- } else {
- this.$http.post('/trade/storeFocus/delete/storeId', [this.storeInfo.id])
- .then(response => {
- this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
- this.onRemind('取消成功')
- })
- }
- } else {
- this.url = this.$route.fullPath
- this.showLoginBox = true
- }
- },
- onRemind: function (str) {
- this.remindText = str
- this.remindCount++
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .commodity-detail {
- .logo-wrap {
- height: 5.18rem;
- line-height: 5.18rem;
- background: #fff;
- text-align: center;
- img {
- /* border: .01rem solid #ccc;*/
- max-width: 4.06rem;
- max-height: 3.27rem;
- }
- }
- .content-wrap {
- -webkit-box-shadow: 0 -2px 7px 0 rgba(143, 141, 141, 0.25);
- -moz-box-shadow: 0 -2px 7px 0 rgba(143, 141, 141, 0.25);
- box-shadow: 0 -2px 7px 0 rgba(143, 141, 141, 0.25);
- border-bottom: .1rem solid #f4f4f4;
- .content-line {
- height: 1.04rem;
- border-bottom: .01rem solid #d9d9d9;
- &.cl-title {
- padding: .14rem 0 .14rem .2rem;
- .code {
- font-size: .3rem;
- font-weight: bold;
- width: 6.22rem;
- padding-right: .3rem;
- border-right: .01rem solid #e1e1e1;
- line-height: .76rem;
- }
- .focus-wrap {
- width: .8rem;
- text-align: center;
- margin-left: .15rem;
- i {
- font-size: .4rem;
- display: block;
- color: #dddddd;
- }
- span {
- font-size: .2rem;
- }
- &.active {
- i {
- color: #ff7803;
- }
- }
- }
- }
- .price-level {
- text-align: center;
- font-size: .24rem;
- border-right: .01rem solid #b0b0b0;
- &:last-child {
- border-right: none;
- }
- p {
- font-size: .38rem;
- color: #f42d29;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- max-width: 1.88rem;
- margin: 0 auto;
- span {
- font-size: .22rem;
- }
- }
- }
- &.cl-price1 {
- padding: .1rem .18rem 0;
- .fl {
- font-size: .24rem;
- text-align: center;
- margin-top: .08rem;
- .price-tag {
- width: .69rem;
- height: .34rem;
- line-height: .34rem;
- text-align: center;
- background: #f42d29;
- border-radius: .1rem;
- color: #fff;
- margin: .02rem 0 .06rem;
- }
- }
- ul {
- display: inline-block;
- li {
- width: 1.96rem;
- }
- }
- i {
- font-size: .32rem;
- }
- }
- &.cl-price2 {
- padding-top: .1rem;
- ul {
- text-align: center;
- li {
- width: 2.83rem;
- }
- }
- }
- &.link {
- padding-top: .18rem;
- ul {
- li {
- width: 33%;
- &.active {
- i {
- color: #d81e06;
- }
- }
- }
- i {
- font-size: .39rem;
- &.icon-kefu1 {
- font-size: .44rem;
- position: relative;
- top: -.05rem;
- color: #ff6000;
- & + p {
- margin-top: -.07rem;
- }
- }
- &.icon-shouye-copy {
- color: #3f84f6;
- }
- }
- p {
- font-size: .2rem;
- color: #333;
- }
- }
- }
- }
- }
- .params-wrap {
- background: #fff;
- padding: .29rem .23rem;
- p {
- font-size: .26rem;
- text-align: center;
- margin-bottom: .24rem;
- }
- ul {
- border-left: .01rem solid #d9d9d9;
- border-top: .01rem solid #d9d9d9;
- background: #fff;
- font-size: .24rem;
- li {
- border-bottom: .01rem solid #d9d9d9;
- span {
- border-right: .01rem solid #d9d9d9;
- height: .67rem;
- line-height: .67rem;
- text-align: center;
- padding: 0 .15rem;
- &:first-child {
- width: 50%;
- }
- &:last-child {
- width: 50%;
- text-align: left;
- }
- }
- }
- }
- }
- .item-wrap {
- padding: .3rem 0;
- border-bottom: .1rem solid #f4f4f4;
- p {
- font-size: .26rem;
- text-align: center;
- margin-bottom: .24rem;
- font-weight: bold;
- }
- .com-info {
- padding-left: .5rem;
- padding-right: .2rem;
- line-height: .5rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- .name {
- color: #666;
- }
- .can-div-sell {
- font-size: 0.18rem;
- margin-left: 0.1rem;
- display: inline-block;
- height: .3rem;
- line-height: .3rem;
- width: .7rem;
- text-align: center;
- background: #3f84f6;
- color: #fff;
- font-weight: bold;
- border-radius: 3px;
- }
- }
- }
- }
- .com-none-state {
- padding: .2rem 0;
- background: transparent;
- b {
- color: #3c7cf5;
- font-weight: normal;
- }
- }
- </style>
|