登录封装完成

This commit is contained in:
2022-05-09 10:03:33 +08:00
parent 5bae62d34d
commit e7a130533d
19 changed files with 604 additions and 70 deletions
@@ -30,7 +30,7 @@
margin-top: 10px;
background-color: rgba(0,0,0, 0.5);
padding: 0 10px;
@include common_ellipsis
@include common_ellipsis(1);
}
}
}
+2 -4
View File
@@ -10,6 +10,7 @@ import styles from './index.module.scss'
import { useEffect, useMemo, useState } from 'react';
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
import { goLink } from '@/common/common';
import useUserInfo from '@/use/useUserInfo';
type item = {title:string, img:string, url:string, id:number}
type params = {
@@ -103,10 +104,7 @@ export default (props:params) => {
}
})
useDidShow(() => {
Taro.getCurrentPages()
})
const {user} = useUserInfo()
return (
<View className={styles.main}>
+3
View File
@@ -20,6 +20,9 @@
text-align: center;
line-height: 44px;
}
.search_input{
width: 300px;
}
}
.products{
flex:1;
+1 -23
View File
@@ -10,7 +10,7 @@ import { goLink } from '@/common/common'
import { useEffect, useState } from 'react'
import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
import useUserInfo from '@/use/useUserInfo'
export default () => {
const tabs_list = [
@@ -47,31 +47,9 @@ export default () => {
}, 1000)
}
const goto = function (e) {
var t = this
Taro.navigateTo({
url: '/pages/details/index',
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
backFromTargetPage: function (backData) {
console.log('好啦,可以在这里写你的逻辑了', backData)
if (backData.from == 'page2') {
// 监听到 page2 返回
console.log('好啦,可以在这里写你的逻辑了', backData)
t.setData({
isBackFromPage2: !0
})
}
}
}
})
}
return (
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
<View className={styles.main}>
<View onClick={(e) => goto(e)}>aaa</View>
<Swiper/>
<View className={styles.search}>
<View className={styles.search_collect}>我的收藏</View>
@@ -24,7 +24,7 @@
color: $color_font_two;
}
textarea{
background-color: $color_bg_one;
background-color: #f3f3f3;
border-radius: 10px;
width: 100%;
height: 313px;
@@ -32,6 +32,7 @@
padding-bottom: 50px;
box-sizing: border-box;
font-size: $font_size;
border: 2px solid #e6e6e6;
}
}
.order_save_address{
+6 -6
View File
@@ -10,13 +10,13 @@ type Param = {
export default ({onBlur, onSave}:Param) => {
const [descData, setDescData] = useState({
number: 0,
value: ''
value: '',
count: 10
})
const getDesc = useCallback((e) => {
let value = e.detail.value
setDescData({...descData, number:value.length, value})
let res = value.slice(0, descData.count)
setDescData({...descData, number:res.length, value: res})
},[])
const setSave = () => {
@@ -26,8 +26,8 @@ export default ({onBlur, onSave}:Param) => {
<View className={styles.order_popup}>
<View className={styles.order_popup_title}>添加备注</View>
<View className={styles.order_popup_input}>
<Textarea placeholder="请添加备注" maxlength={200} cursorSpacing={100} onInput={(e) => getDesc(e)} onBlur={(e) => onBlur?.(e)}></Textarea>
<View className={styles.descDataNum}>{descData.number}/200</View>
<Textarea placeholder="请添加备注" maxlength={10} cursorSpacing={100} onInput={(e) => getDesc(e)} onBlur={(e) => onBlur?.(e)}></Textarea>
<View className={styles.descDataNum}>{descData.number}/{descData.count}</View>
</View>
<View className={styles.order_save_address} onClick={() => setSave()}>保存</View>
</View>
+1 -1
View File
@@ -10,7 +10,7 @@ export default () => {
return (
<View className={styles.main}>
<View className={styles.search}>
<Search style={{width: '100%'}} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} clickOnSearch={() => goLink('/pages/searchList/index')}/>
<Search style={{width: '100%'}} debounceTime={300} changeOnSearch={(e) => console.log(e)} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} />
</View>
<View className={styles.hot}>
<View className={styles.hot_header}>