商品详情

parent 477407cf
import { request } from '../utils/request';
// 套餐详情
export function getProdDetail(data) {
return request({
url: `/sgyrdd/prod/getProd?prodId=${data}`,
method: 'GET',
});
}
......@@ -31,3 +31,11 @@ export function couponShopList(data) {
method: 'GET',
});
}
// 评论
export function likeOrDislike(data) {
return request({
url: `/sgyrdd/evaluation/likeOrDislike`,
method: 'POST',
data,
});
}
@font-face {
font-family: "iconfont"; /* Project id 4633414 */
src: url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.woff2?t=1722311537248') format('woff2'),
url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.woff?t=1722311537248') format('woff'),
url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.ttf?t=1722311537248') format('truetype');
src: url('//at.alicdn.com/t/c/font_4633414_rdq1553pta.woff2?t=1722413035003') format('woff2'),
url('//at.alicdn.com/t/c/font_4633414_rdq1553pta.woff?t=1722413035003') format('woff'),
url('//at.alicdn.com/t/c/font_4633414_rdq1553pta.ttf?t=1722413035003') format('truetype');
}
.iconfont {
......@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-xiai:before {
content: "\e601";
}
.icon-tongzhi:before {
content: "\e60d";
}
......
......@@ -21,7 +21,8 @@
{
"path": "pages/shop/shop",
"style": {
"navigationBarTitleText": "店铺首页"
"navigationBarTitleText": "店铺首页",
"onReachBottomDistance":50
}
},
{
......
......@@ -128,11 +128,29 @@
</template>
<script setup>
import { getProdDetail } from '@/api/packageDetail';
const swiperList = ref([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg',
]);
const myProdId = ref('');
onLoad((options) => {
const { prodId } = options;
myProdId.value = prodId;
getProdDetailFn(prodId);
});
/**
* 获取套餐详情
* @param {String} prodId
*/
function getProdDetailFn(prodId) {
getProdDetail(prodId).then((res) => {
if (res.code === 0) {
console.log('res', res);
}
});
}
</script>
<style lang="scss" scoped>
......
This diff is collapsed.
......@@ -20,3 +20,35 @@ export function getDistance(lat1, lng1, lat2, lng2) {
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
/**
* 更具图片路径返回全路径还是拼接的路径
* @param {*} imgUrl
* @param {*} avatarUrl
* @returns
*/
export function addImgUrlPrefix(imgUrl, avatarUrl) {
// 使用正则表达式检查是否是全路径
const isFullUrl = /^https?:\/\//i.test(avatarUrl);
// 如果不是全路径,添加 imgUrl 前缀
if (!isFullUrl) {
return imgUrl + avatarUrl;
}
// 如果是全路径,直接返回
return avatarUrl;
}
export function addImgUrlPrefixToImages(imgUrl, imagePaths) {
if (imagePaths !== '') {
// 使用逗号分隔的图片路径
const pathsArray = imagePaths.split(',');
// 在每个路径前面添加 imgUrl 前缀
const prefixedPaths = pathsArray.map((path) => imgUrl + path.trim());
// 返回组装好的数组
return prefixedPaths;
} else {
return [];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment