index.vue 58 KB

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