first commit

This commit is contained in:
2025-05-22 10:33:32 +08:00
commit f2ef63d910
581 changed files with 53162 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<template>
<u-sticky zIndex="99999">
<u-navbar fixed :auto-back="false" :bgColor="bgColor" :status-bar-bg-color="bgColor" placeholder :title="title" safeAreaInsetTop
:title-style="{color: 'white'}" auto-back left-icon-color="white" @leftClick="leftClick">
<template slot="left">
<u-icon :name="currentPages.length > 1 ? 'arrow-left' : 'home'" size="20" color="white" v-if="showBack"/>
</template>
</u-navbar>
</u-sticky>
</template>
<script>
import {LINEAR} from "@/config/color";
export default {
name: "HeaderItem",
props: {
title: String,
showBack: {
type: Boolean,
default: true
}
},
data() {
return {
bgColor: LINEAR,
currentPages: []
}
},
methods: {
leftClick() {
console.log(this.currentPages)
if (this.currentPages.length === 1) uni.switchTab({url: '/pages/index/index'})
// else uni.navigateBack()
}
},
mounted() {
this.currentPages = getCurrentPages()
}
}
</script>
+150
View File
@@ -0,0 +1,150 @@
<template>
<u-popup :show="show" close-on-click-overlay @close="refuse" round="10" :safe-area-inset-bottom="false">
<view class="p-50">
<view class="flex flex-col justify-start items-start">
<!-- <u-icon name="/static/logo.png" width="100" height="52"/>-->
<text class="text-30 font-bold mt-20">为了提供更优质的服务,需要获取</text>
</view>
<view class="my-25">
<u-text text="您的身份信息" size="16" bold margin="60rpx 0"/>
</view>
<view class="mt-20 text-25">
<checkbox-group @change="changeCheck">
<view class="flex justify-start items-center">
<checkbox value="check" :checked="check"/>
<view>
<text>我已阅读并同意</text>
<text style="color: #00004F" @click="showAgree('USER_PROTOCOL')">
《用户协议》
</text>
<text style="color: #00004F" @click="showAgree('SECRET_PROTOCOL')">
《隐私协议》
</text>
</view>
</view>
</checkbox-group>
</view>
<view class="mt-25 flex justify-between">
<view class="w-40p">
<u-button type="info" @click="refuse" :custom-style="{backgroundColor: '#F2F2F2'}">拒绝</u-button>
</view>
<view class="w-40p">
<u-button @click="doLogin"
:custom-style="agreeStyle"
:disabled="!check || disabled">允许
</u-button>
</view>
</view>
</view>
<u-popup mode="center" :show="showAgreePopup" closeable @close="showAgreePopup = false" round="10"
:custom-style="{height: '80%', width: '80%'}" closeOnClickOverlay>
<view class="p-30 overflow-y">
<u-parse :content="content"/>
</view>
</u-popup>
</u-popup>
</template>
<script>
import {loginReq} from "@/api/user";
import {setUserInfo} from "@/util/user";
import {sysSettingInfoReq} from "@/api/common";
export default {
name: "Login",
props: {
isIndex: {
type: Boolean,
default: false
},
isHide: {
type: Boolean,
default: false
}
},
data() {
return {
show: false,
check: false,
code: null,
phoneData: null,
agreeStyle: {
backgroundColor: this.check ? '#00C655' : '#F2F2F2',
border: this.check ? '#00C655' : '#F2F2F2',
color: this.check ? '#FFFFFF' : '#828282',
},
showAgreePopup: false,
content: '',
disabled: false
}
},
methods: {
changeCheck({detail}) {
const {value} = detail
this.check = value.length > 0
this.agreeStyle = {
backgroundColor: this.check ? '#00C655' : '#F2F2F2',
border: this.check ? '#00C655' : '#F2F2F2',
color: this.check ? '#FFFFFF' : '#828282',
}
},
open() {
this.disabled = false
this.show = true
},
hide() {
this.show = false
},
wxLogin() {
return new Promise(resolve => {
uni.login({
success: (loginRes) => {
this.code = loginRes.code
resolve()
}
})
})
},
auth(phoneE) {
//获取手机号
this.phoneData = phoneE.detail
this.doLogin()
},
async doLogin() {
await this.wxLogin()
this.disabled = true
// const phone_code = this.phoneData.code
const {data} = await loginReq({
// phone_code,
code: this.code,
})
console.log(data)
this.setInfo(data)
this.done()
this.disabled = false
},
setInfo(res) {
setUserInfo({
username: res.user.nickname,
header: res.user.avatar,
// phone: res.phone,
token: res.access_token,
uid: res.user.userId,
});
},
done() {
this.show = false
this.$emit('done')
},
refuse() {
this.show = false
if (!this.isHide) uni.switchTab({url: '/pages/index/index'})
},
async showAgree(enumKey) {
const {data} = await sysSettingInfoReq({'enum': enumKey})
this.content = data
this.showAgreePopup = true
}
},
}
</script>
+18
View File
@@ -0,0 +1,18 @@
<template>
<view class="mb-25 mt-25">
<u-icon name="/static/line.png" :label="title" label-pos="right" bold label-color="#4F4F4F" label-size="30rpx"/>
</view>
</template>
<script>
export default {
name: "TitleItem",
props: {
title: String
},
data() {
return {}
},
methods: {}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<template>
<view>
<m-tabbar fixed fill :current="current" safeBottom :tabbar="tabbar" native openType="switchTab" @click="tabClick">
<template v-slot:tabbar_index_1>
<view class="custom_style">
<view class="custom_style_icon">
<u-image src="/static/ai.png" width="160rpx" height="160rpx"/>
</view>
</view>
</template>
</m-tabbar>
</view>
</template>
<script>
export default {
name: "customTabbar",
props: {
current: {
default: 0,
type: Number
}
},
data() {
return {
tabbar: {
color: "#333",
selectedColor: "#2ACF8D",
borderStyle: "F0F0F0",
backgroundColor: "#FFFFFF",
list: [
{
"pagePath": "pages/index/index",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home-selected.png",
"text": "首页"
},
{},
{
"pagePath": "pages/user/index",
"iconPath": "static/tabbar/user.png",
"selectedIconPath": "static/tabbar/user-selected.png",
"text": "我的"
}
]
}
}
},
methods: {
tabClick(val){
if (val === 0 && this.current === 0) this.$jump({url: '/pages/index/index'})
}
},
mounted() {
console.log(this.current)
},
}
</script>
<style lang="scss">
.custom_style {
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
width: 100rpx;
height: 100rpx;
margin-top: -40rpx;
&_icon {
//background-color: #2ACF8D;
font-size: 80rpx;
width: 100rpx;
height: 100rpx;
border-radius: 100%;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>