1 line
5.5 KiB
Plaintext
1 line
5.5 KiB
Plaintext
{"version":3,"file":"detail-tabbar.js","sources":["../../../../../../../../src/modules/mall/goods/components/detail/detail-tabbar.vue","../../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9tb2R1bGVzL21hbGwvZ29vZHMvY29tcG9uZW50cy9kZXRhaWwvZGV0YWlsLXRhYmJhci52dWU"],"sourcesContent":["<!-- 商品详情的底部导航 -->\r\n<template>\r\n <su-fixed bottom placeholder bg=\"bg-white\">\r\n <view class=\"ui-tabbar-box\">\r\n <view class=\"ui-tabbar ss-flex ss-col-center ss-row-between\">\r\n <view\r\n v-if=\"collectIcon\"\r\n class=\"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center\"\r\n @tap=\"onFavorite\"\r\n >\r\n <block v-if=\"modelValue.favorite\">\r\n <image\r\n class=\"item-icon\"\r\n :src=\"sheep.$url.static('/static/img/shop/goods/collect_1.gif')\"\r\n mode=\"aspectFit\"\r\n />\r\n <view class=\"item-title\">已收藏</view>\r\n </block>\r\n <block v-else>\r\n <image\r\n class=\"item-icon\"\r\n :src=\"sheep.$url.static('/static/img/shop/goods/collect_0.png')\"\r\n mode=\"aspectFit\"\r\n />\r\n <view class=\"item-title\">收藏</view>\r\n </block>\r\n </view>\r\n <view\r\n v-if=\"serviceIcon\"\r\n class=\"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center\"\r\n @tap=\"onChat\"\r\n >\r\n <image\r\n class=\"item-icon\"\r\n :src=\"sheep.$url.static('/static/img/shop/goods/message.png')\"\r\n mode=\"aspectFit\"\r\n />\r\n <view class=\"item-title\">客服</view>\r\n </view>\r\n <view\r\n v-if=\"shareIcon\"\r\n class=\"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center\"\r\n @tap=\"showShareModal\"\r\n >\r\n <image\r\n class=\"item-icon\"\r\n :src=\"sheep.$url.static('/static/img/shop/goods/share.png')\"\r\n mode=\"aspectFit\"\r\n />\r\n <view class=\"item-title\">分享</view>\r\n </view>\r\n <slot></slot>\r\n </view>\r\n </view>\r\n </su-fixed>\r\n</template>\r\n\r\n<script setup>\r\n/**\r\n *\r\n * 底部导航\r\n *\r\n * @property {String} bg \t\t\t \t\t\t- 背景颜色Class\r\n * @property {String} ui \t\t\t \t\t\t- 自定义样式Class\r\n * @property {Boolean} noFixed \t\t \t\t\t- 是否定位\r\n * @property {Boolean} topRadius \t\t \t\t- 上圆角\r\n */\r\nimport { reactive } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport { showShareModal } from '@/sheep/hooks/useModal'\r\nimport FavoriteApi from '@/sheep/api/product/favorite'\r\n\r\n// 数据\r\nconst state = reactive({})\r\n\r\n// 接收参数\r\nconst props = defineProps({\r\n modelValue: {\r\n type: Object,\r\n default() {},\r\n },\r\n bg: {\r\n type: String,\r\n default: 'bg-white',\r\n },\r\n bgStyles: {\r\n type: Object,\r\n default() {},\r\n },\r\n ui: {\r\n type: String,\r\n default: '',\r\n },\r\n\r\n noFixed: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n topRadius: {\r\n type: Number,\r\n default: 0,\r\n },\r\n collectIcon: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n serviceIcon: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n shareIcon: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n})\r\n\r\nasync function onFavorite() {\r\n // 情况一:取消收藏\r\n if (props.modelValue.favorite) {\r\n const { code } = await FavoriteApi.deleteFavorite(props.modelValue.id)\r\n if (code !== 0) {\r\n return\r\n }\r\n sheep.$helper.toast('取消收藏')\r\n props.modelValue.favorite = false\r\n // 情况二:添加收藏\r\n } else {\r\n const { code } = await FavoriteApi.createFavorite(props.modelValue.id)\r\n if (code !== 0) {\r\n return\r\n }\r\n sheep.$helper.toast('收藏成功')\r\n props.modelValue.favorite = true\r\n }\r\n}\r\n\r\nconst onChat = () => {\r\n sheep.$router.go('/modules/mall/chat/index', {\r\n id: props.modelValue.id,\r\n })\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.ui-tabbar-box {\r\n box-shadow: 0px -6px 10px 0px rgba(51, 51, 51, 0.2);\r\n}\r\n.ui-tabbar {\r\n display: flex;\r\n height: 50px;\r\n background: #fff;\r\n\r\n .detail-tabbar-item {\r\n width: 100rpx;\r\n\r\n .item-icon {\r\n width: 40rpx;\r\n height: 40rpx;\r\n }\r\n\r\n .item-title {\r\n margin-top: 12rpx;\r\n font-size: 20rpx;\r\n font-weight: 500;\r\n line-height: 20rpx;\r\n }\r\n }\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/modules/mall/goods/components/detail/detail-tabbar.vue'\nwx.createComponent(Component)"],"names":["reactive","FavoriteApi","sheep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEcA,kBAAQ,SAAC,EAAE;AAGzB,UAAM,QAAQ;AAwCd,aAAe,aAAa;AAAA;AAE1B,YAAI,MAAM,WAAW,UAAU;AAC7B,gBAAM,EAAE,KAAI,IAAK,MAAMC,2BAAAA,YAAY,eAAe,MAAM,WAAW,EAAE;AACrE,cAAI,SAAS,GAAG;AACd;AAAA,UACD;AACDC,4BAAM,QAAQ,MAAM,MAAM;AAC1B,gBAAM,WAAW,WAAW;AAAA,QAEhC,OAAS;AACL,gBAAM,EAAE,KAAI,IAAK,MAAMD,2BAAAA,YAAY,eAAe,MAAM,WAAW,EAAE;AACrE,cAAI,SAAS,GAAG;AACd;AAAA,UACD;AACDC,4BAAM,QAAQ,MAAM,MAAM;AAC1B,gBAAM,WAAW,WAAW;AAAA,QAC7B;AAAA,MACH;AAAA;AAEA,UAAM,SAAS,MAAM;AACnBA,wBAAM,QAAQ,GAAG,4BAA4B;AAAA,QAC3C,IAAI,MAAM,WAAW;AAAA,MACzB,CAAG;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IA,GAAG,gBAAgB,SAAS;"} |