order-list.vue 27 KB

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