-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(point): add points system #182
Merged
Merged
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
375022a
feat(point): add points system
daonan233 c40d299
refactor(products): move pages
lin594 ee517ad
refactor(products): add products from points mall
lin594 41379d0
style: replace tab with space
lin594 72b0cdd
fix(products): refresh products onShow
lin594 345e842
fix(points): fix some errors
daonan233 11609c8
Merge remote-tracking branch 'origin/feat-point' into feat-point
daonan233 4144321
fix(point): fix point mall‘s error
daonan233 3443bd4
fix(point): fix point mall‘s error
daonan233 18c0360
Merge remote-tracking branch 'origin/feat-point' into feat-point
daonan233 ae1ba41
fix(point): fix point mall‘s error
daonan233 9d03b1b
fix(point): fix point mall‘s error
daonan233 b8706e8
Merge remote-tracking branch 'origin/feat-point' into feat-point
daonan233 e0fdb61
fix(point): fix point mall‘s error
daonan233 a4e1a05
fix(point): fix point mall‘s error
daonan233 51fd8dc
fix(point):fix the error of getGoods in page
daonan233 978a6f4
fix(point):fix the error of getGoods in page,and cancel the upload bu…
daonan233 a663be4
refactor(points): adjust urls
lin594 f906055
fix: remove the unused page
lin594 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<template> | ||
<view class="mall-page"> | ||
<cu-custom title="积分商城" /> | ||
<view class="product-list"> | ||
<view | ||
v-for="product in products" | ||
:key="product.id" | ||
class="product-item" | ||
> | ||
<image | ||
:src="product.picture" | ||
class="product-image" | ||
/> | ||
<view class="product-details"> | ||
<view class="product-name"> | ||
{{ product.name }} | ||
</view> | ||
<view class="product-points"> | ||
所需积分: {{ product.points }} | ||
</view> | ||
<view class="product-quantity"> | ||
剩余数量: {{ product.quantity }} | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
<view class="pagination-info"> | ||
当前页码: {{ pageInfo.page }} | ||
总页数: {{ pageInfo.total_pages }} | ||
每页数量: {{ pageInfo.pageSize }} | ||
总数量: {{ pageInfo.amount }} | ||
</view> | ||
<view | ||
class="circle-button" | ||
@click="toUploadProductsPage()" | ||
> | ||
<i class="iconfont icon-plus" /> | ||
</view> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 图标弄个上传之类的 |
||
</view> | ||
</template> | ||
|
||
<script> | ||
import { getProductInfo } from '@/services/user'; | ||
import { toUploadProductsPage } from '@/routers/product'; | ||
|
||
export default { | ||
data() { | ||
return { | ||
products: [], | ||
pageInfo: {}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 需要设置默认值,否则空白页面时候显示有问题 |
||
}; | ||
}, | ||
methods: { | ||
toUploadProductsPage, | ||
async loadProducts() { | ||
try { | ||
const response = await getProductInfo(); | ||
this.products = response.result; | ||
this.pageInfo = { | ||
page: response.page, | ||
total_pages: response.total_pages, | ||
pageSize: response.pageSize, | ||
amount: response.amount, | ||
}; | ||
} catch (error) { | ||
uni.showToast({ | ||
title: '无法加载商品', | ||
}); | ||
} | ||
}, | ||
}, | ||
onMounted() { | ||
this.loadProducts(); | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.circle-button { | ||
width: 60px; | ||
height: 60px; | ||
background-color: #007bff; | ||
color: #fff; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); | ||
transition: background-color 0.2s; | ||
} | ||
|
||
.circle-button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
.iconfont { | ||
font-size: 24px; | ||
} | ||
|
||
.circle-button { | ||
width: 60px; | ||
height: 60px; | ||
background-color: #39C5BB; | ||
color: #fff; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); | ||
position: fixed; | ||
bottom: 20px; | ||
right: 20px; | ||
z-index: 9999; | ||
transition: background-color 0.2s; | ||
} | ||
|
||
.circle-button:hover { | ||
background-color: #39c5bb; | ||
} | ||
|
||
.iconfont { | ||
font-size: 50px; | ||
} | ||
|
||
/* Custom styles for the white plus sign */ | ||
.circle-button i::before { | ||
content: '+'; | ||
color: #fff; | ||
} | ||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加点什么样式?不说能买了 先弄的好看一点的展示页面