serviceorder.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <template>
  2. <view :class="[AppTheme]" class="container">
  3. <!-- 头部切换 -->
  4. <!-- #ifdef APP-PLUS || MP-WEIXIN -->
  5. <u-sticky offsetTop="0" style="z-index: 10;">
  6. <!-- #endif -->
  7. <!-- #ifdef H5 -->
  8. <u-sticky offsetTop="-44" style="z-index: 10;">
  9. <!-- #endif -->
  10. <view class="head_fixation">
  11. <u-tabs :scrollable="false" ref="uTabs" :list="navList" lineWidth="30" :lineColor="primary"
  12. :activeStyle="{
  13. color: primary,
  14. transform: 'scale(1.05)'
  15. }" :inactiveStyle="{
  16. color: '#606266',
  17. transform: 'scale(1)'
  18. }" :current="current" @click="tabsChange">
  19. </u-tabs>
  20. </view>
  21. </u-sticky>
  22. <!-- 订单列表 -->
  23. <view class="order_list">
  24. <view v-if="orderlist.length" class="order_item" v-for="(item, index) in orderlist" :key="index">
  25. <view class="model_one">
  26. <view class="model_two">
  27. <view></view>
  28. <view class="model_two_1">{{item.title}}</view>
  29. <view class="model_two_2">{{item.status}}</view>
  30. </view>
  31. <view class="model_three">
  32. <view class="model_three_1">
  33. <image :src="item.img"></image>
  34. </view>
  35. <view class="model_three_2">
  36. <view class="model_three_3">操作类型: {{item.operator_deatil}}</view>
  37. <view class="model_three_3">操作内容: {{item.content}}</view>
  38. <view class="model_three_3">备注: {{item.remark}}</view>
  39. </view>
  40. </view>
  41. <view class="model_four">
  42. <view class="model_four_1">
  43. <view class="model_four_2">操作对象</view>
  44. <view class="model_four_2">操作费用</view>
  45. <view class="model_four_2">操作员</view>
  46. </view>
  47. <view class="model_four_3">
  48. <view class="model_four_4">{{item.seed_name}}({{item.seed_num}}m²)</view>
  49. <view class="model_four_4">{{item.order_money}}</view>
  50. <view class="model_four_4" v-if="item.username">{{item.username}}</view>
  51. <view class="model_four_4" v-else>--</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <u-loadmore v-if="orderlist.length" :line="true" :status="status" :dashed='false' />
  57. <view class="footer_bottom"></view>
  58. <!-- 订单为空显示 -->
  59. <view v-if="orderlist.length==0">
  60. <u-empty text="暂无订单" mode="order" margin-top="100" custom-style="#fff">
  61. </u-empty>
  62. </view>
  63. </view>
  64. <!-- 回到顶部 -->
  65. <u-back-top :scroll-top="scrollTop" :custom-style="customstyle"></u-back-top>
  66. </view>
  67. </template>
  68. <script>
  69. import Landapi from '@/api/land/index.js';
  70. import Mallapi from '@/api/mall/index.js';
  71. export default {
  72. data() {
  73. return {
  74. status: 'loadmore',
  75. primary: this.$theme.primary,
  76. settingFile: getApp().globalData.siteinfo,
  77. // 当前排序方式视图
  78. nowsetyindex: 1,
  79. // 订单列表
  80. orderlist: [],
  81. //顶部距离
  82. scrollTop: 0,
  83. modalshow: false,
  84. content: '该订单还未支付,是否先支付?',
  85. seorder: {},
  86. nowindex: 1, //当前列表分页
  87. customstyle: {
  88. background: '#F4F6F8'
  89. },
  90. navList: [{
  91. name: '待处理'
  92. },
  93. {
  94. name: '进行中'
  95. },
  96. {
  97. name: '已完成'
  98. }
  99. ],
  100. current: 0,
  101. swiperCurrent: 0,
  102. nomorelist: false,
  103. };
  104. },
  105. onLoad() {
  106. this.getorderlist(this.swiperCurrent+1, this.nowindex);
  107. },
  108. onPullDownRefresh() {
  109. console.log('下拉刷新了')
  110. this.nowindex = 1
  111. this.getorderlist(this.swiperCurrent, this.nowindex);
  112. setTimeout(() => {
  113. uni.stopPullDownRefresh()
  114. }, 1500)
  115. },
  116. onReachBottom() {
  117. console.log('上拉加载了')
  118. this.nowindex++
  119. let parms = {
  120. p: this.nowindex,
  121. type: this.swiperCurrent
  122. };
  123. this.status = 'loading'
  124. Landapi.getoperator(parms).then(res => {
  125. if (res.status == 1) {
  126. if (res.data !== null && res.data !== undefined && res.data.length > 0) {
  127. // 获取服务套餐详情集合
  128. this.status = 'nomore'
  129. res.data.forEach(item => {
  130. that.orderlist.push(item);
  131. });
  132. if (res.data.length == 10) {
  133. this.status = 'loadmore'
  134. } else {
  135. this.status = 'nomore'
  136. }
  137. }
  138. } else {
  139. this.nowindex--
  140. this.status = "nomore"
  141. }
  142. })
  143. },
  144. onShow() {},
  145. methods: {
  146. // tabs通知swiper切换
  147. tabsChange(e) {
  148. this.nomorelist = false;
  149. this.nowindex = 1;
  150. if (this.swiperCurrent === e.index) {
  151. return;
  152. } else {
  153. this.swiperCurrent = e.index;
  154. this.orderlist = [];
  155. this.getorderlist(this.swiperCurrent + 1, this.nowindex);
  156. }
  157. },
  158. //获取订单列表
  159. getorderlist(type, p) {
  160. var that = this;
  161. let parms = {
  162. p: p,
  163. type: type
  164. };
  165. if (!this.nomorelist) {
  166. Landapi.getoperator(parms).then(res => {
  167. if (res.status == 1) {
  168. if (res.data !== null && res.data !== undefined && res.data.length > 0) {
  169. // 获取服务套餐详情集合
  170. this.orderlist = []
  171. res.data.forEach(item => {
  172. that.orderlist.push(item);
  173. });
  174. this.nowindex = p;
  175. this.status = 'nomore'
  176. if (res.data.length == 10) {
  177. this.status = 'loadmore'
  178. } else {
  179. this.status = 'nomore'
  180. }
  181. }
  182. } else {
  183. this.status = 'nomore'
  184. this.nomorelist = true;
  185. }
  186. });
  187. }
  188. },
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. .action-btn {
  194. width: 160upx;
  195. height: 60upx;
  196. margin: 0;
  197. margin-left: 24upx;
  198. padding: 0;
  199. text-align: center;
  200. line-height: 60upx;
  201. font-size: $font-sm + 2upx;
  202. background: #fff;
  203. border-radius: 100px;
  204. &:after {
  205. border-radius: 100px;
  206. }
  207. &.recom {
  208. background: #fff9f9;
  209. border-width: 1rpx;
  210. border-style: solid;
  211. }
  212. }
  213. .container {
  214. background: $page-color-base;
  215. height: 100%;
  216. box-sizing: border-box;
  217. }
  218. .nomorelist {
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. font-size: 30rpx;
  223. color: #333;
  224. margin-bottom: 20rpx;
  225. }
  226. .model_one{
  227. display: flex;
  228. flex-direction: column;
  229. .model_two{
  230. display: flex;
  231. justify-content: space-between;
  232. float: right;
  233. padding: 0 20rpx;
  234. .model_two_1{
  235. color: #333;
  236. font-weight: 600;
  237. }
  238. .model_two_2{
  239. color: red;
  240. font-size: 30rpx;
  241. }
  242. }
  243. .model_three{
  244. display: flex;
  245. justify-content: flex-start;
  246. align-items: center;
  247. padding: 0 20rpx;
  248. .model_three_1{
  249. image{
  250. width: 150rpx;
  251. height: 150rpx;
  252. }
  253. }
  254. .model_three_2{
  255. color: #999;
  256. padding: 20rpx;
  257. .model_three_3{
  258. padding: 10rpx 0;
  259. font-size: 28rpx;
  260. }
  261. }
  262. }
  263. .model_four{
  264. display: flex;
  265. flex-direction: column;
  266. .model_four_1{
  267. display: flex;
  268. justify-content: space-between;
  269. padding: 20rpx 50rpx;
  270. .model_four_2{
  271. color: #999;
  272. font-size: 28rpx;
  273. }
  274. }
  275. .model_four_3{
  276. display: flex;
  277. justify-content: space-between;
  278. padding: 20rpx 50rpx;
  279. .model_four_4{
  280. font-size: 28rpx;
  281. text-align: center;
  282. height: 45rpx;
  283. line-height:45rpx;
  284. min-width: 15%;
  285. }
  286. }
  287. }
  288. }
  289. .tabbom {
  290. // margin: 85rpx 0 0 0;
  291. }
  292. .swiper-box {
  293. height: calc(100vh - 44px);
  294. overflow-y: auto;
  295. }
  296. .footer_bottom {
  297. width: 100%;
  298. height: 40rpx;
  299. }
  300. .anjnaa {
  301. width: 100%;
  302. height: 1rpx;
  303. }
  304. .head_fixation {
  305. width: 100%;
  306. z-index: 11;
  307. background-color: #ffffff;
  308. }
  309. .data_display {
  310. padding: 0 17.5rpx;
  311. background-color: #ffffff;
  312. font-variant: common-ligatures;
  313. }
  314. .sort_set {
  315. display: flex;
  316. justify-content: space-around;
  317. align-items: center;
  318. height: 75rpx;
  319. }
  320. .order_list {
  321. overflow-y: auto;
  322. height: 100%;
  323. }
  324. .sort_item {
  325. font-size: 32rpx;
  326. color: #333;
  327. padding-bottom: 15rpx;
  328. border-bottom: 3px solid transparent;
  329. }
  330. .order_item {
  331. width: 97%;
  332. margin: 25rpx auto;
  333. padding: 30rpx 0 0 0;
  334. background-color: #ffffff;
  335. border-radius: 15rpx;
  336. box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08);
  337. }
  338. .farm_name {
  339. font-size: 34rpx;
  340. color: #000;
  341. padding: 0 20rpx;
  342. }
  343. .bor_solp {
  344. background-color: #999;
  345. height: 1rpx;
  346. width: 100%;
  347. transform: scaleY(0.3);
  348. margin: 25rpx 0;
  349. }
  350. .order_detil {
  351. display: flex;
  352. justify-content: space-between;
  353. padding: 0 20rpx;
  354. }
  355. .seed_item_thumbnail {
  356. object-fit: cover;
  357. border-radius: 10rpx;
  358. width: 180rpx;
  359. height: 126rpx;
  360. }
  361. .right_deile {
  362. width: calc(100% - 215rpx);
  363. }
  364. .article_title_p1 {
  365. display: flex;
  366. justify-content: flex-start;
  367. align-items: center;
  368. .atintl_icon {
  369. border-radius: 0 10rpx 0 10rpx;
  370. padding: 5rpx 10rpx;
  371. font-size: 28rpx;
  372. color: #ffffff;
  373. }
  374. .astin_text {
  375. font-size: 28rpx;
  376. color: #000;
  377. margin-left: 15rpx;
  378. }
  379. }
  380. .article_title_p2 {
  381. font-size: 26rpx;
  382. color: #000;
  383. margin: 25rpx 0;
  384. }
  385. .article_title_p3 {
  386. font-size: 26rpx;
  387. color: #000;
  388. }
  389. .pay_status {
  390. display: flex;
  391. justify-content: space-between;
  392. align-items: center;
  393. padding: 0 20rpx;
  394. }
  395. .pay_status_text {
  396. font-size: 28rpx;
  397. }
  398. .pay_status_button {
  399. border-radius: 40rpx;
  400. color: #ffffff;
  401. min-width: 90rpx;
  402. height: 40rpx;
  403. padding: 10rpx 25rpx 10rpx 25rpx;
  404. line-height: 40rpx;
  405. font-size: 28rpx;
  406. text-align: center;
  407. margin: 0 10rpx;
  408. }
  409. .nsnnsss {
  410. display: flex;
  411. justify-content: flex-start;
  412. }
  413. </style>