处理页面
12
pages.json
@@ -10,12 +10,12 @@
|
||||
"selectedIconPath": "static/tabbar/home-active.png",
|
||||
"text": "首页"
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/cart/index",
|
||||
// "iconPath": "static/tabbar/cart.png",
|
||||
// "selectedIconPath": "static/tabbar/cart-active.png",
|
||||
// "text": "待办"
|
||||
// },
|
||||
{
|
||||
"pagePath": "pages/todo/index",
|
||||
"iconPath": "static/tabbar/todo.png",
|
||||
"selectedIconPath": "static/tabbar/todo-active.png",
|
||||
"text": "待办"
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/cart/parts/index",
|
||||
// "iconPath": "static/tabbar/cart.png",
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
<template>
|
||||
<!-- <view class="content">
|
||||
<view class="avatar">
|
||||
<nut-avatar size="80">
|
||||
<nut-icon size="30" name="my" />
|
||||
</nut-avatar>
|
||||
</view>
|
||||
<view class="divider">
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="tip-infos">
|
||||
<text>申请获取以下权限</text>
|
||||
<text>获得你的手机号信息</text>
|
||||
</view>
|
||||
<view class="authorize-btn-inner">
|
||||
<nut-button type="success" size="large" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</nut-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
login,
|
||||
fetchUserPhone
|
||||
} from '../../api/user';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
navigateTo
|
||||
} from '../../utils/helper';
|
||||
const code = ref('')
|
||||
const redirect_url = ref('')
|
||||
onLoad((options) => {
|
||||
redirect_url.value = options.redirect_url
|
||||
})
|
||||
onMounted(() => {
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
success(res) {
|
||||
if (res.errMsg === 'login:ok') {
|
||||
code.value = res.code
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
const getPhoneNumber = (res) => {
|
||||
if(res.detail.code){
|
||||
fetchUserPhone(res.detail.code).then(res=>{
|
||||
console.log(res);
|
||||
if(res.msg==='success' && res.code ===1){
|
||||
uni.showToast({
|
||||
title: '授权成功',
|
||||
icon: 'none'
|
||||
})
|
||||
console.log("code");
|
||||
uni.switchTab({
|
||||
url: '/pages/mine/index'
|
||||
})
|
||||
// uni.navigateBack()
|
||||
}else{
|
||||
uni.switchTab({
|
||||
url: '/pages/mine/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: #eee;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
padding: 25px 15px;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.tip-infos {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
padding: 10px 25px;
|
||||
gap: 10px;
|
||||
|
||||
text:nth-child(2) {
|
||||
font-size: 15px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.authorize-btn-inner {
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
||||
8
pages/todo/index.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,22 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<web-view :src="url"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
|
||||
const url = ref('')
|
||||
onLoad((val) => {
|
||||
url.value = val.url
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
||||
@@ -1 +0,0 @@
|
||||
<svg t="1747759569015" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3710" width="200" height="200"><path d="M485.646222 413.795556l92.629334-92.629334c-23.239111-59.320889-10.908444-129.365333 37.034666-177.294222a165.134222 165.134222 0 0 1 148.309334-45.425778v0.085334a16.526222 16.526222 0 0 1 9.969777 27.278222h0.028445l-88.419556 88.419555a32.725333 32.725333 0 0 0 0 46.293334l47.217778 47.217777a32.725333 32.725333 0 0 0 46.293333 0l87.694223-87.694222a16.526222 16.526222 0 0 1 28.046222 9.272889h0.042666a165.134222 165.134222 0 0 1-45.411555 148.323556c-47.928889 47.928889-117.973333 60.273778-177.294222 37.020444l-20.081778 20.081778-14.037333-14.037333a28.444444 28.444444 0 0 0-40.220445 0l-50.289778 50.289777-50.275555-50.289777a28.330667 28.330667 0 0 0-11.235556-6.912z m-96.256 96.241777c1.351111 4.124444 3.655111 7.964444 6.926222 11.235556l50.275556 50.289778-50.275556 50.275555a28.444444 28.444444 0 0 0 0 40.234667l14.037334 14.037333-162.474667 162.460445a66.133333 66.133333 0 1 1-93.511111-93.511111L389.404444 510.037333z m160.540445 18.602667l58.552889-58.567111a16.355556 16.355556 0 0 1 23.153777 0l25.528889 25.543111c5.404444 5.390222 6.286222 13.568 2.673778 19.882667a33.066667 33.066667 0 0 0 44.672 42.951111l0.042667 0.071111c5.660444-2.702222 12.558222-1.962667 17.578666 2.161778l0.056889-0.056889 143.914667 143.928889a81.820444 81.820444 0 0 1 0 115.712l-71.296 71.296a81.820444 81.820444 0 0 1-115.726222 0l-142.791111-142.791111a16.540444 16.540444 0 0 1-2.872889-19.512889l-0.085334-0.056889a33.066667 33.066667 0 0 0-43.448889-43.832889 16.540444 16.540444 0 0 1-20.053333-3.057778l-25.216-25.216a16.355556 16.355556 0 0 1 0-23.139555l58.552889-58.567112L235.960889 308.195556h-37.475556a16.355556 16.355556 0 0 1-14.037333-7.936l-58.794667-97.991112a16.355556 16.355556 0 0 1 2.460445-19.996444l28.686222-28.672a16.355556 16.355556 0 0 1 19.996444-2.460444l97.991112 58.780444c4.920889 2.958222 7.936 8.291556 7.936 14.037333v37.489778L549.930667 528.64z m69.162666 192.312889a21.333333 21.333333 0 0 0 0 30.165333l90.510223 90.510222a21.333333 21.333333 0 0 0 30.165333-30.165333l-90.510222-90.510222a21.333333 21.333333 0 0 0-30.165334 0z m76.430223-76.430222a21.333333 21.333333 0 0 0 0 30.165333l90.510222 90.510222a21.333333 21.333333 0 1 0 30.165333-30.165333l-90.510222-90.510222a21.333333 21.333333 0 0 0-30.165333 0z" fill="#ffffff" p-id="3711"></path></svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1 +0,0 @@
|
||||
<svg t="1747759524592" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2743" id="mx_n_1747759524593" width="200" height="200"><path d="M695.808 85.333333H328.192C264.832 85.333333 213.333333 133.12 213.333333 192v640C213.333333 890.88 264.832 938.666667 328.192 938.666667h367.616C759.168 938.666667 810.666667 890.88 810.666667 832v-640C810.666667 133.12 759.168 85.333333 695.808 85.333333z m-252.757333 746.666667c0-35.413333 28.629333-64 64-64a64 64 0 1 1-64 64zM305.237333 682.666667V213.418667a42.666667 42.666667 0 0 1 42.666667-42.666667h328.234667a42.666667 42.666667 0 0 1 42.666666 42.666667v469.333333a42.666667 42.666667 0 0 1-42.666666 42.666667l-328.277334-0.128a42.666667 42.666667 0 0 1-42.666666-42.666667z" fill="#ffffff" p-id="2744"></path></svg>
|
||||
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
6
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -35,6 +35,12 @@
|
||||
"selectedIconPath": "static/tabbar/home-active.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/todo/index",
|
||||
"iconPath": "static/tabbar/todo.png",
|
||||
"selectedIconPath": "static/tabbar/todo-active.png",
|
||||
"text": "待办"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "static/tabbar/user.png",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg t="1747759569015" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3710" width="200" height="200"><path d="M485.646222 413.795556l92.629334-92.629334c-23.239111-59.320889-10.908444-129.365333 37.034666-177.294222a165.134222 165.134222 0 0 1 148.309334-45.425778v0.085334a16.526222 16.526222 0 0 1 9.969777 27.278222h0.028445l-88.419556 88.419555a32.725333 32.725333 0 0 0 0 46.293334l47.217778 47.217777a32.725333 32.725333 0 0 0 46.293333 0l87.694223-87.694222a16.526222 16.526222 0 0 1 28.046222 9.272889h0.042666a165.134222 165.134222 0 0 1-45.411555 148.323556c-47.928889 47.928889-117.973333 60.273778-177.294222 37.020444l-20.081778 20.081778-14.037333-14.037333a28.444444 28.444444 0 0 0-40.220445 0l-50.289778 50.289777-50.275555-50.289777a28.330667 28.330667 0 0 0-11.235556-6.912z m-96.256 96.241777c1.351111 4.124444 3.655111 7.964444 6.926222 11.235556l50.275556 50.289778-50.275556 50.275555a28.444444 28.444444 0 0 0 0 40.234667l14.037334 14.037333-162.474667 162.460445a66.133333 66.133333 0 1 1-93.511111-93.511111L389.404444 510.037333z m160.540445 18.602667l58.552889-58.567111a16.355556 16.355556 0 0 1 23.153777 0l25.528889 25.543111c5.404444 5.390222 6.286222 13.568 2.673778 19.882667a33.066667 33.066667 0 0 0 44.672 42.951111l0.042667 0.071111c5.660444-2.702222 12.558222-1.962667 17.578666 2.161778l0.056889-0.056889 143.914667 143.928889a81.820444 81.820444 0 0 1 0 115.712l-71.296 71.296a81.820444 81.820444 0 0 1-115.726222 0l-142.791111-142.791111a16.540444 16.540444 0 0 1-2.872889-19.512889l-0.085334-0.056889a33.066667 33.066667 0 0 0-43.448889-43.832889 16.540444 16.540444 0 0 1-20.053333-3.057778l-25.216-25.216a16.355556 16.355556 0 0 1 0-23.139555l58.552889-58.567112L235.960889 308.195556h-37.475556a16.355556 16.355556 0 0 1-14.037333-7.936l-58.794667-97.991112a16.355556 16.355556 0 0 1 2.460445-19.996444l28.686222-28.672a16.355556 16.355556 0 0 1 19.996444-2.460444l97.991112 58.780444c4.920889 2.958222 7.936 8.291556 7.936 14.037333v37.489778L549.930667 528.64z m69.162666 192.312889a21.333333 21.333333 0 0 0 0 30.165333l90.510223 90.510222a21.333333 21.333333 0 0 0 30.165333-30.165333l-90.510222-90.510222a21.333333 21.333333 0 0 0-30.165334 0z m76.430223-76.430222a21.333333 21.333333 0 0 0 0 30.165333l90.510222 90.510222a21.333333 21.333333 0 1 0 30.165333-30.165333l-90.510222-90.510222a21.333333 21.333333 0 0 0-30.165333 0z" fill="#ffffff" p-id="3711"></path></svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1 +0,0 @@
|
||||
<svg t="1747759524592" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2743" id="mx_n_1747759524593" width="200" height="200"><path d="M695.808 85.333333H328.192C264.832 85.333333 213.333333 133.12 213.333333 192v640C213.333333 890.88 264.832 938.666667 328.192 938.666667h367.616C759.168 938.666667 810.666667 890.88 810.666667 832v-640C810.666667 133.12 759.168 85.333333 695.808 85.333333z m-252.757333 746.666667c0-35.413333 28.629333-64 64-64a64 64 0 1 1-64 64zM305.237333 682.666667V213.418667a42.666667 42.666667 0 0 1 42.666667-42.666667h328.234667a42.666667 42.666667 0 0 1 42.666666 42.666667v469.333333a42.666667 42.666667 0 0 1-42.666666 42.666667l-328.277334-0.128a42.666667 42.666667 0 0 1-42.666666-42.666667z" fill="#ffffff" p-id="2744"></path></svg>
|
||||
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |