cart.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553
  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-yixuanze':'icon-weixuanze']"></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-yixuanze':'icon-weixuanze']"></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-yixuanze':'icon-weixuanze']">
  88. </button>
  89. </view>
  90. <text class="img-tip">失效</text>
  91. <view class="pros-img">
  92. <image :src="failure.image ? failure.image:''" alt="" />
  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-yixuanze':'icon-weixuanze']"></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/index'
  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:#666666;
  874. float: left;
  875. padding-left: 10rpx;
  876. text{
  877. margin: 0 6rpx;
  878. }
  879. }
  880. .delBtn{
  881. width: 100rpx;
  882. display: inline-block;
  883. padding: 0 15rpx;
  884. font-size: $font-size-26;
  885. height: 50rpx;
  886. line-height: 50rpx;
  887. border-radius: 30rpx;
  888. background:#FFFFFF;
  889. border: 1px solid #e15616;
  890. color: #E15616;
  891. float: right;
  892. text-align: center;
  893. &.none{
  894. display: none;
  895. }
  896. }
  897. }
  898. .checkbox-box{
  899. display: flex;
  900. align-items: center;
  901. .checkbox{
  902. display: flex;
  903. margin: 0;
  904. padding: 5rpx;
  905. display: flex;
  906. flex-direction: column;
  907. align-items: center;
  908. box-sizing: border-box;
  909. text-align: center;
  910. text-decoration: none;
  911. border-radius: 0;
  912. -webkit-tap-highlight-color: transparent;
  913. overflow: hidden;
  914. background-color:#FFFFFF;
  915. font-size: 36rpx;
  916. color:#999999;
  917. &.icon-yixuanze{
  918. color: $color-system;
  919. }
  920. }
  921. &.disabled{
  922. .checkbox{
  923. color:#999999
  924. }
  925. }
  926. .text{
  927. font-size: $font-size-24;
  928. margin-left: 10rpx;
  929. }
  930. }
  931. .goods-list{
  932. width: 100%;
  933. height: auto;
  934. background-color: #F7F7F7;
  935. .goods-item{
  936. width: 702rpx;
  937. padding: 0 24rpx;
  938. background: #FFFFFF;
  939. margin-bottom: 24rpx;
  940. }
  941. .shoptitle{
  942. display: flex;
  943. align-items: center;
  944. height: 80rpx;
  945. line-height: 80rpx;
  946. .checkbox-box{
  947. padding: 10rpx;
  948. }
  949. .text{
  950. width: 450rpx;
  951. display: block;
  952. overflow: hidden;
  953. text-overflow:ellipsis;
  954. white-space: nowrap;
  955. margin-left: 20rpx;
  956. font-size: $font-size-28;
  957. color: $text-color;
  958. text-align: left;
  959. font-weight: bold;
  960. }
  961. .floor-item-act{
  962. height: 56rpx;
  963. text-align: center;
  964. box-sizing: border-box;
  965. float: left;
  966. padding:10rpx 0;
  967. margin-left: 20rpx;
  968. .floor-tags{
  969. height: 28rpx;
  970. border-radius: 6rpx;
  971. background-color: #FFFFFF;
  972. line-height: 28rpx;
  973. color: $color-system;
  974. text-align: center;
  975. display: inline-block;
  976. padding:0 16rpx;
  977. font-size: $font-size-20;
  978. border: 1px solid #E15616;
  979. float: right;
  980. }
  981. }
  982. }
  983. .goods-pros{
  984. width: 100%;
  985. height: auto;
  986. margin-bottom: 20rpx;
  987. }
  988. .goods-pros-t{
  989. display: flex;
  990. align-items: center;
  991. width: 100%;
  992. height: 210rpx;
  993. padding:0 0 26rpx 0;
  994. .checkbox-box{
  995. padding: 10rpx;
  996. }
  997. .pros-img{
  998. width: 210rpx;
  999. height: 100%;
  1000. border-radius: 10rpx;
  1001. margin:0 20rpx;
  1002. border:1px solid #f3f3f3;
  1003. image{
  1004. width: 100%;
  1005. height: 100%;
  1006. border-radius: 10rpx;
  1007. }
  1008. }
  1009. }
  1010. .goods-pros-b{
  1011. width:100%;
  1012. height: auto;
  1013. padding:0 0 24rpx 0;
  1014. box-sizing: border-box;
  1015. &.show{
  1016. display: block;
  1017. }
  1018. &.none{
  1019. display: none;
  1020. }
  1021. .sum-none{
  1022. width: 100%;
  1023. height: 48rpx;
  1024. line-height: 48rpx;
  1025. color: $text-color;
  1026. float: left;
  1027. text-align: right;
  1028. .money{
  1029. font-size: $font-size-26;
  1030. color: #999999;
  1031. text-decoration: line-through;
  1032. }
  1033. .money-sign{
  1034. font-size: $font-size-26;
  1035. color: #999999;
  1036. text-decoration: line-through;
  1037. }
  1038. .money-reduced{
  1039. margin-left: 10rpx;
  1040. font-size: $font-size-26;
  1041. color: $color-system;
  1042. .iconfont{
  1043. font-size: $font-size-34;
  1044. }
  1045. }
  1046. }
  1047. .sum{
  1048. width: 100%;
  1049. height: 40rpx;
  1050. font-size: $font-size-26;
  1051. line-height: 40rpx;
  1052. color: $text-color;
  1053. float: left;
  1054. display: flex;
  1055. justify-content: flex-end;
  1056. font-weight: bold;
  1057. .money{
  1058. color: #FF2A2A;
  1059. font-size: $font-size-26;
  1060. }
  1061. .money-sign{
  1062. font-size: $font-size-24;
  1063. color: #FF2A2A;
  1064. }
  1065. }
  1066. }
  1067. .pros-product{
  1068. width: 416rpx;
  1069. height: 100%;
  1070. line-height: 36rpx;
  1071. font-size: $font-size-28;
  1072. position: relative;
  1073. .producttitle{
  1074. width: 100%;
  1075. display: inline-block;
  1076. height: auto;
  1077. text-overflow:ellipsis;
  1078. display: -webkit-box;
  1079. word-break: break-all;
  1080. -webkit-box-orient: vertical;
  1081. -webkit-line-clamp: 2;
  1082. overflow: hidden;
  1083. margin-bottom: 15rpx;
  1084. .no-text{
  1085. display: inline-block;
  1086. height:36rpx;
  1087. padding: 0 12rpx;
  1088. line-height: 36rpx;
  1089. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1090. border-radius:18rpx;
  1091. text-align: center;
  1092. color: #FFFFFF;
  1093. font-size:$font-size-28;
  1094. margin-right: 24rpx;
  1095. }
  1096. }
  1097. .productspec{
  1098. height: 36rpx;
  1099. color: #999999;
  1100. font-size: $font-size-26;
  1101. }
  1102. .productprice{
  1103. width: 100%;
  1104. height: 48rpx;
  1105. margin: 30rpx 0 0 0;
  1106. .price{
  1107. line-height: 48rpx;
  1108. font-size: $font-size-26;
  1109. width: 48%;
  1110. color: #FF2A2A;
  1111. float: left;
  1112. font-weight: bold;
  1113. &.disabled{
  1114. color: #999999;
  1115. text-decoration: line-through;
  1116. }
  1117. .money-sign{
  1118. font-size: $font-size-24;
  1119. color: #FF2A2A;
  1120. }
  1121. }
  1122. .count{
  1123. height: 100%;
  1124. float: right;
  1125. position: relative;
  1126. &.show{
  1127. display: block;
  1128. }
  1129. &.none{
  1130. display: none;
  1131. }
  1132. .count-tips{
  1133. width: auto;
  1134. display: inline-block;
  1135. padding: 0 15rpx;
  1136. line-height: 44rpx;
  1137. height: 44rpx;
  1138. border-radius: 22rpx;
  1139. background: $btn-confirm;
  1140. font-size: $font-size-24;
  1141. text-align: center;
  1142. color: #FFFFFF;
  1143. position: absolute;
  1144. top:-60rpx;
  1145. left: -5rpx;
  1146. z-index: 5;
  1147. &.step{
  1148. left:-217rpx
  1149. }
  1150. &::before{
  1151. content: "";
  1152. position: absolute;
  1153. bottom: -30rpx;
  1154. right: 15rpx;
  1155. z-index:1;
  1156. width: 0;
  1157. height: 0;
  1158. border-width: 18rpx;
  1159. border-style: solid;
  1160. border-color:$color-system transparent transparent transparent;
  1161. }
  1162. }
  1163. .number-box{
  1164. display: flex;
  1165. justify-content: center;
  1166. align-items: center;
  1167. border: 2rpx solid #ffe6dc;
  1168. border-radius: 30rpx;
  1169. .iconfont{
  1170. font-size: $font-size-24;
  1171. padding:0 18rpx;
  1172. color: #999999;
  1173. text-align: center;
  1174. line-height: 48rpx;
  1175. font-weight: bold;
  1176. background: #fef6f3;
  1177. &.icon-jianhao{
  1178. border-radius: 30rpx 0 0 30rpx;
  1179. }
  1180. &.icon-jiahao{
  1181. border-radius: 0 30rpx 30rpx 0;
  1182. }
  1183. }
  1184. .btn-input{
  1185. width: 62rpx;
  1186. height: 48rpx;
  1187. line-height: 48rpx;
  1188. background: #fff;
  1189. border-radius: 4rpx;
  1190. text-align: center;
  1191. font-size: $font-size-24;
  1192. }
  1193. }
  1194. .uni-numbox{
  1195. position: absolute;
  1196. left: 45rpx;
  1197. bottom: 0;
  1198. .uni-numbox-minus, .uni-numbox-plus{
  1199. width: 50rpx;
  1200. line-height: 40rpx;
  1201. }
  1202. .uni-numbox-value {
  1203. font-size: $font-size-28;
  1204. width: 60rpx;
  1205. }
  1206. }
  1207. }
  1208. }
  1209. .floor-item-act{
  1210. width: 100%;
  1211. height: 56rpx;
  1212. text-align: center;
  1213. box-sizing: border-box;
  1214. float: left;
  1215. padding:0 0 10rpx 0;
  1216. margin-left: 10rpx;
  1217. .floor-tags{
  1218. height: 28rpx;
  1219. border-radius: 6rpx;
  1220. background-color: #FFFFFF;
  1221. line-height: 28rpx;
  1222. color: $color-system;
  1223. text-align: center;
  1224. display: inline-block;
  1225. padding:0 16rpx;
  1226. font-size: $font-size-20;
  1227. border: 1px solid #E15616;
  1228. float: left;
  1229. }
  1230. }
  1231. }
  1232. }
  1233. .failure-list{
  1234. width: 702rpx;
  1235. height: auto;
  1236. padding: 0 24rpx;
  1237. margin-top: 20rpx;
  1238. background: #FFFFFF;
  1239. .failure-title{
  1240. width: 100%;
  1241. height: 82rpx;
  1242. line-height: 82rpx;
  1243. font-size: $font-size-28;
  1244. border-bottom: 1px solid #EBEBEB;
  1245. .title-txt{
  1246. float: left;
  1247. color:#666666;
  1248. text-align: left;
  1249. }
  1250. .title-btn{
  1251. float: right;
  1252. color: $color-system;
  1253. text-align: right;
  1254. line-height: 80rpx;
  1255. .butto{
  1256. display: inline-block;
  1257. padding: 0 15rpx;
  1258. font-size: $font-size-26;
  1259. height: 50rpx;
  1260. line-height: 50rpx;
  1261. border-radius: 30rpx;
  1262. background:#FFFFFF;
  1263. // border: 1px solid #C9C9C9;
  1264. // color: #999999;
  1265. margin-top: 15rpx;
  1266. }
  1267. }
  1268. }
  1269. .productlist{
  1270. padding-top: 10rpx;
  1271. .goods-pros{
  1272. width: 100%;
  1273. height: auto;
  1274. padding: 20rpx 0;
  1275. }
  1276. .goods-pros-t{
  1277. display: flex;
  1278. align-items: center;
  1279. width: 100%;
  1280. height: 210rpx;
  1281. position: relative;
  1282. .img-tip{
  1283. display: block;
  1284. width: 72rpx;
  1285. height: 36rpx;
  1286. line-height: 36rpx;
  1287. font-size: $font-size-24;
  1288. text-align: center;
  1289. color: #FFFFFF;
  1290. border-radius: 24rpx;
  1291. background:rgba(51,51,51,0.3);
  1292. // position: absolute;
  1293. // left: 0;
  1294. // top: 0;
  1295. }
  1296. .checkbox-box{
  1297. padding: 10rpx;
  1298. }
  1299. .pros-img{
  1300. width: 180rpx;
  1301. height: 100%;
  1302. border-radius: 10rpx;
  1303. margin:0 20rpx;
  1304. border:1px solid #f3f3f3;
  1305. position: relative;
  1306. image{
  1307. width: 100%;
  1308. height: 100%;
  1309. border-radius: 10rpx;
  1310. }
  1311. }
  1312. .pros-marks{
  1313. width: 730rpx; height: 250rpx;
  1314. z-index: 90;
  1315. background: rgba(0,0,0,.05);
  1316. position: absolute;
  1317. left:-20rpx;
  1318. top: -20rpx;
  1319. }
  1320. }
  1321. .goods-pros-b{
  1322. width:622rpx;
  1323. margin-left: 84rpx;
  1324. height: 40rpx;
  1325. padding:0 0 26rpx 0;
  1326. // border-top: 1px solid #EBEBEB;
  1327. &.show{
  1328. display: block;
  1329. }
  1330. &.none{
  1331. display: none;
  1332. }
  1333. .sum{
  1334. font-size: $font-size-28;
  1335. line-height: 40rpx;
  1336. color: $text-color;
  1337. display: flex;
  1338. justify-content: flex-end;
  1339. .money{
  1340. color: #FF2A2A;
  1341. font-size: $font-size-28;
  1342. }
  1343. .money-sign{
  1344. font-size: $font-size-24;
  1345. color: #FF2A2A;
  1346. }
  1347. }
  1348. }
  1349. .pros-product{
  1350. width: 402rpx;
  1351. height: 100%;
  1352. line-height: 36rpx;
  1353. font-size: $font-size-28;
  1354. position: relative;
  1355. .producttitle{
  1356. width: 100%;
  1357. display: inline-block;
  1358. height: auto;
  1359. text-overflow:ellipsis;
  1360. display: -webkit-box;
  1361. word-break: break-all;
  1362. -webkit-box-orient: vertical;
  1363. -webkit-line-clamp: 2;
  1364. overflow: hidden;
  1365. margin-bottom: 8rpx;
  1366. .no-text{
  1367. display: inline-block;
  1368. height:36rpx;
  1369. padding: 0 12rpx;
  1370. line-height: 36rpx;
  1371. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1372. border-radius:18rpx;
  1373. text-align: center;
  1374. color: #FFFFFF;
  1375. font-size: $font-size-28;
  1376. margin-right: 24rpx;
  1377. }
  1378. }
  1379. .productspec{
  1380. height: 36rpx;
  1381. color: #999999;
  1382. font-size: $font-size-26;
  1383. margin-top: 20rpx;
  1384. }
  1385. .productstate{
  1386. font-size: $font-size-28;
  1387. height: 44rpx;
  1388. color: #FF2A2A;
  1389. position: absolute;
  1390. bottom: 0;
  1391. left: 0;
  1392. }
  1393. }
  1394. }
  1395. }
  1396. .footer{
  1397. width: 100%;
  1398. background-color: #FFFFFF;
  1399. height: 110rpx;
  1400. position: fixed;
  1401. bottom: 0rpx;
  1402. z-index: 100;
  1403. .footer-le{
  1404. width: 520rpx;
  1405. height: 100%;
  1406. padding:0 24rpx;
  1407. float: left;
  1408. box-sizing: border-box;
  1409. .foot-check{
  1410. width: 100rpx;
  1411. float: left;
  1412. line-height: 110rpx;
  1413. font-size: $font-size-24;
  1414. .checkbox{
  1415. width: 40rpx;
  1416. text-align: center;
  1417. }
  1418. .text{
  1419. width: 60rpx;
  1420. float: right;
  1421. }
  1422. }
  1423. .sum{
  1424. width: 360rpx;
  1425. height: 110rpx;
  1426. float: right;
  1427. box-sizing: border-box;
  1428. padding: 10rpx;
  1429. .sum-none{
  1430. width: 100%;
  1431. height: 45rpx;
  1432. line-height: 45rpx;
  1433. color: $text-color;
  1434. float: left;
  1435. text-align: right;
  1436. .money{
  1437. font-size: $font-size-24;
  1438. color: #999999;
  1439. text-decoration: line-through;
  1440. }
  1441. .money-sign{
  1442. font-size: $font-size-24;
  1443. color: #999999;
  1444. text-decoration: line-through;
  1445. }
  1446. .money-reduced{
  1447. margin-left: 10rpx;
  1448. font-size: $font-size-24;
  1449. color: $color-system;
  1450. }
  1451. }
  1452. .sum-price{
  1453. text-align: right;
  1454. width: 100%;
  1455. height: 45rpx;
  1456. line-height: 45rpx;
  1457. font-size: $font-size-30;
  1458. color: $text-color;
  1459. float: left;
  1460. font-weight: normal;
  1461. &.none{
  1462. height: 90rpx;
  1463. line-height: 90rpx;
  1464. }
  1465. .money{
  1466. color: #FF2A2A;
  1467. }
  1468. .money-sign{
  1469. font-size: $font-size-24;
  1470. color: #FF2A2A;
  1471. }
  1472. }
  1473. }
  1474. }
  1475. .footer-ri{
  1476. width: 230rpx;
  1477. height: 100%;
  1478. float: right;
  1479. display: flex;
  1480. justify-content: space-between;
  1481. align-items: center;
  1482. z-index: 999;
  1483. box-sizing: border-box;
  1484. padding: 13rpx 15rpx;
  1485. &.none{
  1486. display: none;
  1487. }
  1488. .btn{
  1489. width: 200rpx;
  1490. height: 100%;
  1491. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1492. font-size: $font-size-28;
  1493. line-height: 84rpx;
  1494. color: #FFFFFF;
  1495. display: flex;
  1496. border-radius: 42rpx;
  1497. justify-content: center;
  1498. align-items: center;
  1499. }
  1500. }
  1501. .footer-del{
  1502. width: 400rpx;
  1503. height: 110rpx;
  1504. position: absolute;
  1505. padding-left: 200rpx;
  1506. background: #FFFFFF;
  1507. right: 0;
  1508. top: 0;
  1509. z-index: 1000;
  1510. &.show{
  1511. animation: showDelbtn 0s linear both;
  1512. }
  1513. &.none{
  1514. animation: hideDelbtn 0s linear both;
  1515. }
  1516. .btn{
  1517. width: 50%;
  1518. height: 100%;
  1519. line-height: 110rpx;
  1520. font-size: $font-size-28;
  1521. color: #FFFFFF;
  1522. text-align: center;
  1523. float: left;
  1524. }
  1525. .btn.btn-cancel{
  1526. background:#EEC1AB;
  1527. }
  1528. .btn.btn-confirm{
  1529. background:#FF2A2A;
  1530. }
  1531. @keyframes showDelbtn {
  1532. 0% {
  1533. transform: translateX(0);
  1534. }
  1535. 100% {
  1536. transform: translateX(-100%);
  1537. }
  1538. }
  1539. @keyframes hideDelbtn {
  1540. 0% {
  1541. transform: translateX(-100%);
  1542. }
  1543. 100% {
  1544. transform: translateX(0);
  1545. }
  1546. }
  1547. }
  1548. }
  1549. </style>