_batchCode.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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" @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="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)" 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>
  115. <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>
  116. <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>
  117. <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>
  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. console.log(this.component)
  190. if (url && url !== '1') {
  191. // console.log(url)
  192. window.open(url)
  193. // window.location.href = url
  194. } else {
  195. if (!url) {
  196. this.onRemind('该产品暂无数据手册')
  197. } else {
  198. this.onRemind('数据手册地址错误')
  199. }
  200. }
  201. } else {
  202. this.url = this.$route.fullPath
  203. this.showLoginBox = true
  204. }
  205. },
  206. collectStore: function () {
  207. if (this.user.logged) {
  208. if (!this.isFocus) {
  209. this.$store.dispatch('shop/StoreFocus', {storeName: this.storeInfo.storeName, storeid: this.storeInfo.id})
  210. .then(response => {
  211. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  212. this.onRemind('关注成功')
  213. })
  214. } else {
  215. this.$http.post('/trade/storeFocus/delete/storeId', [this.storeInfo.id])
  216. .then(response => {
  217. this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
  218. this.onRemind('取消成功')
  219. })
  220. }
  221. } else {
  222. this.url = this.$route.fullPath
  223. this.showLoginBox = true
  224. }
  225. },
  226. onRemind: function (str) {
  227. this.remindText = str
  228. this.remindCount++
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .commodity-detail {
  235. background: #f1f3f6;
  236. padding-bottom: 1rem;
  237. margin-bottom: 1.2rem;
  238. .wrap-title {
  239. color: #333;
  240. font-size: 0.28rem;
  241. border-bottom: 1px solid #d3d3d3;
  242. height: 0.5rem;
  243. text-align: left;
  244. padding: 0 0 0.1rem 0.05rem;
  245. margin: 0.17rem 0.25rem 0.13rem 0.25rem;
  246. line-height: 0.5rem;
  247. .line{
  248. width: 0.05rem;
  249. background: #3f84f6;
  250. display: inline-block;
  251. vertical-align: top;
  252. margin-right: 0.08rem;
  253. height: 0.28rem;
  254. margin-top: 0.09rem;
  255. }
  256. }
  257. .product-info {
  258. position: relative;
  259. background: #fff;
  260. margin: 0.2rem;
  261. border: 1px solid #e3e5e8;
  262. padding-bottom: 0.2rem;
  263. .focus-wrap {
  264. text-indent: 0.28rem;
  265. position: absolute;
  266. background-image: url('/images/mobile/product/productdetail_label.png');
  267. width: 0.93rem;
  268. height: 1.27rem;
  269. background-size: 100% 100%;
  270. font-size: 0.24rem;
  271. color: #666;
  272. right: 0px;
  273. top: 0px;
  274. i {
  275. color: #cacaca;
  276. }
  277. &.active {
  278. i {color: rgb(255, 120, 0);}
  279. }
  280. }
  281. .middle {
  282. border-radius: 5px;
  283. padding: 0.24rem 0.24rem 0px;
  284. background: #fff;
  285. .pms {
  286. color: #f57710;
  287. border: 1px solid #f57710;
  288. border-radius: 0.4rem;
  289. background: #fff;
  290. font-size: 0.24rem;
  291. height: 0.4rem;
  292. line-height: 0.4rem;
  293. width: 0.8rem;
  294. text-align: center;
  295. }
  296. .list {
  297. overflow: hidden;
  298. text-overflow: ellipsis;
  299. white-space: nowrap;
  300. .left {
  301. float: left;
  302. overflow: hidden;
  303. text-overflow: ellipsis;
  304. white-space: nowrap;
  305. }
  306. .textinfo {
  307. color: #0067e7;
  308. font-size: 0.28rem;
  309. }
  310. .button {
  311. font-size: 0.28rem;
  312. color: #1a58dd;
  313. width: 0.92rem;
  314. text-align: center;
  315. border-radius: 5px;
  316. border:1px solid #1a58dd;
  317. display: inline-block;
  318. margin-right: 0.2rem;
  319. }
  320. margin-bottom: 0.18rem;
  321. &::after{
  322. clear: both;
  323. display: block;
  324. content: ' ';
  325. visibility: hidden;
  326. zoom: 1;
  327. }
  328. .fl {
  329. width: 3.8rem;
  330. float: left;
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. white-space: nowrap;
  334. }
  335. .fr {
  336. text-align: left;
  337. width: 2rem;
  338. overflow: hidden;
  339. text-overflow: ellipsis;
  340. white-space: nowrap;
  341. }
  342. &.list-long {
  343. .fl {
  344. width: 100% !important;
  345. }
  346. }
  347. .name {
  348. color: #666;
  349. font-size: 0.3rem;
  350. display: inline-block;
  351. }
  352. .text {
  353. display: inline-block;
  354. color: #333;
  355. font-size: 0.28rem;
  356. &.red {
  357. color: #e6353d;
  358. }
  359. }
  360. .table {
  361. width: 4.93rem;
  362. margin-bottom: 0;
  363. margin-top: 0;
  364. li {
  365. height: 0.43rem;
  366. line-height: 0.43rem;
  367. border-left: .01rem solid #c5c5c5;
  368. font-size: .28rem;
  369. &::after {
  370. clear: both;
  371. display: block;
  372. content: ' ';
  373. visibility: hidden;
  374. zoom: 1;
  375. }
  376. div {
  377. text-align: center;
  378. width: 50%;
  379. float: left;
  380. border-right: .01rem solid #c5c5c5;
  381. border-bottom: .01rem solid #c5c5c5;
  382. }
  383. &:nth-child(odd) {
  384. background: #ddd;
  385. color: #666;
  386. font-size: 0.28rem;
  387. }
  388. &:nth-child(even) {
  389. background: #fcfcfc;
  390. color: #666;
  391. font-size: 0.28rem;
  392. }
  393. &:nth-last-of-type(1){
  394. color: #f31919;
  395. }
  396. &.title {
  397. font-size: 0.28rem;
  398. color: #333;
  399. }
  400. }
  401. }
  402. }
  403. }
  404. .com-info {
  405. line-height: .5rem;
  406. overflow: hidden;
  407. text-overflow: ellipsis;
  408. white-space: nowrap;
  409. font-size:0.28rem;
  410. .name {
  411. color: #666;
  412. }
  413. .can-div-sell {
  414. font-size: 0.18rem;
  415. margin-left: 0.1rem;
  416. display: inline-block;
  417. height: .3rem;
  418. line-height: .3rem;
  419. width: .7rem;
  420. text-align: center;
  421. background: #3f84f6;
  422. color: #fff;
  423. font-weight: bold;
  424. border-radius: 3px;
  425. }
  426. }
  427. .content-line {
  428. border-radius: 5px;
  429. ul {
  430. li {
  431. width: 2rem;
  432. height:0.54rem;
  433. line-height: 0.54rem;
  434. float: left;
  435. margin-right: 0.25rem;
  436. color: #fff;
  437. border-radius: 0.08rem;
  438. font-size: 0;
  439. i {
  440. display: inline-block;
  441. margin-right: 0.04rem;
  442. margin-left: 0.24rem;
  443. &.icon-pdf {
  444. color: #929292;
  445. }
  446. &.active {
  447. color: #eb062b;
  448. }
  449. }
  450. &:nth-last-of-type(1) {
  451. margin-right: 0;
  452. background: #fff;
  453. color: #3f84f6;
  454. border: 1px solid #3f84f6;
  455. }
  456. &:nth-child(1) {
  457. background: #3f84f6;
  458. border: 1px solid #3f84f6;
  459. margin-left: 0.2rem;
  460. }
  461. &:nth-child(2) {
  462. background: #ff6000;
  463. border: 1px solid #ff6000;
  464. }
  465. p {
  466. font-size: 0.28rem;
  467. display: inline-block;
  468. text-align: center;
  469. vertical-align: top;
  470. &.lastOne {
  471. color: #929292;
  472. }
  473. &.active {
  474. color: #3f84f6;
  475. }
  476. }
  477. }
  478. }
  479. }
  480. }
  481. .logo-wrap {
  482. max-height: 5.18rem;
  483. background: #fff;
  484. text-align: center;
  485. margin: 0.2rem;
  486. border: 1px solid #e3e5e8;
  487. img {
  488. /* border: .01rem solid #ccc;*/
  489. max-width: 4.06rem;
  490. max-height: 3.27rem;
  491. margin-top: 0.4rem;
  492. margin-bottom: 0.4rem;
  493. }
  494. div.commodity-infom {
  495. font-size: 0.28rem;
  496. color: #666;
  497. line-height: 1.09rem;
  498. span {
  499. color: #3f84f6;
  500. }
  501. }
  502. }
  503. .params-wrap {
  504. border: 1px solid #e3e5e8;
  505. border-radius: 5px;
  506. margin: 0.2rem;
  507. background: #fff;
  508. padding: 0 0 .29rem;
  509. p {
  510. font-size: .26rem;
  511. text-align: center;
  512. margin-bottom: .24rem;
  513. }
  514. ul {
  515. background: #fff;
  516. font-size: .28rem;
  517. padding: 0 0.24rem;
  518. li {
  519. /*border-bottom: .01rem solid #d9d9d9;*/
  520. span {
  521. /*border-right: .01rem solid #d9d9d9;*/
  522. height: .67rem;
  523. line-height: .67rem;
  524. text-align: center;
  525. /*padding: 0 .15rem;*/
  526. &:first-child {
  527. /*width: 50%;*/
  528. color: #666;
  529. }
  530. &:last-child {
  531. color: #333;
  532. /*width: 50%;*/
  533. /*text-align: left;*/
  534. }
  535. }
  536. }
  537. }
  538. }
  539. .mobile-modal-content {
  540. .clearfix {
  541. padding-left: 1rem;
  542. }
  543. }
  544. }
  545. .com-none-state {
  546. padding: .2rem 0;
  547. background: transparent;
  548. b {
  549. color: #3c7cf5;
  550. font-weight: normal;
  551. }
  552. }
  553. </style>