const api = require('../../../../../utils/api.js'); const login = require('../../../../../utils/index.js'); Page({ /** * 页面的初始数据 */ data: { data: [{ 'title': '整体满意度:' }, { 'title': '去现场次数满意度:' }, { 'title': '办事指南符合度:' }, { 'title': '办事效率:' }, { 'title': '服务质量:' }, { 'title': '网上体验:' }], items: [{ 'index': 1, 'name': '非常不满意' }, { 'index': 2, 'name': '不满意' }, { 'index': 2, 'name': '一般' },{ 'index': 3, 'name': '满意' },{ 'index': 4, 'name': '非常满意' }] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.data.projid=options.projid }, textarea:function(e){ this.data.text=e.detail.value }, assess:function(e){ console.log(e) this.data.data[e.currentTarget.dataset.index].ind = e.currentTarget.dataset.ind this.data.data[e.currentTarget.dataset.index].name = this.data.items[e.currentTarget.dataset.ind].name this.setData({ data: this.data.data }) }, submit:function(){ let that = this for(let i=0;i { that.data.userInfo = resolve console.log(that.data.userInfo) if(that.data.userInfo){ wx.request({ url: api.evaluate, method:'POST', data: { projid: that.data.projid, evaluatorName: that.data.userInfo.identity == '0' ? that.data.userInfo.name : that.data.userInfo.lInstitutionName, evaluatorPhone: that.data.userInfo.identity == '0' ? that.data.userInfo.pPhone : that.data.userInfo.lPhone, evaluatorEmail: that.data.userInfo.identity == '0' ? that.data.userInfo.pEmail : that.data.userInfo.lEmail, evaluatorAddress: that.data.userInfo.identity == '0' ? that.data.userInfo.pAddress : that.data.userInfo.lAddress, evaluateContent:that.data.text, satisfactionEvaluate: that.data.data[0].ind+1, errandNoEvaluate: that.data.data[1].ind + 1, guideEvaluate: that.data.data[2].ind + 1, efficiencyEvaluate: that.data.data[3].ind + 1, serviceQualityEvaluate: that.data.data[4].ind + 1, onlineExperienceEvaluate: that.data.data[5].ind + 1 }, success(res) { if(res.data.errno==0){ wx.redirectTo({ url: '/pages/success/index?type=assess', }) }else{ wx.showToast({ title: '提交失败', icon:'none' }) } } }) } }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })