myApplication.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view class="my-application">
  3. <!-- 标题栏 -->
  4. <view class="bg"></view>
  5. <u-navbar
  6. back-icon-color="#fff"
  7. :back-text="$t('common.Back')"
  8. :is-back="true"
  9. :background="{background:'#1777FE'}"
  10. :back-text-style="{color:'#fff'}"
  11. :border-bottom="true"
  12. title-color="#fff"
  13. :title="title"
  14. :custom-back="back"
  15. >
  16. </u-navbar>
  17. <view class="line-h"></view>
  18. <!-- 头部菜单 -->
  19. <view class="menus" v-if="token">
  20. <u-tabs :list="menuList"
  21. :is-scroll="true"
  22. :current="menuIndex"
  23. :bar-height="2"
  24. :height="40"
  25. :bold="false"
  26. :bar-width="120"
  27. @change="showDifferentContent" ></u-tabs>
  28. </view>
  29. <view class="line-h"></view>
  30. <!-- 选项卡的内容区 -->
  31. <view class="applicationContent">
  32. <view class="item" v-for="(item,index) in dataList" :key="index" @click="showDetial(item,index)">
  33. <view class="label" v-if="item.affiliatedUnitName">{{item.affiliatedUnitName}}</view>
  34. <view class="label" v-if="item.unitZhName">{{item.unitZhName}}</view>
  35. <view class="label" v-if="item.reserveOne">{{item.reserveOne}}</view>
  36. <view class="date">{{formatDate(item.createDate)}}</view>
  37. </view>
  38. </view>
  39. <view class="loading" v-if="showLoading && token">
  40. <u-loadmore :status="status" iconType="flower" :load-text="{loading: $t('Loading')}" margin-top="200"/>
  41. </view>
  42. <view class="nodata" v-if="!showLoading && dataList.length==0" style="text-align: center;margin-top: 120upx;">
  43. <view class="imgBox" style="height:600upx;margin-bottom:60upx">
  44. <image src="../../../static/img/public/7.png" style="width: 80%;margin:0 10%" mode="widthFix"></image>
  45. </view>
  46. <text style="font-size: 30upx;color:#ccc">{{$t('common.Nodata')}}</text>
  47. </view>
  48. <u-toast ref="uToast" />
  49. </view>
  50. </template>
  51. <script>
  52. import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
  53. export default {
  54. name:'MyApplication',
  55. components:{
  56. UNavbar
  57. },
  58. data(){
  59. return {
  60. menuIndex:0,
  61. scrollTop: 0,
  62. userId:'',
  63. token:'',
  64. title:'',
  65. old: {
  66. scrollTop: 0
  67. },
  68. status:'loading',
  69. showLoading:true,
  70. menuList:[
  71. {
  72. id:0,
  73. name:this.$t('common.MemberApply'),
  74. path : "/pages/service/others/applicationDetial",
  75. },{
  76. id:1,
  77. name:this.$t('common.Alliance'),
  78. path : "/pages/service/others/applicationDetial",
  79. },{
  80. id:2,
  81. // name:'定制服务',
  82. name:this.$t('common.CustomServiceApply'),
  83. path : "/pages/service/others/applicationDetial",
  84. },{
  85. id:3,
  86. // name:'资助洽商',
  87. name:this.$t('common.Donation'),
  88. path : "/pages/service/others/applicationDetial",
  89. },{
  90. id:4,
  91. // name:'资源共享申请',
  92. name:this.$t('common.ResourceSharingApplication'),
  93. path : "/pages/service/others/applicationDetial",
  94. }
  95. ],
  96. dataList:[],
  97. }
  98. },
  99. onLoad(e){
  100. this.title= this.$i18n.locale == 'zh'? '我的申请': 'My Application'
  101. },
  102. onShow(){
  103. this.menuIndex = uni.getStorageSync('myApplicationMenuIndex')?parseInt(uni.getStorageSync('myApplicationMenuIndex')):0
  104. this.token=uni.getStorageSync('Auth-Token')?'Bearer '+uni.getStorageSync('Auth-Token'):'';
  105. this.userId = uni.getStorageSync('user')? JSON.parse(uni.getStorageSync('user')).id:'';
  106. this.showDifferentContent(this.menuIndex)
  107. },
  108. methods:{
  109. // 获取入会申请数据
  110. async getBaseMemberApplys(){
  111. if(this.token.length<=7){
  112. uni.navigateTo({url:"/pages/public/login?back=1"})
  113. }else{
  114. let res =await this.$myRequest({
  115. url:'/project/baseMemberApplys/getSelfMemberApply'
  116. })
  117. if(res.status==200){
  118. this.dataList = [];
  119. if(res.data.baseMemberApplies){
  120. var baseMemberApply = res.data.baseMemberApplies[0];
  121. this.dataList.push(baseMemberApply);
  122. }else this.dataList =[]
  123. }else{
  124. }
  125. this.showLoading=false;
  126. }
  127. },
  128. // 获取入盟申请数据
  129. async getBaseLeagueApplys(){
  130. let res =await this.$myRequest({
  131. url:'/project/baseLeagueApplys/getSelfAllianceApply',
  132. })
  133. if(res.status==200){
  134. if(res.data.baseLeagueApplyList){
  135. this.dataList=res.data.baseLeagueApplyList;
  136. }else this.dataList =[]
  137. }
  138. this.showLoading=false;
  139. },
  140. // 获取定制服务+资助洽商数据
  141. async getCoopCustomServices(type){
  142. let res =await this.$myRequest({
  143. url:'/project/coopCustomServices',
  144. data:{
  145. createBy:this.userId,
  146. serviceTypeDict:type
  147. }
  148. })
  149. if(res.status==200){
  150. if(res.data.coopCustomServices){
  151. this.dataList = res.data.coopCustomServices;
  152. }else this.dataList =[]
  153. }
  154. this.showLoading=false;
  155. },
  156. // 获取资源共享申请
  157. async getResourceShare(){
  158. let res =await this.$myRequest({
  159. url:'/resourceshare/baseResearchApplications/',
  160. data:{createBy:this.userId,pageNo:"1"}
  161. })
  162. if(res.status==200){
  163. if(res.data.baseResearchApplications){
  164. this.dataList = res.data.baseResearchApplications;
  165. }else this.dataList =[]
  166. }
  167. this.showLoading=false;
  168. },
  169. //切换选项卡
  170. showDifferentContent(index){
  171. if(this.menuIndex!=index){
  172. uni.setStorageSync('myApplicationMenuIndex',index);
  173. this.menuIndex=index;
  174. this.dataList= [];
  175. this.showLoading=true;
  176. }
  177. switch(index){
  178. case 0:
  179. this.getBaseMemberApplys();
  180. break;
  181. case 1:
  182. this.getBaseLeagueApplys();
  183. break;
  184. case 2:
  185. this.getCoopCustomServices(1);
  186. break;
  187. case 3:
  188. this.getCoopCustomServices(2);
  189. break;
  190. case 4:
  191. this.getResourceShare();
  192. break;
  193. }
  194. },
  195. //查看详情
  196. showDetial(item,index){
  197. if(this.menuList[this.menuIndex]['path']){
  198. console.log(this.menuList[this.menuIndex]['path']+'?id='+item.id+'&type='
  199. +this.menuList[this.menuIndex]['id']+'&title='+encodeURIComponent(this.menuList[this.menuIndex]['name']));
  200. uni.navigateTo({
  201. url:this.menuList[this.menuIndex]['path']+'?id='+item.id+'&type='+
  202. this.menuList[this.menuIndex]['id']+'&title='+encodeURIComponent(this.menuList[this.menuIndex]['name'])
  203. })
  204. }else {}
  205. },
  206. scroll(e){
  207. this.old.scrollTop = e.detail.scrollTop
  208. },
  209. //路由后退一步
  210. back(){
  211. // #ifdef H5
  212. history.back()
  213. // #endif
  214. // #ifndef H5
  215. uni.navigateBack()
  216. // #endif
  217. },
  218. }
  219. }
  220. </script>
  221. <style lang="scss" scoped>
  222. .my-application{
  223. color:#666;
  224. .bg{
  225. height:100%;
  226. background:#fdfdfd;
  227. position:fixed;
  228. bottom:0;
  229. left:0;
  230. right:0;
  231. z-index:-1;
  232. }
  233. .line-h{
  234. width:100%;
  235. height:2upx;
  236. background:#eee;
  237. }
  238. // 菜单
  239. .menus{
  240. width:750rpx;
  241. height:50upx;
  242. border-bottom:1px solid #f0f0f0;
  243. margin:30upx auto 0;
  244. }
  245. //内容
  246. .applicationContent{
  247. padding:2%;
  248. .item{
  249. display:flex;
  250. justify-content:space-between;
  251. border-bottom:2upx solid #e2e2e2;
  252. .label,.date{
  253. font-size:28upx;
  254. padding:0 26upx;
  255. height:100upx;
  256. line-height:100upx;
  257. color:#333;
  258. }
  259. .date{
  260. font-size:24upx;
  261. color:#aaa;
  262. }
  263. }
  264. }
  265. }
  266. </style>