index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <div class="purchase-layout">
  3. <div class="plate01">
  4. <div class="main-layout">
  5. <!-- <img class="pro" :src="`${$cdn}images/banner_pro.png`" alt=""> -->
  6. <browse
  7. :idata='browdata'
  8. :floder="'probrowse'"
  9. />
  10. <div class="txt-con">
  11. <img class="p-logo" :src="language==='en'?`${$cdn}images/pro-logo-m-en.png`:`${$cdn}images/pro-logo-m.png`" alt="">
  12. <div class="p-price">{{langPurchase.price}}<span class="zdj">{{langPurchase.yushou}}</span></div>
  13. </div>
  14. <div class="attr-con">
  15. <div class="attr">{{langPurchase.color.key}}</div>
  16. <div class="box color">
  17. <i class="iconfont icon-yuandian"><span>{{langPurchase.color.val}}</span></i>
  18. </div>
  19. <div class="attr">{{langPurchase.service.key}}</div>
  20. <div class="box service">
  21. <i class="iconfont icon-yuandian">
  22. <div class="flex-content">
  23. <span>{{langPurchase.service.type}}</span>
  24. <a class="title peijian" @click="$router.push({name:'pricedetail'})">
  25. <img :src="`${$cdn}images/perjian-warn.png`" alt="">
  26. {{$t('mall.knowMore')}}
  27. </a>
  28. </div>
  29. </i>
  30. <!-- <span @click="scrollTo('rlgz')">{{langPurchase.why}}</span> -->
  31. <ul>
  32. <li v-for="(item,i) in langPurchase.service.val" :key="i" v-html="item"></li>
  33. </ul>
  34. </div>
  35. <div class="attr">{{langPurchase.gift.key}}</div>
  36. <div class="box zhijia" :class="{'no-active':!selectParts}" @click="selectParts=!selectParts">
  37. <img :src="`${$cdn}images/tag-icon.png`" class="t-click" alt>
  38. <img :src="`${$cdn}images/zhijia.png`" alt>
  39. <div>
  40. <p class="title1">{{langPurchase.gift.val}}</p>
  41. <p>{{langPurchase.gift.price}}</p>
  42. </div>
  43. </div>
  44. <p class="title peijian" @click="$router.push({name:'purchasezhijia'})">
  45. <img :src="`${$cdn}images/perjian-warn.png`" alt="">
  46. <span>{{$t('mall.knowMore')}}</span>
  47. </p>
  48. <div v-if="language!=='en'" class="attr">{{langPurchase.count.key}}</div>
  49. <spinner v-if="language!=='en'" class="count" @count='handleNum' />
  50. <div class="dec" v-if="language === 'zh'"><h-icon class="gouwuche" type="gouwuche" />{{langPurchase.tiaokuan}}</div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="plate02" ref="jsgg">
  55. <ul class="plate02-type-list">
  56. <li :class="{'is-active': plate02ShowType === 'product'}" @click="plate02ShowType='product'">{{$t('mall.product')}}</li>
  57. <li :class="{'is-active': plate02ShowType === 'tech'}" @click="plate02ShowType='tech'">{{$t('mall.techDetail')}}</li>
  58. </ul>
  59. <div v-show="plate02ShowType === 'product'">
  60. <ul class="desc-video">
  61. <li v-for="item in videoArr" :key="item.name">
  62. <h1 class="common-title" v-html="item.name"></h1>
  63. <div class="player">
  64. <video class="video" controls="controls" playsinline="playsinline" muted="muted" :poster="`${$cdn}images/postv${item.post}.png`">
  65. <source :src="`${$cdn}video/homevideo/v${item.img}.mp4`" type="video/mp4">
  66. </video>
  67. </div>
  68. </li>
  69. </ul>
  70. </div>
  71. <div v-show="plate02ShowType === 'tech'">
  72. <div class="common-title">{{ $t('mall.techDetail') }}</div>
  73. <div class="p2-pramas">
  74. <div v-for="(item,i) in langPurchase.guige.arr" :key="i">
  75. <p class="title">{{item.name}}</p>
  76. <div class="detail" >
  77. <div v-for="(sub,idx) in item.val" v-html="sub" :key="idx">
  78. <!-- <span v-html="sub">* 付款成功后5个工作日内发货,默认顺丰快递包邮</span> -->
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="plate02-white">
  84. <div class="common-title">{{ $t('mall.widthDetail') }}</div>
  85. <div class="p2-imgc">
  86. <img :src="`${$cdn}images/m-paramspro.png`" alt="">
  87. </div>
  88. <p class="small-tip">*{{ $t('mall.smallTip') }}</p>
  89. </div>
  90. </div>
  91. </div>
  92. <!-- <div class="plate03" ref="rlgz">
  93. <div class="p03">
  94. <div class="b-title">{{langPurchase.pricename}}</div>
  95. <priceTable/>
  96. <ul class="price-txt">
  97. <li v-for="(item,i) in langPurchase.pricetxt" :key="i">
  98. <p>{{item.q}}</p>
  99. <p v-html="item.a"></p>
  100. </li>
  101. </ul>
  102. <p class="peijian" @click="$router.push({name:'pricedetail'})">
  103. <img :src="`${$cdn}images/perjian-warn.png`" alt="">
  104. <span style="width:calc(100% - 24px);margin-left:1%;">{{langPurchase.view}}</span>
  105. </p>
  106. </div>
  107. </div> -->
  108. <div class="hover-btns">
  109. <div class="h-price">
  110. {{language!=='en'? `RMB ${totalPrice}`:'USD 1799'}}
  111. </div>
  112. <div class="h-btns">
  113. <span v-if="language!=='en'" @click="addcart">加入购物车</span>
  114. <span class="primary" @click="tobuy">{{langPurchase.buy}}</span>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { mapState } from 'vuex'
  121. import spinner from '@/components/spinner'
  122. import priceTable from '@/components/priceTable'
  123. import browse from '@/components/browse'
  124. import { getPosition } from '@/util'
  125. import mallConfig from '@/../../common/mall/mall'
  126. import { i18n } from '@/lang'
  127. export default {
  128. components: {
  129. spinner,
  130. browse,
  131. priceTable
  132. },
  133. computed: {
  134. ...mapState({
  135. token: state => state.user.token,
  136. language: state => state.language.current,
  137. langPurchase: state => state.language.home.purchase
  138. }),
  139. totalPrice () {
  140. return mallConfig.price * this.count + (this.selectParts ? mallConfig.zhijiaPrice * this.count : 0)
  141. }
  142. },
  143. data () {
  144. let browdata = [
  145. {
  146. small: 'small-0',
  147. big: 'big-0',
  148. video: 'pro-post'
  149. }, {
  150. small: 'small-1',
  151. big: 'big-1'
  152. },
  153. {
  154. small: 'small-2',
  155. big: 'big-2'
  156. },
  157. {
  158. small: 'small-3',
  159. big: 'big-3'
  160. }]
  161. return {
  162. plate02ShowType: 'product',
  163. mallConfig,
  164. count: 1,
  165. browdata,
  166. selectParts: true,
  167. techData: [
  168. {
  169. label: '机身尺寸',
  170. desc: [`高度:220.7mm / 宽度:78.2mm / 厚度:78.2mm`]
  171. },
  172. {
  173. label: '分辨率',
  174. desc: [`4608*3456像素(每个);8192*4096像素(合计)`]
  175. },
  176. {
  177. label: '存储内存',
  178. desc: ['16GB']
  179. },
  180. {
  181. label: 'WiFi',
  182. desc: ['802.11a/b/g/n网络协议 / ', '支持2.4/5GHz通信']
  183. },
  184. {
  185. label: '镜头',
  186. desc: [`类型:200°鱼眼镜头 孔径:f/2.0 数量:8个`]
  187. },
  188. {
  189. label: '传感器',
  190. desc: [`范围:1/2.3英寸 数量:8个`]
  191. },
  192. {
  193. label: '电池',
  194. desc: ['7.4V 4200mAh / 可通过USB快速充电']
  195. },
  196. {
  197. label: '设备接口',
  198. desc: ['TYPE-C']
  199. }
  200. ],
  201. videoArr: [
  202. {
  203. name: i18n.t('conduct.coreProduct.itemTitle1'),
  204. img: 1,
  205. post: 1,
  206. runAnimation: true
  207. },
  208. {
  209. name: i18n.t('conduct.coreProduct.itemTitle2'),
  210. img: 2,
  211. post: 2,
  212. runAnimation: true
  213. },
  214. {
  215. name: i18n.t('conduct.coreProduct.itemTitle4'),
  216. img: 6,
  217. post: 6,
  218. runAnimation: true
  219. },
  220. {
  221. name: i18n.t('conduct.coreProduct.itemTitle5'),
  222. img: 3,
  223. post: 3,
  224. runAnimation: true
  225. },
  226. {
  227. name: i18n.t('conduct.coreProduct.itemTitle6'),
  228. img: 4,
  229. post: 4,
  230. runAnimation: true
  231. },
  232. {
  233. name: i18n.t('conduct.coreProduct.itemTitle7'),
  234. img: 5,
  235. post: 5,
  236. runAnimation: true
  237. }
  238. ]
  239. }
  240. },
  241. methods: {
  242. handleNum (data) {
  243. this.count = data
  244. },
  245. async addcart () {
  246. if (!this.token) {
  247. return this.$router.push({path: '/login'})
  248. }
  249. let params = {
  250. goodsId: 4,
  251. goodsCount: this.count,
  252. skuSn: mallConfig.goodsMap[4].skuSn
  253. }
  254. let zhijia = {
  255. goodsId: 7,
  256. goodsCount: this.count,
  257. skuSn: mallConfig.goodsMap[7].skuSn
  258. }
  259. await this.$store.dispatch('addCart', params)
  260. this.selectParts && await this.$store.dispatch('addCart', zhijia)
  261. this.$toast.showAddCart('success', '商品加入购物车成功', '前往购物车', () => {
  262. this.$router.push({path: '/cart'})
  263. })
  264. },
  265. async tobuy () {
  266. if (this.language === 'en') {
  267. window.location.href = 'https://www.alibaba.com/product-detail/4DKanKan-Pro-3D-camera-3D-space_62183626283.html?spm=a2700.icbuShop.74.1.66b35b10I4miJd'
  268. return
  269. }
  270. if (!this.token) {
  271. return this.$router.push({path: '/login'})
  272. }
  273. let params = {
  274. goodsId: 4,
  275. price: mallConfig.price,
  276. goodsCount: this.count,
  277. skuSn: mallConfig.goodsMap[4].skuSn
  278. }
  279. let zhijia = {
  280. goodsId: 7,
  281. goodsCount: this.count,
  282. price: mallConfig.zhijiaPrice,
  283. skuSn: mallConfig.goodsMap[7].skuSn
  284. }
  285. let tmpcart = []
  286. let temp = {}
  287. tmpcart.push(params)
  288. this.selectParts && tmpcart.push(zhijia)
  289. temp['goods'] = tmpcart
  290. this.$store.commit('PAYINFO', temp)
  291. this.$router.push({path: '/vieworder'})
  292. },
  293. scrollTo (href) {
  294. this.interval = null
  295. let inter = 0
  296. let tag = getPosition(this.$refs[href]).y - 80
  297. let speed = Math.ceil(tag / 40)
  298. this.interval = setInterval(() => {
  299. window.scrollTo(0, inter)
  300. inter += speed
  301. if ((window.scrollY || window.pageYOffset) >= tag) {
  302. clearInterval(this.interval)
  303. }
  304. })
  305. }
  306. }
  307. }
  308. </script>
  309. <style lang="scss" scoped>
  310. @import './style.scss';
  311. .plate01{
  312. .top{
  313. height: 60px;
  314. padding-top: 20px;
  315. text-align: right;
  316. span{
  317. padding-right: 5%;
  318. font-size: 14px;
  319. color: rgba(0, 0, 0, 0.7);
  320. line-height: 18px;
  321. font-weight: bold;
  322. }
  323. }
  324. .main-layout{
  325. width: 100%;
  326. text-align: center;
  327. .pro{
  328. width: 20%;
  329. margin: 40px auto;
  330. }
  331. .txt-con{
  332. width: 90%;
  333. margin: 0 auto;
  334. text-align: left;
  335. padding: 16px 0 !important;
  336. .p-title{
  337. font-size: 20px;
  338. color: #202020;
  339. line-height: 24px;
  340. font-weight: 700;
  341. }
  342. .p-logo{
  343. width: 165px;
  344. margin-bottom: 8px;
  345. }
  346. .p-label{
  347. font-size: 12px;
  348. color: #202020;
  349. line-height: 16px;
  350. }
  351. .p-price{
  352. margin-top: 10px;
  353. font-size: 20px;
  354. line-height: 1;
  355. color: #202020;
  356. font-weight: 700;
  357. .zdj{
  358. font-size: 16px;
  359. color: #1fe4dc;
  360. }
  361. }
  362. }
  363. .attr-con{
  364. text-align: left;
  365. width: 90%;
  366. margin: 0 auto;
  367. padding: 0 0 40px;
  368. .icon-yuandian{
  369. font-size: 12px !important;
  370. span {
  371. margin-left: 8px;
  372. color: #202020 !important;
  373. }
  374. }
  375. .attr{
  376. font-size: 12px;
  377. color: #202020;
  378. line-height: 18px;
  379. font-weight: bold;
  380. margin: 12px 0 8px;
  381. }
  382. .box{
  383. display: inline-block;
  384. color: rgba(0,0,0,.45);
  385. padding: 0 63px;
  386. box-sizing: border-box;
  387. position: relative;
  388. text-align: left;
  389. .t-click{
  390. position: absolute;
  391. right: 0;
  392. bottom: 0;
  393. margin: 0;
  394. width: 16px;
  395. height: 16px;
  396. padding: 0;
  397. }
  398. }
  399. .color{
  400. width: 100%;
  401. padding: 0;
  402. font-size: 14px;
  403. color: #202020;
  404. font-weight: bold;
  405. }
  406. .service{
  407. width: 100%;
  408. display: inline-block;
  409. padding: 0;
  410. .icon-yuandian{
  411. font-size: 14px;
  412. color: rgba(0, 0, 0, 0.7);
  413. font-weight: bold;
  414. display: flex;
  415. a {
  416. color: #486ACE !important;
  417. line-height: 18px;
  418. margin-top: 0;
  419. img {
  420. vertical-align: middle;
  421. margin-top: -2px;
  422. }
  423. }
  424. }
  425. .flex-content {
  426. display: flex;
  427. justify-content: space-between;
  428. min-width: 271px;
  429. }
  430. ul{
  431. padding: 6px 10px 0 15px;
  432. display: inline-block;
  433. width: 100%;
  434. vertical-align: top;
  435. li{
  436. font-size: 12px;
  437. line-height: 18px;
  438. position: relative;
  439. color: #909090;
  440. &::before{
  441. content: '';
  442. width: 3px;
  443. height: 3px;
  444. border-radius: 50%;
  445. display: inline-block;
  446. position: absolute;
  447. left: -10px;
  448. top: 8px;
  449. background-color: rgba(0,0,0,.45);
  450. }
  451. }
  452. }
  453. span{
  454. color: #1fe4dc;
  455. font-weight: bold;
  456. cursor: pointer;
  457. margin-left: 2%;
  458. }
  459. }
  460. .zhijia{
  461. padding: 0;
  462. text-align: left;
  463. width: 100%;
  464. border: 1px solid #70eee9;
  465. padding-left: 22px;
  466. >div{
  467. display: inline-block;
  468. vertical-align: middle;
  469. }
  470. p{
  471. line-height: 18px;
  472. text-align: left;
  473. color: #202020;
  474. }
  475. }
  476. .peijian{
  477. vertical-align: middle;
  478. margin-top: 10px;
  479. color: #486ace;
  480. font-size: 12px;
  481. cursor: pointer;
  482. font-weight: normal;
  483. img{
  484. vertical-align: middle;
  485. width: 14px;
  486. height: 14px;
  487. }
  488. span{
  489. display: inline-block;
  490. vertical-align: middle;
  491. }
  492. }
  493. .count{
  494. margin: 0;
  495. }
  496. .no-active{
  497. border: 1px solid #e3e3e3;
  498. background-color: #fff;
  499. .t-click{
  500. display: none;
  501. }
  502. }
  503. .btn{
  504. cursor: pointer;
  505. width: 100%;
  506. height: 50px;
  507. margin-top: 35px;
  508. line-height: 50px;
  509. color: #414141;
  510. font-size: 14px;
  511. background-color: #1fe4dc;
  512. display: inline-block;
  513. text-align: center;
  514. }
  515. .dec{
  516. color: #909090;
  517. font-size: 12px;
  518. display: flex;
  519. align-items: center;
  520. text-align: left;
  521. margin-top: 12px;
  522. .gouwuche {
  523. font-size: 18px;
  524. margin-right: 5px;
  525. }
  526. }
  527. }
  528. }
  529. }
  530. </style>