|
@@ -3,32 +3,37 @@
|
|
|
<view class="list" v-for="(item,index) in list" :key="item.id">
|
|
|
<view>奖品{{index+1}}</view>
|
|
|
<view class="names">{{item.prizeDesc}}</view>
|
|
|
- <view class="viewsDetail" @click="viewsDetail">查看详情</view>
|
|
|
- <view class="lingjiang" @click="lingjiang(0)">领奖</view>
|
|
|
+ <view class="lingjiang" v-if="item.state == 'WAIT_RECEIVE'" @click="lingjiang(item)">领奖</view>
|
|
|
+ <view class="viewsDetail" v-else @click="viewsDetail(item)">查看详情</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="list.length == 0">
|
|
|
+ <u-empty text="还未中奖" :icon-size="50" mode="list"></u-empty>
|
|
|
</view>
|
|
|
|
|
|
<!-- 查看详情弹框 -->
|
|
|
- <u-popup v-model="showViews" mode="center" close-icon-color="#ffffff" closeable :border-radius="30" width="500rpx" height="650rpx">
|
|
|
+ <u-popup v-model="showViews" mode="center" close-icon-color="#ffffff" closeable :border-radius="30" width="500rpx">
|
|
|
<view class="lottery-content">
|
|
|
<view class="lottery-title">物流信息</view>
|
|
|
<view class="lottery-form">
|
|
|
<view>
|
|
|
<view class="labes">收件人</view>
|
|
|
- <view>李磊</view>
|
|
|
+ <view>{{curRevice.receiverName}}</view>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="labes">联系电话</view>
|
|
|
- <view>1379964646</view>
|
|
|
+ <view>{{curRevice.receiverPhone}}</view>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="labes">收货地址</view>
|
|
|
- <view>陕西省咸阳市某某街某某 某小区某某单元1100号</view>
|
|
|
+ <view>{{curRevice.receiveAddress}}</view>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="labes">物流单号</view>
|
|
|
<view>
|
|
|
- <!-- <text>暂未发货,如收货信息有误, 请联系13312345678</text> -->
|
|
|
- <text>中国邮政(单号:16546464645)</text> <u-button @click="copyWlCode" size="mini">复制</u-button>
|
|
|
+ <view v-if="curRevice.state == 'WAIT_SEND_EXPRESS'">暂未发货,如收货信息有误, 请联系客服电话<text class="tell" @click="callPhone">{{kfPhone}}</text></view>
|
|
|
+ <view v-else>
|
|
|
+ 中国邮政 <text class="tell">(单号:16546464645)</text> <u-button @click="copyWlCode" size="mini">复制</u-button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -84,13 +89,14 @@
|
|
|
<script>
|
|
|
import Address from '@/components/address.vue'
|
|
|
import {findAddressBycustomerNo, saveAddress} from '@/api/receiveAddress.js'
|
|
|
-import { findWinPrize } from '@/api/luckyDraw.js'
|
|
|
+import { findWinPrize, receive } from '@/api/luckyDraw.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
Address
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ kfPhone:'', // 客服电话
|
|
|
showViews: false, // 查看详情弹框
|
|
|
showAddr: false ,// 实物奖品,收货地址弹框
|
|
|
showLjLd: false, // 虚拟奖品领奖弹框
|
|
@@ -103,7 +109,8 @@ export default {
|
|
|
areaName: '', //地址
|
|
|
areaInfo: {}, // 省市区
|
|
|
areaIdArr: [], // 省市区id数组
|
|
|
- list: []
|
|
|
+ list: [],
|
|
|
+ curRevice: null
|
|
|
}
|
|
|
},
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
@@ -113,6 +120,7 @@ export default {
|
|
|
onLoad(option) {
|
|
|
console.log(option,'option')
|
|
|
this.getfindWinPrize()
|
|
|
+ this.kfPhone = this.$store.state.vuex_kfMobile
|
|
|
},
|
|
|
onUnload() {
|
|
|
this.form = {
|
|
@@ -122,6 +130,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 电话客服
|
|
|
+ callPhone () {
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber: this.kfPhone
|
|
|
+ })
|
|
|
+ },
|
|
|
getfindWinPrize(){
|
|
|
findWinPrize().then(res => {
|
|
|
if(res.status == 200){
|
|
@@ -158,16 +172,22 @@ export default {
|
|
|
uni.navigateBack()
|
|
|
},
|
|
|
// 查看详情
|
|
|
- viewsDetail(){
|
|
|
- this.showViews = true
|
|
|
+ viewsDetail(item){
|
|
|
+ this.curRevice = item
|
|
|
+ if(item.prizeType == 'GOODS'){
|
|
|
+ this.showViews = true
|
|
|
+ }else{
|
|
|
+ this.showLjLd = true
|
|
|
+ }
|
|
|
},
|
|
|
// 领奖
|
|
|
- lingjiang(type){
|
|
|
- if(type){
|
|
|
+ lingjiang(item){
|
|
|
+ this.curRevice = item
|
|
|
+ if(item.prizeType == 'GOODS'){
|
|
|
this.showAddr = true
|
|
|
this.getAddress()
|
|
|
}else{
|
|
|
- this.showLjLd = true
|
|
|
+ this.saveReceive()
|
|
|
}
|
|
|
},
|
|
|
// 复制单号
|
|
@@ -220,17 +240,46 @@ export default {
|
|
|
if(this.form.id) {
|
|
|
params.id = this.form.id
|
|
|
}
|
|
|
+ // 保存我的收货地址
|
|
|
saveAddress(params).then(res=>{
|
|
|
if(res.status == 200) {
|
|
|
- uni.showToast({
|
|
|
- title: res.message,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- this.showAddr = false
|
|
|
+ // 保存领奖收货信息
|
|
|
+ this.saveReceive(params)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ // 领奖
|
|
|
+ saveReceive(params){
|
|
|
+ let item = this.curRevice
|
|
|
+ let isGoods = item.prizeType == 'GOODS'
|
|
|
+ let data = {
|
|
|
+ "luckyDrawWinNo": this.curRevice.luckyDrawWinNo
|
|
|
+ }
|
|
|
+ // 实物,发货地址
|
|
|
+ if(isGoods){
|
|
|
+ data.receiverName = params.receiverName
|
|
|
+ data.receiverPhone = params.receiverPhone
|
|
|
+ data.receiveAddress = params.receiveAreasName +' '+ params.receiveAddress
|
|
|
+ }
|
|
|
+ receive(data).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+
|
|
|
+ if(isGoods){
|
|
|
+ this.showAddr = false
|
|
|
+ }else{
|
|
|
+ this.showLjLd = true
|
|
|
+ }
|
|
|
+
|
|
|
+ this.list = []
|
|
|
+ this.getfindWinPrize()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -266,7 +315,9 @@ export default {
|
|
|
width: 25%;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .tell{
|
|
|
+ color: #0A98D5;
|
|
|
+ }
|
|
|
.lottery-content{
|
|
|
height: 100%;
|
|
|
position: relative;
|
|
@@ -276,9 +327,6 @@ export default {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
font-size: 32rpx;
|
|
|
border-top: 1px solid #eee;
|
|
|
padding: 30rpx 0;
|
|
@@ -319,7 +367,7 @@ export default {
|
|
|
line-height: 42rpx;
|
|
|
}
|
|
|
.lottery-u-form{
|
|
|
- padding: 50rpx 50rpx 150rpx;
|
|
|
+ padding: 50rpx;
|
|
|
.receiveAddress{
|
|
|
width: 100%;
|
|
|
line-height: 1.5em;
|