order-list-retail.vue 28 KB

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