promoDetail.vue 20 KB

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