detail.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <extend name="public@base"/>
  2. <block name="css">
  3. <link rel="stylesheet" href="__TMPL__/public/assets/css/userwall.css">
  4. <style>
  5. </style>
  6. </block>
  7. <block name="body">
  8. <!--头图-->
  9. <div class="image_box">
  10. <div class="back_box">
  11. <span>
  12. <van-icon name="arrow-left" class="text-white" @click="toBack" size="30px"></van-icon>
  13. </span>
  14. </div>
  15. <div class="rq">
  16. <img src="__TMPL__/public/assets/images/userwall/rq.svg">
  17. 人气:{{user.star}}
  18. </div>
  19. <img :src="main_image" class="image" @click="toIntro"/>
  20. </div>
  21. <!--简介-->
  22. <div class="detail_describe">
  23. <div class="fl">
  24. <h3 class="ws">
  25. <span class="fz22">{{user.realname ? user.realname : user.username}}</span>
  26. <span class="fz16 text-gray">(ID:{{user.id}})</span>
  27. </h3>
  28. <p class="fz16 mt10">
  29. <van-icon
  30. :class="[user.sex == 1 ? 'icon-xingbie-nan text-blue' : 'icon-xingbie-nv text-pink','iconfont']"></van-icon>
  31. {{user.age}}岁
  32. ·
  33. {{user.high}}CM
  34. </p>
  35. </div>
  36. <div class="fr mr20" @click="clickFavorite">
  37. <van-icon name="star" :style="{color: is_favorite ? '#FF589B' : '#AAB8C2'}" size="35px"></van-icon>
  38. <p class="fz14 text-center">收藏</p>
  39. </div>
  40. <div class="clear"></div>
  41. </div>
  42. <van-tabs v-model="active" class="mt10">
  43. <!--基本资料-->
  44. <van-tab :key="0">
  45. <template #title>
  46. <span class="fz16">资料</span>
  47. </template>
  48. <div class="plr5 mt10 pb10">
  49. <div class="br8 bg-white bsd">
  50. <dl class="p15 pb10 cursor">
  51. <dt class="fb fz16 pb5 pr" @click="showDetail">
  52. <span class="bg-pink inline_block vam mr5 t_1 pr dian br"></span> 基本资料
  53. <span class="pa rt">
  54. <span class="show-more">查看更多</span>
  55. <van-icon name="arrow"></van-icon>
  56. </span>
  57. </dt>
  58. <dd class="fz14 pt10">
  59. <span class="ptb5 bg_span plr8 br mb5 dib">{{user.high ? user.high + 'CM' : '身高保密'}}</span>
  60. <span class="ptb5 bg_span plr8 br mb5 dib">{{user.weight ? user.weight + 'KG' : '体重保密'}}</span>
  61. <span class="ptb5 bg_span plr8 br mb5 dib">{{user.education}}</span>
  62. </dd>
  63. </dl>
  64. <dl class="p15 pb10">
  65. <dt class="fb fz16 pb5 pr" @click="mating_show = true">
  66. <span class="bg-pink inline_block vam mr5 t_1 pr dian br"></span> 择偶要求
  67. <span class="pa rt">
  68. <span class="show-more">查看更多</span>
  69. <van-icon name="arrow"></van-icon>
  70. </span>
  71. </dt>
  72. <dd class="fz14 pt10">
  73. <span class="ptb5 bg_span plr8 br mb5 dib">年龄:{{mating_age}}</span>
  74. <span class="ptb5 bg_span plr8 br mb5 dib">身高:{{mating_high}}</span>
  75. <span class="ptb5 bg_span plr8 br mb5 dib">体重:{{mating_weight}}</span>
  76. </dd>
  77. </dl>
  78. <dl class="p15 pb10">
  79. <dt class="fb fz16 pb5 pr">
  80. <span class="bg-pink inline_block vam mr5 t_1 pr dian br"></span> 爱情宣言
  81. </dt>
  82. <dd class="fz14 pb10 pt10 p-textarea">{{user.signature}}</dd>
  83. </dl>
  84. </div>
  85. </div>
  86. </van-tab>
  87. <!--相册-->
  88. <van-tab :key="0">
  89. <template #title>
  90. <span class="fz16">相册</span>
  91. </template>
  92. <div class="bg-white">
  93. <van-grid :border="false" :column-num="3">
  94. <van-grid-item v-for="(image,index) in images">
  95. <van-image :src="image" @click="photos(index)"></van-image>
  96. </van-grid-item>
  97. </van-grid>
  98. </div>
  99. </van-tab>
  100. </van-tabs>
  101. <!--收到的礼物-->
  102. <div class="plr5 mt10 pb10">
  103. <div class="br8 bg-white bsd">
  104. <dl class="p15 pb10 cursor">
  105. <dt class="fb fz16 pb5 pr" @click="showGift">
  106. <span class="bg-pink inline_block vam mr5 t_1 pr dian br"></span> 收到礼物
  107. <span class="pa rt">
  108. <van-icon name="arrow"></van-icon>
  109. </span>
  110. </dt>
  111. <dd class="fz14 pt10">
  112. <van-grid :column-num="5" :border="false">
  113. <van-grid-item @click="showGift">
  114. <van-icon name="point-gift" size="45" color="#FF589B"></van-icon>
  115. <span>送礼物</span>
  116. </van-grid-item>
  117. <van-grid-item v-for="value in user_gift">
  118. <van-image :src="value.gift.image"></van-image>
  119. <span>{{value.gift.name}}</span>
  120. </van-grid-item>
  121. </van-grid>
  122. </dd>
  123. </dl>
  124. </div>
  125. </div>
  126. <!--基本资料-->
  127. <van-popup v-model="detail_show" position="right" :style="{width: '100%',height: '100%'}">
  128. <van-nav-bar
  129. left-text="返回"
  130. @click-left="onClickLeft"
  131. >
  132. <template #title>
  133. <span class="fz18">{{user.username}}资料</span>
  134. </template>
  135. </van-nav-bar>
  136. <h3 class="fn fz16 color_red mb10 pt20 plr12">详细资料</h3>
  137. <van-cell-group>
  138. <van-cell title="UID" :value="user.id"></van-cell>
  139. <van-cell title="姓名" :value="user.username ? user.username : '对方还未填写'"></van-cell>
  140. <van-cell title="性别" :value="user.sex_text"></van-cell>
  141. <van-cell title="年龄" :value="user.age + '岁'"></van-cell>
  142. <van-cell title="身高" :value="user.high ? user.high + 'CM' : '保密'"></van-cell>
  143. <van-cell title="体重" :value="user.weight ? user.weight + 'KG' : '保密'"></van-cell>
  144. <van-cell title="婚姻状况" :value="user.marry"></van-cell>
  145. <van-cell title="学历" :value="user.education"></van-cell>
  146. <van-cell title="年收入" :value="user.income"></van-cell>
  147. <van-cell title="工作单位" :value="user.company"></van-cell>
  148. <van-cell title="职务" :value="user.job"></van-cell>
  149. <van-cell title="身份类型" :value="user.id_type"></van-cell>
  150. <van-cell title="家庭成员" :value="user.family.toString()"></van-cell>
  151. <van-cell title="籍贯" :value="user.native"></van-cell>
  152. <van-cell title="民族" :value="user.nation"></van-cell>
  153. <van-cell title="兴趣爱好" :value="user.hobby"></van-cell>
  154. </van-cell-group>
  155. <div class="split-block"></div>
  156. <h3 class="fn fz16 color_red mb10 pt20 plr12">工作生活</h3>
  157. <van-cell-group>
  158. <van-cell title="是否有房" :value="user.have_house"></van-cell>
  159. <van-cell title="是否有车" :value="user.have_car"></van-cell>
  160. <van-cell title="婚后是否愿意与父母同住" :value="user.with_parent_live"></van-cell>
  161. <van-cell title="宗教信仰" :value="user.faith"></van-cell>
  162. <van-cell title="是否吸烟" :value="user.smoke"></van-cell>
  163. <van-cell title="是否喝酒" :value="user.drink"></van-cell>
  164. </van-cell-group>
  165. </van-popup>
  166. <!--择偶要求-->
  167. <van-popup v-model="mating_show" position="right" :style="{width: '100%',height: '100%'}">
  168. <van-nav-bar
  169. left-text="返回"
  170. @click-left="mating_show = false"
  171. >
  172. <template #title>
  173. <span class="fz18">择偶要求</span>
  174. </template>
  175. </van-nav-bar>
  176. <van-cell-group>
  177. <van-cell title="年龄" :value="mating_age"></van-cell>
  178. <van-cell title="身高" :value="mating_high"></van-cell>
  179. <van-cell title="体重" :value="mating_weight"></van-cell>
  180. <van-cell title="籍贯" :value="mating.native"></van-cell>
  181. <van-cell title="学历" :value="mating.education"></van-cell>
  182. <van-cell title="年收入" :value="mating.income"></van-cell>
  183. <van-cell title="身份类型" :value="mating.id_type"></van-cell>
  184. <van-cell title="是否有房" :value="mating.have_house"></van-cell>
  185. <van-cell title="是否有车" :value="mating.have_car"></van-cell>
  186. <van-cell title="婚后是否愿意与父母同住" :value="mating.with_parent_live"></van-cell>
  187. <van-cell title="是否吸烟" :value="mating.smoke"></van-cell>
  188. <van-cell title="是否喝酒" :value="mating.drink"></van-cell>
  189. </van-cell-group>
  190. </van-popup>
  191. <!--送礼物-->
  192. <van-popup v-model="gift_show" round position="bottom">
  193. <div class="br8 bg-white bsd">
  194. <dl>
  195. <dt class="fz16 p15" style="border-bottom:1px solid #eee;">
  196. 送TA礼物,更好地表达你的心意
  197. </dt>
  198. <dd class="fz14 plr8 gift-grid">
  199. <van-grid :column-num="4" :border="false">
  200. <van-grid-item v-for="(item) in gift" @click="giveGift(item.id)">
  201. <van-image :src="item.image"></van-image>
  202. <span class="mt5 fz12">{{item.name}}</span>
  203. <p class="color_red ws mt10 fz12">{{item.money == 0 ? '免费' : item.money}}</p>
  204. </van-grid-item>
  205. </van-grid>
  206. </dd>
  207. </dl>
  208. </div>
  209. </van-popup>
  210. <!--底部-->
  211. <div style="width:100%;height:50px;"></div>
  212. <div class="detail_bottom bg-white">
  213. <div class="bottom_grid" @click="toHome">
  214. <van-icon name="home-o" size="25px"></van-icon>
  215. <span>首页</span>
  216. </div>
  217. <div class="bottom_grid" @click="clickSelect">
  218. <van-icon name="like" :style="{color: is_select ? '#FF589B' : '#AAB8C2'}" size="25px"></van-icon>
  219. <span>表明心意</span>
  220. </div>
  221. <div class="bottom_grid" @click="showGift">
  222. <van-icon name="point-gift-o" size="25px"></van-icon>
  223. <span>送礼物</span>
  224. </div>
  225. <div class="bottom_chat bg-pink" @click="chat">
  226. <van-icon name="chat-o" size="25px"></van-icon>
  227. {{is_friend ? '开始聊天' : '聊天邀请'}}
  228. </div>
  229. </div>
  230. <!--图片预览-->
  231. <van-image-preview
  232. v-model="image_show"
  233. :images="images"
  234. :start-position="image_index"
  235. >
  236. </van-image-preview>
  237. </block>
  238. <block name="script">
  239. <script>
  240. new Vue({
  241. el: '#app',
  242. data() {
  243. return {
  244. user: {$user},
  245. mating: {$mating},
  246. gift: {$gift},
  247. user_gift: {$user_gift},
  248. active: 0,
  249. image_show: false,
  250. image_index: 0,
  251. gift_show: false,
  252. detail_show: false,
  253. mating_show: false,
  254. is_favorite: {$is_favorite},
  255. is_select: {$is_select},
  256. is_friend: {$is_friend},
  257. };
  258. },
  259. methods: {
  260. photos(index) {
  261. this.image_index = index;
  262. this.image_show = true;
  263. },
  264. showGift() {
  265. this.gift_show = true;
  266. },
  267. toHome() {
  268. location.href = '/';
  269. },
  270. showDetail() {
  271. this.detail_show = true;
  272. },
  273. onClickLeft() {
  274. this.detail_show = false;
  275. },
  276. toBack() {
  277. history.back();
  278. },
  279. chat() {
  280. if ("{$user_id}" == this.user.id) {
  281. this.$toast('不能与自己聊天');
  282. return false;
  283. }
  284. let self = this;
  285. $.post("{:url('chat')}", {id: this.user.id}, function (json) {
  286. if (json.code == 1) {
  287. location.href = json.url;
  288. } else {
  289. self.$toast(json.msg);
  290. }
  291. }, 'json');
  292. },
  293. toIntro() {
  294. if ("{$user_id}" == this.user.id) {
  295. location.href = "{:url('my/intro')}";
  296. }
  297. },
  298. clickSelect() {
  299. let self = this;
  300. $.post("{:url('select')}", {id: self.user.id}, function (json) {
  301. self.$toast(json.msg);
  302. if (json.code == 1) {
  303. self.is_select = !self.is_select;
  304. }
  305. }, 'json');
  306. },
  307. clickFavorite() {
  308. let self = this;
  309. $.post("{:url('favorite')}", {id: self.user.id}, function (json) {
  310. self.$toast(json.msg);
  311. if (json.code == 1) {
  312. self.is_favorite = !self.is_favorite;
  313. }
  314. }, 'json');
  315. },
  316. giveGift(id) {
  317. let self = this;
  318. $.post("{:url('giveGift')}", {to_id: self.user.id, gift_id: id}, function (json) {
  319. self.$toast(json.msg);
  320. $.post("{:url('userGift')}", {id: self.user.id}, function (json) {
  321. self.gift_show = false;
  322. self.user_gift = json.data;
  323. }, 'json')
  324. }, 'json');
  325. },
  326. //多列选择器值
  327. getMatingValue(min, max, ext) {
  328. if (min === '' || max === '') {
  329. return '';
  330. }
  331. if (min === 0 && max === 0) {
  332. return '不限';
  333. }
  334. let min_ext = min + ext;
  335. if (min === 0) {
  336. min_ext = '不限';
  337. }
  338. let max_ext = max + ext;
  339. if (max === 0) {
  340. max_ext = '不限';
  341. }
  342. return `${min_ext}-${max_ext}`;
  343. },
  344. },
  345. computed: {
  346. main_image() {
  347. if (this.user.main_image) {
  348. return this.user.main_image
  349. } else {
  350. if ("{$user_id}" == this.user.id) {
  351. return '__TMPL__/public/assets/images/userwall/my_header.jpg';
  352. } else {
  353. return '__TMPL__/public/assets/images/userwall/no_image.png';
  354. }
  355. }
  356. },
  357. //年龄
  358. mating_age() {
  359. return this.getMatingValue(this.mating.min_age, this.mating.max_age, '岁');
  360. },
  361. //身高
  362. mating_high() {
  363. return this.getMatingValue(this.mating.min_high, this.mating.max_high, 'CM');
  364. },
  365. //体重
  366. mating_weight() {
  367. return this.getMatingValue(this.mating.min_weight, this.mating.max_weight, 'KG');
  368. },
  369. images() {
  370. let images = [];
  371. for (let i = 0; i < this.user.more.length; i++) {
  372. if (this.user.more[i]) {
  373. images.push(this.user.more[i].url);
  374. }
  375. }
  376. return images;
  377. },
  378. }
  379. });
  380. </script>
  381. </block>