This commit is contained in:
郑茂强 2019-03-20 15:29:28 +08:00
parent 222d978a10
commit 636304af73
27 changed files with 670 additions and 124 deletions

View File

@ -6,5 +6,18 @@ module.exports = {
},
weapp: {},
h5: {}
h5: {
esnextModules: ['taro-ui'],
// devServer: {
// proxy: {
// '/api': 'http://192.168.1.230/Shop-ajaxStore',
// changeOrigin: true,
// headers: {
// // 后端要校验请求源,那改下 host 或者 origin 不就美滋滋了?
// Host: '192.168.1.230',
// Origin: '192.168.1.230'
// }
// }
// }
}
}

View File

@ -5,5 +5,7 @@ module.exports = {
defineConstants: {
},
weapp: {},
h5: {}
h5: {
esnextModules: ['taro-ui']
}
}

View File

@ -198,7 +198,7 @@ class ShopTypeInteractionComp extends Component {
<View className='shop-interaction' >
<View className='picker-wrapper' onClick={this.invokeAliPicker.bind(this)} >
<AtList>
<AtListItem title='店铺分类' extraText={this.props.selectedValue.name} arrow='right' />
<AtListItem hasBorder={false} title='店铺分类' extraText={this.props.selectedValue.name} arrow='right' />
</AtList>
</View>
{this.state.AliIsShowPicker ? <View>

View File

@ -43,10 +43,7 @@
}
}
}
.picker-wrapper{
padding-left: 20px;
padding-right: 20px;
}
.curtain{
height: 100%;
background-color: black;
@ -56,12 +53,14 @@
opacity: 0.5;
position: fixed;
top: 0;
left: 0;
}
.ali-picker-container{
position: fixed;
width: 100%;
bottom: 0px;
left: 0;
background-color: #fff;
z-index: 100;
opacity: 1;

View File

@ -0,0 +1,303 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Picker } from '@tarojs/components'
import { AtList, AtListItem, } from 'taro-ui'
import './aliGoodsTypeInteraction.scss'
import loginExpired from '../../util/loginExpired'
import { getGlobalStorage } from '../../util/getSetStoage';
let maxDepth = 0
let initialDataArray = []
class AliGoodsTypeInteraction extends Component {
config = {
navigationBarTitleText: 'aliGoodsTypeInteraction'
}
constructor() {
super(...arguments);
this.state = {
///---行业分类 开始
initailMultiArray: [[{ class_name: '选择商品分类', class_id: '' }], [], []], // 初始化底部数据
multiIndex: [0, 0, 0, 0],// 默认联动列数为4个并且每一列都是第一行
interactionMultiArray: [],// 联动
///---行业分类 结束
}
}
//商品目录请求api GetShopCategoryList
getProductCateList(url) {
Taro.request({
url: url,
method: 'POST',
dataType: 'json',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Cookie': 'PFWSSS=' + getGlobalStorage('session_id'),
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(res => {
if (res.data.err_code === 0) {
console.log('商品分类目录', res)
const recursionInteractionData = this.recursionInteraction(res.data.data)
maxDepth = 0
initialDataArray = []
this.recursionInitialized(res.data.data) //
const depthInArray = this.recursionDepth(res.data.data)
console.log('depthInArray', depthInArray)
console.log('initialDataArray', initialDataArray)
for (let i = initialDataArray.length; i < depthInArray.length; i++) {
initialDataArray.unshift([{ name: '--', id: '' }])
}
this.setState({
interactionMultiArray: recursionInteractionData,
multiIndex: depthInArray,
initailMultiArray: initialDataArray.reverse()
}, () => {
console.log('interactionMultiArray',this.state.interactionMultiArray)
// 把全局变变量赋值给state之后初始化商品分类为空 不然第二次进去的时候会自动添加进去
// console.log('联动数据', this.state.interactionMultiArray)
// console.log('初始化数据', this.state.initailMultiArray)
}) // 用递归来整理无限层次的数据
// console.log('联动数据', this.recursionInteraction(res.data.data))
// console.log('初始数据', this.recursionInitialized(res.data.data).reverse())
} else if (res.data.err_code === 88888) {
loginExpired(res)
} else {
Taro.showToast({
title: res.data.err_msg,
icon: 'none'
})
}
}
)
.catch(error => {
console.log('商品分类请求错误', error)
})
}
//联动确认
bindMultiPickerChange(e) {
// 如果没有上商品 那就不执行
if (getGlobalStorage('shopInfo').shop_id) {
this.setState({
multiIndex: e.detail.value.map(item => { if (item === null) { item = 0 } return item })
}, () => {
// console.log('picker发送选择改变携带值为', this.state.multiIndex)
this.returnResultToParent()
})
}
}
returnResultToParent() {
let selected = this.state.interactionMultiArray
for (let index of this.state.multiIndex) {
if (selected[index].children[0].id) {
selected = selected[index].children
} else {
this.props.onPassDataToChild(selected[index])
break
}
}
}
// 递归整理无限层初始数据,将整理好的数据赋值给initialDataArray
recursionInitialized(data) {
const arrayTem = []
if (data.length) {
for (let item of data) {
arrayTem.push({ name: item.class_name, id: item.class_id })
}
}
if (data[0].children.length) {
this.recursionInitialized(data[0].children)
}
initialDataArray.push(arrayTem)
return arrayTem
}
// 递归整理无限层联动数据
recursionInteraction(data) {
let arrayTem = []
for (let items of data) {
arrayTem.push({ name: items.class_name, id: items.class_id })
if (items.children) {
arrayTem[arrayTem.length - 1].children = this.recursionInteraction(items.children)
} else {
arrayTem[arrayTem.length - 1].children = [{ name: '--', id: '' }]
}
}
return arrayTem // 返回联动数据
// return arrayTem
}
// 递归整理无限层初始数据
// recursionInitialized(data) {
// const arrayTem = []
// const childrenHolderArray = []
// if (data.length) {
// for (let item of data) {
// arrayTem.push({ name: item.class_name, id: item.class_id })
// item.children ? childrenHolderArray.push(...item.children) : null
// }
// this.recursionInitialized(childrenHolderArray)
// }
// arrayTem.length ? initialDataArray.push(arrayTem) : null // 数组为空则不添加
// return initialDataArray
// }
// 递归整理无限层初始数据
recursionDepth(data) {
const arrayTem = []
const childrenHolderArray = []
if (data.length) {
for (let item of data) {
arrayTem.push({ name: item.class_name, id: item.class_id })
item.children ? childrenHolderArray.push(...item.children) : null
}
this.recursionDepth(childrenHolderArray)
maxDepth += 1
}
return new Array(maxDepth).fill(0)
}
// 触动联动筛选
bindMultiPickerCol(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
console.log(this.state.initailMultiArray)
const data = {
multiArray: this.state.initailMultiArray,
multiIndex: this.state.multiIndex
}
data.multiIndex[e.detail.column] = e.detail.value
if (e.detail.column == 0) {
for (let index in data.multiArray[0]) {
const indexNumber = Number(index)
if (indexNumber === data.multiIndex[0]) {
data.multiArray[1] = this.state.interactionMultiArray[indexNumber].children
data.multiArray[2] = this.state.interactionMultiArray[indexNumber].children[data.multiIndex[1]].children
data.multiArray[3] = this.state.interactionMultiArray[indexNumber].children[data.multiIndex[1]].children[data.multiIndex[2]].children
}
}
} else if (e.detail.column == 1) {
for (let index in data.multiArray[1]) {
const indexNumber = Number(index)
if (indexNumber === data.multiIndex[1]) {
data.multiArray[2] = this.state.interactionMultiArray[data.multiIndex[0]].children[indexNumber].children
}
}
}
else if (e.detail.column == 2) {
for (let index in data.multiArray[2]) {
const indexNumber = Number(index)
if (indexNumber === data.multiIndex[2]) {
data.multiArray[3] = this.state.interactionMultiArray[data.multiIndex[0]].children[data.multiIndex[1]].children[indexNumber].children
}
}
}
this.setState({ multiIndex: data.multiIndex })
}
aliBindMultiPickerCol(e) {
console.log(',值为', e.detail.value)
this.setState({ multiIndex: e.detail.value })
}
aliCancelButton() {
this.setState({
AliIsShowPicker: false
})
}
aliConfirmButton() {
this.setState({
AliIsShowPicker: false
})
this.returnResultToParent()
}
invokeAliPicker() {
this.setState({
AliIsShowPicker: true
})
}
componentDidMount() {
if (getGlobalStorage('shopInfo').shop_id) {
this.getProductCateList(this.props.url)
} else {
}
}
// 当然父组件有新的props的 会从新渲染组件
componentWillReceiveProps(nextProps) {
}
componentWillUnmount() { }
componentDidShow() { }
componentDidHide() { }
render() {
return (
<View className='goods-interaction' >
<View className='picker-wrapper' onClick={this.invokeAliPicker.bind(this)} >
<AtList >
<AtListItem hasBorder={false} title='商品分类' className='title' extraText={this.props.selectedValue.name} arrow='right' />
</AtList>
</View>
{this.state.AliIsShowPicker ? <View>
<View className='curtain' onClick={this.aliCancelButton.bind(this)} > </View>
<View class='ali-picker-container'>
<View className='button'>
<View className='cancel-button' onClick={this.aliCancelButton.bind(this)}>取消</View>
<View className='confirm-button ali-blue-color' onClick={this.aliConfirmButton.bind(this)}>确定</View>
</View>
<picker-view value={this.state.multiIndex} onChange={this.aliBindMultiPickerCol.bind(this)}>
<picker-view-column>
{this.state.interactionMultiArray.map((item, index) => {
return <View key={index}>{item.name}</View>
})}
</picker-view-column>
<picker-view-column>
{this.state.interactionMultiArray[this.state.multiIndex[0]].children.map((item, index) => {
return <View key={index}>{item.name}</View>
})}
</picker-view-column>
<picker-view-column>
{this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]].children.map((item, index) => {
return <View key={index}>{item.name}</View>
})}
</picker-view-column>
<picker-view-column>
{this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]].children[this.state.multiIndex[2]].children.map((item, index) => {
return <View key={index}>{item.name}</View>
})}
</picker-view-column>
</picker-view>
</View ></View> : null}
</View>
)
}
}
export default AliGoodsTypeInteraction

View File

@ -0,0 +1,47 @@
.picker-wrapper{
.item-content__info-title{
font-weight: bold
}
.item-extra__info{
color: black
}
.at-list__item{
padding-left: 0px;
}
}
.curtain{
height: 100%;
background-color: black;
width: 100%;
position: fixed;
z-index: 99;
opacity: 0.5;
position: fixed;
top: 0;
left:0
}
.ali-picker-container{
position: fixed;
width: 100%;
bottom: 0px;
left:0;
background-color: #fff;
z-index: 100;
opacity: 1;
.button{
display: flex;
flex-direction: row;
padding:20px 30px;
border-bottom: 1px solid #d6e4ef;
}
.cancel-button{
flex:1;
text-align: left;
}
.confirm-button{
flex:1;
text-align: right;
}
}

View File

@ -199,7 +199,7 @@ class AliIndustryTypeInteraction extends Component {
<View className='industry-interaction' >
<View className='picker-wrapper' onClick={this.invokeAliPicker.bind(this)} >
<AtList >
<AtListItem title='行业分类' className='title' extraText={this.props.selectedValue.name} arrow='right' />
<AtListItem hasBorder={false} title='行业分类' className='title' extraText={this.props.selectedValue.name} arrow='right' />
</AtList>
</View>
{this.state.AliIsShowPicker ? <View>

View File

@ -6,6 +6,9 @@
.item-extra__info{
color: black
}
.at-list__item{
padding-left: 0px;
}
}
.curtain{
height: 100%;
@ -16,12 +19,14 @@
opacity: 0.5;
position: fixed;
top: 0;
left:0
}
.ali-picker-container{
position: fixed;
width: 100%;
bottom: 0px;
left:0;
background-color: #fff;
z-index: 100;
opacity: 1;

View File

@ -6,7 +6,7 @@ import './interactionComponent.scss'
import loginExpired from '../../util/loginExpired';
import { getGlobalStorage } from '../../util/getSetStoage';
// 这个是行业分类的联动
let maxDepth = 0
let initialDataArray = []
class Interaction extends Component {

View File

@ -7,6 +7,7 @@ import AliPictureUploadComponent from '../../component/aliPictureUploadComponent
import ShopTypeInteractionComp from '../../component/shopTypeInteractionComp/shopTypeInteractionComp'
import AliShopTypeInteraction from '../../component/AliShopTypeInteraction/AliShopTypeInteraction'
import GoodsTypeInteractionComp from '../../component/goodsTypeInteractionComp/goodsTypeInteractionComp'
import AliGoodsTypeInteraction from '../../component/aliGoodsTypeInteraction/aliGoodsTypeInteraction'
import LoginService from '../../util/LoginService'
import URL from '../../serviceAPI.config'
@ -320,11 +321,16 @@ class GoodsPublish extends Component {
<View className='goods-category'>
{/* 商品分类开始 */}
<GoodsTypeInteractionComp
{platformChecker() ? <GoodsTypeInteractionComp
url={URL.GetProductCategoryList}
onPassDataToChild={this.getDataFromGoodsChild.bind(this)}
selectedValue={this.state.goodsTypeSelected}
></GoodsTypeInteractionComp>
: <AliGoodsTypeInteraction url={URL.GetProductCategoryList}
onPassDataToChild={this.getDataFromGoodsChild.bind(this)}
selectedValue={this.state.goodsTypeSelected} />}
{/* 商品分类结束 */}
<View className='input-box'>
@ -380,14 +386,14 @@ class GoodsPublish extends Component {
</View>
{/* 店铺分类 */}
{platformChecker() ? <View className='ShopTypeInteractionComp-wrapper'>
{platformChecker() ?
<ShopTypeInteractionComp url={URL.GetShopCategoryList}
shopId={getGlobalStorage('shopInfo').shop_id}
selectedValue={this.state.shopTypeSelected}
onPassDataToChild={this.getDataFromShopChild.bind(this)}
></ShopTypeInteractionComp>
</View> : <AliShopTypeInteraction url={URL.GetShopCategoryList}
: <AliShopTypeInteraction url={URL.GetShopCategoryList}
shopId={getGlobalStorage('shopInfo') ? getGlobalStorage('shopInfo').shop_id : ''}
selectedValue={this.state.shopTypeSelected}
onPassDataToChild={this.getDataFromShopChild.bind(this)}
@ -401,12 +407,19 @@ class GoodsPublish extends Component {
<Text className='require'></Text>
<Text className='title'>商品简介:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.productDescript}
onChange={this.productDescriptChange.bind(this)}
maxlength='140'
placeholder='你的产品简介'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.productDescriptChange.bind(this)}
value={this.state.productDescript}
placeholder='你的产品简介'
maxlength='140' /></View>
}
</View>
</View>
<View className='button-box' >

View File

@ -3,7 +3,7 @@ $themeColor:#FF7142;
.goods-category{
padding-top: 10px;
padding: 10px 20px;
.border-box{
border-bottom: 1Px solid #d6e4ef;
@ -18,8 +18,7 @@ $themeColor:#FF7142;
}
.img-box{
margin-top:10Px;
padding-left: 20px;
padding-right: 20px;
.img-container{
border: 1Px solid #d6e4ef;
border-radius:8rpx;
@ -32,8 +31,7 @@ $themeColor:#FF7142;
}
.description-box{
margin-top:10Px;
padding-left: 20px;
padding-right: 20px;
}
}
@ -92,8 +90,7 @@ $themeColor:#FF7142;
}
.page-section{
border-bottom: 1Px solid #d6e4ef;
padding-left: 20px;
padding-right: 20px;
}
.selected{
@ -104,8 +101,7 @@ $themeColor:#FF7142;
.input-box{
border-bottom: 1Px solid #d6e4ef;
display: flex;
padding-left: 20px;
padding-right: 20px;
}
.require{
color:red;
@ -122,7 +118,14 @@ $themeColor:#FF7142;
}
}
.ShopTypeInteractionComp-wrapper{
padding-left: 20px;
padding-right: 20px;
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -114,6 +114,7 @@ class Home extends Component {
header: {
'content-type': 'application/x-www-form-urlencoded',
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
}
})
.then(res => {
@ -311,21 +312,23 @@ class Home extends Component {
componentDidMount() {
// 页面加载后 得到首页的基本信息和推荐店铺的信息
showLoading({ title: '加载中' })
// promise 返回经纬度给state 然后调用函数
this.getUserLocation().then(res => {
this.setState({
latitude: res.latitude,
longitude: res.longitude
}, () => {
// // 页面加载后 得到首页的基本信息和推荐店铺的信息
// showLoading({ title: '加载中' })
// // promise 返回经纬度给state 然后调用函数
// this.getUserLocation().then(res => {
// this.setState({
// latitude: res.latitude,
// longitude: res.longitude
// }, () => {
// this.getShops({})
// this.getHomeCategoriesInfo()
// })
// }).catch(err => {
// this.getShops({})
// this.getHomeCategoriesInfo()
// })
this.getShops({})
this.getHomeCategoriesInfo()
})
}).catch(err => {
this.getShops({})
this.getHomeCategoriesInfo()
})
// 本地缓存没有userid时 从新登入
Taro.getStorageSync('userInfo').user_id ? true : weChatLogin()
}

View File

@ -427,24 +427,37 @@ class MyDemandSupplyEdit extends Component {
<View className='title-box'>
<Text className='title'><Text className='require'></Text>:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.contactAddress}
onChange={this.contactAddressChange.bind(this)}
maxlength='140'
placeholder='联系地址'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contactAddressChange.bind(this)}
value={this.state.contactAddress}
placeholder="联系地址"
maxlength='140' /></View>
}
</View>
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'><Text className='require'>*</Text>:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.content}
onChange={this.contentChange.bind(this)}
maxlength='140'
placeholder=''
/>
/>: <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contentChange.bind(this)}
value={this.state.content}
placeholder=""
maxlength='140' /></View>
}
</View>
<View className='img-box'>
<View className='title-box'>

View File

@ -77,3 +77,13 @@ $themeColor:#FF7142;
line-height:100rpx;
}
}
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -9,6 +9,7 @@ import './myGoodList.scss'
import loginExpired from '../../util/loginExpired';
import onClickValueService from '../../util/onClickValueService';
import { getGlobalStorage } from '../../util/getSetStoage';
import platformChecker from '../../util/plaformChecker'
class MyGoodList extends Component {
@ -144,7 +145,8 @@ class MyGoodList extends Component {
}
}).then(res => {
Taro.hideLoading()
const data = JSON.parse(res.data)
console.log('res',res)
const data = platformChecker()? JSON.parse(res.data):res.data
if (data.err_code === 88888) {
loginExpired(data)

View File

@ -466,13 +466,13 @@ class MyGoodsEdit extends Component {
</View>
{/* 店铺分类 */}
{platformChecker() ? <View className='ShopTypeInteractionComp-wrapper'>
{platformChecker() ?
<ShopTypeInteractionComp url={URL.GetShopCategoryList}
shopId={getGlobalStorage('shopInfo') ? getGlobalStorage('shopInfo').shop_id : ''}
selectedValue={this.state.shopTypeSelected}
onPassDataToChild={this.getDataFromShopChild.bind(this)
}></ShopTypeInteractionComp>
</View> : <AliShopTypeInteraction url={URL.GetShopCategoryList}
: <AliShopTypeInteraction url={URL.GetShopCategoryList}
shopId={getGlobalStorage('shopInfo') ? getGlobalStorage('shopInfo').shop_id : ''}
selectedValue={this.state.shopTypeSelected}
onPassDataToChild={this.getDataFromShopChild.bind(this)}
@ -487,13 +487,20 @@ class MyGoodsEdit extends Component {
<Text className='require'></Text>
<Text className='title'>商品简介:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.productDescript}
onChange={this.productDescriptChange.bind(this)}
maxlength='140'
placeholder='你的产品简介'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.productDescriptChange.bind(this)}
value={this.state.contactAddress}
placeholder="你的产品简介"
maxlength='140' /></View>
}
</View>
<View className='button-box' >
<View className='button' >

View File

@ -3,7 +3,7 @@ $themeColor:#FF7142;
.goods-category{
padding-top: 10px;
padding: 10px 20px;
.border-box{
border-bottom: 1Px solid #d6e4ef;
@ -11,16 +11,14 @@ $themeColor:#FF7142;
.at-input__container{
color:black;
font-weight: bold;
// padding-left: 20px;
// padding-right: 20px;
.at-input__input{
font-weight: normal
}
}
.img-box{
margin-top:10Px;
padding-left: 20px;
padding-right: 20px;
.img-container{
border: 1Px solid #d6e4ef;
border-radius:8rpx;
@ -33,8 +31,7 @@ $themeColor:#FF7142;
}
.description-box{
margin-top:10Px;
padding-left: 20px;
padding-right: 20px;
}
}
@ -103,15 +100,21 @@ $themeColor:#FF7142;
.input-box{
border-bottom: 1Px solid #d6e4ef;
display: flex;
padding-left: 20px;
padding-right: 20px;
}
.require{
color:red;
line-height:100rpx;
}
.ShopTypeInteractionComp-wrapper{
padding-left: 20px;
padding-right: 20px;
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -5,6 +5,8 @@ import { AtInput, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction
import URL from '../../serviceAPI.config'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
import AliIndustryTypeInteraction from '../../component/aliIndustryTypeInteraction/aliIndustryTypeInteraction'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import LoginService from '../../util/LoginService'
@ -14,6 +16,7 @@ import onClickValueService from '../../util/onClickValueService';
import { getGlobalStorage } from '../../util/getSetStoage';
import { showLoading } from '../../util/hideShowLoading';
import { isUserLogin } from '../../util/checkLogin';
import platformChecker from '../../util/plaformChecker';
class MyNeeds extends Component {
@ -392,7 +395,7 @@ class MyNeeds extends Component {
/>
</View>
{/* 开始和结束日期 */}
<View className='page-section'>
<View className='page-section-picker'>
<View className='picker-box'>
<View className='picker-wrapper'>
<Picker mode='date' className='picker-container' onChange={this.onStartDateChange}>
@ -416,7 +419,14 @@ class MyNeeds extends Component {
</View>
</View>
{/* 行业分类开始 */}
{/* 行业分类 */}
{platformChecker() ? <View className='InteractionComponent-wrapper'>
<InteractionComponent url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)} selectedValue={this.state.industryTypeSelected}></InteractionComponent>
</View> : <AliIndustryTypeInteraction url={URL.GetIndustryTypeList}
onPassDataToChild={this.getDataFromChild.bind(this)}
selectedValue={this.state.industryTypeSelected} />}
{/* 行业分类结束 */}
{/* 需求类型 */}
<View className='page-section'>

View File

@ -64,6 +64,47 @@ $themeColor:#FF7142;
margin-left: 10%
}
}
}
}
.page-section-picker{
.picker{
// padding: 24rpx 0;
.selected{
font-weight: normal;
display: inline-block;
margin-left: 20%;
font-size: 32rpx
}
.date{
margin-left: 0%
}
.title-box{
line-height:100rpx;
font-weight: bold;
.title{
//color: #333;
line-height:100rpx;
margin-right:16rpx;
width:172rpx;
font-size:32rpx;
vertical-align:middle;
text-align:left;
font-weight: bold;
}
.first-col{
font-weight: normal;
margin-left: 10%
}
.second-col{
font-weight: normal;
display: inline-block;
margin-left: 10%
}
}
}
}
@ -102,7 +143,6 @@ $themeColor:#FF7142;
}
.info-box{
.needs-box{
margin-top: 10px;
border: 3rpx solid #ddd;

View File

@ -373,12 +373,12 @@ class MyNeedsEdit extends Component {
<View className='supply-demand'>
{deleteModalWindowElement}
{/* 行业分类 */}
{platformChecker() ? <View className='InteractionComponent-wrapper'>
<InteractionComponent url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)} selectedValue={this.state.industryTypeSelected} ></InteractionComponent></View>
{platformChecker() ?
<InteractionComponent url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)} selectedValue={this.state.industryTypeSelected} ></InteractionComponent>
: <AliIndustryTypeInteraction url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)} selectedValue={this.state.industryTypeSelected} />}
{/* 需求类型 */}
<View className='padding-wrapper'>
<View className='page-section'>
<View>
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.needsTypeChange.bind(this)}>
@ -432,24 +432,38 @@ class MyNeedsEdit extends Component {
<View className='title-box'>
<Text className='title'>联系地址:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.contactAddress}
onChange={this.contactAddressChange.bind(this)}
maxlength='140'
placeholder='联系地址'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contactAddressChange.bind(this)}
value={this.state.contactAddress}
placeholder="联系地址"
maxlength='140' /></View>
}
</View>
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'><Text className='require'>*</Text>:</Text>
</View>
<AtTextarea
{platformChecker() ?<AtTextarea
value={this.state.content}
onChange={this.contentChange.bind(this)}
maxlength='140'
placeholder=''
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contentChange.bind(this)}
value={this.state.content}
placeholder=""
maxlength='140' /></View>
}
</View>
<View className='img-box'>
<View className='title-box'>
@ -508,7 +522,7 @@ class MyNeedsEdit extends Component {
<CopyrightComponent></CopyrightComponent>
</View>
</View>
)
}
}

View File

@ -1,15 +1,7 @@
$themeColor:#FF7142;
.supply-demand{
padding: 10px ;
.padding-wrapper{
padding-left: 20px;
padding-right: 20px;
}
.InteractionComponent-wrapper{
padding-left: 20px;
padding-right: 20px;
}
padding: 10px 20px;
.border-box{
border-bottom: 1Px solid #d6e4ef;
display: flex
@ -84,3 +76,13 @@ $themeColor:#FF7142;
line-height:100rpx;
}
}
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -299,14 +299,14 @@ class MyNeedsPublish extends Component {
{/* 行业分类 */}
{/* 需求类型 */}
{platformChecker() ? <View className='InteractionComponent-wrapper'><InteractionComponent url={URL.GetIndustryTypeList}
onPassDataToChild={this.getDataFromChild.bind(this)}
selectedValue={this.state.industryTypeSelected}
></InteractionComponent></View> : <AliIndustryTypeInteraction url={URL.GetIndustryTypeList}
onPassDataToChild={this.getDataFromChild.bind(this)}
selectedValue={this.state.industryTypeSelected} />}
<View className='padding-wrapper'> <View className='page-section'>
<View className='page-section'>
<View>
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.needsTypeHandler.bind(this)}>
<View className='picker'>
@ -340,7 +340,18 @@ class MyNeedsPublish extends Component {
onChange={this.contactNameChange.bind(this)}
/>
</View>
<View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
<View className='input-box'>
<Text className='require'>*</Text>
<AtInput
name='value'
title='联系电话:'
type='number'
value={this.state.contactNumber}
border={false}
onChange={this.contactNumberChange.bind(this)}
/>
</View>
{/* <View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
<View className='title' style='font-weight:bold;'>
<Text style='color:red'>*</Text>
<Text>联系电话</Text>
@ -352,31 +363,38 @@ class MyNeedsPublish extends Component {
value={this.state.contactNumber}
onInput={this.contactNumberChange.bind(this)}
/></View>
</View>
</View> */}
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'>联系地址:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.contactAddress}
onChange={this.contactAddressChange.bind(this)}
maxlength='140'
placeholder='联系地址'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area' onInput={this.contactAddressChange.bind(this)} value={this.state.contactAddress} placeholder="联系地址" maxlength='140' /></View>
}
</View>
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'><Text className='require'>*</Text>:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.content}
onChange={this.contentChange.bind(this)}
maxlength='140'
placeholder=''
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area' onInput={this.contentChange.bind(this)} value={this.state.content} maxlength='140' /></View>
}
</View>
@ -429,7 +447,7 @@ class MyNeedsPublish extends Component {
<CopyrightComponent></CopyrightComponent>
</View>
</View>
)
}
}

View File

@ -1,15 +1,9 @@
$themeColor:#FF7142;
.supply-demand{
padding: 10px ;
.padding-wrapper{
padding-left: 20px;
padding-right: 20px;
}
.InteractionComponent-wrapper{
padding-left: 20px;
padding-right: 20px;
}
padding: 10px 20px ;
.border-box{
border-bottom: 1Px solid #d6e4ef;
display: flex
@ -84,3 +78,13 @@ $themeColor:#FF7142;
line-height:100rpx;
}
}
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -315,7 +315,18 @@ class SupplyDemand extends Component {
border={false}
/>
</View>
<View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
<View className='input-box'>
<Text className='require'>*</Text>
<AtInput
name='value'
title='联系电话:'
type='number'
value={this.state.contactNumber}
onChange={this.contactNumberChange.bind(this)}
border={false}
/>
</View>
{/* <View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
<View className='title' style='font-weight:bold;'>
<Text style='color:red'>*</Text>
<Text>联系电话</Text>
@ -327,30 +338,44 @@ class SupplyDemand extends Component {
value={this.state.contactNumber}
onInput={this.contactNumberChange.bind(this)}
/></View>
</View>
</View> */}
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'>联系地址:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.contactAddress}
onChange={this.contactAddressChange.bind(this)}
maxlength='140'
placeholder='联系地址'
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contactAddressChange.bind(this)}
value={this.state.contactAddress}
placeholder="联系地址"
maxlength='140' /></View>
}
</View>
<View className='demanding-box'>
<View className='title-box'>
<Text className='title'><Text className='require'>*</Text>:</Text>
</View>
<AtTextarea
{platformChecker() ? <AtTextarea
value={this.state.content}
onChange={this.contentChange.bind(this)}
maxlength='140'
placeholder=''
/>
/> : <View className='textarea-wrapper'>
<textarea className='text-area'
onInput={this.contentChange.bind(this)}
value={this.state.content}
placeholder=""
maxlength='140' /></View>
}
</View>
<View className='img-box'>
<View className='title-box'>

View File

@ -72,3 +72,13 @@ $themeColor:#FF7142;
line-height:100rpx;
}
.textarea-wrapper{
border-width: 1px;
border-style: solid;
border-color: rgb(214, 228, 239);
border-radius: 8px;
padding:5px;
.text-area{
height: 150px;
}
}

View File

@ -1,6 +1,6 @@
const LOCALURL = "http://192.168.1.230/"
// const LOCALURL = "https://www.ihome6.com/"
//const LOCALURL = "http://192.168.1.230/"
const LOCALURL = "https://www.ihome6.com/"
const URL = {
Base: LOCALURL,