_batchCode.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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" v-if="commodity.b2cMaxDelivery && (commodity.b2cMaxDelivery != commodity.b2cMinDelivery)" v-text="commodity.b2cMinDelivery + '-'+ commodity.b2cMaxDelivery"></div>
  50. <div class="text" 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">价格梯度:<br/>(PCS)</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.uSDPrice}}</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" @click="goAttach(component.attach)">
  88. <i class="iconfont icon-pdf" :class="{'active': component.attach && component.attach !== '' && component.attach !== '1'}" ></i>
  89. <p class="lastOne" :class="{'active': component.attach && component.attach !== '' && component.attach !== '1'}">数据手册</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="operate-bottom">
  107. <div class="inline-block ob-ope">
  108. <nuxt-link :to="`/mobile/shop/${storeInfo.uuid}`" class="item inline-block">
  109. <i class="iconfont icon-dianpu"></i>
  110. <p>查看店铺</p>
  111. </nuxt-link>
  112. <a class="item inline-block" @click="showStoreInfo = true">
  113. <i class="iconfont icon-duihua"></i>
  114. <p>联系卖家</p>
  115. </a>
  116. <a class="item inline-block" @click="goAttach(component.attach)" :class="{'active': component.attach && component.attach !== '' && component.attach !== '1'}">
  117. <i class="iconfont icon-pdf"></i>
  118. <p>数据手册</p>
  119. </a>
  120. </div>
  121. <div class="inline-block ob-buy">
  122. <button @click="buy(false)">加入购物车</button>
  123. <button @click="buy(true)">立即购买</button>
  124. </div>
  125. </div>
  126. <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
  127. <div class="mobile-modal-box mobile-link-en">
  128. <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
  129. <div class="mobile-modal-content">
  130. <!--
  131. <div v-if="checkInfo(storeInfo.enterprise.enAddress)">商家地址:{{storeInfo.enterprise.enAddress}}</div>
  132. -->
  133. <!--<div class="content-line link-url">在线咨询</div>-->
  134. <div v-if="checkInfo(storeInfo.enterprise.enTel)" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + storeInfo.enterprise.enTel" target="_blank" class="content-line link-url pull-left">{{storeInfo.enterprise.enTel}}</a></div>
  135. <div v-if="checkInfo(storeInfo.enterprise.enPhone)" class="clearfix"><span class="pull-left">手机:</span><a :href="'tel:' + storeInfo.enterprise.enPhone" target="_blank" class="content-line link-url pull-left">{{storeInfo.enterprise.enPhone}}</a></div>
  136. <div v-if="checkInfo(storeInfo.enterprise.enWeixin)" class="clearfix"><span class="pull-left">微信:</span><span class="content-line pull-left">{{storeInfo.enterprise.enWeixin}}</span></div>
  137. <div v-if="checkInfo(storeInfo.enterprise.enQQ)" class="clearfix"><span class="pull-left">Q&nbsp;Q:</span><span class="content-line pull-left">{{storeInfo.enterprise.enQQ}}</span></div>
  138. <div v-if="!empty">暂无联系方式</div>
  139. <!--
  140. <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>
  141. -->
  142. </div>
  143. </div>
  144. </div>
  145. <remind-box :title="remindText" :timeoutCount="remindCount"></remind-box>
  146. <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox" :url="url"></login-box>
  147. </div>
  148. </template>
  149. <script>
  150. import {RemindBox, LoginBox} from '~components/mobile/common'
  151. export default {
  152. layout: 'mobile',
  153. fetch({ store, route }) {
  154. return Promise.all([
  155. store.dispatch('shop/findCommodityOnBatchInfo', route.params)
  156. ])
  157. },
  158. components: {
  159. RemindBox,
  160. LoginBox
  161. },
  162. data () {
  163. return {
  164. isMore: false,
  165. showStoreInfo: false,
  166. remindText: '',
  167. remindCount: 1,
  168. url: '',
  169. showLoginBox: false
  170. }
  171. },
  172. computed: {
  173. commodity () {
  174. // console.log(this.$store.state.shop.storeInfo.commodity.data)
  175. return this.$store.state.shop.storeInfo.commodity.data
  176. },
  177. isRMB () {
  178. return this.commodity.currencyName === 'RMB'
  179. },
  180. commodityPrices () {
  181. return this.commodity.prices
  182. },
  183. priceLevel1 () {
  184. return this.commodityPrices.length > 3 ? this.commodityPrices.slice(0, 3) : this.commodityPrices
  185. },
  186. priceLevel2 () {
  187. return this.commodityPrices.length > 3 ? this.commodityPrices.slice(3, this.commodityPrices.length) : []
  188. },
  189. isFocus () {
  190. // console.log(this.$store.state.shop.storeInfo)
  191. return this.$store.state.shop.storeInfo.focusList.data === 'true'
  192. },
  193. storeInfo () {
  194. return this.$store.state.shop.storeInfo.store.data
  195. },
  196. component () {
  197. return this.$store.state.shop.storeInfo.component.data
  198. },
  199. empty () {
  200. 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)
  201. }
  202. },
  203. methods: {
  204. checkInfo: function (str) {
  205. return str && str.trim() !== ''
  206. },
  207. goAttach: function (url) {
  208. if (this.user.logged) {
  209. if (url && url !== '1') {
  210. // console.log(url)
  211. window.open(url)
  212. // window.location.href = url
  213. } else {
  214. if (!url) {
  215. this.setRemindText('该产品暂无数据手册')
  216. } else {
  217. this.setRemindText('数据手册地址错误')
  218. }
  219. }
  220. } else {
  221. this.url = this.$route.fullPath
  222. this.showLoginBox = true
  223. }
  224. },
  225. collectStore: function () {
  226. if (this.user.logged) {
  227. if (!this.isFocus) {
  228. this.$store.dispatch('shop/StoreFocus', {storeName: this.storeInfo.storeName, storeid: this.storeInfo.id})
  229. .then(response => {
  230. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  231. this.setRemindText('关注成功')
  232. })
  233. } else {
  234. this.$http.post('/trade/storeFocus/delete/storeId', [this.storeInfo.id])
  235. .then(response => {
  236. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  237. this.setRemindText('取消成功')
  238. })
  239. }
  240. } else {
  241. this.url = this.$route.fullPath
  242. this.showLoginBox = true
  243. }
  244. },
  245. setRemindText: function (str) {
  246. this.remindText = str
  247. this.remindCount++
  248. },
  249. buy: function (flag) {
  250. this.baseUtils.buyOrCar(flag, null, this, this.commodity, '/mobile/center/user/pay/')
  251. }
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. .commodity-detail {
  257. background: #f1f3f6;
  258. padding-bottom: 1rem;
  259. margin-bottom: 1.2rem;
  260. .wrap-title {
  261. color: #333;
  262. font-size: 0.28rem;
  263. border-bottom: 1px solid #d3d3d3;
  264. height: 0.5rem;
  265. text-align: left;
  266. padding: 0 0 0.1rem 0.05rem;
  267. margin: 0.17rem 0.25rem 0.13rem 0.25rem;
  268. line-height: 0.5rem;
  269. .line{
  270. width: 0.05rem;
  271. background: #3f84f6;
  272. display: inline-block;
  273. vertical-align: top;
  274. margin-right: 0.08rem;
  275. height: 0.28rem;
  276. margin-top: 0.09rem;
  277. }
  278. }
  279. .product-info {
  280. position: relative;
  281. background: #fff;
  282. margin: 0.2rem;
  283. border: 1px solid #e3e5e8;
  284. padding-bottom: 0.2rem;
  285. .focus-wrap {
  286. text-indent: 0.28rem;
  287. position: absolute;
  288. background-image: url('/images/mobile/product/productdetail_label.png');
  289. width: 0.93rem;
  290. height: 1.27rem;
  291. background-size: 100% 100%;
  292. font-size: 0.24rem;
  293. color: #666;
  294. right: 0px;
  295. top: 0px;
  296. i {
  297. color: #cacaca;
  298. }
  299. &.active {
  300. i {color: rgb(255, 120, 0);}
  301. }
  302. }
  303. .middle {
  304. border-radius: 5px;
  305. padding: 0.24rem 0.24rem 0px;
  306. background: #fff;
  307. .pms {
  308. color: #f57710;
  309. border: 1px solid #f57710;
  310. border-radius: 0.4rem;
  311. background: #fff;
  312. font-size: 0.24rem;
  313. height: 0.4rem;
  314. line-height: 0.4rem;
  315. width: 0.8rem;
  316. text-align: center;
  317. }
  318. .list {
  319. overflow: hidden;
  320. text-overflow: ellipsis;
  321. white-space: nowrap;
  322. .left {
  323. float: left;
  324. overflow: hidden;
  325. text-overflow: ellipsis;
  326. white-space: nowrap;
  327. }
  328. .textinfo {
  329. color: #0067e7;
  330. font-size: 0.28rem;
  331. }
  332. .button {
  333. font-size: 0.28rem;
  334. color: #1a58dd;
  335. width: 0.92rem;
  336. text-align: center;
  337. border-radius: 5px;
  338. border:1px solid #1a58dd;
  339. display: inline-block;
  340. margin-right: 0.2rem;
  341. }
  342. margin-bottom: 0.18rem;
  343. &::after{
  344. clear: both;
  345. display: block;
  346. content: ' ';
  347. visibility: hidden;
  348. zoom: 1;
  349. }
  350. .fl {
  351. width: 3.8rem;
  352. float: left;
  353. overflow: hidden;
  354. text-overflow: ellipsis;
  355. white-space: nowrap;
  356. }
  357. .fr {
  358. text-align: left;
  359. width: 2rem;
  360. overflow: hidden;
  361. text-overflow: ellipsis;
  362. white-space: nowrap;
  363. }
  364. &.list-long {
  365. .fl {
  366. width: 100% !important;
  367. }
  368. }
  369. .name {
  370. color: #666;
  371. font-size: 0.28rem;
  372. display: inline-block;
  373. }
  374. .text {
  375. display: inline-block;
  376. color: #333;
  377. font-size: 0.28rem;
  378. &.red {
  379. color: #e6353d;
  380. }
  381. }
  382. .table {
  383. width: 4.93rem;
  384. margin-bottom: 0;
  385. margin-top: 0;
  386. li {
  387. height: 0.43rem;
  388. line-height: 0.43rem;
  389. border-left: .01rem solid #c5c5c5;
  390. font-size: .28rem;
  391. &::after {
  392. clear: both;
  393. display: block;
  394. content: ' ';
  395. visibility: hidden;
  396. zoom: 1;
  397. }
  398. div {
  399. text-align: center;
  400. width: 50%;
  401. float: left;
  402. border-right: .01rem solid #c5c5c5;
  403. border-bottom: .01rem solid #c5c5c5;
  404. }
  405. &:nth-child(odd) {
  406. background: #ddd;
  407. color: #666;
  408. font-size: 0.28rem;
  409. }
  410. &:nth-child(even) {
  411. background: #fcfcfc;
  412. color: #666;
  413. font-size: 0.28rem;
  414. }
  415. &:nth-last-of-type(1){
  416. color: #f31919;
  417. }
  418. &.title {
  419. font-size: 0.28rem;
  420. color: #333;
  421. }
  422. }
  423. }
  424. }
  425. }
  426. .com-info {
  427. line-height: .5rem;
  428. overflow: hidden;
  429. text-overflow: ellipsis;
  430. white-space: nowrap;
  431. font-size:0.28rem;
  432. .name {
  433. color: #666;
  434. }
  435. .can-div-sell {
  436. font-size: 0.18rem;
  437. margin-left: 0.1rem;
  438. display: inline-block;
  439. height: .3rem;
  440. line-height: .3rem;
  441. width: .7rem;
  442. text-align: center;
  443. background: #3f84f6;
  444. color: #fff;
  445. font-weight: bold;
  446. border-radius: 3px;
  447. }
  448. }
  449. .content-line {
  450. border-radius: 5px;
  451. ul {
  452. li {
  453. width: 2rem;
  454. height:0.54rem;
  455. line-height: 0.54rem;
  456. float: left;
  457. margin-right: 0.25rem;
  458. color: #fff;
  459. border-radius: 0.08rem;
  460. font-size: 0;
  461. i {
  462. display: inline-block;
  463. margin-right: 0.04rem;
  464. margin-left: 0.24rem;
  465. &.icon-pdf {
  466. color: #929292;
  467. }
  468. &.active {
  469. color: #eb062b;
  470. }
  471. }
  472. &:nth-last-of-type(1) {
  473. margin-right: 0;
  474. background: #fff;
  475. color: #3f84f6;
  476. border: 1px solid #3f84f6;
  477. }
  478. &:nth-child(1) {
  479. background: #3f84f6;
  480. border: 1px solid #3f84f6;
  481. margin-left: 0.2rem;
  482. }
  483. &:nth-child(2) {
  484. background: #ff6000;
  485. border: 1px solid #ff6000;
  486. }
  487. p {
  488. font-size: 0.28rem;
  489. display: inline-block;
  490. text-align: center;
  491. vertical-align: top;
  492. &.lastOne {
  493. color: #929292;
  494. }
  495. &.active {
  496. color: #3f84f6;
  497. }
  498. }
  499. }
  500. }
  501. }
  502. }
  503. .logo-wrap {
  504. max-height: 5.18rem;
  505. background: #fff;
  506. text-align: center;
  507. margin: 0.2rem;
  508. border: 1px solid #e3e5e8;
  509. img {
  510. /* border: .01rem solid #ccc;*/
  511. max-width: 4.06rem;
  512. max-height: 3.27rem;
  513. margin-top: 0.4rem;
  514. margin-bottom: 0.4rem;
  515. }
  516. div.commodity-infom {
  517. font-size: 0.28rem;
  518. color: #666;
  519. line-height: 1.09rem;
  520. span {
  521. color: #3f84f6;
  522. }
  523. }
  524. }
  525. .params-wrap {
  526. border: 1px solid #e3e5e8;
  527. border-radius: 5px;
  528. margin: 0.2rem;
  529. background: #fff;
  530. padding: 0 0 .29rem;
  531. p {
  532. font-size: .26rem;
  533. text-align: center;
  534. margin-bottom: .24rem;
  535. }
  536. ul {
  537. background: #fff;
  538. font-size: .28rem;
  539. padding: 0 0.24rem;
  540. li {
  541. /*border-bottom: .01rem solid #d9d9d9;*/
  542. span {
  543. /*border-right: .01rem solid #d9d9d9;*/
  544. height: .67rem;
  545. line-height: .67rem;
  546. text-align: center;
  547. /*padding: 0 .15rem;*/
  548. &:first-child {
  549. /*width: 50%;*/
  550. color: #666;
  551. }
  552. &:last-child {
  553. color: #333;
  554. /*width: 50%;*/
  555. /*text-align: left;*/
  556. }
  557. }
  558. }
  559. }
  560. }
  561. .mobile-modal-content {
  562. .clearfix {
  563. padding-left: 1rem;
  564. }
  565. }
  566. .operate-bottom {
  567. height: 1rem;
  568. position: fixed;
  569. background: #fff;
  570. bottom: .98rem;
  571. width: 100%;
  572. border-top: 1px solid #ccc;
  573. > div {
  574. height: 100%;
  575. }
  576. .ob-ope {
  577. /*width: 3.72rem;*/
  578. width: 49.5%;
  579. .item {
  580. width: 33.3%;
  581. text-align: center;
  582. p {
  583. font-size: .24rem;
  584. color: #666;
  585. }
  586. i {
  587. color: #2e2d2c;
  588. font-size: .4rem;
  589. margin: .1rem 0 .04rem;
  590. display: inline-block;
  591. }
  592. &.active {
  593. .icon-pdf {
  594. color: #eb062b;
  595. }
  596. }
  597. }
  598. }
  599. .ob-buy {
  600. width: 50.5%;
  601. button {
  602. width: 50%;
  603. height: 100%;
  604. background: #fff;
  605. border: none;
  606. color: #3f84f6;
  607. &:first-child {
  608. border: 1px solid #3f84f6;
  609. }
  610. &:last-child {
  611. background: #3f84f6;
  612. color: #fff;
  613. }
  614. }
  615. }
  616. }
  617. }
  618. .com-none-state {
  619. padding: .2rem 0;
  620. background: transparent;
  621. b {
  622. color: #3c7cf5;
  623. font-weight: normal;
  624. }
  625. }
  626. </style>