goods_selection.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view :style="viewColor" class="page-container">
  3. <view class='flash-sale'>
  4. <view class="fixed-head">
  5. <!-- <view class="sys-head" :style="{height:statusBarHeight}"></view> -->
  6. <view class="tool-bar">
  7. <!--#ifdef H5-->
  8. <view class='iconfont icon-xiangzuo' @tap='goBack'></view>
  9. <!--#endif-->
  10. </view>
  11. </view>
  12. <view class='head' :style="{ 'background-image': `url(${domain}/static/diy/selection${keyColor}.jpg)` }">
  13. <!-- <view class="sys-head" :style="{height:statusBarHeight}"></view> -->
  14. <view class="tool-bar"></view>
  15. </view>
  16. <view class="main_count">
  17. <view class='list'>
  18. <block v-for="(item,index) in goodsList" :key='index'>
  19. <view class='item acea-row row-between-wrapper' @tap='goDetails(item)'>
  20. <view class='pictrue'>
  21. <image :src='item.image'></image>
  22. </view>
  23. <view class='text acea-row row-column-around'>
  24. <view class='name line1'>{{item.store_name}}</view>
  25. <view class='booking'>
  26. <view class="count">
  27. <image class="image" :src="`${domain}/static/images/jf-point.png`" mode="widthFix"></image>
  28. <view class="price-box">
  29. <text>{{ item.ot_price }}</text>积分
  30. </view>
  31. <view v-if="item.price>0" class="sales">+{{parseFloat(Number(item.price).toFixed(2))}}元</view>
  32. </view>
  33. </view>
  34. <view class="exchange">
  35. <view class="count">{{item.sales}}人兑换</view>
  36. <view class='order_btn'>去兑换</view>
  37. </view>
  38. </view>
  39. </view>
  40. </block>
  41. </view>
  42. </view>
  43. </view>
  44. <home></home>
  45. <!-- #ifndef H5 -->
  46. <passwordPopup></passwordPopup>
  47. <!-- #endif -->
  48. </view>
  49. </template>
  50. <script>
  51. // +----------------------------------------------------------------------
  52. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  53. // +----------------------------------------------------------------------
  54. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  55. // +----------------------------------------------------------------------
  56. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  57. // +----------------------------------------------------------------------
  58. // | Author: CRMEB Team <admin@crmeb.com>
  59. // +----------------------------------------------------------------------
  60. import { getIntegralGoodsList } from '@/api/points_mall.js';
  61. import home from '@/components/home/index.vue'
  62. import { configMap } from "@/utils";
  63. import { HTTP_REQUEST_URL } from '@/config/app';
  64. // #ifndef H5
  65. import passwordPopup from '@/components/passwordPopup';
  66. // #endif
  67. import { mapGetters } from "vuex";
  68. let app = getApp();
  69. export default {
  70. components: {
  71. // #ifndef H5
  72. passwordPopup,
  73. // #endif
  74. home,
  75. },
  76. computed: configMap({statusBarHeight:0},mapGetters(['viewColor','keyColor'])),
  77. data() {
  78. return {
  79. domain: HTTP_REQUEST_URL,
  80. goodsList: [],
  81. status: 1,
  82. page: 1,
  83. limit: 8,
  84. loading: false,
  85. loadend: false,
  86. pageloading: false,
  87. }
  88. },
  89. /**
  90. * 用户点击右上角分享
  91. */
  92. // #ifdef MP
  93. onShareAppMessage: function() {
  94. wx.showShareMenu({
  95. withShareTicket: true,
  96. menus: ['shareAppMessage', 'shareTimeline']
  97. })
  98. return {
  99. title: '好物精选',
  100. path: 'pages/points_mall/goodSelection',
  101. }
  102. },
  103. onShareTimeline: function() {
  104. return {
  105. title: '好物精选',
  106. query: {
  107. key: ''
  108. },
  109. imageUrl: ''
  110. }
  111. },
  112. // #endif
  113. onLoad() {
  114. this.getSelectionList('');
  115. },
  116. methods: {
  117. goBack: function() {
  118. uni.navigateBack();
  119. },
  120. getSelectionList: function() {
  121. var that = this;
  122. var data = {
  123. page: that.page,
  124. limit: that.limit,
  125. is_hot: 1
  126. };
  127. if (that.pageloading) return;
  128. this.pageloading = true
  129. getIntegralGoodsList(data).then(res => {
  130. var goodsList = res.data.list;
  131. that.page++;
  132. that.goodsList = that.goodsList.concat(goodsList),
  133. that.page = that.page;
  134. that.pageloading = false;
  135. }).catch(err => {
  136. that.pageloading = false
  137. });
  138. },
  139. goDetails(item) {
  140. uni.navigateTo({
  141. url: '/pages/points_mall/integral_goods_details?id=' + item.product_id
  142. })
  143. }
  144. },
  145. /**
  146. * 页面上拉触底事件的处理函数
  147. */
  148. onReachBottom: function() {
  149. this.getSelectionList();
  150. },
  151. // 滚动监听
  152. onPageScroll(e) {
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. .page-container{
  158. min-height: 100vh;
  159. background-color: var(--view-theme);
  160. }
  161. .icon-xiangzuo {
  162. margin-left: 20rpx;
  163. font-size: 40rpx;
  164. color: #fff;
  165. }
  166. .head {
  167. display: flex;
  168. flex-direction: column;
  169. /* #ifdef MP || APP-PLUS */
  170. height: 300rpx;
  171. /* #endif */
  172. /* #ifdef H5 */
  173. height: 300rpx;
  174. /* #endif */
  175. background-repeat: no-repeat;
  176. background-size: 100% 100%;
  177. width: 100%;
  178. }
  179. .noCommodity {
  180. border-top: none;
  181. }
  182. .flash-sale .header {
  183. width: 100%;
  184. position: relative;
  185. }
  186. .flash-sale .main_count {
  187. position: relative;
  188. top: -40rpx;
  189. }
  190. .flash-sale .timeList {
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. margin: 0 auto;
  195. }
  196. .flash-sale .timeList .item {
  197. font-size: 20rpx;
  198. color: #666;
  199. text-align: center;
  200. box-sizing: border-box;
  201. width: 224rpx;
  202. }
  203. .flash-sale .timeList .item .time {
  204. font-size: 26rpx;
  205. color: #AAAAAA;
  206. }
  207. .flash-sale .timeList .item.on .time {
  208. color: #FD6523;
  209. font-weight: 600;
  210. span {
  211. position: relative;
  212. &::after {
  213. content: '';
  214. display: inline-block;
  215. width: 100%;
  216. height: 4rpx;
  217. background: #FD6523;
  218. position: absolute;
  219. left: 0;
  220. bottom: -4rpx;
  221. border-radius: 2rpx;
  222. }
  223. }
  224. }
  225. .flash-sale .list {
  226. margin-top: 24rpx;
  227. }
  228. .flash-sale .list .item {
  229. height: 278rpx;
  230. position: relative;
  231. width: 90%;
  232. margin: 0 auto 20rpx auto;
  233. background-color: #fff;
  234. border-radius: 20rpx;
  235. padding: 0 25rpx;
  236. }
  237. .flash-sale .list .item .pictrue {
  238. width: 220rpx;
  239. height: 220rpx;
  240. border-radius: 16rpx;
  241. }
  242. .flash-sale .list .item .pictrue image {
  243. width: 100%;
  244. height: 100%;
  245. border-radius: 10rpx;
  246. }
  247. .flash-sale .list .item .text {
  248. width: 390rpx;
  249. font-size: 30rpx;
  250. color: #333;
  251. }
  252. .flash-sale .list .item .text .name {
  253. width: 100%;
  254. color: #282828;
  255. font-weight: bold;
  256. font-size: 28rpx;
  257. }
  258. .flash-sale .list .item .text .booking {
  259. margin-top: 17rpx;
  260. }
  261. .flash-sale .list .item .text .booking .count {
  262. display: flex;
  263. margin-top: 8rpx;
  264. align-items: baseline;
  265. .image{
  266. width: 26rpx;
  267. height: 26rpx;
  268. margin-right: 10rpx;
  269. border-radius: 0;
  270. }
  271. .price-box {
  272. font-size: 22rpx;
  273. color: var(--view-theme);
  274. text{
  275. font-size: 34rpx;
  276. }
  277. }
  278. .sales {
  279. font-size: 22rpx;
  280. color: var(--view-theme);
  281. }
  282. }
  283. .flash-sale .list .item .exchange{
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. margin-top: 40rpx;
  288. .count{
  289. color: #666666;
  290. font-size: 26rpx;
  291. }
  292. .order_btn{
  293. width: 140rpx;
  294. height: 56rpx;
  295. display: flex;
  296. align-items: center;
  297. justify-content: center;
  298. background: #FFF3E5;
  299. border-radius: 30rpx;
  300. color: #FF8C00;
  301. font-size: 26rpx;
  302. }
  303. }
  304. .fixed-head{
  305. position: absolute;
  306. left: 0;
  307. top: 20px;
  308. width: 100%;
  309. z-index: 10;
  310. .icon-xiangzuo {
  311. margin-right: 40rpx;
  312. margin-left: 20rpx;
  313. font-size: 40rpx;
  314. color: #fff;
  315. }
  316. }
  317. </style>