more.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="page">
  3. <view class="tpbg">
  4. <uni-nav-bar left-icon="back" backgroundColor="transparent" :border="false" color="#555555" @clickLeft="back" :statusBar="true"></uni-nav-bar>
  5. </view>
  6. <view class="center">
  7. <view class="main-left tagf">
  8. <view class="tag" :class="{'active':activeIndex===index?true:false}" v-for="(item,index) in classList" :key="index" @click="selectTag(index)">
  9. {{item.name}}
  10. </view>
  11. </view>
  12. <view class="item" v-for="(item,index) in CompositionList" :key="index" @click="goPage(item.id)">
  13. <view class="main-between img">
  14. <view style="width: 419rpx;height: 281rpx;">
  15. <image style="width: 420rpx;height: 420rpx;" :src="item.cover_img" mode=""></image>
  16. </view>
  17. <view style="width: 206rpx;">
  18. <image style="width: 206rpx;height: 206rpx;" :src="item.banner_imgs[0].banner_imgs" mode=""></image>
  19. <image style="width: 206rpx;height: 206rpx;" :src="item.banner_imgs[1].banner_imgs" mode=""></image>
  20. </view>
  21. </view>
  22. <view class="main-between pl" >
  23. <view class="main-between-y">
  24. <view class="title t-omit">{{item.name}}</view>
  25. <view class="desc">已售:{{item.sale_num}}套 | {{item.collect_num}}人收藏</view>
  26. <view class="price"><text>¥</text>{{item.actual_price}}</view>
  27. </view>
  28. <view class="cross-bottom arrow-right">
  29. <image src="https://t17.9026.com/web/statics/image/index/arrow-right-gray.png" mode=""></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="no-more" v-if="noMore && CompositionList.length>0">没有更多了...</view>
  34. <appNoData v-if="CompositionList.length==0" :background="'#f8f8f8'" :title="'该分类暂无套装'"></appNoData>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. let _this
  40. // import appNavBar from '@/components/index/app-nav-bar.vue';
  41. import appNoData from '@/components/index/app-no-goods.vue';
  42. export default {
  43. components:{
  44. // appNavBar,
  45. appNoData
  46. },
  47. data() {
  48. return {
  49. activeIndex:0,
  50. navbarHeight:'',
  51. classList:[],
  52. CompositionList:[],
  53. noMore:false,
  54. };
  55. },
  56. onLoad(option) {
  57. _this=this
  58. this.getCompositionClass(option.cat_id)
  59. this.getCompositionList(option.cat_id)
  60. },
  61. methods:{
  62. selectTag(index){
  63. this.activeIndex=index
  64. this.getCompositionList(this.classList[index].id)
  65. },
  66. headHeight(e){
  67. this.navbarHeight=e+'px'
  68. },
  69. goPage(id){
  70. uni.navigateTo({
  71. url:'/pages/program/program?id='+id
  72. })
  73. },
  74. getCompositionClass(cat_id){
  75. _this.$post('plugin/composition/api/index/cat-list',{
  76. success(res){
  77. if(res.code===0){
  78. this.classList=res.data.list
  79. this.classList.splice(0,0,{id:'',name:'全部'})
  80. }
  81. for (let i = 0; i < this.classList.length; i++) {
  82. if(this.classList[i].id==cat_id){
  83. this.activeIndex=i
  84. }
  85. }
  86. }
  87. })
  88. },
  89. back(){
  90. uni.navigateBack({
  91. delta:1
  92. })
  93. },
  94. getCompositionList(cat_id=''){
  95. let dk_estate_id = uni.getStorageSync('dk_estate_id') ? uni.getStorageSync('dk_estate_id') : 0;
  96. _this.$post('plugin/composition/api/index/cat-list',{
  97. data:{
  98. cat_id:cat_id,
  99. estate_id: 0
  100. },
  101. success(res){
  102. if(res.code===0){
  103. this.CompositionList=res.data.list
  104. }
  105. }
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .no-more {
  113. font-size: 24rpx;
  114. font-weight: 500;
  115. color: #666666;
  116. margin-top: 37rpx;
  117. text-align: center;
  118. }
  119. .page{
  120. position: relative;
  121. min-height: 100vh;
  122. }
  123. .tpbg{
  124. width: 750rpx;
  125. height: 368rpx;
  126. position: fixed;
  127. top: 0;
  128. left: 0;
  129. z-index: -1;
  130. background-image: url("https://t17.9026.com/web/statics/image/index/3.png");
  131. background-size: 100%;
  132. }
  133. .w{
  134. width: 750rpx;
  135. }
  136. .center{
  137. border-radius: 30rpx;
  138. overflow: hidden;
  139. margin-top: 368rpx;
  140. width: 750rpx;
  141. height: auto;
  142. background: #F8F8F8;
  143. border-radius: 20rpx;
  144. overflow: hidden;
  145. padding: 36rpx;
  146. .tagf{
  147. padding-bottom: 26rpx;
  148. }
  149. .tag{
  150. min-width: 131rpx;
  151. height: 51rpx;
  152. background: #EFEFEF;
  153. border-radius: 10rpx;
  154. font-size: 24rpx;
  155. font-weight: 500;
  156. color: #999999;
  157. text-align: center;
  158. line-height: 51rpx;
  159. padding: 0 15rpx;
  160. margin-right: 20rpx;
  161. }
  162. .active{
  163. background: #A18353;
  164. color: #FFFFFF;
  165. }
  166. .item{
  167. width: 678rpx;
  168. height: auto;
  169. background: #FFFFFF;
  170. border-radius: 8rpx;
  171. margin:0 auto 24rpx;
  172. padding: 27rpx 22rpx;
  173. .img{
  174. height: 420rpx;
  175. border-radius: 10rpx;
  176. overflow: hidden;
  177. }
  178. .pl{
  179. margin-top: 25rpx;
  180. .title{
  181. width: 620rpx;
  182. font-size: 32rpx;
  183. font-weight: bold;
  184. color: #222222;
  185. }
  186. .desc{
  187. font-size: 22rpx;
  188. font-weight: 500;
  189. color: #999999;
  190. margin: 10rpx 0 13rpx;
  191. }
  192. .price{
  193. text{
  194. font-size: 28rpx;
  195. }
  196. font-size: 38rpx;
  197. font-weight: 500;
  198. color: #F93F3F;
  199. }
  200. .arrow-right{
  201. image{
  202. width: 15rpx;
  203. height: 26rpx;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. </style>