payCentre.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="body">
  3. <!-- <image src="/static/payCentre/loading.gif" mode=""></image> -->
  4. <image class="payLogo" src="/static/payCentre/payLogo.png" mode=""></image>
  5. <view>
  6. 正在进入宜格收银台
  7. <text>{{text}}s</text>
  8. </view>
  9. <view class="footerBox">宜昌城市大脑运营管理有限公司提供技术支持</view>
  10. </view>
  11. </template>
  12. <script>
  13. import uniWeb from '@/utils/uni.webview.1.5.4.js'
  14. export default {
  15. data() {
  16. return {
  17. data:"",
  18. text:3
  19. }
  20. },
  21. onLoad(options) {
  22. if(options.orderNo){
  23. // this.$nextTick(()=>{
  24. // this.goto(options.orderNo)
  25. // })
  26. setTimeout(()=>{
  27. this.goto(options.orderNo)
  28. },100);
  29. }
  30. this.init()
  31. },
  32. methods: {
  33. init(){
  34. this.text=3;
  35. let setTime=setInterval(()=>{
  36. this.text--;
  37. if(this.text==0&&setTime){
  38. clearInterval(setTime)
  39. }
  40. },1000)
  41. },
  42. goto(orderNo) {
  43. try {
  44. uniWeb.webView.postMessage({
  45. data: {
  46. action: 'pay',
  47. orderNo:orderNo
  48. }
  49. })
  50. } catch (err) {
  51. console.log('err==>', err)
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .body{
  59. text-align: center;
  60. padding-top: 300rpx;
  61. color: #303133;
  62. image{
  63. width: 200rpx;
  64. height: 200rpx;
  65. }
  66. .payLogo{
  67. width: 294rpx;
  68. height: 294rpx;
  69. }
  70. >view{
  71. font-size: 30rpx;
  72. color: #333333;
  73. font-weight: 700;
  74. margin-top: 45rpx;
  75. text{
  76. font-size: 36rpx;
  77. color: #FF0511;
  78. }
  79. }
  80. .footerBox{
  81. width: 100%;
  82. font-size: 24rpx;
  83. color: #999999;
  84. text-align: center;
  85. position: fixed;
  86. bottom: 90rpx;
  87. }
  88. }
  89. </style>