index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. },
  43. onShow() {
  44. // console.log('222222222');
  45. // uni.setStorageSync('shop_id', 111)
  46. // uni.setStorageSync('table_number', 1)
  47. // this.login()
  48. },
  49. mounted() {},
  50. methods: {
  51. login() {
  52. uni.login({
  53. provider: "weixin",
  54. success: (loginRes) => {
  55. this.appletLogin(loginRes.code);
  56. },
  57. fail: (loginRes) => {
  58. this.isAjax = false;
  59. tools.error("获取授权信息失败");
  60. },
  61. });
  62. },
  63. appletLogin(code) {
  64. appletLogin({
  65. 'code': code
  66. }).then(res => {
  67. if (res.code === 1) {
  68. uni.setStorageSync('token', res.data.token)
  69. uni.setStorageSync('m_id', res.data.m_id)
  70. // this.goToUrl()
  71. }
  72. })
  73. },
  74. goToUrl(shop_id) {
  75. uni.reLaunch({
  76. url: '/pages-takeout/new-shop?shop_id=' + shop_id
  77. });
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .qd-bg {
  84. width: 100%;
  85. height: 696rpx;
  86. }
  87. .order-food-box {
  88. position: relative;
  89. }
  90. .order-food {
  91. width: calc(100% - 64rpx);
  92. position: absolute;
  93. left: 32rpx;
  94. top: -90rpx;
  95. }
  96. .bc-FFEDE9-FFF1EE {
  97. background: linear-gradient(90deg, #FFEDE9 0%, #FFF1EE 100%);
  98. }
  99. .zh-img {
  100. width: 148rpx;
  101. height: 148rpx;
  102. }
  103. .right-h {
  104. width: 40rpx;
  105. height: 40rpx;
  106. }
  107. </style>