Browse Source

修改bug,并且上传新页面

master
前端-胡立永 11 months ago
parent
commit
a64dd1e291
17 changed files with 460 additions and 21 deletions
  1. +3
    -3
      api/api.js
  2. +1
    -1
      api/http.js
  3. +7
    -2
      components/base/navbar.vue
  4. +2
    -2
      config.js
  5. BIN
      doc/banner1.png
  6. +1
    -1
      manifest.json
  7. +14
    -0
      pages.json
  8. +134
    -0
      pages/auth/login.vue
  9. +0
    -5
      pages/index/center.vue
  10. +7
    -3
      pages/index/index.vue
  11. +0
    -4
      pages/index/publish.vue
  12. +289
    -0
      pages/publish/competition.vue
  13. BIN
      static/image/competition/1.png
  14. BIN
      static/image/competition/k.png
  15. BIN
      static/image/login/logo.png
  16. BIN
      static/image/login/wx.png
  17. +2
    -0
      store/store.js

+ 3
- 3
api/api.js View File

@ -206,9 +206,9 @@ export function api(key, data, callback, loadingTitle) {
//必须登录
if (req.auth) {
if (!uni.getStorageSync('token')) {
// uni.navigateTo({
// url: '/pages/auth/login'
// })
uni.navigateTo({
url: '/pages/auth/login'
})
console.error('需要登录')
return
}


+ 1
- 1
api/http.js View File

@ -29,7 +29,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
uni.removeStorageSync('token')
console.error('登录过期');
uni.navigateTo({
url: '/pages/index/index'
url: '/pages/auth/login'
})
}


+ 7
- 2
components/base/navbar.vue View File

@ -1,6 +1,8 @@
<template>
<view class="navbar">
<view class="title">
<view class="navbar"
:style="{backgroundColor : bgColor}">
<view class="title"
:style="{backgroundColor : bgColor}">
<view class="left">
<uv-icon name="arrow-left"
v-if="leftClick"
@ -59,6 +61,9 @@
},
moreText : {
},
bgColor : {
default : '#fff'
}
},
created() {


+ 2
- 2
config.js View File

@ -5,13 +5,13 @@ import utils from './utils/utils.js'
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
const config = {
dev : {
baseUrl : 'http://h5.xzaiyp.top/a-notice-api',
baseUrl : 'http://8.138.162.67:8000/a-notice-api',
},
prod : {
baseUrl : 'http://admin.anqi.shop/a-notice-api',


BIN
doc/banner1.png View File

Before After
Width: 347  |  Height: 148  |  Size: 70 KiB

+ 1
- 1
manifest.json View File

@ -52,7 +52,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx3c24e397e3b132ea",
"appid" : "wxe7ae8cbe1673834c",
"setting" : {
"urlCheck" : false,
"ignoreDevUnusedFiles" : false


+ 14
- 0
pages.json View File

@ -6,6 +6,20 @@
"navigationBarTitleText": ""
}
},
{
"path" : "pages/publish/competition",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/auth/login",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/publish/actorDetail",
"style" :


+ 134
- 0
pages/auth/login.vue View File

@ -0,0 +1,134 @@
<template>
<view class="login">
<view class="logo">
<image src="/static/image/login/logo.png" mode=""></image>
</view>
<view class="title">
欢迎登录真视界
</view>
<view class="btn mt">
<view class="icon">
<image src="/static/image/login/wx.png" mode=""></image>
</view>
<view class=""
@click="wxLogin">
微信授权手机号登录
</view>
</view>
<view class="btn b2">
使用短信验证登录
</view>
<view class="config">
<uv-checkbox-group
v-model="checkboxValue"
shape="circle">
<view class="content">
<view
style="display: flex;">
<uv-checkbox
size="30rpx"
:name="1"
></uv-checkbox>
阅读并同意我们的<text>服务协议与隐私条款</text>
</view>
<view class="">
以及<text>个人信息保护指引</text>
</view>
</view>
</uv-checkbox-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
checkboxValue : []
}
},
methods: {
wxLogin(){
this.$store.commit('login')
},
}
}
</script>
<style scoped lang="scss">
.login{
display: flex;
justify-content: center;
align-items: center;
height: 80vh;
flex-direction: column;
position: relative;
.logo{
height: 80rpx;
width: 80rpx;
padding: 40rpx 30rpx;
background-color: #ddd;
border-radius: 70rpx;
image{
width: 80rpx;
height: 80rpx;
}
margin-bottom: 20rpx;
}
.title{
position: relative;
font-weight: 900;
font-size: 45rpx;
&::after{
content: '';
position: absolute;
left: 0;
top: 100%;
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right,#3c69f1, #fff);
}
}
.btn{
width: 80%;
height: 100rpx;
background-color: #3c69f1;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
.icon{
margin-right: 10rpx;
image{
width: 40rpx;
height: 35rpx;
}
}
}
.b2{
background-color: #3c69f122;
color: #3c69f1;
}
.mt{
margin-top: 200rpx;
}
.config{
position: absolute;
bottom: 0;
font-size: 22rpx;
text-align: center;
line-height: 40rpx;
text{
color: #3c69f1;
}
}
}
</style>

+ 0
- 5
pages/index/center.vue View File

@ -78,13 +78,11 @@
</view>
<showLogin ref="showLogin"/>
</view>
</template>
<script>
import tabber from '@/components/base/tabbar.vue'
import showLogin from '@/components/config/showLogin.vue'
import {
mapState
} from 'vuex'
@ -92,7 +90,6 @@
export default {
components: {
tabber,
showLogin
},
computed: {
...mapState(['userInfo']),
@ -140,8 +137,6 @@
}
},
onShow() {
//
this.$refs.showLogin.checkLogin()
//
this.$store.commit('getUserInfo')
},


+ 7
- 3
pages/index/index.vue View File

@ -29,6 +29,7 @@
<view class="swipe">
<uv-swiper
:list="banner"
@click="bannerClick"
keyName="image"
height="320rpx"></uv-swiper>
</view>
@ -102,7 +103,6 @@
ref="showPrivacy">
</showPrivacyAgreement>
<showLogin/>
</view>
</template>
@ -110,13 +110,11 @@
import tabber from '@/components/base/tabbar.vue'
import postList from '@/components/post/postList.vue'
import showPrivacyAgreement from '@/components/config/showPrivacyAgreement.vue'
import showLogin from '@/components/config/showLogin.vue'
export default {
components : {
tabber,
postList,
showPrivacyAgreement,
showLogin,
},
data() {
return {
@ -164,6 +162,12 @@
}
})
},
bannerClick(index){
console.log(index);
uni.navigateTo({
url: '/pages/publish/competition'
})
}
}
}
</script>


+ 0
- 4
pages/index/publish.vue View File

@ -20,26 +20,22 @@
<tabber :select="1" />
<showLogin ref="showLogin"/>
</view>
</template>
<script>
import tabber from '@/components/base/tabbar.vue'
import showLogin from '@/components/config/showLogin.vue'
import {
mapState
} from 'vuex'
export default {
components: {
tabber,
showLogin
},
computed: {
...mapState(['count']),
},
onShow() {
this.$refs.showLogin.checkLogin()
},
data() {
return {


+ 289
- 0
pages/publish/competition.vue View File

@ -0,0 +1,289 @@
<template>
<view class="competition">
<navbar
leftClick
bgColor="#cfd4ff"
@leftClick="$utils.navigateBack"
title="比赛评选"/>
<view class="top">
<view class="left">
<view class="title">
比赛评选排行
</view>
<view class="">
参与活动 领取奖励
</view>
</view>
<view class="right">
<image src="/static/image/competition/1.png" mode=""></image>
</view>
</view>
<view class="box">
<view class="head">
<view class="ranking">
排行
</view>
<view class="content">
作品
</view>
<view class="give-like">
点赞
</view>
</view>
<view class="empty"
v-if="!list.length">
<image src="/static/image/competition/k.png" mode=""></image>
<view class="">
暂无作品发布第一个作品吧 ~
</view>
</view>
<view class="list"
v-else>
<view class="item"
v-for="(item, index) in list"
:key="index">
<view class="ranking">
{{ index + 1 }}
</view>
<view class="content">
<view class="image">
<image src="" mode=""></image>
</view>
<view class="text">
<view class="title">
作品名称
</view>
<view class="actor">
<view class="headImage">
<image src="" mode=""></image>
</view>
<view class="username">
发布人小飞作品名称作品名称作品名称作品名称
</view>
</view>
<view class="createTime">
发布时间2024-03-03
</view>
</view>
</view>
<view class="give-like">
<view class="num">
<uv-icon
size="30rpx"
name="thumb-up"></uv-icon>
240
</view>
<view :class="{btn : true, a : index == 3}">
投票
</view>
</view>
</view>
</view>
</view>
<view class="submit">
发布作品
</view>
</view>
</template>
<script>
export default {
data() {
return {
list : []
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.competition{
.top{
background: linear-gradient(#cfd4ff, #f7f7f7);
width: 100%;
height: 400rpx;
display: flex;
box-sizing: border-box;
padding: 0 30rpx;
justify-content: space-between;
.left{
padding-top: 40rpx;
font-size: 28rpx;
.title{
font-size: 50rpx;
font-weight: 900;
color: #5a24f3;
padding-bottom: 20rpx;
}
}
.right{
image{
width: 300rpx;
height: 300rpx;
margin-top: -50rpx;
}
}
}
.box{
background-color: #fff;
min-height: 100rpx;
margin: 0 30rpx;
margin-top: -150rpx;
border-radius: 20rpx;
.head,
.item{
display: flex;
padding: 20rpx 10rpx;
.content{
flex: 1;
}
.give-like,
.ranking{
width: 120rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
}
.head{
font-size: 28rpx;
color: #999;
}
.empty{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 100rpx 0;
color: #999;
}
.list{
.item{
font-size: 20rpx;
&:nth-child(2){
.ranking{
color: red;
}
}
&:nth-child(3){
.ranking{
color: #FFA200;
}
}
&:nth-child(4){
.ranking{
color: #4739EA;
}
}
.ranking{
font-size: 40rpx;
font-weight: 900;
font-style: italic;
}
.content{
display: flex;
image{
width: 100%;
height: 100%;
}
.image{
width: 200rpx;
height: 150rpx;
background-color: #999;
overflow: hidden;
margin-right: 20rpx;
border-radius: 20rpx;
flex-shrink: 0;
}
.text{
.title{
font-size: 30rpx;
font-weight: 900;
display: -webkit-box;
-webkit-box-orient:
vertical; -webkit-line-clamp: 2;
overflow: hidden;
height: 80rpx;
}
.actor{
display: flex;
.headImage{
width: 30rpx;
height: 30rpx;
overflow: hidden;
border-radius: 20rpx;
background-color: #999;
margin-right: 5rpx;
}
.username{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
width: 180rpx;
}
}
.createTime{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
width: 220rpx;
margin-top: 10rpx;
}
}
}
.give-like{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.num{
display: flex;
}
.btn{
border: 1px solid #4739EA;
margin-top: 10rpx;
padding: 8rpx 16rpx;
border-radius: 15rpx;
color: #4739EA;
&.a{
color: #999;
border: 1px solid #999;
}
}
}
}
}
}
.submit{
position: fixed;
bottom: 0;
left: 0;
margin: 0 50rpx;
margin-bottom: 50rpx;
background: $uni-linear-gradient-btn-color;
color: #fff;
width: 650rpx;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
border-radius: 20rpx;
}
}
</style>

BIN
static/image/competition/1.png View File

Before After
Width: 176  |  Height: 151  |  Size: 18 KiB

BIN
static/image/competition/k.png View File

Before After
Width: 266  |  Height: 266  |  Size: 6.7 KiB

BIN
static/image/login/logo.png View File

Before After
Width: 34  |  Height: 45  |  Size: 222 B

BIN
static/image/login/wx.png View File

Before After
Width: 24  |  Height: 20  |  Size: 294 B

+ 2
- 0
store/store.js View File

@ -43,6 +43,8 @@ const store = new Vuex.Store({
uni.navigateTo({
url: '/pages/auth/wxUserInfo'
})
}else{
uni.navigateBack(-1)
}
})
}


Loading…
Cancel
Save