addorder.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navlist" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
  8. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
  9. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData" :style="{ height: height }">
  10. <!-- 空白页 -->
  11. <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
  12. <!-- 订单列表 -->
  13. <view class="dd-wrap" v-for="item in tabItem.list" :key="item">
  14. <view class="dd-id-status">
  15. <view class="dd-stata">
  16. 待服务
  17. </view>
  18. <view class="dd-id">
  19. ddddadfasfdasdf-adfas
  20. </view>
  21. <view class="dd-status">
  22. 已预约
  23. </view>
  24. </view>
  25. <view class="dd-info" style="margin-top: 20rpx;">
  26. 客服名称<text>小圆</text>
  27. </view>
  28. <view class="dd-info">
  29. 下单时间<text>2022-11-03 9:30~10:30</text>
  30. </view>
  31. <view class="dd-info">
  32. 预约时间<text class="chs" style="color:#FF5600;">2022-11-03 9:30~10:30</text>
  33. </view>
  34. <view class="dd-btm">
  35. <view class="btm-price">
  36. 订单金额: <text>¥2400</text>
  37. </view>
  38. <view class="btm-btn btm-btn-lx">
  39. 联系客户
  40. </view>
  41. <view class="btm-btn btm-btn-sm">
  42. 扫码完成
  43. </view>
  44. </view>
  45. <!-- <view class="add-dd">
  46. <image src="../../static/img/add-dd.png" mode=""></image>
  47. <view class="">
  48. 添加项目
  49. </view>
  50. </view> -->
  51. </view>
  52. <u-loadmore :status="tabItem.loadingType" />
  53. </scroll-view>
  54. </swiper-item>
  55. </swiper>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. height: '',
  63. tabCurrentIndex: 0,
  64. navlist: [{
  65. status: 0,
  66. title: '全部',
  67. list: 10,
  68. page: 1,
  69. limit: 10,
  70. loaded: false,
  71. loadingType: 'loadmore'
  72. },
  73. {
  74. status: 1,
  75. title: '待服务',
  76. list: [],
  77. page: 1,
  78. limit: 10,
  79. loaded: false,
  80. loadingType: 'loadmore'
  81. },
  82. {
  83. status: 2,
  84. title: '已完成',
  85. list: [],
  86. page: 1,
  87. limit: 10,
  88. loaded: false,
  89. loadingType: 'loadmore'
  90. }
  91. ]
  92. }
  93. },
  94. onLoad(opt) {
  95. },
  96. onShow() {
  97. },
  98. onReachBottom() {
  99. },
  100. onReady() {
  101. var _this = this;
  102. uni.getSystemInfo({
  103. success: resu => {
  104. const query = uni.createSelectorQuery();
  105. query.select('.swiper-box').boundingClientRect();
  106. query.exec(function(res) {
  107. _this.height = resu.windowHeight - res[0].top + 'px';
  108. console.log('打印页面的剩余高度', _this.height);
  109. });
  110. },
  111. fail: res => {}
  112. });
  113. },
  114. methods: {
  115. //顶部tab点击
  116. tabClick(index) {
  117. this.tabCurrentIndex = index;
  118. // this.loadData('tab')
  119. },
  120. // 获取数据
  121. loadData(type) {
  122. let that = this
  123. let index = that.tabCurrentIndex
  124. let item = that.navlist[index]
  125. if (type == 'reload') {
  126. item.loaded = false
  127. item.loadingType = 'more'
  128. item.page = 1
  129. item.list = []
  130. }
  131. if (type == 'tab' && item.loaded) {
  132. return
  133. }
  134. if (item.loadingType == 'loading' || item.loadingType == 'noMore') {
  135. return
  136. }
  137. item.loadingType = 'loading'
  138. },
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. .navbar {
  144. display: flex;
  145. height: 88rpx;
  146. padding: 0 5px;
  147. background: #fff;
  148. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  149. position: relative;
  150. z-index: 10;
  151. .nav-item {
  152. flex: 1;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. height: 100%;
  157. font-size: 15px;
  158. color: #999999;
  159. position: relative;
  160. &.current {
  161. color: #000;
  162. &:after {
  163. content: '';
  164. position: absolute;
  165. left: 50%;
  166. bottom: 0;
  167. transform: translateX(-50%);
  168. width: 44px;
  169. height: 0;
  170. border-bottom: 2px solid #4076d6;
  171. }
  172. }
  173. }
  174. }
  175. .dd-wrap {
  176. margin: auto;
  177. width: 713rpx;
  178. height: 314rpx;
  179. border-radius: 20rpx;
  180. background-color: #fff;
  181. padding-top: 35rpx;
  182. position: relative;
  183. margin-bottom: 27rpx;
  184. .dd-id-status {
  185. height: 40rpx;
  186. display: flex;
  187. align-items: center;
  188. width: 100%;
  189. font-size: 24rpx;
  190. padding: 0 23rpx 0 43rpx;
  191. .dd-stata {
  192. flex-shrink: 0;
  193. width: 123rpx;
  194. height: 39rpx;
  195. background: #FF5600;
  196. border-radius: 5rpx;
  197. text-align: center;
  198. line-height: 39rpx;
  199. font-weight: 400;
  200. color: #FFFFFF;
  201. }
  202. .dd-id {
  203. margin-left: 15rpx;
  204. flex-grow: 1;
  205. color: #1e395a;
  206. }
  207. .dd-status {
  208. flex-shrink: 0;
  209. font-weight: 400;
  210. color: #FCA930;
  211. }
  212. }
  213. .dd-info {
  214. font-size: 28rpx;
  215. font-weight: 500;
  216. color: #A0A0A0;
  217. padding-left: 42rpx;
  218. text {
  219. padding-left: 32rpx;
  220. font-size: 26rpx;
  221. font-weight: 500;
  222. color: #173456;
  223. }
  224. }
  225. .dd-btm {
  226. position: absolute;
  227. bottom: 0;
  228. height: 90rpx;
  229. width: 713rpx;
  230. background: linear-gradient(to right, #fbf5eb, #ffffff);
  231. border-radius: 0 0 20rpx 20rpx;
  232. display: flex;
  233. justify-content: space-between;
  234. align-items: center;
  235. padding: 0 20rpx 0 42rpx;
  236. .btm-price {
  237. font-size: 26rpx;
  238. color: #56687f;
  239. flex-grow: 1;
  240. text {
  241. color: #ff1e00;
  242. }
  243. }
  244. .btm-btn {
  245. width: 126rpx;
  246. height: 48rpx;
  247. line-height: 48rpx;
  248. background: #ebccae;
  249. border-radius: 10rpx;
  250. font-size: 24rpx;
  251. font-weight: 400;
  252. text-align: center;
  253. }
  254. .btm-btn-sm {
  255. background: #4D74CF;
  256. margin-left: 10rpx;
  257. color: #fff;
  258. }
  259. .btm-btn-lx {
  260. background-color: #fff;
  261. border: 1px solid #65676A;
  262. color: #56585C;
  263. }
  264. }
  265. .add-dd {
  266. position: absolute;
  267. bottom: 90rpx;
  268. right: 20rpx;
  269. width: 110rpx;
  270. height: 100rpx;
  271. font-size: 24rpx;
  272. font-weight: 500;
  273. color: #FF5600;
  274. text-align: center;
  275. image {
  276. display: block;
  277. margin: auto;
  278. width: 36rpx;
  279. height: 45rpx;
  280. }
  281. }
  282. }
  283. </style>