Commit 312af5a3680eff901ffdda70b3bc635a7b50656a
1 parent
74103bf9
我的礼包数据调整展示
Showing
10 changed files
with
842 additions
and
721 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
1 | +var e = getApp(), | ||
2 | + a = e.globalData.setting, | ||
3 | + os = a, | ||
4 | + t = e.request, | ||
5 | + d = e.globalData; | ||
1 | Page({ | 6 | Page({ |
2 | - data: function data() { | ||
3 | - return { | ||
4 | - getStorageID: '', | ||
5 | - getUserID: '', | ||
6 | - wareCard: [], | ||
7 | - page: 0, | ||
8 | - pageSize: 10, | ||
9 | - isEmpty: true, | ||
10 | - loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | ||
11 | - contentText: { | ||
12 | - contentdown: '加载更多', | ||
13 | - contentrefresh: '加载中...', | ||
14 | - contentnomore: '已加载全部' | ||
15 | - } | ||
16 | - }; | ||
17 | - | ||
18 | - | 7 | + data: { |
8 | + url: a.url, //接口网址 | ||
9 | + iurl: a.imghost, //图片前缀网址 | ||
10 | + getStorageID: '', | ||
11 | + getUserID: '', | ||
12 | + wareCard: [], | ||
13 | + page: 0, | ||
14 | + pageSize: 10, | ||
15 | + isEmpty: true, | ||
16 | + loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | ||
17 | + contentText: { | ||
18 | + contentdown: '加载更多', | ||
19 | + contentrefresh: '加载中...', | ||
20 | + contentnomore: '已加载全部' | ||
21 | + } | ||
19 | }, | 22 | }, |
20 | - onLoad: function onLoad(options) { | ||
21 | - this.getStorageID = options.stoid; | ||
22 | - this.getUserID = options.userid; | 23 | + onLoad: function(options) { |
24 | + var th = this; | ||
25 | + th.setData({ | ||
26 | + getStorageID: a.stoid, | ||
27 | + getUserID: 5682130 | ||
28 | + }) | ||
23 | }, | 29 | }, |
24 | - onShow: function onShow() { | ||
25 | - this.page = 1; | ||
26 | - this.pageSize = 10; | ||
27 | - this.loadingType = 0; | ||
28 | - this.getList(); | 30 | + onShow: function() { |
31 | + var th = this; | ||
32 | + th.setData({ | ||
33 | + pages: 1, | ||
34 | + pageSize: 10, | ||
35 | + loadingType: 0 | ||
36 | + }) | ||
37 | + th.getList(); | ||
29 | }, | 38 | }, |
30 | - methods: { | ||
31 | - MyGift: function MyGift() { | ||
32 | - /*销毁跳转*/ | ||
33 | - uni.reLaunch({ | ||
34 | - url: '/pages/mygiftpack/mygiftpack?stoid=' + this.getStorageID + '&userid=' + this.getUserID | ||
35 | - }); | ||
36 | - | ||
37 | - }, | ||
38 | - GetGiftPackList: function GetGiftPackList(getId, ojb) { | ||
39 | - //不销毁调整 | ||
40 | - uni.navigateTo({ | ||
41 | - url: '/pages/mygiftpack/giftpackList?isBuy=1&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' + getId | ||
42 | - }); | ||
43 | - | ||
44 | - }, | ||
45 | - GetBuyPrice: function GetBuyPrice(getID, item) { | ||
46 | - var that = this; | ||
47 | - uni.showModal({ | ||
48 | - title: '', | ||
49 | - content: '是否确定购买该礼包', | ||
50 | - success: function success(res) { | ||
51 | - if (res.confirm) { | ||
52 | - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
53 | - data: { | ||
54 | - "actId": '', //活动Id | ||
55 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
56 | - "buyType": '2', //1=积分兑换 2=余额购买 | ||
57 | - "lbId": getID, //礼包Id | ||
58 | - "storeId": that.getStorageID, //商家Id | ||
59 | - "userId": that.getUserID, //用户ID | ||
60 | - "buyFrom": '1' | ||
61 | - }, | ||
62 | - success: function success(res) { | ||
63 | - if (res.data.code == 0) { | ||
64 | - window.location.href = that.$GetInfo.HtmlHttp + '/Mobile/Payment/getPay.html?stoid=' + that.getStorageID + '&order_sn=' + res.data.data.orderSn + '&recharge_type=6'; | ||
65 | - | ||
66 | - } else { | ||
67 | - console.log(res.data.msg); | ||
68 | - uni.showToast({ | ||
69 | - icon: 'none', | ||
70 | - title: res.data.msg | ||
71 | - }); | ||
72 | 39 | ||
73 | - } | ||
74 | - } | ||
75 | - }); | ||
76 | - | ||
77 | - } else if (res.cancel) { | ||
78 | - console.log('用户点击取消'); | 40 | + GetBuyPrice: function(e) { |
41 | + var that = this.data; | ||
42 | + var th = this; | ||
43 | + var lbId = e.currentTarget.dataset.lbId;//活动id | ||
44 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
45 | + my_confirm.open( | ||
46 | + "是否确定购买该礼包", | ||
47 | + "取消", | ||
48 | + "确定", | ||
49 | + function() { | ||
50 | + my_confirm.open_cancel(0); | ||
51 | + }, | ||
52 | + function() { | ||
53 | + var json = { | ||
54 | + "actId": '', //活动Id | ||
55 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
56 | + "buyType": '2', //1=积分兑换 2=余额购买 | ||
57 | + "lbId": lbId, //礼包Id | ||
58 | + "storeId": that.getStorageID, //商家Id | ||
59 | + "userId": that.getUserID, //用户ID | ||
60 | + "buyFrom": 2 | ||
61 | + }; | ||
62 | + var data = JSON.stringify(json); | ||
63 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | ||
64 | + wx.request({ | ||
65 | + url: url, | ||
66 | + data: data, | ||
67 | + method: 'post', | ||
68 | + header: { | ||
69 | + 'content-type': 'application/json' | ||
70 | + }, // 设置请求的 header | ||
71 | + success: function (res) { | ||
72 | + if (res.data.code == 0) { | ||
73 | + window.location.href = th.data.url + '/Mobile/Payment/getPay.html?stoid=' + that.getStorageID + '&order_sn=' + res.data.data.orderSn + '&recharge_type=6'; | ||
74 | + } else { | ||
75 | + getApp().my_warnning(res.data.msg, 0, th); | ||
76 | + } | ||
79 | } | 77 | } |
80 | - } | ||
81 | - }); | 78 | + }) |
82 | 79 | ||
80 | + } | ||
83 | 81 | ||
84 | - }, | ||
85 | - GetBuyIntegral: function GetBuyIntegral(getID, item) { | ||
86 | - var that = this; | ||
87 | - uni.showModal({ | ||
88 | - title: '', | ||
89 | - content: '是否确定兑换该礼包', | ||
90 | - success: function success(res) { | ||
91 | - if (res.confirm) { | ||
92 | - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
93 | - data: { | ||
94 | - "actId": '', //活动Id | ||
95 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
96 | - "buyType": '1', //1=积分兑换 2=余额购买 | ||
97 | - "lbId": getID, //礼包Id | ||
98 | - "storeId": that.getStorageID, //商家Id | ||
99 | - "userId": that.getUserID //用户ID | ||
100 | - }, | ||
101 | - success: function success(res) { | ||
102 | - console.log(res.data); | ||
103 | - if (res.data.code == 0) { | ||
104 | - console.log(res.data.msg); | ||
105 | - uni.showToast({ | ||
106 | - icon: 'none', | ||
107 | - title: '兑换成功!' | ||
108 | - }); | ||
109 | 82 | ||
110 | - } else { | ||
111 | - console.log(res.data.msg); | ||
112 | - uni.showToast({ | ||
113 | - icon: 'none', | ||
114 | - title: res.data.msg | ||
115 | - }); | 83 | + ) |
116 | 84 | ||
117 | - } | ||
118 | - } | ||
119 | - }); | ||
120 | 85 | ||
121 | - } else if (res.cancel) { | ||
122 | - console.log('用户点击取消'); | 86 | + }, |
87 | + GetBuyIntegral: function(e) { | ||
88 | + var that = this.data; | ||
89 | + var th = this; | ||
90 | + var lbId = e.currentTarget.dataset.lbId;//活动id | ||
91 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
92 | + my_confirm.open( | ||
93 | + "是否确定兑换该礼包", | ||
94 | + "取消", | ||
95 | + "确定", | ||
96 | + function() { | ||
97 | + my_confirm.open_cancel(0); | ||
98 | + }, | ||
99 | + function() { | ||
100 | + getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
101 | + data: { | ||
102 | + "actId": '', //活动Id | ||
103 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
104 | + "buyType": '1', //1=积分兑换 2=余额购买 | ||
105 | + "lbId": 26, //礼包Id | ||
106 | + "storeId": that.getStorageID, //商家Id | ||
107 | + "userId": that.getUserID //用户ID | ||
108 | + }, | ||
109 | + success: function success(res) { | ||
110 | + if (res.data.code == 0) { | ||
111 | + getApp().my_warnning("兑换成功!", 1, th); | ||
112 | + } else { | ||
113 | + getApp().my_warnning(res.data.msg, 0, th); | ||
114 | + } | ||
123 | } | 115 | } |
124 | - } | ||
125 | - }); | 116 | + }) |
126 | 117 | ||
118 | + }) | ||
127 | 119 | ||
128 | - }, | ||
129 | - getList: function getList() { | ||
130 | - var _this = this; //上拉加载 | ||
131 | - var that = this; | ||
132 | - if (that.loadingType != 0) { | ||
133 | - return false; | ||
134 | - } | ||
135 | - that.loadingType = 1; | ||
136 | - getApp().request.promiseGet('/api/weshop/marketing/giftbag/page', { | ||
137 | - data: { | ||
138 | - "storeId": this.getStorageID, //商家ID | ||
139 | - "userId": this.getUserID, //用户ID | ||
140 | - "page": this.page, | ||
141 | - "pageSize": this.pageSize | ||
142 | - }, | ||
143 | - success: function success(res) { | ||
144 | - if (res.data.code == 0) { | ||
145 | - if (res.data.data.total > 0) { | ||
146 | - _this.isEmpty = false; | ||
147 | - } else { | ||
148 | - _this.isEmpty = true; | ||
149 | - } | ||
150 | - if (res.data.data.pageData.length == 0) { | ||
151 | - _this.loadingType = 2; | ||
152 | - } else { | ||
153 | - console.log(_this.wareCard.length); | ||
154 | - console.log(res.data.data.pageData.length); | ||
155 | - if (_this.wareCard.length < res.data.data.pageData.length) { | ||
156 | - for (var i = 0; i < res.data.data.pageData.length; i++) { | ||
157 | - _this.wareCard.push(res.data.data.pageData[i]); | ||
158 | - } | ||
159 | - } | ||
160 | 120 | ||
161 | - _this.loadingType = 0; | ||
162 | - console.log(_this.wareCard); | 121 | + }, |
122 | + getList: function(e) { | ||
123 | + var _this = this; //上拉加载 | ||
124 | + var that = this.data; | ||
125 | + if (that.loadingType != 0) { | ||
126 | + return false; | ||
127 | + } | ||
128 | + // that.loadingType = 1; | ||
129 | + _this.setData({ | ||
130 | + loadingType: 1 | ||
131 | + }) | ||
132 | + getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | ||
133 | + data: { | ||
134 | + "storeId": that.getStorageID, //商家ID | ||
135 | + "userId": that.getUserID, //用户ID | ||
136 | + "page": that.pages, | ||
137 | + "pageSize": that.pageSize | ||
138 | + }, | ||
139 | + success: function success(res) { | ||
140 | + if (res.data.code == 0) { | ||
141 | + if (res.data.data.total > 0) { | ||
142 | + _this.setData({ | ||
143 | + isEmpty: false | ||
144 | + }) | ||
145 | + } else { | ||
146 | + _this.setData({ | ||
147 | + isEmpty: true | ||
148 | + }) | ||
149 | + } | ||
150 | + if (res.data.data.pageData.length == 0) { | ||
151 | + _this.setData({ | ||
152 | + loadingType: 2 | ||
153 | + }) | ||
154 | + } else { | ||
155 | + var wareCard = that.wareCard; | ||
156 | + if (wareCard.length < res.data.data.total) { | ||
157 | + for (var i = 0; i < res.data.data.pageData.length; i++) { | ||
158 | + wareCard.push(res.data.data.pageData[i]); | ||
159 | + } | ||
163 | } | 160 | } |
161 | + _this.setData({ | ||
162 | + wareCard: wareCard | ||
163 | + }) | ||
164 | + _this.setData({ | ||
165 | + loadingType: 0 | ||
166 | + }) | ||
167 | + | ||
164 | } | 168 | } |
169 | + } else { | ||
170 | + getApp().my_warnning(res.data.msg, 0, th); | ||
165 | } | 171 | } |
166 | - }); | 172 | + } |
173 | + }) | ||
167 | 174 | ||
168 | - } | 175 | + }, |
176 | + //界面跳转 | ||
177 | + goto: function(e) { | ||
178 | + var th = this; | ||
179 | + var url = e.currentTarget.dataset.url; | ||
180 | + getApp().goto(url); | ||
169 | } | 181 | } |
170 | -}); | ||
171 | \ No newline at end of file | 182 | \ No newline at end of file |
183 | +}) | ||
172 | \ No newline at end of file | 184 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.json
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | "navigationBarTitleText": "礼包列表", | 2 | "navigationBarTitleText": "礼包列表", |
3 | "navigationStyle": "custom", | 3 | "navigationStyle": "custom", |
4 | "usingComponents": { | 4 | "usingComponents": { |
5 | - "u-li-load-more": "/components/uLi-load-more/uLi-load-more" | 5 | + "warn": "/components/long_warn/long_warn", |
6 | + "my_confirm": "/components/my_confirm/my_confirm" | ||
6 | } | 7 | } |
7 | } | 8 | } |
8 | \ No newline at end of file | 9 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.wxml
1 | <view class="top_img"> | 1 | <view class="top_img"> |
2 | <view class="top_img"> | 2 | <view class="top_img"> |
3 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | 3 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}"></image> |
4 | </view> | 4 | </view> |
5 | <view class="top_title"> | 5 | <view class="top_title"> |
6 | <view class="top_title_box"> | 6 | <view class="top_title_box"> |
@@ -8,14 +8,14 @@ | @@ -8,14 +8,14 @@ | ||
8 | </view> | 8 | </view> |
9 | <view class="top_title_box_S"></view> | 9 | <view class="top_title_box_S"></view> |
10 | <view class="top_title_box"> | 10 | <view class="top_title_box"> |
11 | - <text data-event-opts="{{[['tap',[['MyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="__e">我的礼包</text> | 11 | + <a data-event-opts="{{[['tap',[['MyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a> |
12 | </view> | 12 | </view> |
13 | </view> | 13 | </view> |
14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | 14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
15 | <view class="content_box"> | 15 | <view class="content_box"> |
16 | - <view class="content_box_ware"> | ||
17 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img" bindtap="__e"> | ||
18 | - <image src="{{$GetInfo.imgHttp+items.lbUrl}}"></image> | 16 | + <view class="content_box_ware" bindtap="goto" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> |
17 | + <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img"> | ||
18 | + <image src="{{iurl+items.lbUrl}}"></image> | ||
19 | </view> | 19 | </view> |
20 | <view class="content_box_title"> | 20 | <view class="content_box_title"> |
21 | <view class="content_ware_title"> | 21 | <view class="content_ware_title"> |
@@ -45,22 +45,22 @@ | @@ -45,22 +45,22 @@ | ||
45 | <text>{{"已售:"+items.giftQty+"件"}}</text> | 45 | <text>{{"已售:"+items.giftQty+"件"}}</text> |
46 | </view> | 46 | </view> |
47 | <block wx:if="{{items.payMoney>0}}"> | 47 | <block wx:if="{{items.payMoney>0}}"> |
48 | - <view class="box_button_buy"> | ||
49 | - <button data-event-opts="{{[['tap',[['GetBuyPrice',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即购买</button> | 48 | + <view class="box_button_buy" data-lbId="{{items.lbId}}" bindtap="GetBuyPrice"> |
49 | + <button data-event-opts="{{[['tap',[['GetBuyPrice',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即购买{{items.lbId}}</button> | ||
50 | </view> | 50 | </view> |
51 | </block> | 51 | </block> |
52 | <block wx:if="{{items.payIntegral>0}}"> | 52 | <block wx:if="{{items.payIntegral>0}}"> |
53 | - <view class="box_button_dui"> | ||
54 | - <button data-event-opts="{{[['tap',[['GetBuyIntegral',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即兑换</button> | 53 | + <view class="box_button_dui" bindtap="GetBuyIntegral" data-lbId="{{items.lbId}}"> |
54 | + <button data-event-opts="{{[['tap',[['GetBuyIntegral',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即兑换</button> | ||
55 | </view> | 55 | </view> |
56 | </block> | 56 | </block> |
57 | </view> | 57 | </view> |
58 | </view> | 58 | </view> |
59 | </block> | 59 | </block> |
60 | - <block wx:if="{{this.isEmpty==true}}"> | 60 | + <block wx:if="{{isEmpty==true}}"> |
61 | <view class="foot_empty"> | 61 | <view class="foot_empty"> |
62 | <view> | 62 | <view> |
63 | - <image src="../../static/img/gift07.png"></image> | 63 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}"></image> |
64 | </view> | 64 | </view> |
65 | <view> | 65 | <view> |
66 | <text>当前暂无礼包</text> | 66 | <text>当前暂无礼包</text> |
@@ -73,4 +73,7 @@ | @@ -73,4 +73,7 @@ | ||
73 | <view class="foot_box"> | 73 | <view class="foot_box"> |
74 | <text>———— 到底了 ————</text> | 74 | <text>———— 到底了 ————</text> |
75 | </view> | 75 | </view> |
76 | -</view> | ||
77 | \ No newline at end of file | 76 | \ No newline at end of file |
77 | +</view> | ||
78 | +<!-- 引入提示组件 --> | ||
79 | +<warn id="warn"></warn> | ||
80 | +<my_confirm id="my_confirm"></my_confirm> | ||
78 | \ No newline at end of file | 81 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.wxss
1 | - | ||
2 | /*引用样式路径*/ | 1 | /*引用样式路径*/ |
3 | @charset "UTF-8"; | 2 | @charset "UTF-8"; |
3 | + | ||
4 | /* Author XGQ | 4 | /* Author XGQ |
5 | * 2019-11-12 | 5 | * 2019-11-12 |
6 | */ | 6 | */ |
7 | + | ||
7 | page { | 8 | page { |
8 | - background-color: #fb7454; | 9 | + background-color: #fb7454; |
9 | } | 10 | } |
11 | + | ||
10 | .top_img { | 12 | .top_img { |
11 | - -webkit-align-content: center; | ||
12 | - align-content: center; | 13 | + -webkit-align-content: center; |
14 | + align-content: center; | ||
13 | } | 15 | } |
16 | + | ||
14 | .top_img image { | 17 | .top_img image { |
15 | - width: 100%; | ||
16 | - height: 660rpx; | 18 | + width: 100%; |
19 | + height: 660rpx; | ||
17 | } | 20 | } |
21 | + | ||
18 | .top_title { | 22 | .top_title { |
19 | - display: -webkit-box; | ||
20 | - display: -webkit-flex; | ||
21 | - display: flex; | ||
22 | - background-color: #FFFFFF; | ||
23 | - height: 85rpx; | ||
24 | - border-radius: 10rpx 10rpx 0rpx 0rpx; | ||
25 | - margin: 0rpx 20rpx 0rpx 20rpx; | ||
26 | - -webkit-align-content: center; | ||
27 | - align-content: center; | 23 | + display: -webkit-box; |
24 | + display: -webkit-flex; | ||
25 | + display: flex; | ||
26 | + background-color: #fff; | ||
27 | + height: 85rpx; | ||
28 | + border-radius: 10rpx 10rpx 0rpx 0rpx; | ||
29 | + margin: 0rpx 20rpx 0rpx 20rpx; | ||
30 | + -webkit-align-content: center; | ||
31 | + align-content: center; | ||
28 | } | 32 | } |
33 | + | ||
29 | .top_title_box { | 34 | .top_title_box { |
30 | - width: 49%; | ||
31 | - -webkit-align-content: center; | ||
32 | - align-content: center; | ||
33 | - text-align: center; | ||
34 | - padding: 15rpx; | 35 | + width: 49%; |
36 | + -webkit-align-content: center; | ||
37 | + align-content: center; | ||
38 | + text-align: center; | ||
39 | + padding: 15rpx; | ||
35 | } | 40 | } |
41 | + | ||
36 | .top_title_box_S { | 42 | .top_title_box_S { |
37 | - width: 1%; | ||
38 | - -webkit-align-content: center; | ||
39 | - align-content: center; | ||
40 | - text-align: center; | ||
41 | - margin: 20rpx 0rpx 20rpx 0rpx; | ||
42 | - border-left: #000000 solid 3rpx; | 43 | + width: 1%; |
44 | + -webkit-align-content: center; | ||
45 | + align-content: center; | ||
46 | + text-align: center; | ||
47 | + margin: 20rpx 0rpx 20rpx 0rpx; | ||
48 | + border-left: #000 solid 3rpx; | ||
43 | } | 49 | } |
50 | + | ||
44 | .top_title_redtext { | 51 | .top_title_redtext { |
45 | - font-size: 30rpx; | ||
46 | - color: #d61b30; | 52 | + font-size: 30rpx; |
53 | + color: #d61b30; | ||
47 | } | 54 | } |
55 | + | ||
48 | .top_title_blacktext { | 56 | .top_title_blacktext { |
49 | - font-size: 30rpx; | ||
50 | - color: #000000; | 57 | + font-size: 30rpx; |
58 | + color: #000; | ||
51 | } | 59 | } |
60 | + | ||
52 | .content_box { | 61 | .content_box { |
53 | - background-color: #FFFFFF; | ||
54 | - height: 375rpx; | ||
55 | - margin: 10rpx 20rpx 0rpx 20rpx; | ||
56 | - border-radius: 10rpx; | 62 | + background-color: #fff; |
63 | + margin: 10rpx 20rpx 0rpx 20rpx; | ||
64 | + border-radius: 10rpx; | ||
57 | } | 65 | } |
66 | + | ||
58 | .content_box_ware { | 67 | .content_box_ware { |
59 | - border-bottom: #f5f5f5 solid 2rpx; | ||
60 | - display: -webkit-box; | ||
61 | - display: -webkit-flex; | ||
62 | - display: flex; | 68 | + border-bottom: #f5f5f5 solid 2rpx; |
69 | + display: -webkit-box; | ||
70 | + display: -webkit-flex; | ||
71 | + display: flex; | ||
63 | } | 72 | } |
73 | + | ||
64 | .content_box_img { | 74 | .content_box_img { |
65 | - margin: 20rpx 20rpx 20rpx 25rpx; | ||
66 | - width: 35%; | ||
67 | - display: -webkit-box; | ||
68 | - display: -webkit-flex; | ||
69 | - display: flex; | ||
70 | - font-size: 8rpx; | ||
71 | - position: relative; | 75 | + margin: 20rpx 20rpx 20rpx 25rpx; |
76 | + width: 35%; | ||
77 | + display: -webkit-box; | ||
78 | + display: -webkit-flex; | ||
79 | + display: flex; | ||
80 | + font-size: 8rpx; | ||
81 | + position: relative; | ||
72 | } | 82 | } |
83 | + | ||
73 | .content_box_img image { | 84 | .content_box_img image { |
74 | - width: 100%; | ||
75 | - height: 230rpx; | 85 | + width: 100%; |
86 | + height: 230rpx; | ||
76 | } | 87 | } |
88 | + | ||
77 | .content_box_title { | 89 | .content_box_title { |
78 | - width: 65%; | ||
79 | - margin: 25rpx 25rpx 10rpx 0rpx; | ||
80 | - position: relative; | 90 | + width: 65%; |
91 | + margin: 25rpx 25rpx 10rpx 0rpx; | ||
92 | + position: relative; | ||
81 | } | 93 | } |
94 | + | ||
82 | .content_ware_title { | 95 | .content_ware_title { |
83 | - font-size: 30rpx; | ||
84 | - word-break: break-all; | ||
85 | - /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
86 | - text-overflow: ellipsis; | ||
87 | - display: -webkit-box; | ||
88 | - /** 对象作为伸缩盒子模型显示 **/ | ||
89 | - -webkit-box-orient: vertical; | ||
90 | - /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
91 | - -webkit-line-clamp: 2; | ||
92 | - /** 显示的行数 **/ | ||
93 | - overflow: hidden; | ||
94 | - /** 隐藏超出的内容 **/ | 96 | + font-size: 30rpx; |
97 | + word-break: break-all; | ||
98 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
99 | + text-overflow: ellipsis; | ||
100 | + display: -webkit-box; | ||
101 | + /** 对象作为伸缩盒子模型显示 **/ | ||
102 | + -webkit-box-orient: vertical; | ||
103 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
104 | + -webkit-line-clamp: 2; | ||
105 | + /** 显示的行数 **/ | ||
106 | + overflow: hidden; | ||
107 | + /** 隐藏超出的内容 **/ | ||
95 | } | 108 | } |
109 | + | ||
96 | .content_ware_type { | 110 | .content_ware_type { |
97 | - font-size: 28rpx; | ||
98 | - color: #c61a34; | ||
99 | - margin-top: 10rpx; | ||
100 | - position: absolute; | ||
101 | - left: 0; | ||
102 | - bottom: 100rpx; | 111 | + font-size: 28rpx; |
112 | + color: #c61a34; | ||
113 | + margin-top: 10rpx; | ||
114 | + position: absolute; | ||
115 | + left: 0; | ||
116 | + bottom: 100rpx; | ||
103 | } | 117 | } |
118 | + | ||
104 | .content_ware_price { | 119 | .content_ware_price { |
105 | - font-size: 20rpx; | ||
106 | - color: #b9b5b5; | ||
107 | - margin-top: 2rpx; | ||
108 | - text-decoration: line-through; | ||
109 | - position: absolute; | ||
110 | - left: 0; | ||
111 | - bottom: 70rpx; | 120 | + font-size: 20rpx; |
121 | + color: #b9b5b5; | ||
122 | + margin-top: 2rpx; | ||
123 | + text-decoration: line-through; | ||
124 | + position: absolute; | ||
125 | + left: 0; | ||
126 | + bottom: 70rpx; | ||
112 | } | 127 | } |
128 | + | ||
113 | .content_ware_time { | 129 | .content_ware_time { |
114 | - font-size: 25rpx; | ||
115 | - color: #000000; | ||
116 | - margin-top: 20rpx; | ||
117 | - position: absolute; | ||
118 | - left: 0; | ||
119 | - bottom: 25rpx; | 130 | + font-size: 25rpx; |
131 | + color: #000; | ||
132 | + margin-top: 20rpx; | ||
133 | + position: absolute; | ||
134 | + left: 0; | ||
135 | + bottom: 25rpx; | ||
136 | +} | ||
137 | +.box_button_buy{ | ||
138 | + display: flex; | ||
139 | + align-items: center; | ||
120 | } | 140 | } |
121 | .content_box_button { | 141 | .content_box_button { |
122 | - display: -webkit-box; | ||
123 | - display: -webkit-flex; | ||
124 | - display: flex; | ||
125 | - -webkit-box-pack: end; | ||
126 | - -webkit-justify-content: flex-end; | ||
127 | - justify-content: flex-end; | ||
128 | - position: relative; | ||
129 | -} | ||
130 | -.box_button_remark{ | ||
131 | - margin: 15rpx 0rpx 0rpx 30rpx; | ||
132 | - width: 50%; | ||
133 | - position: absolute; | ||
134 | - left: 5rpx; | ||
135 | - bottom: 15rpx; | ||
136 | -} | ||
137 | -.box_button_remark text{ | ||
138 | - font-size: 28rpx; | ||
139 | - color: #B9B5B5; | 142 | + display: flex; |
143 | + height: 110rpx; | ||
144 | + justify-content: space-between; | ||
145 | + align-items: center; | ||
146 | + padding-left: 20rpx; | ||
147 | + padding-right: 25rpx; | ||
148 | + line-height: 110rpx; | ||
140 | } | 149 | } |
141 | -.box_button_buy{ | ||
142 | - text-align: right; | ||
143 | - margin: 22rpx 25rpx 0rpx 0rpx; | 150 | + |
151 | +.box_button_remark { | ||
152 | + margin-left: 5rpx; | ||
144 | } | 153 | } |
145 | -.box_button_buy button{ | ||
146 | - display: inline-block; | ||
147 | - width: 160rpx; | ||
148 | - height: 50rpx; | ||
149 | - font-size: 20rpx; | ||
150 | - background: #d41c34; | ||
151 | - color: #FFFFFF; | ||
152 | - line-height: 50rpx; | 154 | + |
155 | +.box_button_remark text { | ||
156 | + font-size: 28rpx; | ||
157 | + color: #b9b5b5; | ||
153 | } | 158 | } |
154 | -.box_button_dui{ | 159 | + |
160 | +.box_button_buy button { | ||
161 | + display: inline-block; | ||
162 | + width: 160rpx; | ||
163 | + height: 50rpx; | ||
164 | + font-size: 20rpx; | ||
165 | + background: #d41c34; | ||
166 | + color: #fff; | ||
167 | + line-height: 50rpx; | ||
168 | +} | ||
169 | + | ||
170 | +.box_button_dui { | ||
155 | text-align: right; | 171 | text-align: right; |
156 | margin: 22rpx 25rpx 0rpx 0rpx; | 172 | margin: 22rpx 25rpx 0rpx 0rpx; |
157 | } | 173 | } |
158 | -.box_button_dui button{ | ||
159 | - display: inline-block; | ||
160 | - width: 160rpx; | ||
161 | - height: 50rpx; | ||
162 | - font-size: 20rpx; | ||
163 | - background: #FFFFFF; | ||
164 | - color: #000000; | ||
165 | - line-height: 50rpx; | 174 | + |
175 | +.box_button_dui button { | ||
176 | + display: inline-block; | ||
177 | + width: 160rpx; | ||
178 | + height: 50rpx; | ||
179 | + font-size: 20rpx; | ||
180 | + background: #fff; | ||
181 | + color: #000; | ||
182 | + line-height: 50rpx; | ||
166 | } | 183 | } |
184 | + | ||
167 | .foot_box { | 185 | .foot_box { |
168 | - -webkit-align-content: center; | ||
169 | - align-content: center; | ||
170 | - text-align: center; | ||
171 | - margin-top: 15rpx; | ||
172 | - margin-bottom: 50rpx; | 186 | + -webkit-align-content: center; |
187 | + align-content: center; | ||
188 | + text-align: center; | ||
189 | + margin-top: 15rpx; | ||
190 | + margin-bottom: 50rpx; | ||
173 | } | 191 | } |
192 | + | ||
174 | .foot_box text { | 193 | .foot_box text { |
175 | - font-size: 25rpx; | ||
176 | - color: #FFFFFF; | ||
177 | -} | ||
178 | -.foot_empty{ | ||
179 | - background-color: #FFFFFF; | ||
180 | - height: 375rpx; | ||
181 | - margin: 10rpx 20rpx 0rpx 20rpx; | ||
182 | - border-radius: 10rpx; | ||
183 | - text-align: center; | ||
184 | - padding: 150rpx 0rpx 300rpx 0rpx; | ||
185 | - -webkit-box-pack: center; | ||
186 | - -webkit-justify-content: center; | ||
187 | - justify-content: center; | ||
188 | -} | ||
189 | -.foot_empty image{ | ||
190 | - width: 400rpx; | ||
191 | - height: 273rpx; | ||
192 | -} | ||
193 | -.foot_empty text{ | ||
194 | - font-size: 30rpx; | ||
195 | - color: #999999; | ||
196 | -} | ||
197 | -.foot_empty_button{ | ||
198 | - background: #ff6363; | ||
199 | - margin: 60rpx 230rpx 0rpx 230rpx; | ||
200 | - padding: 10rpx; | ||
201 | - border-radius: 70rpx; | ||
202 | - line-height: 40rpx; | ||
203 | -} | ||
204 | -.foot_empty_button text{ | ||
205 | - font-size: 28rpx; | ||
206 | - color: #FFFFFF; | 194 | + font-size: 25rpx; |
195 | + color: #fff; | ||
196 | +} | ||
197 | + | ||
198 | +.foot_empty { | ||
199 | + background-color: #fff; | ||
200 | + height: 375rpx; | ||
201 | + margin: 10rpx 20rpx 0rpx 20rpx; | ||
202 | + border-radius: 10rpx; | ||
203 | + text-align: center; | ||
204 | + padding: 150rpx 0rpx 300rpx 0rpx; | ||
205 | + -webkit-box-pack: center; | ||
206 | + -webkit-justify-content: center; | ||
207 | + justify-content: center; | ||
208 | +} | ||
209 | + | ||
210 | +.foot_empty image { | ||
211 | + width: 400rpx; | ||
212 | + height: 273rpx; | ||
213 | +} | ||
214 | + | ||
215 | +.foot_empty text { | ||
216 | + font-size: 30rpx; | ||
217 | + color: #999; | ||
218 | +} | ||
219 | + | ||
220 | +.foot_empty_button { | ||
221 | + background: #ff6363; | ||
222 | + margin: 60rpx 230rpx 0rpx 230rpx; | ||
223 | + padding: 10rpx; | ||
224 | + border-radius: 70rpx; | ||
225 | + line-height: 40rpx; | ||
226 | +} | ||
227 | + | ||
228 | +.foot_empty_button text { | ||
229 | + font-size: 28rpx; | ||
230 | + color: #fff; | ||
207 | } | 231 | } |
pages/giftpack/giftpacklist/giftpacklist.js
1 | -var t = require("../../utils/common.js"); var os = getApp().globalData.setting; | 1 | +var e = getApp(), |
2 | + a = e.globalData.setting, | ||
3 | + os = a, | ||
4 | + t = e.request, | ||
5 | + d = e.globalData; | ||
2 | Page({ | 6 | Page({ |
3 | - data: function data() { | ||
4 | - return { | ||
5 | - isBuy: 0, | ||
6 | - getGiftID: '', | ||
7 | - giftImage: '', | ||
8 | - giftTitle: '', | ||
9 | - giftDate: '', | ||
10 | - giftPrice: '', | ||
11 | - giftIntegral: '', | ||
12 | - giftPosPrice: '', | ||
13 | - giftQty: '', | ||
14 | - giftRemark: '', | ||
15 | - giftType: '', | ||
16 | - actTitle: '', | ||
17 | - getUrl: '', | ||
18 | - wareCard: [] | ||
19 | - }; | ||
20 | - | 7 | + data: { |
8 | + url: a.url, //接口网址 | ||
9 | + iurl: a.imghost, //图片前缀网址 | ||
10 | + isBuy: 0, | ||
11 | + getGiftID: '', //礼包id | ||
12 | + giftImage: '', | ||
13 | + giftTitle: '', | ||
14 | + giftDate: '', | ||
15 | + giftPrice: '', | ||
16 | + giftIntegral: '', | ||
17 | + giftPosPrice: '', | ||
18 | + giftQty: '', | ||
19 | + giftRemark: '', | ||
20 | + giftType: '', | ||
21 | + actTitle: '', | ||
22 | + getUrl: '', | ||
23 | + wareCard: [], | ||
24 | + orderSn: "", //订单编号 | ||
21 | }, | 25 | }, |
22 | - onLoad: function onLoad(options) { | ||
23 | - this.isBuy = options.isBuy; | ||
24 | - this.getStorageID = options.stoid; | ||
25 | - this.getUserID = options.userid; | ||
26 | - this.getGiftID = options.id; | ||
27 | - | ||
28 | - console.log(this.isBuy + '||' + this.getStorageID + '||' + this.getUserID + '||' + this.getGiftID); | 26 | + onLoad: function(options) { |
27 | + var th = this; | ||
28 | + th.setData({ | ||
29 | + isBuy: options.isBuy, | ||
30 | + getStorageID: a.stoid, | ||
31 | + getUserID: d.user_id, | ||
32 | + getGiftID: options.lbId, | ||
33 | + orderSn: options.orderSn | ||
34 | + }) | ||
29 | }, | 35 | }, |
30 | - onShow: function onShow() { | ||
31 | - if (this.isBuy == 0) { | ||
32 | - this.GetMyGiftList(); | 36 | + onShow: function() { |
37 | + var th = this; | ||
38 | + if (th.data.isBuy == 0) { | ||
39 | + th.GetMyGiftList(); | ||
33 | } else { | 40 | } else { |
34 | - this.GetBuyGiftList(); | 41 | + th.GetBuyGiftList(); |
35 | } | 42 | } |
36 | 43 | ||
37 | - this.giftRemark = this.giftRemark.replace(/<p><img/gi, "<p class='img'><img"); | 44 | + // this.giftRemark = this.giftRemark.replace(/<p><img/gi, "<p class='img'><img"); |
45 | + th.setData({ | ||
46 | + giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | ||
47 | + }) | ||
38 | }, | 48 | }, |
39 | - methods: { | ||
40 | - GetBuyPrice: function GetBuyPrice() { | ||
41 | - var that = this; | ||
42 | - uni.showModal({ | ||
43 | - title: '', | ||
44 | - content: '是否确定购买该礼包', | ||
45 | - success: function success(res) { | ||
46 | - if (res.confirm) { | ||
47 | - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert',{ | ||
48 | - data: { | ||
49 | - "actId": '', //活动Id | ||
50 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
51 | - "buyType": '2', //1=积分兑换 2=余额购买 | ||
52 | - "lbId": that.getGiftID, //礼包Id | ||
53 | - "storeId": that.getStorageID, //商家Id | ||
54 | - "userId": that.getUserID //用户ID | ||
55 | - }, | ||
56 | - success: function success(res) { | ||
57 | - console.log(res.data); | ||
58 | - if (res.data.code == 0) { | ||
59 | - console.log(res.data.msg); | ||
60 | - uni.showToast({ | ||
61 | - icon: 'none', | ||
62 | - title: '购买成功!' | ||
63 | - }); | ||
64 | - | ||
65 | - } else { | ||
66 | - console.log(res.data.msg); | ||
67 | - uni.showToast({ | ||
68 | - icon: 'none', | ||
69 | - title: res.data.msg | ||
70 | - }); | ||
71 | - | ||
72 | - } | 49 | + GetBuyPrice: function() { |
50 | + var that = this; | ||
51 | + var th = this.data; | ||
52 | + uni.showModal({ | ||
53 | + title: '', | ||
54 | + content: '是否确定购买该礼包', | ||
55 | + success: function success(res) { | ||
56 | + if (res.confirm) { | ||
57 | + getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
58 | + data: { | ||
59 | + "actId": '', //活动Id | ||
60 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
61 | + "buyType": '2', //1=积分兑换 2=余额购买 | ||
62 | + "lbId": th.getGiftID, //礼包Id | ||
63 | + "storeId": th.getStorageID, //商家Id | ||
64 | + "userId": th.getUserID //用户ID | ||
65 | + }, | ||
66 | + success: function success(res) { | ||
67 | + if (res.data.code == 0) { | ||
68 | + getApp().my_warnning("购买成功!", 0, that); | ||
69 | + | ||
70 | + } else { | ||
71 | + getApp().my_warnning(res.data.msg, 0, that); | ||
73 | } | 72 | } |
74 | - }); | 73 | + } |
74 | + }); | ||
75 | 75 | ||
76 | + } else if (res.cancel) { | ||
76 | 77 | ||
77 | - } else if (res.cancel) { | ||
78 | - console.log('用户点击取消'); | ||
79 | - } | ||
80 | } | 78 | } |
81 | - }); | ||
82 | - | ||
83 | - | ||
84 | - }, | ||
85 | - GetBuyIntegral: function GetBuyIntegral() { | ||
86 | - var that = this; | ||
87 | - uni.showModal({ | ||
88 | - title: '', | ||
89 | - content: '是否确定兑换该礼包', | ||
90 | - success: function success(res) { | ||
91 | - if (res.confirm) { | ||
92 | - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert',{ | ||
93 | - data: { | ||
94 | - "actId": '', //活动Id | ||
95 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
96 | - "buyType": '1', //1=积分兑换 2=余额购买 | ||
97 | - "lbId": that.getGiftID, //礼包Id | ||
98 | - "storeId": that.getStorageID, //商家Id | ||
99 | - "userId": that.getUserID //用户ID | ||
100 | - }, | ||
101 | - success: function success(res) { | ||
102 | - console.log(res.data); | ||
103 | - if (res.data.code == 0) { | ||
104 | - console.log(res.data.msg); | ||
105 | - uni.showToast({ | ||
106 | - icon: 'none', | ||
107 | - title: '兑换成功!' | ||
108 | - }); | ||
109 | - | ||
110 | - } else { | ||
111 | - console.log(res.data.msg); | ||
112 | - uni.showToast({ | ||
113 | - icon: 'none', | ||
114 | - title: res.data.msg | ||
115 | - }); | ||
116 | - | ||
117 | - } | ||
118 | - } | ||
119 | - }); | 79 | + } |
80 | + }); | ||
120 | 81 | ||
121 | 82 | ||
122 | - } else if (res.cancel) { | ||
123 | - console.log('用户点击取消'); | ||
124 | - } | ||
125 | - } | ||
126 | - }); | 83 | + }, |
84 | + GetBuyIntegral: function() { | ||
85 | + var that = this.data; | ||
86 | + uni.showModal({ | ||
87 | + title: '', | ||
88 | + content: '是否确定兑换该礼包', | ||
89 | + success: function success(res) { | ||
90 | + if (res.confirm) { | ||
91 | + getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
92 | + data: { | ||
93 | + "actId": '', //活动Id | ||
94 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
95 | + "buyType": '1', //1=积分兑换 2=余额购买 | ||
96 | + "lbId": that.getGiftID, //礼包Id | ||
97 | + "storeId": that.getStorageID, //商家Id | ||
98 | + "userId": that.getUserID //用户ID | ||
99 | + }, | ||
100 | + success: function success(res) { | ||
101 | + if (res.data.code == 0) { | ||
102 | + // uni.showToast({ | ||
103 | + // icon: 'none', | ||
104 | + // title: '兑换成功!' | ||
105 | + // }); | ||
106 | + getApp().my_warnning("兑换成功!"); | ||
107 | + | ||
108 | + } else { | ||
109 | + uni.showToast({ | ||
110 | + icon: 'none', | ||
111 | + title: res.data.msg | ||
112 | + }); | ||
127 | 113 | ||
114 | + } | ||
115 | + } | ||
116 | + }); | ||
128 | 117 | ||
129 | 118 | ||
119 | + } else if (res.cancel) {} | ||
120 | + } | ||
121 | + }); | ||
130 | 122 | ||
131 | - }, | ||
132 | - GetMyGiftList: function GetMyGiftList() { | ||
133 | - var _this = this; | ||
134 | - getApp().request.promiseget('/api/weshop/marketing/my/giftbag/detail/get',{ | ||
135 | - data: { | ||
136 | - "storeId": this.getStorageID, //商家ID | ||
137 | - "userId": this.getUserID, //用户ID | ||
138 | - "orderSn": this.getGiftID | ||
139 | - }, | ||
140 | - success: function success(res) { | ||
141 | - console.log(res.data); | ||
142 | - _this.giftImage = _this.$GetInfo.imgHttp + res.data.data.lbUrl; | ||
143 | - _this.giftTitle = res.data.data.giftTitle; | 123 | + }, |
124 | + GetMyGiftList: function() { | ||
125 | + var _this = this; | ||
126 | + var th = this; | ||
127 | + getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | ||
128 | + data: { | ||
129 | + "storeId": th.data.getStorageID, //商家ID | ||
130 | + "userId": th.data.getUserID, //用户ID | ||
131 | + "orderSn": th.data.orderSn | ||
132 | + }, | ||
133 | + success: function success(res) { | ||
134 | + if (res.data.code == 0) { | ||
135 | + th.setData({ | ||
136 | + giftImage: th.data.iurl + res.data.data.lbUrl, | ||
137 | + giftTitle: res.data.data.giftTitle | ||
138 | + }) | ||
144 | if (res.data.data.giftRemark == '') { | 139 | if (res.data.data.giftRemark == '') { |
145 | - _this.giftRemark = '暂无详情......'; | 140 | + th.setData({ |
141 | + giftRemark: '暂无详情......' | ||
142 | + }) | ||
146 | } else { | 143 | } else { |
147 | - _this.giftRemark = res.data.data.giftRemark; | 144 | + th.setData({ |
145 | + giftRemark: res.data.data.giftRemark | ||
146 | + }) | ||
148 | } | 147 | } |
149 | - _this.giftDate = res.data.data.endTime; | ||
150 | - _this.giftPosPrice = res.data.data.giftPosPrice; | ||
151 | - _this.giftQty = res.data.data.giftQty; | ||
152 | - _this.giftIntegral = res.data.data.payIntegral; | ||
153 | - _this.giftPrice = res.data.data.payMoney; | ||
154 | - _this.giftType = res.data.data.actType; | ||
155 | - _this.actTitle = res.data.data.actTitle; | ||
156 | - _this.wareCard = res.data.data.wareCard; | ||
157 | - console.log(res.data.actImg); | 148 | + |
149 | + th.setData({ | ||
150 | + giftDate: res.data.data.endTime, | ||
151 | + giftPosPrice: res.data.data.giftPosPrice, | ||
152 | + giftQty: res.data.data.giftQty, | ||
153 | + giftIntegral: res.data.data.payIntegral, | ||
154 | + giftPrice: res.data.data.payMoney, | ||
155 | + giftType: res.data.data.actType, | ||
156 | + actTitle: res.data.data.actTitle, | ||
157 | + wareCard: res.data.data.wareCard | ||
158 | + }) | ||
159 | + } else { | ||
160 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | ||
161 | + return false; | ||
158 | } | 162 | } |
159 | - }); | ||
160 | - | ||
161 | - }, | ||
162 | - GetBuyGiftList: function GetBuyGiftList() { | ||
163 | - var _this2 = this; | ||
164 | - getApp().request.promiseget('/api/weshop/marketing/giftbag/detail/get',{ | ||
165 | - data: { | ||
166 | - "storeId": this.getStorageID, //商家ID | ||
167 | - "userId": this.getUserID, //用户ID | ||
168 | - "giftBagId": this.getGiftID | ||
169 | - }, | ||
170 | - success: function success(res) { | ||
171 | - console.log(res.data); | ||
172 | - _this2.giftImage = _this2.$GetInfo.imgHttp + res.data.data.lbUrl; | ||
173 | - _this2.giftTitle = res.data.data.giftTitle; | 163 | + } |
164 | + }); | ||
165 | + | ||
166 | + }, | ||
167 | + GetBuyGiftList: function() { | ||
168 | + var _this2 = this; | ||
169 | + var th = this.data; | ||
170 | + getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | ||
171 | + data: { | ||
172 | + "storeId": th.getStorageID, //商家ID | ||
173 | + "userId": th.getUserID, //用户ID | ||
174 | + "giftBagId": th.getGiftID | ||
175 | + }, | ||
176 | + success: function success(res) { | ||
177 | + if (res.data.code == 0) { | ||
178 | + _this2.setData({ | ||
179 | + giftImage: th.iurl + res.data.data.lbUrl, | ||
180 | + giftTitle: res.data.data.giftTitle | ||
181 | + }) | ||
174 | if (res.data.data.giftRemark == '') { | 182 | if (res.data.data.giftRemark == '') { |
175 | - _this2.giftRemark = '暂无详情......'; | 183 | + |
184 | + _this2.setData({ | ||
185 | + giftRemark: '暂无详情......' | ||
186 | + }) | ||
176 | } else { | 187 | } else { |
177 | - _this2.giftRemark = res.data.data.giftRemark; | 188 | + _this2.setData({ |
189 | + giftRemark: res.data.data.giftRemark | ||
190 | + }) | ||
178 | } | 191 | } |
179 | - _this2.giftDate = res.data.data.endTime; | ||
180 | - _this2.giftPosPrice = res.data.data.giftPosPrice; | ||
181 | - _this2.giftQty = res.data.data.giftQty; | ||
182 | - _this2.giftIntegral = res.data.data.payIntegral; | ||
183 | - _this2.giftPrice = res.data.data.payMoney; | ||
184 | - _this2.giftType = res.data.data.actType; | ||
185 | - _this2.actTitle = res.data.data.actTitle; | ||
186 | - _this2.wareCard = res.data.data.wareCard; | ||
187 | - console.log(res.data.actImg); | 192 | + |
193 | + _this2.setData({ | ||
194 | + giftDate: res.data.data.endTime, | ||
195 | + giftPosPrice: res.data.data.giftPosPrice, | ||
196 | + giftQty: res.data.data.giftQty, | ||
197 | + giftIntegral: res.data.data.payIntegral, | ||
198 | + giftPrice: res.data.data.payMoney, | ||
199 | + giftType: res.data.data.actType, | ||
200 | + actTitle: res.data.data.actTitle, | ||
201 | + wareCard: res.data.data.wareCard | ||
202 | + }) | ||
203 | + } else { | ||
204 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); | ||
205 | + return false; | ||
188 | } | 206 | } |
189 | - }); | 207 | + } |
208 | + }); | ||
190 | 209 | ||
191 | - }, | ||
192 | - GetQrCode: function GetQrCode() { | ||
193 | - //不销毁调整 | ||
194 | - uni.navigateTo({ | ||
195 | - url: '/pages/mygiftpack/QrCode?number=' + this.getGiftID | ||
196 | - }); | 210 | + }, |
211 | + GetQrCode: function() { | ||
212 | + //不销毁调整 | ||
213 | + uni.navigateTo({ | ||
214 | + url: '/pages/mygiftpack/QrCode?number=' + this.getGiftID | ||
215 | + }); | ||
197 | 216 | ||
198 | - }, | ||
199 | - GetWebHttp: function GetWebHttp(type) { | 217 | + }, |
218 | + GetWebHttp: function(type) { | ||
200 | 219 | ||
201 | - if (type == 0) { | ||
202 | - this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/User/coupon/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
203 | - } | ||
204 | - if (type == 1) { | ||
205 | - this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/Yyservice/service_items_list/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
206 | - } | ||
207 | - window.location.href = this.getUrl; | 220 | + if (type == 0) { |
221 | + this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/User/coupon/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
222 | + } | ||
223 | + if (type == 1) { | ||
224 | + this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/Yyservice/service_items_list/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
208 | } | 225 | } |
226 | + window.location.href = this.getUrl; | ||
209 | } | 227 | } |
228 | + | ||
210 | }); | 229 | }); |
211 | \ No newline at end of file | 230 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "礼包详情", | 2 | "navigationBarTitleText": "礼包详情", |
3 | "navigationStyle": "custom", | 3 | "navigationStyle": "custom", |
4 | - "usingComponents": {} | 4 | + "usingComponents": { |
5 | + "warn": "/components/long_warn/long_warn", | ||
6 | + "my_confirm": "/components/my_confirm/my_confirm" | ||
7 | + } | ||
5 | } | 8 | } |
6 | \ No newline at end of file | 9 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.wxml
1 | <view class="box data-v-3a5b7e36"> | 1 | <view class="box data-v-3a5b7e36"> |
2 | <view class="box_top data-v-3a5b7e36"> | 2 | <view class="box_top data-v-3a5b7e36"> |
3 | - <image src="{{this.giftImage}}" class="data-v-3a5b7e36"></image> | 3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36"></image> |
4 | </view> | 4 | </view> |
5 | <view class="box_title data-v-3a5b7e36"> | 5 | <view class="box_title data-v-3a5b7e36"> |
6 | <view class="top_title data-v-3a5b7e36"> | 6 | <view class="top_title data-v-3a5b7e36"> |
7 | - <text class="data-v-3a5b7e36">{{this.giftTitle}}</text> | 7 | + <text class="data-v-3a5b7e36">{{giftTitle}}</text> |
8 | </view> | 8 | </view> |
9 | <view class="top_time data-v-3a5b7e36"> | 9 | <view class="top_time data-v-3a5b7e36"> |
10 | - <text class="data-v-3a5b7e36">{{"兑换截至时间:"+this.giftDate}}</text> | 10 | + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> |
11 | </view> | 11 | </view> |
12 | <view class="top_price data-v-3a5b7e36"> | 12 | <view class="top_price data-v-3a5b7e36"> |
13 | - <block wx:if="{{this.giftPrice>0}}"> | ||
14 | - <text class="data-v-3a5b7e36">{{"¥"+this.giftPrice}}</text> | 13 | + <block wx:if="{{giftPrice>0}}"> |
14 | + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text> | ||
15 | </block> | 15 | </block> |
16 | - <block wx:if="{{this.giftPrice>0&&this.giftIntegral>0}}"> | 16 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
17 | <text class="data-v-3a5b7e36">/</text> | 17 | <text class="data-v-3a5b7e36">/</text> |
18 | </block> | 18 | </block> |
19 | - <block wx:if="{{this.giftIntegral>0}}"> | ||
20 | - <text class="data-v-3a5b7e36">{{this.giftIntegral+"积分"}}</text> | 19 | + <block wx:if="{{giftIntegral>0}}"> |
20 | + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text> | ||
21 | </block> | 21 | </block> |
22 | - <block wx:if="{{this.giftType>0}}"> | ||
23 | - <text class="data-v-3a5b7e36">{{this.actTitle}}</text> | 22 | + <block wx:if="{{giftType>0}}"> |
23 | + <text class="data-v-3a5b7e36">{{actTitle}}</text> | ||
24 | </block> | 24 | </block> |
25 | </view> | 25 | </view> |
26 | <view class="top_foot data-v-3a5b7e36"> | 26 | <view class="top_foot data-v-3a5b7e36"> |
27 | <view class="top_foot_price data-v-3a5b7e36"> | 27 | <view class="top_foot_price data-v-3a5b7e36"> |
28 | - <text class="data-v-3a5b7e36">{{"原价:"+this.giftPosPrice+"元"}}</text> | 28 | + <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text> |
29 | </view> | 29 | </view> |
30 | <view class="top_foot_qty data-v-3a5b7e36"> | 30 | <view class="top_foot_qty data-v-3a5b7e36"> |
31 | - <text class="data-v-3a5b7e36">{{"已售:"+this.giftQty+"件"}}</text> | 31 | + <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> |
32 | </view> | 32 | </view> |
33 | </view> | 33 | </view> |
34 | </view> | 34 | </view> |
@@ -40,19 +40,19 @@ | @@ -40,19 +40,19 @@ | ||
40 | <view class="box_ware_box data-v-3a5b7e36"> | 40 | <view class="box_ware_box data-v-3a5b7e36"> |
41 | <view class="box_ware_img data-v-3a5b7e36"> | 41 | <view class="box_ware_img data-v-3a5b7e36"> |
42 | <block wx:if="{{item.lbType==1}}"> | 42 | <block wx:if="{{item.lbType==1}}"> |
43 | - <image src="{{item.wareImage==''?'../../static/img/kong.png':$GetInfo.imgHttp+item.wareImage}}" class="data-v-3a5b7e36"></image> | 43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36"></image> |
44 | </block> | 44 | </block> |
45 | <block wx:if="{{item.lbType==2}}"> | 45 | <block wx:if="{{item.lbType==2}}"> |
46 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36"></image> | 46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36"></image> |
47 | </block> | 47 | </block> |
48 | <block wx:if="{{item.lbType==3}}"> | 48 | <block wx:if="{{item.lbType==3}}"> |
49 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36"></image> | 49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36"></image> |
50 | </block> | 50 | </block> |
51 | <block wx:if="{{item.lbType==4}}"> | 51 | <block wx:if="{{item.lbType==4}}"> |
52 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36"></image> | 52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36"></image> |
53 | </block> | 53 | </block> |
54 | <block wx:if="{{item.lbType==5}}"> | 54 | <block wx:if="{{item.lbType==5}}"> |
55 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36"></image> | 55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36"></image> |
56 | </block> | 56 | </block> |
57 | </view> | 57 | </view> |
58 | <view class="box_ware_item data-v-3a5b7e36"> | 58 | <view class="box_ware_item data-v-3a5b7e36"> |
@@ -67,13 +67,13 @@ | @@ -67,13 +67,13 @@ | ||
67 | </view> | 67 | </view> |
68 | <view class="box_ware_code data-v-3a5b7e36"> | 68 | <view class="box_ware_code data-v-3a5b7e36"> |
69 | <block wx:if="{{isBuy==0&item.lbType==1}}"> | 69 | <block wx:if="{{isBuy==0&item.lbType==1}}"> |
70 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 70 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> |
71 | </block> | 71 | </block> |
72 | <block wx:if="{{isBuy==0&item.lbType==2}}"> | 72 | <block wx:if="{{isBuy==0&item.lbType==2}}"> |
73 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[0]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 73 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[0]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> |
74 | </block> | 74 | </block> |
75 | <block wx:if="{{isBuy==0&item.lbType==3}}"> | 75 | <block wx:if="{{isBuy==0&item.lbType==3}}"> |
76 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[1]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[1]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> |
77 | </block> | 77 | </block> |
78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> | 78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> |
79 | <text class="data-v-3a5b7e36">已自动到账</text> | 79 | <text class="data-v-3a5b7e36">已自动到账</text> |
@@ -88,39 +88,42 @@ | @@ -88,39 +88,42 @@ | ||
88 | <text class="data-v-3a5b7e36">活动说明</text> | 88 | <text class="data-v-3a5b7e36">活动说明</text> |
89 | </view> | 89 | </view> |
90 | <view class="foot_box_remark data-v-3a5b7e36"> | 90 | <view class="foot_box_remark data-v-3a5b7e36"> |
91 | - <rich-text nodes="{{this.giftRemark}}"></rich-text> | 91 | + <rich-text nodes="{{giftRemark}}"></rich-text> |
92 | </view> | 92 | </view> |
93 | </view> | 93 | </view> |
94 | <view class="foot_empty data-v-3a5b7e36"></view> | 94 | <view class="foot_empty data-v-3a5b7e36"></view> |
95 | - <block wx:if="{{this.isBuy==1}}"> | 95 | + <block wx:if="{{isBuy==1}}"> |
96 | <view class="foot_button data-v-3a5b7e36"> | 96 | <view class="foot_button data-v-3a5b7e36"> |
97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | 97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
98 | <view class="foot_button_left data-v-3a5b7e36"> | 98 | <view class="foot_button_left data-v-3a5b7e36"> |
99 | <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | 99 | <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> |
100 | </view> | 100 | </view> |
101 | </block> | 101 | </block> |
102 | - <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | 102 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
103 | <view class="foot_button_right data-v-3a5b7e36"> | 103 | <view class="foot_button_right data-v-3a5b7e36"> |
104 | <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | 104 | <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> |
105 | </view> | 105 | </view> |
106 | </block> | 106 | </block> |
107 | - <block wx:if="{{giftPrice>0&&giftIntegral<=0}}"> | 107 | + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
108 | <view class="foot_button_buy data-v-3a5b7e36"> | 108 | <view class="foot_button_buy data-v-3a5b7e36"> |
109 | <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | 109 | <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> |
110 | </view> | 110 | </view> |
111 | </block> | 111 | </block> |
112 | - <block wx:if="{{giftPrice<=0&&giftIntegral>0}}"> | 112 | + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> |
113 | <view class="foot_button_intalge data-v-3a5b7e36"> | 113 | <view class="foot_button_intalge data-v-3a5b7e36"> |
114 | <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | 114 | <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> |
115 | </view> | 115 | </view> |
116 | </block> | 116 | </block> |
117 | </view> | 117 | </view> |
118 | </block> | 118 | </block> |
119 | - <block wx:if="{{this.isBuy==0}}"> | 119 | + <block wx:if="{{isBuy==0}}"> |
120 | <view class="foot_button data-v-3a5b7e36"> | 120 | <view class="foot_button data-v-3a5b7e36"> |
121 | <view class="foot_button_buy data-v-3a5b7e36"> | 121 | <view class="foot_button_buy data-v-3a5b7e36"> |
122 | <text data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即使用</text> | 122 | <text data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即使用</text> |
123 | </view> | 123 | </view> |
124 | </view> | 124 | </view> |
125 | </block> | 125 | </block> |
126 | -</view> | ||
127 | \ No newline at end of file | 126 | \ No newline at end of file |
127 | +</view> | ||
128 | +<!-- 引入提示组件 --> | ||
129 | +<warn id="warn"></warn> | ||
130 | +<my_confirm id="my_confirm"></my_confirm> | ||
128 | \ No newline at end of file | 131 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.js
1 | -var t = require("../../../utils/common.js"); var os = getApp().globalData.setting; | 1 | +var e = getApp(), |
2 | + a = e.globalData.setting, | ||
3 | + os = a, | ||
4 | + t = e.request, | ||
5 | + d = e.globalData; | ||
2 | Page({ | 6 | Page({ |
3 | - data: function data() { | ||
4 | - return { | ||
5 | - getDate: new Date().getTime(), | ||
6 | - getStorageID: '', | ||
7 | - getUserID: '', | ||
8 | - wareCard: [], | ||
9 | - pages: 0, | ||
10 | - pageSize: 10, | ||
11 | - isEmpty: true, | ||
12 | - loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | ||
13 | - contentText: { | ||
14 | - contentdown: '加载更多', | ||
15 | - contentrefresh: '加载中...', | ||
16 | - contentnomore: '已加载全部' | ||
17 | - } | ||
18 | - }; | 7 | + data: { |
8 | + iurl: a.imghost, //图片前缀网址 | ||
9 | + getDate: new Date().getTime(), | ||
10 | + getStorageID: '', | ||
11 | + getUserID: '', | ||
12 | + wareCard: [], | ||
13 | + pages: 0, | ||
14 | + pageSize: 10, | ||
15 | + isEmpty: true, | ||
16 | + loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | ||
17 | + contentText: { | ||
18 | + contentdown: '加载更多', | ||
19 | + contentrefresh: '加载中...', | ||
20 | + contentnomore: '已加载全部' | ||
21 | + } | ||
19 | }, | 22 | }, |
20 | 23 | ||
21 | - onLoad: function onLoad(options) { | ||
22 | - this.getStorageID = options.stoid; | ||
23 | - this.getUserID = options.userid; | 24 | + onLoad: function(options) { |
25 | + // this.getStorageID = options.stoid; | ||
26 | + // this.getUserID = options.userid; | ||
27 | + var th = this; | ||
28 | + th.setData({ | ||
29 | + getStorageID: a.stoid, | ||
30 | + getUserID: 5682130 | ||
31 | + }) | ||
24 | }, | 32 | }, |
25 | - onShow: function onShow() { | ||
26 | - this.pages = 1; | ||
27 | - this.pageSize = 10; | ||
28 | - this.loadingType = 0; | ||
29 | - this.getList(); | 33 | + onShow: function() { |
34 | + // this.pages = 1; | ||
35 | + // this.pageSize = 10; | ||
36 | + // this.loadingType = 0; | ||
37 | + // this.getList(); | ||
38 | + var th = this; | ||
39 | + th.setData({ | ||
40 | + pages: 1, | ||
41 | + pageSize: 10, | ||
42 | + loadingType: 0 | ||
43 | + }) | ||
44 | + th.getList(); | ||
30 | }, | 45 | }, |
31 | - methods: { | ||
32 | - BuyGift: function BuyGift() { | ||
33 | - /*销毁跳转*/ | ||
34 | - uni.reLaunch({ | ||
35 | - url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID | ||
36 | - }); | 46 | + // methods: { |
47 | + // BuyGift: function BuyGift() { | ||
48 | + // /*销毁跳转*/ | ||
49 | + // uni.reLaunch({ | ||
50 | + // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID | ||
51 | + // }); | ||
37 | 52 | ||
38 | - }, | ||
39 | - GetGiftPackList: function GetGiftPackList(getId, ojb) { | ||
40 | - //不销毁调整 | ||
41 | - uni.navigateTo({ | ||
42 | - url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' + | ||
43 | - getId | ||
44 | - }); | 53 | + // }, |
54 | + // GetGiftPackList: function(getId, ojb) { | ||
55 | + // //不销毁调整 | ||
56 | + // uni.navigateTo({ | ||
57 | + // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' + | ||
58 | + // getId | ||
59 | + // }); | ||
45 | 60 | ||
46 | - }, | ||
47 | - getList: function getList() { | ||
48 | - var _this = this; //上拉加载 | ||
49 | - var that = this; | ||
50 | - if (that.loadingType != 0) { | ||
51 | - return false; | ||
52 | - } | ||
53 | - that.loadingType = 1; | ||
54 | - getApp().request.get('/api/weshop/marketing/my/giftbag/page',{ | ||
55 | - data: { | ||
56 | - "storeId": this.getStorageID, //商家ID | ||
57 | - "userId": this.getUserID, //用户ID | ||
58 | - "page": this.pages, | ||
59 | - "pageSize": this.pageSize | ||
60 | - }, | ||
61 | - success: function success(res) { | ||
62 | - if (res.data.code == 0) { | ||
63 | - console.log(res.data.data); | ||
64 | - if (res.data.data.total > 0) { | ||
65 | - _this.isEmpty = false; | ||
66 | - } else { | ||
67 | - _this.isEmpty = true; | ||
68 | - } | ||
69 | - if (res.data.data.pageData.length == 0) { | ||
70 | - _this.loadingType = 2; | ||
71 | - } else { | ||
72 | - console.log(_this.wareCard.length); | ||
73 | - console.log(res.data.data.pageData.length); | ||
74 | - if (_this.wareCard.length < res.data.data.pageData.length) { | ||
75 | - for (var i = 0; i < res.data.data.pageData.length; i++) { | ||
76 | - _this.wareCard.push(res.data.data.pageData[i]); | ||
77 | - } | 61 | + // }, |
62 | + getList: function() { | ||
63 | + var _this = this; //上拉加载 | ||
64 | + var that = this.data; | ||
65 | + if (that.loadingType != 0) { | ||
66 | + return false; | ||
67 | + } | ||
68 | + // that.loadingType = 1; | ||
69 | + _this.setData({ | ||
70 | + loadingType: 1 | ||
71 | + }) | ||
72 | + getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | ||
73 | + data: { | ||
74 | + // "storeId": this.getStorageID, //商家ID | ||
75 | + // "userId": this.getUserID, //用户ID | ||
76 | + // "page": this.pages, | ||
77 | + // "pageSize": this.pageSize | ||
78 | + "storeId": that.getStorageID, //商家ID | ||
79 | + "userId": that.getUserID, //用户ID | ||
80 | + "page": that.pages, | ||
81 | + "pageSize": that.pageSize | ||
82 | + }, | ||
83 | + success: function success(res) { | ||
84 | + if (res.data.code == 0) { | ||
85 | + console.log(res.data.data); | ||
86 | + if (res.data.data.total > 0) { | ||
87 | + // _this.isEmpty = false; | ||
88 | + _this.setData({ | ||
89 | + isEmpty: false | ||
90 | + }) | ||
91 | + } else { | ||
92 | + // _this.isEmpty = true; | ||
93 | + _this.setData({ | ||
94 | + isEmpty: true | ||
95 | + }) | ||
96 | + } | ||
97 | + if (res.data.data.pageData.length == 0) { | ||
98 | + // _this.loadingType = 2; | ||
99 | + _this.setData({ | ||
100 | + loadingType: 2 | ||
101 | + }) | ||
102 | + } else { | ||
103 | + // console.log(_this.wareCard.length); | ||
104 | + // console.log(res.data.data.pageData.length); | ||
105 | + var wareCard = that.wareCard; | ||
106 | + // if (_this.wareCard.length < res.data.data.pageData.length) { | ||
107 | + if (wareCard.length < res.data.data.total) { | ||
108 | + for (var i = 0; i < res.data.data.pageData.length; i++) { | ||
109 | + wareCard.push(res.data.data.pageData[i]); | ||
78 | } | 110 | } |
79 | - | ||
80 | - _this.loadingType = 0; | ||
81 | - console.log(_this.wareCard); | ||
82 | } | 111 | } |
83 | - } else { | ||
84 | - console.log(res.data.msg); | 112 | + _this.setData({ |
113 | + wareCard: wareCard | ||
114 | + }) | ||
115 | + | ||
116 | + // _this.loadingType = 0; | ||
117 | + _this.setData({ | ||
118 | + loadingType: 0 | ||
119 | + }) | ||
120 | + console.log(_this.wareCard); | ||
85 | } | 121 | } |
122 | + } else { | ||
123 | + console.log(res.data.msg); | ||
86 | } | 124 | } |
87 | - }); | 125 | + } |
126 | + }); | ||
88 | 127 | ||
89 | - }, | ||
90 | - TimeToDate: function TimeToDate(num) {//时间戳数据处理 是按秒来转换 | ||
91 | - var date = new Date(num * 1000); | ||
92 | - //时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
93 | - var y = date.getFullYear(); | ||
94 | - var MM = date.getMonth() + 1; | ||
95 | - MM = MM < 10 ? '0' + MM : MM; //月补0 | ||
96 | - var d = date.getDate(); | ||
97 | - d = d < 10 ? '0' + d : d; //天补0 | ||
98 | - var h = date.getHours(); | ||
99 | - h = h < 10 ? '0' + h : h; //小时补0 | ||
100 | - var m = date.getMinutes(); | ||
101 | - m = m < 10 ? '0' + m : m; //分钟补0 | ||
102 | - var s = date.getSeconds(); | ||
103 | - s = s < 10 ? '0' + s : s; //秒补0 | ||
104 | - return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; | ||
105 | - }, | ||
106 | - DateToTime: function DateToTime(TimeNum) {//时间转换成时间戳 | ||
107 | - var Time = new Date(TimeNum); | ||
108 | - return Time.getTime() / 1000; | ||
109 | - } | 128 | + }, |
129 | + TimeToDate: function(num) { //时间戳数据处理 是按秒来转换 | ||
130 | + var date = new Date(num * 1000); | ||
131 | + //时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
132 | + var y = date.getFullYear(); | ||
133 | + var MM = date.getMonth() + 1; | ||
134 | + MM = MM < 10 ? '0' + MM : MM; //月补0 | ||
135 | + var d = date.getDate(); | ||
136 | + d = d < 10 ? '0' + d : d; //天补0 | ||
137 | + var h = date.getHours(); | ||
138 | + h = h < 10 ? '0' + h : h; //小时补0 | ||
139 | + var m = date.getMinutes(); | ||
140 | + m = m < 10 ? '0' + m : m; //分钟补0 | ||
141 | + var s = date.getSeconds(); | ||
142 | + s = s < 10 ? '0' + s : s; //秒补0 | ||
143 | + return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; | ||
144 | + }, | ||
145 | + DateToTime: function DateToTime(TimeNum) { //时间转换成时间戳 | ||
146 | + var Time = new Date(TimeNum); | ||
147 | + return Time.getTime() / 1000; | ||
148 | + }, | ||
149 | + goto: function(e) { | ||
150 | + var th = this; | ||
151 | + var url = e.currentTarget.dataset.url; | ||
152 | + getApp().goto(url); | ||
110 | } | 153 | } |
111 | -}); | 154 | + |
155 | +}); | ||
112 | \ No newline at end of file | 156 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "我的礼包", | 2 | "navigationBarTitleText": "我的礼包", |
3 | - "enablePullDownRefresh": false | 3 | + "enablePullDownRefresh": false, |
4 | + "usingComponents": { | ||
5 | + "warn": "/components/long_warn/long_warn", | ||
6 | + "my_confirm": "/components/my_confirm/my_confirm" | ||
7 | + } | ||
4 | } | 8 | } |
5 | \ No newline at end of file | 9 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.wxml
1 | <view class="top_img"> | 1 | <view class="top_img"> |
2 | - <view class="top_img"> | ||
3 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | 2 | + <view class="top_img"> |
3 | + <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> | ||
4 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | ||
5 | + </view> | ||
6 | + <view class="top_title"> | ||
7 | + <view class="top_title_box"> | ||
8 | + <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/buygiftpack/giftpackbuy">礼包列表</text> | ||
4 | </view> | 9 | </view> |
5 | - <view class="top_title"> | ||
6 | - <view class="top_title_box"> | ||
7 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="__e">礼包列表</text> | ||
8 | - </view> | ||
9 | - <view class="top_title_box_S"></view> | ||
10 | - <view class="top_title_box"> | ||
11 | - <text class="top_title_redtext">我的礼包</text> | ||
12 | - </view> | 10 | + <view class="top_title_box_S"></view> |
11 | + <view class="top_title_box"> | ||
12 | + <text class="top_title_redtext">我的礼包</text> | ||
13 | </view> | 13 | </view> |
14 | - <block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | ||
15 | - <view class="content_box"> | ||
16 | - <view class="content_box_ware"> | ||
17 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img" bindtap="__e"> | ||
18 | - <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> | ||
19 | - <block wx:if="{{item.$orig.actType!=0}}"> | ||
20 | - <view class="{{[item.$orig.actType==1?'content_box_img_title content_box_img_ground1':item.$orig.actType==2?'content_box_img_title content_box_img_ground2':item.$orig.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> | ||
21 | - <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift01.png'}}"></image> | ||
22 | - <block wx:if="{{item.$orig.actType==1}}"> | ||
23 | - <text>新人有礼</text> | ||
24 | - </block> | ||
25 | - <block wx:if="{{item.$orig.actType==2}}"> | ||
26 | - <text>评价有礼</text> | ||
27 | - </block> | ||
28 | - <block wx:if="{{item.$orig.actType==3}}"> | ||
29 | - <text>节日营销</text> | ||
30 | - </block> | ||
31 | - <block wx:if="{{item.$orig.actType==4}}"> | ||
32 | - <text>生日营销</text> | ||
33 | - </block> | ||
34 | - <block wx:if="{{item.$orig.actType==5}}"> | ||
35 | - <text>助力礼包</text> | ||
36 | - </block> | ||
37 | - </view> | ||
38 | - </block> | ||
39 | - </view> | ||
40 | - <view class="content_box_title"> | ||
41 | - <view class="content_ware_title"> | ||
42 | - <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{item.$orig.giftTitle}}</text> | ||
43 | - </view> | ||
44 | - <view class="content_ware_type"> | ||
45 | - <block wx:if="{{item.$orig.actType==0&item.$orig.payMoney>0}}"> | ||
46 | - <text>{{"¥"+item.$orig.payMoney}}</text> | ||
47 | - </block> | ||
48 | - <block wx:if="{{item.$orig.actType==0&item.$orig.payIntegral>0}}"> | ||
49 | - <text>{{item.$orig.payIntegral+"积分"}}</text> | ||
50 | - </block> | ||
51 | - <block wx:if="{{item.$orig.actType==1}}"> | ||
52 | - <text>{{item.$orig.actTitle}}</text> | ||
53 | - </block> | ||
54 | - <block wx:if="{{item.$orig.actType==2}}"> | ||
55 | - <text>{{item.$orig.actTitle}}</text> | ||
56 | - </block> | ||
57 | - <block wx:if="{{item.$orig.actType==3}}"> | ||
58 | - <text>{{item.$orig.actTitle}}</text> | ||
59 | - </block> | ||
60 | - <block wx:if="{{item.$orig.actType==4}}"> | ||
61 | - <text>{{item.$orig.actTitle}}</text> | ||
62 | - </block> | ||
63 | - <block wx:if="{{item.$orig.actType==5}}"> | ||
64 | - <text>{{item.$orig.actTitle}}</text> | ||
65 | - </block> | ||
66 | - </view> | ||
67 | - <view class="content_ware_price"> | ||
68 | - <text>{{"原价:¥"+item.$orig.giftPosPrice}}</text> | ||
69 | - </view> | ||
70 | - <view class="content_ware_time"> | ||
71 | - <block wx:if="{{getDate>item.m0}}"> | ||
72 | - <text>{{"兑换截至日期:"+item.$orig.endTime}}</text> | ||
73 | - </block> | ||
74 | - <block wx:if="{{getDate<item.m1}}"> | ||
75 | - <text>{{"距兑换开始时间: "+item.$orig.starTime}}</text> | ||
76 | - </block> | ||
77 | - </view> | ||
78 | - </view> | ||
79 | - </view> | ||
80 | - <view class="content_box_button"> | ||
81 | - <button data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即使用</button> | ||
82 | - </view> | ||
83 | - </view> | ||
84 | - </block> | ||
85 | - <block wx:if="{{this.isEmpty==true}}"> | ||
86 | - <view class="foot_empty"> | ||
87 | - <view> | ||
88 | - <image src="../../static/img/gift07.png"></image> | ||
89 | - </view> | ||
90 | - <view> | ||
91 | - <text>当前暂无礼包</text> | ||
92 | - </view> | ||
93 | - <view class="foot_empty_button"> | ||
94 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | ||
95 | - </view> | 14 | + </view> |
15 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | ||
16 | + <view class="content_box"> | ||
17 | + <view class="content_box_ware"> | ||
18 | + <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img" bindtap="__e"> | ||
19 | + <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> | ||
20 | + <image src="{{iurl+item.lbUrl}}"></image> | ||
21 | + <block wx:if="{{item.actType!=0}}"> | ||
22 | + <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> | ||
23 | + <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift01.png'}}"></image> --> | ||
24 | + <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}"></image> | ||
25 | + <!-- <block wx:if="{{item.$orig.actType==1}}"> --> | ||
26 | + <block wx:if="{{item.actType==1}}"> | ||
27 | + <text>新人有礼</text> | ||
28 | + </block> | ||
29 | + <block wx:if="{{item.actType==2}}"> | ||
30 | + <text>评价有礼</text> | ||
31 | + </block> | ||
32 | + <block wx:if="{{item.actType==3}}"> | ||
33 | + <text>节日营销</text> | ||
34 | + </block> | ||
35 | + <block wx:if="{{item.actType==4}}"> | ||
36 | + <text>生日营销</text> | ||
37 | + </block> | ||
38 | + <block wx:if="{{item.actType==5}}"> | ||
39 | + <text>助力礼包</text> | ||
40 | + </block> | ||
96 | </view> | 41 | </view> |
97 | - </block> | ||
98 | - <view class="foot_box"> | ||
99 | - <text>———— 到底了 ————</text> | 42 | + </block> |
100 | </view> | 43 | </view> |
101 | - </view> | ||
102 | \ No newline at end of file | 44 | \ No newline at end of file |
45 | + <view class="content_box_title"> | ||
46 | + <view class="content_ware_title"> | ||
47 | + <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{item.giftTitle}}</text> | ||
48 | + </view> | ||
49 | + <view class="content_ware_type"> | ||
50 | + <block wx:if="{{item.actType==0&item.payMoney>0}}"> | ||
51 | + <text>{{"¥"+item.payMoney}}</text> | ||
52 | + </block> | ||
53 | + <block wx:if="{{item.actType==0&item.payIntegral>0}}"> | ||
54 | + <text>{{item.payIntegral+"积分"}}</text> | ||
55 | + </block> | ||
56 | + <block wx:if="{{item.actType==1}}"> | ||
57 | + <text>{{item.actTitle}}</text> | ||
58 | + </block> | ||
59 | + <block wx:if="{{item.actType==2}}"> | ||
60 | + <text>{{item.actTitle}}</text> | ||
61 | + </block> | ||
62 | + <block wx:if="{{item.actType==3}}"> | ||
63 | + <text>{{item.actTitle}}</text> | ||
64 | + </block> | ||
65 | + <block wx:if="{{item.actType==4}}"> | ||
66 | + <text>{{item.actTitle}}</text> | ||
67 | + </block> | ||
68 | + <block wx:if="{{item.actType==5}}"> | ||
69 | + <text>{{item.actTitle}}</text> | ||
70 | + </block> | ||
71 | + </view> | ||
72 | + <view class="content_ware_price"> | ||
73 | + <text>{{"原价:¥"+item.giftPosPrice}}</text> | ||
74 | + </view> | ||
75 | + <view class="content_ware_time"> | ||
76 | + <!-- <block wx:if="{{getDate>item.endTime}}"> --> | ||
77 | + <!-- <text>{{"兑换截至日期:"+item.endTime}}</text> --> | ||
78 | + <text>{{"兑换截至日期:"+getDate}}</text> | ||
79 | + <!-- </block> --> | ||
80 | + <block wx:if="{{getDate<item.starTime}}"> | ||
81 | + <text>{{"距兑换开始时间: "+item.starTime}}</text> | ||
82 | + </block> | ||
83 | + </view> | ||
84 | + </view> | ||
85 | + </view> | ||
86 | + <view class="content_box_button"> | ||
87 | + <button data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即使用</button> | ||
88 | + </view> | ||
89 | + </view> | ||
90 | + </block> | ||
91 | + <block wx:if="{{this.isEmpty==true}}"> | ||
92 | + <view class="foot_empty"> | ||
93 | + <view> | ||
94 | + <image src="../../static/img/gift07.png"></image> | ||
95 | + </view> | ||
96 | + <view> | ||
97 | + <text>当前暂无礼包</text> | ||
98 | + </view> | ||
99 | + <view class="foot_empty_button"> | ||
100 | + <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | ||
101 | + </view> | ||
102 | + </view> | ||
103 | + </block> | ||
104 | + <view class="foot_box"> | ||
105 | + <text>———— 到底了 ————</text> | ||
106 | + </view> | ||
107 | +</view> | ||
108 | +<!-- 引入提示组件 --> | ||
109 | +<warn id="warn"></warn> | ||
110 | +<my_confirm id="my_confirm"></my_confirm> | ||
103 | \ No newline at end of file | 111 | \ No newline at end of file |