Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
76933854
Commit
76933854
authored
Aug 01, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情
parent
477407cf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
4 deletions
+76
-4
packageDetail.js
src/api/packageDetail.js
+9
-0
shop.js
src/api/shop.js
+8
-0
iconfont.css
src/assets/iconfont/iconfont.css
+7
-3
pages.json
src/pages.json
+2
-1
packageDetails.vue
src/pages/packageDetails/packageDetails.vue
+18
-0
shop.vue
src/pages/shop/shop.vue
+0
-0
avatar.png
src/static/shop/avatar.png
+0
-0
common.js
src/utils/common.js
+32
-0
No files found.
src/api/packageDetail.js
0 → 100644
View file @
76933854
import
{
request
}
from
'../utils/request'
;
// 套餐详情
export
function
getProdDetail
(
data
)
{
return
request
({
url
:
`/sgyrdd/prod/getProd?prodId=
${
data
}
`
,
method
:
'GET'
,
});
}
src/api/shop.js
View file @
76933854
...
@@ -31,3 +31,11 @@ export function couponShopList(data) {
...
@@ -31,3 +31,11 @@ export function couponShopList(data) {
method
:
'GET'
,
method
:
'GET'
,
});
});
}
}
// 评论
export
function
likeOrDislike
(
data
)
{
return
request
({
url
:
`/sgyrdd/evaluation/likeOrDislike`
,
method
:
'POST'
,
data
,
});
}
src/assets/iconfont/iconfont.css
View file @
76933854
@font-face
{
@font-face
{
font-family
:
"iconfont"
;
/* Project id 4633414 */
font-family
:
"iconfont"
;
/* Project id 4633414 */
src
:
url('//at.alicdn.com/t/c/font_4633414_
xeh7f81eleh.woff2?t=1722311537248
')
format
(
'woff2'
),
src
:
url('//at.alicdn.com/t/c/font_4633414_
rdq1553pta.woff2?t=1722413035003
')
format
(
'woff2'
),
url('//at.alicdn.com/t/c/font_4633414_
xeh7f81eleh.woff?t=1722311537248
')
format
(
'woff'
),
url('//at.alicdn.com/t/c/font_4633414_
rdq1553pta.woff?t=1722413035003
')
format
(
'woff'
),
url('//at.alicdn.com/t/c/font_4633414_
xeh7f81eleh.ttf?t=1722311537248
')
format
(
'truetype'
);
url('//at.alicdn.com/t/c/font_4633414_
rdq1553pta.ttf?t=1722413035003
')
format
(
'truetype'
);
}
}
.iconfont
{
.iconfont
{
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing
:
grayscale
;
-moz-osx-font-smoothing
:
grayscale
;
}
}
.icon-xiai
:before
{
content
:
"\e601"
;
}
.icon-tongzhi
:before
{
.icon-tongzhi
:before
{
content
:
"\e60d"
;
content
:
"\e60d"
;
}
}
...
...
src/pages.json
View file @
76933854
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
{
{
"path"
:
"pages/shop/shop"
,
"path"
:
"pages/shop/shop"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"店铺首页"
"navigationBarTitleText"
:
"店铺首页"
,
"onReachBottomDistance"
:
50
}
}
},
},
{
{
...
...
src/pages/packageDetails/packageDetails.vue
View file @
76933854
...
@@ -128,11 +128,29 @@
...
@@ -128,11 +128,29 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
getProdDetail
}
from
'@/api/packageDetail'
;
const
swiperList
=
ref
([
const
swiperList
=
ref
([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
'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/capybara.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.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
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/shop/shop.vue
View file @
76933854
This diff is collapsed.
Click to expand it.
src/static/shop/avatar.png
0 → 100644
View file @
76933854
1.98 KB
src/utils/common.js
View file @
76933854
...
@@ -20,3 +20,35 @@ export function getDistance(lat1, lng1, lat2, lng2) {
...
@@ -20,3 +20,35 @@ export function getDistance(lat1, lng1, lat2, lng2) {
function
deg2rad
(
deg
)
{
function
deg2rad
(
deg
)
{
return
deg
*
(
Math
.
PI
/
180
);
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
[];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment