order-list.vue 29 KB

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