myaccount.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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("get list----", res)
  113. //-3表示没有绑定任何平台
  114. if (res.data.code !== -3) {
  115. this.account = res.data.data
  116. for (var i = 0; i < this.account.length; i++) {
  117. this.account[i].show_fans_count = fansview(this.account[i].fans_count)
  118. for (var j = 0; j < this.list1.length; j++) {
  119. if (this.list1[j].id == this.account[i].platform_id) {
  120. this.account[i].platform_icon = this.list1[j].platform_icon
  121. this.list1.splice(j, 1)
  122. }
  123. }
  124. }
  125. }
  126. })
  127. },
  128. // 默认信息表
  129. getlist1() {
  130. return this.$https.get('/youngee/c/g/get-info-tables')
  131. .then(res => {
  132. console.log("get list1----", res)
  133. this.list1 = res.data.data.ThirdPlatform
  134. })
  135. },
  136. // 前往绑定账号
  137. // bindaccount(item) {
  138. // console.log("11", item)
  139. // uni.navigateTo({
  140. // url: '/page_mycenter/myinformation/bindaccount?platform_id=' + item.id
  141. // });
  142. // },
  143. //前往绑定抖音页面
  144. // 前往绑定账号
  145. bindaccount(item) {
  146. console.log("11", item);
  147. //绑定抖音平台
  148. if(item.id==2){
  149. uni.navigateTo({
  150. url: '/page_mycenter/bindaccounts/douyinbind'
  151. });
  152. }else{
  153. uni.navigateTo({
  154. url: '/page_mycenter/myinformation/bindaccount?platform_id=' + item.id
  155. });
  156. }
  157. },
  158. // 前往账号详情
  159. accountdetail(item) {
  160. uni.navigateTo({
  161. url: '/page_mycenter/myinformation/bindaccount?platform_id=' + item.platform_id +
  162. '&account_id=' + item
  163. .account_id
  164. });
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. view {
  171. font-size: 14px;
  172. line-height: inherit;
  173. }
  174. .menu {
  175. position: fixed;
  176. top: 180rpx;
  177. border-bottom: #FCCF41;
  178. background-color: #FFFFFF;
  179. justify-content: space-around;
  180. height: 5%;
  181. width: 100%;
  182. display: flex;
  183. z-index: 10;
  184. }
  185. .menu-item p {
  186. font-weight: 600;
  187. &.lor {
  188. border-bottom: 5rpx solid #F0D232;
  189. color: #F0D232;
  190. padding-bottom: 15rpx;
  191. }
  192. }
  193. .card {
  194. display: flex;
  195. align-items: center;
  196. // justify-content: space-between;
  197. width: 88%;
  198. padding: 24rpx;
  199. margin-top: 30rpx;
  200. border-radius: 10rpx;
  201. background-color: #ffffff;
  202. margin: 0 auto;
  203. box-shadow: 0px 0px 10rpx 2rpx #F4F4F4;
  204. }
  205. .Tasktext {
  206. display: inline-block;
  207. padding: 0 0 0 1%;
  208. width: 400rpx;
  209. }
  210. .Tasktext span {
  211. color: #333333;
  212. font-weight: 550;
  213. text-indent: 2em;
  214. font-size: 30rpx;
  215. }
  216. .Tasktext image {
  217. vertical-align: middle;
  218. width: 50rpx;
  219. height: 50rpx;
  220. display: inline-block;
  221. padding-right: 14rpx;
  222. }
  223. .dou {
  224. display: flex;
  225. width: 250rpx;
  226. }
  227. .dou p {
  228. display: inline-block;
  229. font-size: 30rpx;
  230. color: #333333;
  231. font-weight: 550;
  232. }
  233. .dou span {
  234. font-size: 24rpx;
  235. color: #666666;
  236. }
  237. </style>