order-list.vue 27 KB

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