123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- const app = getApp();
- Page({
- data: {
- information: '',
- optioninfo: '',
- adopticon: '',
- geifabulous:'',
- Fabulous:'',
- optionsuid: '',
- collection: '',
- options_img: '',
- uploadImages:[],
- albumimg:'',
- albumimgurl: '',
- },
- onLoad: function (options) {
- var that = this;
- app.postRequest('my/images/headurl', {}, function (res) {
- if (res.code == 201) {
- that.myheadurl = res.data.img
-
-
-
-
-
- }
- })
- getApp().showLoading();
- that.to_id = options.uid;
- that.setData({
- options_img: options.img
- })
-
- try {
- wx.setStorageSync('optionsuid', options.uid)
- } catch (e) {
- }
- var _optionsuid = wx.getStorageSync('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.data);
- if (res.code == 201) {
-
- var itemList = res.data.data;
-
- var items = [];
-
- for (let i in itemList) {
-
- items.push(res.data.url+itemList[i].img);
- }
- console.log(items);
- that.setData({
- uploadImages: items,
- albumimg: res.data.data,
- albumimgurl: res.data.url,
- })
- }
- })
-
- 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) {
-
- 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) {
-
- 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) {
-
-
- 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) {
-
-
- if (res.code == 201) {
- that.setData({
- geifabulous: res.data,
-
- })
- }else{
- that.setData({
- geifabulous: res.data,
-
- })
- }
- })
-
- let collection_url = 'circle/adore/collection';
- let collection_data = {
- uuid: this.data.optionsuid,
- };
- app.postRequest(collection_url, collection_data, function (res) {
-
- if (res.code == 201) {
- that.setData({
- collection: res.data,
-
- })
- } else {
- that.setData({
- collection: res.data,
-
- })
- }
- })
- },
- 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,
-
- })
- } else {
- that.setData({
- geifabulous: res.data,
-
- })
- }
- })
- },
- 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,
-
- })
- } else {
- that.setData({
- collection: res.data,
-
- })
- }
- })
- },
- 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 ;
- }
- app.Tips(res.msg);
- })
- }
- })
|