Showing
33 changed files
with
902 additions
and
17 deletions
| @@ -179,6 +179,54 @@ Page({ | @@ -179,6 +179,54 @@ Page({ | ||
| 179 | } | 179 | } |
| 180 | }) | 180 | }) |
| 181 | }, | 181 | }, |
| 182 | + // 获取code、手机号 | ||
| 183 | + getPhoneNumberFun(e) { | ||
| 184 | + console.log('获取code', e.detail); | ||
| 185 | + if (e.detail && e.detail.code) { | ||
| 186 | + App.Wechat.GetUserPhoneNumber({ | ||
| 187 | + code: e.detail.code, | ||
| 188 | + }).then(res => { | ||
| 189 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 190 | + this.setData({ | ||
| 191 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 192 | + }) | ||
| 193 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 194 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 195 | + } else { | ||
| 196 | + util.toast('手机号获取失败!', 'none') | ||
| 197 | + } | ||
| 198 | + }) | ||
| 199 | + } | ||
| 200 | + }, | ||
| 201 | + // 获取用户在商家的账户余额 | ||
| 202 | + getUserRechargeInfo(phone) { | ||
| 203 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 204 | + openid: getApp().openid, | ||
| 205 | + phone, | ||
| 206 | + sellerid: this.data.seller.sid, | ||
| 207 | + }).then((json) => { | ||
| 208 | + if (json.ret == 200) { | ||
| 209 | + let data = json.data; | ||
| 210 | + if (!data) { | ||
| 211 | + this.createInfoFun(phone) | ||
| 212 | + console.log('用户在商家没有账号'); | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + }) | ||
| 216 | + }, | ||
| 217 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 218 | + createInfoFun(phone) { | ||
| 219 | + let params = { | ||
| 220 | + openid: getApp().openid, | ||
| 221 | + sellerid: this.data.seller.sid, | ||
| 222 | + phone | ||
| 223 | + } | ||
| 224 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 225 | + if (res.ret == 200) { | ||
| 226 | + console.log('新增用户在商家的账户信息----', res); | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + }, | ||
| 182 | // 赴约手机号传参 | 230 | // 赴约手机号传参 |
| 183 | confirmed() { | 231 | confirmed() { |
| 184 | let userinfo = JSON.stringify({ | 232 | let userinfo = JSON.stringify({ |
| @@ -151,7 +151,7 @@ | @@ -151,7 +151,7 @@ | ||
| 151 | <!-- 充值 --> | 151 | <!-- 充值 --> |
| 152 | <view class="publicModule preferentialCoupon" wx:if="{{(hasValueRecharge && marketing.is_recharge=='1' && recharge_data) || (hasValueRecharge && marketing.is_link=='1')}}"> | 152 | <view class="publicModule preferentialCoupon" wx:if="{{(hasValueRecharge && marketing.is_recharge=='1' && recharge_data) || (hasValueRecharge && marketing.is_link=='1')}}"> |
| 153 | <image class="titleImg6" src="https://qn.colorcun.com/invitation10Title2.png" mode="" /> | 153 | <image class="titleImg6" src="https://qn.colorcun.com/invitation10Title2.png" mode="" /> |
| 154 | - <navigator wx:if="{{hasValueRecharge && marketing.is_recharge=='1' && recharge_data && recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 154 | + <navigator wx:if="{{hasValueRecharge && purePhoneNumber && marketing.is_recharge=='1' && recharge_data && recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 155 | <view class="rechargeItems"> | 155 | <view class="rechargeItems"> |
| 156 | <view class="rechargeTitle font36r">{{recharge_data.rname}}</view> | 156 | <view class="rechargeTitle font36r">{{recharge_data.rname}}</view> |
| 157 | <view class="limitation font24r" wx:if="{{priceInfo}}"> | 157 | <view class="limitation font24r" wx:if="{{priceInfo}}"> |
| @@ -168,6 +168,23 @@ | @@ -168,6 +168,23 @@ | ||
| 168 | <view class="font28r">立即充值</view> | 168 | <view class="font28r">立即充值</view> |
| 169 | </view> | 169 | </view> |
| 170 | </navigator> | 170 | </navigator> |
| 171 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{hasValueRecharge && !purePhoneNumber && marketing.is_recharge=='1' && recharge_data && recharge_data.id}}"> | ||
| 172 | + <view class="rechargeItems"> | ||
| 173 | + <view class="rechargeTitle font36r">{{recharge_data.rname}}</view> | ||
| 174 | + <view class="limitation font24r" wx:if="{{priceInfo}}"> | ||
| 175 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 176 | + </view> | ||
| 177 | + <view class="limitation font24r" wx:if="{{scoreInfo}}"> | ||
| 178 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 179 | + </view> | ||
| 180 | + <view class="limitation font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 181 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 182 | + </view> | ||
| 183 | + </view> | ||
| 184 | + <view class="rechargeBtn"> | ||
| 185 | + <view class="font28r">立即充值</view> | ||
| 186 | + </view> | ||
| 187 | + </button> | ||
| 171 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 188 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| 172 | 了解更多会员优惠政策 | 189 | 了解更多会员优惠政策 |
| 173 | </view> | 190 | </view> |
| @@ -1158,4 +1158,15 @@ | @@ -1158,4 +1158,15 @@ | ||
| 1158 | -webkit-box-orient: vertical; | 1158 | -webkit-box-orient: vertical; |
| 1159 | -webkit-line-clamp: 1; | 1159 | -webkit-line-clamp: 1; |
| 1160 | font-weight: 400; | 1160 | font-weight: 400; |
| 1161 | +} | ||
| 1162 | + | ||
| 1163 | +.getPhoneStyle { | ||
| 1164 | + width: 100%; | ||
| 1165 | + padding: 0; | ||
| 1166 | + margin: 0; | ||
| 1167 | + line-height: inherit; | ||
| 1168 | + text-align: left; | ||
| 1169 | +} | ||
| 1170 | +.getPhoneStyle .rechargeItems { | ||
| 1171 | + margin: 0; | ||
| 1161 | } | 1172 | } |
| @@ -129,6 +129,7 @@ Page({ | @@ -129,6 +129,7 @@ Page({ | ||
| 129 | }, | 129 | }, |
| 130 | // 跳转登录页 | 130 | // 跳转登录页 |
| 131 | gotoLogin(event, type) { | 131 | gotoLogin(event, type) { |
| 132 | + console.log(111); | ||
| 132 | const types = type ? type : event.currentTarget.dataset.types; | 133 | const types = type ? type : event.currentTarget.dataset.types; |
| 133 | let params = { | 134 | let params = { |
| 134 | types, //1邀请函领券 2赴约 | 135 | types, //1邀请函领券 2赴约 |
| @@ -188,6 +189,54 @@ Page({ | @@ -188,6 +189,54 @@ Page({ | ||
| 188 | } | 189 | } |
| 189 | }) | 190 | }) |
| 190 | }, | 191 | }, |
| 192 | + // 获取code、手机号 | ||
| 193 | + getPhoneNumberFun(e) { | ||
| 194 | + console.log('获取code', e.detail); | ||
| 195 | + if (e.detail && e.detail.code) { | ||
| 196 | + App.Wechat.GetUserPhoneNumber({ | ||
| 197 | + code: e.detail.code, | ||
| 198 | + }).then(res => { | ||
| 199 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 200 | + this.setData({ | ||
| 201 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 202 | + }) | ||
| 203 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 204 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 205 | + } else { | ||
| 206 | + util.toast('手机号获取失败!', 'none') | ||
| 207 | + } | ||
| 208 | + }) | ||
| 209 | + } | ||
| 210 | + }, | ||
| 211 | + // 获取用户在商家的账户余额 | ||
| 212 | + getUserRechargeInfo(phone) { | ||
| 213 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 214 | + openid: getApp().openid, | ||
| 215 | + phone, | ||
| 216 | + sellerid: this.data.seller.sid, | ||
| 217 | + }).then((json) => { | ||
| 218 | + if (json.ret == 200) { | ||
| 219 | + let data = json.data; | ||
| 220 | + if (!data) { | ||
| 221 | + this.createInfoFun(phone) | ||
| 222 | + console.log('用户在商家没有账号'); | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + }) | ||
| 226 | + }, | ||
| 227 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 228 | + createInfoFun(phone) { | ||
| 229 | + let params = { | ||
| 230 | + openid: getApp().openid, | ||
| 231 | + sellerid: this.data.seller.sid, | ||
| 232 | + phone | ||
| 233 | + } | ||
| 234 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 235 | + if (res.ret == 200) { | ||
| 236 | + console.log('新增用户在商家的账户信息----', res); | ||
| 237 | + } | ||
| 238 | + }) | ||
| 239 | + }, | ||
| 191 | // 赴约手机号传参 | 240 | // 赴约手机号传参 |
| 192 | confirmed() { | 241 | confirmed() { |
| 193 | let userinfo = JSON.stringify({ | 242 | let userinfo = JSON.stringify({ |
| @@ -307,9 +307,12 @@ | @@ -307,9 +307,12 @@ | ||
| 307 | </view> | 307 | </view> |
| 308 | <view class="rechargeBtn"> | 308 | <view class="rechargeBtn"> |
| 309 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" bindtap="gotoFavourableList" class="font32r favouredPolicy">更多优惠</view> | 309 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" bindtap="gotoFavourableList" class="font32r favouredPolicy">更多优惠</view> |
| 310 | - <navigator wx:if="{{activeData.id}}" url="/pack-activity/pack/vipRecharge?id={{activeData.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 310 | + <navigator wx:if="{{activeData.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{activeData.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 311 | 立即充值 | 311 | 立即充值 |
| 312 | </navigator> | 312 | </navigator> |
| 313 | + <button wx:if="{{activeData.id && !purePhoneNumber}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun"> | ||
| 314 | + 立即充值 | ||
| 315 | + </button> | ||
| 313 | </view> | 316 | </view> |
| 314 | </view> | 317 | </view> |
| 315 | <!-- 评价券 --> | 318 | <!-- 评价券 --> |
| @@ -486,7 +486,7 @@ | @@ -486,7 +486,7 @@ | ||
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | .preferentialCoupon .orderingFood { | 488 | .preferentialCoupon .orderingFood { |
| 489 | - padding: 0 44rpx; | 489 | + padding: 0 20rpx; |
| 490 | color: #fff; | 490 | color: #fff; |
| 491 | border: none; | 491 | border: none; |
| 492 | text-align: center; | 492 | text-align: center; |
| @@ -495,7 +495,7 @@ | @@ -495,7 +495,7 @@ | ||
| 495 | height: 44rpx; | 495 | height: 44rpx; |
| 496 | width: max-content; | 496 | width: max-content; |
| 497 | flex-shrink: 0; | 497 | flex-shrink: 0; |
| 498 | - background: #ae2d2d; | 498 | + background: linear-gradient(93.85deg, #f41919 3.82%, #ff7426 117.14%) !important; |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | .preferentialCoupon .icons { | 501 | .preferentialCoupon .icons { |
| @@ -604,7 +604,8 @@ | @@ -604,7 +604,8 @@ | ||
| 604 | justify-content: space-between; | 604 | justify-content: space-between; |
| 605 | } | 605 | } |
| 606 | 606 | ||
| 607 | -.rechargeBtn navigator { | 607 | +.rechargeBtn navigator, |
| 608 | +.rechargeBtn button { | ||
| 608 | width: 63%; | 609 | width: 63%; |
| 609 | padding: 12rpx 0; | 610 | padding: 12rpx 0; |
| 610 | background: #AE2D2D; | 611 | background: #AE2D2D; |
| @@ -615,6 +616,12 @@ | @@ -615,6 +616,12 @@ | ||
| 615 | font-weight: 600; | 616 | font-weight: 600; |
| 616 | } | 617 | } |
| 617 | 618 | ||
| 619 | +.rechargeBtn button { | ||
| 620 | + padding: 0; | ||
| 621 | + height: 64rpx; | ||
| 622 | + line-height: 64rpx; | ||
| 623 | +} | ||
| 624 | + | ||
| 618 | .bottomLimitationTop{ | 625 | .bottomLimitationTop{ |
| 619 | margin-top: 20rpx !important; | 626 | margin-top: 20rpx !important; |
| 620 | } | 627 | } |
| @@ -1218,6 +1225,15 @@ | @@ -1218,6 +1225,15 @@ | ||
| 1218 | color: #AE2D2D; | 1225 | color: #AE2D2D; |
| 1219 | } | 1226 | } |
| 1220 | 1227 | ||
| 1228 | +.getPhoneStyle { | ||
| 1229 | + padding: 0; | ||
| 1230 | + margin: 0; | ||
| 1231 | + line-height: inherit; | ||
| 1232 | +} | ||
| 1233 | +.getPhoneStyle .rechargeItems { | ||
| 1234 | + margin: 0; | ||
| 1235 | +} | ||
| 1236 | + | ||
| 1221 | /* 商务宴会 */ | 1237 | /* 商务宴会 */ |
| 1222 | .viewBox2 { | 1238 | .viewBox2 { |
| 1223 | background: #fff; | 1239 | background: #fff; |
| @@ -1381,7 +1397,8 @@ | @@ -1381,7 +1397,8 @@ | ||
| 1381 | color: #000; | 1397 | color: #000; |
| 1382 | } | 1398 | } |
| 1383 | 1399 | ||
| 1384 | -.viewBox2 .rechargeBtn navigator { | 1400 | +.viewBox2 .rechargeBtn navigator, |
| 1401 | +.viewBox2 .rechargeBtn button { | ||
| 1385 | background: #E8CEA8; | 1402 | background: #E8CEA8; |
| 1386 | color: #000; | 1403 | color: #000; |
| 1387 | } | 1404 | } |
| @@ -192,6 +192,54 @@ Page({ | @@ -192,6 +192,54 @@ Page({ | ||
| 192 | } | 192 | } |
| 193 | }) | 193 | }) |
| 194 | }, | 194 | }, |
| 195 | + // 获取code、手机号 | ||
| 196 | + getPhoneNumberFun(e) { | ||
| 197 | + console.log('获取code', e.detail); | ||
| 198 | + if (e.detail && e.detail.code) { | ||
| 199 | + App.Wechat.GetUserPhoneNumber({ | ||
| 200 | + code: e.detail.code, | ||
| 201 | + }).then(res => { | ||
| 202 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 203 | + this.setData({ | ||
| 204 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 205 | + }) | ||
| 206 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 207 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 208 | + } else { | ||
| 209 | + util.toast('手机号获取失败!', 'none') | ||
| 210 | + } | ||
| 211 | + }) | ||
| 212 | + } | ||
| 213 | + }, | ||
| 214 | + // 获取用户在商家的账户余额 | ||
| 215 | + getUserRechargeInfo(phone) { | ||
| 216 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 217 | + openid: getApp().openid, | ||
| 218 | + phone, | ||
| 219 | + sellerid: this.data.seller.sid, | ||
| 220 | + }).then((json) => { | ||
| 221 | + if (json.ret == 200) { | ||
| 222 | + let data = json.data; | ||
| 223 | + if (!data) { | ||
| 224 | + this.createInfoFun(phone) | ||
| 225 | + console.log('用户在商家没有账号'); | ||
| 226 | + } | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + }, | ||
| 230 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 231 | + createInfoFun(phone) { | ||
| 232 | + let params = { | ||
| 233 | + openid: getApp().openid, | ||
| 234 | + sellerid: this.data.seller.sid, | ||
| 235 | + phone | ||
| 236 | + } | ||
| 237 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 238 | + if (res.ret == 200) { | ||
| 239 | + console.log('新增用户在商家的账户信息----', res); | ||
| 240 | + } | ||
| 241 | + }) | ||
| 242 | + }, | ||
| 195 | // 赴约手机号传参 | 243 | // 赴约手机号传参 |
| 196 | confirmed() { | 244 | confirmed() { |
| 197 | let userinfo = JSON.stringify({ | 245 | let userinfo = JSON.stringify({ |
| @@ -293,9 +293,12 @@ | @@ -293,9 +293,12 @@ | ||
| 293 | </view> | 293 | </view> |
| 294 | </block> | 294 | </block> |
| 295 | <view class="rechargeBtn"> | 295 | <view class="rechargeBtn"> |
| 296 | - <navigator wx:if="{{activeData.id}}" url="/pack-activity/pack/vipRecharge?id={{activeData.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 296 | + <navigator wx:if="{{activeData.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{activeData.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 297 | 立即充值 | 297 | 立即充值 |
| 298 | </navigator> | 298 | </navigator> |
| 299 | + <button wx:if="{{activeData.id && !purePhoneNumber}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun"> | ||
| 300 | + 立即充值 | ||
| 301 | + </button> | ||
| 299 | </view> | 302 | </view> |
| 300 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 303 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| 301 | 点击了解更多会员优惠政策 | 304 | 点击了解更多会员优惠政策 |
| @@ -368,7 +368,8 @@ | @@ -368,7 +368,8 @@ | ||
| 368 | justify-content: space-between; | 368 | justify-content: space-between; |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | -.rechargeBtn navigator { | 371 | +.rechargeBtn navigator, |
| 372 | +.rechargeBtn button { | ||
| 372 | width: 84%; | 373 | width: 84%; |
| 373 | padding: 12rpx 0; | 374 | padding: 12rpx 0; |
| 374 | background: #D2541C; | 375 | background: #D2541C; |
| @@ -379,6 +380,12 @@ | @@ -379,6 +380,12 @@ | ||
| 379 | font-weight: 600; | 380 | font-weight: 600; |
| 380 | } | 381 | } |
| 381 | 382 | ||
| 383 | +.rechargeBtn button { | ||
| 384 | + padding: 0; | ||
| 385 | + height: 64rpx; | ||
| 386 | + line-height: 64rpx; | ||
| 387 | +} | ||
| 388 | + | ||
| 382 | .bottomLimitationTop{ | 389 | .bottomLimitationTop{ |
| 383 | margin-top: 20rpx !important; | 390 | margin-top: 20rpx !important; |
| 384 | } | 391 | } |
| @@ -1279,6 +1286,15 @@ | @@ -1279,6 +1286,15 @@ | ||
| 1279 | color: #D2541C; | 1286 | color: #D2541C; |
| 1280 | } | 1287 | } |
| 1281 | 1288 | ||
| 1289 | +.getPhoneStyle { | ||
| 1290 | + padding: 0; | ||
| 1291 | + margin: 0; | ||
| 1292 | + line-height: inherit; | ||
| 1293 | +} | ||
| 1294 | +.getPhoneStyle .rechargeItems { | ||
| 1295 | + margin: 0; | ||
| 1296 | +} | ||
| 1297 | + | ||
| 1282 | /* 商务宴会 */ | 1298 | /* 商务宴会 */ |
| 1283 | .viewBox2 { | 1299 | .viewBox2 { |
| 1284 | background: #fffef8; | 1300 | background: #fffef8; |
| @@ -1435,7 +1451,8 @@ | @@ -1435,7 +1451,8 @@ | ||
| 1435 | } | 1451 | } |
| 1436 | 1452 | ||
| 1437 | .publicModalBox2 .orderingFood, | 1453 | .publicModalBox2 .orderingFood, |
| 1438 | -.publicModalBox2 .rechargeBtn navigator { | 1454 | +.publicModalBox2 .rechargeBtn navigator, |
| 1455 | +.publicModalBox2 .rechargeBtn button { | ||
| 1439 | background: #854F1E; | 1456 | background: #854F1E; |
| 1440 | color: #fff; | 1457 | color: #fff; |
| 1441 | } | 1458 | } |
| @@ -184,6 +184,102 @@ Page({ | @@ -184,6 +184,102 @@ Page({ | ||
| 184 | } | 184 | } |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | + // 获取code、手机号 | ||
| 188 | + getPhoneNumberFun(e) { | ||
| 189 | + console.log('获取code', e.detail); | ||
| 190 | + if (e.detail && e.detail.code) { | ||
| 191 | + App.Wechat.GetUserPhoneNumber({ | ||
| 192 | + code: e.detail.code, | ||
| 193 | + }).then(res => { | ||
| 194 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 195 | + this.setData({ | ||
| 196 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 197 | + }) | ||
| 198 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 199 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 200 | + } else { | ||
| 201 | + util.toast('手机号获取失败!', 'none') | ||
| 202 | + } | ||
| 203 | + }) | ||
| 204 | + } | ||
| 205 | + }, | ||
| 206 | + // 获取用户在商家的账户余额 | ||
| 207 | + getUserRechargeInfo(phone) { | ||
| 208 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 209 | + openid: getApp().openid, | ||
| 210 | + phone, | ||
| 211 | + sellerid: this.data.seller.sid, | ||
| 212 | + }).then((json) => { | ||
| 213 | + if (json.ret == 200) { | ||
| 214 | + let data = json.data; | ||
| 215 | + if (!data) { | ||
| 216 | + this.createInfoFun(phone) | ||
| 217 | + console.log('用户在商家没有账号'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 222 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 223 | + createInfoFun(phone) { | ||
| 224 | + let params = { | ||
| 225 | + openid: getApp().openid, | ||
| 226 | + sellerid: this.data.seller.sid, | ||
| 227 | + phone | ||
| 228 | + } | ||
| 229 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 230 | + if (res.ret == 200) { | ||
| 231 | + console.log('新增用户在商家的账户信息----', res); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }, | ||
| 235 | + // 获取code、手机号 | ||
| 236 | + getPhoneNumberFun(e) { | ||
| 237 | + console.log('获取code', e.detail); | ||
| 238 | + if (e.detail && e.detail.code) { | ||
| 239 | + App.Wechat.GetUserPhoneNumber({ | ||
| 240 | + code: e.detail.code, | ||
| 241 | + }).then(res => { | ||
| 242 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 243 | + this.setData({ | ||
| 244 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 245 | + }) | ||
| 246 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 247 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 248 | + } else { | ||
| 249 | + util.toast('手机号获取失败!', 'none') | ||
| 250 | + } | ||
| 251 | + }) | ||
| 252 | + } | ||
| 253 | + }, | ||
| 254 | + // 获取用户在商家的账户余额 | ||
| 255 | + getUserRechargeInfo(phone) { | ||
| 256 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 257 | + openid: getApp().openid, | ||
| 258 | + phone, | ||
| 259 | + sellerid: this.data.seller.sid, | ||
| 260 | + }).then((json) => { | ||
| 261 | + if (json.ret == 200) { | ||
| 262 | + let data = json.data; | ||
| 263 | + if (!data) { | ||
| 264 | + this.createInfoFun(phone) | ||
| 265 | + console.log('用户在商家没有账号'); | ||
| 266 | + } | ||
| 267 | + } | ||
| 268 | + }) | ||
| 269 | + }, | ||
| 270 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 271 | + createInfoFun(phone) { | ||
| 272 | + let params = { | ||
| 273 | + openid: getApp().openid, | ||
| 274 | + sellerid: this.data.seller.sid, | ||
| 275 | + phone | ||
| 276 | + } | ||
| 277 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 278 | + if (res.ret == 200) { | ||
| 279 | + console.log('新增用户在商家的账户信息----', res); | ||
| 280 | + } | ||
| 281 | + }) | ||
| 282 | + }, | ||
| 187 | // 赴约手机号传参 | 283 | // 赴约手机号传参 |
| 188 | confirmed() { | 284 | confirmed() { |
| 189 | let userinfo = JSON.stringify({ | 285 | let userinfo = JSON.stringify({ |
| @@ -310,7 +310,7 @@ | @@ -310,7 +310,7 @@ | ||
| 310 | <view wx:if="{{titleType}}" class="chefText font36r"> | 310 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 311 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 311 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 312 | </view> | 312 | </view> |
| 313 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 313 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 314 | <view class="preferentialItems rechargeItems"> | 314 | <view class="preferentialItems rechargeItems"> |
| 315 | <view class="itemLeft"> | 315 | <view class="itemLeft"> |
| 316 | <view class="itemTop font36r"> | 316 | <view class="itemTop font36r"> |
| @@ -331,6 +331,27 @@ | @@ -331,6 +331,27 @@ | ||
| 331 | </view> | 331 | </view> |
| 332 | </view> | 332 | </view> |
| 333 | </navigator> | 333 | </navigator> |
| 334 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 335 | + <view class="preferentialItems rechargeItems"> | ||
| 336 | + <view class="itemLeft"> | ||
| 337 | + <view class="itemTop font36r"> | ||
| 338 | + {{recharge_data.rname}} | ||
| 339 | + </view> | ||
| 340 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 341 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 342 | + </view> | ||
| 343 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 344 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 345 | + </view> | ||
| 346 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 347 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 348 | + </view> | ||
| 349 | + </view> | ||
| 350 | + <view class="font24r orderingFood"> | ||
| 351 | + 抢购 | ||
| 352 | + </view> | ||
| 353 | + </view> | ||
| 354 | + </button> | ||
| 334 | </block> | 355 | </block> |
| 335 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 356 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 336 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 357 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1118,6 +1118,15 @@ | @@ -1118,6 +1118,15 @@ | ||
| 1118 | color: #FFEFC5; | 1118 | color: #FFEFC5; |
| 1119 | } | 1119 | } |
| 1120 | 1120 | ||
| 1121 | +.getPhoneStyle { | ||
| 1122 | + padding: 0; | ||
| 1123 | + margin: 0; | ||
| 1124 | + line-height: inherit; | ||
| 1125 | +} | ||
| 1126 | +.getPhoneStyle .rechargeItems { | ||
| 1127 | + margin: 0; | ||
| 1128 | +} | ||
| 1129 | + | ||
| 1121 | /* 深中国红 */ | 1130 | /* 深中国红 */ |
| 1122 | .crimson, | 1131 | .crimson, |
| 1123 | .crimson .positioningBox { | 1132 | .crimson .positioningBox { |
| @@ -184,6 +184,54 @@ Page({ | @@ -184,6 +184,54 @@ Page({ | ||
| 184 | } | 184 | } |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | + // 获取code、手机号 | ||
| 188 | + getPhoneNumberFun(e) { | ||
| 189 | + console.log('获取code', e.detail); | ||
| 190 | + if (e.detail && e.detail.code) { | ||
| 191 | + App.Wechat.GetUserPhoneNumber({ | ||
| 192 | + code: e.detail.code, | ||
| 193 | + }).then(res => { | ||
| 194 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 195 | + this.setData({ | ||
| 196 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 197 | + }) | ||
| 198 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 199 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 200 | + } else { | ||
| 201 | + util.toast('手机号获取失败!', 'none') | ||
| 202 | + } | ||
| 203 | + }) | ||
| 204 | + } | ||
| 205 | + }, | ||
| 206 | + // 获取用户在商家的账户余额 | ||
| 207 | + getUserRechargeInfo(phone) { | ||
| 208 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 209 | + openid: getApp().openid, | ||
| 210 | + phone, | ||
| 211 | + sellerid: this.data.seller.sid, | ||
| 212 | + }).then((json) => { | ||
| 213 | + if (json.ret == 200) { | ||
| 214 | + let data = json.data; | ||
| 215 | + if (!data) { | ||
| 216 | + this.createInfoFun(phone) | ||
| 217 | + console.log('用户在商家没有账号'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 222 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 223 | + createInfoFun(phone) { | ||
| 224 | + let params = { | ||
| 225 | + openid: getApp().openid, | ||
| 226 | + sellerid: this.data.seller.sid, | ||
| 227 | + phone | ||
| 228 | + } | ||
| 229 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 230 | + if (res.ret == 200) { | ||
| 231 | + console.log('新增用户在商家的账户信息----', res); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }, | ||
| 187 | // 赴约手机号传参 | 235 | // 赴约手机号传参 |
| 188 | confirmed() { | 236 | confirmed() { |
| 189 | let userinfo = JSON.stringify({ | 237 | let userinfo = JSON.stringify({ |
| @@ -315,7 +315,7 @@ | @@ -315,7 +315,7 @@ | ||
| 315 | <view wx:if="{{titleType}}" class="chefText font36r"> | 315 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 316 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 316 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 317 | </view> | 317 | </view> |
| 318 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 318 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 319 | <view class="preferentialItems rechargeItems"> | 319 | <view class="preferentialItems rechargeItems"> |
| 320 | <view class="itemLeft"> | 320 | <view class="itemLeft"> |
| 321 | <view class="itemTop font36r"> | 321 | <view class="itemTop font36r"> |
| @@ -336,6 +336,27 @@ | @@ -336,6 +336,27 @@ | ||
| 336 | </view> | 336 | </view> |
| 337 | </view> | 337 | </view> |
| 338 | </navigator> | 338 | </navigator> |
| 339 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 340 | + <view class="preferentialItems rechargeItems"> | ||
| 341 | + <view class="itemLeft"> | ||
| 342 | + <view class="itemTop font36r"> | ||
| 343 | + {{recharge_data.rname}} | ||
| 344 | + </view> | ||
| 345 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 346 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 347 | + </view> | ||
| 348 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 349 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 350 | + </view> | ||
| 351 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 352 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 353 | + </view> | ||
| 354 | + </view> | ||
| 355 | + <view class="font24r orderingFood"> | ||
| 356 | + 抢购 | ||
| 357 | + </view> | ||
| 358 | + </view> | ||
| 359 | + </button> | ||
| 339 | </block> | 360 | </block> |
| 340 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 361 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 341 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 362 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1151,6 +1151,15 @@ | @@ -1151,6 +1151,15 @@ | ||
| 1151 | color: #FFEFC5; | 1151 | color: #FFEFC5; |
| 1152 | } | 1152 | } |
| 1153 | 1153 | ||
| 1154 | +.getPhoneStyle { | ||
| 1155 | + padding: 0; | ||
| 1156 | + margin: 0; | ||
| 1157 | + line-height: inherit; | ||
| 1158 | +} | ||
| 1159 | +.getPhoneStyle .rechargeItems { | ||
| 1160 | + margin: 0; | ||
| 1161 | +} | ||
| 1162 | + | ||
| 1154 | /* 深中国红 */ | 1163 | /* 深中国红 */ |
| 1155 | .crimson, | 1164 | .crimson, |
| 1156 | .crimson .positioningBox { | 1165 | .crimson .positioningBox { |
| @@ -184,6 +184,54 @@ Page({ | @@ -184,6 +184,54 @@ Page({ | ||
| 184 | } | 184 | } |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | + // 获取code、手机号 | ||
| 188 | + getPhoneNumberFun(e) { | ||
| 189 | + console.log('获取code', e.detail); | ||
| 190 | + if (e.detail && e.detail.code) { | ||
| 191 | + App.Wechat.GetUserPhoneNumber({ | ||
| 192 | + code: e.detail.code, | ||
| 193 | + }).then(res => { | ||
| 194 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 195 | + this.setData({ | ||
| 196 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 197 | + }) | ||
| 198 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 199 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 200 | + } else { | ||
| 201 | + util.toast('手机号获取失败!', 'none') | ||
| 202 | + } | ||
| 203 | + }) | ||
| 204 | + } | ||
| 205 | + }, | ||
| 206 | + // 获取用户在商家的账户余额 | ||
| 207 | + getUserRechargeInfo(phone) { | ||
| 208 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 209 | + openid: getApp().openid, | ||
| 210 | + phone, | ||
| 211 | + sellerid: this.data.seller.sid, | ||
| 212 | + }).then((json) => { | ||
| 213 | + if (json.ret == 200) { | ||
| 214 | + let data = json.data; | ||
| 215 | + if (!data) { | ||
| 216 | + this.createInfoFun(phone) | ||
| 217 | + console.log('用户在商家没有账号'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 222 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 223 | + createInfoFun(phone) { | ||
| 224 | + let params = { | ||
| 225 | + openid: getApp().openid, | ||
| 226 | + sellerid: this.data.seller.sid, | ||
| 227 | + phone | ||
| 228 | + } | ||
| 229 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 230 | + if (res.ret == 200) { | ||
| 231 | + console.log('新增用户在商家的账户信息----', res); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }, | ||
| 187 | // 赴约手机号传参 | 235 | // 赴约手机号传参 |
| 188 | confirmed() { | 236 | confirmed() { |
| 189 | let userinfo = JSON.stringify({ | 237 | let userinfo = JSON.stringify({ |
| @@ -298,7 +298,7 @@ | @@ -298,7 +298,7 @@ | ||
| 298 | <view wx:if="{{titleType}}" class="chefText font36r"> | 298 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 299 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 299 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 300 | </view> | 300 | </view> |
| 301 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 301 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 302 | <view class="preferentialItems rechargeItems"> | 302 | <view class="preferentialItems rechargeItems"> |
| 303 | <view class="itemLeft"> | 303 | <view class="itemLeft"> |
| 304 | <view class="itemTop font36r"> | 304 | <view class="itemTop font36r"> |
| @@ -319,6 +319,27 @@ | @@ -319,6 +319,27 @@ | ||
| 319 | </view> | 319 | </view> |
| 320 | </view> | 320 | </view> |
| 321 | </navigator> | 321 | </navigator> |
| 322 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 323 | + <view class="preferentialItems rechargeItems"> | ||
| 324 | + <view class="itemLeft"> | ||
| 325 | + <view class="itemTop font36r"> | ||
| 326 | + {{recharge_data.rname}} | ||
| 327 | + </view> | ||
| 328 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 329 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 330 | + </view> | ||
| 331 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 332 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 333 | + </view> | ||
| 334 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 335 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 336 | + </view> | ||
| 337 | + </view> | ||
| 338 | + <view class="font24r orderingFood"> | ||
| 339 | + 抢购 | ||
| 340 | + </view> | ||
| 341 | + </view> | ||
| 342 | + </button> | ||
| 322 | </block> | 343 | </block> |
| 323 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 344 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 324 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 345 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1136,6 +1136,15 @@ | @@ -1136,6 +1136,15 @@ | ||
| 1136 | color: #FFEFC5; | 1136 | color: #FFEFC5; |
| 1137 | } | 1137 | } |
| 1138 | 1138 | ||
| 1139 | +.getPhoneStyle { | ||
| 1140 | + padding: 0; | ||
| 1141 | + margin: 0; | ||
| 1142 | + line-height: inherit; | ||
| 1143 | +} | ||
| 1144 | +.getPhoneStyle .rechargeItems { | ||
| 1145 | + margin: 0; | ||
| 1146 | +} | ||
| 1147 | + | ||
| 1139 | /* 深中国红 */ | 1148 | /* 深中国红 */ |
| 1140 | .crimson, | 1149 | .crimson, |
| 1141 | .crimson .positioningBox { | 1150 | .crimson .positioningBox { |
| @@ -183,6 +183,54 @@ Page({ | @@ -183,6 +183,54 @@ Page({ | ||
| 183 | } | 183 | } |
| 184 | }) | 184 | }) |
| 185 | }, | 185 | }, |
| 186 | + // 获取code、手机号 | ||
| 187 | + getPhoneNumberFun(e) { | ||
| 188 | + console.log('获取code', e.detail); | ||
| 189 | + if (e.detail && e.detail.code) { | ||
| 190 | + App.Wechat.GetUserPhoneNumber({ | ||
| 191 | + code: e.detail.code, | ||
| 192 | + }).then(res => { | ||
| 193 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 194 | + this.setData({ | ||
| 195 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 196 | + }) | ||
| 197 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 198 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 199 | + } else { | ||
| 200 | + util.toast('手机号获取失败!', 'none') | ||
| 201 | + } | ||
| 202 | + }) | ||
| 203 | + } | ||
| 204 | + }, | ||
| 205 | + // 获取用户在商家的账户余额 | ||
| 206 | + getUserRechargeInfo(phone) { | ||
| 207 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 208 | + openid: getApp().openid, | ||
| 209 | + phone, | ||
| 210 | + sellerid: this.data.seller.sid, | ||
| 211 | + }).then((json) => { | ||
| 212 | + if (json.ret == 200) { | ||
| 213 | + let data = json.data; | ||
| 214 | + if (!data) { | ||
| 215 | + this.createInfoFun(phone) | ||
| 216 | + console.log('用户在商家没有账号'); | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + }) | ||
| 220 | + }, | ||
| 221 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 222 | + createInfoFun(phone) { | ||
| 223 | + let params = { | ||
| 224 | + openid: getApp().openid, | ||
| 225 | + sellerid: this.data.seller.sid, | ||
| 226 | + phone | ||
| 227 | + } | ||
| 228 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 229 | + if (res.ret == 200) { | ||
| 230 | + console.log('新增用户在商家的账户信息----', res); | ||
| 231 | + } | ||
| 232 | + }) | ||
| 233 | + }, | ||
| 186 | // 赴约手机号传参 | 234 | // 赴约手机号传参 |
| 187 | confirmed() { | 235 | confirmed() { |
| 188 | let userinfo = JSON.stringify({ | 236 | let userinfo = JSON.stringify({ |
| @@ -297,7 +297,7 @@ | @@ -297,7 +297,7 @@ | ||
| 297 | <view wx:if="{{titleType}}" class="chefText font36r"> | 297 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 298 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 298 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 299 | </view> | 299 | </view> |
| 300 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 300 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 301 | <view class="preferentialItems rechargeItems"> | 301 | <view class="preferentialItems rechargeItems"> |
| 302 | <view class="itemLeft"> | 302 | <view class="itemLeft"> |
| 303 | <view class="itemTop font36r"> | 303 | <view class="itemTop font36r"> |
| @@ -318,6 +318,27 @@ | @@ -318,6 +318,27 @@ | ||
| 318 | </view> | 318 | </view> |
| 319 | </view> | 319 | </view> |
| 320 | </navigator> | 320 | </navigator> |
| 321 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 322 | + <view class="preferentialItems rechargeItems"> | ||
| 323 | + <view class="itemLeft"> | ||
| 324 | + <view class="itemTop font36r"> | ||
| 325 | + {{recharge_data.rname}} | ||
| 326 | + </view> | ||
| 327 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 328 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 329 | + </view> | ||
| 330 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 331 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 332 | + </view> | ||
| 333 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 334 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 335 | + </view> | ||
| 336 | + </view> | ||
| 337 | + <view class="font24r orderingFood"> | ||
| 338 | + 抢购 | ||
| 339 | + </view> | ||
| 340 | + </view> | ||
| 341 | + </button> | ||
| 321 | </block> | 342 | </block> |
| 322 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 343 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 323 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 344 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1135,6 +1135,15 @@ | @@ -1135,6 +1135,15 @@ | ||
| 1135 | color: #FFEFC5; | 1135 | color: #FFEFC5; |
| 1136 | } | 1136 | } |
| 1137 | 1137 | ||
| 1138 | +.getPhoneStyle { | ||
| 1139 | + padding: 0; | ||
| 1140 | + margin: 0; | ||
| 1141 | + line-height: inherit; | ||
| 1142 | +} | ||
| 1143 | +.getPhoneStyle .rechargeItems { | ||
| 1144 | + margin: 0; | ||
| 1145 | +} | ||
| 1146 | + | ||
| 1138 | /* 深中国红 */ | 1147 | /* 深中国红 */ |
| 1139 | .crimson, | 1148 | .crimson, |
| 1140 | .crimson .positioningBox { | 1149 | .crimson .positioningBox { |
| @@ -183,6 +183,54 @@ Page({ | @@ -183,6 +183,54 @@ Page({ | ||
| 183 | } | 183 | } |
| 184 | }) | 184 | }) |
| 185 | }, | 185 | }, |
| 186 | + // 获取code、手机号 | ||
| 187 | + getPhoneNumberFun(e) { | ||
| 188 | + console.log('获取code', e.detail); | ||
| 189 | + if (e.detail && e.detail.code) { | ||
| 190 | + App.Wechat.GetUserPhoneNumber({ | ||
| 191 | + code: e.detail.code, | ||
| 192 | + }).then(res => { | ||
| 193 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 194 | + this.setData({ | ||
| 195 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 196 | + }) | ||
| 197 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 198 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 199 | + } else { | ||
| 200 | + util.toast('手机号获取失败!', 'none') | ||
| 201 | + } | ||
| 202 | + }) | ||
| 203 | + } | ||
| 204 | + }, | ||
| 205 | + // 获取用户在商家的账户余额 | ||
| 206 | + getUserRechargeInfo(phone) { | ||
| 207 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 208 | + openid: getApp().openid, | ||
| 209 | + phone, | ||
| 210 | + sellerid: this.data.seller.sid, | ||
| 211 | + }).then((json) => { | ||
| 212 | + if (json.ret == 200) { | ||
| 213 | + let data = json.data; | ||
| 214 | + if (!data) { | ||
| 215 | + this.createInfoFun(phone) | ||
| 216 | + console.log('用户在商家没有账号'); | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + }) | ||
| 220 | + }, | ||
| 221 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 222 | + createInfoFun(phone) { | ||
| 223 | + let params = { | ||
| 224 | + openid: getApp().openid, | ||
| 225 | + sellerid: this.data.seller.sid, | ||
| 226 | + phone | ||
| 227 | + } | ||
| 228 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 229 | + if (res.ret == 200) { | ||
| 230 | + console.log('新增用户在商家的账户信息----', res); | ||
| 231 | + } | ||
| 232 | + }) | ||
| 233 | + }, | ||
| 186 | // 赴约手机号传参 | 234 | // 赴约手机号传参 |
| 187 | confirmed() { | 235 | confirmed() { |
| 188 | let userinfo = JSON.stringify({ | 236 | let userinfo = JSON.stringify({ |
| @@ -283,7 +283,7 @@ | @@ -283,7 +283,7 @@ | ||
| 283 | <view class="rubric rubric1"> | 283 | <view class="rubric rubric1"> |
| 284 | 特别优惠 | 284 | 特别优惠 |
| 285 | </view> | 285 | </view> |
| 286 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 286 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 287 | <view class="rechargeItems"> | 287 | <view class="rechargeItems"> |
| 288 | <view class="left"> | 288 | <view class="left"> |
| 289 | <view class="top"> | 289 | <view class="top"> |
| @@ -304,6 +304,27 @@ | @@ -304,6 +304,27 @@ | ||
| 304 | </view> | 304 | </view> |
| 305 | </view> | 305 | </view> |
| 306 | </navigator> | 306 | </navigator> |
| 307 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 308 | + <view class="preferentialItems rechargeItems"> | ||
| 309 | + <view class="itemLeft"> | ||
| 310 | + <view class="itemTop font36r"> | ||
| 311 | + {{recharge_data.rname}} | ||
| 312 | + </view> | ||
| 313 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 314 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 315 | + </view> | ||
| 316 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 317 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 318 | + </view> | ||
| 319 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 320 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 321 | + </view> | ||
| 322 | + </view> | ||
| 323 | + <view class="font24r orderingFood"> | ||
| 324 | + 抢购 | ||
| 325 | + </view> | ||
| 326 | + </view> | ||
| 327 | + </button> | ||
| 307 | </view> | 328 | </view> |
| 308 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 329 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 309 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 330 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1288,6 +1288,15 @@ | @@ -1288,6 +1288,15 @@ | ||
| 1288 | color: #000; | 1288 | color: #000; |
| 1289 | } | 1289 | } |
| 1290 | 1290 | ||
| 1291 | +.getPhoneStyle { | ||
| 1292 | + padding: 0; | ||
| 1293 | + margin: 0; | ||
| 1294 | + line-height: inherit; | ||
| 1295 | +} | ||
| 1296 | +.getPhoneStyle .rechargeItems { | ||
| 1297 | + margin: 0; | ||
| 1298 | +} | ||
| 1299 | + | ||
| 1291 | .arrivalBox{ | 1300 | .arrivalBox{ |
| 1292 | display: flex; | 1301 | display: flex; |
| 1293 | width: 100%; | 1302 | width: 100%; |
| @@ -184,6 +184,54 @@ Page({ | @@ -184,6 +184,54 @@ Page({ | ||
| 184 | } | 184 | } |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | + // 获取code、手机号 | ||
| 188 | + getPhoneNumberFun(e) { | ||
| 189 | + console.log('获取code', e.detail); | ||
| 190 | + if (e.detail && e.detail.code) { | ||
| 191 | + App.Wechat.GetUserPhoneNumber({ | ||
| 192 | + code: e.detail.code, | ||
| 193 | + }).then(res => { | ||
| 194 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 195 | + this.setData({ | ||
| 196 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 197 | + }) | ||
| 198 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 199 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 200 | + } else { | ||
| 201 | + util.toast('手机号获取失败!', 'none') | ||
| 202 | + } | ||
| 203 | + }) | ||
| 204 | + } | ||
| 205 | + }, | ||
| 206 | + // 获取用户在商家的账户余额 | ||
| 207 | + getUserRechargeInfo(phone) { | ||
| 208 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 209 | + openid: getApp().openid, | ||
| 210 | + phone, | ||
| 211 | + sellerid: this.data.seller.sid, | ||
| 212 | + }).then((json) => { | ||
| 213 | + if (json.ret == 200) { | ||
| 214 | + let data = json.data; | ||
| 215 | + if (!data) { | ||
| 216 | + this.createInfoFun(phone) | ||
| 217 | + console.log('用户在商家没有账号'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 222 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 223 | + createInfoFun(phone) { | ||
| 224 | + let params = { | ||
| 225 | + openid: getApp().openid, | ||
| 226 | + sellerid: this.data.seller.sid, | ||
| 227 | + phone | ||
| 228 | + } | ||
| 229 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 230 | + if (res.ret == 200) { | ||
| 231 | + console.log('新增用户在商家的账户信息----', res); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }, | ||
| 187 | // 赴约手机号传参 | 235 | // 赴约手机号传参 |
| 188 | confirmed() { | 236 | confirmed() { |
| 189 | let userinfo = JSON.stringify({ | 237 | let userinfo = JSON.stringify({ |
| @@ -310,7 +310,7 @@ | @@ -310,7 +310,7 @@ | ||
| 310 | <view wx:if="{{titleType}}" class="chefText font36r"> | 310 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 311 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 311 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 312 | </view> | 312 | </view> |
| 313 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 313 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 314 | <view class="preferentialItems rechargeItems"> | 314 | <view class="preferentialItems rechargeItems"> |
| 315 | <view class="itemLeft"> | 315 | <view class="itemLeft"> |
| 316 | <view class="itemTop font36r"> | 316 | <view class="itemTop font36r"> |
| @@ -331,6 +331,27 @@ | @@ -331,6 +331,27 @@ | ||
| 331 | </view> | 331 | </view> |
| 332 | </view> | 332 | </view> |
| 333 | </navigator> | 333 | </navigator> |
| 334 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 335 | + <view class="preferentialItems rechargeItems"> | ||
| 336 | + <view class="itemLeft"> | ||
| 337 | + <view class="itemTop font36r"> | ||
| 338 | + {{recharge_data.rname}} | ||
| 339 | + </view> | ||
| 340 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 341 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 342 | + </view> | ||
| 343 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 344 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 345 | + </view> | ||
| 346 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 347 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 348 | + </view> | ||
| 349 | + </view> | ||
| 350 | + <view class="font24r orderingFood"> | ||
| 351 | + 抢购 | ||
| 352 | + </view> | ||
| 353 | + </view> | ||
| 354 | + </button> | ||
| 334 | </block> | 355 | </block> |
| 335 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 356 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 336 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 357 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1139,6 +1139,15 @@ | @@ -1139,6 +1139,15 @@ | ||
| 1139 | color: #FFEFC5; | 1139 | color: #FFEFC5; |
| 1140 | } | 1140 | } |
| 1141 | 1141 | ||
| 1142 | +.getPhoneStyle { | ||
| 1143 | + padding: 0; | ||
| 1144 | + margin: 0; | ||
| 1145 | + line-height: inherit; | ||
| 1146 | +} | ||
| 1147 | +.getPhoneStyle .rechargeItems { | ||
| 1148 | + margin: 0; | ||
| 1149 | +} | ||
| 1150 | + | ||
| 1142 | /* 深中国红 */ | 1151 | /* 深中国红 */ |
| 1143 | .crimson, | 1152 | .crimson, |
| 1144 | .crimson .positioningBox { | 1153 | .crimson .positioningBox { |
| @@ -184,6 +184,54 @@ Page({ | @@ -184,6 +184,54 @@ Page({ | ||
| 184 | } | 184 | } |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | + // 获取code、手机号 | ||
| 188 | + getPhoneNumberFun(e) { | ||
| 189 | + console.log('获取code', e.detail); | ||
| 190 | + if (e.detail && e.detail.code) { | ||
| 191 | + App.Wechat.GetUserPhoneNumber({ | ||
| 192 | + code: e.detail.code, | ||
| 193 | + }).then(res => { | ||
| 194 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 195 | + this.setData({ | ||
| 196 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 197 | + }) | ||
| 198 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 199 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 200 | + } else { | ||
| 201 | + util.toast('手机号获取失败!', 'none') | ||
| 202 | + } | ||
| 203 | + }) | ||
| 204 | + } | ||
| 205 | + }, | ||
| 206 | + // 获取用户在商家的账户余额 | ||
| 207 | + getUserRechargeInfo(phone) { | ||
| 208 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 209 | + openid: getApp().openid, | ||
| 210 | + phone, | ||
| 211 | + sellerid: this.data.seller.sid, | ||
| 212 | + }).then((json) => { | ||
| 213 | + if (json.ret == 200) { | ||
| 214 | + let data = json.data; | ||
| 215 | + if (!data) { | ||
| 216 | + this.createInfoFun(phone) | ||
| 217 | + console.log('用户在商家没有账号'); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 222 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 223 | + createInfoFun(phone) { | ||
| 224 | + let params = { | ||
| 225 | + openid: getApp().openid, | ||
| 226 | + sellerid: this.data.seller.sid, | ||
| 227 | + phone | ||
| 228 | + } | ||
| 229 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 230 | + if (res.ret == 200) { | ||
| 231 | + console.log('新增用户在商家的账户信息----', res); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }, | ||
| 187 | // 赴约手机号传参 | 235 | // 赴约手机号传参 |
| 188 | confirmed() { | 236 | confirmed() { |
| 189 | let userinfo = JSON.stringify({ | 237 | let userinfo = JSON.stringify({ |
| @@ -308,7 +308,7 @@ | @@ -308,7 +308,7 @@ | ||
| 308 | <view wx:if="{{titleType}}" class="chefText font36r"> | 308 | <view wx:if="{{titleType}}" class="chefText font36r"> |
| 309 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 309 | <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 310 | </view> | 310 | </view> |
| 311 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 311 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 312 | <view class="preferentialItems rechargeItems"> | 312 | <view class="preferentialItems rechargeItems"> |
| 313 | <view class="itemLeft"> | 313 | <view class="itemLeft"> |
| 314 | <view class="itemTop font36r"> | 314 | <view class="itemTop font36r"> |
| @@ -329,6 +329,27 @@ | @@ -329,6 +329,27 @@ | ||
| 329 | </view> | 329 | </view> |
| 330 | </view> | 330 | </view> |
| 331 | </navigator> | 331 | </navigator> |
| 332 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 333 | + <view class="preferentialItems rechargeItems"> | ||
| 334 | + <view class="itemLeft"> | ||
| 335 | + <view class="itemTop font36r"> | ||
| 336 | + {{recharge_data.rname}} | ||
| 337 | + </view> | ||
| 338 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 339 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 340 | + </view> | ||
| 341 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 342 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 343 | + </view> | ||
| 344 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 345 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 346 | + </view> | ||
| 347 | + </view> | ||
| 348 | + <view class="font24r orderingFood"> | ||
| 349 | + 抢购 | ||
| 350 | + </view> | ||
| 351 | + </view> | ||
| 352 | + </button> | ||
| 332 | </block> | 353 | </block> |
| 333 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> | 354 | <view class="vips {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> |
| 334 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 355 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1139,6 +1139,15 @@ | @@ -1139,6 +1139,15 @@ | ||
| 1139 | color: #FFEFC5; | 1139 | color: #FFEFC5; |
| 1140 | } | 1140 | } |
| 1141 | 1141 | ||
| 1142 | +.getPhoneStyle { | ||
| 1143 | + padding: 0; | ||
| 1144 | + margin: 0; | ||
| 1145 | + line-height: inherit; | ||
| 1146 | +} | ||
| 1147 | +.getPhoneStyle .rechargeItems { | ||
| 1148 | + margin: 0; | ||
| 1149 | +} | ||
| 1150 | + | ||
| 1142 | /* 深中国红 */ | 1151 | /* 深中国红 */ |
| 1143 | .crimson, | 1152 | .crimson, |
| 1144 | .crimson .positioningBox { | 1153 | .crimson .positioningBox { |
| @@ -192,6 +192,54 @@ Page({ | @@ -192,6 +192,54 @@ Page({ | ||
| 192 | } | 192 | } |
| 193 | }) | 193 | }) |
| 194 | }, | 194 | }, |
| 195 | + // 获取code、手机号 | ||
| 196 | + getPhoneNumberFun(e) { | ||
| 197 | + console.log('获取code', e.detail); | ||
| 198 | + if (e.detail && e.detail.code) { | ||
| 199 | + App.Wechat.GetUserPhoneNumber({ | ||
| 200 | + code: e.detail.code, | ||
| 201 | + }).then(res => { | ||
| 202 | + if (res.ret == 200 && res.data && res.data.phone_info && res.data.phone_info.purePhoneNumber) { | ||
| 203 | + this.setData({ | ||
| 204 | + purePhoneNumber: res.data.phone_info.purePhoneNumber, | ||
| 205 | + }) | ||
| 206 | + this.bindUserPhoneFun(res.data.phone_info.purePhoneNumber) | ||
| 207 | + this.getUserRechargeInfo(res.data.phone_info.purePhoneNumber) | ||
| 208 | + } else { | ||
| 209 | + util.toast('手机号获取失败!', 'none') | ||
| 210 | + } | ||
| 211 | + }) | ||
| 212 | + } | ||
| 213 | + }, | ||
| 214 | + // 获取用户在商家的账户余额 | ||
| 215 | + getUserRechargeInfo(phone) { | ||
| 216 | + App.Activity.GetRechargeBalanceByOpenid({ | ||
| 217 | + openid: getApp().openid, | ||
| 218 | + phone, | ||
| 219 | + sellerid: this.data.seller.sid, | ||
| 220 | + }).then((json) => { | ||
| 221 | + if (json.ret == 200) { | ||
| 222 | + let data = json.data; | ||
| 223 | + if (!data) { | ||
| 224 | + this.createInfoFun(phone) | ||
| 225 | + console.log('用户在商家没有账号'); | ||
| 226 | + } | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + }, | ||
| 230 | + // 如果该用户不存在账户 新增用户在商家的账户信息 | ||
| 231 | + createInfoFun(phone) { | ||
| 232 | + let params = { | ||
| 233 | + openid: getApp().openid, | ||
| 234 | + sellerid: this.data.seller.sid, | ||
| 235 | + phone | ||
| 236 | + } | ||
| 237 | + App.Activity.CreateCustomerConsumeSeller(params).then(res => { | ||
| 238 | + if (res.ret == 200) { | ||
| 239 | + console.log('新增用户在商家的账户信息----', res); | ||
| 240 | + } | ||
| 241 | + }) | ||
| 242 | + }, | ||
| 195 | // 赴约手机号传参 | 243 | // 赴约手机号传参 |
| 196 | confirmed() { | 244 | confirmed() { |
| 197 | let userinfo = JSON.stringify({ | 245 | let userinfo = JSON.stringify({ |
| @@ -310,7 +310,7 @@ | @@ -310,7 +310,7 @@ | ||
| 310 | <block wx:if="{{titleType}}"> | 310 | <block wx:if="{{titleType}}"> |
| 311 | <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 311 | <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 312 | </block> | 312 | </block> |
| 313 | - <navigator wx:if="{{recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | 313 | + <navigator wx:if="{{recharge_data.id && purePhoneNumber}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> |
| 314 | <view class="preferentialItems rechargeItems"> | 314 | <view class="preferentialItems rechargeItems"> |
| 315 | <view class="itemLeft"> | 315 | <view class="itemLeft"> |
| 316 | <view class="itemTop font36r"> | 316 | <view class="itemTop font36r"> |
| @@ -331,6 +331,27 @@ | @@ -331,6 +331,27 @@ | ||
| 331 | </view> | 331 | </view> |
| 332 | </view> | 332 | </view> |
| 333 | </navigator> | 333 | </navigator> |
| 334 | + <button class="getPhoneStyle" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFun" wx:if="{{recharge_data.id && !purePhoneNumber}}"> | ||
| 335 | + <view class="preferentialItems rechargeItems"> | ||
| 336 | + <view class="itemLeft"> | ||
| 337 | + <view class="itemTop font36r"> | ||
| 338 | + {{recharge_data.rname}} | ||
| 339 | + </view> | ||
| 340 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 341 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 342 | + </view> | ||
| 343 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 344 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 345 | + </view> | ||
| 346 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 347 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 348 | + </view> | ||
| 349 | + </view> | ||
| 350 | + <view class="font24r orderingFood"> | ||
| 351 | + 抢购 | ||
| 352 | + </view> | ||
| 353 | + </view> | ||
| 354 | + </button> | ||
| 334 | </block> | 355 | </block> |
| 335 | <view class="vips"> | 356 | <view class="vips"> |
| 336 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> | 357 | <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> |
| @@ -1256,6 +1256,15 @@ | @@ -1256,6 +1256,15 @@ | ||
| 1256 | -webkit-line-clamp: 1; | 1256 | -webkit-line-clamp: 1; |
| 1257 | } | 1257 | } |
| 1258 | 1258 | ||
| 1259 | +.getPhoneStyle { | ||
| 1260 | + padding: 0; | ||
| 1261 | + margin: 0; | ||
| 1262 | + line-height: inherit; | ||
| 1263 | +} | ||
| 1264 | +.getPhoneStyle .rechargeItems { | ||
| 1265 | + margin: 0; | ||
| 1266 | +} | ||
| 1267 | + | ||
| 1259 | /* 模板9 */ | 1268 | /* 模板9 */ |
| 1260 | .viewBox9 { | 1269 | .viewBox9 { |
| 1261 | background: #23201e; | 1270 | background: #23201e; |
-
Please register or login to post a comment