page1.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view class="box">
  3. <view class="box_top">
  4. <!-- <view class="tip">
  5. {{ userinfo.level | userLevel }}
  6. </view> -->
  7. <view class="image">
  8. <image :src="crown.headimgurl" mode="widthFix" style="width: 120rpx;"></image>
  9. </view>
  10. <view class="name">
  11. {{ crown.remark_name | getNickname }}
  12. </view>
  13. <!-- <view class="phone">
  14. {{ userinfo.mobile | getPhone }}
  15. </view> -->
  16. </view>
  17. <view class="box_bottom">
  18. <view class="li">
  19. <view class="li_item one">
  20. <text class="bold">{{ data.week | getNum }}</text>
  21. <text>近7日新增</text>
  22. </view>
  23. <view class="li_item two">
  24. <text class="bold">{{ data.month | getNum }}</text>
  25. <text>近30日新增</text>
  26. </view>
  27. <view class="li_item three">
  28. <text class="bold">{{ data.year | getNum }}</text>
  29. <text>{{ year }}累计新增</text>
  30. </view>
  31. </view>
  32. <view class="nav">
  33. <!-- <text style="margin-left: ;">2222</text> -->
  34. <view class="item">
  35. <view class="item_top" style="margin-bottom: 20rpx;align-items: center;">
  36. <image src="../../static/img/yuan.png" mode="widthFix" style="width: 33rpx;"></image>
  37. <text style="font-size: 30rpx;">授权时间:{{ userinfo.auth_startime }}</text>
  38. </view>
  39. </view>
  40. <view class="item">
  41. <view class="item_top">
  42. <image src="../../static/img/yuan.png" mode="widthFix" style="width: 33rpx;"></image>
  43. <text>新增代理</text>
  44. </view>
  45. <view class="item_bottom">
  46. <view class="iamge">
  47. <image :src="userinfo.headimgurl ? userinfo.headimgurl : headimg" mode="widthFix" style="width: 100rpx;"></image>
  48. </view>
  49. <view class="right">
  50. <view class="nickname">
  51. 昵称:{{ userinfo.nickname | getNickname }}
  52. </view>
  53. <text>
  54. 级别:{{ userinfo.level | userLevel }}
  55. </text>
  56. <text>
  57. 手机号:{{ userinfo.mobile | getPhone }}
  58. </text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="item">
  63. <view class="item_top">
  64. <image src="../../static/img/yuan.png" mode="widthFix" style="width: 33rpx;"></image>
  65. <text>推荐人</text>
  66. </view>
  67. <view class="item_bottom">
  68. <view class="iamge">
  69. <image :src="userinfo.recom && userinfo.recom.headimgurl ? userinfo.recom.headimgurl : headimg" mode="widthFix" style="width: 100rpx;"></image>
  70. </view>
  71. <view class="right">
  72. <view class="nickname">
  73. 昵称:{{ userinfo.recom && userinfo.recom.nickname | getNickname }}
  74. </view>
  75. <text>
  76. 级别:{{ userinfo.recom && userinfo.recom.level | userLevel }}
  77. </text>
  78. <text>
  79. 手机号:{{ userinfo.recom && userinfo.recom.mobile | getPhone }}
  80. </text>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="item">
  85. <view class="item_top">
  86. <image src="../../static/img/yuan.png" mode="widthFix" style="width: 33rpx;"></image>
  87. <text>上级代理</text>
  88. </view>
  89. <view class="item_bottom">
  90. <view class="iamge">
  91. <image :src="userinfo.agent && userinfo.agent.headimgurl ? userinfo.agent.headimgurl : headimg" mode="widthFix" style="width: 100rpx;"></image>
  92. </view>
  93. <view class="right">
  94. <view class="nickname">
  95. 昵称:{{ userinfo.agent && userinfo.agent.nickname | getNickname }}
  96. </view>
  97. <text>
  98. 级别:{{ userinfo.agent && userinfo.agent.level | userLevel }}
  99. </text>
  100. <text>
  101. 手机号:{{ userinfo.agent && userinfo.agent.mobile | getPhone }}
  102. </text>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import { GetUserCertInfo, GetCrownTeam } from '../../api/index.js';
  112. export default {
  113. data() {
  114. return {
  115. headimg: 'https://api.app.cliu.cc/logo.jpg',
  116. id: '',
  117. crown_id: '',
  118. year: '',
  119. crown: {},
  120. data: {},
  121. userinfo: {}
  122. }
  123. },
  124. onLoad() {
  125. var date = new Date();
  126. this.year = date.getFullYear(); //获取完整的年份(4位)
  127. this.id = this.$route.query.id
  128. this.crown_id = this.$route.query.crown_id
  129. this.getUserInfo()
  130. },
  131. methods: {
  132. getUserInfo() {
  133. GetUserCertInfo({ id: this.id, crown_id: this.crown_id }).then(res => {
  134. if (res.code === 200) {
  135. this.crown = res.data.crown
  136. this.userinfo = res.data.users
  137. console.log(this.userinfo)
  138. } else {
  139. uni.showToast({
  140. title: res.message || '获取失败',
  141. icon: 'none'
  142. })
  143. }
  144. }).catch(err => {})
  145. GetCrownTeam({ crown_id: this.crown_id }).then(res => {
  146. if (res.code === 200) {
  147. this.data = res.data
  148. } else {
  149. uni.showToast({
  150. title: res.message || '获取失败',
  151. icon: 'none'
  152. })
  153. }
  154. }).catch(err => {})
  155. }
  156. },
  157. filters: {
  158. userLevel(level) {
  159. if (!level) return '公司'
  160. let out = ''
  161. switch (+level) {
  162. case 1:
  163. out = '销售主管'
  164. break;
  165. case 2:
  166. out = '销售经理'
  167. break;
  168. case 3:
  169. out = '代理公司'
  170. break;
  171. default:
  172. out = '待定'
  173. }
  174. return out;
  175. },
  176. getPhone(value) {
  177. if (value) {
  178. // var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
  179. return value.substr(0, 3) + '****' + value.substr(7)
  180. }
  181. },
  182. getNum(value) {
  183. if (value) {
  184. // var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
  185. return value
  186. } else {
  187. return 0
  188. }
  189. },
  190. getNickname(value) {
  191. if (value) {
  192. return value.length > 10 ? value.slice(0, 10) + '...' : value;
  193. }
  194. }
  195. },
  196. }
  197. </script>
  198. <style lang="scss">
  199. .box {
  200. &_top {
  201. width: 100%;
  202. height: 280rpx;
  203. // position: relative;
  204. background:url('../../static/img/bg.png');
  205. background-size:cover;
  206. background-repeat:no-repeat;
  207. color: #fff;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: flex-end;
  211. align-items: center;
  212. .image {
  213. width: 122rpx;
  214. height: 122rpx;
  215. border-radius: 50%;
  216. overflow: hidden;
  217. border: 2rpx solid #FFFFFF;
  218. }
  219. .name {
  220. font-size: 36rpx;
  221. margin-top: 15rpx;
  222. font-weight: bold;
  223. margin-bottom: 65rpx;
  224. }
  225. .phone {
  226. font-size: 30rpx;
  227. margin-top: 20rpx;
  228. font-weight: bold;
  229. }
  230. .tip {
  231. position: absolute;
  232. top: 112rpx;
  233. right: 0;
  234. width: 138rpx;
  235. height: 56rpx;
  236. font-size: 28rpx;
  237. color: #F50F04;
  238. text-align: center;
  239. line-height: 56rpx;
  240. padding-left: 10rpx;
  241. background: #FFCC00;
  242. border-radius: 42rpx 0rpx 0rpx 42rpx;
  243. }
  244. }
  245. &_bottom {
  246. width: 100%;
  247. background: #FFFFFF;
  248. border-radius: 32rpx 32rpx 0rpx 0px;
  249. margin-top: -40rpx;
  250. padding: 24rpx 0 0 0;
  251. // padding: 54rpx 0 0 30rpx;
  252. .li {
  253. margin: 0 24rpx;
  254. display: flex;
  255. justify-content: space-between;
  256. margin-bottom: 25rpx;
  257. &_item {
  258. width: 218rpx;
  259. height: 98rpx;
  260. border-radius: 8px;
  261. padding: 14rpx 0;
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. flex-direction: column;
  266. color: #fff;
  267. font-size: 28rpx;
  268. .bold {
  269. font-size: 40rpx;
  270. font-weight: bold;
  271. margin-bottom: 10rpx;
  272. }
  273. }
  274. .one {
  275. background: linear-gradient(90deg, #5B50FF 0%, #8D3EFF 100%);
  276. }
  277. .two {
  278. background: linear-gradient(93deg, #FF4646 0%, #FF893A 100%);
  279. }
  280. .three {
  281. background: linear-gradient(90deg, #00D59F 0%, #009AD1 100%);
  282. }
  283. }
  284. .nav {
  285. border-left: 2rpx solid #EEEEEE;
  286. margin-left: 30rpx;
  287. // height: 1100rpx;
  288. padding-bottom: 10rpx;
  289. .item {
  290. &_top {
  291. display: flex;
  292. align-items: flex-start;
  293. margin-left: -16rpx;
  294. text {
  295. color: #333;
  296. font-size: 32rpx;
  297. font-weight: bold;
  298. margin-left: 16rpx;
  299. margin-top: -7rpx;
  300. }
  301. }
  302. &_bottom {
  303. height: 162rpx;
  304. padding: 24rpx;
  305. background: #F5F5F5;
  306. border-radius: 16rpx;
  307. margin: 15rpx 24rpx 20rpx 24rpx;
  308. display: flex;
  309. align-items: flex-start;
  310. .image {
  311. width: 100rpx;
  312. height: 100rpx;
  313. border-radius: 8rpx;
  314. overflow: hidden;
  315. }
  316. .right {
  317. margin-left: 48rpx;
  318. height: 162rpx;
  319. display: flex;
  320. justify-content: space-between;
  321. flex-direction: column;
  322. color: #333333;
  323. .nickname {
  324. font-size: 34rpx;
  325. font-weight: bold;
  326. }
  327. text {
  328. font-size: 32rpx;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. </style>