123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- // pages/my/myCustomer/myCustomer.js
- let App = getApp();
- let util = require("../../../utils/util.js");
- var WxParse = require("../../../wxParse/wxParse.js");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- appAssetsUrl: App.appAssetsUrl,
- items: [],
- wgFillInfo: {},
- richtext: null,
- parm: {
- cardno: util.getCardNo(),
- fbtype: "",
- feedback: "",
- },
- },
- // radio
- radioChange(e) {
- this.data.parm.fbtype = e.detail.value;
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.loadDic();
- this.loadkfInfo();
- },
- loadkfInfo() {
- let _this = this;
- App._post_form(
- "wgfillinfo/apiSelectwgfillinfo",
- "application/json",
- null,
- function (res) {
- if (res.code === 0) {
- _this.setData({
- richtext: res.wgFillInfo.ccs.replace(
- /<img/g,
- `<img style=' max-width:100%;'`
- ),
- });
- console.log(_this.data.wgFillInfo, 1111);
- WxParse.wxParse("article", "html", res.wgFillInfo.ccs, _this, 5);
- }
- }
- );
- },
- loadDic() {
- let _this = this;
- App._post_form(
- "bizcatelog/apiSelectBizcatelog/fbtype",
- "application/json",
- null,
- function (res) {
- if (res.code === 0) {
- _this.data.parm.fbtype = res.dictList[0].itemcode;
- _this.setData({
- items: res.dictList,
- });
- }
- }
- );
- },
- input(e) {
- if (e.detail.value) {
- this.data.parm.feedback = e.detail.value;
- }
- },
- sub() {
- let _this = this;
- if (util.UserLoginStatus()) {
- if (this.data.parm.feedback === "") {
- wx.showToast({
- title: "请输入您的想法",
- icon: "none",
- });
- return;
- }
- App._post_form(
- "WgMemberFb/apiInsertWgMemberFb",
- "application/json",
- JSON.stringify(_this.data.parm),
- function (res) {
- if (res.code === 0) {
- wx.showToast({
- title: "提交成功!",
- duration: 1500,
- });
- setTimeout(function () {
- wx.switchTab({
- url: "/pages/my/index/index",
- });
- }, 1500);
- }
- }
- );
- }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {},
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {},
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {},
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {},
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {},
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {},
- });
|