|
@@ -3,18 +3,14 @@
|
|
<!-- 表单 -->
|
|
<!-- 表单 -->
|
|
<view class="form">
|
|
<view class="form">
|
|
<uni-forms :modelValue="formData">
|
|
<uni-forms :modelValue="formData">
|
|
- <uni-forms-item name="type" v-if="isPhy == 1">
|
|
|
|
- <view class="selectType" @click="openSelect">
|
|
|
|
- <view class="uni-input" @click="openSelect">
|
|
|
|
- <text v-if="formData.type==''||formData.type==null"
|
|
|
|
- style="color: #999999 ;font-size: 30rpx;">请选择配送方式</text>
|
|
|
|
- <text v-if="formData.type!=''" style="font-size: 30rpx;">{{formData.type}}</text>
|
|
|
|
|
|
+ <view style="margin-bottom: 24rpx;" class="tab_nav" v-if="isPhy == 1">
|
|
|
|
+ <view class="navTitle" v-for="(item,index) in typeSelect" :key="index"
|
|
|
|
+ @click="checked(index,item.id)">
|
|
|
|
+ <view :class="{'active':isActive === index}">
|
|
|
|
+ {{item.name}}
|
|
</view>
|
|
</view>
|
|
- <image src="/static/icon/right.png"
|
|
|
|
- style="width: 14rpx;height: 24rpx;position: absolute;top:22rpx;right: 30rpx;">
|
|
|
|
- </image>
|
|
|
|
</view>
|
|
</view>
|
|
- </uni-forms-item>
|
|
|
|
|
|
+ </view>
|
|
<uni-forms-item name="name" v-if="formData.type!=''||isVerification==true">
|
|
<uni-forms-item name="name" v-if="formData.type!=''||isVerification==true">
|
|
<uni-easyinput type="text" v-model="Data.receiver" placeholder="联系人" />
|
|
<uni-easyinput type="text" v-model="Data.receiver" placeholder="联系人" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
@@ -42,8 +38,8 @@
|
|
<textarea placeholder-style="#999" class="text-area" type="text" placeholder="详细地址"
|
|
<textarea placeholder-style="#999" class="text-area" type="text" placeholder="详细地址"
|
|
v-model="Data.address" />
|
|
v-model="Data.address" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
- <uni-forms-item name="region" v-if="formData.type=='到店自提'||isVerification==true">
|
|
|
|
- <view class="selectType" @click="openShop">
|
|
|
|
|
|
+ <uni-forms-item name="region" v-if="formData.type=='门店自提'||isVerification==true">
|
|
|
|
+ <view class="selectType" @click="openShop" v-if="hotelList.length != 0 " >
|
|
<view class="uni-input">
|
|
<view class="uni-input">
|
|
<text v-if="formData.shop==''||formData.shop==null"
|
|
<text v-if="formData.shop==''||formData.shop==null"
|
|
style="color: #999999 ; font-size: 30rpx; ">请选择门店</text>
|
|
style="color: #999999 ; font-size: 30rpx; ">请选择门店</text>
|
|
@@ -54,6 +50,9 @@
|
|
style="width: 14rpx;height: 24rpx;position: absolute;top:22rpx;right: 30rpx;">
|
|
style="width: 14rpx;height: 24rpx;position: absolute;top:22rpx;right: 30rpx;">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="selectTypeNone" v-if="hotelList.length == 0 ">
|
|
|
|
+ 暂无门店,请选择其他配送方式
|
|
|
|
+ </view>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</uni-forms>
|
|
</view>
|
|
</view>
|
|
@@ -74,6 +73,17 @@
|
|
<text>件数</text>
|
|
<text>件数</text>
|
|
<text>1件</text>
|
|
<text>1件</text>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view style="width: 694rpx;height: 4rpx;border: 2rpx dashed #F2F2F2;margin-top: 38rpx;"></view>
|
|
|
|
+ <view class="shopRemark">
|
|
|
|
+ <view class="shopRemark-title">
|
|
|
|
+ <text>奖品说明</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="shopRemark-content">
|
|
|
|
+ <u-parse :content="prizeDetail[0].details"></u-parse>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- 占位 -->
|
|
|
|
+ <view style="height: 158rpx;"></view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 兑换按钮 -->
|
|
<!-- 兑换按钮 -->
|
|
@@ -85,7 +95,7 @@
|
|
|
|
|
|
|
|
|
|
<!-- 配送方式-->
|
|
<!-- 配送方式-->
|
|
- <uni-popup ref="Recipient" type="bottom" mask-background-color=" rgba(0,0,0,0.7);">
|
|
|
|
|
|
+ <!-- <uni-popup ref="Recipient" type="bottom" mask-background-color=" rgba(0,0,0,0.7);">
|
|
<view class="pop">
|
|
<view class="pop">
|
|
<view class="popuptitle">
|
|
<view class="popuptitle">
|
|
<view @click="cancelBtn" style="width: 68rpx;color: #999;font-size: 32rpx;">
|
|
<view @click="cancelBtn" style="width: 68rpx;color: #999;font-size: 32rpx;">
|
|
@@ -104,7 +114,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </uni-popup>
|
|
|
|
|
|
+ </uni-popup> -->
|
|
<!-- 门店选择-->
|
|
<!-- 门店选择-->
|
|
<uni-popup ref="shopSelected" type="bottom" mask-background-color=" rgba(0,0,0,0.7);">
|
|
<uni-popup ref="shopSelected" type="bottom" mask-background-color=" rgba(0,0,0,0.7);">
|
|
<view class="pop">
|
|
<view class="pop">
|
|
@@ -120,7 +130,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="chooselag">
|
|
<view class="chooselag">
|
|
<view @click="companyedShop(item.name,item.id,item.distanceToMe,index)" class="language"
|
|
<view @click="companyedShop(item.name,item.id,item.distanceToMe,index)" class="language"
|
|
- v-for="(item,index) in hotelList" :key="index" :class="[activeIndex2 === index?'sgActive': ''] ">
|
|
|
|
|
|
+ v-for="(item,index) in hotelList" :key="index"
|
|
|
|
+ :class="[activeIndex2 === index?'sgActive': ''] ">
|
|
<text>{{item.name}}</text>
|
|
<text>{{item.name}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -158,18 +169,20 @@
|
|
shop: '',
|
|
shop: '',
|
|
distanceToMe: ''
|
|
distanceToMe: ''
|
|
},
|
|
},
|
|
|
|
+ //激活指定table菜单
|
|
|
|
+ isActive: 0,
|
|
// 配送方式
|
|
// 配送方式
|
|
typeSelect: [{
|
|
typeSelect: [{
|
|
name: '快递配送',
|
|
name: '快递配送',
|
|
}, {
|
|
}, {
|
|
- name: '到店自提',
|
|
|
|
|
|
+ name: '门店自提',
|
|
}],
|
|
}],
|
|
// 选择门店
|
|
// 选择门店
|
|
hotelList: [],
|
|
hotelList: [],
|
|
// 表单数据
|
|
// 表单数据
|
|
Data: {
|
|
Data: {
|
|
//奖品id
|
|
//奖品id
|
|
- product_id:'',
|
|
|
|
|
|
+ product_id: '',
|
|
order_id: '', //订单id
|
|
order_id: '', //订单id
|
|
// 快递类型(1.快递发货 2.到店自提也是线下核销)
|
|
// 快递类型(1.快递发货 2.到店自提也是线下核销)
|
|
express_type: '',
|
|
express_type: '',
|
|
@@ -187,30 +200,50 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- onLoad(o) {
|
|
|
|
|
|
+ async onLoad(o) {
|
|
if (o.id) {
|
|
if (o.id) {
|
|
this.id = o.id
|
|
this.id = o.id
|
|
|
|
+ console.log(this.id,'---->订单id');
|
|
this.isPhy = o.isPhy
|
|
this.isPhy = o.isPhy
|
|
- this.init()
|
|
|
|
- console.log(this.id);
|
|
|
|
if (this.isPhy == 1) {
|
|
if (this.isPhy == 1) {
|
|
//实物奖品
|
|
//实物奖品
|
|
- this.getPrizeList(0)
|
|
|
|
|
|
+ await this.getPrizeList(0)
|
|
|
|
+ if(this.Data.product_id){
|
|
|
|
+ this.init(this.Data.product_id)
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
//虚拟奖品
|
|
//虚拟奖品
|
|
- this.getPrizeList(1)
|
|
|
|
|
|
+ await this.getPrizeList(1)
|
|
|
|
+ if(this.Data.product_id){
|
|
|
|
+ this.init(this.Data.product_id)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+
|
|
//初始化
|
|
//初始化
|
|
- async init() {
|
|
|
|
|
|
+ async init(id) {
|
|
await this.goLocation();
|
|
await this.goLocation();
|
|
- await this.getHotel();
|
|
|
|
|
|
+ await this.getHotel(id);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //菜单index切换
|
|
|
|
+ async checked(index, id) {
|
|
|
|
+ this.isActive = index
|
|
|
|
+ if (this.isActive == 0) {
|
|
|
|
+ this.formData.type = '快递配送'
|
|
|
|
+ this.Data.express_type = 1
|
|
|
|
+ } else {
|
|
|
|
+ this.formData.type = '门店自提'
|
|
|
|
+ this.Data.express_type = 2
|
|
|
|
+ await this.goLocation()
|
|
|
|
+ await this.getHotel(this.Data.product_id)
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-
|
|
|
|
space(lat1, lng1, lat2, lng2) {
|
|
space(lat1, lng1, lat2, lng2) {
|
|
var radLat1 = lat1 * Math.PI / 180.0;
|
|
var radLat1 = lat1 * Math.PI / 180.0;
|
|
var radLat2 = lat2 * Math.PI / 180.0;
|
|
var radLat2 = lat2 * Math.PI / 180.0;
|
|
@@ -218,7 +251,7 @@
|
|
var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
|
|
var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
|
|
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
|
|
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
|
|
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
|
|
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
|
|
- s = s * 6378.137;
|
|
|
|
|
|
+ s = s * 6378.137;
|
|
s = Math.round(s * 10000) / 10000;
|
|
s = Math.round(s * 10000) / 10000;
|
|
return s // 单位千米
|
|
return s // 单位千米
|
|
},
|
|
},
|
|
@@ -229,14 +262,14 @@
|
|
type: 2,
|
|
type: 2,
|
|
latitude: this.latitude,
|
|
latitude: this.latitude,
|
|
longitude: this.longitude,
|
|
longitude: this.longitude,
|
|
- product_id:id
|
|
|
|
|
|
+ product_id: id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.hotelList = res.data.data
|
|
|
|
- this.hotelList.map(item => {
|
|
|
|
|
|
+ this.hotelList = res.data.data.map(item => {
|
|
item.distanceToMe = this.space(this.latitude, this.longitude, item.latitude, item
|
|
item.distanceToMe = this.space(this.latitude, this.longitude, item.latitude, item
|
|
.longitude).toFixed(1);
|
|
.longitude).toFixed(1);
|
|
return item;
|
|
return item;
|
|
})
|
|
})
|
|
|
|
+ console.log(this.hotelList, '-------->this.hotelList');
|
|
//最近的酒店
|
|
//最近的酒店
|
|
this.formData.shop = this.hotelList[0].name
|
|
this.formData.shop = this.hotelList[0].name
|
|
this.formData.distanceToMe = this.hotelList[0].distanceToMe
|
|
this.formData.distanceToMe = this.hotelList[0].distanceToMe
|
|
@@ -302,8 +335,8 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.isPhy == 1){
|
|
|
|
- if(this.Data.express_type == 1){
|
|
|
|
|
|
+ if (this.isPhy == 1) {
|
|
|
|
+ if (this.Data.express_type == 1) {
|
|
this.$api.product.orderExchange({
|
|
this.$api.product.orderExchange({
|
|
...this.Data
|
|
...this.Data
|
|
}).then(res => {
|
|
}).then(res => {
|
|
@@ -318,8 +351,8 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
- let obj ={}
|
|
|
|
|
|
+ } else {
|
|
|
|
+ let obj = {}
|
|
obj.express_type = this.Data.express_type
|
|
obj.express_type = this.Data.express_type
|
|
obj.order_id = this.Data.order_id
|
|
obj.order_id = this.Data.order_id
|
|
obj.receiver = this.Data.receiver
|
|
obj.receiver = this.Data.receiver
|
|
@@ -340,8 +373,8 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- let obj ={}
|
|
|
|
|
|
+ } else {
|
|
|
|
+ let obj = {}
|
|
obj.express_type = this.Data.express_type
|
|
obj.express_type = this.Data.express_type
|
|
obj.order_id = this.Data.order_id
|
|
obj.order_id = this.Data.order_id
|
|
obj.receiver = this.Data.receiver
|
|
obj.receiver = this.Data.receiver
|
|
@@ -368,9 +401,9 @@
|
|
openShop() {
|
|
openShop() {
|
|
this.$refs.shopSelected.open('bottom')
|
|
this.$refs.shopSelected.open('bottom')
|
|
},
|
|
},
|
|
- companyedShop(i, id, distance,index) {
|
|
|
|
|
|
+ companyedShop(i, id, distance, index) {
|
|
this.typestatus2 = i
|
|
this.typestatus2 = i
|
|
- this.activeIndex2= index
|
|
|
|
|
|
+ this.activeIndex2 = index
|
|
this.distanceToMe1 = distance
|
|
this.distanceToMe1 = distance
|
|
this.Data.hotel_id = id
|
|
this.Data.hotel_id = id
|
|
},
|
|
},
|
|
@@ -443,18 +476,21 @@
|
|
this.coverImg = this.prizeDetail[0].img_urls
|
|
this.coverImg = this.prizeDetail[0].img_urls
|
|
this.Data.order_id = this.prizeDetail[0].order_id
|
|
this.Data.order_id = this.prizeDetail[0].order_id
|
|
this.Data.product_id = this.prizeDetail[0].product_id
|
|
this.Data.product_id = this.prizeDetail[0].product_id
|
|
- this.product_id = this.Data.product_id
|
|
|
|
- console.log(this.product_id,'----->this.product_id');
|
|
|
|
-
|
|
|
|
|
|
+ this.product_id = this.Data.product_id
|
|
|
|
+ console.log(this.product_id, '----->this.product_id');
|
|
|
|
+
|
|
if (this.isPhy == 2) {
|
|
if (this.isPhy == 2) {
|
|
this.isVerification = true
|
|
this.isVerification = true
|
|
this.Data.express_type = 2
|
|
this.Data.express_type = 2
|
|
this.goLocation()
|
|
this.goLocation()
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.getHotel(this.product_id)
|
|
this.getHotel(this.product_id)
|
|
- }, 1000)
|
|
|
|
|
|
+ }, 500)
|
|
|
|
+ }else if(this.isPhy == 1 ){
|
|
|
|
+ this.formData.type = '快递配送'
|
|
|
|
+ this.Data.express_type = 1
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -497,7 +533,28 @@
|
|
::v-deep .is-input-border {
|
|
::v-deep .is-input-border {
|
|
border: none;
|
|
border: none;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //奖品备注
|
|
|
|
+ .shopRemark{
|
|
|
|
+ margin-top: 30rpx;
|
|
|
|
+ margin-bottom: 66rpx;
|
|
|
|
+ padding: 30rpx 24rpx 26rpx;
|
|
|
|
+ background: #F4F5F6;
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
+ .shopRemark-title{
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #333333;
|
|
|
|
+ }
|
|
|
|
+ .shopRemark-content{
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #666666;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
.form {
|
|
.form {
|
|
background: $pageColor;
|
|
background: $pageColor;
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
@@ -514,6 +571,10 @@
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
|
|
+ .selectTypeNone{
|
|
|
|
+ color: #df6220;
|
|
|
|
+ padding-left: 20rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.msg {
|
|
.msg {
|
|
@@ -653,7 +714,8 @@
|
|
padding-top: 40rpx;
|
|
padding-top: 40rpx;
|
|
padding-bottom: 40rpx;
|
|
padding-bottom: 40rpx;
|
|
}
|
|
}
|
|
- .sgActive{
|
|
|
|
|
|
+
|
|
|
|
+ .sgActive {
|
|
color: #FF6200 !important;
|
|
color: #FF6200 !important;
|
|
font-weight: bold !important;
|
|
font-weight: bold !important;
|
|
}
|
|
}
|
|
@@ -685,4 +747,39 @@
|
|
color: #999 !important;
|
|
color: #999 !important;
|
|
font-size: 30rpx !important;
|
|
font-size: 30rpx !important;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //菜单切换
|
|
|
|
+ .tab_nav {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tab_nav .navTitle {
|
|
|
|
+ flex: none;
|
|
|
|
+ width: 336rpx;
|
|
|
|
+ height: 88rpx;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ background: #E8E8E8;
|
|
|
|
+ color: #333;
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ .active {
|
|
|
|
+ width: 336rpx;
|
|
|
|
+ height: 88rpx;
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ background: linear-gradient(90deg, #FF9342 0%, #FF6200 100%);
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
</style>
|
|
</style>
|