12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- // index.js
- // 获取应用实例
- const app = getApp();
- const util = require('../../../utils/jmsUtil.js');
- const api = require('../../../api/jms.js');
- import moment from 'moment'
- Page({
- data: {
- isFinish:false,
- id:'',
- memo:''
-
- },
- // 事件处理函数
-
- onLoad(options) {
- if(options.id){
- this.setData({
- id:options.id
- })
- }
- },
- onshow(){
-
- },
- bindRrmark(e){
- this.setData({
- memo:e.detail.value
- });
- },
-
- confTap(){
- if(this.data.memo==''){
- wx.showToast({
- title: '请输入备注内容',
- icon:'none'
- });
- return false;
- }
-
- wx.showLoading({
- title: '加载中',
- })
-
- let params={
- remark:this.data.memo,
- id:this.data.id
- }
- util.request(api.AddRemark,
- params
- , 'POST').then(res=>{
- wx.hideLoading();
- if (res.errno == 0) {
- this.setData({
- isFinish:true,
- })
- wx.showModal({
- title: '提示',
- content: '操作成功',
- showCancel:false,
- complete: (res) => {
- if (res.cancel) {
-
- }
-
- if (res.confirm) {
- wx.navigateBack({
- delta:1
- });
-
- }
- }
- })
-
-
- }else{
- wx.showToast({
- title: res.errmsg,
- icon:'none'
- })
- }
-
- }).catch(err=>{
- wx.hideLoading();
- });
-
- },
-
- })
|