修改 图标,登入转跳

This commit is contained in:
郑茂强 2019-02-15 17:20:52 +08:00
parent 7165180b39
commit 89d9c94aff
41 changed files with 191 additions and 151 deletions

View File

@ -74,12 +74,12 @@ class App extends Component {
, { , {
pagePath: "pages/myNeeds/myNeeds", pagePath: "pages/myNeeds/myNeeds",
text: "我的需求", text: "我的需求",
iconPath: "./icons/user.png", iconPath: "./icons/needs.png",
selectedIconPath: "./icons/user-actived.png" selectedIconPath: "./icons/needs-actived.png"
} }
], ],
color: '#333', color: '#333',
selectedColor: '#333', selectedColor: '#FF7142',
backgroundColor: '#fff', backgroundColor: '#fff',
borderStyle: 'black' borderStyle: 'black'
} }

View File

@ -134,24 +134,8 @@ class recommondShop extends Component {
}) })
} }
// 优惠卷弹框。取消。确认
isOpenVoucher() {
this.setState({
isOpenVoucher: true,
userName: Taro.getStorageSync('user_identity').username,
userPhone: Taro.getStorageSync('user_identity').userphone,
})
this.getVoucherInfo({})
}
voucherModalClose() {
this.setState({ isOpenVoucher: false })
}
voucherModalConfirm() {
this.setState({ isOpenVoucher: false })
this.buyConsult({ user: this.state.userName, phone: this.state.userPhone })
}
// 咨询弹框。取消。确认 // 咨询弹框。取消。确认
isOpenConsult() { isOpenConsult() {
this.setState({ this.setState({
@ -165,8 +149,23 @@ class recommondShop extends Component {
this.setState({ isOpenConsult: false }) this.setState({ isOpenConsult: false })
} }
consultModalConfirm() { consultModalConfirm() {
this.setState({ isOpenConsult: false }) if(!this.state.userName){
this.buyConsult({ user: this.state.userName, phone: this.state.userPhone }) Taro.showToast({
title: '请填写姓名',
icon: 'none',
})
}else if(!this.state.userPhone){
Taro.showToast({
title: '请填写电话',
icon: 'none',
})
}else{
this.setState({ isOpenConsult: false })
this.buyConsult({ user: this.state.userName, phone: this.state.userPhone })
}
} }
handleInputCsultName(e) { handleInputCsultName(e) {
this.setState({ userName: e.detail.value }) this.setState({ userName: e.detail.value })

View File

@ -1,7 +1,7 @@
$linearBlue:linear-gradient(to right, #337ab7, #337ab7); $linearBlue:linear-gradient(to right, #337ab7, #337ab7);
.shop-list-box{ .shop-list-box{
border: 4rpx solid #ddd; border: 2rpx solid #ddd;
border-radius: 3px; border-radius: 3px;
box-shadow: 0 5px 5px #ddd; box-shadow: 0 5px 5px #ddd;
margin-bottom: 10px; margin-bottom: 10px;
@ -26,7 +26,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7);
} }
.header{ .header{
border-bottom:4rpx solid #F2F2F2; border-bottom:2rpx solid #F2F2F2;
display: flex; display: flex;
.button-container{ .button-container{
flex:1; flex:1;
@ -100,7 +100,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7);
} }
} }
.body{ .body{
border-bottom:4rpx solid #F2F2F2; border-bottom:2rpx solid #F2F2F2;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
font-size: 35px; font-size: 35px;

View File

@ -73,12 +73,12 @@ class VoucherPoster extends Component {
if (!this.state.voucherName) { if (!this.state.voucherName) {
Taro.showToast({ Taro.showToast({
title: '请填写姓名', title: '请填写姓名',
icon: 'fail', icon: 'none',
}) })
} else if (!this.state.voucherPhone) { } else if (!this.state.voucherPhone) {
Taro.showToast({ Taro.showToast({
title: '请填写电话号码', title: '请填写电话号码',
icon: 'fail', icon: 'none',
}) })
} else { } else {
this.buyConsult({ user: this.state.voucherName, phone: this.state.voucherPhone }) this.buyConsult({ user: this.state.voucherName, phone: this.state.voucherPhone })

View File

@ -41,13 +41,15 @@ class GoodsTypeInteractionComp extends Component {
} }
}) })
.then(res => { .then(res => {
if (res.data.err_msg === 'success') { if (res.data.err_msg === 'success') {
console.log('商品分类目录', res) console.log('商品分类目录', res)
const recursionInteractionData=this.recursionInteraction(res.data.data)
this.recursionInitialized(res.data.data) //
this.setState({ this.setState({
interactionMultiArray: this.recursionInteraction(res.data.data), interactionMultiArray: recursionInteractionData,
multiIndex: this.recursionDepth(res.data.data), multiIndex: this.recursionDepth(res.data.data),
initailMultiArray: this.recursionInitialized(res.data.data).reverse() initailMultiArray:initialDataArray.reverse()
}, () => { }, () => {
initialDataArray=[]// 把全局变变量赋值给state之后初始化商品分类为空 不然第二次进去的时候会自动添加进去 initialDataArray=[]// 把全局变变量赋值给state之后初始化商品分类为空 不然第二次进去的时候会自动添加进去
// console.log('联动数据', this.state.interactionMultiArray) // console.log('联动数据', this.state.interactionMultiArray)
@ -55,7 +57,8 @@ class GoodsTypeInteractionComp extends Component {
}) // 用递归来整理无限层次的数据 }) // 用递归来整理无限层次的数据
// console.log('联动数据', this.recursionInteraction(res.data.data))
// console.log('初始数据', this.recursionInitialized(res.data.data).reverse())
} else { } else {
Taro.showToast({ Taro.showToast({
title: res.data.err_msg, title: res.data.err_msg,
@ -74,14 +77,16 @@ class GoodsTypeInteractionComp extends Component {
//联动确认 //联动确认
bindMultiPickerChange(e) { bindMultiPickerChange(e) {
console.log('e', e) // 如果没有上商品 那就不执行
this.setState({ if(Taro.getStorageSync('shopInfo').shop_id){
multiIndex: e.detail.value.map(item => { if (item === null) { item = 0 } return item }) this.setState({
}, () => { multiIndex: e.detail.value.map(item => { if (item === null) { item = 0 } return item })
// console.log('picker发送选择改变携带值为', this.state.multiIndex) }, () => {
this.returnResultToParent() // console.log('picker发送选择改变携带值为', this.state.multiIndex)
this.returnResultToParent()
})
})
}
} }
returnResultToParent() { returnResultToParent() {
let selected = this.state.interactionMultiArray let selected = this.state.interactionMultiArray
@ -94,6 +99,22 @@ class GoodsTypeInteractionComp extends Component {
} }
} }
} }
// 递归整理无限层初始数据,将整理好的数据赋值给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
}
// 递归整理无限层联动数据 // 递归整理无限层联动数据
@ -111,20 +132,21 @@ class GoodsTypeInteractionComp extends Component {
// return arrayTem // return arrayTem
} }
// 递归整理无限层初始数据 // 递归整理无限层初始数据
recursionInitialized(data) { // recursionInitialized(data) {
const arrayTem = [] // const arrayTem = []
const childrenHolderArray = [] // const childrenHolderArray = []
if (data.length) { // if (data.length) {
for (let item of data) { // for (let item of data) {
arrayTem.push({ name: item.class_name, id: item.class_id }) // arrayTem.push({ name: item.class_name, id: item.class_id })
item.children ? childrenHolderArray.push(...item.children) : null // item.children ? childrenHolderArray.push(...item.children) : null
} // }
this.recursionInitialized(childrenHolderArray) // this.recursionInitialized(childrenHolderArray)
} // }
arrayTem.length ? initialDataArray.push(arrayTem) : null // 数组为空则不添加 // arrayTem.length ? initialDataArray.push(arrayTem) : null // 数组为空则不添加
return initialDataArray // return initialDataArray
} // }
// 递归整理无限层初始数据 // 递归整理无限层初始数据
recursionDepth(data) { recursionDepth(data) {
const arrayTem = [] const arrayTem = []
@ -180,9 +202,6 @@ class GoodsTypeInteractionComp extends Component {
} }
} }
// switch (e.detail.column) {// 移动了第几列 // switch (e.detail.column) {// 移动了第几列
// case 0: // case 0:
// switch (data.multiIndex[0]) { // 第一个index 是多少 // switch (data.multiIndex[0]) { // 第一个index 是多少
@ -292,13 +311,14 @@ class GoodsTypeInteractionComp extends Component {
this.setState({ multiIndex: data.multiIndex }) this.setState({ multiIndex: data.multiIndex })
} }
componentDidMount() { componentDidMount() {
this.getProductCateList(this.props.url)
if(Taro.getStorageSync('shopInfo').shop_id){
this.getProductCateList(this.props.url)
}else{
}
} }
// 当然父组件有新的props的 会从新渲染组件 // 当然父组件有新的props的 会从新渲染组件
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
@ -314,7 +334,6 @@ class GoodsTypeInteractionComp extends Component {
return ( return (
<View class='page-section'> <View class='page-section'>
<Picker <Picker
rangeKey='name' rangeKey='name'
mode='multiSelector' mode='multiSelector'
onChange={this.bindMultiPickerChange.bind(this)} onChange={this.bindMultiPickerChange.bind(this)}

View File

@ -43,9 +43,8 @@ class Interaction extends Component {
console.log('行业分类目录', res) console.log('行业分类目录', res)
let initailMultiArray = this.recursionInitialized(res.data.data) let initailMultiArray = this.recursionInitialized(res.data.data)
initialDataArray[1].unshift({ name: '全部', id: '-1' }) // 默认 initialDataArray[1].unshift({ name: '全部', id: '-1' }) // 默认
this.setState({ this.setState({
initailMultiArray: initailMultiArray.reverse(), initailMultiArray: [initailMultiArray[1]], //initailMultiArray.reverse(),
interactionMultiArray: [{ name: '全部', id: '-1', children: [{ name: '', id: '' }] }, ...this.recursionInteraction(res.data.data)], interactionMultiArray: [{ name: '全部', id: '-1', children: [{ name: '', id: '' }] }, ...this.recursionInteraction(res.data.data)],
multiIndex: this.recursionDepth(res.data.data), multiIndex: this.recursionDepth(res.data.data),

View File

@ -41,8 +41,8 @@ class ShopTypeInteractionComp extends Component {
// this.formatIndustryType(res.data.data) // this.formatIndustryType(res.data.data)
// this.formatIndustTypeInit(res.data.data) // this.formatIndustTypeInit(res.data.data)
if (res.data.err_msg === 'success') { if (res.data.err_msg === 'success') {
if(res.data.data===null){ if (res.data.data === null) {
return return
} }
console.log('店铺分类目录', res) console.log('店铺分类目录', res)
this.setState({ this.setState({
@ -50,10 +50,10 @@ class ShopTypeInteractionComp extends Component {
initailMultiArray: this.recursionInitialized(res.data.data) initailMultiArray: this.recursionInitialized(res.data.data)
}, () => { }, () => {
// this.passDataToParent(this.state.initailMultiArray) // this.passDataToParent(this.state.initailMultiArray)
//返回初始选项在 在商品编辑页面 //返回初始选项在 在商品编辑页面
if(this.props.shopTypeId){ if (this.props.shopTypeId) {
const foundData=this.findDataByShopTypeId(this.props.shopTypeId) const foundData = this.findDataByShopTypeId(this.props.shopTypeId)
this.passDataToParent(foundData) this.passDataToParent(foundData)
} }
@ -73,12 +73,12 @@ class ShopTypeInteractionComp extends Component {
}) })
} }
findDataByShopTypeId() { findDataByShopTypeId() {
console.log('id', this.props.shopTypeId,this.state.initailMultiArray) console.log('id', this.props.shopTypeId, this.state.initailMultiArray)
let result='' let result = ''
this.state.initailMultiArray.forEach(items => { this.state.initailMultiArray.forEach(items => {
items.forEach(item => { items.forEach(item => {
if (item.id === this.props.shopTypeId) { if (item.id === this.props.shopTypeId) {
result =item result = item
} }
}) })
}) })
@ -135,14 +135,18 @@ class ShopTypeInteractionComp extends Component {
} }
bindMultiPickerChange(e) { bindMultiPickerChange(e) {
// console.log('picker发送选择改变携带值为', e.detail.value) // console.log('picker发送选择改变携带值为', e.detail.value)
this.setState({ if (Taro.getStorageSync('shopInfo').shop_id) {
multiIndex: e.detail.value, this.setState({
}, () => { multiIndex: e.detail.value,
//判断如果interactionMultiArray 的子类为空 那就取父类, 反之取子类 }, () => {
let industryTypeSelected //判断如果interactionMultiArray 的子类为空 那就取父类, 反之取子类
industryTypeSelected = this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]] let industryTypeSelected
this.passDataToParent(industryTypeSelected) industryTypeSelected = this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]]
}) this.passDataToParent(industryTypeSelected)
})
}
} }
@ -159,8 +163,8 @@ class ShopTypeInteractionComp extends Component {
// 当然父组件有新的props的 会从新渲染组件 // 当然父组件有新的props的 会从新渲染组件
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
} }
componentWillUnmount() { } componentWillUnmount() { }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

After

Width:  |  Height:  |  Size: 512 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
src/icons/needs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/icons/needs1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

View File

@ -31,7 +31,6 @@ class AllDemanding extends Component {
grabOrderId: '',//抢到订单的id grabOrderId: '',//抢到订单的id
isGrabOrderSuccess: false,// 是否显示轻提示 isGrabOrderSuccess: false,// 是否显示轻提示
grabOrderSuccess: '无法显示绑定后的字段',// 抢单成功返回字段 grabOrderSuccess: '无法显示绑定后的字段',// 抢单成功返回字段
currentPage: 1,
isAddToList: false,// / 请求业主需求的时候是否添加到旧列表里 isAddToList: false,// / 请求业主需求的时候是否添加到旧列表里
isShowTopNav: false,// 是否显示返回顶部按钮 isShowTopNav: false,// 是否显示返回顶部按钮
loadMorePageIndex: 1 loadMorePageIndex: 1
@ -86,10 +85,10 @@ class AllDemanding extends Component {
title: '没有更多了', title: '没有更多了',
icon: 'none' icon: 'none'
}) })
}else{ } else {
this.setState({ supplys:[]}) this.setState({ supplys: [] })
} }
} }
} else { } else {
Taro.showToast({ Taro.showToast({
@ -98,7 +97,7 @@ class AllDemanding extends Component {
duration: 1500 duration: 1500
}) })
} }
this.setState({ isAddToList: false }) this.setState({ isAddToList: false })
}) })
} }
@ -141,14 +140,19 @@ class AllDemanding extends Component {
} }
}) })
.then(res => { .then(res => {
let textTip = res.data.err_msg if (res.data.err_code === 0) {
this.setState({ grabOrderSuccess: textTip, isGrabOrderSuccess: true }, () => { Taro.showToast({
setTimeout(() => { title: res.data.err_msg === 'success' ? '抢单成功' : res.data.err_msg,
icon: res.data.err_msg === 'success' ? 'success' : 'none'
})
this.searchDemanding({ curr_page:1 })
} else {
Taro.showToast({
title: res.data.err_msg,
icon: 'none'
})
}
this.setState({ isGrabOrderSuccess: false })
}, 2000)
})
console.log('抢单请求:', res) console.log('抢单请求:', res)
}) })
@ -164,7 +168,6 @@ class AllDemanding extends Component {
} }
handleGrabConfirm() { handleGrabConfirm() {
this.setState({ isOpenedGrabModal: false }) this.setState({ isOpenedGrabModal: false })
this.GrabDemand({ demandId: this.state.grabOrderId }) this.GrabDemand({ demandId: this.state.grabOrderId })
} }
searchHanlder() { searchHanlder() {
@ -194,10 +197,10 @@ class AllDemanding extends Component {
goToGrabOrderPage(orderId) { goToGrabOrderPage(orderId) {
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId
}) })
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(this.props, nextProps) console.log(this.props, nextProps)
@ -248,12 +251,7 @@ class AllDemanding extends Component {
</AtModalContent> </AtModalContent>
<AtModalAction> <Button onClick={this.handleGrabModalCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleGrabConfirm.bind(this)}></Button> </AtModalAction> <AtModalAction> <Button onClick={this.handleGrabModalCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleGrabConfirm.bind(this)}></Button> </AtModalAction>
</AtModal> </AtModal>
// 抢单返回轻提示
const grabOrderSuccessElement = <AtToast
isOpened={this.state.isGrabOrderSuccess}
text={this.state.grabOrderSuccess}
duration={2000}
></AtToast>
const allDemandingElementArray = this.state.supplys.length ? this.state.supplys.map((item, index) => { const allDemandingElementArray = this.state.supplys.length ? this.state.supplys.map((item, index) => {
return <View className='demanding-info' key={index}> return <View className='demanding-info' key={index}>
<View className='header'> <View className='header'>
@ -267,7 +265,7 @@ class AllDemanding extends Component {
</View> </View>
</View> </View>
<View className='body'> <View className='body'>
<View className='image-container' onClick={this.goToGrabOrderPage.bind(this,item.sd_id)}> <View className='image-container' onClick={this.goToGrabOrderPage.bind(this, item.sd_id)}>
<Image style='width:100%;height:100%' src={URL.Base + item.file_path[0].thumb_path} /> <Image style='width:100%;height:100%' src={URL.Base + item.file_path[0].thumb_path} />
</View> </View>
<View className='detail'> <View className='detail'>
@ -293,8 +291,7 @@ class AllDemanding extends Component {
<View className='allDemanding'> <View className='allDemanding'>
{/* 模态框 */} {/* 模态框 */}
{modalMessageGrabElement} {modalMessageGrabElement}
{/* 轻提示 */}
{grabOrderSuccessElement}
<View className='page-section'> <View className='page-section'>
{/* 供求状态选择 */} {/* 供求状态选择 */}
<View> <View>

View File

@ -307,8 +307,6 @@ class GoodsPublish extends Component {
} }
} }
componentDidMount() { componentDidMount() {
// this.getProductCateList()
// this.getShopCateList()
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
@ -318,7 +316,12 @@ class GoodsPublish extends Component {
componentWillUnmount() { } componentWillUnmount() { }
componentDidShow() { componentDidShow() {
if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){
Taro.showToast({
title:'您还没有店铺,不能使用该功能,快去申请吧',
icon:'none'
})
}
} }
componentDidHide() { } componentDidHide() { }

View File

@ -236,12 +236,12 @@ class GrabOrderPage extends Component {
新增</Button> 新增</Button>
</View> </View>
<View className='button' onClick={this.goToMyNeedsPage.bind(this)}> <View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
<Button size='mini' className='button-green'> <Button size='mini' className='button-orange'>
<AtIcon value='' size='12' color='white'></AtIcon> <AtIcon value='' size='12' color='white'></AtIcon>
我的需求</Button> 我的需求</Button>
</View> </View>
<View className='button' onClick={this.goMyNeedEditPage.bind(this)}> <View className='button' onClick={this.goMyNeedEditPage.bind(this)}>
<Button size='mini' className='button-orange'> <Button size='mini' className='button-blue'>
<AtIcon value='settings' size='12' color='white'></AtIcon> <AtIcon value='settings' size='12' color='white'></AtIcon>
修改</Button> 修改</Button>
</View> </View>
@ -260,7 +260,7 @@ class GrabOrderPage extends Component {
新增</Button> 新增</Button>
</View> </View>
<View className='button' onClick={this.goToMyNeedsPage.bind(this)}> <View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
<Button size='mini' className='button-green'> <Button size='mini' className='button-orange'>
<AtIcon value='' size='12' color='white'></AtIcon> <AtIcon value='' size='12' color='white'></AtIcon>
我的需求</Button> 我的需求</Button>
</View> </View>

View File

@ -16,7 +16,7 @@
.image-wrapper{ .image-wrapper{
display: flex; display: flex;
justify-content:center; justify-content:center;
border: 4rpx solid #ddd; border: 2rpx solid #ddd;
margin-top: 10px margin-top: 10px
} }
@ -33,7 +33,7 @@
.button{ .button{
text-align: center; text-align: center;
.button-orange,.button-green,.button-dark-red{ .button-orange,.button-green,.button-dark-red,.button-blue{
font-size: 27rpx font-size: 27rpx
} }
} }

View File

@ -61,7 +61,7 @@ class RenderingView extends Component {
onClose={this.onCloseCurtain.bind(this)} onClose={this.onCloseCurtain.bind(this)}
> >
<Image <Image
style='width:100%;height:250px' style='width:100%;max-height:100%'
src={this.state.image} src={this.state.image}
/> />
</AtCurtain> </AtCurtain>
@ -70,7 +70,6 @@ class RenderingView extends Component {
{curtainElement} {curtainElement}
{renderingElementArray} {renderingElementArray}
</View> </View>
) )
} }
} }

View File

@ -2,9 +2,9 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
border: 4rpx solid #ddd; border:2rpx solid #ddd;
.image-wrapper{ .image-wrapper{
border: 4rpx solid #ddd; border: 2rpx solid #ddd;
margin-top: 10px; margin-top: 10px;
box-sizing: border-box; box-sizing: border-box;
width: 30%; width: 30%;

View File

@ -107,9 +107,9 @@ class Home extends Component {
.then(res => { .then(res => {
console.log('所有店铺的信息', res) console.log('所有店铺的信息', res)
Taro.hideLoading() Taro.hideLoading()
if (res.data.err_msg === 'success') { if (res.data.err_code === 0) {
if (this.state.isAddToList) { if (this.state.isAddToList) {
if (res.data.shops.length) { if (res.data.shops) {
this.setState({ shops: this.state.shops.concat(res.data.shops), isAddToList: false }) this.setState({ shops: this.state.shops.concat(res.data.shops), isAddToList: false })
} else { } else {
Taro.showToast({ Taro.showToast({
@ -191,7 +191,6 @@ class Home extends Component {
}) })
console.log('item', item) console.log('item', item)
this.setState({ parentClass: item.class_id, childClass: item.class_id, supplyLevel: 1, subCate: item.children || [] }, () => { this.setState({ parentClass: item.class_id, childClass: item.class_id, supplyLevel: 1, subCate: item.children || [] }, () => {
console.log('parentClass', this.state.parentClass, this.state.childClass)
this.getShops({}) this.getShops({})
}) })
@ -255,8 +254,9 @@ class Home extends Component {
}) })
} }
goToMyNeedsPublish() { goToMyNeedsPublish() {
// 传参数给myNeedsPublish页面- 显示效果图选项
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/myNeedsPublish/myNeedsPublish' url: '/pages/myNeedsPublish/myNeedsPublish?id=1'
}) })
} }
@ -384,7 +384,7 @@ class Home extends Component {
shop={item} shop={item}
key={index} key={index}
></FilteredShopComponent> ></FilteredShopComponent>
}) : <View className='no-more-title'> 没有更多了</View> }) : <View className='no-more-title top'> 没有更多了</View>
const subCateElementsArray = this.state.subCate.length ? this.state.subCate.map((item, index) => { const subCateElementsArray = this.state.subCate.length ? this.state.subCate.map((item, index) => {
return <SwiperItem key={index} onClick={this.onClickChildCate.bind(this, item)}> return <SwiperItem key={index} onClick={this.onClickChildCate.bind(this, item)}>
<View className='text'>{item.class_name}</View> <View className='text'>{item.class_name}</View>

View File

@ -49,7 +49,7 @@ $themeColor: #FF7142;
.customer-demanding{ .customer-demanding{
padding:0 20px; padding:0 20px;
.demanding-item{ .demanding-item{
border: 3rpx solid #ddd; border: 2rpx solid #ddd;
border-right:0px; border-right:0px;
text-align: center; text-align: center;
.item-tag{ .item-tag{
@ -98,7 +98,7 @@ $themeColor: #FF7142;
} }
.last{ .last{
border-right: 3rpx solid #ddd; border-right: 2rpx solid #ddd;
} }
} }
@ -111,6 +111,9 @@ $themeColor: #FF7142;
} }
} }
.top{
margin-top: 250px;
}
.gap{ .gap{
height:150px; height:150px;
@ -159,4 +162,4 @@ $themeColor: #FF7142;
.swiper-sub{ .swiper-sub{
margin-bottom: 0px; margin-bottom: 0px;
} }

View File

@ -135,9 +135,7 @@ class Login extends Component {
<View className='password'> <View className='password'>
<Input type='password' name='password' placeholder='请输入密码' value={this.state.password} onInput={this.passwordHandler} /> <Input type='password' name='password' placeholder='请输入密码' value={this.state.password} onInput={this.passwordHandler} />
</View> </View>
<Text className='register'>
立即注册
</Text>
<Button className='button button-orange' onClick={this.loginHandler}>登录</Button> <Button className='button button-orange' onClick={this.loginHandler}>登录</Button>
</View> </View>
</View> </View>

View File

@ -267,7 +267,7 @@ class MyDemandSupplyEdit extends Component {
this.setState({ contactName: event }) this.setState({ contactName: event })
} }
contactNumberChange(event) { contactNumberChange(event) {
this.setState({ contactNumber: event }) this.setState({ contactNumber: event.detail.value })
} }
contactAddressChange(event) { contactAddressChange(event) {
this.setState({ contactAddress: event.target.value }) this.setState({ contactAddress: event.target.value })
@ -345,7 +345,7 @@ class MyDemandSupplyEdit extends Component {
componentDidHide() { } componentDidHide() { }
render() { render() {
// 提示模态弹窗element // 提示模态弹窗element
const modalMessageConfirmElement = <AtModal isOpened={this.state.isConfirmWindow}> const modalMessageConfirmElement = <AtModal isOpened={this.state.isConfirmWindow}>
<AtModalHeader>提示</AtModalHeader> <AtModalHeader>提示</AtModalHeader>
@ -403,7 +403,7 @@ class MyDemandSupplyEdit extends Component {
maxLength='11' maxLength='11'
type='number' type='number'
value={this.state.contactNumber} value={this.state.contactNumber}
onInput={this.handleInputCsultName.bind(this)} onInput={this.contactNumberChange.bind(this)}
/></View> /></View>
</View> </View>
<View className='demanding-box'> <View className='demanding-box'>

View File

@ -120,10 +120,19 @@ class MyNeeds extends Component {
} }
} else { } else {
Taro.showToast({ if(JSON.parse(res.data).err_code===88888){
title: res.data.err_msg, Taro.showToast({
icon: 'none' title: JSON.parse(res.data).err_msg,
}) icon: 'none'
})
}else{
Taro.showToast({
title: res.data.err_msg,
icon: 'none'
})
}
} }
}) })
@ -184,12 +193,7 @@ class MyNeeds extends Component {
class_id: this.state.industryTypeSelected.id === '-1' ? '' : this.state.industryTypeSelected.id, class_id: this.state.industryTypeSelected.id === '-1' ? '' : this.state.industryTypeSelected.id,
state: this.state.needsStateSelected.id state: this.state.needsStateSelected.id
}) })
}) })
}) })
} }

View File

@ -252,6 +252,12 @@ class MyNeedsPublish extends Component {
// console.log('this.$router.params.sdId',this.$router.params.sdId) // console.log('this.$router.params.sdId',this.$router.params.sdId)
// Taro.showLoading({title:'加载中'}) // Taro.showLoading({title:'加载中'})
// this.getSupplyDemandInfo() // this.getSupplyDemandInfo()
// 如果路由参数为1 就默认显示 效果图,反之 显示业主需求
const isRenderingPic=this.$router.params.id
console.log(parseInt(isRenderingPic))
if(parseInt(isRenderingPic)){
this.setState({needsTypeSelected:{ name: '效果图', id: '5' }})
}
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(this.props, nextProps) console.log(this.props, nextProps)

View File

@ -28,6 +28,6 @@ $themeColor:#FF7142;
} }
} }
.image-wrapper{ .image-wrapper{
border: 4rpx solid #ddd; border: 2rpx solid #ddd;
margin-top: 10px margin-top: 10px
} }

View File

@ -267,6 +267,12 @@ class MySupplyDemand extends Component {
LoginService() LoginService()
return return
} }
if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){
Taro.showToast({
title:'您还没有店铺,不能使用该功能,快去申请吧',
icon:'none'
})
}
} }
componentDidHide() { } componentDidHide() { }

View File

@ -34,9 +34,6 @@ class SupplyDemand extends Component {
} }
} }
// 这个需要写一个uploadDemSup 上传供求 的api // 这个需要写一个uploadDemSup 上传供求 的api
uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id, uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id,
sd_title = this.state.title, sd_title = this.state.title,
@ -264,6 +261,12 @@ class SupplyDemand extends Component {
LoginService() LoginService()
return return
} }
if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){
Taro.showToast({
title:'您还没有店铺,不能使用该功能,快去申请吧',
icon:'none'
})
}
} }
componentDidHide() { } componentDidHide() { }

View File

@ -220,12 +220,12 @@ class SupplyDemandView extends Component {
<View className='button-box'> <View className='button-box'>
<View className='button' onClick={this.goToSDPublishPage.bind(this)}> <View className='button' onClick={this.goToSDPublishPage.bind(this)}>
<Button className='button-orange' size='mini'> <Button className='button-green' size='mini' >
<AtIcon value='add' size='12' color='white'></AtIcon> <AtIcon value='add' size='12' color='white'></AtIcon>
新增</Button> 新增</Button>
</View> </View>
<View className='button' onClick={this.goToMyDSEditPage.bind(this)}> <View className='button' onClick={this.goToMyDSEditPage.bind(this)}>
<Button className='button-orange' size='mini'> <Button className='button-blue' size='mini'>
<AtIcon value='settings' size='12' color='white'></AtIcon> <AtIcon value='settings' size='12' color='white'></AtIcon>
修改</Button> 修改</Button>
</View> </View>

View File

@ -19,12 +19,12 @@ $themeColor:#FF7142;
flex-wrap: nowrap; flex-wrap: nowrap;
flex-direction: row; flex-direction: row;
margin: 40px 0 0; margin: 40px 0 0;
justify-content: space-around;
.button{ .button{
flex:1; // flex:1;
text-align: center; text-align: center;
.button-orange,.button-green,.button-dark-red{ .button-orange,.button-green,.button-dark-red,.button-blue{
font-size: 27rpx font-size: 27rpx
} }
} }

BIN
weapp.rar Normal file

Binary file not shown.