123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- // pages/orderDetail/index.js
- const app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- textareaValue:'',
- btnLoading:false,
- activeType: 1,
- longitude:0,
- latitude:0,
- recordData: {},
- orderStatusStrList: [{
- color: '#346BE6',
- text: '待处理'
- },
- {
- color: '#00C777',
- text: '已处理'
- },
- {
- color: '#333333',
- text: '忽略'
- },
- ],
- },
- submit(){
- if (this.data.activeType==2&&!this.data.textareaValue) {
- wx.showToast({
- title: '请先输入忽略原因',
- icon:'none'
- })
- return
- }
- let parmas={
- ids:[this.data.recordData.id],
- reason:this.data.textareaValue,
- status:this.data.activeType
- }
- this.setData({
- btnLoading:true
- })
- app.request('/dock/manage/troubleUpload/handle','post',parmas).then(res=>{
- console.log(res);
- wx.showToast({
- title: '操作成功',
- icon: "none"
- })
- setTimeout(() => {
- wx.navigateBack()
- that.setData({
- btnLoading:false
- })
- }, 1500);
- }).catch(err=>{
- this.setData({
- btnLoading:false
- })
- })
- },
- textareaInput(e){
- this.setData({
- textareaValue: e.detail.value
- })
- },
- chooseType(e) {
- console.log(e);
- this.setData({
- activeType: e.currentTarget.dataset.type
- })
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- console.log(options.id);
- this.mapCtx = wx.createMapContext('map')
- app.request('/dock/manage/troubleUpload/queryById', 'get', {
- id: '1838869204518350849'
- }).then(res => {
- console.log(res);
- this.setData({
- recordData: res,
- longitude: res.longitude,
- latitude: res.latitude,
- })
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|