product.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. <template name="product">
  2. <gracePage headerBG="#FFFFFF" footerBg="#FFFFFF" :customHeader="false">
  3. <view slot="gBody" style="padding-bottom:120rpx;">
  4. <!-- 轮播图 -->
  5. <swiper class="grace-swiper" autoplay="true" indicator-dots
  6. indicator-color="rgba(255, 255, 255, 1)" indicator-active-color="#3688FF"
  7. style="height:399rpx" interval="5000">
  8. <swiper-item class="grace-swiper-item" v-for="(v, k) in item.goods.pic" :key="k">
  9. <image :src="v" mode="widthFix" class="grace-swiper-image" style="height:auto"></image>
  10. </swiper-item>
  11. </swiper>
  12. <!-- 商品标题 分享按钮 -->
  13. <view class="grace-product-padding grace-space-between grace-flex-vcenter">
  14. <text class="grace-product-title grace-bold">{{item.goods.name}}</text>
  15. </view>
  16. <!-- 价格 -->
  17. <view class="grace-product-padding">
  18. <view class="grace-nowrap grace-flex-vcenter">
  19. <text class="grace-product-price">¥{{item.goods.price.min.price}}</text>
  20. <text class="grace-text grace-gray grace-line-through" style="margin-left:30rpx;">¥{{item.goods.price.min.s_price}}</text>
  21. </view>
  22. <view class="grace-space-between grace-flex-vcenter" v-if="item.goods.platform == 1">
  23. <text class="grace-text-small grace-gray" v-if="item.goods.freight && item.goods.freight.price">运费 ¥{{item.goods.freight.price}}</text>
  24. <text class="grace-text-small grace-gray">已售 {{item.goods.sell_num}} 件</text>
  25. </view>
  26. </view>
  27. <view class="grace-common-line"></view>
  28. <!-- 底部信息切换导航 -->
  29. <view class="grace-product-padding">
  30. <graceNavBar :items="navItems" lineHeight="80rpx" :isCenter="true"
  31. :currentIndex="active" :size="200" activeLineBg="#FF7900" textAlign="center"
  32. activeColor="#FF7900" activeLineWidth="200rpx" activeLineHeight="2rpx"
  33. :margin="10" @change="navChange"></graceNavBar>
  34. </view>
  35. <!-- 详情 请根据项目情况自行改进 可以使用 富文本-->
  36. <view class="grace-product-padding" :hidden="active == 1">
  37. <dever-content :item="item.goods.content_array" :pics="item.goods.content_pic" :skeleton="false"></dever-content>
  38. </view>
  39. <!-- 评论区 -->
  40. <view class="grace-comments grace-product-padding" :hidden="active == 0">
  41. <view class="grace-comments-items" v-for="(v, k) in fetch.info" :key="k">
  42. <image :src="v.user.avatar" class="grace-comments-face"></image>
  43. <view class="grace-comments-body">
  44. <view class="grace-comments-header">
  45. <text class="grace-comments-header-text">{{v.user.username}}</text>
  46. <text class="grace-comments-info-text">{{v.cdate_string}}</text>
  47. </view>
  48. <text class="grace-comments-content">{{v.content}}</text>
  49. <view class="grace-comments-imgs" v-if="v.pic">
  50. <view class="grace-comments-image" v-for="(v1, k1) in v.pic" :key="k1">
  51. <image :src="v1" mode="widthFix" class="grace-comments-img" @click="Dever.viewPic(v.pic, v1)" style="height:auto"></image>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 属性选择 -->
  58. <graceBottomDialog :show="attrIsShow" @closeDialog="closeAttr">
  59. <form @submit="attrSubmit" style="box-sizing:border-box; padding:10rpx 25rpx;" class="grace-form" slot="content">
  60. <!-- 关闭按钮 -->
  61. <view class="grace-nowrap grace-flex-end">
  62. <text class="grace-icons icon-close" @tap="closeAttr"></text>
  63. </view>
  64. <!-- 头部商品信息 -->
  65. <view class="grace-product-attr-info">
  66. <image class= "grace-product-attr-info-image" mode="widthFix"
  67. :src="item.goods.pic_cover" style="height:auto"></image>
  68. <view class="grace-product-attr-info-body">
  69. <text class="grace-product-attr-info-title">{{item.goods.name}}</text>
  70. <view class="grace-nowrap grace-flex-vcenter">
  71. <text class="grace-product-price">¥{{payPrice}}</text>
  72. <text class="grace-text" style="margin-left:30rpx;" v-if="freight_price > 0">运费 ¥{{freight_price}}</text>
  73. <text class="grace-text grace-gray" style="margin-left:30rpx;">库存:{{kuNum}}件</text>
  74. </view>
  75. </view>
  76. </view>
  77. <view v-if="item.goods.mode > 0">
  78. <view class="grace-form-item grace-border-b">
  79. <text class="grace-form-label">配送方式</text>
  80. <view class="grace-form-body" style="padding:20rpx 0;">
  81. <radio-group name="danxuan" @change="setMode">
  82. <label class="grace-check-item-v" v-if="item.goods.mode == 1 || item.goods.mode == 3"><radio value="1" checked></radio><text style="margin-left:10rpx;">快递</text></label>
  83. <label class="grace-check-item-v" v-if="store_state && (item.goods.mode == 2 || item.goods.mode == 3)"><radio value="2"></radio><text style="margin-left:10rpx;">自提</text></label>
  84. </radio-group>
  85. </view>
  86. </view>
  87. <view class="grace-wrap" style="margin-top: 20rpx;">
  88. <view class="grace-capsule margin" v-if="(item.goods.mode == 1 || item.goods.mode == 3) && mode == 1" @click="openDialog">
  89. <text class="grace-capsule-icon">地址</text>
  90. <text class="grace-capsule-text" v-if="fetch.area_id">{{fetch.area_name}}{{fetch.address}}</text>
  91. <text class="grace-capsule-text" v-if="!fetch.area_id">您还没有收货地址,请点此填写地址</text>
  92. </view>
  93. <view class="grace-capsule margin" v-if="(item.goods.mode == 2 || item.goods.mode == 3) && mode == 2">
  94. <text class="grace-capsule-icon grace-icon-br" style="background:#E76B61;">自提</text>
  95. <picker @change="storeChange" :value="store_index" :range="store_data" v-if="store_state">
  96. <text class="picker grace-capsule-text grace-text-br" style="border-color:#E76B61; color:#E76B61;">
  97. {{store_data[store_index]}}
  98. </text>
  99. </picker>
  100. <text class="grace-capsule-text grace-text-br" style="border-color:#E76B61; color:#E76B61;" v-if="!store_state" @click="openDialog">
  101. 暂无自提点,点此更换地址
  102. </text>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 属性列表区 -->
  107. <scroll-view style="height:700rpx;" scroll-y>
  108. <block v-for="(v, k) in item.goods.sell_attr" :key="k" v-if="item.goods.price_type == 2">
  109. <view class="grace-title grace-margin-top">{{v.name}}</view>
  110. <view><graceSelectTags selectedColor="#FF0036" :items="v.option_sku" type="radio" @change="change"></graceSelectTags></view>
  111. </block>
  112. <view class="grace-margin-top"><text class="grace-title">购买数量</text></view>
  113. <view style="margin-bottom: 40rpx;">
  114. <graceNumberBox :minNum="1" :maxNum="kuNum" :value="buyNum" v-on:change="buyNumChange"></graceNumberBox>
  115. </view>
  116. </scroll-view>
  117. <view class="grace-product-attr-btn">
  118. <button type="warn" style="background-color:#FF0036;" class="grace-button grace-border-radius" formType="submit">立即购买</button>
  119. </view>
  120. </form>
  121. </graceBottomDialog>
  122. <graceDialog ref="graceDialog" :isTitle="true" :isCloseBtn="false" :title="`收货地址`" v-on:closeDialog="closeDialog">
  123. <view class="content2" slot="content">
  124. <form class="grace-form grace-margin-top">
  125. <view class="grace-form-item grace-border-b">
  126. <text class="grace-form-label">您的姓名</text>
  127. <view class="grace-form-body">
  128. <input type="text" class="grace-form-input" name="name" v-model="fetch.address_contact" placeholder="请填写联系姓名"></input>
  129. </view>
  130. </view>
  131. <view class="grace-form-item grace-border-b">
  132. <text class="grace-form-label">联系电话</text>
  133. <view class="grace-form-body">
  134. <input type="number" class="grace-form-input" name="mobile" v-model="fetch.address_mobile" placeholder="请填写联系电话"></input>
  135. </view>
  136. </view>
  137. <view class="grace-form-item grace-border-b">
  138. <text class="grace-form-label">所在地区</text>
  139. <view class="grace-form-body" @tap="openPicker">
  140. <input type="text" class="grace-form-input" name="area" :value="fetch.area_name" disabled placeholder="请选择所在地区"></input>
  141. </view>
  142. </view>
  143. <view class="grace-form-item">
  144. <text class="grace-form-label">详细地址</text>
  145. <view class="grace-form-body">
  146. <input type="text" class="grace-form-input" name="address" v-model="fetch.address" placeholder="请填写详细地址"></input>
  147. </view>
  148. </view>
  149. </form>
  150. </view>
  151. <view slot="btns" class="grace-space-between">
  152. <text class="grace-dialog-buttons" @tap="closeDialog">关闭</text>
  153. <text class="grace-dialog-buttons grace-blue" @tap="setAddress">确认</text>
  154. </view>
  155. </graceDialog>
  156. <y-Fab :bottom="20" :right="140" v-if="!attrIsShow" @click="buyNow" bgColor="#e55d52" text="购买"></y-Fab>
  157. <y-Fab :bottom="20" :right="260" v-if="!attrIsShow" @click="showModal" bgColor="#0fa5e5" text="评价"></y-Fab>
  158. <block v-if="index == -1">
  159. <y-Fab :bottom="20" :right="20" v-if="!attrIsShow" @click="back" text="返回"></y-Fab>
  160. </block>
  161. <view v-if="showComment">
  162. <dever-publish :title="title" :is_upload="true" @hideModal="hideModal" @getRefresh="getRefresh" :type="key" :type_id="item.goods.id" :api="api"></dever-publish>
  163. </view>
  164. <graceAddressPicker :value="address_default" :show="graceAddressPickerShow" @confirm="pickerConfirm" @close="closePicker" cancelTColor="关闭"></graceAddressPicker>
  165. </view>
  166. <!-- 底部 -->
  167. </gracePage>
  168. </template>
  169. <script>
  170. import deverContent from '@/lib/dever/components/content.vue';
  171. import deverPublish from '@/lib/dever/components/publish.vue';
  172. import copyText from "@/lib/clipboard.thorui.js";
  173. export default {
  174. name: "product",
  175. props: {
  176. control : {
  177. type : Object,
  178. value : null
  179. },
  180. bottom : {
  181. type : Object,
  182. value : null
  183. },
  184. item : {
  185. type : Object,
  186. value : null
  187. },
  188. index : 0
  189. },
  190. data() {
  191. return {
  192. title : '发表新评价',
  193. api : 'app/community/?l=api.addComment',
  194. key : 'content/product',
  195. // 切换导航
  196. navItems : ['商品详情', '最新评价'],
  197. active:0,
  198. // 购买选择属性层展示
  199. attrIsShow : false,
  200. attr : '',
  201. attrKey : '',
  202. skuId : 0,
  203. attrSelect : {},
  204. payPrice : 0,
  205. buyNum : 1,
  206. kuNum : 9999,
  207. showComment : false,
  208. fetch : {
  209. info : [],
  210. address : '',
  211. area_name : '',
  212. store : [],
  213. },
  214. mode : -1,
  215. store_state : false,
  216. store_data : [],
  217. store_index : 0,
  218. store_relation : [],
  219. freight_price : 0,
  220. old_freight_price : 0,
  221. graceAddressPickerShow : false,
  222. address_default : [],
  223. }
  224. },
  225. created() {
  226. },
  227. mounted() {
  228. this.bottom[this.index] = this;
  229. if (this.item.goods.freight) {
  230. this.freight_price = this.item.goods.freight.price;
  231. }
  232. if (this.item.goods.mode == 1 || this.item.goods.mode == 3) {
  233. this.mode = 1;
  234. } else if (this.item.goods.mode == 2 || this.item.goods.mode == 3) {
  235. this.mode = 2;
  236. }
  237. this.getInfo();
  238. this.getData(1);
  239. },
  240. methods:{
  241. openPicker : function() {
  242. this.graceAddressPickerShow = true;
  243. },
  244. pickerConfirm : function(e){
  245. if (e.names[0] == e.names[1]) {
  246. this.fetch.area_name = e.names[1] + ' ' + e.names[2];
  247. } else {
  248. this.fetch.area_name = e.names[0] + ' ' + e.names[1] + ' ' + e.names[2];
  249. }
  250. this.fetch.area_name += ' ';
  251. this.fetch.area_id = e.codes[0] + ',' + e.codes[1] + ',' + e.codes[2];
  252. this.closePicker();
  253. },
  254. closePicker : function () {
  255. this.graceAddressPickerShow = false;
  256. },
  257. // 获取地理位置,运费等信息
  258. getInfo : function() {
  259. var self = this;
  260. var data = {};
  261. data.goods_id = this.item.goods.id;
  262. data.noloading = 1;
  263. this.Dever.get(this, 'app/user/?l=api.goods', data, function(t) {
  264. self.address_default = self.fetch.area_id.split(',');
  265. self.setStore(t.store);
  266. });
  267. /*
  268. this.Dever.getLocation('wgs84', '', function(t) {
  269. if (t && t.longitude && t.longitude) {
  270. }
  271. });
  272. */
  273. },
  274. setStore : function(store) {
  275. var data = Object.keys(store);
  276. if (data.length > 0) {
  277. var j = 0;
  278. for (var i in store) {
  279. this.store_data[j] = store[i].name;
  280. this.store_relation[j] = i;
  281. j++;
  282. }
  283. this.store_state = true;
  284. } else {
  285. this.store_data = [];
  286. this.store_relation = [];
  287. this.store_index = 0;
  288. this.store_state = false;
  289. }
  290. },
  291. getData : function(page) {
  292. if (this.active == 0) {
  293. return;
  294. }
  295. this.Dever.page([page, 'info'], this, 'app/community/?l=api.comment', {type:this.key,type_id:this.item.goods.id,user:true});
  296. },
  297. // 导航切换
  298. navChange : function(e){
  299. this.active = e;
  300. if (e == 1) {
  301. this.getData(1);
  302. }
  303. },
  304. storeChange : function(e) {
  305. this.store_index = e.detail.value;
  306. },
  307. //打开属性视图
  308. buyNow : function() {
  309. if (this.item.goods.platform == 1) {
  310. this.attrIsShow = true;
  311. } else {
  312. //this.Dever.alert('加入到口袋里');
  313. var name = this.item.goods.platform_name;
  314. uni.showModal({
  315. content: '该商品是'+name+'平台商品,是否立刻去购买?',
  316. cancelText: '取消',
  317. confirmText: '去购买',
  318. success: res => {
  319. if (res.confirm) {
  320. if (this.item.goods.platform == 2 || this.item.goods.platform == 4) {
  321. this.copy(this.item.goods.code);
  322. this.Dever.alert('已复制,请打开' + name + 'APP即可购买该商品');
  323. } else {
  324. this.Dever.location(this.item.goods.link);
  325. }
  326. }
  327. }
  328. });
  329. }
  330. },
  331. copy : function(value) {
  332. var self = this;
  333. copyText.getClipboardData(value, function(res) {
  334. });
  335. },
  336. back : function() {
  337. uni.navigateBack();
  338. },
  339. // 关闭属性
  340. closeAttr : function() {
  341. this.attrIsShow = false;
  342. },
  343. // 属性选择
  344. change : function (e) {
  345. var temp = e.split('-');
  346. this.attrSelect[temp[0]] = e;
  347. this.getAttrKey();
  348. },
  349. // 购买数量变化
  350. buyNumChange : function (e) {
  351. this.buyNum = e[0];
  352. this.getAttrKey();
  353. },
  354. // 支付
  355. attrSubmit : function(e) {
  356. var data = {};
  357. data.goods_id = this.item.goods.id;
  358. data.price = this.payPrice;
  359. data.num = this.buyNum;
  360. data.sku = this.skuId;
  361. data.code = this.Dever.config.code;
  362. data.mode = this.mode;
  363. if (this.mode == 2) {
  364. if (this.store_data.length < 0) {
  365. this.Dever.alert('暂无自提点,请选择快递');
  366. return;
  367. }
  368. var store = this.fetch.store[this.store_relation[this.store_index]].id;
  369. data.store_id = store;
  370. }
  371. //如果想关闭属性
  372. //this.closeAttr();
  373. var location = 'dream/view?code='+this.Dever.config.code + '&name=' + this.Dever.config.name;
  374. data.refer = this.Dever.host + '/' + location;
  375. var self = this;
  376. this.Dever.post('app/user/?l=pay.product', data, function(t) {
  377. self.Dever.pay(t, location, '支付失败');
  378. });
  379. },
  380. // 获取属性key
  381. getAttrKey : function() {
  382. var key = [];
  383. for (var i in this.attrSelect) {
  384. key.push(this.attrSelect[i]);
  385. }
  386. this.attrKey = key.join('_');
  387. if (this.item.goods.price_type == 1) {
  388. this.kuNum = parseInt(this.item.goods.num);
  389. this.skuId = 0;
  390. this.payPrice = parseFloat(this.item.goods.price.min.price) * this.buyNum;
  391. } else if (this.item.goods.price_type == 2 && this.item.goods.price.list[this.attrKey]) {
  392. this.kuNum = parseInt(this.item.goods.price.list[this.attrKey].num);
  393. this.skuId = this.item.goods.price.list[this.attrKey].id;
  394. this.payPrice = parseFloat(this.item.goods.price.list[this.attrKey].price) * this.buyNum;
  395. }
  396. if (this.item.goods.freight) {
  397. var freight_price = 0;
  398. this.item.goods.freight.first_num = parseInt(this.item.goods.freight.first_num);
  399. var price = parseFloat(this.item.goods.freight.first_price);
  400. if (this.buyNum > this.item.goods.freight.first_num) {
  401. var num = this.buyNum - this.item.goods.freight.first_num;
  402. price = parseFloat(price + (this.item.goods.freight.next_price*num));
  403. }
  404. if (this.item.goods.freight.type == 2) {
  405. freight_price = this.payPrice*(price/100);
  406. freight_price = freight_price.toFixed(2);
  407. } else {
  408. freight_price = price;
  409. }
  410. if (this.mode == 2) {
  411. this.old_freight_price = freight_price;
  412. } else {
  413. this.freight_price = freight_price;
  414. }
  415. } else {
  416. this.freight_price = 0;
  417. }
  418. return true;
  419. },
  420. showModal : function() {
  421. this.showComment = true;
  422. },
  423. hideModal : function() {
  424. this.showComment = false;
  425. },
  426. getRefresh : function(cate_id, type, type_id, content) {
  427. this.getData(1);
  428. this.hideModal();
  429. },
  430. setMode : function(e) {
  431. this.mode = e.detail.value;
  432. if (this.mode == 2) {
  433. //获取当前位置的自提点
  434. this.old_freight_price = this.freight_price;
  435. this.freight_price = 0;
  436. } else {
  437. this.freight_price = this.old_freight_price;
  438. }
  439. },
  440. openDialog : function() {
  441. this.$refs.graceDialog.open();
  442. },
  443. closeDialog : function() {
  444. this.$refs.graceDialog.hide();
  445. },
  446. setAddress : function() {
  447. var data = {};
  448. data.code = this.Dever.config.code;
  449. data.goods_id = this.item.goods.id;
  450. data.price = this.payPrice;
  451. data.num = this.buyNum;
  452. data.address_contact = this.fetch.address_contact;
  453. data.address_mobile = this.fetch.address_mobile;
  454. data.address = this.fetch.address;
  455. data.area_id = this.fetch.area_id;
  456. //data.noloading = 1;
  457. var self = this;
  458. this.Dever.post('app/user/?l=api.saveAddress', data, function(t) {
  459. self.closeDialog();
  460. self.item.goods.freight = t.freight;
  461. self.setStore(t.store);
  462. self.getAttrKey();
  463. });
  464. }
  465. },
  466. components:{deverContent, deverPublish, copyText}
  467. }
  468. </script>
  469. <style>
  470. .grace-common-line{height:16rpx;}
  471. .grace-product-padding{padding:20rpx 25rpx;}
  472. .grace-product-title{line-height:44rpx; font-size:28rpx;}
  473. .grace-product-share{width:80rpx; height:80rpx; text-align:center; font-size:40rpx; color:#FF7900; line-height:80rpx; flex-shrink:0; margin-left:12px;}
  474. .grace-product-share:after{width:0; height:0;}
  475. .grace-product-price{color:#FF7900; line-height:60rpx; font-size:30rpx; font-weight:bold;}
  476. .grace-product-info-img{width:100%;}
  477. .grace-product-attr-info{overflow:hidden; display:flex; justify-content:space-between; border-bottom:1px solid #F1F1F3; padding-bottom:26rpx;}
  478. .grace-product-attr-info-image{width:120rpx; height:auto; margin-right:10px; flex-shrink:0;}
  479. .grace-product-attr-info-body{width:700rpx;}
  480. .grace-product-attr-info-title{width:100%; font-size:28rpx; color:#333333; display:block;}
  481. .grace-product-attr-info-stone{width:100%; font-size:20rpx; margin-top:8rpx; color:#666666; display:block;}
  482. .icon-close{font-size:30rpx; line-height:80rpx; color:#888888;}
  483. /* 调整宫格大小 */
  484. .grace-grids-items{padding:6rpx 0; width:120rpx;}
  485. .grace-grids-icon{height:50rpx; line-height:50rpx; font-size:40rpx; color:#6B7375;}
  486. .grace-grids-text{line-height:28rpx; font-size:20rpx; margin-top:2px; color:#6B7375;}
  487. .grace-footer-active{color:#FF0036;}
  488. .page-buy {
  489. position: fixed;
  490. right: 120rpx;
  491. bottom: 30rpx;
  492. width: 80rpx;
  493. height: 80rpx;
  494. background: rgb(229, 93, 82);
  495. border-radius: 80rpx;
  496. color: #fff;
  497. font-size: 30rpx;
  498. line-height: 80rpx;
  499. text-align: center;
  500. z-index: 2000;
  501. }
  502. .block1{line-height:80rpx; display:block; width:100%; text-align:center; font-size:28rpx;}
  503. .block2{line-height:66rpx; display:block; width:100%; text-align:center; font-size:28rpx;}
  504. .margin{margin:10rpx 10rpx 0 0;}
  505. .grace-border-b{border-color:#F8F8F8;}
  506. .grace-check-item-v{width:100%; padding:15rpx 15rpx;}
  507. .content1{padding:25rpx; font-size:26rpx; text-align:center; line-height:60rpx;background-color:#F8F8F8; display:block;}
  508. .content2{padding-left:30rpx; padding-right:80rpx; line-height:50rpx; font-size:26rpx;}
  509. /* 图片形式 */
  510. .demo-img{width:580rpx; height:850rpx;}
  511. .grace-dialog-buttons{width:700rpx; line-height:88rpx; height:88rpx; display:block; overflow:hidden; text-align:center; font-size:26rpx; color:#999999;}
  512. .grace-capsule-icon {
  513. white-space: nowrap;
  514. line-height: 34rpx;
  515. text-overflow: ellipsis;
  516. display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
  517. -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  518. -webkit-line-clamp: 1; /** 显示的行数 **/
  519. }
  520. .grace-capsule-text {
  521. line-height : 34rpx;
  522. overflow: hidden;
  523. text-overflow: ellipsis;
  524. word-break: break-all;
  525. display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
  526. -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  527. -webkit-line-clamp: 1; /** 显示的行数 **/
  528. }
  529. </style>