123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- // pages/personal/helpDetail/helpDetail.js
- var app = getApp()
- const util = require('../../../utils/utils.js')
- Page({
- data: {
- show: '',
- currentNum: 0,
- inputVal: '',
- phone:[],
- img:app.globalData.imgUrl
- },
- onLoad: function (options) {
- console.log(options.show)
- let that = this;
- var phones = wx.getStorageSync('home').customer_service_phone
- this.setData({
- phone: this.data.phone.concat(phones),
- show: options.show
- })
- },
- input(e) {
- if (e.detail.value) {
- this.setData({
- currentNum: e.detail.cursor,
- inputVal: e.detail.value
- })
- }
- },
- refund(){
- wx.navigateTo({
- url: '/pages/personal/deposit/deposit',
- })
- },
- rule(){
- wx.navigateTo({
- url: '/pages/accounting_rules/accounting_rules',
- })
- },
- card(){
- wx.navigateTo({
- url: '/pages/personal/mine/mine',
- })
- },
- submit: util.throttle(function (e) {
- var that = this;
- let len = that.data.nowLength
- if (!that.data.inputVal) {
- wx.showModal({
- title: '提示',
- content: '反馈信息不能为空',
- })
- } else {
- //提交反馈接口
- if (that.data.currentNum < 10) {
- wx.showModal({
- title: '提示',
- content: '反馈信息不能小于10个字',
- })
- } else {
- if (app.globalData.req) {
- var data = {
- question: that.data.inputVal,
- area_id: wx.getStorageSync('home').id
- }
- app.request('/question', data, 'POST', app.globalData.req).then(res => {
- console.log(res)
- 200 == res.statusCode && wx.showToast({
- title: '提交成功',
- }), that.setData({
- currentNum: 0,
- inputVal: ''
- })
- }).catch(err => {
- console.log(err)
- })
- } else {
- wx.showToast({
- title: '您的操作过于频繁,请稍后再试~',
- icon: 'none'
- })
- }
- }
- }
- }, 1000),
- service(){
- var phone = this.data.phone[0];
- if(phone!==''&&phone!==undefined){
- wx.makePhoneCall({
- phoneNumber: phone,
- })
- }else{
- wx.makePhoneCall({
- phoneNumber:"037163211915",
- })
- }
- },
- onReady: function () {
- },
- onShow: function () {
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- onReachBottom: function () {
- }
- })
|