product.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <template>
  2. <view class="container">
  3. <!-- 轮播图 -->
  4. <top-swiper :imgList="imgList"></top-swiper>
  5. <view class="sckill-top" v-if="isSckill">
  6. <view class="top-left">
  7. <view class="left-top">限时秒杀价</view>
  8. <view class="left-btm">¥<text class="now-pri">{{goodsObjact.price}}</text><text class="old-pri">¥{{goodsObjact.ot_price}}</text></view>
  9. </view>
  10. <view class="top-right">
  11. <view class="right-top">距离本场结束还剩</view>
  12. <uni-countdown
  13. class="timeBox"
  14. color="#901b21"
  15. background-color="#fff"
  16. splitor-color="#fff"
  17. :show-day="false"
  18. :hour="stopTimes.hours"
  19. :minute="stopTimes.minutes"
  20. :second="stopTimes.seconds"
  21. ></uni-countdown>
  22. </view>
  23. </view>
  24. <!-- 标题 -->
  25. <!-- <product-content :goodsObjact="goodsObjact" ></product-content> -->
  26. <view class="good-title clamp2" v-if="isSckill">{{goodsObjact.store_name}}</view>
  27. <!-- 选择数量 -->
  28. <!-- <view class="row b-b">
  29. <text class="tit">选择</text>
  30. <picker mode="selector" :range="choNum" @change="bindChange">
  31. <view class="refund" v-if="goodsNumber !== 1">{{ goodsNumber || '请选择' }}</view>
  32. <view class="noRefund" v-else>请选择购买数量</view>
  33. </picker>
  34. </view> -->
  35. <!-- 拼货时间及优惠 -->
  36. <!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
  37. <!-- 猜你喜欢 -->
  38. <!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
  39. <!-- 店铺信息 -->
  40. <view class="shop-info">
  41. <view class="shop-logo"><image src="../../static/error/missing-face.png" mode=""></image></view>
  42. <view class="shop-base">
  43. <view class="base-name">子臣台州旗舰店</view>
  44. <view class="base-addr clamp">浙江省台州市椒江区市府大道520号</view>
  45. </view>
  46. <view class="shop-dis"><image src="../../static/icon/base_addr.png" mode="aspectFill"></image>距离200m</view>
  47. </view>
  48. <!-- 评价 -->
  49. <estimate @navTo="navTo('/pages/product/reply?id=' + product_id)" v-if="reply" :reply="reply" :list="list"></estimate>
  50. <!-- 规格信息 -->
  51. <fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
  52. <!-- 图文详情 -->
  53. <content-text :description="description"></content-text>
  54. <!-- 底部高度撑开 -->
  55. <view class="contentBottomHeight"></view>
  56. <!-- 底部操作菜单 -->
  57. <product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne"></product-bottom>
  58. <!-- 规格-模态层弹窗 -->
  59. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
  60. <!-- 遮罩层 -->
  61. <view class="mask"></view>
  62. <view class="layer attr-content" @click.stop="stopPrevent">
  63. <view class="a-t">
  64. <image :src="actionImage"></image>
  65. <view class="right">
  66. <text class="name">{{ goodsObjact.store_name }}</text>
  67. <text class="price">¥{{ actionPrice * goodsNumber }}</text>
  68. <text class="stock">库存:{{ goodsStore }}件</text>
  69. <view class="selected" v-if="specList != ''">
  70. 已选:
  71. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
  72. </view>
  73. </view>
  74. </view>
  75. <view v-for="(item, index) in specList" :key="index" class="attr-list">
  76. <text>{{ item.attr_name }}</text>
  77. <view class="item-list">
  78. <text
  79. v-for="(childItem, childIndex) in item.attr_value"
  80. :key="childIndex"
  81. class="tit"
  82. :class="{ selected: childItem.check }"
  83. @click="selectSpec(childItem, item, index)"
  84. >
  85. {{ childItem.attr }}
  86. </text>
  87. </view>
  88. </view>
  89. <view class="attr-list">
  90. <text>购买数量</text>
  91. <view class="item-list">
  92. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  93. </view>
  94. </view>
  95. <button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
  96. <button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
  103. import { mapState } from 'vuex';
  104. import store from '@/store/index.js';
  105. import { saveUrl } from '@/utils/loginUtils.js';
  106. // #ifdef H5
  107. import { weixindata } from '@/utils/wxAuthorized';
  108. // #endif
  109. // 头部轮播图
  110. import topSwiper from './common/topSwiper.vue';
  111. // 标题
  112. import productContent from './common/productContent.vue';
  113. // 到货时间及优惠
  114. import discounts from './common/discounts.vue';
  115. // 规格信息
  116. import freshDetail from './common/freshDetail.vue';
  117. // 图文详情
  118. import contentText from './common/contentText.vue';
  119. // 底部按钮
  120. import productBottom from './common/productBottom.vue';
  121. // 猜你喜欢
  122. import guessLike from './common/guessLike.vue';
  123. // 评价
  124. import estimate from './common/estimate.vue';
  125. import uniNumberBox from '@/components/uni-number-box.vue';
  126. import {timeComputed} from '@/utils/rocessor.js'
  127. export default {
  128. components: {
  129. guessLike,
  130. topSwiper,
  131. productContent,
  132. discounts,
  133. freshDetail,
  134. contentText,
  135. productBottom,
  136. estimate,
  137. uniNumberBox
  138. },
  139. data() {
  140. return {
  141. goodsStore: 0, //选中库存
  142. specList: [],
  143. buys_show: true,
  144. buys_shows: false,
  145. specSelected: [], //选中的分类
  146. specClass: 'none', //显示隐藏弹窗
  147. many: 1, //1是单规格 2是多规格
  148. reply: '', //评论
  149. list: '', //商品详情的数据
  150. type: 1, //默认支付方式add为
  151. goodsType: 0,
  152. goodsNumber: 1, //购买数量
  153. goodsid: '', //商品id
  154. description: '', //商品描述
  155. goodsObjact: {
  156. percent: 1
  157. }, //保存商品数据
  158. //图片循环
  159. imgList: [],
  160. // 对比对象
  161. actionPrice: 0, //默认选中商品价格
  162. actionImage: '', //默认选中图片
  163. good_list: '', //猜你喜欢列表
  164. goodsNumberMax: 0, //最大可购买数量
  165. // 倒计时数据保存
  166. seckillObj: {
  167. stopTime: 0, //结束时间
  168. stop: false, //是否结束
  169. stopTimeH: 0, //小时
  170. stopTimeM: 0, //分钟
  171. stopTimeS: 0, //秒钟
  172. stopTimeD: 0, //天
  173. upTime: 0 //更新组件内部组件用
  174. },
  175. // 拼团数据保存
  176. pink: {
  177. id: '', //拼团编号
  178. uid: '', //用户编号
  179. people: '', //拼团人数
  180. price: '', //拼团价格
  181. stop_time: '', //拼团结束时间
  182. nickname: '', //团长昵称
  183. avatar: '', //团长头像
  184. count: '', //拼团剩余人数
  185. h: '', //时
  186. i: '', //分
  187. s: '' //秒
  188. },
  189. userInfo: '',
  190. isSckill: false,
  191. stopTimes: {
  192. hours: 0,
  193. minutes: 0,
  194. seconds: 0,
  195. day: 0,
  196. tpye: false
  197. },
  198. product_id:0
  199. };
  200. },
  201. filters: {
  202. parseIntTo(percent) {
  203. percent = +percent * 100;
  204. if (percent % 1 === 0) {
  205. return percent;
  206. } else {
  207. percent = percent.toFixed(1);
  208. return percent;
  209. }
  210. }
  211. },
  212. async onLoad(options) {
  213. console.log(options)
  214. let obj = this;
  215. obj.userInfo = uni.getStorageSync('userInfo');
  216. //保存商品id
  217. this.goodsid = options.id;
  218. this.product_id = options.id
  219. this.goodsType = options.type;
  220. // 判断有无人邀请
  221. if (options.spread) {
  222. // 存储邀请人
  223. uni.setStorageSync('spread', options.spread);
  224. }
  225. saveUrl();
  226. if(options.type === '1') {
  227. obj.getGoodInfo()
  228. // obj.getTime()
  229. this.product_id = options.product_id
  230. console.log('this.product_id',this.product_id)
  231. obj.isSckill = true
  232. }else {
  233. this.goodsDetail();
  234. }
  235. if(options.type === '1'){
  236. obj.isSckill = true
  237. }
  238. // 注册邀请信息
  239. // #ifdef H5
  240. let bool = uni.getStorageSync('weichatBrowser') || '';
  241. if (bool) {
  242. weixindata();
  243. }
  244. // #endif
  245. },
  246. computed: {
  247. ...mapState(['weichatObj', 'baseURL', 'urlFile']),
  248. choNum() {
  249. let a = []
  250. for(let i = 1 ; i <= this.goodsNumberMax ; i++ ){
  251. a.push(i)
  252. }
  253. return a
  254. }
  255. },
  256. // 分享
  257. onShareAppMessage(options) {
  258. // 设置菜单中的转发按钮触发转发事件时的转发内容
  259. let pages = getCurrentPages(); //获取加载的页面
  260. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  261. let url = currentPage.route; //当前页面url
  262. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  263. let shareObj = {
  264. title: this.goodsObjact.store_name + ' 价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
  265. path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
  266. imageUrl: this.goodsObjact.image,
  267. success: function(res) {
  268. // 转发成功之后的回调
  269. if (res.errMsg == 'shareAppMessage:ok') {
  270. }
  271. },
  272. fail: function() {
  273. // 转发失败之后的回调
  274. if (res.errMsg == 'shareAppMessage:fail cancel') {
  275. // 用户取消转发
  276. } else if (res.errMsg == 'shareAppMessage:fail') {
  277. // 转发失败,其中 detail message 为详细失败信息
  278. }
  279. }
  280. };
  281. return shareObj;
  282. },
  283. methods: {
  284. //选择规格
  285. selectSpec(item, arr, ind) {
  286. arr.attr_value.forEach(function(e) {
  287. e.check = false;
  288. });
  289. item.check = true;
  290. let obj = this;
  291. obj.specSelected[ind] = item.attr;
  292. let str = obj.specSelected.join(',');
  293. // 获取当前选中的对象
  294. if (obj.productValue[str]) {
  295. obj.buys_show = true;
  296. obj.buys_shows = false;
  297. obj.actionPrice = obj.productValue[str].price;
  298. obj.goodsNumberMax = obj.productValue[str].stock;
  299. obj.actionImage = obj.productValue[str].image;
  300. obj.uniqueId = obj.productValue[str].unique;
  301. obj.goodsStore = obj.productValue[str].stock;
  302. } else {
  303. (obj.buys_show = false), (obj.buys_shows = true);
  304. }
  305. if (obj.goodsStore == 0) {
  306. obj.buys_show = false;
  307. obj.buys_shows = true;
  308. }
  309. obj.specSelected[ind] = item.attr;
  310. },
  311. // 打開彈窗
  312. specOPne(type=1) {
  313. let obj = this;
  314. obj.specClass = 'show';
  315. obj.type = type
  316. },
  317. //规格弹窗开关
  318. toggleSpec(str) {
  319. if (this.specClass === 'show') {
  320. this.specClass = 'hide';
  321. setTimeout(() => {
  322. this.specClass = 'none';
  323. }, 250);
  324. } else if (this.specClass === 'none') {
  325. this.specClass = 'show';
  326. }
  327. // 保存当前购买类型
  328. this.type = str;
  329. },
  330. //领取优惠券
  331. Getcoupon() {
  332. uni.navigateTo({
  333. url: '/pages/coupon/getcoupon'
  334. });
  335. },
  336. //详情页
  337. navToDetailPage(item) {
  338. let id = item.id;
  339. uni.navigateTo({
  340. url: '/pages/product/product?id=' + id
  341. });
  342. },
  343. // 跳转页面
  344. navTo(url) {
  345. uni.navigateTo({
  346. url
  347. });
  348. },
  349. //加入购物车
  350. Addcar(item) {
  351. let obj = this;
  352. cartAdd({
  353. cartNum: '1', //商品数量
  354. uniqueId: '', //商品标签
  355. new: 0, //商品是否新增加到购物车1为不加入0为加入
  356. mer_id: '',
  357. productId: item.id //商品编号
  358. })
  359. .then(function(e) {
  360. uni.showToast({
  361. title: '成功加入购物车',
  362. type: 'top',
  363. duration: 500,
  364. icon: 'none'
  365. });
  366. obj.goodsDetail();
  367. })
  368. .catch(e => {
  369. console.log(e);
  370. });
  371. },
  372. goodsDetail() {
  373. let obj = this;
  374. // 获取普通商品信息
  375. goodsDetail({}, this.goodsid).then(function({ data }) {
  376. obj.list = data;
  377. console.log(data)
  378. obj.good_list = data.good_list; //保存猜你喜欢列表
  379. obj.reply = data.reply; //保存评论列表
  380. let goods = data.storeInfo;
  381. obj.goodsObjact = goods;
  382. console.log(obj.goodsObjact)
  383. if (obj.goodsObjact.description != null) {
  384. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  385. } //小程序商品详情图超出屏幕问题
  386. obj.imgList = goods.slider_image; //保存轮播图
  387. obj.specList = data.productAttr; //保存分类列表
  388. if (Array.isArray(data.productValue) != true) {
  389. obj.many = 2;
  390. obj.specList = data.productAttr; //保存产品属性
  391. obj.productValue = data.productValue; //保存属性值
  392. obj.specSelected = []; //初始化默认选择对象
  393. for (let i = 0; i < obj.specList.length; i++) {
  394. // 设置默认数据
  395. let attrValue = obj.specList[i].attr_value[0];
  396. attrValue.check = true;
  397. obj.specSelected.push(attrValue.attr);
  398. }
  399. let str = obj.specSelected.join(',');
  400. console.log(str, 'str');
  401. // 设置默认值
  402. obj.actionPrice = obj.productValue[str].price;
  403. obj.goodsNumberMax = obj.productValue[str].stock;
  404. obj.actionImage = obj.productValue[str].image;
  405. obj.uniqueId = obj.productValue[str].unique;
  406. obj.goodsStore = obj.productValue[str].quota;
  407. } else {
  408. obj.many = 1;
  409. }
  410. obj.productValue = data.productValue; //保存分类查询数据
  411. obj.actionPrice = goods.price; //保存默认选中商品价格
  412. obj.actionImage = goods.image_base; //保存默认选中商品图片
  413. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  414. obj.shopId = data.mer_id; //保存商店id
  415. });
  416. },
  417. getGoodInfo() {
  418. let obj = this;
  419. // 获取秒杀商品信息
  420. seckillGoods({}, this.goodsid).then(function({ data }) {
  421. console.log(data)
  422. obj.list = data;
  423. obj.good_list = data.good_list; //保存猜你喜欢列表
  424. obj.reply = data.reply; //保存评论列表
  425. let goods = data.storeInfo;
  426. obj.goodsObjact = goods;
  427. obj.goodsObjact.title = goods.title
  428. obj.stopTimes = timeComputed(obj.list.isSeckillEnd.stop*1000)
  429. console.log(obj.stopTimes,'dddddddddd')
  430. if (obj.goodsObjact.description != null) {
  431. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  432. } //小程序商品详情图超出屏幕问题
  433. obj.imgList = goods.images; //保存轮播图
  434. obj.specList = data.productAttr; //保存分类列表
  435. if (Array.isArray(data.productValue) != true) {
  436. obj.many = 2;
  437. obj.specList = data.productAttr; //保存产品属性
  438. obj.productValue = data.productValue; //保存属性值
  439. obj.specSelected = []; //初始化默认选择对象
  440. for (let i = 0; i < obj.specList.length; i++) {
  441. // 设置默认数据
  442. let attrValue = obj.specList[i].attr_value[0];
  443. attrValue.check = true;
  444. obj.specSelected.push(attrValue.attr);
  445. }
  446. let str = obj.specSelected.join(',');
  447. console.log(str, 'str');
  448. // 设置默认值
  449. obj.actionPrice = obj.productValue[str].price;
  450. obj.goodsNumberMax = obj.productValue[str].stock;
  451. obj.actionImage = obj.productValue[str].image;
  452. obj.uniqueId = obj.productValue[str].unique;
  453. obj.goodsStore = obj.productValue[str].quota;
  454. } else {
  455. obj.many = 1;
  456. }
  457. obj.productValue = data.productValue; //保存分类查询数据
  458. obj.actionPrice = goods.price; //保存默认选中商品价格
  459. obj.actionImage = goods.image_base; //保存默认选中商品图片
  460. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  461. obj.shopId = data.mer_id; //保存商店id
  462. });
  463. },
  464. // 立即购买
  465. buy() {
  466. let obj = this;
  467. // 创建传值对象
  468. let data = {
  469. cartNum: obj.goodsNumber, //商品数量
  470. new: 1,
  471. productId: obj.goodsid,//商品编号
  472. uniqueId:obj.uniqueId
  473. };
  474. if (obj.type == 2) {
  475. data.new = 0;
  476. }
  477. cartAdd(data)
  478. .then(function(e) {
  479. let da = e.data;
  480. if (obj.type == 1) {
  481. // 跳转到支付页
  482. uni.navigateTo({
  483. url: '/pages/order/createOrder?id=' + da.cartId
  484. });
  485. }
  486. if (obj.type == 2) {
  487. uni.showToast({
  488. title: '成功加入购物车',
  489. type: 'top',
  490. duration: 2000,
  491. icon: 'none'
  492. });
  493. obj.goodsDetail();
  494. }
  495. obj.toggleSpec()
  496. })
  497. .catch(e => {
  498. console.log(e);
  499. });
  500. },
  501. // 阻止触发上级事件
  502. stopPrevent() {},
  503. bindChange(e) {
  504. this.goodsNumber = this.choNum[e.detail.value]*1;
  505. console.log(this.goodsNumber)
  506. },
  507. numberChange(e) {
  508. //购买数量
  509. this.chooseGoodsNumber = e.number;
  510. },
  511. // getTime() {
  512. // let start = new data()
  513. // }
  514. }
  515. };
  516. </script>
  517. <style lang="scss">
  518. /* 弹出层 */
  519. .popup {
  520. position: fixed;
  521. left: 0;
  522. top: 0;
  523. right: 0;
  524. bottom: 0;
  525. z-index: 99;
  526. &.show {
  527. display: block;
  528. .mask {
  529. animation: showPopup 0.2s linear both;
  530. }
  531. .layer {
  532. animation: showLayer 0.2s linear both;
  533. }
  534. }
  535. &.hide {
  536. .mask {
  537. animation: hidePopup 0.2s linear both;
  538. }
  539. .layer {
  540. animation: hideLayer 0.2s linear both;
  541. }
  542. }
  543. &.none {
  544. display: none;
  545. }
  546. .mask {
  547. position: fixed;
  548. top: 0;
  549. width: 100%;
  550. height: 100%;
  551. z-index: 1;
  552. background-color: rgba(0, 0, 0, 0.4);
  553. }
  554. .layer {
  555. position: fixed;
  556. z-index: 99;
  557. bottom: 0;
  558. width: 100%;
  559. min-height: 35vh;
  560. border-radius: 10rpx 10rpx 0 0;
  561. background-color: #fff;
  562. .btn {
  563. height: 66rpx;
  564. line-height: 66rpx;
  565. border-radius: 100rpx;
  566. background: #901b21;
  567. font-size: $font-base + 2rpx;
  568. color: #fff;
  569. margin: 30rpx auto 20rpx;
  570. }
  571. }
  572. @keyframes showPopup {
  573. 0% {
  574. opacity: 0;
  575. }
  576. 100% {
  577. opacity: 1;
  578. }
  579. }
  580. @keyframes hidePopup {
  581. 0% {
  582. opacity: 1;
  583. }
  584. 100% {
  585. opacity: 0;
  586. }
  587. }
  588. @keyframes showLayer {
  589. 0% {
  590. transform: translateY(120%);
  591. }
  592. 100% {
  593. transform: translateY(0%);
  594. }
  595. }
  596. @keyframes hideLayer {
  597. 0% {
  598. transform: translateY(0);
  599. }
  600. 100% {
  601. transform: translateY(120%);
  602. }
  603. }
  604. }
  605. /* 规格选择弹窗 */
  606. .attr-content {
  607. padding: 25rpx 30rpx;
  608. .a-t {
  609. display: flex;
  610. image {
  611. width: 170rpx;
  612. height: 170rpx;
  613. flex-shrink: 0;
  614. border-radius: 8rpx;
  615. }
  616. .right {
  617. display: flex;
  618. flex-direction: column;
  619. padding-left: 24rpx;
  620. font-size: $font-sm + 2rpx;
  621. color: $font-color-base;
  622. line-height: 42rpx;
  623. width: 75%;
  624. .price {
  625. font-size: $font-lg;
  626. color: #901b21;
  627. margin: 10rpx 0rpx;
  628. }
  629. .name {
  630. font-size: 32rpx;
  631. color: $font-color-dark;
  632. height: 50rpx;
  633. overflow: hidden;
  634. text-overflow: ellipsis;
  635. white-space: nowrap;
  636. display: block;
  637. }
  638. .selected-text {
  639. margin-right: 10rpx;
  640. }
  641. }
  642. }
  643. .attr-list {
  644. display: flex;
  645. flex-direction: column;
  646. font-size: $font-base + 2rpx;
  647. color: $font-color-base;
  648. padding-top: 30rpx;
  649. padding-left: 10rpx;
  650. }
  651. .item-list {
  652. padding: 20rpx 0 0;
  653. display: flex;
  654. flex-wrap: wrap;
  655. text {
  656. display: flex;
  657. align-items: center;
  658. justify-content: center;
  659. background: #eee;
  660. margin-right: 20rpx;
  661. margin-bottom: 20rpx;
  662. border-radius: 100rpx;
  663. min-width: 60rpx;
  664. height: 60rpx;
  665. padding: 0 20rpx;
  666. font-size: $font-base;
  667. color: $font-color-dark;
  668. }
  669. .selected {
  670. background: #ddffdf;
  671. color: $uni-color-primary;
  672. }
  673. }
  674. }
  675. //默认商品底部高度
  676. .goodsBottom {
  677. height: 160rpx;
  678. }
  679. page {
  680. background: #f0f0f0;
  681. }
  682. //秒杀、拼团底部高度
  683. .contentBottomHeight {
  684. height: 130rpx;
  685. }
  686. //默认商品底部高度
  687. .goodsBottom {
  688. height: 160rpx;
  689. }
  690. /deep/ .iconenter {
  691. font-size: $font-base + 2rpx;
  692. color: #888;
  693. }
  694. /deep/ .con_image {
  695. width: 130rpx;
  696. height: 130rpx;
  697. display: inline-block;
  698. padding: 15rpx;
  699. image {
  700. width: 100%;
  701. height: 100%;
  702. }
  703. }
  704. /* 商品详情中限制图片大小 */
  705. /deep/ .rich-img {
  706. width: 100% !important;
  707. height: auto;
  708. }
  709. .cho-num {
  710. margin: 20rpx 0;
  711. width: 750rpx;
  712. height: 83rpx;
  713. background: #FFFFFF;
  714. padding: 29rpx 24rpx 30rpx 25rpx;
  715. font-size: 26rpx;
  716. font-weight: 500;
  717. color: #606972;
  718. }
  719. .row {
  720. display: flex;
  721. align-items: center;
  722. position: relative;
  723. padding: 0 30rpx;
  724. height: 110rpx;
  725. background: #fff;
  726. .refund {
  727. font-size: 30rpx;
  728. color: $font-color-dark;
  729. padding-left: 128rpx;
  730. }
  731. .noRefund {
  732. font-size: 30rpx;
  733. color: $font-color-light;
  734. padding-left: 128rpx;
  735. }
  736. .tit {
  737. flex-shrink: 0;
  738. width: 120rpx;
  739. font-size: 30rpx;
  740. color: $font-color-dark;
  741. }
  742. .input {
  743. flex: 1;
  744. font-size: 30rpx;
  745. color: $font-color-dark;
  746. padding-left: 128rpx;
  747. &.payColor {
  748. color: $color-red;
  749. }
  750. }
  751. .iconlocation {
  752. font-size: 36rpx;
  753. color: $font-color-light;
  754. }
  755. }
  756. .shop-info {
  757. width: 750rpx;
  758. height: 140rpx;
  759. margin: 20rpx 0;
  760. padding: 28rpx 24rpx 22rpx 16rpx;
  761. background-color: #fff;
  762. display: flex;
  763. position: relative;
  764. .shop-logo {
  765. width: 90rpx;
  766. height: 90rpx;
  767. border-radius: 50%;
  768. background-color: red;
  769. // overflow: hidden;
  770. image {
  771. width: 90rpx;
  772. height: 90rpx;
  773. }
  774. }
  775. .shop-base {
  776. padding-left: 15rpx;
  777. // width: 376rpx;
  778. width: 100%;
  779. font-size: 24rpx;
  780. font-weight: 500;
  781. color: #999999;
  782. line-height: 1;
  783. .base-name {
  784. padding-top: 14rpx;
  785. font-size: 30rpx;
  786. padding-bottom: 16rpx;
  787. font-weight: 500;
  788. color: #333333;
  789. }
  790. }
  791. .shop-dis {
  792. padding-top: 31rpx;
  793. position: absolute;
  794. font-size: 24rpx;
  795. font-weight: 500;
  796. color: #901B21;
  797. // line-height: 140rpx;
  798. right: 24rpx;
  799. image {
  800. padding-right: 5rpx;
  801. width: 21rpx;
  802. height: 21rpx;
  803. }
  804. }
  805. }
  806. .sckill-top {
  807. width: 750rpx;
  808. height: 165rpx;
  809. background-image: url(../../static/img/base-sckill.png);
  810. background-size: 100% 100%;
  811. position: relative;
  812. top: -40rpx;
  813. margin-bottom: -40rpx;
  814. display: flex;
  815. justify-content: space-between;
  816. .top-left {
  817. line-height: 1;
  818. .left-top {
  819. padding: 35rpx 0 23rpx 22rpx;
  820. font-size: 44rpx;
  821. font-weight: 500;
  822. color: #FFFFFF;
  823. line-height: 1;
  824. }
  825. .left-btm {
  826. line-height: 1;
  827. font-size: 30rpx;
  828. font-weight: 500;
  829. // text-decoration: line-through;
  830. color: #FFFFFF;
  831. .now-pri {
  832. display: inline-block;
  833. padding-right: 8rpx;
  834. font-size: 44rpx;
  835. font-weight: 800;
  836. color: #FFFFFF;
  837. }
  838. .old-pri {
  839. text-decoration: line-through;
  840. }
  841. }
  842. }
  843. .top-right {
  844. padding:67rpx 20rpx 18rpx 0;
  845. .right-top {
  846. font-size: 22rpx;
  847. font-weight: 400;
  848. color: #FFFFFF;
  849. line-height: 1;
  850. padding-bottom: 8rpx;
  851. }
  852. }
  853. }
  854. .good-title {
  855. background-color: #fff;
  856. // height: 142rpx;
  857. padding: 24rpx 19rpx 24rpx 34rpx;
  858. line-height: 1.5;
  859. font-size: 36rpx;
  860. font-weight: 800;
  861. color: #333333;
  862. }
  863. </style>