chanPin.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="box">
  3. <view class="top_bg">
  4. <topBox></topBox>
  5. <view @click="backBtn" class="back" tabindex="0">返回上一级</view>
  6. </view>
  7. <view class="zj_box">
  8. <view class="harder_box box_item">
  9. <view class="box_banner">
  10. <view class="box_item">
  11. <view @click="detailsBtn(index)" class="banner_item" v-for="(item, index) in projectList" :key="item.index" tabindex="0">
  12. <view class="banner_bgimg">
  13. <view class="banner_img">
  14. <image class="itemImg" :src="item.image" mode="aspectFill"></image>
  15. </view>
  16. </view>
  17. <view class="item_tit">{{ item.title }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- <commonItems :projectList="projectList" class="box_item"></commonItems> -->
  23. </view>
  24. <!-- <view class="qiehuan">
  25. <view class="qh_btn">
  26. <image class="img" src="/static/img/left.png"></image>
  27. </view>
  28. <view class="qh_btn">
  29. <image class="img" src="/static/img/right.png"></image>
  30. </view>
  31. </view> -->
  32. </view>
  33. </template>
  34. <script>
  35. let that;
  36. export default {
  37. data() {
  38. return { projectList: [] };
  39. },
  40. onLoad(o) {
  41. that = this;
  42. this.getContentList();
  43. },
  44. methods: {
  45. getContentList() {
  46. this.$api.getContentList(
  47. {
  48. model_id: 9 /* 模型id */,
  49. main_body_id: 1
  50. },
  51. function (res) {
  52. that.projectList = res.data.list;
  53. console.log(that.projectList, '传承人');
  54. }
  55. );
  56. },
  57. detailsBtn(i) {
  58. uni.navigateTo({
  59. url: `/pages/index2/fY_xiangQing/xiangMuXQ?id=${this.projectList[i].id}`
  60. });
  61. },
  62. backBtn() {
  63. console.log(11111);
  64. uni.navigateBack({
  65. delta: 1
  66. });
  67. }
  68. }
  69. };
  70. </script>
  71. <style>
  72. .box {
  73. width: 100%;
  74. height: 100vh;
  75. background: linear-gradient(180deg, rgba(240, 235, 222, 0.2) 0%, #f0ebde 5%, #f0ebde 100%);
  76. }
  77. .top_bg {
  78. width: 100%;
  79. position: absolute;
  80. color: #ffffff;
  81. z-index: 1;
  82. /* background: linear-gradient(10deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2) 100%); */
  83. }
  84. .zj_box {
  85. width: 100%;
  86. height: 62%;
  87. position: fixed;
  88. }
  89. .back {
  90. width: 12%;
  91. height: 15%;
  92. margin-left: 5%;
  93. margin-top: -2%;
  94. cursor: pointer;
  95. font-size: 12px;
  96. color: #8e6c4f;
  97. letter-spacing: 0.3em;
  98. }
  99. .qiehuan {
  100. position: absolute;
  101. top: 42%;
  102. left: 8%;
  103. z-index: 33;
  104. display: flex;
  105. justify-content: space-between;
  106. width: 87%;
  107. height: 8%;
  108. }
  109. .qh_btn {
  110. width: 3%;
  111. height: 65%;
  112. }
  113. .img {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. /* 列表 */
  118. .harder_box {
  119. position: relative;
  120. z-index: 1;
  121. width: 100%;
  122. height: 25vh;
  123. }
  124. .itemImg {
  125. width: 100%;
  126. height: 100%;
  127. border-radius: 5px 25px 5px 25px;
  128. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.56), -3px 0 6px rgba(0, 0, 0, 0.26);
  129. }
  130. .itemImg::before {
  131. content: '';
  132. position: absolute;
  133. top: 0;
  134. left: 0;
  135. width: 100%;
  136. height: 100%;
  137. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), -3px 0 6px rgba(0, 0, 0, 0.16);
  138. z-index: -1;
  139. }
  140. .box_banner {
  141. width: 82%;
  142. height: 28%;
  143. /* height: 28%; */
  144. margin: auto;
  145. }
  146. .banner_img {
  147. position: absolute;
  148. top: 6%;
  149. left: 5%;
  150. width: 90%;
  151. height: 75%;
  152. }
  153. .banner_bgimg {
  154. position: relative;
  155. width: 100%;
  156. height: 100%;
  157. background: url('../../../static/img/bg_logo.png') no-repeat center;
  158. background-size: 100% 100%;
  159. }
  160. .box_item {
  161. width: 100%;
  162. height: 100%;
  163. display: flex;
  164. flex-wrap: wrap;
  165. }
  166. .banner_item {
  167. width: 23%;
  168. height: 120%;
  169. margin-bottom: 2%;
  170. position: relative;
  171. margin-left: 2%;
  172. }
  173. .item_tit {
  174. width: 90%;
  175. position: absolute;
  176. top: 83%;
  177. left: 5%;
  178. text-align: center;
  179. z-index: 1;
  180. font-size: 10px;
  181. color: #fbfcdc;
  182. /* text-shadow: 0px 4px 0px #8e5938; */
  183. }
  184. </style>