From 7e8c9d1afcbb5b427c84a4a3cacee979f21f349e Mon Sep 17 00:00:00 2001 From: Maoqiang Zheng Date: Sun, 27 Jan 2019 17:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=9C=80=E6=B1=82=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=89=80=E6=9C=89=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E6=8A=A2=E5=8D=95=E9=A1=B5=E9=9D=A2api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/app.js | 48 +++- src/app.scss | 2 +- .../scrollToTopComponent.scss | 2 +- src/icons/box-actived.png | Bin 0 -> 382 bytes src/icons/box.png | Bin 0 -> 392 bytes src/icons/home-actived.png | Bin 0 -> 1027 bytes src/icons/home.png | Bin 0 -> 1043 bytes src/icons/menu-actived.png | Bin 0 -> 358 bytes src/icons/menu.png | Bin 0 -> 375 bytes src/icons/publish-actived.png | Bin 0 -> 481 bytes src/icons/publish.png | Bin 0 -> 511 bytes src/icons/setting-actived.png | Bin 0 -> 1003 bytes src/icons/setting.png | Bin 0 -> 1012 bytes src/icons/user-actived.png | Bin 0 -> 687 bytes src/icons/user.png | Bin 0 -> 681 bytes src/pages/allDemanding/allDemanding.js | 25 +- src/pages/allDemanding/allDemanding.scss | 1 - src/pages/grabOrderPage/grabOrderPage.js | 102 +++++-- src/pages/grabOrderPage/grabOrderPage.scss | 22 +- src/pages/home/home.js | 48 ++-- src/pages/home/home.scss | 6 +- src/pages/myGoodList/myGoodList.js | 49 ++-- src/pages/myNeeds/myNeeds.js | 11 +- src/pages/myNeedsView/myNeedsView.js | 44 ++- src/pages/myNeedsView/myNeedsView.scss | 8 +- src/pages/mySupplyDemand/mySupplyDemand.js | 2 +- src/pages/mySupplyDemand/mySupplyDemand.scss | 7 +- src/pages/shop/shop.js | 168 +++++++---- src/pages/shop/shop.scss | 2 +- src/todo list.txt | 271 +++--------------- 31 files changed, 406 insertions(+), 413 deletions(-) create mode 100644 src/icons/box-actived.png create mode 100644 src/icons/box.png create mode 100644 src/icons/home-actived.png create mode 100644 src/icons/home.png create mode 100644 src/icons/menu-actived.png create mode 100644 src/icons/menu.png create mode 100644 src/icons/publish-actived.png create mode 100644 src/icons/publish.png create mode 100644 src/icons/setting-actived.png create mode 100644 src/icons/setting.png create mode 100644 src/icons/user-actived.png create mode 100644 src/icons/user.png diff --git a/package.json b/package.json index 74b7817..f3389e1 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@tarojs/taro-h5": "^1.2.0-beta.3", "@tarojs/taro-swan": "^1.2.0-beta.3", "@tarojs/taro-weapp": "^1.2.0-beta.3", + "@tarojs/webpack-runner": "^1.2.8", "nerv-devtools": "^1.3.9", "nervjs": "^1.3.9", "redux": "^4.0.0", diff --git a/src/app.js b/src/app.js index a66ee7d..5a3962b 100644 --- a/src/app.js +++ b/src/app.js @@ -1,7 +1,7 @@ import '@tarojs/async-await' import Taro, { Component } from '@tarojs/taro' import { Provider } from '@tarojs/redux' -import Index from './pages/index' +import Home from './pages/home' import configStore from './store' import './app.scss' @@ -18,7 +18,7 @@ class App extends Component { config = { pages: [ - 'pages/index/index', // index页面 + //'pages/index/index', // index页面 'pages/home/home',//首页 --------------------- 'pages/shop/shop',//店铺页面 --------------------- 'pages/goods/goods',// 商品页面 --------------------- @@ -42,10 +42,46 @@ class App extends Component { navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black', - // enablePullDownRefresh:true - onReachBottomDistance: 0 + // enablePullDownRefresh:true + onReachBottomDistance: 0 + }, + + tabBar: { + list: [{ + pagePath: "pages/home/home", + text: "首页", + iconPath: "./icons/home.png", + selectedIconPath: "./icons/home-actived.png" + }, { + pagePath: "pages/goodsPublish/goodsPublish", + text: "商品发布", + iconPath: "./icons/box.png", + selectedIconPath: "./icons/box-actived.png" + }, { + pagePath: "pages/supplyDemandPublish/supplyDemandPublish", + text: "供求发布", + iconPath: "./icons/publish.png", + selectedIconPath: "./icons/publish-actived.png" + } + , { + pagePath: "pages/mySupplyDemand/mySupplyDemand", + text: "我的供求", + iconPath: "./icons/menu.png", + selectedIconPath: "./icons/menu-actived.png" + } + , { + pagePath: "pages/myNeeds/myNeeds", + text: "我的需求", + iconPath: "./icons/user.png", + selectedIconPath: "./icons/user-actived.png" + } + ], + color: '#333', + selectedColor: '#333', + backgroundColor: '#fff', + borderStyle: '#ccc' } - , + } @@ -64,7 +100,7 @@ class App extends Component { render() { return ( - + ) } diff --git a/src/app.scss b/src/app.scss index 8fab76f..9551879 100644 --- a/src/app.scss +++ b/src/app.scss @@ -55,7 +55,7 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7); .button-no-margin{ margin:10px 0 } -.no_more_title{ +.no-more-title{ text-align: center; font-size: 25rpx; diff --git a/src/component/scrollToTopComponent/scrollToTopComponent.scss b/src/component/scrollToTopComponent/scrollToTopComponent.scss index 238460d..de817d3 100644 --- a/src/component/scrollToTopComponent/scrollToTopComponent.scss +++ b/src/component/scrollToTopComponent/scrollToTopComponent.scss @@ -6,7 +6,7 @@ border-radius:50%; text-align:center; position:fixed; - bottom:10%; + bottom:3%; right:5%; font-size:25rpx; .box{ diff --git a/src/icons/box-actived.png b/src/icons/box-actived.png new file mode 100644 index 0000000000000000000000000000000000000000..0b56bbcc678290fe07db6126acac6e0484c436fd GIT binary patch literal 382 zcmV-^0fGLBP)<`NYkR-`KYrW+-m1iP){q`6qV2l|mrOq6i zgNO(so)ghU?KK9l)_x%3x@&-1UqmuyHnRXDL|j=AK+enq4=|O$BBF2dn7RkzINk_? zVAmx~Q51K1o{xSU!+OG6dw__yE&)Vjo0(rcz`qj^kzrL;ms;!3$*M$T6#z~V@uaQ7 zt`%Gp(NUX0nx;I9rp=P-{ZYj(D{URt-u5L1bhN+6EMc?E2SPfyR-4%%u;T(kL~fY*a8kSJXN1O>J*8AIPY4ltXXeLQ&E@)<&2z_p c)#^QgFZAN*Ay$9bivR!s07*qoM6N<$g6U+WoB#j- literal 0 HcmV?d00001 diff --git a/src/icons/box.png b/src/icons/box.png new file mode 100644 index 0000000000000000000000000000000000000000..a9fe862cb06a03f1422e7ee61e24d908044073c4 GIT binary patch literal 392 zcmV;30eAk1P)75Thd4YhksGh+v_WrJX*3-~-qMLSQC^wM=f2a$mzrJ1Yyd6D(}B(ZW`+ zS_rvIK$rauVv@}kNtY1L`Q{w%3`1!6p@#jjSOCo2A)?JXQ&CF2g<<&d>oG`xnY#ea z>oot-762Do>&yIo01(IVHxaGP0RSTMVvN}y2j~&e(wqQZjWL}TU?hQgL_f`AWFN5B zt~-viS0{|;dH25W_a??L|6r{>R7%~|36N#kRuo0=Ex^AM5RtA@>Iy(QT$P9{12_Y4 zT2x`#3U0L4$3+Ir{0v}c)<2~HMC95SbJ7?vbHABjLPF0sg|yIxiQ6p^i)24IX?Qq>ax zGO@CM?6o0nzi;w7=}+V^VRO;s@ibGtJP}j#+WyVXx|_ZLjf3Lt|Ow4i0IbXeJc?i5RpS2 zHJkx(OJ~iGs=7l&erM+A037TGVjuu!_B%40iId7&yC)386aCbnsv!}TMdYmS`^%o^ z9V4Q290-77rBbPGAR#l~O+@bln2K#W2jIaEM%-dn5HYQ~uTs(Ls<4LuuFwGLo82!d7L_u2D2 zr;u$)G8K^(F!L?|rxKVhM0B5s{KCwyC#j*|J*%qY%kv`gGBaOKM2;_BL%-xs+JK_HYK+9Tt*z>&eu}ZlP`gB4w>sdB-1yuDV5qUA` znwa?zfM*9?;n)DIwaZ}`zMGW9_x(Md=e>0Wz?BM&Tmjb!0W<~$_zy_v_3eZ%F*C0L znC}N-OaRp&2#S4YK?lG+0Nm`(CV?0gfU5rNMzQb|EMfB1*wR(Fa9PlHI$r0pUIvGIM7a z->gCGL$Fee6wyGf21F1+@B<2!Dr#UsP?VS`?ihFX9=YqT>`rGVO*VoLy>C0`o^yWp z-19$|1r4x#-#=vBJqUe~E@~@4?+c1Fd`#S(E z0Jtlb?9*nmnJbk_zs4cTn|AeoWHRp)(H*fs z=DJJ8Vlgmkuqh+c}TA)!J4 z1TZdySnz#+zhznHh-hb$Oob40P)Z#pqO%EsE&zD2P$>MQl$uRaLrSx;d8337N-1?C zGcN+zpRhk?0A5Sz+(l+S5=Bwnb=`R)8e30Zee821BO}L`mX=&1GVjOTv3(~Ez|%zZ za>u~Tr$$Fdk5#MHYulsuz$TNo+?e^p;o;$jZQEX3U0pSeX&SV%o`IR9=6(Sj(psPK zJnwX+QrXjJG>jT{4U)Xew_71o%zQ5qy)A?|amgqS!|+b6wHd8FkH!{&{Hu`eSUmtz z$|1*beg`nL1qqWvM1?}(DgdTQTPqH*-F4mQKT6&Tn>q=ll>dJKW^S|xQmyAM|CylA zCk(Tmf^J0xUKB#SkaSH-sep(?+7%8Az|7;tV)3n{BtZ}y1@QV6fGZUkqyj^(>#n5* z7_1{F=ZX*hWY>i N002ovPDHLkV1h|Z?C}5q literal 0 HcmV?d00001 diff --git a/src/icons/menu-actived.png b/src/icons/menu-actived.png new file mode 100644 index 0000000000000000000000000000000000000000..8433eae1e94022c331b1a53d46f9896dd3dc571e GIT binary patch literal 358 zcmV-s0h#`ZP)5d*41j$|NIXKeFamcsXH2`bPtiO_mnM&pJVd&cJVNpWMZz#59)WH!xgyFTri4hG z@Bot~EZg__=X?St{=~%ofkyyR%8d}>!_Yv)S0ih!10wpgKobhZ${4iUFJ0=T7M(o<|W{INe~AJP0VI+MKU@HLx?X zlyX5t?}LvtTrtV>{Fg@;%yZyT+QKkgKGJ#if73KoQ51hXy5QO9$JD5v@qOR(JZ~|k)7Dm9*Hu}T)!c?`2(+WPyMo(Ap+AZN;BD+00DvURvSe;U9t7@f z#kZC0+d>WOyOnId4exEm79S=tBE~$5&_aO?HaR(ge+Uc9AyG!sP5=M^07*qoM6N<$ Ef?tc9K>z>% literal 0 HcmV?d00001 diff --git a/src/icons/menu.png b/src/icons/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..b868396d5e70621462ca7410a8c44b88077022a6 GIT binary patch literal 375 zcmV--0f_#IP)b>!45aMAenPf%><==w-P%{AU+^Hx?owqkENMv}(QZwj(7vF4inH5NA)_)fB{3kw z8qA4+2$DJ;DT=_%LS~K+VI&}gcm{y2Ljw^XoUW9*?Yiz|0;IkeW1l?&RaJ39$m>Z0 z12RI0I{^6hoq#cB#~9;bB=BDXTZUc`@!siD%8l0g-8TY+kT*o!he1N$w;SUx3oTo{Wtb7KwzS1;pvMg(sHVgv+JBqc|!xL;5h0{?C0FS;o z001>2)=L|Pfxx+~*sf&8n2!lKupd^k6y{6o#KSxoT=bkkWq;Xy6M}hdPK3{sKFTw$!2igF-jN~N^?;ZZM*wp zNpl$h*4_P^q;)g<-l^9G5JIR*dXj8prYb zetSU$crma`@5Zxwy6#o6ot>3eNkLNkl;TMEG$e4EyNW5f>=wU#6o|;&LA6bu~?ax)xb7MVP(hUcb_4G=7XjJj*G`I_H+o4uGWhB<}&ZG>mIe9gwtct(~vcYWF2=0=PH`A{sy@ zo+Qc3R;!g2@eO0l&tV{<0A%8YLSebxZf{F^V2oLjv|)_-5JK1@dEq!Gq5uGR4qy?$ z02ovP@!Rkm0KjWWPe@)J=>M5K35Qwr(U@3mm{<2O z{=@*1=8Q3Wd6Yv4Z%9tZa^N$7?|A?K+yyWZ3m~U<@9-0EK@|1>x(%}nrc^3@%HxFh zewXB(^BTzIKo;!1|K0DWBF{GTh<$9Web@J0kf!M>fM+8L^_u=m(sk$DeqVq}rDBT3 z;wwoDB(IGMBIyswT}dyTb00hN{df-s}j&LIE*002ovPDHLkV1j!} BEX+&FFtPh4h=!OKyKMgYZzRSCzo&c0mj}p;|&c&Gd1#9i$>k6Qh8k?J& zJ3Tu)`%kB1rPMwmdN~4c)LQ#Y=YJz3BgMtV#W7>d7fE1=5ztzXGxJdwYGxkyegBMe zQmIt#6+*mEL^9%Z7QnbM<`e){O5FwELn5jGc*z*EKMo=mKx@5?nVqrdF!~69b2`*5 z%*^~N5uIk{r#kJ!Fx=_;{-LPt3V=$ba%W#(-_HR0^5!#5-)uHVf*|;zQx_WnrPMJZ zdNR#n&iP4W%$C#$IDzMRH0{9xheQ`$2Jj2Wfn0X=yf^$l#2LZfDL=PwE&suBm$qX<&JiNA0D4b7lc6@$* z{@IzCnT6=QQtE9YdL?!tqDr+|ok~oBQtDO!qwXQ1tpL`?IQnH_VL{gG^~HqLkW%Ul z5p9f_uQKzO0L~K8x5k(YPV-+EXssIniYYz5!&>`pH%;6zoe+_ms@3Y1ya4xGYrpCS zptT+VP){pfBFYZ{V2d$kvYT@$r6+`NE!=hV1i;L1T5DfV0eDOZ@o{c|RuQ^ZafLWW zMD8~_{%kZFx>l=Q?4byMV&;>s2;F0?z4ks4dlU~046Nzz@4pmxA29Qe05)4||BgTu zq?8AR5YPA2hEXG}^>F~(5_UQlhT#W7h)>;o7>4VJXm`vN-8MgEjCmjyEGbt~%2$OD zd((26asHq&#vSb|Mr;Z^&%3=`F4q9`XIvmnw!E~oq^GB+r=!B8>v)2Q9!m3?bN(A+ z%!X8ep`oF5#bVLzzL0Z)u5xDPX0tguH8u5pr!Y1GQp&AF^a&A_TH-5V7`mFc8^99) zZcJG1Dl?y8=1C&jLqxYZ9W#f_{Iu`;$5JEE7Dy>K2_Yr`eBNj@cGPOMKir(>d8JaR zbdrdoZ#V9;+0bs!)=SMkX5P-skNdv=S>_^a3q8-frCzW99@C<40EnK5M~pEm&Va$e z!JFIgxdD=rs+4+!i2k=DW`53E`(EC<>FLX;)uz|(^Y&O?US1z9uq-e=0c3HURkP{< Z{{r18f-qYN1wQ})002ovPDHLkV1nF_*U$g} literal 0 HcmV?d00001 diff --git a/src/icons/setting.png b/src/icons/setting.png new file mode 100644 index 0000000000000000000000000000000000000000..34a5b5c6fd14b5b2e5409de65c14ab62e3e6f998 GIT binary patch literal 1012 zcmVCMptv(t zJqt3ZxQJj5N|b;fh>}|pQNh&+=Awz;p9h7wBK9gyKdG=AW_!D*dxpT)Wnk+6Uj6F5 zSFfrG>pWFOy5U7+RBQc7zZ)6|z*>7JfI~5W39a?>=Mo{L z4IL|&%VD=;YpnsmF@OVF>j%33o1dRAE-o&PG4nfVV5t!>#*7ou0RS%4u2M(YXDlU)@4x?eGS0tH=jB5*D~|*Ze3agUIB1#4u}0njxh7? z%m_F^yWKu-X=&*cfQ|jE&_nxYu~@u%YHI4&TmVjFt$h^0Gv@+8M4r-GKc2e?mjONm zaD9@IhrO@Xy`6A_I@Q8Wr*4-xH%i$&y{;o;$}larJGq`*-S1g>A)kYIZP zz`I1W;CbH1)6>&GI?dTrV6FWZKrtid`;6N#-j2!f3w@=MZvAR?cYN~N18CMN#s zhN#!;g^`hwHh_Ht9mBYhwe}!@y(v3gB%+sz=uI~tMbTy=^5a)@m+etzz9q?5ulGQW zh-R~LnP*-^+FEPZ+SiOk0AtK0M066saGnLSG$QgJfNfgqFXP&@>-aE$+p-+@IsXwe z@5%%Sf?#tLMJI`<(B}eKa#2c+`o8~Zw=gjR&1Q3tQtAx=8=P1~PAjEqB65w0+(Sg? zrxfSkM07|*T(f$bh%R2Xj{w}SwRR7kRU@?st+h7+aH)7(DYf7C{okEsyWQRphM_yp zt6n!Ea-vi!?OHjW?oktlp?f_)q?Ee5QmMR^y9if=v$L}o&CJaF7B@7;)QM2)ZcUjTK;t&f#EOKEtGYSz73sF!I4g@Va^ZEd4Bl+1ai6D z9@lkCh1A{%d%b};(`Ib)$jLFq~RO0sgA%%%Mf4-2qE?Zz)>PPHn@t#*nHmrAo=yajH2ja7>3EQ z7@wH}p64ytwp{{%3yA0&X`=x}L=U>%?s~0O+nUy$Do`jC&LZL(-Cna)#~PO?;imn#8X6EP6Ov=iKy0Yw`HTz=>F-9 z2uLX}0l*p;m?cL002ovPDHLkV1fypClmkx literal 0 HcmV?d00001 diff --git a/src/icons/user.png b/src/icons/user.png new file mode 100644 index 0000000000000000000000000000000000000000..ef18f7c6bfbe8f0325248e00543fa8c8c01a38b1 GIT binary patch literal 681 zcmV;a0#^NrP)otXw-OP*x7N?#6eDlrg&Lz6s*yZu@{|Qv9)y-L! z4U-&H)%^f^0lXynye!Krd7ghyS=FQ!sMTuw%CdY)a#OoORP{@iWk*LwM&8FtL<`hv zwf?d!ACv40z~}wSh{)#{iD&_9?L(4BVxR!-8e>kxWTOPe$H%v4S@tmoxGb~77&8~D zi4t(m4FR|jf-Ub?)nO629;%5IFaT@_w!FVA%L{p)*F!b20>c2VgmGy`&D&TLiruk5u(mp67mB zf^AKKYPH(u-+lmRN$w8PRtDYzxJhzmbaZsSQ*B29=iDh(osM{ZLtZ}sOf?#f%SBN% zTEnXZ{+#j|l4nBXlzvrx2jIAf_^Z0qRtY%g?)hK}JRv*RXf*nZqFDG_vqHdHd!FQU z0x&tMs#ZkuwgS$%X8;Z+Q_~7w8)N*>?C-W>1)OvKkW|um$?2cQn2ntT{N8LxMkW;a z$4W$&CfT|I-4(Fb-XVE1VM57KRedEQ2ik5yGHo3SqThmb7^^L!>jJ+3+}PJ4+G_Dv P00000NkvXXu0mjfg!?m6 literal 0 HcmV?d00001 diff --git a/src/pages/allDemanding/allDemanding.js b/src/pages/allDemanding/allDemanding.js index 5f3440d..9944131 100644 --- a/src/pages/allDemanding/allDemanding.js +++ b/src/pages/allDemanding/allDemanding.js @@ -191,23 +191,12 @@ class AllDemanding extends Component { this.setState({ industryTypeSelected: value }) } - // 翻页导航 - paginationNav(type) { - Taro.showLoading({ - title: '加载中' + goToGrabOrderPage(orderId) { + Taro.navigateTo({ + + url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId }) - this.setState({ currentPage: type.current, }, () => { - this.searchDemanding({ - curr_page: this.state.currentPage, - page_count: 10, - sd_title: this.state.title, - state: this.state.demandingStateSelected.id, - update_dateL: this.state.startDateSel, - update_dateU: this.state.endDateSel, - class_id: this.state.industryTypeSelected.id - }) - }) - } + } componentWillReceiveProps(nextProps) { console.log(this.props, nextProps) @@ -277,7 +266,7 @@ class AllDemanding extends Component { - + @@ -298,7 +287,7 @@ class AllDemanding extends Component { - }) : 没有更多了 + }) : 没有更多了 return ( {/* 模态框 */} diff --git a/src/pages/allDemanding/allDemanding.scss b/src/pages/allDemanding/allDemanding.scss index ca1c551..954d087 100644 --- a/src/pages/allDemanding/allDemanding.scss +++ b/src/pages/allDemanding/allDemanding.scss @@ -110,7 +110,6 @@ $themeColor: #FF7142; .watch{ padding-left: 10px; } - } } .body{ diff --git a/src/pages/grabOrderPage/grabOrderPage.js b/src/pages/grabOrderPage/grabOrderPage.js index d0f35c7..b1a7206 100644 --- a/src/pages/grabOrderPage/grabOrderPage.js +++ b/src/pages/grabOrderPage/grabOrderPage.js @@ -1,6 +1,6 @@ //grabOrderPage import Taro, { Component } from '@tarojs/taro' -import { View, Text, Button } from '@tarojs/components' +import { View, Text, Button, Image } from '@tarojs/components' import { AtModal, AtModalHeader, AtModalContent, AtModalAction, AtIcon } from 'taro-ui' import URL from '../../serviceAPI.config' @@ -9,6 +9,7 @@ import CopyrightComponent from '../../component/copyrightComponent/copyrightComp import './grabOrderPage.scss' +import { SymbolDef } from '_terser@3.14.1@terser'; class GrabOrderPage extends Component { @@ -25,10 +26,12 @@ class GrabOrderPage extends Component { contactNumber: '', address: '', content: '', + images: [], isOpen: false, // 抢单消息提示 grabOrderId: this.$router.params.orderId, - stateId:'', - stateName:'' + stateId: '', + stateName: '', + userId: '' } } @@ -50,15 +53,17 @@ class GrabOrderPage extends Component { .then(res => { console.log('抢单详情获取成功', res) this.setState({ - type: res.data.sdInfo.sd_type, + type: res.data.sdInfo.class_name, title: res.data.sdInfo.sd_title, browsing: res.data.sdInfo.browse_times, contactName: res.data.sdInfo.user_name, contactNumber: res.data.sdInfo.user_phone, address: res.data.sdInfo.user_address, content: res.data.sdInfo.sd_desc, - stateId:res.data.sdInfo.state, - stateName:res.data.sdInfo.state_name, + images: res.data.sdInfo.file_path, + stateId: res.data.sdInfo.state, + stateName: res.data.sdInfo.state_name, + userId: res.data.sdInfo.user_id }) } @@ -144,7 +149,64 @@ class GrabOrderPage extends Component { componentDidHide() { } render() { - + const localStoageUserId = Taro.getStorageSync('userInfo').user_id + + + let ButtonElement + if (localStoageUserId === this.state.userId && this.state.stateId === '1') { + ButtonElement = + + + + + + + + + + + + + + + } else if (localStoageUserId === this.state.userId && this.state.stateId != '1') { + ButtonElement = + + + + + + + + } else if (this.state.stateId === '1') { + ButtonElement = + + + + } else if (this.state.stateId === '2') { + ButtonElement = + + + } else if (this.state.stateId === '3') { + ButtonElement = + + + } + + + // 提示模态弹窗element const modalMessageGrabElement = 提示 @@ -153,6 +215,11 @@ class GrabOrderPage extends Component { + const imageElementArray = this.state.images.map((item, index) => { + return + + + }) return ( @@ -185,20 +252,13 @@ class GrabOrderPage extends Component { 业主需求内容: {this.state.content} - - {/* - - */} - {this.state.stateId === '1' ? - - : null || this.state.stateId === '2' ? - - : null || this.state.stateId === '3' ? - - : null} - + + {this.state.images.length ? 业主需求图片: : null} + {imageElementArray} + + {ButtonElement} + + diff --git a/src/pages/grabOrderPage/grabOrderPage.scss b/src/pages/grabOrderPage/grabOrderPage.scss index ee693b8..499f07a 100644 --- a/src/pages/grabOrderPage/grabOrderPage.scss +++ b/src/pages/grabOrderPage/grabOrderPage.scss @@ -12,15 +12,27 @@ color:#0579c6 } } + .image-wrapper{ + border: 4rpx solid #ddd; + margin-top: 10px + } } +.button-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + margin: 40px 0 0; + justify-content: space-around; + + .button{ - margin-top: 20%; - text-align: center; - // margin:2%; - // justify-content:center; - + text-align: center; + .button-orange,.button-green,.button-dark-red{ + font-size: 27rpx + } } +} \ No newline at end of file diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 23dff9f..81e0a08 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -14,7 +14,8 @@ import './home.scss' class Home extends Component { config = { - navigationBarTitleText: '首页' + navigationBarTitleText: '首页', + } constructor() { @@ -66,7 +67,7 @@ class Home extends Component { Taro.setStorageSync('user_identity', { username: res.data.otherData.userName, userphone: res.data.otherData.userPhone }) this.setState({ ads: res.data.data.adsLb, - categories: [res.data.data.supplyClass[0],Object.values(res.data.data.supplyClass[1])], + categories: [res.data.data.supplyClass[0], Object.values(res.data.data.supplyClass[1])], demanding: res.data.data.demand.supplys, otherData: res.data.otherData, userName: res.data.otherData.userName, @@ -104,7 +105,7 @@ class Home extends Component { } }) .then(res => { - console.log('所有店铺的信息', res) + console.log('所有店铺的信息', res) Taro.hideLoading() if (res.data.err_msg === 'success') { if (this.state.isAddToList) { @@ -132,9 +133,10 @@ class Home extends Component { } ) } - + // 异步函数登入api async login() { + Taro.login({ success(res) { if (res.code) { @@ -153,22 +155,18 @@ class Home extends Component { }) .then(response => { if (response.data.err_msg === 'success') { + console.log('微信登入成功', response) - // Taro.showToast({ - // title:'登入成功', - // icon:'success', - // duration:1500 - // }) - //储存后台返回的session_id 到local Storage + Taro.setStorageSync('session_id', response.data.session_id) Taro.setStorageSync('shopInfo', response.data.shop_info) Taro.setStorageSync('userInfo', response.data.user_info) - + } else { Taro.showToast({ title: '登入失败' + response.data.err_msg, icon: 'none', - duration: 1500 + duration: 2000 }) } @@ -176,6 +174,8 @@ class Home extends Component { ).catch(err => { console.log('登入微信失败', err) + }).then(()=>{ + }) } else { @@ -303,14 +303,24 @@ class Home extends Component { }) } + + componentDidMount() { // 页面加载后 得到首页的基本信息和推荐店铺的信息 - Taro.showLoading({ title: '加载中' }) - - this.login().then(() => { + (async ()=>{ + Taro.showLoading({ title: '加载中' }) + await this.login() this.getShops({}) this.getHomeCategoriesInfo() - }).catch(err => console.log('微信登入失败:', err)) + })() + + + + + // this.login().then(() => { + // this.getShops({}) + // this.getHomeCategoriesInfo() + // }).catch(err => console.log('微信登入失败:', err)) } @@ -411,7 +421,7 @@ class Home extends Component { {item.class_name} }) : null - + const shopCollectionElementsArray = this.state.shops.length ? this.state.shops.map((item, index) => { return - }) : 没有更多了 + }) : 没有更多了 const subCateElementsArray = this.state.subCate.length ? this.state.subCate.map((item, index) => { return {item.class_name} @@ -552,7 +562,7 @@ class Home extends Component { - + {/* */} diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss index 7486f7b..149b9f3 100644 --- a/src/pages/home/home.scss +++ b/src/pages/home/home.scss @@ -6,11 +6,8 @@ $themeColor: #FF7142; height: 100%; width: 100%; } - } - } - .modalBox{ .at-modal-footer--simple{ .at-modal-action{ @@ -43,9 +40,8 @@ $themeColor: #FF7142; vertical-align: middle; } .more-link{ - // float: right; margin-left: 50%; - font-size: 30px; + font-size: 25px; color: #ccc; vertical-align: middle; } diff --git a/src/pages/myGoodList/myGoodList.js b/src/pages/myGoodList/myGoodList.js index 518210e..4349a83 100644 --- a/src/pages/myGoodList/myGoodList.js +++ b/src/pages/myGoodList/myGoodList.js @@ -22,7 +22,8 @@ class MyGoodList extends Component { heightestPrice: '', minimumSold: '', maximumSold: '', - productId: '', + order: '',// 商品列表排序参数 + productId: '',// 商品编号参数 productCate: [], //宝贝类目 productCateSelected: { id: '', name: '全部类目' },// 已选宝贝类目 filterBar: ['filterPrice', 'filterStock', 'filterSold', 'filterPublishDate',], //筛选选项 @@ -37,7 +38,7 @@ class MyGoodList extends Component { myGoodList: [],// 保存后台返回的商品列表 myGoodListTotal: '0',// 后台的商品总数 goodsStateParam: 1,//商品状态参数 - pageCountParam: 10,// 商品数量参数 + pageCountParam: 20,// 商品数量参数 currPageParam: 1,// 当前页面 参数 isCheckAll: false,// 是否checked goodsIdList: [],//商品Id 列表 @@ -108,17 +109,16 @@ class MyGoodList extends Component { // 获取我的商品列表接口api getMyGoodListApi({ goodsName = this.state.productName, - goodsSn = '', + goodsSn = this.state.productId, goodsClass = this.state.productCateSelected.id, goodsPriceL = this.state.lowestPrice, goodsPriceU = this.state.heightestPrice, goodsSalesL = this.state.minimumSold, goodsSalesU = this.state.maximumSold, - shopClassID = this.state.productId, goodsState = this.state.goodsStateParam, pageCount = this.state.pageCountParam, currPage = this.state.currPageParam, - order = '', + order = this.state.order, }) { Taro.request({ url: URL.MyGoodList, @@ -132,7 +132,6 @@ class MyGoodList extends Component { goodsPriceU: goodsPriceU, goodsSalesL: goodsSalesL, goodsSalesU: goodsSalesU, - shopClassID: shopClassID, goodsState: goodsState, pageCount: pageCount, currPage: currPage, @@ -329,7 +328,7 @@ class MyGoodList extends Component { Taro.showLoading({ title: '加载中', }) - this.setState({ currPageParam: 1, isCheckAll: false,loadMorePageIndex:1 }, () => { + this.setState({ currPageParam: 1, isCheckAll: false,order:'' }, () => { this.getMyGoodListApi({}) }) } @@ -339,7 +338,6 @@ class MyGoodList extends Component { emptyButtonHanlder() { this.setState({ isCheckAll: false, - loadMorePageIndex:1, currPageParam: 1, productName: '', lowestPrice: '', @@ -348,6 +346,7 @@ class MyGoodList extends Component { maximumSold: '', productId: '', productCateSelected: { id: '', name: '全部类目' }, + order:'', }, () => { this.getMyGoodListApi({}) Taro.showToast({ @@ -370,10 +369,15 @@ class MyGoodList extends Component { filterSold: false, filterPublishDate: false, } - } - ) - this.state.filterOptions.filterPrice ? this.getMyGoodListApi({ order: "goods_price desc" }) : this.getMyGoodListApi({ order: "goods_price" }) + }, () => { + this.state.filterOptions.filterPrice ? this.setState({ order: "goods_price" }, () => { + this.getMyGoodListApi({}) + }) : this.setState({ order: "goods_price desc" }, () => { + this.getMyGoodListApi({}) + }) + + }) } if (value == 1) { this.setState({ @@ -385,7 +389,11 @@ class MyGoodList extends Component { filterPublishDate: false, } }, () => { - this.state.filterOptions.filterStock ? this.getMyGoodListApi({ order: "goods_stock desc" }) : this.getMyGoodListApi({ order: "goods_stock" }) + this.state.filterOptions.filterStock ? this.setState({ order: "goods_stock" }, () => { + this.getMyGoodListApi({}) + }) : this.setState({ order: "goods_stock desc" }, () => { + this.getMyGoodListApi({}) + }) } ) } @@ -400,11 +408,14 @@ class MyGoodList extends Component { } }, () => { - this.state.filterOptions.filterSold ? this.getMyGoodListApi({ order: "sales_volume desc" }) : this.getMyGoodListApi({ order: "sales_volume" }) + this.state.filterOptions.filterSold ? this.setState({ order: "sales_volume " }, () => { + this.getMyGoodListApi({}) + }) : this.setState({ order: "sales_volume desc" }, () => { + this.getMyGoodListApi({}) + }) } ) - } if (value == 3) { this.setState({ @@ -417,7 +428,11 @@ class MyGoodList extends Component { } }, () => { - this.state.filterOptions.filterPublishDate ? this.getMyGoodListApi({ order: "update_date desc" }) : this.getMyGoodListApi({ order: "update_date" }) + this.state.filterOptions.filterPublishDate ? this.setState({ order: "update_date desc" }, () => { + this.getMyGoodListApi({}) + }) : this.setState({ order: "update_date" }, () => { + this.getMyGoodListApi({}) + }) } ) } @@ -581,8 +596,8 @@ class MyGoodList extends Component { Taro.showLoading({ title: '加载中' }) - this.setState({ isAddToList: true, loadMorePageIndex: this.state.loadMorePageIndex + 1 }, () => { - this.getMyGoodListApi({ currPage: this.state.loadMorePageIndex }) + this.setState({ isAddToList: true, currPageParam: this.state.currPageParam + 1 }, () => { + this.getMyGoodListApi({}) }) diff --git a/src/pages/myNeeds/myNeeds.js b/src/pages/myNeeds/myNeeds.js index bc369f6..b4a2850 100644 --- a/src/pages/myNeeds/myNeeds.js +++ b/src/pages/myNeeds/myNeeds.js @@ -243,10 +243,11 @@ class MyNeeds extends Component { needsStateSelected: this.state.needsState[e.detail.value] }) } - goToMyNeedsViewPage(id) { - Taro.navigateTo({ - url: '/pages/myNeedsView/myNeedsView?id=' + id - }) + goToMyNeedsViewPage(Id) { + Taro.navigateTo({ + url: '/pages/grabOrderPage/grabOrderPage?orderId=' + Id + }) + } goToMyNeedsEditPage(id) { Taro.navigateTo({ @@ -446,7 +447,7 @@ class MyNeeds extends Component { {/* 我的需求信息 */} { - {this.state.allNeedsList.length?myNeedsListArrayElement:没有更多了} + {this.state.allNeedsList.length?myNeedsListArrayElement:没有更多了} } {this.state.isShowTopNav ? : null} diff --git a/src/pages/myNeedsView/myNeedsView.js b/src/pages/myNeedsView/myNeedsView.js index 1a87e72..2473925 100644 --- a/src/pages/myNeedsView/myNeedsView.js +++ b/src/pages/myNeedsView/myNeedsView.js @@ -18,7 +18,6 @@ class SupplyDemandView extends Component { constructor() { super(...arguments) this.state = { - industryTypeSelected: '', needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }], needsTypeSelected: { name: '业主需求', id: '4' }, @@ -35,14 +34,15 @@ class SupplyDemandView extends Component { contactAddress: '', content: '',//描述 pickerImageUrl: [], - ImagesInfo: '', + ImagesInfo: [], isShowAllButtons:true// 是否显示所有按钮 } } //获取需求信息api getSingleMyNeedInfo() { Taro.request({ - url: URL.EditMyNeeds, + // url: URL.EditMyNeeds, + url: URL.supplyDemandDetails, method: 'GET', dataType: 'json', data: { @@ -79,13 +79,13 @@ class SupplyDemandView extends Component { } } - const needsType = this.state.needsType.filter(item => { - return item.id === res.data.sdInfo.sd_type - })[0] - const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } }) - const needsState = this.state.needsState.filter(item => { - return item.id === res.data.sdInfo.state - })[0] + // const needsType = this.state.needsType.filter(item => { + // return item.id === res.data.sdInfo.sd_type + // })[0] + // const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } }) + // const needsState = this.state.needsState.filter(item => { + // return item.id === res.data.sdInfo.state + // })[0] this.setState({ sd_id: res.data.sdInfo.sd_id, industryTypeSelected: industryType, @@ -212,9 +212,15 @@ class SupplyDemandView extends Component { - const imageArrayElement = this.state.ImagesInfo.map((item, index) => { - return - }) + // const imageArrayElement = this.state.ImagesInfo.map((item, index) => { + // return + // }) + const imageArrayElement=this.state.ImagesInfo.map((item, index) => { + return + + + }) + return ( @@ -248,13 +254,21 @@ class SupplyDemandView extends Component { 业主需求内容: {this.state.content} - {this.state.ImagesInfo.length? + + {this.state.ImagesInfo.length?业主需求图片::null} + {imageArrayElement} + + + + + + {/* {this.state.ImagesInfo.length? 业主需求图片: {imageArrayElement} :null -} +} */} {this.state.isShowAllButtons? diff --git a/src/pages/myNeedsView/myNeedsView.scss b/src/pages/myNeedsView/myNeedsView.scss index bd465af..33d7c19 100644 --- a/src/pages/myNeedsView/myNeedsView.scss +++ b/src/pages/myNeedsView/myNeedsView.scss @@ -27,9 +27,7 @@ $themeColor:#FF7142; } } } -.img-box{ - padding:20px; - .image{ - font-size: 0px - } +.image-wrapper{ + border: 4rpx solid #ddd; + margin-top: 10px } diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js index 40ef8ab..09c95a1 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.js +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -340,7 +340,7 @@ class MySupplyDemand extends Component { - }) : + }) : 没有更多了.... return ( diff --git a/src/pages/mySupplyDemand/mySupplyDemand.scss b/src/pages/mySupplyDemand/mySupplyDemand.scss index 8a2d8a1..e05c612 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.scss +++ b/src/pages/mySupplyDemand/mySupplyDemand.scss @@ -95,7 +95,7 @@ $themeColor:#FF7142; border: 3rpx solid #ddd; margin-bottom: 8px; box-shadow: 0 8px 8px #ddd; - padding: 10px; + padding: 10px 10px 0; View{ margin-top: 5px; } @@ -108,12 +108,11 @@ $themeColor:#FF7142; flex-wrap: nowrap; justify-content:flex-end; margin: 20px 0 0 0; - padding: 0 20px; + border-top: 1px solid #ddd; .button{ - // flex:1; text-align: center; - margin:1% 1% 0; + margin:0 1% 0; .button-orange,.button-green,.button-dark-red{ font-size: 27rpx } diff --git a/src/pages/shop/shop.js b/src/pages/shop/shop.js index 5f029b4..a7df7b8 100644 --- a/src/pages/shop/shop.js +++ b/src/pages/shop/shop.js @@ -9,10 +9,10 @@ import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToT import './shop.scss' import ShopItem from '../../component/shopItemComponent/shopItemComponent' -import BottomNav from '../../component/bottomNav/bottomNav' +//import BottomNav from '../../component/bottomNav/bottomNav' import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent' -const locationIcon=require('../../assets/img/location.png') +const locationIcon = require('../../assets/img/location.png') class Shop extends Component { // 项目配置 @@ -47,7 +47,6 @@ class Shop extends Component { popularity: false, }, filterCondition: '',// 筛选条件 - mainType: [],// 侧边筛选分类 goodType: [],//侧边商品类型 otherType: [],//侧边其他类型 @@ -66,13 +65,15 @@ class Shop extends Component { shop_class_id: '', order: '', goods_class_id: '', + class_filter: '', + goods_type: '', goodsSpec: [], goodsParam: [], goodsParamExt: [], // 地图的经度和维度 longitude: '', latitude: '', - + } } @@ -117,13 +118,18 @@ class Shop extends Component { console.log('筛选项目成功', res) Taro.hideLoading() this.formatFilterData(res.data).then(data => { + console.log('data', data) + this.setState({ sideFilterdata: data, - mainType: data.mainType || [], - goodType: data.goodType || [], - otherType: data.otherType || [], - widthType: data.widthType || [], + mainType: data.mainType, + goodType: data.goodType, + otherType: data.otherType, + widthType: data.widthType, }) + + + console.log('formated data', data) }) } else { @@ -140,10 +146,26 @@ class Shop extends Component { //侧边筛选分类 if (data.goods_class) { let typeArray = [] - data.goods_class.forEach(item => { - typeArray.push({ id: item.class_id, name: item.class_name, checked: false }) - }); + // 如果后台返回的筛选项有和checkedFilterIdList重叠的 就不显示. + if (this.state.checkedFilterIdList.length) { + data.goods_class.forEach(item => { + this.state.checkedFilterIdList.forEach((checkedItem) => { + if (checkedItem.id !== item.class_id) { + typeArray.push({ id: item.class_id, name: item.class_name, checked: false }) + } + }) + }); + } else { + data.goods_class.forEach(item => { + typeArray.push({ id: item.class_id, name: item.class_name, checked: false }) + } + ) + } + + formatedFilterOptions.mainType = typeArray + } else { + formatedFilterOptions.mainType = [] } //侧边筛选商品类型 if (data.goods_type) { @@ -159,6 +181,9 @@ class Shop extends Component { } }); formatedFilterOptions.goodType = goodTypeArray + } else { + formatedFilterOptions.goodType = [] + } //侧边筛选其他类型 if (data.goodsParam) { @@ -177,6 +202,10 @@ class Shop extends Component { }); formatedFilterOptions.otherType = goodsParamArray } + else { + formatedFilterOptions.otherType = [] + + } //侧边筛选宽度类型 if (data.goodsParamExt) { let goodsParamExtArray = [] @@ -192,6 +221,8 @@ class Shop extends Component { }); formatedFilterOptions.widthType = goodsParamExtArray + } else { + formatedFilterOptions.widthType = [] } return formatedFilterOptions @@ -234,7 +265,10 @@ class Shop extends Component { goodsParamExt: JSON.stringify(goodsParamExt), }, header: { + // 'content-type': 'application/x-www-form-urlencoded', + // 'X-Requested-With': 'XMLHttpRequest' 'content-type': 'application/x-www-form-urlencoded', + 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), 'X-Requested-With': 'XMLHttpRequest' } }) @@ -502,7 +536,8 @@ class Shop extends Component { Taro.showLoading({ title: '加载中' }) this.setState({ - checkedFilterIdList: [], curr_page: 1, + checkedFilterIdList: [], + curr_page: 1, page_count: 10, shop_name: false, config_id: 4, @@ -510,6 +545,8 @@ class Shop extends Component { order: '', curr_page: 1, goods_class_id: '', + class_filter: '', + goods_type: '', goodsSpec: [], goodsParam: [], goodsParamExt: [], @@ -520,7 +557,14 @@ class Shop extends Component { } + openNavMap() { + Taro.openLocation({ + latitude: Number(this.state.latitude), + longitude: Number(this.state.longitude), + name: this.state.shopAddress, + }) + } componentDidMount() { Taro.showLoading({ title: '加载中' }) //页面加载之后 得到指定店铺的商品 和 筛选标签 @@ -552,7 +596,7 @@ class Shop extends Component { } } render() { - + const ShopItemElementsArray = this.state.shopItem.length ? this.state.shopItem.map((item, index) => { return @@ -572,9 +616,9 @@ class Shop extends Component { // 侧边已选项 const checkedFilterElementsArray = this.state.checkedFilterIdList.map((item, index) => { return {item.name} }) @@ -584,19 +628,19 @@ class Shop extends Component { // 侧边筛选的分类项 const goodsClassElementsArray = this.state.mainType.map((item, index) => { return {item.name} }) // 侧边筛选的商品类型项 const goodsTypeElementsArray = this.state.goodType.map((item, index) => { return {item.name} }) @@ -610,10 +654,10 @@ class Shop extends Component { let isCheck = subItem.checked return {name} })} @@ -623,10 +667,10 @@ class Shop extends Component { // 侧边筛选宽度选项 const widthnessElementsArray = this.state.widthType.map((item, index) => { return {item.name} }) // 店铺页面/店铺主页 @@ -666,7 +710,7 @@ class Shop extends Component { {/* 店铺的商品列表 */} - {this.state.shopItem.length ? ShopItemElementsArray : 没有更多了} + {this.state.shopItem.length ? ShopItemElementsArray : 没有更多了} @@ -705,26 +749,30 @@ class Shop extends Component { */} {/* location.png */} + + + + {/* - - - - + + + + 店铺全部分类 @@ -786,7 +834,7 @@ class Shop extends Component { - + {/* */} ) diff --git a/src/pages/shop/shop.scss b/src/pages/shop/shop.scss index 9fd52cd..4577439 100644 --- a/src/pages/shop/shop.scss +++ b/src/pages/shop/shop.scss @@ -152,7 +152,7 @@ height:60rpx; padding:10px; } - .no_more_title{ + .no-more-title{ width:100%; margin-top:20%; diff --git a/src/todo list.txt b/src/todo list.txt index 6019384..204af61 100644 --- a/src/todo list.txt +++ b/src/todo list.txt @@ -20,236 +20,51 @@ bug: 商品编辑 增加图片后 图片顺序乱了 -// api -商品列表 --价格排序 --库存排序 --总销量 --发布时间 - - - -import Taro, { Component } from '@tarojs/taro' -import { View, Text } from '@tarojs/components' - -import { Picker } from 'taro-ui' - -import './interactionComponent.scss' - -class Interaction extends Component { - - config = { - navigationBarTitleText: 'interactionComponent' - } - constructor() { - super(...arguments); - - this.state = { - ///---行业分类 开始 - objectMultiArray: '', - multiIndex: [0, 0], - formatInWindow: [], - ///---行业分类 结束 - - } - - } - // 行业分类筛选列表GetIndustryTypeList - getIndustryTypeList(url) { - Taro.request({ - url: url, - method: 'GET', - dataType: 'json', - header: { - 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), - 'content-type': 'application/x-www-form-urlencoded', - 'X-Requested-With': 'XMLHttpRequest' - } - }).then(res => { - // console.log('行业分类列表', res) - this.formatIndustryType(res.data.data) - this.formatIndustTypeInit(res.data.data) - - }).catch(err => { - console.log('行业分类列表获取失败', err) - }) - } - // 第一种formate 用于底部弹层滚动时的数据 - formatIndustryType(data) { - const newIndustryType = [{ name: '全部', id: '-1', child: [{ name: '', id: '' }] }] - for (let outter of data) { - let outterObject = { name: outter.class_name, id: outter.class_id, child: [{name:'可选',id:''}] } - if (outter.child.length) { - for (let inner of outter.child) { - outterObject.child.push({ name: inner.class_name, id: inner.class_id }) - } - } else { - outterObject.child.push({ name: '', id: '' }) - } - newIndustryType.push(outterObject) - } - this.setState({ formatInWindow: newIndustryType }) - } - //第二种format 用于底部弹层的初始化数据 - formatIndustTypeInit(data) { - const firstArray = [{ name: '全部', id: '1' }] - const secondArray = [{ name: '', id: '' }] - for (let outter of data) { - firstArray.push({ name: outter.class_name, id: outter.class_id }) - if (outter.child.length) { - for (let inner of outter.child) { - secondArray.push({ name: inner.class_name, id: inner.class_id }) - } - } - } - this.setState({ objectMultiArray: [firstArray, secondArray] }, () => { - }) - - } - //--------------------开始-行业分类picker - bindMultiPickerChange(e) { - //判断如果formatInWindow 的子类为空 那就取父类, 反之取子类 - - let industryTypeSelected - if (this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id === '') { - industryTypeSelected = this.state.formatInWindow[e.detail.value[0]] - } else { - industryTypeSelected = this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]] - } - - // console.log('picker发送选择改变,携带值为', e.detail.value) - - this.setState({ - multiIndex: e.detail.value, - }, () => { - this.passDataToParent(industryTypeSelected) - }) - - } - bindMulPickerColChge(e) { - // console.log('修改的列为', e.detail.column, ',值为', e.detail.value) - const data = { - objectMultiArray: this.state.objectMultiArray, - multiIndex: this.state.multiIndex - } - data.multiIndex[e.detail.column] = e.detail.value - switch (e.detail.column) { - case 0: - switch (data.multiIndex[0]) { - case 0: - data.objectMultiArray[1] = this.state.formatInWindow[0].child - break - case 1: - data.objectMultiArray[1] = this.state.formatInWindow[1].child - break - case 2: - data.objectMultiArray[1] = this.state.formatInWindow[2].child - break - case 3: - data.objectMultiArray[1] = this.state.formatInWindow[3].child - break - case 4: - data.objectMultiArray[1] = this.state.formatInWindow[4].child - break - case 5: - data.objectMultiArray[1] = this.state.formatInWindow[6].child - break - case 6: - data.objectMultiArray[1] = [{ name: '' }] - break - case 7: - data.objectMultiArray[1] = this.state.formatInWindow[7].child - break - case 8: - data.objectMultiArray[1] = this.state.formatInWindow[8].child - break - case 9: - data.objectMultiArray[1] = this.state.formatInWindow[9].child - break - case 10: - data.objectMultiArray[1] = this.state.formatInWindow[10].child - break - case 11: - data.objectMultiArray[1] = this.state.formatInWindow[11].child - break - case 12: - data.objectMultiArray[1] = this.state.formatInWindow[12].child - break - case 13: - data.objectMultiArray[1] = this.state.formatInWindow[13].child - break - case 14: - data.objectMultiArray[1] = this.state.formatInWindow[14].child - break - case 15: - data.objectMultiArray[1] = this.state.formatInWindow[15].child - break - case 15: - data.objectMultiArray[1] = this.state.formatInWindow[16].child - break - - } - data.multiIndex[1] = 0 - break - - } - // console.log(data.multiIndex) - // console.log('objectMultiArray', data.objectMultiArray) - this.setState({ - multiIndex: data.multiIndex, - objectMultiArray: data.objectMultiArray - }, () => { - - }) - } - - //--------------------结束-行业分类picker - passDataToParent(industryTypeSelected) { - this.props.onPassDataToChild(industryTypeSelected) - } - - - componentDidMount() { - - this.getIndustryTypeList(this.props.url) - } - // 当然父组件有新的props的 会从新渲染组件 - componentWillReceiveProps(nextProps) { - - } - componentWillUnmount() { } - - componentDidShow() { } - - componentDidHide() { } - - render() { - return ( - - - - - 行业分类: - - {this.props.selectedValue.name} - {/* {this.state.objectMultiArray[0] ? {this.state.objectMultiArray[0][this.state.multiIndex[0]].name} : null} - {this.state.objectMultiArray[1] ? {this.state.objectMultiArray[1][this.state.multiIndex[1]].name} : null} */} - - - + const selfAndAvailable = localStoageUserId === this.state.userId && this.state.stateId === '1' && + + + + + + + + + + + + - ) - } -} + const selfAndUnAvaialble = localStoageUserId === this.state.userId && this.state.stateId != '1' && + + + + + + + + const Avaialble = this.state.stateId === '1' && + + + const Unavailable = this.state.stateId === '2' && + + + const SoldOut = this.state.stateId === '3' && + + -export default Interaction + const ButtonElement = selfAndAvailable || selfAndUnAvaialble || Avaialble || Unavailable || SoldOut