fun.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="wrapper">
  3. <text class="marginL15 bold font4" v-if="title">{{ title }}</text>
  4. <template v-if="$common.isArray(list[0])">
  5. <view
  6. v-for="(superItem, index) in list"
  7. :key="index"
  8. class="flex-align-around paddingT18"
  9. >
  10. <view
  11. v-for="item in superItem"
  12. :key="item.title"
  13. class="flex-column-align-center flex1 self-stretch"
  14. >
  15. <button
  16. v-if="item.type !== '4_6'"
  17. class="btn-clear flex-column-align-center"
  18. @click="showNext(item.type)"
  19. >
  20. <image
  21. class="image-1"
  22. :src="item.icon"
  23. :style="{
  24. width: (item.width || 70) + 'rpx',
  25. height: (item.height || 70) + 'rpx'
  26. }"
  27. />
  28. <text
  29. :class="[item.font || 'font2']"
  30. style="color: #fff"
  31. :style="{ marginTop: (item.top || 20) + 'rpx' }"
  32. >
  33. {{ item.title }}
  34. </text>
  35. <!-- <text class="marginT4" :class="[item.font || 'font1']" style="color: #eee">
  36. {{ item.tip }}
  37. </text> -->
  38. </button>
  39. <view v-else class="group-btn-wrapper flex-column-align-center">
  40. <view class="flex-column-align-center" style="pointer-events: none">
  41. <image
  42. class="image-1"
  43. :src="item.icon"
  44. :style="{
  45. width: (item.width || 70) + 'rpx',
  46. height: (item.height || 70) + 'rpx'
  47. }"
  48. />
  49. <text
  50. :class="[item.font || 'font2']"
  51. style="color: #eee"
  52. :style="{ marginTop: (item.top || 20) + 'rpx' }"
  53. >
  54. {{ item.title }}
  55. </text>
  56. <!-- <text
  57. class="marginT4"
  58. :class="[item.font || 'font1']"
  59. style="color: #eee"
  60. >
  61. {{ item.tip }}
  62. </text> -->
  63. </view>
  64. <cell
  65. class="group-btn"
  66. url="https://work.weixin.qq.com/gm/140cdeace2d2c03b35d693b1b755b815"
  67. />
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <view v-else class="flex-align-around" :class="{ paddingT12: !!title }">
  73. <view
  74. v-for="item in list"
  75. :key="item.title"
  76. class="flex-column-align-center flex1"
  77. @click="showNext(item.type)"
  78. >
  79. <image
  80. class="image-1"
  81. :src="item.icon"
  82. :style="{
  83. width: (item.width || 70) + 'rpx',
  84. height: (item.height || 70) + 'rpx'
  85. }"
  86. />
  87. <text
  88. :class="[item.font || 'font2']"
  89. :style="{ marginTop: (item.top || 20) + 'rpx' }"
  90. >
  91. {{ item.title }}
  92. </text>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. props: {
  100. title: {
  101. type: String,
  102. default: ''
  103. },
  104. list: {
  105. type: Array,
  106. default: []
  107. }
  108. },
  109. methods: {
  110. showNext(type) {
  111. switch (type) {
  112. case '1_1':
  113. this.$router.pushCheck('wallet')
  114. break
  115. case '1_2':
  116. this.$router.pushCheck('coupon')
  117. break
  118. case '1_3':
  119. this.$router.pushCheck('magic')
  120. break
  121. case '2_1':
  122. this.$router.pushCheck('order_product', { active: 1 })
  123. break
  124. case '2_2':
  125. this.$router.pushCheck('order_product', { active: 4 })
  126. break
  127. case '2_3':
  128. this.$router.pushCheck('order_product', { active: 5 })
  129. break
  130. case '2_4':
  131. this.$router.pushCheck('order_product', { active: 6 })
  132. break
  133. case '3_1':
  134. this.$router.pushCheck('order_award')
  135. break
  136. case '3_2':
  137. this.$router.pushCheck('order_award', { active: 1 })
  138. break
  139. case '3_3':
  140. this.$router.pushCheck('store')
  141. break
  142. case '4_1':
  143. this.$router.pushCheck('message')
  144. break
  145. case '4_2':
  146. this.$message.alert('敬请期待')
  147. break
  148. case '4_3':
  149. this.$router.pushCheck('address')
  150. break
  151. case '4_4':
  152. this.$common.showKefu()
  153. break
  154. case '4_5':
  155. this.$router.push('setting')
  156. break
  157. case '4_6':
  158. const url =
  159. 'https://mp.weixin.qq.com/s?__biz=MzkwNjM5ODU2OA==&mid=2247483714&idx=1&sn=c122646c1874cad5161b76bc89a0f160&chksm=c0e85f45f79fd653de84a4392b5be0a5b9daceeb012f0610f174f843c928c8eeeaf49721ac4d#rd'
  160. this.$router.web(url, '领福利')
  161. break
  162. case '4_7':
  163. this.$emit('showVip')
  164. break
  165. case '4_8':
  166. this.$router.push('sell')
  167. break
  168. case '4_9':
  169. this.$router.pushCheck('feedback')
  170. break
  171. case '5_0':
  172. this.$router.pushCheck('pull_new_user')
  173. break
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .wrapper {
  181. border-radius: 20rpx;
  182. background: rgba(23, 17, 35, 0.7);
  183. margin: 20rpx 28rpx 0;
  184. padding: 24rpx 0;
  185. color: #ffffff;
  186. .image-1 {
  187. width: 92rpx;
  188. height: 92rpx;
  189. }
  190. .group-btn-wrapper {
  191. width: 180rpx;
  192. position: relative;
  193. overflow: hidden;
  194. .group-btn {
  195. position: absolute;
  196. left: 0;
  197. top: 0;
  198. right: 0;
  199. bottom: 0;
  200. background: #363748;
  201. opacity: 0;
  202. }
  203. }
  204. }
  205. </style>