cyh #2

Merged
linghe merged 2 commits from cyh into master 2024-09-10 17:00:00 +08:00
3 changed files with 65 additions and 12 deletions
Showing only changes of commit cea2b32034 - Show all commits

View File

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

View File

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