index.vue 67 KB

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