12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- // pages/awaitState/awaitState.js
- var app = getApp()
- Page({
- data: {
- src : '',
- msg : '',
- url : '',
- name : '',
- order_number : '',
- order_userid :'',
- sendUserId : '',
- recHidden : false,
- sendHidden: false,
- time : '',
- uploadImg : []
- },
- onLoad: function (options) {
- var that = this;
- this.setData({
- src: options.src,
- msg: options.msg,
- url : options.url,
- name : options.name,
- order_number: options.order_number,
- order_userid: options.order_userid,
- time: options.time,
- uploadImg: JSON.parse(options.list)
- })
- console.log(options.list);
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- if (un_id != undefined && un_id != '' && un_id != null){
- wx.request({
- url: host + "forunionidapi/select",
- data: {
- user_id: un_id
- },
- method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- if (that.data.order_userid != res.data.unionid) {//当前浏览的用户为收礼物者
- that.setData({
- recHidden: true,
- sendHidden: false
- })
- } else {
- that.setData({
- sendHidden: true,
- recHidden: false
- })
- }
- that.setData({
- receiveUserId: res.code
- })
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- });
- }
-
- },
- selectWuliu : function(){
- var that = this;
- wx.navigateTo({
- url: '/pages/wuliu/wuliu?id=' + that.data.order_number,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- },
- wantSent : function(e){
- wx.switchTab({
- url: '/pages/index/index'
- })
- },
- previewImg: function (e) {//banner图预览
- var that = this;
- var currentUrl = e.currentTarget.dataset.src;
- wx.previewImage({
- current: currentUrl,
- urls: that.data.uploadImg.imgList
- })
- }
- })
|