business-order.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务订单</text>
  6. </view>
  7. </view>
  8. <u-sticky offset-top="-90">
  9. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  10. </u-sticky>
  11. <view class="card-box">
  12. <view class="card" v-for="(businessItem,index) in businessItemList" :key="index">
  13. <view class="t">
  14. <image class="icon" src="../../static/home-icon-01.png"></image>
  15. <text class="title">{{businessItem.companyName}}</text>
  16. </view>
  17. <view class="c">
  18. <view class="item car-num-item">
  19. <text class="car-num">{{businessItem.carNum}}</text>
  20. </view>
  21. <view class="item">
  22. <text class="p1">车型:</text>
  23. <text class="p2">{{businessItem.carType}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="p1">载重:</text>
  27. <text class="p2">{{businessItem.weight}}</text>
  28. </view>
  29. <view class="item">
  30. <text class="p1">状态:</text>
  31. <text class="p2">{{businessItem.state}}</text>
  32. </view>
  33. </view>
  34. <view class="b">
  35. <view class="btn b3" v-if="businessItem.btnShow==1" @click="fk(index)">确认付款</view>
  36. <view class="btn b1" v-if="businessItem.btnShow==1" @click="rc(index)">确认入场</view>
  37. <view class="btn b1" v-if="businessItem.btnShow==2" @click="cc(index)">确认出场</view>
  38. <view class="btn b3" v-if="businessItem.btnShow==2" @click="zd(index)">确认账单</view>
  39. </view>
  40. </view>
  41. </view>
  42. <u-loadmore style="margin: 30rpx;" :status="status"/>
  43. <uni-popup ref="fkpopup" type="dialog">
  44. <uni-popup-dialog type="success" title="确定已付款吗?" :duration="2000" @confirm="fkconfirm"></uni-popup-dialog>
  45. </uni-popup>
  46. <uni-popup ref="rcpopup" type="dialog">
  47. <uni-popup-dialog type="success" title="确定已入场吗?" :duration="2000" @confirm="rcconfirm"></uni-popup-dialog>
  48. </uni-popup>
  49. <uni-popup ref="ccpopup" type="dialog">
  50. <uni-popup-dialog type="success" title="确定已出场吗?" :duration="2000" @confirm="ccconfirm"></uni-popup-dialog>
  51. </uni-popup>
  52. <uni-popup ref="zdpopup" type="dialog">
  53. <uni-popup-dialog type="success" title="确认账单吗?" :duration="2000" @confirm="zdconfirm"></uni-popup-dialog>
  54. </uni-popup>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. current:0,
  62. status: 'loadmore',
  63. page: 0,
  64. tabs: [{
  65. name: '进场',
  66. }, {
  67. name: '出场',
  68. }
  69. ],
  70. businessItemList:[
  71. {
  72. companyName:'广西医科大一附院',
  73. carNum:'桂A.B5W61',
  74. carType:'小型汽车',
  75. weight:'5吨',
  76. state:'进场',
  77. btnShow:1
  78. },
  79. {
  80. companyName:'广西中医院',
  81. carNum:'桂A.A7JJ8',
  82. carType:'卡车',
  83. weight:'10吨',
  84. state:'出场',
  85. btnShow:2
  86. },
  87. {
  88. companyName:'广西中医院',
  89. carNum:'桂A.A7JJ8',
  90. carType:'卡车',
  91. weight:'10吨',
  92. state:'出场',
  93. btnShow:2
  94. },
  95. {
  96. companyName:'广西中医院',
  97. carNum:'桂A.A7JJ8',
  98. carType:'卡车',
  99. weight:'10吨',
  100. state:'出场',
  101. btnShow:2
  102. },
  103. {
  104. companyName:'广西中医院',
  105. carNum:'桂A.A7JJ8',
  106. carType:'卡车',
  107. weight:'10吨',
  108. state:'出场',
  109. btnShow:2
  110. }
  111. ]
  112. }
  113. },
  114. methods: {
  115. //点击上方切换栏,根据点击项重新加载数据
  116. change(index) {
  117. this.current = index;
  118. if(index==0){
  119. //只加载进场订单
  120. }
  121. if(index==1){
  122. //只加载出场订单
  123. }
  124. },
  125. //点击按钮
  126. //------------------------------------------
  127. fk(){
  128. this.$refs.fkpopup.open('center')
  129. },
  130. fkconfirm(index) {
  131. console.log('付款')
  132. this.$refs.fkpopup.close()
  133. },
  134. rc(){
  135. this.$refs.rcpopup.open('center')
  136. },
  137. rcconfirm(index) {
  138. console.log('入场')
  139. this.$refs.rcpopup.close()
  140. },
  141. cc(){
  142. this.$refs.ccpopup.open('center')
  143. },
  144. ccconfirm(index) {
  145. console.log('出场')
  146. this.$refs.ccpopup.close()
  147. },
  148. zd(){
  149. this.$refs.zdpopup.open('center')
  150. },
  151. zdconfirm(index) {
  152. console.log('账单')
  153. this.$refs.zdpopup.close()
  154. },
  155. //------------------------------------------
  156. //上拉加载更多,分页模拟数据
  157. onReachBottom() {
  158. if(this.page >= 3) return ;
  159. this.status = 'loading';
  160. this.page = ++ this.page;
  161. setTimeout(() => {
  162. this.businessItemList += 5;//接接口后把数据加上,懒得写假数据了
  163. if(this.page >= 3) this.status = 'nomore';
  164. else this.status = 'loading';
  165. }, 2000)
  166. }
  167. }
  168. }
  169. </script>
  170. <style lang="scss">
  171. .card-box{
  172. display: flex;
  173. width: 100%;
  174. flex-direction: column;
  175. .card{
  176. background-color: #fff;
  177. border-radius: 20rpx;
  178. margin: 20rpx 20rpx 0 20rpx;
  179. padding: 30rpx;
  180. box-sizing: border-box;
  181. display: flex;
  182. flex-direction: column;
  183. .t{
  184. width: 100%;
  185. display: flex;
  186. align-items: center;
  187. padding-bottom: 30rpx;
  188. border-bottom: 1rpx solid #f5f5f5;
  189. .icon{
  190. width: 40rpx;
  191. height: 40rpx;
  192. }
  193. .title{
  194. font-size: 30rpx;
  195. font-weight: bold;
  196. margin-left: 20rpx;
  197. }
  198. }
  199. .c{
  200. padding:15rpx 0 30rpx 0;
  201. display: flex;
  202. flex-wrap: wrap;
  203. border-bottom: 1rpx solid #f5f5f5;
  204. .item{
  205. width: 50%;
  206. padding: 20rpx 0;
  207. .car-num{
  208. background-color: #edf6ff;
  209. color: #0080ff;
  210. font-size: 44rpx;
  211. padding: 15rpx 0;
  212. text-align: center;
  213. width: 100%;
  214. border-radius: 10rpx;
  215. font-weight: bold;
  216. letter-spacing: 20rpx;
  217. }
  218. .p1{
  219. font-size: 28rpx;
  220. color: #999;
  221. }
  222. .p2{
  223. font-size: 28rpx;
  224. color: #191919;
  225. font-weight: bold;
  226. margin-left: 20rpx;
  227. }
  228. }
  229. .car-num-item{
  230. width: 100%;
  231. display: flex;
  232. align-items: center;
  233. justify-content: center;
  234. }
  235. }
  236. .b{
  237. display: flex;
  238. width: 100%;
  239. align-items: center;
  240. justify-content: space-between;
  241. .btn{
  242. height: 70rpx;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. width: calc(50% - 15rpx);
  247. margin: 30rpx 0 0 0;
  248. border-radius: 10rpx;
  249. border-width: 1rpx;
  250. box-sizing: border-box;
  251. }
  252. .b1{
  253. background-color: #0080ff;
  254. color: #fff;
  255. }
  256. .b2{
  257. background-color: #f7f7f7;
  258. color: #191919;
  259. }
  260. .b3{
  261. background-color: #fff;
  262. color: #0080ff;
  263. border: 1rpx solid #0080ff;
  264. }
  265. }
  266. }
  267. }
  268. @import '@/common/common.scss'
  269. </style>