index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="page">
  3. <view class="header">
  4. <view class="left">
  5. <image class="img" mode="widthFix" src="../../static/home/top_title.png"></image>
  6. </view>
  7. </view>
  8. <view class="topbanner">
  9. <view class="left" @click="goPage('/pages/index/ai_pp')">
  10. <image class="aibg" mode="widthFix" src="../../static/home/ai_bg.png"></image>
  11. <view class="title">AI匹配</view>
  12. <view class="desc">遇见那个TA</view>
  13. <view class="btn">开始匹配</view>
  14. </view>
  15. <view class="right">
  16. <view class="item1" @click="goPage('/pages/index/peopleList')">
  17. <image class="meinv" mode="widthFix" src="../../static/home/meinv.png"></image>
  18. <view class="title">兴趣交友</view>
  19. <view class="desc">开启真挚交友</view>
  20. </view>
  21. <view class="item2" @click="goArticle">
  22. <image class="talk" mode="widthFix" src="../../static/home/talk.png"></image>
  23. <view class="title">热门动态</view>
  24. <view class="desc">点燃思想火花</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="centerbanner" v-if="false">
  29. <view class="item1">
  30. <image class="icon" mode="widthFix" src="../../static/home/talk2.png"></image>
  31. <view class="title">加密群聊</view>
  32. </view>
  33. <view class="item2">
  34. <image class="icon" mode="widthFix" src="../../static/home/nan.png"></image>
  35. <view class="title">AI男友</view>
  36. </view>
  37. <view class="item3">
  38. <image class="icon" mode="widthFix" src="../../static/home/nv.png"></image>
  39. <view class="title">AI女友</view>
  40. </view>
  41. </view>
  42. <view class="section-title">
  43. 热门动态
  44. </view>
  45. <view class="article_notify">
  46. <view class="left">
  47. <image class="icon" mode="widthFix" src="../../static/home/nv.png"></image>
  48. </view>
  49. <view class="right">
  50. <view class="title">热门动态
  51. <image class="icon" mode="widthFix" src="../../static/home/icon_vip.png" v-if="article.is_vip > 0">
  52. </image>
  53. </view>
  54. <view class="desc">{{article.content}}</view>
  55. </view>
  56. </view>
  57. <view class="section-title">
  58. 精选推荐
  59. </view>
  60. <view class="list">
  61. <view class="item" v-for="(item,index) of list" :key="index" @click="goHome(item.uid)">
  62. <view class="img">
  63. <image class="icon" mode="aspectFill" :src="item.avator"></image>
  64. </view>
  65. <view class="tit">
  66. <text class="name">{{item.nickname}}</text>
  67. <text class="juli">{{item.juli}}</text>
  68. </view>
  69. <view class="tag_list">
  70. <view class="tag">
  71. <image class="icon" mode="widthFix" src="../../static/home/icon_sex2.png"></image>
  72. <text>{{item.age}}</text>
  73. </view>
  74. <view class="tag2" v-if="item.ziye">
  75. <text>{{item.ziye}}</text>
  76. </view>
  77. <view class="tag2" v-if="item.xinzuo">
  78. <text>{{item.xinzuo}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="thread2"></view>
  84. <view class="thread2"></view>
  85. <wu-app-update></wu-app-update>
  86. </view>
  87. </template>
  88. <script>
  89. import pubc from '@/common/public.js'
  90. export default {
  91. components: {},
  92. data() {
  93. return {
  94. title: '',
  95. myinfo: {},
  96. article: {},
  97. list: [],
  98. lat: '',
  99. lng: '',
  100. }
  101. },
  102. onLoad() {
  103. let self = this;
  104. let that = this;
  105. // uni.getLocation({
  106. // type: 'wgs84',
  107. // success: function(res) {
  108. // that.lat = res.latitude;
  109. // that.lng = res.longitude;
  110. // },
  111. // fail: function(error) {
  112. // console.error('获取位置失败:', error);
  113. // }
  114. // });
  115. },
  116. onShow() {
  117. uni.$emit('check_update');
  118. this.loadData();
  119. // let hsign = pubc.Encrypt("aboa-wifl-kwfl-zjfk-wlaa" + getApp().globalData.uuid);
  120. // console.log("hsign", hsign)
  121. },
  122. methods: {
  123. goArticle() {
  124. uni.switchTab({
  125. url: '/pages/article/article'
  126. })
  127. },
  128. goHome(uid) {
  129. uni.navigateTo({
  130. url: '/pages/index/peopleHome?uid=' + uid
  131. })
  132. },
  133. goPage(path) {
  134. uni.navigateTo({
  135. url: path
  136. })
  137. },
  138. loadData() {
  139. console.log("headsign", getApp().globalData.headerSign);
  140. uni.request({
  141. url: this.$apiHost + '/Index/getAllInfo',
  142. data: {
  143. uuid: getApp().globalData.uuid,
  144. lat: this.lat,
  145. lng: this.lng
  146. },
  147. header: {
  148. "content-type": "application/json",
  149. 'sign': getApp().globalData.headerSign
  150. },
  151. success: (res) => {
  152. console.log("----:", res.data);
  153. if (res.data.need_login == "yes") {
  154. uni.removeStorageSync("wapptoken");
  155. uni.redirectTo({
  156. url: '/pages/login/login'
  157. });
  158. return;
  159. }
  160. if (res.data.need_edit == "yes") {
  161. uni.navigateTo({
  162. url: '/pages/my/step'
  163. });
  164. return;
  165. }
  166. this.myinfo = res.data;
  167. this.article = res.data.article;
  168. this.list = res.data.list;
  169. },
  170. complete: (com) => {
  171. // uni.hideLoading();
  172. },
  173. fail: (e) => {
  174. console.log("----e:", e);
  175. }
  176. });
  177. },
  178. }
  179. }
  180. </script>
  181. <style scoped lang="scss">
  182. @import 'index.scss';
  183. </style>