-
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
Conversation
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
1 similar comment
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
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.
修复了一些问题,接下来就是急需完善功能就可以了
src/pages/products/index.vue
Outdated
data() { | ||
return { | ||
products: [], | ||
pageInfo: {}, |
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.
需要设置默认值,否则空白页面时候显示有问题
src/pages/products/index.vue
Outdated
<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> |
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.
加点什么样式?不说能买了 先弄的好看一点的展示页面
src/pages/products/index.vue
Outdated
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
图标弄个上传之类的
然后条件编译,如果是微信小程序则不显示
src/pages/products/upload.vue
Outdated
<input | ||
id="product-name" | ||
v-model="productData.name" | ||
type="text" | ||
class="text-input" | ||
placeholder="请输入商品名称" | ||
> |
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.
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.
这边的点击上传文件有点问题,我去上传头像那边看看
@click="triggerFileInput" | ||
> | ||
<i class="iconfont icon-upload" /> | ||
<p>点击上传图片</p> |
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.
这个感觉有点问题、
简单点的话可以从头像那里去抄
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.
好的,现在正在修改这个问题
# Conflicts: # src/pages/products/index.vue # src/pages/users/me/points.vue
# Conflicts: # src/pages/products/history.vue # src/pages/products/index.vue # src/pages/products/productDetail.vue
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
src/pages/products/productDetail.vue
Outdated
@@ -0,0 +1,166 @@ | |||
<template> |
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.
这个文件的名字直接叫details就行吧,没必要前面加一个product
src/pages/users/me/points.vue
Outdated
goToUploadGoods() { | ||
uni.navigateTo({ | ||
url: './uploadgoods.vue', | ||
}); | ||
}, |
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.
为啥不用routers里的东东?
/** | ||
* 前往积分页面 | ||
* @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', | ||
}); | ||
} |
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.
这个感觉都废了没有好好利用?
/** | ||
* 获取个人积分增减信息 | ||
*/ | ||
export async function getMyPoints(id) { |
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.
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=`); |
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.
以及这个拼接不需要你手动操作吧,get的第二个参数传一个object应该就能实现
(固定只看第一页肯定是不合适吧?
src/pages/products/index.vue
Outdated
goToSubPage(id) { | ||
uni.navigateTo({ | ||
url: `/pages/products/productDetail?id=${id}`, | ||
}); | ||
}, |
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.
挪到 routers 里
src/services/point.js
Outdated
export function getGoods() { | ||
return request.get('/products'); | ||
} |
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.
现在这个接口还没实现分页是吧)
那先这样、之后再更新
goToPointMall() { | ||
uni.navigateTo({ | ||
url: '/pages/products/index', | ||
}); |
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.
挪一挪)
src/pages/products/index.vue
Outdated
<view | ||
class="floating-view" | ||
@tap="gotoBill" | ||
> | ||
<view class="view-content"> | ||
上传商品 | ||
</view> | ||
</view> |
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.
这个要判断一下,只有他是管理员身份才应该出现这个按钮
(或者目前把这个按钮注释掉,另开一个PR吧
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
src/pages.json
Outdated
"style": {} | ||
}, | ||
{ | ||
"path": "pages/products/productDetail", |
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.
这个的路由是 pages/products/details?id=xx
就行
} | ||
|
||
.bg-info .text { | ||
position: absolute; | ||
top: 22vh; | ||
font-size: 36rpx; | ||
font-size: 36 rpx; |
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.
这个有没有空格有影响么) 不太记得了
This PR is deployed at https://orange-cliff-0b1e10000-182.eastasia.2.azurestaticapps.net |
This is a feature about points