添加个人中心

This commit is contained in:
郑茂强 2019-03-04 17:42:02 +08:00
parent 09b20e0ef3
commit 036bc4783a
26 changed files with 634 additions and 743 deletions

View File

@ -17,10 +17,10 @@ const store = configStore()
class App extends Component { class App extends Component {
isTrue=Taro.getStorageSync('session_id')?true:false
config = { config = {
pages: [ pages: [
//'pages/index/index', // index页面 //'pages/index/index', // index页面
'pages/individualCenter/individualCenter',// 个人中心页面
'pages/home/home',//首页 --------------------- 'pages/home/home',//首页 ---------------------
'pages/login/login',//登入页面 --------------------- 'pages/login/login',//登入页面 ---------------------
'pages/shop/shop',//店铺页面 --------------------- 'pages/shop/shop',//店铺页面 ---------------------
@ -39,6 +39,8 @@ class App extends Component {
'pages/myNeedsEdit/myNeedsEdit',// 单个需求编辑页面 'pages/myNeedsEdit/myNeedsEdit',// 单个需求编辑页面
'pages/myNeedsPublish/myNeedsPublish',// 需求发布 'pages/myNeedsPublish/myNeedsPublish',// 需求发布
// 'pages/shopDescription/shopDescription', // 'pages/shopDescription/shopDescription',
], ],
permission: { permission: {
@ -62,27 +64,21 @@ class App extends Component {
iconPath: "./icons/home.png", iconPath: "./icons/home.png",
selectedIconPath: "./icons/home-actived.png" selectedIconPath: "./icons/home-actived.png"
}, { }, {
pagePath: "pages/goodsPublish/goodsPublish", pagePath: "pages/myNeedsPublish/myNeedsPublish",
text: "商品发布", text: "需求发布",
iconPath: "./icons/box.png",
selectedIconPath: "./icons/box-actived.png"
}, {
pagePath: "pages/supplyDemandPublish/supplyDemandPublish",
text: "供求发布",
iconPath: "./icons/publish.png", iconPath: "./icons/publish.png",
selectedIconPath: "./icons/publish-actived.png" selectedIconPath: "./icons/publish-actived.png"
}
, {
pagePath: "pages/mySupplyDemand/mySupplyDemand",
text: "我的供求",
iconPath: "./icons/menu.png",
selectedIconPath: "./icons/menu-actived.png"
} }
, { , {
pagePath: "pages/myNeeds/myNeeds", pagePath: "pages/myNeeds/myNeeds",
text: "我的需求", text: "我的需求",
iconPath: "./icons/needs.png", iconPath: "./icons/needs.png",
selectedIconPath: "./icons/needs-actived.png" selectedIconPath: "./icons/needs-actived.png"
}, {
pagePath: "pages/individualCenter/individualCenter",
text: "个人中心",
iconPath: "./icons/needs.png",
selectedIconPath: "./icons/needs-actived.png"
} }
], ],
color: '#333', color: '#333',
@ -94,7 +90,7 @@ class App extends Component {
} }
componentDidMount() { componentDidMount() {
console.log('this.tabBar', this)
} }
componentDidShow() { } componentDidShow() { }

View File

@ -0,0 +1,53 @@
//scrollToTopComponent
import Taro, { Component } from '@tarojs/taro'
import { View, Text,MovableArea, MovableView } from '@tarojs/components'
import './backToCenterComponent.scss'
class BackToCenterComponent extends Component {
config = {
navigationBarTitleText: '顶部'
}
goToCenterPage(){
Taro.switchTab({
url:'/pages/individualCenter/individualCenter'
})
}
componentDidMount() {
}
componentWillReceiveProps(nextProps) {
// console.log(this.props, nextProps)
}
componentWillUnmount() { }
componentDidShow() { }
componentDidHide() { }
render() {
return (
// <View className='backToCenterComponent' onClick={this.goToCenterPage.bind(this)}>
// <View className='box'>
// <View>个人中心</View>
// </View>
// </View>
<MovableArea style='height: 100vh; width: 100%; position:fixed; top:0; '>
<View>hello world</View>
<MovableView style='height: 50px; width: 50px; background: blue;opacity:1' direction='all'></MovableView>
</MovableArea>
)
}
}
export default BackToCenterComponent

View File

@ -0,0 +1,17 @@
.backToCenterComponent{
height:100rpx;
width:100rpx;
color:#ffffff;
background-color:black;
opacity: 0.3;
border-radius:50%;
position:fixed;
bottom:12%;
right:3%;
font-size:25rpx;
display: flex;
align-items: center;
justify-content: center
}

View File

@ -45,7 +45,7 @@ class Interaction extends Component {
let initailMultiArray = this.recursionInitialized(res.data.data) let initailMultiArray = this.recursionInitialized(res.data.data)
initailMultiArray[1].unshift({ name: '全部', id: '-1' }) initailMultiArray[1].unshift({ name: '全部', id: '-1' })
initailMultiArray[0] = [{ name: '--', id: '' }] initailMultiArray[0] = [{ name: '--', id: '' }]
console.log('initailMultiArray', initailMultiArray) // console.log('initailMultiArray', initailMultiArray)
this.setState({ this.setState({
@ -112,7 +112,7 @@ class Interaction extends Component {
return new Array(maxDepth).fill(0) return new Array(maxDepth).fill(0)
} }
bindMultiPickerCol(e) { bindMultiPickerCol(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value) // console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
const data = { const data = {
multiArray: this.state.initailMultiArray, multiArray: this.state.initailMultiArray,
@ -124,7 +124,7 @@ class Interaction extends Component {
const indexNumber = Number(index) const indexNumber = Number(index)
if (indexNumber === data.multiIndex[0]) { if (indexNumber === data.multiIndex[0]) {
data.multiArray[1] = this.state.interactionMultiArray[indexNumber].children data.multiArray[1] = this.state.interactionMultiArray[indexNumber].children
console.log('datat', data)
} }
} }
} }

View File

@ -6,8 +6,8 @@
border-radius:50%; border-radius:50%;
text-align:center; text-align:center;
position:fixed; position:fixed;
bottom:10%; bottom:1%;
right:5%; right:3%;
font-size:25rpx; font-size:25rpx;
.box{ .box{
margin-top:6%; margin-top:6%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

BIN
src/icons/client-needs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -106,12 +106,12 @@ class GoodsPublish extends Component {
setTimeout(() => { setTimeout(() => {
if (this.state.isPublish) { if (this.state.isPublish) {
// 导航到编辑页面 // 导航到编辑页面
Taro.navigateTo({ Taro.redirectTo({
url: '/pages/myGoodsEdit/myGoodsEdit?id=' + res.data.goods_id url: '/pages/myGoodsList/myGoodsList'
}) })
} else if (this.state.isPublishAndAdd) { } else if (this.state.isPublishAndAdd) {
// 导航到发布页面 // 导航到发布页面
Taro.reLaunch({ Taro.navigateTo({
url: '/pages/goodsPublish/goodsPublish' url: '/pages/goodsPublish/goodsPublish'
}) })
} }
@ -269,7 +269,7 @@ class GoodsPublish extends Component {
LoginService() LoginService()
return return
} }
Taro.navigateTo({ Taro.redirectTo({
url: '/pages/myGoodList/myGoodList' url: '/pages/myGoodList/myGoodList'
}) })
} }
@ -403,9 +403,9 @@ class GoodsPublish extends Component {
{/* <View className='button'> {/* <View className='button'>
<Button type='primary' className='button-a' size='small' >发布并新增</Button> <Button type='primary' className='button-a' size='small' >发布并新增</Button>
</View> */} </View> */}
<View className='button' onClick={this.publishAndNewButton.bind(this)}> {/* <View className='button' onClick={this.publishAndNewButton.bind(this)}>
<Button size='mini' className='button-green'>发布并新增</Button> <Button size='mini' className='button-green'>发布并新增</Button>
</View> </View> */}
<View className='button' onClick={this.goToMyGoodListPage.bind(this)}> <View className='button' onClick={this.goToMyGoodListPage.bind(this)}>
<Button size='mini' className='button-green'>商品列表</Button> <Button size='mini' className='button-green'>商品列表</Button>
</View> </View>

View File

@ -76,7 +76,7 @@ class GrabOrderPage extends Component {
icon: 'none' icon: 'none'
}) })
setTimeout(() => { setTimeout(() => {
Taro.reLaunch({ Taro.switchTab({
url: '/pages/home/home' url: '/pages/home/home'
}) })
}, 1500); }, 1500);
@ -218,7 +218,7 @@ class GrabOrderPage extends Component {
duration: 1500 duration: 1500
}) })
setTimeout(() => { setTimeout(() => {
Taro.reLaunch({ Taro.switchTab({
url: '/pages/myNeeds/myNeeds' url: '/pages/myNeeds/myNeeds'
}) })
}, 1500); }, 1500);

View File

@ -42,7 +42,6 @@ class Home extends Component {
supplyLevel: 1,// 筛选1是小类或者2是大类, supplyLevel: 1,// 筛选1是小类或者2是大类,
latitude: '', latitude: '',
longitude: '', longitude: '',
isShopOwner: false
} }
} }
@ -290,22 +289,7 @@ class Home extends Component {
componentDidMount() { componentDidMount() {
// 页面加载后 得到首页的基本信息和推荐店铺的信息 // 页面加载后 得到首页的基本信息和推荐店铺的信息
// Taro.setTabBarItem({
// index: 2,
// text: 'client',
// iconPath: './icons/needs-actived.png',
// selectedIconPath: './icon/needs.png',
// success: function (res) {
// console.log('indexBarSuccess3', res)
// },
// fail: function (res) {
// console.log('indexBarFail3', res)
// },
// complete: function (res) {
// console.log('indexBarComplete3', res)
// }
// })
Taro.showLoading({ title: '加载中' }) Taro.showLoading({ title: '加载中' })
// promise 返回经纬度给state 然后调用函数 // promise 返回经纬度给state 然后调用函数
this.getUserLocation().then(res => { this.getUserLocation().then(res => {
@ -321,25 +305,11 @@ class Home extends Component {
this.getHomeCategoriesInfo() this.getHomeCategoriesInfo()
}) })
// 本地缓存没有userid时 从新登入 // 本地缓存没有userid时 从新登入
if (!Taro.getStorageSync('userInfo').user_id) { Taro.getStorageSync('userInfo').user_id ? true : weChatLogin()
weChatLogin().then(res => {
Taro.getStorageSync('shopInfo').shop_id ? this.setState({
isShopOwner: true
}) : this.setState({
isShopOwner: false
})
}).catch(err => {
})
} else {
Taro.getStorageSync('shopInfo').shop_id ? this.setState({
isShopOwner: true
}) : this.setState({
isShopOwner: false
})
}
} }
componentWillMount() { componentWillMount() {
@ -348,7 +318,7 @@ class Home extends Component {
componentWillUnmount() { } componentWillUnmount() { }
componentDidShow() { componentDidShow() {
console.log('home', this.$scope.route)
} }
componentDidHide() { } componentDidHide() { }
@ -379,7 +349,6 @@ class Home extends Component {
} }
render() { render() {
console.log('this.state.isShopOwner', this.state.isShopOwner)
// 提示模态弹窗element // 提示模态弹窗element
const modalMessageGrabElement = <AtModal isOpened={this.state.isOpen}> const modalMessageGrabElement = <AtModal isOpened={this.state.isOpen}>
<AtModalHeader>提示</AtModalHeader> <AtModalHeader>提示</AtModalHeader>

View File

@ -0,0 +1,170 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Image, Button } from '@tarojs/components'
import { AtGrid, AtList, AtListItem, AtAvatar, AtButton } from "taro-ui"
import './individualCenter.scss'
import URL from '../../serviceAPI.config'
class IndividualCenter extends Component {
config = {
navigationBarTitleText: '个人中心'
}
constructor() {
this.state = {
client: [
{
image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png',
value: '需求发布'
},
{
image: 'https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png',
value: '我的需求'
}
],
seller: [
{
image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png',
value: '我的商品'
},
{
image: 'https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png',
value: '商品发布'
},
{
image: 'https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png',
value: '我的供求'
},
{
image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png',
value: '供求发布'
}
],
username: '',
avatar: '',
isShop: false,
}
}
handlerGridClick(e) {
const value = e.currentTarget.dataset.eTapAA.value
switch (value) {
case '需求发布':
Taro.switchTab({
url: '/pages/myNeedsPublish/myNeedsPublish'
})
break;
case '我的需求':
Taro.switchTab({
url: '/pages/myNeeds/myNeeds'
})
break;
case '我的商品':
Taro.navigateTo({
url: '/pages/myGoodList/myGoodList'
})
break;
case '商品发布':
Taro.navigateTo({
url: '/pages/goodsPublish/goodsPublish'
})
break;
case '我的供求':
Taro.navigateTo({
url: '/pages/mySupplyDemand/mySupplyDemand'
})
break;
case '供求发布':
Taro.navigateTo({
url: '/pages/supplyDemandPublish/supplyDemandPublish'
})
break;
default:
// code block
}
}
handlerTitleBarClick() {
Taro.showToast({
title: '暂时没有更多',
icon: 'none'
})
}
getInfoFromStorage() {
const username = Taro.getStorageSync('userInfo').login_name
const avatar = Taro.getStorageSync('userInfo').avatar
const isShop = Taro.getStorageSync('shopInfo').shop_id ? true : false
this.setState({
username, avatar, isShop
})
}
handleLogoutClick() {
Taro.clearStorageSync()
Taro.reLaunch({
url: '/pages/login/login'
})
}
componentDidMount() {
this.getInfoFromStorage()
}
componentWillReceiveProps(nextProps) {
console.log(this.props, nextProps)
}
componentWillUnmount() { }
componentDidShow() { }
componentDidHide() { }
render() {
const { client, seller, username, avatar, isShop } = this.state
return (
<View className='individualCenter'>
<View className='avatar'>
<AtAvatar circle={true} size={'large'} image={URL.Base + avatar}></AtAvatar>
<View className='user-name'>
<View className='name'>
{username}</View>
<View className='badge'>????</View>
</View>
</View>
<View className='client-container'>
<View className='bg-image'>
<Image
style='width: 100%;height: 250rpx;'
src={URL.Base + 'Public/images/m/bg.jpg'}
/>
</View>
<View className='row'>
<View className='title'>收藏的宝贝</View>|
<View className='title'>收藏的店铺</View>|
<View className='title'>我的足迹</View>
</View>
<AtList>
<AtListItem hasBorder={false} title='业主中心' onClick={this.handlerTitleBarClick.bind(this)} extraText='更多' arrow='right' />
</AtList>
<AtGrid hasBorder={false} data={client} columnNum={4} onClick={this.handlerGridClick.bind(this)} />
</View>
{isShop ? <View className='seller-container'>
<AtList>
<AtListItem hasBorder={false} title='店铺中心' onClick={this.handlerTitleBarClick.bind(this)} extraText='更多' arrow='right' />
</AtList>
<AtGrid hasBorder={false} data={seller} columnNum={4} onClick={this.handlerGridClick.bind(this)} />
</View> : <View />}
<View className='logout' onClick={this.handleLogoutClick.bind(this)}>
{/* <AtButton type='primary' size='normal'>退出</AtButton> */}
<Button type='primary' size='noraml' className='button-dark-red' >
退出</Button>
</View>
</View>
)
}
}
export default IndividualCenter

View File

@ -0,0 +1,40 @@
.individualCenter{
position: relative;
.avatar{
position: absolute;
top:190rpx;
left: 50rpx;
display: flex;
.user-name{
display: flex;
font-size: 25rpx;
color: #FFFFFF;
.name{
margin-left: 15rpx
}
.badge{
margin-left: 15rpx
}
}
}
.row{
height: 80rpx;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content:flex-end;
.title{
margin-left:10rpx;
margin-right:10rpx;
}
}
.logout{
width:30%;
margin:0 auto;
margin-top: 10%
}
.seller-container{
}
}

View File

@ -31,7 +31,6 @@ class MyDemandSupplyEdit extends Component {
content: '', content: '',
pickerImageUrl: [], // 上传的图片 pickerImageUrl: [], // 上传的图片
ImagesInfo: [],// 后台传回来的图片信息 ImagesInfo: [],// 后台传回来的图片信息
isFormCompleted: false, isFormCompleted: false,
isConfirmWindow: false,// 删除提示框 isConfirmWindow: false,// 删除提示框
demandSupplyId: '',// 供求id demandSupplyId: '',// 供求id
@ -57,6 +56,7 @@ class MyDemandSupplyEdit extends Component {
}) })
.then(res => { .then(res => {
console.log('供求详情获取成功', res) console.log('供求详情获取成功', res)
Taro.hideLoading()
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0] const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
const selectedState = this.state.demandingSupplyState.filter(item => item.id == res.data.sdInfo.state)[0] const selectedState = this.state.demandingSupplyState.filter(item => item.id == res.data.sdInfo.state)[0]
@ -73,9 +73,14 @@ class MyDemandSupplyEdit extends Component {
pickerImageUrl: imageFile, pickerImageUrl: imageFile,
ImagesInfo: res.data.sdInfo.file_path, ImagesInfo: res.data.sdInfo.file_path,
}) })
Taro.hideLoading()
} else if (res.data.err_code === 88888) { } else if (res.data.err_code === 88888) {
loginExpired(res) loginExpired(res)
}else{
Taro.showToast({
title:res.data.err_msg,
icon:'none'
})
} }
}) })
@ -137,7 +142,7 @@ class MyDemandSupplyEdit extends Component {
setTimeout(() => { setTimeout(() => {
console.log('this.state.isSaveAndNew', this.state.isSaveAndNew) console.log('this.state.isSaveAndNew', this.state.isSaveAndNew)
if (this.state.isSaveAndNew) { if (this.state.isSaveAndNew) {
Taro.reLaunch({ Taro.navigateTo({
url: '/pages/supplyDemandPublish/supplyDemandPublish' url: '/pages/supplyDemandPublish/supplyDemandPublish'
}) })
} else { } else {
@ -309,8 +314,8 @@ class MyDemandSupplyEdit extends Component {
} }
} }
goToMyDemSupPage() { goToMyDemSupPage() {
Taro.switchTab({ Taro.navigateBack({
url: '/pages/mySupplyDemand/mySupplyDemand' delta: 1
}) })
} }
deleteButtonHandler() { deleteButtonHandler() {

View File

@ -1,5 +1,5 @@
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import { View, Radio, Button } from '@tarojs/components' import { View, Radio, Button, MovableArea, MovableView } from '@tarojs/components'
import { AtInput, Text, AtIcon, Picker, Image, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui' import { AtInput, Text, AtIcon, Picker, Image, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent' import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent' import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'
@ -47,6 +47,8 @@ class MyGoodList extends Component {
isOpenOffStockModal: false,// 是否显示下架模态框 isOpenOffStockModal: false,// 是否显示下架模态框
isAddToList: false,// 是否下拉加载 如果是 就添加商品到我的商品列表 isAddToList: false,// 是否下拉加载 如果是 就添加商品到我的商品列表
isShowTopNav: false,// 是否显示返回顶部按钮 isShowTopNav: false,// 是否显示返回顶部按钮
screenWidth:'',
screenHeight:''
} }
} }
@ -526,7 +528,8 @@ class MyGoodList extends Component {
}) })
} }
// 导航到商品编辑页面myGoodsEdit // 导航到商品编辑页面myGoodsEdit
goToGoodEditPage(goodId) { goToGoodEditPage(e) {
const goodId = e.currentTarget.dataset.eTapAA
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/myGoodsEdit/myGoodsEdit?id=' + goodId url: '/pages/myGoodsEdit/myGoodsEdit?id=' + goodId
}) })
@ -534,11 +537,12 @@ class MyGoodList extends Component {
// 导航到商品发布页面 // 导航到商品发布页面
goToGoodsPublishPage() { goToGoodsPublishPage() {
Taro.switchTab({ Taro.navigateTo({
url: '/pages/goodsPublish/goodsPublish' url: '/pages/goodsPublish/goodsPublish'
}) })
} }
goToGoodspage(goodId) { goToGoodspage(e) {
const goodId = e.currentTarget.dataset.eTapAA
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/goods/goods?id=' + goodId url: '/pages/goods/goods?id=' + goodId
}) })
@ -579,8 +583,26 @@ class MyGoodList extends Component {
isOpenOffStockModal: false isOpenOffStockModal: false
}) })
} }
goToCenterPage() {
Taro.switchTab({
url: '/pages/individualCenter/individualCenter'
})
}
getUserSystemInfo(){
Taro.getSystemInfo().then(res=>{
return res
}).then(res=>{
console.log('res',res)
this.setState({
screenWidth:res.screenWidth-80+'px',
screenHeight:res.screenHeight-200+'px'
})
})
}
componentDidMount() { componentDidMount() {
this.getUserSystemInfo()
Taro.showLoading({ Taro.showLoading({
title: '加载中' title: '加载中'
}) })
@ -619,8 +641,6 @@ class MyGoodList extends Component {
} }
render() { render() {
//等待接口数据 //等待接口数据
const goodListElementArray = this.state.myGoodList.map((item, index) => { const goodListElementArray = this.state.myGoodList.map((item, index) => {
return <View key={index} className='good-container'> return <View key={index} className='good-container'>
@ -671,7 +691,8 @@ class MyGoodList extends Component {
</AtModal> </AtModal>
return ( return (
<View className='MyGoodList'> <MovableArea style='height: 100%; width: 100%; '>
<View className='MyGoodList' style='position:relative;'>
{/* 删除模态提示框 */} {/* 删除模态提示框 */}
{modalMessageDeleteElement} {modalMessageDeleteElement}
{/* 下架模态框提示 */} {/* 下架模态框提示 */}
@ -799,7 +820,12 @@ class MyGoodList extends Component {
<CopyrightComponent></CopyrightComponent> <CopyrightComponent></CopyrightComponent>
<MovableView className='movable-point' x={this.state.screenWidth} y={this.state.screenHeight} style='opacity:0.3' direction='all' onClick={this.goToCenterPage.bind(this)} >
个人中心
</MovableView>
</View> </View>
</MovableArea>
) )
} }
} }

View File

@ -2,6 +2,21 @@ $themeColor:#FF7142;
.button-orange, .button-dark-red,.button-green{ .button-orange, .button-dark-red,.button-green{
font-size:28rpx; font-size:28rpx;
} }
.movable-point{
height:130rpx;
width:130rpx;
color:#ffffff;
background-color:black;
opacity: 0.3;
border-radius:50%;
position:fixed;
display: flex;
align-items: center;
justify-content:center;
font-size:25rpx;
opacity:1 ;
position:fixed;
}
.MyGoodList{ .MyGoodList{
padding: 10px 20px; padding: 10px 20px;
.filterbar-container{ .filterbar-container{

View File

@ -91,6 +91,12 @@ class MyGoodsEdit extends Component {
} else if (res.data.err_code === 88888) { } else if (res.data.err_code === 88888) {
loginExpired(res) loginExpired(res)
} }
else {
Taro.showToast({
title: res.data.err_msg,
icon: 'none',
})
}
} }
) )
@ -166,9 +172,10 @@ class MyGoodsEdit extends Component {
}).then(() => { }).then(() => {
setTimeout(() => { setTimeout(() => {
if (this.state.isSaveButton) { if (this.state.isSaveButton) {
// Taro.redirectTo({ Taro.navigateBack({
// url: '/pages/myGoodsEdit/myGoodsEdit?id=' + this.$router.params.id delta:1
// }) // url: '/pages/myGoodsList/myGoodsEdit?id=' + this.$router.params.id
})
} else if (this.state.isSaveAndNewBUtton) { } else if (this.state.isSaveAndNewBUtton) {
Taro.switchTab({ Taro.switchTab({
url: '/pages/goodsPublish/goodsPublish' url: '/pages/goodsPublish/goodsPublish'
@ -455,9 +462,9 @@ class MyGoodsEdit extends Component {
{/* <View className='button'> {/* <View className='button'>
<Button className='button-a' size='mini' >发布并新增</Button> <Button className='button-a' size='mini' >发布并新增</Button>
</View> */} </View> */}
<View className='button' onClick={this.saveAndNewButton.bind(this)}> {/* <View className='button' onClick={this.saveAndNewButton.bind(this)}>
<Button className='button-green' size='mini'>保存并新增</Button> <Button className='button-green' size='mini'>保存并新增</Button>
</View> </View> */}
<View className='button' onClick={this.goToGoodsDetailPage.bind(this)}> <View className='button' onClick={this.goToGoodsDetailPage.bind(this)}>
<Button className='button-green' size='mini'>商品详情</Button> <Button className='button-green' size='mini'>商品详情</Button>
</View> </View>

View File

@ -265,7 +265,7 @@ class MyNeedsEdit extends Component {
duration: 1000 duration: 1000
}) })
setTimeout(() => { setTimeout(() => {
Taro.reLaunch({ Taro.switchTab({
url: '/pages/myNeeds/myNeeds' url: '/pages/myNeeds/myNeeds'
}) })
@ -311,7 +311,7 @@ class MyNeedsEdit extends Component {
this.setState({ content: event.target.value }) this.setState({ content: event.target.value })
} }
goToMyNeedsPage() { goToMyNeedsPage() {
Taro.reLaunch({ Taro.switchTab({
url: '/pages/myNeeds/myNeeds' url: '/pages/myNeeds/myNeeds'
}) })
} }

View File

@ -239,7 +239,7 @@ class MyNeedsPublish extends Component {
} }
goToMyNeedsPage() { goToMyNeedsPage() {
Taro.reLaunch({ Taro.switchTab({
url: '/pages/myNeeds/myNeeds' url: '/pages/myNeeds/myNeeds'
}) })
} }

View File

@ -111,6 +111,7 @@ class MySupplyDemand extends Component {
} }
onSearchButtonHandler() { onSearchButtonHandler() {
Taro.showLoading({ title: '加载中' }) Taro.showLoading({ title: '加载中' })
this.setState({ loadMorePageIndex: 1 }, () => { this.setState({ loadMorePageIndex: 1 }, () => {
@ -160,7 +161,7 @@ class MySupplyDemand extends Component {
// 新增我的供求 // 新增我的供求
addDemandSupply() { addDemandSupply() {
Taro.reLaunch({ Taro.navigateTo({
url: '/pages/supplyDemandPublish/supplyDemandPublish' url: '/pages/supplyDemandPublish/supplyDemandPublish'
}) })
} }
@ -234,14 +235,16 @@ class MySupplyDemand extends Component {
// 编辑我的供求 // 编辑我的供求
// 跳转到我的供求编辑页面 // 跳转到我的供求编辑页面
goToMyDSEditPage(sdId) { goToMyDSEditPage(e) {
const sdId=e.currentTarget.dataset.eTapAA
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + sdId url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + sdId
}) })
} }
// 转到供求查看页面 // 转到供求查看页面
goSupplyDemandView(sdId) { goSupplyDemandView(e) {
const sdId=e.currentTarget.dataset.eTapAA
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/supplyDemandView/supplyDemandView?sdId=' + sdId url: '/pages/supplyDemandView/supplyDemandView?sdId=' + sdId
}) })

View File

@ -84,12 +84,12 @@ class SupplyDemand extends Component {
console.log('this.state.isPublishAndNew', this.state.isPublishAndNew) console.log('this.state.isPublishAndNew', this.state.isPublishAndNew)
setTimeout(() => { setTimeout(() => {
if (this.state.isPublishAndNew) { if (this.state.isPublishAndNew) {
Taro.reLaunch({ Taro.navigateTo({
url: '/pages/supplyDemandPublish/supplyDemandPublish' url: '/pages/supplyDemandPublish/supplyDemandPublish'
}) })
} else { } else {
Taro.navigateTo({ Taro.redirectTo({
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + res.data.sd_id url: '/pages/mySupplyDemand/mySupplyDemand'
}) })
} }
}, 1000); }, 1000);
@ -240,7 +240,7 @@ class SupplyDemand extends Component {
LoginService() LoginService()
return return
} }
Taro.switchTab({ Taro.navigateTo({
url: '/pages/mySupplyDemand/mySupplyDemand' url: '/pages/mySupplyDemand/mySupplyDemand'
}) })
} }
@ -383,9 +383,9 @@ class SupplyDemand extends Component {
<View className='button' onClick={this.publishButtonHandler.bind(this)}> <View className='button' onClick={this.publishButtonHandler.bind(this)}>
<Button size='mini' className='button-orange' >发布</Button> <Button size='mini' className='button-orange' >发布</Button>
</View> </View>
<View className='button' onClick={this.publishAndNewButton.bind(this)}> {/* <View className='button' onClick={this.publishAndNewButton.bind(this)}>
<Button size='mini' className='button-green' >发布并新增</Button> <Button size='mini' className='button-green' >发布并新增</Button>
</View> </View> */}
<View className='button' onClick={this.goToMyDemSupPage.bind(this)}> <View className='button' onClick={this.goToMyDemSupPage.bind(this)}>
<Button size='mini' className='button-green' >我的供求</Button> <Button size='mini' className='button-green' >我的供求</Button>
</View> </View>

View File

@ -49,6 +49,7 @@ class SupplyDemandView extends Component {
}) })
.then(res => { .then(res => {
console.log('供求详情获取成功', res) console.log('供求详情获取成功', res)
Taro.hideLoading()
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
const selectedType = this.state.demandingSupplyCate.filter(item => item.id === res.data.sdInfo.sd_type)[0].name const selectedType = this.state.demandingSupplyCate.filter(item => item.id === res.data.sdInfo.sd_type)[0].name
this.setState({ this.setState({
@ -62,9 +63,14 @@ class SupplyDemandView extends Component {
images: res.data.sdInfo.file_path, images: res.data.sdInfo.file_path,
itemId: res.data.sdInfo.sd_id itemId: res.data.sdInfo.sd_id
}) })
Taro.hideLoading()
} else if (res.data.err_code === 88888) { } else if (res.data.err_code === 88888) {
loginExpired(res) loginExpired(res)
}else{
Taro.showToast({
title:res.data.err_msg,
icon:'none'
})
} }
} }
@ -115,7 +121,7 @@ class SupplyDemandView extends Component {
} }
goToSDPublishPage() { goToSDPublishPage() {
Taro.reLaunch({ Taro.navigateTo({
url: '/pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面 url: '/pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面
}) })
} }
@ -127,7 +133,7 @@ class SupplyDemandView extends Component {
} }
goToMySDPage() { goToMySDPage() {
Taro.reLaunch({ Taro.navigateBack({
url: '/pages/mySupplyDemand/mySupplyDemand',//我的供求页面 url: '/pages/mySupplyDemand/mySupplyDemand',//我的供求页面
}) })
} }

View File

@ -18,552 +18,136 @@ bug 商品编辑 增加图片后 图片顺序乱了
等待后台--- 单个我的商品页面的图片顺序,单个我的需求页面的接口, 当个我哦的需求编辑页面的接口 等待后台--- 单个我的商品页面的图片顺序,单个我的需求页面的接口, 当个我哦的需求编辑页面的接口
import '@tarojs/async-await'
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text, Swiper, SwiperItem, Image, } from '@tarojs/components' import { Provider } from '@tarojs/redux'
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui' import Home from './pages/home'
import FilteredShopComponent from '../../component/filteredShopComponent/filteredShopComponent'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import LoginService from '../../util/LoginService' import configStore from './store'
import weChatLogin from '../../util/weChatLogin'
import URL from '../../serviceAPI.config'
import './home.scss'
import './app.scss'
// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释:
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
// require('nerv-devtools')
// }
class Home extends Component { const store = configStore()
class App extends Component {
isTrue = Taro.getStorageSync('session_id') ? true : false
config = { config = {
navigationBarTitleText: '首页', pages: [
//'pages/index/index', // index页面
'pages/home/home',//首页 ---------------------
'pages/login/login',//登入页面 ---------------------
'pages/shop/shop',//店铺页面 ---------------------
'pages/goods/goods',// 商品页面 ---------------------
'pages/goodsPublish/goodsPublish',// 商品发布页面 ---------------------
'pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面 ---------------------
'pages/mySupplyDemand/mySupplyDemand',// 我的供求列表页面 ---------------------
'pages/myGoodsEdit/myGoodsEdit',// 我的商品编辑页面 ---------------------
'pages/allDemanding/allDemanding',// 所有供求页面 ---------------------
'pages/myGoodList/myGoodList',// 我的商品列表页面 --------------------- 编辑商品按键
'pages/myDemandSupplyEdit/myDemandSupplyEdit',// 我的供求编辑页面 ---------------------
'pages/supplyDemandView/supplyDemandView',// 查看单个供求页面
'pages/grabOrderPage/grabOrderPage',// 抢单页面
'pages/myNeeds/myNeeds',// 我的需求页面
'pages/myNeedsView/myNeedsView',// 单个需求查看页面
'pages/myNeedsEdit/myNeedsEdit',// 单个需求编辑页面
'pages/myNeedsPublish/myNeedsPublish',// 需求发布
// 'pages/shopDescription/shopDescription',
],
permission: {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
constructor() {
super(...arguments);
this.state = {
shops: [], // 推荐店铺的信息
ads: [], //广告图片数组
categories: [],// 大类
subCate: [], //小类
demanding: [],// 业主需求
otherData: [], // 底部导航栏
isOpen: false, // 抢单消息提示
grabOrderId: '',//抢到订单的id
userName: Taro.getStorageSync('user_identity').userName || '',//用户名字
userPhone: Taro.getStorageSync('user_identity').userPhone || '',// 用户电话
isShowTopNav: false,// 是否显示返回顶部按钮
loadMorePageIndex: 1,//下拉加载页面数
isAddToList: false,
parentClass: '',// 大类的id
childClass: '-1',//小类的id
supplyLevel: 1,// 筛选1是小类或者2是大类,
latitude: '',
longitude: ''
}
}
// onPullDownRefresh() {
// Taro.showLoading({ title: '加载中' })
// this.login().then(() => {
// this.getShops({})
// this.getHomeCategoriesInfo()
// }).catch(err => console.log('微信登入失败:', err))
// Taro.stopPullDownRefresh()
// }
//api得到首页的信息
getHomeCategoriesInfo() {
Taro.request({
url: URL.ShopWxStore,
header: {
// 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
}
})
.then(res => {
console.log('首页基本信息', res)
if (res.data.err_msg === 'success') {
this.setState({
ads: res.data.data.adsLb,
categories: [res.data.data.supplyClass[0], Object.values(res.data.data.supplyClass[1])],
demanding: res.data.data.demand.supplys,
otherData: res.data.otherData,
userName: res.data.otherData.userName,
userPhone: res.data.otherData.userPhone,
})
} else {
Taro.showToast({
title: res.data.err_msg,
icon: 'none',
duration: 1500
})
}
})
}
// api 得到推荐商店的信息
getShops({ parent_supply_class = this.state.parentClass, supply_class = this.state.childClass, supply_level = this.state.supplyLevel, curr_page = 1,
page_count = 5, action = "2" }) {
Taro.request({
url: URL.ShopSupplyShops,
method: 'POST',
dataType: 'json',
data: {
param: JSON.stringify({
curr_page: curr_page,
page_count: page_count,
parent_supply_class: parent_supply_class, //父级class id
supply_class: supply_class,// 子级class id
supply_level: supply_level,// 层级
action: action,
latitude:this.state.latitude,
longitude:this.state.longitude,
})
}, },
header: { window: {
'content-type': 'application/x-www-form-urlencoded', backgroundTextStyle: 'light',
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), navigationBarBackgroundColor: '#fff',
} navigationBarTitleText: 'WeChat',
}) navigationBarTextStyle: 'black',
.then(res => { // enablePullDownRefresh:true
console.log('所有店铺的信息', res) onReachBottomDistance: 0
Taro.hideLoading()
if (res.data.err_code === 0) {
if (this.state.isAddToList) {
if (res.data.shops) {
this.setState({ shops: this.state.shops.concat(res.data.shops), isAddToList: false })
} else {
Taro.showToast({
title: '没有更多了',
icon: 'none',
duration: 1500
})
}
} else {
res.data.shops ? this.setState({ shops: res.data.shops }) : this.setState({ shops: [] })
}
} else {
Taro.showToast({
title: res.data.err_msg,
icon: 'none',
duration: 1500
})
}
this.setState({ isAddToList: false })
}
)
}
getUserLocation(that) {
Taro.getLocation({
type: 'gcj02', // 返回可以用于wx.openLocation的经纬度
success(res) {
that.setState({
latitude: res.latitude,
longitude: res.longitude
},()=>{
that.getShops({})
that.getHomeCategoriesInfo()
})
}
})
}
// 微信用户设置
// wxUserSetting() {
// Taro.getSetting({
// success(res) {
// if (res.authSetting['scope.userInfo']) {
// console.log('personal info', res)
// Taro.authorize({
// scope: 'scope.userInfo',
// success() {
// // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
// // Taro.getUserInfo({
// // success(res1) {
// // console.log('res1',res1)
// // }
// // })
// console.log('权限允许')
// }
// })
// }
// }
// })
// }
// api 抢单请求
GrabDemand({ demandId = 218 }) {
Taro.request({
url: URL.GrabDemand,
method: 'POST',
dataType: 'json',
data: {
demandId: demandId
}, },
header: {
'content-type': 'application/x-www-form-urlencoded', tabBar: {
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), list: [{
'X-Requested-With': 'XMLHttpRequest' pagePath: "pages/home/home",
text: "首页",
iconPath: "./icons/home.png",
selectedIconPath: "./icons/home-actived.png"
},
, {
pagePath: "pages/myNeedsPublish/myNeedsPublish",
text: "需求发布",
iconPath: "./icons/publish.png",
selectedIconPath: "./icons/publish-actived.png"
} }
}) , {
.then(res => { pagePath: "pages/myNeeds/myNeeds",
Taro.showToast({ text: "我的需求",
title: res.data.err_msg === 'success' ? '抢单成功' : res.data.err_msg, iconPath: "./icons/needs.png",
icon: 'none', selectedIconPath: "./icons/needs-actived.png"
duration: 1500
})
console.log('抢单请求:', res)
})
} }
// 点击大类icon // , {
onClickParentCate(item) { // pagePath: "pages/individualCenter/individualCenter",
Taro.showLoading({ // text: "个人中心",
title: '加载中' // iconPath: "./icons/needs.png",
}) // selectedIconPath: "./icons/needs-actived.png"
this.setState({ parentClass: item.class_id, childClass: item.class_id, supplyLevel: 1, subCate: item.children || [] }, () => { // }
this.getShops({}) ],
}) color: '#333',
selectedColor: '#FF7142',
backgroundColor: '#fff',
} borderStyle: 'black'
// 点击子类
onClickChildCate(item) {
Taro.showLoading({
title: '加载中'
})
this.setState({ childClass: item.class_id, supplyLevel: 2 }, () => {
this.getShops({})
})
// this.getShops(item.parent_class_id, item.class_id, 2)
}
scrollToSubCate(item) {
Taro.pageScrollTo({
scrollTop: 410,
duration: 300
})
this.onClickParentCate(item)
}
// 转到其他页面
goToAllDemandingPage() {
if (!Taro.getStorageSync('userInfo').user_id) {
LoginService()
return
}
Taro.navigateTo({
url: '/pages/allDemanding/allDemanding'
})
} }
grabOrderId(Id) {
this.setState({ isOpen: true, grabOrderId: Id })
} }
handleGrabModalClose() {
this.setState({ isOpen: false })
}
handleGrabModalCancel() {
this.setState({ isOpen: false })
}
handleGrabConfirm() {
if (!Taro.getStorageSync('userInfo').user_id) {
LoginService()
}
this.setState({ isOpen: false })
// 确认抢单之后
this.GrabDemand({ demandId: this.state.grabOrderId })
}
// 导航去抢单页面
goToGrabOrderPage(orderId) {
Taro.navigateTo({
url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId
})
}
goToMyNeedsPublish() {
// 传参数给myNeedsPublish页面- 显示效果图选项
Taro.navigateTo({
url: '/pages/myNeedsPublish/myNeedsPublish?id=1'
})
}
componentDidMount() { componentDidMount() {
// 页面加载后 得到首页的基本信息和推荐店铺的信息
Taro.showLoading({ title: '加载中' })
this.getUserLocation(this)
if (!Taro.getStorageSync('userInfo').user_id) {
weChatLogin()
}
// this.login().then(() => {
// this.getShops({})
// this.getHomeCategoriesInfo()
// }).catch(err => console.log('微信登入失败:', err))
} }
componentWillMount() { componentDidShow() { }
}
componentWillUnmount() { }
componentDidShow() {
}
componentDidHide() { } componentDidHide() { }
componentCatchError() { }
// 微信用户信息 componentDidCatchError() { }
onGotUserInfo(e) {
console.log(e.detail.errMsg)
console.log(e.detail.userInfo)
console.log(e.detail.rawData)
}
// 页面位置
onPageScroll(location) {
if (location.scrollTop <= 300 && this.state.isShowTopNav) {
this.setState({ isShowTopNav: false })
} else if (location.scrollTop > 300 && !this.state.isShowTopNav) {
this.setState({ isShowTopNav: true })
}
}
// 底部加载
onReachBottom() {
Taro.showLoading({
title: '加载中'
})
this.setState({ loadMorePageIndex: this.state.loadMorePageIndex + 1, isAddToList: true }, () => {
this.getShops({ curr_page: this.state.loadMorePageIndex, })
})
}
// 在 App 类中的 render() 函数没有实际作用
// 请勿修改此函数
render() { render() {
// 提示模态弹窗element
const modalMessageGrabElement = <AtModal isOpened={this.state.isOpen}>
<AtModalHeader>提示</AtModalHeader>
<AtModalContent>
确认抢单?
</AtModalContent>
<AtModalAction> <Button onClick={this.handleGrabModalCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleGrabConfirm.bind(this)}>确定</Button> </AtModalAction>
</AtModal>
const demandingElemensArray = this.state.demanding.length ? this.state.demanding.map((item, index) => {
return <SwiperItem key={index} >
<View className={this.state.demanding.length - 1 === index ? 'demanding-item last' : 'demanding-item'}>
<View onClick={this.goToGrabOrderPage.bind(this, item.sd_id)}>
<View className='item-tag'>
<Text className='item-tag-text'> {item.class_name}</Text>
</View>
<View className='item-title'>
{item.sd_title}
</View>
<View className='item-address'>
{item.user_address || '--'}
</View>
<View className='item-name'>
业主:{item.user_name}
</View>
</View>
{item.state === '1' ? <View className='button' onClick={this.grabOrderId.bind(this, item.sd_id)}>
<Button size='mini' className='button-orange'>抢单</Button>
</View> : null || item.state === '2' ? <View className='button'>
<Button size='mini' className='button-orange blur'>{item.state_name}</Button>
</View> : null || item.state === '3' ? <View className='button'>
<Button size='mini' className='button-orange blur'>{item.state_name}</Button>
</View> : null}
{/* <View className='item-button-box' onClick={this.grabOrderId.bind(this, item.sd_id)}>
<Button className='item-button' > {item.state_name === '在用' ? '抢单' : '已抢光'}</Button>
</View> */}
</View>
</SwiperItem >
}) : null
const adsImgElementsArray = this.state.ads.length ? this.state.ads.map((item, index) => {
return <SwiperItem key={index}>
<Image className='banner-img' src={URL.Base + item.ads_pic} />
</SwiperItem>
}) : null
// 这里应该代码可以优化-----
const categoriesElementsArray1 = this.state.categories.length ? this.state.categories[0].map((item, index) => {
return <View className='category-item' key={index} onClick={this.scrollToSubCate.bind(this, item)}>
{/* onClick={this.onClickParentCate.bind(this, item)}> */}
<Image className='cate-img' src={URL.Base + item.icon} />
<View>{item.class_name}</View>
</View>
}) : null
const categoriesElementsArray2 = this.state.categories.length ? this.state.categories[1].map((item, index) => {
return <View className='category-item' key={index} onClick={this.scrollToSubCate.bind(this, item)}>
{/* onClick={this.onClickParentCate.bind(this, item)}> */}
<Image className='cate-img' src={URL.Base + item.icon} />
<View>{item.class_name}</View>
</View>
}) : null
const shopCollectionElementsArray = this.state.shops.length ? this.state.shops.map((item, index) => {
return <FilteredShopComponent
shop={item}
key={index}
categoryLevel={this.state.supplyLevel}
classId={this.state.parentClass === this.state.childClass ? this.state.parentClass : this.state.childClass}
></FilteredShopComponent>
}) : <View className='no-more-title top'> 没有更多了</View>
const subCateElementsArray = this.state.subCate.length ? this.state.subCate.map((item, index) => {
return <SwiperItem key={index} onClick={this.onClickChildCate.bind(this, item)}>
<View className='text'>{item.class_name}</View>
</SwiperItem>
}) : null
return ( return (
<View className='home'> <Provider store={store}>
<Home />
{/* 获取微信用户的信息 */} </Provider>
{/* <AtButton open-type='getUserInfo' lang='zh_CN' type='primary' size='normal' onGetUserInfo={this.onGotUserInfo.bind(this)}>获取微信用户的信息</AtButton> */}
{modalMessageGrabElement}
<View className='first-banner'>
<Swiper
className='swipper'
style='height:120px;'
indicatorColor='#999'
indicatorActiveColor='#333'
hotizontal
circular
indicatorDots
autoplay
>
{adsImgElementsArray}
</Swiper>
</View>
{/* 第二行图片滚动条 */}
<View className='second-banner'>
<Swiper
style='height:100%;'
className='swipper'
indicatorColor='#999'
indicatorActiveColor='#333'
hotizontal
circular
indicatorDots
// autoplay
>
<SwiperItem>
<View className='categories'>
{categoriesElementsArray1}
</View>
</SwiperItem>
<SwiperItem>
<View className='categories'>
{categoriesElementsArray2}
</View>
</SwiperItem>
</Swiper>
</View>
{/* 第三行图片滚动条 */}
<View className='third-banner'>
<Swiper
style='height:100px;'
className='swipper'
indicatorColor='#999'
indicatorActiveColor='#333'
horizontal
circular
indicatorDots
autoplay
>
<SwiperItem onClick={this.goToMyNeedsPublish.bind(this)}>
<Image className='banner-img' src={URL.Base + 'Public/images/xgt.png'} />
</SwiperItem>
</Swiper>
</View>
{/* 业主需求和行业推荐 */}
<View className='container'>
<View className='title'>
<Text className='title-block'></Text>
<Text className='title-text'>业主需求</Text>
<Text className='more-link' onClick={this.goToAllDemandingPage.bind(this)}>
更多>>
</Text>
</View>
<View className='customer-demanding'>
<Swiper
style='height:180px;'
className='swipper swiper-sub'
indicatorColor='#999'
indicatorActiveColor='#333'
horizontal
displayMultipleItems='2.5'
>
{demandingElemensArray}
</Swiper>
</View>
<View className='second-banner-level2'>
{this.state.subCate.length ? <Swiper
style='height:35px;'
className='swipper swiper-sub'
indicatorColor='#999'
indicatorActiveColor='#333'
horizontal
displayMultipleItems={this.state.subCate.length > 4.5 ? 4.5 : this.state.subCate.length}
>
{subCateElementsArray}
</Swiper> : null}
</View>
<View className='title'>
<Text className='title-block'></Text>
<Text className='title-text'>行业推荐</Text>
</View>
<View className='shop-box'>
{shopCollectionElementsArray}
</View>
{this.state.isShowTopNav ? <ScrollToTopComponent ></ScrollToTopComponent> : null}
<CopyrightComponent></CopyrightComponent>
<View className='gap'>
</View>
</View>
<View className='bottom-nav-box'>
{/* <BottomNav otherData={this.state.otherData} /> */}
</View>
</View>
) )
} }
} }
export default Home Taro.render(<App />, document.getElementById('app'))
// {
// pagePath: "pages/goodsPublish/goodsPublish",
// text: "商品发布",
// iconPath: "./icons/box.png",
// selectedIconPath: "./icons/box-actived.png"
// }, {
// pagePath: "pages/supplyDemandPublish/supplyDemandPublish",
// text: "供求发布",
// iconPath: "./icons/publish.png",
// selectedIconPath: "./icons/publish-actived.png"
// }
// , {
// pagePath: "pages/mySupplyDemand/mySupplyDemand",
// text: "我的供求",
// iconPath: "./icons/menu.png",
// selectedIconPath: "./icons/menu-actived.png"
// }