cart.vue 43 KB

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