order-list.vue 29 KB

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