activatedChargingPile.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view>
  3. <ujp-navbar title="激活充电桩"></ujp-navbar>
  4. <view class="main">
  5. <view class="img">
  6. <img src="../../assets/img/pile.png" alt="">
  7. </view>
  8. <view class="text">
  9. <view class="text-1">
  10. {{name}}
  11. </view>
  12. <view class="text-1">
  13. 设备暂未绑定
  14. </view>
  15. <view class="text-2">
  16. <p>请在施工人员的帮助下,</p>
  17. <p>扫码关联充电桩并完成激活操作</p>
  18. </view>
  19. </view>
  20. <button v-if="!isReady" class="btn" @click="test" > <text>加载中</text></button>
  21. <button v-else class="btn" @click="getScanCode" >
  22. <text><img src="../../assets/img/riLine-qr-scan-2-line@1x.png" alt="">
  23. </text>扫码绑定</button>
  24. <view style="text-align: center; margin-top: 10px;color: #275cbf;"
  25. @click="gotoUrl('pagesFinance/news/index?code=AZSM')" >查看安装说明文档</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import * as WxJsApi from '@/utils/wxJsApi.js'
  31. import * as API from '@/apis/finance.js'
  32. export default {
  33. data() {
  34. return {
  35. isReady:false,
  36. id:"",
  37. name:""
  38. }
  39. },
  40. onLoad(op) {
  41. if(op.id){
  42. this.id=op.id;
  43. this.name=op.name
  44. }
  45. },
  46. onReady() {
  47. WxJsApi.getWxConfig(['scanQRCode']).then((res) => {
  48. // //(res)
  49. this.isReady=true;
  50. }).catch(error => {
  51. //(res)
  52. })
  53. },
  54. methods: {
  55. test(){
  56. if(process.env.NODE_ENV === "development"){
  57. this.getInfo("YQ20220816002")
  58. }
  59. //
  60. },
  61. getInfo(id){
  62. uni.showLoading({
  63. title: "加载中",
  64. mask: true,
  65. })
  66. API.findByDeviceNo({
  67. deviceNo:id
  68. }).then((res) => {
  69. this.obj = res.data
  70. uni.redirectTo({
  71. url:"/pagesFinance/user/confirmBinding?id="+id+"&stationId="+this.id
  72. })
  73. uni.hideLoading()
  74. }).catch(error => {
  75. uni.showToast({
  76. title: error
  77. })
  78. })
  79. },
  80. getScanCode(){
  81. WxJsApi.scanQRCode(1).then(res => {
  82. this.getInfo(res)
  83. }).catch(error => {
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .main{
  91. margin-top: 48px;
  92. .img{
  93. width: 100%;
  94. text-align: center;
  95. }
  96. .text{
  97. text-align: center;
  98. margin-top: 28px;
  99. .text-1{
  100. color: rgba(51, 51, 51, 1);
  101. font-size: 20px;
  102. line-height: 27px;
  103. font-weight: bold;
  104. }
  105. .text-2{
  106. margin: 0 auto;
  107. color: rgba(119, 119, 119, 1);
  108. font-size: 16px;
  109. line-height: 19px;
  110. margin-top: 24rpx;
  111. p{
  112. margin-bottom: 4px;
  113. }
  114. }
  115. }
  116. .btn{
  117. margin-top: 36px;
  118. width: 58.9%;
  119. border-radius: 8px;
  120. background-color: rgba(24, 90, 198, 1);
  121. line-height: 48px;
  122. color: #fff;
  123. text{
  124. margin-right: 16rpx;
  125. }
  126. img{
  127. vertical-align: middle;
  128. }
  129. }
  130. }
  131. </style>