feedback.js 3.38 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
//hospitalList.js 医院列表 联系医院

// 网络请求工具类
var networkUtil = require('../../utils/network_util.js')
var api = require('../../utils/apiFile.js')
var app = getApp()
// 页码
var page = 0
// 地理位置信息
var latitude = 0
var longitude = 0
// 是否有更多
var hasMore = true

Page({
data: {
chooseOne: 0,
chooseTwo: 0,
chooseThree: 0,
content: "",
babyname:'',
babyid:'',
hpid:'',
networkutil:''
},
onLoad: function (e) {
// console.log('撒大大',e);
this.setData({
babyname:e.babyname,
babyid:wx.getStorageSync('erid'),
hpid:wx.getStorageSync('hospitalId'),
networkutil:networkUtil.Builing_Release_AppStore
})
wx.getSystemInfo({
success: function (res) {
// console.log(res)
var system = res.system
var number = system.split(" ")[1]
// console.log(system.split(" ")[1])
if (system.split(" ")[0] == "Android") {

if (number.split(".")[0] >= 6) {
console.log("beyond")
} else {
console.log("not beyond")
}
} else {
console.log("ios")
}



}
})

},
chooseOne: function () {
this.setData({
chooseOne: 1,
chooseTwo: 0,
chooseThree: 0,
})
},
chooseTwo: function () {
this.setData({
chooseOne: 0,
chooseTwo: 1,
chooseThree: 0,
})
},
chooseThree: function () {
this.setData({
chooseOne: 0,
chooseTwo: 0,
chooseThree: 1,
})
},
inputOver: function (e) {

var value = e.detail.value
this.setData({
content: value
})
},
submit2:function(){
wx.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
success: function (res) {
wx.navigateBack()
return
}
})

},
submit: function () {
if (this.data.content.length==0){
networkUtil.showErrorToast('请填写意见或建议')
return
}
if (this.data.chooseOne == 0 && this.data.chooseTwo == 0 && this.data.chooseThree == 0 ){
networkUtil.showErrorToast('选择反馈类型')
return
}
let type
if(this.data.chooseOne==1){
type=1
}else if(this.data.chooseTwo==1){
type=2
}else{
type=3
}
let params={
content:this.data.content,
publishId:this.data.babyid,
publishName:this.data.babyname,
type:type,
hospitalId:app.globalData.userInfo.hospitalId
}
networkUtil._post(api.addfeedback, params, function (res) {
if(res.data.errorcode==0){
wx.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
success: function (res) {
wx.navigateBack()
}
})

// console.log('res',res);
}
}, function (res) {
networkUtil.showErrorToast(res.errormsg)
},'application/json')
},
submit1:function(){
wx.navigateTo({
url: `/packageA/pages/feedbacklist/feedbacklist?id=${this.data.babyid}`
})
// networkUtil._get(api.getfeedback, {
// page:1,
// limit:10,
// babyId:this.data.babyid
// }, function(res) {

// }, function(res) {
// networkUtil.showErrorToast(res.errormsg)
// })
}
})