cart.vue 42 KB

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