order-list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  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 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(shop) {
  345. if(shop.shopType === 2){
  346. return
  347. }
  348. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shop.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(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  540. } else {
  541. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  542. }
  543. }
  544. })
  545. .catch(error => {
  546. this.$util.msg(error.msg, 2000)
  547. })
  548. },
  549. hanldPaymentConfirm(data) {
  550. //余额抵扣跳转
  551. this.OrderService.OrderBalanceDeduction({ orderId: data.order.orderId })
  552. .then(response => {
  553. if (data.type === 2) {
  554. let _data = { orderId: data.order.orderId }
  555. this.$api.navigateTo(
  556. `/pages/user/order/success?type=deduction&data=${JSON.stringify({ data: _data })}`
  557. )
  558. } else {
  559. if (data.order.onlinePayFlag === 1) {
  560. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.order.orderId}`)
  561. } else {
  562. this.$api.navigateTo(
  563. `/pages/user/order/order-pay-list?orderId=${data.order.orderId}`
  564. )
  565. }
  566. }
  567. })
  568. .catch(error => {
  569. this.$util.msg(error.msg, 2000)
  570. })
  571. },
  572. hanldCancelConfirm(data) {
  573. //不使用余额抵扣直接跳转收银台
  574. if (data.onlinePayFlag === 1) {// 只能线下
  575. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  576. } else {
  577. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  578. }
  579. },
  580. hanldConfirmFn(orderId) {
  581. //确认打款供应商
  582. this.$util.modal(
  583. '提示',
  584. '确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?',
  585. '确定',
  586. '取消',
  587. true,
  588. () => {
  589. this.OrderService.confirmpayment({ orderId: orderId })
  590. .then(response => {
  591. this.$util.msg('确认成功', 2000, true, 'success')
  592. setTimeout(() => {
  593. this.getOrderDatainit(this.currentTab)
  594. }, 2000)
  595. })
  596. .catch(error => {
  597. this.$util.msg(error.msg, 2000)
  598. })
  599. }
  600. )
  601. },
  602. handOrderConfirm(orderId) {
  603. //确认收货
  604. this.$util.modal('提示', '是否确认收货', '确定', '取消', true, () => {
  605. this.OrderService.ConfirmReceipt({ orderId: orderId })
  606. .then(response => {
  607. this.beansType = 7
  608. this.beanNumber = 100
  609. this.isActivityBean = true
  610. })
  611. .catch(error => {
  612. this.$util.msg(error.msg, 2000)
  613. })
  614. })
  615. },
  616. handOrderConfirmation(orderId) {
  617. //确认订单
  618. this.$util.modal('提示', '确认此订单?', '确定', '取消', true, () => {
  619. this.OrderService.AffirmOrder({ orderId: orderId })
  620. .then(response => {
  621. this.$util.msg(response.msg, 2000, true, 'success')
  622. setTimeout(() => {
  623. this.getOrderDatainit(this.currentTab)
  624. }, 2000)
  625. })
  626. .catch(error => {
  627. this.$util.msg(error.msg, 2000)
  628. })
  629. })
  630. },
  631. handOrderDetele(orderId) {
  632. //删除订单
  633. this.$util.modal('提示', '确认删除该订单吗?', '确定', '取消', true, () => {
  634. this.OrderService.DeleteOrder({ orderId: orderId })
  635. .then(response => {
  636. this.$util.msg(response.msg, 2000, true, 'success')
  637. setTimeout(() => {
  638. this.getOrderDatainit(this.currentTab)
  639. }, 2000)
  640. })
  641. .catch(error => {
  642. this.$util.msg(error.msg, 2000)
  643. })
  644. })
  645. },
  646. handCenceConfirm(orderId) {
  647. //取消订单
  648. this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
  649. this.OrderService.CancelOrder({ orderId: orderId })
  650. .then(response => {
  651. this.$util.msg(response.msg, 2000, true, 'success')
  652. setTimeout(() => {
  653. this.getOrderDatainit(this.currentTab)
  654. }, 2000)
  655. })
  656. .catch(error => {
  657. this.$util.msg(error.msg, 2000)
  658. })
  659. })
  660. },
  661. handlSearchPath() {
  662. this.$api.navigateTo('/pages/search/search-order')
  663. },
  664. onShareAppMessage(res) {
  665. //分享转发
  666. this.isShareModal = false
  667. if (res.from === 'button') {
  668. // 来自页面内转发按钮
  669. }
  670. return {
  671. title: '您有新的分享订单,快来查看吧~',
  672. path: `/pages/user/order/order-sharelogin?orderId=${this.btnoRderID}&userId=${this.userId}`,
  673. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  674. }
  675. },
  676. orderPriceToFixed(n) {
  677. let price = ''
  678. price = n.toFixed(2)
  679. return price
  680. },
  681. getHeaderTopHeight() {
  682. // 状态栏高度
  683. let statusBarHeight = this.systeminfo.statusBarHeight
  684. let headerPosi = this.headerBtnPosi
  685. let btnPosi = {
  686. // 胶囊实际位置,坐标信息不是左上角原点
  687. height: headerPosi.height,
  688. width: headerPosi.width,
  689. // 胶囊top - 状态栏高度
  690. top: headerPosi.top - statusBarHeight,
  691. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  692. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  693. // 屏幕宽度 - 胶囊right
  694. right: this.systeminfo.screenWidth - headerPosi.right
  695. }
  696. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  697. },
  698. setHeaderBtnPosi() {
  699. // 获得胶囊按钮位置信息
  700. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  701. return headerBtnPosi
  702. },
  703. setSysteminfo() {
  704. let systeminfo
  705. uni.getSystemInfo({
  706. // 获取设备信息
  707. success: res => {
  708. systeminfo = res
  709. }
  710. })
  711. return systeminfo
  712. },
  713. PromotionsFormat(promo) {
  714. //促销活动类型数据处理
  715. if (promo != null) {
  716. if (promo.type == 1 && promo.mode == 1) {
  717. return true
  718. } else {
  719. return false
  720. }
  721. }
  722. return false
  723. },
  724. StateExpFormat(state) {
  725. //订单状态文字和颜色
  726. var HtmlStateText = '',
  727. stateTextObject = {
  728. 0: '待确认',
  729. 4: '交易完成',
  730. 5: '订单完成',
  731. 6: '已关闭',
  732. 7: '交易全退',
  733. 77: '交易全退',
  734. 11: '待付款待发货',
  735. 12: '待付款部分发货',
  736. 13: '待付款已发货',
  737. 21: '部分付款待发货',
  738. 22: '部分付款部分发货',
  739. 23: '部分付款已发货',
  740. 31: '已付款待发货',
  741. 32: '已付款部分发货',
  742. 33: '已付款已发货',
  743. 111: '待付款待发货'
  744. }
  745. Object.keys(stateTextObject).forEach(function(key) {
  746. if (key == state) {
  747. HtmlStateText = stateTextObject[key]
  748. }
  749. })
  750. return HtmlStateText
  751. },
  752. handleBeanlClick() {
  753. //关闭采美豆弹窗
  754. this.isActivityBean = false
  755. this.getOrderDatainit(this.currentTab)
  756. }
  757. },
  758. onPageScroll(e) {
  759. this.scrollTop = e.scrollTop
  760. },
  761. onShow() {
  762. this.isModalLayer = false
  763. this.getOrderDatainit(this.currentTab)
  764. }
  765. }
  766. </script>
  767. <style lang="scss">
  768. /*tabbar start*/
  769. ::-webkit-scrollbar {
  770. width: 0;
  771. height: 0;
  772. color: transparent;
  773. }
  774. .order-section-top {
  775. width: 100%;
  776. position: fixed;
  777. top: 0;
  778. left: 0;
  779. z-index: 99;
  780. background: #ffffff;
  781. }
  782. .tab-view::before {
  783. content: '';
  784. position: absolute;
  785. border-bottom: 1rpx solid #eaeef1;
  786. -webkit-transform: scaleY(0.5);
  787. transform: scaleY(0.5);
  788. bottom: 0;
  789. right: 0;
  790. left: 0;
  791. }
  792. .tab-view {
  793. width: 100%;
  794. height: 80rpx;
  795. overflow: hidden;
  796. box-sizing: border-box;
  797. background: #fff;
  798. white-space: nowrap;
  799. border-top: 1px solid #f7f7f7;
  800. }
  801. .tab-bar-item {
  802. padding: 0;
  803. height: 80rpx;
  804. min-width: 80rpx;
  805. line-height: 80rpx;
  806. margin: 0 28rpx;
  807. display: inline-block;
  808. text-align: center;
  809. box-sizing: border-box;
  810. }
  811. .tab-bar-title {
  812. height: 80rpx;
  813. line-height: 80rpx;
  814. font-size: $font-size-28;
  815. color: $text-color;
  816. }
  817. .active {
  818. border-bottom: 6rpx solid $color-system;
  819. }
  820. .active .tab-bar-title {
  821. color: $color-system !important;
  822. }
  823. /*tabbar end*/
  824. .scoll-y {
  825. height: 100%;
  826. }
  827. page {
  828. background: #f7f7f7;
  829. }
  830. .container {
  831. padding-bottom: env(safe-area-inset-bottom);
  832. height: auto;
  833. position: relative;
  834. }
  835. .tui-order-content {
  836. width: 100%;
  837. height: auto;
  838. }
  839. .tui-order-list {
  840. margin-top: 90rpx;
  841. width: 100%;
  842. position: relative;
  843. }
  844. .tui-order-item {
  845. display: flex;
  846. flex-direction: column;
  847. width: 702rpx;
  848. padding: 20rpx 24rpx 0 24rpx;
  849. background: #fff;
  850. border-bottom: 20rpx solid #f7f7f7;
  851. }
  852. .order-title {
  853. width: 100%;
  854. height: auto;
  855. .order-title-t {
  856. width: 100%;
  857. height: 68rpx;
  858. float: left;
  859. line-height: 68rpx;
  860. position: relative;
  861. .bage-icon {
  862. width: 50rpx;
  863. height: 50rpx;
  864. display: block;
  865. position: absolute;
  866. right: 0;
  867. top: 9rpx;
  868. }
  869. .bage-buss {
  870. display: inline-block;
  871. width: 72rpx;
  872. height: 30rpx;
  873. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  874. border-radius: 4rpx;
  875. line-height: 30rpx;
  876. font-size: $font-size-22;
  877. text-align: center;
  878. color: #ffffff;
  879. }
  880. .bage-auto {
  881. display: inline-block;
  882. width: 72rpx;
  883. height: 30rpx;
  884. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  885. border-radius: 4rpx;
  886. line-height: 30rpx;
  887. font-size: $font-size-22;
  888. text-align: center;
  889. color: #ffffff;
  890. }
  891. .bage-text {
  892. display: inline-block;
  893. font-size: $font-size-28;
  894. line-height: 68rpx;
  895. text-align: left;
  896. color: $text-color;
  897. margin-left: 10rpx;
  898. }
  899. }
  900. .order-title-b {
  901. width: 100%;
  902. height: 40rpx;
  903. float: left;
  904. margin-top: 8rpx;
  905. .order-title-btxt {
  906. float: left;
  907. font-size: $font-size-28;
  908. line-height: 40rpx;
  909. color: #999999;
  910. text-align: lef;
  911. }
  912. .order-title-tip {
  913. float: right;
  914. font-size: $font-size-28;
  915. line-height: 40rpx;
  916. text-align: right;
  917. color: #ff2a2a;
  918. }
  919. }
  920. }
  921. .goods-title {
  922. width: 100%;
  923. height: 56rpx;
  924. float: left;
  925. margin-top: 10rpx;
  926. .floor-item-act {
  927. height: 56rpx;
  928. text-align: center;
  929. box-sizing: border-box;
  930. float: left;
  931. padding: 10rpx 0;
  932. margin-right: 12rpx;
  933. }
  934. .title-text {
  935. width: 400rpx;
  936. overflow: hidden;
  937. text-overflow: ellipsis;
  938. white-space: nowrap;
  939. float: left;
  940. font-size: $font-size-28;
  941. color: $text-color;
  942. text-align: left;
  943. line-height: 56rpx;
  944. font-weight: bold;
  945. .iconfont {
  946. color: #999999;
  947. font-size: 28rpx;
  948. margin-left: 10rpx;
  949. }
  950. .paymenttext {
  951. color: #f9a94b;
  952. font-size: $font-size-22;
  953. margin-left: 20rpx;
  954. }
  955. }
  956. }
  957. .goods-item {
  958. width: 100%;
  959. height: auto;
  960. }
  961. .goods-pros-t {
  962. width: 100%;
  963. height: auto;
  964. padding: 24rpx 0;
  965. .pros-img {
  966. float: left;
  967. width: 210rpx;
  968. height: 100%;
  969. border-radius: 10rpx;
  970. margin: 0 26rpx 0 0;
  971. position: relative;
  972. .tips {
  973. display: inline-block;
  974. width: 80rpx;
  975. height: 40rpx;
  976. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  977. line-height: 40rpx;
  978. text-align: center;
  979. font-size: $font-size-24;
  980. color: #ffffff;
  981. border-radius: 10rpx 0 10rpx 0;
  982. position: absolute;
  983. top: 0;
  984. left: 0;
  985. }
  986. image {
  987. width: 210rpx;
  988. height: 210rpx;
  989. border-radius: 10rpx;
  990. border: 1px solid #f3f3f3;
  991. }
  992. }
  993. }
  994. .pros-product {
  995. width: 460rpx;
  996. height: 100%;
  997. line-height: 36rpx;
  998. font-size: $font-size-26;
  999. position: relative;
  1000. float: left;
  1001. .producttitle {
  1002. width: 100%;
  1003. display: inline-block;
  1004. height: auto;
  1005. text-overflow: ellipsis;
  1006. display: -webkit-box;
  1007. word-break: break-all;
  1008. -webkit-box-orient: vertical;
  1009. -webkit-line-clamp: 2;
  1010. overflow: hidden;
  1011. margin-bottom: 8rpx;
  1012. }
  1013. .productspec {
  1014. height: 36rpx;
  1015. color: #999999;
  1016. margin: 30rpx 0;
  1017. }
  1018. .productprice {
  1019. height: 48rpx;
  1020. width: 100%;
  1021. float: left;
  1022. .price {
  1023. line-height: 48rpx;
  1024. font-size: $font-size-28;
  1025. width: 48%;
  1026. color: #ff2a2a;
  1027. float: left;
  1028. font-weight: bold;
  1029. &.none {
  1030. text-decoration: line-through;
  1031. color: #999999;
  1032. }
  1033. }
  1034. .count {
  1035. height: 100%;
  1036. float: right;
  1037. position: relative;
  1038. .small {
  1039. color: #666666;
  1040. }
  1041. }
  1042. }
  1043. .floor-item-act {
  1044. width: 100%;
  1045. height: 56rpx;
  1046. text-align: center;
  1047. box-sizing: border-box;
  1048. float: left;
  1049. padding: 0 0 10rpx 0;
  1050. }
  1051. }
  1052. .order-footer {
  1053. width: 100%;
  1054. height: 78rpx;
  1055. float: left;
  1056. margin-top: 20rpx;
  1057. .order-footer-top {
  1058. width: 100%;
  1059. height: 34rpx;
  1060. line-height: 34rpx;
  1061. font-size: $font-size-24;
  1062. color: #999999;
  1063. text-align: right;
  1064. }
  1065. .order-footer-bot {
  1066. width: 100%;
  1067. float: left;
  1068. height: 48rpx;
  1069. line-height: 48rpx;
  1070. font-size: $font-size-28;
  1071. color: $text-color;
  1072. .count {
  1073. width: 50%;
  1074. float: left;
  1075. text-align: left;
  1076. font-weight: bold;
  1077. }
  1078. .money {
  1079. width: 50%;
  1080. float: right;
  1081. text-align: right;
  1082. }
  1083. }
  1084. }
  1085. </style>