order-list.vue 31 KB

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