index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="orderFood-index">
  3. <view class="content">
  4. <view class="item" v-for="(item,index) in list" :key="index" @click="jump(item.type)">
  5. <image class="icon" :src="item.src" mode=""></image>
  6. <view class="name">
  7. {{item.name}}
  8. </view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. list: [
  18. {
  19. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xgJrwD0vChsW012ac1e138a0aa5a970e8f8c59dab926.png/1.png',
  20. name:'肯德基KFC',
  21. type:'Kfc'
  22. },
  23. {
  24. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/K64jffEqRIDr487e8cab971c3b890d4066a26f5856d2.png/1.png',
  25. name:'麦当劳',
  26. type:'MDL'
  27. },
  28. {
  29. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xMwtPkICBcam5513c4ac644054e60009cb8b1eb52e8f.png/1.png',
  30. name:'星巴克',
  31. type:'XBK'
  32. },
  33. {
  34. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/U9j6fgVmKeAt522ed50aa1a72f798260e0e30138d4c6.png/1.png',
  35. name:'奈雪的茶',
  36. type:'NXDC'
  37. },
  38. {
  39. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/zS5Q8sC9AAQca76eef36da2bd5a2ec234d75d8dcc044.png/1.png',
  40. name:'瑞幸咖啡',
  41. type:'RXKF'
  42. },
  43. {
  44. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/fA95my16Qunf967a9d992fc41134332926bcb5665881.png/1.png',
  45. name:'喜茶',
  46. type:'XC'
  47. },
  48. {
  49. src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/wk5eyuvhighG206a7ea081e3f0b783ff2a9555375e85.png/1.png',
  50. name:'库迪咖啡',
  51. type:'KD'
  52. }
  53. ]
  54. }
  55. },
  56. methods: {
  57. jump(type) {
  58. if (uni.getStorageSync('token')) {
  59. uni.setStorageSync('ot',type)
  60. uni.navigateTo({
  61. url:'./shopList'
  62. })
  63. }else{
  64. uni.showModal({
  65. title:'请登录',
  66. confirmText:'去登录',
  67. success(res){
  68. console.log(res);
  69. if(res.confirm){
  70. uni.navigateTo({
  71. url:`/login/login/login?redirect=/orderFood/index`
  72. })
  73. }
  74. }
  75. })
  76. }
  77. }
  78. },
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .orderFood-index{
  83. background: #F9F9F9;
  84. padding: 24rpx;
  85. min-height: 100vh;
  86. .content{
  87. display: flex;
  88. flex-wrap: wrap;
  89. justify-content: space-between;
  90. .item{
  91. width: 224rpx;
  92. background: #FFFFFF;
  93. border-radius: 16rpx 16rpx 16rpx 16rpx;
  94. padding: 24rpx;
  95. box-sizing: border-box;
  96. text-align: center;
  97. margin-bottom: 16rpx;
  98. .icon{
  99. width: 120rpx;
  100. height: 120rpx;
  101. border-radius: 50%;
  102. }
  103. .name{
  104. font-size: 32rpx;
  105. color: #222222;
  106. text-align: center;
  107. margin-top: 28rpx;
  108. }
  109. }
  110. }
  111. }
  112. </style>