promoDetail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  1. <template>
  2. <view class="video-pagesCons">
  3. <view class="tab-search">
  4. <u-search placeholder="请输入产品名称/轮胎规格" shape="round" :clearabled="true" show-action v-model="queryWord" @clear="pageInit" @search="pageInit" @custom="pageInit"></u-search>
  5. </view>
  6. <view class="tab-body">
  7. <!-- <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom"> -->
  8. <view class="product-list" v-if="list.length">
  9. <view
  10. class="check-order-list"
  11. v-for="(item,index) in list"
  12. :key="item.id"
  13. >
  14. <view class="video-item">
  15. <view>
  16. <u-image :src="item.productImage+'?x-oss-process=image/resize,p_50'" height="140px" width="100%"></u-image>
  17. <view class="back-price" v-if="item.promoRuleValue">返<text>{{item.promoRuleValue}}</text>元</view>
  18. <view class="product-code">{{item.productCode}}</view>
  19. </view>
  20. <view>
  21. <view class="product-name">{{item.productName}}</view>
  22. <view class="product-guige ellipsis-two">{{item.productOrigCode}}</view>
  23. <view class="product-button">
  24. <view class="price-txt">¥<text>{{item.cost}}</text></view>
  25. <view @click="chooseProduct(item)">
  26. <!-- <view class="cart-add" :class="!item.checked?'colr-add':'colr-checks'">
  27. <u-icon v-if="!item.checked" color="#fff" name="plus"></u-icon>
  28. <view v-else>
  29. <u-icon name="plus" color="#fff"></u-icon>{{item.qty}}
  30. </view>
  31. </view> -->
  32. <u-button v-if="!item.checked" :throttle-time="50" @click="chooseProduct(item)" size="mini" type="primary" shape="circle"><u-icon name="plus"></u-icon></u-button>
  33. <u-button v-else :throttle-time="50" @click="chooseProduct(item)" size="mini" type="success" shape="circle"><u-icon name="plus"></u-icon>{{item.qty}}</u-button>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view style="padding: 20upx;">
  41. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  42. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  43. </view>
  44. <!-- </scroll-view> -->
  45. </view>
  46. <!-- 底部栏 -->
  47. <view class="bottom-bar" @click="clearAction" v-if="total>0">
  48. <view class="bottom-bar-left">
  49. <view class="bottom-bar-left-item">
  50. <view class="bottom-bar-left-item-icon" @click="openChoose">
  51. <u-icon name="shopping-cart" size="40"></u-icon>
  52. <u-badge type="error" :count="totalNum" :offset="[-7,-8]"></u-badge>
  53. </view>
  54. </view>
  55. <view class="bottom-bar-left-item" v-if="showChoosePopu">
  56. 合计:<view class="price-txt">¥<text>{{totalAmount}}</text></view>
  57. </view>
  58. </view>
  59. <view :class="'bottom-bar-right bg-'+(showChoosePopu?'1':'0')" @click="submitOrder">
  60. <view class="bottom-bar-right-item">{{showChoosePopu?'确认采购':'去结算'}}</view>
  61. </view>
  62. </view>
  63. <!-- 分页 -->
  64. <view class="pages-box" v-if="showPage">
  65. <uni-pages-nav :totalPages="totalPages" :currentPage="pageNo" @pagechanged="pagechanged"></uni-pages-nav>
  66. </view>
  67. <!-- 已选列表 -->
  68. <page-container
  69. :show="showChoosePopu"
  70. :round="true"
  71. position="bottom"
  72. custom-style="height:90%"
  73. @enter="openRender"
  74. @afterleave="closePopu">
  75. <scroll-view :style="{width:screenWidth + 'px',height:'100%'}" scroll-y="true">
  76. <view class="choose-title">
  77. <view class="flex align_center">
  78. <view>已选<text class="p-nums">{{chooseLength}}</text>款产品 </view>
  79. <u-button @click="claerChoose" size="mini" type="error" plain style="margin: 0 20upx;">清空列表</u-button>
  80. <text class="choose-inf">左滑删除产品</text>
  81. </view>
  82. <view class="choose-close" @click="showChoosePopu=false">
  83. <u-icon name="close" size="30"></u-icon>
  84. </view>
  85. </view>
  86. <view class="choose-product-list" v-if="showSwipeAction">
  87. <u-swipe-action
  88. :show="item.show"
  89. v-for="(item, index) in chooseProductList"
  90. :index="item.id"
  91. :key="item.id"
  92. @click="chooseClick"
  93. @open="chooseOpen"
  94. :options="chooseOptions"
  95. >
  96. <view class="choose-product-item" :style="{width:(screenWidth-20) + 'px'}">
  97. <view>
  98. <view class="choose-product-item-img">
  99. <u-image :src="item.productImage+'?x-oss-process=image/resize,p_50'" height="200rpx" width="100%"></u-image>
  100. <view class="back-price" v-if="item.promoRuleValue">返<text>{{item.promoRuleValue}}</text>元</view>
  101. <view class="choose-product-item-left-info-code">{{item.productCode}}</view>
  102. </view>
  103. <view class="choose-product-item-info">
  104. <view class="choose-product-item-left-info-name">{{item.productName}}</view>
  105. <view class="choose-product-item-left-info-guige ellipsis-two">{{item.productOrigCode}}</view>
  106. <view class="choose-product-item-left-info-price">
  107. <view class="price-txt">¥<text>{{item.cost}}</text></view>
  108. <view>
  109. <u-number-box v-model="item.qty" :index="item.id" :input-width="60" :input-height="60" size="mini" :min="1" @change="changeQty"></u-number-box>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </u-swipe-action>
  116. <!-- 分页 -->
  117. <view class="choose-product-pages" v-if="totalSelPages>1">
  118. <uni-pages-nav :totalPages="totalSelPages" :showShadow="false" :currentPage="choosePageNo" @pagechanged="onreachPopuBottom"></uni-pages-nav>
  119. </view>
  120. </view>
  121. </scroll-view>
  122. </page-container>
  123. </view>
  124. </template>
  125. <script>
  126. import {
  127. mapState,
  128. mapMutations,
  129. } from 'vuex'
  130. import { queryPromoProductByPage } from '@/api/video.js'
  131. import { purchaseSave } from '@/api/purchase.js'
  132. export default {
  133. data() {
  134. return {
  135. status: 'loading',
  136. noDataText: '暂无数据',
  137. queryWord: '',// 关键词查询列表
  138. // 查询条件
  139. pageNo: 1, // 当前页
  140. pageSize: 24,//每页条数
  141. list: [], // 产品列表
  142. total: 0, // 总记录
  143. showChoosePopu: false,//已选列表弹框
  144. chooseList:[], // 已选数据
  145. chooseProductList:[], // 已选弹框中当前数据
  146. chooseOptions:[
  147. {
  148. text: '删除',
  149. style: {
  150. backgroundColor: '#dd524d'
  151. }
  152. }
  153. ], // 左滑删除已选产品
  154. screenWidth: 750, // 屏幕宽度
  155. showSwipeAction: false, // 已选弹框是否一打开
  156. choosePageNo: 1, // 已选产品当前页
  157. choosePageSize: 6, // 已选产品每页数
  158. chooseTotal: 0 ,// 已选产品总记录数
  159. promoActiveSn: null, // 活动sn
  160. submitOk: false,
  161. // 分页
  162. showPage: false,
  163. maxScrollTop: 0
  164. }
  165. },
  166. computed: {
  167. ...mapState(['hasLogin']),
  168. userInfo(){
  169. return this.$store.state.vuex_userInfo
  170. },
  171. // 已选产品总款数
  172. chooseLength(){
  173. return this.chooseList.length
  174. },
  175. // 已选产品总金额
  176. totalAmount(){
  177. let total = 0
  178. this.chooseList.forEach(key => {
  179. total = total + key.cost * key.qty
  180. })
  181. return total.toFixed(2)
  182. },
  183. // 已选产品总数量
  184. totalNum(){
  185. let total = 0
  186. this.chooseList.forEach(key => {
  187. total = total + key.qty
  188. })
  189. return total
  190. },
  191. // 总页数
  192. totalPages(){
  193. return Math.ceil(this.total / this.pageSize)
  194. },
  195. // 已选产品分页总数
  196. totalSelPages(){
  197. return Math.ceil(this.chooseTotal/this.choosePageSize)
  198. }
  199. },
  200. onLoad(opts) {
  201. uni.setNavigationBarTitle({
  202. title: opts.title||'促销活动产品'
  203. })
  204. this.screenWidth = uni.getSystemInfoSync().windowWidth
  205. this.$store.state.vuex_tempData = null
  206. this.promoActiveSn = opts.promoActiveSn
  207. // 购物车是否有缓存
  208. const cacheList = this.$store.state.vuex_cartList.find(k => k.sn == this.promoActiveSn)
  209. this.chooseList = cacheList ? JSON.parse(JSON.stringify(cacheList.list)) : []
  210. // 查询产品列表
  211. this.pageInit()
  212. },
  213. onShow() {
  214. this.showChoosePopu=false
  215. },
  216. onUnload() {
  217. // 存储已选列表值
  218. const hasCache = this.$store.state.vuex_cartList.find(k => k.sn == this.promoActiveSn)
  219. if(hasCache){
  220. hasCache.list = this.chooseList
  221. }else{
  222. this.$store.state.vuex_cartList.push({sn:this.promoActiveSn,list: this.chooseList})
  223. }
  224. this.$u.vuex('vuex_cartList', this.$store.state.vuex_cartList)
  225. // 清空数据
  226. this.chooseList = null
  227. this.list = null
  228. },
  229. // 到底部加载更多
  230. onReachBottom() {
  231. this.showPage = true
  232. if(this.list.length < this.total){
  233. // this.pageNo += 1
  234. // this.getRow()
  235. }else{
  236. this.status = "nomore"
  237. }
  238. },
  239. onPageScroll(e){
  240. if(this.showPage && this.maxScrollTop == 0){
  241. this.maxScrollTop = e.scrollTop
  242. }
  243. // console.log(this.maxScrollTop , e.scrollTop)
  244. if(this.showPage && this.maxScrollTop>0 && (e.scrollTop < (this.maxScrollTop/10)*9)){
  245. this.showPage = false
  246. }
  247. // 最后一页显示
  248. if(this.pageNo >= this.totalPages){
  249. this.showPage = true
  250. }
  251. },
  252. methods: {
  253. pagechanged(page){
  254. this.pageNo = page
  255. this.getRow()
  256. },
  257. // 初始化页面
  258. pageInit(){
  259. // 重置分页
  260. this.total = 0
  261. this.pageNo = 1
  262. this.list = []
  263. // 获取列表数据
  264. this.getRow()
  265. },
  266. // 添加已选产品
  267. chooseProduct(item){
  268. if(!item.checked){
  269. item.checked = true
  270. item.qty = 1
  271. item.show = false
  272. this.chooseList.unshift(this.$u.deepClone(item))
  273. }else{
  274. item.qty = item.qty + 1
  275. // 已添加,则增加数量
  276. const row = this.chooseList.find(key => key.id == item.id)
  277. if(row){
  278. row.qty = row.qty + 1
  279. }
  280. this.chooseList.splice()
  281. }
  282. },
  283. // 渲染已选产品列表
  284. openRender(){
  285. setTimeout(()=>{
  286. this.showSwipeAction = true
  287. },100)
  288. },
  289. // 关闭已选列表弹框
  290. closePopu(){
  291. this.chooseProductList = []
  292. this.showChoosePopu=false
  293. if(this.submitOk){
  294. uni.hideLoading()
  295. uni.navigateTo({
  296. url: "/pagesB/procureOrder"
  297. })
  298. }
  299. },
  300. // 打开已选产品列表
  301. openChoose(){
  302. this.submitOk = false
  303. if(this.chooseLength){
  304. this.showChoosePopu = !this.showChoosePopu
  305. if(this.showChoosePopu){
  306. console.log(this.chooseList)
  307. // 默认加载第一页数据
  308. this.chooseTotal = this.chooseList.length
  309. this.choosePageNo = 0
  310. // this.onreachPopuBottom()
  311. this.onreachPopuBottom(1)
  312. }
  313. }else{
  314. this.$u.toast(`请选择产品`);
  315. }
  316. },
  317. // 已选产品滚动到底部
  318. onreachPopuBottom(pages){
  319. console.log(pages)
  320. this.chooseProductList = []
  321. console.log(pages,this.totalSelPages)
  322. // if(this.choosePageNo>=this.totalSelPages){
  323. // return
  324. // }
  325. uni.showLoading({
  326. title: '加载中',
  327. mask: true
  328. })
  329. // this.choosePageNo = this.choosePageNo + 1
  330. this.choosePageNo = pages
  331. const start = (this.choosePageNo-1)*this.choosePageSize
  332. const end = this.choosePageNo*this.choosePageSize
  333. const list = this.chooseTotal > this.choosePageSize ? this.chooseList.slice(start,end>this.chooseTotal?this.chooseTotal:end) : this.chooseList
  334. // this.chooseProductList = this.chooseProductList.concat(list)
  335. this.chooseProductList = list
  336. // this.chooseProductList.splice()
  337. this.$nextTick(()=>{
  338. uni.hideLoading()
  339. })
  340. },
  341. // 已选产品变更数量
  342. changeQty(e){
  343. const _this = this
  344. const rowIndex = this.chooseProductList.findIndex(key => key.id == e.index)
  345. if(e.value>0){
  346. this.chooseProductList[rowIndex].qty = e.value
  347. // 更新原始数据
  348. const rindex = this.chooseList.findIndex(key => key.id == e.index)
  349. if(rindex>=0){
  350. this.chooseList[rindex].qty = e.value
  351. this.chooseList.splice()
  352. }
  353. // 更新页面产品数据
  354. const aindex = this.list.findIndex(key => key.id == e.index)
  355. if(aindex>=0){
  356. this.list[aindex].qty = e.value
  357. this.list.splice()
  358. }
  359. }else{
  360. // 数量为0时,删除
  361. // this.chooseClick(e.index,0)
  362. }
  363. },
  364. //已选产品删除
  365. chooseClick(index, btns){
  366. if(btns == 0) {
  367. // 更新列表已选状态
  368. const row = this.list.find(item => item.id == index)
  369. if(row){
  370. row.checked = false
  371. row.qty = 0
  372. }
  373. const rindex = this.chooseProductList.findIndex(item => item.id == index)
  374. if(rindex>=0){
  375. this.chooseProductList.splice(rindex, 1);
  376. // this.chooseList.splice(rindex, 1);
  377. }
  378. const aindex = this.chooseList.findIndex(item => item.id == index)
  379. if(aindex>=0){
  380. this.chooseList.splice(aindex, 1);
  381. }
  382. // 重新计算分页,并更新当前页
  383. this.chooseTotal = this.chooseList.length
  384. this.onreachPopuBottom(this.choosePageNo>this.totalSelPages?this.totalSelPages:this.choosePageNo)
  385. // 如果数量小于每页数量,自动加载下一页
  386. // if(this.chooseProductList.length < this.choosePageSize){
  387. // this.onreachPopuBottom()
  388. // }
  389. // 如果没有数据了
  390. if(this.chooseTotal==0){
  391. this.clearChooseData()
  392. }
  393. this.$u.toast(`删除成功!`);
  394. }
  395. },
  396. // 同时打开一个
  397. chooseOpen(index){
  398. // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
  399. // 原本为'false',再次设置为'false'会无效
  400. const row = this.chooseProductList.find(item => item.id == index)
  401. if(row) {
  402. row.show = true
  403. }
  404. this.chooseProductList.map((item, idx) => {
  405. if(index != item.id) this.chooseProductList[idx].show = false;
  406. })
  407. },
  408. // 清除滑动按钮
  409. clearAction(){
  410. this.chooseProductList.map(item => {
  411. item.show = false
  412. })
  413. this.chooseProductList.splice()
  414. },
  415. // 确定清空已选列表
  416. claerChoose(){
  417. const _this = this
  418. uni.showModal({
  419. title: '提示',
  420. content: '确定清空已选列表?',
  421. confirmText: '确定',
  422. success(res) {
  423. if(res.confirm){
  424. _this.clearChooseData()
  425. }
  426. }
  427. })
  428. },
  429. // 清空已选数据
  430. clearChooseData(){
  431. this.chooseList = []
  432. this.chooseProductList = []
  433. this.showChoosePopu = false
  434. // nav.navigateBack()
  435. // 重置已选状态
  436. this.list.filter(item => item.checked).map(item=>{
  437. item.checked = false
  438. item.qty = 0
  439. })
  440. },
  441. // 查询列表
  442. getRow () {
  443. let _this = this
  444. let params = {
  445. pageNo: this.pageNo,
  446. pageSize: this.pageSize,
  447. queryWord: this.queryWord,
  448. promoActiveSn: this.promoActiveSn
  449. }
  450. this.status = "loading"
  451. uni.showLoading({
  452. title: '加载中',
  453. mask: true
  454. })
  455. queryPromoProductByPage(params).then(res => {
  456. if (res.code == 200 || res.status == 204 || res.status == 200) {
  457. const list = res.data.list||[]
  458. const ret = []
  459. // 更新已选状态
  460. list.map(k => {
  461. // 如果筛选或分页后,更新页面列表产品数量
  462. const hasChecked = this.chooseList.find(s=>s.id == k.id)
  463. ret.push({
  464. id: k.id,
  465. cost: k.cost,
  466. checked: hasChecked,
  467. qty: hasChecked ? hasChecked.qty : 0,
  468. productCode: k.productCode,
  469. productSn: k.productSn,
  470. productImage: k.productImage,
  471. productName: k.productName,
  472. productOrigCode: k.productOrigCode,
  473. promoActiveSn: k.promoActiveSn,
  474. promoRuleSn: k.promoRuleSn,
  475. promoRuleValue: k.promoRuleValue,
  476. promoRuleType: k.promoRuleType,
  477. show: false
  478. })
  479. })
  480. // _this.list = _this.list.concat(ret)
  481. _this.list = ret
  482. _this.total = res.data.count || 0
  483. } else {
  484. _this.list = []
  485. _this.total = 0
  486. _this.noDataText = res.message
  487. }
  488. // 滚动到顶部
  489. _this.$nextTick(()=>{
  490. _this.showPage = false
  491. uni.pageScrollTo({
  492. scrollTop: 0,
  493. duration: 300
  494. });
  495. uni.hideLoading()
  496. })
  497. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  498. })
  499. },
  500. // 提交订单
  501. submitOrder(){
  502. if(this.showChoosePopu){
  503. uni.showLoading({
  504. title: '提交中...',
  505. mask: true
  506. })
  507. const detailList = []
  508. this.chooseList.map(item => {
  509. detailList.push({
  510. promoActiveSn: this.promoActiveSn,
  511. promoRuleSn:item.promoRuleSn,
  512. productSn:item.productSn,
  513. productCode:item.productCode,
  514. qty:item.qty,
  515. price:item.cost,
  516. giveAmount:item.promoRuleValue
  517. })
  518. })
  519. purchaseSave({
  520. promoActiveSn: this.promoActiveSn,
  521. detailList: detailList
  522. }).then(res => {
  523. if(res.status == 200){
  524. res.data.detailList = []
  525. this.$store.state.vuex_tempData = res.data
  526. this.clearChooseData()
  527. this.submitOk = true
  528. }else{
  529. uni.showToast({
  530. title: res.message,
  531. icon: 'none'
  532. })
  533. }
  534. })
  535. }else{
  536. this.openChoose()
  537. }
  538. },
  539. }
  540. }
  541. </script>
  542. <style lang="less">
  543. page{
  544. height: 100vh;
  545. .pages-box{
  546. position: fixed;
  547. left: 10%;
  548. bottom: 150rpx;
  549. z-index: 90;
  550. width: 80%;
  551. display: flex;
  552. justify-content: center;
  553. align-items: center;
  554. }
  555. }
  556. .video-pagesCons{
  557. height: 100vh;
  558. position: relative;
  559. .tab-search{
  560. padding: 15rpx 20rpx;
  561. background: #fff;
  562. position: fixed;
  563. top:0;
  564. left:0;
  565. width:100%;
  566. z-index:20;
  567. }
  568. .tab-body{
  569. display: flex;
  570. flex-direction: column;
  571. flex-grow: 1;
  572. padding: 90rpx 0 170rpx 0;
  573. .product-list{
  574. display: flex;
  575. flex-wrap: wrap;
  576. }
  577. .check-order-list{
  578. width: 50%;
  579. padding: 10upx;
  580. .video-item{
  581. background: #ffffff;
  582. border-radius: 10upx;
  583. box-shadow: 1px 1px 3px #EEEEEE;
  584. height: 100%;
  585. display: flex;
  586. flex-direction: column;
  587. > view{
  588. &:first-child{
  589. position: relative;
  590. overflow: hidden;
  591. border-bottom: 1px solid #eee;
  592. .product-code{
  593. color: #666;
  594. position: absolute;
  595. width: 100%;
  596. left:0;
  597. bottom:0;
  598. background: rgba(255,255,255,0.7);
  599. text-align: center;
  600. }
  601. }
  602. &:last-child{
  603. padding: 20rpx 20rpx 70rpx 20rpx;
  604. position: relative;
  605. flex-grow: 1;
  606. .product-name{
  607. font-size: 28rpx;
  608. font-weight: 900;
  609. color: #666;
  610. }
  611. .product-guige{
  612. margin: 10rpx 0 20rpx 0;
  613. color: #2196F3;
  614. text{
  615. margin-right: 10rpx;
  616. }
  617. }
  618. }
  619. .product-button{
  620. display: flex;
  621. justify-content: space-between;
  622. align-items: center;
  623. position: absolute;
  624. bottom: 20rpx;
  625. left: 0;
  626. width: 100%;
  627. padding: 0 20rpx;
  628. }
  629. .cart-add{
  630. padding: 6rpx 15rpx;
  631. border-radius: 30rpx;
  632. background: #2196F3;
  633. color: #fff;
  634. display: flex;
  635. align-items: center;
  636. justify-content: center;
  637. font-size: 24rpx;
  638. }
  639. .colr-add{
  640. background: #2196F3;
  641. padding: 10rpx 20rpx;
  642. }
  643. .colr-checks{
  644. background: #00aa00;
  645. }
  646. }
  647. }
  648. }
  649. }
  650. .bottom-bar{
  651. height: 130upx;
  652. z-index: 200;
  653. background-color: #fff;
  654. display: flex;
  655. align-items: center;
  656. justify-content: space-between;
  657. font-size: 32upx;
  658. position: fixed;
  659. bottom:0;
  660. left:0;
  661. width:100%;
  662. .bottom-bar-left{
  663. padding: 0 30upx;
  664. flex-grow: 1;
  665. display: flex;
  666. align-items: center;
  667. }
  668. .bottom-bar-left-item{
  669. padding-right: 20rpx;
  670. font-size: 24rpx;
  671. display: flex;
  672. align-items: center;
  673. }
  674. .bottom-bar-left-item-icon{
  675. position: relative;
  676. background: #2196F3;
  677. padding: 20rpx;
  678. border-radius: 100%;
  679. color: #fff;
  680. }
  681. .bottom-bar-right{
  682. padding: 0 50rpx;
  683. height: 100%;
  684. background: #2196F3;
  685. display: flex;
  686. align-items: center;
  687. .bottom-bar-right-item{
  688. color: #fff;
  689. }
  690. }
  691. .bg-0{
  692. background: #2196F3;
  693. }
  694. .bg-1{
  695. background: #f44336;
  696. }
  697. }
  698. .price-txt{
  699. color: red;
  700. text{
  701. font-size: 36rpx;
  702. }
  703. }
  704. .choose-title{
  705. display: flex;
  706. align-items:center;
  707. justify-content: space-between;
  708. padding: 0 25rpx;
  709. position: fixed;
  710. background: #fff;
  711. width: 100%;
  712. z-index: 3;
  713. border-bottom: 1px solid #eee;
  714. border-radius: 40rpx 40rpx 0 0;
  715. > view{
  716. padding: 25rpx 0;
  717. }
  718. .p-nums{
  719. color: #2196F3;
  720. margin: 0 6rpx;
  721. }
  722. .choose-inf{
  723. color: #999;
  724. font-size: 24rpx;
  725. }
  726. .choose-close{
  727. padding: 25rpx 20rpx;
  728. }
  729. }
  730. .choose-product-pages{
  731. padding: 10rpx;
  732. display: flex;
  733. justify-content: center;
  734. position: absolute;
  735. left: 0;
  736. bottom: 150rpx;
  737. z-index: 20;
  738. width: 100%;
  739. }
  740. .choose-product-list{
  741. padding: 100rpx 20rpx 280rpx;
  742. width: 100%;
  743. position: relative;
  744. .choose-product-item{
  745. display: flex;
  746. align-items: center;
  747. justify-content: space-between;
  748. padding: 20rpx 0;
  749. border-bottom: 1px solid #eee;
  750. > view{
  751. display: flex;
  752. align-items: center;
  753. justify-content: space-between;
  754. flex-grow: 1;
  755. width: 100%;
  756. }
  757. .choose-product-item-img{
  758. margin-right: 20rpx;
  759. width: 35%;
  760. position: relative;
  761. overflow: hidden;
  762. border: 1px solid #eee;
  763. padding: 10rpx;
  764. .back-price{
  765. zoom: calc(0.8);
  766. }
  767. .choose-product-item-left-info-code{
  768. color: #666;
  769. position: absolute;
  770. width: 100%;
  771. left:0;
  772. bottom:0;
  773. background: rgba(255,255,255,0.7);
  774. text-align: center;
  775. }
  776. }
  777. .choose-product-item-info{
  778. margin-right: 10rpx;
  779. width: 65%;
  780. flex-grow: 1;
  781. .choose-product-item-left-info-price{
  782. display: flex;
  783. align-items:center;
  784. justify-content: space-between;
  785. >view{
  786. &:last-child{
  787. display: flex;
  788. align-items:center;
  789. }
  790. }
  791. }
  792. .choose-product-item-left-info-name{
  793. font-size: 28rpx;
  794. font-weight: 900;
  795. color: #666;
  796. }
  797. .choose-product-item-left-info-guige{
  798. color: #2196F3;
  799. margin: 10rpx 0;
  800. text{
  801. margin-right: 10rpx;
  802. }
  803. }
  804. }
  805. }
  806. }
  807. .back-price{
  808. padding: 6rpx 65rpx;
  809. background: rgba(255 ,87 ,34 , 1);
  810. position: absolute;
  811. top: 18rpx;
  812. right: -45rpx;
  813. color: #fff;
  814. z-index: 2;
  815. font-size: 20rpx;
  816. text-align: center;
  817. transform: rotate(40deg);
  818. display: flex;
  819. align-items: center;
  820. text{
  821. font-size: 28rpx;
  822. margin: 0 5rpx;
  823. }
  824. }
  825. }
  826. </style>