微信小程序之在线任务发布与接单平台(3)

评价模块:

//serviceshow.js
var app=getApp()
Page({
  data:{
    selected1:true,
    selected2:false,
    out_judge_s:{},
    out_judge_t:{},
    in_judge_s:{},
    in_judge_t:{},
    judge_s:{},
    judge_t:{},
    open_id:""
  },
  selected1:function(){
    var that2=this;
    this.setData({
      selected1:true,
      selected2:false
    })
    wx.getStorage({
      key: 'out_judge_t',
      success: function(res){
        // success
        that2.setData({
          judge_t:res.data
        })
      },
      fail: function(res) {
        // fail
      },
      complete: function(res) {
        // complete
      }
    })
      wx.getStorage({
      key: 'out_judge_s',
      success: function(res){
        // success
        that2.setData({
          judge_s:res.data
        })
      },
      fail: function(res) {
        // fail
      },
      complete: function(res) {
        // complete
      }
    })
  },
  selected2:function(){
    var that2=this;
    this.setData({
      selected1:false,
      selected2:true
    })
    wx.getStorage({
      key: 'in_judge_t',
      success: function(res){
        // success
        that2.setData({
          judge_t:res.data
        })
      },
      fail: function(res) {
        // fail
      },
      complete: function(res) {
        // complete
      }
    })
      wx.getStorage({
      key: 'in_judge_s',
      success: function(res){
        // success
        that2.setData({
          judge_s:res.data
        })
      },
      fail: function(res) {
        // fail
      },
      complete: function(res) {
        // complete
      }
    })
  },
  onLoad:function(options){
    // 生命周期函数--监听页面加载
    var that = this;
    app.getUserOpenid(function(openid){
        that.setData({
          open_id:openid
      })
    })
    //获取发出的服务评价
      wx.request({
        url: 'https://www.cc.com/get_me_judge.php',
        data: {
          open_id:that.data.open_id,
          flag:1
        },
        method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
        header: {'content-type': 'application/x-www-form-urlencoded'}, // 设置请求的 header
        success: function(res){
          // success
          wx.setStorageSync('out_judge_s', res.data)
          that.setData({
            judge_s: res.data
          })
        },
        fail: function(res) {
          // fail
        },
        complete: function(res) {
          // complete
        }
      })
      wx.request({
        url: 'https://www.cc.com/get_me_judge.php',
        data: {
          open_id:that.data.open_id,
          flag:0
        },
        method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
        header: {'content-type': 'application/x-www-form-urlencoded'}, // 设置请求的 header
        success: function(res){
          // success
          wx.setStorageSync('in_judge_s', res.data)
        },
        fail: function(res) {
          // fail
        },
        complete: function(res) {
          // complete
        }
      })
      wx.request({
        url: 'https://www.cc.com/get_me_judge2.php',
        data: {
          open_id:that.data.open_id,
          flag:1
        },
        method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
        header: {'content-type': 'application/x-www-form-urlencoded'}, // 设置请求的 header
        success: function(res){
          // success
          wx.setStorageSync('out_judge_t', res.data)
          that.setData({
            judge_t: res.data
          })
        },
        fail: function(res) {
          // fail
        },
        complete: function(res) {
          // complete
        }
      })
        wx.request({
        url: 'https://www.cc.com/get_me_judge2.php',
        data: {
          open_id:that.data.open_id,
          flag:0
        },
        method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
        header: {'content-type': 'application/x-www-form-urlencoded'}, // 设置请求的 header
        success: function(res){
          // success
          wx.setStorageSync('in_judge_t', res.data)  
        },
        fail: function(res) {
          // fail
        },
        complete: function(res) {
          // complete
        }
      })

  },
  onReady:function(){
    // 生命周期函数--监听页面初次渲染完成
    var that=this;
    wx.getStorage({
      key: 'out_judge_t',
      success: function (res) {
        // success
        that.setData({
          judge_t: res.data
        })
      },
      fail: function (res) {
        // fail
      },
      complete: function (res) {
        // complete
      }
    })
    wx.getStorage({
      key: 'out_judge_s',
      success: function (res) {
        // success
        that.setData({
          judge_s: res.data
        })
      },
      fail: function (res) {
        // fail
      },
      complete: function (res) {
        // complete
      }
    })
  },
  onShow:function(){
    // 生命周期函数--监听页面显示
    
  },
  onHide:function(){
    // 生命周期函数--监听页面隐藏
    
  },
  onUnload:function(){
    // 生命周期函数--监听页面卸载
  },
  onPullDownRefresh: function() {
    // 页面相关事件处理函数--监听用户下拉动作
    
  },
  onReachBottom: function() {
    // 页面上拉触底事件的处理函数
  },
  onShareAppMessage: function() {
    // 用户点击右上角分享
    return {
      title: 'title', // 分享标题
      desc: 'desc', // 分享描述
      path: 'path' // 分享路径
    }
  }
})

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值