cart.vue 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605
  1. <!-- 购物车 -->
  2. <template>
  3. <view :style="{paddingBottom:!tempList.storeCartGroupList?0:'120rpx'}" @click="closeMask">
  4. <!-- #ifndef MP-WEIXIN -->
  5. <uni-nav-bar fixed='true' color='#333' status-bar='true' :left-icon="nav_left_icon" :right-text="topRightText" :title="$L('购物车')"
  6. @clickRight='manageCart'></uni-nav-bar>
  7. <!-- #endif -->
  8. <!-- #ifdef MP-WEIXIN -->
  9. <view class="cart_header" v-if="tempList && tempList.storeCartGroupList && tempList.storeCartGroupList.length > 0">
  10. <view class="cart_header_text" v-if="settings && settings.length > 0">
  11. <image :src="settings[1]" mode="" v-if="settings[1]"></image>
  12. <text v-if="settings[0]">{{settings[0]}}</text>
  13. </view>
  14. <view class="cart_header_btn" @click="manageCart">{{topRightText}}</view>
  15. </view>
  16. <!-- #endif -->
  17. <!-- 空白页 start-->
  18. <view v-if="(empty && tempList.invalidList.length == 0) || (tempList && tempList.storeCartGroupList && tempList.storeCartGroupList.length == 0)" class="flex_column_start_center empty_part">
  19. <image class="img" :src="imgUrl+'empty_goods.png'" />
  20. <text class="tip_con">{{$L('这里空空如也~快去商品中心加购商品吧!')}}</text>
  21. <view class="ope_btn flex_row_center_center" @click="goGoodsList()">
  22. {{$L('马上去逛逛')}}
  23. </view>
  24. </view>
  25. <!-- 空白页 end-->
  26. <view v-if="tempList.storeCartGroupList">
  27. <view class="cart-list">
  28. <view class="shop_list_wrap">
  29. <view class="shop_item" v-for="(item1,index1) in tempList.storeCartGroupList" :key="index1">
  30. <view class="shop_item_top">
  31. <text :class="{item_check:true, iconfont:true, iconziyuan33:item1.checkedAll && !item1.lackAll}" @click="changeSelectState('shop',item1.storeId,item1.checkedAll)"></text>
  32. <text :class="{iconfont:true, iconziyuan43:!item1.checkedAll && !item1.lackAll}" @click="changeSelectState('shop',item1.storeId,item1.checkedAll)"></text>
  33. <text :class="{stock_not_icon:true,iconfont:true, iconziyuan43:item1.lackAll}"></text>
  34. <view style="display: flex;align-items: center;" @click.stop="toShopDetail(item1.storeId)">
  35. <image :src="imgUrl+'shop/shop_icon.png'" mode="" class="shop_icon"></image>
  36. <view class="shop_name">{{item1.storeName}}</view>
  37. <image :src="imgUrl+'shop/to_right.png'" mode="" class="to_right_icon"></image>
  38. </view>
  39. <image :src="imgUrl+'shop/coupon.png'" mode="" class="coupon_icon" @click="getShopCoupon(item1.storeId)" v-if="!editFlag && item1.hasCoupon"></image>
  40. </view>
  41. <!-- 购物车列表 -->
  42. <view v-for="(item2,index2) in item1.promotionCartGroupList" :key="index2">
  43. <view class="discount_left" v-if="item2.promotionDes">
  44. <view class="discount_icon">{{$L('满减')}}</view>
  45. <view class="promotion_text">
  46. <view class="discount_text"></view>
  47. <view class="discount_text">{{item2.promotionDes}}</view>
  48. </view>
  49. </view>
  50. <view class="discount_activity" v-for="(item,index) in item2.cartList" :key="index">
  51. <!-- 换促销活动 -->
  52. <!-- <view class="discount_activity_wrap" v-if="!editFlag && item.promotionList && item.promotionList.length>0">
  53. <view class="discount_left">
  54. <view class="discount_icon">满减</view>
  55. <view class="promotion_text">
  56. <view class="discount_text"></view>
  57. <view class="discount_text">{{item2.promotionDes}}</view>
  58. </view>
  59. </view>
  60. <view class="discount_right" @click="showPromotionBox(item.cartId,item.productImage,item.productPrice,item.specValues,item.promotionList,item.promotionId)">
  61. <text>换促销</text>
  62. <image :src="imgUrl+'shop/to_right.png'" mode="" class="see_more"></image>
  63. </view>
  64. </view> -->
  65. <view class="cart-item" @longpress="showOperate(item.cartId,item.goodsId)">
  66. <!-- 长按商品出现蒙层及操作 start -->
  67. <view v-show="curOperateId==item.cartId && is_show_mask == true || curOperateId==item.goodsId && is_show_mask == true" class="mask flex_row_center_center">
  68. <view class="move flex_row_center_center" @click.stop="operateCartGoods('move', item.cartId)" v-if="item.isShowCollectBtn == true">{{$L('移入收藏夹')}}</view>
  69. <view class="del flex_row_center_center" @click.stop="operateCartGoods('del',item.cartId,item.goodsId)" :style="{marginLeft:item.isShowCollectBtn == true?'90rpx':'0'}">{{$L('删除商品')}}</view>
  70. </view>
  71. <!-- 长按商品出现蒙层及操作 end -->
  72. <view class="image-wrapper flex_row_start_center">
  73. <text :class="{item_check:true, iconfont:true, iconziyuan33:(item.isChecked && item.productState!=3)}" @click="changeSelectState('goods',item.cartId,item.isChecked,item.goodsId)"></text> -->
  74. <text :class="{iconfont:true, iconziyuan43:(!item.isChecked && item.productState!=3)}" @click="changeSelectState('goods',item.cartId,item.isChecked,item.goodsId)"></text>
  75. <!-- <text :class="{stock_not_icon:true,iconfont:true, iconziyuan43:item.productState==3}"></text> -->
  76. <text :class="{stock_not_icon:true,iconfont:true, iconziyuan43:item.productState==3}"></text>
  77. <view class="goods-img" :style="{backgroundImage: 'url('+item.productImage+')'}" @click.stop="goGoodsDetail(item.productId,item.goodsId)"></view>
  78. </view>
  79. <view class="item-right">
  80. <view class="right_top" @click.stop="goGoodsDetail(item.productId,item.goodsId)">
  81. <text :class="item.productState==3?'title stock_not_enough':'title'">{{item.goodsName}}</text>
  82. <text class="attr" v-if="item.specInfo">{{item.specInfo}}</text>
  83. </view>
  84. <view class="goods_spec">{{item.specValues}}</view>
  85. <view class="right_bottom flex_row_between_center">
  86. <view class="right_bottom_left">
  87. <view class="trade_promotion_btn" v-if="!editFlag && item.promotionList && item.promotionList.length>0" @click="showPromotionBox(item.cartId,item.productImage,item.productPrice,item.specValues,item.promotionList,item.promotionId)">
  88. <text>{{$L('换促销')}}</text>
  89. <image :src="imgUrl+'arrow_bottom.png'" mode=""></image>
  90. </view>
  91. <view class="price_wrap" :class="{price_wrap_hide:item.isShowBigNumBox == false}">
  92. <text class="unit">¥</text><text class="price_int">{{item.isShowCloseBtn == true?item.productPrice:$getPartNumber(item.productPrice,'int')}}</text><text class="price_decimal">{{item.isShowCloseBtn == true?'':$getPartNumber(item.productPrice,'decimal')}}</text>
  93. </view>
  94. </view>
  95. <view :class="item.productState == 3?'goods_num_wrap':'exceed_price_wrap'">
  96. <view class="goods_num_box" v-if="item.isShowBigNumBox == true && !editFlag" @click.stop="changeBuyNum(item.cartId,item.goodsId)">*{{item.buyNum}}</view>
  97. <!-- item.buyNum>item.productStock?item.productStock: -->
  98. <uni-number-box v-if="item.isShowBigNumBox == false&&!editFlag" class="step" :max="item.productStock" :value="item.buyNum" @change="numberChange($event,item.cartId,item.goodsId)" :margin_right="10"></uni-number-box>
  99. <image :src="closeImg" mode="" class="close_img" v-if="item.isShowCloseBtn == true" @click="closeBigPriceBox(item.cartId,item.goodsId)"></image>
  100. <view class="stock_not" v-if="item.productState==3 && !editFlag">{{$L('还剩')}}{{item.productStock}}{{$L('件')}}</view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 失效购物车列表 -->
  110. <view class="invalid_list_wrap" v-if="tempList.invalidList.length>0">
  111. <view class="invalid_list_title">
  112. <text>{{$L('失效商品')}}{{tempList.invalidList.length}}{{$L('件')}}</text>
  113. <text @click="clearFailureGoods('open')">{{$L('清空失效商品')}}</text>
  114. </view>
  115. <view class="invalid_list_content">
  116. <view class="invalid_list_item" v-for="(item2,index2) in tempList.invalidList" :key="index2">
  117. <view class="invalid_icon">{{$L('失效')}}</view>
  118. <view class="invalid_img">
  119. <image :src="item2.productImage" mode=""></image>
  120. </view>
  121. <view class="invalid_goods_wrap">
  122. <view class="invalid_goods_name">{{item2.goodsName}}</view>
  123. <text class="invalid_goods_spec" v-if="item2.specValues">{{item2.specValues}}</text>
  124. <view class="invalid_goods_text">{{$L('商品已下架')}}</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 底部菜单栏 -->
  131. <view class="action-section flex_row_between_center" v-if="tempList.storeCartGroupList && tempList.storeCartGroupList.length > 0">
  132. <view class="checkbox flex_row_start_center">
  133. <text :class="{item_check:true,iconfont:true,iconziyuan33:tempList.checkedAll}" @click="check(tempList.checkedAll)"></text>
  134. <text :class="{iconfont:true,iconziyuan43:!tempList.checkedAll}" @click="check(tempList.checkedAll)"></text>
  135. <text class="check_all_tit">{{$L('全选')}}</text>
  136. </view>
  137. <!-- 去结算样式 start -->
  138. <template v-if='!editFlag'>
  139. <view class="total-box flex_row_end_center">
  140. <text>{{$L('合计:')}}</text>
  141. <view class="price_wrap">
  142. <text class="unit">¥</text><text class="price_int">{{$getPartNumber(tempList.totalAmount,'int')}}</text><text class="price_decimal">{{$getPartNumber(tempList.totalAmount,'decimal')}}</text>
  143. </view>
  144. </view>
  145. <button type="primary" class="no-border confirm-btn flex_row_center_center" @click="createOrder">
  146. {{$L('结算')}}<text class="settle_num">({{tempList.totalCheck}})</text>
  147. </button>
  148. </template>
  149. <!-- 去结算样式 end -->
  150. <!-- 点击管理之后的样式 start -->
  151. <template v-if="editFlag">
  152. <view class="flex_row_end_center">
  153. <view class="move_collect flex_row_center_center" @click="batchCollect" v-if="tempList.isShowCollectBtn == true">{{$L('加入收藏夹')}}</view>
  154. <view class="del_more flex_row_center_center" @click="batchDelete">{{$L('删除所选')}}</view>
  155. </view>
  156. </template>
  157. <!-- 点击管理之后的样式 end -->
  158. </view>
  159. </view>
  160. <!-- 推荐商品 start-->
  161. <recommendGoods ref='recomment_goods' @reload_cart="reload_cart" @addToCart="addToCart"/>
  162. <!-- 推荐商品 end-->
  163. <!-- 换促销弹框 -->
  164. <uni-popup ref="popup" type="bottom" @touchmove.stop.prevent="moveHandle">
  165. <view class="promotion_box">
  166. <block v-for="(item,index) in promotion_goods_info" :key="index">
  167. <view class="promotion_goods_wrap">
  168. <view class="promotion_goods_img_wrap">
  169. <image :src="item.productImage" mode="aspectFit" class="promotion_goods_img"></image>
  170. </view>
  171. <view class="promotion_goods_right">
  172. <view class="promotion_goods_price">
  173. <view class="promotion_goods_price_now">
  174. <text class="small_price">¥</text>
  175. <text class="big_price">{{$getPartNumber(item.productPrice,'int')}}</text>
  176. <text class="small_price">{{$getPartNumber(item.productPrice,'decimal')}}</text>
  177. </view>
  178. <!-- <view class="promotion_goods_price_old">¥866.66</view> -->
  179. </view>
  180. <view class="promotion_goods_spec">{{$L('已选:')}}{{item.specValues == ''?'默认规格':item.specValues}}</view>
  181. <image :src="imgUrl+'close2.png'" mode="" class="close_icon" @click="closePromotionBox"></image>
  182. </view>
  183. </view>
  184. <scroll-view class="promotion_rules_wrap" scroll-y="true">
  185. <view class="promotion_rules_title">{{$L('修改促销')}}</view>
  186. <view class="promotion_rule_item" v-for="(item2,index2) in promotion_list" :key="index2">
  187. <text :class="{item_check:true,iconfont:true,iconziyuan33:promotionId == item2.promotionId}" @click="changePromotion(index2,item2.promotionDes,item2.promotionId,item2.promotionType)"></text>
  188. <text :class="{iconfont:true,iconziyuan43:promotionId != item2.promotionId}" @click="changePromotion(index2,item2.promotionDes,item2.promotionId,item2.promotionType)"></text>
  189. <text class="promotion_text">{{item2.promotionDes}}</text>
  190. </view>
  191. </scroll-view>
  192. </block>
  193. <view class="confirm_btn_wrap">
  194. <view class="confirm_btn" @click="confirmChangePromotion">{{$L('确定')}}</view>
  195. </view>
  196. </view>
  197. </uni-popup>
  198. <!-- 优惠券弹框 start -->
  199. <uni-popup ref="couponPopup" type="bottom" @touchmove.stop.prevent="moveHandle">
  200. <view class="coupon_model">
  201. <view class="coupon_model_title">
  202. <text>{{$L('领取优惠券')}}</text>
  203. <image :src="imgUrl+'goods_detail/close.png'" mode="" @click="closeCouponBox"></image>
  204. </view>
  205. <!-- 有优惠券 -->
  206. <scroll-view class="coupon_model_list" scroll-y="true" v-if="coupon_list.length>0">
  207. <view class="my_coupon_pre" v-for="(item,index) in coupon_list" :key="index">
  208. <view class="coupon_pre_top" :style="{backgroundImage:'url(' + item.couponBg + ')'}">
  209. <view class="coupon_pre_left">
  210. <!-- 固定券 start -->
  211. <view class="coupon_pre_price" v-if="item.couponType == 1">
  212. <text class="unit">¥ </text>
  213. <text class="price_int">{{$getPartNumber(item.publishValue,'int')}}</text>
  214. </view>
  215. <!-- 固定券 end -->
  216. <!-- 折扣券 start -->
  217. <view class="coupon_pre_price" v-if="item.couponType == 2">
  218. <view class=""></view>
  219. <text class="price_int">{{filters.toSplit(filters.toFixNum(item.publishValue,1))[0]}}</text>.
  220. <text class="price_decimal">{{filters.toSplit(filters.toFixNum(item.publishValue,1))[1]}}</text>
  221. <text class="price_decimal">{{$L('折')}}</text>
  222. </view>
  223. <!-- 折扣券 end -->
  224. <!-- 随机券 start -->
  225. <view class="coupon_pre_price" v-if="item.couponType == 3">
  226. <text class="unit">¥ </text>
  227. <text class="price_int">{{$getPartNumber(item.randomMax,'int')}}</text>
  228. </view>
  229. <!-- 随机券 end -->
  230. <view class="coupon_pre_active">{{item.couponContent}}</view>
  231. </view>
  232. <view class="coupon_pre_cen">
  233. <view class="coupon_pre_title">{{item.useTypeValue}}</view>
  234. <view class="coupon_pre_time">{{item.publishStartTime}}~{{item.publishEndTime}}</view>
  235. <view class="coupon_pre_rules" @click="descriptionOpen(item.couponId)">
  236. <text>{{$L('使用规则')}}</text>
  237. <image :src="item.isOpen ? imgUrl + 'coupon/up.png' : imgUrl + 'coupon/down.png'" mode=""></image>
  238. </view>
  239. </view>
  240. <view class="coupon_pre_right" v-if="item.isReceive == 3">{{$L('已抢完')}}</view>
  241. <view class="coupon_pre_right" v-if="item.isReceive == 2">{{$L('已领')}}</view>
  242. <view class="coupon_pre_right" v-if="item.isReceive == 1" @click="goReceive(item)">{{$L('立即领取')}}</view>
  243. </view>
  244. <view class="coupon_rules" v-if="item.isOpen == true">
  245. <view class="coupon_rules_title">{{$L('使用规则:')}}{{item.description}}</view>
  246. </view>
  247. <view class="coupon_type">{{item.couponTypeValue}}</view>
  248. <view class="coupon_progress" v-if="item.isReceive != 3">
  249. {{$L('已抢')}}{{item.receivePercent}}%
  250. <view class="progress_con">
  251. <progress :percent="item.receivePercent" stroke-width="3" activeColor="#FFFFFF" backgroundColor="#FF1919" border-radius='2px' />
  252. </view>
  253. </view>
  254. </view>
  255. </scroll-view>
  256. <!-- 无优惠券 -->
  257. <view class="empty_coupon_wrap">
  258. <image :src="imgUrl+'no_coupon.png'" mode="" class="empty_coupon_img"></image>
  259. <view class="empty_coupon_text">{{$L('该店铺暂无优惠券~')}}</view>
  260. </view>
  261. </view>
  262. </uni-popup>
  263. <!-- 优惠券弹框 end -->
  264. <!-- 商品全部,部分无货弹窗 start-->
  265. <view id="store_no_good" v-if="store_show_no_good" @touchmove.stop.prevent="moveHandle">
  266. <view class="content">
  267. <view class="content_title">
  268. <text> {{no_good_info.stateValue}}</text>
  269. <image @tap="hide_good_dialog" :src="imgUrl+'/order/store_no_good_cancel.png'" mode=""></image>
  270. </view>
  271. <view class="good_list">
  272. <view v-for="(item,index) in no_good_info.productList" :key='index' class="good_item">
  273. <image :src="item.image" mode=""></image>
  274. <view class="good_info">
  275. <view class="good_name">
  276. {{item.goodsName}}
  277. </view>
  278. <view class="good_spec">
  279. <text>{{item.specValues}}</text>
  280. </view>
  281. <text class="num">*{{item.buyNum}}</text>
  282. </view>
  283. </view>
  284. </view>
  285. <view class="part_no_goods_another">
  286. <view class="return" @click="refreshCartInfo">
  287. {{$L('确定')}}
  288. </view>
  289. </view>
  290. </view>
  291. </view>
  292. <!-- 商品全部,部分无货弹窗 end-->
  293. <uni-popup ref="popup" type="dialog">
  294. <uni-popup-dialog type="input" title ="提示" content="确定清空所有失效商品?" :duration="2000" @confirm="clearFailureGoods('confirm')"></uni-popup-dialog>
  295. </uni-popup>
  296. </view>
  297. </template>
  298. <script module="filters" lang="wxs" src="../../utils/filter.wxs"></script>
  299. <script>
  300. import {
  301. mapState,
  302. mapMutations
  303. } from 'vuex';
  304. import uniNumberBox from "@/components/uni-number-box/uni-number-box.vue"
  305. import recommendGoods from "@/components/recommend-goods.vue"
  306. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue"
  307. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  308. import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
  309. //库存input change事件的防抖定时器
  310. var storeAntiShakeTimer;
  311. export default {
  312. components: {
  313. uniNumberBox,
  314. recommendGoods,
  315. uniNavBar,
  316. uniPopup,
  317. uniPopupDialog
  318. },
  319. computed: {
  320. ...mapState(['hasLogin', 'cartData', 'userInfo'])
  321. },
  322. data() {
  323. return {
  324. editFlag: false, //是否编辑标识
  325. total: 0, //总价格
  326. allChecked: false, //全选状态 true|false
  327. empty: false, //空白页现实 true|false
  328. cartList: [],
  329. topRightText: '', //导航右侧文字,没有数据的话不显示
  330. nav_left_icon: '', //底部tab进入的话为空,否则为back
  331. curOperateId:'',//当前长按的商品购物车id,登录时为cartId,未登录时为goodsId
  332. tempList:{},
  333. isShowBigNumBox:false, //是否展示价格过长样式
  334. isShow:true, //重载页面
  335. closeImg:getApp().globalData.imgUrl+'recharge_fail.png',
  336. isShowCloseBtn:false, //是否展示数量加减关闭按钮
  337. showPrice:'',
  338. ifOnShow:false, //从其他页面进入时重载当前页面
  339. token:'',
  340. isDisabled:false ,//结算按钮是否禁用
  341. imgUrl:getApp().globalData.imgUrl,
  342. settings:[], //配置信息
  343. is_show_mask:true,
  344. is_show_empty:false, //是否显示空页面
  345. is_checked:true,
  346. is_show_more_rules:false, //是否展开优惠券使用规则
  347. coupon_list:[], //优惠券列表
  348. pageCurrent:1, //优惠券列表,页
  349. pageSize:10, //优惠券列表 每页的条数
  350. goReceiveBg:getApp().globalData.imgUrl + 'coupon/coupon_pre_bg.png', //立即领取背景
  351. finishReceiveBg:getApp().globalData.imgUrl + 'coupon/finishReceiveBg.png', //已抢完背景
  352. hasReceiveBg:getApp().globalData.imgUrl + 'coupon/hasReceiveBg.png', //已领取背景
  353. promotion_goods_info:[], //换促销商品信息
  354. promotion_list:[], //促销列表
  355. currIndex:0,
  356. cartId:'',
  357. promotionDes:'',
  358. promotionId:'',
  359. promotionType:'',
  360. isShow:false,
  361. store_show_no_good: false,
  362. no_good_info:'',
  363. };
  364. },
  365. onHide(){
  366. // this.ifOnShow = true
  367. },
  368. onShow(){
  369. if (this.hasLogin) {
  370. this.getCartData();
  371. } else {
  372. this.initCartData();
  373. }
  374. this.editFlag = false;
  375. },
  376. onLoad(option) {
  377. if (option.source && option.source != 'tabbar') {
  378. this.nav_left_icon = 'back';
  379. }
  380. uni.showLoading({
  381. title:'加载中!',
  382. icon:'none'
  383. })
  384. if (this.hasLogin) {
  385. this.getCartData();
  386. } else {
  387. this.initCartData();
  388. }
  389. this.token = this.userInfo.access_token;
  390. this.getSettings();
  391. },
  392. onReachBottom() {
  393. this.$refs.recomment_goods.getMoreData();
  394. },
  395. watch: {
  396. //显示空白页
  397. tempList(e) {
  398. if(e){
  399. let empty = e.storeCartGroupList.length == 0 ? true : false;
  400. if (this.empty !== empty) {
  401. this.empty = empty;
  402. }
  403. }else{
  404. this.empty = true
  405. }
  406. },
  407. },
  408. // 监听顶部管理按钮
  409. onNavigationBarButtonTap(e){
  410. },
  411. onPageScroll(e){
  412. if(e.scrollTop>0){
  413. this.closeMask()
  414. }
  415. },
  416. methods: {
  417. ...mapMutations(['login', 'operateCartData']),
  418. moveHandle(){},
  419. // 隐藏商品无货弹窗
  420. hide_good_dialog() {
  421. this.store_show_no_good = false
  422. },
  423. refreshCartInfo(){
  424. this.store_show_no_good = false
  425. this.getCartData();
  426. },
  427. handleState(tempList){
  428. let list = tempList.storeCartGroupList
  429. let shop_stock_out = 0 //店铺库存不足数
  430. // tempList.totalAmount = 0
  431. list.map(item=>{
  432. item.promotionCartGroupList.map(item1=>{
  433. item1.cartList.map(item2=>{
  434. let price = item2.productPrice.toString().split('.')[0]
  435. item2.isShowCloseBtn = false
  436. item2.isShowCollectBtn = true
  437. // if(item2.isChecked == 1){
  438. // tempList.totalAmount += item2.productPrice * item2.buyNum
  439. // }
  440. if(price.toString().length>5){
  441. item2.isShowBigNumBox = true
  442. }else{
  443. item2.isShowBigNumBox = false
  444. }
  445. // if(item2.productState == 3){
  446. // shop_stock_out++
  447. // }
  448. // if(item1.cartList.length == shop_stock_out){
  449. // item.shopForbidden = true
  450. // }else{
  451. // item.shopForbidden = false
  452. // }
  453. })
  454. })
  455. })
  456. tempList.isShowCollectBtn = true;
  457. if(list.length > 0){
  458. if(!this.editFlag){
  459. this.topRightText = '管理';
  460. }else{
  461. this.topRightText = '完成';
  462. }
  463. }else{
  464. this.topRightText = '';
  465. // this.$forceUpdate();
  466. }
  467. this.tempList = tempList;
  468. this.$forceUpdate()
  469. this.checkNum()
  470. },
  471. initCartData() {
  472. //从缓存获取购物车信息
  473. this.tempList = uni.getStorageSync('cart_list') == undefined?[]:uni.getStorageSync('cart_list')
  474. if(this.tempList != ''){
  475. this.tempList.storeCartGroupList.map(item=>{
  476. item.promotionCartGroupList.map(item1=>{
  477. item1.cartList.map(item2=>{
  478. let price = item2.productPrice.toString().split('.')[0]
  479. item2.isShowCloseBtn = false
  480. if(price.toString().length>5){
  481. item2.isShowBigNumBox = true
  482. }else{
  483. item2.isShowBigNumBox = false
  484. }
  485. })
  486. })
  487. })
  488. this.tempList.isShowCollectBtn = false
  489. if(this.tempList.storeCartGroupList.length > 0){
  490. this.topRightText = '管理';
  491. }else{
  492. this.topRightText = '';
  493. }
  494. this.tempList = this.tempList;
  495. this.$forceUpdate()
  496. this.calcTotal();
  497. }else{
  498. this.tempList = {
  499. storeCartGroupList:[],
  500. invalidList:[]
  501. }
  502. }
  503. uni.hideLoading();
  504. },
  505. //从购物车获取数据
  506. getCartData() {
  507. this.$request({
  508. url: 'v3/business/front/cart/cartList',
  509. method: 'GET'
  510. }).then(res => {
  511. if (res.state == 200) {
  512. this.tempList = res.data;
  513. this.operateCartData(res.data);
  514. let checkedLen = 0
  515. this.handleState(this.tempList)
  516. let list = res.data.storeCartGroupList
  517. uni.hideLoading();
  518. } else {
  519. this.$api.msg(res.msg)
  520. uni.hideLoading();
  521. }
  522. }).catch((e) => {
  523. //异常处理
  524. })
  525. },
  526. //请求数据
  527. async loadData() {
  528. let list = await this.$api.json('cartList');
  529. let cartList = list.map(item => {
  530. item.checked = true;
  531. return item;
  532. });
  533. this.cartList = cartList;
  534. this.calcTotal(); //计算总价
  535. },
  536. //监听image加载完成
  537. onImageLoad(key, index) {
  538. this.$set(this[key][index], 'loaded', 'loaded');
  539. },
  540. //监听image加载失败
  541. onImageError(key, index) {
  542. this[key][index].image = getApp().globalData.imgUrl+'errorImage.jpg';
  543. },
  544. navToLogin() {
  545. uni.navigateTo({
  546. url: '/pages/public/login'
  547. })
  548. },
  549. //确认订单前,检验商品是否可结算
  550. testConfirmOrder() {
  551. const {
  552. preParam
  553. } = this;
  554. let param = {};
  555. param.url = 'v3/business/front/orderOperate/check';
  556. param.method = 'POST';
  557. param.data = {};
  558. param.header = {
  559. "Content-Type": "application/json"
  560. };
  561. param.data.isCart = true
  562. this.$request(param).then(res => {
  563. if (res.state == 267) {
  564. this.no_good_info = res.data
  565. this.store_show_no_good = true
  566. } else if (res.state == 200) {
  567. uni.navigateTo({
  568. url:'/pages/order/confirmOrder?orderType=1&isCart=true'
  569. })
  570. }
  571. }).catch((e) => {
  572. //异常处理
  573. })
  574. },
  575. //全选状态处理 type, index
  576. check(isCheckedAll) {
  577. if(this.hasLogin){ //登录
  578. let cartIds = ''
  579. this.tempList.storeCartGroupList.map(item=>{
  580. item.promotionCartGroupList.map(item1=>{
  581. item1.cartList.map(item2=>{
  582. cartIds += item2.cartId+','
  583. })
  584. })
  585. })
  586. cartIds = cartIds.substring(0,cartIds.length-1)
  587. let param = {}
  588. param.url = 'v3/business/front/cart/checkedCarts'
  589. param.method = 'POST'
  590. param.data = {
  591. cartIds,
  592. checked:isCheckedAll == 0?1:0 //0?1:0
  593. }
  594. this.$request(param).then(res=>{
  595. if(res.state == 200){
  596. this.tempList = res.data
  597. this.handleState(this.tempList)
  598. }else{
  599. this.$api.msg(res.msg)
  600. }
  601. })
  602. }else{ //未登录
  603. this.tempList.checkedAll = !this.tempList.checkedAll
  604. this.tempList.storeCartGroupList.map(item=>{
  605. item.promotionCartGroupList.map(item1=>{
  606. item1.cartList.map(item2=>{
  607. if(this.tempList.checkedAll == true){
  608. item2.isChecked = 1
  609. item.checkedAll = 1
  610. }else{
  611. item2.isChecked = 0
  612. item.checkedAll = 0
  613. }
  614. })
  615. })
  616. })
  617. this.calcTotal()
  618. uni.setStorage({
  619. key: 'cart_list',
  620. data: this.tempList,
  621. success: function() {
  622. //更新购物车数量和购物车数据
  623. // this.isShow = false
  624. // this.isShow = true
  625. }
  626. })
  627. }
  628. },
  629. // 点击商品、店铺状态处理
  630. changeSelectState(type,cartId,isChecked,goodsId){
  631. if(this.hasLogin && !this.editFlag){ //登录
  632. let cartIds = ''
  633. let storeId = cartId
  634. if(type == 'goods'){ //商品
  635. cartIds = cartId
  636. }else{ // 店铺
  637. this.tempList.storeCartGroupList.map(item=>{
  638. if(item.storeId == storeId){
  639. item.promotionCartGroupList.map(item1=>{
  640. item1.cartList.map(item2=>{
  641. cartIds += item2.cartId + ','
  642. })
  643. })
  644. }
  645. })
  646. cartIds = cartIds.substring(0,cartIds.length-1)
  647. }
  648. let param = {}
  649. param.url = 'v3/business/front/cart/checkedCarts'
  650. param.method = 'POST'
  651. param.data = {
  652. cartIds:cartIds,
  653. checked:isChecked == 1?0:1
  654. }
  655. let _this = this
  656. this.$request(param).then(res=>{
  657. if(res.state == 200){
  658. _this.tempList = res.data
  659. _this.checkNum()
  660. // _this.isShow = false
  661. // _this.isShow = true
  662. this.handleState(res.data)
  663. }else{
  664. this.$api.msg(res.msg)
  665. }
  666. })
  667. }else{ // 未登录
  668. let checkedNum = 0 //选中数量
  669. let storeId = cartId
  670. let shopChecked = 0
  671. let cartNum = 0 //购物车数量
  672. if(type == 'goods'){ //商品
  673. this.tempList.storeCartGroupList.map(item=>{
  674. item.promotionCartGroupList.map(item1=>{
  675. item1.cartList.map(item2=>{
  676. if(item2.goodsId == goodsId){
  677. item2.isChecked = item2.isChecked == 0?1:0
  678. item1.cartList.map(v=>{
  679. if(v.isChecked == 1){
  680. shopChecked++
  681. }
  682. })
  683. if(item1.cartList.length == shopChecked){
  684. item.checkedAll = 1
  685. }else{
  686. item.checkedAll = 0
  687. }
  688. }
  689. })
  690. })
  691. })
  692. }else{ //店铺
  693. this.tempList.storeCartGroupList.map(item=>{
  694. if(item.storeId == storeId){
  695. item.checkedAll = item.checkedAll == 0?1:0
  696. item.promotionCartGroupList.map(item1=>{
  697. item1.cartList.map(item2=>{
  698. item2.isChecked = item.checkedAll
  699. })
  700. })
  701. }
  702. })
  703. }
  704. this.tempList.storeCartGroupList.map(item=>{
  705. item.promotionCartGroupList.map(item1=>{
  706. item1.cartList.map(item2=>{
  707. if(item2.isChecked == 1){
  708. checkedNum++
  709. }
  710. })
  711. cartNum += item1.cartList.length
  712. })
  713. })
  714. if(checkedNum == cartNum){
  715. this.tempList.checkedAll = true
  716. }else{
  717. this.tempList.checkedAll = false
  718. }
  719. this.calcTotal()
  720. if(!this.hasLogin){
  721. uni.setStorage({
  722. key: 'cart_list',
  723. data: this.tempList,
  724. success: function() {
  725. //更新购物车数量和购物车数据
  726. // this.isShow = false
  727. // this.isShow = true
  728. }
  729. })
  730. }
  731. }
  732. },
  733. //购物车数量加减
  734. numberChange(num,cartId,goodsId) {
  735. if(storeAntiShakeTimer){
  736. clearTimeout(storeAntiShakeTimer)
  737. }
  738. storeAntiShakeTimer=setTimeout(()=>{
  739. if(this.userInfo.access_token){ //登录
  740. let param = {}
  741. param.url = 'v3/business/front/cart/changeNum'
  742. param.method = 'POST'
  743. param.data = {
  744. cartId,
  745. number:num > 1 ? num : 1
  746. }
  747. this.$request(param).then(res=>{
  748. if(res.state == 200){
  749. // this.tempList = res.data
  750. this.getCartData();
  751. }else{
  752. this.$api.msg(res.msg);
  753. }
  754. })
  755. }else{ //未登录
  756. this.tempList.storeCartGroupList.map(item=>{
  757. item.promotionCartGroupList.map(item1=>{
  758. item1.cartList.map(item2=>{
  759. if(item2.goodsId == goodsId){
  760. item2.buyNum = num-0
  761. }
  762. })
  763. })
  764. })
  765. this.calcTotal()
  766. uni.setStorage({
  767. key: 'cart_list',
  768. data: this.tempList,
  769. success: function() {
  770. //更新购物车数量和购物车数据
  771. // this.isShow = false
  772. // this.isShow = true
  773. }
  774. })
  775. }
  776. },450);
  777. },
  778. //删除
  779. deleteCartItem(index) {
  780. let list = this.cartList;
  781. let row = list[index];
  782. let id = row.id;
  783. this.cartList.splice(index, 1);
  784. this.calcTotal();
  785. uni.hideLoading();
  786. },
  787. // 批量删除
  788. batchDelete(){
  789. let cartIds = ''
  790. let tempArr = []
  791. let goodsIds = ''
  792. let unLoginArr = []
  793. let checkedNum = 0
  794. this.tempList.storeCartGroupList.map(item =>{
  795. item.promotionCartGroupList.map(item1 =>{
  796. item1.cartList.map(item2=>{
  797. if(item2.isChecked == 1){
  798. checkedNum++
  799. cartIds += item2.cartId+','
  800. tempArr.push(item2.cartId)
  801. unLoginArr.push(item2.goodsId)
  802. }
  803. })
  804. })
  805. })
  806. if(checkedNum == 0){
  807. uni.showToast({
  808. title:'请选择删除的商品!',
  809. icon:'none'
  810. })
  811. }else{
  812. if(this.hasLogin){ //登录时批量删除
  813. cartIds = cartIds.substring(0,cartIds.length-1)
  814. let param = {}
  815. param.url = 'v3/business/front/cart/deleteCarts'
  816. param.method = 'POST'
  817. param.data = {
  818. cartIds
  819. }
  820. this.$request(param).then(res=>{
  821. if(res.state == 200){
  822. this.checkNum()
  823. uni.showToast({
  824. title:'删除成功!'
  825. })
  826. this.getCartData();
  827. }
  828. })
  829. }else{ //未登录时批量删除
  830. if(this.tempList.checkedAll == true){
  831. uni.removeStorageSync('cart_list')
  832. this.tempList.storeCartGroupList = []
  833. }else{
  834. this.tempList.storeCartGroupList.forEach((item,index)=>{
  835. item.promotionCartGroupList.forEach((item1,index1)=>{
  836. item1.cartList.forEach((item2,index2)=>{
  837. unLoginArr.forEach(v=>{
  838. if(item2.goodsId == v){
  839. item1.cartList.splice(index2,1)
  840. }
  841. })
  842. })
  843. if(item1.cartList.length == 0){
  844. item.promotionCartGroupList = []
  845. }
  846. if(item.promotionCartGroupList.length == 0){
  847. this.tempList.storeCartGroupList.splice(index,1)
  848. }
  849. })
  850. })
  851. }
  852. uni.showToast({
  853. title:'删除成功!'
  854. })
  855. }
  856. }
  857. },
  858. // 批量移入收藏夹
  859. batchCollect(){
  860. let cartId = ''
  861. let checkedNum = 0
  862. this.tempList.storeCartGroupList.map( item =>{
  863. item.promotionCartGroupList.map( item1 =>{
  864. item1.cartList.map(item2 =>{
  865. if(item2.isChecked == 1){
  866. checkedNum++
  867. cartId += item2.cartId + ','
  868. }
  869. })
  870. })
  871. })
  872. if(checkedNum == 0){
  873. uni.showToast({
  874. title:'请选择收藏的商品!',
  875. icon:'none'
  876. })
  877. }else{
  878. cartId = cartId.substring(0,cartId.length-1)
  879. let param = {}
  880. param.url = 'v3/business/front/cart/moveToCollection'
  881. param.method = 'POST'
  882. param.data = {
  883. cartIds:cartId,
  884. }
  885. this.$request(param).then(res=>{
  886. if(res.state == 200){
  887. uni.showToast({
  888. title:'收藏成功'
  889. })
  890. this.curOperateId = ''
  891. this.tempList = res.data
  892. // this.isShow = false
  893. // this.isShow = true
  894. }
  895. })
  896. }
  897. },
  898. // 计算结算数量及改变按钮样式
  899. checkNum(){
  900. let checkedLen = 0
  901. this.tempList.storeCartGroupList.map(item=>{
  902. item.promotionCartGroupList.map(item1=>{
  903. item1.cartList.map(item2=>{
  904. if(item2.isChecked == 1 && item2.productState == 1){
  905. checkedLen++
  906. }
  907. })
  908. })
  909. })
  910. // this.tempList.checkedLen = checkedLen
  911. this.isDisabled = checkedLen == 0?true:false
  912. },
  913. //计算总价
  914. calcTotal() {
  915. // 未登录时计算合计价格,结算数量
  916. let subTotal = 0
  917. let checkedNum = 0
  918. this.tempList.storeCartGroupList.map(item=>{
  919. item.promotionCartGroupList.map(item1=>{
  920. item1.cartList.map(item2=>{
  921. if(item2.isChecked == 1){
  922. subTotal += item2.buyNum * item2.productPrice
  923. checkedNum++
  924. }
  925. })
  926. })
  927. })
  928. this.tempList.totalAmount = subTotal.toFixed(2)
  929. this.tempList.totalCheck = checkedNum
  930. uni.setStorage({
  931. key: 'cart_list',
  932. data: this.tempList,
  933. success: function() {
  934. // this.isShow = false
  935. // this.isShow = true
  936. }
  937. });
  938. },
  939. //创建订单
  940. createOrder() {
  941. if(this.hasLogin){ //登录跳转确认下单页
  942. let settle_num = 0
  943. this.tempList.storeCartGroupList.map(item=>{
  944. item.promotionCartGroupList.map(item1=>{
  945. item1.cartList.map(item2=>{
  946. if(item2.isChecked == 1 && item2.productState == 1){
  947. settle_num++
  948. }
  949. })
  950. })
  951. })
  952. if(settle_num == 0){
  953. uni.showToast({
  954. title:'您还没有选中商品',
  955. icon:'none'
  956. })
  957. }else{
  958. this.testConfirmOrder()
  959. }
  960. }else{ //未登录提示登录
  961. uni.showModal({
  962. title:'提示',
  963. content:'需要先登录才能下单哦~',
  964. confirmText:'去登陆',
  965. cancelText:'我再看看',
  966. success:res=>{
  967. if (res.confirm) {
  968. uni.navigateTo({
  969. url:'/pages/public/login'
  970. })
  971. }
  972. }
  973. })
  974. }
  975. },
  976. //马上去逛逛事件
  977. goGoodsList() {
  978. uni.navigateTo({
  979. url: `/pages/product/list`
  980. })
  981. },
  982. //管理购物车数据
  983. manageCart() {
  984. this.editFlag = !this.editFlag;
  985. if(this.tempList && this.tempList.storeCartGroupList && this.tempList.storeCartGroupList.length > 0){
  986. if (this.editFlag) {
  987. this.topRightText = '完成';
  988. this.tempList.storeCartGroupList.map(item=>{
  989. item.promotionCartGroupList.map(item1=>{
  990. item1.cartList.map(item2=>{
  991. if(item2.productState == 3){
  992. item2.productState = 1
  993. item2.isChecked = 1
  994. this.$forceUpdate()
  995. }
  996. })
  997. })
  998. })
  999. } else {
  1000. this.topRightText = '管理';
  1001. this.tempList.storeCartGroupList.map(item=>{
  1002. item.promotionCartGroupList.map(item1=>{
  1003. item1.cartList.map(item2=>{
  1004. if(item2.buyNum > item2.productStock){
  1005. item2.productState = 3
  1006. item2.isChecked = 0
  1007. }
  1008. })
  1009. })
  1010. })
  1011. }
  1012. this.checkNum()
  1013. }else{
  1014. this.topRightText = '';
  1015. }
  1016. },
  1017. //商品长按事件
  1018. showOperate(cartId,goodsId){
  1019. this.is_show_mask = true
  1020. if(this.token){
  1021. this.curOperateId = cartId;
  1022. }else{
  1023. this.curOperateId = goodsId;
  1024. }
  1025. },
  1026. /*
  1027. *操作商品事件
  1028. * type:move移入收藏夹,del删除商品
  1029. */
  1030. operateCartGoods(type,id,goodsId){
  1031. if(this.hasLogin && !this.editFlag){ //登录
  1032. let param = {}
  1033. param.method = 'POST'
  1034. if(type == 'move'){
  1035. param.url = 'v3/business/front/cart/moveToCollection'
  1036. param.data = {
  1037. key:this.userInfo.access_token,
  1038. cartIds:id,
  1039. }
  1040. }else{
  1041. param.url = 'v3/business/front/cart/deleteCarts'
  1042. param.data = {
  1043. key:this.userInfo.access_token,
  1044. cartIds:id,
  1045. }
  1046. }
  1047. this.$request(param).then(res=>{
  1048. if(res.state == 200){
  1049. if(type == 'del'){
  1050. uni.showToast({
  1051. title:'删除成功!',
  1052. icon:'none'
  1053. })
  1054. }else{
  1055. this.curOperateId = ''
  1056. uni.showToast({
  1057. title:'收藏成功!',
  1058. icon:'none'
  1059. })
  1060. this.tempList = res.data
  1061. }
  1062. if(this.tempList.storeCartGroupList.length == 0){
  1063. this.topRightText = '';
  1064. }
  1065. this.handleState(res.data)
  1066. this.checkNum()
  1067. // this.isShow = false
  1068. // this.isShow = true
  1069. }
  1070. })
  1071. }else{ //未登录删除
  1072. this.tempList && this.tempList.storeCartGroupList && this.tempList.storeCartGroupList.map((item,index)=>{
  1073. item.promotionCartGroupList.map(item1=>{
  1074. item1.cartList.map((item2,index2)=>{
  1075. if(item2.goodsId == goodsId){
  1076. item1.cartList.splice(index2,1)
  1077. }
  1078. })
  1079. if(item1.cartList.length == 0){
  1080. item.promotionCartGroupList = []
  1081. }
  1082. if(item.promotionCartGroupList.length == 0){
  1083. this.tempList.storeCartGroupList.splice(index,1)
  1084. }
  1085. })
  1086. })
  1087. if(!this.hasLogin){
  1088. if(this.tempList.storeCartGroupList.length == 0){
  1089. uni.removeStorage({
  1090. key: 'cart_list',
  1091. success: function (res) {
  1092. // this.isShow = false
  1093. // this.isShow = true
  1094. }
  1095. })
  1096. }else{
  1097. uni.setStorage({
  1098. key: 'cart_list',
  1099. data: this.tempList,
  1100. success: function() {
  1101. //更新购物车数量和购物车数据
  1102. // this.isShow = false
  1103. // this.isShow = true
  1104. }
  1105. });
  1106. }
  1107. }
  1108. this.calcTotal()
  1109. uni.showToast({
  1110. title:'删除成功!'
  1111. })
  1112. this.tempList =this.tempList;
  1113. }
  1114. },
  1115. //进入商品详情页
  1116. goGoodsDetail(productId,goodsId){
  1117. uni.navigateTo({
  1118. url: '/pages/product/detail?productId=' + productId + '&goodsId='+goodsId
  1119. })
  1120. },
  1121. // 商品价格过长修改购买数量
  1122. changeBuyNum(cartId,goodsId){
  1123. console.log('asdasdas')
  1124. this.tempList && this.tempList.storeCartGroupList && this.tempList.storeCartGroupList.map(item=>{
  1125. if(this.hasLogin){
  1126. item.promotionCartGroupList.map(item1=>{
  1127. item1.cartList.map(item2=>{
  1128. if(item2.cartId == cartId){
  1129. item2.isShowBigNumBox = false
  1130. item2.isShowCloseBtn = true
  1131. this.$forceUpdate()
  1132. }
  1133. })
  1134. })
  1135. }else{
  1136. if(item.goodsId == goodsId){
  1137. item.isShowBigNumBox = false
  1138. item.isShowCloseBtn = true
  1139. this.$forceUpdate()
  1140. }
  1141. }
  1142. })
  1143. this.isShow = false
  1144. this.isShow = true
  1145. this.tempList && this.tempList.storeCartGroupList && this.tempList.storeCartGroupList.map(item=>{
  1146. if(this.hasLogin){
  1147. item.promotionCartGroupList.map(item1=>{
  1148. item1.cartList.map(item2=>{
  1149. if(item.cartId == cartId){
  1150. this.showPrice = item2.productPrice
  1151. item2.productPrice = item2.productPrice.toString().split('.')[0].toString().substr(0,4)+'...'
  1152. }
  1153. })
  1154. })
  1155. }else{
  1156. if(item.goodsId == goodsId){
  1157. this.showPrice = item.productPrice
  1158. item.productPrice = item.productPrice.toString().split('.')[0].toString().substr(0,4)+'...'
  1159. }
  1160. }
  1161. })
  1162. },
  1163. // 编辑数量关闭数量加减
  1164. closeBigPriceBox(cartId,goodsId){
  1165. this.tempList.storeCartGroupList.map(item=>{
  1166. item.promotionCartGroupList.map(item1=>{
  1167. item1.cartList.map(item2=>{
  1168. if(this.hasLogin){
  1169. if(item2.cartId == cartId){
  1170. item2.isShowBigNumBox = true
  1171. item2.isShowCloseBtn = false
  1172. }
  1173. }else{
  1174. if(item2.goodsId == goodsId){
  1175. item2.isShowBigNumBox = true
  1176. item2.isShowCloseBtn = false
  1177. }
  1178. }
  1179. })
  1180. })
  1181. })
  1182. this.getCartData()
  1183. this.isShow = false
  1184. this.isShow = true
  1185. },
  1186. // 清空失效商品
  1187. clearFailureGoods(type){
  1188. switch(type){
  1189. case 'open':{
  1190. this.$refs.popup.open()
  1191. break;
  1192. }
  1193. case 'confirm':{
  1194. let _this = this
  1195. let param = {}
  1196. param.url = 'v3/business/front/cart/emptyInvalid'
  1197. param.method = 'POST'
  1198. _this.$request(param).then(res=>{
  1199. if(res.state == 200){
  1200. _this.tempList.invalidList = []
  1201. _this.isShow = false
  1202. _this.isShow = true
  1203. uni.showToast({
  1204. title:'清除成功!'
  1205. })
  1206. }
  1207. })
  1208. break;
  1209. }
  1210. }
  1211. },
  1212. reload_cart(val){
  1213. if (this.hasLogin) {
  1214. this.getCartData();
  1215. this.isShow = false
  1216. this.isShow = true
  1217. } else {
  1218. this.initCartData();
  1219. this.isShow = false
  1220. this.isShow = true
  1221. }
  1222. },
  1223. //手机号免密登录是否开启接口
  1224. getSettings(){
  1225. // this.$request({
  1226. // url: 'v1/front/setting/getSettings',
  1227. // data: {
  1228. // names: 'basic_site_name,main_site_logo'
  1229. // },
  1230. // method: 'GET'
  1231. // }).then(res => {
  1232. // if (res.state == 200) {
  1233. // //更新页面数据
  1234. // this.settings = res.data || [];
  1235. // }
  1236. // }).catch((e) => {
  1237. // this.$api.msg(res.msg);
  1238. // //异常处理
  1239. // })
  1240. },
  1241. // 点击关闭长按蒙层
  1242. closeMask(e){
  1243. this.is_show_mask = false
  1244. },
  1245. addToCart(val){
  1246. uni.setStorageSync('cart_list',val);
  1247. this.initCartData();
  1248. this.$forceUpdate();
  1249. },
  1250. // 是否展示空页面
  1251. IsShowEmptyPage(){
  1252. if((this.tempList && this.tempList.cartInfoList.length>0) && (tempList.invalidList && tempList.invalidList.length > 0)){
  1253. this.is_show_empty = false
  1254. }else{
  1255. this.is_show_empty = true
  1256. }
  1257. },
  1258. // 打开换促销弹框
  1259. showPromotionBox(cartId,productImage,productPrice,specValues,promotionList,promotionId){
  1260. this.promotion_goods_info = [];
  1261. this.promotion_goods_info.push({
  1262. productImage:productImage,
  1263. productPrice:productPrice,
  1264. specValues:specValues,
  1265. promotionId:promotionId
  1266. })
  1267. this.promotionId = promotionId;
  1268. this.promotion_list = promotionList
  1269. this.cartId = cartId
  1270. this.$refs.popup.open()
  1271. },
  1272. // 关闭换促销弹框
  1273. closePromotionBox(){
  1274. this.$refs.popup.close()
  1275. },
  1276. // 关闭优惠券弹框
  1277. closeCouponBox(){
  1278. this.$refs.couponPopup.close();
  1279. },
  1280. packUpCoupon(){
  1281. this.is_show_more_rules = !this.is_show_more_rules
  1282. },
  1283. // 关注店铺
  1284. careStore(){
  1285. uni.navigateTo({
  1286. url:'/pages/store/attentionStore'
  1287. })
  1288. },
  1289. // 去店铺详情
  1290. toShopDetail(storeId){
  1291. uni.navigateTo({
  1292. url:'/pages/store/shopHomePage?vid='+storeId
  1293. })
  1294. },
  1295. // 打开优惠券弹框,获取店铺优惠券列表
  1296. getShopCoupon(storeId){
  1297. if(this.hasLogin){
  1298. this.$refs.couponPopup.open()
  1299. let param = {}
  1300. param.url = 'v3/promotion/front/coupon/storeCouponList?storeId='+storeId
  1301. param.method = 'GET'
  1302. this.$request(param).then(res=>{
  1303. if(res.state == 200){
  1304. this.coupon_list = res.data.list
  1305. this.coupon_list.forEach((item,index)=>{
  1306. item.isOpen = false;
  1307. if(item.isReceive == 3){
  1308. item.couponBg = this.finishReceiveBg;
  1309. }
  1310. if(item.isReceive == 2){
  1311. item.couponBg = this.hasReceiveBg;
  1312. }
  1313. if(item.isReceive == 1){
  1314. item.couponBg = this.goReceiveBg;
  1315. }
  1316. })
  1317. }
  1318. })
  1319. }else{
  1320. uni.navigateTo({
  1321. url:'/pages/public/login'
  1322. })
  1323. }
  1324. },
  1325. // 领取优惠券
  1326. applyCoupon(isReceive,couponId){
  1327. if(isReceive == 1){ //已领取
  1328. uni.showToast({
  1329. title:'您已领取该优惠券',
  1330. icon:'none'
  1331. })
  1332. }else if(isReceive == 2){ //已抢完
  1333. uni.showToast({
  1334. title:'该优惠券已抢完',
  1335. icon:'none'
  1336. })
  1337. }else{ //立即领取
  1338. let _this = this
  1339. let param = {}
  1340. param.url = 'v3/promotion/front/coupon/receiveCoupon?couponId='+couponId
  1341. param.method = 'GET'
  1342. this.$request(param).then(res=>{
  1343. if(res.state == 200){
  1344. uni.showToast({
  1345. title:'领取成功!'
  1346. })
  1347. setTimeout(()=>{
  1348. _this.getShopCoupon(_this.storeId)
  1349. },700)
  1350. }
  1351. })
  1352. }
  1353. },
  1354. //规则展开
  1355. descriptionOpen(couponId){
  1356. this.coupon_list.map(item=>{
  1357. if(item.couponId == couponId){
  1358. if(item.description != ''){
  1359. item.isOpen = !item.isOpen
  1360. this.$forceUpdate()
  1361. }
  1362. }
  1363. })
  1364. },
  1365. //立即领取
  1366. goReceive(item){
  1367. let couponId = item.couponId
  1368. let param = {};
  1369. param.url = 'v3/promotion/front/coupon/receiveCoupon';
  1370. param.method = 'GET';
  1371. param.data = {};
  1372. param.data.couponId = couponId;
  1373. this.$request(param).then(res => {
  1374. if (res.state == 200) {
  1375. let result = res.data;
  1376. this.$api.msg('领取成功!');
  1377. this.getShopCoupon(item.storeId)
  1378. } else {
  1379. this.$api.msg(res.msg);
  1380. this.getShopCoupon(item.storeId)
  1381. }
  1382. }).catch((e) => {
  1383. //异常处理
  1384. })
  1385. },
  1386. // 修改促销活动
  1387. changePromotion(index,promotionDes,promotionId,promotionType){
  1388. this.currIndex = index
  1389. this.promotionDes = promotionDes
  1390. this.promotionId = promotionId
  1391. this.promotionType = promotionType
  1392. },
  1393. // 确定修改促销活动
  1394. confirmChangePromotion(){
  1395. let param = {}
  1396. param.url = 'v3/business/front/cart/changePromotion'
  1397. param.method = 'POST'
  1398. param.data = {
  1399. cartId:this.cartId,
  1400. promotionDescription:this.promotionDes,
  1401. promotionId:this.promotionId,
  1402. promotionType:this.promotionType
  1403. }
  1404. this.$request(param).then(res=>{
  1405. if(res.state == 200){
  1406. uni.showToast({
  1407. title:'修改成功!'
  1408. })
  1409. this.tempList = res.data;
  1410. let storeCartGroupList = this.tempList.storeCartGroupList;
  1411. storeCartGroupList && storeCartGroupList.map(item=>{
  1412. item.promotionCartGroupList.map(item1=>{
  1413. item1.cartList.map(item2=>{
  1414. item2.isShowBigNumBox = false;
  1415. })
  1416. })
  1417. })
  1418. this.$refs.popup.close();
  1419. this.$forceUpdate();
  1420. }
  1421. })
  1422. }
  1423. }
  1424. }
  1425. </script>
  1426. <style lang='scss'>
  1427. page {
  1428. background-color: $bg-color-split;
  1429. width: 750rpx;
  1430. margin: 0 auto;
  1431. }
  1432. .container {
  1433. padding-bottom: 120rpx;
  1434. }
  1435. .cart_header{
  1436. background: #FFFFFF;
  1437. padding: 30rpx;
  1438. display: flex;
  1439. justify-content: space-between;
  1440. align-items: center;
  1441. .cart_header_text{
  1442. display: flex;
  1443. align-items: center;
  1444. image{
  1445. width: 32rpx;
  1446. height: 32rpx;
  1447. margin-right: 10rpx;
  1448. }
  1449. text{
  1450. font-size: 28rpx;
  1451. }
  1452. }
  1453. .cart_header_btn{
  1454. font-size: 28rpx;
  1455. }
  1456. }
  1457. .cart-list{
  1458. padding:0 20rpx;
  1459. box-sizing: border-box;
  1460. width: 750rpx;
  1461. margin: 0 auto;
  1462. }
  1463. /* 购物车列表项 */
  1464. .cart-item {
  1465. display: flex;
  1466. position: relative;
  1467. height: 200rpx;
  1468. margin-top:20rpx;
  1469. .mask {
  1470. position: absolute;
  1471. z-index: 4;
  1472. left: 0;
  1473. right: 0;
  1474. top: 0;
  1475. bottom: 0;
  1476. background: rgba(0, 0, 0, .6);
  1477. border-radius: 15rpx;
  1478. .move,.del {
  1479. width: 200rpx;
  1480. height: 80rpx;
  1481. border-radius: 40rpx;
  1482. color: #fff;
  1483. font-size: 28rpx;
  1484. }
  1485. .move {
  1486. background: linear-gradient(-90deg, #FE9820, #FFB72B);
  1487. }
  1488. .del {
  1489. background: linear-gradient(-90deg, #FC1D1C, #FF7A18);
  1490. margin-left: 90rpx;
  1491. }
  1492. }
  1493. .image-wrapper {
  1494. flex-shrink: 0;
  1495. position: relative;
  1496. background-color: #fff;
  1497. .goods-img {
  1498. background-size: contain;
  1499. background-position: center center;
  1500. background-repeat: no-repeat;
  1501. width: 200rpx;
  1502. height: 200rpx;
  1503. overflow: hidden;
  1504. background-color: #F8F6F7;
  1505. border-radius: 14rpx;
  1506. margin-left: 20rpx;
  1507. }
  1508. }
  1509. .checkbox {
  1510. position: absolute;
  1511. left: -16rpx;
  1512. top: -16rpx;
  1513. z-index: 8;
  1514. font-size: 44rpx;
  1515. line-height: 1;
  1516. padding: 4rpx;
  1517. color: $font-color-disabled;
  1518. background: #fff;
  1519. border-radius: 50px;
  1520. }
  1521. .item-right {
  1522. flex: 1;
  1523. overflow: hidden;
  1524. position: relative;
  1525. padding-left: 20rpx;
  1526. box-sizing: border-box;
  1527. .right_top {
  1528. margin-top: 10rpx;
  1529. }
  1530. .goods_spec{
  1531. font-size: 26rpx;
  1532. color:#666;
  1533. margin-top:10rpx;
  1534. overflow: hidden;
  1535. text-overflow: ellipsis;
  1536. white-space: nowrap;
  1537. }
  1538. .title {
  1539. color: $main-font-color;
  1540. font-size: 26rpx;
  1541. overflow: hidden;
  1542. text-overflow: ellipsis;
  1543. display: -webkit-box;
  1544. -webkit-line-clamp: 2;
  1545. -webkit-box-orient: vertical;
  1546. word-break: break-word;
  1547. line-height: 38rpx;
  1548. }
  1549. .attr {
  1550. font-size: 24rpx;
  1551. line-height: 28rpx;
  1552. color: $main-third-color;
  1553. background-color: #F8F8F8;
  1554. padding: 3rpx 7rpx;
  1555. border-radius: 6rpx;
  1556. }
  1557. .price {
  1558. height: 50rpx;
  1559. line-height: 50rpx;
  1560. }
  1561. .right_bottom {
  1562. width: 399rpx;
  1563. position: absolute;
  1564. bottom:0;
  1565. .right_bottom_left{
  1566. .trade_promotion_btn{
  1567. text{
  1568. font-size: 24rpx;
  1569. font-family: PingFang SC;
  1570. font-weight: 500;
  1571. color: #666666;
  1572. line-height: 30rpx;
  1573. }
  1574. image{
  1575. width: 20rpx;
  1576. height: 12rpx;
  1577. margin-left: 5rpx;
  1578. }
  1579. }
  1580. .price_wrap {
  1581. &.price_wrap_hide{
  1582. width: 148rpx;
  1583. white-space: nowrap;
  1584. text-overflow: ellipsis;
  1585. overflow: hidden;
  1586. word-break: break-all;
  1587. }
  1588. .unit,
  1589. .price_decimal {
  1590. font-size: 24rpx;
  1591. font-weight: 600;
  1592. color: $main-color;
  1593. }
  1594. .price_int {
  1595. font-weight: 600;
  1596. font-size: 34rpx;
  1597. line-height: 34rpx;
  1598. color: $main-color;
  1599. }
  1600. }
  1601. }
  1602. .goods_num_box{
  1603. height: 50rpx;
  1604. font-size:24rpx;
  1605. font-weight: 600;
  1606. text-align: center;
  1607. line-height: 50rpx;
  1608. color:#2D2D2D;
  1609. border: 1px solid #f2f2f2;
  1610. border-radius: 6px;
  1611. padding:0 15rpx;
  1612. margin-right:20rpx;
  1613. }
  1614. }
  1615. }
  1616. .del-btn {
  1617. padding: 4rpx 10rpx;
  1618. font-size: 34rpx;
  1619. height: 50rpx;
  1620. color: $font-color-light;
  1621. }
  1622. }
  1623. /* 底部栏 */
  1624. .action-section {
  1625. margin: 0 auto;
  1626. /* #ifdef H5 */
  1627. margin-bottom: 50px;
  1628. /* #endif */
  1629. position: fixed;
  1630. left: 0rpx;
  1631. bottom: 0rpx;
  1632. right: 0;
  1633. z-index: 95;
  1634. display: flex;
  1635. align-items: center;
  1636. height: 100rpx;
  1637. padding: 0 20rpx;
  1638. background: #fff;
  1639. box-shadow: 0px 0px 10px 0px rgba(153, 153, 153, 0.1);
  1640. width: 750rpx;
  1641. .checkbox {
  1642. .iconfont {
  1643. color: #BBBBBB;
  1644. font-size: 32rpx;
  1645. }
  1646. .check_all_tit {
  1647. color: #949494;
  1648. font-size: 26rpx;
  1649. margin-left: 15rpx;
  1650. }
  1651. }
  1652. .clear-btn {
  1653. position: absolute;
  1654. left: 26rpx;
  1655. top: 0;
  1656. z-index: 4;
  1657. width: 0;
  1658. height: 52rpx;
  1659. line-height: 52rpx;
  1660. padding-left: 38rpx;
  1661. font-size: $font-base;
  1662. color: #fff;
  1663. background: $font-color-disabled;
  1664. border-radius: 0 50px 50px 0;
  1665. opacity: 0;
  1666. transition: .2s;
  1667. &.show {
  1668. opacity: 1;
  1669. width: 120rpx;
  1670. }
  1671. }
  1672. .total-box {
  1673. flex: 1;
  1674. padding-right: 40rpx;
  1675. font-size: 26rpx;
  1676. color: #2D2D2D;
  1677. .price_wrap {
  1678. .unit,
  1679. .price_decimal {
  1680. font-size: 24rpx;
  1681. font-weight: bold;
  1682. color: $main-color;
  1683. margin-top: 4rpx;
  1684. }
  1685. .price_int {
  1686. font-weight: bold;
  1687. font-size: 34rpx;
  1688. line-height: 34rpx;
  1689. color: $main-color;
  1690. margin-left: 2rpx;
  1691. }
  1692. }
  1693. .coupon {
  1694. font-size: $font-sm;
  1695. color: $font-color-light;
  1696. text {
  1697. color: $font-color-dark;
  1698. }
  1699. }
  1700. }
  1701. .confirm-btn {
  1702. width: 200rpx;
  1703. height: 70rpx;
  1704. background: linear-gradient(-90deg, rgba(252, 29, 28, 1), rgba(255, 122, 24, 1));
  1705. border-radius: 35rpx;
  1706. font-size: 28rpx;
  1707. .settle_num {
  1708. font-size: 28rpx;
  1709. }
  1710. }
  1711. .move_collect{
  1712. width: 200rpx;
  1713. height: 60rpx;
  1714. background: #FFFFFF;
  1715. border: 1px solid #F76C14;
  1716. border-radius: 30rpx;
  1717. font-size: 28rpx;
  1718. font-family: PingFang SC;
  1719. font-weight: 500;
  1720. color: #F76C14;
  1721. line-height: 60rpx;
  1722. }
  1723. .del_more{
  1724. width: 200rpx;
  1725. height: 60rpx;
  1726. border: 1rpx solid #FF0000;
  1727. border-radius: 30rpx;
  1728. font-size: 28rpx;
  1729. font-family: PingFang SC;
  1730. font-weight: 500;
  1731. color: #FC2020;
  1732. line-height: 60rpx;
  1733. margin-left: 20rpx;
  1734. }
  1735. }
  1736. /* 复选框选中状态 */
  1737. .action-section .checkbox.checked,
  1738. .cart-item .checkbox.checked {
  1739. color: $uni-color-primary;
  1740. }
  1741. .empty_part {
  1742. display: flex;
  1743. flex: 1;
  1744. width: 100%;
  1745. height: 516rpx;
  1746. background: #fff;
  1747. margin-top: 20rpx;
  1748. .img {
  1749. width: 210rpx;
  1750. height: 210rpx;
  1751. margin-bottom: 37rpx;
  1752. margin-top: 88rpx;
  1753. }
  1754. .tip_con {
  1755. color: $main-third-color;
  1756. font-size: 26rpx;
  1757. }
  1758. .ope_btn {
  1759. color: $main-color;
  1760. font-size: 28rpx;
  1761. padding: 0 25rpx;
  1762. height: 54rpx;
  1763. background: rgba(252, 28, 28, .1);
  1764. border-radius: 27rpx;
  1765. margin-top: 20rpx;
  1766. }
  1767. }
  1768. .invalid_list_wrap{
  1769. background-color: #fff;
  1770. margin-top:20rpx;
  1771. border-radius: 15rpx;
  1772. padding:0 20rpx;
  1773. .invalid_list_title{
  1774. width:100%;
  1775. height:80rpx;
  1776. font-weight: 600;
  1777. display: flex;
  1778. align-items: center;
  1779. justify-content: space-between;
  1780. border-bottom:1rpx solid rgba(0,0,0,0.05);
  1781. }
  1782. .invalid_list_title text:nth-child(1){
  1783. font-size:30rpx;
  1784. color:#333;
  1785. }
  1786. .invalid_list_title text:nth-child(2){
  1787. font-size:24rpx;
  1788. color:#FC1C1C;
  1789. }
  1790. .invalid_list_content{
  1791. width:100%;
  1792. padding-bottom:20rpx;
  1793. .invalid_list_item{
  1794. padding-top:20rpx;
  1795. display:flex;
  1796. align-items: center;
  1797. .invalid_icon{
  1798. width:97rpx;
  1799. height: 34rpx;
  1800. font-size:24rpx;
  1801. text-align: center;
  1802. font-weight: 600;
  1803. color:#2D2D2D;
  1804. border-radius: 6rpx;
  1805. background-color: #ddd;
  1806. margin-right: 15rpx;
  1807. line-height: 34rpx;
  1808. }
  1809. .invalid_img{
  1810. margin-right:20rpx;
  1811. image{
  1812. width:200rpx;
  1813. height:200rpx;
  1814. border-radius: 14rpx;
  1815. }
  1816. }
  1817. .invalid_goods_wrap{
  1818. width:100%;
  1819. height:200rpx;
  1820. display:flex;
  1821. flex-direction: column;
  1822. position:relative;
  1823. .invalid_goods_name{
  1824. font-size:28rpx;
  1825. /* height:80rpx; */
  1826. color:#999;
  1827. font-weight: 600;
  1828. text-overflow: -o-ellipsis-lastline;
  1829. overflow: hidden;
  1830. text-overflow: ellipsis;
  1831. display: -webkit-box;
  1832. -webkit-line-clamp: 2;
  1833. line-clamp: 2;
  1834. -webkit-box-orient: vertical;
  1835. }
  1836. .invalid_goods_text{
  1837. position:absolute;
  1838. bottom:28rpx;
  1839. font-size:24rpx;
  1840. color:#333;
  1841. font-weight: 600;
  1842. }
  1843. .invalid_goods_spec{
  1844. font-size: 12px;
  1845. line-height: 14px;
  1846. color: #999;
  1847. background-color: #F8F8F8;
  1848. padding: 1px 3px;
  1849. -webkit-border-radius: 3px;
  1850. border-radius: 3px;
  1851. margin-top: 8rpx;
  1852. width: fit-content;
  1853. }
  1854. }
  1855. }
  1856. }
  1857. }
  1858. .close_img{
  1859. width:40rpx;
  1860. height:40rpx;
  1861. margin-left:6rpx;
  1862. margin-right: 20rpx;
  1863. }
  1864. .iconfont {
  1865. font-size: 32rpx;
  1866. color: #BBBBBB;
  1867. &.item_check{
  1868. color: $main-color !important;
  1869. }
  1870. }
  1871. .disabled_btn{
  1872. width: 200rpx;
  1873. height: 70rpx;
  1874. border-radius: 35rpx;
  1875. font-size: 28rpx;
  1876. background:#adadad !important;
  1877. .settle_num {
  1878. font-size: 28rpx;
  1879. /* margin-top: 7rpx; */
  1880. /* padding-bottom: 6rpx; */
  1881. }
  1882. }
  1883. .step{
  1884. width: 175rpx;
  1885. /* margin-right: 20rpx; */
  1886. }
  1887. .step /deep/ .uni-numbox__minus,.step /deep/ .uni-numbox__value,.step /deep/ .uni-numbox__plus{
  1888. border-color:#f2f2f2;
  1889. }
  1890. .stock_not{
  1891. font-size: 24rpx;
  1892. color: #FF0D24;
  1893. margin-right:20rpx;
  1894. margin-top: 8rpx;
  1895. }
  1896. .stock_not_enough{
  1897. color: #666666;
  1898. }
  1899. .stock_not_icon{
  1900. color: #eeeeee;
  1901. }
  1902. .promotion_box{
  1903. width: 750rpx;
  1904. height:900rpx;
  1905. background-color: #fff;
  1906. border-radius: 15rpx 15rpx 0 0;
  1907. padding:0 20rpx;
  1908. box-sizing: border-box;
  1909. .promotion_goods_wrap{
  1910. border-bottom:1rpx solid rgba(0,0,0,0.05);
  1911. display:flex;
  1912. padding:20rpx 0;
  1913. .promotion_goods_img_wrap{
  1914. width:180rpx;
  1915. height: 180rpx;
  1916. border-radius: 15rpx;
  1917. margin-right: 20rpx;
  1918. background-color: #eee;
  1919. .promotion_goods_img{
  1920. width:180rpx;
  1921. height: 180rpx;
  1922. border-radius: 15rpx;
  1923. }
  1924. }
  1925. .promotion_goods_right{
  1926. width:100%;
  1927. position: relative;
  1928. .promotion_goods_price{
  1929. display: flex;
  1930. align-items: flex-end;
  1931. .promotion_goods_price_now{
  1932. color:#FF3044;
  1933. font-weight: bold;
  1934. margin-right:20rpx;
  1935. .small_price{
  1936. font-size:24rpx;
  1937. }
  1938. .big_price{
  1939. font-size:34rpx;
  1940. }
  1941. }
  1942. .promotion_goods_price_old{
  1943. font-size:28rpx;
  1944. color:#999;
  1945. text-decoration: line-through;
  1946. }
  1947. }
  1948. .promotion_goods_spec{
  1949. font-size:28rpx;
  1950. color:#333;
  1951. text-overflow: -o-ellipsis-lastline;
  1952. overflow: hidden;
  1953. text-overflow: ellipsis;
  1954. display: -webkit-box;
  1955. -webkit-line-clamp: 2;
  1956. line-clamp: 2;
  1957. -webkit-box-orient: vertical;
  1958. position: absolute;
  1959. left:0;
  1960. bottom:20rpx;
  1961. }
  1962. .close_icon{
  1963. width:30rpx;
  1964. height:30rpx;
  1965. position: absolute;
  1966. right:0;
  1967. top:0;
  1968. }
  1969. }
  1970. }
  1971. .promotion_rules_wrap{
  1972. height:472rpx;
  1973. overflow-y: scroll;
  1974. .promotion_rules_title{
  1975. margin-top:30rpx;
  1976. font-size:32rpx;
  1977. color:#333;
  1978. font-weight: bold;
  1979. }
  1980. .promotion_rule_item{
  1981. margin-top:45rpx;
  1982. display: flex;
  1983. align-items: center;
  1984. .promotion_text{
  1985. display: inline-block;
  1986. font-size:28rpx;
  1987. color:#333;
  1988. margin-left:24rpx;
  1989. }
  1990. }
  1991. }
  1992. .confirm_btn_wrap{
  1993. width:750rpx;
  1994. position: fixed;
  1995. bottom:100rpx;
  1996. /* #ifdef MP-WEIXIN */
  1997. bottom: 0;
  1998. /* #endif */
  1999. left:0;
  2000. height:100rpx;
  2001. display: flex;
  2002. justify-content: center;
  2003. align-items: center;
  2004. box-shadow: 0px 0px 20px 0px rgba(86, 86, 86, 0.08);
  2005. .confirm_btn{
  2006. width:690rpx;
  2007. height:70rpx;
  2008. color:#fff;
  2009. display: flex;
  2010. justify-content: center;
  2011. align-items: center;
  2012. font-size: 28rpx;
  2013. background: #F30300;
  2014. border-radius: 35rpx;
  2015. }
  2016. }
  2017. }
  2018. /* 领取优惠券弹框 */
  2019. .coupon_box{
  2020. height:900rpx;
  2021. background-color: #f5f5f5;
  2022. border-radius: 15rpx 15rpx 0 0;
  2023. .coupon_title{
  2024. height:90rpx;
  2025. display:flex;
  2026. align-items: center;
  2027. font-size:32rpx;
  2028. color:#333;
  2029. font-weight: bold;
  2030. justify-content: space-between;
  2031. padding:0 20rpx 0 30rpx;
  2032. box-sizing: border-box;
  2033. background-color: #fff;
  2034. .close_icon{
  2035. width:30rpx;
  2036. height:30rpx;
  2037. }
  2038. }
  2039. .coupon_content_wrap{
  2040. height:810rpx;
  2041. overflow-y: scroll;
  2042. padding:0 20rpx 120rpx 20rpx;
  2043. box-sizing: border-box;
  2044. .coupon_item{
  2045. width:100%;
  2046. margin-top:20rpx;
  2047. .coupon_top{
  2048. height:180rpx;
  2049. display: flex;
  2050. align-items: center;
  2051. background-color: #FFF7F5;
  2052. border-radius: 15rpx;
  2053. position:relative;
  2054. .coupon_price{
  2055. width:200rpx;
  2056. font-size: 60rpx;
  2057. color:#FF1812;
  2058. font-weight: bold;
  2059. display: flex;
  2060. justify-content: center;
  2061. }
  2062. .coupon_rules_wrap{
  2063. .coupon_rule{
  2064. font-size: 34rpx;
  2065. color:#333;
  2066. font-weight: bold;
  2067. }
  2068. .coupon_time{
  2069. font-size: 28rpx;
  2070. color:#999;
  2071. margin-top:18rpx;
  2072. font-weight: 400;
  2073. }
  2074. }
  2075. .have_apply{
  2076. width:135rpx;
  2077. height:50rpx;
  2078. position: absolute;
  2079. right:28rpx;
  2080. top:50%;
  2081. transform: translateY(-50%);
  2082. }
  2083. }
  2084. .coupon_bottom{
  2085. font-size:26rpx;
  2086. color:#333;
  2087. padding:20rpx 30rpx;
  2088. box-sizing: border-box;
  2089. background-color: #fff;
  2090. border-radius: 15rpx;
  2091. position: relative;
  2092. .rule_icon{
  2093. width:28rpx;
  2094. height:28rpx;
  2095. position:absolute;
  2096. right:30rpx;
  2097. top:50%;
  2098. transform: translateY(-50%);
  2099. }
  2100. }
  2101. }
  2102. }
  2103. }
  2104. .coupon_rule_text{
  2105. width:581rpx;
  2106. white-space: nowrap;
  2107. text-overflow: ellipsis;
  2108. overflow: hidden;
  2109. }
  2110. .shop_list_wrap{
  2111. .shop_item{
  2112. margin-top:20rpx;
  2113. background-color: #fff;
  2114. border-radius: 15rpx;
  2115. box-sizing: border-box;
  2116. .shop_item_top{
  2117. display: flex;
  2118. align-items: center;
  2119. position: relative;
  2120. padding-bottom: 20rpx;
  2121. border-bottom: 1rpx solid #F2F2F2;
  2122. padding: 20rpx;
  2123. box-sizing: border-box;
  2124. .shop_icon{
  2125. width:34rpx;
  2126. height:32rpx;
  2127. margin:0 10rpx 0 20rpx;
  2128. }
  2129. .shop_name{
  2130. font-size:28rpx;
  2131. color:#2d2d2d;
  2132. font-weight: 600;
  2133. margin-right:10rpx;
  2134. }
  2135. .to_right_icon{
  2136. width:13rpx;
  2137. height: 22rpx;
  2138. }
  2139. .coupon_icon{
  2140. width:62rpx;
  2141. height: 30rpx;
  2142. position:absolute;
  2143. top:50%;
  2144. right: 0;
  2145. transform: translateY(-50%);
  2146. }
  2147. }
  2148. }
  2149. }
  2150. .discount_activity{
  2151. padding: 0 20rpx 20rpx;
  2152. box-sizing: border-box;
  2153. }
  2154. .discount_left{
  2155. margin-left:50rpx;
  2156. display: flex;
  2157. align-items: center;
  2158. margin-top: 24rpx;
  2159. margin-bottom: 22rpx;
  2160. .discount_icon{
  2161. width: 62rpx;
  2162. height: 30rpx;
  2163. font-size:24rpx;
  2164. color:#fff;
  2165. display: flex;
  2166. justify-content: center;
  2167. align-items: center;
  2168. background: #FF0D24;
  2169. border-radius: 15rpx;
  2170. margin-right:10rpx;
  2171. }
  2172. .promotion_text{
  2173. width:550rpx;
  2174. height:28rpx;
  2175. display: flex;
  2176. text-overflow: -o-ellipsis-lastline;
  2177. overflow: hidden;
  2178. text-overflow: ellipsis;
  2179. display: -webkit-box;
  2180. -webkit-line-clamp: 1;
  2181. line-clamp: 1;
  2182. -webkit-box-orient: vertical;
  2183. .discount_text{
  2184. font-size:26rpx;
  2185. color:#2d2d2d;
  2186. line-height: 30rpx;
  2187. }
  2188. }
  2189. }
  2190. .discount_activity_wrap{
  2191. display: flex;
  2192. justify-content: space-between;
  2193. margin-top:20rpx;
  2194. }
  2195. /* 优惠券弹框 start */
  2196. .coupon_model{
  2197. width: 100%;
  2198. height: 900rpx;
  2199. background: #F5F5F5;
  2200. border-radius: 15rpx 15rpx 0 0;
  2201. .coupon_model_title{
  2202. width: 100%;
  2203. height: 100rpx;
  2204. border-radius: 15rpx 15rpx 0 0;
  2205. display: flex;
  2206. align-items: center;
  2207. justify-content: space-between;
  2208. padding: 0 12rpx 0 30rpx;
  2209. box-sizing: border-box;
  2210. position: absolute;
  2211. z-index: 10;
  2212. top: 0;
  2213. background: #FFFFFF;
  2214. border-bottom: 1rpx solid #f2f2f2;
  2215. text {
  2216. font-size: 32rpx;
  2217. font-family: PingFang SC;
  2218. font-weight: bold;
  2219. color: #333333;
  2220. line-height: 32rpx;
  2221. }
  2222. image {
  2223. width: 46rpx;
  2224. height: 46rpx;
  2225. }
  2226. }
  2227. .coupon_model_list{
  2228. box-sizing: border-box;
  2229. height: 880rpx;
  2230. width: 750rpx;
  2231. overflow-x: hidden;
  2232. padding: 120rpx 20rpx 0 20rpx;
  2233. /* #ifdef H5*/
  2234. padding-bottom:100rpx;
  2235. /* #endif */
  2236. box-sizing: border-box;
  2237. .my_coupon_pre{
  2238. margin-bottom: 20rpx;
  2239. position: relative;
  2240. .coupon_pre_top{
  2241. width: 710rpx;
  2242. height: 190rpx;
  2243. background-size: 100% 100%;
  2244. display: flex;
  2245. align-items: center;
  2246. .coupon_pre_left{
  2247. display: flex;
  2248. flex-direction: column;
  2249. width: 203rpx;
  2250. align-items: center;
  2251. .coupon_pre_price{
  2252. font-size: 20rpx;
  2253. font-family: Source Han Sans CN;
  2254. font-weight: bold;
  2255. color: #F20C06;
  2256. line-height: 31rpx;
  2257. text:nth-child(2){
  2258. font-size: 48rpx;
  2259. font-family: Source Han Sans CN;
  2260. font-weight: bold;
  2261. color: #F30801;
  2262. line-height: 31rpx;
  2263. }
  2264. }
  2265. .coupon_pre_active{
  2266. font-size: 24rpx;
  2267. font-family: Source Han Sans CN;
  2268. font-weight: 400;
  2269. color: #F6130E;
  2270. line-height: 31rpx;
  2271. margin-top: 20rpx;
  2272. }
  2273. }
  2274. .coupon_pre_cen{
  2275. display: felx;
  2276. flex-direction: column;
  2277. flex:1;
  2278. padding-left: 44rpx;
  2279. .coupon_pre_title{
  2280. font-size: 30rpx;
  2281. font-family: PingFang SC;
  2282. font-weight: bold;
  2283. color: #111111;
  2284. line-height: 31rpx;
  2285. }
  2286. .coupon_pre_time{
  2287. font-size: 24rpx;
  2288. font-family: PingFang SC;
  2289. font-weight: 500;
  2290. color: #333333;
  2291. line-height: 31rpx;
  2292. margin: 21rpx 0 17rpx;
  2293. }
  2294. .coupon_pre_rules{
  2295. display: flex;
  2296. align-items: center;
  2297. text{
  2298. font-size: 24rpx;
  2299. font-family: PingFang SC;
  2300. font-weight: 500;
  2301. color: #999999;
  2302. line-height: 31rpx;
  2303. }
  2304. image{
  2305. width: 12rpx;
  2306. height: 7rpx;
  2307. margin-left: 20rpx;
  2308. }
  2309. }
  2310. }
  2311. .coupon_pre_right{
  2312. width: 130rpx;
  2313. box-sizing: border-box;
  2314. font-size: 24rpx;
  2315. font-family: Source Han Sans CN;
  2316. font-weight: 400;
  2317. color: #FFFFFF;
  2318. text-align: center;
  2319. }
  2320. }
  2321. .coupon_rules{
  2322. width: 710rpx;
  2323. padding: 20rpx 0 20rpx 43rpx;
  2324. box-sizing: border-box;
  2325. font-size: 22rpx;
  2326. font-family: PingFang SC;
  2327. font-weight: 500;
  2328. color: #666666;
  2329. line-height: 30rpx;
  2330. background: #FFFFFF;
  2331. border-top: 1rpx solid #f2f2f2;
  2332. border-radius: 0 0 15rpx 15rpx;
  2333. .coupon_rules_title{
  2334. margin-bottom: 10rpx;
  2335. }
  2336. }
  2337. .coupon_type{
  2338. position: absolute;
  2339. top: 0;
  2340. left: 0;
  2341. padding: 0 5rpx;
  2342. height: 30rpx;
  2343. background: linear-gradient(0deg, #FF3000 0%, #FB3E31 0%, #FF3728 0%, #FF142F 100%);
  2344. font-size: 20rpx;
  2345. font-family: Source Han Sans CN;
  2346. font-weight: 400;
  2347. color: #FFFFFF;
  2348. line-height: 30rpx;
  2349. text-align: center;
  2350. border-radius: 15rpx 0 15rpx 0;
  2351. }
  2352. .coupon_progress{
  2353. position: absolute;
  2354. width: 130rpx;
  2355. top: 10rpx;
  2356. right: 0rpx;
  2357. display: flex;
  2358. flex-direction: column;
  2359. align-items: center;
  2360. font-size: 18rpx;
  2361. font-family: Source Han Sans CN;
  2362. font-weight: 400;
  2363. color: #FFFFFF;
  2364. line-height: 31rpx;
  2365. .progress_con{
  2366. width: 84rpx;
  2367. margin-top: 5rpx;
  2368. border-radius: 5rpx;
  2369. progress{
  2370. border: 1rpx solid #FFFFFF;
  2371. border-radius: 5rpx;
  2372. }
  2373. }
  2374. }
  2375. }
  2376. }
  2377. }
  2378. /* 空优惠券 */
  2379. .empty_coupon_wrap{
  2380. display: flex;
  2381. flex-direction: column;
  2382. justify-content: center;
  2383. align-items: center;
  2384. padding-top:260rpx;
  2385. box-sizing: border-box;
  2386. .empty_coupon_img{
  2387. width:187rpx;
  2388. height:187rpx;
  2389. margin-bottom:30rpx;
  2390. }
  2391. .empty_coupon_text{
  2392. font-size:26rpx;
  2393. color:#999;
  2394. }
  2395. }
  2396. /* 优惠券弹框 end */
  2397. .goods_num_wrap{
  2398. text-align: right;
  2399. }
  2400. .exceed_price_wrap{
  2401. display: flex;
  2402. align-items: center;
  2403. }
  2404. #store_no_good {
  2405. display: flex;
  2406. align-items: center;
  2407. justify-content: center;
  2408. }
  2409. #store_no_good {
  2410. position: fixed;
  2411. top: 0;
  2412. left: 0;
  2413. width: 750rpx;
  2414. height: 100vh;
  2415. background-color: rgba(0, 0, 0, 0.6);
  2416. z-index: 999;
  2417. right: 0;
  2418. margin: 0 auto;
  2419. }
  2420. #store_no_good .content {
  2421. width: 580rpx;
  2422. height: 773rpx;
  2423. background-color: white;
  2424. border-radius: 15rpx;
  2425. .content_title {
  2426. margin-top: 24rpx;
  2427. margin-bottom: 24rpx;
  2428. display: flex;
  2429. align-items: center;
  2430. justify-content: space-between;
  2431. padding: 0 30rpx;
  2432. font-size: 32rpx;
  2433. color: #2D2D2D;
  2434. image {
  2435. width: 22rpx;
  2436. height: 22rpx;
  2437. }
  2438. }
  2439. .good_list {
  2440. height: 593rpx;
  2441. overflow-y: scroll;
  2442. width: 100%;
  2443. .good_item {
  2444. display: flex;
  2445. align-items: center;
  2446. padding: 30rpx;
  2447. border-top: 1rpx solid #f2f2f2;
  2448. image {
  2449. width: 70rpx;
  2450. height: 70rpx;
  2451. border-radius: 6rpx;
  2452. }
  2453. .good_info {
  2454. margin-left: 20rpx;
  2455. position: relative;
  2456. .good_name {
  2457. width: 382rpx;
  2458. font-size: 26rpx;
  2459. }
  2460. .good_spec {
  2461. margin-top: 20rpx;
  2462. font-size: 22rpx;
  2463. }
  2464. .num {
  2465. position: absolute;
  2466. bottom: 0rpx;
  2467. right: 0rpx;
  2468. font-size: 24rpx;
  2469. color: #333333;
  2470. }
  2471. }
  2472. }
  2473. }
  2474. .part_no_goods {
  2475. width: 520rpx;
  2476. height: 60rpx;
  2477. font-size: 30rpx;
  2478. color: white;
  2479. display: flex;
  2480. align-items: center;
  2481. margin: 0 auto;
  2482. border-radius: 30rpx;
  2483. margin-top: 15rpx;
  2484. .return {
  2485. width: 50%;
  2486. height: 60rpx;
  2487. line-height: 60rpx;
  2488. background-color: #FF8809;
  2489. text-align: center;
  2490. border-radius: 30rpx 0 0 30rpx;
  2491. }
  2492. .remove {
  2493. width: 50%;
  2494. height: 60rpx;
  2495. line-height: 60rpx;
  2496. background-color: #F90208;
  2497. text-align: center;
  2498. border-radius: 0 30rpx 30rpx 0;
  2499. }
  2500. }
  2501. }
  2502. .part_no_goods_another {
  2503. width: 520rpx;
  2504. height: 60rpx;
  2505. font-size: 30rpx;
  2506. color: white;
  2507. display: flex;
  2508. align-items: center;
  2509. margin: 0 auto;
  2510. border-radius: 30rpx;
  2511. background-color: #F90208;
  2512. .return {
  2513. width: 100%;
  2514. text-align: center;
  2515. }
  2516. }
  2517. </style>