Browse Source

Merge pull request 'dev' (#1) from dev into master

Reviewed-on: #1
master
王琳 5 months ago
parent
commit
a14a71af85
  1. 2
      README.md
  2. 6
      index.html
  3. 70
      package-lock.json
  4. 1
      package.json
  5. 1
      src/assets/logo.svg
  6. 3
      src/assets/main.css
  7. 4
      src/main.js
  8. 11
      src/router/index.js
  9. 231
      src/views/FrontView.vue
  10. 392
      src/views/backindex.vue

2
README.md

@ -27,3 +27,5 @@ npm run dev
```sh
npm run build
```
npm install element-plus --save 下载 element-plus 组件

6
index.html

@ -11,3 +11,9 @@
<script type="module" src="/src/main.js"></script>
</body>
</html>
<style>
body{
margin: 0;
}
</style>

70
package-lock.json

@ -10,6 +10,7 @@
"dependencies": {
"axios": "^1.7.9",
"element-plus": "^2.9.1",
"moment": "^2.30.1",
"pinia": "^2.2.6",
"vue": "^3.5.13",
"vue-router": "^4.4.5"
@ -491,7 +492,7 @@
},
"node_modules/@ctrl/tinycolor": {
"version": "3.6.1",
"resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
"integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==",
"license": "MIT",
"engines": {
@ -500,7 +501,7 @@
},
"node_modules/@element-plus/icons-vue": {
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
"integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
"license": "MIT",
"peerDependencies": {
@ -917,7 +918,7 @@
},
"node_modules/@floating-ui/core": {
"version": "1.6.8",
"resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.6.8.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@floating-ui/core/-/core-1.6.8.tgz",
"integrity": "sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==",
"license": "MIT",
"dependencies": {
@ -926,7 +927,7 @@
},
"node_modules/@floating-ui/dom": {
"version": "1.6.12",
"resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.6.12.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@floating-ui/dom/-/dom-1.6.12.tgz",
"integrity": "sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==",
"license": "MIT",
"dependencies": {
@ -936,7 +937,7 @@
},
"node_modules/@floating-ui/utils": {
"version": "0.2.8",
"resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.8.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@floating-ui/utils/-/utils-0.2.8.tgz",
"integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==",
"license": "MIT"
},
@ -1002,7 +1003,7 @@
"node_modules/@popperjs/core": {
"name": "@sxzz/popperjs-es",
"version": "2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==",
"license": "MIT",
"funding": {
@ -1328,13 +1329,13 @@
},
"node_modules/@types/lodash": {
"version": "4.17.13",
"resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.13.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/lodash/-/lodash-4.17.13.tgz",
"integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==",
"license": "MIT"
},
"node_modules/@types/lodash-es": {
"version": "4.17.12",
"resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"license": "MIT",
"dependencies": {
@ -1343,7 +1344,7 @@
},
"node_modules/@types/web-bluetooth": {
"version": "0.0.16",
"resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
"integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==",
"license": "MIT"
},
@ -1583,7 +1584,7 @@
},
"node_modules/@vueuse/core": {
"version": "9.13.0",
"resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@vueuse/core/-/core-9.13.0.tgz",
"integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==",
"license": "MIT",
"dependencies": {
@ -1598,7 +1599,7 @@
},
"node_modules/@vueuse/metadata": {
"version": "9.13.0",
"resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@vueuse/metadata/-/metadata-9.13.0.tgz",
"integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==",
"license": "MIT",
"funding": {
@ -1607,7 +1608,7 @@
},
"node_modules/@vueuse/shared": {
"version": "9.13.0",
"resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@vueuse/shared/-/shared-9.13.0.tgz",
"integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==",
"license": "MIT",
"dependencies": {
@ -1619,19 +1620,19 @@
},
"node_modules/async-validator": {
"version": "4.2.5",
"resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/async-validator/-/async-validator-4.2.5.tgz",
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==",
"license": "MIT"
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"license": "MIT"
},
"node_modules/axios": {
"version": "1.7.9",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
"license": "MIT",
"dependencies": {
@ -1722,7 +1723,7 @@
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"license": "MIT",
"dependencies": {
@ -1778,7 +1779,7 @@
},
"node_modules/dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==",
"license": "MIT"
},
@ -1845,7 +1846,7 @@
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"license": "MIT",
"engines": {
@ -1861,7 +1862,7 @@
},
"node_modules/element-plus": {
"version": "2.9.1",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.1.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/element-plus/-/element-plus-2.9.1.tgz",
"integrity": "sha512-9Agqf/jt4Ugk7EZ6C5LME71sgkvauPCsnvJN12Xid2XVobjufxMGpRE4L7pS4luJMOmFAH3J0NgYEGZT5r+NDg==",
"license": "MIT",
"dependencies": {
@ -1959,7 +1960,7 @@
},
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"license": "MIT"
},
@ -2014,7 +2015,7 @@
},
"node_modules/follow-redirects": {
"version": "1.15.9",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/follow-redirects/-/follow-redirects-1.15.9.tgz",
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
"funding": [
{
@ -2034,7 +2035,7 @@
},
"node_modules/form-data": {
"version": "4.0.1",
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"license": "MIT",
"dependencies": {
@ -2315,19 +2316,19 @@
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/lodash-es": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
"license": "MIT"
},
"node_modules/lodash-unified": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash-unified/-/lodash-unified-1.0.3.tgz",
"integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==",
"license": "MIT",
"peerDependencies": {
@ -2357,13 +2358,13 @@
},
"node_modules/memoize-one": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/memoize-one/-/memoize-one-6.0.0.tgz",
"integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==",
"license": "MIT"
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"license": "MIT",
"engines": {
@ -2372,7 +2373,7 @@
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"license": "MIT",
"dependencies": {
@ -2389,6 +2390,15 @@
"dev": true,
"license": "MIT"
},
"node_modules/moment": {
"version": "2.30.1",
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
"license": "MIT",
"engines": {
"node": "*"
}
},
"node_modules/mrmime": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/mrmime/-/mrmime-2.0.0.tgz",
@ -2433,7 +2443,7 @@
},
"node_modules/normalize-wheel-es": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==",
"license": "BSD-3-Clause"
},
@ -2610,7 +2620,7 @@
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"license": "MIT"
},

1
package.json

@ -11,6 +11,7 @@
"dependencies": {
"axios": "^1.7.9",
"element-plus": "^2.9.1",
"moment": "^2.30.1",
"pinia": "^2.2.6",
"vue": "^3.5.13",
"vue-router": "^4.4.5"

1
src/assets/logo.svg

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>

3
src/assets/main.css

@ -1,3 +1,6 @@
*{
margin: 0;
}
body{
margin: 0;
}

4
src/main.js

@ -1,4 +1,4 @@
import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
@ -9,7 +9,7 @@ import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
const app = createApp(App)
app.use(ElementPlus)
app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.mount('#app')

11
src/router/index.js

@ -1,15 +1,20 @@
import { createRouter, createWebHistory } from 'vue-router'
import FrontView from '../views/FrontView.vue'
import Backindex from '@/views/backindex.vue'
import FrontView from '@/views/FrontView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name:'front',
component:FrontView
},
{
path: '/back',
name: 'home',
component: FrontView,
component: Backindex,
},
],
})

231
src/views/FrontView.vue

@ -1,76 +1,20 @@
<script setup>
import ShowApi from '@/axios/ShowApi';
import { ref } from 'vue';
import ShowApi from "@/axios/ShowApi";
import { ref } from "vue";
//
const participants = ref([]);
//
const activity = ref();
const percent = ref()
const percent = ref();
function loadParticipants() {
// participants.value = [
// {
// id: 1,
// jwcode: "498498",
// },
// {
// id: 2,
// jwcode: "498498",
// },
// {
// id: 3,
// jwcode: "498498",
// },
// {
// id: 4,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// },
// {
// id: 5,
// jwcode: "498498",
// }
// ]
ShowApi.showPage().then(result =>{
console.log("后端数据:",result.data)
ShowApi.showPage().then((result) => {
activity.value = result.data;
// participants.value = result.data.participantList;
percent.value = result.data.nowNumber/result.data.targetNumber*100
console.log("活动数据",activity.value)
})
let per = (result.data.nowNumber / result.data.targetNumber) * 100;
// 使 Math.round()
let roundedPercent = Math.round(per);
percent.value = roundedPercent;
});
}
loadParticipants();
</script>
@ -81,55 +25,48 @@ loadParticipants();
<div class="header">
<div class="title" :title="activity.title">
关于{{activity.title}}众筹
关于{{ activity.title }}众筹
</div>
<div class="minge" :target="activity.targetNumber">
只需要{{activity.targetNumber}}个名额
只需要{{ activity.targetNumber }}个名额
</div>
<!-- 众筹状态 -->
<div class="state">
<span class="doing">众筹状态</span>
<span class="finished" v-if="activity.status==1">众筹中</span>
<span class="finished" v-if="activity.status == 1">众筹中</span>
<span class="finished" v-else>已完成</span>
</div>
<!-- 进度 -->
<div class="jindu">
<!-- 当前进度 -->
<span class="current" :current="activity.nowNumber">
当前进度:{{activity.nowNumber}}
当前进度:{{ activity.nowNumber }}
</span>
<!-- 目标 -->
<span class="goal" :goal="activity.targetNumber">
目标{{activity.targetNumber}}
目标{{ activity.targetNumber }}
</span>
</div>
<!-- 目标 -->
</div>
<!-- 进度条 -->
<div class="progress-bar">
<!-- 进度条背景 -->
<div class="progress-bg">
<!-- 进度条 -->
<div class="progress-bottem">
<div class="progress">
<el-progress
:text-inside="true"
:stroke-width="40"
:percentage="percent"
status="exception"
/>
<el-progress :text-inside="true" :stroke-width="40" :percentage="percent" status="exception" />
</div>
</div>
<!-- 丝带 -->
</div>
</div>
<!-- 参与众筹人员展示 -->
<div class="list">
<div class="list-item" v-for="participant in activity.participantList">
<div class="display-item" :jwcode="participant.jwcode">
恭喜{{ participant.jwcode }}参与了本次众筹</div>
恭喜{{ participant.jwcode }}参与了本次众筹
</div>
</div>
</div>
</div>
@ -139,79 +76,84 @@ loadParticipants();
.container {
background-image: url("../assets/bg.png");
width: 100%;
height: auto;
height: 100vh;
}
/* 20vh */
.title {
color: #FFC48D;
color: #ffc48d;
text-shadow: 20px 0 7px rgba(96, 0, 0, 0.35);
font-weight: 700;
width: auto;
height: auto;
font-size: 150px;
height: 12vh;
font-size: 6vw;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
padding-top: 100px;
font-family: Alibaba PuHuiTi 3.0;
padding-top: 8vh;
font-family: Alibaba PuHuiTi 3;
}
/* 12vh */
.minge {
font-weight: 700;
color: #FFC48D;
color: #ffc48d;
font-weight: 115 Black;
width: auto;
height: auto;
font-size: 110px;
height: 10vh;
font-size: 5vw;
text-align: center;
text-shadow: 0 20px 7px 0 #61000059;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
margin-top: 50px;
margin-top: 2vh;
}
/* 10vh */
.state {
margin: auto;
margin-top: 40px;
background-color: #E0BA77;
border: 1px solid #BE6F2D;
margin-top: 3vh;
background-color: #e0ba77;
border: 1px solid #be6f2d;
border-radius: 29.18px 29.18px 29.18px 29.18px;
width: 355.09px;
height: 58.38px;
width: 29vw;
height: 7vh;
}
.doing {
color: #AE0000;
color: #ae0000;
display: inline-block;
font-weight: 800;
font-size: 30.41px;
font-size: 2vw;
text-align: center;
color: #AE0000 100%;
color: #ae0000 100%;
text-align: center;
padding-left: 20px;
padding-top: 5px;
padding-left: 2vw;
padding-top: 1vh;
}
.finished {
margin-left: 19px;
margin-top: 7px;
margin-left: 3vw;
margin-top: 1vh;
display: inline-block;
width: 187.56px;
height: 45.62px;
width: 15vw;
height: 5.5vh;
border-radius: 22.81px 22.81px 22.81px 22.81px;
background: #ffffff;
color: #AE0000;
color: #ae0000;
font-weight: 800;
font-size: 30.41px;
font-size: 2vw;
text-align: center;
}
/* 10vh */
.jindu {
margin-top: 25px;
margin-top: 3vh;
height: 3vh;
margin-bottom: 4vh;
display: flex;
/* 启用 Flexbox 布局 */
justify-content: center;
@ -228,7 +170,7 @@ loadParticipants();
justify-content: center;
align-items: center;
color: #bb0404;
font-size: 32px;
font-size: 2vw;
font-weight: 900;
}
@ -243,18 +185,21 @@ loadParticipants();
justify-content: center;
align-items: center;
color: #bb0404;
font-size: 32px;
font-size: 2vw;
font-weight: 900;
}
/* 20vh */
.progress-bar {
margin-top: 30px;
/* margin-top: 30px; */
height: 20vh;
position: relative;
}
.progress-bg {
background-image: url("../assets/底座.png");
/* width: 1920px; */
height: 200px;
height: 20vh;
display: flex;
justify-content: center;
align-items: center;
@ -277,32 +222,34 @@ loadParticipants();
/* padding-top: 80px; */
width: 90%;
}
/* .sidai1{
position: absolute;
left: 1vw;
top: -3vh;
} */
.el-progress__text {
font-size: 16px; /* 调整字体大小 */
color: #333; /* 调整字体颜色 */
font-size: 16px;
/* 调整字体大小 */
color: #333;
/* 调整字体颜色 */
}
.list {
margin: auto;
display: flex;
/* 启用 Flexbox 布局 */
flex-wrap: wrap;
/* 允许换行 */
justify-content: flex-start;
align-items: flex-start;
/* 子元素之间的间隔 */
/* align-items: center; */
width: 70vw;
max-height: 300px;
height: 20vh;
border-radius: 0 0px 48px 48px;
background: linear-gradient(-90deg, #e51b1b, #990505);
/* padding: 0 200px; */
padding-left: 50px;
/* margin-top: 10px; */
padding-top: 20px;
padding-bottom: 50px;
border: #EDD88E solid 4px;
overflow-y:scroll /*只是y方向*/
padding-left: 3vw;
padding-top: 3vh;
padding-bottom: 3vh;
border: #edd88e solid 4px;
overflow-y: scroll;
}
.list-item {
@ -317,32 +264,40 @@ loadParticipants();
display: inline-block;
width: 60%;
box-sizing: border-box; /* 确保 padding 和 border 不会增加元素的总宽度 */
box-sizing: border-box;
/* 确保 padding 和 border 不会增加元素的总宽度 */
padding: 15px 0;
}
/* 为奇数项添加左边距,使得两列并排显示 */
.list-item:nth-child(odd) {
margin-left: 0;
margin-right: 10px; /* 添加右边距,确保两列之间有间隔 */
margin-right: 10px;
/* 添加右边距,确保两列之间有间隔 */
text-align: center;
}
.list-item:nth-child(even) {
margin-left: 10px; /* 为偶数项添加左边距,确保两列之间有间隔 */
margin-left: 10px;
/* 为偶数项添加左边距,确保两列之间有间隔 */
margin-right: 10px;
text-align: center;
}
.display-item {
font-size: 1.7vw;
font-weight: 200;
font-family: Source Han Serif SC;
border-bottom: 1px solid white;
display: inline-block; /* 使下划线与文本内容对齐 */
width: auto; /* 自动宽度,根据内容调整 */
margin: 0 auto; /* 居中显示 */
padding-left: 40px; /* 左边距,可以根据需要调整 */
padding-right: 40px; /* 右边距,可以根据需要调整 */
display: inline-block;
/* 使下划线与文本内容对齐 */
width: auto;
/* 自动宽度,根据内容调整 */
margin: 0 auto;
/* 居中显示 */
padding-left: 40px;
/* 左边距,可以根据需要调整 */
padding-right: 40px;
/* 右边距,可以根据需要调整 */
}
</style>

392
src/views/backindex.vue

@ -0,0 +1,392 @@
<script setup>
import { ref } from "vue";
import { ElMessage } from "element-plus";
import { ElMessageBox } from "element-plus";
import axios from "axios";
import moment from "moment";
const titleEdit = ref(false);
const raiseEdit = ref(false);
const addInfo = ref(false);
const deleteInfo = ref(false);
//
const info = ref({});
const getInfo = async function () {
try {
const result = await axios.get("http://192.168.9.117:8092/page");
info.value.title = result.data.data.title;
info.value.targetNumber = result.data.data.targetNumber;
} catch (error) {
console.log("请求失败", error);
}
};
getInfo();
//
const titleNew = ref({});
const putTitle = async function () {
try {
// FormData
const formData = new FormData();
// titleNewFormData
for (const key in titleNew.value) {
formData.append(key, titleNew.value[key]);
}
const result = await axios.put(
"http://192.168.9.117:8092/title",
formData,
{
headers: {
"Content-Type": "multipart/form-data",
},
}
);
if (result.data.code == 10000) {
ElMessage.success("修改成功");
titleEdit.value = false;
titleNew.value = {};
getInfo(); //
}
if (result.data.code == 10001) {
ElMessage.error(result.data.msg);
titleNew.value = {};
titleEdit.value = false;
}
} catch (error) {
console.log("请求失败", error);
}
};
//
const targetNumberNew = ref({});
const putTargetNumber = async function () {
try {
// FormData
const formData = new FormData();
// titleNewFormData
for (const key in targetNumberNew.value) {
formData.append(key, targetNumberNew.value[key]);
}
const result = await axios.put(
"http://192.168.9.117:8092/target",
formData,
{
headers: {
"Content-Type": "multipart/form-data",
},
}
);
if (result.data.code == 10000) {
ElMessage.success("修改成功");
raiseEdit.value = false;
targetNumberNew.value = {};
getInfo(); //
}
if (result.data.code == 10001) {
ElMessage.error(result.data.msg);
targetNumberNew.value = {};
raiseEdit.value = false;
}
} catch (error) {
console.log("请求失败", error);
}
};
//
const search = ref({
jwcode: "",
identity: "",
});
const tableData = ref([]);
const get = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/users",
search.value
);
tableData.value = result.data.data;
} catch (error) {
console.log("请求失败", error);
}
};
get();
//
const add = ref({});
const addUser = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/addUser",
add.value
);
if (result.data.code == 10000) {
ElMessage.success("修改成功");
addInfo.value = false;
add.value = {};
get(); //
}
if (result.data.code == 10001) {
ElMessage.error(result.data.msg);
addInfo.value = false;
add.value = {};
}
} catch (error) {
console.log("请求失败", error);
}
};
//
const idname = ref("");
function deleteRow(value) {
deleteInfo.value = true;
console.log(value);
idname.value = value;
}
const tureDelete = async function () {
try {
const result = await axios.delete(
"http://192.168.9.117:8092/delUser/" + idname.value
);
if (result.data.code == 10000) {
ElMessage.success("修改成功");
deleteInfo.value = false;
idname.value = {};
get(); //
}
if (result.data.code == 10001) {
ElMessage.error(result.data.msg);
deleteInfo.value = false;
idname.value = {};
}
} catch (error) {
console.log("请求失败", error);
}
};
//
const searchBy = ref({
jwcode: "",
identity: "",
});
const searchByJwcodeAndIdentity = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/users",
searchBy.value
);
if (result.data.code == 10000) {
ElMessage.success("查询成功");
}
if (result.data.code == 10001) {
ElMessage.error(result.data.msg);
}
tableData.value = result.data.data;
} catch (error) {
console.log("请求失败", error);
}
};
function Nono() {
searchBy.value = {};
get();
}
</script>
<template>
<el-container>
<el-main style="width: 100%">
<el-card style="min-width: 70%; margin: 0 auto">
<h2 style="margin-top: 0%">众筹活动界面后台</h2>
<h3>修改前台展示</h3>
<el-divider style="margin-top: 0%" />
<div style="display: flex; align-items: center">
<h4 style="margin: 0%">当前标题:</h4>
<span style="color: rgb(145, 145, 145); margin-left: 20px">{{
info.title
}}</span>
<el-button
class="xiugai"
type="danger"
style="
display: inline-block;
margin-left: 20px;
color: rgb(245, 62, 62);
margin-right: 50px;
"
@click="() => {titleEdit = true;titleNew.title = info.title}"
>修改</el-button
>
<span style="color: rgb(145, 145, 145);;">标题最高可输入12个字符</span>
</div>
<div style="display: flex; align-items: center">
<h4 style="margin-bottom: 0px; margin-top: 30px">众筹目标:</h4>
<span
style="
margin-bottom: 0px;
margin-top: 30px;
margin-left: 20px;
color: rgb(145, 145, 145);
"
>{{ info.targetNumber }}</span
>
<el-button
class="xiugai"
type="danger"
style="
display: inline-block;
margin-left: 20px;
margin-top: 30px;
color: rgb(245, 62, 62);
"
@click="() => {raiseEdit = true;targetNumberNew.targetNumber = info.targetNumber }"
>修改</el-button
>
</div>
</el-card>
<el-card style="min-width: 70%; margin: 0 auto; margin-top: 20px">
<h3>众筹用户列表</h3>
<el-button type="danger" @click="addInfo = true">添加</el-button>
<el-input
v-model="searchBy.jwcode"
style="width: 150px; margin-left: 200px"
placeholder="精网号"
></el-input>
<el-select
v-model="searchBy.identity"
style="width: 100px; margin-left: 60px"
placeholder="身份"
>
<el-option label="真实" value="1"></el-option>
<el-option label="虚拟" value="0"></el-option>
</el-select>
<el-button type="" @click="Nono()" style="margin-left: 40px"
>重置</el-button
>
<el-button type="danger" @click="searchByJwcodeAndIdentity()"
>查询</el-button
>
<el-table :data="tableData">
<el-table-column
label="序号"
width="300px"
type="index"
>
</el-table-column>
<el-table-column
prop="jwcode"
label="编号"
width="300px"
></el-table-column>
<el-table-column prop="identity" label="身份" width="300px">
<!-- 模板内容 -->
<template #default="scope">
<span v-if="scope.row.identity == 1">
<span>真实</span>
</span>
<span v-if="scope.row.identity == 0">
<span>虚拟</span>
</span>
</template>
</el-table-column>
<el-table-column prop="creatTime" label="参与时间" width="700px">
<template #default="scope">
{{ moment(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column label="操作" width="px">
<template #default="scope">
<el-button
@click="deleteRow(scope.row.jwcode)"
type="text"
style="color: rgb(245, 62, 62)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-main>
</el-container>
<!-- 这是添加的弹窗 -->
<el-dialog v-model="addInfo" width="500">
<div>
<h3 style="display: inline-block; margin-right: 20px">精网号</h3>
<el-input
v-model="add.jwcode"
placeholder="请输入精网号"
style="width: 300px; display: inline-block"
/>
</div>
<div>
<h3 style="display: inline-block; margin-right: 20px">身份</h3>
<el-radio-group v-model="add.identity">
<el-radio value="1" size="large">真实</el-radio>
<el-radio value="0" size="large">虚拟</el-radio>
</el-radio-group>
</div>
<el-button type="danger" @click="addUser()" style="margin-left: 400px"
>添加</el-button
>
</el-dialog>
<!-- 这是修改表题的弹窗 -->
<el-dialog v-model="titleEdit" width="500">
<div>
<h3 style="display: inline-block; margin-right: 20px">输入新标题</h3>
<el-input
v-model="titleNew.title"
placeholder="请输入新标题"
style="width: 300px; display: inline-block"
/>
</div>
<span style="color: rgb(145, 145, 145);;">标题最高可输入12个字符</span>
<el-button type="danger" @click="putTitle()" style="margin-left: 400px"
>确定</el-button
>
</el-dialog>
<!-- 这是修改众筹目标的弹窗 -->
<el-dialog v-model="raiseEdit" width="500">
<div>
<h3 style="display: inline-block; margin-right: 20px">
输入新众筹目标为
</h3>
<el-input
v-model="targetNumberNew.targetNumber"
placeholder="请输入阿拉伯数字"
style="width: 300px; display: inline-block"
/>
</div>
<el-button
type="danger"
@click="putTargetNumber()"
style="margin-left: 400px"
>确定</el-button
>
</el-dialog>
<!-- 这是删除的弹窗 -->
<el-dialog v-model="deleteInfo" width="500">
<div>
<h3 style="display: inline-block; margin-right: 20px">
确认删除该条信息
</h3>
</div>
<el-button type="danger" @click="tureDelete()" style="margin-left: 400px"
>确定</el-button
>
</el-dialog>
</template>
<style scoped>
/* 移除 el-button 的默认样式 */
.xiugai {
border: none;
background-color: transparent;
color: #409eff; /* Element Plus 默认的主题色 */
padding: 0;
font-size: inherit; /* 继承父元素的字体大小 */
}
</style>
Loading…
Cancel
Save