order-list.vue 32 KB

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