Commit 74103bf999f5b47cf4c004f8dce85deb1dcef0f6
1 parent
ed6e9338
我的礼包,礼包列表,礼包详情
Showing
12 changed files
with
1426 additions
and
0 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
0 → 100644
1 | +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 | + | ||
19 | + }, | ||
20 | + onLoad: function onLoad(options) { | ||
21 | + this.getStorageID = options.stoid; | ||
22 | + this.getUserID = options.userid; | ||
23 | + }, | ||
24 | + onShow: function onShow() { | ||
25 | + this.page = 1; | ||
26 | + this.pageSize = 10; | ||
27 | + this.loadingType = 0; | ||
28 | + this.getList(); | ||
29 | + }, | ||
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 | + | ||
73 | + } | ||
74 | + } | ||
75 | + }); | ||
76 | + | ||
77 | + } else if (res.cancel) { | ||
78 | + console.log('用户点击取消'); | ||
79 | + } | ||
80 | + } | ||
81 | + }); | ||
82 | + | ||
83 | + | ||
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 | + | ||
110 | + } else { | ||
111 | + console.log(res.data.msg); | ||
112 | + uni.showToast({ | ||
113 | + icon: 'none', | ||
114 | + title: res.data.msg | ||
115 | + }); | ||
116 | + | ||
117 | + } | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + } else if (res.cancel) { | ||
122 | + console.log('用户点击取消'); | ||
123 | + } | ||
124 | + } | ||
125 | + }); | ||
126 | + | ||
127 | + | ||
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 | + | ||
161 | + _this.loadingType = 0; | ||
162 | + console.log(_this.wareCard); | ||
163 | + } | ||
164 | + } | ||
165 | + } | ||
166 | + }); | ||
167 | + | ||
168 | + } | ||
169 | + } | ||
170 | +}); | ||
0 | \ No newline at end of file | 171 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.json
0 → 100644
pages/giftpack/buygiftpack/giftpackbuy.wxml
0 → 100644
1 | +<view class="top_img"> | ||
2 | + <view class="top_img"> | ||
3 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | ||
4 | + </view> | ||
5 | + <view class="top_title"> | ||
6 | + <view class="top_title_box"> | ||
7 | + <text class="top_title_redtext">礼包列表</text> | ||
8 | + </view> | ||
9 | + <view class="top_title_box_S"></view> | ||
10 | + <view class="top_title_box"> | ||
11 | + <text data-event-opts="{{[['tap',[['MyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="__e">我的礼包</text> | ||
12 | + </view> | ||
13 | + </view> | ||
14 | + <block wx:for="{{wareCard}}" wx:for-item="items" 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+items.lbUrl}}"></image> | ||
19 | + </view> | ||
20 | + <view class="content_box_title"> | ||
21 | + <view class="content_ware_title"> | ||
22 | + <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{items.giftTitle}}</text> | ||
23 | + </view> | ||
24 | + <view class="content_ware_type"> | ||
25 | + <block wx:if="{{items.payMoney>0}}"> | ||
26 | + <text>{{"¥"+items.payMoney}}</text> | ||
27 | + </block> | ||
28 | + <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}"> | ||
29 | + <text>/</text> | ||
30 | + </block> | ||
31 | + <block wx:if="{{items.payIntegral>0}}"> | ||
32 | + <text>{{items.payIntegral+"积分"}}</text> | ||
33 | + </block> | ||
34 | + </view> | ||
35 | + <view class="content_ware_price"> | ||
36 | + <text>{{"原价:¥"+items.giftPosPrice}}</text> | ||
37 | + </view> | ||
38 | + <view class="content_ware_time"> | ||
39 | + <text>{{"活动时间:"+items.endTime}}</text> | ||
40 | + </view> | ||
41 | + </view> | ||
42 | + </view> | ||
43 | + <view class="content_box_button"> | ||
44 | + <view class="box_button_remark"> | ||
45 | + <text>{{"已售:"+items.giftQty+"件"}}</text> | ||
46 | + </view> | ||
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> | ||
50 | + </view> | ||
51 | + </block> | ||
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> | ||
55 | + </view> | ||
56 | + </block> | ||
57 | + </view> | ||
58 | + </view> | ||
59 | + </block> | ||
60 | + <block wx:if="{{this.isEmpty==true}}"> | ||
61 | + <view class="foot_empty"> | ||
62 | + <view> | ||
63 | + <image src="../../static/img/gift07.png"></image> | ||
64 | + </view> | ||
65 | + <view> | ||
66 | + <text>当前暂无礼包</text> | ||
67 | + </view> | ||
68 | + <view class="foot_empty_button"> | ||
69 | + <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | ||
70 | + </view> | ||
71 | + </view> | ||
72 | + </block> | ||
73 | + <view class="foot_box"> | ||
74 | + <text>———— 到底了 ————</text> | ||
75 | + </view> | ||
76 | +</view> | ||
0 | \ No newline at end of file | 77 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.wxss
0 → 100644
1 | + | ||
2 | +/*引用样式路径*/ | ||
3 | +@charset "UTF-8"; | ||
4 | +/* Author XGQ | ||
5 | + * 2019-11-12 | ||
6 | + */ | ||
7 | +page { | ||
8 | + background-color: #fb7454; | ||
9 | +} | ||
10 | +.top_img { | ||
11 | + -webkit-align-content: center; | ||
12 | + align-content: center; | ||
13 | +} | ||
14 | +.top_img image { | ||
15 | + width: 100%; | ||
16 | + height: 660rpx; | ||
17 | +} | ||
18 | +.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; | ||
28 | +} | ||
29 | +.top_title_box { | ||
30 | + width: 49%; | ||
31 | + -webkit-align-content: center; | ||
32 | + align-content: center; | ||
33 | + text-align: center; | ||
34 | + padding: 15rpx; | ||
35 | +} | ||
36 | +.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 | +} | ||
44 | +.top_title_redtext { | ||
45 | + font-size: 30rpx; | ||
46 | + color: #d61b30; | ||
47 | +} | ||
48 | +.top_title_blacktext { | ||
49 | + font-size: 30rpx; | ||
50 | + color: #000000; | ||
51 | +} | ||
52 | +.content_box { | ||
53 | + background-color: #FFFFFF; | ||
54 | + height: 375rpx; | ||
55 | + margin: 10rpx 20rpx 0rpx 20rpx; | ||
56 | + border-radius: 10rpx; | ||
57 | +} | ||
58 | +.content_box_ware { | ||
59 | + border-bottom: #f5f5f5 solid 2rpx; | ||
60 | + display: -webkit-box; | ||
61 | + display: -webkit-flex; | ||
62 | + display: flex; | ||
63 | +} | ||
64 | +.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; | ||
72 | +} | ||
73 | +.content_box_img image { | ||
74 | + width: 100%; | ||
75 | + height: 230rpx; | ||
76 | +} | ||
77 | +.content_box_title { | ||
78 | + width: 65%; | ||
79 | + margin: 25rpx 25rpx 10rpx 0rpx; | ||
80 | + position: relative; | ||
81 | +} | ||
82 | +.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 | + /** 隐藏超出的内容 **/ | ||
95 | +} | ||
96 | +.content_ware_type { | ||
97 | + font-size: 28rpx; | ||
98 | + color: #c61a34; | ||
99 | + margin-top: 10rpx; | ||
100 | + position: absolute; | ||
101 | + left: 0; | ||
102 | + bottom: 100rpx; | ||
103 | +} | ||
104 | +.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; | ||
112 | +} | ||
113 | +.content_ware_time { | ||
114 | + font-size: 25rpx; | ||
115 | + color: #000000; | ||
116 | + margin-top: 20rpx; | ||
117 | + position: absolute; | ||
118 | + left: 0; | ||
119 | + bottom: 25rpx; | ||
120 | +} | ||
121 | +.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; | ||
140 | +} | ||
141 | +.box_button_buy{ | ||
142 | + text-align: right; | ||
143 | + margin: 22rpx 25rpx 0rpx 0rpx; | ||
144 | +} | ||
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; | ||
153 | +} | ||
154 | +.box_button_dui{ | ||
155 | + text-align: right; | ||
156 | + margin: 22rpx 25rpx 0rpx 0rpx; | ||
157 | +} | ||
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; | ||
166 | +} | ||
167 | +.foot_box { | ||
168 | + -webkit-align-content: center; | ||
169 | + align-content: center; | ||
170 | + text-align: center; | ||
171 | + margin-top: 15rpx; | ||
172 | + margin-bottom: 50rpx; | ||
173 | +} | ||
174 | +.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; | ||
207 | +} |
pages/giftpack/giftpacklist/giftpacklist.js
0 → 100644
1 | +var t = require("../../utils/common.js"); var os = getApp().globalData.setting; | ||
2 | +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 | + | ||
21 | + }, | ||
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); | ||
29 | + }, | ||
30 | + onShow: function onShow() { | ||
31 | + if (this.isBuy == 0) { | ||
32 | + this.GetMyGiftList(); | ||
33 | + } else { | ||
34 | + this.GetBuyGiftList(); | ||
35 | + } | ||
36 | + | ||
37 | + this.giftRemark = this.giftRemark.replace(/<p><img/gi, "<p class='img'><img"); | ||
38 | + }, | ||
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 | + } | ||
73 | + } | ||
74 | + }); | ||
75 | + | ||
76 | + | ||
77 | + } else if (res.cancel) { | ||
78 | + console.log('用户点击取消'); | ||
79 | + } | ||
80 | + } | ||
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 | + }); | ||
120 | + | ||
121 | + | ||
122 | + } else if (res.cancel) { | ||
123 | + console.log('用户点击取消'); | ||
124 | + } | ||
125 | + } | ||
126 | + }); | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | ||
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; | ||
144 | + if (res.data.data.giftRemark == '') { | ||
145 | + _this.giftRemark = '暂无详情......'; | ||
146 | + } else { | ||
147 | + _this.giftRemark = res.data.data.giftRemark; | ||
148 | + } | ||
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); | ||
158 | + } | ||
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; | ||
174 | + if (res.data.data.giftRemark == '') { | ||
175 | + _this2.giftRemark = '暂无详情......'; | ||
176 | + } else { | ||
177 | + _this2.giftRemark = res.data.data.giftRemark; | ||
178 | + } | ||
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); | ||
188 | + } | ||
189 | + }); | ||
190 | + | ||
191 | + }, | ||
192 | + GetQrCode: function GetQrCode() { | ||
193 | + //不销毁调整 | ||
194 | + uni.navigateTo({ | ||
195 | + url: '/pages/mygiftpack/QrCode?number=' + this.getGiftID | ||
196 | + }); | ||
197 | + | ||
198 | + }, | ||
199 | + GetWebHttp: function GetWebHttp(type) { | ||
200 | + | ||
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; | ||
208 | + } | ||
209 | + } | ||
210 | +}); | ||
0 | \ No newline at end of file | 211 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.json
0 → 100644
pages/giftpack/giftpacklist/giftpacklist.wxml
0 → 100644
1 | +<view class="box data-v-3a5b7e36"> | ||
2 | + <view class="box_top data-v-3a5b7e36"> | ||
3 | + <image src="{{this.giftImage}}" class="data-v-3a5b7e36"></image> | ||
4 | + </view> | ||
5 | + <view class="box_title data-v-3a5b7e36"> | ||
6 | + <view class="top_title data-v-3a5b7e36"> | ||
7 | + <text class="data-v-3a5b7e36">{{this.giftTitle}}</text> | ||
8 | + </view> | ||
9 | + <view class="top_time data-v-3a5b7e36"> | ||
10 | + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+this.giftDate}}</text> | ||
11 | + </view> | ||
12 | + <view class="top_price data-v-3a5b7e36"> | ||
13 | + <block wx:if="{{this.giftPrice>0}}"> | ||
14 | + <text class="data-v-3a5b7e36">{{"¥"+this.giftPrice}}</text> | ||
15 | + </block> | ||
16 | + <block wx:if="{{this.giftPrice>0&&this.giftIntegral>0}}"> | ||
17 | + <text class="data-v-3a5b7e36">/</text> | ||
18 | + </block> | ||
19 | + <block wx:if="{{this.giftIntegral>0}}"> | ||
20 | + <text class="data-v-3a5b7e36">{{this.giftIntegral+"积分"}}</text> | ||
21 | + </block> | ||
22 | + <block wx:if="{{this.giftType>0}}"> | ||
23 | + <text class="data-v-3a5b7e36">{{this.actTitle}}</text> | ||
24 | + </block> | ||
25 | + </view> | ||
26 | + <view class="top_foot data-v-3a5b7e36"> | ||
27 | + <view class="top_foot_price data-v-3a5b7e36"> | ||
28 | + <text class="data-v-3a5b7e36">{{"原价:"+this.giftPosPrice+"元"}}</text> | ||
29 | + </view> | ||
30 | + <view class="top_foot_qty data-v-3a5b7e36"> | ||
31 | + <text class="data-v-3a5b7e36">{{"已售:"+this.giftQty+"件"}}</text> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | + </view> | ||
35 | + <view class="box_ware data-v-3a5b7e36"> | ||
36 | + <view class="box_ware_title data-v-3a5b7e36"> | ||
37 | + <text class="data-v-3a5b7e36">礼包内容</text> | ||
38 | + </view> | ||
39 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | ||
40 | + <view class="box_ware_box data-v-3a5b7e36"> | ||
41 | + <view class="box_ware_img data-v-3a5b7e36"> | ||
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> | ||
44 | + </block> | ||
45 | + <block wx:if="{{item.lbType==2}}"> | ||
46 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36"></image> | ||
47 | + </block> | ||
48 | + <block wx:if="{{item.lbType==3}}"> | ||
49 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36"></image> | ||
50 | + </block> | ||
51 | + <block wx:if="{{item.lbType==4}}"> | ||
52 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36"></image> | ||
53 | + </block> | ||
54 | + <block wx:if="{{item.lbType==5}}"> | ||
55 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36"></image> | ||
56 | + </block> | ||
57 | + </view> | ||
58 | + <view class="box_ware_item data-v-3a5b7e36"> | ||
59 | + <view class="box_ware_item_title data-v-3a5b7e36"> | ||
60 | + <text class="data-v-3a5b7e36">{{item.couponName}}</text> | ||
61 | + </view> | ||
62 | + <view class="box_ware_item_price data-v-3a5b7e36"> | ||
63 | + <text class="data-v-3a5b7e36"></text> | ||
64 | + </view> | ||
65 | + <view class="box_ware_item_qty data-v-3a5b7e36"> | ||
66 | + <text class="data-v-3a5b7e36">{{"数量:"+item.num}}</text> | ||
67 | + </view> | ||
68 | + <view class="box_ware_code data-v-3a5b7e36"> | ||
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> | ||
71 | + </block> | ||
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> | ||
74 | + </block> | ||
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> | ||
77 | + </block> | ||
78 | + <block wx:if="{{isBuy==0&item.lbType>3}}"> | ||
79 | + <text class="data-v-3a5b7e36">已自动到账</text> | ||
80 | + </block> | ||
81 | + </view> | ||
82 | + </view> | ||
83 | + </view> | ||
84 | + </block> | ||
85 | + </view> | ||
86 | + <view class="foot_box data-v-3a5b7e36"> | ||
87 | + <view class="foot_box_title data-v-3a5b7e36"> | ||
88 | + <text class="data-v-3a5b7e36">活动说明</text> | ||
89 | + </view> | ||
90 | + <view class="foot_box_remark data-v-3a5b7e36"> | ||
91 | + <rich-text nodes="{{this.giftRemark}}"></rich-text> | ||
92 | + </view> | ||
93 | + </view> | ||
94 | + <view class="foot_empty data-v-3a5b7e36"></view> | ||
95 | + <block wx:if="{{this.isBuy==1}}"> | ||
96 | + <view class="foot_button data-v-3a5b7e36"> | ||
97 | + <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | ||
98 | + <view class="foot_button_left data-v-3a5b7e36"> | ||
99 | + <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | ||
100 | + </view> | ||
101 | + </block> | ||
102 | + <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | ||
103 | + <view class="foot_button_right data-v-3a5b7e36"> | ||
104 | + <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | ||
105 | + </view> | ||
106 | + </block> | ||
107 | + <block wx:if="{{giftPrice>0&&giftIntegral<=0}}"> | ||
108 | + <view class="foot_button_buy data-v-3a5b7e36"> | ||
109 | + <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | ||
110 | + </view> | ||
111 | + </block> | ||
112 | + <block wx:if="{{giftPrice<=0&&giftIntegral>0}}"> | ||
113 | + <view class="foot_button_intalge data-v-3a5b7e36"> | ||
114 | + <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | ||
115 | + </view> | ||
116 | + </block> | ||
117 | + </view> | ||
118 | + </block> | ||
119 | + <block wx:if="{{this.isBuy==0}}"> | ||
120 | + <view class="foot_button 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> | ||
123 | + </view> | ||
124 | + </view> | ||
125 | + </block> | ||
126 | +</view> | ||
0 | \ No newline at end of file | 127 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.wxss
0 → 100644
1 | + | ||
2 | +@charset "UTF-8"; | ||
3 | +/* Author XGQ | ||
4 | + * 2019-12-12 | ||
5 | + */ | ||
6 | +.box.data-v-3a5b7e36 { | ||
7 | + -webkit-align-content: center; | ||
8 | + align-content: center; | ||
9 | +} | ||
10 | +.box_top.data-v-3a5b7e36 { | ||
11 | + width: 100%; | ||
12 | +} | ||
13 | +.box_top image.data-v-3a5b7e36 { | ||
14 | + width: 100%; | ||
15 | + height: 540rpx; | ||
16 | +} | ||
17 | +.box_title.data-v-3a5b7e36 { | ||
18 | + margin: 10rpx 20rpx 20rpx 20rpx; | ||
19 | + padding: 35rpx; | ||
20 | + background-color: #FFFFFF; | ||
21 | + border-radius: 20rpx; | ||
22 | +} | ||
23 | +.top_title.data-v-3a5b7e36 { | ||
24 | + font-size: 30rpx; | ||
25 | + margin-bottom: 10rpx; | ||
26 | +} | ||
27 | +.top_time.data-v-3a5b7e36 { | ||
28 | + font-size: 27rpx; | ||
29 | + color: #B9B5B5; | ||
30 | +} | ||
31 | +.top_price.data-v-3a5b7e36 { | ||
32 | + font-size: 35rpx; | ||
33 | + color: #D61B30; | ||
34 | + margin-top: 30rpx; | ||
35 | + margin-bottom: 5rpx; | ||
36 | +} | ||
37 | +.top_foot.data-v-3a5b7e36 { | ||
38 | + display: -webkit-box; | ||
39 | + display: -webkit-flex; | ||
40 | + display: flex; | ||
41 | +} | ||
42 | +.top_foot_price.data-v-3a5b7e36 { | ||
43 | + font-size: 22rpx; | ||
44 | + color: #B9B5B5; | ||
45 | + width: 50%; | ||
46 | + text-decoration: line-through; | ||
47 | +} | ||
48 | +.top_foot_qty.data-v-3a5b7e36 { | ||
49 | + font-size: 22rpx; | ||
50 | + color: #B9B5B5; | ||
51 | + width: 50%; | ||
52 | + -webkit-align-content: flex-end; | ||
53 | + align-content: flex-end; | ||
54 | + text-align: right; | ||
55 | +} | ||
56 | +.box_ware.data-v-3a5b7e36 { | ||
57 | + margin: 10rpx 20rpx 20rpx 20rpx; | ||
58 | + padding: 35rpx; | ||
59 | + background-color: #FFFFFF; | ||
60 | + border-radius: 20rpx; | ||
61 | +} | ||
62 | +.box_ware_title.data-v-3a5b7e36 { | ||
63 | + font-size: 35rpx; | ||
64 | + margin: 5rpx 0rpx 30rpx 0rpx; | ||
65 | +} | ||
66 | +.box_ware_box.data-v-3a5b7e36 { | ||
67 | + display: -webkit-box; | ||
68 | + display: -webkit-flex; | ||
69 | + display: flex; | ||
70 | + margin: 10rpx 0rpx 25rpx 0rpx; | ||
71 | +} | ||
72 | +.box_ware_img.data-v-3a5b7e36 { | ||
73 | + width: 30%; | ||
74 | + height: 180rpx; | ||
75 | + border: #999999 solid 1rpx; | ||
76 | +} | ||
77 | +.box_ware_img image.data-v-3a5b7e36 { | ||
78 | + width: 100%; | ||
79 | + height: 100%; | ||
80 | +} | ||
81 | +.box_ware_item.data-v-3a5b7e36 { | ||
82 | + width: 70%; | ||
83 | + margin-left: 25rpx; | ||
84 | + position: relative; | ||
85 | +} | ||
86 | +.box_ware_item_title.data-v-3a5b7e36 { | ||
87 | + font-size: 30rpx; | ||
88 | + word-break: break-all; | ||
89 | + text-overflow: ellipsis; | ||
90 | + display: -webkit-box; | ||
91 | + -webkit-box-orient: vertical; | ||
92 | + -webkit-line-clamp: 2; | ||
93 | + overflow: hidden; | ||
94 | +} | ||
95 | +.box_ware_count.data-v-3a5b7e36 { | ||
96 | + display: -webkit-box; | ||
97 | + display: -webkit-flex; | ||
98 | + display: flex; | ||
99 | +} | ||
100 | +.box_ware_item_price.data-v-3a5b7e36 { | ||
101 | + font-size: 25rpx; | ||
102 | + color: #B9B5B5; | ||
103 | + position: absolute; | ||
104 | + bottom: 60rpx; | ||
105 | + left: 0; | ||
106 | +} | ||
107 | +.box_ware_item_qty.data-v-3a5b7e36 { | ||
108 | + font-size: 25rpx; | ||
109 | + position: absolute; | ||
110 | + bottom: 15rpx; | ||
111 | + left: 0; | ||
112 | +} | ||
113 | +.box_ware_code.data-v-3a5b7e36 { | ||
114 | + position: absolute; | ||
115 | + bottom: 10rpx; | ||
116 | + right: 10rpx; | ||
117 | +} | ||
118 | +.box_ware_code image.data-v-3a5b7e36 { | ||
119 | + width: 60rpx; | ||
120 | + height: 60rpx; | ||
121 | +} | ||
122 | +.box_ware_code text.data-v-3a5b7e36 { | ||
123 | + font-size: 20rpx; | ||
124 | +} | ||
125 | +.foot_box.data-v-3a5b7e36 { | ||
126 | + margin: 10rpx 20rpx 50rpx 20rpx; | ||
127 | + padding: 35rpx; | ||
128 | + background-color: #FFFFFF; | ||
129 | + border-radius: 20rpx; | ||
130 | +} | ||
131 | +.foot_box_title.data-v-3a5b7e36 { | ||
132 | + font-size: 35rpx; | ||
133 | + margin-bottom: 30rpx; | ||
134 | +} | ||
135 | +.foot_box_remark.data-v-3a5b7e36 { | ||
136 | + font-size: 27rpx; | ||
137 | + line-height: 40rpx; | ||
138 | +} | ||
139 | +.foot_empty.data-v-3a5b7e36 { | ||
140 | + height: 90rpx; | ||
141 | +} | ||
142 | +.foot_button.data-v-3a5b7e36 { | ||
143 | + display: -webkit-box; | ||
144 | + display: -webkit-flex; | ||
145 | + display: flex; | ||
146 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
147 | + padding: 25rpx 0rpx; | ||
148 | + background: #FFFFFF; | ||
149 | + text-align: center; | ||
150 | + -webkit-box-pack: center; | ||
151 | + -webkit-justify-content: center; | ||
152 | + justify-content: center; | ||
153 | + position: fixed; | ||
154 | + bottom: 0; | ||
155 | + left: 0; | ||
156 | + width: 100%; | ||
157 | +} | ||
158 | +.foot_button_left.data-v-3a5b7e36 { | ||
159 | + background: #e4010c; | ||
160 | + color: #FFFFFF; | ||
161 | + width: 250rpx; | ||
162 | + height: 70rpx; | ||
163 | + font-size: 28rpx; | ||
164 | + line-height: 70rpx; | ||
165 | + border-radius: 30rpx 0rpx 0rpx 30rpx; | ||
166 | +} | ||
167 | +.foot_button_right.data-v-3a5b7e36 { | ||
168 | + background: #ffbb42; | ||
169 | + color: #FFFFFF; | ||
170 | + width: 250rpx; | ||
171 | + height: 70rpx; | ||
172 | + font-size: 28rpx; | ||
173 | + line-height: 70rpx; | ||
174 | + border-radius: 0rpx 30rpx 30rpx 0rpx; | ||
175 | +} | ||
176 | +.foot_button_buy.data-v-3a5b7e36 { | ||
177 | + background: #e4010c; | ||
178 | + color: #FFFFFF; | ||
179 | + width: 400rpx; | ||
180 | + height: 70rpx; | ||
181 | + font-size: 28rpx; | ||
182 | + line-height: 70rpx; | ||
183 | + border-radius: 30rpx 30rpx 30rpx 30rpx; | ||
184 | +} | ||
185 | +.foot_button_intalge.data-v-3a5b7e36 { | ||
186 | + background: #ffbb42; | ||
187 | + color: #FFFFFF; | ||
188 | + width: 400rpx; | ||
189 | + height: 70rpx; | ||
190 | + font-size: 28rpx; | ||
191 | + line-height: 70rpx; | ||
192 | + border-radius: 30rpx 30rpx 30rpx 30rpx; | ||
193 | +} | ||
194 | +page.data-v-3a5b7e36 { | ||
195 | + background-color: #e85f93; | ||
196 | +} | ||
197 | +.foot_box_remark.data-v-3a5b7e36 ._img { | ||
198 | + width: 100%; | ||
199 | +} | ||
200 | +.foot_box_remark.data-v-3a5b7e36 .img { | ||
201 | + line-height: 0; | ||
202 | +} | ||
203 | + |
pages/giftpack/mygiftpack/mygiftpack.js
0 → 100644
1 | +var t = require("../../../utils/common.js"); var os = getApp().globalData.setting; | ||
2 | +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 | + }; | ||
19 | + }, | ||
20 | + | ||
21 | + onLoad: function onLoad(options) { | ||
22 | + this.getStorageID = options.stoid; | ||
23 | + this.getUserID = options.userid; | ||
24 | + }, | ||
25 | + onShow: function onShow() { | ||
26 | + this.pages = 1; | ||
27 | + this.pageSize = 10; | ||
28 | + this.loadingType = 0; | ||
29 | + this.getList(); | ||
30 | + }, | ||
31 | + methods: { | ||
32 | + BuyGift: function BuyGift() { | ||
33 | + /*销毁跳转*/ | ||
34 | + uni.reLaunch({ | ||
35 | + url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID | ||
36 | + }); | ||
37 | + | ||
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 | + }); | ||
45 | + | ||
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 | + } | ||
78 | + } | ||
79 | + | ||
80 | + _this.loadingType = 0; | ||
81 | + console.log(_this.wareCard); | ||
82 | + } | ||
83 | + } else { | ||
84 | + console.log(res.data.msg); | ||
85 | + } | ||
86 | + } | ||
87 | + }); | ||
88 | + | ||
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 | + } | ||
110 | + } | ||
111 | +}); |
pages/giftpack/mygiftpack/mygiftpack.json
0 → 100644
pages/giftpack/mygiftpack/mygiftpack.wxml
0 → 100644
1 | +<view class="top_img"> | ||
2 | + <view class="top_img"> | ||
3 | + <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | ||
4 | + </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> | ||
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> | ||
96 | + </view> | ||
97 | + </block> | ||
98 | + <view class="foot_box"> | ||
99 | + <text>———— 到底了 ————</text> | ||
100 | + </view> | ||
101 | + </view> | ||
0 | \ No newline at end of file | 102 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.wxss
0 → 100644
1 | + | ||
2 | + | ||
3 | +/*引用样式路径*/ | ||
4 | +@charset "UTF-8"; | ||
5 | +/* Author XGQ | ||
6 | + * 2019-11-12 | ||
7 | + */ | ||
8 | +.top_img { | ||
9 | + -webkit-align-content: center; | ||
10 | + align-content: center; | ||
11 | +} | ||
12 | +.top_img image { | ||
13 | + width: 100%; | ||
14 | + height: 660rpx; | ||
15 | +} | ||
16 | +.top_title { | ||
17 | + display: -webkit-box; | ||
18 | + display: -webkit-flex; | ||
19 | + display: flex; | ||
20 | + background-color: #FFFFFF; | ||
21 | + height: 85rpx; | ||
22 | + border-radius: 10rpx 10rpx 0rpx 0rpx; | ||
23 | + margin: 0rpx 20rpx 0rpx 20rpx; | ||
24 | + -webkit-align-content: center; | ||
25 | + align-content: center; | ||
26 | +} | ||
27 | +.top_title_box { | ||
28 | + width: 49%; | ||
29 | + -webkit-align-content: center; | ||
30 | + align-content: center; | ||
31 | + text-align: center; | ||
32 | + padding: 15rpx; | ||
33 | +} | ||
34 | +.top_title_box_S { | ||
35 | + width: 1%; | ||
36 | + -webkit-align-content: center; | ||
37 | + align-content: center; | ||
38 | + text-align: center; | ||
39 | + margin: 20rpx 0rpx 20rpx 0rpx; | ||
40 | + border-left: #000000 solid 3rpx; | ||
41 | +} | ||
42 | +.top_title_redtext { | ||
43 | + font-size: 30rpx; | ||
44 | + color: #d61b30; | ||
45 | +} | ||
46 | +.top_title_blacktext { | ||
47 | + font-size: 30rpx; | ||
48 | + color: #000000; | ||
49 | +} | ||
50 | +.content_box { | ||
51 | + background-color: #FFFFFF; | ||
52 | + height: 375rpx; | ||
53 | + margin: 10rpx 20rpx 0rpx 20rpx; | ||
54 | + border-radius: 10rpx; | ||
55 | +} | ||
56 | +.content_box_ware { | ||
57 | + border-bottom: #f5f5f5 solid 2rpx; | ||
58 | + display: -webkit-box; | ||
59 | + display: -webkit-flex; | ||
60 | + display: flex; | ||
61 | +} | ||
62 | +.content_box_img { | ||
63 | + margin: 20rpx 20rpx 20rpx 25rpx; | ||
64 | + width: 35%; | ||
65 | + display: -webkit-box; | ||
66 | + display: -webkit-flex; | ||
67 | + display: flex; | ||
68 | + font-size: 8rpx; | ||
69 | + position: relative; | ||
70 | +} | ||
71 | +.content_box_img image { | ||
72 | + width: 100%; | ||
73 | + height: 230rpx; | ||
74 | +} | ||
75 | +.content_box_img_title { | ||
76 | + position: absolute; | ||
77 | + background: #D01119; | ||
78 | + display: -webkit-box; | ||
79 | + display: -webkit-flex; | ||
80 | + display: flex; | ||
81 | + padding: 8rpx; | ||
82 | + border-radius: 0rpx 0rpx 10rpx 0rpx; | ||
83 | +} | ||
84 | +.content_box_img_ground1{ | ||
85 | + background: #fb6451; | ||
86 | +} | ||
87 | +.content_box_img_ground2{ | ||
88 | + background: #ffb72d; | ||
89 | +} | ||
90 | +.content_box_img_ground3{ | ||
91 | + background: #9be0e5; | ||
92 | +} | ||
93 | +.content_box_img_ground4{ | ||
94 | + background: #4784ef; | ||
95 | +} | ||
96 | +.content_box_img_title image { | ||
97 | + width: 30rpx; | ||
98 | + height: 30rpx; | ||
99 | +} | ||
100 | +.content_box_img_title text { | ||
101 | + font-size: 20rpx; | ||
102 | + color: #FFFFFF; | ||
103 | + line-height: 25rpx; | ||
104 | + padding-top: 5rpx; | ||
105 | +} | ||
106 | +.content_box_title { | ||
107 | + width: 65%; | ||
108 | + margin: 25rpx 25rpx 10rpx 0rpx; | ||
109 | + position: relative; | ||
110 | +} | ||
111 | +.content_ware_title { | ||
112 | + font-size: 30rpx; | ||
113 | + word-break: break-all; | ||
114 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
115 | + text-overflow: ellipsis; | ||
116 | + display: -webkit-box; | ||
117 | + /** 对象作为伸缩盒子模型显示 **/ | ||
118 | + -webkit-box-orient: vertical; | ||
119 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
120 | + -webkit-line-clamp: 2; | ||
121 | + /** 显示的行数 **/ | ||
122 | + overflow: hidden; | ||
123 | + /** 隐藏超出的内容 **/ | ||
124 | +} | ||
125 | +.content_ware_type { | ||
126 | + font-size: 28rpx; | ||
127 | + color: #c61a34; | ||
128 | + margin-top: 10rpx; | ||
129 | + position: absolute; | ||
130 | + left: 0; | ||
131 | + bottom: 100rpx; | ||
132 | +} | ||
133 | +.content_ware_price { | ||
134 | + font-size: 20rpx; | ||
135 | + color: #b9b5b5; | ||
136 | + margin-top: 2rpx; | ||
137 | + text-decoration: line-through; | ||
138 | + position: absolute; | ||
139 | + left: 0; | ||
140 | + bottom: 70rpx; | ||
141 | +} | ||
142 | +.content_ware_time { | ||
143 | + font-size: 25rpx; | ||
144 | + color: #c61a34; | ||
145 | + margin-top: 20rpx; | ||
146 | + position: absolute; | ||
147 | + left: 0; | ||
148 | + bottom: 25rpx; | ||
149 | +} | ||
150 | +.content_box_button { | ||
151 | + text-align: right; | ||
152 | + margin: 20rpx 25rpx 20rpx 20rpx; | ||
153 | +} | ||
154 | +.content_box_button button { | ||
155 | + display: inline-block; | ||
156 | + width: 160rpx; | ||
157 | + height: 50rpx; | ||
158 | + font-size: 25rpx; | ||
159 | + background: #d41c34; | ||
160 | + color: #FFFFFF; | ||
161 | + line-height: 50rpx; | ||
162 | +} | ||
163 | +.foot_box { | ||
164 | + -webkit-align-content: center; | ||
165 | + align-content: center; | ||
166 | + text-align: center; | ||
167 | + margin-top: 15rpx; | ||
168 | + margin-bottom: 50rpx; | ||
169 | +} | ||
170 | +.foot_box text { | ||
171 | + font-size: 25rpx; | ||
172 | + color: #FFFFFF; | ||
173 | +} | ||
174 | +.foot_empty{ | ||
175 | + background-color: #FFFFFF; | ||
176 | + height: 375rpx; | ||
177 | + margin: 10rpx 20rpx 0rpx 20rpx; | ||
178 | + border-radius: 10rpx; | ||
179 | + text-align: center; | ||
180 | + padding: 150rpx 0rpx 300rpx 0rpx; | ||
181 | + -webkit-box-pack: center; | ||
182 | + -webkit-justify-content: center; | ||
183 | + justify-content: center; | ||
184 | +} | ||
185 | +.foot_empty image{ | ||
186 | + width: 400rpx; | ||
187 | + height: 273rpx; | ||
188 | +} | ||
189 | +.foot_empty text{ | ||
190 | + font-size: 30rpx; | ||
191 | + color: #999999; | ||
192 | +} | ||
193 | +.foot_empty_button{ | ||
194 | + background: #ff6363; | ||
195 | + margin: 60rpx 230rpx 0rpx 230rpx; | ||
196 | + padding: 10rpx; | ||
197 | + border-radius: 70rpx; | ||
198 | + line-height: 40rpx; | ||
199 | +} | ||
200 | +.foot_empty_button text{ | ||
201 | + font-size: 28rpx; | ||
202 | + color: #FFFFFF; | ||
203 | +} | ||
204 | +page { | ||
205 | + background-color: #fb7454; | ||
206 | +} |