myaccount.vue 5.0 KB

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