|
@@ -71,7 +71,7 @@
|
|
</image>
|
|
</image>
|
|
<view style="margin-left: 24rpx;">
|
|
<view style="margin-left: 24rpx;">
|
|
<text class="name">{{productDetail.name}}</text>
|
|
<text class="name">{{productDetail.name}}</text>
|
|
- <!-- <text class="tag">礼盒装 </text> -->
|
|
|
|
|
|
+ <text class="tag" v-if="attrArry[0]">{{attrArry[0].attr_group_name == '包装'?attrArry[1].attr_group_name.slice(0,2)+'装':'' }} {{integral}}积分</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="shopNumber">
|
|
<view class="shopNumber">
|
|
@@ -108,9 +108,8 @@
|
|
style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
|
|
style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
|
|
</view>
|
|
</view>
|
|
<view class="chooselag">
|
|
<view class="chooselag">
|
|
- <view @click="companyed(item.name,index)" class="language"
|
|
|
|
- v-for="(item,index) in typeSelect " :key="index"
|
|
|
|
- :class="[activeIndex === index?'sgActive': ''] ">
|
|
|
|
|
|
+ <view @click="companyed(item.name,index)" class="language" v-for="(item,index) in typeSelect "
|
|
|
|
+ :key="index" :class="[activeIndex === index?'sgActive': ''] ">
|
|
<text>{{item.name}}</text>
|
|
<text>{{item.name}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -130,14 +129,14 @@
|
|
style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
|
|
style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
|
|
</view>
|
|
</view>
|
|
<view class="chooselag">
|
|
<view class="chooselag">
|
|
- <view@click="companyedShop(item.name,item.id,item.distanceToMe,index)"
|
|
|
|
- class="language" v-for="(item,index) in hotelList" :key="index"
|
|
|
|
|
|
+ <view@click="companyedShop(item.name,item.id,item.distanceToMe,index)" class="language"
|
|
|
|
+ v-for="(item,index) in hotelList" :key="index"
|
|
:class="[activeIndex2 === index?'sgActive': ''] ">
|
|
:class="[activeIndex2 === index?'sgActive': ''] ">
|
|
<text>{{item.name}}</text>
|
|
<text>{{item.name}}</text>
|
|
- </view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </uni-popup>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ </uni-popup>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -151,8 +150,12 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ //产品规格数组
|
|
|
|
+ attrArry:[],
|
|
|
|
+ //产品规格
|
|
|
|
+ attrName:'',
|
|
//积分
|
|
//积分
|
|
- integral:'',
|
|
|
|
|
|
+ integral: '',
|
|
//选中激活样式
|
|
//选中激活样式
|
|
activeIndex: '',
|
|
activeIndex: '',
|
|
activeIndex2: '',
|
|
activeIndex2: '',
|
|
@@ -190,7 +193,7 @@
|
|
// 产品ID
|
|
// 产品ID
|
|
product_id: '',
|
|
product_id: '',
|
|
// 产品规格ID
|
|
// 产品规格ID
|
|
- attr:'',
|
|
|
|
|
|
+ attr: '',
|
|
},
|
|
},
|
|
// 配送方式
|
|
// 配送方式
|
|
typeSelect: [{
|
|
typeSelect: [{
|
|
@@ -207,8 +210,15 @@
|
|
onLoad(op) {
|
|
onLoad(op) {
|
|
console.log(op, "产品id")
|
|
console.log(op, "产品id")
|
|
this.Data.product_id = op.product_id
|
|
this.Data.product_id = op.product_id
|
|
- this.Data.attr= op.attr
|
|
|
|
|
|
+ this.Data.attr = op.attr
|
|
this.integral = op.integral
|
|
this.integral = op.integral
|
|
|
|
+ this.attrName= op.attrName
|
|
|
|
+ this.attrArry= this.attrName.split("-").map(item=>{
|
|
|
|
+ return {
|
|
|
|
+ attr_group_name: item
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log(this.attrArry[1].attr_group_name.split(','),1111111111111)
|
|
this.getProductDetail(op.product_id)
|
|
this.getProductDetail(op.product_id)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -219,7 +229,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 // 单位千米
|
|
},
|
|
},
|
|
@@ -230,7 +240,7 @@
|
|
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 = res.data.data
|
|
this.hotelList.map(item => {
|
|
this.hotelList.map(item => {
|
|
@@ -239,6 +249,12 @@
|
|
return item;
|
|
return item;
|
|
})
|
|
})
|
|
console.log(this.hotelList, '-------->this.hotelList');
|
|
console.log(this.hotelList, '-------->this.hotelList');
|
|
|
|
+ //最近的酒店
|
|
|
|
+ this.formData.shop = this.hotelList[0].name
|
|
|
|
+ this.formData.distanceToMe = this.hotelList[0].distanceToMe
|
|
|
|
+ this.Data.hotel_id = this.hotelList[0].id
|
|
|
|
+
|
|
|
|
+
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//获取定位
|
|
//获取定位
|
|
@@ -282,7 +298,7 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
//订单兑换
|
|
//订单兑换
|
|
goExchange() {
|
|
goExchange() {
|
|
if (this.formData.type == '' && this.is_virtual == 0) {
|
|
if (this.formData.type == '' && this.is_virtual == 0) {
|
|
@@ -327,14 +343,14 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.is_virtual == 0){
|
|
|
|
|
|
+ if (this.is_virtual == 0) {
|
|
let _this = this
|
|
let _this = this
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '确认使用积分兑换',
|
|
content: '确认使用积分兑换',
|
|
- success: function (res) {
|
|
|
|
|
|
+ success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- if(_this.Data.express_type == 1){
|
|
|
|
|
|
+ if (_this.Data.express_type == 1) {
|
|
_this.$api.product.integralExchange({
|
|
_this.$api.product.integralExchange({
|
|
..._this.Data
|
|
..._this.Data
|
|
}).then(res => {
|
|
}).then(res => {
|
|
@@ -349,8 +365,8 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
- let obj ={}
|
|
|
|
|
|
+ } else {
|
|
|
|
+ let obj = {}
|
|
obj.express_type = _this.Data.express_type
|
|
obj.express_type = _this.Data.express_type
|
|
obj.product_id = _this.Data.product_id
|
|
obj.product_id = _this.Data.product_id
|
|
obj.receiver = _this.Data.receiver
|
|
obj.receiver = _this.Data.receiver
|
|
@@ -377,14 +393,14 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
let _this = this
|
|
let _this = this
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '确认使用积分兑换',
|
|
content: '确认使用积分兑换',
|
|
- success: function (res) {
|
|
|
|
|
|
+ success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- let obj ={}
|
|
|
|
|
|
+ let obj = {}
|
|
obj.express_type = _this.Data.express_type
|
|
obj.express_type = _this.Data.express_type
|
|
obj.product_id = _this.Data.product_id
|
|
obj.product_id = _this.Data.product_id
|
|
obj.receiver = _this.Data.receiver
|
|
obj.receiver = _this.Data.receiver
|
|
@@ -412,7 +428,7 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
change(ret) {
|
|
change(ret) {
|
|
this.formData.region = ret.data.join('-')
|
|
this.formData.region = ret.data.join('-')
|
|
this.Data.area_id = ret.code[2]
|
|
this.Data.area_id = ret.code[2]
|
|
@@ -421,10 +437,10 @@
|
|
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.distanceToMe1 = distance
|
|
this.distanceToMe1 = distance
|
|
- this.activeIndex2= index
|
|
|
|
|
|
+ this.activeIndex2 = index
|
|
this.Data.hotel_id = id
|
|
this.Data.hotel_id = id
|
|
},
|
|
},
|
|
//确定按钮
|
|
//确定按钮
|
|
@@ -497,6 +513,7 @@
|
|
height: 100%;
|
|
height: 100%;
|
|
// background: #f9f9f9;
|
|
// background: #f9f9f9;
|
|
}
|
|
}
|
|
|
|
+
|
|
.distance {
|
|
.distance {
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 60rpx;
|
|
right: 60rpx;
|
|
@@ -565,8 +582,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;
|
|
}
|
|
}
|