index.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // pages/settled/index/index.js
  2. const app = getApp();
  3. const api = app.api;
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. agree:true,
  10. isShowPop:false,
  11. settleInfo:{
  12. artistCaStatus: 0, //艺术家认证状态 0未提交,1已提交,2认证通过,3认证不通过
  13. companyCaStatus: 0, //司认证状态 0未提交,1已提交,2认证通过,3认证不通过
  14. curatorCaStatus: 0, //策展人认证状态 0未提交,1已提交,2认证通过,3认证不通过
  15. isArtist: 0,
  16. isArtistAgree: 0, // 艺术家协议 0未同意,1已同意
  17. isArtistInvoiceAgree: 0, //发票协议
  18. isCompany: 0,
  19. isCompanyAgree: 0, //公司认证协议 0未同意,1已同意
  20. isCurator: 0,
  21. isCuratorAgree: 0, // 策展人协议 0未同意,1已同意
  22. isVerification: null, //身份认证
  23. isWeChatLogin: null
  24. }
  25. },
  26. /**
  27. * 生命周期函数--监听页面加载
  28. */
  29. onLoad: function (options) {
  30. },
  31. /**
  32. * 生命周期函数--监听页面初次渲染完成
  33. */
  34. onReady: function () {
  35. },
  36. /**
  37. * 生命周期函数--监听页面显示
  38. */
  39. onShow: function () {
  40. this.getData()
  41. },
  42. getData(){
  43. app.post(api.getUserSettleInfo).then(res=>{
  44. console.log(res);
  45. this.setData({
  46. settleInfo:res.data
  47. })
  48. })
  49. },
  50. handlerTap(e){
  51. const {index}=e.currentTarget.dataset;
  52. const { settleInfo } = this.data;
  53. if(settleInfo.isVerification==0){
  54. this.showPop()
  55. }else if(settleInfo.artistCaStatus && settleInfo.artistCaStatus === 2){
  56. //艺术家认证通过
  57. wx.navigateTo({
  58. url: '/pages/user/artUpload/artUpload'
  59. })
  60. }else if(settleInfo.curatorCaStatus && settleInfo.curatorCaStatus === 2){
  61. //策展人认证通弄过过
  62. wx.navigateTo({
  63. // url: '/pages/user/artUpload/artUpload'
  64. url: '/pages/settled/contacts/contacts'
  65. })
  66. }else if(settleInfo.companyCaStatus && settleInfo.companyCaStatus == 1){
  67. //公司入驻审核中
  68. wx.navigateTo({
  69. url: '/pages/settled/success/success'
  70. })
  71. }else if(settleInfo.companyCaStatus && settleInfo.companyCaStatus == 2){
  72. //公司入驻审核通过
  73. wx.navigateTo({
  74. url: '/pages/settled/contacts/contacts'
  75. })
  76. }else{
  77. if(index==0){
  78. this.artistGo();
  79. }else if(index==1){
  80. this.companyGo();
  81. }else{
  82. this.curatorGO();
  83. }
  84. }
  85. },
  86. artistGo(){
  87. const {settleInfo}=this.data;
  88. if(!settleInfo.isVerification&&settleInfo.isArtistAgree){
  89. wx.navigateTo({
  90. url:"/pages/invoice/authentication/authentication?id=0"
  91. })
  92. return
  93. // }else if(settleInfo.isArtistAgree){
  94. }else{
  95. wx.navigateTo({
  96. url:"/pages/user/personalInfo/personalInfo"
  97. })
  98. }
  99. // }else{
  100. // wx.navigateTo({
  101. // url:`/pages/settled/agreement/agreement?id=0`
  102. // })
  103. // }
  104. },
  105. companyGo(){
  106. // console.log(company)
  107. const {settleInfo}=this.data;
  108. if(settleInfo.isCompanyAgree){
  109. wx.navigateTo({
  110. url:"/pages/settled/authenticationCompany/authenticationCompany"
  111. })
  112. }else{
  113. wx.navigateTo({
  114. url:`/pages/settled/companyStep/companyStep`
  115. //url:`/pages/settled/agreement/agreement?id=1`
  116. })
  117. }
  118. },
  119. curatorGO(){
  120. const {settleInfo}=this.data;
  121. if(!settleInfo.isVerification&&settleInfo.isArtistAgree){
  122. wx.navigateTo({
  123. url:"/pages/invoice/authentication/authentication?id=2"
  124. })
  125. }else if(settleInfo.isArtistAgree){
  126. wx.navigateTo({
  127. // url:"/pages/settled/curatorInfo/curatorInfo"
  128. url:"/pages/user/personalInfo/personalInfo?type=2"
  129. })
  130. }else{
  131. wx.navigateTo({
  132. url:`/pages/settled/curatorStep/curatorStep`
  133. //url:`/pages/settled/agreement/agreement?id=2`
  134. })
  135. }
  136. },
  137. /**
  138. * 生命周期函数--监听页面隐藏
  139. */
  140. onHide: function () {
  141. },
  142. /**
  143. * 生命周期函数--监听页面卸载
  144. */
  145. onUnload: function () {
  146. },
  147. /**
  148. * 页面相关事件处理函数--监听用户下拉动作
  149. */
  150. onPullDownRefresh: function () {
  151. },
  152. /**
  153. * 页面上拉触底事件的处理函数
  154. */
  155. onReachBottom: function () {
  156. },
  157. /**
  158. * 用户点击右上角分享
  159. */
  160. onShareAppMessage: function () {
  161. },
  162. showPop(){
  163. this.setData({
  164. isShowPop:true
  165. });
  166. },
  167. hidePop(){
  168. this.setData({
  169. isShowPop:false
  170. });
  171. }
  172. })