index.vue 66 KB

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