order-list.vue 28 KB

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