index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="work-pages">
  3. <!-- 工作控制按钮及进度 -->
  4. <view class="work-cons flex-center">
  5. <!-- 操作按钮组件 -->
  6. <view class="work-button-wrap">
  7. <!-- 按钮 -->
  8. <view class="work-button flex-center" @click="startWork">
  9. <!-- 扇形 -->
  10. <view class="circle_process">
  11. <view class="wrapper right"><view class="circle rightcircle" :style="{ transform: `rotate(${rdeg}deg)` }"></view></view>
  12. <view class="wrapper left"><view class="circle leftcircle" :style="{ transform: `rotate(${ldeg}deg)` }"></view></view>
  13. </view>
  14. <view class="cirle-one"></view>
  15. <view class="cirle-two flex-center" v-for="item in 60"><view class="sector" :style="{ transform: `rotate(${item * 6}deg)` }"></view></view>
  16. <view class="cirle-three flex-center"></view>
  17. <view class="cirle-free" :class="status == 'working' ? 'w-stop' : 'w-start'"></view>
  18. <view class="cirle-sex flex-center">{{ status == 'working' ? '紧急停止' : '点击启动' }}</view>
  19. </view>
  20. <!-- 状态提示 -->
  21. <view class="work-button-tips">设备准备就绪</view>
  22. </view>
  23. </view>
  24. <!-- 说明提示 -->
  25. <view class="work-tips">
  26. <view class="work-dtime">
  27. 距离订单强制完成还剩
  28. <u-count-down
  29. @change="changeDtime"
  30. separator="zh"
  31. font-size="36"
  32. separator-size="28"
  33. color="#ff0000"
  34. :timestamp="timestamp"
  35. :show-days="false"
  36. :show-hours="false"
  37. ></u-count-down>
  38. </view>
  39. <view class="work-remarks">
  40. <view class="title">说明:</view>
  41. <view>
  42. 支付完成后
  43. <text class="red">请尽快启动洗车服务</text>
  44. ,否则订单将在5分钟后自动完成。
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 正在启动,归位弹框提示 -->
  49. <u-popup v-model="showStart" :mask-close-able="false" border-radius="10" mode="center" width="500rpx" height="400rpx">
  50. <view style="padding: 30rpx;display: flex;justify-content: center;text-align: center;">
  51. <!-- 启动中 -->
  52. <view v-if="status == 'start'">
  53. <u-image width="216px" height="120px" src="/static/img/start.png"></u-image>
  54. <view style="padding: 15rpx;">洗车机正在启动...</view>
  55. </view>
  56. <!-- 归位中 -->
  57. <view v-if="status == 'reseting'">
  58. <u-image width="216px" height="120px" src="/static/img/reset.png"></u-image>
  59. <view style="padding: 15rpx;">洗车机正在归位中...</view>
  60. </view>
  61. </view>
  62. </u-popup>
  63. <!-- 急停提示弹框 -->
  64. <u-popup v-model="showStop" :mask-close-able="false" border-radius="10" mode="center" width="80%">
  65. <view style="padding: 30rpx;text-align: center;">
  66. <view>
  67. <view style="font-weight: bold;">设备提示</view>
  68. <view style="display: flex;justify-content: center;padding: 10rpx 0;">
  69. <u-image width="165px" height="138px" src="/static/img/sbts.png"></u-image>
  70. </view>
  71. <u-divider>可能原因</u-divider>
  72. <view style="padding: 15rpx;text-align: left;">
  73. <view>1、洗车机紧急停止,本次服务结束</view>
  74. <view>2、因设备故障无法继续为您服务,所支付金额将退至您的支付账户</view>
  75. <view>3、如需再次服务,请退出车辆重新进入,再扫码支付洗车</view>
  76. <view>4、如需帮助请联系客服</view>
  77. </view>
  78. <view style="display: flex;padding: 20rpx 0;">
  79. <u-button @click="callPhone" style="width: 45%;border-radius: 0;">联系客服</u-button>
  80. <u-button @click="resetRabt" style="width: 45%;" type="error">洗车机归位</u-button>
  81. </view>
  82. </view>
  83. </view>
  84. </u-popup>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. timestamp: 300,
  92. rdeg: -135,
  93. ldeg: -135,
  94. step: 0,
  95. interId: null,
  96. status: 'start', // 状态,start 开始启动,working 正在工作,reseting 归位中
  97. showStart: false ,// 启动弹框提示
  98. showStop: false, // 急停提示
  99. };
  100. },
  101. onLoad() {},
  102. methods: {
  103. // 电话客服
  104. callPhone () {
  105. uni.makePhoneCall({
  106. phoneNumber: '114'
  107. })
  108. },
  109. // 倒计时监听,0 时自动结束订单
  110. changeDtime(time) {
  111. console.log(time);
  112. },
  113. // 归位机器
  114. resetRabt(){
  115. this.status = 'reseting';
  116. this.showStart = true;
  117. this.showStop = false;
  118. // 归位结束后
  119. },
  120. // 启动,急停按钮
  121. startWork() {
  122. // this.interId = setInterval(()=>{
  123. // this.loading(this.step++)
  124. // },1000)
  125. // 启动
  126. if (this.status == 'start') {
  127. this.showStart = true;
  128. // 启动成功
  129. setTimeout(() => {
  130. this.status = 'working';
  131. this.showStart = false;
  132. }, 3000);
  133. }
  134. // 急停
  135. if (this.status == 'working') {
  136. // 显示急停提示弹框
  137. this.showStop = true;
  138. }
  139. },
  140. // 进度条动画
  141. loading(second) {
  142. if (second <= 30) {
  143. this.rdeg = -135 + 6 * second;
  144. this.ldeg = -135;
  145. } else {
  146. this.rdeg = 45;
  147. this.ldeg = -135 + 6 * (second - 30);
  148. }
  149. }
  150. }
  151. };
  152. </script>
  153. <style lang="scss">
  154. // 扇形圆环
  155. .circle_process {
  156. position: absolute;
  157. width: 380rpx;
  158. height: 380rpx;
  159. }
  160. .circle_process .wrapper {
  161. width: 190rpx;
  162. height: 380rpx;
  163. position: absolute;
  164. top: 0;
  165. overflow: hidden;
  166. }
  167. .circle_process .right {
  168. right: 0;
  169. }
  170. .circle_process .left {
  171. left: 0;
  172. }
  173. .circle_process .circle {
  174. width: 380rpx;
  175. height: 380rpx;
  176. border: 20rpx solid transparent;
  177. border-radius: 50%;
  178. position: absolute;
  179. top: 0;
  180. transform: rotate(-135deg);
  181. }
  182. .circle_process .rightcircle {
  183. border-top: 20rpx solid red;
  184. border-right: 20rpx solid red;
  185. right: 0;
  186. }
  187. .circle_process .leftcircle {
  188. border-bottom: 20rpx solid red;
  189. border-left: 20rpx solid red;
  190. left: 0;
  191. }
  192. .work-pages {
  193. width: 100%;
  194. .flex-center {
  195. display: flex;
  196. align-items: center;
  197. justify-content: center;
  198. }
  199. .work-cons {
  200. height: 60vh;
  201. background-image: linear-gradient(0deg, #666, #333);
  202. border-bottom-left-radius: 300rpx 30rpx;
  203. border-bottom-right-radius: 300rpx 30rpx;
  204. position: relative;
  205. // 按钮
  206. .work-button-wrap {
  207. width: 400rpx;
  208. margin-top: -50rpx;
  209. .work-button {
  210. background: #aaa;
  211. border-radius: 100%;
  212. width: 380rpx;
  213. height: 380rpx;
  214. cursor: pointer;
  215. .cirle-one {
  216. background: #444;
  217. width: 370rpx;
  218. height: 370rpx;
  219. border-radius: 100%;
  220. position: absolute;
  221. }
  222. .cirle-two {
  223. width: 370rpx;
  224. height: 370rpx;
  225. border-radius: 100%;
  226. position: absolute;
  227. .sector {
  228. transform-origin: center center;
  229. width: 350rpx;
  230. height: 5rpx;
  231. background: #aaa;
  232. }
  233. }
  234. .cirle-three {
  235. background: #444;
  236. width: 280rpx;
  237. height: 280rpx;
  238. border-radius: 100%;
  239. position: absolute;
  240. }
  241. .cirle-free {
  242. width: 230rpx;
  243. height: 230rpx;
  244. border-radius: 100%;
  245. position: absolute;
  246. animation: mymove 5s infinite;
  247. }
  248. @keyframes mymove {
  249. 0% {
  250. transform: scale(1); /*开始为原始大小*/
  251. opacity: 1;
  252. }
  253. 25% {
  254. transform: scale(1.1); /*放大1.1倍*/
  255. opacity: 0.5;
  256. }
  257. 50% {
  258. transform: scale(1);
  259. opacity: 1;
  260. }
  261. 75% {
  262. transform: scale(1.1);
  263. opacity: 0.5;
  264. }
  265. }
  266. .cirle-sex {
  267. background-image: linear-gradient(180deg, #888, #333 50%);
  268. width: 210rpx;
  269. height: 210rpx;
  270. border-radius: 100%;
  271. position: absolute;
  272. color: #ffffff;
  273. font-size: 28rpx;
  274. color: #eee;
  275. }
  276. .w-start {
  277. background: #ffcc00;
  278. }
  279. .w-stop {
  280. background: #ff0000;
  281. }
  282. &:active {
  283. .cirle-sex {
  284. background-image: linear-gradient(180deg, #888, #333 80%);
  285. }
  286. }
  287. }
  288. .work-button-tips {
  289. color: #eee;
  290. text-align: center;
  291. padding-top: 30rpx;
  292. }
  293. }
  294. }
  295. .work-tips {
  296. padding: 45rpx;
  297. .work-dtime {
  298. text-align: center;
  299. font-weight: bold;
  300. font-size: 34rpx;
  301. }
  302. .work-remarks {
  303. padding-top: 50rpx;
  304. .red {
  305. color: red;
  306. }
  307. .title {
  308. font-weight: bold;
  309. }
  310. }
  311. }
  312. }
  313. </style>