Merge branch 'promotion1.0' into 'master'
Promotion1.0 merge See merge request !18
Showing
15 changed files
with
302 additions
and
36 deletions
@@ -7,39 +7,46 @@ Component({ | @@ -7,39 +7,46 @@ Component({ | ||
7 | }, | 7 | }, |
8 | coupons: { | 8 | coupons: { |
9 | type: Array, | 9 | type: Array, |
10 | - value: [] | 10 | + value: [], |
11 | }, | 11 | }, |
12 | selectedCode: { | 12 | selectedCode: { |
13 | type: String, | 13 | type: String, |
14 | + value: '', | ||
15 | + }, | ||
16 | + chosenIdx: { | ||
17 | + type: String, | ||
14 | value: '' | 18 | value: '' |
15 | - } | 19 | + }, |
16 | }, | 20 | }, |
17 | data: { | 21 | data: { |
18 | - chosenIdx: '' | 22 | + // chosenIdx: '' |
19 | }, | 23 | }, |
20 | methods: { | 24 | methods: { |
21 | confirm: function () { | 25 | confirm: function () { |
22 | let item = this.data.coupons[this.data.chosenIdx]; | 26 | let item = this.data.coupons[this.data.chosenIdx]; |
27 | + let codeType = item && item.coupon_type|| ''; | ||
23 | let code = item && item.coupon_code || ''; | 28 | let code = item && item.coupon_code || ''; |
24 | let amount = item && item.coupon_value_str || ''; | 29 | let amount = item && item.coupon_value_str || ''; |
25 | - | ||
26 | - this.triggerEvent('confirmselect', {code, amount}) | 30 | + this.triggerEvent('confirmselect', { code, amount, codeType}) |
27 | }, | 31 | }, |
28 | cancel: function () { | 32 | cancel: function () { |
29 | this.triggerEvent('cancel') | 33 | this.triggerEvent('cancel') |
30 | }, | 34 | }, |
31 | check: function (e) { | 35 | check: function (e) { |
32 | let idx = e.currentTarget.dataset.idx; | 36 | let idx = e.currentTarget.dataset.idx; |
33 | - | 37 | + let that = this; |
34 | this.data.coupons.forEach((item, index) => { | 38 | this.data.coupons.forEach((item, index) => { |
39 | + let listItem = item; | ||
35 | if (index !== idx && item.isChosen) { | 40 | if (index !== idx && item.isChosen) { |
36 | this.setData({ | 41 | this.setData({ |
37 | - [`coupons[${index}].isChosen`]: false | 42 | + [`coupons[${index}].isChosen`]: false, |
43 | + [`coupons[${idx}].selected`]: 'N' | ||
38 | }); | 44 | }); |
39 | } | 45 | } |
40 | if (index === idx) { | 46 | if (index === idx) { |
41 | this.setData({ | 47 | this.setData({ |
42 | - [`coupons[${idx}].isChosen`]: true | 48 | + [`coupons[${idx}].isChosen`]: true, |
49 | + [`coupons[${idx}].selected`]: 'Y' | ||
43 | }); | 50 | }); |
44 | } | 51 | } |
45 | }); | 52 | }); |
@@ -49,7 +56,8 @@ Component({ | @@ -49,7 +56,8 @@ Component({ | ||
49 | let idx = e.currentTarget.dataset.idx; | 56 | let idx = e.currentTarget.dataset.idx; |
50 | 57 | ||
51 | this.setData({ | 58 | this.setData({ |
52 | - [`coupons[${idx}].isChosen`]: false | 59 | + [`coupons[${idx}].isChosen`]: false, |
60 | + [`coupons[${idx}].selected`]: 'N' | ||
53 | }); | 61 | }); |
54 | this.data.chosenIdx = ''; | 62 | this.data.chosenIdx = ''; |
55 | }, | 63 | }, |
@@ -77,6 +85,7 @@ Component({ | @@ -77,6 +85,7 @@ Component({ | ||
77 | this.data.chosenIdx = ''; | 85 | this.data.chosenIdx = ''; |
78 | } | 86 | } |
79 | } | 87 | } |
88 | + console.log(this.data.coupons) | ||
80 | } | 89 | } |
81 | } | 90 | } |
82 | }); | 91 | }); |
src/components/tip-dialog/index.js
0 → 100644
1 | +// src/components/dialog/dialog.js | ||
2 | +Component({ | ||
3 | + options: { | ||
4 | + multipleSlots: true // 在组件定义时的选项中启用多slot支持 | ||
5 | + }, | ||
6 | + /** | ||
7 | + * 组件的属性列表 | ||
8 | + * 用于组件自定义设置 | ||
9 | + */ | ||
10 | + properties: { | ||
11 | + // 弹窗标题 | ||
12 | + title: { // 属性名 | ||
13 | + type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型) | ||
14 | + value: '标题' // 属性初始值(可选),如果未指定则会根据类型选择一个 | ||
15 | + }, | ||
16 | + // 弹窗内容 | ||
17 | + content: { | ||
18 | + type: String, | ||
19 | + value: '弹窗内容' | ||
20 | + }, | ||
21 | + // 弹窗取消按钮文字 | ||
22 | + cancelText: { | ||
23 | + type: String, | ||
24 | + value: '取消' | ||
25 | + }, | ||
26 | + // 弹窗确认按钮文字 | ||
27 | + confirmText: { | ||
28 | + type: String, | ||
29 | + value: '确定' | ||
30 | + } | ||
31 | + }, | ||
32 | + | ||
33 | + /** | ||
34 | + * 私有数据,组件的初始数据 | ||
35 | + * 可用于模版渲染 | ||
36 | + */ | ||
37 | + data: { | ||
38 | + // 弹窗显示控制 | ||
39 | + isShow: false | ||
40 | + }, | ||
41 | + | ||
42 | + /** | ||
43 | + * 组件的方法列表 | ||
44 | + * 更新属性和数据的方法与更新页面数据的方法类似 | ||
45 | + */ | ||
46 | + methods: { | ||
47 | + /* | ||
48 | + * 公有方法 | ||
49 | + */ | ||
50 | + | ||
51 | + _showChange(isShow) { | ||
52 | + console.log("===isShow==" + isShow) | ||
53 | + this.setData({ isShowLeft: isShow }) | ||
54 | + | ||
55 | + }, | ||
56 | + | ||
57 | + //隐藏弹框 | ||
58 | + hideDialog() { | ||
59 | + this.setData({ | ||
60 | + isShow: !this.data.isShow | ||
61 | + }) | ||
62 | + }, | ||
63 | + //展示弹框 | ||
64 | + showDialog() { | ||
65 | + this.setData({ | ||
66 | + isShow: !this.data.isShow | ||
67 | + }) | ||
68 | + }, | ||
69 | + /* | ||
70 | + * 内部私有方法建议以下划线开头 | ||
71 | + * triggerEvent 用于触发事件 | ||
72 | + */ | ||
73 | + _cancelEvent() { | ||
74 | + this.triggerEvent("cancelEvent") | ||
75 | + }, | ||
76 | + _confirmEvent() { | ||
77 | + this.triggerEvent("confirmEvent"); | ||
78 | + } | ||
79 | + } | ||
80 | +}) |
src/components/tip-dialog/index.json
0 → 100644
src/components/tip-dialog/index.wxml
0 → 100644
1 | +<!--src/components/tip-dialog/index.wxml--> | ||
2 | +<!--src/components/dialog/dialog.wxml--> | ||
3 | +<view class='wx_dialog_container' hidden="{{!isShow}}"> | ||
4 | + <view class='wx-mask'></view> | ||
5 | + <view class='wx-dialog'> | ||
6 | + <view class='wx-dialog-content'>{{ content }}</view> | ||
7 | + <view class='wx-dialog-footer'> | ||
8 | + <view class='wx-dialog-btn' bindtap="_confirmEvent">{{ confirmText }}</view> | ||
9 | + </view> | ||
10 | + </view> | ||
11 | +</view> | ||
12 | + |
src/components/tip-dialog/index.wxss
0 → 100644
1 | +/* src/components/tip-dialog/index.wxss */ | ||
2 | +/* src/components/dialog/dialog.wxss */ | ||
3 | +.wx-mask{ | ||
4 | + position: fixed; | ||
5 | + z-index: 1000; | ||
6 | + top: 0; | ||
7 | + right: 0; | ||
8 | + left: 0; | ||
9 | + bottom: 0; | ||
10 | + background: rgba(0, 0, 0, 0.3); | ||
11 | +} | ||
12 | +.wx-dialog{ | ||
13 | + position: fixed; | ||
14 | + z-index: 5000; | ||
15 | + width: 560rpx; | ||
16 | + top: 50%; | ||
17 | + left: 50%; | ||
18 | + -webkit-transform: translate(-50%, -50%); | ||
19 | + transform: translate(-50%, -50%); | ||
20 | + background-color: #FFFFFF; | ||
21 | + text-align: center; | ||
22 | + border-radius: 3rpx; | ||
23 | + overflow: hidden; | ||
24 | +} | ||
25 | +.wx-dialog-title{ | ||
26 | + font-size: 30rpx; | ||
27 | + padding: 15rpx 15rpx 5rpx; | ||
28 | +} | ||
29 | +.wx-dialog-content{ | ||
30 | + height: 240rpx; | ||
31 | + font-size: 30rpx; | ||
32 | + display:flex; | ||
33 | + align-items:center;/*垂直居中*/ | ||
34 | + justify-content: center;/*水平居中*/ | ||
35 | + margin: 0 50rpx; | ||
36 | +} | ||
37 | +.wx-dialog-footer{ | ||
38 | + display: flex; | ||
39 | + align-items: center; | ||
40 | + position: relative; | ||
41 | + height: 100rpx; | ||
42 | + font-size: 30rpx; | ||
43 | +} | ||
44 | +.wx-dialog-footer::before{ | ||
45 | + content: ''; | ||
46 | + position: absolute; | ||
47 | + left: 0; | ||
48 | + top: 0; | ||
49 | + right: 0; | ||
50 | + height: 1px; | ||
51 | + border-top: 1rpx solid #D5D5D6; | ||
52 | + color: #D5D5D6; | ||
53 | + -webkit-transform-origin: 0 0; | ||
54 | + transform-origin: 0 0; | ||
55 | + -webkit-transform: scaleY(0.5); | ||
56 | + transform: scaleY(0.5); | ||
57 | +} | ||
58 | +.wx-dialog-btn{ | ||
59 | + display: block; | ||
60 | + -webkit-flex: 1; | ||
61 | + flex: 1; | ||
62 | + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
63 | + position: relative; | ||
64 | + height:100%; | ||
65 | + line-height:100rpx; | ||
66 | +} | ||
67 | +.wx-dialog-footer .wx-dialog-btn:nth-of-type(1){ | ||
68 | + color: #000; | ||
69 | +} | ||
70 | +.wx-dialog-footer .wx-dialog-btn:nth-of-type(2){ | ||
71 | + color: #000; | ||
72 | +} | ||
73 | +.wx-dialog-footer .wx-dialog-btn:nth-of-type(2):after{ | ||
74 | + content: " "; | ||
75 | + position: absolute; | ||
76 | + left: 0; | ||
77 | + top: 0; | ||
78 | + width: 1rpx; | ||
79 | + bottom: 0; | ||
80 | + border-left: 2rpx solid #D5D5D6; | ||
81 | + color: #D5D5D6; | ||
82 | + -webkit-transform-origin: 0 0; | ||
83 | + transform-origin: 0 0; | ||
84 | + -webkit-transform: scaleX(0.5); | ||
85 | + transform: scaleX(0.5); | ||
86 | +} |
1 | -const app_version = '1.0.0' | 1 | +const app_version = '1.1.5' |
2 | +const build_code = 1000 | ||
2 | const private_key = 'b43890b0a296ff3c7b8c260ca763980b' | 3 | const private_key = 'b43890b0a296ff3c7b8c260ca763980b' |
3 | const appid = 'wxc677c88385762287' | 4 | const appid = 'wxc677c88385762287' |
4 | export default { | 5 | export default { |
@@ -19,6 +20,14 @@ export default { | @@ -19,6 +20,14 @@ export default { | ||
19 | // activityHost: 'https://action.yoho.cn', | 20 | // activityHost: 'https://action.yoho.cn', |
20 | // reportHost: 'https://app.yoho.cn/collect/v3', | 21 | // reportHost: 'https://app.yoho.cn/collect/v3', |
21 | // yasHost: 'https://analysis.yohobuy.com/yas_mobile' | 22 | // yasHost: 'https://analysis.yohobuy.com/yas_mobile' |
23 | + | ||
24 | + // grey | ||
25 | + // api: 'http://2.yohobuy.com', | ||
26 | + // yohoApi: 'http://54.223.33.55', | ||
27 | + // yohoLogin: 'http://54.223.33.55', | ||
28 | + // activityHost: 'https://action.yoho.cn', | ||
29 | + // reportHost: 'https://app.yoho.cn/collect/v3', | ||
30 | + // yasHost: 'https://analysis.yohobuy.com/yas_mobile' | ||
22 | }, | 31 | }, |
23 | apiParams: { | 32 | apiParams: { |
24 | client_type: 'miniapp', | 33 | client_type: 'miniapp', |
@@ -53,6 +62,7 @@ export default { | @@ -53,6 +62,7 @@ export default { | ||
53 | source_type: 'wechat', | 62 | source_type: 'wechat', |
54 | user_source: 'wechat', | 63 | user_source: 'wechat', |
55 | business_line: 'miniappUFO', | 64 | business_line: 'miniappUFO', |
65 | + build_code: build_code, | ||
56 | }, | 66 | }, |
57 | unionType: '', // 渠道号 | 67 | unionType: '', // 渠道号 |
58 | // MINI_APP_DOMAIN: 'miniapp.yohobuy.com', | 68 | // MINI_APP_DOMAIN: 'miniapp.yohobuy.com', |
@@ -148,7 +148,7 @@ export default class Index extends Component { | @@ -148,7 +148,7 @@ export default class Index extends Component { | ||
148 | commonModel.search({ | 148 | commonModel.search({ |
149 | limit: 10, | 149 | limit: 10, |
150 | type: type, | 150 | type: type, |
151 | - page: page[type] | 151 | + page: page[type] || 1 |
152 | }).then(ret => { | 152 | }).then(ret => { |
153 | if (ret && ret.code === 200) { | 153 | if (ret && ret.code === 200) { |
154 | let list = ret.data && ret.data.product_list || []; | 154 | let list = ret.data && ret.data.product_list || []; |
@@ -33,12 +33,13 @@ Page({ | @@ -33,12 +33,13 @@ Page({ | ||
33 | selectCouponCode: '', | 33 | selectCouponCode: '', |
34 | selectCouponAmount: '', | 34 | selectCouponAmount: '', |
35 | selectingCoupon: false, | 35 | selectingCoupon: false, |
36 | + promotionid: '', | ||
36 | user_activity_id: '' // 有值代表砍价 | 37 | user_activity_id: '' // 有值代表砍价 |
37 | }, | 38 | }, |
38 | onLoad: async function (option) { | 39 | onLoad: async function (option) { |
39 | yas = new Yas(this); | 40 | yas = new Yas(this); |
40 | yas.pageOpenReport(); | 41 | yas.pageOpenReport(); |
41 | - | 42 | + |
42 | this.setData({ | 43 | this.setData({ |
43 | isStore: Number(option.is_store) || 0, | 44 | isStore: Number(option.is_store) || 0, |
44 | storeId: option.store_id || 0, | 45 | storeId: option.store_id || 0, |
@@ -54,12 +55,16 @@ Page({ | @@ -54,12 +55,16 @@ Page({ | ||
54 | if (!(userInfo && userInfo.uid && userInfo.session_key)) { | 55 | if (!(userInfo && userInfo.uid && userInfo.session_key)) { |
55 | router.go('nativeLogin'); | 56 | router.go('nativeLogin'); |
56 | return; | 57 | return; |
57 | - } | 58 | + } |
58 | 59 | ||
59 | - await this.fetchData(this.data.isStore); | ||
60 | - if (!this.data.isStore) { | ||
61 | - await this.fetchAddress() | 60 | + //选中优惠卷后,切到后台,再切回前台页面,不在请求数据 |
61 | + if (!this.data.selectCouponCode) { | ||
62 | + await this.fetchData(this.data.isStore); | ||
63 | + if (!this.data.isStore && !this.data.hasAddress) { | ||
64 | + await this.fetchAddress() | ||
65 | + } | ||
62 | } | 66 | } |
67 | + | ||
63 | }, | 68 | }, |
64 | 69 | ||
65 | showSelectCoupon: function () { | 70 | showSelectCoupon: function () { |
@@ -69,27 +74,53 @@ Page({ | @@ -69,27 +74,53 @@ Page({ | ||
69 | }, | 74 | }, |
70 | 75 | ||
71 | async confirmSelectCoupon({detail}) { | 76 | async confirmSelectCoupon({detail}) { |
77 | + | ||
72 | let code = detail.code; | 78 | let code = detail.code; |
79 | + let codeType = detail.codeType; | ||
73 | let amount = detail.amount || ''; | 80 | let amount = detail.amount || ''; |
81 | + let couponsList = this.data.couponList; | ||
82 | + if (couponsList){ | ||
83 | + couponsList.forEach((item, index) => { | ||
84 | + if (code === item.coupon_code) { | ||
85 | + item.isChosen = true; | ||
86 | + item.selected = 'Y' | ||
87 | + } | ||
74 | 88 | ||
89 | + }); | ||
90 | + } | ||
91 | + | ||
75 | this.setData({ | 92 | this.setData({ |
93 | + couponsList, | ||
76 | selectCouponAmount: amount, | 94 | selectCouponAmount: amount, |
77 | selectCouponCode: code, | 95 | selectCouponCode: code, |
78 | - selectingCoupon: false | 96 | + selectingCoupon: false, |
97 | + selectingCouponType: codeType | ||
79 | }); | 98 | }); |
80 | 99 | ||
81 | // 区分线上线下 | 100 | // 区分线上线下 |
82 | let info; | 101 | let info; |
102 | + //如果选择了非运费券,促销不选择 | ||
103 | + let promotion_id = ''; | ||
104 | + if (this.data && this.data.promotionTips && this.data.promotionTips.promotionIds) { | ||
105 | + promotion_id = this.data.promotionTips.promotionIds; | ||
106 | + } | ||
107 | + //判断优惠劵的类型 | ||
108 | + if (code && codeType !== 110){ | ||
109 | + promotion_id = ''; | ||
110 | + } | ||
83 | try { | 111 | try { |
84 | if (this.data.isStore) { | 112 | if (this.data.isStore) { |
85 | info = await api.orderOfflineCompute({ | 113 | info = await api.orderOfflineCompute({ |
86 | skup: this.data.skup, | 114 | skup: this.data.skup, |
87 | - coupon_code: code | 115 | + coupon_code: code, |
116 | + promotionId: promotion_id, | ||
117 | + app_version: '1' | ||
88 | }, () => wx.hideLoading()); | 118 | }, () => wx.hideLoading()); |
89 | } else { | 119 | } else { |
90 | const params = { | 120 | const params = { |
91 | skup: this.data.skup, | 121 | skup: this.data.skup, |
92 | - coupon_code: code | 122 | + coupon_code: code, |
123 | + promotionid: promotion_id | ||
93 | }; | 124 | }; |
94 | 125 | ||
95 | if (this.data.user_activity_id) { | 126 | if (this.data.user_activity_id) { |
@@ -121,7 +152,8 @@ Page({ | @@ -121,7 +152,8 @@ Page({ | ||
121 | }); | 152 | }); |
122 | let params = { | 153 | let params = { |
123 | skup: this.data.skup, | 154 | skup: this.data.skup, |
124 | - store_id: this.data.storeId | 155 | + store_id: this.data.storeId, |
156 | + api_version: '1' | ||
125 | } | 157 | } |
126 | 158 | ||
127 | if (this.data.user_activity_id) { | 159 | if (this.data.user_activity_id) { |
@@ -155,10 +187,23 @@ Page({ | @@ -155,10 +187,23 @@ Page({ | ||
155 | } | 187 | } |
156 | } | 188 | } |
157 | 189 | ||
158 | - api.orderSelectCoupon(this.data.skup, () => wx.hideLoading()).then(data => { | ||
159 | - let coupons = data || []; | ||
160 | - this.setData(coupons) | ||
161 | - }); | 190 | + // await api.orderSelectCoupon(this.data.skup, () => wx.hideLoading()).then(data => { |
191 | + // this.setData(coupons) | ||
192 | + // }); | ||
193 | + let that = this; | ||
194 | + if (data && data.couponList && data.couponList.length > 0){ | ||
195 | + let coupons = []; | ||
196 | + data.couponList.forEach((item, index) => { | ||
197 | + let selected = item.selected; | ||
198 | + if (selected === 'Y'){ | ||
199 | + item.isChosen = true; | ||
200 | + data.selectCouponAmount = item.coupon_value_str; | ||
201 | + data.selectCouponCode = item.coupon_code; | ||
202 | + }else { | ||
203 | + item.isChosen = false; | ||
204 | + } | ||
205 | + }); | ||
206 | + } | ||
162 | 207 | ||
163 | if (data.good && data.good.goodImg) { | 208 | if (data.good && data.good.goodImg) { |
164 | data.good.goodImg = getImgUrl(data.good.goodImg, 270, 270) | 209 | data.good.goodImg = getImgUrl(data.good.goodImg, 270, 270) |
@@ -202,18 +247,26 @@ Page({ | @@ -202,18 +247,26 @@ Page({ | ||
202 | }, | 247 | }, |
203 | 248 | ||
204 | async submit() { | 249 | async submit() { |
205 | - | ||
206 | if (!this.data.agreeProtocol) return; | 250 | if (!this.data.agreeProtocol) return; |
207 | let data; | 251 | let data; |
208 | try { | 252 | try { |
253 | + let promotionId = ''; | ||
254 | + if (this.data && this.data.promotionTips && this.data.promotionTips.promotionIds){ | ||
255 | + promotionId = this.data.promotionTips.promotionIds; | ||
256 | + } | ||
257 | + | ||
258 | + if (this.data.selectingCouponType && this.data.selectingCouponType !== 110) { | ||
259 | + promotionId = ''; | ||
260 | + } | ||
209 | if (this.data.isStore) { | 261 | if (this.data.isStore) { |
210 | this.check = this.selectComponent("#check"); | 262 | this.check = this.selectComponent("#check"); |
211 | let checkRes = await this.check.init(); | 263 | let checkRes = await this.check.init(); |
212 | if (!checkRes.result) return; | 264 | if (!checkRes.result) return; |
213 | let param = checkRes.data; | 265 | let param = checkRes.data; |
214 | - param.skup = this.data.skup | 266 | + param.skup = this.data.skup; |
267 | + param.api_version = '1'; | ||
215 | param.coupon_code = this.data.selectCouponCode || ''; | 268 | param.coupon_code = this.data.selectCouponCode || ''; |
216 | - | 269 | + param.promotionId = promotionId; |
217 | // wx.showLoading({ | 270 | // wx.showLoading({ |
218 | // title: '', | 271 | // title: '', |
219 | // }) | 272 | // }) |
@@ -234,6 +287,7 @@ Page({ | @@ -234,6 +287,7 @@ Page({ | ||
234 | let channelNo = ''; | 287 | let channelNo = ''; |
235 | let couponCode = this.data.selectCouponCode || ''; | 288 | let couponCode = this.data.selectCouponCode || ''; |
236 | let extra = null; | 289 | let extra = null; |
290 | + | ||
237 | 291 | ||
238 | if (this.data.user_activity_id) { | 292 | if (this.data.user_activity_id) { |
239 | extra = { | 293 | extra = { |
@@ -245,7 +299,7 @@ Page({ | @@ -245,7 +299,7 @@ Page({ | ||
245 | // wx.showLoading({ | 299 | // wx.showLoading({ |
246 | // title: '', | 300 | // title: '', |
247 | // }) | 301 | // }) |
248 | - data = await api.buyerSubmit({skup, channelNo, addressId, couponCode, extra}, () => wx.hideLoading()); | 302 | + data = await api.buyerSubmit({ skup, channelNo, addressId, couponCode, promotionId, extra}, () => wx.hideLoading()); |
249 | } | 303 | } |
250 | if (data && data.orderCode) { | 304 | if (data && data.orderCode) { |
251 | let skup = this.data.skup | 305 | let skup = this.data.skup |
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | <productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell> | 8 | <productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell> |
9 | <!-- // 砍价没有优惠券 --> | 9 | <!-- // 砍价没有优惠券 --> |
10 | <couponCell wx:if="{{!user_activity_id}}" bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell> | 10 | <couponCell wx:if="{{!user_activity_id}}" bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell> |
11 | + | ||
11 | <priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}" isStore="{{isStore === 1}}"></priceCell> | 12 | <priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}" isStore="{{isStore === 1}}"></priceCell> |
12 | <payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell> | 13 | <payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell> |
13 | </scroll-view> | 14 | </scroll-view> |
@@ -38,5 +39,5 @@ | @@ -38,5 +39,5 @@ | ||
38 | </view> | 39 | </view> |
39 | </view> | 40 | </view> |
40 | <couponSelect bindconfirmselect="confirmSelectCoupon" show="{{selectingCoupon}}" selected-code="{{selectCouponCode}}" | 41 | <couponSelect bindconfirmselect="confirmSelectCoupon" show="{{selectingCoupon}}" selected-code="{{selectCouponCode}}" |
41 | - bindcancel="cancelSelectCoupon" coupons="{{coupons}}"></couponSelect> | 42 | + bindcancel="cancelSelectCoupon" coupons="{{couponList}}" chosenIdx="{{chosenIdx}}"></couponSelect> |
42 | <checkstore id="check" storeId="{{storeId}}" productId="{{product_id}}"></checkstore> | 43 | <checkstore id="check" storeId="{{storeId}}" productId="{{product_id}}"></checkstore> |
@@ -56,14 +56,17 @@ export default class orderService extends BaseService { | @@ -56,14 +56,17 @@ export default class orderService extends BaseService { | ||
56 | }) | 56 | }) |
57 | } | 57 | } |
58 | 58 | ||
59 | - async buyerSubmit({skup, channelNo = '2919', addressId, couponCode, complete, extra = {}} ) { | 59 | + async buyerSubmit({ skup, channelNo = '2919', addressId, couponCode, complete, promotionId, extra = {}} ) { |
60 | 60 | ||
61 | return await this.GET(Object.assign({ | 61 | return await this.GET(Object.assign({ |
62 | method: BUYER_SUBMIT, | 62 | method: BUYER_SUBMIT, |
63 | skup, | 63 | skup, |
64 | channelNo, | 64 | channelNo, |
65 | addressId, | 65 | addressId, |
66 | - coupon_code: couponCode || '' | 66 | + promotionId, |
67 | + coupon_code: couponCode || '', | ||
68 | + app_version: '1' | ||
69 | + | ||
67 | }, extra), { | 70 | }, extra), { |
68 | path: '/shopping', | 71 | path: '/shopping', |
69 | complete | 72 | complete |
@@ -108,7 +108,8 @@ export default class ProductDetail extends Component { | @@ -108,7 +108,8 @@ export default class ProductDetail extends Component { | ||
108 | if (options && options.q) { | 108 | if (options && options.q) { |
109 | let url = decodeURIComponent(options.q); | 109 | let url = decodeURIComponent(options.q); |
110 | let urlObj = urlParse.parse(url); | 110 | let urlObj = urlParse.parse(url); |
111 | - if (urlObj.host === 'o.yohobuy.com' && urlObj.pathname === '/ufo') { | 111 | + // console |
112 | + if (urlObj.host === '2.yohobuy.com' && urlObj.pathname === '/ufo') { | ||
112 | const queryObj = queryString.parse(urlObj.query); | 113 | const queryObj = queryString.parse(urlObj.query); |
113 | const p = queryObj.p; | 114 | const p = queryObj.p; |
114 | const storeArr = p.split(',') || []; | 115 | const storeArr = p.split(',') || []; |
@@ -656,7 +657,7 @@ export default class ProductDetail extends Component { | @@ -656,7 +657,7 @@ export default class ProductDetail extends Component { | ||
656 | </Button>) | 657 | </Button>) |
657 | } | 658 | } |
658 | { | 659 | { |
659 | - (!isGoApp && skup) && <Image className="goYohoBuy" onClick={this.goOnLineProuduct.bind(this, id)} src={goOnLine} mode="aspectFill" /> | 660 | + // (!isGoApp && skup) && <Image className="goYohoBuy" onClick={this.goOnLineProuduct.bind(this, id)} src={goOnLine} mode="aspectFill" /> |
660 | } | 661 | } |
661 | { | 662 | { |
662 | (!isGoApp && !skup) && <Image className="goYohoBuy" onClick={this.goYohoBuyMinApp.bind(this)} src={goYohoBuy} mode="aspectFill" /> | 663 | (!isGoApp && !skup) && <Image className="goYohoBuy" onClick={this.goYohoBuyMinApp.bind(this)} src={goYohoBuy} mode="aspectFill" /> |
src/pages/tarotest/test.js
0 → 100644
@@ -6,7 +6,8 @@ import Taro from '@tarojs/taro' | @@ -6,7 +6,8 @@ import Taro from '@tarojs/taro' | ||
6 | 6 | ||
7 | const ACTION_TYPE = { | 7 | const ACTION_TYPE = { |
8 | h5: 'go.h5', | 8 | h5: 'go.h5', |
9 | - ufo: 'go.ufo' | 9 | + ufo: 'go.ufo', |
10 | + productDetail: 'go.ufoProductDetail', | ||
10 | } | 11 | } |
11 | 12 | ||
12 | const OPEN_BY_TYPE = { | 13 | const OPEN_BY_TYPE = { |
@@ -56,6 +57,10 @@ export default { | @@ -56,6 +57,10 @@ export default { | ||
56 | this.handleUFOJumpPage(yoho); | 57 | this.handleUFOJumpPage(yoho); |
57 | break; | 58 | break; |
58 | } | 59 | } |
60 | + case ACTION_TYPE.productDetail: { | ||
61 | + this.handleUFOJumpPage(yoho); | ||
62 | + break; | ||
63 | + } | ||
59 | } | 64 | } |
60 | }, | 65 | }, |
61 | handleUFOJumpPage(yoho) { | 66 | handleUFOJumpPage(yoho) { |
-
Please register or login to post a comment