From 104c844b14a28fc8da6706f05e4cf6b1006c0e5b Mon Sep 17 00:00:00 2001 From: Maoqiang Zheng Date: Wed, 26 Dec 2018 17:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=20=E6=88=91=E7=9A=84=E4=BE=9B=E6=B1=82=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.js | 18 +- src/pages/goodsPublish/goodsPublish.js | 11 +- src/pages/index/index.js | 3 + .../myDemandSupplyEdit/myDemandSupplyEdit.js | 293 ++++++++++++++++++ .../myDemandSupplyEdit.scss | 80 +++++ src/pages/myGoodList/myGoodList.js | 176 +++++++++++ src/pages/myGoodList/myGoodList.scss | 112 +++++++ src/pages/mySupplyDemand/mySupplyDemand.js | 73 +++-- src/pages/shop/shop.js | 2 +- .../supplyDemandPublish.js | 95 ++++-- src/serviceAPI.config.js | 58 ++-- src/todo list.txt | 11 +- 12 files changed, 834 insertions(+), 98 deletions(-) create mode 100644 src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js create mode 100644 src/pages/myDemandSupplyEdit/myDemandSupplyEdit.scss create mode 100644 src/pages/myGoodList/myGoodList.js create mode 100644 src/pages/myGoodList/myGoodList.scss diff --git a/src/app.js b/src/app.js index 608f128..4cdd700 100644 --- a/src/app.js +++ b/src/app.js @@ -18,14 +18,16 @@ class App extends Component { config = { pages: [ - 'pages/index/index', - 'pages/home/home', - 'pages/shop/shop', - 'pages/goods/goods', - 'pages/goodsPublish/goodsPublish', - 'pages/supplyDemandPublish/supplyDemandPublish', - 'pages/mySupplyDemand/mySupplyDemand', - 'pages/allDemanding/allDemanding', + 'pages/index/index', // index页面 + 'pages/home/home',//首页 + 'pages/shop/shop',//店铺页面 + 'pages/goods/goods',// 商品页面 + 'pages/goodsPublish/goodsPublish',// 商品发布页面 + 'pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面 + 'pages/mySupplyDemand/mySupplyDemand',// 我的供求页面 + 'pages/allDemanding/allDemanding',// 所有供求页面 + 'pages/myGoodList/myGoodList',// 我的商品列表页面 + 'pages/myDemandSupplyEdit/myDemandSupplyEdit',// 我的供求编辑页面 // 'pages/shopDescription/shopDescription', ], window: { diff --git a/src/pages/goodsPublish/goodsPublish.js b/src/pages/goodsPublish/goodsPublish.js index d372b80..425476f 100644 --- a/src/pages/goodsPublish/goodsPublish.js +++ b/src/pages/goodsPublish/goodsPublish.js @@ -231,7 +231,7 @@ class GoodsPublish extends Component { const that = this if (operationType === 'add') { Taro.uploadFile({ - url: URL.UploadPorductImage, + url: URL.UploadGoodsPorductImage, filePath: files[files.length - 1].url, name: 'file', formData: { @@ -297,6 +297,13 @@ class GoodsPublish extends Component { console.log(this.state.shopCategoryCheckedPicker) }) } + goToMyGoodListPage(){ + Taro.navigateTo({ + + url: '/pages/myGoodList/myGoodList' + + }) + } componentDidMount() { @@ -563,7 +570,7 @@ class GoodsPublish extends Component { {/* 发布并新增 */} - + 商品列表 diff --git a/src/pages/index/index.js b/src/pages/index/index.js index 1f3b902..acf24ae 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -20,6 +20,7 @@ import './index.scss' dispatch(asyncAdd()) } })) + class Index extends Component { config = { navigationBarTitleText: '首页' @@ -29,6 +30,8 @@ class Index extends Component { componentDidMount(){ Taro.navigateTo({ // url: '/pages/goodsPublish/goodsPublish' + // url: '/pages/myGoodList/myGoodList' + // url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit' url: '/pages/home/home' // url:'/pages/supplyDemandPublish/supplyDemandPublish' }) diff --git a/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js new file mode 100644 index 0000000..119ffaf --- /dev/null +++ b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.js @@ -0,0 +1,293 @@ + +import Taro, { Component } from '@tarojs/taro' +import { View, Text } from '@tarojs/components' +import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast } from 'taro-ui' + +import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent' +import URL from '../../serviceAPI.config' + + +import './myDemandSupplyEdit.scss' + + + +class MyDemandSupplyEdit extends Component { + + config = { + navigationBarTitleText: '我的供求编辑' + } + constructor() { + super(...arguments) + this.state = { + demandingSupplyCate: ['需求', '供应', '人才'], //供求类型选择 + demandingSupplyCateSelected: '需求',// 当前供求类型 + demandingSupplyState: ['上架', '下架'], // 状态选择 + demandingSupplyStateSelected: '上架',// 当前状态 + title: '', + contactName: '', + contactNumber: '', + contactAddress: '', + content: '', + pickerImageUrl: [], // 上传的图片 + ImagesInfo: [],// 后台传回来的图片信息 + isUploadImageSuccess: false, + uploadImageTextTip: '', + isFormCompleted: false, + isUploadDemSupSuccess: false, + uploadDemSupTextTip: '', + + } + } + + // 上传供求api + uploadSupplyDemand() { + if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.contactAddress && this.state.content && this.state.demandingSupplyStateSelected) { + this.uploadDemSup({}) + } else { + this.setState({ uploadDemSupTextTip: '请填写完表格', isUploadDemSupSuccess: true }, () => { + setTimeout(() => { + this.setState({ isUploadDemSupSuccess: false }) + }, 2000) + }) + } + + // Taro.request({ + // url: URL.UploadSupplyDemand, + // method: 'POST', + // dataType: 'json', + // data: { + // action: 1, + // sdInfo: JSON.stringify({ "sd_type": "2", "sd_title": "534523", "user_name": "杨夕兵", "user_phone": "18950295811", "user_address": "2342", "sd_desc": "42342", "state": "1", "file_path": [{ "file_name": "bg3.jpg", "file_size": "212678", "file_path": "Uploads/supply/user_27/201812/38bf91f30d215bbefb2686f2401217a6.jpg", "thumb_path": "Uploads/supply/user_27/201812/thumb/38bf91f30d215bbefb2686f2401217a6_200X200.jpg" }] }) + // }, + // header: { + // 'content-type': 'application/x-www-form-urlencoded', + // } + // }) + // .then(res => { + // console.log('上传供求', res) + // } + // ) + } + + // 这个需要写一个uploadDemSup 上传供求 的api + + + // 上传图片 + onChangeImg(files, operationType, index) { + const that = this + if (operationType === 'add') { + Taro.uploadFile({ + url: URL.UploadDSPorductImage, + filePath: files[files.length - 1].url, + name: 'file', + header: { + 'content-type': 'multipart/form-data', + 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), + 'X-Requested-With': 'XMLHttpRequest' + }, + success(response) { + const data = JSON.parse(response.data) + const imagePath = URL.Base + data.file_path + const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath }) + const newImageInfo = that.state.ImagesInfo.concat(data) + that.setState({ pickerImageUrl: newPickerImageUrl, isUploadImageSuccess: true, uploadImageTextTip: '图片上传成功', ImagesInfo: newImageInfo }, () => { + setTimeout(() => { + that.setState({ isUploadImageSuccess: false }) + }, 2000) + }) + } + }) + } + if (operationType === 'remove') { + this.state.pickerImageUrl.splice(index, 1); + this.setState({ files: this.state.pickerImageUrl }); + that.setState({ isUploadImageSuccess: true, uploadImageTextTip: '删除成功' }, () => { + setTimeout(() => { + that.setState({ isUploadImageSuccess: false }) + }, 2000) + }) + } + } + // 修改供求类型 + demandingSupplyCate = e => { + this.setState({ + demandingSupplyCateSelected: this.state.demandingSupplyCate[e.detail.value] + }) + } + // 修改供求状态 + demSupplyStateChange = e => { + this.setState({ + demandingSupplyStateSelected: this.state.demandingSupplyState[e.detail.value] + }) + } + //改标题 + titleChange(event) { + this.setState({ title: event }) + } + contactNameChange(event) { + this.setState({ contactName: event }) + } + contactNumberChange(event) { + this.setState({ contactNumber: event }) + } + contactAddressChange(event) { + this.setState({ contactAddress: event.target.value }) + } + contentChange(event) { + this.setState({ content: event.target.value }) + } + goToMyDemSupPage(){ + Taro.navigateTo({ + url: '/pages/mySupplyDemand/mySupplyDemand' + }) + } + + + componentDidMount() { + // this.uploadSupplyDemand() + } + componentWillReceiveProps(nextProps) { + console.log(this.props, nextProps) + } + + componentWillUnmount() { } + + componentDidShow() { } + + componentDidHide() { } + + render() { + const imageUploadSuccessElement = + const demandSupplyUploadSuccessElement = + return ( + + {/* 图片上传模态框 */} + {imageUploadSuccessElement} + {/* 商品发布模态框 */} + {demandSupplyUploadSuccessElement} + + + + + + + *供求类型: {this.state.demandingSupplyCateSelected} + + + + + + + + * + + + * + + + + * + + + + + *联系地址: + + + + + + + *需求内容: + + + + + + 需求图片: + (最多4张) + + + + + + + + + + + + + + *状态: {this.state.demandingSupplyStateSelected} + + + + + + + + + + 保存 + + {/* + + 保存并新增 + */} + + 我的供求 + + + + + + + ) + } +} + +export default MyDemandSupplyEdit diff --git a/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.scss b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.scss new file mode 100644 index 0000000..06b4839 --- /dev/null +++ b/src/pages/myDemandSupplyEdit/myDemandSupplyEdit.scss @@ -0,0 +1,80 @@ +$themeColor:#FF7142; + +.supply-demand{ + padding: 10px 20px; + + .border-box{ + border-bottom: 1Px solid #d6e4ef; + display: flex + } + .at-input__container{ + color:black; + font-weight: bold; + .at-input__input{ + font-weight: normal + } + } + .img-box{ + margin-top:10Px; + .img-container{ + border: 1Px solid #d6e4ef; + border-radius:8rpx; + } + } + .button-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + margin: 40px 0; + padding: 0 120px; + .button{ + flex:1; + text-align: center; + .at-button--primary{ + background-color:$themeColor,; + border:1PX solid $themeColor,; + } + .button-a{ + background-color:#5cb85c; + border:1PX solid #5cb85c; + } + } +} + +} + +.title-box{ + .title{ + //color: #333; + margin-right:16rpx; + width:172rpx; + font-size:32rpx; + line-height:1.5; + vertical-align:middle; + text-align:left; + font-weight: bold; + } + +} +.warn{ + font-size: 25px; + color:red; + } +.page-section{ + border-bottom: 1Px solid #d6e4ef; + +} +.selected{ + display: inline-block; + margin-left: 20%; + font-size: 32rpx +} +.input-box{ + border-bottom: 1Px solid #d6e4ef; + display: flex; +} +.require{ + color:red; + line-height:100rpx; + +} \ No newline at end of file diff --git a/src/pages/myGoodList/myGoodList.js b/src/pages/myGoodList/myGoodList.js new file mode 100644 index 0000000..c5eb827 --- /dev/null +++ b/src/pages/myGoodList/myGoodList.js @@ -0,0 +1,176 @@ +import Taro, { Component } from '@tarojs/taro' +import { View } from '@tarojs/components' +import { AtInput, Text, AtButton, AtIcon, Picker, Image } from 'taro-ui' +import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' + + +import './myGoodList.scss' + + + +class MyGoodList extends Component { + config = { + navigationBarTitleText: '我的商品列表' + } + constructor() { + super(...arguments) + this.state = { + productName: '', + lowestPrice: '', + heightestPrice: '', + minimumSold: '', + maximumSold: '', + productId: '', + productCate: ['全部类目', '衣柜', '人工服务', '开料机', '书柜', '橱柜', '更衣室'], + productCateSelected: '全部类目' + } + } + + productNameChange(event) { + this.setState({ productName: event }) + } + productIdChange(event) { + this.setState({ productId: event }) + } + lowestPriceChange(event) { + this.setState({ lowestPrice: event }) + } + heightestPriceChange(event) { + this.setState({ heightestPrice: event }) + } + minimumSoldChange(event) { + this.setState({ minimumSold: event }) + } + maximumSoldChange(event) { + this.setState({ maximumSold: event }) + } + productCateChange = e => { + this.setState({ + productCateSelected: this.state.productCate[e.detail.value] + }) + } + + componentDidMount() { + + } + componentWillReceiveProps(nextProps) { + console.log(this.props, nextProps) + } + + componentWillUnmount() { } + + componentDidShow() { } + + componentDidHide() { } + + render() { + //等待接口数据 + const goodListElementArray = + + + + 名称 + ¥12.00 + 3243 + + + +编辑商品 + + + return ( + + + + + + + + + + + + + + + + + + + + + 宝贝类目: + + {this.state.productCateSelected} + + + + + + + + + + 搜索 + + + + + 清空条件 + + + + + {goodListElementArray} + {goodListElementArray} + {goodListElementArray} + {goodListElementArray} + + + + ) + } +} + +export default MyGoodList diff --git a/src/pages/myGoodList/myGoodList.scss b/src/pages/myGoodList/myGoodList.scss new file mode 100644 index 0000000..78f985d --- /dev/null +++ b/src/pages/myGoodList/myGoodList.scss @@ -0,0 +1,112 @@ +$themeColor:#FF7142; +.MyGoodList{ + padding: 10px 20px; + .at-input__container{ + color:black; + font-weight: bold; + .at-input__input{ + font-weight: normal + } + } + .border-box { + border-bottom: 1Px solid #d6e4ef; + display: flex; + + } + .input-box{ + display: flex; + } + .page-section{ + border-bottom: 1Px solid #d6e4ef; + height: 100rpx; + .title-box{ + line-height: 100rpx; + .title{ + //color: #333; + margin-right:16rpx; + width:172rpx; + font-size:32rpx; + line-height:1.5; + vertical-align:middle; + font-weight: bold; + } + .selected{ + display:inline-block; + margin-left:30%; + font-size:32rpx; + } + + } + } + .button-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + margin: 40px 0; + padding: 0 120px; + .button{ + flex:1; + text-align: center; + .at-button--primary{ + background-color:$themeColor; + border:1PX solid $themeColor; + } + .button-a{ + + background-color:#5cb85c; + border:1PX solid #5cb85c; + } + } +} +.mygoodlist-container{ + border-top:1px solid #ddd; + .good-container{ + border: 1px solid #ddd; + border-top: 0px; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + font-size: 30px; + height: 200px; + line-height: 200px; + text-align: center; + color:#717592; + + .img-box{ + flex:1; + .img{ + margin-top: 25%; + } + + } + .name-box{ + flex:1; + color: #0579c6 + + } + .price-box{ + flex:1; + + } + .quantity-box{ + flex:1; + + } + .button-box1{ + flex:1; + padding-top: 3%; + padding-right: 2%; + .button-a{ + + background-color:$themeColor; + border:1PX solid $themeColor; + } + + } + + } +} + + + +} diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js index 8cad573..f4c59fe 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.js +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -1,6 +1,6 @@ import Taro, { Component } from '@tarojs/taro' -import { View, Text } from '@tarojs/components' -import { AtInput, AtButton, Picker, AtIcon, AtModal, AtToast } from 'taro-ui' +import { View, Text, Button } from '@tarojs/components' +import { AtInput, AtButton, Picker, AtIcon, AtModal, AtToast, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui' import URL from '../../serviceAPI.config' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' @@ -9,7 +9,6 @@ import copyrightComponent from '../../component/copyrightComponent/copyrightComp import './mySupplyDemand.scss' -console.log('hi') class MySupplyDemand extends Component { config = { @@ -23,8 +22,8 @@ class MySupplyDemand extends Component { demandSupplyState: ['全部', '上架', '下架'], demandSupplyStatesSelected: '全部', title: '', - startDateSel: '2018-04-22', - endDateSel: '2018-04-22', + startDateSel: '', + endDateSel: '', allDemandSupply: [], totalDemandSupply: '', isToast: false,// 是否显示轻提示 @@ -56,14 +55,14 @@ class MySupplyDemand extends Component { } }).then(res => { if (res.data.err_msg === "success") { - // 判断是否有res.data.supplys , 如果没有就是空数组[] - this.setState({ allDemandSupply: res.data.supplys?res.data.supplys:[], totalDemandSupply: res.data.count }) + // 判断是否有res.data.supplys , 如果没有就是空数组[] + this.setState({ allDemandSupply: res.data.supplys ? res.data.supplys : [], totalDemandSupply: res.data.count }) } }) } //搜索我的供求api - searchDemandSupply({ curr_page = 1, page_count = 20, sd_type = "2", state = "1", sd_title = "1", update_dateL = "2018-12-18", update_dateU = "2018-12-20" }) { + searchDemandSupply({ curr_page = 1, page_count = 20, sd_type = "2", state = "1", sd_title = this.state.title, update_dateL = this.state.startDateSel, update_dateU = this.state.endDateSel }) { Taro.request({ url: URL.SearchDemandSupply, method: 'POST', @@ -119,11 +118,11 @@ class MySupplyDemand extends Component { this.getMySupplyDemand({}) }, 2000) }) - }else{ + } else { this.setState({ toastContent: res.data.err_msg, isToast: true }, () => { setTimeout(() => { this.setState({ isToast: false }) - + }, 2000) }) } @@ -198,6 +197,15 @@ class MySupplyDemand extends Component { // 编辑我的供求 + // 跳转到我的供求编辑页面 + goToMyDSEditPage(){ + Taro.navigateTo({ + + url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit' + + }) + + } //查看我的供求 componentWillReceiveProps(nextProps) { @@ -214,22 +222,21 @@ class MySupplyDemand extends Component { componentDidHide() { } render() { + + // 提示模态弹窗element - const modalMessageConfirmElement = + const modalMessageConfirmElement = + 提示 + + 确认删除{this.state.demandSupplyItemName}? + + + // 轻提示 const toastElement = const demandSupplyElementArray = this.state.allDemandSupply.length ? this.state.allDemandSupply.map((item, index) => { return @@ -261,7 +268,7 @@ class MySupplyDemand extends Component { 查看 - + 编辑 @@ -280,9 +287,9 @@ class MySupplyDemand extends Component { {modalMessageConfirmElement} {/* 轻提示 */} {toastElement} - - + + {/* 供求类型 */} @@ -313,12 +320,12 @@ class MySupplyDemand extends Component { * {/* 开始和结束日期 */} @@ -332,7 +339,7 @@ class MySupplyDemand extends Component { - + *结束日期: {this.state.endDateSel} diff --git a/src/pages/shop/shop.js b/src/pages/shop/shop.js index 6b3d0f7..c098827 100644 --- a/src/pages/shop/shop.js +++ b/src/pages/shop/shop.js @@ -1,6 +1,6 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text, Image } from '@tarojs/components' -import { AtTag, AtIcon, AtPagination, AtActionSheet, AtActionSheetItem } from 'taro-ui' +import { AtTag, AtIcon, AtPagination } from 'taro-ui' import URL from '../../serviceAPI.config' diff --git a/src/pages/supplyDemandPublish/supplyDemandPublish.js b/src/pages/supplyDemandPublish/supplyDemandPublish.js index cd05bb8..dfbd621 100644 --- a/src/pages/supplyDemandPublish/supplyDemandPublish.js +++ b/src/pages/supplyDemandPublish/supplyDemandPublish.js @@ -41,8 +41,16 @@ class SupplyDemand extends Component { // 上传供求api uploadSupplyDemand() { + console.log(this.state.ImagesInfo) if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.contactAddress && this.state.content && this.state.demandingSupplyStateSelected) { - this.uploadDemSup({}) + this.uploadDemSup({ + sd_type:"2", + sd_title:this.state.title, + user_name:this.state.contactName, + user_phone:this.state.contactNumber, + user_address:this.state.contactAddress, + sd_desc:this.state.content, + state:"1"}) } else { this.setState({ uploadDemSupTextTip: '请填写完表格', isUploadDemSupSuccess: true }, () => { setTimeout(() => { @@ -51,25 +59,62 @@ class SupplyDemand extends Component { }) } - // Taro.request({ - // url: URL.UploadSupplyDemand, - // method: 'POST', - // dataType: 'json', - // data: { - // action: 1, - // sdInfo: JSON.stringify({ "sd_type": "2", "sd_title": "534523", "user_name": "杨夕兵", "user_phone": "18950295811", "user_address": "2342", "sd_desc": "42342", "state": "1", "file_path": [{ "file_name": "bg3.jpg", "file_size": "212678", "file_path": "Uploads/supply/user_27/201812/38bf91f30d215bbefb2686f2401217a6.jpg", "thumb_path": "Uploads/supply/user_27/201812/thumb/38bf91f30d215bbefb2686f2401217a6_200X200.jpg" }] }) - // }, - // header: { - // 'content-type': 'application/x-www-form-urlencoded', - // } - // }) - // .then(res => { - // console.log('上传供求', res) - // } - // ) + } // 这个需要写一个uploadDemSup 上传供求 的api + uploadDemSup({sd_type="2",sd_title="第4方",user_name="郑燕彬",user_phone="13509302402",user_address="",sd_desc="但是发射点",state="1"}){ + const file_path=[]; + this.state.ImagesInfo.forEach((item)=>{ + file_path.push({ + file_name: item.file_name, + file_size: item.file_size, + file_path: item.file_path, + thumb_path:item.thumb_path + }) + }) + Taro.request({ + url: URL.UploadSupplyDemand, + method: 'POST', + dataType: 'json', + data: { + action: 1, + sdInfo: JSON.stringify({ + sd_type: sd_type, + sd_title: sd_title, + user_name: user_name, + user_phone: user_phone, + user_address: user_address, + sd_desc: sd_desc, + state: state, + file_path:file_path}) + }, + header: { + 'content-type': 'application/x-www-form-urlencoded', + 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), + 'X-Requested-With': 'XMLHttpRequest' + } + }) + .then(res => { + console.log('上传供求', res) + if(res.data.err_msg==='success'){ + console.log(11111) + this.setState({ uploadDemSupTextTip: '上传成功', isUploadDemSupSuccess: true }, () => { + setTimeout(() => { + this.setState({ isUploadDemSupSuccess: false }) + Taro.navigateTo({ + url: '/pages/mySupplyDemand/mySupplyDemand' + }) + }, 2000) + }) + }else{ + console.log('上传供求失败') + } + + } + ) + + } // 上传图片 @@ -77,14 +122,12 @@ class SupplyDemand extends Component { const that = this if (operationType === 'add') { Taro.uploadFile({ - url: URL.UploadPorductImage, + url: URL.UploadDSPorductImage, filePath: files[files.length - 1].url, name: 'file', - formData: { - user: 'test' - }, + header: { - 'content-type': 'multipart/form-data', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryAWxeadaAVmRVQCiz', 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), 'X-Requested-With': 'XMLHttpRequest' }, @@ -170,6 +213,7 @@ class SupplyDemand extends Component { text={this.state.uploadDemSupTextTip} duration={2000} > + return ( {/* 图片上传模态框 */} @@ -277,16 +321,13 @@ class SupplyDemand extends Component { 发布 - + {/* 发布并新增 - + */} 我的供求 - - - diff --git a/src/serviceAPI.config.js b/src/serviceAPI.config.js index 62367ef..7fc1df4 100644 --- a/src/serviceAPI.config.js +++ b/src/serviceAPI.config.js @@ -1,34 +1,40 @@ const LOCALURL = "http://192.168.1.230/" const URL = { - Base:LOCALURL, - Login: LOCALURL + 'Applet-login', //登入接口 - ShopWxStore: LOCALURL + 'Shop-wxStore', //商城首页信息 - ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息 - // 店铺信息 - GoodsSearch: LOCALURL + 'GoodsSearch-search',// 店铺页面的信息 - GetSearchParam: LOCALURL + 'GoodsSearch-getSearchParam',// sidebar筛选的字段 - GetShopCategoryList: LOCALURL + 'Shop-ajaxShopCartgory',// 店铺内分类目录 - GetProductCategoryList: LOCALURL + 'applet-getGoodsClass',// 商品分类目录 - SearchResult: LOCALURL + 'GoodsSearch-search',// 得到搜索结果 - SearchBarKeyWords: LOCALURL + 'Search-getKeywords',// 搜索栏接口 - GetAllDemanding: LOCALURL + 'supply-allDemandList',// 获取所有业主需求 - MySupplyDemand: LOCALURL + 'Supply-myList',// 获取所有业主需求 - ShopDescription: LOCALURL + 'shop-wxShopInfo',// 获取店铺详情 - GrabDemand: LOCALURL + 'Supply-grabDemand',// 抢单接口 - GetVoucherInfo: LOCALURL + 'Shop-couponsTips',// 优惠卷信息 - GetConsultInfo: LOCALURL + 'Shop-consultTips',// 咨询信息 - BuyConsult: LOCALURL + 'Shop-consult',// 购买咨询 - GetShopItemDetail: LOCALURL + 'GoodsQuery-wxGoodsDetail',// 商品详情 - // 商品发布api接口 + Base: LOCALURL, + Login: LOCALURL + 'Applet-login', //登入接口 + ShopWxStore: LOCALURL + 'Shop-wxStore', //商城首页信息 + ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息 + GrabDemand: LOCALURL + 'Supply-grabDemand',// 抢单接口 + GetVoucherInfo: LOCALURL + 'Shop-couponsTips',// 优惠卷信息 + GetConsultInfo: LOCALURL + 'Shop-consultTips',// 咨询信息 + BuyConsult: LOCALURL + 'Shop-consult',// 购买咨询 + GetShopItemDetail: LOCALURL + 'GoodsQuery-wxGoodsDetail',// 商品详情 + UploadDSPorductImage: LOCALURL + 'Supply-fileUpload',// 上传图片API - - UploadPorductImage: LOCALURL + 'Goods-fileUpload',// 上传商品图片 - UploadProduct: LOCALURL + 'Goods-phonePost',// 上传商品 - UploadSupplyDemand: LOCALURL + 'Supply-post',// 上传供求 + + + //所有业主供求 + GetAllDemanding: LOCALURL + 'supply-allDemandList',// 获取所有业主需求 + MySupplyDemand: LOCALURL + 'Supply-myList',// 我的供求 + + + + // 店铺信息 + GoodsSearch: LOCALURL + 'GoodsSearch-search',// 店铺页面的信息 + ShopDescription: LOCALURL + 'shop-wxShopInfo',// 获取店铺详情 + GetSearchParam: LOCALURL + 'GoodsSearch-getSearchParam',// sidebar筛选的字段 + GetShopCategoryList: LOCALURL + 'Shop-ajaxShopCartgory',// 店铺内分类目录 + GetProductCategoryList: LOCALURL + 'applet-getGoodsClass',// 商品分类目录 + SearchResult: LOCALURL + 'GoodsSearch-search',// 得到搜索结果 + SearchBarKeyWords: LOCALURL + 'Search-getKeywords',// 搜索栏接口 + // 商品发布api接口 + UploadGoodsPorductImage: LOCALURL + 'Goods-fileUpload',// 上传商品 + UploadProduct: LOCALURL + 'Goods-phonePost',// 上传商品 + UploadSupplyDemand: LOCALURL + 'Supply-post',// 上传供求 // 我的供求页面接口Supply-myList - SearchDemandSupply: LOCALURL + 'Supply-myList',// 搜索我的供求接口 - DeleteDemandSupply: LOCALURL + 'Supply-delete',// 删除我的供求接口 + SearchDemandSupply: LOCALURL + 'Supply-myList',// 搜索我的供求接口 + DeleteDemandSupply: LOCALURL + 'Supply-delete',// 删除我的供求接口 } module.exports = URL \ No newline at end of file diff --git a/src/todo list.txt b/src/todo list.txt index 120ef25..a5c3874 100644 --- a/src/todo list.txt +++ b/src/todo list.txt @@ -21,4 +21,13 @@ todo list: 我的供求页面: 搜索接口--等待后台 - 我的供求 -查看和编辑页面 + + 我的供求查看页面 + 我的供求编辑页面--等待后台接口 + +我的商品列表页面 + 我的商品列表数据 + 我的商品--筛选项目 + 商品编辑页面?? + +