index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="预订二维码" :showHome="false"></c-nav-bar>
  4. <image src="https://i.ringzle.com/file/20240115/4cfb2a681dba4431800e88ba903d61a6.png" class="title" mode="widthFix"></image>
  5. <view class="code">
  6. <image :src="img" mode="scaleToFill"></image>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. img:''
  15. }
  16. },
  17. onLoad() {
  18. this.getCode();
  19. },
  20. methods: {
  21. getCode(){
  22. this.$api.get('/merchant/hotel/mine/createTouristCode?homestayId='+uni.getStorageSync('homestayId'),{},true,true,true).then(res=>{
  23. if(res.data){
  24. this.img = 'data:image/png;base64,'+uni.arrayBufferToBase64(res.data);
  25. }
  26. })
  27. }
  28. }
  29. }
  30. </script>
  31. <style scoped lang="less">
  32. .page{
  33. box-sizing: border-box;
  34. background: url(https://i.ringzle.com/file/20240115/95e355588e3c4df9847d3a586d79aa44.png) no-repeat;
  35. background-size: 100% 100%;
  36. display: flex;
  37. flex-direction: column;
  38. align-items: center;
  39. .title{
  40. width: calc(100% - 98rpx);
  41. margin: 214rpx 49rpx 0;
  42. }
  43. .code{
  44. width: 460rpx;
  45. height: 460rpx;
  46. background: #FFFFFF;
  47. box-shadow: 0rpx 3rpx 32rpx 1rpx rgba(72,139,255,0.27);
  48. border-radius: 20rpx 20rpx 20rpx 20rpx;
  49. padding: 40rpx;
  50. box-sizing: border-box;
  51. margin: 83rpx auto 0;
  52. image{
  53. width: 100%;
  54. height: 100%;
  55. }
  56. }
  57. }
  58. </style>