myaccount.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view v-if="!loading">
  7. <!-- 已经绑定的账号-->
  8. <view class="card" style="margin-top: 2%;" v-for="item in account" @click="accountdetail(item)">
  9. <view class="Tasktext">
  10. <image :src="item.platform_icon" mode=""></image>
  11. <span>{{item.platform_nickname}}</span>
  12. </view>
  13. <view class="dou">
  14. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  15. <p>{{item.show_fans_count}}</p>
  16. </view>
  17. <view class="clickkk">
  18. <image :src="togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view v-if="!loading">
  23. <!-- 未绑定的 -->
  24. <view class="card" style="margin-top: 2%;" v-for="item in list1">
  25. <view class="Tasktext" @click="bindaccount(item)">
  26. <image :src="item.platform_icon" mode=""></image>
  27. <span>绑定{{item.platform_name}}账号</span>
  28. </view>
  29. <view class="dou"></view>
  30. <view class="clickkk" @click="bindaccount(item)">
  31. <image :src="togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="" style="width: 100%;height: 200rpx;">
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import mvBar from "@/components/mys_navBar/mysNavBar";
  41. import {
  42. fansview
  43. } from '@/components/utils.js';
  44. export default {
  45. components: {
  46. mvBar,
  47. },
  48. data() {
  49. return {
  50. navH: getApp().globalData.navHeight,
  51. loading: false,
  52. togoimg: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/task16.png',
  53. list1: [],
  54. account: [],
  55. mysNavConfig: {
  56. /* 开启单页显示首页图标 */
  57. isHome: true,
  58. /* 固定导航 */
  59. navFixed: true,
  60. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  61. navTitle: {
  62. text: "社媒账号绑定",
  63. color: "",
  64. fontSize: "32rpx", // px upx rpx
  65. fontWeight: "normal", // 100 - 700
  66. },
  67. btnType: "type2",
  68. onLeftClick: '',
  69. /* type2 按钮 */
  70. type2Config: {
  71. // 左图标
  72. leftPath: "/static/img/png2.png",
  73. // 右图标
  74. rightPath: "/static/img/png4.png",
  75. // 圆角
  76. radius: "40rpx",
  77. },
  78. },
  79. }
  80. },
  81. async onShow() {
  82. this.loading = true;
  83. uni.showLoading({
  84. title: '加载中'
  85. });
  86. await this.getlist1()
  87. await this.getlist()
  88. uni.hideLoading();
  89. this.loading = false;
  90. },
  91. onLoad() {},
  92. methods: {
  93. tomylocation() {
  94. uni.navigateTo({
  95. url: './mylocation'
  96. });
  97. },
  98. topersoninfo() {
  99. uni.navigateTo({
  100. url: './personinfo'
  101. });
  102. },
  103. tomybank() {
  104. uni.navigateTo({
  105. url: './mybank'
  106. });
  107. },
  108. // 信息表
  109. getlist() {
  110. return this.$https.get('/youngee/c/t/g/get-talent-account')
  111. .then(res => {
  112. console.log(res)
  113. if (res.data.code !== -3) {
  114. this.account = res.data.data
  115. for (var i = 0; i < this.account.length; i++) {
  116. this.account[i].show_fans_count = fansview(this.account[i].fans_count)
  117. for (var j = 0; j < this.list1.length; j++) {
  118. if (this.list1[j].id == this.account[i].platform_id) {
  119. this.account[i].platform_icon = this.list1[j].platform_icon
  120. this.list1.splice(j, 1)
  121. }
  122. }
  123. }
  124. }
  125. })
  126. },
  127. // 默认信息表
  128. getlist1() {
  129. return this.$https.get('/youngee/c/g/get-info-tables')
  130. .then(res => {
  131. console.log(res)
  132. this.list1 = res.data.data.ThirdPlatform
  133. })
  134. },
  135. // 前往绑定账号
  136. bindaccount(item) {
  137. console.log("11", item)
  138. uni.navigateTo({
  139. url: '/pages/mycenter/myinformation/bindaccount?platform_id=' + item.id
  140. });
  141. },
  142. // 前往账号详情
  143. accountdetail(item) {
  144. uni.navigateTo({
  145. url: '/pages/mycenter/myinformation/bindaccount?platform_id=' + item.platform_id +
  146. '&account_id=' + item
  147. .account_id
  148. });
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. view {
  155. font-size: 14px;
  156. line-height: inherit;
  157. }
  158. .menu {
  159. position: fixed;
  160. top: 180rpx;
  161. border-bottom: #FCCF41;
  162. background-color: #FFFFFF;
  163. justify-content: space-around;
  164. height: 5%;
  165. width: 100%;
  166. display: flex;
  167. z-index: 10;
  168. }
  169. .menu-item p {
  170. font-weight: 600;
  171. &.lor {
  172. border-bottom: 5rpx solid #F0D232;
  173. color: #F0D232;
  174. padding-bottom: 15rpx;
  175. }
  176. }
  177. .card {
  178. display: flex;
  179. align-items: center;
  180. // justify-content: space-between;
  181. width: 88%;
  182. padding: 24rpx;
  183. margin-top: 30rpx;
  184. border-radius: 10rpx;
  185. background-color: #ffffff;
  186. margin: 0 auto;
  187. box-shadow: 0px 0px 10rpx 2rpx #F4F4F4;
  188. }
  189. .Tasktext {
  190. display: inline-block;
  191. padding: 0 0 0 1%;
  192. width: 400rpx;
  193. }
  194. .Tasktext span {
  195. color: #333333;
  196. font-weight: 550;
  197. text-indent: 2em;
  198. }
  199. .Tasktext image {
  200. vertical-align: middle;
  201. width: 50rpx;
  202. height: 50rpx;
  203. display: inline-block;
  204. padding-right: 14rpx;
  205. }
  206. .dou {
  207. display: flex;
  208. width: 250rpx;
  209. }
  210. .dou p {
  211. display: inline-block;
  212. font-size: 26rpx;
  213. color: #333333;
  214. font-weight: 550;
  215. }
  216. .dou span {
  217. font-size: 24rpx;
  218. color: #666666;
  219. }
  220. </style>