order-list.vue 29 KB

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