Compare commits

...

3 Commits

Author SHA1 Message Date
10335b8b2c Merge pull request 'cyh' (#2) from cyh into master
Reviewed-on: #2
2024-09-10 16:59:58 +08:00
53ac440321 手机号页面更新 2024-09-10 16:36:02 +08:00
cea2b32034 手机号页面更新 2024-09-10 16:27:41 +08:00
6 changed files with 70 additions and 13 deletions

6
.gitignore vendored
View File

@ -35,4 +35,8 @@
# .vscode/ # .vscode/
# ### Mac OS ### # ### Mac OS ###
.DS_Store .DS_Store
/.idea/.gitignore
/.idea/acdr.iml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/vcs.xml

Binary file not shown.

View File

@ -2,30 +2,33 @@
<template> <template>
<view v-if="template"> <view v-if="template">
<s-layout <s-layout
title="首页"
navbar="custom"
tabbar="/pages/mall/index/index"
:bgStyle="template.page" :bgStyle="template.page"
:navbarStyle="template.navigationBar" :navbarStyle="template.navigationBar"
navbar="custom"
onShareAppMessage onShareAppMessage
tabbar="/pages/mall/index/index"
title="首页"
> >
<s-block <s-block
v-for="(item, index) in template.components" v-for="(item, index) in template.components"
:key="index" :key="index"
:styles="item.property.style" :styles="item.property.style"
> >
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" /> <s-block-item :data="item.property" :styles="item.property.style" :type="item.id"/>
</s-block> </s-block>
</s-layout> </s-layout>
</view> </view>
</template> </template>
<script setup> <script setup>
import { computed } from 'vue' import {computed} from 'vue'
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app' import {onLoad, onPageScroll, onPullDownRefresh} from '@dcloudio/uni-app'
import sheep from '@/sheep' import sheep from '@/sheep'
import $share from '@/sheep/platform/share' import $share from '@/sheep/platform/share'
import AuthUtil from '@/sheep/api/member/auth' import AuthUtil from '@/sheep/api/member/auth'
import SBlockItem from '@/sheep/components/s-block-item/s-block-item.vue'
import SBlock from '@/sheep/components/s-block/s-block.vue'
import SLayout from '@/sheep/components/s-layout/s-layout.vue'
// tabBar // tabBar
uni.hideTabBar() uni.hideTabBar()
@ -92,7 +95,8 @@ onPullDownRefresh(() => {
}, 800) }, 800)
}) })
onPageScroll(() => {}) onPageScroll(() => {
})
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -7,11 +7,12 @@
</route> </route>
<template> <template>
<view class="bg-[#F5F5F5] h-full"> <image
<!-- 顶部背景和标题 --> class="absolute w-full h-full"
<view class="w-full bg-pink-100 py-6 flex justify-center items-center"> src="/static/certification/certification_bg.png"
<text class="text-2xl text-white">输入新的手机号</text> mode="aspectFill"
</view> ></image>
<view class="absolute w-full top-[75vw]">
<!-- 手机号绑定部分 --> <!-- 手机号绑定部分 -->
<view class="p-4"> <view class="p-4">
@ -19,20 +20,40 @@
<wd-icon name="search" size="24" class="text-gray-400"></wd-icon> <wd-icon name="search" size="24" class="text-gray-400"></wd-icon>
<input class="ml-4 flex-1 text-lg" placeholder="请输入手机号" v-model="phoneNumber" /> <input class="ml-4 flex-1 text-lg" placeholder="请输入手机号" v-model="phoneNumber" />
</view> </view>
<view class="bg-white p-4 rounded-lg shadow mb-4 flex items-center">
<wd-icon name="search" size="24" class="text-gray-400"></wd-icon>
<input class="ml-4 flex-1 text-lg" placeholder="请输入验证码" v-model="captcha" />
</view>
<button <button
class="w-full bg-gray-300 text-white text-center rounded-full py-4 mt-4" class="w-full bg-gray-300 text-white text-center rounded-full py-4 mt-4"
@click="getVerificationCode" @click="getVerificationCode"
> >
获取验证码 获取验证码
</button> </button>
<button
class="w-full bg-gray-300 text-white text-center rounded-full py-1 mt-4"
@click="binding"
>
绑定
</button>
<button
class="w-full bg-[#ff7f50] text-black text-center rounded-full py-1 mt-4"
@click="toPath('/')"
>
返回首页
</button>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import TopBar from "@/components/TopBar.vue";
import {toPath} from "@/utils/commUtils";
const phoneNumber = ref('') const phoneNumber = ref('')
const captcha = ref('')
const getVerificationCode = () => { const getVerificationCode = () => {
// //
@ -42,6 +63,16 @@ const getVerificationCode = () => {
} }
uni.showToast({ title: '验证码已发送', icon: 'success' }) uni.showToast({ title: '验证码已发送', icon: 'success' })
} }
const binding = () => {
if (!captcha.value) {
uni.showToast({ title: '请输入验证码', icon: 'none' })
return
}
if (!phoneNumber.value) {
uni.showToast({ title: '请输入手机号', icon: 'none' })
return
}
}
</script> </script>
<style scoped> <style scoped>

View File

@ -33,6 +33,24 @@ const DiyApi = {
}, },
}) })
}, },
updatePhone: (id) => {
return request({
url: '/api/setting/updatePhone',
method: 'POST',
params: {
id,
},
})
},
getCode: (id) => {
return request({
url: '/public/getCode',
method: 'GET',
params: {
id,
},
})
},
} }
export default DiyApi export default DiyApi

Binary file not shown.