order-list.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  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.productType == 2 || pros.productType == 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?orderId=${order.order.orderId}`)
  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?orderId=${order.order.orderId}`)
  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?orderId=${order.order.orderId}`)
  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?orderId=${data.orderId}`)
  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: 4rpx;
  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: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  873. }
  874. &.ebate{
  875. background: #ff7a51;
  876. }
  877. }
  878. .order-title-tip {
  879. float: left;
  880. font-size: $font-size-28;
  881. line-height: 68rpx;
  882. text-align: right;
  883. color: #ff2a2a;
  884. }
  885. }
  886. }
  887. .goods-title {
  888. width: 100%;
  889. height: 56rpx;
  890. float: left;
  891. margin-top: 10rpx;
  892. .floor-item-act {
  893. height: 56rpx;
  894. text-align: center;
  895. box-sizing: border-box;
  896. float: left;
  897. padding: 10rpx 0;
  898. margin-right: 12rpx;
  899. }
  900. .title-text {
  901. width: 400rpx;
  902. overflow: hidden;
  903. text-overflow: ellipsis;
  904. white-space: nowrap;
  905. float: left;
  906. font-size: $font-size-28;
  907. color: $text-color;
  908. text-align: left;
  909. line-height: 56rpx;
  910. font-weight: bold;
  911. .iconfont {
  912. color: #999999;
  913. font-size: 28rpx;
  914. margin-left: 10rpx;
  915. }
  916. .paymenttext {
  917. color: #f9a94b;
  918. font-size: $font-size-22;
  919. margin-left: 20rpx;
  920. }
  921. }
  922. }
  923. .goods-item {
  924. width: 100%;
  925. height: auto;
  926. }
  927. .goods-pros-t {
  928. width: 100%;
  929. height: auto;
  930. padding: 24rpx 0;
  931. .pros-img {
  932. float: left;
  933. width: 210rpx;
  934. height: 100%;
  935. border-radius: 10rpx;
  936. margin: 0 26rpx 0 0;
  937. position: relative;
  938. .tips {
  939. display: inline-block;
  940. width: 80rpx;
  941. height: 40rpx;
  942. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  943. line-height: 40rpx;
  944. text-align: center;
  945. font-size: $font-size-24;
  946. color: #ffffff;
  947. border-radius: 10rpx 0 10rpx 0;
  948. position: absolute;
  949. top: 0;
  950. left: 0;
  951. }
  952. image {
  953. width: 210rpx;
  954. height: 210rpx;
  955. border-radius: 10rpx;
  956. border: 1px solid #f3f3f3;
  957. }
  958. }
  959. }
  960. .pros-product {
  961. width: 460rpx;
  962. height: 100%;
  963. line-height: 36rpx;
  964. font-size: $font-size-26;
  965. position: relative;
  966. float: left;
  967. .producttitle {
  968. width: 100%;
  969. display: inline-block;
  970. height: auto;
  971. text-overflow: ellipsis;
  972. display: -webkit-box;
  973. word-break: break-all;
  974. -webkit-box-orient: vertical;
  975. -webkit-line-clamp: 2;
  976. overflow: hidden;
  977. margin-bottom: 8rpx;
  978. }
  979. .productspec {
  980. height: 36rpx;
  981. color: #999999;
  982. margin: 30rpx 0;
  983. }
  984. .productprice {
  985. height: 48rpx;
  986. width: 100%;
  987. float: left;
  988. .price {
  989. line-height: 48rpx;
  990. font-size: $font-size-28;
  991. width: 48%;
  992. color: #ff2a2a;
  993. float: left;
  994. font-weight: bold;
  995. &.none {
  996. text-decoration: line-through;
  997. color: #999999;
  998. }
  999. }
  1000. .count {
  1001. height: 100%;
  1002. float: right;
  1003. position: relative;
  1004. .small {
  1005. color: #666666;
  1006. }
  1007. }
  1008. }
  1009. .floor-item-act {
  1010. width: 100%;
  1011. height: 56rpx;
  1012. text-align: center;
  1013. box-sizing: border-box;
  1014. float: left;
  1015. padding: 0 0 10rpx 0;
  1016. }
  1017. }
  1018. .order-footer {
  1019. width: 100%;
  1020. height: 78rpx;
  1021. float: left;
  1022. margin-top: 20rpx;
  1023. .order-footer-bot {
  1024. width: 100%;
  1025. float: left;
  1026. height: 48rpx;
  1027. line-height: 48rpx;
  1028. font-size: $font-size-28;
  1029. color: $text-color;
  1030. .count {
  1031. width: 50%;
  1032. float: left;
  1033. text-align: left;
  1034. font-weight: bold;
  1035. }
  1036. .money {
  1037. width: 50%;
  1038. float: right;
  1039. text-align: right;
  1040. }
  1041. }
  1042. }
  1043. </style>