order-list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  1. <template>
  2. <view class="container" :style="{paddingTop:navbarHeight+'px'}">
  3. <!-- 自定义返回 -->
  4. <header-back :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :isDelete="isDelete" @goSearchPath="handlSearchPath"></header-back>
  5. <view class="order-section-top" :style="{marginTop:navbarHeight+'px'}">
  6. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  7. <view v-for="(item,index) in orderTabBar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']"
  8. :data-current="index" @tap.stop="onClickTab">
  9. <text class="tab-bar-title">{{item.text}}</text>
  10. </view>
  11. </scroll-view>
  12. </view>
  13. <swiper class="tab-content" :current="currentTab" duration="80" @animationfinish="onChange" :style="{height:winHeight+'px'}" >
  14. <swiper-item v-for="(tabItem,index) in orderTabBar" :key="index">
  15. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="false" :loadingType="5"></tui-skeleton>
  16. <scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower">
  17. <view :class="{'tui-order-list':scrollTop >= 0}" class="tui-skeleton clearfix">
  18. <!-- 空白页 -->
  19. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
  20. <!-- 列表 -->
  21. <view v-else class="tui-order-content">
  22. <view class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" >
  23. <view class="order-title">
  24. <view class="order-title-t">
  25. <text class="bage-buss tui-skeleton-fillet" v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4">协销</text>
  26. <text class="bage-auto tui-skeleton-fillet" v-if="order.orderSubmitType == 0 || order.orderSubmitType == 1 || order.orderSubmitType == 2">自主</text>
  27. <text class="bage-text tui-skeleton-fillet">订单编号:{{order.orderNo}}</text>
  28. <image class="bage-icon" src="https://static.caimei365.com/app/img/icon/icon-type@3x.png" mode="widthFix" v-if="order.secondHandOrderFlag == 1"></image>
  29. </view>
  30. <view class="order-title-b">
  31. <view class="order-title-btxt tui-skeleton-fillet">下单时间:{{order.orderTime}}</view>
  32. <view class="order-title-tip tui-skeleton-fillet">{{ StateExpFormat(order.status) }}</view>
  33. </view>
  34. </view>
  35. <block v-for="(shop,sindex) in order.shopOrderList" :key="sindex">
  36. <view class="goods-title">
  37. <view v-if="shop.shopPromotion" class="floor-item-act">
  38. <view class="floor-tags">{{shop.shopPromotion.name}}</view>
  39. </view>
  40. <view class="title-text" v-if="order.secondHandOrderFlag==1">{{shop.shopName}}<label class="paymenttext" v-if="order.affirmPaymentFlag==1">已确认打款供应商</label></view>
  41. <view class="title-text tui-skeleton-fillet" v-else @click="goShophome(shop.shopID)">{{shop.shopName}}<label class="iconfont icon-jinrudianpu"></label></view>
  42. </view>
  43. <view class="goods-item" v-for="(pros,prosIndex) in shop.orderProductList" :key="prosIndex" @click.stop="detail(order.orderID)">
  44. <view class="goods-pros-t">
  45. <view class="pros-img tui-skeleton-fillet">
  46. <image :src="pros.productImage" alt="" />
  47. <text class="tips" v-if="pros.productType ==2 || pros.productType ==1">赠品</text>
  48. </view>
  49. <view class="pros-product clearfix">
  50. <view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
  51. <view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
  52. <view class="productprice">
  53. <view class="price tui-skeleton-fillet">
  54. <text>¥{{pros.price | NumFormat}}</text>
  55. </view>
  56. <view class="count tui-skeleton-fillet">
  57. <text class="small">x</text>{{pros.num}}
  58. </view>
  59. </view>
  60. <view class="floor-item-act" v-if=" pros.productPromotion!=null ">
  61. <view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags">
  62. {{pros.productPromotion.name}}
  63. <text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
  64. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  65. </text>
  66. </view>
  67. <view v-else-if="pros.productPromotion.type !=3" class="floor-tags">{{pros.productPromotion.name}}</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </block>
  73. <view class="order-footer">
  74. <view class="order-footer-top" v-if="order.discountFee!=0">经理折扣:¥{{order.discountFee | NumFormat}}</view>
  75. <view class="order-footer-bot">
  76. <view class="count tui-skeleton-fillet">共{{order.productCount}}件商品</view>
  77. <view class="money tui-skeleton-fillet" v-if="order.status==31||order.status==32||order.status==33">已支付:<label style="color:#f94b4b ;">¥{{ order.receiptAmount | NumFormat }}</label></view>
  78. <view class="money tui-skeleton-fillet" v-else>待付总额:<label style="color:#f94b4b ;">¥{{ order.pendingPayments | NumFormat }}</label></view>
  79. </view>
  80. </view>
  81. <!-- 底部button -->
  82. <order-button ref="orderButton"
  83. :status="order.status"
  84. :order="order"
  85. @buttonConfirm="handButtonConfirm">
  86. </order-button>
  87. </view>
  88. <!--加载loadding-->
  89. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  90. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  91. <!--加载loadding-->
  92. </view>
  93. </view>
  94. </scroll-view>
  95. </swiper-item>
  96. </swiper>
  97. <!-- 付款弹窗 -->
  98. <order-model v-if="isPayModel"
  99. :payModelData="payModelData"
  100. :modelType='modelType'
  101. @cancelConfirm = "hanldCancelConfirm"
  102. @paymentConfirm ='hanldPaymentConfirm'/>
  103. <!-- 分享弹窗 -->
  104. <share-alert v-if="isShareModal" :orderID="btnoRderID" @shareConfirm ='onShareAppMessage' />
  105. <!-- 透明模态层 -->
  106. <modal-layer v-if='isModalLayer'></modal-layer>
  107. </view>
  108. </template>
  109. <script>
  110. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  111. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  112. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  113. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  114. import tuiNomore from "@/components/tui-components/nomore/nomore"
  115. import orderButton from '@/components/cm-module/orderDetails/orderListButton' //按钮
  116. import modalLayer from "@/components/modal-layer"
  117. import empty from "@/components/empty";
  118. import shareAlert from '@/components/cm-module/modelAlert/shareAlert' //分享弹窗
  119. import orderModel from '@/components/cm-module/modelAlert/order-alert' //付款弹窗
  120. export default {
  121. components: {
  122. headerBack,
  123. empty,
  124. btSearch,
  125. tuiLoadmore,
  126. tuiNomore,
  127. orderButton,
  128. tuiSkeleton,
  129. modalLayer,
  130. shareAlert,
  131. orderModel
  132. },
  133. data() {
  134. return {
  135. CustomBar:this.CustomBar,// 顶部导航栏高度
  136. orderTabBar: [{state: 0,text: '全部订单',orderList: []},
  137. {state: 1,text: '待确认',orderList: []},
  138. {state: 2,text: '待付款',orderList: []},
  139. {state: 3,text: '待发货',orderList: []},
  140. {state: 4,text: '已发货',orderList: []},
  141. {state: 5,text: '退货/款',orderList: []}
  142. ],
  143. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  144. systeminfo: this.setSysteminfo(), //获取设备信息
  145. nvabarData: { //顶部自定义导航
  146. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  147. showSearch: 1,
  148. title: '我的订单', // 导航栏 中间的标题
  149. },
  150. winHeight: "", //窗口高度
  151. currentTab: 0, //预设当前项的值
  152. scrollLeft: 0 ,//tab标题的滚动条位置
  153. userID:0,
  154. orderData: [],
  155. btnoRderID: 0, //点击按钮传入的的订单ID
  156. pageNum: 1, //页数
  157. pageSize: 10, //条数
  158. scrollTop: 0,
  159. skeletonShow: true,
  160. isDelete:false,
  161. isClickChange: false,
  162. isShareModal: false,//控制分享弹窗
  163. isModalLayer: false,
  164. isPayModel:false,
  165. loadding: false,
  166. pullUpOn: true,
  167. hasNextPage: false,
  168. pullFlag: true,
  169. navbarHeight:'',
  170. payModelData:{},
  171. hanldOrderData:{},
  172. modelType:0,
  173. nomoreText: '上拉显示更多',
  174. isOnloadFlag:false,
  175. }
  176. },
  177. onLoad(e) {
  178. let self = this;
  179. if(e.type ==='detele'){self.isDelete = true}
  180. self.currentTab = e.state
  181. self.isOnloadFlag = true
  182. self.getHeaderTopHeight()//设置自定义导航高度
  183. // 高度自适应
  184. uni.getSystemInfo({
  185. success: function(res) {
  186. let calc = res.windowHeight;
  187. self.winHeight = calc - self.CustomBar;
  188. }
  189. });
  190. },
  191. filters:{
  192. NumFormat(value) {//处理金额
  193. return Number(value).toFixed(2);
  194. },
  195. },
  196. methods: {
  197. goShophome(id){
  198. this.$api.navigateTo(`/supplier/pages/user/my-shop?shopId=${id}`)
  199. },
  200. // 滚动切换标签样式
  201. onChange: function(e) {
  202. let index = e.target.current || e.detail.current;
  203. if (this.isClickChange) {
  204. this.currentTab = index;
  205. this.isClickChange = false;
  206. return;
  207. }
  208. this.isClickChange = false;
  209. this.currentTab = index;
  210. this.checkCor();
  211. this.pageNum = 1
  212. this.pullUpOn = true //切换时隐藏
  213. this.loadding = false //切换时隐藏
  214. this.nomoreText = ''
  215. if(!this.isOnloadFlag){
  216. this.getOrderDatainit(this.currentTab,'tabChange')
  217. }
  218. },
  219. // 点击标题切换当前页时改变样式
  220. onClickTab: function(e) {
  221. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current;
  222. if (this.currentTab === tabIndex) {
  223. return false;
  224. } else {
  225. this.isClickChange = true;
  226. this.currentTab = tabIndex
  227. this.pageNum = 1
  228. this.pullUpOn = true //切换时隐藏
  229. this.loadding = false //切换时隐藏
  230. this.getOrderDatainit(this.currentTab)
  231. }
  232. },
  233. //判断当前滚动超过一屏时,设置tab标题滚动条。
  234. checkCor: function() {
  235. if (this.currentTab > 3) {
  236. //这里距离按实际计算
  237. this.scrollLeft = 300
  238. } else {
  239. this.scrollLeft = 0
  240. }
  241. },
  242. getOrderDatainit(index,source){
  243. /**
  244. * @订单初始化加载 仅加载第一页码
  245. * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
  246. * @param:userID(用户ID)
  247. * @param:pageNum(页码数)
  248. * @param:pageSize(每页条数)
  249. * @param:organizeID(全局变量组织ID)
  250. */
  251. setTimeout(()=>{
  252. this.skeletonShow = false
  253. this.isOnloadFlag = false
  254. },1500)
  255. let orderItem = this.orderTabBar[index];
  256. let state = orderItem.state;
  257. if(source === 'tabChange' && orderItem.loaded === true){
  258. //tab切换只有第一次需要加载数据
  259. return;
  260. }
  261. setTimeout(()=>{
  262. this.$api.getStorage().then((resolve) =>{
  263. this.userID = resolve.userID
  264. let params = {orderState:index,userId:this.userID,pageNum:1,pageSize:this.pageSize};
  265. this.OrderService.QueryOrderList(params).then(response =>{
  266. let orderList = response.data.results.filter(item=>{
  267. //添加不同状态下订单的表现形式
  268. item = Object.assign(item, this.StateExpFormat(item.state));
  269. return item;
  270. });
  271. orderItem.orderList =[];
  272. orderList.forEach(item=>{
  273. orderItem.orderList.push(item);
  274. })
  275. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  276. this.$set(orderItem, 'loaded', true);
  277. this.hasNextPage = response.data.hasNextPage;
  278. if(this.hasNextPage){
  279. this.pullUpOn = false
  280. this.nomoreText = '上拉显示更多'
  281. }else{
  282. if(orderItem.orderList.length < 2){
  283. this.pullUpOn = true
  284. }else{
  285. this.pullUpOn = false
  286. this.nomoreText = '已至底部'
  287. }
  288. }
  289. }).catch(error =>{
  290. this.$util.msg(error.msg,2000);
  291. })
  292. })
  293. }, 600);
  294. },
  295. getOnReachBottomData(index){//上拉加载
  296. this.pageNum+=1
  297. let params = {orderState:index,userId:this.userID,pageNum:this.pageNum,pageSize:this.pageSize};
  298. this.OrderService.QueryOrderList(params).then(response =>{
  299. let orderItem = this.orderTabBar[index];
  300. let resData = response.data.results
  301. this.hasNextPage = response.data.hasNextPage;
  302. orderItem.orderList = orderItem.orderList.concat(resData)
  303. this.pullFlag = false;// 防上拉暴滑
  304. setTimeout(()=>{this.pullFlag = true;},500)
  305. if(this.hasNextPage){
  306. this.pullUpOn = false
  307. this.nomoreText = '上拉显示更多'
  308. }else{
  309. this.loadding = false
  310. this.pullUpOn = false
  311. this.nomoreText = '已至底部'
  312. }
  313. }).catch(error =>{
  314. this.$util.msg(error.msg,2000)
  315. })
  316. },
  317. scrolltolower() {
  318. if(this.hasNextPage){
  319. this.loadding = true
  320. this.pullUpOn = true
  321. this.getOnReachBottomData(this.currentTab);
  322. }
  323. },
  324. detail(id) {//订单详情跳转
  325. console.log(id)
  326. this.isModalLayer = true;
  327. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderID=${id}`)
  328. },
  329. handButtonConfirm(data) {//获取点击
  330. this.handShowAlert(data)
  331. this.btnoRderID = data.orderId
  332. },
  333. handShowAlert(data) {//执行
  334. switch(data.type){
  335. case 'delete':
  336. this.handOrderDetele(data.orderId);
  337. break
  338. case 'cancel':
  339. this.handCenceConfirm(data.orderId)
  340. break
  341. case 'query':
  342. this.isModalLayer = true;
  343. this.$api.navigateTo('/pages/user/order/order-logistics?orderID='+data.orderId)
  344. break
  345. case 'confirm':
  346. this.handOrderConfirm(data.orderId);
  347. break
  348. case 'pay':
  349. this.hanldOrderData = data.order;
  350. this.getOrderPaymentValidation(data)
  351. break
  352. case 'confirmation':
  353. this.handOrderConfirmation(data.orderId);
  354. break
  355. case 'payment':
  356. this.hanldConfirmFn(data.orderId);
  357. break
  358. }
  359. },
  360. getOrderPaymentValidation(data){//监听根据付款状态做操作
  361. this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
  362. let dataCode = response.data.code
  363. this.payModelData = response.data
  364. switch(dataCode){
  365. case 1:
  366. this.isPayModel = true;
  367. this.modelType = 1
  368. break;
  369. case 2:
  370. this.isPayModel = true;
  371. this.modelType = 2
  372. break;
  373. case -1:
  374. this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
  375. break;
  376. default:
  377. if(response.data.onlinePayFlag == '1'){
  378. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${response.data.pendingPayments}&orderID=${data.orderId}`)
  379. }else{
  380. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
  381. }
  382. }
  383. }).catch(error =>{
  384. this.$util.msg(error.msg,2000)
  385. })
  386. },
  387. hanldPaymentConfirm(data){//余额抵扣跳转
  388. this.OrderService.OrderBalanceDeduction({orderId:data.order.orderId}).then(response =>{
  389. if(data.type === 2){
  390. let _data = {orderID:data.order.orderId}
  391. this.$api.navigateTo(`/pages/user/order/success?type=deduction&data=${JSON.stringify({data:_data})}`)
  392. }else{
  393. if(data.order.onlinePayFlag === '1'){
  394. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderID=${data.order.orderId}`)
  395. }else{
  396. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
  397. }
  398. }
  399. }).catch(error =>{
  400. this.$util.msg(error.msg,2000)
  401. })
  402. },
  403. hanldCancelConfirm(data){//不使用余额抵扣直接跳转收银台
  404. if(data.onlinePayFlag == '1'){
  405. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.hanldOrderData.pendingPayments}&orderID=${data.orderId}`)
  406. }else{
  407. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
  408. }
  409. },
  410. hanldConfirmFn (orderId){//确认打款供应商
  411. this.$util.modal('提示','确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?','确定','取消',true,() =>{
  412. this.OrderService.confirmpayment({orderID:orderId,userId:this.userID}).then(response =>{
  413. this.$util.msg('确认成功',2000,true,'success');
  414. setTimeout(() => {
  415. this.getOrderDatainit(this.currentTab)
  416. },2000)
  417. }).catch(error =>{
  418. this.$util.msg(error.msg,2000)
  419. })
  420. })
  421. },
  422. handOrderConfirm (id){//确认收货
  423. this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
  424. this.OrderService.ConfirmReceipt({orderID:id}).then(response =>{
  425. this.$util.msg(response.msg,2000,true,'success');
  426. setTimeout(() => {
  427. this.getOrderDatainit(this.currentTab)
  428. },2000)
  429. }).catch(error =>{
  430. this.$util.msg(error.msg,2000)
  431. })
  432. })
  433. },
  434. handOrderConfirmation (id){//确认订单
  435. this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
  436. this.OrderService.AffirmOrder({orderID:id}).then(response =>{
  437. this.$util.msg(response.msg,2000,true,'success');
  438. setTimeout(() => {
  439. this.getOrderDatainit(this.currentTab)
  440. },2000)
  441. }).catch(error =>{
  442. this.$util.msg(error.msg,2000)
  443. })
  444. })
  445. },
  446. handOrderDetele(id){//删除订单
  447. this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
  448. this.OrderService.DeleteOrder({orderID:id}).then(response =>{
  449. this.$util.msg(response.msg,2000,true,'success');
  450. setTimeout(() => {
  451. this.getOrderDatainit(this.currentTab)
  452. },2000)
  453. }).catch(error =>{
  454. this.$util.msg(error.msg,2000)
  455. })
  456. })
  457. },
  458. handCenceConfirm(id){//取消订单
  459. this.$util.modal('提示','确认取消该订单吗?','确定','取消',true,() =>{
  460. this.OrderService.CancelOrder({orderID:id}).then(response =>{
  461. this.$util.msg(response.msg,2000,true,'success');
  462. setTimeout(() => {
  463. this.getOrderDatainit(this.currentTab)
  464. },2000)
  465. }).catch(error =>{
  466. this.$util.msg(error.msg,2000)
  467. })
  468. })
  469. },
  470. handlSearchPath(){
  471. this.$api.navigateTo('/search/pages/search/search-order')
  472. },
  473. onShareAppMessage (res){//分享转发
  474. this.isShareModal = false
  475. if (res.from === 'button') {// 来自页面内转发按钮
  476. }
  477. return {
  478. title: '您有新的分享订单,快来查看吧~',
  479. path: `/pages/user/order/order-sharelogin?orderID=${this.btnoRderID}&userID=${this.userID}`,
  480. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  481. }
  482. },
  483. orderPriceToFixed (n){
  484. let price ='';
  485. price = n.toFixed(2);
  486. return price
  487. },
  488. getHeaderTopHeight (){ // 状态栏高度
  489. let statusBarHeight = this.systeminfo.statusBarHeight
  490. let headerPosi = this.headerBtnPosi
  491. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  492. height: headerPosi.height,
  493. width: headerPosi.width,
  494. // 胶囊top - 状态栏高度
  495. top: headerPosi.top - statusBarHeight,
  496. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  497. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  498. // 屏幕宽度 - 胶囊right
  499. right: this.systeminfo.screenWidth - headerPosi.right
  500. }
  501. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  502. },
  503. setHeaderBtnPosi (){
  504. // 获得胶囊按钮位置信息
  505. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  506. return headerBtnPosi
  507. },
  508. setSysteminfo (){
  509. let systeminfo;
  510. uni.getSystemInfo({ // 获取设备信息
  511. success: (res) => {
  512. systeminfo = res
  513. },
  514. })
  515. return systeminfo
  516. },
  517. PromotionsFormat(promo){//促销活动类型数据处理
  518. if(promo!=null){
  519. if(promo.type == 1 && promo.mode == 1){
  520. return true
  521. }else{
  522. return false
  523. }
  524. }
  525. return false
  526. },
  527. StateExpFormat(state){ //订单状态文字和颜色
  528. var HtmlStateText = '',
  529. stateTextObject={
  530. 0:'待确认',
  531. 4:'交易完成',
  532. 5:'订单完成',
  533. 6:'已关闭',
  534. 7:'交易全退',
  535. 77:'交易全退',
  536. 11:'待付款待发货',
  537. 12:'待付款部分发货',
  538. 13:'待付款已发货',
  539. 21:'部分付款待发货',
  540. 22:'部分付款部分发货',
  541. 23:'部分付款已发货',
  542. 31:'已付款待发货',
  543. 32:'已付款部分发货',
  544. 33:'已付款已发货',
  545. 111:'待付款待发货'
  546. };
  547. Object.keys(stateTextObject).forEach(function(key){
  548. if(key == state){
  549. HtmlStateText = stateTextObject[key]
  550. }
  551. });
  552. return HtmlStateText;
  553. }
  554. },
  555. onPageScroll(e) {
  556. this.scrollTop = e.scrollTop;
  557. },
  558. onShow() {
  559. this.isModalLayer = false;
  560. this.getOrderDatainit(this.currentTab)
  561. }
  562. }
  563. </script>
  564. <style lang="scss">
  565. /*tabbar start*/
  566. ::-webkit-scrollbar {
  567. width: 0;
  568. height: 0;
  569. color: transparent;
  570. }
  571. .order-section-top{
  572. width: 100%;
  573. position: fixed;
  574. top: 0;
  575. left: 0;
  576. z-index: 99;
  577. background: #FFFFFF;
  578. }
  579. .tab-view::before {
  580. content: '';
  581. position: absolute;
  582. border-bottom: 1rpx solid #eaeef1;
  583. -webkit-transform: scaleY(0.5);
  584. transform: scaleY(0.5);
  585. bottom: 0;
  586. right: 0;
  587. left: 0;
  588. }
  589. .tab-view {
  590. width: 100%;
  591. height: 80rpx;
  592. overflow: hidden;
  593. box-sizing: border-box;
  594. background: #fff;
  595. white-space: nowrap;
  596. border-top: 1px solid #F7F7F7;
  597. }
  598. .tab-bar-item {
  599. padding: 0;
  600. height: 80rpx;
  601. min-width: 80rpx;
  602. line-height: 80rpx;
  603. margin: 0 28rpx;
  604. display: inline-block;
  605. text-align: center;
  606. box-sizing: border-box;
  607. }
  608. .tab-bar-title {
  609. height: 80rpx;
  610. line-height: 80rpx;
  611. font-size:$font-size-28;
  612. color: $text-color;
  613. }
  614. .active {
  615. border-bottom: 6rpx solid $color-system;
  616. }
  617. .active .tab-bar-title {
  618. color: $color-system !important;
  619. }
  620. /*tabbar end*/
  621. .scoll-y {
  622. height: 100%;
  623. }
  624. page{
  625. background: #F7F7F7;
  626. }
  627. .container {
  628. padding-bottom: env(safe-area-inset-bottom);
  629. height: auto;
  630. position: relative;
  631. }
  632. .tui-order-content{
  633. width: 100%;
  634. height: auto;
  635. }
  636. .tui-order-list {
  637. margin-top: 90rpx;
  638. width: 100%;
  639. position: relative;
  640. }
  641. .tui-order-item {
  642. display: flex;
  643. flex-direction: column;
  644. width: 702rpx;
  645. padding:20rpx 24rpx 0 24rpx;
  646. background: #fff;
  647. border-bottom: 20rpx solid #F7F7F7;
  648. }
  649. .order-title{
  650. width: 100%;
  651. height: auto;
  652. .order-title-t{
  653. width: 100%;
  654. height: 68rpx;
  655. float: left;
  656. line-height: 68rpx;
  657. position: relative;
  658. .bage-icon{
  659. width: 50rpx;
  660. height: 50rpx;
  661. display: block;
  662. position: absolute;
  663. right: 0;
  664. top: 9rpx;
  665. }
  666. .bage-buss{
  667. display: inline-block;
  668. width: 72rpx;
  669. height: 30rpx;
  670. background:radial-gradient(circle,rgba(255,39,180,1) 0%,rgba(193,77,245,1) 100%);
  671. border-radius: 4rpx;
  672. line-height: 30rpx;
  673. font-size: $font-size-22;
  674. text-align: center;
  675. color: #FFFFFF;
  676. }
  677. .bage-auto{
  678. display: inline-block;
  679. width: 72rpx;
  680. height: 30rpx;
  681. background:radial-gradient(circle,rgba(255,180,39,1) 0%,rgba(245,142,77,1) 100%);
  682. border-radius: 4rpx;
  683. line-height: 30rpx;
  684. font-size: $font-size-22;
  685. text-align: center;
  686. color: #FFFFFF;
  687. }
  688. .bage-text{
  689. display: inline-block;
  690. font-size: $font-size-28;
  691. line-height: 68rpx;
  692. text-align: left;
  693. color: $text-color;
  694. margin-left: 10rpx;
  695. }
  696. }
  697. .order-title-b{
  698. width: 100%;
  699. height: 40rpx;
  700. float: left;
  701. margin-top: 8rpx;
  702. .order-title-btxt{
  703. float: left;
  704. font-size: $font-size-28;
  705. line-height: 40rpx;
  706. color: #999999;
  707. text-align: lef
  708. }
  709. .order-title-tip{
  710. float: right;
  711. font-size: $font-size-28;
  712. line-height: 40rpx;
  713. text-align: right;
  714. color: #FF2A2A;
  715. }
  716. }
  717. }
  718. .goods-title{
  719. width: 100%;
  720. height: 56rpx;
  721. float: left;
  722. margin-top:10rpx;
  723. .floor-item-act{
  724. height: 56rpx;
  725. text-align: center;
  726. box-sizing: border-box;
  727. float: left;
  728. padding: 10rpx 0;
  729. margin-right: 12rpx;
  730. .floor-tags{
  731. height: 28rpx;
  732. border-radius: 6rpx;
  733. background-color: #FFFFFF;
  734. line-height: 28rpx;
  735. color: $color-system;
  736. text-align: center;
  737. display: inline-block;
  738. padding:0 16rpx;
  739. font-size: $font-size-20;
  740. border: 1px solid #E15616;
  741. float: left;
  742. }
  743. }
  744. .title-text{
  745. width: 400rpx;
  746. overflow: hidden;
  747. text-overflow:ellipsis;
  748. white-space: nowrap;
  749. float: left;
  750. font-size: $font-size-28;
  751. color: $text-color;
  752. text-align: left;
  753. line-height: 56rpx;
  754. font-weight: bold;
  755. .iconfont{
  756. color: #999999;
  757. font-size: 28rpx;
  758. margin-left: 10rpx;
  759. }
  760. .paymenttext{
  761. color: #f9a94b;
  762. font-size: $font-size-22;
  763. margin-left: 20rpx;
  764. }
  765. }
  766. }
  767. .goods-item{
  768. width: 100%;
  769. height: auto;
  770. }
  771. .goods-pros-t{
  772. width: 100%;
  773. height: auto;
  774. padding:24rpx 0;
  775. .pros-img{
  776. float: left;
  777. width: 210rpx;
  778. height: 100%;
  779. border-radius: 10rpx;
  780. margin:0 26rpx 0 0;
  781. position: relative;
  782. .tips{
  783. display: inline-block;
  784. width: 80rpx;
  785. height: 40rpx;
  786. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  787. line-height: 40rpx;
  788. text-align: center;
  789. font-size: $font-size-24;
  790. color: #FFFFFF;
  791. border-radius:10rpx 0 10rpx 0 ;
  792. position: absolute;
  793. top:0;
  794. left: 0;
  795. }
  796. image{
  797. width: 210rpx;
  798. height: 210rpx;
  799. border-radius: 10rpx;
  800. border:1px solid #f3f3f3;
  801. }
  802. }
  803. }
  804. .pros-product{
  805. width: 460rpx;
  806. height: 100%;
  807. line-height: 36rpx;
  808. font-size: $font-size-26;
  809. position: relative;
  810. float: left;
  811. .producttitle{
  812. width: 100%;
  813. display: inline-block;
  814. height: auto;
  815. text-overflow:ellipsis;
  816. display: -webkit-box;
  817. word-break: break-all;
  818. -webkit-box-orient: vertical;
  819. -webkit-line-clamp: 2;
  820. overflow: hidden;
  821. margin-bottom: 8rpx;
  822. }
  823. .productspec{
  824. height: 36rpx;
  825. color: #999999;
  826. margin: 30rpx 0;
  827. }
  828. .productprice{
  829. height: 48rpx;
  830. width: 100%;
  831. float: left;
  832. .price{
  833. line-height: 48rpx;
  834. font-size: $font-size-28;
  835. width: 48%;
  836. color: #FF2A2A;
  837. float: left;
  838. font-weight: bold;
  839. }
  840. .count{
  841. height: 100%;
  842. float: right;
  843. position: relative;
  844. .small{
  845. color: #666666;
  846. }
  847. }
  848. }
  849. .floor-item-act{
  850. width: 100%;
  851. height: 56rpx;
  852. text-align: center;
  853. box-sizing: border-box;
  854. float: left;
  855. padding:0 0 10rpx 0;
  856. .floor-tags{
  857. height: 28rpx;
  858. border-radius: 6rpx;
  859. background-color: #FFFFFF;
  860. line-height: 28rpx;
  861. color: $color-system;
  862. text-align: center;
  863. display: inline-block;
  864. padding:0 16rpx;
  865. font-size: $font-size-20;
  866. border: 1px solid #E15616;
  867. float: left;
  868. }
  869. }
  870. }
  871. .order-footer{
  872. width: 100%;
  873. height: 78rpx;
  874. float: left;
  875. margin-top: 20rpx;
  876. .order-footer-top{
  877. width: 100%;
  878. height: 34rpx;
  879. line-height: 34rpx;
  880. font-size: $font-size-24;
  881. color: #999999;
  882. text-align: right;
  883. }
  884. .order-footer-bot{
  885. width: 100%;
  886. float: left;
  887. height: 48rpx;
  888. line-height: 48rpx;
  889. font-size: $font-size-28;
  890. color: $text-color;
  891. .count{
  892. width: 50%;
  893. float: left;
  894. text-align: left;
  895. font-weight: bold;
  896. }
  897. .money{
  898. width: 50%;
  899. float: right;
  900. text-align: right;
  901. }
  902. }
  903. }
  904. </style>