您的位置:首页 > 移动开发 > 微信开发

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

2018-03-31 09:26 316 查看
评价模块://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
4000
_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' // 分享路径
}
}
})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: