order-list.vue 24 KB

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