|
@@ -11,16 +11,20 @@
|
|
|
<span class="list_ct_name">{{item.name}}</span>
|
|
|
<span class="list_ct_gold">{{item.price}}</span>
|
|
|
<img v-if="item.canExchange == '0'" src="../assets/awards/gray_awards_btn.png" alt="" @click="goldInsufficient">
|
|
|
+ <img v-if="item.canExchange == '2'" src="../assets/awards/gray_awards_btn.png" alt="" @click="goldOverTimer">
|
|
|
<img v-else-if="item.canExchange == '1'" src="../assets/awards/red_awards_btn.png" alt="" @click="awardsBtn(item.isVirtual,item.prizeId,item.name)">
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<i class="back_btn" @click="backBtn"/>
|
|
|
<login v-if="showLogin" @onClose="close" @onLogin="login"/>
|
|
|
-
|
|
|
+ <!-- 虚拟品兑换成功 -->
|
|
|
+ <div v-show="shiwuSucceed" class="conceal_tier"/>
|
|
|
+ <div v-show="shiwuSucceed" class="shiwu_succeed_popup"/>
|
|
|
<!-- 虚拟品 -->
|
|
|
- <div v-show="popup2" class="conceal_tier" @click="popupHide"/>
|
|
|
- <div v-show="popup2" class="exchange_succeed3">
|
|
|
+ <div v-show="popup2" class="conceal_tier" />
|
|
|
+ <div v-show="popup2" class="exchange_succeed">
|
|
|
+ <p class="discount_text">{{name}}</p>
|
|
|
<div class="popup2_yes_btn" @click="popup2YesBtn"/>
|
|
|
</div>
|
|
|
<!-- 实物邮寄地址 -->
|
|
@@ -69,6 +73,8 @@ export default {
|
|
|
name: '',
|
|
|
address: ''
|
|
|
},
|
|
|
+ addressId: '',
|
|
|
+ shiwuSucceed: false,
|
|
|
mobile: null,
|
|
|
popup: false,
|
|
|
popup2: false,
|
|
@@ -76,11 +82,7 @@ export default {
|
|
|
pointsTotal: '',
|
|
|
name: '',
|
|
|
list: [
|
|
|
- {
|
|
|
- // name: 'name',
|
|
|
- // price: 'price',
|
|
|
- // canExchange: 'canExchange'
|
|
|
- }
|
|
|
+ {}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
@@ -97,6 +99,9 @@ export default {
|
|
|
goldInsufficient () {
|
|
|
Toast('金币不足')
|
|
|
},
|
|
|
+ goldOverTimer () {
|
|
|
+ Toast('已经超过兑换奖品的时间')
|
|
|
+ },
|
|
|
close () {
|
|
|
this.showLogin = false
|
|
|
},
|
|
@@ -107,16 +112,40 @@ export default {
|
|
|
this.showLogin = false
|
|
|
},
|
|
|
popup2YesBtn () {
|
|
|
- Toast(this.name + '奖品兑换成功')
|
|
|
- this.popup2 = false
|
|
|
- },
|
|
|
- popupHide () {
|
|
|
- // this.popup2 = false
|
|
|
+ let params = {}
|
|
|
+ params.url = apis.exchange
|
|
|
+ params.data = {
|
|
|
+ activityId: utils.storage.fetch('activiType').activityId,
|
|
|
+ prizeId: this.prizeId
|
|
|
+ }
|
|
|
+ params.method = 'POST'
|
|
|
+ net.req(params).then((data) => {
|
|
|
+ Indicator.close() // mint ui
|
|
|
+
|
|
|
+ if (data.code == 0) {
|
|
|
+ // console.log(data)
|
|
|
+ this.popup2 = false
|
|
|
+ Toast(this.name + '奖品兑换成功')
|
|
|
+ }
|
|
|
+ }, (e) => {
|
|
|
+ Indicator.close() // mint ui
|
|
|
+
|
|
|
+ Toast('奖品兑换失败')
|
|
|
+ this.popup2 = false
|
|
|
+ console.log(e)
|
|
|
+ })
|
|
|
},
|
|
|
+ // popupHide () {
|
|
|
+ // // this.popup2 = false
|
|
|
+ // },
|
|
|
backBtn2 () {
|
|
|
this.popup = false
|
|
|
},
|
|
|
submit () {
|
|
|
+ Indicator.open({
|
|
|
+ text: 'Loading...',
|
|
|
+ spinnerType: 'fading-circle'
|
|
|
+ })
|
|
|
// var reg = /^1[3|4|5|6|7|8][0-9]\d{4,8}$/
|
|
|
if (!this.parms.name) {
|
|
|
Toast('请输入姓名')
|
|
@@ -126,30 +155,52 @@ export default {
|
|
|
Toast('请输入手机号码')
|
|
|
return false
|
|
|
}
|
|
|
- if (!this.parms.name) {
|
|
|
+ if (isNaN(this.parms.phone) === true) {
|
|
|
+ Toast('手机号码格式不正确')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.parms.address) {
|
|
|
Toast('请输入地址')
|
|
|
return false
|
|
|
}
|
|
|
let params = {}
|
|
|
- params.url = apis.create_order
|
|
|
+ params.url = apis.update_user_info
|
|
|
params.data = {
|
|
|
- activityId: utils.storage.fetch('activiType').activityId,
|
|
|
- goodsId: this.prizeId,
|
|
|
- name: this.parms.name,
|
|
|
+ actionCode: 1,
|
|
|
+ userName: this.parms.name,
|
|
|
mobile: this.parms.phone,
|
|
|
- address: this.parms.address
|
|
|
+ addressDetail: this.parms.address
|
|
|
}
|
|
|
params.method = 'POST'
|
|
|
net.req(params).then((data) => {
|
|
|
- Indicator.close() // mint ui
|
|
|
-
|
|
|
+ this.addressId = data.data.addressId
|
|
|
if (data.code == 0) {
|
|
|
- console.log(data)
|
|
|
- Toast('十日内发货')
|
|
|
- this.popup = false
|
|
|
+ Indicator.close() // mint ui
|
|
|
+ let params = {}
|
|
|
+ params.url = apis.exchange
|
|
|
+ params.data = {
|
|
|
+ activityId: utils.storage.fetch('activiType').activityId,
|
|
|
+ prizeId: this.prizeId,
|
|
|
+ addressId: this.addressId
|
|
|
+ }
|
|
|
+ params.method = 'POST'
|
|
|
+ net.req(params).then((data) => {
|
|
|
+ if (data.code == 0) {
|
|
|
+ // console.log(data)
|
|
|
+ this.shiwuSucceed = true
|
|
|
+ this.popup = false
|
|
|
+ let that = this
|
|
|
+ setTimeout(function () {
|
|
|
+ that.shiwuSucceed = false
|
|
|
+ }, 3000)
|
|
|
+ }
|
|
|
+ }, (e) => {
|
|
|
+ console.log(e)
|
|
|
+ })
|
|
|
}
|
|
|
}, (e) => {
|
|
|
- console.log(22, e)
|
|
|
+ Indicator.close() // mint ui
|
|
|
+ console.log(e)
|
|
|
})
|
|
|
},
|
|
|
awardsBtn (i, x, n) {
|
|
@@ -190,7 +241,7 @@ export default {
|
|
|
Indicator.close() // mint ui
|
|
|
|
|
|
if (data.code == 0) {
|
|
|
- console.log(data)
|
|
|
+ // console.log(data)
|
|
|
this.list = data.data.list
|
|
|
this.pointsTotal = data.data.currentPointsTotal
|
|
|
}
|
|
@@ -325,12 +376,12 @@ export default {
|
|
|
left: 2.335rem;
|
|
|
font-size: .5555555rem;
|
|
|
}
|
|
|
-.exchange_succeed3 {
|
|
|
+.exchange_succeed {
|
|
|
display: block;
|
|
|
margin: auto;
|
|
|
width: 10.19rem;
|
|
|
height: 9.01em;
|
|
|
- background: url(../assets/awards/discount3.png) no-repeat center center;
|
|
|
+ background: url(../assets/awards/discount.png) no-repeat center center;
|
|
|
background-size: cover;
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
@@ -339,11 +390,34 @@ export default {
|
|
|
margin-top: -4.5rem;
|
|
|
z-index: 100;
|
|
|
}
|
|
|
+.shiwu_succeed_popup {
|
|
|
+ display: block;
|
|
|
+ margin: auto;
|
|
|
+ width: 10.19rem;
|
|
|
+ height: 7.2em;
|
|
|
+ background: url(../assets/awards/shiwu.png) no-repeat center center;
|
|
|
+ background-size: cover;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ margin-left: -5.1rem;
|
|
|
+ margin-top: -5.5rem;
|
|
|
+ z-index: 100;
|
|
|
+}
|
|
|
+.discount_text {
|
|
|
+ position: absolute;
|
|
|
+ top: 43%;
|
|
|
+ font-size: .6rem;
|
|
|
+ padding: 0 .2rem;
|
|
|
+ margin-left: 6%;
|
|
|
+ background-color: #FCDB00;
|
|
|
+ border-radius: 1rem;
|
|
|
+}
|
|
|
.popup2_yes_btn {
|
|
|
position: absolute;
|
|
|
width: 42%;
|
|
|
height: 1.3rem;
|
|
|
- background-color: red;
|
|
|
+ // background-color: red;
|
|
|
opacity: .5;
|
|
|
bottom: .1rem;
|
|
|
left: 18%;
|