You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-bargain-index.26d533e...

2 lines
6.8 KiB

11 months ago
import{q as a,u as t,o as s,c as e,w as l,n as o,i,a as c,b as n,d,F as u,e as r,k as f,f as _,l as m,r as g,y as p,t as h,g as b}from"./index-4ddb689d.js";import{M as x,_ as y}from"./mescroll-mixins.a7931123.js";import{r as k}from"./uni-app.es.24af5d4f.js";import{W as v}from"./wxofficial.956096a5.js";import{A as T}from"./index.1169d7d7.js";import{C as L}from"./index.994d85b2.js";import{l as C,a as w}from"./task.812dd4ac.js";import{_ as S}from"./_plugin-vue_export-helper.1b428a4d.js";const j=S({components:{AvatarImage:T,CountDown:L},mixins:[x,v],data:()=>({isLoading:!0,curTab:0,activeList:a(),myList:a(),upOption:{auto:!0,page:{size:15},noMoreSize:3}}),watch:{curTab(a){uni.setNavigationBarTitle({title:0==a?"砍价会场":"我的砍价"})}},onLoad(a){a.tab&&(this.curTab=a.tab),this.setWxofficialShareData()},methods:{upCallback(a){const t=this;t.getListData(a.num).then((a=>{const s=a.data.length,e=a.data.total;t.mescroll.endBySize(s,e)})).catch((()=>t.mescroll.endErr()))},getListData(a){return{0:this.getActiveList,1:this.getMyList}[this.curTab](a)},getActiveList(a){const s=this;return new Promise(((e,l)=>{C({page:a}).then((l=>{const o=l.data.list;s.activeList.data=t(o,s.activeList,a),e(o)})).catch(l)}))},getMyList(a){const s=this;return new Promise(((e,l)=>{w({page:a}).then((l=>{const o=l.data.list;s.myList.data=t(o,s.myList,a),e(o)})).catch(l)}))},onChangeTab(t=0){const s=this;s.curTab=t,s.activeList=a(),s.myList=a(),s.mescroll.resetUpScroll()},onTargetActive(a){this.$navTo("pages/bargain/goods/index",{activeId:a.active_id,goodsId:a.goods_id})},onTargetTask(a){this.$navTo("pages/bargain/task",{taskId:a})},setWxofficialShareData(){this.updateShareCardData({title:"砍价专区"})}},onShareAppMessage(){return{title:"砍价专区",path:`/pages/bargain/index?${this.$getShareUrlParams()}`}},onShareTimeline(){return{title:"砍价专区",path:`/pages/bargain/index?${this.$getShareUrlParams()}`}}},[["render",function(a,t,x,v,T,L){const C=b,w=i,S=m,j=g("avatar-image"),I=g("count-down"),A=k(p("mescroll-body"),y);return s(),e(w,{class:"container",style:o(a.appThemeStyle)},{default:l((()=>[c(A,{ref:"mescrollRef",sticky:!0,onInit:a.mescrollInit,down:{use:!1},up:T.upOption,onUp:L.upCallback},{default:l((()=>[0==T.curTab?(s(),e(w,{key:0,class:"bargain-hall"},{default:l((()=>[(s(!0),n(u,null,d(T.activeList.data,((a,t)=>(s(),e(w,{class:"goods-item",key:t},{default:l((()=>[c(w,{class:"goods-item--container dis-flex",onClick:t=>L.onTargetActive(a)},{default:l((()=>[c(w,{class:"goods-image"},{default:l((()=>[c(C,{class:"image",src:a.goods.goods_image},null,8,["src"])])),_:2},1024),c(w,{class:"goods-info"},{default:l((()=>[c(w,{class:"goods-name"},{default:l((()=>[c(S,{class:"twoline-hide"},{default:l((()=>[_(h(a.goods.goods_name),1)])),_:2},1024)])),_:2},1024),a.helpsCount>0?(s(),e(w,{key:0,class:"peoples dis-flex"},{default:l((()=>[c(w,{class:"user-list dis-flex"},{default:l((()=>[(s(!0),n(u,null,d(a.helpList,((a,t)=>(s(),e(w,{class:"user-item-avatar",key:t},{default:l((()=>[c(j,{url:a.user.avatar_url,width:36},null,8,["url"])])),_:2},1024)))),128))])),_:2},1024),c(w,{class:"people__text"},{default:l((()=>[c(S,null,{default:l((()=>[_(h(a.helpsCount)+"人正在砍价",1)])),_:2},1024)])),_:2},1024)])),_:2},1024)):r("",!0),c(w,{class:"goods-price"},{default:l((()=>[c(S,null,{default:l((()=>[_("¥"+h(a.goods.goods_price_min),1)])),_:2},1024)])),_:2},1024),c(w,{class:"floor-price"},{default:l((()=>[c(S,{class:"small"},{default:l((()=>[_("最低¥")])),_:1}),c(S,{class:"big"},{default:l((()=>[_(h(a.floor_price),1)])),_:2},1024)])),_:2},1024),c(w,{class:"opt-touch"},{default:l((()=>[c(w,{class:"touch-btn"},{default:l((()=>[c(S,null,{default:l((()=>[_("立即参加")])),_:1})])),_:1})])),_:1})])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})):r("",!0),1==T.curTab?(s(),e(w,{key:1,class:"bargain-hall"},{default:l((()=>[(s(!0),n(u,null,d(T.myList.data,((a,t)=>(s(),e(w,{class:"goods-item",key:t},{default:l((()=>[c(w,{class:"goods-item--container dis-flex",onClick:t=>L.onTargetTask(a.task_id)},{default:l((()=>[c(w,{class:"goods-