cart.vue 43 KB

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