diff --git a/src/app.js b/src/app.js index 96898aa..c049a7b 100644 --- a/src/app.js +++ b/src/app.js @@ -74,12 +74,12 @@ class App extends Component { , { pagePath: "pages/myNeeds/myNeeds", text: "我的需求", - iconPath: "./icons/user.png", - selectedIconPath: "./icons/user-actived.png" + iconPath: "./icons/needs.png", + selectedIconPath: "./icons/needs-actived.png" } ], color: '#333', - selectedColor: '#333', + selectedColor: '#FF7142', backgroundColor: '#fff', borderStyle: 'black' } diff --git a/src/component/filteredShopComponent/filteredShopComponent.js b/src/component/filteredShopComponent/filteredShopComponent.js index becf587..24cce53 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.js +++ b/src/component/filteredShopComponent/filteredShopComponent.js @@ -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() { this.setState({ @@ -165,8 +149,23 @@ class recommondShop extends Component { this.setState({ isOpenConsult: false }) } consultModalConfirm() { - this.setState({ isOpenConsult: false }) - this.buyConsult({ user: this.state.userName, phone: this.state.userPhone }) + if(!this.state.userName){ + 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) { this.setState({ userName: e.detail.value }) diff --git a/src/component/filteredShopComponent/filteredShopComponent.scss b/src/component/filteredShopComponent/filteredShopComponent.scss index 84fc1da..8612f4a 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.scss +++ b/src/component/filteredShopComponent/filteredShopComponent.scss @@ -1,7 +1,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7); .shop-list-box{ - border: 4rpx solid #ddd; + border: 2rpx solid #ddd; border-radius: 3px; box-shadow: 0 5px 5px #ddd; margin-bottom: 10px; @@ -26,7 +26,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7); } .header{ - border-bottom:4rpx solid #F2F2F2; + border-bottom:2rpx solid #F2F2F2; display: flex; .button-container{ flex:1; @@ -100,7 +100,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7); } } .body{ - border-bottom:4rpx solid #F2F2F2; + border-bottom:2rpx solid #F2F2F2; display: flex; flex-wrap: nowrap; font-size: 35px; diff --git a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js index b4696dd..7c19883 100644 --- a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js +++ b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js @@ -73,12 +73,12 @@ class VoucherPoster extends Component { if (!this.state.voucherName) { Taro.showToast({ title: '请填写姓名', - icon: 'fail', + icon: 'none', }) } else if (!this.state.voucherPhone) { Taro.showToast({ title: '请填写电话号码', - icon: 'fail', + icon: 'none', }) } else { this.buyConsult({ user: this.state.voucherName, phone: this.state.voucherPhone }) diff --git a/src/component/goodsTypeInteractionComp/goodsTypeInteractionComp.js b/src/component/goodsTypeInteractionComp/goodsTypeInteractionComp.js index c621152..3c7b942 100644 --- a/src/component/goodsTypeInteractionComp/goodsTypeInteractionComp.js +++ b/src/component/goodsTypeInteractionComp/goodsTypeInteractionComp.js @@ -41,13 +41,15 @@ class GoodsTypeInteractionComp extends Component { } }) .then(res => { + if (res.data.err_msg === 'success') { console.log('商品分类目录', res) - + const recursionInteractionData=this.recursionInteraction(res.data.data) + this.recursionInitialized(res.data.data) // this.setState({ - interactionMultiArray: this.recursionInteraction(res.data.data), + interactionMultiArray: recursionInteractionData, multiIndex: this.recursionDepth(res.data.data), - initailMultiArray: this.recursionInitialized(res.data.data).reverse() + initailMultiArray:initialDataArray.reverse() }, () => { initialDataArray=[]// 把全局变变量赋值给state之后,初始化商品分类为空, 不然第二次进去的时候会自动添加进去 // 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 { Taro.showToast({ title: res.data.err_msg, @@ -74,14 +77,16 @@ class GoodsTypeInteractionComp extends Component { //联动确认 bindMultiPickerChange(e) { - console.log('e', e) - this.setState({ - multiIndex: e.detail.value.map(item => { if (item === null) { item = 0 } return item }) - }, () => { - // console.log('picker发送选择改变,携带值为', this.state.multiIndex) - this.returnResultToParent() - - }) + // 如果没有上商品 那就不执行 + if(Taro.getStorageSync('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 @@ -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 } // 递归整理无限层初始数据 - 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) - } + // 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 - } + // arrayTem.length ? initialDataArray.push(arrayTem) : null // 数组为空则不添加 + // return initialDataArray + // } + // 递归整理无限层初始数据 recursionDepth(data) { const arrayTem = [] @@ -180,9 +202,6 @@ class GoodsTypeInteractionComp extends Component { } } - - - // switch (e.detail.column) {// 移动了第几列 // case 0: // switch (data.multiIndex[0]) { // 第一个index 是多少 @@ -292,13 +311,14 @@ class GoodsTypeInteractionComp extends Component { this.setState({ multiIndex: data.multiIndex }) } - - - componentDidMount() { - this.getProductCateList(this.props.url) - + if(Taro.getStorageSync('shopInfo').shop_id){ + this.getProductCateList(this.props.url) + }else{ + + } + } // 当然父组件有新的props的 会从新渲染组件 componentWillReceiveProps(nextProps) { @@ -314,7 +334,6 @@ class GoodsTypeInteractionComp extends Component { return ( { - // this.passDataToParent(this.state.initailMultiArray) + // this.passDataToParent(this.state.initailMultiArray) //返回初始选项在 在商品编辑页面 - if(this.props.shopTypeId){ - const foundData=this.findDataByShopTypeId(this.props.shopTypeId) + if (this.props.shopTypeId) { + const foundData = this.findDataByShopTypeId(this.props.shopTypeId) this.passDataToParent(foundData) } @@ -73,12 +73,12 @@ class ShopTypeInteractionComp extends Component { }) } findDataByShopTypeId() { - console.log('id', this.props.shopTypeId,this.state.initailMultiArray) - let result='' + console.log('id', this.props.shopTypeId, this.state.initailMultiArray) + let result = '' this.state.initailMultiArray.forEach(items => { items.forEach(item => { if (item.id === this.props.shopTypeId) { - result =item + result = item } }) }) @@ -135,14 +135,18 @@ class ShopTypeInteractionComp extends Component { } bindMultiPickerChange(e) { // console.log('picker发送选择改变,携带值为', e.detail.value) - this.setState({ - multiIndex: e.detail.value, - }, () => { - //判断如果interactionMultiArray 的子类为空 那就取父类, 反之取子类 - let industryTypeSelected - industryTypeSelected = this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]] - this.passDataToParent(industryTypeSelected) - }) + if (Taro.getStorageSync('shopInfo').shop_id) { + this.setState({ + multiIndex: e.detail.value, + }, () => { + //判断如果interactionMultiArray 的子类为空 那就取父类, 反之取子类 + let 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的 会从新渲染组件 componentWillReceiveProps(nextProps) { - - + + } componentWillUnmount() { } diff --git a/src/icons/box-actived.png b/src/icons/box-actived.png index 0b56bbc..41a220c 100644 Binary files a/src/icons/box-actived.png and b/src/icons/box-actived.png differ diff --git a/src/icons/box.png b/src/icons/box.png index a9fe862..b2fdd5a 100644 Binary files a/src/icons/box.png and b/src/icons/box.png differ diff --git a/src/icons/home-actived.png b/src/icons/home-actived.png index 7324174..66e7c7a 100644 Binary files a/src/icons/home-actived.png and b/src/icons/home-actived.png differ diff --git a/src/icons/home.png b/src/icons/home.png index 92e23d9..41cd8d5 100644 Binary files a/src/icons/home.png and b/src/icons/home.png differ diff --git a/src/icons/menu-actived.png b/src/icons/menu-actived.png index 8433eae..f317c21 100644 Binary files a/src/icons/menu-actived.png and b/src/icons/menu-actived.png differ diff --git a/src/icons/menu.png b/src/icons/menu.png index b868396..6d738d3 100644 Binary files a/src/icons/menu.png and b/src/icons/menu.png differ diff --git a/src/icons/needs-actived.png b/src/icons/needs-actived.png new file mode 100644 index 0000000..013967b Binary files /dev/null and b/src/icons/needs-actived.png differ diff --git a/src/icons/needs-actived1.png b/src/icons/needs-actived1.png new file mode 100644 index 0000000..8e3a845 Binary files /dev/null and b/src/icons/needs-actived1.png differ diff --git a/src/icons/needs.png b/src/icons/needs.png new file mode 100644 index 0000000..53290f9 Binary files /dev/null and b/src/icons/needs.png differ diff --git a/src/icons/needs1.png b/src/icons/needs1.png new file mode 100644 index 0000000..5054592 Binary files /dev/null and b/src/icons/needs1.png differ diff --git a/src/icons/publish-actived.png b/src/icons/publish-actived.png index ae7574d..a1d4ccd 100644 Binary files a/src/icons/publish-actived.png and b/src/icons/publish-actived.png differ diff --git a/src/icons/publish.png b/src/icons/publish.png index d13163f..9017c30 100644 Binary files a/src/icons/publish.png and b/src/icons/publish.png differ diff --git a/src/icons/setting-actived.png b/src/icons/setting-actived.png deleted file mode 100644 index 8c03a77..0000000 Binary files a/src/icons/setting-actived.png and /dev/null differ diff --git a/src/icons/setting.png b/src/icons/setting.png deleted file mode 100644 index 34a5b5c..0000000 Binary files a/src/icons/setting.png and /dev/null differ diff --git a/src/icons/user-actived.png b/src/icons/user-actived.png deleted file mode 100644 index 08da33b..0000000 Binary files a/src/icons/user-actived.png and /dev/null differ diff --git a/src/icons/user.png b/src/icons/user.png deleted file mode 100644 index ef18f7c..0000000 Binary files a/src/icons/user.png and /dev/null differ diff --git a/src/pages/allDemanding/allDemanding.js b/src/pages/allDemanding/allDemanding.js index 910aeff..043f96f 100644 --- a/src/pages/allDemanding/allDemanding.js +++ b/src/pages/allDemanding/allDemanding.js @@ -31,7 +31,6 @@ class AllDemanding extends Component { grabOrderId: '',//抢到订单的id isGrabOrderSuccess: false,// 是否显示轻提示 grabOrderSuccess: '无法显示绑定后的字段',// 抢单成功返回字段 - currentPage: 1, isAddToList: false,// / 请求业主需求的时候是否添加到旧列表里 isShowTopNav: false,// 是否显示返回顶部按钮 loadMorePageIndex: 1 @@ -86,10 +85,10 @@ class AllDemanding extends Component { title: '没有更多了', icon: 'none' }) - }else{ - this.setState({ supplys:[]}) + } else { + this.setState({ supplys: [] }) } - + } } else { Taro.showToast({ @@ -98,7 +97,7 @@ class AllDemanding extends Component { duration: 1500 }) } - this.setState({ isAddToList: false }) + this.setState({ isAddToList: false }) }) } @@ -141,14 +140,19 @@ class AllDemanding extends Component { } }) .then(res => { - let textTip = res.data.err_msg - this.setState({ grabOrderSuccess: textTip, isGrabOrderSuccess: true }, () => { - setTimeout(() => { + if (res.data.err_code === 0) { + Taro.showToast({ + 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) }) @@ -164,7 +168,6 @@ class AllDemanding extends Component { } handleGrabConfirm() { this.setState({ isOpenedGrabModal: false }) - this.GrabDemand({ demandId: this.state.grabOrderId }) } searchHanlder() { @@ -194,10 +197,10 @@ class AllDemanding extends Component { goToGrabOrderPage(orderId) { Taro.navigateTo({ - - url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId + + url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId }) - } + } componentWillReceiveProps(nextProps) { console.log(this.props, nextProps) @@ -248,12 +251,7 @@ class AllDemanding extends Component { - // 抢单返回轻提示 - const grabOrderSuccessElement = + const allDemandingElementArray = this.state.supplys.length ? this.state.supplys.map((item, index) => { return @@ -267,7 +265,7 @@ class AllDemanding extends Component { - + @@ -293,8 +291,7 @@ class AllDemanding extends Component { {/* 模态框 */} {modalMessageGrabElement} - {/* 轻提示 */} - {grabOrderSuccessElement} + {/* 供求状态选择 */} diff --git a/src/pages/goodsPublish/goodsPublish.js b/src/pages/goodsPublish/goodsPublish.js index e6cbf65..f0b9aad 100644 --- a/src/pages/goodsPublish/goodsPublish.js +++ b/src/pages/goodsPublish/goodsPublish.js @@ -307,8 +307,6 @@ class GoodsPublish extends Component { } } componentDidMount() { - // this.getProductCateList() - // this.getShopCateList() } componentWillReceiveProps(nextProps) { @@ -318,7 +316,12 @@ class GoodsPublish extends Component { componentWillUnmount() { } componentDidShow() { - + if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){ + Taro.showToast({ + title:'您还没有店铺,不能使用该功能,快去申请吧', + icon:'none' + }) + } } componentDidHide() { } diff --git a/src/pages/grabOrderPage/grabOrderPage.js b/src/pages/grabOrderPage/grabOrderPage.js index 9e0a51f..1bce6bb 100644 --- a/src/pages/grabOrderPage/grabOrderPage.js +++ b/src/pages/grabOrderPage/grabOrderPage.js @@ -236,12 +236,12 @@ class GrabOrderPage extends Component { 新增 - - @@ -260,7 +260,7 @@ class GrabOrderPage extends Component { 新增 - diff --git a/src/pages/grabOrderPage/grabOrderPage.scss b/src/pages/grabOrderPage/grabOrderPage.scss index 6bca752..30d29ea 100644 --- a/src/pages/grabOrderPage/grabOrderPage.scss +++ b/src/pages/grabOrderPage/grabOrderPage.scss @@ -16,7 +16,7 @@ .image-wrapper{ display: flex; justify-content:center; - border: 4rpx solid #ddd; + border: 2rpx solid #ddd; margin-top: 10px } @@ -33,7 +33,7 @@ .button{ text-align: center; - .button-orange,.button-green,.button-dark-red{ + .button-orange,.button-green,.button-dark-red,.button-blue{ font-size: 27rpx } } diff --git a/src/pages/grabOrderPage/renderingView/renderingView.js b/src/pages/grabOrderPage/renderingView/renderingView.js index 2d820d5..698ee6e 100644 --- a/src/pages/grabOrderPage/renderingView/renderingView.js +++ b/src/pages/grabOrderPage/renderingView/renderingView.js @@ -61,7 +61,7 @@ class RenderingView extends Component { onClose={this.onCloseCurtain.bind(this)} > @@ -70,7 +70,6 @@ class RenderingView extends Component { {curtainElement} {renderingElementArray} - ) } } diff --git a/src/pages/grabOrderPage/renderingView/renderingView.scss b/src/pages/grabOrderPage/renderingView/renderingView.scss index 358dd56..7f67ac3 100644 --- a/src/pages/grabOrderPage/renderingView/renderingView.scss +++ b/src/pages/grabOrderPage/renderingView/renderingView.scss @@ -2,9 +2,9 @@ display: flex; flex-wrap: wrap; flex-direction: row; - border: 4rpx solid #ddd; + border:2rpx solid #ddd; .image-wrapper{ - border: 4rpx solid #ddd; + border: 2rpx solid #ddd; margin-top: 10px; box-sizing: border-box; width: 30%; diff --git a/src/pages/home/home.js b/src/pages/home/home.js index dfdfb48..eda2307 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -107,9 +107,9 @@ class Home extends Component { .then(res => { console.log('所有店铺的信息', res) Taro.hideLoading() - if (res.data.err_msg === 'success') { + if (res.data.err_code === 0) { 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 }) } else { Taro.showToast({ @@ -191,7 +191,6 @@ class Home extends Component { }) console.log('item', item) 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({}) }) @@ -255,8 +254,9 @@ class Home extends Component { }) } goToMyNeedsPublish() { + // 传参数给myNeedsPublish页面- 显示效果图选项 Taro.navigateTo({ - url: '/pages/myNeedsPublish/myNeedsPublish' + url: '/pages/myNeedsPublish/myNeedsPublish?id=1' }) } @@ -384,7 +384,7 @@ class Home extends Component { shop={item} key={index} > - }) : 没有更多了 + }) : 没有更多了 const subCateElementsArray = this.state.subCate.length ? this.state.subCate.map((item, index) => { return {item.class_name} diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss index d04eb8d..db3c5f6 100644 --- a/src/pages/home/home.scss +++ b/src/pages/home/home.scss @@ -49,7 +49,7 @@ $themeColor: #FF7142; .customer-demanding{ padding:0 20px; .demanding-item{ - border: 3rpx solid #ddd; + border: 2rpx solid #ddd; border-right:0px; text-align: center; .item-tag{ @@ -98,7 +98,7 @@ $themeColor: #FF7142; } .last{ - border-right: 3rpx solid #ddd; + border-right: 2rpx solid #ddd; } } @@ -111,6 +111,9 @@ $themeColor: #FF7142; } } + .top{ + margin-top: 250px; + } .gap{ height:150px; @@ -159,4 +162,4 @@ $themeColor: #FF7142; .swiper-sub{ margin-bottom: 0px; -} \ No newline at end of file +} diff --git a/src/pages/login/login.js b/src/pages/login/login.js index 7849a68..353e7e7 100644 --- a/src/pages/login/login.js +++ b/src/pages/login/login.js @@ -135,9 +135,7 @@ class Login extends Component { - - 立即注册 - + diff --git a/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js index 957ddfc..e99a812 100644 --- a/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js +++ b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js @@ -267,7 +267,7 @@ class MyDemandSupplyEdit extends Component { this.setState({ contactName: event }) } contactNumberChange(event) { - this.setState({ contactNumber: event }) + this.setState({ contactNumber: event.detail.value }) } contactAddressChange(event) { this.setState({ contactAddress: event.target.value }) @@ -345,7 +345,7 @@ class MyDemandSupplyEdit extends Component { componentDidHide() { } - render() { + render() { // 提示模态弹窗element const modalMessageConfirmElement = 提示 @@ -403,7 +403,7 @@ class MyDemandSupplyEdit extends Component { maxLength='11' type='number' value={this.state.contactNumber} - onInput={this.handleInputCsultName.bind(this)} + onInput={this.contactNumberChange.bind(this)} /> diff --git a/src/pages/myNeeds/myNeeds.js b/src/pages/myNeeds/myNeeds.js index c002993..7b21d81 100644 --- a/src/pages/myNeeds/myNeeds.js +++ b/src/pages/myNeeds/myNeeds.js @@ -120,10 +120,19 @@ class MyNeeds extends Component { } } else { - Taro.showToast({ - title: res.data.err_msg, - icon: 'none' - }) + if(JSON.parse(res.data).err_code===88888){ + Taro.showToast({ + 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, state: this.state.needsStateSelected.id }) - }) - - - - }) } diff --git a/src/pages/myNeedsPublish/myNeedsPublish.js b/src/pages/myNeedsPublish/myNeedsPublish.js index 75433d8..a427c37 100644 --- a/src/pages/myNeedsPublish/myNeedsPublish.js +++ b/src/pages/myNeedsPublish/myNeedsPublish.js @@ -252,6 +252,12 @@ class MyNeedsPublish extends Component { // console.log('this.$router.params.sdId',this.$router.params.sdId) // Taro.showLoading({title:'加载中'}) // this.getSupplyDemandInfo() + // 如果路由参数为1 就默认显示 效果图,反之 显示业主需求 + const isRenderingPic=this.$router.params.id + console.log(parseInt(isRenderingPic)) + if(parseInt(isRenderingPic)){ + this.setState({needsTypeSelected:{ name: '效果图', id: '5' }}) + } } componentWillReceiveProps(nextProps) { console.log(this.props, nextProps) diff --git a/src/pages/myNeedsView/myNeedsView.scss b/src/pages/myNeedsView/myNeedsView.scss index 33d7c19..958977b 100644 --- a/src/pages/myNeedsView/myNeedsView.scss +++ b/src/pages/myNeedsView/myNeedsView.scss @@ -28,6 +28,6 @@ $themeColor:#FF7142; } } .image-wrapper{ - border: 4rpx solid #ddd; + border: 2rpx solid #ddd; margin-top: 10px } diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js index 709c1c9..2aceb26 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.js +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -267,6 +267,12 @@ class MySupplyDemand extends Component { LoginService() return } + if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){ + Taro.showToast({ + title:'您还没有店铺,不能使用该功能,快去申请吧', + icon:'none' + }) + } } componentDidHide() { } diff --git a/src/pages/supplyDemandPublish/supplyDemandPublish.js b/src/pages/supplyDemandPublish/supplyDemandPublish.js index 23233bd..8bf40c9 100644 --- a/src/pages/supplyDemandPublish/supplyDemandPublish.js +++ b/src/pages/supplyDemandPublish/supplyDemandPublish.js @@ -34,9 +34,6 @@ class SupplyDemand extends Component { } } - - - // 这个需要写一个uploadDemSup 上传供求 的api uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id, sd_title = this.state.title, @@ -264,6 +261,12 @@ class SupplyDemand extends Component { LoginService() return } + if(!Taro.getStorageSync('shopInfo').shop_id&&Taro.getStorageSync('userInfo').user_id){ + Taro.showToast({ + title:'您还没有店铺,不能使用该功能,快去申请吧', + icon:'none' + }) + } } componentDidHide() { } diff --git a/src/pages/supplyDemandView/supplyDemandView.js b/src/pages/supplyDemandView/supplyDemandView.js index 4ea1b7f..05a5e72 100644 --- a/src/pages/supplyDemandView/supplyDemandView.js +++ b/src/pages/supplyDemandView/supplyDemandView.js @@ -220,12 +220,12 @@ class SupplyDemandView extends Component { - - diff --git a/src/pages/supplyDemandView/supplyDemandView.scss b/src/pages/supplyDemandView/supplyDemandView.scss index 79884fa..6dda899 100644 --- a/src/pages/supplyDemandView/supplyDemandView.scss +++ b/src/pages/supplyDemandView/supplyDemandView.scss @@ -19,12 +19,12 @@ $themeColor:#FF7142; flex-wrap: nowrap; flex-direction: row; margin: 40px 0 0; - + justify-content: space-around; .button{ - flex:1; + // flex:1; text-align: center; - .button-orange,.button-green,.button-dark-red{ + .button-orange,.button-green,.button-dark-red,.button-blue{ font-size: 27rpx } } diff --git a/weapp.rar b/weapp.rar new file mode 100644 index 0000000..4d5426c Binary files /dev/null and b/weapp.rar differ