goldenBean.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="">
  3. <view class="goldenBean">
  4. <view class="title">
  5. <image src="@/static/img/list1.png"></image>
  6. <view class="title-t"> {{list}} </view>
  7. <text class="about">超值体验</text>
  8. <view class="">
  9. {{id}}
  10. </view>
  11. </view>
  12. <view class="box">
  13. <view class="header" :style="indexLoad%2!=1?bgColor[0]:bgColor[1]" >
  14. <view class="left">
  15. <view class="title">
  16. 热门好物推荐
  17. </view>
  18. <view class="about">
  19. 买到就是赚到
  20. </view>
  21. </view>
  22. <view class="right">
  23. <image src="@/static/img/right.png" @click="navto('/pages/product/fenlei?id='+id)"></image>
  24. </view>
  25. </view>
  26. <view class="footer">
  27. <view class="list">
  28. <view class="item" v-for="d in jdList"
  29. @click="navto('/pages/product/product?id=' + d.id + '&is_gold=' + 1)">
  30. <view class="img">
  31. <image :src="d.image" mode=""></image>
  32. </view>
  33. <view class="name nowarp" :title='d.store_name'>
  34. {{ d.store_name }}
  35. </view>
  36. <view class="price">
  37. ¥{{ d.price }}
  38. </view>
  39. <view class="name" style="font-size: 22rpx;color: #999;">
  40. 已售 {{ d.sales || '0'}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. goodsDetail,getProducts
  52. } from '@/api/product.js'
  53. export default {
  54. props: ['data', 'leibie', 'index'],
  55. mounted() {
  56. // console.log(this.data);
  57. console.log(this.leibie, this.index, 'ssss');
  58. this.list = this.leibie.cate_name
  59. this.id = this.leibie.id
  60. console.log(this.id,'eiddidi');
  61. this.indexLoad = this.index
  62. // this.leibie.forEach(
  63. // item => {
  64. // this.list = item.cate_name
  65. // console.log(this.list, 'weqeq')
  66. // });
  67. // for(let arr of this.leibie){arr=>{
  68. // console.log(arr,'2222');
  69. // }}
  70. },
  71. data() {
  72. return {
  73. list: '',
  74. id: '',
  75. indexLoad: '',
  76. jdList:[],
  77. bgColor: [{background: "linear-gradient(43deg, #FFBD70, #FF8F44)"},
  78. {background: "linear-gradient(90deg, #F75022, #FF8B6C)"},
  79. ]
  80. }
  81. },
  82. onLoad() {
  83. this.getBargainList()
  84. },
  85. // onShow() {
  86. // this.goodsDetail()
  87. // },
  88. methods: {
  89. getBargainList() {
  90. let that = this;
  91. getProducts({
  92. page: that.page,
  93. limit: that.limit,
  94. sid:that.id
  95. })
  96. .then(function(res) {
  97. that.jdList = res.data
  98. console.log(that.jdList,'jdlist');
  99. })
  100. .catch(res => {});
  101. },
  102. navto(url) {
  103. uni.navigateTo({
  104. url: url
  105. });
  106. },
  107. // 获取商品信息
  108. goodsDetail() {
  109. let obj = this;
  110. goodsDetail({}, this.id).then(function({
  111. data
  112. }) {
  113. console.log(data, 'data');
  114. });
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. $grey: #95A0B1;
  121. $text: #333333;
  122. $red: #FF4C4C;
  123. // 金豆专区
  124. .goldenBean {
  125. font-family: PingFang-SC-Bold;
  126. margin-top: 20rpx;
  127. padding: 20rpx;
  128. background-color: #fff;
  129. .title {
  130. display: flex;
  131. line-height: 40rpx;
  132. .title-t {
  133. color: $text;
  134. font-weight: bold;
  135. margin: 0 20rpx;
  136. font-size: 34rpx;
  137. }
  138. .about {
  139. font-size: 24rpx;
  140. color: $grey;
  141. }
  142. image {
  143. width: 40rpx;
  144. height: 40rpx;
  145. }
  146. }
  147. .box {
  148. margin: 20rpx 0;
  149. border-radius: 10rpx;
  150. overflow: hidden;
  151. .header {
  152. padding: 20rpx;
  153. padding-bottom: 80rpx;
  154. width: 100%;
  155. display: flex;
  156. justify-content: space-between;
  157. color: #fff;
  158. .left {
  159. line-height: 40rpx;
  160. .title {
  161. font-size: 32rpx;
  162. }
  163. .about {
  164. opacity: 0.9;
  165. font-size: 24rpx;
  166. }
  167. }
  168. .right {
  169. margin: auto 0;
  170. image {
  171. width: 30rpx;
  172. height: 30rpx;
  173. }
  174. }
  175. }
  176. .footer {
  177. height: 300rpx;
  178. background-color: $page-color-base;
  179. padding: 20rpx;
  180. margin-bottom: -50rpx;
  181. .list {
  182. display: flex;
  183. justify-content: space-between;
  184. overflow: auto;
  185. border-radius: 10rpx;
  186. position: relative;
  187. top: -90rpx;
  188. background-color: #fff;
  189. .item {
  190. padding: 35rpx;
  191. border-right: solid 1rpx $page-color-base;
  192. .name {
  193. font-size: 24rpx;
  194. color: #3F3F3F;
  195. width: 150rpx;
  196. overflow: hidden;
  197. display: -webkit-box;
  198. -webkit-box-orient: vertical;
  199. -webkit-line-clamp: 1;
  200. border-radius: 10rpx;
  201. text-overflow: ellipsis;
  202. }
  203. .price {
  204. font-size: 28rpx;
  205. color: $red;
  206. font-weight: bold;
  207. }
  208. .img {
  209. overflow: hidden;
  210. border-radius: 20rpx;
  211. image {
  212. width: 150rpx;
  213. height: 150rpx;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. </style>