goods.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256
  1. <template>
  2. <view>
  3. <scroll-view class="container" :style="'height: ' + winHeight + 'rpx'" :scroll-y="true">
  4. <view v-if="!openAttr">
  5. <swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
  6. <swiper-item v-for="(item, index) in gallery" :key="item.id">
  7. <image :src="item.img_url" background-size="cover"></image>
  8. </swiper-item>
  9. </swiper>
  10. <view class="service-policy">
  11. <view class="item">30天无忧退货</view>
  12. <view class="item">48小时快速退款</view>
  13. <view class="item">满88元免邮费</view>
  14. </view>
  15. <view class="goods-info">
  16. <view class="c">
  17. <text class="name">{{goods.name||''}}</text>
  18. <text class="desc">{{goods.goods_brief||''}}</text>
  19. <text class="price">¥{{goods.retail_price||'0'}}</text>
  20. <view class="brand" v-if="brand.name">
  21. <navigator :url="'../brandDetail/brandDetail?id='+ brand.id">
  22. <text>{{brand.name}}</text>
  23. </navigator>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="section-nav section-attr" @tap="switchAttrPop">
  28. <view class="t">请选择规格数量</view>
  29. <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
  30. </view>
  31. <view class="comments" v-if="comment.count > 0">
  32. <view class="h">
  33. <navigator :url="'../comment/comment?valueId='+goods.id+'&typeId=0'">
  34. <text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
  35. <text class="i">查看全部</text>
  36. </navigator>
  37. </view>
  38. <view class="b">
  39. <view class="item">
  40. <view class="info">
  41. <view class="user">
  42. <image :src="comment.data.avatar"></image>
  43. <text>{{comment.data.nickname}}</text>
  44. </view>
  45. <view class="time">{{comment.data.add_time}}</view>
  46. </view>
  47. <view class="content">
  48. {{comment.data.content}}
  49. </view>
  50. <view class="imgs" v-if="comment.data.pic_list.length > 0">
  51. <image class="img" v-for="(item, index) in comment.data.pic_list" :key="index" :src="item.pic_url"></image>
  52. </view>
  53. <!-- <view class="spec">白色 2件</view> -->
  54. </view>
  55. </view>
  56. </view>
  57. <view class="goods-attr">
  58. <view class="t">商品参数</view>
  59. <view class="l">
  60. <view class="item" v-for="(item, index) in attribute" :key="item.name">
  61. <text class="left">{{item.name}}</text>
  62. <text class="right">{{item.value}}</text>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="detail">
  67. <uParse :content="goods.goods_desc" noData="" />
  68. </view>
  69. <view class="common-problem">
  70. <view class="h">
  71. <view class="line"></view>
  72. <text class="title">常见问题</text>
  73. </view>
  74. <view class="b">
  75. <view class="item" v-for="(item, index) in issueList" :key="item.id">
  76. <view class="question-box">
  77. <text class="spot"></text>
  78. <text class="question">{{item.question}}</text>
  79. </view>
  80. <view class="answer">
  81. {{item.answer}}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="related-goods" v-if="relatedGoods.length > 0">
  87. <view class="h">
  88. <view class="line"></view>
  89. <text class="title">大家都在看</text>
  90. </view>
  91. <view class="b">
  92. <view class="item" v-for="(item, index) in relatedGoods" :key="item.id">
  93. <navigator :url="'/pages/goods/goods?id='+item.id">
  94. <image class="img" :src="item.list_pic_url" background-size="cover"></image>
  95. <text class="name">{{item.name}}</text>
  96. <text class="price">¥{{item.retail_price}}</text>
  97. </navigator>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view v-if="openAttr" class="attr-pop">
  103. <view class="img-info">
  104. <image class="img" :src="goods.list_pic_url"></image>
  105. <view class="info">
  106. <view class="c">
  107. <view class="p">价格:¥{{goods.retail_price}}</view>
  108. <view class="a" v-if="productList.length>0">已选择:{{checkedSpecText}}</view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="spec-con">
  113. <view class="spec-item" v-for="(item, index) in specificationList" :key="item.specification_id">
  114. <view class="name">{{item.name}}</view>
  115. <view class="values">
  116. <view :class="'value ' + (vitem.checked ? 'selected' : '')" @tap="clickSkuValue" v-for="(vitem, vindex) in item.valueList"
  117. :key="vitem.id" :data-value-id="vitem.id" :data-name-id="vitem.specification_id">{{vitem.value}}</view>
  118. </view>
  119. </view>
  120. <view class="number-item">
  121. <view class="name">数量</view>
  122. <view class="selnum">
  123. <view class="cut" @tap="cutNumber">-</view>
  124. <input :value="number" class="number" :disabled="true" type="number" />
  125. <view class="add" @tap="addNumber">+</view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </scroll-view>
  131. <view class="bottom-btn">
  132. <view :class="'l l-collect '+ (openAttr ? 'back' : '')" @tap="closeAttrOrCollect">
  133. <image class="icon" :src="collectBackImage"></image>
  134. </view>
  135. <view class="l l-cart">
  136. <view class="box">
  137. <text class="cart-count">{{cartGoodsCount}}</text>
  138. <image @tap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
  139. </view>
  140. </view>
  141. <view class="c" @tap='buyGoods'>立即购买</view>
  142. <view class="r" @tap="addToCart">加入购物车</view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. const util = require("@/utils/util.js")
  148. const api = require('@/utils/api.js');
  149. import uParse from '@/components/uParse/src/wxParse'
  150. export default {
  151. components: {
  152. uParse
  153. },
  154. data() {
  155. return {
  156. winHeight: "",
  157. id: 0,
  158. goods: {},
  159. gallery: [],
  160. attribute: [],
  161. issueList: [],
  162. comment: [],
  163. brand: {},
  164. specificationList: [],
  165. productList: [],
  166. relatedGoods: [],
  167. cartGoodsCount: 0,
  168. userHasCollect: 0,
  169. number: 1,
  170. checkedSpecText: '请选择规格数量',
  171. openAttr: false,
  172. noCollectImage: "/static/images/icon_collect.png",
  173. hasCollectImage: "/static/images/icon_collect_checked.png",
  174. collectBackImage: "/static/images/icon_collect.png"
  175. }
  176. },
  177. methods: {
  178. getGoodsInfo: function() {
  179. let that = this;
  180. util.request(api.GoodsDetail, {
  181. id: that.id
  182. }).then(function(res) {
  183. if (res.errno === 0) {
  184. that.goods = res.data.info
  185. that.gallery = res.data.gallery
  186. that.attribute = res.data.attribute
  187. that.issueList = res.data.issue
  188. that.comment = res.data.comment
  189. that.brand = res.data.brand
  190. that.specificationList = res.data.specificationList
  191. that.productList = res.data.productList
  192. that.userHasCollect = res.data.userHasCollect
  193. //设置默认值
  194. that.setDefSpecInfo(that.specificationList);
  195. if (res.data.userHasCollect == 1) {
  196. that.collectBackImage = that.hasCollectImage
  197. } else {
  198. that.collectBackImage = that.noCollectImage
  199. }
  200. that.getGoodsRelated();
  201. }
  202. });
  203. },
  204. getGoodsRelated: function() {
  205. let that = this;
  206. util.request(api.GoodsRelated, {
  207. id: that.id
  208. }).then(function(res) {
  209. if (res.errno === 0) {
  210. that.relatedGoods = res.data.goodsList
  211. }
  212. });
  213. },
  214. clickSkuValue: function(event) {
  215. let that = this;
  216. let specNameId = event.currentTarget.dataset.nameId;
  217. let specValueId = event.currentTarget.dataset.valueId;
  218. //判断是否可以点击
  219. let _specificationList = this.specificationList;
  220. for (let i = 0; i < _specificationList.length; i++) {
  221. if (_specificationList[i].specification_id == specNameId) {
  222. for (let j = 0; j < _specificationList[i].valueList.length; j++) {
  223. if (_specificationList[i].valueList[j].id == specValueId) {
  224. //如果已经选中,则反选
  225. if (_specificationList[i].valueList[j].checked) {
  226. _specificationList[i].valueList[j].checked = false;
  227. } else {
  228. _specificationList[i].valueList[j].checked = true;
  229. }
  230. } else {
  231. _specificationList[i].valueList[j].checked = false;
  232. }
  233. }
  234. }
  235. }
  236. this.specificationList = _specificationList;
  237. //重新计算spec改变后的信息
  238. this.changeSpecInfo();
  239. //重新计算哪些值不可以点击
  240. },
  241. //获取选中的规格信息
  242. getCheckedSpecValue: function() {
  243. let checkedValues = [];
  244. let _specificationList = this.specificationList;
  245. for (let i = 0; i < _specificationList.length; i++) {
  246. let _checkedObj = {
  247. nameId: _specificationList[i].specification_id,
  248. valueId: 0,
  249. valueText: ''
  250. };
  251. for (let j = 0; j < _specificationList[i].valueList.length; j++) {
  252. if (_specificationList[i].valueList[j].checked) {
  253. _checkedObj.valueId = _specificationList[i].valueList[j].id;
  254. _checkedObj.valueText = _specificationList[i].valueList[j].value;
  255. }
  256. }
  257. checkedValues.push(_checkedObj);
  258. }
  259. return checkedValues;
  260. },
  261. //根据已选的值,计算其它值的状态
  262. setSpecValueStatus: function() {
  263. },
  264. //判断规格是否选择完整
  265. isCheckedAllSpec: function() {
  266. return !this.getCheckedSpecValue().some(function(v) {
  267. if (v.valueId == 0) {
  268. return true;
  269. }
  270. });
  271. },
  272. getCheckedSpecKey: function() {
  273. let checkedValue = this.getCheckedSpecValue().map(function(v) {
  274. return v.valueId;
  275. });
  276. return checkedValue.join('_');
  277. },
  278. changeSpecInfo: function() {
  279. let checkedNameValue = this.getCheckedSpecValue();
  280. //设置选择的信息
  281. let checkedValue = checkedNameValue.filter(function(v) {
  282. if (v.valueId != 0) {
  283. return true;
  284. } else {
  285. return false;
  286. }
  287. }).map(function(v) {
  288. return v.valueText;
  289. });
  290. if (checkedValue.length > 0) {
  291. this.checkedSpecText = checkedValue.join(' ');
  292. } else {
  293. this.checkedSpecText = '请选择规格数量'
  294. }
  295. },
  296. getCheckedProductItem: function(key) {
  297. return this.productList.filter(function(v) {
  298. if (v.goods_specification_ids.indexOf(key) > -1) {
  299. return true;
  300. } else {
  301. return false;
  302. }
  303. });
  304. },
  305. switchAttrPop: function() {
  306. if (this.openAttr == false) {
  307. this.openAttr = !this.openAttr
  308. this.collectBackImage = "/static/images/detail_back.png"
  309. }
  310. },
  311. closeAttrOrCollect: function() {
  312. let that = this;
  313. if (that.openAttr) {
  314. that.openAttr = false
  315. if (that.userHasCollect == 1) {
  316. that.collectBackImage = that.hasCollectImage
  317. } else {
  318. that.collectBackImage = that.noCollectImage
  319. }
  320. } else {
  321. //添加或是取消收藏
  322. util.request(api.CollectAddOrDelete, {
  323. typeId: 0,
  324. valueId: that.id
  325. }, "POST", "application/json")
  326. .then(function(res) {
  327. let _res = res;
  328. if (_res.errno == 0) {
  329. if (_res.data.type == 'add') {
  330. that.collectBackImage = that.hasCollectImage
  331. } else {
  332. that.collectBackImage = that.noCollectImage
  333. }
  334. } else {
  335. uni.showToast({
  336. image: '/static/images/icon_error.png',
  337. title: _res.errmsg,
  338. mask: true
  339. });
  340. }
  341. });
  342. }
  343. },
  344. openCartPage: function() {
  345. uni.switchTab({
  346. url: '/pages/cart/cart',
  347. });
  348. },
  349. /**
  350. * 直接购买
  351. */
  352. buyGoods: function() {
  353. var that = this;
  354. if (that.openAttr == false) {
  355. //打开规格选择窗口
  356. that.openAttr = !that.openAttr
  357. that.collectBackImage = "/static/images/detail_back.png"
  358. } else {
  359. //提示选择完整规格
  360. if (!that.isCheckedAllSpec()) {
  361. return false;
  362. }
  363. //根据选中的规格,判断是否有对应的sku信息
  364. let checkedProduct = that.getCheckedProductItem(that.getCheckedSpecKey());
  365. if (!checkedProduct || checkedProduct.length <= 0) {
  366. //找不到对应的product信息,提示没有库存
  367. return false;
  368. }
  369. //验证库存
  370. if (checkedProduct.goods_number < that.number) {
  371. //找不到对应的product信息,提示没有库存
  372. return false;
  373. }
  374. // 直接购买商品
  375. util.request(api.BuyAdd, {
  376. goodsId: that.goods.id,
  377. number: that.number,
  378. productId: checkedProduct[0].id
  379. }, "POST", 'application/json')
  380. .then(function(res) {
  381. let _res = res;
  382. if (_res.errno == 0) {
  383. that.openAttr = !that.openAttr
  384. uni.navigateTo({
  385. url: '/pages/shopping/checkout/checkout?isBuy=true',
  386. })
  387. } else {
  388. uni.showToast({
  389. image: '/static/images/icon_error.png',
  390. title: _res.errmsg,
  391. mask: true
  392. });
  393. }
  394. });
  395. }
  396. },
  397. /**
  398. * 添加到购物车
  399. */
  400. addToCart: function() {
  401. var that = this;
  402. if (that.openAttr == false) {
  403. //打开规格选择窗口
  404. that.openAttr = !that.openAttr
  405. that.collectBackImage = "/static/images/detail_back.png"
  406. } else {
  407. //提示选择完整规格
  408. if (!that.isCheckedAllSpec()) {
  409. uni.showToast({
  410. title: '请选择完整规格'
  411. });
  412. return false;
  413. }
  414. //根据选中的规格,判断是否有对应的sku信息
  415. let checkedProduct = that.getCheckedProductItem(that.getCheckedSpecKey());
  416. if (!checkedProduct || checkedProduct.length <= 0) {
  417. //找不到对应的product信息,提示没有库存
  418. return false;
  419. }
  420. //验证库存
  421. if (checkedProduct.goods_number < that.number) {
  422. //找不到对应的product信息,提示没有库存
  423. return false;
  424. }
  425. //添加到购物车
  426. util.request(api.CartAdd, {
  427. goodsId: that.goods.id,
  428. number: that.number,
  429. productId: checkedProduct[0].id
  430. }, 'POST', 'application/json').then(function(res) {
  431. let _res = res;
  432. if (_res.errno == 0) {
  433. uni.showToast({
  434. title: '添加成功'
  435. });
  436. that.openAttr = !that.openAttr
  437. that.cartGoodsCount = _res.data.cartTotal.goodsCount
  438. if (that.userHasCollect == 1) {
  439. that.collectBackImage = that.hasCollectImage
  440. } else {
  441. that.collectBackImage = that.noCollectImage
  442. }
  443. } else {
  444. uni.showToast({
  445. image: '/static/images/icon_error.png',
  446. title: _res.errmsg,
  447. mask: true
  448. });
  449. }
  450. });
  451. }
  452. },
  453. cutNumber: function() {
  454. this.number = (this.number - 1 > 1) ? this.number - 1 : 1
  455. },
  456. addNumber: function() {
  457. this.number = this.number + 1
  458. },
  459. setDefSpecInfo: function(specificationList) {
  460. //未考虑规格联动情况
  461. let that = this;
  462. if (!specificationList) return;
  463. for (let i = 0; i < specificationList.length; i++) {
  464. let specification = specificationList[i];
  465. let specNameId = specification.specification_id;
  466. //规格只有一个时自动选择规格
  467. if (specification.valueList && specification.valueList.length == 1) {
  468. let specValueId = specification.valueList[0].id;
  469. that.clickSkuValue({
  470. currentTarget: {
  471. dataset: {
  472. "nameId": specNameId,
  473. "valueId": specValueId
  474. }
  475. }
  476. });
  477. }
  478. }
  479. specificationList.map(function(item) {
  480. });
  481. }
  482. },
  483. onLoad: function(options) {
  484. // 页面初始化 options为页面跳转所带来的参数
  485. this.id = parseInt(options.id)
  486. var that = this;
  487. this.getGoodsInfo();
  488. util.request(api.CartGoodsCount).then(function(res) {
  489. if (res.errno === 0) {
  490. that.cartGoodsCount = res.data.cartTotal.goodsCount
  491. }
  492. });
  493. var that = this
  494. // 高度自适应
  495. uni.getSystemInfo({
  496. success: function(res) {
  497. var clientHeight = res.windowHeight,
  498. clientWidth = res.windowWidth,
  499. rpxR = 750 / clientWidth;
  500. var calc = clientHeight * rpxR - 100;
  501. that.winHeight = calc
  502. }
  503. });
  504. }
  505. }
  506. </script>
  507. <style lang="scss">
  508. .container {
  509. /* margin-bottom: 100rpx; */
  510. }
  511. .goodsimgs {
  512. width: 750rpx;
  513. height: 750rpx;
  514. }
  515. .goodsimgs image {
  516. width: 750rpx;
  517. height: 750rpx;
  518. }
  519. .service-policy {
  520. width: 750rpx;
  521. height: 73rpx;
  522. background: #f4f4f4;
  523. padding: 0 31.25rpx;
  524. display: flex;
  525. flex-flow: row nowrap;
  526. align-items: center;
  527. justify-content: space-between;
  528. }
  529. .service-policy .item {
  530. background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;
  531. background-size: 10rpx;
  532. padding-left: 15rpx;
  533. display: flex;
  534. align-items: center;
  535. font-size: 25rpx;
  536. color: #666;
  537. }
  538. .goods-info {
  539. width: 750rpx;
  540. height: 306rpx;
  541. overflow: hidden;
  542. background: #fff;
  543. }
  544. .goods-info .c {
  545. display: block;
  546. width: 718.75rpx;
  547. height: 100%;
  548. margin-left: 31.25rpx;
  549. padding: 38rpx 31.25rpx 38rpx 0;
  550. border-bottom: 1px solid #f4f4f4;
  551. }
  552. .goods-info .c text {
  553. display: block;
  554. width: 687.5rpx;
  555. text-align: center;
  556. }
  557. .goods-info .name {
  558. height: 41rpx;
  559. margin-bottom: 5.208rpx;
  560. font-size: 41rpx;
  561. line-height: 41rpx;
  562. }
  563. .goods-info .desc {
  564. height: 43rpx;
  565. margin-bottom: 41rpx;
  566. font-size: 24rpx;
  567. line-height: 36rpx;
  568. color: #999;
  569. }
  570. .goods-info .price {
  571. height: 35rpx;
  572. font-size: 35rpx;
  573. line-height: 35rpx;
  574. color: #b4282d;
  575. }
  576. .goods-info .brand {
  577. margin-top: 23rpx;
  578. min-height: 40rpx;
  579. text-align: center;
  580. }
  581. .goods-info .brand text {
  582. display: inline-block;
  583. width: auto;
  584. padding: 2px 30rpx 2px 10.5rpx;
  585. line-height: 35.5rpx;
  586. border: 1px solid #f48f18;
  587. font-size: 25rpx;
  588. color: #f48f18;
  589. border-radius: 4px;
  590. background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/detailTagArrow-18bee52dab.png) 95% center no-repeat;
  591. background-size: 10.75rpx 18.75rpx;
  592. }
  593. .section-nav {
  594. width: 750rpx;
  595. height: 108rpx;
  596. background: #fff;
  597. margin-bottom: 20rpx;
  598. }
  599. .section-nav .t {
  600. float: left;
  601. width: 600rpx;
  602. height: 108rpx;
  603. line-height: 108rpx;
  604. font-size: 29rpx;
  605. color: #333;
  606. margin-left: 31.25rpx;
  607. }
  608. .section-nav .i {
  609. float: right;
  610. width: 52rpx;
  611. height: 52rpx;
  612. margin-right: 16rpx;
  613. margin-top: 28rpx;
  614. }
  615. .section-act .t {
  616. float: left;
  617. display: flex;
  618. align-items: center;
  619. width: 600rpx;
  620. height: 108rpx;
  621. overflow: hidden;
  622. line-height: 108rpx;
  623. font-size: 29rpx;
  624. color: #999;
  625. margin-left: 31.25rpx;
  626. }
  627. .section-act .label {
  628. color: #999;
  629. }
  630. .section-act .tag {
  631. display: flex;
  632. align-items: center;
  633. padding: 0 10rpx;
  634. border-radius: 3px;
  635. height: 37rpx;
  636. width: auto;
  637. color: #f48f18;
  638. overflow: hidden;
  639. border: 1px solid #f48f18;
  640. font-size: 25rpx;
  641. margin: 0 10rpx;
  642. }
  643. .section-act .text {
  644. display: flex;
  645. align-items: center;
  646. height: 37rpx;
  647. width: auto;
  648. overflow: hidden;
  649. color: #f48f18;
  650. font-size: 29rpx;
  651. }
  652. .comments {
  653. width: 100%;
  654. height: auto;
  655. padding-left: 30rpx;
  656. background: #fff;
  657. margin: 20rpx 0;
  658. }
  659. .comments .h {
  660. height: 102.5rpx;
  661. line-height: 100.5rpx;
  662. width: 718.75rpx;
  663. padding-right: 16rpx;
  664. border-bottom: 1px solid #d9d9d9;
  665. }
  666. .comments .h .t {
  667. display: block;
  668. float: left;
  669. width: 50%;
  670. font-size: 38.5rpx;
  671. color: #333;
  672. }
  673. .comments .h .i {
  674. display: block;
  675. float: right;
  676. width: 164rpx;
  677. height: 100.5rpx;
  678. line-height: 100.5rpx;
  679. background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/address-right-990628faa7.png) right center no-repeat;
  680. background-size: 52rpx;
  681. }
  682. .comments .b {
  683. height: auto;
  684. width: 720rpx;
  685. }
  686. .comments .item {
  687. height: auto;
  688. width: 720rpx;
  689. overflow: hidden;
  690. }
  691. .comments .info {
  692. height: 127rpx;
  693. width: 100%;
  694. padding: 33rpx 0 27rpx 0;
  695. }
  696. .comments .user {
  697. float: left;
  698. width: auto;
  699. height: 67rpx;
  700. line-height: 67rpx;
  701. font-size: 0;
  702. }
  703. .comments .user image {
  704. float: left;
  705. width: 67rpx;
  706. height: 67rpx;
  707. margin-right: 17rpx;
  708. border-radius: 50%;
  709. }
  710. .comments .user text {
  711. display: inline-block;
  712. width: auto;
  713. height: 66rpx;
  714. overflow: hidden;
  715. font-size: 29rpx;
  716. line-height: 66rpx;
  717. }
  718. .comments .time {
  719. display: block;
  720. float: right;
  721. width: auto;
  722. height: 67rpx;
  723. line-height: 67rpx;
  724. color: #7f7f7f;
  725. font-size: 25rpx;
  726. margin-right: 30rpx;
  727. }
  728. .comments .content {
  729. width: 720rpx;
  730. padding-right: 30rpx;
  731. line-height: 45.8rpx;
  732. font-size: 29rpx;
  733. margin-bottom: 24rpx;
  734. }
  735. .comments .imgs {
  736. width: 720rpx;
  737. height: auto;
  738. margin-bottom: 25rpx;
  739. }
  740. .comments .imgs .img {
  741. height: 150rpx;
  742. width: 150rpx;
  743. margin-right: 28rpx;
  744. }
  745. .comments .spec {
  746. width: 720rpx;
  747. padding-right: 30rpx;
  748. line-height: 30rpx;
  749. font-size: 24rpx;
  750. color: #999;
  751. margin-bottom: 30rpx;
  752. }
  753. .goods-attr {
  754. width: 750rpx;
  755. height: auto;
  756. overflow: hidden;
  757. padding: 0 31.25rpx 25rpx 31.25rpx;
  758. background: #fff;
  759. }
  760. .goods-attr .t {
  761. width: 687.5rpx;
  762. height: 104rpx;
  763. line-height: 104rpx;
  764. font-size: 38.5rpx;
  765. }
  766. .goods-attr .item {
  767. width: 687.5rpx;
  768. height: 68rpx;
  769. padding: 11rpx 20rpx;
  770. margin-bottom: 11rpx;
  771. background: #f7f7f7;
  772. font-size: 38.5rpx;
  773. }
  774. .goods-attr .left {
  775. float: left;
  776. font-size: 25rpx;
  777. width: 134rpx;
  778. height: 45rpx;
  779. line-height: 45rpx;
  780. overflow: hidden;
  781. color: #999;
  782. }
  783. .goods-attr .right {
  784. float: left;
  785. font-size: 36.5rpx;
  786. margin-left: 20rpx;
  787. width: 480rpx;
  788. height: 45rpx;
  789. line-height: 45rpx;
  790. overflow: hidden;
  791. color: #333;
  792. }
  793. .detail {
  794. width: 750rpx;
  795. height: auto;
  796. overflow: hidden;
  797. }
  798. .detail image {
  799. width: 750rpx;
  800. display: block;
  801. }
  802. .common-problem {
  803. width: 750rpx;
  804. height: auto;
  805. overflow: hidden;
  806. }
  807. .common-problem .h {
  808. position: relative;
  809. height: 145.5rpx;
  810. width: 750rpx;
  811. padding: 56.25rpx 0;
  812. background: #fff;
  813. text-align: center;
  814. }
  815. .common-problem .h .line {
  816. display: inline-block;
  817. position: absolute;
  818. top: 72rpx;
  819. left: 0;
  820. z-index: 2;
  821. height: 1px;
  822. margin-left: 225rpx;
  823. width: 300rpx;
  824. background: #ccc;
  825. }
  826. .common-problem .h .title {
  827. display: inline-block;
  828. position: absolute;
  829. top: 56.125rpx;
  830. left: 0;
  831. z-index: 3;
  832. height: 33rpx;
  833. margin-left: 285rpx;
  834. width: 180rpx;
  835. background: #fff;
  836. }
  837. .common-problem .b {
  838. width: 750rpx;
  839. height: auto;
  840. overflow: hidden;
  841. padding: 0rpx 30rpx;
  842. background: #fff;
  843. }
  844. .common-problem .item {
  845. height: auto;
  846. overflow: hidden;
  847. padding-bottom: 25rpx;
  848. }
  849. .common-problem .question-box .spot {
  850. float: left;
  851. display: block;
  852. height: 8rpx;
  853. width: 8rpx;
  854. background: #b4282d;
  855. border-radius: 50%;
  856. margin-top: 11rpx;
  857. }
  858. .common-problem .question-box .question {
  859. float: left;
  860. line-height: 30rpx;
  861. padding-left: 8rpx;
  862. display: block;
  863. font-size: 26rpx;
  864. padding-bottom: 15rpx;
  865. color: #303030;
  866. }
  867. .common-problem .answer {
  868. line-height: 36rpx;
  869. padding-left: 16rpx;
  870. font-size: 26rpx;
  871. color: #787878;
  872. }
  873. .related-goods {
  874. width: 750rpx;
  875. height: auto;
  876. overflow: hidden;
  877. }
  878. .related-goods .h {
  879. position: relative;
  880. height: 145.5rpx;
  881. width: 750rpx;
  882. padding: 56.25rpx 0;
  883. background: #fff;
  884. text-align: center;
  885. border-bottom: 1px solid #f4f4f4;
  886. }
  887. .related-goods .h .line {
  888. display: inline-block;
  889. position: absolute;
  890. top: 72rpx;
  891. left: 0;
  892. z-index: 2;
  893. height: 1px;
  894. margin-left: 225rpx;
  895. width: 300rpx;
  896. background: #ccc;
  897. }
  898. .related-goods .h .title {
  899. display: inline-block;
  900. position: absolute;
  901. top: 56.125rpx;
  902. left: 0;
  903. z-index: 3;
  904. height: 33rpx;
  905. margin-left: 285rpx;
  906. width: 180rpx;
  907. background: #fff;
  908. }
  909. .related-goods .b {
  910. width: 750rpx;
  911. height: auto;
  912. overflow: hidden;
  913. }
  914. .related-goods .b .item {
  915. float: left;
  916. background: #fff;
  917. width: 375rpx;
  918. height: auto;
  919. overflow: hidden;
  920. text-align: center;
  921. padding: 15rpx 31.25rpx;
  922. border-right: 1px solid #f4f4f4;
  923. border-bottom: 1px solid #f4f4f4;
  924. }
  925. .related-goods .item .img {
  926. width: 311.45rpx;
  927. height: 311.45rpx;
  928. }
  929. .related-goods .item .name {
  930. display: block;
  931. width: 311.45rpx;
  932. height: 35rpx;
  933. margin: 11.5rpx 0 15rpx 0;
  934. text-align: center;
  935. overflow: hidden;
  936. font-size: 30rpx;
  937. color: #333;
  938. }
  939. .related-goods .item .price {
  940. display: block;
  941. width: 311.45rpx;
  942. height: 30rpx;
  943. text-align: center;
  944. font-size: 30rpx;
  945. color: #b4282d;
  946. }
  947. .bottom-btn {
  948. position: fixed;
  949. left: 0;
  950. bottom: 0;
  951. z-index: 10;
  952. width: 750rpx;
  953. height: 100rpx;
  954. display: flex;
  955. background: #fff;
  956. }
  957. .bottom-btn .l {
  958. float: left;
  959. height: 100rpx;
  960. width: 162rpx;
  961. border: 1px solid #f4f4f4;
  962. display: flex;
  963. align-items: center;
  964. justify-content: center;
  965. }
  966. .bottom-btn .l.l-collect {
  967. border-right: none;
  968. border-left: none;
  969. text-align: center;
  970. }
  971. .bottom-btn .l.l-cart .box {
  972. position: relative;
  973. height: 60rpx;
  974. width: 60rpx;
  975. }
  976. .bottom-btn .l.l-cart .cart-count {
  977. height: 28rpx;
  978. width: 28rpx;
  979. z-index: 10;
  980. position: absolute;
  981. top: 0;
  982. right: 0;
  983. background: #b4282d;
  984. text-align: center;
  985. font-size: 18rpx;
  986. color: #fff;
  987. line-height: 28rpx;
  988. border-radius: 50%;
  989. }
  990. .bottom-btn .l.l-cart .icon {
  991. position: absolute;
  992. top: 10rpx;
  993. left: 0;
  994. }
  995. .bottom-btn .l .icon {
  996. display: block;
  997. height: 44rpx;
  998. width: 44rpx;
  999. }
  1000. .bottom-btn .c {
  1001. float: left;
  1002. height: 100rpx;
  1003. line-height: 96rpx;
  1004. flex: 1;
  1005. text-align: center;
  1006. color: #333;
  1007. border-top: 1px solid #f4f4f4;
  1008. border-bottom: 1px solid #f4f4f4;
  1009. }
  1010. .bottom-btn .r {
  1011. border: 1px solid #b4282d;
  1012. background: #b4282d;
  1013. float: left;
  1014. height: 100rpx;
  1015. line-height: 96rpx;
  1016. flex: 1;
  1017. text-align: center;
  1018. color: #fff;
  1019. }
  1020. .attr-pop {
  1021. width: 100%;
  1022. height: 100%;
  1023. padding: 31.25rpx;
  1024. background: #fff;
  1025. }
  1026. .attr-pop .img-info {
  1027. width: 687.5rpx;
  1028. height: 177rpx;
  1029. overflow: hidden;
  1030. margin-bottom: 41.5rpx;
  1031. }
  1032. .attr-pop .img {
  1033. float: left;
  1034. height: 177rpx;
  1035. width: 177rpx;
  1036. background: #f4f4f4;
  1037. margin-right: 31.25rpx;
  1038. }
  1039. .attr-pop .info {
  1040. float: left;
  1041. height: 177rpx;
  1042. display: flex;
  1043. align-items: center;
  1044. }
  1045. .attr-pop .p {
  1046. font-size: 33rpx;
  1047. color: #333;
  1048. height: 33rpx;
  1049. line-height: 33rpx;
  1050. margin-bottom: 10rpx;
  1051. overflow: hidden;
  1052. }
  1053. .attr-pop .a {
  1054. font-size: 29rpx;
  1055. color: #333;
  1056. height: 40rpx;
  1057. line-height: 40rpx;
  1058. }
  1059. .spec-con {
  1060. width: 100%;
  1061. height: auto;
  1062. overflow: hidden;
  1063. }
  1064. .spec-con .name {
  1065. margin-bottom: 22rpx;
  1066. font-size: 29rpx;
  1067. color: #333;
  1068. }
  1069. .spec-con .values {
  1070. height: auto;
  1071. margin-bottom: 31.25rpx;
  1072. font-size: 0;
  1073. }
  1074. .spec-con .value {
  1075. display: inline-block;
  1076. height: 62rpx;
  1077. padding: 0 35rpx;
  1078. line-height: 56rpx;
  1079. text-align: center;
  1080. margin-right: 25rpx;
  1081. margin-bottom: 16.5rpx;
  1082. border: 1px solid #333;
  1083. font-size: 25rpx;
  1084. color: #333;
  1085. }
  1086. .spec-con .value.disable {
  1087. border: 1px solid #ccc;
  1088. color: #ccc;
  1089. }
  1090. .spec-con .value.selected {
  1091. border: 1px solid #b4282d;
  1092. color: #b4282d;
  1093. }
  1094. .number-item .selnum {
  1095. width: 322rpx;
  1096. height: 71rpx;
  1097. border: 1px solid #ccc;
  1098. display: flex;
  1099. }
  1100. .number-item .cut {
  1101. width: 93.75rpx;
  1102. height: 100%;
  1103. text-align: center;
  1104. line-height: 65rpx;
  1105. }
  1106. .number-item .number {
  1107. flex: 1;
  1108. height: 100%;
  1109. text-align: center;
  1110. line-height: 68.75rpx;
  1111. border-left: 1px solid #ccc;
  1112. border-right: 1px solid #ccc;
  1113. float: left;
  1114. }
  1115. .number-item .add {
  1116. width: 93.75rpx;
  1117. height: 100%;
  1118. text-align: center;
  1119. line-height: 65rpx;
  1120. }
  1121. </style>