# Conflicts:
#	app/src/pages.json
This commit is contained in:
Jason
2022-09-09 10:46:37 +08:00
29 changed files with 575 additions and 79 deletions

View File

@@ -8,3 +8,7 @@ export function smsSend(data: any) {
export function getConfig() {
return request.get({ url: '/config' })
}
export function getPolicy(data: any) {
return request.get({ url: '/policy', data: data })
}

View File

@@ -3,3 +3,24 @@ import request from '@/utils/request'
export function getUserCenter() {
return request.get({ url: '/user/center' })
}
// 个人信息
export function getUserInfo() {
return request.get({ url: '/user/info' })
}
// 个人编辑
export function userEdit(data: any) {
return request.post({ url: '/user/edit', data: data })
}
// 绑定手机
export function userBindMobile(data: any) {
return request.post({ url: '/user/bindMobile', data: data })
}
// 微信电话
export function userMnpMobile(data: any) {
return request.post({ url: '/user/mnpMobile', data: data })
}

View File

@@ -11,7 +11,7 @@
<view class="text-muted text-xs w-full flex justify-between mt-[12rpx]">
<view>{{ item.createTime }}</view>
<view class="flex items-center">
<image src="/static/images/icon_visit.png" class="w-[30rpx] h-[30rpx]"></image>
<image src="/static/images/icon/icon_visit.png" class="w-[30rpx] h-[30rpx]"></image>
<view class="ml-[10rpx]">{{ item.visit }}</view>
</view>
</view>

View File

@@ -0,0 +1,6 @@
//菜单主题类型
export enum AgreementEnum {
PRIVACY = 'privacy',
SERVICE = 'service'
}

View File

@@ -48,6 +48,12 @@
"navigationBarTitleText": "详情"
}
},
{
"path": "pages/user_set/user_set",
"style": {
"navigationBarTitleText": "个人设置"
}
},
{
"path": "pages/collection/collection",
"style": {
@@ -55,6 +61,30 @@
},
"auth": true
},
{
"path": "pages/as_us/as_us",
"style": {
"navigationBarTitleText": "关于我们"
}
},
{
"path": "pages/agreement/agreement",
"style": {
"navigationBarTitleText": "协议"
}
},
{
"path": "pages/change_password/change_password",
"style": {
"navigationBarTitleText": "修改密码"
}
},
{
"path": "pages/user_data/user_data",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "pages/search/search",
"style": {

View File

@@ -0,0 +1,36 @@
<template>
<view class="">
<u-parse :html="agreementContent"></u-parse>
</view>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { onLoad } from "@dcloudio/uni-app";
import { AgreementEnum } from '@/enums/agreementEnums'
import { getPolicy } from '@/api/app'
let agreementType = ref('') // 协议类型
let agreementContent = ref('') // 协议内容
const getData = async (type) => {
let res = await getPolicy({ type })
console.log(res, 'res')
agreementContent.value = res.content
uni.setNavigationBarTitle({
title: res.name
})
}
onLoad((options: any) => {
if(options.type) {
agreementType = options.type
getData(agreementType)
}
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,22 @@
<template>
<view class="as-us flex flex-1 flex-col items-center">
<image :src="appStore.config.website.logo" mode="" class="img"></image>
<view class="text-content mt-[20rpx]">当前版本{{ appStore.config.version }}</view>
</view>
</template>
<script setup lang="ts">
import { useAppStore } from '@/stores/app'
const appStore = useAppStore()
</script>
<style lang="scss" scoped>
.as-us {
.img {
width: 160rpx;
height: 160rpx;
border-radius: 20rpx;
margin-top: 96rpx;
}
}
</style>

View File

@@ -0,0 +1,37 @@
<template>
<view class="">
<u-parse :html="agreementContent"></u-parse>
</view>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { onLoad } from "@dcloudio/uni-app";
import { AgreementEnum } from '@/enums/agreementEnums'
import { getPolicy } from '@/api/app'
let agreementType = ref('') // 协议类型
let agreementContent = ref('') // 协议内容
// let agreementName = ref('') // 协议名称
const getData = async (type) => {
let res = await getPolicy({ type })
console.log(res, 'res')
agreementContent.value = res.content
uni.setNavigationBarTitle({
title: res.name
})
}
onLoad((options: any) => {
if(options.type) {
agreementType.value = options.type
getData(agreementType)
}
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -1,6 +1,5 @@
<template>
<z-paging ref="paging" v-model="dataList" v-if="i == index" @query="queryList" :fixed="false" height="100%"
use-page-scroll>
<z-paging ref="paging" v-model="dataList" v-if="i == index" @query="queryList" :fixed="false" height="100%">
<block v-for="(newsItem,newsIndex) in dataList" :key="newsIndex">
<news-card :item="newsItem" :newsId="newsItem.id"></news-card>
</block>

View File

@@ -7,7 +7,7 @@
<view class="mr-[40rpx]" v-if="newsData.author">作者: {{ newsData.author }}</view>
<view class="text-muted mr-[40rpx]">{{ newsData.createTime }}</view>
<view class="flex items-center text-muted ">
<image src="/static/images/icon_visit.png" class="w-[30rpx] h-[30rpx]"></image>
<image src="/static/images/icon/icon_visit.png" class="w-[30rpx] h-[30rpx]"></image>
<view class="ml-[10rpx]">{{ newsData.visit }}</view>
</view>
</view>

View File

@@ -31,7 +31,6 @@
@query="queryList"
:fixed="false"
height="100%"
use-page-scroll
>
<block v-for="(item, index) in search.result" :key="item.id">
<news-card :item="item" :newsId="item.id"></news-card>

View File

View File

@@ -0,0 +1,97 @@
<template>
<view class="user-set">
<navigator :url="`/pages/user_data/user_data`">
<view class="item flex bg-white mt-[20rpx]">
<u-avatar :src="userInfo.avatar" shape="square"></u-avatar>
<view class="ml-[20rpx] flex flex-1 justify-between">
<view>
<view class="mb-[15rpx] text-xl font-medium">{{ userInfo.nickname }}</view>
<view class="text-content text-xs">账号{{ userInfo.username }}</view>
</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</view>
</navigator>
<view class="item bg-white mt-[20rpx] btn-border flex flex-1 justify-between">
<view class="text-xl">登录密码</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
<view class="item bg-white btn-border flex flex-1 justify-between">
<view class="text-xl">绑定微信</view>
<view class=" flex justify-between">
<view class="text-muted mr-[20rpx]">
{{ userInfo.isBindMnp ? '已绑定' : '未绑定' }}
</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</view>
<navigator :url="`/pages/agreement/agreement?type=${ AgreementEnum.PRIVACY }`">
<view class="item bg-white mt-[20rpx] btn-border flex flex-1 justify-between">
<view class="text-xl">隐私政策</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</navigator>
<navigator :url="`/pages/agreement/agreement?type=${ AgreementEnum.SERVICE }`">
<view class="item bg-white btn-border flex flex-1 justify-between">
<view class="text-xl">服务协议</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</navigator>
<view class="item bg-white btn-border flex flex-1 justify-between">
<view class="text-xl">关于我们</view>
<view class="flex justify-between">
<view class="text-muted mr-[20rpx]">
{{ appStore.config.version }}
</view>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import {
getUserInfo
} from '@/api/user'
import {
onShow
} from '@dcloudio/uni-app'
import {
reactive,
ref,
} from 'vue'
import {
useAppStore
} from '@/stores/app'
import {
AgreementEnum
} from '@/enums/agreementEnums'
const appStore = useAppStore()
let userInfo = ref({})
const getUser = async () => {
let res = await getUserInfo()
console.log(res, 'res')
userInfo.value = res
}
onShow(() => {
getUser()
})
</script>
<style lang="scss" scoped>
.user-set {
.item {
padding: 30rpx;
}
.btn-border {
border-bottom: 1rpx solid $u-form-item-border-color;
}
}
</style>

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB