Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
717e3c67fe
14 changed files with 639 additions and 110 deletions
  1. +23
    -1
      api/api.js
  2. +1
    -1
      components/config/PrivacyAgreementPoup.vue
  3. +1
    -1
      components/list/dynamic/dynamicItem.vue
  4. +251
    -0
      components/user/certificationPopup.vue
  5. +2
    -2
      components/user/createDetailPopup.vue
  6. +30
    -9
      pages.json
  7. +4
    -1
      pages/index/center.vue
  8. +112
    -57
      pages/index/index.vue
  9. +5
    -3
      pages_order/auth/wxLogin.vue
  10. +192
    -25
      pages_order/auth/wxUserInfo.vue
  11. BIN
      static/image/logo.jpg
  12. BIN
      static/logo.png
  13. +17
    -9
      store/store.js
  14. +1
    -1
      uni.scss

+ 23
- 1
api/api.js View File

@ -23,12 +23,19 @@ const config = {
},
// 修改个人信息接口
updateInfo: {
url: '/info/updateInfo',
url: '/token/updateInfo',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
// 获取个人信息接口
getInfo: {
url: '/token/getInfo',
method: 'GET',
auth: true,
limit : 500,
},
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
@ -125,6 +132,21 @@ const config = {
url: '/token/publishPost',
method: 'POST',
limit : 1000,
auth : true,
},
//店铺认证
companyAuthentication: {
url: '/token/companyAuthentication',
method: 'POST',
limit : 1000,
auth : true,
},
//个人认证
personalAuthentication: {
url: '/token/personalAuthentication',
method: 'POST',
limit : 1000,
auth : true,
},
}


+ 1
- 1
components/config/PrivacyAgreementPoup.vue View File

@ -2,7 +2,7 @@
<uv-popup ref="popup" z-index="99999" :closeOnClickOverlay="false" :customStyle="{ backgroundColor: 'transparent' }">
<view class="privacyPopup">
<view class="icon">
<image src="/static/image/PrivacyAgreementPoup/icon.png"
<image src="/static/image/logo.jpg"
mode=""></image>
</view>
<view class="title">


+ 1
- 1
components/list/dynamic/dynamicItem.vue View File

@ -38,7 +38,7 @@
</view>
<view class="Artworkimages">
<view class="wrokimg" :key="i" v-for="(img, i) in item.image && item.image.split(',')">
<image :src="img" mode=""></image>
<image :src="img" mode="aspectFill"></image>
</view>
</view>
<view class="bottom">


+ 251
- 0
components/user/certificationPopup.vue View File

@ -0,0 +1,251 @@
<template>
<!-- 实名认证 -->
<uv-popup ref="popup" :round="30">
<view class="page">
<!-- <view class="info-tips">
完成认证<text>您将获得实名认证平台特权</text>
</view> -->
<uv-tabs :list="tags" @click="tagsClick"
:activeStyle="{color : '#5baaff', fontWeight : 900}"
lineHeight="0"
lineWidth="50rpx"></uv-tabs>
<view class="form"
v-if="type == 0">
<view class="form-item">
<view class="label">
姓名
</view>
<input type="text" class="form-input"
placeholder="请输入姓名"
v-model="form.name"/>
</view>
<view class="form-item">
<view class="label">
身份证号码
</view>
<input type="text" class="form-input"
placeholder="请输入身份证号码"
v-model="form.card"/>
</view>
</view>
<view class="form"
v-if="type == 1">
<view class="form-item">
<view class="label">
店铺名称
</view>
<input type="text" class="form-input"
placeholder="请输入姓名"
v-model="form.name"/>
</view>
<view class="form-item">
<view class="label">
联系方式
</view>
<input type="text" class="form-input"
placeholder="请输入联系方式"
v-model="form.phone"/>
</view>
<view class="form-item">
<view class="title">
请上传营业执照
</view>
<view class="tips">
信息仅用身份核实上传后可增加曝光机会
</view>
</view>
<view class="form-item">
<uv-upload
:fileList="fileList"
:maxCount="1"
width="600rpx"
height="280rpx"
multiple
@afterRead="afterRead"
@delete="deleteImage">
<view class="upload">
<image src="/static/image/home/cart.png"
mode="aspectFit"
style="width: 390rpx;height: 280rpx;" />
<view class="btn-add">
点击上传
</view>
</view>
</uv-upload>
</view>
<view class="form-item">
<view class="tips"
style="text-align: center;padding: 20rpx 0;">
(确保文字清晰可辨避免遮挡不全反光)
</view>
</view>
</view>
<view class="uni-color-btn"
@click="submit">
认证
</view>
</view>
</uv-popup>
</template>
<script>
export default {
data() {
return {
checkboxValue : [],
form : {},
fileList: [],
type : 0,
tags : [
{
name : '个人认证',
},
{
name : '店铺认证',
},
],
}
},
methods: {
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
open(){
this.$refs.popup.open()
},
tagsClick({index}){
this.type = index
},
submit(){
let data = {
...this.form,
image : this.fileList.map((item) => item.url).join(","),
}
if(this.type == 0){
if (this.$utils.verificationAll(data, {
name: '说点什么吧',
card : '请输入身份证号',
})) {
return
}
}else{
if (this.$utils.verificationAll(data, {
name: '请输入店铺名称',
phone: '请输入联系方式',
image: '请上传营业执照',
})) {
return
}
}
this.$api([
'personalAuthentication',
'companyAuthentication',
][this.type], data, res => {
if(res.code == 200){
uni.showToast({
title: '提交成功!',
icon: 'none'
})
this.$refs.popup.close()
}
})
},
}
}
</script>
<style scoped lang="scss">
.page{
width: 700rpx;
.info-tips{
width: 100%;
padding: 30rpx 0;
background-color: #f3f3f3;
text-align: center;
text{
color: $uni-color;
}
}
.form {
padding: 30rpx;
.form-item{
.label{
padding: 20rpx 0;
}
.form-input{
border: 1px solid $uni-color;
background: rgba($uni-color, 0.1);
padding: 10rpx 20rpx;
font-size: 28rpx;
}
.title{
font-weight: 900;
margin-top: 50rpx;
padding: 10rpx 0;
}
.tips{
font-size: 26rpx;
color: #777;
padding-bottom: 20rpx;
}
}
.upload{
display: flex;
justify-content: center;
align-items: center;
width: 690rpx;
background-color: #f3f3f3;
border-radius: 10rpx;
.btn-add{
margin: auto;
padding: 10rpx 20rpx;
background-color: $uni-color;
color: #fff;
border-radius: 10rpx;
}
}
}
.config{
font-size: 26rpx;
line-height: 40rpx;
width: 100%;
display: flex;
justify-content: center;
.content{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
text{
color: $uni-color;
}
}
}
</style>

+ 2
- 2
components/user/createDetailPopup.vue View File

@ -55,11 +55,11 @@
<style scoped lang="scss">
.createDetail {
position: fixed;
top: 50vh;
top: 70vh;
right: 50rpx;
width: 100rpx;
height: 100rpx;
background-color: $uni-color-primary;
background-color: $uni-color;
border-radius: 50rpx;
display: flex;
justify-content: center;


+ 30
- 9
pages.json View File

@ -2,7 +2,7 @@
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
"enablePullDownRefresh" : true
}
},
{
@ -32,7 +32,7 @@
{
"path": "pages/index/center",
"style": {
"navigationBarTitleText": ""
"enablePullDownRefresh" : true
}
},
{
@ -78,34 +78,55 @@
"path": "mine/help"
},
{
"path": "renting/rentingList"
"path": "renting/rentingList",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "renting/rentingDetail"
"path": "renting/rentingDetail",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "renting/addRenting"
},
{
"path": "work/workList"
"path": "work/workList",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "work/addWork"
},
{
"path": "work/workDetail"
"path": "work/workDetail",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "post/postDetail"
"path": "post/postDetail",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "post/addPost"
},
{
"path": "gourmet/gourmetList"
"path": "gourmet/gourmetList",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "activity/activityDetail"
"path": "activity/activityDetail",
"style": {
"enablePullDownRefresh" : true
}
}
]
}],


+ 4
- 1
pages/index/center.vue View File

@ -64,7 +64,7 @@
<view class="Content">
<uv-tabs :list="list" @click="click"
:activeStyle="{color : '#000', fontWeight : 900}"
lineColor="#00f"
lineColor="#5baaff"
lineHeight="8rpx"
lineWidth="50rpx"></uv-tabs>
@ -90,6 +90,9 @@
}]
}
},
onShow() {
this.$store.commit('getUserInfo')
},
methods: {
click(item) {
console.log('item', item);


+ 112
- 57
pages/index/index.vue View File

@ -1,5 +1,14 @@
<template>
<view class="page">
<view>
<uv-swiper
:list="bannerList"
indicator
height="520rpx"
indicatorStyle="bottom: 100rpx;"
keyName="image"></uv-swiper>
</view>
<!-- 瑶都万能墙 -->
<view class="Headbackground">
@ -8,7 +17,7 @@
size="30rpx"
color="#fff"
name="map"></uv-icon>
长沙
江华瑶族自治县
</view>
<view class="top">
<view class=" profilePicture">
@ -16,7 +25,7 @@
</view>
<view class="UniversalWall">
<view class="dynamic">
{{headinfo.name}}
{{ headinfo.name }}
</view>
<view class="dynamics">
@ -24,44 +33,49 @@
</view>
</view>
<view class="join">
<view class="join"
@click="$refs.certificationPopup.open()">
加入
</view>
</view>
</view>
<view class="life">
<view class="mouse" @click="menuClick(item.url)"
:key="index"
v-for="(item, index) in menu">
<view class="RentingAhouseimg">
<image
:src="item.icon"
style="width: 90rpx;height: 90rpx;" mode=""></image>
</view>
<view class="RentingAhouse">
{{ item.title }}
<view class="box">
<view class="life">
<view class="mouse" @click="menuClick(item.url)"
:key="index"
v-for="(item, index) in menu">
<view class="RentingAhouseimg">
<image
:src="item.icon"
style="width: 90rpx;height: 90rpx;" mode=""></image>
</view>
<view class="RentingAhouse">
{{ item.title }}
</view>
</view>
</view>
<view class="LabelOptions">
<uv-tabs :list="category"
:activeStyle="{color : '#000', fontWeight : 900}"
lineColor="#5baaff"
lineHeight="8rpx"
lineWidth="50rpx"
keyName="title"
@click="tabsClick"></uv-tabs>
</view>
<dynamicItem
:key="index"
v-for="(item, index) in list"
:item="item"
/>
</view>
<view class="LabelOptions">
<uv-tabs :list="category"
:activeStyle="{color : '#000', fontWeight : 900}"
lineColor="#00f"
lineHeight="8rpx"
lineWidth="50rpx"
keyName="title"
@click="tabsClick"></uv-tabs>
</view>
<dynamicItem
:key="index"
v-for="(item, index) in list"
:item="item"
/>
<createDetailPopup/>
<certificationPopup ref="certificationPopup"/>
<PrivacyAgreementPoup />
<tabber select="0" />
@ -71,6 +85,7 @@
<script>
import PrivacyAgreementPoup from '@/components/config/PrivacyAgreementPoup.vue'
import tabber from '@/components/base/tabbar.vue'
import certificationPopup from '@/components/user/certificationPopup.vue'
import createDetailPopup from '@/components/user/createDetailPopup.vue'
import dynamicItem from '@/components/list/dynamic/dynamicItem.vue'
import mixinsList from '@/mixins/list.js'
@ -82,17 +97,26 @@
PrivacyAgreementPoup,
createDetailPopup,
dynamicItem,
certificationPopup,
},
data() {
return {
headinfo: {},
menu : [],
mixinsListApi : 'getPostPage',
bannerList : [],
}
},
onShow() {
this.getIndexHeaderInfo()
this.getClassifyList()
this.getBannerList()
this.$store.commit('getCategory')
},
onPullDownRefresh() {
this.getIndexHeaderInfo()
this.getClassifyList()
this.getBannerList()
this.$store.commit('getCategory')
},
computed: {
@ -100,7 +124,12 @@
},
methods: {
tabsClick(item) {
console.log('item', item);
if(item.index){
this.queryParams.classId = item.id
}else{
delete this.queryParams.classId
}
this.getData()
},
menuClick(url) {
//
@ -130,6 +159,22 @@
}
})
},
//
getClassifyList(){
this.$api('getClassifyList',res =>{
if(res.code == 200){
this.menu = res.result
}
})
},
// banner
getBannerList(){
this.$api('getBannerList', res =>{
if(res.code == 200){
this.bannerList = res.result
}
})
},
}
}
</script>
@ -140,8 +185,12 @@
height: 100%;
}
.Headbackground {
position: absolute;
width: 100%;
top: 0;
left: 0;
padding-top: 150rpx;
background: linear-gradient(to bottom, rgb(85, 94, 123), rgb(45, 51, 73));
// background: linear-gradient(to bottom, rgb(85, 94, 123), rgb(45, 51, 73));
.Toggle{
margin: 10rpx 30rpx;
padding: 20rpx;
@ -189,7 +238,7 @@
.join {
width: 125rpx;
height: 50rpx;
background-color: $uni-color-primary;
background-color: $uni-color;
margin-left: auto;
display: flex;
align-items: center;
@ -199,32 +248,38 @@
}
}
.life {
margin-top: 20rpx;
display: flex;
justify-content: space-around;
text-align: center;
flex-wrap: wrap;
.mouse {
.RentingAhouseimg {
display: flex;
justify-content: center;
align-items: center;
margin: 15rpx;
width: 130rpx;
height: 100rpx;
background-color: #ffffff;
border-top-left-radius: 40rpx;
border-bottom-right-radius: 40rpx;
border-bottom-left-radius: 20rpx;
border-top-right-radius: 20rpx;
.box{
margin-top: -60rpx;
background-color: #f7f7f7;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
position: relative;
z-index: 9;
.life {
margin-top: 20rpx;
display: flex;
justify-content: space-around;
text-align: center;
flex-wrap: wrap;
.mouse {
.RentingAhouseimg {
display: flex;
justify-content: center;
align-items: center;
margin: 15rpx;
width: 130rpx;
height: 100rpx;
background-color: #ffffff;
border-top-left-radius: 40rpx;
border-bottom-right-radius: 40rpx;
border-bottom-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
}
}
}
</style>

+ 5
- 3
pages_order/auth/wxLogin.vue View File

@ -1,7 +1,8 @@
<template>
<view class="login">
<view class="logo">
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
<image src="/static/image/logo.jpg"
mode=""></image>
</view>
<view class="title">
欢迎使用瑶都万能墙
@ -93,8 +94,9 @@
background-color: #ddd;
border-radius: 30rpx;
image{
width: 80rpx;
height: 80rpx;
width: 100%;
height: 100%;
border-radius: 30rpx;
}
margin-bottom: 20rpx;
}


+ 192
- 25
pages_order/auth/wxUserInfo.vue View File

@ -1,13 +1,13 @@
<template>
<view class="login">
<view class="title">
<!-- <view class="title">
瑶都万能墙
</view>
<view class="title">
申请获取你的头像昵称
</view>
</view> -->
<button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<!-- <button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<view class="line">
<view class="">
头像
@ -28,7 +28,63 @@
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName"
v-model="userInfo.nickName" />
</view>
</view> -->
<view class="bg1"/>
<view class="title">
定制自己的形象
</view>
<button class="chooseAvatar"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar">
<image :src="userInfo.headImage"
mode="aspectFill"></image>
</button>
<input type="nickname"
placeholder="给自己起一个响亮的名字"
class="nickname" id="nickName"
v-model="userInfo.nickName" />
<view class="sexSelect">
<view
@click="sexClick(item)"
v-for="(item, index) in sex"
:key="index"
:style="{color : userInfo.sex == item.value ? item.actColor : '#333'}">
<uv-icon
size="30rpx"
:color="userInfo.sex == item.value ? item.actColor : '#333'"
:name="item.icon"></uv-icon>
{{ item.value }}
</view>
</view>
<view class="address"
@click="$refs.datetimePicker.open()">
您出生于{{ $dayjs(userInfo.yearDate).format("YYYY") }}
</view>
<view class="address"
@click="$refs.picker.open()">
{{ userInfo.address || '请选择居住地址'}}
</view>
<uv-datetime-picker
ref="datetimePicker"
v-model="userInfo.yearDate"
mode="year"
:minDate="minDate"
:maxDate="maxDate">
</uv-datetime-picker>
<uv-picker ref="picker"
:columns="columns"
keyName="name"
@confirm="confirmAddress"></uv-picker>
<view class="btn" @click="submit">
确认
</view>
@ -36,24 +92,66 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
userInfo: {
headImage: '',
headImage: '/static/image/logo.jpg',
nickName: '',
}
sex : '男',
yearDate : this.$dayjs().add(-18, 'y').valueOf(),//18
address : '',
},
maxDate : this.$dayjs().valueOf(),
minDate : this.$dayjs().add(-100, 'y').valueOf(),
sex : [
{
value : '男',
icon : 'man',
actColor : '#5baaff',
},
{
value : '女',
icon : 'woman',
actColor : '#ff50b3',
},
],
columns : [],
};
},
onShow() {},
computed: {
...mapState(['cityList']),
},
onLoad() {
},
onShow() {
this.getCityList()
},
computed: {},
methods: {
onChooseAvatar(res) {
let self = this
self.$Oss.ossUpload(res.target.avatarUrl)
.then(url => {
self.userInfo.headImage = url
})
.then(url => {
self.userInfo.headImage = url
})
},
sexClick(item){
this.userInfo.sex = item.value
},
confirmAddress(e){
this.userInfo.address = e.value[0].name
},
//
getCityList(){
this.$api('getCityList', res => {
if(res.code == 200){
this.columns = [
res.result
]
}
})
},
submit() {
let self = this
@ -70,13 +168,19 @@
if (self.$utils.verificationAll(self.userInfo, {
headImage: '请选择头像',
nickName: '请填写昵称',
address: '请选择居住地址',
})) {
return
}
self.$api('infoUpdateInfo', self.userInfo, res => {
let data = {
...self.userInfo,
yearDate : this.$dayjs(self.userInfo.yearDate).format("YYYY")
}
self.$api('updateInfo', data, res => {
if (res.code == 200) {
uni.switchTab({
uni.reLaunch({
url:'/pages/index/index'
})
}
@ -94,29 +198,92 @@
flex-direction: column;
justify-content: center;
align-items: center;
height: 80vh;
height: 100vh;
background-color: #fff;
overflow: hidden;
.bg1{
width: 700rpx;
height: 700rpx;
border-radius: 50%;
background-color: #ffc0b333;
position: absolute;
right: -300rpx;
top: -300rpx;
}
.title {
line-height: 45rpx;
font-weight: 900;
}
.line {
display: flex;
justify-content: space-between;
align-items: center;
width: 80%;
border-bottom: 1px solid #00000023;
padding: 30rpx 0;
margin: 0 auto;
padding-bottom: 100rpx;
font-size: 40rpx;
}
.chooseAvatar {
width: 100%;
padding: 0;
margin: 0;
margin-top: 10vh;
padding: 0 !important;
margin: 0 !important;
border: none;
background-color: #fff !important;
width: 220rpx;
height: 220rpx;
border-radius: 50%;
image{
width: 200rpx;
height: 200rpx;
border-radius: 50%;
box-shadow: 0 0 10rpx 10rpx #00000012;
margin: 10rpx;
}
}
.chooseAvatar::after{
border: none;
padding: 0 !important;
margin: 0 !important;
}
.nickname{
background-color: #f7f7f7;
width: 600rpx;
height: 80rpx;
text-align: center;
border-radius: 40rpx;
margin-top: 30rpx;
}
.sexSelect{
background-color: #f7f7f7;
width: 600rpx;
height: 80rpx;
text-align: center;
border-radius: 40rpx;
margin-top: 30rpx;
display: flex;
align-items: center;
font-size: 26rpx;
line-height: 80rpx;
overflow: hidden;
&>view{
flex: 1;
display: flex;
justify-content: center;
align-content: center;
height: 100%;
}
&>view:nth-child(1){
border-right: 1px solid #000;
}
}
.address{
background-color: #f7f7f7;
width: 600rpx;
height: 80rpx;
text-align: center;
border-radius: 40rpx;
margin-top: 30rpx;
line-height: 80rpx;
color: #555;
}
.btn {


BIN
static/image/logo.jpg View File

Before After
Width: 926  |  Height: 926  |  Size: 33 KiB

BIN
static/logo.png View File

Before After
Width: 72  |  Height: 72  |  Size: 3.9 KiB

+ 17
- 9
store/store.js View File

@ -11,7 +11,8 @@ const store = new Vuex.Store({
configList: [], //配置列表
shop : false,
userInfo : {}, //用户信息
city : [],//城市列表
city : {},//城市列表
cityList : [],//城市列表
category : [],//动态分类
},
getters: {
@ -61,21 +62,27 @@ const store = new Vuex.Store({
state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token)
// if(!state.userInfo.nickName || !state.userInfo.headImage){
// uni.navigateTo({
// url: '/pages_order/auth/wxUserInfo'
// })
// }else{
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
})
}else{
uni.navigateBack(-1)
// }
}
})
}
})
},
getUserInfo(state){
api('infoGetInfo', res => {
api('getInfo', res => {
if(res.code == 200){
state.userInfo = res.result
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
})
}
}
})
},
@ -83,7 +90,8 @@ const store = new Vuex.Store({
getCityList(state){
api('getCityList', res => {
if(res.code == 200){
state.city = res.result
state.cityList = res.result
state.city = res.result[0] || {}
}
})
},


+ 1
- 1
uni.scss View File

@ -12,7 +12,7 @@
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
$uni-color: #FD5100;
$uni-color: #5baaff;
/* 行为相关颜色 */
$uni-color-primary: #1671ff;


Loading…
Cancel
Save