integral_mall.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <view>
  3. <view class="wrap">
  4. <!-- 积分商城 -->
  5. <u-sticky>
  6. <view class="filter-wrap wrap-flex">
  7. <u-button :custom-style="buttonCustomStyle" :hair-line="false" hover-class="none" @click="handleGo('mallMenu1')">精选</u-button>
  8. <u-dropdown style="position: static;">
  9. <u-dropdown-item v-model="brandValue" title="品牌" :options="brandOptions"></u-dropdown-item>
  10. </u-dropdown>
  11. <u-button :custom-style="buttonCustomStyle" :hair-line="false" hover-class="none" @click="showFilterPopup=true">分类
  12. <u-icon name="grid"></u-icon>
  13. </u-button>
  14. <u-search placeholder="请输入商品名称或种类" :animation="true" :style="inputCustomStyle" :show-action="false" v-model="keyword" @focus="inputFocus" @blur="inputBlur"></u-search>
  15. </view>
  16. </u-sticky>
  17. <scroll-view scroll-y @scrolltolower="scrollBottom" class="scroll-view-container">
  18. <view class="page-box">
  19. <view class="order" >
  20. <view class="item" v-for="(item, index) in goodsList" :key="index" @click="handleGoDetails">
  21. <view class="left"><image :src="item.goodsUrl" mode="aspectFill"></image></view>
  22. <view class="content">
  23. <view class="title u-line-2">{{ item.title }}</view>
  24. <view class="type">{{ item.type }}</view>
  25. <!-- <view class="delivery-time">发货时间 {{ item.deliveryTime }}</view> -->
  26. <view class="price-row">
  27. <view class="price">
  28. {{ item.price }}积分
  29. </view>
  30. <view class="exchange">加入购物车</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <u-loadmore :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
  36. </view>
  37. </scroll-view>
  38. <view id="shopping-car" @click="handleGoCar"><u-icon :custom-style="iconCustomStyleCarFixed" size="48" name="car" color="#9999999"></u-icon><u-badge :offset="[-8,-8]" :count="goodsCounts" type="error"></u-badge></view>
  39. <u-popup v-model="showFilterPopup" mode="right" width="60%">
  40. <view class="filter-title">分类</view>
  41. <block v-for="(item,index) in tabbar" :key="index">
  42. <scroll-view scroll-y class="right-box">
  43. <view class="page-view">
  44. <view class="class-item">
  45. <view class="item-title">
  46. <text>{{item.name}}</text>
  47. </view>
  48. <view class="item-container">
  49. <view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1">
  50. <view class="item-menu-name">{{item1.value}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </scroll-view>
  56. </block>
  57. </u-popup>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. buttonCustomStyle: {
  66. border: "none"
  67. },
  68. brandValue: "",
  69. brandOptions: [{
  70. label: "赛轮",
  71. value: "SAILUN"
  72. }, {
  73. label: "金宇",
  74. value: "jinyu"
  75. }],
  76. keyword: "",
  77. inputCustomStyle: {},
  78. iconCustomStyleCarFixed: {
  79. background: "#ffffff",
  80. padding: "16rpx",
  81. borderRadius: "50%",
  82. boxShadow: "0px 1px 12px 0px rgba(116, 116, 116, 0.6)"
  83. },
  84. goodsCounts: 100,
  85. showFilterPopup: false,
  86. tabbar: [{
  87. "name": "品牌",
  88. "foods": [{
  89. "value": "赛轮",
  90. "label": "SAILUN",
  91. },
  92. {
  93. "value": "金宇",
  94. "label": "jinyu",
  95. },
  96. ]
  97. }],
  98. loadStatus: "loadmore",
  99. goodsList: [],
  100. list: [
  101. {
  102. goodsUrl: 'https://img12.360buyimg.com/n7/jfs/t16642/126/2693663818/450163/6879e8ce/5b06d93bN6305bd94.png',
  103. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  104. type: '胎动品牌;修补类型;普通积分',
  105. deliveryTime: '付款后30天内发货',
  106. price: '348.58',
  107. number: 2
  108. },
  109. {
  110. goodsUrl: 'https://img12.360buyimg.com/n7/jfs/t1/47645/22/6120/140457/5d3d17deEec9f8e8d/3687ff03ca89b48c.jpg',
  111. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  112. type: '胎动品牌;修补类型;普通积分',
  113. deliveryTime: '付款后30天内发货',
  114. price: '135.00',
  115. number: 1
  116. },
  117. {
  118. goodsUrl: 'https://img11.360buyimg.com/n7/jfs/t1/88990/24/4208/105799/5de4c6e9E24bc09d0/f810effb14c9c13a.jpg',
  119. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  120. type: '胎动品牌;修补类型;普通积分',
  121. deliveryTime: '付款后7天内发货',
  122. price: '128.05',
  123. number: 1
  124. },
  125. {
  126. goodsUrl: 'https://img12.360buyimg.com/n7/jfs/t1/93698/23/4500/114562/5de713dfEfc997085/e8deaa979909851d.jpg',
  127. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  128. type: '胎动品牌;修补类型;普通积分',
  129. deliveryTime: '保质5年',
  130. price: '1998',
  131. number: 3
  132. },
  133. {
  134. goodsUrl: 'https://img11.360buyimg.com/n7/jfs/t16642/126/2693663818/450163/6879e8ce/5b06d93bN6305bd94.png',
  135. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  136. type: '胎动品牌;修补类型;普通积分',
  137. deliveryTime: '保质5年',
  138. price: '2354',
  139. number: 1
  140. },
  141. {
  142. goodsUrl: 'https://img10.360buyimg.com/n7/jfs/t1/68753/35/2229/118427/5d089fb7Ee5b93887/2e3bbc7fec247fdc.jpg',
  143. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  144. type: '胎动品牌;修补类型;普通积分',
  145. deliveryTime: '珍藏10年好酒',
  146. price: '1543',
  147. number: 3
  148. },
  149. {
  150. goodsUrl: 'https://img10.360buyimg.com/n7/jfs/t1/68753/35/2229/118427/5d089fb7Ee5b93887/2e3bbc7fec247fdc.jpg',
  151. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  152. type: '胎动品牌;修补类型;普通积分',
  153. deliveryTime: '口感好',
  154. price: '120',
  155. number: 1
  156. },
  157. {
  158. goodsUrl: 'https://img10.360buyimg.com/n7/jfs/t1/68753/35/2229/118427/5d089fb7Ee5b93887/2e3bbc7fec247fdc.jpg',
  159. title: '【胎动】T-M3蘑菇钉,24支/盒, 3mm ',
  160. type: '胎动品牌;修补类型;普通积分',
  161. deliveryTime: '使用方便',
  162. price: '451',
  163. number: 9
  164. }
  165. ]
  166. };
  167. },
  168. onLoad() {
  169. this.getDataList();
  170. },
  171. computed: {
  172. // 价格小数
  173. priceDecimal() {
  174. return val => {
  175. if (val !== parseInt(val)) return val.slice(-2);
  176. else return '00';
  177. };
  178. },
  179. // 价格整数
  180. priceInt() {
  181. return val => {
  182. if (val !== parseInt(val)) return val.split('.')[0];
  183. else return val;
  184. };
  185. }
  186. },
  187. methods: {
  188. inputFocus: function(){
  189. console.log(111);
  190. this.inputCustomStyle = {
  191. position: "absolute",
  192. zIndex: "100",
  193. width: "98%",
  194. margin: "6rpx 1%"
  195. };
  196. },
  197. inputBlur: function(){
  198. this.inputCustomStyle = {};
  199. },
  200. scrollBottom: function(v){
  201. console.log(v);
  202. this.loadStatus = 'loading';
  203. // 模拟数据加载
  204. setTimeout(() => {
  205. this.getDataList();
  206. this.loadStatus = 'loadmore';
  207. }, 1000)
  208. },
  209. getDataList: function(){
  210. this.goodsList = this.goodsList.concat(this.list)
  211. },
  212. handleGoCar: function(){
  213. console.log("进入购物车")
  214. uni.navigateTo({
  215. url: "/pages/home/integral-mall/integral_mall_car"
  216. })
  217. },
  218. handleGoDetails: function(){
  219. uni.navigateTo({
  220. url: "/pages/home/integral-mall/integral_mall_goods_details"
  221. })
  222. },
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. /* #ifndef H5 */
  228. page {
  229. height: 100%;
  230. background-color: #f2f2f2;
  231. }
  232. /* #endif */
  233. .wrap-flex {
  234. display: flex;
  235. }
  236. .scroll-view-container{
  237. width: 100%;
  238. height: calc(100% - 88rpx);
  239. }
  240. .filter-title {
  241. background: #F6F6F6;
  242. padding: 16rpx;
  243. }
  244. .class-item {
  245. margin-bottom: 30rpx;
  246. background-color: #fff;
  247. padding: 16rpx;
  248. border-radius: 8rpx;
  249. }
  250. .class-item:last-child {
  251. min-height: 100vh;
  252. }
  253. .item-title {
  254. font-size: 26rpx;
  255. color: $u-main-color;
  256. font-weight: bold;
  257. }
  258. .item-menu-name {
  259. font-weight: normal;
  260. font-size: 24rpx;
  261. color: $u-main-color;
  262. }
  263. .item-container {
  264. display: flex;
  265. flex-wrap: wrap;
  266. }
  267. .thumb-box {
  268. width: 33.333333%;
  269. display: flex;
  270. align-items: center;
  271. justify-content: center;
  272. flex-direction: column;
  273. margin: 20px 16rpx 0;
  274. background: #f6f6f6;
  275. padding: 8rpx;
  276. }
  277. .order {
  278. width: 710rpx;
  279. background-color: #ffffff;
  280. margin: 20rpx auto;
  281. border-radius: 20rpx;
  282. box-sizing: border-box;
  283. padding: 20rpx;
  284. font-size: 28rpx;
  285. .top {
  286. display: flex;
  287. justify-content: space-between;
  288. .left {
  289. display: flex;
  290. align-items: center;
  291. .store {
  292. margin: 0 10rpx;
  293. font-size: 32rpx;
  294. font-weight: bold;
  295. }
  296. }
  297. .right {
  298. color: $u-type-warning-dark;
  299. }
  300. }
  301. .item {
  302. display: flex;
  303. margin: 20rpx 0 0;
  304. .left {
  305. margin-right: 20rpx;
  306. image {
  307. width: 200rpx;
  308. height: 200rpx;
  309. border-radius: 10rpx;
  310. }
  311. }
  312. .content {
  313. .title {
  314. font-size: 28rpx;
  315. line-height: 50rpx;
  316. }
  317. .type {
  318. margin: 10rpx 0;
  319. font-size: 24rpx;
  320. color: $u-tips-color;
  321. }
  322. .delivery-time {
  323. color: #e5d001;
  324. font-size: 24rpx;
  325. }
  326. .price-row{
  327. display: flex;
  328. justify-content: space-between;
  329. margin: 10rpx 0;
  330. font-size: 26rpx;
  331. .price{
  332. color: #FF0000;
  333. }
  334. .exchange{
  335. background: #0094FE;
  336. color: #FFFFFF;
  337. padding: 4rpx 16rpx;
  338. line-height: 1.5;
  339. }
  340. }
  341. }
  342. .right {
  343. margin-left: 10rpx;
  344. padding-top: 20rpx;
  345. text-align: right;
  346. .decimal {
  347. font-size: 24rpx;
  348. margin-top: 4rpx;
  349. }
  350. .number {
  351. color: $u-tips-color;
  352. font-size: 24rpx;
  353. }
  354. }
  355. }
  356. .total {
  357. margin-top: 20rpx;
  358. text-align: right;
  359. font-size: 24rpx;
  360. .total-price {
  361. font-size: 32rpx;
  362. }
  363. }
  364. .bottom {
  365. display: flex;
  366. margin-top: 40rpx;
  367. padding: 0 10rpx;
  368. justify-content: space-between;
  369. align-items: center;
  370. .btn {
  371. line-height: 52rpx;
  372. width: 160rpx;
  373. border-radius: 26rpx;
  374. border: 2rpx solid $u-border-color;
  375. font-size: 26rpx;
  376. text-align: center;
  377. color: $u-type-info-dark;
  378. }
  379. .evaluate {
  380. color: $u-type-warning-dark;
  381. border-color: $u-type-warning-dark;
  382. }
  383. }
  384. }
  385. .centre {
  386. text-align: center;
  387. margin: 200rpx auto;
  388. font-size: 32rpx;
  389. image {
  390. width: 164rpx;
  391. height: 164rpx;
  392. border-radius: 50%;
  393. margin-bottom: 20rpx;
  394. }
  395. .tips {
  396. font-size: 24rpx;
  397. color: #999999;
  398. margin-top: 20rpx;
  399. }
  400. .btn {
  401. margin: 80rpx auto;
  402. width: 200rpx;
  403. border-radius: 32rpx;
  404. line-height: 64rpx;
  405. color: #ffffff;
  406. font-size: 26rpx;
  407. background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
  408. }
  409. }
  410. .wrap {
  411. display: flex;
  412. flex-direction: column;
  413. height: calc(100vh - var(--window-top));
  414. width: 100%;
  415. }
  416. #shopping-car{
  417. position: fixed;
  418. z-index: 9999;
  419. right: 26rpx;
  420. bottom: 300rpx;
  421. }
  422. </style>