index.vue 69 KB

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