cart.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  4. <view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
  5. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0">
  6. <view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
  7. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  8. </view>
  9. <view v-if="!isEmpty" class="container-cart">
  10. <view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
  11. <view class="goods-list">
  12. <view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
  13. <view class="shoptitle">
  14. <!--选择商店的全部商品"-->
  15. <view class="checkbox-box" @click.stop="checkShop(item)">
  16. <view class="checkbox iconfont" :class="[item.checked ?'icon-yixuanze':'icon-weixuanze']"></view>
  17. </view>
  18. <view v-if="item.promotions" class="floor-item-act">
  19. <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
  20. </view>
  21. <view class="text">{{item.name}}</view>
  22. <view class="text-coupon" @click="showPopup(0)">领券</view>
  23. </view>
  24. <view class="productlist">
  25. <view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
  26. <view class="goods-pros-t">
  27. <!--选择商品-->
  28. <view class="checkbox-box" @click.stop="ischeck(item,pros)">
  29. <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
  30. </view>
  31. <view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.image ? pros.image:''" alt="" /></view>
  32. <view class="pros-product">
  33. <view class="producttitle" @click.stop="navToListPage(pros.productId)" >{{pros.name}}</view>
  34. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  35. <view class="productprice">
  36. <!--使用过滤器对总价改变-->
  37. <view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
  38. <text>¥</text>
  39. {{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price) | NumFormat }}
  40. </view>
  41. <view class="count" v-if="pros.validFlag == 2 " :class="[isshowDelbtn ? 'none':'show']">
  42. <text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
  43. <text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
  44. <view class="number-box">
  45. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  46. <input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
  47. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-show="pros.actStatus==1" class="floor-item-act">
  52. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  53. {{pros.promotions.name}}
  54. <text v-if ="pros.promotions!=null && pros.promotions.type!=3">
  55. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  56. </text>
  57. </view>
  58. <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
  59. </view>
  60. <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
  61. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
  68. <view class="sum-none" v-if="item.reducedPrice>0">
  69. <text class="money-sign">¥</text>
  70. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  71. <text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  72. </view>
  73. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="failure-list" v-if="failureList.length>0">
  78. <view class="failure-title">
  79. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  80. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  81. </view>
  82. <view class="productlist">
  83. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  84. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  85. <!--选择商品-->
  86. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  87. <button class="checkbox iconfont"
  88. :class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
  89. </button>
  90. </view>
  91. <text class="img-tip">失效</text>
  92. <view class="pros-img">
  93. <image :src="failure.image ? failure.image:''" alt="" />
  94. </view>
  95. <view class="pros-product">
  96. <view class="producttitle">{{failure.name}}</view>
  97. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  98. <view class="productstate">{{failureStateText(failure.status)}}</view>
  99. </view>
  100. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 脚部菜单 -->
  107. <view class="footer">
  108. <view class="footer-le">
  109. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  110. <button class="checkbox iconfont" :class="[isCheckAll?'icon-yixuanze':'icon-weixuanze']"></button>
  111. <view class="text">全选</view>
  112. </view>
  113. <view class="sum">
  114. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  115. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  116. </view>
  117. <view class="sum-none" v-if="reducedPrice>0">
  118. <!-- <text class="money-sign">¥</text> -->
  119. <!-- <text class="money">{{ totalOriginalPrice | NumFormat }}</text> -->
  120. <text class="money-reduced">共减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  121. <text class="money-popup" @click="showPopup(1)">优惠明细<text class="iconfont icon-xiangshangjiantou"></text></text>
  122. </view>
  123. </view>
  124. </view>
  125. <view v-if="!isshowDelbtn" class="footer-ri" >
  126. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  127. </view>
  128. <view v-else class="footer-del">
  129. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  130. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  131. </view>
  132. </view>
  133. </view>
  134. <view v-else class="cart-content empty">
  135. <view class="empty-container">
  136. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  137. <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
  138. <view class="login-btn" @click="goIndex">去商城</view>
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 促销活动弹窗 -->
  143. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  144. <!-- 透明模态层 -->
  145. <modal-layer v-if='modallayer'></modal-layer>
  146. <!-- 优惠券 -->
  147. <tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
  148. <view class="tui-popup-box clearfix">
  149. <view class="title">优惠券</view>
  150. <view class="tui-popup-close" @click="hidePopup(0)">
  151. <text class="iconfont icon-iconfontguanbi"></text>
  152. </view>
  153. <view class="tui-popup-tabs">
  154. <coupon-tabs :tabs="navbar"
  155. :currentTab="currentTab>2?0:currentTab"
  156. @change="couponChange"
  157. :itemWidth="(100/navbar.length)+'%'"
  158. selectedColor="#e15616"
  159. sliderBgColor="#e15616">
  160. </coupon-tabs>
  161. </view>
  162. <div class="tui-popup-main coupon">
  163. <scroll-view class="tui-popup-scroll" scroll-y="true">
  164. <view v-for="(coupon,index) in dataList" :key="index" :id="coupon.id" class="coupon-list">
  165. <view class="list-cell-le">
  166. <view class="coupon-maxMoney">
  167. <text class="small">¥</text>
  168. {{ coupon.maxMoney }}
  169. </view>
  170. <view class="coupon-minMoney">
  171. 满{{ coupon.minMoney }}可用
  172. </view>
  173. </view>
  174. <view class="list-cell-ri">
  175. <view class="list-cell-top">
  176. <view class="list-cell-type">
  177. <view class="list-cell-tags">
  178. <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
  179. </view>
  180. <view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
  181. <text v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</text>
  182. <text v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</text>
  183. <text v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</text>
  184. </view>
  185. </view>
  186. <view class="list-cell-btn">
  187. <view class="icon-used">
  188. <view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
  189. <view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
  190. </view>
  191. </view>
  192. </view>
  193. <view class="list-cell-time">{{ coupon.couponTime }}</view>
  194. </view>
  195. </view>
  196. </scroll-view>
  197. </div>
  198. </view>
  199. </tui-bottom-popup>
  200. <!-- 优惠明细 -->
  201. <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
  202. <view class="tui-popup-box clearfix">
  203. <view class="title">优惠明细</view>
  204. <view class="tui-popup-close" @click="hidePopup(1)">
  205. <text class="iconfont icon-iconfontguanbi"></text>
  206. </view>
  207. <div class="tui-popup-main coupon">
  208. <view class="tui-popup-coupon">
  209. <view class="tui-popup-h1">
  210. <view class="tui-popup-text left">商品总额</view>
  211. <view class="tui-popup-text right bold">¥4500.00</view>
  212. </view>
  213. <view class="tui-popup-h1">
  214. <view class="tui-popup-text left">促销满减</view>
  215. <view class="tui-popup-text right bold red">¥500.00</view>
  216. </view>
  217. <view class="tui-popup-h1">
  218. <view class="tui-popup-text left">优惠券</view>
  219. <view class="tui-popup-text right bold red">¥100.00</view>
  220. </view>
  221. <view class="tui-popup-h1">
  222. <view class="tui-popup-text left bold">共减</view>
  223. <view class="tui-popup-text right bold red">¥600.00</view>
  224. </view>
  225. <view class="tui-popup-h1">
  226. <view class="tui-popup-text left bold">总计</view>
  227. <view class="tui-popup-text right bold">¥3900.00</view>
  228. </view>
  229. </view>
  230. </div>
  231. </view>
  232. </tui-bottom-popup>
  233. </view>
  234. </template>
  235. <script>
  236. import authorize from '@/common/config/authorize.js'
  237. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  238. import tuiNomore from "@/components/tui-components/nomore/nomore"
  239. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  240. import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
  241. import modalLayer from "@/components/modal-layer"
  242. import { mapState,mapMutations } from 'vuex';
  243. export default{
  244. components:{
  245. tuiLoadmore,
  246. tuiNomore,
  247. activiPopup,
  248. couponTabs,
  249. modalLayer
  250. },
  251. data(){
  252. return{
  253. CustomBar:this.CustomBar,// 顶部导航栏高度
  254. isIphoneX:this.$store.state.isIphoneX,
  255. userID:'',
  256. alertType:'',
  257. isStock:'',
  258. handlerPros:{},//监听单挑促销商品
  259. failureList:[], //失效商品列表
  260. goodsList:[], //购物车的商品
  261. promotionsList:[],//促销列表
  262. delGoodsList:'',//要删除的商品
  263. setGoodData:'', //确认订单的商品
  264. isCheckAll:false,//是否全选
  265. kindCount:0,//购物车宝贝数量
  266. allPrice:0,//所有价格
  267. totalOriginalPrice:0,//所有原价价
  268. reducedPrice:0,//满减
  269. allCount:0,//被选中的产品数量
  270. isModallayer:false,
  271. skeletonShow:true,
  272. isshowDelbtn:false,
  273. isDisabled: false, // 供应商/店铺全选是否禁用状态
  274. isNoConfim:false,
  275. isEmpty:false,//显示空购物车
  276. scrollHeight: 'auto',
  277. nomoreText: '上拉显示更多',
  278. hasNextPage: false,
  279. loadding: false,
  280. pullUpOn: true,
  281. pullFlag: true,
  282. pageSize: 10,
  283. pageNum: 1,
  284. submitIds:[],
  285. popupShow:false,
  286. popupShow0:false,
  287. popupShow1:false,
  288. currentTab: 0,
  289. navbar: [
  290. { name: "未领取",num:3 },
  291. { name: "已领取",num:4 }
  292. ],
  293. dataList:[
  294. {
  295. maxMoney:5000,
  296. minMoney:1000,
  297. couponType:1,
  298. couponTime:'2021.06.28~2021.07.28',
  299. couponText:'华熙生物技术有限公司',
  300. useType:1,
  301. couponBtnType:0
  302. },
  303. {
  304. maxMoney:2000,
  305. minMoney:200,
  306. couponType:2,
  307. couponTime:'2021.06.28~2021.07.28',
  308. couponText:'华熙生物技术有限公司',
  309. useType:2,
  310. couponBtnType:0
  311. },
  312. {
  313. maxMoney:4000,
  314. minMoney:800,
  315. couponType:3,
  316. couponTime:'2021.06.28~2021.07.28',
  317. couponText:'华熙生物技术有限公司',
  318. useType:3,
  319. couponBtnType:0
  320. },
  321. {
  322. maxMoney:6000,
  323. minMoney:1000,
  324. couponType:4,
  325. couponTime:'2021.06.28~2021.07.28',
  326. couponText:'华熙生物技术有限公司',
  327. useType:1,
  328. couponBtnType:0
  329. },
  330. {
  331. maxMoney:6000,
  332. minMoney:1000,
  333. couponType:5,
  334. couponTime:'2021.06.28~2021.07.28',
  335. couponText:'华熙生物技术有限公司',
  336. useType:2,
  337. couponBtnType:0
  338. }
  339. ],
  340. }
  341. },
  342. onLoad(){
  343. this.setScrollHeight();
  344. },
  345. computed: {
  346. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  347. },
  348. filters:{
  349. NumFormat(value) {//处理金额
  350. return Number(value).toFixed(2);
  351. },
  352. totalprice(val,count){//单件商品的价格 × 数量
  353. return (val * count).toFixed(2)
  354. },
  355. TypeFormat:function(value) {
  356. switch (value) {
  357. case 1:
  358. return '活动券';
  359. break;
  360. case 2:
  361. return '品类券';
  362. break;
  363. case 3:
  364. return '店铺券';
  365. break;
  366. case 4:
  367. return '专享券';
  368. break;
  369. case 5:
  370. return '新用户券';
  371. break;
  372. }
  373. },
  374. TypeFormatText:function(value) {
  375. switch (value) {
  376. case 1:
  377. return '全商城商品通用';
  378. break;
  379. case 2:
  380. return '仅限购买仪器类商品';
  381. break;
  382. case 3:
  383. return '仅可购买店铺';
  384. break;
  385. }
  386. }
  387. },
  388. methods:{
  389. initData(){
  390. this.isModallayer = false //遮罩层 防止多次点击
  391. this.skeletonShow = true //预加载圆圈
  392. this.isCheckAll=false//是否全选
  393. this.submitIds = []
  394. this.$api.getStorage().then((resolve) => {
  395. this.userID = resolve.userId;
  396. this.initGetCartGoodsList();
  397. })
  398. },
  399. initLogin(){
  400. this.$api.redirectTo('/pages/login/login?type=4')
  401. },
  402. clickPopupShow(pros,type){
  403. this.popupShow = true;
  404. this.handlerPros = pros;
  405. },
  406. setScrollHeight() {
  407. // 窗口高度-footer高度
  408. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  409. setTimeout(()=> {
  410. const query = uni.createSelectorQuery().in(this);
  411. query.selectAll('.footer').boundingClientRect();
  412. query.exec(res => {
  413. this.windowHeight = windowHeight;
  414. if(res[0][0]) {
  415. this.scrollHeight = windowHeight - res[0][0].height;
  416. }
  417. })
  418. }, 500)
  419. },
  420. initGetCartGoodsList(){//初始化购物车 index:1
  421. this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
  422. this.skeletonShow = false
  423. let data = response.data
  424. this.kindCount = data.kindCount
  425. this.promotionsList = data.promotions
  426. this.$store.commit('updateAllNum',data.kindCount)
  427. if( data.list.length > 0 || data.invalid.length > 0){
  428. this.isEmpty =false
  429. }else{
  430. this.isEmpty =true
  431. }
  432. if(data.list && data.list.length > 0 ){
  433. this.goodsList = data.list;
  434. this.goodsList.forEach((item,index) => {
  435. item.cartList.forEach(pros => {
  436. pros.shopID = item.shopID;
  437. pros.isStep = false
  438. if(pros.step === 2){
  439. if(pros.number % pros.min != 0){
  440. pros.number = pros.min
  441. this.totalShopPeice()
  442. this.updateShoppogNum(pros)
  443. }
  444. }
  445. })
  446. })
  447. this.totalShopPeice()
  448. } else {
  449. this.goodsList = [];
  450. }
  451. if( data.invalid && data.invalid.length > 0){
  452. let newFailureList = [],isFailureLayer;
  453. data.invalid.forEach((failure,index) => {
  454. if(failure.status == 1 || failure.status == 2) {
  455. isFailureLayer = true
  456. }else{
  457. isFailureLayer = false
  458. }
  459. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  460. })
  461. this.failureList = newFailureList
  462. } else {
  463. this.failureList = [];
  464. }
  465. }).catch(error =>{
  466. this.$util.msg(error.msg,2000);
  467. })
  468. },
  469. ischeckFailure(failure){
  470. failure.productsChecked = !failure.productsChecked
  471. this.updateCheckAllBtn()
  472. },
  473. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  474. pro.productsChecked = !pro.productsChecked;
  475. if(pro.productsChecked) {
  476. if(!this.submitIds.includes(pro.productID*1)){
  477. this.submitIds.push(pro.productID);
  478. }
  479. } else {
  480. var lent = this.submitIds.indexOf(pro.productID*1);
  481. if(lent >=0 ){
  482. this.submitIds.splice(lent, 1);
  483. }
  484. }
  485. this.updateProductCheckedAllBtn(item);
  486. this.updateCheckAllBtn();
  487. },
  488. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  489. let productsList = item.cartList,
  490. productsCheckedLength = 0,
  491. disabledLength = 0;
  492. if(this.isshowDelbtn) {
  493. productsList.forEach(pros => {
  494. if(pros.productsChecked) {
  495. productsCheckedLength++;
  496. }
  497. })
  498. } else {
  499. productsList.forEach(pros => {
  500. if(pros.productsChecked) {
  501. productsCheckedLength++;
  502. }
  503. })
  504. }
  505. item.checked = productsCheckedLength === productsList.length;
  506. },
  507. updateCheckAllBtn() {// 全选勾选判断
  508. let goodsCheckedLength = 0,
  509. goodsList = this.goodsList,
  510. failureList = this.failureList;
  511. goodsList.forEach(item => {
  512. if(item.checked) {
  513. goodsCheckedLength++;
  514. }
  515. })
  516. failureList.forEach(failureItem=>{
  517. if(failureItem.productsChecked){
  518. goodsCheckedLength++;
  519. }
  520. })
  521. if(this.isshowDelbtn){
  522. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  523. }else{
  524. this.isCheckAll = goodsCheckedLength === goodsList.length;
  525. }
  526. },
  527. checkShop(item){//与单选商品类似
  528. item.checked = !item.checked;
  529. this.setProductChecked(item);
  530. this.updateCheckAllBtn();
  531. },
  532. setProductChecked(item) {
  533. item.cartList.forEach(pros=>{
  534. if(item.checked) {
  535. pros.productsChecked = true;
  536. if(!this.submitIds.includes(pros.productId*1)){
  537. this.submitIds.push(pros.productId);
  538. }
  539. } else {
  540. pros.productsChecked = false;
  541. var lent = this.submitIds.indexOf(pros.productId*1);
  542. if(lent >=0 ){
  543. this.submitIds.splice(lent, 1);
  544. }
  545. }
  546. })
  547. },
  548. updateBothCheckBtn() {
  549. if(this.isshowDelbtn) {
  550. // 当管理删除按钮出现时,失效的商品可被选择
  551. this.goodsList.forEach((item)=>{
  552. item.checked = this.isCheckAll;
  553. this.setProductChecked(item);
  554. })
  555. //删除按钮 全选包括失效商品勾选
  556. this.failureList.forEach(failureItem=>{
  557. failureItem.productsChecked = this.isCheckAll;
  558. })
  559. } else {
  560. this.goodsList.forEach((item)=>{
  561. item.checked = this.isCheckAll && !item.isDisabled;
  562. this.setProductChecked(item);
  563. })
  564. }
  565. },
  566. checkAll(){//全选方法内调用方法
  567. this.isCheckAll = !this.isCheckAll;
  568. if(!this.isCheckAll){
  569. this.popupShow1 = false
  570. }
  571. this.updateBothCheckBtn();
  572. },
  573. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  574. let touchPrice = 0;
  575. let reducedPrice = 0;//商铺合计满减价
  576. this.goodsList.map((item,index)=>{
  577. //计算店铺满减后店铺合计
  578. if(item.promotions && item.promotions.mode == 2){
  579. let prosPrice=0;
  580. let totalOriginalPrice = 0;//商铺合计原价
  581. item.cartList.forEach(pros=>{
  582. prosPrice += pros.price*pros.number
  583. totalOriginalPrice += pros.originalPrice*pros.number
  584. })
  585. if(prosPrice >= item.promotions.touchPrice){
  586. item.totalPrice = prosPrice - item.promotions.reducedPrice
  587. item.reducedPrice = item.promotions.reducedPrice
  588. item.totalOriginalPrice = totalOriginalPrice
  589. }else{
  590. item.reducedPrice = 0 //统计合计价格
  591. item.totalPrice = prosPrice
  592. }
  593. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  594. let _totalPrice = 0;
  595. let _reducedPrice = 0;
  596. let _totalOriginalPrice =0;
  597. item.cartList.forEach(pros=>{
  598. let _price = pros.price*pros.number
  599. _totalOriginalPrice += pros.price*pros.number;
  600. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  601. if(_price >= pros.promotions.touchPrice){
  602. _price = _price - pros.promotions.reducedPrice
  603. _reducedPrice += pros.promotions.reducedPrice
  604. }
  605. _totalPrice += _price
  606. }else{
  607. _reducedPrice = 0;
  608. _totalPrice += pros.price*pros.number;
  609. }
  610. })
  611. item.reducedPrice = _reducedPrice
  612. item.totalOriginalPrice = _totalOriginalPrice
  613. item.totalPrice = _totalPrice
  614. }
  615. })
  616. },
  617. totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  618. let totalPrice = 0;
  619. let reducedPrice = 0;
  620. let originalPrice = 0;
  621. this.goodsList.forEach((item,index)=>{
  622. let supplierPrice = 0;
  623. let supplierReducedPrice = 0;
  624. item.totalprice = 0;
  625. item.reducedprice = 0;
  626. item.originalprice = 0;
  627. item.cartList.forEach(pros=>{
  628. if(pros.productsChecked){
  629. supplierPrice += pros.price*pros.number;
  630. // 单品满减
  631. if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
  632. // 单品满减-重新计算供应商总价/满减金额
  633. if(pros.price*pros.number >= pros.promotions.touchPrice){
  634. supplierPrice -= pros.promotions.reducedPrice;
  635. supplierReducedPrice += pros.promotions.reducedPrice;
  636. }
  637. }
  638. }
  639. })
  640. // 店铺满减
  641. if(item.promotions && item.promotions.mode*1===2){
  642. // 店铺满减-计算供应商总价/满减金额
  643. if(supplierPrice >= item.promotions.touchPrice){
  644. supplierPrice -= item.promotions.reducedPrice;
  645. supplierReducedPrice += item.promotions.reducedPrice;
  646. }
  647. }
  648. item.totalprice = supplierPrice;
  649. item.reducedprice = supplierReducedPrice;
  650. item.originalprice = (supplierPrice+supplierReducedPrice);
  651. totalPrice += item.totalprice;
  652. reducedPrice += item.reducedprice;
  653. originalPrice += item.originalprice;
  654. })
  655. //总促销计算
  656. this.promotionsList.forEach(promotions =>{
  657. // 凑单满减
  658. if(promotions.mode*1===2 && promotions.type*1===2){
  659. let total = 0;
  660. promotions.productList.forEach(pros=>{
  661. if (this.submitIds.includes(pros.productId*1)){
  662. total += pros.number * pros.price;
  663. }
  664. });
  665. if(total>=promotions.touchPrice){
  666. totalPrice -= promotions.reducedPrice;
  667. reducedPrice += promotions.reducedPrice;
  668. }
  669. }
  670. });
  671. //最后统计商品原价
  672. this.totalOriginalPrice = originalPrice;
  673. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  674. this.reducedPrice = reducedPrice;
  675. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  676. this.allPrice = totalPrice ;
  677. },
  678. totalCount(){//计算总数量
  679. this.allCount = 0
  680. let prosAllCount=0
  681. let validCount = 0
  682. let validList =[];
  683. let productsList =[];
  684. this.goodsList.forEach(item=>{
  685. productsList = item.cartList
  686. productsList.forEach(pros=>{
  687. if(pros.productsChecked){
  688. prosAllCount+=parseInt(pros.number);
  689. this.allCount = prosAllCount
  690. }
  691. })
  692. })
  693. },
  694. changeCountAdd(item,pros){//商品数量加加
  695. if(pros.step === 2){
  696. pros.isStep = false
  697. pros.number += pros.min
  698. this.processActivityPrice(pros)
  699. this.isStock = false
  700. }else{
  701. pros.number++
  702. this.processActivityPrice(pros)
  703. this.isStock = false
  704. }
  705. this.updateShoppogNum(pros)
  706. this.totalShopPeice();
  707. },
  708. changeCountSub(item,pros){//商品数量减减
  709. if(pros.number<=pros.min){
  710. pros.number= pros.min
  711. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  712. return
  713. }else{
  714. if(pros.step === 2){
  715. pros.isStep = false
  716. pros.number -= pros.min
  717. }else{
  718. pros.number--
  719. }
  720. this.processActivityPrice(pros)
  721. }
  722. this.updateShoppogNum(pros)
  723. this.totalShopPeice();
  724. },
  725. changeInput(pros){//输入商品数量更新
  726. pros.isStep = false
  727. },
  728. changeNnmber(e,item,pros){//输入商品数量更新
  729. let _value = Number(e.detail.value);
  730. if(!this.$api.isNumber(_value)){
  731. pros.number = pros.min
  732. }else if(_value < pros.min){
  733. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  734. pros.number = pros.min
  735. }else if(_value % pros.min != 0){
  736. pros.isStep = true
  737. pros.number = pros.min
  738. }else{
  739. pros.isStep = false
  740. pros.number = e.detail.value
  741. this.processActivityPrice(pros)
  742. }
  743. this.updateShoppogNum(pros)
  744. this.totalShopPeice();
  745. },
  746. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  747. let ladderPriceList = pros.ladderPrices;
  748. if(pros.ladderFlag == '0' || pros.actStatus == 1){
  749. pros.price = pros.price
  750. }else{
  751. ladderPriceList.forEach((item,index)=>{
  752. if(pros.number>=item.buyNum){
  753. pros.price = item.buyPrice
  754. }
  755. })
  756. }
  757. },
  758. updateShoppogNum(pros){//加减购物车商品更新到后台
  759. let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
  760. this.ProductService.ShoppingCartUpdate(params).then(response =>{
  761. this.isshowDelbtn = false;
  762. this.initGetCartGoodsList();
  763. }).catch(error =>{
  764. this.$util.msg(error.msg,2000);
  765. })
  766. },
  767. toConfirmation(){//跳转确认订单页面
  768. let setGoodsList=[];
  769. this.goodsList.forEach(res=>{
  770. let products = res.cartList
  771. products.forEach(pros=>{
  772. if(pros.productsChecked){
  773. setGoodsList.push(pros.productId)
  774. }
  775. })
  776. })
  777. if(setGoodsList == ''){
  778. this.$util.msg("请先选择结算商品~",2000);
  779. return
  780. }else{
  781. this.isNoConfim = false
  782. this.goodsList.forEach(el=>{
  783. el.cartList.forEach(pros=>{
  784. if(pros.productsChecked){
  785. if(pros.number<pros.min){
  786. this.isNoConfim = true
  787. }
  788. }
  789. })
  790. })
  791. if(this.isNoConfim){
  792. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  793. return;
  794. }
  795. let productID = '';
  796. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  797. el.cartList.forEach(pros=>{
  798. if(pros.productsChecked){
  799. productID += pros.productId+','
  800. }
  801. })
  802. })
  803. let cartPramsData={
  804. allPrice:this.allPrice,
  805. allCount:this.allCount,
  806. productID:productID.substring(0,productID.lastIndexOf(',')),
  807. productCount:''
  808. }
  809. // 友盟埋点购物车去结算点击事件
  810. if(process.env.NODE_ENV != 'development'){
  811. this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
  812. Um_Key_PageName: '去结算',
  813. Um_Key_SourcePage: '底部菜单购物车',
  814. })
  815. }
  816. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  817. }
  818. },
  819. showDelManager(){//显示删除商品管理
  820. this.isshowDelbtn = true;
  821. if(this.isCheckAll) {
  822. this.updateBothCheckBtn();
  823. } else {
  824. this.goodsList.forEach(item => {
  825. if(item.checked) {
  826. item.cartList.forEach(pros => {
  827. pros.productsChecked = true;
  828. })
  829. }
  830. })
  831. this.updateCheckAllBtn();
  832. }
  833. // 失效也被勾选
  834. this.failureList.forEach(failureItem => {
  835. if(failureItem.isFailureLayer){
  836. failureItem.isFailureLayer = false
  837. }
  838. })
  839. },
  840. hideDelManage(){//隐藏删除商品管理
  841. this.isshowDelbtn = false;
  842. let isFailureLayer,newFailureList =[];
  843. if(this.isCheckAll) {
  844. this.updateBothCheckBtn();
  845. } else {
  846. // 失效商品取消勾选
  847. this.goodsList.forEach(item => {
  848. if(item.isDisabled) {
  849. item.checked = false;
  850. }
  851. item.cartList.forEach(pros => {
  852. if(pros.validFlag == 3) {
  853. pros.productsChecked = false;
  854. }
  855. })
  856. })
  857. this.updateCheckAllBtn();
  858. }
  859. this.failureList.forEach((failure,index) => {
  860. if(failure.failureState == 1 || failure.failureState == 2) {
  861. isFailureLayer = true
  862. }else{
  863. isFailureLayer = false
  864. }
  865. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  866. })
  867. this.failureList = newFailureList;
  868. },
  869. deleteList(){//删除购物车商品
  870. this.delGoodsList=[];
  871. this.goodsList.forEach(delitem=>{
  872. let products = delitem.cartList
  873. products.forEach(pros=>{
  874. if(pros.productsChecked){
  875. this.delGoodsList += pros.productId+','
  876. }
  877. })
  878. })
  879. this.failureList.forEach(failure=>{
  880. if(failure.productsChecked){
  881. this.delGoodsList += failure.productId+','
  882. }
  883. })
  884. if(this.delGoodsList.length == 0){
  885. this.$util.msg("请选择要删除的商品~",2000);
  886. return
  887. }else{
  888. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  889. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  890. this.$util.msg('删除成功',2000);
  891. setTimeout(()=>{
  892. this.isshowDelbtn = false;
  893. this.initGetCartGoodsList();
  894. },2000)
  895. }).catch(error =>{
  896. this.$util.msg(error.msg,2000)
  897. })
  898. })
  899. }
  900. },
  901. deletefailureList(){
  902. this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
  903. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  904. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  905. this.$util.msg('删除成功',2000);
  906. setTimeout(()=>{
  907. this.isshowDelbtn = false;
  908. this.initGetCartGoodsList();
  909. },2000)
  910. }).catch(error =>{
  911. this.$util.msg(error.msg,2000)
  912. })
  913. })
  914. },
  915. goIndex(){
  916. uni.switchTab({
  917. url: '/pages/tabBar/home/index'
  918. });
  919. },
  920. goNavto(url){
  921. uni.navigateTo ({
  922. url
  923. })
  924. },
  925. navToListPage(id){
  926. this.isModallayer = true;
  927. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  928. },
  929. failureToProduct(failure){
  930. if(failure.status == 1){
  931. this.$util.msg('商品已丢失,不能查看',2000)
  932. return
  933. }else if(failure.status == 2){
  934. this.$util.msg('商品已停售,不能查看',2000)
  935. return
  936. }else{
  937. this.isModallayer = true;
  938. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  939. }
  940. },
  941. failureStateText(state){
  942. let stateText = '',
  943. stateTextObject={
  944. 1:'商品已丢失',
  945. 2:'商品已停售',
  946. 3:'商品已下架',
  947. 4:'商品已售罄',
  948. 5:'价格仅会员可见,您不能购买',
  949. 6:'未公开价格',
  950. 7:'库存不足'
  951. }
  952. Object.keys(stateTextObject).forEach(key => {
  953. if(key == state){
  954. stateText = stateTextObject[key]
  955. }
  956. })
  957. return stateText;
  958. },
  959. setHeaderBtnPosi(){
  960. // 获得胶囊按钮位置信息
  961. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  962. return headerBtnPosi
  963. },
  964. setSysteminfo(){
  965. let systeminfo;
  966. uni.getSystemInfo({ // 获取设备信息
  967. success: (res) => {
  968. systeminfo = res
  969. },
  970. })
  971. return systeminfo
  972. },
  973. PromotionsFormat(promo){//促销活动类型数据处理
  974. if(promo!=null){
  975. if(promo.type == 1 && promo.mode == 1){
  976. return true
  977. }else{
  978. return false
  979. }
  980. }
  981. return false
  982. },
  983. showPopup(index){// 显示popup弹窗
  984. switch(index){
  985. case 0:
  986. this.popupShow0 = true
  987. break;
  988. case 1:
  989. this.popupShow1 = true
  990. break;
  991. }
  992. },
  993. hidePopup(index){// 隐藏popup弹窗
  994. switch(index){
  995. case 0:
  996. this.popupShow0 = false
  997. break;
  998. case 1:
  999. this.popupShow1 = false
  1000. break;
  1001. }
  1002. },
  1003. couponChange(e) {
  1004. this.currentTab = e.index
  1005. console.log('currentTab',this.currentTab)
  1006. switch(this.currentTab){
  1007. case 0:
  1008. this.listClass = 'list-used'
  1009. break;
  1010. case 1:
  1011. this.listClass = 'list-none'
  1012. break;
  1013. case 2:
  1014. this.listClass = 'list-none'
  1015. break;
  1016. }
  1017. },
  1018. },
  1019. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  1020. goodsList:{
  1021. deep:true,
  1022. handler(val,oldval){
  1023. this.totalPeice()
  1024. this.totalCount()
  1025. }
  1026. }
  1027. },
  1028. onPullDownRefresh() {//下拉刷新
  1029. this.initGetCartGoodsList()
  1030. uni.stopPullDownRefresh()
  1031. },
  1032. onShow(){
  1033. if(this.hasLogin){
  1034. this.initData()
  1035. }else{
  1036. this.initLogin()
  1037. }
  1038. },
  1039. }
  1040. </script>
  1041. <style lang="scss">
  1042. page{
  1043. background: #f7f7f7;
  1044. height: auto;
  1045. }
  1046. .cart-content{
  1047. position: relative;
  1048. }
  1049. .container-cart-main.none{
  1050. display: none;
  1051. }
  1052. .container-cart-main.show{
  1053. display: block;
  1054. }
  1055. .cart-content.empty.none{
  1056. display: none;
  1057. }
  1058. .cart-content.empty.show{
  1059. display: block;
  1060. }
  1061. .container-cart.show{
  1062. display: block;
  1063. }
  1064. .container-cart.none{
  1065. display: none;
  1066. }
  1067. .empty-container.none{
  1068. display: none;
  1069. }
  1070. .empty-container.show{
  1071. display: flex;
  1072. }
  1073. .foot-check-delbtn{
  1074. width: 100%;
  1075. height: 80rpx;
  1076. position: fixed;
  1077. top: 0;
  1078. left: 0;
  1079. box-sizing: border-box;
  1080. padding: 15rpx 24rpx;
  1081. background-color: #F7F7F7;
  1082. z-index: 990;
  1083. .foot-text{
  1084. font-size: $font-size-26;
  1085. height: 50rpx;
  1086. line-height: 50rpx;
  1087. color:#666666;
  1088. float: left;
  1089. padding-left: 10rpx;
  1090. text{
  1091. margin: 0 6rpx;
  1092. }
  1093. }
  1094. .delBtn{
  1095. width: 100rpx;
  1096. display: inline-block;
  1097. padding: 0 15rpx;
  1098. font-size: $font-size-26;
  1099. height: 50rpx;
  1100. line-height: 50rpx;
  1101. border-radius: 30rpx;
  1102. background:#FFFFFF;
  1103. border: 1px solid #e15616;
  1104. color: #E15616;
  1105. float: right;
  1106. text-align: center;
  1107. &.none{
  1108. display: none;
  1109. }
  1110. }
  1111. }
  1112. .checkbox-box{
  1113. display: flex;
  1114. align-items: center;
  1115. .checkbox{
  1116. display: flex;
  1117. margin: 0;
  1118. padding: 5rpx;
  1119. display: flex;
  1120. flex-direction: column;
  1121. align-items: center;
  1122. box-sizing: border-box;
  1123. text-align: center;
  1124. text-decoration: none;
  1125. border-radius: 0;
  1126. -webkit-tap-highlight-color: transparent;
  1127. overflow: hidden;
  1128. background-color:#FFFFFF;
  1129. font-size: 36rpx;
  1130. color:#999999;
  1131. &.icon-yixuanze{
  1132. color: $color-system;
  1133. }
  1134. }
  1135. &.disabled{
  1136. .checkbox{
  1137. color:#999999
  1138. }
  1139. }
  1140. .text{
  1141. font-size: $font-size-24;
  1142. margin-left: 10rpx;
  1143. }
  1144. }
  1145. .goods-list{
  1146. width: 100%;
  1147. height: auto;
  1148. background-color: #F7F7F7;
  1149. .goods-item{
  1150. width: 702rpx;
  1151. padding: 0 24rpx;
  1152. background: #FFFFFF;
  1153. margin-bottom: 24rpx;
  1154. }
  1155. .shoptitle{
  1156. height: 80rpx;
  1157. line-height: 80rpx;
  1158. .checkbox-box{
  1159. float: left;
  1160. height: 80rpx;
  1161. line-height: 80rpx;
  1162. display: inline-block;
  1163. box-sizing: border-box;
  1164. margin-left: 10rpx;
  1165. }
  1166. .text{
  1167. width: 400rpx;
  1168. float: left;
  1169. display: block;
  1170. overflow: hidden;
  1171. text-overflow:ellipsis;
  1172. white-space: nowrap;
  1173. line-height: 80rpx;
  1174. margin-left: 20rpx;
  1175. font-size: $font-size-28;
  1176. color: $text-color;
  1177. text-align: left;
  1178. font-weight: bold;
  1179. }
  1180. .text-coupon{
  1181. float: right;
  1182. line-height: 80rpx;
  1183. font-size: $font-size-30;
  1184. color: #e15616;
  1185. }
  1186. .floor-item-act{
  1187. width: 120rpx;
  1188. height: 80rpx;
  1189. text-align: center;
  1190. box-sizing: border-box;
  1191. float: left;
  1192. padding: 24rpx 0;
  1193. margin-left: 20rpx;
  1194. .floor-tags{
  1195. height: 28rpx;
  1196. border-radius: 6rpx;
  1197. background-color: #FFFFFF;
  1198. line-height: 28rpx;
  1199. color: $color-system;
  1200. text-align: center;
  1201. display: inline-block;
  1202. padding:0 16rpx;
  1203. font-size: $font-size-20;
  1204. border: 1px solid #E15616;
  1205. float: right;
  1206. }
  1207. }
  1208. }
  1209. .goods-pros{
  1210. width: 100%;
  1211. height: auto;
  1212. margin-bottom: 20rpx;
  1213. }
  1214. .goods-pros-t{
  1215. display: flex;
  1216. align-items: center;
  1217. width: 100%;
  1218. height: 210rpx;
  1219. padding:0 0 26rpx 0;
  1220. .checkbox-box{
  1221. padding: 10rpx;
  1222. }
  1223. .pros-img{
  1224. width: 210rpx;
  1225. height: 100%;
  1226. border-radius: 10rpx;
  1227. margin:0 20rpx;
  1228. border:1px solid #f3f3f3;
  1229. image{
  1230. width: 100%;
  1231. height: 100%;
  1232. border-radius: 10rpx;
  1233. }
  1234. }
  1235. }
  1236. .goods-pros-b{
  1237. width:100%;
  1238. height: auto;
  1239. padding:0 0 24rpx 0;
  1240. box-sizing: border-box;
  1241. &.show{
  1242. display: block;
  1243. }
  1244. &.none{
  1245. display: none;
  1246. }
  1247. .sum-none{
  1248. width: 100%;
  1249. height: 48rpx;
  1250. line-height: 48rpx;
  1251. color: $text-color;
  1252. float: left;
  1253. text-align: right;
  1254. .money{
  1255. font-size: $font-size-26;
  1256. color: #999999;
  1257. text-decoration: line-through;
  1258. }
  1259. .money-sign{
  1260. font-size: $font-size-26;
  1261. color: #999999;
  1262. text-decoration: line-through;
  1263. }
  1264. .money-reduced{
  1265. margin-left: 10rpx;
  1266. font-size: $font-size-26;
  1267. color: $color-system;
  1268. .iconfont{
  1269. font-size: $font-size-34;
  1270. }
  1271. }
  1272. }
  1273. .sum{
  1274. width: 100%;
  1275. height: 40rpx;
  1276. font-size: $font-size-26;
  1277. line-height: 40rpx;
  1278. color: $text-color;
  1279. float: left;
  1280. display: flex;
  1281. justify-content: flex-end;
  1282. font-weight: bold;
  1283. .money{
  1284. color: #FF2A2A;
  1285. font-size: $font-size-26;
  1286. }
  1287. .money-sign{
  1288. font-size: $font-size-24;
  1289. color: #FF2A2A;
  1290. }
  1291. }
  1292. }
  1293. .pros-product{
  1294. width: 416rpx;
  1295. height: 100%;
  1296. line-height: 36rpx;
  1297. font-size: $font-size-28;
  1298. position: relative;
  1299. .producttitle{
  1300. width: 100%;
  1301. display: inline-block;
  1302. height: auto;
  1303. text-overflow:ellipsis;
  1304. display: -webkit-box;
  1305. word-break: break-all;
  1306. -webkit-box-orient: vertical;
  1307. -webkit-line-clamp: 2;
  1308. overflow: hidden;
  1309. margin-bottom: 15rpx;
  1310. .no-text{
  1311. display: inline-block;
  1312. height:36rpx;
  1313. padding: 0 12rpx;
  1314. line-height: 36rpx;
  1315. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1316. border-radius:18rpx;
  1317. text-align: center;
  1318. color: #FFFFFF;
  1319. font-size:$font-size-28;
  1320. margin-right: 24rpx;
  1321. }
  1322. }
  1323. .productspec{
  1324. height: 36rpx;
  1325. color: #999999;
  1326. font-size: $font-size-26;
  1327. }
  1328. .productprice{
  1329. width: 100%;
  1330. height: 48rpx;
  1331. margin: 30rpx 0 0 0;
  1332. .price{
  1333. line-height: 48rpx;
  1334. font-size: $font-size-26;
  1335. width: 48%;
  1336. color: #FF2A2A;
  1337. float: left;
  1338. font-weight: bold;
  1339. &.disabled{
  1340. color: #999999;
  1341. text-decoration: line-through;
  1342. }
  1343. .money-sign{
  1344. font-size: $font-size-24;
  1345. color: #FF2A2A;
  1346. }
  1347. }
  1348. .count{
  1349. height: 100%;
  1350. float: right;
  1351. position: relative;
  1352. &.show{
  1353. display: block;
  1354. }
  1355. &.none{
  1356. display: none;
  1357. }
  1358. .count-tips{
  1359. width: auto;
  1360. display: inline-block;
  1361. padding: 0 15rpx;
  1362. line-height: 44rpx;
  1363. height: 44rpx;
  1364. border-radius: 22rpx;
  1365. background: $btn-confirm;
  1366. font-size: $font-size-24;
  1367. text-align: center;
  1368. color: #FFFFFF;
  1369. position: absolute;
  1370. top:-60rpx;
  1371. left: -5rpx;
  1372. z-index: 5;
  1373. &.step{
  1374. left:-217rpx
  1375. }
  1376. &::before{
  1377. content: "";
  1378. position: absolute;
  1379. bottom: -30rpx;
  1380. right: 15rpx;
  1381. z-index:1;
  1382. width: 0;
  1383. height: 0;
  1384. border-width: 18rpx;
  1385. border-style: solid;
  1386. border-color:$color-system transparent transparent transparent;
  1387. }
  1388. }
  1389. .number-box{
  1390. display: flex;
  1391. justify-content: center;
  1392. align-items: center;
  1393. border: 2rpx solid #ffe6dc;
  1394. border-radius: 30rpx;
  1395. .iconfont{
  1396. font-size: $font-size-24;
  1397. padding:0 18rpx;
  1398. color: #999999;
  1399. text-align: center;
  1400. line-height: 48rpx;
  1401. font-weight: bold;
  1402. background: #fef6f3;
  1403. &.icon-jianhao{
  1404. border-radius: 30rpx 0 0 30rpx;
  1405. }
  1406. &.icon-jiahao{
  1407. border-radius: 0 30rpx 30rpx 0;
  1408. }
  1409. }
  1410. .btn-input{
  1411. width: 62rpx;
  1412. height: 48rpx;
  1413. line-height: 48rpx;
  1414. background: #fff;
  1415. border-radius: 4rpx;
  1416. text-align: center;
  1417. font-size: $font-size-24;
  1418. }
  1419. }
  1420. .uni-numbox{
  1421. position: absolute;
  1422. left: 45rpx;
  1423. bottom: 0;
  1424. .uni-numbox-minus, .uni-numbox-plus{
  1425. width: 50rpx;
  1426. line-height: 40rpx;
  1427. }
  1428. .uni-numbox-value {
  1429. font-size: $font-size-28;
  1430. width: 60rpx;
  1431. }
  1432. }
  1433. }
  1434. }
  1435. .floor-item-act{
  1436. width: 100%;
  1437. height: 56rpx;
  1438. text-align: center;
  1439. box-sizing: border-box;
  1440. float: left;
  1441. padding:0 0 10rpx 0;
  1442. margin-left: 10rpx;
  1443. }
  1444. }
  1445. }
  1446. .failure-list{
  1447. width: 702rpx;
  1448. height: auto;
  1449. padding: 0 24rpx;
  1450. margin-top: 20rpx;
  1451. background: #FFFFFF;
  1452. .failure-title{
  1453. width: 100%;
  1454. height: 82rpx;
  1455. line-height: 82rpx;
  1456. font-size: $font-size-28;
  1457. border-bottom: 1px solid #EBEBEB;
  1458. .title-txt{
  1459. float: left;
  1460. color:#666666;
  1461. text-align: left;
  1462. }
  1463. .title-btn{
  1464. float: right;
  1465. color: $color-system;
  1466. text-align: right;
  1467. line-height: 80rpx;
  1468. .butto{
  1469. display: inline-block;
  1470. padding: 0 15rpx;
  1471. font-size: $font-size-26;
  1472. height: 50rpx;
  1473. line-height: 50rpx;
  1474. border-radius: 30rpx;
  1475. background:#FFFFFF;
  1476. // border: 1px solid #C9C9C9;
  1477. // color: #999999;
  1478. margin-top: 15rpx;
  1479. }
  1480. }
  1481. }
  1482. .productlist{
  1483. padding-top: 10rpx;
  1484. .goods-pros{
  1485. width: 100%;
  1486. height: auto;
  1487. padding: 20rpx 0;
  1488. }
  1489. .goods-pros-t{
  1490. display: flex;
  1491. align-items: center;
  1492. width: 100%;
  1493. height: 210rpx;
  1494. position: relative;
  1495. .img-tip{
  1496. display: block;
  1497. width: 72rpx;
  1498. height: 36rpx;
  1499. line-height: 36rpx;
  1500. font-size: $font-size-24;
  1501. text-align: center;
  1502. color: #FFFFFF;
  1503. border-radius: 24rpx;
  1504. background:rgba(51,51,51,0.3);
  1505. // position: absolute;
  1506. // left: 0;
  1507. // top: 0;
  1508. }
  1509. .checkbox-box{
  1510. padding: 10rpx;
  1511. }
  1512. .pros-img{
  1513. width: 180rpx;
  1514. height: 100%;
  1515. border-radius: 10rpx;
  1516. margin:0 20rpx;
  1517. border:1px solid #f3f3f3;
  1518. position: relative;
  1519. image{
  1520. width: 100%;
  1521. height: 100%;
  1522. border-radius: 10rpx;
  1523. }
  1524. }
  1525. .pros-marks{
  1526. width: 730rpx; height: 250rpx;
  1527. z-index: 90;
  1528. background: rgba(0,0,0,.05);
  1529. position: absolute;
  1530. left:-20rpx;
  1531. top: -20rpx;
  1532. }
  1533. }
  1534. .goods-pros-b{
  1535. width:622rpx;
  1536. margin-left: 84rpx;
  1537. height: 40rpx;
  1538. padding:0 0 26rpx 0;
  1539. // border-top: 1px solid #EBEBEB;
  1540. &.show{
  1541. display: block;
  1542. }
  1543. &.none{
  1544. display: none;
  1545. }
  1546. .sum{
  1547. font-size: $font-size-28;
  1548. line-height: 40rpx;
  1549. color: $text-color;
  1550. display: flex;
  1551. justify-content: flex-end;
  1552. .money{
  1553. color: #FF2A2A;
  1554. font-size: $font-size-28;
  1555. }
  1556. .money-sign{
  1557. font-size: $font-size-24;
  1558. color: #FF2A2A;
  1559. }
  1560. }
  1561. }
  1562. .pros-product{
  1563. width: 402rpx;
  1564. height: 100%;
  1565. line-height: 36rpx;
  1566. font-size: $font-size-28;
  1567. position: relative;
  1568. .producttitle{
  1569. width: 100%;
  1570. display: inline-block;
  1571. height: auto;
  1572. text-overflow:ellipsis;
  1573. display: -webkit-box;
  1574. word-break: break-all;
  1575. -webkit-box-orient: vertical;
  1576. -webkit-line-clamp: 2;
  1577. overflow: hidden;
  1578. margin-bottom: 8rpx;
  1579. .no-text{
  1580. display: inline-block;
  1581. height:36rpx;
  1582. padding: 0 12rpx;
  1583. line-height: 36rpx;
  1584. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1585. border-radius:18rpx;
  1586. text-align: center;
  1587. color: #FFFFFF;
  1588. font-size: $font-size-28;
  1589. margin-right: 24rpx;
  1590. }
  1591. }
  1592. .productspec{
  1593. height: 36rpx;
  1594. color: #999999;
  1595. font-size: $font-size-26;
  1596. margin-top: 20rpx;
  1597. }
  1598. .productstate{
  1599. font-size: $font-size-28;
  1600. height: 44rpx;
  1601. color: #FF2A2A;
  1602. position: absolute;
  1603. bottom: 0;
  1604. left: 0;
  1605. }
  1606. }
  1607. }
  1608. }
  1609. .tui-popup-box {
  1610. position: relative;
  1611. box-sizing: border-box;
  1612. min-height: 220rpx;
  1613. padding:24rpx 24rpx 0 24rpx;
  1614. .tui-popup-close{
  1615. width: 90rpx;
  1616. height: 90rpx;
  1617. position: absolute;
  1618. right: 0;
  1619. top: 24rpx;
  1620. line-height: 90rpx;
  1621. text-align: center;
  1622. color: #b2b2b2;
  1623. .icon-iconfontguanbi{
  1624. font-size: $font-size-40;
  1625. }
  1626. }
  1627. .title{
  1628. font-size: $font-size-34;
  1629. color: $text-color;
  1630. line-height: 88rpx;
  1631. text-align: center;
  1632. float: left;
  1633. width: 100%;
  1634. height: 88rpx;
  1635. font-weight: bold;
  1636. }
  1637. .tui-popup-main{
  1638. width: 100%;
  1639. float: left;
  1640. &.coupon{
  1641. padding-bottom: 40rpx;
  1642. }
  1643. .tui-popup-scroll{
  1644. width: 100%;
  1645. height: 600rpx;
  1646. .coupon-list{
  1647. width: 100%;
  1648. height: 200rpx;
  1649. margin-top: 24rpx;
  1650. box-sizing: border-box;
  1651. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  1652. background-size: cover;
  1653. &:last-child{
  1654. margin-bottom: 24rpx;
  1655. }
  1656. .list-cell-le{
  1657. width: 224rpx;
  1658. height: 100%;
  1659. box-sizing: border-box;
  1660. padding: 37rpx 0;
  1661. float: left;
  1662. .coupon-maxMoney{
  1663. width: 100%;
  1664. height: 78rpx;
  1665. line-height: 78rpx;
  1666. font-size: 56rpx;
  1667. color: #FFFFFF;
  1668. text-align: center;
  1669. .small{
  1670. font-size: $font-size-24;
  1671. }
  1672. }
  1673. .coupon-minMoney{
  1674. width: 100%;
  1675. height: 33rpx;
  1676. line-height: 33rpx;
  1677. font-size: $font-size-24;
  1678. color: #FFFFFF;
  1679. text-align: center;
  1680. }
  1681. }
  1682. .list-cell-ri{
  1683. width: 478rpx;
  1684. height: 100%;
  1685. box-sizing: border-box;
  1686. padding: 20rpx 24rpx 0 24rpx;
  1687. float: right;
  1688. .list-cell-top{
  1689. width: 100%;
  1690. height: 121rpx;
  1691. float: left;
  1692. border-bottom: 1px solid #e1e1e1;
  1693. .list-cell-type{
  1694. width: 286rpx;
  1695. height: 100%;
  1696. float: left;
  1697. .list-cell-tags{
  1698. width: 100%;
  1699. height: 32rpx;
  1700. margin-bottom: 7rpx;
  1701. .tags{
  1702. display: inline-block;
  1703. padding: 0 10rpx;
  1704. height: 32rpx;
  1705. line-height: 32rpx;
  1706. background-color: #ffdcce;
  1707. color: #f94b4b;
  1708. font-size: $font-size-20;
  1709. border-radius: 8rpx;
  1710. text-align: center;
  1711. float: left;
  1712. }
  1713. }
  1714. .list-cell-texts{
  1715. width: 100%;
  1716. height: auto;
  1717. line-height:35rpx;
  1718. text-overflow:ellipsis;
  1719. display: -webkit-box;
  1720. word-break: break-all;
  1721. -webkit-box-orient: vertical;
  1722. -webkit-line-clamp: 2;
  1723. overflow: hidden;
  1724. font-size: 26rpx;
  1725. color: #333333;
  1726. }
  1727. }
  1728. .list-cell-btn{
  1729. width: 128rpx;
  1730. height: 100%;
  1731. float: right;
  1732. .icon-used{
  1733. width: 100%;
  1734. height: 100%;
  1735. box-sizing: border-box;
  1736. padding-top: 57rpx;
  1737. .icon-used-btn{
  1738. width: 128rpx;
  1739. height: 48rpx;
  1740. border-radius: 28rpx;
  1741. line-height: 48rpx;
  1742. font-size: $font-size-26;
  1743. text-align: center;
  1744. &.receive{
  1745. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);;
  1746. color: #FFFFFF;
  1747. }
  1748. &.make{
  1749. border: solid 1px #f94b4b;
  1750. color: #f94b4b;
  1751. }
  1752. }
  1753. }
  1754. }
  1755. }
  1756. .list-cell-time{
  1757. width: 100%;
  1758. height: 58rpx;
  1759. line-height: 58rpx;
  1760. text-align: left;
  1761. font-size: $font-size-20;
  1762. color: #999999;
  1763. }
  1764. }
  1765. }
  1766. }
  1767. .tui-popup-coupon{
  1768. width: 100%;
  1769. height: 500rpx;
  1770. box-sizing: border-box;
  1771. padding:30rpx 20rpx;
  1772. .tui-popup-h1{
  1773. width: 100%;
  1774. height: 66rpx;
  1775. display: flex;
  1776. align-items: center;
  1777. .tui-popup-text{
  1778. flex: 1;
  1779. height: 66rpx;
  1780. line-height: 66rpx;
  1781. font-size: $font-size-30;
  1782. color: #333333;
  1783. &.red{
  1784. color: #f94b4b;
  1785. }
  1786. &.bold{
  1787. font-weight: bold;
  1788. }
  1789. &.left{
  1790. text-align: left;
  1791. }
  1792. &.right{
  1793. text-align: right;
  1794. }
  1795. }
  1796. }
  1797. }
  1798. }
  1799. }
  1800. .footer{
  1801. width: 100%;
  1802. background-color: #FFFFFF;
  1803. height: 110rpx;
  1804. position: fixed;
  1805. bottom: 0rpx;
  1806. z-index: 990;
  1807. .footer-le{
  1808. width: 520rpx;
  1809. height: 100%;
  1810. padding-left: 24rpx;
  1811. float: left;
  1812. box-sizing: border-box;
  1813. .foot-check{
  1814. width: 100rpx;
  1815. float: left;
  1816. line-height: 110rpx;
  1817. font-size: $font-size-24;
  1818. .checkbox{
  1819. width: 40rpx;
  1820. text-align: center;
  1821. }
  1822. .text{
  1823. width: 60rpx;
  1824. float: right;
  1825. }
  1826. }
  1827. .sum{
  1828. width: 360rpx;
  1829. height: 110rpx;
  1830. float: right;
  1831. box-sizing: border-box;
  1832. padding: 10rpx;
  1833. .sum-none{
  1834. width: 100%;
  1835. height: 45rpx;
  1836. line-height: 45rpx;
  1837. color: $text-color;
  1838. float: left;
  1839. text-align: left;
  1840. .money{
  1841. font-size: $font-size-24;
  1842. color: #999999;
  1843. text-decoration: line-through;
  1844. }
  1845. .money-sign{
  1846. font-size: $font-size-24;
  1847. color: #999999;
  1848. text-decoration: line-through;
  1849. }
  1850. .money-reduced{
  1851. margin-left: 10rpx;
  1852. font-size: $font-size-24;
  1853. color: #FF2A2A;
  1854. }
  1855. .money-popup{
  1856. height: 45rpx;
  1857. line-height: 45rpx;
  1858. display: inline-block;
  1859. float: right;
  1860. font-size: $font-size-24;
  1861. color: #FF2A2A;
  1862. .icon-xiangshangjiantou{
  1863. font-size: $font-size-30;
  1864. margin-left: 5rpx;
  1865. }
  1866. }
  1867. }
  1868. .sum-price{
  1869. width: 100%;
  1870. height: 45rpx;
  1871. line-height: 45rpx;
  1872. font-size: $font-size-30;
  1873. color: $text-color;
  1874. float: left;
  1875. font-weight: normal;
  1876. text-align: left;
  1877. &.none{
  1878. height: 90rpx;
  1879. line-height: 90rpx;
  1880. }
  1881. .money{
  1882. color: #FF2A2A;
  1883. }
  1884. .money-sign{
  1885. font-size: $font-size-24;
  1886. color: #FF2A2A;
  1887. }
  1888. }
  1889. }
  1890. }
  1891. .footer-ri{
  1892. width: 230rpx;
  1893. height: 100%;
  1894. float: right;
  1895. display: flex;
  1896. justify-content: space-between;
  1897. align-items: center;
  1898. z-index: 999;
  1899. box-sizing: border-box;
  1900. padding: 13rpx 15rpx 13rpx 5rpx;
  1901. &.none{
  1902. display: none;
  1903. }
  1904. .btn{
  1905. width: 200rpx;
  1906. height: 100%;
  1907. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1908. font-size: $font-size-28;
  1909. line-height: 84rpx;
  1910. color: #FFFFFF;
  1911. display: flex;
  1912. border-radius: 42rpx;
  1913. justify-content: center;
  1914. align-items: center;
  1915. }
  1916. }
  1917. .footer-del{
  1918. width: 400rpx;
  1919. height: 110rpx;
  1920. position: absolute;
  1921. padding-left: 200rpx;
  1922. background: #FFFFFF;
  1923. right: 0;
  1924. top: 0;
  1925. z-index: 1000;
  1926. &.show{
  1927. animation: showDelbtn 0s linear both;
  1928. }
  1929. &.none{
  1930. animation: hideDelbtn 0s linear both;
  1931. }
  1932. .btn{
  1933. width: 50%;
  1934. height: 100%;
  1935. line-height: 110rpx;
  1936. font-size: $font-size-28;
  1937. color: #FFFFFF;
  1938. text-align: center;
  1939. float: left;
  1940. }
  1941. .btn.btn-cancel{
  1942. background:#EEC1AB;
  1943. }
  1944. .btn.btn-confirm{
  1945. background:#FF2A2A;
  1946. }
  1947. @keyframes showDelbtn {
  1948. 0% {
  1949. transform: translateX(0);
  1950. }
  1951. 100% {
  1952. transform: translateX(-100%);
  1953. }
  1954. }
  1955. @keyframes hideDelbtn {
  1956. 0% {
  1957. transform: translateX(-100%);
  1958. }
  1959. 100% {
  1960. transform: translateX(0);
  1961. }
  1962. }
  1963. }
  1964. }
  1965. </style>