_batchCode.vue 17 KB

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