123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- const app = getApp();
- Page({
- data: {
- information: '', //个人信息
- optioninfo: '', //择偶信息
- adopticon: '', //认证信息
- geifabulous:'', //获取点赞
- Fabulous:'', // 点赞
- optionsuid: '', //用户uid
- collection: '', //收藏
- options_img: '', //头像
- uploadImages:[], //相册放大图集
- albumimg:'', // 相册
- albumimgurl: '',// 相册url
- watermark: '',
- },
- onLoad: function (options) {
- var that = this;
-
- app.postRequest('my/images/headurl', {}, function (res) {
- if (res.code == 201) {
- that.myheadurl = res.data.img
- // console.log(res);
- // that.setData({
- // myheadurl: res.data.img,
- // // optioninfocode: res,
- // })
- }
- })
- that.to_id = options.uid;
- that.setData({
- options_img: options.img //头像
- })
- // 同步传参
- try {
- wx.setStorageSync('optionsuid', options.uid)
- } catch (e) {
- }
- var _optionsuid = wx.getStorageSync('optionsuid');
- // console.log(_optionsuid)
- that.setData({
- optionsuid: _optionsuid
- })
-
- // 个人相册
- let albumimg_url = 'circle/frienddetails/albumimg';
- let albumimg_data = {
- uid: _optionsuid,
- };
- app.postRequest(albumimg_url, albumimg_data, function (res) {
- // console.log(res.data.url);
- console.log(res.data.data);
- if (res.code == 201) {
- // 对象转数组
- var itemList = res.data.data;
- //声明一个空的数组
- var items = [];
- //遍历数据
- for (let i in itemList) {
- //push到空数组里
- items.push(res.data.url + itemList[i].img + res.data.watermark);
- }
- console.log(items);
- that.setData({
- uploadImages: items,
- albumimg: res.data.data,
- albumimgurl: res.data.url,
- watermark: res.data.watermark,
- })
- }
- })
- // 个人信息
- let information_url = 'circle/frienddetails/details';
- let information_data = {
- uid: this.data.optionsuid,
- };
- app.postRequest(information_url, information_data, function (res) {
- if (res.code == 201) {
- // console.log(res.data);
- that.setData({
- information: res.data
- })
- }
- })
- // 择偶信息
- let optioninfo_url = 'circle/frienddetails/optiondetails';
- let optioninfo_data = {
- uid: this.data.optionsuid,
- };
- app.postRequest(optioninfo_url, optioninfo_data, function (res) {
- // console.log(res.data);
- if (res.code == 201) {
- that.setData({
- optioninfo: res.data,
- optioninfocode: res,
- })
- }
- })
- // 认证信息
- let adopticon_url = 'circle/frienddetails/authdetails';
- let adopticon_data = {
- uid: this.data.optionsuid,
- };
- app.postRequest(adopticon_url, adopticon_data, function (res) {
- // console.log(res.data);
- // console.log(res);
- if (res.code == 201) {
- that.setData({
- adopticon: res.data,
- adopticoncode: res,
- })
- }
- })
- // 获取点赞
- let appreciate_url = 'circle/adore/appreciate';
- let appreciate_data = {
- uuid: this.data.optionsuid,
- };
- app.postRequest(appreciate_url, appreciate_data, function (res) {
- // console.log(res.data);
-
- if (res.code == 201) {
- that.setData({
- geifabulous: res.data,
- // optioninfocode: res,
- })
- }else{
- that.setData({
- geifabulous: res.data,
- // optioninfocode: res,
- })
- }
- })
- // 获取收藏
- let collection_url = 'circle/adore/collection';
- let collection_data = {
- uuid: this.data.optionsuid,
- };
- app.postRequest(collection_url, collection_data, function (res) {
- // console.log(res.data);
- if (res.code == 201) {
- that.setData({
- collection: res.data,
- // optioninfocode: res,
- })
- } else {
- that.setData({
- collection: res.data,
- // optioninfocode: res,
- })
- }
- })
- },
- // 相册点击放大
- enlarge: function (e) {
- var that = this;
- console.log(that.data.uploadImages)
- wx.previewImage({
- urls: that.data.uploadImages ,
- current: e.currentTarget.dataset.src
- })
- },
- fabulousclick: function(e){
- var that = this ;
- // 点赞
- let appreciateform_url = 'circle/adore/appreciateform';
- let appreciateform_data = {
- uuid: this.data.optionsuid,
- };
- app.postRequest(appreciateform_url, appreciateform_data, function (res) {
- if (res.code == 201) {
- that.setData({
- geifabulous: res.data,
- // optioninfocode: res,
- })
- } else {
- that.setData({
- geifabulous: res.data,
- // optioninfocode: res,
- })
- }
- })
- },
- collectionformclick: function (e) {
- var that = this;
- // 点赞
- let collectionform_url = 'circle/adore/collectionform';
- let collectionform_data = {
- uuid: this.data.optionsuid,
- };
- app.postRequest(collectionform_url, collectionform_data, function (res) {
- if (res.code == 201) {
- that.setData({
- collection: res.data,
- // optioninfocode: res,
- })
- } else {
- that.setData({
- collection: res.data,
- // optioninfocode: res,
- })
- }
- })
- },
- toChat(e) { //跳转进入聊天页面
- let that = this;
- app.postRequest('circle/dialogue/validate', {}, function (res) {
- console.log(res);
- if (res.code == 201) {
- wx.navigateTo({
- url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
- });
- return ;
- }
- if (res.data.location == 'shiming') {
-
- wx.showModal({
- title: '实名认证',
- content: res.msg,
- success(res) {
- if (res.confirm) {
- // console.log('用户点击确定');
- wx.navigateTo({
- url: '/pages/personal_core/Realname/Realname'
- });
- } else if (res.cancel) {
- // console.log('用户点击取消')
- }
- }
- })
- }
- if (res.data.location == 'huiyuan') {
- wx.showModal({
- title: '开通会员',
- content: res.msg,
- success(res) {
- if (res.confirm) {
- // console.log('用户点击确定');
- wx.navigateTo({
- url: '/pages/payment/Member/Member'
- });
- } else if (res.cancel) {
- // console.log('用户点击取消')
- }
- }
- })
- }
- // if (res.data.location == shiming) {
- // wx.navigateTo({
- // url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
- // });
- // }
-
- // app.Tips(res.msg);
- })
- }
- })
|