|
@@ -120,9 +120,9 @@
|
|
<view class="lottery-content win_4" v-if="winTypes == 'win_4'">
|
|
<view class="lottery-content win_4" v-if="winTypes == 'win_4'">
|
|
<view class="lottery-title">
|
|
<view class="lottery-title">
|
|
<view>请输入支付密码</view>
|
|
<view>请输入支付密码</view>
|
|
- <view class="pay-info">支付<text>10</text><image src="../../static/ledou.png"></image></view>
|
|
|
|
|
|
+ <view class="pay-info">支付<text>{{luckDraw.purchaseTimesGold}}</text><image src="../../static/ledou.png"></image></view>
|
|
<view>
|
|
<view>
|
|
- <u-input v-model="payPws" trim type="password" :border="true" :password-icon="true" placeholder="请输入支付密码"></u-input>
|
|
|
|
|
|
+ <u-input v-model="payPws" :focus="focus" trim type="password" :border="true" :password-icon="true" placeholder="请输入支付密码"></u-input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="lottery-confrim-btn" @click="toPaySubmit">
|
|
<view class="lottery-confrim-btn" @click="toPaySubmit">
|
|
@@ -130,13 +130,23 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-popup>
|
|
</u-popup>
|
|
|
|
+ <!-- 提示用户设置支付密码 -->
|
|
|
|
+ <u-modal v-model="showSetPswModal"
|
|
|
|
+ content="请先设置支付密码,才能使用乐豆"
|
|
|
|
+ show-cancel-button
|
|
|
|
+ confirm-text="去设置"
|
|
|
|
+ cancel-text="暂时放弃"
|
|
|
|
+ @confirm="toSetPwd"
|
|
|
|
+ @cancel="showSetPswModal=false"
|
|
|
|
+ ></u-modal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import AlmostLottery from '@/components/almost-lottery/almost-lottery.vue';
|
|
import AlmostLottery from '@/components/almost-lottery/almost-lottery.vue';
|
|
import { clearCacheFile } from '@/almost-utils/almost-utils.js';
|
|
import { clearCacheFile } from '@/almost-utils/almost-utils.js';
|
|
-import { findCustomerTimes } from '@/api/luckyDraw.js'
|
|
|
|
|
|
+import { findCustomerTimes, buyDrawTimes } from '@/api/luckyDraw.js'
|
|
|
|
+import { existPayPwd } from '@/api/order.js'
|
|
export default {
|
|
export default {
|
|
name: 'Home',
|
|
name: 'Home',
|
|
components: {
|
|
components: {
|
|
@@ -161,6 +171,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ focus: false,
|
|
|
|
+ showSetPswModal: false,
|
|
animateUp: false,
|
|
animateUp: false,
|
|
timer: null,
|
|
timer: null,
|
|
scrollTextHeight: 400,
|
|
scrollTextHeight: 400,
|
|
@@ -305,10 +317,22 @@ export default {
|
|
},
|
|
},
|
|
// 抽奖次数用完了
|
|
// 抽奖次数用完了
|
|
showPayWin(winTypes){
|
|
showPayWin(winTypes){
|
|
- this.showLottery = true
|
|
|
|
- this.winTypes = winTypes
|
|
|
|
- this.prizeIndex = -1
|
|
|
|
- clearCacheFile()
|
|
|
|
|
|
+ // 判断用户是否设置过支付密码
|
|
|
|
+ existPayPwd().then(res=>{
|
|
|
|
+ if(res.status == 200) {
|
|
|
|
+ // 设置过支付密码,输入密码
|
|
|
|
+ if(res.data) {
|
|
|
|
+ this.payPws = ''
|
|
|
|
+ this.showLottery = true
|
|
|
|
+ this.winTypes = winTypes
|
|
|
|
+ this.prizeIndex = -1
|
|
|
|
+ clearCacheFile()
|
|
|
|
+ } else {
|
|
|
|
+ // 没设置过支付密码,提示设置密码
|
|
|
|
+ this.showSetPswModal = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 本次抽奖开始
|
|
// 本次抽奖开始
|
|
handleDrawStart() {
|
|
handleDrawStart() {
|
|
@@ -393,14 +417,31 @@ export default {
|
|
},
|
|
},
|
|
// 支付乐豆继续抽奖
|
|
// 支付乐豆继续抽奖
|
|
toPay(){
|
|
toPay(){
|
|
|
|
+ this.payPws = ''
|
|
this.winTypes = 'win_4'
|
|
this.winTypes = 'win_4'
|
|
},
|
|
},
|
|
// 支付确定
|
|
// 支付确定
|
|
toPaySubmit(){
|
|
toPaySubmit(){
|
|
- this.showLottery = false
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pagesA/luckDraw/paySuccess'
|
|
|
|
- })
|
|
|
|
|
|
+ if(this.payPws != ''){
|
|
|
|
+ let params = {
|
|
|
|
+ "payPwd": this.payPws,
|
|
|
|
+ "payGold": this.luckDraw.purchaseTimesGold,
|
|
|
|
+ "luckyDrawNo": this.luckDraw.luckyDrawNo
|
|
|
|
+ }
|
|
|
|
+ buyDrawTimes(params).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.showLottery = false
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pagesA/luckDraw/paySuccess'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请输入支付密码'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 文字滚动
|
|
// 文字滚动
|
|
scrollAnimate() {
|
|
scrollAnimate() {
|
|
@@ -433,7 +474,22 @@ export default {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pagesA/taskList/taskList?id='+this.luckDraw.luckyDrawNo
|
|
url: '/pagesA/taskList/taskList?id='+this.luckDraw.luckyDrawNo
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 跳转到设置支付密码页
|
|
|
|
+ toSetPwd () {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:"/pages/userCenter/userInfo/smsVerification"
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 设置密码成功, 打开输入密码弹窗
|
|
|
|
+ setPsw (e) {
|
|
|
|
+ if (e.success) {
|
|
|
|
+ this.toPay()
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.focus = true
|
|
|
|
+ },300)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.timer = setInterval(this.scrollAnimate, 2000);
|
|
this.timer = setInterval(this.scrollAnimate, 2000);
|
|
@@ -457,6 +513,9 @@ export default {
|
|
withShareTicket: true,
|
|
withShareTicket: true,
|
|
menus: ['shareAppMessage', 'shareTimeline']
|
|
menus: ['shareAppMessage', 'shareTimeline']
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ // 监听设置密码是否成功
|
|
|
|
+ uni.$once('setPswSuccess', this.setPsw)
|
|
},
|
|
},
|
|
onUnload() {
|
|
onUnload() {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|