_batchCode.vue 15 KB

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