_batchCode.vue 16 KB

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