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.

821 lines
22 KiB

6 months ago
  1. <template>
  2. <view>
  3. <!-- 占位 -->
  4. <!-- <view class="place"></view> -->
  5. <!-- 商品列表 -->
  6. <view class="goods-list">
  7. <!-- 空白页 -->
  8. <empty v-if="goodsList.length === 0" tip='购物车是空的哦'></empty>
  9. <view class="row" v-for="(row,index) in goodsList" :key="index">
  10. <!-- 删除按钮 -->
  11. <view class="menu" @tap.stop="deleteGoods(row.id)">
  12. <view class="icon shanchu"></view>
  13. </view>
  14. <!-- 商品 -->
  15. <view class="carrier" :class="[theIndex==index?'open':oldIndex==index?'close':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
  16. <!-- checkbox -->
  17. <view class="checkbox-box" @tap="selected(index)" v-if="row.kucun">
  18. <view class="checkbox">
  19. <view :class="[row.selected?'on':'']"></view>
  20. </view>
  21. </view>
  22. <view class="checkbox-box" v-if="!row.kucun">
  23. <view class="sellq">售空</view>
  24. </view>
  25. <!-- 商品信息 -->
  26. <view class="goods-info" @tap="toGoods(row)">
  27. <view class="img">
  28. <image :src="row.img"></image>
  29. </view>
  30. <view class="info">
  31. <view class="title">{{row.mc}}{{row.gg}}{{row.dw}}</view>
  32. <view class="spbz" style="width: 100%;">
  33. <input style="font-size: 28upx; color: #41A863; height: 40upx; line-height: 40upx; min-height: 40upx;" type="text" :value="row.bz" @input="inputchangeBz($event,row.bz,row.id,index)" placeholder="输入备注">
  34. <input style="font-size: 28upx; color: #41A863; height: 40upx; line-height: 40upx; min-height: 40upx;" type="text" :value="row.fudw" @input="inputchangeFudw($event,row.fudw,row.id,index)" placeholder="输入副单位">
  35. </view>
  36. <view class="kcnum">库存&nbsp;{{row.kucun}}</view>
  37. <view class="price-number" v-if="row.kucun">
  38. <view class="price">{{row.price}}</view>
  39. <view class="number">
  40. <view class="sub" @tap.stop="sub(index)">
  41. <view class="icon jian"></view>
  42. </view>
  43. <view class="input" @tap.stop="discard">
  44. <input type="digit" v-model="row.num" @input="sum($event,index)" />
  45. </view>
  46. <view class="add" @tap.stop="add(index)">
  47. <view class="icon jia"></view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="price-number" v-if="!row.kucun">
  52. <view class="deltip">左滑可删除</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 脚部菜单 -->
  60. <view class="footer" :style="{bottom:footerbottom}">
  61. <view class="checkbox-box" @tap="allSelect">
  62. <view class="checkbox">
  63. <view :class="[isAllselected?'on':'']"></view>
  64. </view>
  65. <view class="text">全选</view>
  66. </view>
  67. <view class="delBtn" @tap="deleteList" v-if="selectedList.length>0">删除</view>
  68. <view class="settlement">
  69. <view class="sum">合计:<view class="money">{{sumPrice}}</view></view>
  70. <view class="btn" @tap="toConfirmation">结算({{selectedList.length}})</view>
  71. <!-- <view class="btn btn_gray" v-else> -->
  72. <!-- <text v-if="startingPrice>=0">{{-(sumPrice-startingPrice)|toFixed}}起送</text> -->
  73. <!-- </view> -->
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import empty from "@/components/empty";
  80. export default {
  81. components: {
  82. empty
  83. },
  84. data() {
  85. return {
  86. sumPrice:'0.00',
  87. headerPosition:"fixed",
  88. headerTop:null,
  89. statusTop:null,
  90. selectedList:[],
  91. isAllselected:false,
  92. goodsList:[],
  93. //控制滑动效果
  94. theIndex:null,
  95. oldIndex:null,
  96. isStop:false,
  97. //配送起步价
  98. startingPrice:0,
  99. tmpList:[],
  100. dhid:0,
  101. }
  102. },
  103. onShow() {
  104. this.goodsList=uni.getStorageSync('cartlistjiad');
  105. let len = this.goodsList.length;
  106. let arr = [];let gids='';
  107. if(len<=0){
  108. //this.$set('isAllselected',false);
  109. this.isAllselected=false;
  110. this.sumPrice=0;
  111. }else{
  112. //要删除的商品数组
  113. let delarrid=[];
  114. for(let i=0;i<len;i++){
  115. this.$set(this.goodsList[i],'selected',true);
  116. if(this.goodsList[i].num<=0){
  117. //数量num为0的商品放入到删除数组中
  118. delarrid.push(this.goodsList[i].id);
  119. }else{
  120. if(this.goodsList[i].selected==true){
  121. arr.push(this.goodsList[i].id);
  122. }
  123. }
  124. gids=gids+','+this.goodsList[i].id;
  125. }
  126. //删除num为0的商品
  127. if(delarrid.length>0){
  128. for(let i=0;i<delarrid.length;i++){
  129. this.deleteGoods(delarrid[i])
  130. }
  131. if(this.goodsList.length<=0){
  132. this.isAllselected=false;
  133. }
  134. }else{
  135. this.selectedList = arr;
  136. this.isAllselected = this.selectedList.length == this.goodsList.length;
  137. }
  138. }
  139. gids=gids.substr(1);
  140. this.checkkc(gids);
  141. this.sum();
  142. },
  143. onPageScroll(e){
  144. //兼容iOS端下拉时顶部漂移
  145. this.headerPosition = e.scrollTop>=0?"fixed":"absolute";
  146. this.headerTop = e.scrollTop>=0?null:0;
  147. this.statusTop = e.scrollTop>=0?null:-this.statusHeight+'px';
  148. },
  149. //下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
  150. onPullDownRefresh() {
  151. setTimeout(function () {
  152. uni.stopPullDownRefresh();
  153. }, 1000);
  154. },
  155. filters: {
  156. toFixed:function(x) {
  157. return parseFloat(x).toFixed(2);
  158. }
  159. },
  160. onLoad(e) {
  161. this.dhid=e.dhid;
  162. //兼容H5下结算条位置
  163. // #ifdef H5
  164. this.footerbottom = document.getElementsByTagName('uni-tabbar')[0].offsetHeight+'px';
  165. // #endif
  166. // #ifdef APP-PLUS
  167. this.statusHeight = plus.navigator.getStatusbarHeight();
  168. // #endif
  169. },
  170. methods: {
  171. async checkkc(gids) {
  172. let userinfo=uni.getStorageSync('userinfo')
  173. let reinfo=await this.$api.checkkc({action:'checkkc',gids:gids,uid:userinfo.uid,aid:userinfo.aid});
  174. let getcheckarr=reinfo.data;
  175. let thisgoodlist=this.goodsList;
  176. if(getcheckarr){
  177. for(let i=0;i<getcheckarr.length;i++){
  178. for(let j=0;j<thisgoodlist.length;j++){
  179. if(getcheckarr[i].id==thisgoodlist[j].id){
  180. this.$set(this.goodsList[j],'kucun',getcheckarr[i].kucun);
  181. this.$set(this.goodsList[j], 'price', getcheckarr[i].price)
  182. }
  183. }
  184. }
  185. }
  186. this.sum();
  187. },
  188. //加入商品 参数 goods:商品数据
  189. joinGoods(goods){
  190. /*
  191. * 这里只是展示一种添加逻辑模板并没有做从其他页面加入商品到购物车的具体动作
  192. * 在实际应用上前端并不会直接插入记录到goodsList这一个动作一般是更新列表和本地列表缓存
  193. * 一般商城购物车的增删改动作是由后端来完成的,
  194. * 后端记录后返回前端更新前端缓存
  195. */
  196. let len = this.goodsList.length;
  197. let isFind = false;//是否找到ID一样的商品
  198. for(let i=0;i<len;i++){
  199. let row = this.goodsList[i];
  200. if(row.id==goods.id )
  201. { //找到商品一样的商品
  202. this.goodsList[i].num++;//数量自增
  203. isFind = true;//找到一样的商品
  204. break;//跳出循环
  205. }
  206. }
  207. if(!isFind){
  208. //没有找到一样的商品,新增一行到购物车商品列表头部
  209. this.goodsList[i].unshift(goods);
  210. }
  211. },
  212. //控制左滑删除效果-begin
  213. touchStart(index,event){
  214. //多点触控不触发
  215. if(event.touches.length>1){
  216. this.isStop = true;
  217. return ;
  218. }
  219. this.oldIndex = this.theIndex;
  220. this.theIndex = null;
  221. //初始坐标
  222. this.initXY = [event.touches[0].pageX,event.touches[0].pageY];
  223. },
  224. touchMove(index,event){
  225. //多点触控不触发
  226. if(event.touches.length>1){
  227. this.isStop = true;
  228. return ;
  229. }
  230. let moveX = event.touches[0].pageX - this.initXY[0];
  231. let moveY = event.touches[0].pageY - this.initXY[1];
  232. if(this.isStop||Math.abs(moveX)<5){
  233. return ;
  234. }
  235. if (Math.abs(moveY) > Math.abs(moveX)){
  236. // 竖向滑动-不触发左滑效果
  237. this.isStop = true;
  238. return;
  239. }
  240. if(moveX<0){
  241. this.theIndex = index;
  242. this.isStop = true;
  243. }else if(moveX>0){
  244. if(this.theIndex!=null&&this.oldIndex==this.theIndex){
  245. this.oldIndex = index;
  246. this.theIndex = null;
  247. this.isStop = true;
  248. setTimeout(()=>{
  249. this.oldIndex = null;
  250. },150)
  251. }
  252. }
  253. },
  254. touchEnd(index,$event){
  255. //结束禁止触发效果
  256. this.isStop = false;
  257. },
  258. //控制左滑删除效果-end
  259. //商品跳转
  260. toGoods(e){
  261. // uni.showToast({title: '商品'+e.id,icon:"none"});
  262. // uni.navigateTo({
  263. // url: '../goods/goods'
  264. // });
  265. },
  266. //跳转确认订单页面
  267. toConfirmation(){
  268. let userinfo=uni.getStorageSync('userinfo')
  269. if(userinfo.uid==''||userinfo.uid==undefined){
  270. uni.showModal({
  271. title: '温馨提示',
  272. content: '您还没登录,请登录',
  273. success: function (res) {
  274. if (res.confirm) {
  275. uni.navigateTo({
  276. url:'/pages/user/login'
  277. })
  278. } else if (res.cancel) {
  279. //console.log('用户点击取消');
  280. }
  281. }
  282. });
  283. }else{
  284. this.tmpList=[];
  285. let len = this.goodsList.length;
  286. for(let i=0;i<len;i++){
  287. if(this.goodsList[i].selected) {
  288. this.tmpList.push(this.goodsList[i]);
  289. }
  290. }
  291. if(this.tmpList.length<1){
  292. uni.showToast({
  293. title:'请选择商品结算',
  294. icon:'none'
  295. });
  296. return ;
  297. }
  298. //本地模拟订单提交UI效果
  299. uni.showLoading({
  300. title:'正在提交订单...'
  301. })
  302. //提交订单
  303. this.postorderjiad();
  304. }
  305. },
  306. async postorderjiad(){
  307. let cpids='';
  308. let cpnums='';
  309. let cpbeizs='';
  310. let cpfudws='';
  311. for(var i=0;i<this.tmpList.length;i++){
  312. cpids=cpids+','+this.tmpList[i].id;
  313. cpnums=cpnums+','+this.tmpList[i].num;
  314. cpbeizs=cpbeizs+'^'+this.tmpList[i].bz;
  315. cpfudws=cpfudws+'^'+this.tmpList[i].fudw;
  316. }
  317. cpids=cpids.substr(1);
  318. cpnums=cpnums.substr(1);
  319. cpbeizs=cpbeizs.substr(1);
  320. cpfudws=cpfudws.substr(1);
  321. let getuserinfo=uni.getStorageSync('userinfo');
  322. let reinfo=await this.$api.orderjiad({action:'orderjiad',uid:getuserinfo.uid,aid:getuserinfo.aid,name:getuserinfo.name,cpids:cpids,cpnums:cpnums,cpbeizs:cpbeizs,dhid:this.dhid,cpfudws:cpfudws});
  323. if(reinfo.code==1){
  324. uni.hideLoading();
  325. uni.removeStorage({
  326. key: 'cartlistjiad',
  327. success: (res)=>{
  328. this.tmpList = [];
  329. }
  330. });
  331. uni.showModal({
  332. title: '加单成功',
  333. content: reinfo.msg,
  334. showCancel: false,
  335. success: (res) => {
  336. uni.redirectTo({
  337. url: "/pages/orderlist/orderlist"
  338. })
  339. }
  340. });
  341. }else{
  342. uni.hideLoading();
  343. uni.showToast({title:reinfo.msg,icon:'none'});
  344. let t=this;
  345. setTimeout(function(){
  346. uni.hideToast();
  347. },1500)
  348. }
  349. },
  350. //删除商品
  351. deleteGoods(id){
  352. let len = this.goodsList.length;
  353. for(let i=0;i<len;i++){
  354. if(id==this.goodsList[i].id){
  355. this.goodsList.splice(i, 1);
  356. break;
  357. }
  358. }
  359. this.selectedList.splice(this.selectedList.indexOf(id), 1);
  360. //更新本地储存
  361. uni.setStorageSync('cartlistjiad',this.goodsList);
  362. this.sum();
  363. this.oldIndex = null;
  364. this.theIndex = null;
  365. },
  366. // 删除商品s
  367. deleteList(){
  368. let len = this.selectedList.length;
  369. while (this.selectedList.length>0)
  370. {
  371. this.deleteGoods(this.selectedList[0]);
  372. }
  373. this.selectedList = [];
  374. this.isAllselected = this.selectedList.length == this.goodsList.length && this.goodsList.length>0;
  375. this.sum();
  376. },
  377. // 选中商品
  378. selected(index){
  379. this.goodsList[index].selected = this.goodsList[index].selected?false:true;
  380. let i = this.selectedList.indexOf(this.goodsList[index].id);
  381. i>-1?this.selectedList.splice(i, 1):this.selectedList.push(this.goodsList[index].id);
  382. this.isAllselected = this.selectedList.length == this.goodsList.length;
  383. this.sum();
  384. },
  385. //全选
  386. allSelect(){
  387. let len = this.goodsList.length;
  388. let arr = [];
  389. for(let i=0;i<len;i++){
  390. this.goodsList[i].selected = this.isAllselected? false : true;
  391. if(this.goodsList[i].kucun>0){
  392. arr.push(this.goodsList[i].id);
  393. }
  394. }
  395. this.selectedList = this.isAllselected?[]:arr;
  396. this.isAllselected = this.isAllselected||this.goodsList.length==0?false : true;
  397. this.sum();
  398. },
  399. // 减少数量
  400. sub(index){
  401. if(this.goodsList[index].num<=1){
  402. return;
  403. }
  404. this.goodsList[index].num--;
  405. this.goodsList[index].total=this.goodsList[index].num*this.goodsList[index].price
  406. //更新本地储存
  407. uni.setStorageSync('cartlistjiad',this.goodsList);
  408. this.sum();
  409. },
  410. // 增加数量
  411. add(index){
  412. if(this.goodsList[index].kucun>this.goodsList[index].num){
  413. this.goodsList[index].num++;
  414. this.goodsList[index].total=this.goodsList[index].num*this.goodsList[index].price
  415. //更新本地储存
  416. uni.setStorageSync('cartlistjiad',this.goodsList);
  417. this.sum();
  418. }else{
  419. uni.showToast({
  420. title:'库存不足!',
  421. icon:'none'
  422. });
  423. return ;
  424. }
  425. },
  426. // 合计
  427. sum(e,index){
  428. this.sumPrice=0;
  429. let len = this.goodsList.length;
  430. let goodslist=this.goodsList;
  431. let gids='';
  432. for(let i=0;i<len;i++){
  433. gids=gids+','+goodslist[i].id;
  434. if(goodslist[i].selected && goodslist[i].kucun>0) {
  435. if(e && i==index){
  436. this.sumPrice = this.sumPrice + (parseFloat(e.detail.value)*goodslist[i].price);
  437. goodslist[i].num=e.detail.value;
  438. goodslist[i].inputnum=e.detail.value;
  439. }else{
  440. this.sumPrice = this.sumPrice + (goodslist[i].num*goodslist[i].price);
  441. }
  442. }
  443. }
  444. uni.setStorageSync('cartlistjiad', goodslist)
  445. // gids=gids.substr(1);
  446. // this.checkkc(gids);
  447. this.sumPrice = this.sumPrice.toFixed(2);
  448. },
  449. inputchangeBz(inputsl,inputnum, id, index) {
  450. inputnum=inputsl.detail.value;
  451. this.goodsList[index].bz=inputnum;
  452. //更新本地储存
  453. uni.setStorageSync('cartlistjiad',this.goodsList);
  454. },
  455. inputchangeFudw(inputsl,inputnum, id, index) {
  456. inputnum=inputsl.detail.value;
  457. this.goodsList[index].fudw=inputnum;
  458. this.sum()
  459. //更新本地储存
  460. // uni.setStorageSync('cartlistjiad',this.goodsList);
  461. },
  462. discard() {
  463. //丢弃
  464. }
  465. }
  466. }
  467. </script>
  468. <style lang="scss">
  469. page{position: relative;}
  470. @font-face {font-family:"HMfont-home";src:url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOEAAsAAAAAB7wAAAM1AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDHAqDAIJNATYCJAMQCwoABCAFhG0HPhu1BsiOw7jha84s8T+CgOyq6unevTlAeAkRhAhQBjj8eJfmMg/oB5whSgaFspy7AqbpwE3Py3/j9j+X07uGyFHr21lua9HYi9rUCzDeGtBYmw4o0AJJ0BvGLmiJxyEAC3yIQhSVPL9BF4U5TgBi7ChtQzfjQKFYWEdgrFiqEBsxoGurtMfAhuD74g8JQgcNg8ScWjf8xoPz7/nfD8iFpoV0eQi86XQAWwUSiAIUiJGVhgEaUSAKiYXau0kKoKOjwVRthd8PmExIBRvmWH95INCQIIyYqVYAJKGghO/5Dg4B3wtxaPD9QAoS4IOM1gEzYBbAMkT16iIQGPxsopS5ScAcK23LiaBDpzyk1aGLHtsvhVrL7adDD55016wPXnDfcr7T3lcE2TVcP2fNhZM7WeiEhVp44vx9C5vVD6+eEgaLTZvEot3HL1lawlnXLK3XnISDllbWwmrmGjlRLdxq2bpme1RAeqXtzWh6g0F//wCCnRiN2diwr2+Yse3iEs20g05Q5tT0BikOXwKf79vsoEvb6p6xjVhHP92nwDJmX+9hwsf26dXbPiNvZ/98x67/+5T+ev0aWxbXCwOX41zLxia+O73B6Y57fN1u6GvN+Zmbc8XITigTAcB0Rl6X8QB4hDgEpoXypZz2q37D5FVnVa9t1n/dUgHw8uKMq9BmWqjoJoP3zevM+zG8jmVKE5hKpRShw9WTFZW04D7TscAC+B0RcOD9FHLnzqkg0HFOQMMMb5DoBKGKGgUGLEkCIzq5YEEkpastcWQyDYQyByJYBkBgx2nQsOEaSOx4girqOzDgwj8wYickWNAiHLe0JESMsiicTLaQh84PBm6WKlst/TD9hXQV25wWBLQP4jJw435MXD58RynxFDPKT30golBxluAtOI3iOMOcs5Bc2fFF8sPd2OFVBO24WQJ9CmEIG4HwQAb4ARmFS0aK8qoL/cLnXyA0FTE23FBSZf+AYEqCzpF4YojrgN5J004lt/LKFD7RHDAVQYEMh8lIQErAICImJgOZWD0ohHARdhg5wJdzSKxVaXhX6c7y8uQN1wAWmLOU0IQUShiQo0fZTceadqaMdP2uXwEAAAAA') format('woff2');}
  471. .icon {
  472. font-family:"HMfont-home" !important;
  473. font-size:60upx;
  474. font-style:normal;
  475. color:#000000;
  476. &.jia {
  477. &:before{content:"\e641";}
  478. }
  479. &.jian {
  480. &:before{content:"\e643";}
  481. }
  482. &.shanchu {
  483. &:before{content:"\e6a4";}
  484. }
  485. }
  486. .checkbox-box{
  487. display: flex;
  488. align-items: center;
  489. .sellq{
  490. font-size: 28upx;
  491. color: #ffffff;
  492. background-color: #C4C4C4;
  493. padding: 5upx 20upx;
  494. text-align: center;
  495. border-radius: 25upx;
  496. }
  497. .checkbox{
  498. width: 35upx;
  499. height: 35upx;
  500. border-radius: 100%;
  501. border: solid 2upx #f06c7a;
  502. display: flex;
  503. justify-content: center;
  504. align-items: center;
  505. .on{
  506. width: 25upx;
  507. height: 25upx;
  508. border-radius: 100%;
  509. background-color: #f06c7a;
  510. }
  511. }
  512. .text{
  513. font-size: 28upx;
  514. margin-left: 10upx;
  515. }
  516. }
  517. .status {
  518. width: 100%;
  519. height: 0;
  520. position: fixed;
  521. z-index: 10;
  522. background-color: #fff;
  523. top: 0;
  524. /* #ifdef APP-PLUS */
  525. height: var(--status-bar-height);//覆盖样式
  526. /* #endif */
  527. }
  528. .header{
  529. width: 92%;
  530. padding: 0 4%;
  531. height: 100upx;
  532. display: flex;
  533. align-items: center;
  534. position: fixed;
  535. top: 0;
  536. z-index: 10;
  537. background-color: #fff;
  538. /* #ifdef APP-PLUS */
  539. top: var(--status-bar-height);
  540. /* #endif */
  541. .title{
  542. font-size: 36upx;
  543. }
  544. }
  545. .place{
  546. background-color: #ffffff;
  547. height: 100upx;
  548. /* #ifdef APP-PLUS */
  549. margin-top: var(--status-bar-height);
  550. /* #endif */
  551. }
  552. .goods-list{
  553. width: 100%;
  554. padding: 20upx 0 120upx 0;
  555. .tis{
  556. width: 100%;
  557. height: 60upx;
  558. display: flex;
  559. justify-content: center;
  560. align-items: center;
  561. font-size: 32upx;
  562. }
  563. .row{
  564. width: calc(92%);
  565. height: calc(22vw + 40upx);
  566. margin: 20upx auto;
  567. border-radius: 15upx;
  568. box-shadow: 0upx 5upx 20upx rgba(0,0,0,0.1);
  569. display: flex;
  570. align-items: center;
  571. position: relative;
  572. overflow: hidden;
  573. z-index: 4;
  574. border: 0;
  575. .menu{
  576. .icon{
  577. color: #fff;
  578. // font-size: 25upx;
  579. }
  580. position: absolute;
  581. width: 30%;
  582. height: 100%;
  583. right: 0;
  584. display: flex;
  585. justify-content: center;
  586. align-items: center;
  587. background-color: red;
  588. color: #fff;
  589. z-index: 2;
  590. }
  591. .carrier{
  592. @keyframes showMenu {
  593. 0% {transform: translateX(0);}100% {transform: translateX(-30%);}
  594. }
  595. @keyframes closeMenu {
  596. 0% {transform: translateX(-30%);}100% {transform: translateX(0);}
  597. }
  598. &.open{
  599. animation: showMenu 0.25s linear both;
  600. }
  601. &.close{
  602. animation: closeMenu 0.15s linear both;
  603. }
  604. background-color: #fff;
  605. .checkbox-box{
  606. padding-left: 20upx;
  607. flex-shrink: 0;
  608. height: 22vw;
  609. margin-right: 20upx;
  610. }
  611. position: absolute;
  612. width: 100%;
  613. padding: 0 0;
  614. height: 100%;
  615. z-index: 3;
  616. display: flex;
  617. align-items: center;
  618. .goods-info{
  619. width: 100%;
  620. display: flex;
  621. padding-right: 20upx;
  622. .img{
  623. width: 22vw;
  624. height: 22vw;
  625. border-radius: 10upx;
  626. overflow: hidden;
  627. flex-shrink: 0;
  628. margin-right: 10upx;
  629. image{
  630. width: 22vw;
  631. height: 22vw;
  632. }
  633. }
  634. .info{
  635. width: 100%;
  636. height: 22vw;
  637. overflow: hidden;
  638. display: flex;
  639. flex-wrap: wrap;
  640. position: relative;
  641. .title{
  642. width: 100%;
  643. font-size: 28upx;
  644. display: -webkit-box;
  645. -webkit-box-orient: vertical;
  646. -webkit-line-clamp: 2;
  647. // text-align: justify;
  648. overflow: hidden;
  649. }
  650. .spgg{
  651. font-size: 25upx;
  652. background-color: #f3f3f3;
  653. color: #a7a7a7;
  654. border-radius: 15upx;
  655. margin-bottom: 10vw;
  656. }
  657. // .spec{
  658. // font-size: 25upx;
  659. // background-color: #f3f3f3;
  660. // color: #a7a7a7;
  661. // height: 30upx;
  662. // display: flex;
  663. // align-items: center;
  664. // padding: 0 10upx;
  665. // border-radius: 15upx;
  666. // margin-bottom: 10vw;
  667. // }
  668. .spbz{
  669. font-size: 25upx;
  670. color: #a7a7a7;
  671. height: 30upx;
  672. display: flex;
  673. align-items: center;
  674. padding: 0 10upx;
  675. margin-bottom: 10vw;
  676. }
  677. .kcnum{
  678. font-size: 25upx;
  679. position: absolute;
  680. width: 100%;
  681. top: 88upx;
  682. padding: 0 10upx;
  683. border-radius: 15upx;
  684. margin-bottom: 10vw;
  685. }
  686. .price-number{
  687. position: absolute;
  688. width: 100%;
  689. bottom: 0upx;
  690. display: flex;
  691. justify-content: space-between;
  692. align-items: flex-end;
  693. font-size: 28upx;
  694. height: 60upx;
  695. .price{
  696. }
  697. .deltip{
  698. position: absolute;
  699. right: 0;
  700. top: -53rpx;
  701. color: #B4B4B4;
  702. margin-right: 8rpx;
  703. }
  704. .number{
  705. display: flex;
  706. justify-content: center;
  707. align-items: flex-end;
  708. .input{
  709. width: 60upx;
  710. height: 60upx;
  711. margin: 0 10upx;
  712. background-color: #f3f3f3;
  713. input{
  714. width: 60upx;
  715. height: 60upx;
  716. display: flex;
  717. justify-content: center;
  718. align-items: center;
  719. text-align: center;
  720. font-size: 26upx;
  721. }
  722. }
  723. .sub ,.add{
  724. width: 45upx;
  725. height: 45upx;
  726. background-color: #f3f3f3;
  727. border-radius: 5upx;
  728. .icon{
  729. font-size: 22upx;
  730. width: 45upx;
  731. height: 45upx;
  732. display: flex;
  733. justify-content: center;
  734. align-items: center;
  735. }
  736. }
  737. }
  738. }
  739. }
  740. }
  741. }
  742. }
  743. }
  744. .footer{
  745. width: 100%;
  746. padding: 0 4%;
  747. background-color: #fbfbfb;
  748. height: 100upx;
  749. display: flex;
  750. justify-content: space-between;
  751. align-items: center;
  752. font-size: 28upx;
  753. position: fixed;
  754. bottom: 0upx;
  755. z-index: 5;
  756. .delBtn{
  757. border: solid 1upx #f06c7a;
  758. color: #f06c7a;
  759. padding: 0 30upx;
  760. height: 50upx;
  761. border-radius: 30upx;
  762. display: flex;
  763. justify-content: center;
  764. align-items: center;
  765. }
  766. .settlement{
  767. width: 64%;
  768. display: flex;
  769. justify-content: flex-end;
  770. align-items: center;
  771. .sum{
  772. width: 50%;
  773. font-size: 28upx;
  774. margin-right: 10upx;
  775. display: flex;
  776. justify-content: flex-end;
  777. .money{
  778. font-weight: 600;
  779. }
  780. }
  781. .btn{
  782. padding: 0 20upx;
  783. height: 50upx;
  784. background-color: #f06c7a;
  785. color: #fff;
  786. display: flex;
  787. justify-content: center;
  788. align-items: center;
  789. border-radius: 30upx;
  790. }
  791. .btn_gray{
  792. padding: 0 20upx;
  793. height: 50upx;
  794. background-color: #C4C4C4;
  795. color: #fff;
  796. display: flex;
  797. justify-content: center;
  798. align-items: center;
  799. width: 240upx;
  800. border-radius: 30upx;
  801. }
  802. }
  803. }
  804. </style>