order-list.vue 26 KB

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