item-detail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务详情</text>
  6. </view>
  7. </view>
  8. <view class="card-box">
  9. <view class="card">
  10. <view class="t">
  11. <image class="icon" src="../../static/home-icon-01.png"></image>
  12. <text class="title">{{businessItem.itemTypeName}}</text>
  13. </view>
  14. <view class="c">
  15. <view class="item car-num-item">
  16. <text class="car-num">{{businessItem.itemName}}</text>
  17. </view>
  18. </view>
  19. <view class="c">
  20. <view class="item">
  21. <text class="p1">录入时间:</text>
  22. <text class="p2">{{businessItem.createTime}}</text>
  23. </view>
  24. </view>
  25. <view class="c">
  26. <view class="item">
  27. <text class="p1">状态:</text>
  28. <text class="p2">
  29. <text v-if="businessItem.pick==1">已接单</text>
  30. <text v-else>未接单</text>
  31. </text>
  32. </view>
  33. </view>
  34. <view class="c">
  35. <view class="item" v-if="businessItem.pickTime">
  36. <text class="p1">接单时间:</text>
  37. <text class="p2">
  38. <text>{{businessItem.pickTime}}</text>
  39. </text>
  40. </view>
  41. </view>
  42. <view class="c" v-if="businessItem.pick==1">
  43. <view class="item">
  44. <text class="p1">确认状态:</text>
  45. <text class="p2">
  46. <text v-if="businessItem.confirm==1">已确认</text>
  47. <text v-else>未确认</text>
  48. </text>
  49. </view>
  50. </view>
  51. <view class="c" v-if="businessItem.confirm==1">
  52. <view class="item">
  53. <text class="p1">确认时间:</text>
  54. <text class="p2">
  55. <text>{{businessItem.confirmTime}}</text>
  56. </text>
  57. </view>
  58. </view>
  59. <view class="b">
  60. <view class="btn b3" v-if="businessItem.pick==0" @click="pickFn">
  61. 接单</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. openid: '',
  72. businessItem: {}
  73. }
  74. },
  75. onLoad(option) {
  76. this.businessItem.id = option.itemId;
  77. this.openid = option.openid;
  78. this.getBusinessItem();
  79. },
  80. onBackPress() {
  81. this.$common.to('/pages/index/index')
  82. return true;
  83. },
  84. methods: {
  85. getBusinessItem() {
  86. this.$api.getBusinessItem({
  87. id: this.businessItem.id
  88. }).then(resp => {
  89. let data = resp.data;
  90. if (!data) {
  91. this.$common.toast('该业务已取消或删除');
  92. setTimeout(() => {
  93. this.$common.to('/pages/index/index')
  94. }, 2000)
  95. return;
  96. }
  97. this.businessItem = resp.data;
  98. })
  99. },
  100. pickFn() {
  101. let that = this;
  102. uni.showModal({
  103. title: '提示',
  104. content: '是否确认接单?',
  105. success(resp) {
  106. if (resp.confirm) {
  107. that.surePick();
  108. }
  109. }
  110. })
  111. },
  112. surePick() {
  113. let obj = {
  114. openid: this.openid,
  115. id: this.businessItem.id
  116. };
  117. this.$api.pickBusinessItem(obj).then(resp => {
  118. if (resp.code == 200) {
  119. this.$common.toast('已接单');
  120. this.getBusinessItem();
  121. }
  122. })
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="scss">
  128. .card-box {
  129. display: flex;
  130. width: 100%;
  131. flex-direction: column;
  132. .card {
  133. background-color: #fff;
  134. border-radius: 20rpx;
  135. margin: 20rpx 20rpx 0 20rpx;
  136. padding: 30rpx;
  137. box-sizing: border-box;
  138. display: flex;
  139. flex-direction: column;
  140. .t {
  141. width: 100%;
  142. display: flex;
  143. align-items: center;
  144. padding-bottom: 30rpx;
  145. border-bottom: 1rpx solid #f5f5f5;
  146. .icon {
  147. width: 40rpx;
  148. height: 40rpx;
  149. }
  150. .title {
  151. font-size: 35rpx;
  152. font-weight: bold;
  153. margin-left: 20rpx;
  154. }
  155. }
  156. .c {
  157. padding: 15rpx 0 30rpx 0;
  158. display: flex;
  159. flex-wrap: wrap;
  160. border-bottom: 1rpx solid #f5f5f5;
  161. .item {
  162. padding: 20rpx 0;
  163. .car-num {
  164. background-color: #edf6ff;
  165. color: #0080ff;
  166. font-size: 38rpx;
  167. padding: 15rpx 0;
  168. text-align: center;
  169. width: 100%;
  170. border-radius: 10rpx;
  171. font-weight: bold;
  172. }
  173. .p1 {
  174. font-size: 28rpx;
  175. color: #999;
  176. }
  177. .p2 {
  178. font-size: 28rpx;
  179. color: #191919;
  180. font-weight: bold;
  181. margin-left: 20rpx;
  182. }
  183. }
  184. .car-num-item {
  185. width: 100%;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. }
  190. }
  191. .b {
  192. display: flex;
  193. width: 100%;
  194. align-items: center;
  195. justify-content: space-between;
  196. .btn {
  197. height: 70rpx;
  198. display: flex;
  199. align-items: center;
  200. justify-content: center;
  201. width: calc(100% - 15rpx);
  202. margin: 30rpx 0 0 0;
  203. border-radius: 10rpx;
  204. border-width: 1rpx;
  205. box-sizing: border-box;
  206. }
  207. .b1 {
  208. background-color: #0080ff;
  209. color: #fff;
  210. }
  211. .b2 {
  212. background-color: #f7f7f7;
  213. color: #191919;
  214. }
  215. .b3 {
  216. background-color: #fff;
  217. color: #0080ff;
  218. border: 1rpx solid #0080ff;
  219. }
  220. .b4 {
  221. background-color: #ff0000;
  222. color: #fff;
  223. }
  224. }
  225. }
  226. }
  227. @import '@/common/common.scss'
  228. </style>