order-list.vue 29 KB

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