index.vue 63 KB

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