payCentre.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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>
  10. </template>
  11. <script>
  12. import uniWeb from '@/utils/uni.webview.1.5.4.js'
  13. export default {
  14. data() {
  15. return {
  16. data:"",
  17. text:3
  18. }
  19. },
  20. onLoad(options) {
  21. if(options.orderNo){
  22. // this.$nextTick(()=>{
  23. // this.goto(options.orderNo)
  24. // })
  25. setTimeout(()=>{
  26. this.goto(options.orderNo)
  27. },100);
  28. }
  29. this.init()
  30. },
  31. methods: {
  32. init(){
  33. this.text=3;
  34. let setTime=setInterval(()=>{
  35. this.text--;
  36. if(this.text==0&&setTime){
  37. clearInterval(setTime)
  38. }
  39. },1000)
  40. },
  41. goto(orderNo) {
  42. try {
  43. uniWeb.webView.postMessage({
  44. data: {
  45. action: 'pay',
  46. orderNo:orderNo
  47. }
  48. })
  49. } catch (err) {
  50. console.log('err==>', err)
  51. }
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .body{
  58. text-align: center;
  59. padding-top: 300rpx;
  60. color: #303133;
  61. image{
  62. width: 200rpx;
  63. height: 200rpx;
  64. }
  65. .payLogo{
  66. width: 294rpx;
  67. height: 294rpx;
  68. }
  69. >view{
  70. font-size: 30rpx;
  71. color: #333333;
  72. font-weight: 700;
  73. margin-top: 45rpx;
  74. text{
  75. font-size: 36rpx;
  76. color: #FF0511;
  77. }
  78. }
  79. }
  80. </style>