depositAdmin.js 6.3 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["user/page/depositAdmin"],{"4f70":function(e,t,n){},"5fc8":function(e,t,n){"use strict";n.r(t);var o=n("7de6"),r=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=r.a},"764d":function(e,t,n){"use strict";var o=n("4f70"),r=n.n(o);r.a},"7de6":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("307c"),r=function(){n.e("components/uni-popup/uni-popup").then(function(){return resolve(n("ebf3"))}.bind(null,n)).catch(n.oe)},a=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("20fd"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/empty").then(function(){return resolve(n("de8d"))}.bind(null,n)).catch(n.oe)},i={components:{uniLoadMore:a,empty:d,uniPopup:r},filters:{moneyNum:function(e){return+e}},data:function(){return{height:"",backIndex:0,backMaxNum:0,backNum:"",orderId:"",loaded:!1,tabCurrentIndex:0,orderList:[],loadingType:"more",page:1,limit:10,navList:[{text:"普通商品",loadingType:"more",orderList:[],page:1,limit:10,loaded:!1},{text:"兑换券",loadingType:"more",orderList:[],page:1,limit:10,loaded:!1}],isUser:!0,userphone:"",keyword:""}},onLoad:function(e){this.loadData()},onReady:function(t){var n=this;e.getSystemInfo({success:function(t){var o=e.createSelectorQuery();o.select(".scoll-wrap").boundingClientRect(),o.exec((function(e){console.log(e,"ddddddddddddd"),n.height=t.windowHeight-e[0].top+"px",console.log("打印页面的剩余高度",n.height)}))},fail:function(e){}})},methods:{tabClick:function(e){this.tabCurrentIndex=e,this.loadData("tab")},moneyNum:function(e){return+e},loadData:function(e){var t=this,n=this,r=n.tabCurrentIndex,a=n.navList[r];"loading"!==a.loadingType&&"noMore"!==a.loadingType&&(a.loaded&&"tab"==e||(a.loadingType="loading",0==r&&(0,o.GetAdminOrderList)({status:3,page:a.page,limit:a.limit,user_phone:n.keyword}).then((function(e){var n=e.data;console.log(n,"ddddddddddd");var o=n.map((function(e){var n=t.orderStateExp(e.status);return e.stateTip=n.stateTip,e.stateTipColor=n.stateTipColor,e}));a.orderList=a.orderList.concat(o),console.log(a.orderList),a.page++,a.limit==n.length?a.loadingType="more":a.loadingType="noMore",t.$set(a,"loaded",!0)})).catch((function(e){console.log(e)})),1==r&&(0,o.getAdminExchangeList)({page:1,limit:10,user_phone:n.keyword}).then((function(e){var n=e.data;console.log(n,"ddddddddddd");var o=n.map((function(e){var n=t.orderStateExp(e.status);return e.stateTip=n.stateTip,e.stateTipColor=n.stateTipColor,e}));a.orderList=a.orderList.concat(o),console.log(a.orderList),a.page++,a.limit==n.length?a.loadingType="more":a.loadingType="noMore",t.$set(a,"loaded",!0)}))))},orderStateExp:function(e){var t="",n="#fa436a";switch(+e){case 0:t="待付款";break;case 1:t="待发货";break;case 2:t="待收货";break;case 3:t="待评价";break;case 4:t="已完成",n="#901b21";break;case 9:t="订单已关闭",n="#909399";break}return{stateTip:t,stateTipColor:n}},backDeposit:function(e){var t=this;0==t.tabCurrentIndex?t.orderId=e.order_id:t.orderId=e.id,t.backMaxNum=1*e.deposit-1*e.deposit_back,this.$refs.popupadmin.open(),t.backIndex=t.navList[t.tabCurrentIndex].orderList.indexOf(e),console.log(e,"ddddddddddddddddddddd",t.backIndex)},qrbackDeposit:function(){var t=this;""!=t.backNum?1*t.backNum>1*t.backMaxNum?t.$api.msg("退还金额大于押金"):""!=t.orderId?0==t.tabCurrentIndex?(0,o.backDeposit)({order_id:t.orderId,refund_price:t.backNum}).then((function(n){e.showToast({title:"退还成功",duration:2e3}),console.log(n),t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_status=1,t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_back=1*t.backNum+1*t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_back,t.$refs.popupadmin.close(),t.orderId="",t.backMaxNum="",t.backNum=""})):(0,o.backExchangeDeposit)({id:t.orderId,refund_price:t.backNum}).then((function(n){e.showToast({title:"退还成功",duration:2e3}),console.log(n),t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_status=1,t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_back=1*t.backNum+1*t.navList[t.tabCurrentIndex].orderList[t.backIndex].deposit_back,t.$refs.popupadmin.close(),t.orderId="",t.backMaxNum="",t.backNum=""})):t.$api.msg("请选择订单"):t.$api.msg("请输入退还押金")},backClose:function(){var e=this;e.$refs.popupadmin.close(),e.orderId="",e.backMaxNum="",e.backNum=""},search:function(){var e=this;if(""==e.userphone)e.keyword="";else{var t=/^(\+?0?86-?)?1[\d]\d{9}$/;if(!t.test(e.userphone))return void e.$api.msg("请填写正确的手机号码")}e.keyword=e.userphone,e.navList[e.tabCurrentIndex].orderList=[],e.navList[e.tabCurrentIndex].loadingType="more",e.navList[e.tabCurrentIndex].page=1,e.loadData()}}};t.default=i}).call(this,n("543d")["default"])},"861e":function(e,t,n){"use strict";n.r(t);var o=n("8e42"),r=n("5fc8");for(var a in r)"default"!==a&&function(e){n.d(t,e,(function(){return r[e]}))}(a);n("764d");var d,i=n("f0c5"),u=Object(i["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],d);t["default"]=u.exports},"8e42":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var o={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"20fd"))},uniPopup:function(){return n.e("components/uni-popup/uni-popup").then(n.bind(null,"ebf3"))}},r=function(){var e=this,t=e.$createElement,n=(e._self._c,0==e.tabCurrentIndex?e.__map(e.navList[0].orderList,(function(t,n){var o=e.__get_orig(t),r=e.__map(t._info,(function(t,n){var o=e.__get_orig(t),r=e._f("moneyNum")(t.cart_info.productInfo.price);return{$orig:o,f0:r}}));return{$orig:o,l0:r}})):null),o=1==e.tabCurrentIndex?e.__map(e.navList[1].orderList,(function(t,n){var o=e.__get_orig(t),r=e.__map(t._info,(function(t,n){var o=e.__get_orig(t),r=e._f("moneyNum")(t.cart_info.productInfo.price);return{$orig:o,f1:r}}));return{$orig:o,l2:r}})):null;e.$mp.data=Object.assign({},{$root:{l1:n,l3:o}})},a=[]},"97cf":function(e,t,n){"use strict";(function(e){n("5935");o(n("66fd"));var t=o(n("861e"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])}},[["97cf","common/runtime","common/vendor"]]]);