cart.vue 44 KB

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