混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
4.8 KiB

1 week ago
  1. <template>
  2. <view class="content">
  3. <view class="head flex-sb">
  4. <view class="items">
  5. <view class="item-tab flex">
  6. <view @click="clickTabOne">施工前</view>
  7. <view @click="clickTabTwo">施工中</view>
  8. <view @click="clickTabThr">施工后</view>
  9. </view>
  10. <view class="item-active" :style="{'--step': step + 'rpx'}"></view>
  11. </view>
  12. </view>
  13. <view class="m20">
  14. <view class="re-empty" v-if="item.length<1">
  15. <view>暂无数据</view>
  16. </view>
  17. <view v-for="e in item" class="b-relative item-card mb20">
  18. <view class="m10 flex-sb">
  19. <view class="item-tip">请于施工前30分钟内到达现场</view>
  20. <view style="color: #aaa;" @click="clickDetail(e.id)">
  21. <span v-if="+e.step===0">待开工</span>
  22. <span v-if="+e.step===1">施工中</span>
  23. <span v-if="+e.step===2">已完成</span>
  24. <uni-icons type="right" color="#aaa" size="12"></uni-icons>
  25. </view>
  26. </view>
  27. <view class="mt20">
  28. <view>
  29. <view class="item-icon"/>
  30. <span>到场时间{{ $timeUtils.formatTime2Day(e.in_time) }}</span>
  31. </view>
  32. <view @click="openMap(e)">
  33. <view class="item-icon"/>
  34. <span>施工地点{{ e.address }}</span>
  35. <uni-icons type="paperplane" color="#333" size="12"></uni-icons>
  36. </view>
  37. <view>
  38. <view class="item-icon" style="border-color: #e5b746;"/>
  39. <span>施工已开始</span>
  40. </view>
  41. </view>
  42. <view class="mt20 flex-reverse">
  43. <button class="item-button" @click="clickStep(e.id)">拍摄照片</button>
  44. <button class="item-button jr" open-type="contact" v-if="+e.step===0">我要拒单</button>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. step: 8,
  55. item: [],
  56. status: 0
  57. }
  58. },
  59. onShow() {
  60. this.clickTabOne()
  61. },
  62. methods: {
  63. clickDetail(id){ uni.navigateTo({ url: `/pages/user/orderd?id=${id}` }) },
  64. clickBanner(){ uni.navigateTo({ url: '/pages/login/login' }) },
  65. clickTabOne(){
  66. this.step=8
  67. this.status = 0
  68. this.loadList()
  69. },
  70. clickTabTwo(){
  71. this.step=221
  72. this.status = 1
  73. this.loadList()
  74. },
  75. clickTabThr(){
  76. this.step=432
  77. this.status = 2
  78. this.loadList()
  79. },
  80. loadList(){
  81. this.item = []
  82. uni.showLoading({})
  83. this.$httpGet("/api/order/mine", {status: this.status}, (res) => {
  84. uni.hideLoading({})
  85. console.log('[/order/mine]', res);
  86. if(res.data){
  87. this.item = this.$utils.toArray(res.data)
  88. }
  89. })
  90. },
  91. clickStep(id){
  92. var stepUri = "/pages/user/step"
  93. if(+this.status === 0){
  94. stepUri = stepUri + "0"
  95. } else if(+this.status === 1){
  96. stepUri = stepUri + "1"
  97. } else if(+this.status === 2){
  98. stepUri = stepUri + "2"
  99. }
  100. uni.navigateTo({
  101. url: `${stepUri}?id=${id}`
  102. })
  103. },
  104. openMap(row){
  105. uni.openLocation({
  106. latitude: parseFloat(row.latitude),
  107. longitude:parseFloat(row.longitude),
  108. scale: 18,
  109. name: row.address || '未命名地址'
  110. })
  111. },
  112. }
  113. }
  114. </script>
  115. <style>
  116. page {
  117. background-color: #f5f5f5;
  118. --step: 1; /* 0.05 1 1.88 */
  119. --color: #F40000;
  120. }
  121. .head{
  122. height: 68rpx;
  123. padding: 10rpx 40rpx;
  124. background-color: #fff;
  125. }
  126. .items{
  127. width: 687rpx;
  128. height: 52rpx;
  129. padding: 8rpx 8rpx;
  130. border-radius: 34rpx;
  131. background-color: #f2f4f9;
  132. position: relative;
  133. }
  134. .item-tab{
  135. line-height: 52rpx;
  136. background-color: transparent;
  137. }
  138. .item-tab view{
  139. width: 33%;
  140. text-align: center;
  141. font-size: 26rpx;
  142. font-weight: normal;
  143. text-align: center;
  144. letter-spacing: -0.16px;
  145. color: #152748;
  146. background-color: transparent;
  147. z-index: 1;
  148. }
  149. .item-active{
  150. width: 229rpx;
  151. height: 52rpx;
  152. border-radius: 26rpx;
  153. background-color: #ffffff;
  154. position: absolute;
  155. left: var(--step);
  156. top: 8rpx;
  157. transition: .3s ease-in;
  158. z-index: 0;
  159. }
  160. .item-card{
  161. width: calc(100vw - 120rpx);
  162. height: calc(414rpx - 60rpx);
  163. background: #ffffff;
  164. padding: 30rpx;
  165. margin: 30rpx;
  166. border-radius: 24rpx;
  167. font-size: 24rpx;
  168. line-height: 52rpx;
  169. color: #333333;
  170. }
  171. .item-tip{
  172. padding: 0 10rpx;
  173. background-color: #F2F5F9;
  174. border-radius: 8rpx;
  175. font-size: 20rpx;
  176. font-weight: normal;
  177. letter-spacing: 0px;
  178. color: #152748;
  179. }
  180. .item-icon {
  181. width: 24rpx;
  182. height: 24rpx;
  183. box-sizing: border-box;
  184. border: 6rpx solid #68B04F;
  185. border-radius: 50%;
  186. display: inline-block;
  187. margin: 10rpx 15rpx -2rpx 0;
  188. }
  189. .item-button{
  190. width: 160rpx;
  191. height: 64rpx;
  192. line-height: 64rpx;
  193. border-radius: 32rpx;
  194. box-sizing: border-box;
  195. border: 2rpx solid #F40000;
  196. font-size: 28rpx;
  197. font-weight: normal;
  198. text-align: center;
  199. letter-spacing: 0px;
  200. color: #F40000;
  201. padding: 0 !important;
  202. margin: 0 !important;
  203. background-color: transparent !important;
  204. margin-left: 10rpx !important;
  205. }
  206. .jr{
  207. border-color: #aaa;
  208. color: #aaa;
  209. }
  210. </style>