123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- const app = require('../../utils/util.js');
- const tools = require('../../utils/tools.js');
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- isshow1: false,
- isshow2: true,
- activebg: "#ffeae9",
- unactivebg: "#f2f2f2",
- mytip: "",
- listArr: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- tab1Show() {
- this.setData({
- isshow1: false,
- isshow2: true,
- activebg: "#ffeae9",
- unactivebg: "#f2f2f2"
- })
- },
- askingList(sessionKey) {
- wx.request({
- url: app.globalData.publicUrl + '/wx/board/list',
- method: "post",
- data: {
- sessionKey: sessionKey
- },
- success: (res) => {
- console.log(res, "我是查到的列表")
- if (res.data.code == 0) {
- if (res.data.list.length == 0) {
- wx.showModal({
- showCancel: false,
- content: "您还没有提问哦"
- })
- } else {
- this.setData({
- listArr: res.data.list,
- isshow1: true,
- isshow2: false,
- activebg: "#f2f2f2",
- unactivebg: "#ffeae9"
- })
- }
- } else {
- wx.showModal({
- showCancel: false,
- content: "您还没有提问哦"
- })
- }
- }
- })
- },
- async tab2Show() {
- const sessionKey = await tools.checkSessionAndLogin();
- this.askingList(sessionKey)
- },
- gojjDetails(e) {
- let id = e.currentTarget.dataset.item.id
- if (e.currentTarget.dataset.item.replyContent == "" || e.currentTarget.dataset.item.replyContent == null) {
- wx.showModal({
- showCancel: false,
- content: "您还没收到回复哦"
- })
- } else {
- wx.navigateTo({
- url: '/pages/myInteractionsDetais/myInteractionsDetais?id=' + id,
- })
- }
- },
- async bindFormSubmit(e) {
- let input_val = e.detail.value.textarea;
- const sessionKey = await tools.checkSessionAndLogin();
- if (input_val == "" || input_val == undefined) {
- wx.showToast({
- title: '反馈不能为空',
- icon: 'none',
- duration: 1000
- })
- return false;
- }
- wx.request({
- url: app.globalData.publicUrl + '/wx/board/add',
- method: "post",
- data: {
- content: input_val,
- sessionKey: sessionKey
- },
- success: (res) => {
- if (res.data.code == 0) {
- wx.showModal({
- showCancel: false,
- content: "提交成功",
- success(res) {
- if (res.confirm) {
- wx.switchTab({
- url: '../personInfo/personInfo'
- })
- }
- }
- })
- } else {
- wx.showModal({
- showCancel: false,
- content: res.data.msg
- })
- }
- }
- })
- }
- })
|