服务相关模块:
已经发布的服务列表
//
var imageUtil = require('../../utils/util_image.js');
Page({
data:{
unit_type: ['次', '小时', '分钟', '单', '幅', '天', '周', '月', '份', '课时', '个', '面议'],
service_type: ['维修', '打印', '摄像', '代办跑腿', '顺风车'],
service: [],
imgUrls: [
'/img/task_show_banner/',
'/img/task_show_banner/'
],
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 1000
},
imageLoad: function (e) {
var imageSize = (e)
({
imagewidth: ,
imageheight:
})
},
service_detail:function(event){
var item2=;
var service1=;
var service2=service1[item2];
let service3=(service2);
({
url: '../servicedetail/servicedetail?service2='+service3,
success: function(res){
// success
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
},
request_data:function(e){
var that=this;
({
url: '/get_service.php',
data: {
},
method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
header: {'content-type': 'application/json'}, // 设置请求的 header
success: function(res){
// success
(
{
service:
}
)
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
},
onLoad:function(options){
// 生命周期函数--监听页面加载
this.request_data();
(getApp().)
},
onReady:function(){
// 生命周期函数--监听页面初次渲染完成
},
onShow:function(){
// 生命周期函数--监听页面显示
},
onHide:function(){
// 生命周期函数--监听页面隐藏
},
onUnload:function(){
// 生命周期函数--监听页面卸载
},
onPullDownRefresh: function() {
// 页面相关事件处理函数--监听用户下拉动作
('--------下拉刷新-------')
();
},
onReachBottom: function() {
// 页面上拉触底事件的处理函数
},
onShareAppMessage: function() {
// 用户点击右上角分享
return {
title: 'title', // 分享标题
desc: 'desc', // 分享描述
path: 'path' // 分享路径
}
}
})
服务详细内容:
//
var app=getApp();
Page({
data: {
unit_type: ['次', '小时', '分钟', '单', '幅', '天', '周', '月', '份', '课时', '个', '面议'],
service_type: ['维修', '打印', '摄像', '代办跑腿', '顺风车'],
service:{},
open_id:null
},
submit:function(){
var that=this;
({
url: '/',
data: {
flag:"sid",
stid:,
open_id:.open_id
},
method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
// header: {}, // 设置请求的 header
header:{
'content-type': 'application/x-www-form-urlencoded'
},
success: function(res){
// success
({
url: '../meservice/meservice',
success: function(res){
// success
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
},
onLoad:function(options){
// 生命周期函数--监听页面加载
var that =this;
(function(openid){
({
open_id:openid
})
})
({
service:(options.service2)
})
},
onReady:function(){
// 生命周期函数--监听页面初次渲染完成
},
onShow:function(){
// 生命周期函数--监听页面显示
},
onHide:function(){
// 生命周期函数--监听页面隐藏
},
onUnload:function(){
// 生命周期函数--监听页面卸载
},
onPullDownRefresh: function() {
// 页面相关事件处理函数--监听用户下拉动作
},
onReachBottom: function() {
// 页面上拉触底事件的处理函数
},
onShareAppMessage: function() {
// 用户点击右上角分享
return {
title: 'title', // 分享标题
desc: 'desc', // 分享描述
path: 'path' // 分享路径
}
}
})
个人服务页面:
//
var app=getApp()
Page({
data: {
unit_type: ['次', '小时', '分钟', '单', '幅', '天', '周', '月', '份', '课时', '个', '面议'],
service_type: ['维修', '打印', '摄像', '代办跑腿', '顺风车'],
selected1:true,
selected2:false,
service:[],
service2:[],
service3:[],
open_id:""
},
judge: function (event) {
var that = this;
var judged = ;
var ttid = ;
//var gotten = ;
/*if (!gotten) {
({
title: '等待接单中',
icon: 'loading',
duration: 2000
})
return;
}*/
if (judged == 1) {
({
title: '已评价',
content: '评价内容可在‘我的评价’中查看',
})
} else {
({
url: '../judge/judge?tid=' + ttid + '&flag=1',
})
}
},
selected1: function () {
({
selected1: true,
selected2: false
})
var that3 = this;
({
key: 'service',
success: function (res) {
// success
({
service3:
})
},
fail: function (res) {
// fail
},
complete: function (res) {
// complete
}
})
},
selected2: function () {
({
selected1: false,
selected2: true
})
var that2 = this;
({
key: 'service2',
success: function (res) {
// success
({
service3:
})
},
fail: function (res) {
// fail
},
complete: function (res) {
// complete
}
})
},
delete_service: function (event) {
var that = this;
var ssid = ;
(ssid)
({
url: '/',
data: {
flag: 1,
ssid:ssid
},
method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
header: { 'content-type': 'application/x-www-form-urlencoded' }, // 设置请求的 header
success: function (res) {
({
title: '删除',
content: '删除成功',
success:function(res){
()
}
})
},
fail: function (res) {
// fail
},
complete: function (res) {
// complete
}
})
},
onLoad:function(options){
// 生命周期函数--监听页面加载
var that = this;
(function(openid){
({
open_id:openid
})
})
({
url: '/get_me_service.php',
data: {
open_id:.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){
('service', )
({
service3:
})
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
({
url: '/get_me_service.php',
data: {
open_id:.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
('service2', )
},
fail: function(res) {
// fail
},
complete: function(res) {
// complete
}
})
},
onReady:function(){
// 生命周期函数--监听页面初次渲染完成
},
onShow:function(){
// 生命周期函数--监听页面显示
},
onHide:function(){
// 生命周期函数--监听页面隐藏
},
onUnload:function(){
// 生命周期函数--监听页面卸载
},
onPullDownRefresh: function() {
// 页面相关事件处理函数--监听用户下拉动作
},
onReachBottom: function() {
// 页面上拉触底事件的处理函数
},
onShareAppMessage: function() {
// 用户点击右上角分享
return {
title: 'title', // 分享标题
desc: 'desc', // 分享描述
path: 'path' // 分享路径
}
}
})