order-list.vue 33 KB

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