You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

823 lines
21 KiB

6 months ago
  1. <template>
  2. <view class="content">
  3. <view class="navbar" :style="{position:headerPosition,top:headerTop}">
  4. <view class="nav-item" :class="{current: filterIndex === 0}" @click="tabClick(0)">
  5. 综合排序
  6. </view>
  7. <view class="nav-item" :class="{current: filterIndex === 1}" @click="tabClick(1)">
  8. 销量优先
  9. </view>
  10. <view class="nav-item" :class="{current: filterIndex === 2}" @click="tabClick(2)">
  11. <text>价格</text>
  12. <view class="p-box">
  13. <text :class="{active: priceOrder === 1 && filterIndex === 2}" class="yticon icon-shang"></text>
  14. <text :class="{active: priceOrder === 2 && filterIndex === 2}" class="yticon icon-shang xia"></text>
  15. </view>
  16. </view>
  17. <!-- 跳到购物车 -->
  18. <navigator url="/pages/cart/cart" open-type="switchTab"><text class=" cate-item yticon icon-gouwuche"></text></navigator>
  19. </view>
  20. <view class="goods-list">
  21. <view
  22. v-for="(item, index) in goodsList" :key="index"
  23. class="goods-item">
  24. <view class="image-wrapper" @click="toGoods(item)">
  25. <image :src="item.img" mode="aspectFill"></image>
  26. </view>
  27. <text class="title clamp" @click="toGoods(item)">{{item.mc}}&nbsp;{{item.gg}}{{item.dw}}</text>
  28. <!-- <view>
  29. <text class="sdtext">{{ item.sdtext }}</text>
  30. <text class="sellnum">售量&nbsp;{{ item.sellnum }}</text>
  31. </view> -->
  32. <view v-if="item.inputnum">
  33. <input style="font-size: 28upx;color: #41A863;" type="text" :value="item.bz" @input="inputchangeBz($event,item.bz,item.id,item.kcnum)" placeholder="输入备注">
  34. <input style="font-size: 28upx;color: #41A863;" type="text" :value="item.fudw" @input="inputchangeFudw($event,item.fudw,item.id,item.kcnum)" placeholder="输入副单位">
  35. </view>
  36. <view class="price-box">
  37. <view class="info">
  38. <view class="price" v-if="item.price>0">{{ item.price }}{{item.dw}}</view>
  39. <!-- <view class="slogan">库存&nbsp;{{ item.kcnum }}</view> -->
  40. </view>
  41. <view style="display: flex; justify-content: space-between; width: 100%;">
  42. <!-- <view v-if="item.kcnum==0" class="cart"><cjl-icon color="#909399" size='50'>&#xe60f;</cjl-icon></view> -->
  43. <!-- <view v-if="item.kcnum" @click="addshopcat(item.id)" class="cart"><cjl-icon color="#3883FA" size='50'>&#xe60f;</cjl-icon></view>
  44. <text class="checknum" v-if="item.shownum">{{item.shownum}}</text>
  45. -->
  46. <view class="p-b-btn" :class="{active: item.iscollect}" @click="toFavorite(item.id,index)">
  47. <text class="yticon icon-shoucang"></text>
  48. </view>
  49. <view class="number" v-if="item.kcnum">
  50. <view class="sub" @tap.stop="sub(item.id)" >
  51. <view class="jian">-</view>
  52. </view>
  53. <view class="input" @tap.stop="discard" >
  54. <input type="digit" v-model="item.inputnum==0?'':item.inputnum" @input="inputchange($event,item.inputnum,item.id,item.kcnum,0)" />
  55. </view>
  56. <view class="add" @tap.stop="add(item.id,0)">
  57. <view class="jia">
  58. <image src="../../static/img/addicon.png"></image>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="shouqinimg" v-if="item.kcnum==0">
  65. <image src="/static/img/nocknum.png" ></image>
  66. </view>
  67. </view>
  68. </view>
  69. <uni-load-more :status="loadingType"></uni-load-more>
  70. </view>
  71. </template>
  72. <script>
  73. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  74. export default {
  75. components: {
  76. uniLoadMore
  77. },
  78. data() {
  79. return {
  80. cateMaskState: 0, //分类面板展开状态
  81. headerPosition:"fixed",
  82. headerTop:"0px",
  83. loadingType: 'more', //加载更多状态
  84. filterIndex: 0,
  85. cateId: 0, //已选三级分类id
  86. priceOrder: 0, //1 价格从低到高 2价格从高到低
  87. goodsList: [],
  88. favorite: true,
  89. cartlist:[],
  90. dflid:0,
  91. cpid:0,
  92. };
  93. },
  94. onLoad(options){
  95. // #ifdef H5
  96. this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight+'px';
  97. // #endif
  98. this.cateId = options.fid;
  99. this.cpid = options.cpid;
  100. this.dflid=options.dflid;
  101. this.keyword=options.keyword
  102. this.loadData();
  103. //this.getgoodlist();
  104. },
  105. onShow(){
  106. this.checkshownum()
  107. },
  108. onPageScroll(e){
  109. //兼容iOS端下拉时顶部漂移
  110. if(e.scrollTop>=0){
  111. this.headerPosition = "fixed";
  112. }else{
  113. this.headerPosition = "absolute";
  114. }
  115. },
  116. //下拉刷新
  117. onPullDownRefresh(){
  118. this.loadData('refresh');
  119. },
  120. //加载更多
  121. onReachBottom(){
  122. this.loadData();
  123. },
  124. methods: {
  125. //减操作
  126. sub(id) {
  127. let getcartlist = uni.getStorageSync('cartlist');
  128. let isexit = this.findidfromstor(id);
  129. let delid = 0;
  130. for (let i = 0; i < getcartlist.length; i++) {
  131. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  132. getcartlist[i].num--; //数量减
  133. if (getcartlist[i].num <= 0) {
  134. //删除当前商品缓存
  135. getcartlist.splice(i, 1);
  136. uni.setStorageSync('cartlist', getcartlist)
  137. break; //跳出循环
  138. } else {
  139. getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  140. uni.setStorageSync('cartlist', getcartlist)
  141. break; //跳出循环
  142. }
  143. }
  144. }
  145. this.checkshownum();
  146. },
  147. // 增加数量,type 0-推荐商品,1-猜你喜欢商品
  148. add(id, type) {
  149. let getcartlist = uni.getStorageSync('cartlist');
  150. //首次加购物车
  151. if (getcartlist == '') {
  152. this.goodsLists = [];
  153. this.goodsLists.push(this.findarrbyid(id));
  154. //计算每个商品的总价格
  155. this.goodsLists.map((item, index) => {
  156. item.total = parseFloat((item.price * item.num) * 100) / 100
  157. });
  158. uni.setStorageSync('cartlist', this.goodsLists);
  159. } else {
  160. //已有商品在购物车
  161. let isexit = this.findidfromstor(id);
  162. if (!isexit) {
  163. //购物车中还没当前商品
  164. //不存在
  165. getcartlist.push(this.findarrbyid(id));
  166. for (let i = 0; i < getcartlist.length; i++) {
  167. if (id == getcartlist[i].id) {
  168. getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  169. }
  170. }
  171. uni.setStorageSync('cartlist', getcartlist);
  172. } else {
  173. //存在
  174. for (let i = 0; i < getcartlist.length; i++) {
  175. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  176. getcartlist[i].num++; //数量自增
  177. if (getcartlist[i].num > getcartlist[i].kcnum) {
  178. uni.showToast({
  179. title: '库存不足!',
  180. icon: 'none'
  181. })
  182. break; //跳出循环
  183. } else {
  184. getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  185. uni.setStorageSync('cartlist', getcartlist)
  186. break; //跳出循环
  187. }
  188. }
  189. }
  190. }
  191. }
  192. this.checkshownum();
  193. //更新本地储存
  194. },
  195. // input框直接加入购物车
  196. inputadd(id, type,inputnum) {
  197. let getcartlist = uni.getStorageSync('cartlist');
  198. //首次加购物车
  199. if (getcartlist == '') {
  200. this.goodsLists = [];
  201. this.goodsLists.push(this.findarrbyid(id));
  202. //计算每个商品的总价格
  203. this.goodsLists.map((item, index) => {
  204. item.total = parseFloat((item.price * inputnum) * 100) / 100;
  205. item.num = parseFloat(inputnum);
  206. });
  207. uni.setStorageSync('cartlist', this.goodsLists);
  208. } else {
  209. //已有商品在购物车
  210. let isexit = this.findidfromstor(id);
  211. if (!isexit) {
  212. //购物车中还没当前商品
  213. //不存在
  214. getcartlist.push(this.findarrbyid(id));
  215. for (let i = 0; i < getcartlist.length; i++) {
  216. if (id == getcartlist[i].id) {
  217. // getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  218. getcartlist[i].total = parseFloat((inputnum * getcartlist[i].price) * 100) / 100;
  219. getcartlist[i].num = parseFloat(inputnum);
  220. }
  221. }
  222. uni.setStorageSync('cartlist', getcartlist);
  223. } else {
  224. //存在
  225. for (let i = 0; i < getcartlist.length; i++) {
  226. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  227. getcartlist[i].num=inputnum; //数量自增
  228. if (getcartlist[i].num > getcartlist[i].kcnum) {
  229. uni.showToast({
  230. title: '库存不足!',
  231. icon: 'none'
  232. })
  233. break; //跳出循环
  234. } else {
  235. getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  236. uni.setStorageSync('cartlist', getcartlist)
  237. break; //跳出循环
  238. }
  239. }
  240. }
  241. }
  242. }
  243. this.checkshownum();
  244. },
  245. inputchange(inputsl,inputnum, id, kcnum,type) {
  246. inputnum=parseFloat(inputsl.detail.value);
  247. let getcartlist = uni.getStorageSync('cartlist');
  248. if (inputnum > 0) {
  249. if (inputnum > kcnum) {
  250. uni.showToast({
  251. title: '库存不足',
  252. icon: 'none'
  253. })
  254. return;
  255. }
  256. this.inputadd(id,type,inputnum);//input框直接添加购物车
  257. } else {
  258. for (let i = 0; i < getcartlist.length; i++) {
  259. if (id == getcartlist[i].id) { //找到商品一样的商品
  260. getcartlist[i].num = 0;
  261. uni.setStorageSync('cartlist', getcartlist)
  262. break; //跳出循环
  263. }
  264. }
  265. this.checkshownum();
  266. }
  267. },
  268. inputchangeBz(inputsl,inputnum, id, kcnum) {
  269. inputnum=inputsl.detail.value;
  270. let getcartlist = uni.getStorageSync('cartlist');
  271. let isbz=0;
  272. for (let i = 0; i < getcartlist.length; i++) {
  273. if (id == getcartlist[i].id) { //找到商品一样的商品
  274. getcartlist[i].bz = inputnum;
  275. uni.setStorageSync('cartlist', getcartlist)
  276. isbz=1;
  277. break; //跳出循环
  278. }
  279. }
  280. if(isbz==0){
  281. uni.showToast({title:'请您输入数量后再填备注',icon:'none'});
  282. return;
  283. }
  284. this.checkshownum();
  285. },
  286. inputchangeFudw(inputsl,inputnum, id, kcnum) {
  287. inputnum=inputsl.detail.value;
  288. let getcartlist = uni.getStorageSync('cartlist');
  289. let is=0;
  290. for (let i = 0; i < getcartlist.length; i++) {
  291. if (id == getcartlist[i].id) { //找到商品一样的商品
  292. getcartlist[i].fudw = inputnum;
  293. uni.setStorageSync('cartlist', getcartlist)
  294. is=1;
  295. break; //跳出循环
  296. }
  297. }
  298. if(is==0){
  299. uni.showToast({title:'请您输入数量后再填副单位',icon:'none'});
  300. return;
  301. }
  302. this.checkshownum();
  303. },
  304. //初始化购物车数据
  305. checkshownum() {
  306. let getcartlist = uni.getStorageSync('cartlist');
  307. let carid=[];let carbz=[];let carfudw=[];
  308. for (let i = 0; i < getcartlist.length; i++) {
  309. carid[getcartlist[i]['id']] = getcartlist[i]['num'];
  310. carbz[getcartlist[i]['id']] = getcartlist[i]['bz'];
  311. carfudw[getcartlist[i]['id']] = getcartlist[i]['fudw'];
  312. }
  313. for (let i = 0; i < this.goodsList.length; i++) {
  314. if (carid[this.goodsList[i]['id']]) {
  315. this.$set(this.goodsList[i], 'inputnum', carid[this.goodsList[i]['id']])
  316. this.$set(this.goodsList[i], 'bz', carbz[this.goodsList[i]['id']])
  317. this.$set(this.goodsList[i], 'fudw', carfudw[this.goodsList[i]['id']])
  318. } else {
  319. this.$set(this.goodsList[i], 'inputnum', 0)
  320. this.$set(this.goodsList[i], 'bz', '')
  321. this.$set(this.goodsList[i], 'fudw', '')
  322. }
  323. }
  324. },
  325. //加载商品 ,带下拉刷新和上滑加载
  326. async loadData(type='add', loading) {
  327. //没有更多直接返回
  328. if(type === 'add'){
  329. if(this.loadingType === 'nomore'){
  330. return;
  331. }
  332. this.loadingType = 'loading';
  333. }else{
  334. this.loadingType = 'more'
  335. }
  336. let userinfo=uni.getStorageSync('userinfo');
  337. let getdata;
  338. if(this.dflid>0){
  339. //一级分类
  340. getdata = await this.$api.getgoodlist({action:'goodlist2',uid:userinfo.uid,dflid:this.dflid,keywords:this.keyword});
  341. }else if(this.cpid>0){
  342. getdata = await this.$api.getgoodlist({action:'goodlist2',uid:userinfo.uid,cpid:this.cpid,keywords:this.keyword});
  343. }else{
  344. //二级分类
  345. getdata = await this.$api.getgoodlist({action:'goodlist2',uid:userinfo.uid,fid:this.cateId,keywords:this.keyword});
  346. }
  347. let goodsList=getdata.data;
  348. if(type === 'refresh'){
  349. this.goodsList = [];
  350. }
  351. //筛选,测试数据直接前端筛选了
  352. if(this.filterIndex === 1){
  353. goodsList.sort((a,b)=>b.sellnum - a.sellnum)
  354. }
  355. if(this.filterIndex === 2){
  356. goodsList.sort((a,b)=>{
  357. if(this.priceOrder == 1){
  358. return a.price - b.price;
  359. }
  360. return b.price - a.price;
  361. })
  362. }
  363. this.goodsList = this.goodsList.concat(goodsList);
  364. this.checkshownum();
  365. //判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了)
  366. //this.loadingType = this.goodsList.length > 20 ? 'nomore' : 'more';
  367. this.loadingType = 'nomore';
  368. if(type === 'refresh'){
  369. if(loading == 1){
  370. uni.hideLoading()
  371. }else{
  372. uni.stopPullDownRefresh();
  373. }
  374. }
  375. },
  376. //筛选点击
  377. tabClick(index){
  378. if(this.filterIndex === index && index !== 2){
  379. return;
  380. }
  381. this.filterIndex = index;
  382. if(index === 2){
  383. this.priceOrder = this.priceOrder === 1 ? 2: 1;
  384. }else{
  385. this.priceOrder = 0;
  386. }
  387. uni.pageScrollTo({
  388. duration: 300,
  389. scrollTop: 0
  390. })
  391. this.loadData('refresh', 1);
  392. uni.showLoading({
  393. title: '正在加载'
  394. })
  395. },
  396. stopPrevent(){},
  397. async addcollection(id, index) {
  398. let userinfo=uni.getStorageSync('userinfo');
  399. let type=!this.goodsList[index].iscollect;
  400. if(userinfo){
  401. let redata=await this.$api.addcollection({action:'addcollection',type:type,uid:userinfo.uid,id:id});
  402. uni.showToast({
  403. title:redata.msg,icon:'none'
  404. })
  405. if(redata.code==1){
  406. this.goodsList[index].iscollect=!this.goodsList[index].iscollect;
  407. }
  408. }else{
  409. uni.navigateTo({
  410. url:'/pages/user/login'
  411. })
  412. }
  413. },
  414. //收藏
  415. toFavorite(id,index){
  416. this.addcollection(id,index);
  417. },
  418. //添加浏览记录
  419. async add_read_record(id,uid) {
  420. await this.$api.add_read_record({action:'add_read_record',cpid:id,uid:uid});
  421. },
  422. addshopcat(id){
  423. let getcartlist=uni.getStorageSync('cartlist');
  424. let userinfo=uni.getStorageSync('userinfo');
  425. if(userinfo.uid>0){
  426. this.add_read_record(id,userinfo.uid)
  427. }
  428. if(getcartlist==''){
  429. this.cartlist.push(this.findarrbyid(id));
  430. this.cartlist.map((item,index)=>{
  431. item.total=parseFloat((item.price*item.num)*100)/100
  432. });
  433. uni.setStorageSync('cartlist',this.cartlist);
  434. }else{
  435. let isexit=this.findidfromstor(id);
  436. if(!isexit){
  437. //不存在
  438. getcartlist.push(this.findarrbyid(id));
  439. for(let i=0;i<getcartlist.length;i++){
  440. if(id==getcartlist[i].id ){
  441. getcartlist[i].total=parseFloat((getcartlist[i].num*getcartlist[i].price)*100)/100
  442. }
  443. }
  444. uni.setStorageSync('cartlist',getcartlist);
  445. }else{
  446. //存在
  447. for(let i=0;i<getcartlist.length;i++){
  448. if(isexit.id==getcartlist[i].id )
  449. { //找到商品一样的商品
  450. getcartlist[i].num++;//数量自增
  451. if(getcartlist[i].num>getcartlist[i].kcnum){
  452. uni.showToast({
  453. title:'库存不足!',icon:'none'
  454. })
  455. break;//跳出循环
  456. }else{
  457. getcartlist[i].total=parseFloat((getcartlist[i].num*getcartlist[i].price)*100)/100
  458. uni.setStorageSync('cartlist',getcartlist)
  459. break;//跳出循环
  460. }
  461. }
  462. }
  463. }
  464. }
  465. this.checkshownum();
  466. },
  467. //根据数组指定key获取当前数组
  468. findarrbyid(id){
  469. let arr=this.goodsList;
  470. for(let i=0;i<arr.length;i++){
  471. if(arr[i]['id']==id){
  472. return arr[i];
  473. break;//跳出循环
  474. }
  475. }
  476. },
  477. //从本地存储中根据id获取数组
  478. findidfromstor(id){
  479. let arr=uni.getStorageSync('cartlist');
  480. for(let i=0;i<arr.length;i++){
  481. if(arr[i]['id']==id){
  482. return arr[i];
  483. break;//跳出循环
  484. }
  485. }
  486. },
  487. //跳详情页
  488. toGoods(good){
  489. uni.navigateTo({
  490. url:'../product/detail?gid='+good.id+"&price="+good.price
  491. })
  492. }
  493. },
  494. }
  495. </script>
  496. <style lang="scss">
  497. page, .content{
  498. background: $page-color-base;
  499. }
  500. .content{
  501. padding-top: 96upx;
  502. }
  503. .info {
  504. display: flex;
  505. justify-content: space-between;
  506. align-items: flex-end;
  507. width: 100%;
  508. padding: 10upx 4% 10upx 0;
  509. .price {
  510. color: #e65339;
  511. font-size: 30upx;
  512. font-weight: 600;
  513. }
  514. .slogan {
  515. color: #807c87;
  516. font-size: 24upx;
  517. }
  518. }
  519. .number {
  520. display: flex;
  521. justify-content: flex-end;
  522. margin-right: 30upx;
  523. margin-bottom: 10upx;
  524. .input {
  525. width: 70upx;
  526. height: 45upx;
  527. margin: 0 10upx;
  528. // background-color: #f3f3f3;
  529. border-bottom: 1upx #ADADAD solid;
  530. input {
  531. width: 60upx;
  532. height: 60upx;
  533. display: flex;
  534. justify-content: center;
  535. align-items: center;
  536. text-align: center;
  537. font-size: 26upx;
  538. }
  539. }
  540. .sub,
  541. .add {
  542. width: 45upx;
  543. height: 45upx;
  544. border-radius: 5upx;
  545. }
  546. .jia {
  547. display: flex;
  548. width: 45upx;
  549. height: 45upx;
  550. justify-content: center;
  551. justify-items: center;
  552. align-items: center;
  553. background-color: #41A863;
  554. color: #fff;
  555. border-radius: 50%;
  556. image {
  557. width: 40upx;
  558. height: 40upx;
  559. padding: 7upx;
  560. }
  561. }
  562. .jian {
  563. display: flex;
  564. width: 45upx;
  565. height: 45upx;
  566. justify-content: center;
  567. justify-items: center;
  568. align-items: center;
  569. background-color: #41A863;
  570. color: #fff;
  571. border-radius: 50%;
  572. padding-bottom: 10upx;
  573. }
  574. }
  575. .navbar{
  576. position: fixed;
  577. left: 0;
  578. top: var(--window-top);
  579. display: flex;
  580. width: 100%;
  581. height: 80upx;
  582. background: #fff;
  583. box-shadow: 0 2upx 10upx rgba(0,0,0,.06);
  584. z-index: 10;
  585. .nav-item{
  586. flex: 1;
  587. display: flex;
  588. justify-content: center;
  589. align-items: center;
  590. height: 100%;
  591. font-size: 30upx;
  592. color: $font-color-dark;
  593. position: relative;
  594. &.current{
  595. color: #3883FA;
  596. &:after{
  597. content: '';
  598. position: absolute;
  599. left: 50%;
  600. bottom: 0;
  601. transform: translateX(-50%);
  602. width: 120upx;
  603. height: 0;
  604. border-bottom: 4upx solid #3883FA;
  605. }
  606. }
  607. }
  608. .p-box{
  609. display: flex;
  610. flex-direction: column;
  611. .yticon{
  612. display: flex;
  613. align-items: center;
  614. justify-content: center;
  615. width: 30upx;
  616. height: 14upx;
  617. line-height: 1;
  618. margin-left: 4upx;
  619. font-size: 26upx;
  620. color: #888;
  621. &.active{
  622. color: #2C74E5;
  623. }
  624. }
  625. &.active, &.active .yticon{
  626. color: $uni-color-primary;
  627. }
  628. .xia{
  629. transform: scaleY(-1);
  630. }
  631. }
  632. .cate-item{
  633. display: flex;
  634. justify-content: center;
  635. align-items: center;
  636. height: 100%;
  637. width: 100upx;
  638. position: relative;
  639. font-size: 44upx;
  640. &:after{
  641. content: '';
  642. position: absolute;
  643. left: 0;
  644. top: 50%;
  645. transform: translateY(-50%);
  646. border-left: 1px solid #ddd;
  647. width: 0;
  648. height: 36upx;
  649. }
  650. }
  651. }
  652. /* 商品列表 */
  653. .goods-list{
  654. display:flex;
  655. flex-wrap:wrap;
  656. padding: 0 30upx;
  657. background: #fff;
  658. .goods-item{
  659. display:flex;
  660. flex-direction: column;
  661. width: 48%;
  662. padding-bottom: 40upx;
  663. &:nth-child(2n+1){
  664. margin-right: 4%;
  665. }
  666. .sdtext{
  667. padding: 2upx 8upx;
  668. border: 1upx #DBDBDB solid;
  669. border-radius: 5upx;
  670. color: #B9B9B9;
  671. font-size: 25upx;
  672. margin-top: 3upx;
  673. }
  674. .sellnum{
  675. font-size: 25upx;
  676. padding-left: 15upx;
  677. color: #B9B9B9;
  678. }
  679. }
  680. .shouqinimg{
  681. position: relative;
  682. image{
  683. width: 250upx;
  684. height: 250upx;
  685. position: absolute;
  686. bottom: 200upx;
  687. right: 40upx;
  688. z-index: 100;
  689. }
  690. }
  691. .image-wrapper{
  692. width: 100%;
  693. height: 330upx;
  694. border-radius: 3px;
  695. overflow: hidden;
  696. image{
  697. width: 100%;
  698. height: 100%;
  699. opacity: 1;
  700. }
  701. }
  702. .title{
  703. font-size: $font-lg;
  704. color: $font-color-dark;
  705. line-height: 80upx;
  706. }
  707. .price-box{
  708. display: flex;
  709. align-items: center;
  710. // justify-content: space-between;
  711. flex-direction: column;
  712. // padding-right: 10upx;
  713. font-size: 24upx;
  714. color: $font-color-light;
  715. .waitsell{
  716. font-size: 24upx;
  717. color: #F2F5F2;
  718. padding: 5upx;
  719. border-radius: 3upx;
  720. background-color: #B7B7B7;
  721. text-align: center;
  722. }
  723. .btright{
  724. display: flex;
  725. align-items: center;
  726. .nosell{
  727. display: flex;
  728. justify-content: flex-end;
  729. text{
  730. position: relative;
  731. right: 5upx;
  732. padding: 5upx;
  733. background-color: #EAEAEA;
  734. color: white;
  735. font-size: 28upx !important;
  736. }
  737. }
  738. .cart{
  739. padding-right: 15upx;
  740. }
  741. .checknum{
  742. width: 38upx;
  743. height: 38upx;
  744. border-radius: 50%;
  745. color: #FFFFFF;
  746. background-color: #FF393B;
  747. position: relative;
  748. text-align: center;
  749. right: 15upx;
  750. bottom: 25upx;
  751. }
  752. }
  753. .p-b-btn{
  754. display:flex;
  755. flex-direction: column;
  756. align-items: flex-start;
  757. justify-content: flex-start;
  758. font-size: 24upx;
  759. color: $font-color-base;
  760. // width: 96upx;
  761. height: 80upx;
  762. .yticon{
  763. font-size: 40upx;
  764. line-height: 48upx;
  765. color: #F0EAE5;
  766. }
  767. &.active, &.active .yticon{
  768. color: $uni-color-primary;
  769. }
  770. .icon-fenxiang2{
  771. font-size: 42upx;
  772. transform: translateY(-2upx);
  773. }
  774. .icon-shoucang{
  775. font-size: 50upx;
  776. }
  777. }
  778. }
  779. .price{
  780. font-size: $font-lg;
  781. color: $uni-color-primary;
  782. line-height: 1;
  783. &:before{
  784. content: '¥';
  785. font-size: 26upx;
  786. }
  787. }
  788. }
  789. </style>