operator.vue 9.3 KB

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