index.vue 68 KB

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