index.vue 2.4 KB

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