index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="content">
  3. <view class="head_bgs">
  4. <view class="text-xl text-bold text-white u-margin-right-10">
  5. 订单列表
  6. </view>
  7. <u-icon name="list-dot" color="#fff" size="45"></u-icon>
  8. </view>
  9. <u-tabs :list="list" active-color="#F1C453" :is-scroll="false" :current="current" @change="change"></u-tabs>
  10. <view class="list_container">
  11. <view @click.stop="orderInfo(item.id)" class="list_item margin-lr-sm u-margin-top-30"
  12. v-for="(item,index) in listItem" :key="index">
  13. <view class="order-num u-font-28 u-padding-bottom-10 u-border-bottom" style="color:#909399;">
  14. 订单号:{{item.orders.order_sn}}
  15. </view>
  16. <view class="order-num u-margin-top-15 flex align-center u-padding-bottom-10 u-border-bottom">
  17. <u-avatar :src="item.users.avatar" size="100"></u-avatar>
  18. <view class="u-margin-left-20 flex-sub" style="color: #505559;">
  19. <view class="u-font-28" v-if="item.type==2">
  20. 评估类型:企业信用问题咨询
  21. </view>
  22. <view class="u-font-28" v-else>
  23. 评估类型:个人信用问题咨询
  24. </view>
  25. <view class="u-font-28">
  26. 评估用户:{{item.users.realname}}
  27. </view>
  28. <view class="u-font-28">
  29. 咨询项目个数:{{item.project_num}}
  30. </view>
  31. <view class="u-font-28 flex justify-between">
  32. <text>咨询总金额:{{item.price/100}}</text>
  33. <text class="u-font-30" style="color: #F1C453;">佣金:{{item.commission/100}}元</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="u-margin-top-15 flex align-center justify-between">
  38. <view class="u-font-26" style="color: #909399;">
  39. 联系电话:{{item.users.phone}}
  40. </view>
  41. <!-- <view class="flex align-center" v-if="item.status == 0">
  42. <button hover-class="none" @click.stop="tipsOrder(item.id,4,index)"
  43. class="left_btn u-margin-right-10">拒接</button>
  44. <button style="color: #fff;background: #F1C453;border-color: #F1C453;" hover-class="none"
  45. class="left_btn" @click.stop="tipsOrder(item.id,1,index)">接单</button>
  46. </view> -->
  47. <!-- <view class="flex align-center" v-else-if="item.status == 1">
  48. <button style="color: #fff;background: #0CBB07;border-color: #0CBB07;"
  49. @click.stop="tipsOrder(item.id,2,index)" hover-class="none" class="left_btn">提交订单</button>
  50. </view> -->
  51. <button style="color: #fff;background: #F1C453;border-color: #F1C453;margin: 0;"
  52. v-if="item.status == 0||item.status == 1" hover-class="none" class="left_btn"
  53. @click.stop="orderInfo(item.id)">查看详情</button>
  54. <view class="flex align-center" v-if="item.status == 2">
  55. <text
  56. class="text-red">审核状态:{{item.verify_status == 0?'待审核':item.verify_status == 1?'审核通过':'审核失败'}}</text>
  57. </view>
  58. <view class="flex align-center" v-else-if="item.status == 3">
  59. <text class="text-green">已完成</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <uni-load-more :loadingType="loadingType" :contentText="contentText" />
  65. <!-- <view class="cu-tabbar-height"></view>
  66. <view class="cu-tabbar-height"></view> -->
  67. </view>
  68. </template>
  69. <script>
  70. import {
  71. baseUrl,
  72. callurl
  73. } from '@/common/env.js'
  74. import util from '@/common/util.js'
  75. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  76. export default {
  77. components: {
  78. uniLoadMore
  79. },
  80. data() {
  81. return {
  82. list: [{
  83. name: '全部'
  84. }, {
  85. name: '待接单'
  86. }, {
  87. name: '进行中',
  88. }, {
  89. name: '已提交',
  90. }, {
  91. name: '已完成',
  92. }],
  93. current: 0,
  94. loadingType: 0,
  95. contentText: {
  96. contentdown: '上拉显示更多',
  97. contentrefresh: '正在加载...',
  98. contentnomore: '没有更多数据了'
  99. },
  100. indexPage: 1,
  101. listItem: []
  102. }
  103. },
  104. async onShow() {
  105. let res = await this.$u.post("manager/managerInfo")
  106. if (res.code == 200) {
  107. if (this.$u.test.isEmpty(res.data.web_openid) && util.is_weixin() && this.vuex_hasLogin) {
  108. window.location.href = baseUrl + '/common/wxManagerAuthorize?callback=' + callurl + res.data.id
  109. }
  110. this.$u.vuex("vuex_user", res.data)
  111. }
  112. this.indexPage = 1
  113. this.listItem = []
  114. this.getUserItem()
  115. },
  116. onReachBottom() {
  117. if (this.loadingType !== 0) {
  118. return;
  119. }
  120. this.loadingType = 1;
  121. this.getUserItem();
  122. },
  123. methods: {
  124. orderInfo(id) {
  125. uni.navigateTo({
  126. url: './orderInfo?id=' + id
  127. })
  128. },
  129. tipsOrder(id, status, index) {
  130. if (this.vuex_user.is_auth == 1 || this.vuex_user.is_auth == 0) {
  131. uni.showToast({
  132. title: "请先进行身份认证",
  133. icon: "none"
  134. })
  135. return false
  136. }
  137. let str = ''
  138. switch (status) {
  139. case 1:
  140. str = '是否接取该订单'
  141. break;
  142. case 4:
  143. str = '是否拒接该订单'
  144. break;
  145. case 2:
  146. str = '是否提交该订单'
  147. break;
  148. default:
  149. break;
  150. }
  151. uni.showModal({
  152. title: "温馨提示",
  153. content: str,
  154. success: (res) => {
  155. if (res.confirm) {
  156. this.updateOrder(id, status, index)
  157. }
  158. }
  159. })
  160. },
  161. async updateOrder(id, status, index) {
  162. let data = await this.$u.post('managerOrder/updateOrder', {
  163. id,
  164. status
  165. })
  166. if (data.code == 200) {
  167. if (this.current == 0) {
  168. if (status == 4) {
  169. this.listItem.splice(index, 1)
  170. } else {
  171. this.listItem[index].status = status
  172. }
  173. } else {
  174. this.listItem.splice(index, 1)
  175. }
  176. } else {
  177. uni.showToast({
  178. title: res.message,
  179. icon: "none"
  180. })
  181. return false
  182. }
  183. },
  184. change(index) {
  185. this.indexPage = 1
  186. this.listItem = []
  187. this.current = index;
  188. this.getUserItem()
  189. },
  190. async getUserItem() {
  191. let num = this.current
  192. let res = await this.$u.post("managerOrder/orderList", {
  193. page: this.indexPage,
  194. status: num - 1
  195. })
  196. if (res.code == 200) {
  197. this.listItem = this.listItem.concat(res.data.data)
  198. this.indexPage++
  199. if (res.data.current_page == res.data.last_page) {
  200. this.loadingType = 2;
  201. } else {
  202. this.loadingType = 0;
  203. }
  204. } else {
  205. uni.showToast({
  206. icon: 'none',
  207. title: res.message
  208. });
  209. this.loadingType = 0;
  210. }
  211. }
  212. }
  213. }
  214. </script>
  215. <style>
  216. .content {
  217. min-height: 100vh;
  218. }
  219. .head_bgs {
  220. background: #F1C453;
  221. height: 100rpx;
  222. width: 100%;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. }
  227. .list_container {
  228. /* margin-top: 20rpx; */
  229. }
  230. .list_item {
  231. padding: 20rpx;
  232. border-radius: 16rpx;
  233. box-shadow: 6rpx 6rpx 10rpx rgba(122, 122, 122, 0.2);
  234. background: #fff;
  235. }
  236. .order-num::after {
  237. border-color: #bbb;
  238. }
  239. button::after {
  240. display: none;
  241. }
  242. .left_btn {
  243. padding: 0;
  244. color: #909399;
  245. border: 2rpx solid rgba(144, 147, 153, .5);
  246. border-radius: 8rpx;
  247. width: 124rpx;
  248. height: 44rpx;
  249. font-size: 28rpx;
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. background: #fff;
  254. }
  255. </style>