初始化代码
This commit is contained in:
1
front/mine/pages/coupon/list.js
Normal file
1
front/mine/pages/coupon/list.js
Normal file
@@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/coupon/list"],{2622:function(t,e,a){"use strict";(function(t){var n=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("2eee")),s=n(a("c973")),r=a("26cb"),o={components:{},data:function(){return{options:{},activeIndex:0,tabList:[{title:"待使用",id:1},{title:"已使用",id:2},{title:"已过期",id:3}],statusType:{1:"去使用",2:"已使用",3:"删除"},useType:{is_land:"土地租赁",is_claim:"认养服务",is_shop:"商城"},param:{page:1},list:{data:[]},loading:!0,lockTap:!1}},computed:(0,r.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){this.$util.showLoading(),this.options=t;var e=t.tab,a=void 0===e?0:e;this.activeIndex=a,this.initIndex()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:{initIndex:function(){this.getList()},initRefresh:function(){this.param.page=1,this.initIndex()},getList:function(){var t=this;return(0,s.default)(i.default.mark((function e(){var a,n,s,r,o,u;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.list,n=t.param,s=t.useType,r=t.tabList,o=t.activeIndex,n.status=r[o].id,e.next=4,t.$api.mine.userCouponList(n);case 4:u=e.sent,u.data.map((function(t){t.is_show=!1;var e="";for(var a in s)t[a]&&(e+="".concat(s[a],"、"));t.use_range=e.substring(0,e.length-1)})),1==t.param.page||(u.data=a.data.concat(u.data)),t.list=u,t.loading=!1,t.$util.hideAll();case 9:case"end":return e.stop()}}),e)})))()},handerTabChange:function(t){this.activeIndex=t,this.$util.showLoading(),this.param.page=1,this.list.data=[],this.getList()},goDetail:function(t){var e=this;return(0,s.default)(i.default.mark((function a(){var n,s,r,o,u,c;return i.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e.activeIndex,a.t0=n,a.next=0===a.t0?4:1===a.t0?8:2===a.t0?9:27;break;case 4:return s=e.list.data[t],r=s.goods,o=s.shop_goods,u=r.length>0?"/pages/service":o.length>0?"/pages/shop":"/pages/restaurant",e.$util.goUrl({url:u,openType:"switchTab"}),a.abrupt("break",27);case 8:return a.abrupt("break",27);case 9:if(c=e.list.data[t].id,!e.lockTap){a.next=12;break}return a.abrupt("return");case 12:return e.lockTap=!0,e.$util.showLoading(),a.prev=14,a.next=17,e.$api.mine.couponDel({coupon_id:c});case 17:e.$util.hideAll(),e.$util.showToast({title:"删除成功"}),e.list.data.splice(t,1),e.lockTap=!1,a.next=26;break;case 23:a.prev=23,a.t1=a["catch"](14),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 26:return a.abrupt("break",27);case 27:case"end":return a.stop()}}),a,null,[[14,23]])})))()}}};e.default=o}).call(this,a("543d")["default"])},"60b3":function(t,e,a){"use strict";(function(t,e){var n=a("4ea4");a("b03e");n(a("66fd"));var i=n(a("9afb"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(i.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},"61b2":function(t,e,a){"use strict";a.r(e);var n=a("2622"),i=a.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(s);e["default"]=i.a},9124:function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=(t._self._c,t.tabList.length),n=t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,i=!t.loading&&t.list.data.length<=0&&1==t.list.current_page;t._isMounted||(t.e0=function(t,e){var a=arguments[arguments.length-1].currentTarget.dataset,n=a.eventParams||a["event-params"];e=n.index;t.stopPropagation(),this.list.data[e].is_show=!this.list.data[e].is_show}),t.$mp.data=Object.assign({},{$root:{g0:a,g1:n,g2:i}})},i=[]},"9afb":function(t,e,a){"use strict";a.r(e);var n=a("9124"),i=a("61b2");for(var s in i)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(s);a("de2b");var r=a("f0c5"),o=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=o.exports},a94f:function(t,e,a){},de2b:function(t,e,a){"use strict";var n=a("a94f"),i=a.n(n);i.a}},[["60b3","common/runtime","common/vendor"]]]);
|
||||
5
front/mine/pages/coupon/list.json
Normal file
5
front/mine/pages/coupon/list.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的卡券",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
front/mine/pages/coupon/list.wxml
Normal file
1
front/mine/pages/coupon/list.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<view class="mine-coupon-list"><fixed vue-id="650cd150-1" bind:__l="__l" vue-slots="{{['default']}}"><tab vue-id="{{('650cd150-2')+','+('650cd150-1')}}" list="{{tabList}}" activeIndex="{{activeIndex}}" activeColor="{{primaryColor}}" width="{{100/$root.g0+'%'}}" height="100rpx" data-event-opts="{{[['^change',[['handerTabChange']]]]}}" bind:change="__e" bind:__l="__l"></tab><view class="b-1px-b"></view></fixed><block wx:for="{{list.data}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="list-item fill-base mg-big pd-lg radius-34"><view class="flex-between"><view class="flex-center flex-column"><view class="flex-y-baseline f-caption c-warning">¥<view class="f-lg-title">{{item.discount+''}}</view></view><view class="f-caption c-title">优惠券</view></view><view class="flex-1 ml-lg flex-between"><view class="f-title c-title mr-lg"><view class="text-bold">{{item.title}}</view><view class="f-icontext mt-sm">{{item.type==0?'满'+item.full+'元可用':'无门槛'}}</view><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({index})}}" class="flex-y-baseline f-icontext mt-sm" catchtap="__e">查看详情<view class="{{['iconfont','ml-sm','_i',[(!item.is_show)?'icon-down':''],[(item.is_show)?'icon-up':'']]}}" style="font-size:24rpx;"></view></view></view><view data-event-opts="{{[['tap',[['goDetail',[index]]]]]}}" class="use-btn flex-center f-caption c-base radius" style="{{'background:'+(activeIndex==0?primaryColor:activeIndex==1?'#aaa':'#F1381F')+';'}}" catchtap="__e">{{''+statusType[item.status]+''}}</view></view></view><block wx:if="{{item.is_show}}"><view class="mt-lg pd-lg f-icontext c-title radius-16" style="background:#F9FAF9;"><view class="flex-warp"><view>卡券数量:</view><view class="flex-1 c-desc">{{"x"+item.num}}</view></view><view class="flex-warp mt-md"><view>使用时间:</view><view class="flex-1 c-desc">{{activeIndex==1?item.use_time:item.start_time}}</view></view><view class="flex-warp mt-md"><view>使用范围:</view><view class="flex-1 c-desc">{{item.use_range}}</view></view><view class="flex-warp mt-md"><view>使用规则:</view><view class="flex-1 c-desc"><text style="word-break:break-all;" decode="emsp">{{item.rule}}</text></view></view><view class="flex-warp mt-md"><view>优惠详情:</view><view class="flex-1 c-desc"><text style="word-break:break-all;" decode="emsp">{{item.text}}</text></view></view></view></block></view></block><block wx:if="{{loading}}"><load-more vue-id="650cd150-3" noMore="{{$root.g1}}" loading="{{loading}}" bind:__l="__l"></load-more></block><block wx:if="{{$root.g2}}"><abnor vue-id="650cd150-4" type="COUPON" bind:__l="__l"></abnor></block><view class="space-footer"></view></view>
|
||||
1
front/mine/pages/coupon/list.wxss
Normal file
1
front/mine/pages/coupon/list.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.mine-coupon-list .list-item{overflow:hidden}.mine-coupon-list .list-item .item-title{top:0;left:0;height:50rpx;background:#ffe2e2;border-radius:15rpx 0 15rpx 0}.mine-coupon-list .list-item .use-btn{min-width:120rpx;height:58rpx}
|
||||
1
front/mine/pages/coupon/use.js
Normal file
1
front/mine/pages/coupon/use.js
Normal file
@@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/coupon/use"],{"038c":function(t,n,i){},"228f":function(t,n,i){"use strict";(function(t){var e=i("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=e(i("2eee")),o=e(i("c973")),s=i("26cb"),r={components:{},data:function(){return{options:{},useType:{is_land:"土地租赁",is_claim:"认养服务",is_shop:"商城"},param:{page:1},list:{data:[]},loading:!0,lockTap:!1}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},userInfo:function(t){return t.user.userInfo},orderInfo:function(t){return t.order.orderInfo}}),onLoad:function(t){this.options=t,this.$util.showLoading(),this.initIndex()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:{initIndex:function(){this.getList()},initRefresh:function(){this.param.page=1,this.initIndex()},getList:function(){var t=this;return(0,o.default)(a.default.mark((function n(){var i,e,o,s,r,u,c,l;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.list,e=t.useType,o=t.options.type,s=void 0===o?1:o,r=1==s?t.$util.pick(t.orderInfo,["land_id","spe_id","cycle","massif_id","seed_data"]):{},u=Object.assign({},t.param,t.options,r),c={1:"land",2:"claim",3:"shop"},delete u.type,n.next=8,t.$api[c[s]].canUseCouponList(u);case 8:l=n.sent,l.data.map((function(t){t.is_show=!1;var n="";for(var i in e)t[i]&&(n+="".concat(e[i],"、"));t.use_range=n.substring(0,n.length-1)})),1==t.param.page||(l.data=i.data.concat(l.data)),t.list=l,t.loading=!1,t.$util.hideAll();case 13:case"end":return n.stop()}}),n)})))()},toUse:function(t){var n=this;if(!this.lockTap){this.lockTap=!0;try{var i=this.list.data[t].id;this.$util.getPage(-1).orderInfo.coupon_id=i,this.$util.back(),setTimeout((function(){n.$util.goUrl({url:1,openType:"navigateBack"})}),500)}catch(e){setTimeout((function(){n.lockTap=!1}),2e3)}}},noUse:function(){var t=this;this.$util.getPage(-1).orderInfo.coupon_id=0,this.$util.back(),setTimeout((function(){t.$util.goUrl({url:1,openType:"navigateBack"})}),500)}}};n.default=r}).call(this,i("543d")["default"])},b437:function(t,n,i){"use strict";i.r(n);var e=i("b4d9"),a=i("fbb9");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(n,t,(function(){return a[t]}))}(o);i("d450");var s=i("f0c5"),r=Object(s["a"])(a["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],void 0);n["default"]=r.exports},b4d9:function(t,n,i){"use strict";i.d(n,"b",(function(){return e})),i.d(n,"c",(function(){return a})),i.d(n,"a",(function(){}));var e=function(){var t=this,n=t.$createElement,i=(t._self._c,t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null),e=!t.loading&&t.list.data.length<=0&&1==t.list.current_page;t._isMounted||(t.e0=function(t,n){var i=arguments[arguments.length-1].currentTarget.dataset,e=i.eventParams||i["event-params"];n=e.index;t.stopPropagation(),this.list.data[n].is_show=!this.list.data[n].is_show}),t.$mp.data=Object.assign({},{$root:{g0:i,g1:e}})},a=[]},d05b:function(t,n,i){"use strict";(function(t,n){var e=i("4ea4");i("b03e");e(i("66fd"));var a=e(i("b437"));t.__webpack_require_UNI_MP_PLUGIN__=i,n(a.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},d450:function(t,n,i){"use strict";var e=i("038c"),a=i.n(e);a.a},fbb9:function(t,n,i){"use strict";i.r(n);var e=i("228f"),a=i.n(e);for(var o in e)["default"].indexOf(o)<0&&function(t){i.d(n,t,(function(){return e[t]}))}(o);n["default"]=a.a}},[["d05b","common/runtime","common/vendor"]]]);
|
||||
5
front/mine/pages/coupon/use.json
Normal file
5
front/mine/pages/coupon/use.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "选择卡券",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
front/mine/pages/coupon/use.wxml
Normal file
1
front/mine/pages/coupon/use.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<view class="mine-coupon-use"><block wx:for="{{list.data}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="list-item fill-base mg-big pd-lg radius-34"><view class="flex-between"><view class="flex-center flex-column"><view class="flex-y-baseline f-caption c-warning">¥<view class="f-lg-title">{{item.discount+''}}</view></view><view class="f-caption c-title">优惠券</view></view><view class="flex-1 ml-lg flex-between"><view class="f-title c-title mr-lg"><view class="text-bold">{{item.title}}</view><view class="f-icontext mt-sm">{{item.type==0?'满'+item.full+'元可用':'无门槛'}}</view><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({index})}}" class="flex-y-baseline f-icontext mt-sm" catchtap="__e">查看详情<view class="{{['iconfont','ml-sm','_i',[(!item.is_show)?'icon-down':''],[(item.is_show)?'icon-up':'']]}}" style="font-size:24rpx;"></view></view></view><view data-event-opts="{{[['tap',[['toUse',[index]]]]]}}" class="use-btn flex-center f-caption c-base radius" style="{{'background:'+(primaryColor)+';'}}" catchtap="__e">去使用</view></view></view><block wx:if="{{item.is_show}}"><view class="mt-lg pd-lg f-icontext c-title radius-16" style="background:#F9FAF9;"><view class="flex-warp"><view>卡券数量:</view><view class="flex-1 c-desc">{{"x"+item.num}}</view></view><view class="flex-warp mt-md"><view>使用时间:</view><view class="flex-1 c-desc">{{item.start_time}}</view></view><view class="flex-warp mt-md"><view>使用范围:</view><view class="flex-1 c-desc">{{item.use_range}}</view></view><view class="flex-warp mt-md"><view>使用规则:</view><view class="flex-1 c-desc"><text style="word-break:break-all;" decode="emsp">{{item.rule}}</text></view></view><view class="flex-warp mt-md"><view>优惠详情:</view><view class="flex-1 c-desc"><text style="word-break:break-all;" decode="emsp">{{item.text}}</text></view></view></view></block></view></block><block wx:if="{{loading}}"><load-more vue-id="270dab7f-1" noMore="{{$root.g0}}" loading="{{loading}}" bind:__l="__l"></load-more></block><block wx:if="{{$root.g1}}"><abnor vue-id="270dab7f-2" type="COUPON" bind:__l="__l"></abnor></block><view class="space-max-footer"></view><fix-bottom-button vue-id="270dab7f-3" text="{{[{type:'confirm',text:'不使用卡券'}]}}" data-event-opts="{{[['^confirm',[['noUse']]]]}}" bind:confirm="__e" bind:__l="__l"></fix-bottom-button></view>
|
||||
1
front/mine/pages/coupon/use.wxss
Normal file
1
front/mine/pages/coupon/use.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.mine-coupon-use .list-item{overflow:hidden}.mine-coupon-use .list-item .item-title{top:0;left:0;height:50rpx;background:#ffe2e2;border-radius:15rpx 0 15rpx 0}.mine-coupon-use .list-item .use-btn{min-width:120rpx;height:58rpx}
|
||||
Reference in New Issue
Block a user