acdr-ui/dist/dev/mp-weixin/modules/mall/activity/index.js.map

1 line
7.9 KiB
Plaintext

{"version":3,"file":"index.js","sources":["../../../../../../src/modules/mall/activity/index.vue","../../../../../../uniPage:/bW9kdWxlc1xtYWxsXGFjdGl2aXR5XGluZGV4LnZ1ZQ"],"sourcesContent":["<!-- 指定满减送的活动列表 -->\r\n<template>\r\n <s-layout class=\"activity-wrap\" :title=\"state.activityInfo.title\">\r\n <!-- 活动信息 -->\r\n <su-sticky bgColor=\"#fff\">\r\n <view class=\"ss-flex ss-col-top tip-box\">\r\n <view class=\"type-text ss-flex ss-row-center\">满减:</view>\r\n <view class=\"ss-flex-1\">\r\n <view class=\"tip-content\" v-for=\"item in state.activityInfo.rules\" :key=\"item\">\r\n {{ formatRewardActivityRule(state.activityInfo, item) }}\r\n </view>\r\n </view>\r\n <image class=\"activity-left-image\" src=\"/static/activity-left.png\" />\r\n <image class=\"activity-right-image\" src=\"/static/activity-right.png\" />\r\n </view>\r\n </su-sticky>\r\n\r\n <!-- 商品信息 -->\r\n <view class=\"ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top\">\r\n <view class=\"goods-list-box\">\r\n <view class=\"left-list\" v-for=\"item in state.leftGoodsList\" :key=\"item.id\">\r\n <s-goods-column\r\n class=\"goods-md-box\"\r\n size=\"md\"\r\n :data=\"item\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/index', { id: item.id })\"\r\n @getHeight=\"mountMasonry($event, 'left')\"\r\n >\r\n <template v-slot:cart>\r\n <button class=\"ss-reset-button cart-btn\"></button>\r\n </template>\r\n </s-goods-column>\r\n </view>\r\n </view>\r\n <view class=\"goods-list-box\">\r\n <view class=\"right-list\" v-for=\"item in state.rightGoodsList\" :key=\"item.id\">\r\n <s-goods-column\r\n class=\"goods-md-box\"\r\n size=\"md\"\r\n :data=\"item\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/index', { id: item.id })\"\r\n @getHeight=\"mountMasonry($event, 'right')\"\r\n >\r\n <template v-slot:cart>\r\n <button class=\"ss-reset-button cart-btn\" />\r\n </template>\r\n </s-goods-column>\r\n </view>\r\n </view>\r\n </view>\r\n\r\n <uni-load-more\r\n v-if=\"state.pagination.total > 0\"\r\n :status=\"state.loadStatus\"\r\n :content-text=\"{\r\n contentdown: '上拉加载更多',\r\n }\"\r\n @tap=\"loadMore\"\r\n />\r\n </s-layout>\r\n</template>\r\n<script setup>\r\nimport { reactive } from 'vue'\r\nimport { onLoad, onReachBottom } from '@dcloudio/uni-app'\r\nimport sheep from '@/sheep'\r\nimport _ from 'lodash-es'\r\nimport RewardActivityApi from '@/sheep/api/promotion/rewardActivity'\r\nimport { formatRewardActivityRule } from '@/sheep/hooks/useGoods'\r\nimport SpuApi from '@/sheep/api/product/spu'\r\n\r\nconst state = reactive({\r\n activityId: 0, // 获得编号\r\n activityInfo: {}, // 获得信息\r\n\r\n pagination: {\r\n list: [],\r\n total: 1,\r\n pageNo: 1,\r\n pageSize: 8,\r\n },\r\n loadStatus: '',\r\n leftGoodsList: [],\r\n rightGoodsList: [],\r\n})\r\n\r\n// 加载瀑布流\r\nlet count = 0\r\nlet leftHeight = 0\r\nlet rightHeight = 0\r\n\r\nfunction mountMasonry(height = 0, where = 'left') {\r\n if (!state.pagination.list[count]) return\r\n\r\n if (where === 'left') {\r\n leftHeight += height\r\n } else {\r\n rightHeight += height\r\n }\r\n if (leftHeight <= rightHeight) {\r\n state.leftGoodsList.push(state.pagination.list[count])\r\n } else {\r\n state.rightGoodsList.push(state.pagination.list[count])\r\n }\r\n count++\r\n}\r\n\r\n// 加载商品信息\r\nasync function getList() {\r\n // 处理拓展参数\r\n const params = {}\r\n if (state.activityInfo.productScope === 2) {\r\n params.ids = state.activityInfo.productSpuIds.join(',')\r\n } else if (state.activityInfo.productScope === 3) {\r\n params.categoryIds = state.activityInfo.productSpuIds.join(',')\r\n }\r\n // 请求数据\r\n state.loadStatus = 'loading'\r\n const { code, data } = await SpuApi.getSpuPage({\r\n pageNo: state.pagination.pageNo,\r\n pageSize: state.pagination.pageSize,\r\n ...params,\r\n })\r\n if (code !== 0) {\r\n return\r\n }\r\n state.pagination.list = _.concat(state.pagination.list, data.list)\r\n state.pagination.total = data.total\r\n state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore'\r\n mountMasonry()\r\n}\r\n\r\n// 加载活动信息\r\nasync function getActivity(id) {\r\n const { code, data } = await RewardActivityApi.getRewardActivity(id)\r\n if (code === 0) {\r\n state.activityInfo = data\r\n }\r\n}\r\n\r\n// 加载更多\r\nfunction loadMore() {\r\n if (state.loadStatus === 'noMore') {\r\n return\r\n }\r\n state.pagination.pageNo++\r\n getList()\r\n}\r\n\r\n// 上拉加载更多\r\nonReachBottom(() => {\r\n loadMore()\r\n})\r\n\r\nonLoad(async (options) => {\r\n state.activityId = options.activityId\r\n await getActivity(state.activityId)\r\n await getList(state.activityId)\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n \r\n.goods-list-box {\r\n box-sizing: border-box;\r\n width: 50%;\r\n .left-list {\r\n margin-right: 10rpx;\r\n margin-bottom: 20rpx;\r\n }\r\n .right-list {\r\n margin-bottom: 20rpx;\r\n margin-left: 10rpx;\r\n }\r\n}\r\n.tip-box {\r\n position: relative;\r\n box-sizing: border-box;\r\n width: 100%;\r\n padding: 20rpx;\r\n background: #fff0e7;\r\n .activity-left-image {\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n width: 58rpx;\r\n height: 36rpx;\r\n }\r\n .activity-right-image {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n width: 72rpx;\r\n height: 50rpx;\r\n }\r\n .type-text {\r\n font-size: 26rpx;\r\n font-weight: 500;\r\n line-height: 42rpx;\r\n color: #ff6000;\r\n }\r\n .tip-content {\r\n font-size: 26rpx;\r\n font-weight: 500;\r\n line-height: 42rpx;\r\n color: #ff6000;\r\n }\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/activity/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["reactive","SpuApi","_","RewardActivityApi","onReachBottom","onLoad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,UAAA,QAAAA,cAAAA,SAAA;AAAA,MACA,YAAA;AAAA;AAAA,MACA,cAAA,CAAA;AAAA;AAAA,MAEA,YAAA;AAAA,QACA,MAAA,CAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA,UAAA;AAAA,MACA;AAAA,MACA,YAAA;AAAA,MACA,eAAA,CAAA;AAAA,MACA,gBAAA,CAAA;AAAA,IACA,CAAA;AAGA,QAAA,QAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AAEA,aAAA,aAAA,SAAA,GAAA,QAAA,QAAA;AACA,UAAA,CAAA,MAAA,WAAA,KAAA,KAAA;AAAA;AAEA,UAAA,UAAA,QAAA;AACA,sBAAA;AAAA,MACA,OAAA;AACA,uBAAA;AAAA,MACA;AACA,UAAA,cAAA,aAAA;AACA,cAAA,cAAA,KAAA,MAAA,WAAA,KAAA,KAAA,CAAA;AAAA,MACA,OAAA;AACA,cAAA,eAAA,KAAA,MAAA,WAAA,KAAA,KAAA,CAAA;AAAA,MACA;AACA;AAAA,IACA;AAGA,aAAA,UAAA;AAAA;AAEA,cAAA,SAAA,CAAA;AACA,YAAA,MAAA,aAAA,iBAAA,GAAA;AACA,iBAAA,MAAA,MAAA,aAAA,cAAA,KAAA,GAAA;AAAA,QACA,WAAA,MAAA,aAAA,iBAAA,GAAA;AACA,iBAAA,cAAA,MAAA,aAAA,cAAA,KAAA,GAAA;AAAA,QACA;AAEA,cAAA,aAAA;AACA,cAAA,EAAA,MAAA,KAAA,IAAA,MAAAC,sBAAAA,OAAA,WAAA;AAAA,UACA,QAAA,MAAA,WAAA;AAAA,UACA,UAAA,MAAA,WAAA;AAAA,WACA,OACA;AACA,YAAA,SAAA,GAAA;AACA;AAA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