cart.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  4. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0" :style="{top:CustomBar+'px'}">
  5. <view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
  6. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  7. </view>
  8. <view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
  9. <view v-if="!isEmpty" class="container-cart">
  10. <scroll-view class="cart-content" scroll-y @scrolltolower="toLower">
  11. <view class="goods-list">
  12. <view v-for="(item, index) in goodsList" :key="index" class="goods-item">
  13. <view class="shoptitle">
  14. <!--选择商店的全部商品 :disabled="isNnder"-->
  15. <view class="checkbox-box" @click.stop="checkShop(item)">
  16. <view class="checkbox iconfont" :class="[item.checked ?'icon-xuanze':'icon-weixuanze']"></view>
  17. </view>
  18. <view v-if="item.promotions" class="floor-item-act">
  19. <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
  20. </view>
  21. <view class="text">{{item.name}}</view>
  22. </view>
  23. <view class="productlist">
  24. <view class="goods-pros" v-for="(pros,idx) in item.productsList" :key="idx">
  25. <view class="goods-pros-t">
  26. <!--选择商品-->
  27. <view class="checkbox-box" @click.stop="ischeck(item,pros,idx)">
  28. <view class="checkbox iconfont" :class="[pros.productsChecked ?'icon-xuanze':'icon-weixuanze']"></view>
  29. </view>
  30. <view class="pros-img" @click.stop="navToListPage(pros.productID)">
  31. <image :src="pros.mainImage ? pros.mainImage :''" alt="" />
  32. </view>
  33. <view class="pros-product">
  34. <view class="producttitle" @click.stop="navToListPage(pros.productID)" >
  35. {{pros.name}}
  36. </view>
  37. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  38. <view class="productspec" v-if="pros.productCode!=''&&pros.productCode!=null">
  39. <view bgcolor="#666666">商品编码:{{pros.productCode}}</view>
  40. </view>
  41. <view class="productprice">
  42. <!--使用过滤器对总价改变-->
  43. <view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
  44. <text>¥</text>
  45. {{ (PromotionsFormat(pros.promotions) ? pros.price1 : pros.retailPrice) | NumFormat }}
  46. </view>
  47. <view class="count" :class="[isshowDelbtn ? 'none':'show']">
  48. <text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
  49. <view class="number-box">
  50. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  51. <input class="btn-input" type="number" maxlength='6' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
  52. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  53. </view>
  54. </view>
  55. </view>
  56. <view v-show="pros.actStatus==1" class="floor-item-act">
  57. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  58. {{pros.promotions.name}}
  59. <text v-if ="pros.promotions!=null && pros.promotions.type!=3">
  60. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  61. </text>
  62. </view>
  63. <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
  64. </view>
  65. <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
  66. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="goods-pros-line">
  71. <view class="line"></view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
  76. <view class="sum-none" v-if="item.reducedPrice>0">
  77. <text class="money-sign">¥</text>
  78. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  79. <text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  80. </view>
  81. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="failure-list" v-if="failureList.length>0">
  86. <view class="failure-title">
  87. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  88. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  89. </view>
  90. <view class="productlist">
  91. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  92. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  93. <!--选择商品-->
  94. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  95. <button class="checkbox iconfont"
  96. :class="[ failure.productsChecked ? 'icon-xuanze':'icon-weixuanze']">
  97. </button>
  98. </view>
  99. <text class="img-tip">失效</text>
  100. <view class="pros-img">
  101. <image :src="failure.mainImage ? failure.mainImage:''" alt="" />
  102. </view>
  103. <view class="pros-product">
  104. <view class="producttitle">{{failure.name}}</view>
  105. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  106. <view class="productstate">{{failureStateText(failure.validFlag)}}</view>
  107. </view>
  108. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  109. <!--</view>-->
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <!--加载loadding-->
  115. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  116. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  117. <!--加载loadding-->
  118. </scroll-view>
  119. <!-- 脚部菜单 -->
  120. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  121. <view class="footer-le">
  122. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  123. <button class="checkbox iconfont" :class="[isCheckAll?'icon-xuanze':'icon-weixuanze']"></button>
  124. <view class="text">全选</view>
  125. </view>
  126. <view class="sum">
  127. <view class="sum-none" v-if="reducedPrice>0">
  128. <text class="money-sign">¥</text>
  129. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  130. <text class="money-reduced">减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  131. </view>
  132. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  133. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  134. </view>
  135. </view>
  136. </view>
  137. <view v-if="!isshowDelbtn" class="footer-ri" >
  138. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  139. </view>
  140. <view v-else class="footer-del">
  141. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  142. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  143. </view>
  144. </view>
  145. </view>
  146. <view v-if="isEmpty" class="cart-content empty">
  147. <view class="empty-container">
  148. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  149. <text class="error-text">购物车空空如也~</text>
  150. </view>
  151. </view>
  152. </view>
  153. <!-- 提示弹窗 -->
  154. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
  155. <!-- 促销活动弹窗 -->
  156. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  157. <!-- 透明模态层 -->
  158. <modal-layer v-if='modallayer'></modal-layer>
  159. </view>
  160. </template>
  161. <script>
  162. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  163. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  164. import tuiNomore from "@/components/tui-components/nomore/nomore"
  165. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  166. import { cartList } from '@/common/json/data.json.js' //本地数据
  167. import modalLayer from "@/components/modal-layer"
  168. import { mapState,mapMutations } from 'vuex';
  169. export default{
  170. components:{
  171. tuiSkeleton,
  172. tuiLoadmore,
  173. tuiNomore,
  174. activiPopup,
  175. modalLayer
  176. },
  177. data(){
  178. return{
  179. modal:false,
  180. contentModalText:'',
  181. clubId:'', //机构ID
  182. userID:'',
  183. kindCount:0,
  184. serviceProviderId:'',//协销ID
  185. isStock:'',
  186. popupShow:false,
  187. handlerPros:{},//监听单挑促销商品
  188. promotionsList:[],//促销活动列表
  189. failureList:[], //失效商品列表
  190. goodsList:cartList, //购物车的商品
  191. delGoodsList:'',//要删除的商品
  192. setGoodData:'', //确认订单的商品
  193. isCheckAll:false,//是否全选
  194. totalOriginalPrice:0,//所有原价价
  195. reducedPrice:0,//满减
  196. allPrice:0,//所有价格
  197. allCount:0,//被选中的产品数量
  198. isModallayer:false,
  199. skeletonShow:false,
  200. isshowDelbtn:false,
  201. isDisabled: false, // 供应商/店铺全选是否禁用状态
  202. isEmpty:false,//显示空购物车
  203. scrollHeight: 'auto',
  204. nomoreText: '上拉显示更多',
  205. hasNextPage: false,
  206. loadding: false,
  207. pullUpOn: true,
  208. pullFlag: true,
  209. pageSize: 10,
  210. pageNum: 1,
  211. submitIds:[],
  212. depositIds : [6060,6061,6062,6063,6064],//定金商品ID
  213. rechargeIds : [6065,6066,6067,6068,6069],//充值余额商品ID
  214. isIphoneX:this.$store.state.isIphoneX,
  215. againBuyProductIds:''
  216. }
  217. },
  218. onLoad(){
  219. this.setScrollHeight();
  220. },
  221. computed: {
  222. ...mapState(['hasLogin','userInfo'])
  223. },
  224. filters:{
  225. NumFormat(value) {//处理金额
  226. return Number(value).toFixed(2);
  227. },
  228. totalprice(val,count){//单件商品的价格 × 数量
  229. return (val * count).toFixed(2)
  230. }
  231. },
  232. methods:{
  233. initData(){
  234. this.isModallayer = false //遮罩层 防止多次点击
  235. this.skeletonShow = true //预加载圆圈
  236. this.isCheckAll=false//是否全选
  237. this.submitIds = []
  238. this.$api.getStorage().then((resolve) => {
  239. this.serviceProviderId = resolve.serviceProviderID;
  240. this.initGetCartGoodsList();
  241. })
  242. },
  243. initLogin(){
  244. this.$api.redirectTo('/pages/login/login?type=4')
  245. },
  246. clickPopupShow(pros,type){//显示活动弹窗
  247. this.popupShow = true;
  248. this.handlerPros = pros;
  249. },
  250. failureToProduct(failure){
  251. if(failure.status == 1){
  252. this.$util.msg('商品已丢失,不能查看',2000)
  253. return
  254. }else if(failure.status == 2){
  255. this.$util.msg('商品已停售,不能查看',2000)
  256. return
  257. }else{
  258. this.isModallayer = true;
  259. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  260. }
  261. },
  262. failureStateText(state){
  263. let stateText = '',
  264. stateTextObject={
  265. 0:'商品已停售',
  266. 10:'商品已丢失'
  267. }
  268. Object.keys(stateTextObject).forEach(key => {
  269. if(key == state){
  270. stateText = stateTextObject[key]
  271. }
  272. })
  273. return stateText;
  274. },
  275. deletefailureList(){
  276. this.failureList.forEach(failure=>{ this.delGoodsList += failure.sellerCartId+',' })
  277. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  278. console.log(this.delGoodsList)
  279. this.SellerService.SellerCartdelete({sellerCartIds:this.delGoodsList}).then(response =>{
  280. console.log(response)
  281. this.$util.msg('删除成功',2000);
  282. setTimeout(()=>{
  283. this.isshowDelbtn = false;
  284. this.initGetCartGoodsList();
  285. },2000)
  286. }).catch(error =>{
  287. this.$util.msg(error.msg,2000)
  288. })
  289. })
  290. },
  291. setScrollHeight() {
  292. // 窗口高度-footer高度
  293. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  294. setTimeout(()=> {
  295. const query = uni.createSelectorQuery().in(this);
  296. query.selectAll('.footer').boundingClientRect();
  297. query.exec(res => {
  298. this.windowHeight = windowHeight;
  299. if(res[0][0]) {
  300. this.scrollHeight = windowHeight - res[0][0].height;
  301. }
  302. })
  303. }, 500)
  304. },
  305. initGetCartGoodsList(){//初始化购物车 index:1
  306. let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:1,pageSize:this.pageSize,againBuyProductIds:this.againBuyProductIds}
  307. this.SellerService.GetSellerShoppingInfo(params).then(response =>{
  308. this.skeletonShow = false
  309. this.$store.commit('updateAllNum',response.data.cartQuantity)
  310. this.promotionsList = response.data.promotionsList;
  311. this.kindCount = response.data.productCount;
  312. const resultsData = response.data.pageDate;
  313. if(resultsData.results.length > 0||response.data.invalidProductList.length>0){
  314. this.isEmpty =false
  315. }else{
  316. this.isEmpty =true
  317. }
  318. if(resultsData.results&&resultsData.results.length > 0){
  319. this.hasNextPage = resultsData.hasNextPage;
  320. this.goodsList = resultsData.results;
  321. this.goodsList.forEach((item,index) => {
  322. let productsListLength = item.productsList.length,invalidLength = 0;
  323. item.productsList.forEach(pros => {
  324. pros.shopID = item.shopID;
  325. pros.isStep = false
  326. if(pros.step === 2){
  327. if(pros.productCount % pros.minBuyNumber != 0){
  328. pros.productCount = pros.minBuyNumber
  329. this.totalShopPeice()
  330. this.updateShoppogNum(pros)
  331. }
  332. }
  333. })
  334. })
  335. this.totalShopPeice()
  336. this.pullFlag = false;
  337. setTimeout(()=>{this.pullFlag = true;},500)
  338. if(this.hasNextPage){
  339. this.pullUpOn = false
  340. this.nomoreText = '上拉显示更多'
  341. }else{
  342. if(this.goodsList.length < 4){
  343. this.pullUpOn = true
  344. }else{
  345. this.pullUpOn = false
  346. this.nomoreText = '已至底部'
  347. }
  348. }
  349. } else {
  350. this.goodsList = [];
  351. }
  352. if( response.data.invalidProductList && response.data.invalidProductList.length > 0){
  353. let newFailureList = [],isFailureLayer;
  354. response.data.invalidProductList.forEach((failure,index) => {
  355. if(failure.validFlag == 0 || failure.validFlag == 10) {
  356. isFailureLayer = true
  357. }else{
  358. isFailureLayer = false
  359. }
  360. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  361. })
  362. this.failureList = newFailureList;
  363. console.log(this.failureList)
  364. } else {
  365. this.failureList = [];
  366. }
  367. }).catch(error =>{
  368. this.$util.msg(error.msg,2000);
  369. })
  370. },
  371. getOnReachBottomData(){//上拉加载
  372. this.pageNum+=1
  373. let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
  374. this.SellerService.GetSellerShoppingInfo(params).then(response =>{
  375. let resultsData = response.data.pageDate
  376. this.promotionsList = response.data.promotionsList;
  377. this.hasNextPage = resultsData.hasNextPage;
  378. this.goodsList = this.goodsList.concat(resultsData.results)
  379. this.goodsList.forEach((item,index) => {
  380. let productsListLength = item.productsList.length,invalidLength = 0;
  381. item.productsList.forEach(pros => {
  382. pros.shopID = item.shopID;
  383. pros.isStep = false
  384. if(pros.step === 2){
  385. if(pros.productCount % pros.minBuyNumber != 0){
  386. pros.productCount = pros.minBuyNumber
  387. this.totalShopPeice()
  388. this.updateShoppogNum(pros)
  389. }
  390. }
  391. })
  392. })
  393. this.totalShopPeice()
  394. this.pullFlag = false;// 防上拉暴滑
  395. setTimeout(()=>{this.pullFlag = true;},500)
  396. if(this.hasNextPage){
  397. this.pullUpOn = false
  398. this.nomoreText = '上拉显示更多'
  399. }else{
  400. this.loadding = false
  401. this.pullUpOn = false
  402. this.nomoreText = '已至底部'
  403. }
  404. }).catch(error =>{
  405. this.$util.msg(error.msg,2000);
  406. })
  407. },
  408. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  409. pro.productsChecked = !pro.productsChecked;
  410. if(pro.productsChecked) {
  411. if(!this.submitIds.includes(pro.productID*1)){
  412. this.submitIds.push(pro.productID);
  413. }
  414. } else {
  415. var lent = this.submitIds.indexOf(pro.productID*1);
  416. if(lent >=0 ){
  417. this.submitIds.splice(lent, 1);
  418. }
  419. }
  420. this.updateProductCheckedAllBtn(item);
  421. this.updateCheckAllBtn();
  422. },
  423. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  424. let productsList = item.productsList,
  425. productsCheckedLength = 0,
  426. disabledLength = 0;
  427. if(this.isshowDelbtn) {
  428. productsList.forEach(pros => {
  429. if(pros.productsChecked) {
  430. productsCheckedLength++;
  431. }
  432. })
  433. } else {
  434. productsList.forEach(pros => {
  435. if(pros.productsChecked) {
  436. productsCheckedLength++;
  437. }
  438. })
  439. }
  440. item.checked = productsCheckedLength === productsList.length - disabledLength;
  441. },
  442. updateCheckAllBtn() {// 全选勾选判断
  443. let goodsCheckedLength = 0,
  444. disabledListLength = 0,
  445. goodsList = this.goodsList;
  446. goodsList.forEach(item => {
  447. if(item.checked) {
  448. goodsCheckedLength++;
  449. }
  450. })
  451. this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
  452. },
  453. checkShop(item){//与单选商品类似
  454. item.checked = !item.checked;
  455. this.setProductChecked(item);
  456. this.updateCheckAllBtn();
  457. },
  458. setProductChecked(item) {
  459. item.productsList.forEach(pros=>{
  460. if(item.checked) {
  461. pros.productsChecked = true;
  462. if(!this.submitIds.includes(pros.productID*1)){
  463. this.submitIds.push(pros.productID);
  464. }
  465. } else {
  466. pros.productsChecked = false;
  467. var lent = this.submitIds.indexOf(pros.productID*1);
  468. if(lent >=0 ){
  469. this.submitIds.splice(lent, 1);
  470. }
  471. }
  472. })
  473. },
  474. updateBothCheckBtn() {
  475. if(this.isshowDelbtn) {
  476. // 当管理删除按钮出现时,失效的商品可被选择
  477. this.goodsList.forEach((item)=>{
  478. item.checked = this.isCheckAll;
  479. this.setProductChecked(item);
  480. })
  481. } else {
  482. this.goodsList.forEach((item)=>{
  483. item.checked = this.isCheckAll;
  484. this.setProductChecked(item);
  485. })
  486. }
  487. },
  488. checkAll(){//全选方法内调用方法
  489. this.isCheckAll = !this.isCheckAll;
  490. this.updateBothCheckBtn();
  491. },
  492. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  493. let touchPrice = 0;
  494. let reducedPrice = 0;//商铺合计满减价
  495. this.goodsList.map((item,index)=>{
  496. //计算店铺满减后店铺合计
  497. if(item.promotions && item.promotions.mode == 2){
  498. let prosPrice=0;
  499. let totalOriginalPrice = 0;//商铺合计原价
  500. item.productsList.forEach(pros=>{
  501. prosPrice += pros.retailPrice*pros.productCount
  502. totalOriginalPrice += pros.retailPrice*pros.productCount
  503. })
  504. if(prosPrice >= item.promotions.touchPrice){
  505. item.totalPrice = prosPrice - item.promotions.reducedPrice
  506. item.reducedPrice = item.promotions.reducedPrice
  507. item.totalOriginalPrice = totalOriginalPrice
  508. }else{
  509. item.reducedPrice = 0 //统计合计价格
  510. item.totalPrice = prosPrice
  511. }
  512. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  513. let _totalPrice = 0;
  514. let _reducedPrice = 0;
  515. let _totalOriginalPrice =0;
  516. item.productsList.forEach(pros=>{
  517. let _price = pros.retailPrice*pros.productCount
  518. _totalOriginalPrice += pros.retailPrice*pros.productCount;
  519. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  520. if(_price >= pros.promotions.touchPrice){
  521. _price = _price - pros.promotions.reducedPrice
  522. _reducedPrice += pros.promotions.reducedPrice
  523. }
  524. _totalPrice += _price
  525. }else{
  526. _reducedPrice = 0;
  527. _totalPrice += pros.retailPrice*pros.productCount;
  528. }
  529. })
  530. item.reducedPrice = _reducedPrice
  531. item.totalOriginalPrice = _totalOriginalPrice
  532. item.totalPrice = _totalPrice
  533. }
  534. })
  535. },
  536. totalPeice(){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  537. let totalPrice = 0;
  538. let reducedPrice = 0;
  539. let originalPrice = 0;
  540. this.goodsList.forEach((item,index)=>{
  541. let supplierPrice = 0;
  542. let supplierReducedPrice = 0;
  543. item.totalprice = 0;
  544. item.reducedprice = 0;
  545. item.originalprice = 0;
  546. item.productsList.forEach(pros=>{
  547. if(pros.productsChecked){
  548. supplierPrice += pros.retailPrice*pros.productCount;
  549. // 单品满减
  550. if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
  551. // 单品满减-重新计算供应商总价/满减金额
  552. if(pros.retailPrice*pros.productCount >= pros.promotions.touchPrice){
  553. supplierPrice -= pros.promotions.reducedPrice;
  554. supplierReducedPrice += pros.promotions.reducedPrice;
  555. }
  556. }
  557. }
  558. })
  559. // 店铺满减
  560. if(item.promotions && item.promotions.mode*1===2){
  561. // 店铺满减-计算供应商总价/满减金额
  562. if(supplierPrice >= item.promotions.touchPrice){
  563. supplierPrice -= item.promotions.reducedPrice;
  564. supplierReducedPrice += item.promotions.reducedPrice;
  565. }
  566. }
  567. item.totalprice = supplierPrice;
  568. item.reducedprice = supplierReducedPrice;
  569. item.originalprice = (supplierPrice+supplierReducedPrice);
  570. totalPrice += item.totalprice;
  571. reducedPrice += item.reducedprice;
  572. originalPrice += item.originalprice;
  573. })
  574. //总促销计算
  575. this.promotionsList.forEach(promotions =>{
  576. // 凑单满减
  577. if(promotions.mode*1===2 && promotions.type*1===2){
  578. let total = 0;
  579. promotions.products.forEach(pros=>{
  580. if (this.submitIds.includes(pros.productID*1)){
  581. total += pros.productCount * pros.retailPrice;
  582. }
  583. });
  584. if(total>=promotions.touchPrice){
  585. totalPrice -= promotions.reducedPrice;
  586. reducedPrice += promotions.reducedPrice;
  587. }
  588. }
  589. });
  590. //最后统计商品原价
  591. this.totalOriginalPrice = originalPrice;
  592. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  593. this.reducedPrice = reducedPrice;
  594. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  595. this.allPrice = totalPrice ;
  596. },
  597. totalCount(){//计算总数量
  598. this.allCount = 0
  599. let prosAllCount=0
  600. let validCount = 0
  601. let validList =[];
  602. let productsList =[];
  603. this.goodsList.forEach(item=>{
  604. productsList = item.productsList
  605. productsList.forEach(pros=>{
  606. if(pros.productsChecked){
  607. prosAllCount+=parseInt(pros.productCount);
  608. this.allCount = prosAllCount
  609. }
  610. })
  611. })
  612. },
  613. changeCountAdd(item,pros){//商品数量加加
  614. if(pros.step === 2){
  615. pros.isStep = false
  616. pros.productCount += pros.minBuyNumber
  617. this.processActivityPrice(pros)
  618. this.isStock = false
  619. }else{
  620. pros.productCount++
  621. this.processActivityPrice(pros)
  622. this.isStock = false
  623. }
  624. this.updateShoppogNum(pros)
  625. this.totalShopPeice();
  626. },
  627. changeCountSub(item,pros){//商品数量减减
  628. if(pros.productCount<=pros.minBuyNumber){
  629. pros.productCount= pros.minBuyNumber
  630. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  631. return
  632. }else{
  633. if(pros.step === 2){
  634. pros.isStep = false
  635. pros.productCount -= pros.minBuyNumber
  636. }else{
  637. pros.productCount--
  638. }
  639. this.processActivityPrice(pros)
  640. }
  641. this.updateShoppogNum(pros)
  642. this.totalShopPeice();
  643. },
  644. changeNnmber(e,item,pros){//输入商品数量更新
  645. let _value = e.detail.value;
  646. if(!this.$api.isNumber(_value)){
  647. pros.productCount = pros.minBuyNumber
  648. }else if(_value < pros.minBuyNumber){
  649. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  650. pros.productCount = pros.minBuyNumber
  651. }else if(_value % pros.minBuyNumber != 0){
  652. pros.isStep = true
  653. pros.productCount = pros.minBuyNumber
  654. }else{
  655. pros.isStep = false
  656. pros.productCount = e.detail.value
  657. this.processActivityPrice(pros)
  658. }
  659. this.updateShoppogNum(pros)
  660. this.totalShopPeice();
  661. },
  662. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  663. let ladderPriceList = pros.ladderPriceList;
  664. if(pros.ladderPriceFlag == '1'){
  665. ladderPriceList.forEach((item,index)=>{
  666. if(pros.productCount>=item.buyNum){
  667. pros.retailPrice = item.buyPrice
  668. }
  669. });
  670. }else{
  671. pros.retailPrice = pros.retailPrice
  672. }
  673. },
  674. updateShoppogNum(pros){//加减购物车商品更新到后台
  675. let params ={id:pros.sellerCartId,productID:pros.productID,num:pros.productCount}
  676. this.SellerService.SellerAddProductNum(params).then(response =>{
  677. this.isshowDelbtn = false;
  678. this.initGetCartGoodsList();
  679. }).catch(error =>{
  680. this.$util.msg(error.msg,2000);
  681. })
  682. },
  683. toConfirmation(){//跳转确认订单页面
  684. let setGoodsList=[];
  685. let productIdList = [];
  686. let productID = '';
  687. this.goodsList.forEach(res=>{
  688. let products = res.productsList
  689. products.forEach(pros=>{
  690. if(pros.productsChecked){
  691. setGoodsList.push(pros.productID)
  692. }
  693. })
  694. })
  695. if(setGoodsList == ''){
  696. this.$util.msg("请先选择结算商品~",2000);
  697. return
  698. }else{
  699. /**
  700. * @获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  701. * @获取勾选的商品分类ID拼接字符串格式逗号隔开,最后一个逗号去掉
  702. */
  703. this.goodsList.forEach(el=>{
  704. el.productsList.forEach(pros=>{
  705. if(pros.productsChecked){
  706. productIdList.push(pros.productID)
  707. }
  708. })
  709. })
  710. //判断勾选的商品是否为充值商品或者为定金商品的一些处理逻辑
  711. const isHasDepositlds = productIdList.filter(item =>this.depositIds.includes(item))
  712. const isHasRechargeIds = productIdList.filter(item =>this.rechargeIds.includes(item))
  713. const isGoods= productIdList.every(item =>{ [...this.depositIds,...this.rechargeIds].includes(item)})
  714. if(productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0){
  715. console.log('定金商品')
  716. productIdList.forEach(item =>{
  717. productID += item +','
  718. })
  719. }else if(productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0){
  720. console.log('充值余额商品')
  721. productIdList.forEach(item =>{
  722. productID += item +','
  723. })
  724. }else if(!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0){
  725. console.log('正常商品')
  726. productIdList.forEach(item =>{
  727. productID += item +','
  728. })
  729. }else{
  730. this.$util.modal('提示','缴纳订金商品或余额充值商品请单独下单!','确定','',false,() =>{})
  731. return
  732. }
  733. let cartPramsData={
  734. clubId:this.clubId,
  735. allPrice:this.allPrice,
  736. allCount:this.allCount,
  737. productID:productID.substring(0,productID.lastIndexOf(',')),
  738. productCount:''
  739. }
  740. this.$api.navigateTo(`/seller/pages/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  741. }
  742. },
  743. showDelManager(){//显示删除商品管理
  744. this.isshowDelbtn = true;
  745. if(this.isCheckAll) {
  746. this.updateBothCheckBtn();
  747. } else {
  748. this.updateCheckAllBtn();
  749. }
  750. },
  751. hideDelManage(){//隐藏删除商品管理
  752. this.isshowDelbtn = false;
  753. if(this.isCheckAll) {
  754. this.updateBothCheckBtn();
  755. } else {
  756. this.updateCheckAllBtn();
  757. }
  758. },
  759. deleteList(){//删除购物车商品
  760. this.delGoodsList=[];
  761. this.goodsList.forEach(delitem=>{
  762. let products = delitem.productsList
  763. products.forEach(pros=>{
  764. if(pros.productsChecked){
  765. this.delGoodsList += pros.sellerCartId+','
  766. }
  767. })
  768. })
  769. this.failureList.forEach(failure=>{
  770. if(failure.productsChecked){
  771. this.delGoodsList += failure.sellerCartId+','
  772. }
  773. })
  774. if(this.delGoodsList.length == 0){
  775. this.$util.msg("请选择要删除的商品~",2000);
  776. return
  777. }else{
  778. this.modal = true;
  779. this.contentModalText = '确定删除选中的商品吗?';
  780. }
  781. },
  782. handleClick(e) {//用户操作订单
  783. let index = e.index;
  784. if(index == 1){
  785. this.SellerService.DeleteSellerCart({sellerCartIds:this.delGoodsList}).then(response =>{
  786. this.$util.msg('删除成功',2000);
  787. setTimeout(()=>{
  788. this.isshowDelbtn = false;
  789. this.initGetCartGoodsList();
  790. },2000)
  791. }).catch(error =>{
  792. this.$util.msg(error.msg,2000)
  793. })
  794. }
  795. this.modal = false;
  796. },
  797. goNavto(url){
  798. uni.navigateTo ({
  799. url
  800. })
  801. },
  802. PromotionsFormat(promo){//促销活动类型数据处理
  803. if(promo!=null){
  804. if(promo.type == 1 && promo.mode == 1){
  805. return true
  806. }else{
  807. return false
  808. }
  809. }
  810. return false
  811. },
  812. navToListPage(id){
  813. this.isModallayer = true;
  814. console.log(id)
  815. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  816. },
  817. hideMobel(){
  818. this.modal = false;
  819. },
  820. },
  821. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  822. goodsList:{
  823. deep:true,
  824. handler(val,oldval){
  825. this.totalPeice()
  826. this.totalCount()
  827. }
  828. }
  829. },
  830. onReachBottom() {
  831. if(this.hasNextPage){
  832. this.loadding = true
  833. this.pullUpOn = true
  834. this.getOnReachBottomData()
  835. }
  836. },
  837. onPullDownRefresh() {//下拉刷新
  838. this.initGetCartGoodsList()
  839. uni.stopPullDownRefresh()
  840. },
  841. onShow(){
  842. // this.$api.getComStorage('orderUserInfo').then((resolve) =>{
  843. // console.log(resolve)
  844. // this.clubId = resolve.clubID
  845. // this.againBuyProductIds = resolve.againBuyProductIds
  846. // this.initData()
  847. // })
  848. }
  849. }
  850. </script>
  851. <style lang="scss">
  852. page{
  853. background: #f7f7f7;
  854. }
  855. .cart-content{
  856. position: relative;
  857. padding-bottom:74rpx;
  858. }
  859. .container-cart-main.none{
  860. display: none;
  861. }
  862. .container-cart-main.show{
  863. display: block;
  864. }
  865. .cart-content.empty.none{
  866. display: none;
  867. }
  868. .cart-content.empty.show{
  869. display: block;
  870. }
  871. .container-cart.show{
  872. display: block;
  873. }
  874. .container-cart.none{
  875. display: none;
  876. }
  877. .empty-container.none{
  878. display: none;
  879. }
  880. .empty-container.show{
  881. display: flex;
  882. }
  883. .foot-check-delbtn{
  884. width: 100%;
  885. height: 80rpx;
  886. position: fixed;
  887. top: 0;
  888. left: 0;
  889. box-sizing: border-box;
  890. padding: 15rpx 24rpx;
  891. background-color: #F7F7F7;
  892. z-index: 990;
  893. .foot-text{
  894. font-size: $font-size-26;
  895. height: 50rpx;
  896. line-height: 50rpx;
  897. color: #666666;
  898. float: left;
  899. padding-left: 10rpx;
  900. text{
  901. // color: $color-system;
  902. margin: 0 6rpx;
  903. }
  904. }
  905. .delBtn{
  906. width: 100rpx;
  907. display: inline-block;
  908. padding: 0 15rpx;
  909. font-size: $font-size-26;
  910. height: 50rpx;
  911. line-height: 50rpx;
  912. border-radius: 30rpx;
  913. background:#FFFFFF;
  914. border: 1px solid #333333;
  915. color: $color-system;
  916. float: right;
  917. text-align: center;
  918. &.none{
  919. display: none;
  920. }
  921. }
  922. }
  923. .checkbox-box{
  924. display: flex;
  925. align-items: center;
  926. .checkbox{
  927. display: flex;
  928. margin: 0;
  929. padding: 0;
  930. display: flex;
  931. flex-direction: column;
  932. align-items: center;
  933. box-sizing: border-box;
  934. text-align: center;
  935. text-decoration: none;
  936. border-radius: 0;
  937. -webkit-tap-highlight-color: transparent;
  938. overflow: hidden;
  939. background-color:#FFFFFF;
  940. font-size: 36rpx;
  941. color:#191919;
  942. padding: 5rpx;
  943. &.icon-weixuanze{
  944. color: #b2b2b2;
  945. }
  946. }
  947. &.disabled{
  948. .checkbox{
  949. color:#999999
  950. }
  951. }
  952. .text{
  953. font-size: $font-size-24;
  954. margin-left: 10rpx;
  955. }
  956. }
  957. .goods-list{
  958. width: 100%;
  959. height: auto;
  960. border-top: 1px solid #EBEBEB;
  961. background-color: #F7F7F7;
  962. .goods-item{
  963. width: 702rpx;
  964. padding: 0 24rpx;
  965. background: #FFFFFF;
  966. margin-bottom: 24rpx;
  967. }
  968. .shoptitle{
  969. display: flex;
  970. align-items: center;
  971. height: 80rpx;
  972. line-height: 80rpx;
  973. .checkbox-box{
  974. // padding: 10rpx;
  975. }
  976. .text{
  977. width: 450rpx;
  978. display: block;
  979. overflow: hidden;
  980. text-overflow:ellipsis;
  981. white-space: nowrap;
  982. margin-left: 20rpx;
  983. font-size: $font-size-28;
  984. color: $text-color;
  985. text-align: left;
  986. font-weight: bold;
  987. }
  988. .floor-item-act{
  989. height: 56rpx;
  990. text-align: center;
  991. box-sizing: border-box;
  992. float: left;
  993. padding:10rpx 0;
  994. margin-left: 20rpx;
  995. .floor-tags{
  996. height: 28rpx;
  997. border-radius: 6rpx;
  998. background-color: #FFFFFF;
  999. line-height: 28rpx;
  1000. color: $color-system;
  1001. text-align: center;
  1002. display: inline-block;
  1003. padding:0 16rpx;
  1004. font-size: $font-size-20;
  1005. border: 1px solid #E15616;
  1006. float: right;
  1007. }
  1008. }
  1009. }
  1010. .goods-pros{
  1011. width: 100%;
  1012. height: auto;
  1013. &:last-child{
  1014. .goods-pros-line{
  1015. width: 100%;
  1016. height: 1px;
  1017. box-sizing: border-box;
  1018. padding-left: 65rpx;
  1019. .line{
  1020. height: 1px;
  1021. width: 100%;
  1022. background-color: #FFFFFF;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. .goods-pros-line{
  1028. width: 100%;
  1029. height: 1px;
  1030. box-sizing: border-box;
  1031. padding-left: 65rpx;
  1032. .line{
  1033. height: 1px;
  1034. width: 100%;
  1035. background-color: #e1e1e1;
  1036. }
  1037. }
  1038. .goods-pros-t{
  1039. display: flex;
  1040. align-items: center;
  1041. width: 100%;
  1042. height: auto;
  1043. padding:20rpx 0 20rpx 0;
  1044. .checkbox-box{
  1045. // padding: 10rpx;
  1046. }
  1047. .pros-img{
  1048. width: 210rpx;
  1049. height: 210rpx;
  1050. border-radius: 10rpx;
  1051. margin:0 20rpx;
  1052. border:1px solid #f3f3f3;
  1053. image{
  1054. width: 210rpx;
  1055. height: 210rpx;
  1056. border-radius: 10rpx;
  1057. }
  1058. }
  1059. }
  1060. .goods-pros-b{
  1061. width:100%;
  1062. height: auto;
  1063. padding:0 0 24rpx 0;
  1064. box-sizing: border-box;
  1065. &.show{
  1066. display: block;
  1067. }
  1068. &.none{
  1069. display: none;
  1070. }
  1071. .sum-none{
  1072. width: 100%;
  1073. height: 48rpx;
  1074. line-height: 48rpx;
  1075. color: $text-color;
  1076. float: left;
  1077. text-align: right;
  1078. .money{
  1079. font-size: $font-size-26;
  1080. color: #999999;
  1081. text-decoration: line-through;
  1082. }
  1083. .money-sign{
  1084. font-size: $font-size-26;
  1085. color: #999999;
  1086. text-decoration: line-through;
  1087. }
  1088. .money-reduced{
  1089. margin-left: 10rpx;
  1090. font-size: $font-size-26;
  1091. color: $color-system;
  1092. .iconfont{
  1093. font-size: $font-size-34;
  1094. }
  1095. }
  1096. }
  1097. .sum{
  1098. width: 100%;
  1099. height: 40rpx;
  1100. font-size: $font-size-28;
  1101. line-height: 40rpx;
  1102. color: $text-color;
  1103. float: left;
  1104. display: flex;
  1105. justify-content: flex-end;
  1106. .money{
  1107. color: #FF2A2A;
  1108. font-size: $font-size-28;
  1109. }
  1110. .money-sign{
  1111. font-size: $font-size-24;
  1112. color: #FF2A2A;
  1113. }
  1114. }
  1115. }
  1116. .pros-product{
  1117. width: 386rpx;
  1118. height: 100%;
  1119. line-height: 36rpx;
  1120. font-size: $font-size-26;
  1121. position: relative;
  1122. .producttitle{
  1123. width: 100%;
  1124. display: inline-block;
  1125. height: auto;
  1126. text-overflow:ellipsis;
  1127. display: -webkit-box;
  1128. word-break: break-all;
  1129. -webkit-box-orient: vertical;
  1130. -webkit-line-clamp: 2;
  1131. overflow: hidden;
  1132. margin-bottom: 8rpx;
  1133. .no-text{
  1134. display: inline-block;
  1135. height:36rpx;
  1136. padding: 0 12rpx;
  1137. line-height: 36rpx;
  1138. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1139. border-radius:18rpx;
  1140. text-align: center;
  1141. color: #FFFFFF;
  1142. font-size: $font-size-24;
  1143. margin-right: 24rpx;
  1144. }
  1145. }
  1146. .productspec{
  1147. height: 36rpx;
  1148. color: #999999;
  1149. text-overflow:ellipsis;
  1150. display: -webkit-box;
  1151. word-break: break-all;
  1152. -webkit-box-orient: vertical;
  1153. -webkit-line-clamp: 2;
  1154. overflow: hidden;
  1155. margin-top: 10rpX;
  1156. }
  1157. .productCode{
  1158. color: #666666;
  1159. }
  1160. .productprice{
  1161. width: 100%;
  1162. height: 48rpx;
  1163. margin: 10rpx 0 0 0;
  1164. .price{
  1165. line-height: 48rpx;
  1166. font-size: $font-size-28;
  1167. width: 48%;
  1168. color: #FF2A2A;
  1169. float: left;
  1170. &.disabled{
  1171. color: #999999;
  1172. text-decoration: line-through;
  1173. }
  1174. .money-sign{
  1175. font-size: $font-size-24;
  1176. color: #FF2A2A;
  1177. }
  1178. }
  1179. .count{
  1180. height: 100%;
  1181. float: right;
  1182. position: relative;
  1183. &.show{
  1184. display: block;
  1185. }
  1186. &.none{
  1187. display: none;
  1188. }
  1189. .count-tips{
  1190. width: auto;
  1191. display: inline-block;
  1192. padding: 0 15rpx;
  1193. line-height: 44rpx;
  1194. height: 44rpx;
  1195. border-radius: 22rpx;
  1196. background: $btn-confirm;
  1197. font-size: $font-size-24;
  1198. text-align: center;
  1199. color: #FFFFFF;
  1200. position: absolute;
  1201. top:-60rpx;
  1202. left: -5rpx;
  1203. z-index: 5;
  1204. &.step{
  1205. left:-217rpx
  1206. }
  1207. &::before{
  1208. content: "";
  1209. position: absolute;
  1210. bottom: -30rpx;
  1211. right: 15rpx;
  1212. z-index:1;
  1213. width: 0;
  1214. height: 0;
  1215. border-width: 18rpx;
  1216. border-style: solid;
  1217. border-color:$color-system transparent transparent transparent;
  1218. }
  1219. }
  1220. .number-box{
  1221. display: flex;
  1222. justify-content: center;
  1223. align-items: center;
  1224. border: 2rpx solid #e1e1e1;
  1225. border-radius: 30rpx;
  1226. height: 48rpx;
  1227. .iconfont{
  1228. font-size: $font-size-24;
  1229. padding:0 12rpx;
  1230. color: #333333;
  1231. text-align: center;
  1232. line-height: 48rpx;
  1233. font-weight: bold;
  1234. background: #FFFFFF;
  1235. &.icon-jianhao{
  1236. border-radius: 30rpx 0 0 30rpx;
  1237. }
  1238. &.icon-jiahao{
  1239. border-radius: 0 30rpx 30rpx 0;
  1240. }
  1241. }
  1242. .btn-input{
  1243. width: 56rpx;
  1244. height: 44rpx;
  1245. line-height: 44rpx;
  1246. border-radius: 4rpx;
  1247. text-align: center;
  1248. font-size: $font-size-24;
  1249. color: #333333;
  1250. background-color: #f7f7f7;
  1251. }
  1252. }
  1253. .uni-numbox{
  1254. position: absolute;
  1255. left: 45rpx;
  1256. bottom: 0;
  1257. .uni-numbox-minus, .uni-numbox-plus{
  1258. width: 50rpx;
  1259. line-height: 40rpx;
  1260. }
  1261. .uni-numbox-value {
  1262. font-size: $font-size-28;
  1263. width: 60rpx;
  1264. }
  1265. }
  1266. }
  1267. }
  1268. .floor-item-act{
  1269. width: 100%;
  1270. height: 56rpx;
  1271. text-align: center;
  1272. box-sizing: border-box;
  1273. float: left;
  1274. padding:0 0 10rpx 0;
  1275. margin-left: 10rpx;
  1276. .floor-tags{
  1277. height: 28rpx;
  1278. border-radius: 6rpx;
  1279. background-color: #FFFFFF;
  1280. line-height: 28rpx;
  1281. color: $color-system;
  1282. text-align: center;
  1283. display: inline-block;
  1284. padding:0 16rpx;
  1285. font-size: $font-size-20;
  1286. border: 1px solid #E15616;
  1287. float: left;
  1288. }
  1289. }
  1290. }
  1291. }
  1292. .footer{
  1293. width: 100%;
  1294. background-color: #FFFFFF;
  1295. height: 110rpx;
  1296. position: fixed;
  1297. bottom: 0rpx;
  1298. z-index: 100;
  1299. .footer-le{
  1300. width: 510rpx;
  1301. height: 100%;
  1302. padding:0 24rpx;
  1303. float: left;
  1304. .foot-check{
  1305. width: 100rpx;
  1306. float: left;
  1307. line-height: 110rpx;
  1308. font-size: $font-size-24;
  1309. .checkbox{
  1310. width: 40rpx;
  1311. text-align: center;
  1312. }
  1313. .text{
  1314. width: 60rpx;
  1315. float: right;
  1316. }
  1317. }
  1318. .sum{
  1319. width: 380rpx;
  1320. height: 110rpx;
  1321. float: right;
  1322. box-sizing: border-box;
  1323. padding: 10rpx;
  1324. .sum-none{
  1325. width: 100%;
  1326. height: 45rpx;
  1327. line-height: 45rpx;
  1328. color: $text-color;
  1329. float: left;
  1330. text-align: right;
  1331. .money{
  1332. font-size: $font-size-24;
  1333. color: #999999;
  1334. text-decoration: line-through;
  1335. }
  1336. .money-sign{
  1337. font-size: $font-size-24;
  1338. color: #999999;
  1339. text-decoration: line-through;
  1340. }
  1341. .money-reduced{
  1342. margin-left: 10rpx;
  1343. font-size: $font-size-24;
  1344. color: $color-system;
  1345. }
  1346. }
  1347. .sum-price{
  1348. text-align: right;
  1349. width: 100%;
  1350. height: 45rpx;
  1351. line-height: 45rpx;
  1352. font-size: $font-size-30;
  1353. color: $text-color;
  1354. float: left;
  1355. font-weight: normal;
  1356. &.none{
  1357. height: 90rpx;
  1358. line-height: 90rpx;
  1359. }
  1360. .money{
  1361. color: #FF2A2A;
  1362. }
  1363. .money-sign{
  1364. font-size: $font-size-24;
  1365. color: #FF2A2A;
  1366. }
  1367. }
  1368. }
  1369. }
  1370. .footer-ri{
  1371. width: 180rpx;
  1372. height: 84rpx;
  1373. background:#ff2a2a;
  1374. float: right;
  1375. display: flex;
  1376. justify-content: space-between;
  1377. align-items: center;
  1378. z-index: 999;
  1379. border-radius: 49rpx;
  1380. margin-top: 15rpx;
  1381. margin-right: 10rpx;
  1382. &.none{
  1383. display: none;
  1384. }
  1385. .btn{
  1386. width: 200rpx;
  1387. height: 100%;
  1388. font-size: $font-size-28;
  1389. line-height: 110rpx;
  1390. color: #FFFFFF;
  1391. display: flex;
  1392. justify-content: center;
  1393. align-items: center;
  1394. }
  1395. }
  1396. .footer-del{
  1397. width: 400rpx;
  1398. height: 110rpx;
  1399. position: absolute;
  1400. padding-left: 200rpx;
  1401. background: #FFFFFF;
  1402. right: 0;
  1403. top: 0;
  1404. z-index: 1000;
  1405. &.show{
  1406. animation: showDelbtn 0s linear both;
  1407. }
  1408. &.none{
  1409. animation: hideDelbtn 0s linear both;
  1410. }
  1411. .btn{
  1412. width: 50%;
  1413. height: 100%;
  1414. line-height: 110rpx;
  1415. font-size: $font-size-28;
  1416. color: #FFFFFF;
  1417. text-align: center;
  1418. float: left;
  1419. }
  1420. .btn.btn-cancel{
  1421. background:#EEC1AB;
  1422. }
  1423. .btn.btn-confirm{
  1424. background:#FF2A2A;
  1425. }
  1426. @keyframes showDelbtn {
  1427. 0% {
  1428. transform: translateX(0);
  1429. }
  1430. 100% {
  1431. transform: translateX(-100%);
  1432. }
  1433. }
  1434. @keyframes hideDelbtn {
  1435. 0% {
  1436. transform: translateX(-100%);
  1437. }
  1438. 100% {
  1439. transform: translateX(0);
  1440. }
  1441. }
  1442. }
  1443. }
  1444. .failure-list{
  1445. width: 702rpx;
  1446. height: auto;
  1447. padding: 0 24rpx;
  1448. margin-top: 20rpx;
  1449. background: #FFFFFF;
  1450. .failure-title{
  1451. width: 100%;
  1452. height: 82rpx;
  1453. line-height: 82rpx;
  1454. font-size: $font-size-28;
  1455. .title-txt{
  1456. float: left;
  1457. color:#666666;
  1458. text-align: left;
  1459. }
  1460. .title-btn{
  1461. float: right;
  1462. color: $color-system;
  1463. text-align: right;
  1464. line-height: 80rpx;
  1465. .butto{
  1466. display: inline-block;
  1467. padding: 0 15rpx;
  1468. font-size: $font-size-26;
  1469. height: 50rpx;
  1470. line-height: 50rpx;
  1471. border-radius: 30rpx;
  1472. background:#FFFFFF;
  1473. // border: 1px solid #C9C9C9;
  1474. // color: #999999;
  1475. margin-top: 15rpx;
  1476. }
  1477. }
  1478. }
  1479. .productlist{
  1480. padding-top: 10rpx;
  1481. .goods-pros{
  1482. width: 100%;
  1483. height: auto;
  1484. padding: 20rpx 0;
  1485. }
  1486. .goods-pros-t{
  1487. display: flex;
  1488. align-items: center;
  1489. width: 100%;
  1490. height: 210rpx;
  1491. position: relative;
  1492. .img-tip{
  1493. display: block;
  1494. width: 72rpx;
  1495. height: 36rpx;
  1496. line-height: 36rpx;
  1497. font-size: $font-size-24;
  1498. text-align: center;
  1499. color: #FFFFFF;
  1500. border-radius: 24rpx;
  1501. background:rgba(51,51,51,0.3);
  1502. }
  1503. .checkbox-box{
  1504. // padding: 10rpx;
  1505. }
  1506. .pros-img{
  1507. width: 180rpx;
  1508. height: 100%;
  1509. border-radius: 10rpx;
  1510. margin:0 20rpx;
  1511. border:1px solid #f3f3f3;
  1512. position: relative;
  1513. image{
  1514. width: 100%;
  1515. height: 100%;
  1516. border-radius: 10rpx;
  1517. }
  1518. }
  1519. .pros-marks{
  1520. width: 750rpx;
  1521. height: 250rpx;
  1522. z-index: 90;
  1523. background: rgba(0,0,0,.05);
  1524. position: absolute;
  1525. left:-20rpx;
  1526. top: -20rpx;
  1527. }
  1528. }
  1529. .goods-pros-b{
  1530. width:622rpx;
  1531. margin-left: 84rpx;
  1532. height: 40rpx;
  1533. padding:0 0 26rpx 0;
  1534. // border-top: 1px solid #EBEBEB;
  1535. &.show{
  1536. display: block;
  1537. }
  1538. &.none{
  1539. display: none;
  1540. }
  1541. .sum{
  1542. font-size: $font-size-28;
  1543. line-height: 40rpx;
  1544. color: $text-color;
  1545. display: flex;
  1546. justify-content: flex-end;
  1547. .money{
  1548. color: #FF2A2A;
  1549. font-size: $font-size-28;
  1550. }
  1551. .money-sign{
  1552. font-size: $font-size-24;
  1553. color: #FF2A2A;
  1554. }
  1555. }
  1556. }
  1557. .pros-product{
  1558. width: 402rpx;
  1559. height: 100%;
  1560. line-height: 36rpx;
  1561. font-size: $font-size-28;
  1562. position: relative;
  1563. .producttitle{
  1564. width: 100%;
  1565. display: inline-block;
  1566. height: auto;
  1567. text-overflow:ellipsis;
  1568. display: -webkit-box;
  1569. word-break: break-all;
  1570. -webkit-box-orient: vertical;
  1571. -webkit-line-clamp: 2;
  1572. overflow: hidden;
  1573. margin-bottom: 8rpx;
  1574. .no-text{
  1575. display: inline-block;
  1576. height:36rpx;
  1577. padding: 0 12rpx;
  1578. line-height: 36rpx;
  1579. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1580. border-radius:18rpx;
  1581. text-align: center;
  1582. color: #FFFFFF;
  1583. font-size: $font-size-28;
  1584. margin-right: 24rpx;
  1585. }
  1586. }
  1587. .productspec{
  1588. height: 36rpx;
  1589. color: #999999;
  1590. font-size: $font-size-26;
  1591. margin-top: 20rpx;
  1592. }
  1593. .productstate{
  1594. font-size: $font-size-28;
  1595. height: 44rpx;
  1596. color: #FF2A2A;
  1597. position: absolute;
  1598. bottom: 0;
  1599. left: 0;
  1600. }
  1601. }
  1602. }
  1603. }
  1604. </style>