order-list.vue 29 KB

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