_batchCode.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <template>
  2. <div class="mobile-content commodity-detail">
  3. <div class="logo-wrap">
  4. <div class="wrap-title"><span class="line"></span>图片信息</div>
  5. <img :src="commodity.img || '/images/store/common/default.png'" alt="">
  6. </div>
  7. <div class="product-info">
  8. <div class="wrap-title"><span class="line"></span>产品信息</div>
  9. <div class="focus-wrap inline-block" :class="{'active': isFocus}">
  10. <i class="iconfont icon-shoucang" @click="collectStore" style="font-size: 0.43rem;"></i>
  11. <div>店铺</div>
  12. <div>关注</div>
  13. </div>
  14. <div class="middle">
  15. <div class="list">
  16. <div class="fl">
  17. <div class="name">品牌:</div>
  18. <div class="text">{{commodity.brandNameEn}}</div>
  19. </div>
  20. </div>
  21. <div class="list">
  22. <div class="fl">
  23. <div class="name">类目(产品名称):</div>
  24. <div class="text">{{commodity.kindNameCn || '-'}}</div>
  25. </div>
  26. </div>
  27. <div class="list">
  28. <div class="name">规格:</div>
  29. <div class="text">{{commodity.spec || '-'}}</div>
  30. </div>
  31. <div class="list">
  32. <div class="name">包装方式:</div>
  33. <div class="text">{{commodity.packaging || '无包装信息'}}</div>
  34. </div>
  35. <div class="list">
  36. <div class="name">最小包装数:</div>
  37. <div class="text">{{commodity.minPackQty}}</div>
  38. </div>
  39. <div class="list">
  40. <div class="com-info">
  41. <span class="name">库存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
  42. (<span v-text="commodity.minBuyQty || 1"></span>个起订)
  43. <span class="can-div-sell" v-if="commodity.breakUp">可拆卖</span>
  44. </div>
  45. </div>
  46. <div class="list">
  47. <div class="name">交期(天):</div>
  48. <div class="text red" v-if="commodity.b2cMaxDelivery && (commodity.b2cMaxDelivery != commodity.b2cMinDelivery)" v-text="commodity.b2cMinDelivery + '-'+ commodity.b2cMaxDelivery + '(天)'"></div>
  49. <div class="text red" v-if="commodity.b2cMaxDelivery && (commodity.b2cMaxDelivery == commodity.b2cMinDelivery)" v-text="commodity.b2cMinDelivery + '(天)'"></div>
  50. </div>
  51. <!--<div class="list">-->
  52. <!--<div class="name">最小起订量:</div>-->
  53. <!--<div class="text" style="color: #f31919">{{commodity.minBuyQty}}</div>-->
  54. <!--</div>-->
  55. <!--<div class="list">-->
  56. <!--<div class="name">生产日期:</div>-->
  57. <!--<div class="text" :title="item.produceDate">{{commodity.produceDate || '-'}}</div>-->
  58. <!--</div>-->
  59. <div class="list">
  60. <div class="name left">价格梯度:</div>
  61. <div class="table left">
  62. <ul>
  63. <li class="title">
  64. <div>分段数量/PCS</div>
  65. <div>分段单价</div>
  66. </li>
  67. <li v-for="price in commodity.prices">
  68. <div>{{price.start}}+</div>
  69. <div v-if="commodity.currencyName == 'RMB'">¥{{price.rMBPrice}}</div>
  70. <div v-else>${{price.rMBPrice}}</div>
  71. </li>
  72. </ul>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="content-line link cl-price2">
  77. <ul class="clearfix">
  78. <nuxt-link :to="`/mobile/shop/${storeInfo.uuid}`" tag="li" class="text-ellipse inline-block price-level">
  79. <i class="iconfont icon-dianpu"></i>
  80. <p>查看店铺</p>
  81. </nuxt-link>
  82. <li class="text-ellipse inline-block price-level" @click="showStoreInfo = true">
  83. <i class="iconfont icon-kefu1"></i>
  84. <p>联系卖家</p>
  85. </li>
  86. <li class="text-ellipse inline-block price-level" :class="{'active': component.attach}" @click="goAttach(component.attach)">
  87. <i class="iconfont icon-pdf"></i>
  88. <p>数据手册</p>
  89. </li>
  90. </ul>
  91. </div>
  92. </div>
  93. <div class="params-wrap">
  94. <div class="wrap-title"><span class="line"></span>产品参数</div>
  95. <ul v-if="component.properties && component.properties.length">
  96. <li v-for="prop in component.properties" v-if="prop.property">
  97. <span class="inline-block text-ellipse"> {{prop.property.labelCn}}:</span>
  98. <span class="inline-block text-ellipse" v-text="prop.value || '—'"></span>
  99. </li>
  100. </ul>
  101. <div class="com-none-state" v-else>
  102. <p>卖家上传的产品暂无参数,请 <b @click="showStoreInfo = true">联系卖家</b> 了解具体详情</p>
  103. </div>
  104. </div>
  105. <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
  106. <div class="mobile-modal-box mobile-link-en">
  107. <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
  108. <div class="mobile-modal-content">
  109. <!--
  110. <div v-if="checkInfo(storeInfo.enterprise.enAddress)">商家地址:{{storeInfo.enterprise.enAddress}}</div>
  111. -->
  112. <!--<div class="content-line link-url">在线咨询</div>-->
  113. <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>
  114. <div v-if="checkInfo(storeInfo.enterprise.enPhone)">手机:<a :href="'tel:' + storeInfo.enterprise.enPhone" target="_blank" class="content-line link-url">{{storeInfo.enterprise.enPhone}}</a></div>
  115. <div v-if="checkInfo(storeInfo.enterprise.enWeixin)">微信:<span class="content-line">{{storeInfo.enterprise.enWeixin}}</span></div>
  116. <div v-if="checkInfo(storeInfo.enterprise.enQQ)">Q&nbsp;Q:<span class="content-line">{{storeInfo.enterprise.enQQ}}</span></div>
  117. <div v-if="!empty">暂无联系方式</div>
  118. <!--
  119. <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>
  120. -->
  121. </div>
  122. </div>
  123. </div>
  124. <remind-box :title="remindText" :timeoutCount="remindCount"></remind-box>
  125. <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox" :url="url"></login-box>
  126. </div>
  127. </template>
  128. <script>
  129. import {RemindBox, LoginBox} from '~components/mobile/common'
  130. export default {
  131. layout: 'mobile',
  132. fetch({ store, route }) {
  133. return Promise.all([
  134. store.dispatch('shop/findCommodityOnBatchInfo', route.params)
  135. ])
  136. },
  137. components: {
  138. RemindBox,
  139. LoginBox
  140. },
  141. data () {
  142. return {
  143. isMore: false,
  144. showStoreInfo: false,
  145. remindText: '',
  146. remindCount: 1,
  147. url: '',
  148. showLoginBox: false
  149. }
  150. },
  151. computed: {
  152. commodity () {
  153. console.log(this.$store.state.shop.storeInfo.commodity.data)
  154. return this.$store.state.shop.storeInfo.commodity.data
  155. },
  156. isRMB () {
  157. return this.commodity.currencyName === 'RMB'
  158. },
  159. commodityPrices () {
  160. return this.commodity.prices
  161. },
  162. priceLevel1 () {
  163. return this.commodityPrices.length > 3 ? this.commodityPrices.slice(0, 3) : this.commodityPrices
  164. },
  165. priceLevel2 () {
  166. return this.commodityPrices.length > 3 ? this.commodityPrices.slice(3, this.commodityPrices.length) : []
  167. },
  168. isFocus () {
  169. // console.log(this.$store.state.shop.storeInfo)
  170. return this.$store.state.shop.storeInfo.focusList.data === 'true'
  171. },
  172. storeInfo () {
  173. return this.$store.state.shop.storeInfo.store.data
  174. },
  175. component () {
  176. return this.$store.state.shop.storeInfo.component.data
  177. },
  178. empty () {
  179. return this.checkInfo(this.storeInfo.enterprise.enTel) || this.checkInfo(this.storeInfo.enterprise.enPhone) || this.checkInfo(this.storeInfo.enterprise.enWeixin) || this.checkInfo(this.storeInfo.enterprise.enQQ)
  180. }
  181. },
  182. methods: {
  183. checkInfo: function (str) {
  184. return str && str.trim() !== ''
  185. },
  186. goAttach: function (url) {
  187. if (this.user.logged) {
  188. if (url && url !== '1') {
  189. window.open(url)
  190. // window.location.href = url
  191. } else {
  192. if (!url) {
  193. this.onRemind('该产品暂无数据手册')
  194. } else {
  195. this.onRemind('数据手册地址错误')
  196. }
  197. }
  198. } else {
  199. this.url = this.$route.fullPath
  200. this.showLoginBox = true
  201. }
  202. },
  203. collectStore: function () {
  204. if (this.user.logged) {
  205. if (!this.isFocus) {
  206. this.$store.dispatch('shop/StoreFocus', {storeName: this.storeInfo.storeName, storeid: this.storeInfo.id})
  207. .then(response => {
  208. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  209. this.onRemind('关注成功')
  210. })
  211. } else {
  212. this.$http.post('/trade/storeFocus/delete/storeId', [this.storeInfo.id])
  213. .then(response => {
  214. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  215. this.onRemind('取消成功')
  216. })
  217. }
  218. } else {
  219. this.url = this.$route.fullPath
  220. this.showLoginBox = true
  221. }
  222. },
  223. onRemind: function (str) {
  224. this.remindText = str
  225. this.remindCount++
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. .commodity-detail {
  232. background: #f1f3f6;
  233. padding-bottom: 1rem;
  234. margin-bottom: 1.2rem;
  235. .wrap-title {
  236. color: #333;
  237. font-size: 0.28rem;
  238. border-bottom: 1px solid #d3d3d3;
  239. height: 0.5rem;
  240. text-align: left;
  241. padding: 0 0 0.1rem 0.05rem;
  242. margin: 0.17rem 0.25rem 0.13rem 0.25rem;
  243. line-height: 0.5rem;
  244. .line{
  245. width: 0.05rem;
  246. background: #3f84f6;
  247. display: inline-block;
  248. vertical-align: top;
  249. margin-right: 0.08rem;
  250. height: 0.28rem;
  251. margin-top: 0.09rem;
  252. }
  253. }
  254. .product-info {
  255. position: relative;
  256. background: #fff;
  257. margin: 0.2rem;
  258. border: 1px solid #e3e5e8;
  259. padding-bottom: 0.2rem;
  260. .focus-wrap {
  261. text-indent: 0.28rem;
  262. position: absolute;
  263. background-image: url('/images/mobile/product/productdetail_label.png');
  264. width: 0.93rem;
  265. height: 1.27rem;
  266. background-size: 100% 100%;
  267. font-size: 0.24rem;
  268. color: #666;
  269. right: 0px;
  270. top: 0px;
  271. i {
  272. color: #cacaca;
  273. }
  274. &.active {
  275. i {color: rgb(255, 120, 0);}
  276. }
  277. }
  278. .middle {
  279. border-radius: 5px;
  280. padding: 0.24rem 0.24rem 0px;
  281. background: #fff;
  282. .pms {
  283. color: #f57710;
  284. border: 1px solid #f57710;
  285. border-radius: 0.4rem;
  286. background: #fff;
  287. font-size: 0.24rem;
  288. height: 0.4rem;
  289. line-height: 0.4rem;
  290. width: 0.8rem;
  291. text-align: center;
  292. }
  293. .list {
  294. overflow: hidden;
  295. text-overflow: ellipsis;
  296. white-space: nowrap;
  297. .left {
  298. float: left;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. white-space: nowrap;
  302. }
  303. .textinfo {
  304. color: #0067e7;
  305. font-size: 0.28rem;
  306. }
  307. .button {
  308. font-size: 0.28rem;
  309. color: #1a58dd;
  310. width: 0.92rem;
  311. text-align: center;
  312. border-radius: 5px;
  313. border:1px solid #1a58dd;
  314. display: inline-block;
  315. margin-right: 0.2rem;
  316. }
  317. margin-bottom: 0.18rem;
  318. &::after{
  319. clear: both;
  320. display: block;
  321. content: ' ';
  322. visibility: hidden;
  323. zoom: 1;
  324. }
  325. .fl {
  326. width: 3.8rem;
  327. float: left;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. white-space: nowrap;
  331. }
  332. .fr {
  333. text-align: left;
  334. width: 2rem;
  335. overflow: hidden;
  336. text-overflow: ellipsis;
  337. white-space: nowrap;
  338. }
  339. &.list-long {
  340. .fl {
  341. width: 100% !important;
  342. }
  343. }
  344. .name {
  345. color: #666;
  346. font-size: 0.3rem;
  347. display: inline-block;
  348. }
  349. .text {
  350. display: inline-block;
  351. color: #333;
  352. font-size: 0.28rem;
  353. &.red {
  354. color: #e6353d;
  355. }
  356. }
  357. .table {
  358. width: 4.93rem;
  359. margin-bottom: 0;
  360. margin-top: 0;
  361. li {
  362. height: 0.43rem;
  363. line-height: 0.43rem;
  364. border-left: .01rem solid #c5c5c5;
  365. font-size: .28rem;
  366. &::after {
  367. clear: both;
  368. display: block;
  369. content: ' ';
  370. visibility: hidden;
  371. zoom: 1;
  372. }
  373. div {
  374. text-align: center;
  375. width: 50%;
  376. float: left;
  377. border-right: .01rem solid #c5c5c5;
  378. border-bottom: .01rem solid #c5c5c5;
  379. }
  380. &:nth-child(odd) {
  381. background: #ddd;
  382. color: #666;
  383. font-size: 0.28rem;
  384. }
  385. &:nth-child(even) {
  386. background: #fcfcfc;
  387. color: #666;
  388. font-size: 0.28rem;
  389. }
  390. &:nth-last-of-type(1){
  391. color: #f31919;
  392. }
  393. &.title {
  394. font-size: 0.28rem;
  395. color: #333;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .com-info {
  402. line-height: .5rem;
  403. overflow: hidden;
  404. text-overflow: ellipsis;
  405. white-space: nowrap;
  406. font-size:0.28rem;
  407. .name {
  408. color: #666;
  409. }
  410. .can-div-sell {
  411. font-size: 0.18rem;
  412. margin-left: 0.1rem;
  413. display: inline-block;
  414. height: .3rem;
  415. line-height: .3rem;
  416. width: .7rem;
  417. text-align: center;
  418. background: #3f84f6;
  419. color: #fff;
  420. font-weight: bold;
  421. border-radius: 3px;
  422. }
  423. }
  424. .content-line {
  425. border-radius: 5px;
  426. ul {
  427. li {
  428. width: 2rem;
  429. height:0.54rem;
  430. line-height: 0.54rem;
  431. float: left;
  432. margin-right: 0.25rem;
  433. color: #fff;
  434. border-radius: 0.08rem;
  435. font-size: 0;
  436. i {
  437. display: inline-block;
  438. margin-right: 0.04rem;
  439. margin-left: 0.24rem;
  440. &.icon-pdf {
  441. color: #929292;
  442. }
  443. &.active {
  444. color: #eb062b;
  445. }
  446. }
  447. &:nth-last-of-type(1) {
  448. margin-right: 0;
  449. background: #fff;
  450. color: #3f84f6;
  451. border: 1px solid #3f84f6;
  452. }
  453. &:nth-child(1) {
  454. background: #3f84f6;
  455. border: 1px solid #3f84f6;
  456. margin-left: 0.2rem;
  457. }
  458. &:nth-child(2) {
  459. background: #ff6000;
  460. border: 1px solid #ff6000;
  461. }
  462. p {
  463. font-size: 0.28rem;
  464. display: inline-block;
  465. text-align: center;
  466. vertical-align: top;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. .logo-wrap {
  473. height: 5.18rem;
  474. background: #fff;
  475. text-align: center;
  476. margin: 0.2rem;
  477. border: 1px solid #e3e5e8;
  478. img {
  479. /* border: .01rem solid #ccc;*/
  480. max-width: 4.06rem;
  481. max-height: 3.27rem;
  482. margin-top: 0.4rem;
  483. }
  484. }
  485. .params-wrap {
  486. border: 1px solid #e3e5e8;
  487. border-radius: 5px;
  488. margin: 0.2rem;
  489. background: #fff;
  490. padding: 0 0 .29rem;
  491. p {
  492. font-size: .26rem;
  493. text-align: center;
  494. margin-bottom: .24rem;
  495. }
  496. ul {
  497. background: #fff;
  498. font-size: .28rem;
  499. padding: 0 0.24rem;
  500. li {
  501. /*border-bottom: .01rem solid #d9d9d9;*/
  502. span {
  503. /*border-right: .01rem solid #d9d9d9;*/
  504. height: .67rem;
  505. line-height: .67rem;
  506. text-align: center;
  507. /*padding: 0 .15rem;*/
  508. &:first-child {
  509. /*width: 50%;*/
  510. color: #666;
  511. }
  512. &:last-child {
  513. color: #333;
  514. /*width: 50%;*/
  515. /*text-align: left;*/
  516. }
  517. }
  518. }
  519. }
  520. }
  521. }
  522. .com-none-state {
  523. padding: .2rem 0;
  524. background: transparent;
  525. b {
  526. color: #3c7cf5;
  527. font-weight: normal;
  528. }
  529. }
  530. </style>