order-list.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <view class="container" :style="{ paddingTop: navbarHeight + 82 + 'px' }">
  3. <!-- 自定义返回 -->
  4. <header-back
  5. :systeminfo="systeminfo"
  6. :navbar-data="nvabarData"
  7. :headerBtnPosi="headerBtnPosi"
  8. :isDelete="isDelete"
  9. :isUsertype="1"
  10. :screenTab="screenTab"
  11. @goSearchPath="handlSearchPath"
  12. />
  13. <tui-skeleton
  14. v-if="skeletonShow"
  15. backgroundColor="#fafafa"
  16. borderRadius="10rpx"
  17. :isLoading="true"
  18. :loadingType="5"
  19. />
  20. <template v-else>
  21. <view class="order-section-top" :style="{ marginTop: navbarHeight + 'px' }">
  22. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  23. <view
  24. v-for="(item, index) in orderTabBar"
  25. :key="index"
  26. class="tab-bar-item"
  27. :class="[currentTab == index ? 'active' : '']"
  28. :data-current="index"
  29. @tap.stop="onClickTab"
  30. >
  31. <text class="tab-bar-title">{{ item.text }}</text>
  32. </view>
  33. </scroll-view>
  34. <scroll-view scroll-x scroll-with-animation class="tab-screen" :scroll-left="scrollLeft">
  35. <view
  36. v-for="(item, index) in screenTabBar"
  37. :key="index"
  38. class="tab-screen-item"
  39. :class="[screenTab == index ? 'active' : '']"
  40. :data-current="index"
  41. @tap.stop="onClickScreenTab(index)"
  42. >{{ item.text }}</view
  43. >
  44. <view
  45. class="tab-screen-item"
  46. v-if="isManage"
  47. :data-current="3"
  48. :class="[screenTab == 3 ? 'active' : '']"
  49. @tap.stop="onClickScreenTab(3)"
  50. >组员订单</view
  51. >
  52. </scroll-view>
  53. </view>
  54. <swiper
  55. class="tab-content"
  56. :current="currentTab"
  57. duration="80"
  58. @animationfinish="onChange"
  59. :style="{ height: winHeight + 'px' }"
  60. >
  61. <swiper-item v-for="(tabItem, index) in orderTabBar" :key="index" @touchmove.stop="">
  62. <scroll-view
  63. scroll-y
  64. class="scoll-y tui-skeleton"
  65. @scrolltolower="scrolltolower"
  66. :style="{ height: winHeight + 'px' }"
  67. >
  68. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="tui-skeleton clearfix">
  69. <!-- 空白页 -->
  70. <empty
  71. v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
  72. :typeIndex="currentTab"
  73. :navbarHeight="navbarHeight"
  74. />
  75. <!-- 列表 -->
  76. <view v-else class="tui-order-content">
  77. <view
  78. class="tui-order-item"
  79. v-for="(order, orderIndex) in tabItem.orderList"
  80. :key="orderIndex"
  81. @click.stop="detail(order)"
  82. >
  83. <view class="order-title">
  84. <view class="order-title-name">
  85. <text>{{ order.clubName ? order.clubName : '' }}</text>
  86. <text
  87. class="tags"
  88. v-if="order.svipUserFlag == 0 && order.userIdentity === 2"
  89. >VIP</text
  90. >
  91. <text class="tags sv" v-if="order.svipUserFlag == 1">SVIP</text>
  92. <view class="name" v-if="screenTab === 3"
  93. >【 {{ order.serviceName ? order.serviceName : '' }} 】</view
  94. >
  95. </view>
  96. <view class="order-title-t">
  97. <view class="order-title-tip tui-skeleton-fillet">
  98. {{ order.status | statusFilters }}
  99. </view>
  100. <view class="bage ebate" v-if="order.rebateFlag == 1">返佣</view>
  101. <text
  102. class="bage buss tui-skeleton-fillet"
  103. v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4"
  104. >
  105. 协销
  106. </text>
  107. <text
  108. class="bage auto tui-skeleton-fillet"
  109. v-if="
  110. order.orderSubmitType == 0 ||
  111. order.orderSubmitType == 1 ||
  112. order.orderSubmitType == 2
  113. "
  114. >
  115. 自主
  116. </text>
  117. <image
  118. class="bage-icon"
  119. src="https://static.caimei365.com/app/img/icon/icon-type@3x.png"
  120. mode="widthFix"
  121. v-if="order.secondHandOrderFlag == 1"
  122. >
  123. </image>
  124. </view>
  125. </view>
  126. <view class="goods-title">
  127. <view v-if="order.shopPromotion" class="floor-item-act">
  128. <view class="floor-tags">{{ order.shopPromotion.name }}</view>
  129. </view>
  130. <view class="title-text tui-skeleton-fillet">{{ order.shopName }}</view>
  131. </view>
  132. <view
  133. class="goods-item"
  134. v-for="(pros, prosIndex) in order.orderProductList"
  135. :key="prosIndex"
  136. >
  137. <view class="goods-pros-t">
  138. <view class="pros-img tui-skeleton-fillet">
  139. <image :src="pros.image" alt="" />
  140. <text
  141. class="tips"
  142. v-if="pros.productType == 2 || pros.productType == 1"
  143. >赠品</text
  144. >
  145. </view>
  146. <view class="pros-product clearfix">
  147. <view class="producttitle tui-skeleton-fillet">{{
  148. pros.name
  149. }}</view>
  150. <view
  151. class="productspec tui-skeleton-fillet"
  152. v-if="pros.productCategory != 2"
  153. >
  154. 规格:{{ pros.productUnit ? pros.productUnit : '' }}
  155. </view>
  156. <view class="productprice">
  157. <view
  158. class="price tui-skeleton-fillet"
  159. :class="
  160. pros.svipPriceFlag == 1 ||
  161. PromotionsFormat(pros.productPromotion)
  162. ? 'none'
  163. : ''
  164. "
  165. >
  166. <text>¥{{ pros.price | NumFormat }}</text>
  167. </view>
  168. <view class="count tui-skeleton-fillet">
  169. <text class="small">x</text>{{ pros.num }}
  170. </view>
  171. </view>
  172. <view class="floor-item-act">
  173. <template v-if="pros.productPromotion">
  174. <view
  175. v-if="PromotionsFormat(pros.productPromotion)"
  176. class="floor-tags"
  177. @click.stop="clickPopupShow(pros.productPromotion)"
  178. >
  179. {{ pros.productPromotion.name }}
  180. <text
  181. v-if="
  182. pros.productPromotion != null &&
  183. pros.productPromotion.type != 3
  184. "
  185. >
  186. :¥{{
  187. pros.productPromotion == null
  188. ? '0.00'
  189. : pros.productPromotion.touchPrice
  190. | NumFormat
  191. }}
  192. </text>
  193. </view>
  194. <view
  195. v-else-if="pros.productPromotion.type != 3"
  196. class="floor-tags"
  197. @click.stop="clickPopupShow(pros.productPromotion)"
  198. >{{ pros.productPromotion.name }}</view
  199. >
  200. </template>
  201. <template v-if="pros.svipPriceFlag == 1">
  202. <view class="svip-tags">
  203. <view class="tags">SVIP</view>
  204. <view class="price">{{ pros.svipPriceTag }}</view>
  205. </view>
  206. </template>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. <view class="order-footer">
  212. <!-- <view class="order-footer-top" v-if="order.discountFee != 0"
  213. >经理折扣:¥{{ order.discountFee | NumFormat }}</view
  214. > -->
  215. <view class="order-footer-bot">
  216. <view class="count tui-skeleton-fillet"
  217. >共{{ order.itemCount }}件商品</view
  218. >
  219. <view
  220. class="money tui-skeleton-fillet"
  221. v-if="order.status == 31 || order.status == 32 || order.status == 33"
  222. >
  223. 已支付:<label style="color:#f94b4b ;"
  224. >¥{{ order.receiptAmount | NumFormat }}</label
  225. >
  226. </view>
  227. <view class="money tui-skeleton-fillet" v-else
  228. >待付总额:<label style="color:#f94b4b ;">
  229. ¥{{ order.obligation | NumFormat }}</label
  230. >
  231. </view>
  232. </view>
  233. </view>
  234. <!-- 底部button -->
  235. <cm-list-button
  236. ref="orderButton"
  237. v-if="screenTab != 3"
  238. :status="order.status"
  239. :order="order"
  240. :shopOrderId="order.shopOrderId"
  241. :rechargeGoods="order.rechargeGoods"
  242. :userId="order.userId"
  243. :secondHandOrderFlag="order.secondHandOrderFlag"
  244. @buttonConfirm="handButtonConfirm"
  245. />
  246. </view>
  247. <!--加载loadding-->
  248. <tui-loadmore :visible="loadding" :index="3" type="black"/>
  249. <tui-nomore
  250. :visible="!pullUpOn"
  251. :backgroundColor="'#ffffff'"
  252. :text="nomoreText"
  253. />
  254. <!--加载loadding-->
  255. </view>
  256. </view>
  257. </scroll-view>
  258. </swiper-item>
  259. </swiper>
  260. </template>
  261. <!-- 分享弹窗 -->
  262. <cm-share-popup
  263. :shopOrderId="handleShopOrderId"
  264. :shareType="isShareType"
  265. v-if="isShareModal"
  266. @shareConfirm="onShareAppMessage"
  267. />
  268. <!-- 透明模态层 -->
  269. <modal-layer v-if="isModalLayer"></modal-layer>
  270. <view class="aganBj" v-show="showAgan">
  271. <view class="alertAgan">
  272. <text class="title">{{ promptitle }}</text>
  273. <view class="goods">
  274. <view class="list" v-for="(item, index) in failList" :key="index">
  275. <image class="image-left" :src="item.image"></image>
  276. <view class="name-right">{{ item.name }}</view>
  277. </view>
  278. </view>
  279. <view class="BtnAll">
  280. <view class="closebtn btn" @click="showAgan = false">取消</view>
  281. <view class="cancel btn" @click="handleAddAgian">确定</view>
  282. </view>
  283. </view>
  284. </view>
  285. <!-- 筛选抽屉 -->
  286. <cm-orderDrawer
  287. ref="screendrawer"
  288. v-if="rightDrawer"
  289. :rightDrawer="rightDrawer"
  290. @handSearchConfirm="handSearchConfirmData"
  291. />
  292. <!-- 提示弹窗 -->
  293. <tui-modal
  294. :show="modal"
  295. @click="handleClick"
  296. :content="contentModalText"
  297. :button="modalButton"
  298. color="#333"
  299. :size="32"
  300. shape="circle"
  301. :maskClosable="false"
  302. />
  303. </view>
  304. </template>
  305. <script>
  306. import { mapState, mapMutations } from 'vuex'
  307. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义顶部导航
  308. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  309. import modalLayer from '@/components/modal-layer'
  310. import empty from '@/components/empty'
  311. import cmListButton from './components/cm-list-button' //操作按钮
  312. import cmSharePopup from './components/cm-share-popup' //分享弹窗
  313. import cmOrderDrawer from '../components/cm-order-drawer' //筛选抽屉
  314. import orderMixins from './mixins/orderMixins.js'
  315. export default {
  316. mixins: [orderMixins],
  317. components: {
  318. headerBack,
  319. empty,
  320. btSearch,
  321. modalLayer,
  322. cmListButton,
  323. cmSharePopup,
  324. cmOrderDrawer
  325. },
  326. data() {
  327. return {
  328. orderTabBar: [
  329. { listType: 0, text: '全部订单', orderList: [] },
  330. { listType: 1, text: '待确认', orderList: [] },
  331. { listType: 2, text: '待付款', orderList: [] },
  332. { listType: 3, text: '待发货', orderList: [] },
  333. { listType: 4, text: '已发货', orderList: [] },
  334. { listType: 5, text: '退货/款', orderList: [] }
  335. ],
  336. screenTabBar: [
  337. { type: 0, text: '全部订单(我的)' },
  338. { type: 1, text: '自主订单(我的)' },
  339. { type: 2, text: '协销订单(我的)' }
  340. ],
  341. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  342. systeminfo: this.setSysteminfo(), //获取设备信息
  343. nvabarData: {
  344. //顶部自定义导航
  345. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  346. showSearch: 1,
  347. title: ' ' // 导航栏中间的标题
  348. },
  349. CustomBar: this.CustomBar, // 顶部导航栏高度
  350. winHeight: '', //窗口高度
  351. currentTab: 0, //预设当前项的值
  352. screenTab: 0, //筛选预设当前项的值
  353. scrollLeft: 0, //tab标题的滚动条位置
  354. orderData: [],
  355. listQuery: {
  356. pageNum: 1, //页数
  357. pageSize: 10, //条数
  358. groupServiceId: 0,
  359. serviceProviderId: 0, //协销用户ID
  360. listType: 0,
  361. orderSubmitType: 0
  362. },
  363. scrollTop: 0,
  364. skeletonShow: true,
  365. isClickChange: false,
  366. isShareModal: false, //控制分享弹窗
  367. isShareType: 2,
  368. isModalLayer: false,
  369. loadding: false,
  370. pullUpOn: true,
  371. hasNextPage: false,
  372. pullFlag: true,
  373. navbarHeight: '',
  374. nomoreText: '上拉显示更多',
  375. showAgan: false,
  376. failList: [], // 再来一单可购买商品
  377. promptitle: '',
  378. userId: 0,
  379. manager: 0,
  380. rightDrawer: false ,//控制筛选抽屉
  381. }
  382. },
  383. onLoad(option) {
  384. if (option.type === 'detele') {
  385. this.isDelete = true
  386. }
  387. this.currentTab = option.listType
  388. this.getHeaderTopHeight() //设置自定义导航高度
  389. this.initGetStotage()
  390. },
  391. computed: {
  392. ...mapState(['isManage'])
  393. },
  394. methods: {
  395. async initGetStotage() {
  396. const userInfo = await this.$api.getStorage()
  397. this.userId = userInfo.userId ? userInfo.userId : 0
  398. this.manager = userInfo.manager ? userInfo.manager : 0
  399. this.listQuery.serviceProviderId = userInfo.serviceProviderId
  400. this.getOrderDatainit(this.currentTab)
  401. },
  402. // 滚动切换标签样式
  403. onChange(e) {
  404. let index = e.target.current || e.detail.current
  405. if (this.isClickChange) {
  406. this.currentTab = index
  407. this.isClickChange = false
  408. return
  409. }
  410. this.isClickChange = false
  411. this.currentTab = index
  412. this.listQuery.listType = index
  413. this.checkCor()
  414. this.pullUpOn = true //切换时隐藏
  415. this.loadding = false //切换时隐藏
  416. this.nomoreText = ''
  417. this.getOrderDatainit(this.currentTab, 'tabChange')
  418. },
  419. // 点击标题切换当前页时改变样式
  420. onClickTab(e) {
  421. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current
  422. if (this.currentTab === tabIndex) {
  423. return false
  424. } else {
  425. this.isClickChange = true
  426. this.currentTab = tabIndex
  427. this.listQuery.listType = tabIndex
  428. this.pullUpOn = true //切换时隐藏
  429. this.loadding = false //切换时隐藏
  430. this.getOrderDatainit(this.currentTab)
  431. }
  432. },
  433. onClickScreenTab(index) {
  434. this.screenTab = index
  435. this.listQuery.orderSubmitType = index
  436. this.pullUpOn = true //切换时隐藏
  437. this.loadding = false //切换时隐藏
  438. this.nomoreText = ''
  439. this.getOrderDatainit(this.currentTab)
  440. },
  441. //判断当前滚动超过一屏时,设置tab标题滚动条。
  442. checkCor: function() {
  443. if (this.currentTab > 3) {
  444. //这里距离按实际计算
  445. this.scrollLeft = 300
  446. } else {
  447. this.scrollLeft = 0
  448. }
  449. },
  450. async getOrderDatainit(index, source) {
  451. try {
  452. this.listQuery.pageNum = 1
  453. let orderItem = this.orderTabBar[index]
  454. if (source === 'tabChange' && orderItem.loaded === true) {
  455. //tab切换只有第一次需要加载数据
  456. return
  457. }
  458. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  459. const res = await this.SellerService.GetSellerOrderList(this.listQuery)
  460. const data = res.data
  461. if (data.list && data.list.length > 0) {
  462. orderItem.orderList = []
  463. data.list.forEach(item => {
  464. orderItem.orderList.push(item)
  465. })
  466. this.hasNextPage = data.hasNextPage
  467. if (this.hasNextPage) {
  468. this.pullUpOn = false
  469. this.nomoreText = '上拉显示更多'
  470. } else {
  471. if (orderItem.orderList.length < 2) {
  472. this.pullUpOn = true
  473. } else {
  474. this.pullUpOn = false
  475. this.nomoreText = '已至底部'
  476. }
  477. }
  478. } else {
  479. this.$set(orderItem, 'loaded', true)
  480. orderItem.orderList = []
  481. }
  482. this.skeletonShow = false
  483. } catch (error) {
  484. this.$util.msg(error.msg, 2000)
  485. }
  486. },
  487. //上拉加载
  488. async getOnReachBottomData(index) {
  489. try {
  490. this.listQuery.pageNum += 1
  491. const res = await this.SellerService.GetSellerOrderList(this.listQuery)
  492. const data = res.data
  493. const orderItem = this.orderTabBar[index]
  494. orderItem.orderList = orderItem.orderList.concat(data.list)
  495. this.hasNextPage = data.hasNextPage
  496. this.pullFlag = false // 防上拉暴滑
  497. setTimeout(() => {
  498. this.pullFlag = true
  499. }, 500)
  500. if (this.hasNextPage) {
  501. this.pullUpOn = false
  502. this.nomoreText = '上拉显示更多'
  503. } else {
  504. this.loadding = false
  505. this.pullUpOn = false
  506. this.nomoreText = '已至底部'
  507. }
  508. } catch (error) {
  509. this.$util.msg(error.msg, 2000)
  510. }
  511. },
  512. //获取点击
  513. handButtonConfirm(data) {
  514. console.log('data',data)
  515. this.handleShopOrderId = data.shopOrderId
  516. switch (data.type) {
  517. case 'cancel': //取消订单
  518. this.modal = true
  519. this.contentModalText = '确认取消该订单吗?'
  520. this.handleModelEven = 1
  521. break
  522. case 'delete': //删除订单
  523. this.modal = true
  524. this.contentModalText = '确认删除该订单吗?'
  525. this.handleModelEven = 2
  526. break
  527. case 'confirm': // 确认订单
  528. this.modal = true
  529. this.contentModalText = '确认此订单吗?'
  530. this.handleModelEven = 3
  531. break
  532. case 'again':
  533. this.handOrderAgain(data.shopOrderId)
  534. break
  535. case 'query':
  536. this.isModalLayer = true
  537. this.$api.navigateTo('/pages/user/order/order-logistics?shopOrderId=' + data.shopOrderId)
  538. break
  539. }
  540. },
  541. //确定筛选
  542. handSearchConfirmData(data) {
  543. this.listQuery.groupServiceId = data.serviceProviderId
  544. this.getOrderDatainit(this.currentTab)
  545. },
  546. scrolltolower() {
  547. if (this.hasNextPage) {
  548. this.loadding = true
  549. this.pullUpOn = true
  550. this.getOnReachBottomData(this.currentTab)
  551. }
  552. },
  553. detail(order) {
  554. //订单详情跳转
  555. this.isModalLayer = true
  556. if (this.screenTab === 3) {
  557. this.$api.navigateTo(
  558. `/pages/seller/order/order-club-details?listType=${this.currentTab}&shopOrderId=${
  559. order.shopOrderId
  560. }&userId=${order.userId}`
  561. )
  562. } else {
  563. this.$api.navigateTo(
  564. `/pages/seller/order/order-details?listType=${this.currentTab}&shopOrderId=${
  565. order.shopOrderId
  566. }&userId=${order.userId}`
  567. )
  568. }
  569. },
  570. handlSearchPath() {
  571. this.$api.navigateTo('/pages/seller/order/search-order')
  572. },
  573. PromotionsFormat(promo) {
  574. //促销活动类型数据处理
  575. if (promo != null) {
  576. if (promo.type == 1 && promo.mode == 1) {
  577. return true
  578. } else {
  579. return false
  580. }
  581. }
  582. return false
  583. },
  584. //订单状态文字和颜色
  585. StateExpFormat(state) {
  586. let stateText = '',
  587. stateTextObject = {
  588. 0: '待确认',
  589. 2: '交易完成',
  590. 4: '已关闭',
  591. 5: '交易全退',
  592. 6: '交易全退',
  593. 11: '待付款待发货',
  594. 12: '待付款部分发货',
  595. 13: '待付款已发货',
  596. 21: '部分付款待发货',
  597. 22: '部分付款部分发货',
  598. 23: '部分付款已发货',
  599. 31: '已付款待发货',
  600. 32: '已付款部分发货',
  601. 33: '已付款已发货'
  602. }
  603. Object.keys(stateTextObject).forEach(key => {
  604. if (key == state) {
  605. stateText = stateTextObject[key]
  606. }
  607. })
  608. return stateText
  609. },
  610. orderPriceToFixed(n) {
  611. let price = ''
  612. price = n.toFixed(2)
  613. return price
  614. },
  615. getHeaderTopHeight() {
  616. // 状态栏高度
  617. let self = this
  618. let statusBarHeight = this.systeminfo.statusBarHeight
  619. let headerPosi = this.headerBtnPosi
  620. let btnPosi = {
  621. // 胶囊实际位置,坐标信息不是左上角原点
  622. height: headerPosi.height,
  623. width: headerPosi.width,
  624. // 胶囊top - 状态栏高度
  625. top: headerPosi.top - statusBarHeight,
  626. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  627. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  628. // 屏幕宽度 - 胶囊right
  629. right: this.systeminfo.screenWidth - headerPosi.right
  630. }
  631. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  632. // 高度自适应
  633. uni.getSystemInfo({
  634. success: function(res) {
  635. let calc = res.windowHeight
  636. self.winHeight = calc - self.CustomBar - 82
  637. }
  638. })
  639. },
  640. setHeaderBtnPosi() {
  641. // 获得胶囊按钮位置信息
  642. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  643. return headerBtnPosi
  644. },
  645. setSysteminfo() {
  646. let systeminfo
  647. uni.getSystemInfo({
  648. // 获取设备信息
  649. success: res => {
  650. systeminfo = res
  651. }
  652. })
  653. return systeminfo
  654. }
  655. },
  656. onPageScroll(e) {
  657. this.scrollTop = e.scrollTop
  658. },
  659. onShow() {
  660. this.isModalLayer = false
  661. }
  662. }
  663. </script>
  664. <style lang="scss">
  665. page {
  666. background-color: #ffffff;
  667. }
  668. /*tabbar start*/
  669. ::-webkit-scrollbar {
  670. width: 0;
  671. height: 0;
  672. color: transparent;
  673. }
  674. .order-section-top {
  675. width: 100%;
  676. position: fixed;
  677. top: 0;
  678. left: 0;
  679. z-index: 99;
  680. background: #ffffff;
  681. .tab-screen {
  682. width: 100%;
  683. box-sizing: border-box;
  684. background: #fff;
  685. white-space: nowrap;
  686. height: 80rpx;
  687. padding: 10rpx 0;
  688. border-top: 1px solid #f7f7f7;
  689. border-bottom: 1px solid #f7f7f7;
  690. overflow: hidden;
  691. .tab-screen-item {
  692. min-width: 100rpx;
  693. height: 60rpx;
  694. border-radius: 10rpx;
  695. background: #f7f7f7;
  696. margin: 0 15rpx;
  697. padding: 0 15rpx;
  698. line-height: 60rpx;
  699. font-size: $font-size-28;
  700. color: #333333;
  701. text-align: center;
  702. display: inline-block;
  703. &.active {
  704. color: $color-system;
  705. }
  706. }
  707. }
  708. }
  709. .tab-view::before {
  710. content: '';
  711. position: absolute;
  712. border-bottom: 1rpx solid #eaeef1;
  713. -webkit-transform: scaleY(0.5);
  714. transform: scaleY(0.5);
  715. bottom: 0;
  716. right: 0;
  717. left: 0;
  718. }
  719. .tab-view {
  720. width: 100%;
  721. height: 80rpx;
  722. overflow: hidden;
  723. box-sizing: border-box;
  724. background: #fff;
  725. white-space: nowrap;
  726. border-top: 1px solid #f7f7f7;
  727. }
  728. .tab-bar-item {
  729. padding: 0;
  730. height: 80rpx;
  731. min-width: 80rpx;
  732. line-height: 80rpx;
  733. margin: 0 28rpx;
  734. display: inline-block;
  735. text-align: center;
  736. box-sizing: border-box;
  737. &.active {
  738. border-bottom: 6rpx solid $color-system;
  739. }
  740. .tab-bar-title {
  741. height: 80rpx;
  742. line-height: 80rpx;
  743. font-size: $font-size-28;
  744. color: $text-color;
  745. }
  746. &.active .tab-bar-title {
  747. color: $color-system !important;
  748. }
  749. }
  750. .container {
  751. padding-bottom: env(safe-area-inset-bottom);
  752. height: auto;
  753. position: relative;
  754. }
  755. .tui-order-content {
  756. width: 100%;
  757. height: auto;
  758. }
  759. .tui-order-list {
  760. width: 100%;
  761. position: relative;
  762. }
  763. .tui-order-item {
  764. display: flex;
  765. flex-direction: column;
  766. width: 702rpx;
  767. padding: 20rpx 24rpx 0 24rpx;
  768. background: #fff;
  769. border-bottom: 20rpx solid #f7f7f7;
  770. }
  771. .order-title {
  772. width: 100%;
  773. height: auto;
  774. .order-title-name {
  775. width: 100%;
  776. height: 72rpx;
  777. border-bottom: 1px solid #f7f7f7;
  778. line-height: 72rpx;
  779. text-align: left;
  780. font-size: $font-size-28;
  781. color: #333333;
  782. .tags {
  783. display: inline-block;
  784. width: 60rpx;
  785. height: 32rpx;
  786. border-radius: 8rpx;
  787. background: #f0cb72;
  788. font-size: $font-size-22;
  789. color: #4e4539;
  790. text-align: center;
  791. line-height: 32rpx;
  792. margin-left: 10rpx;
  793. &.sv {
  794. background: #333333;
  795. color: #f0cb72;
  796. }
  797. }
  798. .name {
  799. float: right;
  800. font-size: 26rpx;
  801. color: #999999;
  802. }
  803. }
  804. .order-title-t {
  805. width: 100%;
  806. height: 68rpx;
  807. float: left;
  808. line-height: 68rpx;
  809. position: relative;
  810. .bage-icon {
  811. width: 50rpx;
  812. height: 50rpx;
  813. display: block;
  814. position: absolute;
  815. right: 110rpx;
  816. top: 12rpx;
  817. }
  818. .bage{
  819. display: inline-block;
  820. width: 72rpx;
  821. height: 32rpx;
  822. margin: 19rpx 10rpx 0 10rpx;
  823. border-radius: 4rpx;
  824. line-height: 32rpx;
  825. font-size: $font-size-22;
  826. text-align: center;
  827. color: #ffffff;
  828. float: right;
  829. &.buss{
  830. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  831. }
  832. &.auto{
  833. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  834. }
  835. &.ebate{
  836. background: #ff7a51;
  837. }
  838. }
  839. .order-title-tip {
  840. float: left;
  841. font-size: $font-size-28;
  842. line-height: 68rpx;
  843. text-align: right;
  844. color: #ff2a2a;
  845. }
  846. }
  847. }
  848. .goods-title {
  849. width: 100%;
  850. height: 56rpx;
  851. float: left;
  852. margin-top: 10rpx;
  853. .floor-item-act {
  854. height: 56rpx;
  855. text-align: center;
  856. box-sizing: border-box;
  857. float: left;
  858. padding: 10rpx 0;
  859. margin-right: 12rpx;
  860. }
  861. .title-text {
  862. width: 400rpx;
  863. overflow: hidden;
  864. text-overflow: ellipsis;
  865. white-space: nowrap;
  866. float: left;
  867. font-size: $font-size-28;
  868. color: $text-color;
  869. text-align: left;
  870. line-height: 56rpx;
  871. font-weight: bold;
  872. }
  873. }
  874. .goods-item {
  875. width: 100%;
  876. height: auto;
  877. }
  878. .goods-pros-t {
  879. width: 100%;
  880. height: auto;
  881. padding: 24rpx 0;
  882. .pros-img {
  883. float: left;
  884. width: 210rpx;
  885. height: 100%;
  886. border-radius: 10rpx;
  887. margin: 0 26rpx 0 0;
  888. position: relative;
  889. .tips {
  890. display: inline-block;
  891. width: 80rpx;
  892. height: 40rpx;
  893. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  894. line-height: 40rpx;
  895. text-align: center;
  896. font-size: $font-size-24;
  897. color: #ffffff;
  898. border-radius: 10rpx 0 10rpx 0;
  899. position: absolute;
  900. top: 0;
  901. left: 0;
  902. }
  903. image {
  904. width: 210rpx;
  905. height: 210rpx;
  906. border-radius: 10rpx;
  907. border: 1px solid #f3f3f3;
  908. }
  909. }
  910. }
  911. .pros-product {
  912. width: 460rpx;
  913. height: 100%;
  914. line-height: 36rpx;
  915. font-size: $font-size-26;
  916. position: relative;
  917. float: left;
  918. .producttitle {
  919. width: 100%;
  920. display: inline-block;
  921. height: auto;
  922. text-overflow: ellipsis;
  923. display: -webkit-box;
  924. word-break: break-all;
  925. -webkit-box-orient: vertical;
  926. -webkit-line-clamp: 2;
  927. overflow: hidden;
  928. margin-bottom: 8rpx;
  929. }
  930. .productspec {
  931. height: 36rpx;
  932. color: #999999;
  933. text-overflow: ellipsis;
  934. display: -webkit-box;
  935. word-break: break-all;
  936. -webkit-box-orient: vertical;
  937. -webkit-line-clamp: 1;
  938. overflow: hidden;
  939. }
  940. .productprice {
  941. height: 48rpx;
  942. width: 100%;
  943. float: left;
  944. .price {
  945. line-height: 48rpx;
  946. font-size: $font-size-28;
  947. width: 48%;
  948. color: #ff2a2a;
  949. float: left;
  950. font-weight: bold;
  951. &.none {
  952. text-decoration: line-through;
  953. color: #999999;
  954. }
  955. }
  956. .count {
  957. height: 100%;
  958. float: right;
  959. position: relative;
  960. .small {
  961. color: #666666;
  962. }
  963. }
  964. }
  965. .floor-item-act {
  966. width: 100%;
  967. height: 56rpx;
  968. text-align: center;
  969. box-sizing: border-box;
  970. float: left;
  971. padding: 0 0 10rpx 0;
  972. }
  973. }
  974. .order-footer {
  975. width: 100%;
  976. height: 78rpx;
  977. float: left;
  978. .order-footer-top {
  979. width: 100%;
  980. height: 34rpx;
  981. line-height: 34rpx;
  982. font-size: $font-size-24;
  983. color: #999999;
  984. text-align: right;
  985. }
  986. .order-footer-bot {
  987. width: 100%;
  988. float: left;
  989. height: 48rpx;
  990. line-height: 48rpx;
  991. font-size: $font-size-28;
  992. font-weight: bold;
  993. color: $text-color;
  994. .count {
  995. width: 50%;
  996. float: left;
  997. text-align: left;
  998. }
  999. .money {
  1000. width: 50%;
  1001. float: right;
  1002. text-align: right;
  1003. }
  1004. }
  1005. }
  1006. .aganBj {
  1007. position: fixed;
  1008. left: 0;
  1009. top: 0;
  1010. bottom: 0;
  1011. width: 100%;
  1012. height: 100%;
  1013. background-color: rgba(0, 0, 0, 0.5);
  1014. z-index: 999999;
  1015. .alertAgan {
  1016. position: absolute;
  1017. top: 50%;
  1018. left: 50%;
  1019. transform: translate(-50%, -50%);
  1020. width: 580rpx;
  1021. background-color: #fff;
  1022. border-radius: 16rpx;
  1023. .title {
  1024. font-size: 30rpx;
  1025. color: #333333;
  1026. line-height: 42rpx;
  1027. padding: 30rpx;
  1028. display: block;
  1029. }
  1030. .goods {
  1031. padding: 0 30rpx;
  1032. .list {
  1033. padding: 10px 0;
  1034. border-bottom: 1rpx solid #e1e1e1;
  1035. margin: 10rpx 0;
  1036. .image-left {
  1037. width: 86rpx;
  1038. height: 86rpx;
  1039. border: 2rpx solid #e1e1e1;
  1040. border-radius: 6rpx;
  1041. display: inline-block;
  1042. vertical-align: middle;
  1043. }
  1044. .name-right {
  1045. display: inline-block;
  1046. width: 416rpx;
  1047. margin-left: 15rpx;
  1048. font-size: 26rpx;
  1049. color: #666666;
  1050. vertical-align: middle;
  1051. word-break: break-all;
  1052. overflow: hidden;
  1053. text-overflow: ellipsis;
  1054. display: -webkit-inline-box;
  1055. -webkit-line-clamp: 2;
  1056. -webkit-box-orient: vertical;
  1057. }
  1058. }
  1059. }
  1060. .BtnAll {
  1061. margin-top: 30rpx;
  1062. .btn {
  1063. display: inline-block;
  1064. width: 290rpx;
  1065. height: 90rpx;
  1066. line-height: 90rpx;
  1067. text-align: center;
  1068. &.closebtn {
  1069. border-radius: 0px 0px 0px 10px;
  1070. color: #999999;
  1071. background: #efefef;
  1072. }
  1073. &.cancel {
  1074. border-radius: 0px 0px 8px 0px;
  1075. background: $btn-confirm;
  1076. color: #fff;
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. </style>