详情小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

399 lines
10 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <view class="lf-w-100 lf-h-100">
  3. <view class="head-top">
  4. <view class="lf-row-between pic-top">
  5. <view class="lf-row-round">
  6. <view>
  7. <!-- <lf-image style="width: 160rpx;height: 160rpx;" src="../../static/logo.png"></lf-image> -->
  8. <lf-image :src="user.avatar" mode="widthFix" class="head-pic"></lf-image>
  9. </view>
  10. <view class="head-left">
  11. <view class="head-name" @click="clickEnter">
  12. <text>{{ user.number_nickname || '您未登录,点此登录' }}</text>
  13. <u-icon name="arrow-right lf-m-l-20"></u-icon>
  14. </view>
  15. <view class="head-text">{{ user.overall_state_text || '登录后以便获取更好的服务' }}</view>
  16. </view>
  17. </view>
  18. <!-- <view class="lf-bg-white span-btn1" @click="$url('/pages/my/bindPhone')">
  19. 绑定手机号
  20. </view> -->
  21. </view>
  22. <view class="adv">
  23. <view class="lf-row-between">
  24. <view>
  25. <view class="logo-my">
  26. <!-- <text class="lf-iconfont icon-dingzhi" style="font-size: 60rpx;color: white;"></text> -->
  27. <image src="../../static/images/read_line.png" mode="aspectFill" style="width: 60rpx;height: 60rpx;"></image>
  28. </view>
  29. </view>
  30. <view class="adv-content">
  31. <view class="lf-color-222 lf-font-32 lf-m-b-15">
  32. 红线数
  33. </view>
  34. <view class="lf-color-777 lf-font-26">促成您和心仪对象线下见面</view>
  35. </view>
  36. </view>
  37. <view class="lf-color-primary lf-font-32">
  38. {{ user.red_rope || 0 }}
  39. </view>
  40. </view>
  41. <!-- <view class="lf-row-between" style="height: 98rpx;padding: 0 32rpx;">
  42. <view class="lf-row-round lf-flex-column" @click="showRedthread()">
  43. <view class="lf-font-32 lf-color-white">0</view>
  44. <view class="lf-font-24 lf-color-white lf-p-t-20">红线</view>
  45. </view>
  46. <view class="lf-row-round lf-flex-column" @click="showPeachblossom()">
  47. <view class="lf-font-32 lf-color-white">5</view>
  48. <view class="lf-font-24 lf-color-white lf-p-t-20">桃花</view>
  49. </view>
  50. <view class="lf-row-round lf-flex-column" @click="$url('/pages/my/seeMe')">
  51. <view class="lf-font-32 lf-color-white">0</view>
  52. <view class="lf-font-24 lf-color-white lf-p-t-20">谁看过我</view>
  53. </view>
  54. <view class="lf-row-round lf-flex-column" @click="$url('/pages/my/likeMe')">
  55. <view class="lf-font-32 lf-color-white">0</view>
  56. <view class="lf-font-24 lf-color-white lf-p-t-20">喜欢我的</view>
  57. </view>
  58. <view class="lf-row-round lf-flex-column">
  59. <view class="lf-font-32 lf-color-white">70%</view>
  60. <view class="lf-font-24 lf-color-white lf-p-t-20">资料完整</view>
  61. </view>
  62. </view> -->
  63. <!-- <view class="head-top-wrap lf-w-100 lf-h-100">
  64. <view class="lf-w-100 tips-wrap">
  65. <view class="tips">
  66. <view class="lf-row-round lf-w-100 lf-h-100 lf-p-b-12">
  67. <view class="lf-color-white lf-font-28">VIP会员拥有专属权益</view>
  68. <view class="lf-bg-white span-btn" @click="$url('/pages/my/memberVip')">
  69. 了解详情
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view> -->
  75. </view>
  76. <view class="classify">
  77. <view class="card" v-for="(item,index) in list" :key="index" @click="clickTab(item)">
  78. <view class="lf-row-center" style="align-content: center;">
  79. <!-- <u-icon class="classify-icon" :name="item.icon"></u-icon> -->
  80. <image class="classify-icon" :src="item.pic" mode="aspectFill"></image>
  81. </view>
  82. <view>
  83. {{item.name}}
  84. </view>
  85. </view>
  86. </view>
  87. <view style="height: 30rpx;"></view>
  88. </view>
  89. </template>
  90. <script scoped="scoped">
  91. export default {
  92. data() {
  93. return {
  94. list: [
  95. {name: '我的红娘',icon:'github-circle-fill',path: '/pages/my/exclusiveMatch',pic: '../../static/my/red.png',check: true},
  96. {name: '实名认证',icon:'email',path: '/pages/my/authentication',pic: '../../static/my/authen.png',check: true},
  97. // {name: '我喜欢的',icon:'qzone',path: '/pages/my/collect',pic: '../../static/my/collect.png'},
  98. // {name: '我的动态',icon:'moments',path:'/pages/my/qzone',pic: '../../static/my/qzone.png'},
  99. // {name: '福利中心',icon:'red-packet',path:'/pages/my/welfare',pic: '../../static/my/welhare.png'},
  100. {name: '公众号',icon:'google-circle-fill',path:'/pages/my/officialAccount',pic: '../../static/my/public.png'},
  101. {name: '联系客服',icon:'kefu-ermai',path: '/pages/my/service',pic: '../../static/my/service.png'},
  102. // {name: '设置',icon:'setting',path: '/pages/my/setting',pic: '../../static/my/setting.png'}
  103. ],
  104. user: {}
  105. }
  106. },
  107. onLoad(){
  108. // #ifdef H5
  109. this.href_str = JSON.stringify(location.href);
  110. let options = this.strToObj();
  111. if(options.code){
  112. this.login(options.code)
  113. }else{
  114. let user_info = uni.getStorageSync('user_info');
  115. if(this.$isRight(user_info) && this.$isRight(user_info?.member?.weixin)){
  116. this.getData();
  117. }
  118. }
  119. // #endif
  120. },
  121. methods: {
  122. clickEnter(){
  123. if(this.$isRight(this.user)){
  124. this.$url('/pages/my/editInfo');
  125. }else{
  126. this.$url('/pages/login/index');
  127. }
  128. },
  129. clickTab(item){
  130. if(item.check && !this.$isRight(this.user)){
  131. this.$url('/pages/login/index');
  132. }else{
  133. this.$url(item.path);
  134. }
  135. },
  136. showRedthread() {
  137. uni.showModal({
  138. title: '红线说明',
  139. content: '红线可以用来联系其他会员,对方不接受则24小时后退还红线',
  140. showCancel: false,
  141. cancelText: '我知道了',
  142. confirmColor: '#E21196',
  143. success: res => {
  144. if (res.confirm) {
  145. console.log('用户点击确定');
  146. this.$url('/pages/my/getRedLine');
  147. }
  148. }
  149. });
  150. },
  151. showPeachblossom() {
  152. uni.showModal({
  153. title: '桃花说明',
  154. content: '桃花可以用来发布动态、评论等,签到可以获得桃花',
  155. showCancel: false,
  156. cancelText: '我知道了',
  157. confirmColor: '#E21196',
  158. success: function (res) {
  159. if (res.confirm) {
  160. console.log('用户点击确定');
  161. }
  162. }
  163. });
  164. },
  165. getData(){
  166. this.$http(this.API.API_UCENTER).then(res => {
  167. this.user = res.data.user;
  168. })
  169. },
  170. strToObj(){
  171. let val = this.href_str;
  172. let obj = {};
  173. if(!val) return obj;
  174. if(val.indexOf('?') < 0) return obj;
  175. let indexA = val.indexOf('?') + 1;
  176. let str = val.substr(indexA);
  177. str = str.substr(0, str.length - 1);
  178. let indexB = str.indexOf('#');
  179. if(indexB >= 0){
  180. str = str.substr(0, indexB);
  181. }
  182. let arr = str.split('&');
  183. arr.map(item => {
  184. let a = item.split('=');
  185. obj[a[0]] = a[1];
  186. });
  187. return obj;
  188. },
  189. login(code){
  190. this.$http(this.API.API_OFFICIAL_LOGIN, {
  191. code: code,
  192. scopes: 'snsapi_userinfo'
  193. }).then(res => {
  194. let user_info = res?.data?.user;
  195. uni.setStorageSync('user_info', user_info);
  196. var url = window.location.href; //获取当前页面的url
  197. if(url.indexOf("?")!=-1){ //判断是否存在参数
  198. url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
  199. window.history.pushState({}, 0, url);
  200. }
  201. if(user_info && this.$isRight(user_info?.member?.weixin)){
  202. this.getData();
  203. }else{
  204. this.$url('/pages/my/addWechatNumber'); // 如果微信号为空,就跳转让用户添加
  205. }
  206. }).catch(err => {
  207. console.log(err)
  208. })
  209. }
  210. }
  211. }
  212. </script>
  213. <style>
  214. page {
  215. background-color: #F5F5F5;
  216. }
  217. </style>
  218. <style lang="scss">
  219. .logo-my {
  220. width: 135rpx;
  221. height: 135rpx;
  222. background: linear-gradient(180deg, #FE3EA5 0%, #FE7251 100%);
  223. border-radius: 50%;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. margin-right: 15rpx;
  228. }
  229. .head-top {
  230. width: 100%;
  231. //隐藏部分
  232. // height: 480rpx;
  233. height: 320rpx;
  234. position: relative;
  235. z-index: 9;
  236. /* background-color: red; */
  237. }
  238. .head-top-wrap {
  239. width: 100%;
  240. height: 180rpx;
  241. /* z-index: -1; */
  242. overflow: hidden;
  243. position: relative;
  244. }
  245. .head-top::after {
  246. content: '';
  247. width: 184%;
  248. // height: 440rpx;
  249. height: 350rpx;
  250. position: absolute;
  251. left: -312rpx;
  252. top: 0;
  253. z-index: -1;
  254. // border-radius: 0 586px 586px/0 0 200rpx 200rpx;
  255. border-radius: 0 0 50% 50%;
  256. background: linear-gradient(180deg, #FE3EA5 0%, #FE7749 100%);
  257. }
  258. .tips-wrap {
  259. overflow: hidden;
  260. height: 660rpx;
  261. border-radius: 0 586px 586px/0 0 200rpx 200rpx;
  262. position: absolute;
  263. top: -494rpx;
  264. }
  265. .tips {
  266. width: 686rpx;
  267. height: 125rpx;
  268. background-color: #314177;
  269. border-radius: 20rpx;
  270. position: relative;
  271. bottom: -536rpx;
  272. left: 0;
  273. margin: 0 auto;
  274. }
  275. .span-btn {
  276. border-radius: 25rpx;
  277. width: 149rpx;
  278. height: 50rpx;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. font-size: 24rpx;
  283. color: #314177;
  284. }
  285. .head-pic {
  286. width: 160rpx;
  287. height: 160rpx;
  288. border: 5rpx solid #FFFFFF;
  289. border-radius: 50%;
  290. }
  291. .adv-pic {
  292. width: 135rpx;
  293. height: 135rpx;
  294. border-radius: 50%;
  295. margin-right: 15rpx;
  296. }
  297. .head-text {
  298. font-size: 28rpx;
  299. color: #FFFFFF;
  300. font-weight: 400;
  301. line-height: 40rpx;
  302. }
  303. .pic-top {
  304. padding: 48rpx 32rpx 40rpx 48rpx;
  305. }
  306. .span-btn1 {
  307. border-radius: 25rpx;
  308. width: 149rpx;
  309. height: 50rpx;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. font-size: 24rpx;
  314. color: #E21196;
  315. font-weight: 400;
  316. line-height: 33rpx;
  317. }
  318. .head-name {
  319. font-weight: 500;
  320. color: #FFFFFF;
  321. line-height: 45rpx;
  322. letter-spacing: 1rpx;
  323. font-size: 32rpx;
  324. }
  325. .head-left {
  326. padding: 20rpx;
  327. height: 160rpx;
  328. display: flex;
  329. flex-direction: column;
  330. justify-content: space-evenly;
  331. }
  332. .adv {
  333. width: 686rpx;
  334. height: 195rpx;
  335. background-color: white;
  336. border-radius: 20rpx;
  337. margin: -10rpx auto;
  338. display: flex;
  339. // padding: 0 0 0 30rpx;
  340. justify-content: space-around;
  341. align-items: center;
  342. }
  343. .adv-content {
  344. display: flex;
  345. flex-direction: column;
  346. justify-content: space-around;
  347. }
  348. .classify {
  349. width: 686rpx;
  350. display: flex;
  351. background-color: white;
  352. border-radius: 20rpx;
  353. margin: 0 auto;
  354. flex-wrap: wrap;
  355. padding: 38rpx 30rpx;
  356. margin-top: 170rpx;
  357. }
  358. .card {
  359. width: 116rpx;
  360. height: 116rpx;
  361. text-align: center;
  362. position: relative;
  363. overflow: hidden;
  364. margin-right: 54rpx;
  365. // margin-bottom: 68rpx;
  366. &:nth-child(4n) {
  367. margin-right: 0;
  368. }
  369. &:nth-child(n + 5) {
  370. margin-top: 68rpx;
  371. }
  372. }
  373. .classify-icon {
  374. height: 48rpx;
  375. width: 45rpx;
  376. font-size: 48rpx;
  377. margin-bottom: 22rpx;
  378. }
  379. </style>