order-list.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  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(shopId) {
  345. if(shopId == 1161){
  346. return
  347. }
  348. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shopId}`)
  349. },
  350. // 滚动切换标签样式
  351. onChange: function(e) {
  352. let index = e.target.current || e.detail.current
  353. if (this.isClickChange) {
  354. this.currentTab = index
  355. this.isClickChange = false
  356. return
  357. }
  358. this.isClickChange = false
  359. this.currentTab = index
  360. this.checkCor()
  361. this.pageNum = 1
  362. this.pullUpOn = true //切换时隐藏
  363. this.loadding = false //切换时隐藏
  364. this.nomoreText = ''
  365. if (!this.isOnloadFlag) {
  366. this.getOrderDatainit(this.currentTab, 'tabChange')
  367. }
  368. },
  369. // 点击标题切换当前页时改变样式
  370. onClickTab: function(e) {
  371. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current
  372. if (this.currentTab === tabIndex) {
  373. return false
  374. } else {
  375. this.isClickChange = true
  376. this.currentTab = tabIndex
  377. this.pageNum = 1
  378. this.pullUpOn = true //切换时隐藏
  379. this.loadding = false //切换时隐藏
  380. this.getOrderDatainit(this.currentTab)
  381. }
  382. },
  383. //判断当前滚动超过一屏时,设置tab标题滚动条。
  384. checkCor: function() {
  385. if (this.currentTab > 3) {
  386. //这里距离按实际计算
  387. this.scrollLeft = 300
  388. } else {
  389. this.scrollLeft = 0
  390. }
  391. },
  392. getOrderDatainit(index, source) {
  393. /**
  394. * @订单初始化加载 仅加载第一页码
  395. * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
  396. * @param:userId(用户ID)
  397. * @param:pageNum(页码数)
  398. * @param:pageSize(每页条数)
  399. * @param:organizeID(全局变量组织ID)
  400. */
  401. setTimeout(() => {
  402. this.skeletonShow = false
  403. this.isOnloadFlag = false
  404. }, 1500)
  405. let orderItem = this.orderTabBar[index]
  406. if (source === 'tabChange' && orderItem.loaded === true) {
  407. //tab切换只有第一次需要加载数据
  408. return
  409. }
  410. setTimeout(() => {
  411. this.$api.getStorage().then(resolve => {
  412. this.userId = resolve.userId ? resolve.userId : 0
  413. let params = { orderState: index, userId: this.userId, pageNum: 1, pageSize: this.pageSize }
  414. this.OrderService.QueryOrderList(params)
  415. .then(response => {
  416. let data = response.data
  417. let orderList = data.list.filter(item => {
  418. //添加不同状态下订单的表现形式
  419. item = Object.assign(item, this.StateExpFormat(item.status))
  420. return item
  421. })
  422. orderItem.orderList = []
  423. orderList.forEach(item => {
  424. orderItem.orderList.push(item)
  425. })
  426. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  427. this.$set(orderItem, 'loaded', true)
  428. this.hasNextPage = data.hasNextPage
  429. if (this.hasNextPage) {
  430. this.pullUpOn = false
  431. this.nomoreText = '上拉显示更多'
  432. } else {
  433. if (orderItem.orderList.length < 2) {
  434. this.pullUpOn = true
  435. } else {
  436. this.pullUpOn = false
  437. this.nomoreText = '已至底部'
  438. }
  439. }
  440. })
  441. .catch(error => {
  442. this.$util.msg(error.msg, 2000)
  443. })
  444. })
  445. }, 600)
  446. },
  447. getOnReachBottomData(index) {
  448. //上拉加载
  449. this.pageNum += 1
  450. let params = { orderState: index, userId: this.userId, pageNum: this.pageNum, pageSize: this.pageSize }
  451. this.OrderService.QueryOrderList(params)
  452. .then(response => {
  453. let data = response.data
  454. let orderItem = this.orderTabBar[index]
  455. this.hasNextPage = data.hasNextPage
  456. orderItem.orderList = orderItem.orderList.concat(data.list)
  457. this.pullFlag = false // 防上拉暴滑
  458. setTimeout(() => {
  459. this.pullFlag = true
  460. }, 500)
  461. if (this.hasNextPage) {
  462. this.pullUpOn = false
  463. this.nomoreText = '上拉显示更多'
  464. } else {
  465. this.loadding = false
  466. this.pullUpOn = false
  467. this.nomoreText = '已至底部'
  468. }
  469. })
  470. .catch(error => {
  471. this.$util.msg(error.msg, 2000)
  472. })
  473. },
  474. scrolltolower() {
  475. if (this.hasNextPage) {
  476. this.loadding = true
  477. this.pullUpOn = true
  478. this.getOnReachBottomData(this.currentTab)
  479. }
  480. },
  481. detail(orderId) {
  482. //订单详情跳转
  483. this.isModalLayer = true
  484. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderId=${orderId}`)
  485. },
  486. handButtonConfirm(data) {
  487. //获取点击
  488. this.handShowAlert(data)
  489. this.btnoRderID = data.orderId
  490. },
  491. handShowAlert(data) {
  492. //执行
  493. switch (data.type) {
  494. case 'delete':
  495. this.handOrderDetele(data.orderId)
  496. break
  497. case 'cancel':
  498. this.handCenceConfirm(data.orderId)
  499. break
  500. case 'query':
  501. this.isModalLayer = true
  502. this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
  503. break
  504. case 'confirm':
  505. this.handOrderConfirm(data.orderId)
  506. break
  507. case 'pay':
  508. this.hanldOrderData = data.order
  509. this.getOrderPaymentValidation(data)
  510. break
  511. case 'confirmation':
  512. this.handOrderConfirmation(data.orderId)
  513. break
  514. case 'payment':
  515. this.hanldConfirmFn(data.orderId)
  516. break
  517. }
  518. },
  519. getOrderPaymentValidation(data) {
  520. //监听根据付款状态做操作
  521. this.OrderService.OrderPaymentValidation({ orderId: data.orderId })
  522. .then(response => {
  523. let dataCode = response.data.code
  524. this.payModelData = response.data
  525. switch (dataCode) {
  526. case 1:
  527. this.isPayModel = true
  528. this.modelType = 1
  529. break
  530. case 2:
  531. this.isPayModel = true
  532. this.modelType = 2
  533. break
  534. case -1:
  535. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  536. break
  537. default:
  538. if (response.data.onlinePayFlag == 1) {
  539. this.$api.navigateTo(
  540. `/pages/user/order/order-payment?type=onlinePay&Amount=${
  541. response.data.pendingPayments
  542. }&orderId=${data.orderId}`
  543. )
  544. } else {
  545. this.$api.navigateTo(
  546. `/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`
  547. )
  548. }
  549. }
  550. })
  551. .catch(error => {
  552. this.$util.msg(error.msg, 2000)
  553. })
  554. },
  555. hanldPaymentConfirm(data) {
  556. //余额抵扣跳转
  557. this.OrderService.OrderBalanceDeduction({ orderId: data.order.orderId })
  558. .then(response => {
  559. if (data.type === 2) {
  560. let _data = { orderId: data.order.orderId }
  561. this.$api.navigateTo(
  562. `/pages/user/order/success?type=deduction&data=${JSON.stringify({ data: _data })}`
  563. )
  564. } else {
  565. if (data.order.onlinePayFlag === 1) {
  566. this.$api.navigateTo(
  567. `/pages/user/order/order-payment?type=onlinePay&Amount=${
  568. data.order.pendingPayments
  569. }&orderId=${data.order.orderId}`
  570. )
  571. } else {
  572. this.$api.navigateTo(
  573. `/pages/user/order/order-payment?type=payfirm&orderId=${data.order.orderId}`
  574. )
  575. }
  576. }
  577. })
  578. .catch(error => {
  579. this.$util.msg(error.msg, 2000)
  580. })
  581. },
  582. hanldCancelConfirm(data) {
  583. //不使用余额抵扣直接跳转收银台
  584. if (data.onlinePayFlag === 1) {
  585. this.$api.navigateTo(
  586. `/pages/user/order/order-payment?type=onlinePay&Amount=${
  587. this.hanldOrderData.pendingPayments
  588. }&orderId=${data.orderId}`
  589. )
  590. } else {
  591. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
  592. }
  593. },
  594. hanldConfirmFn(orderId) {
  595. //确认打款供应商
  596. this.$util.modal(
  597. '提示',
  598. '确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?',
  599. '确定',
  600. '取消',
  601. true,
  602. () => {
  603. this.OrderService.confirmpayment({ orderId: orderId })
  604. .then(response => {
  605. this.$util.msg('确认成功', 2000, true, 'success')
  606. setTimeout(() => {
  607. this.getOrderDatainit(this.currentTab)
  608. }, 2000)
  609. })
  610. .catch(error => {
  611. this.$util.msg(error.msg, 2000)
  612. })
  613. }
  614. )
  615. },
  616. handOrderConfirm(orderId) {
  617. //确认收货
  618. this.$util.modal('提示', '是否确认收货', '确定', '取消', true, () => {
  619. this.OrderService.ConfirmReceipt({ orderId: orderId })
  620. .then(response => {
  621. this.beansType = 7
  622. this.beanNumber = 100
  623. this.isActivityBean = true
  624. })
  625. .catch(error => {
  626. this.$util.msg(error.msg, 2000)
  627. })
  628. })
  629. },
  630. handOrderConfirmation(orderId) {
  631. //确认订单
  632. this.$util.modal('提示', '确认此订单?', '确定', '取消', true, () => {
  633. this.OrderService.AffirmOrder({ orderId: orderId })
  634. .then(response => {
  635. this.$util.msg(response.msg, 2000, true, 'success')
  636. setTimeout(() => {
  637. this.getOrderDatainit(this.currentTab)
  638. }, 2000)
  639. })
  640. .catch(error => {
  641. this.$util.msg(error.msg, 2000)
  642. })
  643. })
  644. },
  645. handOrderDetele(orderId) {
  646. //删除订单
  647. this.$util.modal('提示', '确认删除该订单吗?', '确定', '取消', true, () => {
  648. this.OrderService.DeleteOrder({ orderId: orderId })
  649. .then(response => {
  650. this.$util.msg(response.msg, 2000, true, 'success')
  651. setTimeout(() => {
  652. this.getOrderDatainit(this.currentTab)
  653. }, 2000)
  654. })
  655. .catch(error => {
  656. this.$util.msg(error.msg, 2000)
  657. })
  658. })
  659. },
  660. handCenceConfirm(orderId) {
  661. //取消订单
  662. this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
  663. this.OrderService.CancelOrder({ orderId: orderId })
  664. .then(response => {
  665. this.$util.msg(response.msg, 2000, true, 'success')
  666. setTimeout(() => {
  667. this.getOrderDatainit(this.currentTab)
  668. }, 2000)
  669. })
  670. .catch(error => {
  671. this.$util.msg(error.msg, 2000)
  672. })
  673. })
  674. },
  675. handlSearchPath() {
  676. this.$api.navigateTo('/pages/search/search-order')
  677. },
  678. onShareAppMessage(res) {
  679. //分享转发
  680. this.isShareModal = false
  681. if (res.from === 'button') {
  682. // 来自页面内转发按钮
  683. }
  684. return {
  685. title: '您有新的分享订单,快来查看吧~',
  686. path: `/pages/user/order/order-sharelogin?orderId=${this.btnoRderID}&userId=${this.userId}`,
  687. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  688. }
  689. },
  690. orderPriceToFixed(n) {
  691. let price = ''
  692. price = n.toFixed(2)
  693. return price
  694. },
  695. getHeaderTopHeight() {
  696. // 状态栏高度
  697. let statusBarHeight = this.systeminfo.statusBarHeight
  698. let headerPosi = this.headerBtnPosi
  699. let btnPosi = {
  700. // 胶囊实际位置,坐标信息不是左上角原点
  701. height: headerPosi.height,
  702. width: headerPosi.width,
  703. // 胶囊top - 状态栏高度
  704. top: headerPosi.top - statusBarHeight,
  705. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  706. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  707. // 屏幕宽度 - 胶囊right
  708. right: this.systeminfo.screenWidth - headerPosi.right
  709. }
  710. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  711. },
  712. setHeaderBtnPosi() {
  713. // 获得胶囊按钮位置信息
  714. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  715. return headerBtnPosi
  716. },
  717. setSysteminfo() {
  718. let systeminfo
  719. uni.getSystemInfo({
  720. // 获取设备信息
  721. success: res => {
  722. systeminfo = res
  723. }
  724. })
  725. return systeminfo
  726. },
  727. PromotionsFormat(promo) {
  728. //促销活动类型数据处理
  729. if (promo != null) {
  730. if (promo.type == 1 && promo.mode == 1) {
  731. return true
  732. } else {
  733. return false
  734. }
  735. }
  736. return false
  737. },
  738. StateExpFormat(state) {
  739. //订单状态文字和颜色
  740. var HtmlStateText = '',
  741. stateTextObject = {
  742. 0: '待确认',
  743. 4: '交易完成',
  744. 5: '订单完成',
  745. 6: '已关闭',
  746. 7: '交易全退',
  747. 77: '交易全退',
  748. 11: '待付款待发货',
  749. 12: '待付款部分发货',
  750. 13: '待付款已发货',
  751. 21: '部分付款待发货',
  752. 22: '部分付款部分发货',
  753. 23: '部分付款已发货',
  754. 31: '已付款待发货',
  755. 32: '已付款部分发货',
  756. 33: '已付款已发货',
  757. 111: '待付款待发货'
  758. }
  759. Object.keys(stateTextObject).forEach(function(key) {
  760. if (key == state) {
  761. HtmlStateText = stateTextObject[key]
  762. }
  763. })
  764. return HtmlStateText
  765. },
  766. handleBeanlClick() {
  767. //关闭采美豆弹窗
  768. this.isActivityBean = false
  769. this.getOrderDatainit(this.currentTab)
  770. }
  771. },
  772. onPageScroll(e) {
  773. this.scrollTop = e.scrollTop
  774. },
  775. onShow() {
  776. this.isModalLayer = false
  777. this.getOrderDatainit(this.currentTab)
  778. }
  779. }
  780. </script>
  781. <style lang="scss">
  782. /*tabbar start*/
  783. ::-webkit-scrollbar {
  784. width: 0;
  785. height: 0;
  786. color: transparent;
  787. }
  788. .order-section-top {
  789. width: 100%;
  790. position: fixed;
  791. top: 0;
  792. left: 0;
  793. z-index: 99;
  794. background: #ffffff;
  795. }
  796. .tab-view::before {
  797. content: '';
  798. position: absolute;
  799. border-bottom: 1rpx solid #eaeef1;
  800. -webkit-transform: scaleY(0.5);
  801. transform: scaleY(0.5);
  802. bottom: 0;
  803. right: 0;
  804. left: 0;
  805. }
  806. .tab-view {
  807. width: 100%;
  808. height: 80rpx;
  809. overflow: hidden;
  810. box-sizing: border-box;
  811. background: #fff;
  812. white-space: nowrap;
  813. border-top: 1px solid #f7f7f7;
  814. }
  815. .tab-bar-item {
  816. padding: 0;
  817. height: 80rpx;
  818. min-width: 80rpx;
  819. line-height: 80rpx;
  820. margin: 0 28rpx;
  821. display: inline-block;
  822. text-align: center;
  823. box-sizing: border-box;
  824. }
  825. .tab-bar-title {
  826. height: 80rpx;
  827. line-height: 80rpx;
  828. font-size: $font-size-28;
  829. color: $text-color;
  830. }
  831. .active {
  832. border-bottom: 6rpx solid $color-system;
  833. }
  834. .active .tab-bar-title {
  835. color: $color-system !important;
  836. }
  837. /*tabbar end*/
  838. .scoll-y {
  839. height: 100%;
  840. }
  841. page {
  842. background: #f7f7f7;
  843. }
  844. .container {
  845. padding-bottom: env(safe-area-inset-bottom);
  846. height: auto;
  847. position: relative;
  848. }
  849. .tui-order-content {
  850. width: 100%;
  851. height: auto;
  852. }
  853. .tui-order-list {
  854. margin-top: 90rpx;
  855. width: 100%;
  856. position: relative;
  857. }
  858. .tui-order-item {
  859. display: flex;
  860. flex-direction: column;
  861. width: 702rpx;
  862. padding: 20rpx 24rpx 0 24rpx;
  863. background: #fff;
  864. border-bottom: 20rpx solid #f7f7f7;
  865. }
  866. .order-title {
  867. width: 100%;
  868. height: auto;
  869. .order-title-t {
  870. width: 100%;
  871. height: 68rpx;
  872. float: left;
  873. line-height: 68rpx;
  874. position: relative;
  875. .bage-icon {
  876. width: 50rpx;
  877. height: 50rpx;
  878. display: block;
  879. position: absolute;
  880. right: 0;
  881. top: 9rpx;
  882. }
  883. .bage-buss {
  884. display: inline-block;
  885. width: 72rpx;
  886. height: 30rpx;
  887. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  888. border-radius: 4rpx;
  889. line-height: 30rpx;
  890. font-size: $font-size-22;
  891. text-align: center;
  892. color: #ffffff;
  893. }
  894. .bage-auto {
  895. display: inline-block;
  896. width: 72rpx;
  897. height: 30rpx;
  898. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  899. border-radius: 4rpx;
  900. line-height: 30rpx;
  901. font-size: $font-size-22;
  902. text-align: center;
  903. color: #ffffff;
  904. }
  905. .bage-text {
  906. display: inline-block;
  907. font-size: $font-size-28;
  908. line-height: 68rpx;
  909. text-align: left;
  910. color: $text-color;
  911. margin-left: 10rpx;
  912. }
  913. }
  914. .order-title-b {
  915. width: 100%;
  916. height: 40rpx;
  917. float: left;
  918. margin-top: 8rpx;
  919. .order-title-btxt {
  920. float: left;
  921. font-size: $font-size-28;
  922. line-height: 40rpx;
  923. color: #999999;
  924. text-align: lef;
  925. }
  926. .order-title-tip {
  927. float: right;
  928. font-size: $font-size-28;
  929. line-height: 40rpx;
  930. text-align: right;
  931. color: #ff2a2a;
  932. }
  933. }
  934. }
  935. .goods-title {
  936. width: 100%;
  937. height: 56rpx;
  938. float: left;
  939. margin-top: 10rpx;
  940. .floor-item-act {
  941. height: 56rpx;
  942. text-align: center;
  943. box-sizing: border-box;
  944. float: left;
  945. padding: 10rpx 0;
  946. margin-right: 12rpx;
  947. }
  948. .title-text {
  949. width: 400rpx;
  950. overflow: hidden;
  951. text-overflow: ellipsis;
  952. white-space: nowrap;
  953. float: left;
  954. font-size: $font-size-28;
  955. color: $text-color;
  956. text-align: left;
  957. line-height: 56rpx;
  958. font-weight: bold;
  959. .iconfont {
  960. color: #999999;
  961. font-size: 28rpx;
  962. margin-left: 10rpx;
  963. }
  964. .paymenttext {
  965. color: #f9a94b;
  966. font-size: $font-size-22;
  967. margin-left: 20rpx;
  968. }
  969. }
  970. }
  971. .goods-item {
  972. width: 100%;
  973. height: auto;
  974. }
  975. .goods-pros-t {
  976. width: 100%;
  977. height: auto;
  978. padding: 24rpx 0;
  979. .pros-img {
  980. float: left;
  981. width: 210rpx;
  982. height: 100%;
  983. border-radius: 10rpx;
  984. margin: 0 26rpx 0 0;
  985. position: relative;
  986. .tips {
  987. display: inline-block;
  988. width: 80rpx;
  989. height: 40rpx;
  990. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  991. line-height: 40rpx;
  992. text-align: center;
  993. font-size: $font-size-24;
  994. color: #ffffff;
  995. border-radius: 10rpx 0 10rpx 0;
  996. position: absolute;
  997. top: 0;
  998. left: 0;
  999. }
  1000. image {
  1001. width: 210rpx;
  1002. height: 210rpx;
  1003. border-radius: 10rpx;
  1004. border: 1px solid #f3f3f3;
  1005. }
  1006. }
  1007. }
  1008. .pros-product {
  1009. width: 460rpx;
  1010. height: 100%;
  1011. line-height: 36rpx;
  1012. font-size: $font-size-26;
  1013. position: relative;
  1014. float: left;
  1015. .producttitle {
  1016. width: 100%;
  1017. display: inline-block;
  1018. height: auto;
  1019. text-overflow: ellipsis;
  1020. display: -webkit-box;
  1021. word-break: break-all;
  1022. -webkit-box-orient: vertical;
  1023. -webkit-line-clamp: 2;
  1024. overflow: hidden;
  1025. margin-bottom: 8rpx;
  1026. }
  1027. .productspec {
  1028. height: 36rpx;
  1029. color: #999999;
  1030. margin: 30rpx 0;
  1031. }
  1032. .productprice {
  1033. height: 48rpx;
  1034. width: 100%;
  1035. float: left;
  1036. .price {
  1037. line-height: 48rpx;
  1038. font-size: $font-size-28;
  1039. width: 48%;
  1040. color: #ff2a2a;
  1041. float: left;
  1042. font-weight: bold;
  1043. &.none {
  1044. text-decoration: line-through;
  1045. color: #999999;
  1046. }
  1047. }
  1048. .count {
  1049. height: 100%;
  1050. float: right;
  1051. position: relative;
  1052. .small {
  1053. color: #666666;
  1054. }
  1055. }
  1056. }
  1057. .floor-item-act {
  1058. width: 100%;
  1059. height: 56rpx;
  1060. text-align: center;
  1061. box-sizing: border-box;
  1062. float: left;
  1063. padding: 0 0 10rpx 0;
  1064. }
  1065. }
  1066. .order-footer {
  1067. width: 100%;
  1068. height: 78rpx;
  1069. float: left;
  1070. margin-top: 20rpx;
  1071. .order-footer-top {
  1072. width: 100%;
  1073. height: 34rpx;
  1074. line-height: 34rpx;
  1075. font-size: $font-size-24;
  1076. color: #999999;
  1077. text-align: right;
  1078. }
  1079. .order-footer-bot {
  1080. width: 100%;
  1081. float: left;
  1082. height: 48rpx;
  1083. line-height: 48rpx;
  1084. font-size: $font-size-28;
  1085. color: $text-color;
  1086. .count {
  1087. width: 50%;
  1088. float: left;
  1089. text-align: left;
  1090. font-weight: bold;
  1091. }
  1092. .money {
  1093. width: 50%;
  1094. float: right;
  1095. text-align: right;
  1096. }
  1097. }
  1098. }
  1099. </style>