index.vue 62 KB

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