Skip to content
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 19 commits into from
Nov 27, 2023
Merged

Conversation

daonan233
Copy link
Contributor

This is a feature about points

@github-actions
Copy link

lin594

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Sep 3, 2023

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 3, 2023

@github-actions
Copy link

github-actions bot commented Sep 3, 2023

Copy link
Member

@lin594 lin594 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修复了一些问题,接下来就是急需完善功能就可以了

data() {
return {
products: [],
pageInfo: {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要设置默认值,否则空白页面时候显示有问题

Comment on lines 5 to 25
<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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加点什么样式?不说能买了 先弄的好看一点的展示页面

Comment on lines 33 to 38
<view
class="circle-button"
@click="toUploadProductsPage()"
>
<i class="iconfont icon-plus" />
</view>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图标弄个上传之类的
然后条件编译,如果是微信小程序则不显示

Comment on lines 12 to 18
<input
id="product-name"
v-model="productData.name"
type="text"
class="text-input"
placeholder="请输入商品名称"
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有的这个文本款就感觉显示有点问题?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边的点击上传文件有点问题,我去上传头像那边看看

@click="triggerFileInput"
>
<i class="iconfont icon-upload" />
<p>点击上传图片</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个感觉有点问题、
简单点的话可以从头像那里去抄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,现在正在修改这个问题

@github-actions
Copy link

@github-actions
Copy link

@@ -0,0 +1,166 @@
<template>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件的名字直接叫details就行吧,没必要前面加一个product

Comment on lines 84 to 88
goToUploadGoods() {
uni.navigateTo({
url: './uploadgoods.vue',
});
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥不用routers里的东东?

Comment on lines +1 to +28
/**
* 前往积分页面
* @param id 文章id
*/
// eslint-disable-next-line import/prefer-default-export
export function toPointsPage(id) {
uni.navigateTo({
url: `/pages/users/me/points?id=${id}`,
});
}

/**
* 前往积分商城页面
*/
export function toPointMall() {
uni.navigateTo({
url: '/pages/users/me/pointmall',
});
}

/**
* 前往商品发布页面
*/
export function toUploadGoods() {
uni.navigateTo({
url: '/pages/users/me/uploadgoods',
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个感觉都废了没有好好利用?

/**
* 获取个人积分增减信息
*/
export async function getMyPoints(id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export async function getMyPoints(id) {
export async function getMyPoints(id, page=1, pageSize=10) {

一般来说 page 和 pageSize 都是当参数吧?

* 获取个人积分增减信息
*/
export async function getMyPoints(id) {
return request.get(`/transactions?user=${id}&page=1&pageSize=10&action=earn,redeem&start_date=&end_date=`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以及这个拼接不需要你手动操作吧,get的第二个参数传一个object应该就能实现
(固定只看第一页肯定是不合适吧?

Comment on lines 97 to 101
goToSubPage(id) {
uni.navigateTo({
url: `/pages/products/productDetail?id=${id}`,
});
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

挪到 routers 里

Comment on lines 6 to 8
export function getGoods() {
return request.get('/products');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在这个接口还没实现分页是吧)
那先这样、之后再更新

Comment on lines +86 to +89
goToPointMall() {
uni.navigateTo({
url: '/pages/products/index',
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

挪一挪)

Comment on lines 4 to 11
<view
class="floating-view"
@tap="gotoBill"
>
<view class="view-content">
上传商品
</view>
</view>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个要判断一下,只有他是管理员身份才应该出现这个按钮
(或者目前把这个按钮注释掉,另开一个PR吧

Copy link

Copy link

src/pages.json Outdated
"style": {}
},
{
"path": "pages/products/productDetail",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个的路由是 pages/products/details?id=xx 就行

}

.bg-info .text {
position: absolute;
top: 22vh;
font-size: 36rpx;
font-size: 36 rpx;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个有没有空格有影响么) 不太记得了

Copy link

@lin594 lin594 merged commit df629a8 into e-dialect:master Nov 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants