index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="flex-common-css">
  3. <Nav :leftShow='false' :customNav='true' title="" bgckgroundBox='#EF1F0C'></Nav>
  4. <view class="flex-1 flex-direction iPhone-bottom box-border-box">
  5. <image class="qd-bg" src="@/static/img/order-food/qd-bg.png" mode=""></image>
  6. <view class="order-food-box p-0-32 box-border-box">
  7. <view class="order-food p-32 box-border-box bgc-f b-rad-24" @click="login()">
  8. <view class="b-FFD7CC bc-FFEDE9-FFF1EE b-rad-24 p-20-32 box-border-box align-items-center flex-justify-space">
  9. <view class="flex-direction">
  10. <view class="align-items-center mb-8">
  11. <view class="fs-36 fc-3 fw-600">
  12. 堂食扫码点餐
  13. </view>
  14. <image class="right-h" src="@/static/img/order-food/right-h.png" mode=""></image>
  15. </view>
  16. <view class="fs-28 fc-9">
  17. 自助下单方便快捷
  18. </view>
  19. </view>
  20. <image class="zh-img" src="@/static/img/order-food/zh-img.png" mode=""></image>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. appletLogin
  30. } from "@/api/member";
  31. import tools from "@/service/tools";
  32. export default {
  33. components: {},
  34. data() {
  35. return {}
  36. },
  37. onLoad(data) {
  38. this.login()
  39. },
  40. mounted() {},
  41. methods: {
  42. login() {
  43. uni.login({
  44. provider: "weixin",
  45. success: (loginRes) => {
  46. this.appletLogin(loginRes.code);
  47. },
  48. fail: (loginRes) => {
  49. this.isAjax = false;
  50. tools.error("获取授权信息失败");
  51. },
  52. });
  53. },
  54. appletLogin(code) {
  55. appletLogin({
  56. 'code': code
  57. }).then(res => {
  58. this.goToUrl()
  59. })
  60. },
  61. goToUrl(shop_id) {
  62. uni.reLaunch({
  63. url: '/pages-takeout/shop?shop_id=' + shop_id
  64. });
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .qd-bg {
  71. width: 100%;
  72. height: 696rpx;
  73. }
  74. .order-food-box {
  75. position: relative;
  76. }
  77. .order-food {
  78. width: calc(100% - 64rpx);
  79. position: absolute;
  80. left: 32rpx;
  81. top: -90rpx;
  82. }
  83. .bc-FFEDE9-FFF1EE {
  84. background: linear-gradient(90deg, #FFEDE9 0%, #FFF1EE 100%);
  85. }
  86. .zh-img {
  87. width: 148rpx;
  88. height: 148rpx;
  89. }
  90. .right-h {
  91. width: 40rpx;
  92. height: 40rpx;
  93. }
  94. </style>