order-list.vue 37 KB

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