item-detail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. this.businessItem = resp.data;
  90. })
  91. },
  92. pickFn() {
  93. let that = this;
  94. uni.showModal({
  95. title: '提示',
  96. content: '是否确认接单?',
  97. success(resp) {
  98. if (resp.confirm) {
  99. that.surePick();
  100. }
  101. }
  102. })
  103. },
  104. surePick() {
  105. let obj = {
  106. openid: this.openid,
  107. id: this.businessItem.id
  108. };
  109. this.$api.pickBusinessItem(obj).then(resp => {
  110. if (resp.code == 200) {
  111. this.$common.toast('已接单');
  112. this.getBusinessItem();
  113. }
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. .card-box {
  121. display: flex;
  122. width: 100%;
  123. flex-direction: column;
  124. .card {
  125. background-color: #fff;
  126. border-radius: 20rpx;
  127. margin: 20rpx 20rpx 0 20rpx;
  128. padding: 30rpx;
  129. box-sizing: border-box;
  130. display: flex;
  131. flex-direction: column;
  132. .t {
  133. width: 100%;
  134. display: flex;
  135. align-items: center;
  136. padding-bottom: 30rpx;
  137. border-bottom: 1rpx solid #f5f5f5;
  138. .icon {
  139. width: 40rpx;
  140. height: 40rpx;
  141. }
  142. .title {
  143. font-size: 35rpx;
  144. font-weight: bold;
  145. margin-left: 20rpx;
  146. }
  147. }
  148. .c {
  149. padding: 15rpx 0 30rpx 0;
  150. display: flex;
  151. flex-wrap: wrap;
  152. border-bottom: 1rpx solid #f5f5f5;
  153. .item {
  154. padding: 20rpx 0;
  155. .car-num {
  156. background-color: #edf6ff;
  157. color: #0080ff;
  158. font-size: 38rpx;
  159. padding: 15rpx 0;
  160. text-align: center;
  161. width: 100%;
  162. border-radius: 10rpx;
  163. font-weight: bold;
  164. }
  165. .p1 {
  166. font-size: 28rpx;
  167. color: #999;
  168. }
  169. .p2 {
  170. font-size: 28rpx;
  171. color: #191919;
  172. font-weight: bold;
  173. margin-left: 20rpx;
  174. }
  175. }
  176. .car-num-item {
  177. width: 100%;
  178. display: flex;
  179. align-items: center;
  180. justify-content: center;
  181. }
  182. }
  183. .b {
  184. display: flex;
  185. width: 100%;
  186. align-items: center;
  187. justify-content: space-between;
  188. .btn {
  189. height: 70rpx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. width: calc(100% - 15rpx);
  194. margin: 30rpx 0 0 0;
  195. border-radius: 10rpx;
  196. border-width: 1rpx;
  197. box-sizing: border-box;
  198. }
  199. .b1 {
  200. background-color: #0080ff;
  201. color: #fff;
  202. }
  203. .b2 {
  204. background-color: #f7f7f7;
  205. color: #191919;
  206. }
  207. .b3 {
  208. background-color: #fff;
  209. color: #0080ff;
  210. border: 1rpx solid #0080ff;
  211. }
  212. .b4 {
  213. background-color: #ff0000;
  214. color: #fff;
  215. }
  216. }
  217. }
  218. }
  219. @import '@/common/common.scss'
  220. </style>