123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- var app = getApp()
- var api = require('../../utils/api.js');
- Page({
- data: {
- titles: [],
- course_name: '',
- teacher: '',
- teachers: [],
- is_new: true
- },
- onLoad: function (options) {
- let that = this;
- that.setData({
- course_name: options.course_name,
- teacher: options.teacher
- })
- wx.request({
- url: api.getRemarkTitlesUrl,
- data: {
- id: wx.getStorageSync('pt_student').id
- },
- method: 'GET',
- success: res => {
- // console.log(res.data)
- that.setData({
- is_new: res.data.is_new,
- titles: res.data.titles,
- teachers: res.data.teachers
- })
- }
- })
- },
- formSubmit: function (e) {
- let data = e.detail.value;
- data.student_id = wx.getStorageSync('pt_student').id
- wx.request({
- url: api.remarkTeacherUrl,
- method: 'GET',
- data: data,
- success: res => {
- if (res.data.status == 'success') {
- wx.showModal({
- title: '评价成功',
- content: '感谢评价',
- success: function (res) {
- wx.switchTab({
- url: '/pages/userinfo/userinfo',
- })
- }
- })
- } else {
- wx.showToast({
- title: res.data.info,
- icon: 'none',
- duration: 800
- })
- }
- }
- })
- },
- onSubmit: function() {
- wx.navigateTo({url: '/pages/rate-review/rate-review'})
- }
- })
|