_batchCode.vue 18 KB

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