cart.vue 42 KB

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