1 |
- "use strict";const e=require("../../common/vendor.js"),s=require("../../sheep/hooks/useGoods.js"),t=require("../../sheep/index.js");if(require("../../sheep/url/index.js"),require("../../sheep/store/index.js"),require("../../sheep/store/app.js"),require("../../sheep/api/promotion/diy.js"),require("../../sheep/request/index.js"),require("../../sheep/config/index.js"),require("../../sheep/platform/index.js"),require("../../sheep/platform/provider/wechat/index.js"),require("../../sheep/platform/provider/wechat/miniProgram.js"),require("../../sheep/api/member/auth.js"),require("../../sheep/api/member/social.js"),require("../../sheep/api/member/user.js"),require("../../sheep/platform/provider/apple/index.js"),require("../../sheep/platform/share.js"),require("../../sheep/router/index.js"),require("../../sheep/hooks/useModal.js"),require("../../sheep/helper/index.js"),require("../../sheep/helper/test.js"),require("../../sheep/helper/digit.js"),require("../../sheep/api/member/signin.js"),require("../../sheep/helper/throttle.js"),require("../../sheep/platform/pay.js"),require("../../sheep/api/pay/order.js"),require("../../sheep/store/user.js"),require("../../sheep/store/cart.js"),require("../../sheep/api/trade/cart.js"),require("../../sheep/api/pay/wallet.js"),require("../../sheep/api/trade/order.js"),require("../../sheep/api/promotion/coupon.js"),require("../../sheep/store/sys.js"),require("../../sheep/store/modal.js"),require("../../sheep/util/index.js"),require("../../sheep/config/zIndex.js"),!Array){(e.resolveComponent("su-tabs")+e.resolveComponent("su-sticky")+e.resolveComponent("s-empty")+e.resolveComponent("s-goods-item")+e.resolveComponent("uni-load-more")+e.resolveComponent("s-layout"))()}Math||((()=>"../../sheep/ui/su-tabs/su-tabs.js")+(()=>"../../sheep/ui/su-sticky/su-sticky.js")+(()=>"../../sheep/components/s-empty/s-empty.js")+(()=>"../../sheep/components/s-goods-item/s-goods-item.js")+(()=>"../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const r={__name:"otherlist",setup(r){const o=e.computed((()=>t.sheep.$store("app").has_wechat_trade_managed)),n={data:[],current_page:1,total:1,last_page:1},a=e.reactive({currentTab:0,pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",deleteOrderId:0,error:0}),i=[{name:"全部",value:"all"},{name:"待付款",value:"unpaid"},{name:"待发货",value:"nosend"},{name:"待收货",value:"noget"},{name:"待评价",value:"nocomment"}];function d(e){a.currentTab!==e.index&&(a.pagination=n,a.currentTab=e.index,l())}function p(e){t.sheep.$router.go("/pages/order/detail",{orderSN:e})}async function u(s,r=!1){if("WechatMiniProgram"===t.sheep.$platform.name&&!e.lodashExports.isEmpty(s.wechat_extra_data)&&1===o.value&&!r)return void function(s){if(!e.wx$1.openBusinessView)return void t.sheep.$helper.toast("请升级微信版本");e.wx$1.openBusinessView({businessType:"weappOrderConfirm",extraData:{merchant_trade_no:s.wechat_extra_data.merchant_trade_no,transaction_id:s.wechat_extra_data.transaction_id},success(e){console.log("success:",e),"openBusinessView:ok"===e.errMsg&&"success"===e.extraData.status&&u(s,!0)},fail(e){console.log("error:",e)},complete(e){console.log("result:",e)}})}(s);const{error:i}=await t.sheep.$api.order.confirm(s.id);0===i&&(a.pagination=n,l())}async function c(s){e.index.showModal({title:"提示",content:"确定要申请退款吗?",success:async function(e){if(e.confirm){t.sheep.$platform.useProvider("wechat").subscribeMessage("order_refund");const{error:e,data:r}=await t.sheep.$api.order.applyRefund(s);if(0===e){let e=a.pagination.data.findIndex((e=>e.id===s));a.pagination.data[e]=r}}}})}async function l(s=1,r=5){a.loadStatus="loading";let o=await t.sheep.$api.order.list({type:i[a.currentTab].value,list_rows:r,page:s});if(a.error=o.error,0===o.error){let s=e._.concat(a.pagination.data,o.data.data);a.pagination={...o.data,data:s},a.pagination.current_page<a.pagination.last_page?a.loadStatus="more":a.loadStatus="noMore"}}function g(){"noMore"!==a.loadStatus&&l(a.pagination.current_page+1)}return e.onLoad((async e=>{e.type&&(a.currentTab=e.type),l()})),e.onReachBottom((()=>{g()})),e.onPullDownRefresh((()=>{a.pagination=n,l(),setTimeout((function(){e.index.stopPullDownRefresh()}),800)})),(r,o)=>e.e({a:e.o(d),b:e.p({list:i,scrollable:!1,current:a.currentTab}),c:e.p({bgColor:"#fff"}),d:0===a.pagination.total},0===a.pagination.total?{e:e.p({icon:"/static/order-empty.png",text:"暂无订单"})}:{},{f:a.pagination.total>0},a.pagination.total>0?{g:e.f(a.pagination.data,((r,o,n)=>e.e({a:e.t(r.order_sn),b:e.t(r.status_text),c:e.n(e.unref(s.formatOrderColor)(r.status_code)),d:e.f(r.items,((s,o,a)=>e.e({a:s.btns.includes("aftersale")},s.btns.includes("aftersale")?{b:e.o((r=>e.unref(t.sheep).$router.go("/pages/order/aftersale/apply",{item:JSON.stringify(s)})),s.id)}:{},{c:s.btns.includes("re_aftersale")},s.btns.includes("re_aftersale")?{d:e.o((r=>e.unref(t.sheep).$router.go("/pages/order/aftersale/apply",{item:JSON.stringify(s)})),s.id)}:{},{e:s.btns.includes("aftersale_info")},s.btns.includes("aftersale_info")?{f:e.o((r=>e.unref(t.sheep).$router.go("/pages/order/aftersale/detail",{id:s.ext.aftersale_id})),s.id)}:{},{g:s.btns.includes("buy_again")},s.btns.includes("buy_again")?{h:e.o((r=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:s.goods_id})),s.id)}:{},{i:"18bbd6b4-4-"+n+"-"+a+",18bbd6b4-0",j:e.p({img:s.goods_image,title:s.goods_title,skuText:s.goods_sku_text,price:s.goods_price,score:r.score_amount,num:s.goods_num}),k:s.id}))),e:r.total_discount_fee>0},r.total_discount_fee>0?{f:e.t(r.total_discount_fee)}:{},{g:e.t(r.dispatch_amount),h:e.t(r.order_amount),i:r.score_amount},(r.score_amount,{}),{j:r.score_amount},r.score_amount?{k:e.unref(t.sheep).$url.static("/static/images/score1.svg"),l:e.t(r.score_amount)}:{},{m:r.btns.includes("groupon")},r.btns.includes("groupon")?{n:e.t("groupon_ing"===r.status_code?"邀请拼团":"拼团详情"),o:e.o((e=>function(e){t.sheep.$router.go("/pages/activity/groupon/detail",{id:e.ext.groupon_id})}(r)),r.id)}:{},{p:r.btns.includes("invoice")},r.btns.includes("invoice")?{q:e.o((e=>{var s,o;return o=null==(s=r.invoice)?void 0:s.id,void t.sheep.$router.go("/pages/order/invoice",{invoiceId:o})}),r.id)}:{},{r:0===r.btns.length},0===r.btns.length?{s:e.o((e=>p(r.order_sn)),r.id)}:{},{t:r.btns.includes("confirm")},r.btns.includes("confirm")?{v:e.o((e=>u(r)),r.id)}:{},{w:r.btns.includes("express")},r.btns.includes("express")?{x:e.o((e=>async function(e){t.sheep.$router.go("/pages/order/express/list",{orderId:e})}(r.id)),r.id)}:{},{y:r.btns.includes("apply_refund")},r.btns.includes("apply_refund")?{z:e.o((e=>c(r.id)),r.id)}:{},{A:r.btns.includes("re_apply_refund")},r.btns.includes("re_apply_refund")?{B:e.o((e=>c(r.id)),r.id)}:{},{C:r.btns.includes("cancel")},r.btns.includes("cancel")?{D:e.o((s=>async function(s){e.index.showModal({title:"提示",content:"确定要取消订单吗?",success:async function(e){if(e.confirm){const{error:e,data:r}=await t.sheep.$api.order.cancel(s);if(0===e){let e=a.pagination.data.findIndex((e=>e.id===s));a.pagination.data[e]=r}}}})}(r.id)),r.id)}:{},{E:r.btns.includes("comment")},r.btns.includes("comment")?{F:e.o((e=>{return s=r.order_sn,void t.sheep.$router.go("/pages/goods/comment/add",{orderSN:s});var s}),r.id)}:{},{G:r.btns.includes("delete")},r.btns.includes("delete")?{H:e.o((s=>{return o=r.id,void e.index.showModal({title:"提示",content:"确定要删除订单吗?",success:async function(e){if(e.confirm){const{error:e,data:s}=await t.sheep.$api.order.delete(o);if(0===e){let e=a.pagination.data.findIndex((e=>e.id===o));a.pagination.data.splice(e,1)}}}});var o}),r.id)}:{},{I:r.btns.includes("pay")},r.btns.includes("pay")?{J:e.o((e=>{return s=r.order_sn,void t.sheep.$router.go("/pages/pay/index",{orderSN:s});var s}),r.id)}:{},{K:e.n(r.btns.length>3?"ss-row-between":"ss-row-right"),L:r.id,M:e.o((e=>p(r.order_sn)),r.id)})))}:{},{h:a.pagination.total>0},a.pagination.total>0?{i:e.o(g),j:e.p({status:a.loadStatus,"content-text":{contentdown:"上拉加载更多"}})}:{},{k:e.p({title:"我的订单"})})}},o=e._export_sfc(r,[["__scopeId","data-v-18bbd6b4"]]);wx.createPage(o);
|