index.vue 7.8 KB

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