classify.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view class="container">
  3. <!-- 头部轮播 -->
  4. <view class="top">
  5. <view class="bg"></view>
  6. <view class="title-box">
  7. <view class="title-one">
  8. <text>{{integral.two}}</text>
  9. <text>推销得分</text>
  10. </view>
  11. <view class="title-one">
  12. <text>{{integral.one}}</text>
  13. <text>推荐得分</text>
  14. </view>
  15. <view class="title-one">
  16. <text>{{integral.gain}}</text>
  17. <text>购买得分</text>
  18. </view>
  19. </view>
  20. <view class="title-box1" @click="navTo('/pages/user/shareQrCode')">
  21. <view class="title-bg">
  22. <image src="../../static/img/libao.jpg" mode=""></image>
  23. </view>
  24. <view class="title-between">
  25. <text>邀请有礼</text>
  26. <text>转发海报邀请好友获得更多奖励</text>
  27. </view>
  28. <view class="title-right">
  29. <image src="../../static/user/right01.png" mode=""></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="goodsList-box">
  34. <view class="goodsList-item flex" :key="ind" v-for="(ls, ind) in list">
  35. <image :src="ls.image" mode=" scaleToFill"></image>
  36. <view class="goodsList-content">
  37. <view class="title">
  38. <text class="clamp2">{{ ls.store_name }}</text>
  39. </view>
  40. <view class="goods-money flex">
  41. <view class="money-box">
  42. <text class="money">现金:¥{{ (ls.price) - ls.max_integral }}</text>
  43. <!-- <image src="../../static/icon/in2.png"></image> -->
  44. <!-- <image src="../../static/error/errorImage.jpg"></image> -->
  45. <!-- <text class="decline">直降{{ ls.ot_price - ls.price}}元</text> -->
  46. <!-- <view class="otMoney-box"> -->
  47. <view class="money">积分:{{ ls.max_integral }}</view>
  48. <!-- <text class="sales">已售{{ ls.sales }}件</text> -->
  49. <!-- </view> -->
  50. </view>
  51. <view class="button" @click="navTo('/pages/product/intProduct?id='+ls.id)">立即购买</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. getProducts
  61. } from '@/api/product.js';
  62. import {
  63. integralList
  64. } from '@/api/user.js';
  65. export default {
  66. data() {
  67. return {
  68. list: [],
  69. page: 1,
  70. limit: 1000,
  71. loadingType: 'more',
  72. integral: {
  73. gain: 0,
  74. one: 0,
  75. two: 0,
  76. }
  77. };
  78. },
  79. onLoad(option) {
  80. // 获取查询对象
  81. this.type = option.type;
  82. // 加载基础数据
  83. this.loadData();
  84. this.getArticleList();
  85. },
  86. methods: {
  87. getArticleList() {
  88. let obj = this
  89. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  90. return
  91. }
  92. obj.loadingType = 'loading'
  93. getProducts({
  94. page: obj.page,
  95. limit: obj.limit,
  96. is_integral: 1
  97. }, obj.cid).then(({
  98. data
  99. }) => {
  100. obj.list = obj.list.concat(data)
  101. obj.page++
  102. if (data.length == obj.limit) {
  103. obj.loadingType = 'more'
  104. } else {
  105. obj.loadingType = 'noMore'
  106. }
  107. })
  108. },
  109. navTo: function(url) {
  110. uni.navigateTo({
  111. url
  112. });
  113. },
  114. // 请求载入数据
  115. async loadData() {
  116. integralList().then(res => {
  117. this.integral={
  118. gain: res.data.gain,//购买
  119. one: res.data.gain,//直推
  120. two: res.data.gain//间推
  121. }
  122. })
  123. },
  124. }
  125. };
  126. </script>
  127. <style lang="scss">
  128. page {
  129. background: $page-color-base;
  130. }
  131. .top {
  132. .bg {
  133. width: 1000rpx;
  134. height: 200rpx;
  135. background: #52C696;
  136. overflow: hidden;
  137. text-align: center;
  138. border-bottom-left-radius: 50%;
  139. border-bottom-right-radius: 50%;
  140. margin-left: -125rpx;
  141. }
  142. .title-box {
  143. position: relative;
  144. z-index: 999;
  145. margin: -100rpx auto;
  146. display: flex;
  147. justify-content: space-around;
  148. align-items: center;
  149. width: 702rpx;
  150. height: 137rpx;
  151. background: #FFFFFF;
  152. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  153. border-radius: 10rpx;
  154. .title-one {
  155. display: flex;
  156. flex-direction: column;
  157. align-items: center;
  158. text:nth-child(2) {
  159. font-size: 26rpx;
  160. font-family: PingFang SC;
  161. font-weight: 500;
  162. color: #666666;
  163. }
  164. }
  165. }
  166. .title-box1 {
  167. margin: 120rpx auto 0;
  168. display: flex;
  169. justify-content: space-around;
  170. align-items: center;
  171. width: 702rpx;
  172. height: 137rpx;
  173. background: #FFFFFF;
  174. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  175. border-radius: 10rpx;
  176. .title-bg {
  177. width: 123rpx;
  178. height: 123rpx;
  179. image {
  180. width: 100%;
  181. height: 100%;
  182. }
  183. }
  184. .title-between {
  185. display: flex;
  186. flex-direction: column;
  187. text:nth-child(1) {
  188. width: 131rpx;
  189. font-size: 33rpx;
  190. font-family: PingFang SC;
  191. font-weight: bold;
  192. color: #333333;
  193. line-height: 34rpx;
  194. }
  195. text:nth-child(2) {
  196. width: 350rpx;
  197. font-size: 24rpx;
  198. font-family: PingFang SC;
  199. font-weight: 500;
  200. color: #999999;
  201. line-height: 44rpx;
  202. }
  203. }
  204. .title-right {
  205. width: 16rpx;
  206. height: 30rpx;
  207. image {
  208. width: 100%;
  209. height: 100%;
  210. }
  211. }
  212. }
  213. }
  214. .carousel-section {
  215. padding: 0;
  216. .titleNview-placing {
  217. padding-top: 0;
  218. height: 0;
  219. }
  220. .swiper-dots {
  221. left: 45rpx;
  222. bottom: 40rpx;
  223. }
  224. .carousel {
  225. width: 100%;
  226. height: 360rpx;
  227. .carousel-item {
  228. width: 100%;
  229. height: 100%;
  230. overflow: hidden;
  231. }
  232. image {
  233. width: 100%;
  234. height: 100%;
  235. }
  236. }
  237. }
  238. // 中间标题样式
  239. .type-title-box {
  240. padding: 40rpx;
  241. .title-content {
  242. height: 100%;
  243. width: 200rpx;
  244. text-align: center;
  245. font-size: $font-lg;
  246. font-weight: 500;
  247. color: $font-color-dark;
  248. }
  249. .title-border {
  250. width: 250rpx;
  251. height: 2rpx;
  252. background-color: #e9e9e9;
  253. }
  254. }
  255. // 商品列表
  256. .goodsList-box {
  257. padding: 30rpx;
  258. .goodsList-item {
  259. box-shadow: 0 0 20rpx 6rpx #f1f1f1;
  260. border-radius: 10rpx;
  261. margin-bottom: 30rpx;
  262. background-color: #ffffff;
  263. padding: 30rpx;
  264. image {
  265. flex-shrink: 0;
  266. border-radius: $border-radius-sm;
  267. height: 180rpx;
  268. width: 180rpx;
  269. }
  270. .goodsList-content {
  271. margin-left: 20rpx;
  272. flex-grow: 1;
  273. height: 180rpx;
  274. position: relative;
  275. .title {
  276. font-size: $font-base;
  277. color: $font-color-dark;
  278. font-weight: bold;
  279. }
  280. .goods-money {
  281. position: absolute;
  282. left: 0;
  283. bottom: 0;
  284. width: 100%;
  285. .money-box {
  286. .otMoney {
  287. color: #999999;
  288. // text-decoration: line-through;
  289. margin-right: 15rpx;
  290. font-size: 20rpx;
  291. }
  292. .money {
  293. color: #FF6F0F;
  294. font-weight: bold;
  295. font-size: 30rpx;
  296. }
  297. image {
  298. width: 20rpx;
  299. height: 20rpx;
  300. margin-right: 5rpx;
  301. }
  302. .decline {
  303. color: #B59467;
  304. font-size: 20rpx;
  305. }
  306. .sales {
  307. color: $font-color-light;
  308. }
  309. }
  310. .button {
  311. background: #52C696;
  312. height: 50rpx;
  313. border-radius: 20rpx;
  314. padding: 10rpx 15rpx;
  315. color: #fff;
  316. font-size: 25rpx;
  317. }
  318. .cart {
  319. border: 1px solid $color-red;
  320. color: $color-red;
  321. font-size: $font-base;
  322. font-weight: bold;
  323. border-radius: 99px;
  324. width: 55rpx;
  325. height: 55rpx;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. </style>