Skip to content

Commit

Permalink
更新列表页面
Browse files Browse the repository at this point in the history
  • Loading branch information
biaov committed Jan 31, 2024
1 parent 26c6dcf commit 5808218
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 6 deletions.
2 changes: 1 addition & 1 deletion admin/src/components/modal-qrcode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function modalQrcodeComponent(props: Props) {

return (
<>
<Modal {...{ onCancel, footer: null, open: formState.visible, title: '二维码' }}>
<Modal {...{ onCancel, footer: null, open: formState.visible, title: '投放二维码' }}>
<div className="p-tb-40">
<Row justify="center">
<QRCode type="svg" value={text || '-'} color="#409eff" />
Expand Down
2 changes: 1 addition & 1 deletion admin/src/views/activity/draw-prize/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function CasePage() {
render: (_, record) => (
<Space size={12}>
<Button type="link" className="p-0" disabled={!checkPermission('/activity/draw-prize/qrcode') || record.status === activityStatus.ended} onClick={() => onShowQrcodeModal(record)}>
二维码
投放二维码
</Button>
<Button
type="link"
Expand Down
5 changes: 5 additions & 0 deletions mobile/src/api/activity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { command, restful } from './factory'

/**
* 抽奖活动
*/
export const drawPrizeApi = restful('/activity/draw-prize')

/**
* 抽奖活动记录
*/
Expand Down
4 changes: 2 additions & 2 deletions mobile/src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "ecosystem",
"appid": "H5B979BEE",
"description": "这是一个生态系统的移动端",
"versionName": "1.2.1",
"versionCode": "121",
"versionName": "1.3.0",
"versionCode": "130",
"transformPx": false,
"app-plus": {
"usingComponents": true,
Expand Down
9 changes: 7 additions & 2 deletions mobile/src/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,16 @@
{
"root": "pages/activity",
"pages": [
{
"path": "draw-prize-list/index",
"style": {
"navigationBarTitleText": "抽奖列表"
}
},
{
"path": "draw-prize/index",
"style": {
"navigationBarTitleText": "抽奖",
"navigationStyle": "custom"
"navigationBarTitleText": "抽奖"
}
}
]
Expand Down
22 changes: 22 additions & 0 deletions mobile/src/pages/activity/draw-prize-list/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { drawPrizeApi } from '@/api/activity'
import type { DrawPrizeItem } from './types'

/**
* 抽奖列表数据
*/
export const useDrawPrizeList = () => {
const drawPrizeList = ref<DrawPrizeItem[]>([])

const loadPrizeData = async () => {
const data = await drawPrizeApi.all<DrawPrizeItem[]>()
drawPrizeList.value = data
}

const onClickItem = (item: DrawPrizeItem) => {
uni.navigateTo({
url: `/pages/activity/draw-prize/index?id=${item.id}`
})
}

return { drawPrizeList, loadPrizeData, onClickItem }
}
Empty file.
32 changes: 32 additions & 0 deletions mobile/src/pages/activity/draw-prize-list/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script lang="ts" setup>
import { toast } from '@/utils/function'
import { useDrawPrizeList } from './hooks'
const [loading, setLoading] = useVisible(true)
const { drawPrizeList, loadPrizeData, onClickItem } = useDrawPrizeList()
useSilentAuth(async () => {
await loadPrizeData()
setLoading(false)
})
</script>

<template>
<view class="p-30 w-100vw h-100vh flex flex-column flex-dc bg-white" v-if="!loading">
<view class="m-b-20 bg-color-f5 p-30 w-fill flex flex-sb flex-dc br-8" v-for="(item, index) in drawPrizeList" :key="index" @click="onClickItem(item)">
<view class="flex-1">
<view class="color-85 m-b-10">名称:{{ item.name }}</view>
<view class="color-45">开始时间:{{ item.startTime }}</view>
<view class="color-45">结束时间:{{ item.endTime }}</view>
</view>
<view>
<image class="w-40 h-40 m-l-10" src="/static/icon/arrow-right.png" mode="widthFix"></image>
</view>
</view>
</view>
<loading-page :loading="loading" />
</template>

<style lang="less" scoped>
@import './index.less';
</style>
10 changes: 10 additions & 0 deletions mobile/src/pages/activity/draw-prize-list/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* 抽奖活动
*/
export interface DrawPrizeItem {
id: number
name: string
desc: string
startTime: string
endTime: String
}
Binary file added mobile/src/static/icon/draw-prize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5808218

Please sign in to comment.