index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <image class="image" :src="oneUrl" mode=""></image>
  6. </view>
  7. <view class="two">
  8. <scroll-view scroll-y="true" class="scroll-view">
  9. <view class="list-scroll-view">
  10. <view class="list" v-for="(item,index) in list" :key="index" :style="{background:item.bgColor}"
  11. @click="toCommon('/pagesHome/place/detail')">
  12. <view class="name">
  13. <text>{{item.name}}</text>
  14. </view>
  15. <image class="image" :src="item.url" mode=""></image>
  16. <view class="no_use" v-if="item.is_use==false">
  17. &nbsp;
  18. </view>
  19. </view>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. </view>
  24. </mobile-frame>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. oneUrl: '',
  31. list: [ //
  32. {
  33. name: '北京特产',
  34. url: '',
  35. bgColor: '#FF6573',
  36. is_use: true
  37. },
  38. {
  39. name: '河北特产',
  40. url:'',
  41. bgColor: '#448E51',
  42. is_use: false
  43. },
  44. {
  45. name: '天津特产',
  46. url:'',
  47. bgColor: '#8A59B4',
  48. is_use: false
  49. },
  50. {
  51. name: '辽宁特产',
  52. url:'',
  53. bgColor: '#2A669A',
  54. is_use: false
  55. },
  56. {
  57. name: '山西特产',
  58. url:'',
  59. bgColor: '#794537',
  60. is_use: false
  61. },
  62. {
  63. name: '内蒙特产',
  64. url:'',
  65. bgColor: '#397126',
  66. is_use: false
  67. },
  68. {
  69. name: '吉林特产',
  70. url:'',
  71. bgColor: '#965400',
  72. is_use: false
  73. },
  74. {
  75. name: '黑龙江特产',
  76. url:'',
  77. bgColor: '#005854',
  78. is_use: false
  79. },
  80. {
  81. name: '湖北特产',
  82. url:'',
  83. bgColor: '#55C5C5',
  84. is_use: false
  85. },
  86. {
  87. name: '湖南特产',
  88. url:'',
  89. bgColor: '#659100',
  90. is_use: false
  91. },
  92. {
  93. name: '江西特产',
  94. url:'',
  95. bgColor: '#CF4779',
  96. is_use: false
  97. },
  98. {
  99. name: '河南特产',
  100. url:'',
  101. bgColor: '#1F83B7',
  102. is_use: false
  103. },
  104. {
  105. name: '安徽特产',
  106. url:'',
  107. bgColor: '#302760',
  108. is_use: false
  109. },
  110. {
  111. name: '上海特产',
  112. url:'',
  113. bgColor: '#8E8A64',
  114. is_use: false
  115. },
  116. {
  117. name: '江苏特产',
  118. url:'',
  119. bgColor: '#CF6B54',
  120. is_use: false
  121. },
  122. {
  123. name: '浙江特产',
  124. url:'',
  125. bgColor: '#0B4864',
  126. is_use: false
  127. },
  128. {
  129. name: '山东特产',
  130. url:'',
  131. bgColor: '#892557',
  132. is_use: false
  133. },
  134. {
  135. name: '福建特产',
  136. url:'',
  137. bgColor: '#13607A',
  138. is_use: false
  139. },
  140. {
  141. name: '广东特产',
  142. url:'',
  143. bgColor: '#FF6A52',
  144. is_use: false
  145. },
  146. {
  147. name: '海南特产',
  148. url:'',
  149. bgColor: '#1D2F79',
  150. is_use: false
  151. },
  152. {
  153. name: '广西特产',
  154. url:'',
  155. bgColor: '#DD863F',
  156. is_use: false
  157. },
  158. {
  159. name: '甘肃特产',
  160. url:'',
  161. bgColor: '#118582',
  162. is_use: false
  163. },
  164. {
  165. name: '青海特产',
  166. url:'',
  167. bgColor: '#9744B6',
  168. is_use: false
  169. },
  170. {
  171. name: '宁夏特产',
  172. url:'',
  173. bgColor: '#048B50',
  174. is_use: false
  175. },
  176. {
  177. name: '新疆特产',
  178. url:'',
  179. bgColor: '#5D832C',
  180. is_use: false
  181. },
  182. {
  183. name: '重庆特产',
  184. url:'',
  185. bgColor: '#32A6BF',
  186. is_use: false
  187. },
  188. {
  189. name: '陕西特产',
  190. url:'',
  191. bgColor: '#145342',
  192. is_use: false
  193. },
  194. {
  195. name: '四川特产',
  196. url:'',
  197. bgColor: '#9C3140',
  198. is_use: false
  199. },
  200. {
  201. name: '贵州特产',
  202. url:'',
  203. bgColor: '#7F8D02',
  204. is_use: false
  205. },
  206. {
  207. name: '云南特产',
  208. url:'',
  209. bgColor: '#019585',
  210. is_use: false
  211. },
  212. {
  213. name: '西藏特产',
  214. url:'',
  215. bgColor: '#B4A52E',
  216. is_use: false
  217. }
  218. ]
  219. };
  220. },
  221. onShow: function() {},
  222. methods: {
  223. // 公共跳转
  224. toCommon(route, e) {
  225. uni.navigateTo({
  226. url: `${route}?id=${e && e._id ? e._id : ''}`
  227. })
  228. },
  229. }
  230. }
  231. </script>
  232. <style lang="scss">
  233. .main {
  234. display: flex;
  235. flex-direction: column;
  236. width: 96vw;
  237. height: 97vh;
  238. padding: 2vw;
  239. .one {
  240. margin: 0 0 2vw 0;
  241. .image {
  242. width: 100%;
  243. height: 50vw;
  244. }
  245. }
  246. .two {
  247. position: relative;
  248. flex-grow: 1;
  249. .list {
  250. position: relative;
  251. width: 27vw;
  252. margin: 0 0 2vw 0;
  253. border: 1px solid var(--f1Color);
  254. text-align: center;
  255. padding: 2vw;
  256. .name {
  257. text {
  258. font-size: var(--font16Size);
  259. border: 2px solid var(--f1Color);
  260. display: inline-block;
  261. color: var(--fffColor);
  262. padding: 1vw 2vw;
  263. margin: 0 0 2vw;
  264. border-radius: 5px;
  265. }
  266. }
  267. .image {
  268. width: 90%;
  269. height: 22vw;
  270. border-radius: 90px;
  271. }
  272. .no_use {
  273. position: absolute;
  274. top: 0;
  275. z-index: 999;
  276. width: 100%;
  277. height: 100%;
  278. left: 0;
  279. background-color: #f1f1f19f;
  280. }
  281. }
  282. }
  283. }
  284. .scroll-view {
  285. position: absolute;
  286. top: 0;
  287. left: 0;
  288. right: 0;
  289. bottom: 0;
  290. .list-scroll-view {
  291. display: flex;
  292. flex-direction: row;
  293. flex-wrap: wrap;
  294. }
  295. }
  296. </style>