index.vue 67 KB

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