index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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 | Date }}</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. 级别:<text style="color: #FB231F;">{{ userinfo.level | userLevel }}</text>
  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. 级别:<text style="color: #FB231F;">{{ userinfo.recom && userinfo.recom.level | userLevel }}</text>
  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. 级别:<text style="color: #FB231F;">{{ userinfo.agent && userinfo.agent.level | userLevel }}</text>
  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. // http://192.168.2.129:8080/#/?id=39517&crown_id=277&time=2021%2F09%2F08%2000%3A00%3A00
  113. export default {
  114. data() {
  115. return {
  116. headimg: 'https://api.app.cliu.cc/logo.jpg',
  117. id: '',
  118. crown_id: '',
  119. time: '',
  120. year: '',
  121. crown: {},
  122. data: {},
  123. userinfo: {}
  124. }
  125. },
  126. onLoad() {
  127. var date = new Date();
  128. this.year = date.getFullYear(); //获取完整的年份(4位)
  129. this.id = this.$route.query.id
  130. this.crown_id = this.$route.query.crown_id
  131. this.time = this.$route.query.time
  132. this.getUserInfo()
  133. },
  134. methods: {
  135. getUserInfo() {
  136. // id=39517&crown_id=277&time=
  137. GetCrownTeam({ crown_id: this.crown_id, time: this.time }).then(res => {
  138. if (res.code === 200) {
  139. this.data = res.data
  140. } else {
  141. uni.showToast({
  142. title: res.message || '获取失败',
  143. icon: 'none'
  144. })
  145. }
  146. }).catch(err => {})
  147. // ?id=39517&crown_id=277
  148. GetUserCertInfo({ id: this.id, crown_id: this.crown_id, time: this.time }).then(res => {
  149. if (res.code === 200) {
  150. this.crown = res.data.crown
  151. this.userinfo = res.data.users
  152. } else {
  153. uni.showToast({
  154. title: res.message || '获取失败',
  155. icon: 'none'
  156. })
  157. }
  158. }).catch(err => {})
  159. }
  160. },
  161. filters: {
  162. userLevel(level) {
  163. if (!level) return '公司'
  164. let out = ''
  165. switch (+level) {
  166. case 1:
  167. out = '销售主管'
  168. break;
  169. case 2:
  170. out = '销售经理'
  171. break;
  172. case 3:
  173. out = '代理公司'
  174. break;
  175. default:
  176. out = '待定'
  177. }
  178. return out;
  179. },
  180. getPhone(value) {
  181. if (value) {
  182. // var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
  183. return value.substr(0, 3) + '****' + value.substr(7)
  184. }
  185. },
  186. Date(value) {
  187. if(value) {
  188. var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
  189. return newDate[0]
  190. }
  191. },
  192. getNum(value) {
  193. if (value) {
  194. // var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
  195. return value
  196. } else {
  197. return 0
  198. }
  199. },
  200. getNickname(value) {
  201. if (value) {
  202. return value.length > 10 ? value.slice(0, 10) + '...' : value;
  203. }
  204. },
  205. parseMoney(money) {
  206. const reg = /(^[1-9][0-9]{0,12}([.][0-9]{0,2})?$)|(^0?(\.[0-9]{0,2})?$)/
  207. if (!money || !reg.test(money)) return '0.00'
  208. money = String(money)
  209. money = money.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
  210. return money
  211. }
  212. },
  213. }
  214. </script>
  215. <style lang="scss">
  216. .box {
  217. &_top {
  218. width: 100%;
  219. height: 280rpx;
  220. // position: relative;
  221. background:url('../../static/img/bg.png');
  222. background-size:cover;
  223. background-repeat:no-repeat;
  224. color: #fff;
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: flex-end;
  228. align-items: center;
  229. .image {
  230. width: 122rpx;
  231. height: 122rpx;
  232. border-radius: 50%;
  233. overflow: hidden;
  234. border: 2rpx solid #FFFFFF;
  235. }
  236. .name {
  237. font-size: 36rpx;
  238. margin-top: 15rpx;
  239. font-weight: bold;
  240. margin-bottom: 65rpx;
  241. }
  242. .phone {
  243. font-size: 30rpx;
  244. margin-top: 20rpx;
  245. font-weight: bold;
  246. }
  247. .tip {
  248. position: absolute;
  249. top: 112rpx;
  250. right: 0;
  251. width: 138rpx;
  252. height: 56rpx;
  253. font-size: 28rpx;
  254. color: #F50F04;
  255. text-align: center;
  256. line-height: 56rpx;
  257. padding-left: 10rpx;
  258. background: #FFCC00;
  259. border-radius: 42rpx 0rpx 0rpx 42rpx;
  260. }
  261. }
  262. &_bottom {
  263. width: 100%;
  264. background: #FFFFFF;
  265. border-radius: 32rpx 32rpx 0rpx 0px;
  266. margin-top: -40rpx;
  267. padding: 24rpx 0 0 0;
  268. // padding: 54rpx 0 0 30rpx;
  269. .li {
  270. margin: 0 24rpx;
  271. display: flex;
  272. justify-content: space-between;
  273. margin-bottom: 25rpx;
  274. &_item {
  275. width: 218rpx;
  276. height: 126rpx;
  277. border-radius: 8px;
  278. // padding: 14rpx 0;
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. flex-direction: column;
  283. color: #fff;
  284. font-size: 28rpx;
  285. font-weight: 400;
  286. .bold {
  287. font-size: 40rpx;
  288. // font-weight: bold;
  289. font-weight: 500;
  290. margin-bottom: 8rpx;
  291. }
  292. }
  293. .one {
  294. background: linear-gradient(90deg, #5B50FF 0%, #8D3EFF 100%);
  295. }
  296. .two {
  297. background: linear-gradient(93deg, #FF4646 0%, #FF893A 100%);
  298. }
  299. .three {
  300. background: linear-gradient(90deg, #00D59F 0%, #009AD1 100%);
  301. }
  302. }
  303. .nav {
  304. border-left: 2rpx solid #EEEEEE;
  305. margin-left: 30rpx;
  306. // height: 1100rpx;
  307. padding-bottom: 10rpx;
  308. .item {
  309. &_top {
  310. display: flex;
  311. align-items: flex-start;
  312. margin-left: -16rpx;
  313. text {
  314. color: #333;
  315. font-size: 32rpx;
  316. font-weight: bold;
  317. margin-left: 16rpx;
  318. margin-top: -7rpx;
  319. }
  320. }
  321. &_bottom {
  322. height: 162rpx;
  323. padding: 24rpx;
  324. background: #F5F5F5;
  325. border-radius: 16rpx;
  326. margin: 15rpx 24rpx 20rpx 24rpx;
  327. display: flex;
  328. align-items: flex-start;
  329. .image {
  330. width: 100rpx;
  331. height: 100rpx;
  332. border-radius: 8rpx;
  333. overflow: hidden;
  334. }
  335. .right {
  336. margin-left: 48rpx;
  337. height: 162rpx;
  338. display: flex;
  339. justify-content: space-between;
  340. flex-direction: column;
  341. color: #333333;
  342. .nickname {
  343. font-size: 34rpx;
  344. font-weight: bold;
  345. }
  346. text {
  347. font-size: 32rpx;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. }
  355. </style>