Browse Source

写第一页

master
岳鹏龙 1 year ago
parent
commit
e053712186
  1. 15173
      package-lock.json
  2. 156
      src/App.vue
  3. 295
      src/app/pages/votingElection/index.vue
  4. 56
      src/components/PullToRefresh.vue
  5. 5
      src/pages.json
  6. BIN
      src/static/img/grxx-select.png
  7. BIN
      src/static/img/grxx.png
  8. BIN
      src/static/img/tpxj-select.png
  9. BIN
      src/static/img/tpxj.png
  10. BIN
      src/static/img/wdxj-select.png
  11. BIN
      src/static/img/wdxj.png
  12. BIN
      src/static/img/xjjg-select.png
  13. BIN
      src/static/img/xjjg.png
  14. BIN
      src/static/img/xjlb-select.png
  15. BIN
      src/static/img/xjlb.png

15173
package-lock.json

File diff suppressed because it is too large

156
src/App.vue

@ -10,91 +10,91 @@
onLaunch(async(data) => { onLaunch(async(data) => {
// // //
launchInterceptor() // launchInterceptor()
// #ifdef H5
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
//
window.parent.postMessage(JSON.stringify({
type: 'appOnLaunch',
message: '初始化加载完成'
}), '*');
//
window.addEventListener('message', event => {
try {
let data = {
type: ''
};
if (typeof event.data == 'string') {
data = JSON.parse(event.data)
} else if (typeof event.data == 'object') {
data = event.data
}
if (data.type && data.type == 'appOnReady') {
window.parent.postMessage(JSON.stringify({
type: 'appOnReady',
message: '加载完成'
}), '*');
}
} catch (e) {
console.log('uni-app App.vue 接受数据错误', e)
}
}, false);
// id
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
const { wechatInit } = useShare()
wechatInit()
// #endif
const configStore = useConfigStore() // // #ifdef H5
await configStore.getTabbarConfig() // uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
await configStore.getLoginConfig()
useSystemStore().getMapFn() // //
useSystemStore().getSiteInfoFn() // window.parent.postMessage(JSON.stringify({
// type: 'appOnLaunch',
// message: ''
// }), '*');
// //
// window.addEventListener('message', event => {
// try { // try {
// // tabbar // let data = {
// uni.hideTabBar() // type: ''
// };
// if (typeof event.data == 'string') {
// data = JSON.parse(event.data)
// } else if (typeof event.data == 'object') {
// data = event.data
// }
// if (data.type && data.type == 'appOnReady') {
// window.parent.postMessage(JSON.stringify({
// type: 'appOnReady',
// message: ''
// }), '*');
// }
// } catch (e) { // } catch (e) {
// console.log('uni-app App.vue ', e)
// }
// }, false);
// // id
// if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
// const { wechatInit } = useShare()
// wechatInit()
// // #endif
// const configStore = useConfigStore()
// await configStore.getTabbarConfig()
// await configStore.getLoginConfig()
// useSystemStore().getMapFn()
// useSystemStore().getSiteInfoFn()
// // try {
// // // tabbar
// // uni.hideTabBar()
// // } catch (e) {
// // }
// //
// if (getToken()) {
// const memberStore = useMemberStore()
// await memberStore.setToken(getToken())
// setTimeout(() => {
// if (!uni.getStorageSync('openid')) {
// const memberInfo = useMemberStore().info
// // #ifdef MP-WEIXIN
// memberInfo && memberInfo.weapp_openid && uni.setStorageSync('openid', memberInfo.weapp_openid)
// // #endif
// // #ifdef H5
// isWeixinBrowser() && memberInfo && memberInfo.wx_openid && uni.setStorageSync('openid', memberInfo.wx_openid)
// // #endif
// }
// }, 1000)
// } // }
// // if (!getToken()) {
if (getToken()) { // const login = useLogin()
const memberStore = useMemberStore() // //
await memberStore.setToken(getToken()) // // #ifdef MP
// login.getAuthCode()
setTimeout(() => { // // #endif
if (!uni.getStorageSync('openid')) { // // #ifdef H5
const memberInfo = useMemberStore().info // if (isWeixinBrowser()) {
// #ifdef MP-WEIXIN // data.query.code ? login.authLogin(data.query.code) : login.getAuthCode('snsapi_userinfo')
memberInfo && memberInfo.weapp_openid && uni.setStorageSync('openid', memberInfo.weapp_openid) // }
// #endif // // #endif
// #ifdef H5 // }
isWeixinBrowser() && memberInfo && memberInfo.wx_openid && uni.setStorageSync('openid', memberInfo.wx_openid)
// #endif
}
}, 1000)
}
if (!getToken()) {
const login = useLogin()
//
// #ifdef MP
login.getAuthCode()
// #endif
// #ifdef H5
if (isWeixinBrowser()) {
data.query.code ? login.authLogin(data.query.code) : login.getAuthCode('snsapi_userinfo')
}
// #endif
}
}) })
onShow(() => { onShow(() => {

295
src/app/pages/votingElection/index.vue

@ -1,18 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import { import { onShow } from '@dcloudio/uni-app';
import { log } from 'console';
import {
onMounted, onMounted,
ref ref
} from 'vue'; } from 'vue';
import PullToRefresh from '@/components/PullToRefresh.vue';
const tpList = ref([ const tpList = ref([
{ {
img: '/static/img/grxx.png', img: '/static/img/grxx.png',
name: '陈志远', name: '陈志远',
class: '现任财务总监', class: '现任财务总监',
} }
]) ])
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => { const doSearch = (_formData : { page : number; limit : number }, onSuccess : Function) => {
// const submitData = { ...formData } // const submitData = { ...formData }
// listApi(submitData, userStore.useType).then((res) => { // listApi(submitData, userStore.useType).then((res) => {
// const { data } = res as { data: { data: any; total: number } } // const { data } = res as { data: { data: any; total: number } }
@ -22,46 +25,64 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
data: { data: {
data: [ data: [
{ {
id: 1, img: '/static/img/grxx.png',
name: '测试一', name: '陈志远',
phone: '17612341234', class: '现任财务总监',
address: '测试地址', },
region_desc: '测试地址测试地址测试地址测试地址', {
is_default: true img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监',
}, },
{ {
id: 2, img: '/static/img/grxx.png',
name: '测试一', name: '陈志远',
phone: '17612341234', class: '现任财务总监',
address: '测试地址',
region_desc: '测试地址测试地址测试地址测试地址'
}, },
{ {
id: 3, img: '/static/img/grxx.png',
name: '测试一', name: '陈志远',
phone: '17612341234', class: '现任财务总监',
address: '测试地址',
region_desc: '测试地址测试地址测试地址测试地址'
}, },
{ {
id: 4, img: '/static/img/grxx.png',
name: '测试一', name: '陈志远',
phone: '17612341234', class: '现任财务总监',
address: '测试地址',
region_desc: '测试地址测试地址测试地址测试地址'
} }
], ],
total: 0 total: 0
} }
}) })
} }
const selectIndex = ref(0)
const buttlist = ref([
{
butname: '同意'
},
{
butname: '反对'
},
{
butname: '弃权'
}
])
const selectBut = (index : number) => {
selectIndex.value = index
}
const loadData = async () => {
//
console.log(1111111111111)
};
</script> </script>
<template> <template>
<pull-to-refresh :on-refresh="loadData">
<!-- 你的页面内容 -->
<view class="box"> <view class="box">
<ex-header :leftShow="false" backgroundColor="#2563EB" textColor="#fff" title="地址管理" /> <ex-list ref="reListRef" custom-list-type="scroll" :on-form-search="doSearch" empty-text=""
<ex-list ref="reListRef" custom-list-type="scroll" :on-form-search="doSearch" empty-text="暂无收货地址~"
customListType="custom"> customListType="custom">
<template v-slot="{ data }"> <template v-slot="{ data }">
@ -76,62 +97,45 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
投票截止时间2024年3月15日 18:00 投票截止时间2024年3月15日 18:00
</view> </view>
</view> </view>
<view class="tppart">
<view v-for="(row, index) of data" class="address-items flex" @click.stop="onChoose(row)"> <view class="tpone" v-for="(row, index) of data" :key="index">
<view class="flex1 left"> <view class="topp">
<view class="flex-center-start"> <img style="width: 96rpx;height: 96rpx; border-radius: 50%;" :src="row.img" alt="" />
<text class="name">{{ row.name }}</text> <view class="rightpart">
<text class="name">{{ row.phone }}</text> <view class="name">
<text v-if="row.is_default" class="isdefault">默认地址</text> {{ row.name }}
</view>
<view class="info text-ellipsis">{{ row.region_desc }}{{ row.address }}</view>
</view>
<view class="flex column right">
<text @click.stop="navto('pages/address/edit', { id: row.id, isadd: 0 })">编辑</text>
<text v-if="!row.is_default" style="margin-top: 14rpx"
@click.stop="setDefault(row, index)">设为默认</text>
</view>
</view>
</template>
</ex-list>
</view> </view>
<!-- <view class="box"> <view class="class">
<view class="main"> {{ row.class }}
<view class="headpart">
<view class="title">
2024年度董事会成员选举
</view> </view>
<view class="time">
投票开始时间2024年3月15日 18:00
</view> </view>
<view class="time">
投票截止时间2024年3月15日 18:00
</view> </view>
<view class="bottomp">
<view class="minbut" v-for="(item,index) in buttlist" :key="index"
@click="selectBut(index)" :class="{active: selectIndex === index}">
{{item.butname}}
</view> </view>
<view class="tppart">
<view class="tpone" v-for="(item, index) in tpList" :key="index">
<img style="width: 96rpx;height: 96rpx; border-radius: 50%;" :src="item.img" alt="" />
<view class="rightpart">
<view class="name">
{{ item.name }}
</view> </view>
<view class="class">
</view> </view>
</view> </view>
</template>
</ex-list>
<view class="bottbutton">
<view class="qbty">
全部同意
</view> </view>
<view class="tjtp">
提交投票
</view> </view>
</view> </view>
<view class="buts">
</view> </view>
</view> --> </pull-to-refresh>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.box { .box {
width: 100%; width: 100%;
min-height: 100vh; height: 100vh;
background-color: #F9FAFB; background-color: #F9FAFB;
.headpart { .headpart {
@ -142,6 +146,7 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
margin: 32rpx auto; margin: 32rpx auto;
padding: 20rpx 3%; padding: 20rpx 3%;
.title { .title {
color: #2563EB; color: #2563EB;
font-size: 28rpx; font-size: 28rpx;
@ -155,38 +160,154 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
} }
} }
.main {
width: 100%;
height: 90vh;
display: grid;
justify-items: center;
align-content: start;
.tppart { .tppart {
margin-top: 32rpx;
width: 100%; width: 100%;
max-height: 60vh; max-height: 69vh;
overflow-y: auto; overflow-y: auto;
display: grid; display: grid;
justify-items: center; justify-items: center;
.tpone { .tpone {
width: 84%; width: 91%;
height: 264rpx; height: 264rpx;
padding: 20rpx 4%; padding: 20rpx 4%;
box-sizing: border-box;
border-radius: 24rpx; border-radius: 24rpx;
background-color: #FFFFFF; background: linear-gradient(0deg, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.001)), #FFFFFF;
box-sizing: border-box;
border: 2rpx solid #F3F4F6; border: 2rpx solid #F3F4F6;
box-shadow: 5rpx 5rpx 3rpx 0 rgba(212, 212, 212, 0.7); box-shadow: 0rpx 2rpx 4rpx -2rpx rgba(0, 0, 0, 0.1), 0rpx 2rpx 6rpx 0rpx rgba(0, 0, 0, 0.1);
margin-top: 32rpx;
display: grid;
.topp {
display: flex;
.rightpart { .rightpart {
margin-left: 40rpx; margin-left: 32rpx;
display: grid;
justify-items: left;
align-content: baseline;
.name {
font-family: Roboto;
font-size: 28rpx;
font-weight: 500;
line-height: 42rpx;
letter-spacing: normal;
color: #000000;
margin-top: 7rpx;
}
.class {
font-family: Roboto;
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
letter-spacing: normal;
color: #6B7280;
margin-top: 7rpx;
}
}
}
.bottomp {
display: flex;
justify-content: space-between;
gap: 0rpx 20rpx;
.minbut {
flex: 1;
width: 190rpx;
height: 76rpx;
/* 自动布局 */
display: flex;
justify-content: center;
padding: 16rpx 32rpx;
flex-wrap: wrap;
align-content: flex-start;
border-radius: 8rpx;
background: #FFFFFF;
box-sizing: border-box;
border: 2rpx solid #D1D5DB;
font-family: Roboto;
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
text-align: center;
letter-spacing: normal;
color: #4B5563;
}
.name {} .minbut.active {
border: 2rpx solid #2563EB;
color: #2563EB;
}
}
}
.tpone:first-child {
margin-top: 0;
}
} }
.bottbutton {
width: 100%;
height: 10vh;
display: flex;
padding: 24rpx 32rpx;
gap: 0rpx 24rpx;
flex-wrap: wrap;
align-content: flex-start;
background: #FFFFFF;
box-sizing: border-box;
border-width: 2rpx 0rpx 0rpx 0rpx;
border-style: solid;
border-color: #F3F4F6;
position: fixed;
bottom: 0;
.qbty {
width: 331rpx;
height: 90rpx;
/* 自动布局 */
display: flex;
box-sizing: border-box;
justify-content: center;
padding: 24rpx 0rpx;
gap: 0rpx 20rpx;
flex-wrap: wrap;
border-radius: 8rpx;
background: #EFF6FF;
font-family: Roboto;
font-size: 28rpx;
font-weight: 500;
line-height: 42rpx;
text-align: center;
letter-spacing: normal;
color: #2563EB;
} }
.tjtp {
width: 331rpx;
height: 90rpx;
/* 自动布局 */
display: flex;
box-sizing: border-box;
justify-content: center;
padding: 24rpx 0rpx;
gap: 0rpx 20rpx;
flex-wrap: wrap;
border-radius: 8rpx;
background: #2563EB;
font-family: Roboto;
font-size: 28rpx;
font-weight: 500;
line-height: 42rpx;
text-align: center;
letter-spacing: normal;
color: #FFFFFF;
} }
} }
@ -243,5 +364,5 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
bottom: 0; bottom: 0;
border-top: 2rpx solid #ebebec; border-top: 2rpx solid #ebebec;
} }
} }
</style> </style>

56
src/components/PullToRefresh.vue

@ -0,0 +1,56 @@
<!-- components/PullToRefresh.vue -->
<template>
<scroll-view
scroll-y
:refresher-enabled="true"
:refresher-triggered="isRefreshing"
@refresherrefresh="handleRefresh"
class="scroll-view"
>
<!-- 下拉刷新提示区域 -->
<view v-if="isRefreshing" class="refresh-loading">
<text>加载中...</text>
</view>
<!-- 内容插槽 -->
<slot />
</scroll-view>
</template>
<script setup>
import { ref } from 'vue';
const props = defineProps({
onRefresh: {
type: Function,
required: true
}
});
const isRefreshing = ref(false);
const handleRefresh = async () => {
if (isRefreshing.value) return;
isRefreshing.value = true;
try {
await props.onRefresh();
} finally {
isRefreshing.value = false;
}
};
</script>
<style scoped>
.scroll-view {
height: 100vh;
box-sizing: border-box;
}
.refresh-loading {
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
color: #666;
}
</style>

5
src/pages.json

@ -3,7 +3,8 @@
{ {
"path": "app/pages/votingElection/index", "path": "app/pages/votingElection/index",
"style": { "style": {
"navigationBarTitleText": "投票选举" "navigationBarTitleText": "投票选举",
"enablePullDownRefresh": true
} }
}, },
{ {
@ -130,7 +131,7 @@
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue", "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
"diy-(\W.*)": "@/app/components/diy/$1/index.vue", "diy-(\W.*)": "@/app/components/diy/$1/index.vue",
"fixed-(\W.*)": "@/app/components/fixed/$1/index.vue", "fixed-(\W.*)": "@/app/components/fixed/$1/index.vue",
"^ex-(.*)": "feng-uniapp-exploit/components/ex-$1/ex-$1.vue", "^ex-(.*)": "feng-uniapp-exploit/components/ex-$1/ex-$1.vue"
} }
}, },
"condition": { // "condition": { //

BIN
src/static/img/grxx-select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 288 B

BIN
src/static/img/grxx.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 285 B

BIN
src/static/img/tpxj-select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 303 B

BIN
src/static/img/tpxj.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 296 B

BIN
src/static/img/wdxj-select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 294 B

BIN
src/static/img/wdxj.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 291 B

BIN
src/static/img/xjjg-select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 365 B

BIN
src/static/img/xjjg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 358 B

BIN
src/static/img/xjlb-select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 312 B

BIN
src/static/img/xjlb.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 296 B

Loading…
Cancel
Save