cart.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin" :style="{paddingTop:CustomBar+'px'}">
  3. <headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1'></headerNavbar>
  4. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  5. <view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
  6. <view class="foot-check-delbtn" v-if="!isshowDelbtn" :style="{top:CustomBar+'px'}">
  7. <view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
  8. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  9. </view>
  10. <view v-if="!isEmpty" class="container-cart">
  11. <view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
  12. <view class="goods-list">
  13. <view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
  14. <view class="shoptitle">
  15. <!--选择商店的全部商品"-->
  16. <view class="checkbox-box" @click.stop="checkShop(item)">
  17. <view class="checkbox iconfont" :class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"></view>
  18. </view>
  19. <view v-if="item.promotions" class="floor-item-act">
  20. <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
  21. </view>
  22. <view class="text">{{item.name}}</view>
  23. </view>
  24. <view class="productlist">
  25. <view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
  26. <view class="goods-pros-t">
  27. <!--选择商品-->
  28. <view class="checkbox-box" @click.stop="ischeck(item,pros)">
  29. <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
  30. </view>
  31. </view>
  32. <view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.image ? pros.image:''" alt="" /></view>
  33. <view class="pros-product">
  34. <view class="producttitle" @click.stop="navToListPage(pros.productId)" >{{pros.name}}</view>
  35. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  36. <view class="productprice">
  37. <!--使用过滤器对总价改变-->
  38. <view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
  39. <text>¥</text>{{pros.price | NumFormat}}
  40. </view>
  41. <view class="count" v-if="pros.validFlag == 2 " :class="[isshowDelbtn ? 'none':'show']">
  42. <text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
  43. <text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
  44. <view class="number-box">
  45. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  46. <input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
  47. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-show="pros.actStatus==1" class="floor-item-act">
  52. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  53. {{pros.promotions.name}}
  54. <text v-if ="pros.promotions!=null">
  55. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  56. </text>
  57. </view>
  58. <view v-else class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
  59. </view>
  60. <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
  61. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
  68. <view class="sum-none" v-if="item.reducedPrice>0">
  69. <text class="money-sign">¥</text>
  70. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  71. <text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  72. </view>
  73. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="failure-list" v-if="failureList.length>0">
  78. <view class="failure-title">
  79. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  80. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  81. </view>
  82. <view class="productlist">
  83. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  84. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  85. <!--选择商品-->
  86. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  87. <button class="checkbox iconfont"
  88. :class="[ failure.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
  89. </button>
  90. </view>
  91. <view class="pros-img">
  92. <image :src="failure.image ? failure.image:''" alt="" />
  93. <text class="img-tip">失效</text>
  94. </view>
  95. <view class="pros-product">
  96. <view class="producttitle">{{failure.name}}</view>
  97. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  98. <view class="productstate">{{failureStateText(failure.failureState)}}</view>
  99. </view>
  100. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 脚部菜单 -->
  107. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  108. <view class="footer-le">
  109. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  110. <button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button>
  111. <view class="text">全选</view>
  112. </view>
  113. <view class="sum">
  114. <view class="sum-none" v-if="reducedPrice>0">
  115. <text class="money-sign">¥</text>
  116. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  117. <text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  118. </view>
  119. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  120. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  121. </view>
  122. </view>
  123. </view>
  124. <view v-if="!isshowDelbtn" class="footer-ri" >
  125. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  126. </view>
  127. <view v-else class="footer-del">
  128. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  129. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  130. </view>
  131. </view>
  132. </view>
  133. <view v-else class="cart-content empty">
  134. <view class="empty-container">
  135. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  136. <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
  137. <view class="login-btn" @click="goIndex">去商城</view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 促销活动弹窗 -->
  142. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  143. <!-- 透明模态层 -->
  144. <modal-layer v-if='modallayer'></modal-layer>
  145. </view>
  146. </template>
  147. <script>
  148. import authorize from '@/common/config/authorize.js'
  149. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  150. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  151. import tuiNomore from "@/components/tui-components/nomore/nomore"
  152. import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
  153. import modalLayer from "@/components/modal-layer"
  154. import { mapState,mapMutations } from 'vuex';
  155. export default{
  156. components:{
  157. tuiSkeleton,
  158. tuiLoadmore,
  159. tuiNomore,
  160. modalLayer,
  161. headerNavbar
  162. },
  163. data(){
  164. return{
  165. nvabarData: {//顶部自定义导航
  166. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  167. showSearch: 0,
  168. title: '购物车', // 导航栏 中间的标题
  169. },
  170. headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
  171. systeminfo:this.setSysteminfo(), //获取设备信息
  172. CustomBar:this.CustomBar,// 顶部导航栏高度
  173. isIphoneX:this.$store.state.isIphoneX,
  174. userID:'',
  175. alertType:'',
  176. isStock:'',
  177. popupShow:false,
  178. handlerPros:{},//监听单挑促销商品
  179. failureList:[], //失效商品列表
  180. goodsList:[], //购物车的商品
  181. promotionsList:[],//促销列表
  182. delGoodsList:'',//要删除的商品
  183. setGoodData:'', //确认订单的商品
  184. isCheckAll:false,//是否全选
  185. kindCount:0,//购物车宝贝数量
  186. allPrice:0,//所有价格
  187. totalOriginalPrice:0,//所有原价价
  188. reducedPrice:0,//满减
  189. allCount:0,//被选中的产品数量
  190. isModallayer:false,
  191. skeletonShow:true,
  192. isshowDelbtn:false,
  193. isDisabled: false, // 供应商/店铺全选是否禁用状态
  194. isNoConfim:false,
  195. isEmpty:false,//显示空购物车
  196. scrollHeight: 'auto',
  197. nomoreText: '上拉显示更多',
  198. hasNextPage: false,
  199. loadding: false,
  200. pullUpOn: true,
  201. pullFlag: true,
  202. pageSize: 10,
  203. pageNum: 1,
  204. }
  205. },
  206. onLoad(){
  207. this.setScrollHeight();
  208. },
  209. computed: {
  210. ...mapState(['hasLogin','userInfo'])
  211. },
  212. filters:{
  213. NumFormat(value) {//处理金额
  214. return Number(value).toFixed(2);
  215. },
  216. totalprice(val,count){//单件商品的价格 × 数量
  217. return (val * count).toFixed(2)
  218. }
  219. },
  220. methods:{
  221. initData(){
  222. this.isModallayer = false //遮罩层 防止多次点击
  223. this.skeletonShow = true //预加载圆圈
  224. this.isCheckAll=false//是否全选
  225. this.$api.getStorage().then((resolve) => {
  226. this.userID = resolve.userID;
  227. this.initGetCartGoodsList();
  228. })
  229. },
  230. initLogin(){
  231. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  232. if(wxResponse == 1){
  233. this.$api.redirectTo('/pages/login/login?type=4')
  234. }else{
  235. this.$api.navigateTo('/pages/authorization/authorization?type=0')
  236. }
  237. })
  238. },
  239. clickPopupShow(pros,type){
  240. this.popupShow = true;
  241. this.handlerPros = pros;
  242. },
  243. setScrollHeight() {
  244. // 窗口高度-footer高度
  245. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  246. setTimeout(()=> {
  247. const query = uni.createSelectorQuery().in(this);
  248. query.selectAll('.footer').boundingClientRect();
  249. query.exec(res => {
  250. this.windowHeight = windowHeight;
  251. if(res[0][0]) {
  252. this.scrollHeight = windowHeight - res[0][0].height;
  253. }
  254. })
  255. }, 500)
  256. },
  257. initGetCartGoodsList(){//初始化购物车 index:1
  258. this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
  259. this.skeletonShow = false
  260. let data = response.data
  261. this.kindCount = data.kindCount
  262. this.promotionsList = data.promotions
  263. this.$store.commit('updateAllNum',data.kindCount)
  264. if( data.list.length > 0 || data.invalid.length > 0){
  265. this.isEmpty =false
  266. }else{
  267. this.isEmpty =true
  268. }
  269. if(data.list && data.list.length > 0 ){
  270. this.goodsList = data.list;
  271. this.goodsList.forEach((item,index) => {
  272. item.cartList.forEach(pros => {
  273. pros.shopID = item.shopID;
  274. pros.isStep = false
  275. if(pros.step === 2){
  276. if(pros.number % pros.min != 0){
  277. pros.number = pros.min
  278. this.totalShopPeice()
  279. this.updateShoppogNum(pros)
  280. }
  281. }
  282. })
  283. })
  284. this.totalShopPeice()
  285. } else {
  286. this.goodsList = [];
  287. }
  288. if( data.invalid && data.invalid.length > 0){
  289. let newFailureList = [],isFailureLayer;
  290. data.invalid.forEach((failure,index) => {
  291. if(failure.status == 1 || failure.status == 2) {
  292. isFailureLayer = true
  293. }else{
  294. isFailureLayer = false
  295. }
  296. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  297. })
  298. this.failureList = newFailureList
  299. } else {
  300. this.failureList = [];
  301. }
  302. }).catch(error =>{
  303. this.$util.msg(error.msg,2000);
  304. })
  305. },
  306. ischeckFailure(failure){
  307. failure.productsChecked = !failure.productsChecked
  308. this.updateCheckAllBtn()
  309. },
  310. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  311. pro.productsChecked = !pro.productsChecked;
  312. this.updateProductCheckedAllBtn(item);
  313. this.updateCheckAllBtn();
  314. },
  315. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  316. let productsList = item.cartList,
  317. productsCheckedLength = 0,
  318. disabledLength = 0;
  319. if(this.isshowDelbtn) {
  320. productsList.forEach(pros => {
  321. if(pros.productsChecked) {
  322. productsCheckedLength++;
  323. }
  324. })
  325. } else {
  326. productsList.forEach(pros => {
  327. if(pros.productsChecked) {
  328. productsCheckedLength++;
  329. }
  330. })
  331. }
  332. item.checked = productsCheckedLength === productsList.length;
  333. },
  334. updateCheckAllBtn() {// 全选勾选判断
  335. let goodsCheckedLength = 0,
  336. goodsList = this.goodsList,
  337. failureList = this.failureList;
  338. goodsList.forEach(item => {
  339. if(item.checked) {
  340. goodsCheckedLength++;
  341. }
  342. })
  343. failureList.forEach(failureItem=>{
  344. if(failureItem.productsChecked){
  345. goodsCheckedLength++;
  346. }
  347. })
  348. if(this.isshowDelbtn){
  349. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  350. }else{
  351. this.isCheckAll = goodsCheckedLength === goodsList.length;
  352. }
  353. },
  354. checkShop(item){//与单选商品类似
  355. item.checked = !item.checked;
  356. this.setProductChecked(item);
  357. this.updateCheckAllBtn();
  358. },
  359. setProductChecked(item) {
  360. item.cartList.forEach(pros=>{
  361. if(item.checked) {
  362. pros.productsChecked = true;
  363. } else {
  364. pros.productsChecked = false;
  365. }
  366. })
  367. },
  368. updateBothCheckBtn() {
  369. if(this.isshowDelbtn) {
  370. // 当管理删除按钮出现时,失效的商品可被选择
  371. this.goodsList.forEach((item)=>{
  372. item.checked = this.isCheckAll;
  373. this.setProductChecked(item);
  374. })
  375. //删除按钮 全选包括失效商品勾选
  376. this.failureList.forEach(failureItem=>{
  377. failureItem.productsChecked = this.isCheckAll;
  378. })
  379. } else {
  380. this.goodsList.forEach((item)=>{
  381. item.checked = this.isCheckAll && !item.isDisabled;
  382. this.setProductChecked(item);
  383. })
  384. }
  385. },
  386. checkAll(){//全选方法内调用方法
  387. this.isCheckAll = !this.isCheckAll;
  388. this.updateBothCheckBtn();
  389. },
  390. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  391. let prosPrice=0;
  392. let touchPrice = 0;
  393. let reducedPrice = 0;//商铺合计满减价
  394. let totalOriginalPrice = 0;//商铺合计原价
  395. let productsList=[];
  396. this.goodsList.map((item,index)=>{
  397. productsList = item.cartList;
  398. //计算店铺满减后店铺合计
  399. if(item.promotions && item.promotions.mode == 2){
  400. productsList.forEach(pros=>{
  401. prosPrice += pros.price*pros.number
  402. totalOriginalPrice+= pros.price*pros.number;
  403. if(prosPrice >= item.promotions.touchPrice){
  404. item.totalPrice = prosPrice - item.promotions.reducedPrice
  405. item.reducedPrice = item.promotions.reducedPrice
  406. item.totalOriginalPrice = totalOriginalPrice
  407. }else{
  408. item.totalPrice = prosPrice
  409. }
  410. })
  411. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  412. let _totalPrice = 0;
  413. let _reducedPrice = 0;
  414. let _totalOriginalPrice =0;
  415. productsList.forEach(pros=>{
  416. let _price = pros.price*pros.number
  417. _totalOriginalPrice += pros.price*pros.number;
  418. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  419. if(_price >= pros.promotions.touchPrice){
  420. _price = _price - pros.promotions.reducedPrice
  421. _reducedPrice += pros.promotions.reducedPrice
  422. }
  423. _totalPrice += _price
  424. }else{
  425. _totalPrice += pros.price*pros.number;
  426. }
  427. })
  428. item.reducedPrice = _reducedPrice
  429. item.totalOriginalPrice = _totalOriginalPrice
  430. item.totalPrice = _totalPrice
  431. }
  432. })
  433. },
  434. totalPeice(){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  435. this.allPrice = 0
  436. let productsList =[];
  437. //店铺满减
  438. let prosPrice=0;
  439. let totalPrice = 0;
  440. let reducedPrice=0;//促销满减
  441. let totalOriginalPrice=0;//促销原价
  442. //凑单满减.单品满减
  443. let _totalPrice = 0;
  444. let _reducedPrice = 0;
  445. let _totalOriginalPrice =0;
  446. // 正常商品
  447. let _totalNonePrice = 0;
  448. /*
  449. *originalPrice:商品原价
  450. *price:商品现价
  451. *mode:促销商品满减计算 促销方式mode为 2 的单独做计算 当mode == 2时商品promotions字段为促销活动内容,
  452. *touchPrice 为需要满金额
  453. *reducedPrice 为满减金额
  454. **/
  455. this.goodsList.forEach((item,index)=>{
  456. item.cartList.forEach(pros=>{
  457. if(pros.productsChecked){
  458. if(item.promotions && item.promotions.mode == 2){
  459. prosPrice = pros.price*pros.number
  460. if(prosPrice >= item.promotions.touchPrice){
  461. totalPrice += prosPrice - item.promotions.reducedPrice
  462. totalOriginalPrice += pros.originalPrice*pros.number
  463. reducedPrice += item.promotions.reducedPrice
  464. }else{
  465. totalPrice += prosPrice
  466. }
  467. }else if(pros.promotions && pros.promotions.mode == 2){//以下为计算除店铺满减以外的单品满减以及正常商品
  468. let _price = pros.price*pros.number
  469. _totalOriginalPrice += pros.originalPrice*pros.number;
  470. if(_price >= pros.promotions.touchPrice){
  471. _price = _price - pros.promotions.reducedPrice
  472. _reducedPrice += pros.promotions.reducedPrice
  473. }
  474. _totalPrice += _price
  475. }else{
  476. _totalNonePrice += pros.price*pros.number;
  477. }
  478. }
  479. })
  480. this.totalOriginalPrice = totalOriginalPrice + _totalOriginalPrice;
  481. this.reducedPrice = reducedPrice +_reducedPrice;
  482. this.allPrice = totalPrice + _totalPrice + _totalNonePrice;
  483. })
  484. },
  485. totalCount(){//计算总数量
  486. this.allCount = 0
  487. let prosAllCount=0
  488. let validCount = 0
  489. let validList =[];
  490. let productsList =[];
  491. this.goodsList.forEach(item=>{
  492. productsList = item.cartList
  493. productsList.forEach(pros=>{
  494. if(pros.productsChecked){
  495. prosAllCount+=parseInt(pros.number);
  496. this.allCount = prosAllCount
  497. }
  498. })
  499. })
  500. },
  501. changeCountAdd(item,pros){//商品数量加加
  502. if(pros.step === 2){
  503. pros.isStep = false
  504. pros.number += pros.min
  505. this.processActivityPrice(pros)
  506. this.isStock = false
  507. }else{
  508. pros.number++
  509. this.processActivityPrice(pros)
  510. this.isStock = false
  511. }
  512. this.updateShoppogNum(pros)
  513. this.totalShopPeice();
  514. },
  515. changeCountSub(item,pros){//商品数量减减
  516. if(pros.number<=pros.min){
  517. pros.number= pros.min
  518. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  519. return
  520. }else{
  521. if(pros.step === 2){
  522. pros.isStep = false
  523. pros.number -= pros.min
  524. }else{
  525. pros.number--
  526. }
  527. this.processActivityPrice(pros)
  528. }
  529. this.updateShoppogNum(pros)
  530. this.totalShopPeice();
  531. },
  532. changeInput(pros){//输入商品数量更新
  533. pros.isStep = false
  534. },
  535. changeNnmber(e,item,pros){//输入商品数量更新
  536. let _value = Number(e.detail.value);
  537. if(!this.$api.isNumber(_value)){
  538. pros.number = pros.min
  539. }else if(_value < pros.min){
  540. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  541. pros.number = pros.min
  542. }else if(_value % pros.min != 0){
  543. pros.isStep = true
  544. pros.number = pros.min
  545. }else{
  546. pros.isStep = false
  547. pros.number = e.detail.value
  548. this.processActivityPrice(pros)
  549. }
  550. this.updateShoppogNum(pros)
  551. this.totalShopPeice();
  552. },
  553. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  554. let ladderPriceList = pros.ladderPrices;
  555. if(pros.ladderFlag == '0' || pros.actStatus == 1){
  556. pros.price = pros.price
  557. }else{
  558. ladderPriceList.forEach((item,index)=>{
  559. if(pros.number>=item.buyNum){
  560. pros.price = item.buyPrice
  561. }
  562. })
  563. }
  564. },
  565. updateShoppogNum(pros){//加减购物车商品更新到后台
  566. let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
  567. this.ProductService.shoppingCartUpdate(params).then(response =>{
  568. this.isshowDelbtn = false;
  569. this.initGetCartGoodsList();
  570. }).catch(error =>{
  571. this.$util.msg(error.msg,2000);
  572. })
  573. },
  574. toConfirmation(){//跳转确认订单页面
  575. let setGoodsList=[];
  576. this.goodsList.forEach(res=>{
  577. let products = res.cartList
  578. products.forEach(pros=>{
  579. if(pros.productsChecked){
  580. setGoodsList.push(pros.productId)
  581. }
  582. })
  583. })
  584. if(setGoodsList == ''){
  585. this.$util.msg("请先选择结算商品~",2000);
  586. return
  587. }else{
  588. this.isNoConfim = false
  589. this.goodsList.forEach(el=>{
  590. el.cartList.forEach(pros=>{
  591. if(pros.productsChecked){
  592. if(pros.number<pros.min){
  593. this.isNoConfim = true
  594. }
  595. }
  596. })
  597. })
  598. if(this.isNoConfim){
  599. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  600. return;
  601. }
  602. let productID = '';
  603. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  604. el.cartList.forEach(pros=>{
  605. if(pros.productsChecked){
  606. productID += pros.productId+','
  607. }
  608. })
  609. })
  610. let cartPramsData={
  611. allPrice:this.allPrice,
  612. allCount:this.allCount,
  613. productID:productID.substring(0,productID.lastIndexOf(',')),
  614. productCount:''
  615. }
  616. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  617. }
  618. },
  619. showDelManager(){//显示删除商品管理
  620. this.isshowDelbtn = true;
  621. if(this.isCheckAll) {
  622. this.updateBothCheckBtn();
  623. } else {
  624. this.goodsList.forEach(item => {
  625. if(item.checked) {
  626. item.cartList.forEach(pros => {
  627. pros.productsChecked = true;
  628. })
  629. }
  630. })
  631. this.updateCheckAllBtn();
  632. }
  633. // 失效也被勾选
  634. this.failureList.forEach(failureItem => {
  635. if(failureItem.isFailureLayer){
  636. failureItem.isFailureLayer = false
  637. }
  638. })
  639. },
  640. hideDelManage(){//隐藏删除商品管理
  641. this.isshowDelbtn = false;
  642. let isFailureLayer,newFailureList =[];
  643. if(this.isCheckAll) {
  644. this.updateBothCheckBtn();
  645. } else {
  646. // 失效商品取消勾选
  647. this.goodsList.forEach(item => {
  648. if(item.isDisabled) {
  649. item.checked = false;
  650. }
  651. item.cartList.forEach(pros => {
  652. if(pros.validFlag == 3) {
  653. pros.productsChecked = false;
  654. }
  655. })
  656. })
  657. this.updateCheckAllBtn();
  658. }
  659. this.failureList.forEach((failure,index) => {
  660. if(failure.failureState == 1 || failure.failureState == 2) {
  661. isFailureLayer = true
  662. }else{
  663. isFailureLayer = false
  664. }
  665. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  666. })
  667. this.failureList = newFailureList;
  668. },
  669. deleteList(){//删除购物车商品
  670. this.delGoodsList=[];
  671. this.goodsList.forEach(delitem=>{
  672. let products = delitem.cartList
  673. products.forEach(pros=>{
  674. if(pros.productsChecked){
  675. this.delGoodsList += pros.productId+','
  676. }
  677. })
  678. })
  679. this.failureList.forEach(failure=>{
  680. if(failure.productsChecked){
  681. this.delGoodsList += failure.productId+','
  682. }
  683. })
  684. if(this.delGoodsList.length == 0){
  685. this.$util.msg("请选择要删除的商品~",2000);
  686. return
  687. }else{
  688. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  689. this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  690. this.$util.msg('删除成功',2000);
  691. setTimeout(()=>{
  692. this.isshowDelbtn = false;
  693. this.initGetCartGoodsList();
  694. },2000)
  695. }).catch(error =>{
  696. this.$util.msg(error.msg,2000)
  697. })
  698. })
  699. }
  700. },
  701. deletefailureList(){
  702. this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
  703. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  704. this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  705. this.$util.msg('删除成功',2000);
  706. setTimeout(()=>{
  707. this.isshowDelbtn = false;
  708. this.initGetCartGoodsList();
  709. },2000)
  710. }).catch(error =>{
  711. this.$util.msg(error.msg,2000)
  712. })
  713. })
  714. },
  715. goIndex(){
  716. uni.switchTab({
  717. url: '/pages/tabBar/home/home'
  718. });
  719. },
  720. goNavto(url){
  721. uni.navigateTo ({
  722. url
  723. })
  724. },
  725. navToListPage(id){
  726. this.isModallayer = true;
  727. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  728. },
  729. failureToProduct(failure){
  730. if(failure.status == 1){
  731. this.$util.msg('商品已丢失,不能查看',2000)
  732. return
  733. }else if(failure.status == 2){
  734. this.$util.msg('商品已停售,不能查看',2000)
  735. return
  736. }else{
  737. this.isModallayer = true;
  738. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  739. }
  740. },
  741. failureStateText(state){
  742. let stateText = '',
  743. stateTextObject={
  744. 1:'商品已丢失',
  745. 2:'商品已停售',
  746. 3:'商品已下架',
  747. 4:'商品已售罄',
  748. 5:'价格仅会员可见,您不能购买',
  749. 6:'未公开价格',
  750. 7:'库存不足'
  751. }
  752. Object.keys(stateTextObject).forEach(key => {
  753. if(key == state){
  754. stateText = stateTextObject[key]
  755. }
  756. })
  757. return stateText;
  758. },
  759. setHeaderBtnPosi(){
  760. // 获得胶囊按钮位置信息
  761. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  762. return headerBtnPosi
  763. },
  764. setSysteminfo(){
  765. let systeminfo;
  766. uni.getSystemInfo({ // 获取设备信息
  767. success: (res) => {
  768. systeminfo = res
  769. },
  770. })
  771. return systeminfo
  772. },
  773. PromotionsFormat(promo){//促销活动类型数据处理
  774. if(promo!=null){
  775. if(promo.type == 1 && promo.mode == 1){
  776. return true
  777. }else{
  778. return false
  779. }
  780. }
  781. return false
  782. }
  783. },
  784. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  785. goodsList:{
  786. deep:true,
  787. handler(val,oldval){
  788. this.totalPeice()
  789. this.totalCount()
  790. }
  791. }
  792. },
  793. onPullDownRefresh() {//下拉刷新
  794. this.initGetCartGoodsList()
  795. uni.stopPullDownRefresh()
  796. },
  797. onShow(){
  798. if(this.hasLogin){
  799. this.initData()
  800. }else{
  801. this.initLogin()
  802. }
  803. },
  804. }
  805. </script>
  806. <style lang="scss">
  807. page{
  808. background: #f7f7f7;
  809. height: auto;
  810. }
  811. .cart-content{
  812. position: relative;
  813. }
  814. .container-cart-main.none{
  815. display: none;
  816. }
  817. .container-cart-main.show{
  818. display: block;
  819. }
  820. .cart-content.empty.none{
  821. display: none;
  822. }
  823. .cart-content.empty.show{
  824. display: block;
  825. }
  826. .container-cart.show{
  827. display: block;
  828. }
  829. .container-cart.none{
  830. display: none;
  831. }
  832. .empty-container.none{
  833. display: none;
  834. }
  835. .empty-container.show{
  836. display: flex;
  837. }
  838. .foot-check-delbtn{
  839. width: 100%;
  840. height: 80rpx;
  841. position: fixed;
  842. top: 0;
  843. left: 0;
  844. box-sizing: border-box;
  845. padding: 15rpx 24rpx;
  846. background-color: #F7F7F7;
  847. z-index: 9999;
  848. .foot-text{
  849. font-size: $font-size-26;
  850. height: 50rpx;
  851. line-height: 50rpx;
  852. color: $text-color;
  853. float: left;
  854. padding-left: 10rpx;
  855. text{
  856. color: $color-system;
  857. margin: 0 6rpx;
  858. }
  859. }
  860. .delBtn{
  861. width: 100rpx;
  862. display: inline-block;
  863. padding: 0 15rpx;
  864. font-size: $font-size-26;
  865. height: 50rpx;
  866. line-height: 50rpx;
  867. border-radius: 30rpx;
  868. background:#FFFFFF;
  869. border: 1px solid #C9C9C9;
  870. color: #999999;
  871. float: right;
  872. text-align: center;
  873. &.none{
  874. display: none;
  875. }
  876. }
  877. }
  878. .checkbox-box{
  879. display: flex;
  880. align-items: center;
  881. .checkbox{
  882. display: flex;
  883. margin: 0;
  884. padding: 0;
  885. display: flex;
  886. flex-direction: column;
  887. align-items: center;
  888. box-sizing: border-box;
  889. text-align: center;
  890. text-decoration: none;
  891. border-radius: 0;
  892. -webkit-tap-highlight-color: transparent;
  893. overflow: hidden;
  894. background-color:#FFFFFF;
  895. font-size: 36rpx;
  896. color:$color-system;
  897. }
  898. &.disabled{
  899. .checkbox{
  900. color:#999999
  901. }
  902. }
  903. .text{
  904. font-size: $font-size-24;
  905. margin-left: 10rpx;
  906. }
  907. }
  908. .goods-list{
  909. width: 100%;
  910. height: auto;
  911. background-color: #F7F7F7;
  912. .goods-item{
  913. width: 702rpx;
  914. padding: 0 24rpx;
  915. background: #FFFFFF;
  916. margin-bottom: 24rpx;
  917. }
  918. .shoptitle{
  919. display: flex;
  920. align-items: center;
  921. height: 80rpx;
  922. line-height: 80rpx;
  923. .checkbox-box{
  924. padding: 10rpx;
  925. }
  926. .text{
  927. width: 450rpx;
  928. display: block;
  929. overflow: hidden;
  930. text-overflow:ellipsis;
  931. white-space: nowrap;
  932. margin-left: 20rpx;
  933. font-size: $font-size-28;
  934. color: $text-color;
  935. text-align: left;
  936. font-weight: bold;
  937. }
  938. .floor-item-act{
  939. height: 56rpx;
  940. text-align: center;
  941. box-sizing: border-box;
  942. float: left;
  943. padding:10rpx 0;
  944. margin-left: 20rpx;
  945. .floor-tags{
  946. float: right;
  947. height: 36rpx;
  948. border-radius: 4rpx;
  949. background-color: rgba(225, 86, 22, 0.1);
  950. line-height: 36rpx;
  951. color: $color-system;
  952. text-align: center;
  953. display: inline-block;
  954. padding:0 16rpx;
  955. font-size: $font-size-20;
  956. }
  957. }
  958. }
  959. .goods-pros{
  960. width: 100%;
  961. height: auto;
  962. }
  963. .goods-pros-t{
  964. display: flex;
  965. align-items: center;
  966. width: 100%;
  967. height: 210rpx;
  968. padding:0 0 26rpx 0;
  969. .checkbox-box{
  970. padding: 10rpx;
  971. }
  972. .pros-img{
  973. width: 210rpx;
  974. height: 100%;
  975. border-radius: 10rpx;
  976. margin:0 20rpx;
  977. border:1px solid #f3f3f3;
  978. image{
  979. width: 100%;
  980. height: 100%;
  981. border-radius: 10rpx;
  982. }
  983. }
  984. }
  985. .goods-pros-b{
  986. width:100%;
  987. height: auto;
  988. padding:0 0 24rpx 0;
  989. box-sizing: border-box;
  990. &.show{
  991. display: block;
  992. }
  993. &.none{
  994. display: none;
  995. }
  996. .sum-none{
  997. width: 100%;
  998. height: 40rpx;
  999. line-height: 40rpx;
  1000. color: $text-color;
  1001. float: left;
  1002. text-align: right;
  1003. .money{
  1004. font-size: $font-size-24;
  1005. color: #999999;
  1006. text-decoration: line-through;
  1007. }
  1008. .money-sign{
  1009. font-size: $font-size-24;
  1010. color: #999999;
  1011. text-decoration: line-through;
  1012. }
  1013. .money-reduced{
  1014. margin-left: 10rpx;
  1015. font-size: $font-size-24;
  1016. color: $color-system;
  1017. }
  1018. }
  1019. .sum{
  1020. width: 100%;
  1021. height: 40rpx;
  1022. font-size: $font-size-28;
  1023. line-height: 40rpx;
  1024. color: $text-color;
  1025. float: left;
  1026. display: flex;
  1027. justify-content: flex-end;
  1028. .money{
  1029. color: #FF2A2A;
  1030. font-size: $font-size-28;
  1031. }
  1032. .money-sign{
  1033. font-size: $font-size-24;
  1034. color: #FF2A2A;
  1035. }
  1036. }
  1037. }
  1038. .pros-product{
  1039. width: 402rpx;
  1040. height: 100%;
  1041. line-height: 36rpx;
  1042. font-size: $font-size-28;
  1043. position: relative;
  1044. .producttitle{
  1045. width: 100%;
  1046. display: inline-block;
  1047. height: auto;
  1048. text-overflow:ellipsis;
  1049. display: -webkit-box;
  1050. word-break: break-all;
  1051. -webkit-box-orient: vertical;
  1052. -webkit-line-clamp: 2;
  1053. overflow: hidden;
  1054. margin-bottom: 8rpx;
  1055. .no-text{
  1056. display: inline-block;
  1057. height:36rpx;
  1058. padding: 0 12rpx;
  1059. line-height: 36rpx;
  1060. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1061. border-radius:18rpx;
  1062. text-align: center;
  1063. color: #FFFFFF;
  1064. font-size:$font-size-28;
  1065. margin-right: 24rpx;
  1066. }
  1067. }
  1068. .productspec{
  1069. height: 36rpx;
  1070. color: #999999;
  1071. font-size: $font-size-26;
  1072. }
  1073. .productprice{
  1074. width: 100%;
  1075. height: 48rpx;
  1076. margin: 10rpx 0 0 0;
  1077. .price{
  1078. line-height: 48rpx;
  1079. font-size: $font-size-28;
  1080. width: 48%;
  1081. color: #FF2A2A;
  1082. float: left;
  1083. &.disabled{
  1084. color: #999999;
  1085. text-decoration: line-through;
  1086. }
  1087. .money-sign{
  1088. font-size: $font-size-24;
  1089. color: #FF2A2A;
  1090. }
  1091. }
  1092. .count{
  1093. height: 100%;
  1094. float: right;
  1095. position: relative;
  1096. &.show{
  1097. display: block;
  1098. }
  1099. &.none{
  1100. display: none;
  1101. }
  1102. .count-tips{
  1103. width: auto;
  1104. display: inline-block;
  1105. padding: 0 15rpx;
  1106. line-height: 44rpx;
  1107. height: 44rpx;
  1108. border-radius: 22rpx;
  1109. background: $btn-confirm;
  1110. font-size: $font-size-24;
  1111. text-align: center;
  1112. color: #FFFFFF;
  1113. position: absolute;
  1114. top:-60rpx;
  1115. left: -5rpx;
  1116. z-index: 5;
  1117. &.step{
  1118. left:-217rpx
  1119. }
  1120. &::before{
  1121. content: "";
  1122. position: absolute;
  1123. bottom: -30rpx;
  1124. right: 15rpx;
  1125. z-index:1;
  1126. width: 0;
  1127. height: 0;
  1128. border-width: 18rpx;
  1129. border-style: solid;
  1130. border-color:$color-system transparent transparent transparent;
  1131. }
  1132. }
  1133. .number-box{
  1134. display: flex;
  1135. justify-content: center;
  1136. align-items: center;
  1137. .iconfont{
  1138. font-size: $font-size-24;
  1139. padding:0 20rpx;
  1140. color: $text-color;
  1141. text-align: center;
  1142. line-height: 48rpx;
  1143. font-weight: bold;
  1144. }
  1145. .btn-input{
  1146. width: 62rpx;
  1147. height: 48rpx;
  1148. line-height: 48rpx;
  1149. background: #F8F8F8;
  1150. border-radius: 4rpx;
  1151. text-align: center;
  1152. font-size: $font-size-24;
  1153. }
  1154. }
  1155. .uni-numbox{
  1156. position: absolute;
  1157. left: 45rpx;
  1158. bottom: 0;
  1159. .uni-numbox-minus, .uni-numbox-plus{
  1160. width: 50rpx;
  1161. line-height: 40rpx;
  1162. }
  1163. .uni-numbox-value {
  1164. font-size: $font-size-28;
  1165. width: 60rpx;
  1166. }
  1167. }
  1168. }
  1169. }
  1170. .floor-item-act{
  1171. width: 100%;
  1172. height: 56rpx;
  1173. text-align: center;
  1174. box-sizing: border-box;
  1175. float: left;
  1176. padding:0 0 10rpx 0;
  1177. margin-left: 10rpx;
  1178. .floor-tags{
  1179. float: left;
  1180. height: 36rpx;
  1181. border-radius: 4rpx;
  1182. background-color: rgba(225, 86, 22, 0.1);
  1183. line-height: 36rpx;
  1184. color: $color-system;
  1185. text-align: center;
  1186. display: inline-block;
  1187. padding:0 16rpx;
  1188. font-size: $font-size-20;
  1189. }
  1190. }
  1191. }
  1192. }
  1193. .failure-list{
  1194. width: 702rpx;
  1195. height: auto;
  1196. padding: 0 24rpx;
  1197. margin-top: 20rpx;
  1198. background: #FFFFFF;
  1199. .failure-title{
  1200. width: 100%;
  1201. height: 80rpx;
  1202. line-height: 80rpx;
  1203. font-size: $font-size-28;
  1204. border-bottom: 1px solid #EBEBEB;
  1205. .title-txt{
  1206. float: left;
  1207. color: $text-color;
  1208. text-align: left;
  1209. }
  1210. .title-btn{
  1211. float: right;
  1212. color: $color-system;
  1213. text-align: right;
  1214. line-height: 80rpx;
  1215. .butto{
  1216. display: inline-block;
  1217. padding: 0 15rpx;
  1218. font-size: $font-size-26;
  1219. height: 50rpx;
  1220. line-height: 50rpx;
  1221. border-radius: 30rpx;
  1222. background:#FFFFFF;
  1223. border: 1px solid #C9C9C9;
  1224. color: #999999;
  1225. margin-top: 15rpx;
  1226. }
  1227. }
  1228. }
  1229. .productlist{
  1230. padding-top: 10rpx;
  1231. .goods-pros{
  1232. width: 100%;
  1233. height: auto;
  1234. padding: 20rpx 0;
  1235. }
  1236. .goods-pros-t{
  1237. display: flex;
  1238. align-items: center;
  1239. width: 100%;
  1240. height: 210rpx;
  1241. position: relative;
  1242. .checkbox-box{
  1243. padding: 10rpx;
  1244. }
  1245. .pros-img{
  1246. width: 210rpx;
  1247. height: 100%;
  1248. border-radius: 10rpx;
  1249. margin:0 20rpx;
  1250. border:1px solid #f3f3f3;
  1251. position: relative;
  1252. .img-tip{
  1253. display: block;
  1254. width: 72rpx;
  1255. height: 36rpx;
  1256. line-height: 36rpx;
  1257. font-size: $font-size-24;
  1258. text-align: center;
  1259. color: #FFFFFF;
  1260. border-radius: 10rpx 0 10rpx 0;
  1261. background:linear-gradient(34deg,rgba(255,149,42,1) 0%,rgba(225,86,22,1) 100%);
  1262. position: absolute;
  1263. left: 0;
  1264. top: 0;
  1265. }
  1266. image{
  1267. width: 100%;
  1268. height: 100%;
  1269. border-radius: 10rpx;
  1270. }
  1271. }
  1272. .pros-marks{
  1273. width: 750rpx;
  1274. height: 250rpx;
  1275. z-index: 90;
  1276. background: rgba(0,0,0,.05);
  1277. position: absolute;
  1278. left:-20rpx;
  1279. top: -20rpx;
  1280. }
  1281. }
  1282. .goods-pros-b{
  1283. width:622rpx;
  1284. margin-left: 84rpx;
  1285. height: 40rpx;
  1286. padding:0 0 26rpx 0;
  1287. // border-top: 1px solid #EBEBEB;
  1288. &.show{
  1289. display: block;
  1290. }
  1291. &.none{
  1292. display: none;
  1293. }
  1294. .sum{
  1295. font-size: $font-size-28;
  1296. line-height: 40rpx;
  1297. color: $text-color;
  1298. display: flex;
  1299. justify-content: flex-end;
  1300. .money{
  1301. color: #FF2A2A;
  1302. font-size: $font-size-28;
  1303. }
  1304. .money-sign{
  1305. font-size: $font-size-24;
  1306. color: #FF2A2A;
  1307. }
  1308. }
  1309. }
  1310. .pros-product{
  1311. width: 402rpx;
  1312. height: 100%;
  1313. line-height: 36rpx;
  1314. font-size: $font-size-28;
  1315. position: relative;
  1316. .producttitle{
  1317. width: 100%;
  1318. display: inline-block;
  1319. height: auto;
  1320. text-overflow:ellipsis;
  1321. display: -webkit-box;
  1322. word-break: break-all;
  1323. -webkit-box-orient: vertical;
  1324. -webkit-line-clamp: 2;
  1325. overflow: hidden;
  1326. margin-bottom: 8rpx;
  1327. .no-text{
  1328. display: inline-block;
  1329. height:36rpx;
  1330. padding: 0 12rpx;
  1331. line-height: 36rpx;
  1332. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1333. border-radius:18rpx;
  1334. text-align: center;
  1335. color: #FFFFFF;
  1336. font-size: $font-size-28;
  1337. margin-right: 24rpx;
  1338. }
  1339. }
  1340. .productspec{
  1341. height: 36rpx;
  1342. color: #999999;
  1343. font-size: $font-size-26;
  1344. }
  1345. .productstate{
  1346. font-size: $font-size-28;
  1347. height: 44rpx;
  1348. color: #FF2A2A;
  1349. position: absolute;
  1350. bottom: 0;
  1351. left: 0;
  1352. }
  1353. }
  1354. }
  1355. }
  1356. .footer{
  1357. width: 100%;
  1358. background-color: #FFFFFF;
  1359. height: 110rpx;
  1360. position: fixed;
  1361. bottom: 0rpx;
  1362. z-index: 100;
  1363. .footer-le{
  1364. width: 520rpx;
  1365. height: 100%;
  1366. padding:0 24rpx;
  1367. float: left;
  1368. .foot-check{
  1369. width: 100rpx;
  1370. float: left;
  1371. line-height: 110rpx;
  1372. font-size: $font-size-24;
  1373. .checkbox{
  1374. width: 40rpx;
  1375. text-align: center;
  1376. }
  1377. .text{
  1378. width: 60rpx;
  1379. float: right;
  1380. }
  1381. }
  1382. .sum{
  1383. width: 380rpx;
  1384. height: 110rpx;
  1385. float: right;
  1386. box-sizing: border-box;
  1387. padding: 10rpx;
  1388. .sum-none{
  1389. width: 100%;
  1390. height: 45rpx;
  1391. line-height: 45rpx;
  1392. color: $text-color;
  1393. float: left;
  1394. text-align: right;
  1395. .money{
  1396. font-size: $font-size-24;
  1397. color: #999999;
  1398. text-decoration: line-through;
  1399. }
  1400. .money-sign{
  1401. font-size: $font-size-24;
  1402. color: #999999;
  1403. text-decoration: line-through;
  1404. }
  1405. .money-reduced{
  1406. margin-left: 10rpx;
  1407. font-size: $font-size-24;
  1408. color: $color-system;
  1409. }
  1410. }
  1411. .sum-price{
  1412. text-align: right;
  1413. width: 100%;
  1414. height: 45rpx;
  1415. line-height: 45rpx;
  1416. font-size: $font-size-30;
  1417. color: $text-color;
  1418. float: left;
  1419. font-weight: normal;
  1420. &.none{
  1421. height: 90rpx;
  1422. line-height: 90rpx;
  1423. }
  1424. .money{
  1425. color: #FF2A2A;
  1426. }
  1427. .money-sign{
  1428. font-size: $font-size-24;
  1429. color: #FF2A2A;
  1430. }
  1431. }
  1432. }
  1433. }
  1434. .footer-ri{
  1435. width: 180rpx;
  1436. height: 100%;
  1437. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1438. float: right;
  1439. display: flex;
  1440. justify-content: space-between;
  1441. align-items: center;
  1442. z-index: 999;
  1443. &.none{
  1444. display: none;
  1445. }
  1446. .btn{
  1447. width: 200rpx;
  1448. height: 100%;
  1449. font-size: $font-size-28;
  1450. line-height: 110rpx;
  1451. color: #FFFFFF;
  1452. display: flex;
  1453. justify-content: center;
  1454. align-items: center;
  1455. }
  1456. }
  1457. .footer-del{
  1458. width: 400rpx;
  1459. height: 110rpx;
  1460. position: absolute;
  1461. padding-left: 200rpx;
  1462. background: #FFFFFF;
  1463. right: 0;
  1464. top: 0;
  1465. z-index: 1000;
  1466. &.show{
  1467. animation: showDelbtn 0s linear both;
  1468. }
  1469. &.none{
  1470. animation: hideDelbtn 0s linear both;
  1471. }
  1472. .btn{
  1473. width: 50%;
  1474. height: 100%;
  1475. line-height: 110rpx;
  1476. font-size: $font-size-28;
  1477. color: #FFFFFF;
  1478. text-align: center;
  1479. float: left;
  1480. }
  1481. .btn.btn-cancel{
  1482. background:#EEC1AB;
  1483. }
  1484. .btn.btn-confirm{
  1485. background:#FF2A2A;
  1486. }
  1487. @keyframes showDelbtn {
  1488. 0% {
  1489. transform: translateX(0);
  1490. }
  1491. 100% {
  1492. transform: translateX(-100%);
  1493. }
  1494. }
  1495. @keyframes hideDelbtn {
  1496. 0% {
  1497. transform: translateX(-100%);
  1498. }
  1499. 100% {
  1500. transform: translateX(0);
  1501. }
  1502. }
  1503. }
  1504. }
  1505. </style>