order-list-retail.vue 28 KB

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