myteam.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="head">
  7. <view class="show-income">
  8. <p>累计开团现金收益</p>
  9. <p style="margin-top: 20rpx;font-weight: 600;">¥{{moneyIncome}}</p>
  10. </view>
  11. <view class="show-income">
  12. <p>累计开团积分收益</p>
  13. <p style="margin-top: 20rpx;font-weight: 600;">{{pointIncome}}</p>
  14. </view>
  15. </view>
  16. <view class="content">
  17. <p>开团明细</p>
  18. <view>
  19. <uni-search-bar @confirm="search" :focus="true" cancelButton="none" v-model="searchValue">
  20. </uni-search-bar>
  21. </view>
  22. <view class="menu">
  23. <view class="menu-item" @click="toShow1()">
  24. <p v-bind:class="tab == 'exe'?'lor':'unlor'">开团中</p>
  25. </view>
  26. <view class="menu-item" @click="toShow2()">
  27. <p v-bind:class="tab == 'end'?'lor':'unlor'">已结束</p>
  28. </view>
  29. </view>
  30. <view class="team-list" v-if="tab == 'exe' && !loading">
  31. <view class="team-card" v-for="(item,index) in youngTeamList">
  32. <view class="project" @click="toTeamDetail(item)">
  33. <!-- 项目名称 -->
  34. <image class="platform-img" :src="item.platform_icon"></image>
  35. <p>{{item.project_name}}</p>
  36. <view @click="toProject()">
  37. <image class="togo-icon" :src="picture.icon_right"></image>
  38. </view>
  39. </view>
  40. <view class="team-info">
  41. <!-- young之团信息 -->
  42. <image class="project-img" :src="item.project_photo"></image>
  43. <view class="team-txt">
  44. <!-- 成团编码 -->
  45. <view style="display: flex;">
  46. <p>成团编码ID:{{item.team_id}}</p>
  47. <image :src="picture.icon_copy" mode=""
  48. style="padding-left:5rpx;width: 30rpx;height: 30rpx;"
  49. @click="handleCopy('item.team_id')" />
  50. </view>
  51. <!-- 人数信息 -->
  52. <p style="padding: 10rpx 0;">已报名:{{item.num_apply}}人 &nbsp; 申请成功:{{item.num_apply_success}}人
  53. &nbsp; 已结案:{{item.num_end}}人</p>
  54. <!-- 收益信息 -->
  55. <p style="font-weight: 600;">预计积分收益:{{item.point_income}} &nbsp;
  56. 预计现金收益:¥{{item.show_money_income}}</p>
  57. </view>
  58. </view>
  59. <view class="team-foot">
  60. <!-- 查看进度按钮 -->
  61. <button class="team-btn" @click="toTeamDetail(item)" type="default">查看进度</button>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="team-list" v-if="tab == 'end' && !loading">
  66. <view class="team-card" v-for="(item,index) in youngTeamList">
  67. <view class="project" @click="toTeamDetail(item)">
  68. <!-- 项目名称 -->
  69. <image class="platform-img" :src="item.platform_icon"></image>
  70. <p>{{item.project_name}}</p>
  71. <view @click="toProject()">
  72. <image class="togo-icon" :src="picture.icon_right"></image>
  73. </view>
  74. </view>
  75. <view class="team-info">
  76. <!-- young之团信息 -->
  77. <image class="project-img" :src="item.project_photo"></image>
  78. <view class="team-txt">
  79. <!-- 成团编码 -->
  80. <view style="display: flex;">
  81. <p>成团编码ID:{{item.team_id}}</p>
  82. <image :src="picture.icon_copy" mode=""
  83. style="padding-left:5rpx;width: 30rpx;height: 30rpx;"
  84. @click="handleCopy('item.team_id')" />
  85. </view>
  86. <!-- 人数信息 -->
  87. <p style="padding: 10rpx 0;">已报名:{{item.num_apply}}人 &nbsp; 申请成功:{{item.num_apply_success}}人
  88. &nbsp; 已结案:{{item.num_end}}人</p>
  89. <!-- 收益信息 -->
  90. <p style="font-weight: 600;">积分收益:{{item.point_income}} &nbsp;
  91. 现金收益:¥{{item.show_money_income}}</p>
  92. </view>
  93. </view>
  94. <view class="team-foot">
  95. <!-- 查看进度按钮 -->
  96. <button class="team-btn" @click="toTeamDetail(item)" type="default">查看历史纪录</button>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import mvBar from "@/components/mys_navBar/mysNavBar";
  105. import {
  106. fansview,
  107. money
  108. } from '@/components/utils.js';
  109. import {
  110. showLoading
  111. } from "../../uni_modules/sakura-canvas/js_sdk/util";
  112. export default {
  113. components: {
  114. mvBar,
  115. },
  116. data() {
  117. return {
  118. navH: getApp().globalData.navHeight,
  119. picture: getApp().globalData.picture,
  120. mysNavConfig: {
  121. /* 开启单页显示首页图标 */
  122. isHome: true,
  123. /* 固定导航 */
  124. navFixed: true,
  125. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  126. navTitle: {
  127. text: "YOUNG之团",
  128. color: "",
  129. fontSize: "32rpx", // px upx rpx
  130. fontWeight: "normal", // 100 - 700
  131. },
  132. btnType: "type2",
  133. onLeftClick: "/pages/mycenter/mycenter",
  134. /* type2 按钮 */
  135. type2Config: {
  136. // 左图标
  137. leftPath: "/static/img/png2.png",
  138. // 右图标
  139. rightPath: "/static/img/png4.png",
  140. // 圆角
  141. radius: "40rpx",
  142. },
  143. },
  144. loading: false,
  145. platformList: [],
  146. searchValue: "",
  147. showList1: false,
  148. showList2: false,
  149. tab: 'exe',
  150. status: 2,
  151. moneyIncome: 0.0,
  152. pointIncome: 0,
  153. youngTeamList: [],
  154. }
  155. },
  156. async onLoad(options) {
  157. // 判断登录
  158. await this.isLogin();
  159. if (this.token === '') {
  160. uni.showModal({
  161. content: '请先登录',
  162. success: function(res) {
  163. if (res.confirm) {
  164. uni.navigateTo({
  165. url: '/pages/login/login'
  166. });
  167. } else if (res.cancel) {
  168. uni.navigateBack();
  169. }
  170. }
  171. });
  172. }
  173. await this.getInfoList()
  174. let data = options.textObj.replace(/""/g, "");
  175. data = JSON.parse(decodeURIComponent(data))
  176. this.tab = data.tab
  177. this.status = this.tab === 'exe' ? 2 : 3
  178. this.getYoungTeam()
  179. },
  180. methods: {
  181. // 判断登陆是否过期
  182. isLogin() {
  183. return this.$https.get('/youngee/c/t/g/is-login')
  184. .then(res => {
  185. if (res.data.code === 403) {
  186. // 登陆已失效
  187. this.token = ""
  188. uni.clearStorage();
  189. } else {
  190. this.token = uni.getStorageSync('token')
  191. }
  192. })
  193. },
  194. async search(res) {
  195. uni.showToast({
  196. title: '搜索:' + res.value,
  197. icon: 'none'
  198. })
  199. },
  200. handleCopy(text) {
  201. wx.setClipboardData({
  202. data: text,
  203. success: function(res) {
  204. console.log("复制成功");
  205. }
  206. });
  207. },
  208. toShow1() {
  209. this.tab = 'exe';
  210. this.status = 2
  211. this.getYoungTeam()
  212. },
  213. toShow2() {
  214. this.tab = 'end';
  215. this.status = 3
  216. this.getYoungTeam()
  217. },
  218. async getYoungTeam() {
  219. this.loading = true;
  220. uni.showLoading({
  221. title: '加载中'
  222. });
  223. await this.$https.get('/youngee/c/t/g/get-younggee-team-list?' +
  224. 'status=' +
  225. this.status)
  226. .then(res => {
  227. if (res.data.code === 0) {
  228. this.youngTeamList = res.data.data.young_team_list
  229. let num = res.data.data.num
  230. this.moneyIncome = money(res.data.data.money_income)
  231. this.pointIncome = res.data.data.point_income
  232. for (let i = 0; i < num; ++i) {
  233. this.youngTeamList[i].platform_icon = this.platformList[this.youngTeamList[
  234. i]
  235. .platform - 1].platform_icon
  236. this.youngTeamList[i].show_money_income = money(this.youngTeamList[i]
  237. .money_income)
  238. }
  239. }
  240. })
  241. uni.hideLoading();
  242. this.loading = false;
  243. },
  244. getInfoList() {
  245. return this.$http.get('/youngee/c/g/get-info-tables')
  246. .then(res => {
  247. if (res.data.code === 0) {
  248. this.platformList = res.data.data.ThirdPlatform
  249. }
  250. })
  251. },
  252. }
  253. }
  254. </script>
  255. <style>
  256. /deep/ .uni-searchbar__box-search-input {
  257. font-size: 32rpx !important;
  258. }
  259. </style>
  260. <style lang="scss" scoped>
  261. p {
  262. font-size: 32rpx;
  263. }
  264. .head {
  265. margin: 10rpx 3%;
  266. border-radius: 15rpx;
  267. background-color: #f0d232;
  268. height: 200rpx;
  269. display: flex;
  270. align-items: center;
  271. justify-content: space-around;
  272. }
  273. .show-income {
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. }
  278. .content {
  279. margin: 30rpx 3%;
  280. }
  281. .menu {
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-around;
  285. }
  286. .menu-item p {
  287. font-weight: 600;
  288. &.lor {
  289. border-bottom: 5rpx solid #F0D232;
  290. color: #F0D232;
  291. padding-bottom: 15rpx;
  292. }
  293. &.unlor {
  294. color: #81838f;
  295. padding-bottom: 15rpx;
  296. border-bottom: 5rpx solid #ffffff;
  297. }
  298. }
  299. .point-card {
  300. display: flex;
  301. justify-content: space-between;
  302. align-items: center;
  303. }
  304. .point-card-left {
  305. display: flex;
  306. flex-direction: column;
  307. justify-content: start;
  308. }
  309. .point-card-right p {
  310. color: #f0d232;
  311. font-weight: 600;
  312. }
  313. .team-list {
  314. padding: 20rpx 0;
  315. }
  316. .team-card {
  317. margin: 20rpx 0;
  318. display: flex;
  319. flex-direction: column;
  320. // justify-content: start;
  321. }
  322. .project {
  323. display: flex;
  324. align-items: center;
  325. }
  326. .project p {
  327. font-weight: 600;
  328. }
  329. .platform-img {
  330. width: 40rpx;
  331. height: 40rpx;
  332. // background-color: #F0D232;
  333. margin-right: 10rpx;
  334. }
  335. .togo-icon {
  336. width: 30rpx;
  337. height: 30rpx;
  338. }
  339. .team-info {
  340. margin: 20rpx 0;
  341. display: flex;
  342. justify-content: start;
  343. align-items: center;
  344. }
  345. .project-img {
  346. width: 120rpx;
  347. height: 120rpx;
  348. background-color: #b3c96b;
  349. }
  350. .team-txt {
  351. margin-left: 10rpx;
  352. display: flex;
  353. flex-direction: column;
  354. }
  355. .team-txt p {
  356. font-size: 28rpx;
  357. }
  358. .team-foot {
  359. padding: 0 20rpx;
  360. text-align: right;
  361. }
  362. .team-btn::after {
  363. border: none;
  364. }
  365. .team-btn {
  366. display: inline-block;
  367. width: 250rpx;
  368. border: 1rpx solid #F0D232;
  369. background-color: #ffffff;
  370. border-radius: 15rpx;
  371. font-size: 28rpx;
  372. line-height: 200%;
  373. }
  374. </style>