order-list.vue 26 KB

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