video.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <app-layout>
  3. <view class="page" :style="{ height: height }">
  4. <view class="swiper" :style="containerStyle">
  5. <block v-for="(item, index) in videoList" :key="index">
  6. <video-new
  7. class="video"
  8. :video_id="item.video_id"
  9. :video_url="item.video_url"
  10. :height="height"
  11. :width="width"
  12. :play="item.flag"
  13. :cur_index="cur_index"
  14. :style="{ height: height, width: width }"
  15. ></video-new>
  16. </block>
  17. </view>
  18. <view class="close" @click.stop="close">
  19. <image class="image" src="/static/image/icon/video-close.png"></image>
  20. </view>
  21. <view
  22. class="cover-view-marks"
  23. :style="{ height: height, width: width }"
  24. @click.stop="clickVideo"
  25. @touchmove="ListTouchMove"
  26. @touchend.stop="ListTouchEnd"
  27. @touchstart="ListTouchStart"
  28. >
  29. </view>
  30. <view class="operating ">
  31. <view class="dir-left-nowrap cross-bottom">
  32. <view class="left dir-left-nowrap main-between">
  33. <view class="up-down-goods">
  34. <view class="item" @click="previous">上一件商品</view>
  35. <view class="item down" @click="next">下一件商品</view>
  36. </view>
  37. <view class="goods-list">
  38. <view class="scroll" :style="{bottom: (getEmpty+157) + 'rpx'}" v-show="goodBool">
  39. <view class="scroll-view">
  40. <view class="item-good dir-left-nowrap" @click="routeGo(goods_list[cur_index].page_url)">
  41. <view class="image-view cover-pic">
  42. <image class="cover-pic " :src="goods_list[cur_index].cover_pic"></image>
  43. <view>视频同款</view>
  44. </view>
  45. <view class="content dir-top-nowrap main-between">
  46. <view class="name t-omit-two">{{goods_list[cur_index].name}}</view>
  47. <view class="pri-but dir-left-nowrap main-between cross-bottom">
  48. <view>
  49. <view class="dir-left-nowrap">
  50. <!-- 会员价 -->
  51. <view class="member-price" v-if="goods_list[cur_index].is_level == 1 && goods_list[cur_index].is_negotiable != 1">
  52. <app-member-price
  53. :price="goods_list[cur_index].level_price"
  54. ></app-member-price>
  55. </view>
  56. <!-- 超级会员卡 -->
  57. <view class="app-sup-vip" v-if="goods_list[cur_index].vip_card_appoint.discount > 0">
  58. <app-sup-vip
  59. :discount="goods_list[cur_index].vip_card_appoint.discount"
  60. :is_vip_card_user="goods_list[cur_index].vip_card_appoint.is_vip_card_user"
  61. ></app-sup-vip>
  62. </view>
  63. </view>
  64. <view class="pri">
  65. <text class="price">{{goods_list[cur_index].price_content}}</text>
  66. <text class="original">¥{{goods_list[cur_index].original_price}}</text>
  67. </view>
  68. </view>
  69. <view class="button" @click.stop="specification(goods_list[cur_index])"></view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="triangle"></view>
  75. </view>
  76. <image class="image" src="/static/image/video-goods.png" @click="goodBool = !goodBool"></image>
  77. </view>
  78. </view>
  79. <view class="right dir-left-nowrap">
  80. <view class="but index" @click.stop="routeGo('/pages/index/index')">
  81. <view class="icon">
  82. <image class="image" src="/static/image/icon/video-index.png"></image>
  83. </view>
  84. <text>首页</text>
  85. </view>
  86. <view class="but cart" @click.stop="specification(goods_list[cur_index])">
  87. <view class="icon">
  88. <image class="image" src="/pages/goods/image/video-card.png"></image>
  89. </view>
  90. <text>加购</text>
  91. </view>
  92. <view class="but" >
  93. <view class="icon">
  94. <image class="image" src="/static/image/icon/video-share.png"></image>
  95. </view>
  96. <text>分享</text>
  97. <button class="share" open-type="share">
  98. </button>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="empty" :style="{'height': getEmpty+'rpx'} ">
  103. </view>
  104. </view>
  105. <view class="attr">
  106. <app-attr ref="attr"
  107. :goods="item"
  108. :select-attr="selectAttr"
  109. :attr-group-list="attrGroup"
  110. :show="show"
  111. :cartShow="cartShow"
  112. :buyText="buyText"
  113. :buyClick="buyBool"
  114. :plugin="plugin"
  115. :previewUrl="previewUrl"
  116. :submitUrl="submitUrl"
  117. @buyClick="buyClick"
  118. @attrtap="onAttr"
  119. @attr="attr"
  120. >
  121. <view slot="extra" v-if="sign === 'pintuan'">
  122. <app-pt-attr
  123. v-if="pt"
  124. :pintuan_groups="item.pintuan_groups"
  125. :selectGroupAttrId="selectGroupAttrId"
  126. @click="setGroupAttrID"
  127. ></app-pt-attr>
  128. </view>
  129. </app-attr>
  130. </view>
  131. <view v-if="sign === 'pintuan' && show_pt">
  132. <app-iphone-x>
  133. <view class="pintuan dir-left-nowrap" slot="empty-area">
  134. <view class="single box-grow-1 dir-top-nowrap" @click="individual" v-if="item">
  135. <text class="app-text">单独购买</text>
  136. </view>
  137. <view class="tuan box-grow-1 dir-top-nowrap" @click="multiplayer">
  138. <text class="app-text">拼团</text>
  139. </view>
  140. </view>
  141. </app-iphone-x>
  142. </view>
  143. </view>
  144. </app-layout>
  145. </template>
  146. <script>
  147. import {mapGetters} from 'vuex';
  148. import videoNew from '../../components/page-component/goods/app-goods-video.vue';
  149. import appMemberPrice from '../../components/page-component/app-member-mark/app-member-price.vue';
  150. import appSupVip from '../../components/page-component/app-sup-vip/app-sup-vip.vue';
  151. import appAttr from '../../components/page-component/app-attr/app-attr.vue';
  152. import appIphoneX from '../../components/basic-component/app-iphone-x/app-iphone-x.vue';
  153. import appPtAttr from '../../components/page-component/app-pt-attr/app-pt-attr.vue';
  154. import allPay from './all-pay.js';
  155. export default {
  156. components: {
  157. videoNew,
  158. appPtAttr,
  159. 'app-member-price': appMemberPrice,
  160. 'app-sup-vip': appSupVip,
  161. 'app-attr': appAttr,
  162. 'app-iphone-x': appIphoneX,
  163. },
  164. data() {
  165. return {
  166. buyText: '立即购买',
  167. sign: '',
  168. cartShow: 1,
  169. plugin: '',
  170. buyBool: false,
  171. previewUrl: '',
  172. submitUrl: '',
  173. show_pt: false,
  174. pt: true,
  175. selectGroupAttrId: -1,
  176. pintuan_groups:[],
  177. appAttr: {},
  178. translateX: '10',
  179. height: '667px',
  180. cur_index: null,
  181. width: '',
  182. sysheight: 0,
  183. containerStyle: 'transform:translateY(0px)',
  184. distance: 0,
  185. listTouchStartY: 0,
  186. listTouchDirection: null,
  187. scroll: false,
  188. videoList: [],
  189. clicktime:0,
  190. goodBool: false,
  191. goods_list: [],
  192. page: 1,
  193. goods_id: 0,
  194. show: 0,
  195. item: null,
  196. selectAttr: {},
  197. attrGroup: [],
  198. ne: 0,
  199. pre: 0,
  200. };
  201. },
  202. computed: {
  203. ...mapGetters('iPhoneX', {
  204. getEmpty: 'getEmpty'
  205. }),
  206. },
  207. onLoad(options) {
  208. this.goods_id = options.goods_id;
  209. this.sign = options.sign;
  210. switch (this.sign) {
  211. case "advance":
  212. this.cartShow = 0;
  213. this.buyText = '支付定金';
  214. this.buyBool = true;
  215. break;
  216. case "booking":
  217. this.cartShow = 0;
  218. this.buyText = '立即预约';
  219. this.plugin = 'booking';
  220. this.submitUrl = this.$api.book.order_submit;
  221. this.previewUrl = this.$api.book.order_preview;
  222. break;
  223. case "miaosha":
  224. this.submitUrl = this.$api.miaosha.order_submit;
  225. this.previewUrl = this.$api.miaosha.order_preview;
  226. break;
  227. case "pintuan":
  228. this.$request({
  229. url: this.$api.pt.detail,
  230. data: {
  231. id: this.goods_id,
  232. group_id: 0,
  233. }
  234. }).then((res) => {
  235. this.item = res.data.detail;
  236. this.selectGroupAttrId = this.item.pintuan_groups[0].id;
  237. });
  238. break;
  239. case "integral_mall":
  240. this.cartShow = 0;
  241. this.buyText = '立即兑换';
  242. this.submitUrl = this.$api.integral_mall.order_submit;
  243. this.previewUrl = this.$api.integral_mall.order_preview;
  244. break;
  245. case "step":
  246. this.cartShow = 0;
  247. this.buyText = '立即兑换';
  248. this.submitUrl = this.$api.step.order_submit;
  249. this.previewUrl = this.$api.step.order_preview;
  250. break;
  251. case "gift":
  252. this.cartShow = 0;
  253. this.buyBool = true;
  254. this.buyText = '加入礼包';
  255. break;
  256. case "mch":
  257. this.submitUrl = this.$api.mch.order_submit;
  258. this.previewUrl = this.$api.mch.order_preview;
  259. break;
  260. default:
  261. break;
  262. }
  263. this.getVideo(options.goods_id);
  264. let res = uni.getSystemInfoSync();
  265. this.height = `${res.windowHeight}px`;
  266. this.width = `${res.windowWidth}px`;
  267. this.sysheight = res.windowHeight;
  268. },
  269. onHide() {
  270. this.videoCtx = uni.createVideoContext(`video_${this.videoList[this.cur_index].video_id}`, this);
  271. this.videoCtx.pause();
  272. },
  273. onShow() {
  274. if (this.cur_index !== null && this.videoList[this.cur_index].flag) {
  275. this.videoCtx = uni.createVideoContext(`video_${this.videoList[this.cur_index].video_id}`, this);
  276. this.videoCtx.play();
  277. }
  278. },
  279. methods: {
  280. buyClick(data) {
  281. allPay(data, this.sign, this, this.goods_list[this.cur_index]);
  282. console.log(data);
  283. },
  284. submit() {
  285. let goods = this.item;
  286. let number = this.appAttr.number;
  287. let select_attr = this.selectAttr;
  288. if (!select_attr) {
  289. uni.showModal({
  290. title: '提示',
  291. content: '请先选择规格',
  292. showCancel: false
  293. });
  294. return false;
  295. }
  296. if (number <= 0) {
  297. uni.showModal({
  298. title: '提示',
  299. content: '商品数量不能为0',
  300. showCancel: false
  301. });
  302. return false;
  303. }
  304. if (!goods) {
  305. return false;
  306. }
  307. return true;
  308. },
  309. onAttr(data) {
  310. this.selectAttr = data;
  311. },
  312. specification(goods) {
  313. this.attrGroup = goods.attr_groups;
  314. this.show = Math.random();
  315. if (this.sign === 'pintuan') {
  316. this.show_pt = true;
  317. this.request_pt(this.selectGroupAttrId);
  318. } else {
  319. this.item = goods;
  320. }
  321. },
  322. setGroupAttrID(id) {
  323. this.selectGroupAttrId = id;
  324. this.selectAttr = {};
  325. this.request_pt(id);
  326. },
  327. attr(data) {
  328. this.appAttr = data;
  329. console.log(data);
  330. },
  331. buy() {
  332. if (!this.submit()) {
  333. return false;
  334. }
  335. let goods = this.item;
  336. let number = this.appAttr.number;
  337. let select_attr = this.selectAttr;
  338. let goods_attr_id = select_attr.id;
  339. let attr = [];
  340. for (let i in select_attr.attr_list) {
  341. attr.push({
  342. attr_id: select_attr.attr_list[i].attr_id,
  343. attr_group_id: select_attr.attr_list[i].attr_group_id,
  344. });
  345. }
  346. let mch_list = [];
  347. let mch = {
  348. mch_id: goods.mch_id ? goods.mch_id : 0,
  349. goods_list: []
  350. };
  351. mch.goods_list.push({
  352. id: goods.id,
  353. attr: attr,
  354. num: number,
  355. cat_id: 0,
  356. goods_attr_id: goods_attr_id
  357. });
  358. mch_list.push(mch);
  359. uni.navigateTo({
  360. url: '/pages/order-submit/order-submit?mch_list=' + JSON.stringify(mch_list),
  361. })
  362. },
  363. individual() {
  364. if (this.pt) {
  365. this.pt = false;
  366. this.selectAttr = {};
  367. this.request_pt(0);
  368. } else {
  369. if (Object.keys(this.selectAttr).length === 0) {
  370. uni.showToast({
  371. title: '请选择规格',
  372. icon: "none"
  373. })
  374. } else {
  375. this.buy();
  376. }
  377. console.log(this.selectAttr);
  378. }
  379. },
  380. multiplayer() {
  381. if (this.pt) {
  382. if (this.selectAttr && Object.keys(this.selectAttr).length === 0) {
  383. uni.showToast({
  384. title: '请选择规格',
  385. icon: "none"
  386. })
  387. } else if (this.selectAttr && Object.keys(this.selectAttr).length > 0) {
  388. console.log(this.selectAttr);
  389. let mch_id = this.item.mch_id;
  390. let mch_list = [];
  391. let goods = {
  392. id: this.item.id,
  393. attr: [],
  394. num: this.appAttr.number,
  395. goods_attr_id: this.selectAttr.id,
  396. cart_id: 0,
  397. };
  398. for (let i = 0; i < this.selectAttr.attr_list.length; i++) {
  399. let attr = {
  400. attr_id: this.selectAttr.attr_list[i].attr_id,
  401. attr_group_id: this.selectAttr.attr_list[i].attr_group_id,
  402. };
  403. goods.attr.push(attr);
  404. }
  405. mch_list.push({
  406. mch_id: mch_id,
  407. pintuan_order_id: 0,
  408. pintuan_group_id: this.selectGroupAttrId,
  409. goods_list: [goods],
  410. });
  411. console.log(mch_list);
  412. uni.navigateTo({
  413. url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify(mch_list)}&preview_url=${encodeURIComponent(this.$api.pt.order_preview)}&submit_url=${encodeURIComponent(this.$api.pt.order_submit)}&order_page_url=/plugins/pt/order/order&plugin=pt`
  414. });
  415. }
  416. } else {
  417. this.selectAttr = {};
  418. this.pt = true;
  419. this.request_pt(this.selectGroupAttrId);
  420. }
  421. },
  422. async request_pt(group_id) {
  423. try {
  424. const response = await this.$request({
  425. url: this.$api.pt.detail,
  426. data: {
  427. id: this.goods_id,
  428. group_id: group_id,
  429. }
  430. });
  431. if (response.code === 0) {
  432. this.item = response.data.detail;
  433. }
  434. } catch(e) {
  435. throw new Error(e);
  436. }
  437. },
  438. async getVideo() {
  439. const res = await this.$request({
  440. url: this.$api.goods.goods_video_list,
  441. method: 'get',
  442. data: {
  443. goodsId: this.goods_id,
  444. page: this.page,
  445. limit: 3
  446. }
  447. });
  448. if (res.code === 0) {
  449. let data = res.data.list;
  450. for (let item of data) {
  451. this.videoList.push({
  452. video_id: item.id,
  453. video_url: item.video_url,
  454. flag: false,
  455. });
  456. this.goods_list.push(item);
  457. }
  458. if (this.cur_index == null) this.cur_index = 0;
  459. this.$nextTick().then(() => {
  460. this.videoList[this.cur_index].flag = true;
  461. this.videoCtx = uni.createVideoContext(`video_${this.videoList[this.cur_index].video_id}`, this);
  462. this.videoCtx.play();
  463. });
  464. }
  465. },
  466. routeGo(data) {
  467. uni.navigateTo({
  468. url: data,
  469. })
  470. },
  471. close() {
  472. uni.redirectTo({
  473. url: this.goods_list[this.cur_index].page_url,
  474. });
  475. },
  476. lower() {
  477. console.log(1);
  478. },
  479. clickVideo(e) {
  480. this.goodBool = false;
  481. if(this.clicktime > 0 && e.timeStamp - this.clicktime < 200){
  482. clearTimeout(this.han);
  483. }else{
  484. let _this = this;
  485. this.han = setTimeout(function() {
  486. _this.videoList[_this.cur_index].flag = !_this.videoList[_this.cur_index].flag;
  487. }, 200);
  488. }
  489. this.clicktime = e.timeStamp;
  490. return;
  491. },
  492. ListTouchStart(e) {
  493. this.listTouchStartY = e.changedTouches[0].pageY;
  494. },
  495. ListTouchMove(e) {
  496. this.listTouchDirection = this.listTouchStartY - e.changedTouches[0].pageY > 10 ? -1 : 0;
  497. this.listTouchDirection = e.changedTouches[0].pageY - this.listTouchStartY > 10 ? 1 : this.listTouchDirection;
  498. const distance = this.distance + e.changedTouches[0].pageY - this.listTouchStartY;
  499. if (distance > 0) return;
  500. if (Math.abs(this.listTouchStartY - e.changedTouches[0].pageY) < 2) {
  501. this.listTouchDirection = null;
  502. }
  503. },
  504. ListTouchEnd(e) {
  505. this.handelVideo(e);
  506. },
  507. handelVideo(){
  508. if (this.cur_index == 0 && this.listTouchDirection == 1) {
  509. return;
  510. }
  511. this.translateX = 10;
  512. if (this.scroll) return;
  513. if (!this.listTouchDirection) {
  514. return;
  515. }
  516. const destination = this.listTouchDirection * this.sysheight + this.distance;
  517. if (destination > 0 || destination < -this.sysheight * (this.videoList.length - 1)) return;
  518. for (let item of this.videoList) {
  519. item.flag = false;
  520. }
  521. this.animate(destination, this.listTouchDirection);
  522. this.cur_index = this.cur_index - this.listTouchDirection;
  523. this.videoList[this.cur_index].flag = true;
  524. //移动到最后一个加载新的列表
  525. if (this.videoList.length == this.cur_index + 1) {
  526. this.page++;
  527. this.getVideo();
  528. }
  529. this.listTouchDirection = null;
  530. },
  531. animate(des, direc) {
  532. let { distance } = this;
  533. return new Promise((resolve, reject) => {
  534. this.scroll = true;
  535. const temp = setInterval(() => {
  536. if ((direc === -1 && des < distance) || (direc === 1 && des > distance)) {
  537. distance += 100 * direc;
  538. this.containerStyle = `transform:translateY(${distance}px)`;
  539. } else {
  540. clearInterval(temp);
  541. distance = des;
  542. this.distance = des;
  543. this.containerStyle = `transform:translateY(${distance}px)`;
  544. this.scroll = false;
  545. resolve();
  546. }
  547. }, 20);
  548. });
  549. },
  550. previous() {
  551. if (this.cur_index === 0) return;
  552. for (let item of this.videoList) {
  553. item.flag = false;
  554. }
  555. this.distance =this.distance + this.sysheight;
  556. let distance = this.distance;
  557. this.cur_index = this.cur_index - 1;
  558. this.containerStyle = `transform:translateY(${distance}px)`;
  559. clearTimeout(this.pre);
  560. this.pre = setTimeout(() => {
  561. this.videoList[this.cur_index].flag = true;
  562. }, 300);
  563. },
  564. next() {
  565. if (this.cur_index + 1 === this.videoList.length) {
  566. uni.showToast({
  567. title: '无更多视频',
  568. icon: 'none'
  569. });
  570. return
  571. }
  572. this.distance = this.distance - this.sysheight;
  573. let distance = this.distance;
  574. this.containerStyle = `transform:translateY(${distance}px)`;
  575. clearTimeout(this.ne);
  576. this.ne = setTimeout(() => {
  577. this.videoList[this.cur_index].flag = false;
  578. this.cur_index = this.cur_index + 1;
  579. this.videoList[this.cur_index].flag = true;
  580. });
  581. if (this.videoList.length < this.cur_index + 2) {
  582. this.page++;
  583. this.getVideo();
  584. }
  585. }
  586. },
  587. onShareAppMessage() {
  588. return this.$shareAppMessage({
  589. title: this.goods_list[this.cur_index].app_share_title ? this.goods_list[this.cur_index].app_share_title : this.goods_list[this.cur_index].name,
  590. imageUrl: this.goods_list[this.cur_index].app_share_pic ? this.goods_list[this.cur_index].app_share_pic : this.goods_list[this.cur_index].cover_pic,
  591. path: this.goods_list[this.cur_index].page_url.split('?')[0],
  592. params: {
  593. id: this.goods_list[this.cur_index].id,
  594. mch_id: this.goods_list[this.cur_index].mch_id
  595. }
  596. });
  597. },
  598. watch: {
  599. appAttr: {
  600. handler(data) {
  601. if (data.display === 'none') {
  602. this.show_pt = false;
  603. // this.selectAttr = {};
  604. }
  605. }
  606. }
  607. }
  608. };
  609. </script>
  610. <style lang="scss">
  611. .empty {
  612. width: #{750upx};
  613. }
  614. .page {
  615. flex: 1;
  616. overflow: hidden;
  617. background-color: #000;
  618. }
  619. .operating {
  620. position: fixed;
  621. bottom: 0;
  622. left: 0;
  623. width: 100%;
  624. z-index: 1402;
  625. }
  626. .left {
  627. margin-left: #{26upx};
  628. width: #{410upx};
  629. }
  630. .right {
  631. margin-right: #{26upx};
  632. }
  633. .attr {
  634. position: fixed;
  635. bottom: 0;
  636. left: 0;
  637. z-index: 1403;
  638. }
  639. .up-down-goods {
  640. .item {
  641. width: #{266upx};
  642. height: #{60upx};
  643. border-radius: #{16upx};
  644. background-color: rgba(51,51,51,.4);
  645. color: #ffffff;
  646. font-size: #{24upx};
  647. line-height: #{60upx};
  648. text-align: center;
  649. }
  650. .down {
  651. margin-top: #{12upx};
  652. }
  653. }
  654. .goods-list {
  655. width: #{124upx};
  656. height: #{124upx};
  657. border-radius: #{62upx};
  658. background-color: rgba(51,51,51,.4);
  659. margin-left: #{20upx};
  660. position: relative;
  661. .image {
  662. width: #{68upx};
  663. height: #{78upx};
  664. position: absolute;
  665. top: 50%;
  666. left: 50%;
  667. transform: translate(-50%, -50%);
  668. }
  669. }
  670. .index {
  671. margin-left: #{20upx};
  672. }
  673. .cart {
  674. margin: #{0 30upx};
  675. }
  676. .but {
  677. text-align: center;
  678. position: relative;
  679. .icon {
  680. width: #{70upx};
  681. height: #{70upx};
  682. border-radius: #{35upx};
  683. background-color: rgba(51,51,51,.4);
  684. position: relative;
  685. }
  686. .image {
  687. width: #{38upx};
  688. height: #{36upx};
  689. position: absolute;
  690. top: 50%;
  691. left: 50%;
  692. transform: translate(-50%, -50%);
  693. }
  694. text {
  695. color: #ffffff;
  696. font-size: #{24upx};
  697. line-height: 1;
  698. }
  699. }
  700. .share {
  701. background: transparent;
  702. border: none;
  703. border-radius: 0;
  704. padding:0;
  705. position: absolute;
  706. top: 0;
  707. left: 0;
  708. width: 100%;
  709. height: 100%;
  710. }
  711. .scroll {
  712. width: #{690upx};
  713. height: #{240upx};
  714. position: fixed;
  715. left: 50%;
  716. bottom: #{157upx};
  717. transform: translate(-50%, 0%);
  718. }
  719. .scroll-view {
  720. height: calc(100% - #{23upx});
  721. background-color: #ffffff;
  722. border-radius: #{16upx};
  723. padding: #{0 25upx};
  724. .item-good {
  725. padding-top: #{25upx};
  726. .image-view {
  727. position: relative;
  728. >view {
  729. width: #{150upx};
  730. height: #{30upx};
  731. line-height: #{30upx};
  732. position: absolute;
  733. bottom: 0;
  734. font-size: #{18upx};
  735. color: #ffffff;
  736. text-align: center;
  737. background: linear-gradient(to left, #ffcb00, #ff9600);
  738. }
  739. }
  740. }
  741. .cover-pic {
  742. width: #{150upx};
  743. height: #{150upx};
  744. }
  745. .content {
  746. width: calc(100% - #{150upx});
  747. min-height: #{150upx};
  748. margin-bottom: #{25upx};
  749. padding-left: #{25upx};
  750. }
  751. .name {
  752. line-height: #{32upx};
  753. font-size: #{24upx};
  754. color: #303030;
  755. margin-top: #{8upx};
  756. }
  757. .pri-but {
  758. >.button {
  759. width: #{50upx};
  760. height: #{50upx};
  761. background-image: url("../../static/image/icon/add-to.png");
  762. background-size: 100% 100%;
  763. background-repeat: no-repeat;
  764. margin: #{0 4upx 0 0};
  765. border-radius: #{25rpx};
  766. background-color: transparent;
  767. }
  768. .pri {
  769. line-height: #{21upx};
  770. margin-top: #{9upx};
  771. }
  772. .price {
  773. color: #ff4544;
  774. font-size: #{21upx};
  775. line-height: 1;
  776. }
  777. .original {
  778. color: #999999;
  779. font-size: #{17upx};
  780. line-height: 1;
  781. text-decoration: line-through;
  782. margin-left: #{15upx};
  783. }
  784. }
  785. .member-price {
  786. margin-right: #{12upx};
  787. }
  788. }
  789. .triangle {
  790. width: #{40upx};
  791. border-top: #{23upx} solid #ffffff;
  792. border-bottom: #{23upx} solid transparent;
  793. border-left: #{23upx} solid transparent;
  794. border-right: #{23upx} solid transparent;
  795. position: absolute;
  796. left: 50%;
  797. transform: translateX(-50%);
  798. }
  799. .close {
  800. position: fixed;
  801. top: #{26upx};
  802. right: #{26upx};
  803. width: #{70upx};
  804. height: #{70upx};
  805. z-index: 1406;
  806. border-radius: #{35upx};
  807. background-color: rgba(51,51,51,.4);
  808. .image {
  809. width: #{26upx};
  810. height: #{26upx};
  811. position:absolute;
  812. left: 50%;
  813. top: 50%;
  814. transform: translate(-50%, -50%);
  815. }
  816. }
  817. .swiper {
  818. position: relative;
  819. }
  820. .cover-view-marks {
  821. position: fixed;
  822. top: 0;
  823. right: 0;
  824. z-index: 1401;
  825. }
  826. .video {
  827. width: 100%;
  828. height: 100%;
  829. position: relative;
  830. }
  831. .pintuan {
  832. width: #{750upx};
  833. height: #{110upx};
  834. color: #ffffff;
  835. .single {
  836. background-color: #f39800;
  837. text-align: center;
  838. line-height: #{110upx};
  839. }
  840. .tuan {
  841. background-color: #ff4544;
  842. text-align: center;
  843. line-height: #{110upx};
  844. }
  845. }
  846. </style>