shopManage.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <template>
  2. <view class="u-wrap">
  3. <view class="top-box">
  4. <view class="switch-box">
  5. <u-tabs :list="list1" lineWidth="30" lineColor="$uni-bg-color-primary" @click="handlerChangeTab" :activeStyle="{
  6. color: '#000',
  7. fontSize: '28rpx',
  8. transform: 'scale(1.05)',
  9. marginBottom: '15rpx',
  10. }" :inactiveStyle="{
  11. color: '#333',
  12. fontSize: '30rpx',
  13. transform: 'scale(1)',
  14. marginBottom: '15rpx',
  15. }" itemStyle="width:50%;padding:0;margin:5px 0;"></u-tabs>
  16. </view>
  17. <view class="search-box">
  18. <u--input v-model="search" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399"
  19. class="search-ipt" placeholder="请输入内容" border="surround" clearable></u--input>
  20. <button class="btn" @click="handlerSearchBtn">搜索</button>
  21. </view>
  22. </view>
  23. <!-- 在售中 -->
  24. <view class="u-menu-wrap" v-if="delete_type == 0">
  25. <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
  26. :scroll-into-view="itemId">
  27. <view v-for="(item, index) in tabbar" :key="index" class="u-tab-item"
  28. :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
  29. <text class="u-line-1">{{ item.name }}</text>
  30. </view>
  31. </scroll-view>
  32. <scroll-view :scroll-top="scrollRightTop" :scroll-into-view="itemId" scroll-y scroll-with-animation
  33. class="right-box" @scroll="rightScroll">
  34. <view class="page-view">
  35. <view class="" style="margin-top: 40rpx;" v-if="!tabbar.length">
  36. <u-empty mode="search" iconColor="#dae2ef" width="100" height="100"
  37. icon="https://cdn.uviewui.com/uview/demo/empty/search.png" v-if="!tabbar.length&&search.length!=0">
  38. </u-empty>
  39. <u-empty mode="list" text="暂无下架商品" iconColor="#dae2ef" width="100" height="100"
  40. icon="https://cdn.uviewui.com/uview/demo/empty/list.png" v-else-if="!tabbar.length">
  41. </u-empty>
  42. </view>
  43. <view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index">
  44. <view class="item-title">
  45. <text>{{ item.name }}</text>
  46. </view>
  47. <view class="item-box" v-for="itm of item.children" :key="idx">
  48. <view class="item-l">
  49. <img class="l-img" src="@/static/QR57a.jpg" alt="" />
  50. </view>
  51. <view class="item-r">
  52. <p class="p1">{{ itm.name }}</p>
  53. <p class="p2 ws2 ">{{itm.description}}</p>
  54. <view class=" flex-c">
  55. <view class="mar-right-20 p3">
  56. ¥{{itm.specialPrice}}起
  57. </view>
  58. <view class="gray-color originalPrice">
  59. ¥{{itm.originalPrice}}
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. </view>
  68. <!-- 已下架 -->
  69. <view class="u-menu-wrap" v-if="delete_type == 1">
  70. <scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
  71. <view class="page-view">
  72. <view class="" style="margin-top: 40rpx;" v-if="!tabbar.length">
  73. <u-empty mode="search" iconColor="#dae2ef" width="100" height="100"
  74. icon="https://cdn.uviewui.com/uview/demo/empty/search.png" v-if="!tabbar.length&&search.length!=0">
  75. </u-empty>
  76. <u-empty mode="list" text="暂无下架商品" iconColor="#dae2ef" width="100" height="100"
  77. icon="https://cdn.uviewui.com/uview/demo/empty/list.png" v-else-if="!tabbar.length">
  78. </u-empty>
  79. </view>
  80. <view class="class-item2" :id="'item' + index" v-for="(item, index) in rightTabbar" :key="index">
  81. <view class="item-box" >
  82. <u-checkbox-group >
  83. <u-checkbox v-model="item.checked" shape="circle" @change="checkeChange(item)"></u-checkbox>
  84. </u-checkbox-group>
  85. <view class="item-l">
  86. <img class="l-img" src="@/static/QR57a.jpg" alt="" />
  87. </view>
  88. <view class="item-r">
  89. <p class="p1">{{ item.name }}</p>
  90. <p class="p2 ws2 ">{{item.description}}</p>
  91. <view class=" flex-c">
  92. <view class="mar-right-20 p3">
  93. ¥{{item.specialPrice}}起
  94. </view>
  95. <view class="gray-color originalPrice">
  96. ¥{{item.originalPrice}}
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </scroll-view>
  104. </view>
  105. <view class="bottom-box" v-if="delete_type == 1">
  106. <p @click="upStore">批量上架</p>
  107. <p @click="deleteShop">批量删除</p>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import {
  113. getGoodsList,
  114. upGoods
  115. } from '@/api/client/goods.js'
  116. export default {
  117. data() {
  118. return {
  119. checkboxValue1:[],
  120. scrollTop: 0, //tab标题的滚动条位置
  121. oldScrollTop: 0, // tab标题的滚动条旧位置
  122. current: 0, // 预设当前项的值
  123. menuHeight: 0, // 左边菜单的高度
  124. menuItemHeight: 0, // 左边菜单item的高度
  125. itemId: '', // 栏目右边scroll-view用于滚动的id
  126. arr: [], // 储存距离顶部高度的数组
  127. scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
  128. timer: null, // 定时器
  129. tabbar: [],
  130. tabbar1: [{
  131. name: '蔬菜水果',
  132. foods: [{
  133. cat: 383,
  134. name: '蔬菜',
  135. icon: 'http://nq348.com/uploads/category/20220315/1aeed6fa43b54cd68cce0c4883160f91.png',
  136. key: '蔬菜',
  137. },
  138. {
  139. cat: 384,
  140. name: '食用菌',
  141. icon: 'http://nq348.com/uploads/category/20220418/09839c618b35b510d50151f9a17793ee.png',
  142. key: '食用菌',
  143. },
  144. {
  145. cat: 385,
  146. name: '水果',
  147. icon: 'http://nq348.com/uploads/category/20220418/5294ad2fc7effc9629cbfdb8baf41773.png',
  148. key: '水果',
  149. },
  150. ],
  151. },
  152. {
  153. name: '畜禽养殖',
  154. foods: [{
  155. cat: 388,
  156. name: '禽类',
  157. icon: 'http://nq348.com/uploads/category/20220418/da31895fc5a9aacf93fea6f27f08afd7.png',
  158. key: '禽类',
  159. },
  160. {
  161. cat: 389,
  162. name: '畜类',
  163. icon: 'http://nq348.com/uploads/category/20220418/6352081e3f3b36f9360a933676e9452c.png',
  164. key: '畜类',
  165. },
  166. {
  167. cat: 391,
  168. name: '蛋类',
  169. icon: 'http://nq348.com/uploads/category/20220418/d2e7ab4224679c0c796ba3ddd8a68e2f.png',
  170. key: '蛋类',
  171. },
  172. {
  173. cat: 390,
  174. name: '水产',
  175. icon: 'http://nq348.com/uploads/category/20220418/52a1f1baa7617ef4d4e1a4b344b2fce7.png',
  176. key: '水产',
  177. },
  178. ],
  179. },
  180. {
  181. name: '粮油副食',
  182. foods: [{
  183. cat: 393,
  184. name: '米面粮油',
  185. icon: 'http://nq348.com/uploads/category/20220418/1bb32e319ecf5aa352b7fe26fc265004.png',
  186. key: '米面粮油',
  187. },
  188. {
  189. cat: 394,
  190. name: '坚果干果',
  191. icon: 'http://nq348.com/uploads/category/20220418/6ded13eae4a3b113b5225ca8b99bbfdd.png',
  192. key: '坚果干果',
  193. },
  194. {
  195. cat: 395,
  196. name: '加工食品',
  197. icon: 'http://nq348.com/uploads/category/20220418/1e1c10838799de5834aa77f0f9eb8f40.png',
  198. key: '加工食品',
  199. },
  200. {
  201. cat: 396,
  202. name: '茶烟酒',
  203. icon: 'http://nq348.com/uploads/category/20220418/c43cd994e49023c7efdf2b18b1bca30b.png',
  204. key: '茶烟酒',
  205. },
  206. ],
  207. },
  208. {
  209. name: '花卉苗木',
  210. foods: [{
  211. cat: 398,
  212. name: '鲜花盆景',
  213. icon: 'http://nq348.com/uploads/category/20220418/b21c44045daaa8b8d148981ba9efc2e0.png',
  214. key: '鲜花盆景',
  215. },
  216. {
  217. cat: 399,
  218. name: '果树苗',
  219. icon: 'http://nq348.com/uploads/category/20220418/63ee2b902ff0f4d638d8a5ad770f7641.png',
  220. key: '果树苗',
  221. },
  222. {
  223. cat: 400,
  224. name: '蔬瓜种子',
  225. icon: 'http://nq348.com/uploads/category/20220418/2df521877616ee44fd01aae0434a5815.png',
  226. key: '蔬瓜种子',
  227. },
  228. {
  229. cat: 401,
  230. name: '经济作物',
  231. icon: 'http://nq348.com/uploads/category/20220418/f85be72a98694befd889f30de45a1d64.png',
  232. key: '经济作物',
  233. },
  234. ],
  235. },
  236. {
  237. name: '中草药材',
  238. foods: [{
  239. cat: 403,
  240. name: '全草类',
  241. icon: 'http://nq348.com/uploads/category/20220418/01812c1a83f5db7eafbf3bdae927f134.png',
  242. key: '全草类',
  243. },
  244. {
  245. cat: 405,
  246. name: '根茎皮叶花',
  247. icon: 'http://nq348.com/uploads/category/20220418/dca8dcc814401474d4f19ae7394cc209.png',
  248. key: '根茎皮叶花',
  249. },
  250. {
  251. cat: 406,
  252. name: '滋补品类',
  253. icon: 'http://nq348.com/uploads/category/20220418/33b965295811fdd6f5e672e9a3ce34a2.png',
  254. key: '滋补品类',
  255. },
  256. {
  257. cat: 404,
  258. name: '果实籽仁类',
  259. icon: 'http://nq348.com/uploads/category/20220418/1dc8c46c66b4625d458a7f45787ecef9.png',
  260. key: '果实籽仁类',
  261. },
  262. ],
  263. },
  264. {
  265. name: '其他',
  266. foods: [{
  267. cat: 434,
  268. name: '包装',
  269. icon: 'http://nq348.com/uploads/category/20220418/ebdfd326333344825adbe81dbd89e2c9.png',
  270. key: '包装',
  271. },
  272. {
  273. cat: 435,
  274. name: '安全溯源',
  275. icon: 'http://nq348.com/uploads/category/20220418/03230c63f066f46005abf5f576df0ed1.png',
  276. key: '安全溯源',
  277. },
  278. {
  279. cat: 436,
  280. name: '农用百货',
  281. icon: 'http://nq348.com/uploads/category/20220418/93393f2df3264faba86bb449a0c10a79.png',
  282. key: '农用百货',
  283. },
  284. {
  285. cat: 437,
  286. name: '仓储物流',
  287. icon: 'http://nq348.com/uploads/category/20220418/f553505ebabbcb1bf762b288716cf1e7.png',
  288. key: '仓储物流',
  289. },
  290. ],
  291. },
  292. ],
  293. list1: [{
  294. name: '在售中',
  295. },
  296. {
  297. name: '已下架',
  298. },
  299. ],
  300. checked: false,
  301. search: '',
  302. delete_type: false,
  303. rightTabbar:[]
  304. };
  305. },
  306. /**
  307. * 获取一个目标元素的高度
  308. * @elClass 元素的类名
  309. * @dataVal 储存高度的对象
  310. */
  311. onReady() {
  312. this.getMenuItemTop();
  313. },
  314. watch: {
  315. delete_type(newValue) {
  316. this.scrollRightTop = 0;
  317. this.current = 0;
  318. },
  319. },
  320. computed: {
  321. merchantId() {
  322. return this.$store.state.data.merchantInfo.merchant.id
  323. }
  324. },
  325. created() {
  326. },
  327. onShow() {
  328. this.getGoodsList()
  329. },
  330. methods: {
  331. checkeChange(item){
  332. console.log(item.checked);
  333. item.checked = !item.checked
  334. },
  335. deleteShop() {
  336. },
  337. async upStore() {
  338. console.log(this.rightTabbar)
  339. const res = await upGoods()
  340. },
  341. async getGoodsList() {
  342. const res = await getGoodsList({
  343. merchantId: this.merchantId,
  344. size: 100,
  345. goodsName: this.search,
  346. status: this.delete_type ? 'OFFLINE' : 'ONLINE'
  347. })
  348. console.log(res);
  349. if (res.code == 'OK' && res.data.categories && res.data.goodsList) {
  350. res.data.categories.forEach(obj => {
  351. res.data.goodsList.forEach(item => {
  352. if (obj.id == item.categoryId) {
  353. obj.children.push(item )
  354. }
  355. })
  356. })
  357. this.tabbar = res.data.categories
  358. res.data.categories.forEach(item=>{
  359. item.children.forEach(obj=>{
  360. this.rightTabbar.push({checked:false,...obj})
  361. })
  362. })
  363. } else {
  364. this.tabbar = []
  365. }
  366. },
  367. getElRect(elClass, dataVal) {
  368. new Promise((resolve, reject) => {
  369. const query = uni.createSelectorQuery().in(this);
  370. query
  371. .select('.' + elClass)
  372. .fields({
  373. size: true,
  374. },
  375. res => {
  376. // 如果节点尚未生成,res值为null,循环调用执行
  377. if (!res) {
  378. setTimeout(() => {
  379. this.getElRect(elClass);
  380. }, 10);
  381. return;
  382. }
  383. this[dataVal] = res.height;
  384. resolve();
  385. },
  386. )
  387. .exec();
  388. });
  389. },
  390. getMenuItemTop() {
  391. new Promise(resolve => {
  392. let selectorQuery = uni.createSelectorQuery();
  393. selectorQuery
  394. .selectAll('.class-item')
  395. .boundingClientRect(rects => {
  396. // 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
  397. if (!rects.length) {
  398. setTimeout(() => {
  399. this.getMenuItemTop();
  400. }, 10);
  401. return;
  402. }
  403. rects.forEach(rect => {
  404. // 视情况而定,这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
  405. this.arr.push(rect.top - rects[0].top);
  406. // this.arr.push(rect.top)
  407. resolve();
  408. });
  409. })
  410. .exec();
  411. });
  412. },
  413. /**
  414. * 观测元素相交状态
  415. * 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
  416. * 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
  417. */
  418. async observer() {
  419. this.tabbar.map((val, index) => {
  420. let observer = uni.createIntersectionObserver(this);
  421. observer
  422. .relativeTo('.right-box', {
  423. top: 0,
  424. })
  425. .observe('#item' + index, res => {
  426. if (res.intersectionRatio > 0) {
  427. let id = res.id.substring(4);
  428. this.leftMenuStatus(id);
  429. }
  430. });
  431. });
  432. },
  433. /**
  434. * 设置左边菜单的滚动状态
  435. * @index 传入的 ID
  436. */
  437. async leftMenuStatus(index) {
  438. this.current = index;
  439. // 如果为0,意味着尚未初始化
  440. if (this.menuHeight == 0 || this.menuItemHeight == 0) {
  441. await this.getElRect('menu-scroll-view', 'menuHeight');
  442. await this.getElRect('u-tab-item', 'menuItemHeight');
  443. }
  444. // 将菜单活动item垂直居中
  445. this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
  446. },
  447. /**
  448. * 点击左边的栏目切换
  449. * @index 传入的 ID
  450. */
  451. async swichMenu(index) {
  452. this.$nextTick(() => {
  453. this.itemId = 'item' + index
  454. })
  455. if (this.arr.length == 0) {
  456. await this.getMenuItemTop();
  457. }
  458. if (index == this.current) return;
  459. this.scrollRightTop = this.oldScrollTop;
  460. this.$nextTick(function() {
  461. this.scrollRightTop = this.arr[index];
  462. this.current = index;
  463. this.leftMenuStatus(index);
  464. });
  465. },
  466. /**
  467. * 右边菜单滚动
  468. * 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
  469. */
  470. async rightScroll(e) {
  471. this.oldScrollTop = e.detail.scrollTop;
  472. if (this.arr.length == 0) {
  473. await this.getMenuItemTop();
  474. }
  475. if (this.timer) return;
  476. if (!this.menuHeight) {
  477. await this.getElRect('menu-scroll-view', 'menuHeight');
  478. }
  479. setTimeout(() => {
  480. // 节流
  481. this.timer = null;
  482. // scrollHeight为右边菜单垂直中点位置
  483. // let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
  484. // scrollHeight为右边菜单头部位置
  485. let scrollHeight = e.detail.scrollTop + 20;
  486. for (let i = 0; i < this.arr.length; i++) {
  487. let height1 = this.arr[i];
  488. let height2 = this.arr[i + 1];
  489. if (!height2 || (scrollHeight >= height1 && scrollHeight < height2)) {
  490. this.leftMenuStatus(i);
  491. return;
  492. }
  493. }
  494. }, 10);
  495. },
  496. // 搜索按钮
  497. handlerSearchBtn() {
  498. console.log('search', this.search);
  499. this.getGoodsList()
  500. },
  501. // 切换tab
  502. handlerChangeTab(e) {
  503. if (e.index == 1) {
  504. this.delete_type = true;
  505. } else {
  506. this.delete_type = false;
  507. }
  508. // this.getGoodsList()
  509. },
  510. },
  511. };
  512. </script>
  513. <style lang="scss" scoped>
  514. .top-box {
  515. padding: 0 0 20rpx;
  516. width: 100%;
  517. .switch-box {
  518. width: 100%;
  519. }
  520. .search-box {
  521. display: flex;
  522. justify-content: space-around;
  523. width: 90%;
  524. margin: 20rpx auto 0;
  525. .btn {
  526. width: 160rpx;
  527. height: 70rpx;
  528. background-color: #5992bb;
  529. color: #fff;
  530. text-align: center;
  531. line-height: 70rpx;
  532. font-size: 26rpx;
  533. border-radius: 30rpx;
  534. margin-left: 20rpx;
  535. }
  536. }
  537. }
  538. .u-wrap {
  539. /* #ifdef H5 */
  540. height: calc(100vh - var(--window-top));
  541. /* #endif */
  542. display: flex;
  543. flex-direction: column;
  544. height: 100vh;
  545. }
  546. .u-search-box {
  547. padding: 18rpx 30rpx;
  548. }
  549. .u-menu-wrap {
  550. flex: 1;
  551. display: flex;
  552. overflow: hidden;
  553. }
  554. .u-tab-view {
  555. width: 200rpx;
  556. background-color: #f6f6f6;
  557. }
  558. .u-tab-item {
  559. height: 110rpx;
  560. background: #f6f6f6;
  561. box-sizing: border-box;
  562. display: flex;
  563. align-items: center;
  564. justify-content: center;
  565. font-size: 26rpx;
  566. color: #444;
  567. font-weight: 400;
  568. line-height: 1;
  569. padding: 16rpx 0;
  570. }
  571. .u-tab-item-active {
  572. position: relative;
  573. color: #5f96be;
  574. font-size: 30rpx;
  575. font-weight: 500;
  576. background: #fff;
  577. }
  578. .u-tab-item-active::before {
  579. content: '';
  580. position: absolute;
  581. border-left: 4px solid #5f96be;
  582. height: 52rpx;
  583. left: 0;
  584. top: 29rpx;
  585. }
  586. .u-tab-view {
  587. height: 100%;
  588. }
  589. .right-box {
  590. background-color: rgb(250, 250, 250);
  591. }
  592. .page-view {
  593. padding: 16rpx;
  594. }
  595. .class-item,
  596. .class-item2 {
  597. margin-bottom: 30rpx;
  598. background-color: #fff;
  599. padding: 16rpx;
  600. border-radius: 8rpx;
  601. }
  602. .class-item2 {
  603. margin-bottom: 0;
  604. }
  605. .item-title {
  606. font-size: 26rpx;
  607. text-align: center;
  608. color: #5f96be;
  609. margin-bottom: 20rpx;
  610. }
  611. .item-box {
  612. display: flex;
  613. margin-bottom: 10rpx;
  614. .item-l {
  615. border: 2rpx solid #eef0f0;
  616. border-radius: 20rpx;
  617. margin-right: 20rpx;
  618. .l-img {
  619. width: 140rpx;
  620. height: 130rpx;
  621. border-radius: 20rpx;
  622. }
  623. }
  624. .item-r {
  625. .p1,
  626. .type_p1 {
  627. width: 350rpx;
  628. font-size: 28rpx;
  629. color: #000;
  630. margin-bottom: 5rpx;
  631. overflow-x: hidden;
  632. text-overflow: ellipsis;
  633. white-space: nowrap;
  634. }
  635. .type_p1 {
  636. width: 480rpx;
  637. }
  638. .p2 {
  639. font-size: 24rpx;
  640. color: #a4a5ad;
  641. }
  642. .p3 {
  643. font-size: 26rpx;
  644. color: #d6534d;
  645. }
  646. }
  647. }
  648. .bottom-box {
  649. width: 100%;
  650. background-color: #fff;
  651. padding: 10rpx 20rpx;
  652. height: 100rpx;
  653. border-top: 2rpx solid #f7f7f7;
  654. box-shadow: 0px 7px 10px 7px rgba(0, 0, 0, 0.1);
  655. display: flex;
  656. justify-content: space-around;
  657. line-height: 100rpx;
  658. font-size: 28rpx;
  659. }
  660. ::v-deep .u-input--radius.data-v-fdbb9fe6,
  661. .u-input--square.data-v-fdbb9fe6 {
  662. background-color: #f7f7f7 !important;
  663. padding: 40rpx;
  664. border-radius: 50rpx;
  665. }
  666. .ws2 {
  667. overflow: hidden;
  668. text-overflow: ellipsis;
  669. display: -webkit-box;
  670. -webkit-line-clamp: 2; //两行
  671. -webkit-box-orient: vertical;
  672. height: 70rpx;
  673. }
  674. .flex-c {
  675. display: flex;
  676. align-items: center;
  677. }
  678. .gray-color {
  679. color: #a4a5ad
  680. }
  681. .mar-right-20 {
  682. margin-right: 20rpx;
  683. }
  684. .originalPrice {
  685. text-decoration: line-through
  686. }
  687. </style>