index.vue 67 KB

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