Merge branch 'dev' into test
This commit is contained in:
+13
@@ -167,6 +167,19 @@
|
|||||||
"navigationBarTitleText": "提现结果"
|
"navigationBarTitleText": "提现结果"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/user/promotion/PromoterOrder/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/user/promotion/PromoterList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销列表",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/promotion/UserPromotion/index",
|
"path": "pages/user/promotion/UserPromotion/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -341,10 +341,11 @@ export default {
|
|||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
this.location = address[1].data.result.ad_info.city
|
this.location = address.city
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
|
|||||||
+9
-46
@@ -74,7 +74,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from '@/utils/mapConfig'
|
import { getCurAddress, getLocation } from "@/utils/common"
|
||||||
import {
|
import {
|
||||||
getHotelTypeList,
|
getHotelTypeList,
|
||||||
getHotelList
|
getHotelList
|
||||||
@@ -124,56 +124,19 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取当前定位地址
|
//获取当前定位地址
|
||||||
getCurAddress() {
|
async getCurAddressFn() {
|
||||||
const that = this
|
const that = this
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '定位中...'
|
title: '定位中...'
|
||||||
})
|
})
|
||||||
uni.getLocation({
|
const map = await getLocation()
|
||||||
type: 'wgs84',
|
if (map.length > 1) {
|
||||||
success: function(res) {
|
const {latitude, longitude} = map[1]
|
||||||
let latitude = res.latitude
|
getCurAddress(latitude, longitude, address => {
|
||||||
let longitude = res.longitude
|
that.cityName = address.city
|
||||||
// #ifdef H5
|
that.paramCity = address.city
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' +
|
|
||||||
config.key, {
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
that.cityName = json.result.ad_info.city
|
|
||||||
that.paramCity = json.result.ad_info.city
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
}).catch(err => {
|
|
||||||
uni.hideLoading()
|
|
||||||
})
|
})
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.request({
|
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude +
|
|
||||||
'&key=' + config.key,
|
|
||||||
success: function(res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.cityName = res.data.result.ad_info.city
|
|
||||||
that.paramCity = res.data.result.ad_info.city
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
},
|
|
||||||
fail: function(res) {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function(res) {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fetchTypeList() {
|
fetchTypeList() {
|
||||||
this.hotelList = []
|
this.hotelList = []
|
||||||
@@ -195,7 +158,7 @@ export default {
|
|||||||
this.fetchList()
|
this.fetchList()
|
||||||
uni.removeStorageSync('cityName')
|
uni.removeStorageSync('cityName')
|
||||||
} else {
|
} else {
|
||||||
this.getCurAddress()
|
this.getCurAddressFn()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -457,13 +457,11 @@ export default {
|
|||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1 && !this.cityName) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
if(!this.cityName) {
|
this.cityName = address.city
|
||||||
this.cityName = address[1].data.result.ad_info.city
|
})
|
||||||
}
|
|
||||||
// this.search()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tapType(index) {
|
tapType(index) {
|
||||||
|
|||||||
@@ -1399,13 +1399,12 @@ export default {
|
|||||||
getLocationPromise().then(mapData => {
|
getLocationPromise().then(mapData => {
|
||||||
if (mapData.errMsg) {
|
if (mapData.errMsg) {
|
||||||
const { latitude, longitude } = mapData
|
const { latitude, longitude } = mapData
|
||||||
getCurAddress(latitude, longitude).then(address => {
|
getCurAddress(latitude, longitude, address => {
|
||||||
this.cityName = address[1].data.result.ad_info.city
|
console.log(address)
|
||||||
|
this.cityName = address.city
|
||||||
uni.setStorageSync('locationCityName', this.cityName)
|
uni.setStorageSync('locationCityName', this.cityName)
|
||||||
this.isLocating = false
|
this.isLocating = false
|
||||||
this.getPageData()
|
this.getPageData()
|
||||||
}).catch(() => {
|
|
||||||
this.getPageData()
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.isLocating = false
|
this.isLocating = false
|
||||||
|
|||||||
@@ -901,17 +901,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
let location = uni.getStorageSync('location')
|
const location = uni.getStorageSync('location')
|
||||||
if (location.length === 0) {
|
if (location.length === 0) {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
let address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
address = address[1].data.result.ad_info
|
this.postAddress = address.formattedAddress
|
||||||
location = address.province + address.city + address.district
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
this.postAddress = location
|
this.postAddress = location
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取当前位置经纬度
|
// 获取当前位置经纬度
|
||||||
handleLoacation(toast) {
|
handleLoacation(toast) {
|
||||||
@@ -923,9 +924,9 @@ export default {
|
|||||||
const map = await getLocation();
|
const map = await getLocation();
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
let address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
address = address[1].data.result.ad_info
|
that.postAddress = address.formattedAddress
|
||||||
that.postAddress = address.province + address.city + address.district
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
:items="district"
|
:items="district"
|
||||||
></CitySelect>
|
></CitySelect>
|
||||||
</view>
|
</view>
|
||||||
<view class="iconfont icon-dizhi font-color-red" @click="getCurAddress()"></view>
|
<view class="iconfont icon-dizhi font-color-red" @click="getCurAddressFn()"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
import CitySelect from '@/components/CitySelect'
|
import CitySelect from '@/components/CitySelect'
|
||||||
import config from '@/utils/mapConfig'
|
import {getCurAddress, getLocation} from "@/utils/common"
|
||||||
import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user'
|
import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user'
|
||||||
import attrs, { chs_extphone, required } from '@/utils/validate'
|
import attrs, { chs_extphone, required } from '@/utils/validate'
|
||||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||||
@@ -192,113 +192,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取当前定位地址
|
//获取当前定位地址
|
||||||
getCurAddress() {
|
async getCurAddressFn() {
|
||||||
|
const that = this
|
||||||
var that = this;
|
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '定位中...'
|
title: '定位中...'
|
||||||
});
|
|
||||||
|
|
||||||
//this.getLocation();
|
|
||||||
|
|
||||||
uni.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: function (res) {
|
|
||||||
let latitude = res.latitude;
|
|
||||||
let longitude = res.longitude;
|
|
||||||
|
|
||||||
console.log('latitude:' + latitude + 'longitude:' + longitude)
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
|
||||||
{
|
|
||||||
//callbackName: 'QQmap',
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.addressText =
|
|
||||||
json.result.ad_info.province + " " + json.result.ad_info.city + " " + json.result.ad_info.district;
|
|
||||||
that.address.province = json.result.ad_info.province;
|
|
||||||
that.address.city = json.result.ad_info.city;
|
|
||||||
that.address.district = json.result.ad_info.district;
|
|
||||||
that.$set(that.userAddress, 'detail', json.result.formatted_addresses.recommend);
|
|
||||||
//that.userAddress.detail = json.result.formatted_addresses.recommend;
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
|
|
||||||
//设置city_id
|
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
|
||||||
if (pIdx > -1) {
|
|
||||||
var citys = that.district[pIdx].c;
|
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
|
||||||
if (cIdx > -1) {
|
|
||||||
var city = citys[cIdx];
|
|
||||||
that.address.city_id = city.v;
|
|
||||||
console.log('city_id:' + city.v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
// Failed.
|
|
||||||
console.log('地址解析失败:' + JSON.stringify(err));
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
})
|
||||||
// #endif
|
const map = await getLocation()
|
||||||
|
if (map.length > 1) {
|
||||||
// #ifndef H5
|
const {latitude, longitude} = map[1]
|
||||||
uni.request({
|
getCurAddress(latitude, longitude, address => {
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
that.addressText = address.province + " " + address.city + " " + address.county
|
||||||
success: function (res) {
|
that.address.province = address.province
|
||||||
// console.log('res:'+JSON.stringify(res.data));
|
that.address.city = address.city
|
||||||
uni.hideLoading();
|
that.address.district = address.county
|
||||||
that.addressText =
|
that.$set(that.userAddress, 'detail', address.formattedAddress)
|
||||||
res.data.result.ad_info.province + " " + res.data.result.ad_info.city + " " + res.data.result.ad_info.district;
|
|
||||||
that.address.province = res.data.result.ad_info.province;
|
|
||||||
that.address.city = res.data.result.ad_info.city;
|
|
||||||
that.address.district = res.data.result.ad_info.district;
|
|
||||||
//that.userAddress.detail = res.data.result.formatted_addresses.recommend;
|
|
||||||
that.$set(that.userAddress, 'detail', res.data.result.formatted_addresses.recommend);
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
// 设置city_id
|
// 设置city_id
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
const pIdx = that.getIndex(that.address.province, that.district)
|
||||||
if (pIdx > -1) {
|
if (pIdx > -1) {
|
||||||
var citys = that.district[pIdx].c;
|
const citys = that.district[pIdx].c
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
const cIdx = that.getIndex(that.address.city, citys)
|
||||||
if (cIdx > -1) {
|
if (cIdx > -1) {
|
||||||
var city = citys[cIdx];
|
const city = citys[cIdx]
|
||||||
that.address.city_id = city.v;
|
that.address.city_id = city.v
|
||||||
console.log('city_id:' + city.v);
|
console.log('city_id:' + city.v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('地址解析失败');
|
|
||||||
uni.hideLoading();
|
|
||||||
},
|
|
||||||
complete: function () {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
// uni.showToast({
|
|
||||||
// title:'城市定位失败:'+JSON.stringify(res),
|
|
||||||
// icon:'none',
|
|
||||||
// duration:2000
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getCityList: function () {
|
getCityList: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|||||||
@@ -77,11 +77,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation();
|
uni.showLoading({
|
||||||
|
title: '定位中...'
|
||||||
|
})
|
||||||
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1];
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude);
|
getCurAddress(latitude, longitude, address => {
|
||||||
this.cityName = address[1].data.result['ad_info']['city']
|
this.cityName = address.city
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -140,14 +140,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation();
|
uni.showLoading({
|
||||||
|
title: '定位中...'
|
||||||
|
})
|
||||||
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1];
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude);
|
getCurAddress(latitude, longitude, address => {
|
||||||
this.cityName = address[1].data.result['ad_info']['city']
|
this.cityName = address.city
|
||||||
|
this.fetchList()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.fetchList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetchList() {
|
async fetchList() {
|
||||||
|
|||||||
@@ -557,7 +557,7 @@
|
|||||||
v-for="(shop, shopIndex) in shopList"
|
v-for="(shop, shopIndex) in shopList"
|
||||||
:key="shopIndex"
|
:key="shopIndex"
|
||||||
class="village-item v12-white"
|
class="village-item v12-white"
|
||||||
@click="villageItemClick(shop)"
|
@click="hotelItemClick(shop)"
|
||||||
>
|
>
|
||||||
<view class="img-wrap">
|
<view class="img-wrap">
|
||||||
<image
|
<image
|
||||||
@@ -1685,6 +1685,14 @@ export default {
|
|||||||
gotoInvestment(title = '', type = 'investment', id = '') {
|
gotoInvestment(title = '', type = 'investment', id = '') {
|
||||||
uni.navigateTo({ url: `/pkg_product/views/famousQianxianInvestment?id=${id || this.id}&title=${title}&type=${type}` })
|
uni.navigateTo({ url: `/pkg_product/views/famousQianxianInvestment?id=${id || this.id}&title=${title}&type=${type}` })
|
||||||
},
|
},
|
||||||
|
hotelItemClick(item) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pagesInn/inn/innHome',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
villageItemClick(item) {
|
villageItemClick(item) {
|
||||||
uni.navigateTo({ url: `/pkg_product/views/famousQianxianVillageShop?id=${item.id}` })
|
uni.navigateTo({ url: `/pkg_product/views/famousQianxianVillageShop?id=${item.id}` })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ export default {
|
|||||||
onLoad(query) {
|
onLoad(query) {
|
||||||
this.id = (query && query.id) || ''
|
this.id = (query && query.id) || ''
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
this.getCalendar()
|
// this.getCalendar()
|
||||||
getJiaLouBookingRules(this.id).then(res => {
|
getJiaLouBookingRules(this.id).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
this.rules = res.data || ''
|
this.rules = res.data || ''
|
||||||
@@ -256,22 +256,22 @@ export default {
|
|||||||
handleDate() {
|
handleDate() {
|
||||||
this.showDatePicker = true
|
this.showDatePicker = true
|
||||||
},
|
},
|
||||||
/**
|
// /**
|
||||||
* 获取产品可预约日期
|
// * 获取产品可预约日期
|
||||||
*/
|
// */
|
||||||
getCalendar() {
|
// getCalendar() {
|
||||||
const currentMonth = new Date().toISOString().slice(0, 7)
|
// const currentMonth = new Date().toISOString().slice(0, 7)
|
||||||
getJiaLouCalendar({
|
// getJiaLouCalendar({
|
||||||
travelGroupProductId: this.id,
|
// travelGroupProductId: this.id,
|
||||||
month: currentMonth
|
// month: currentMonth
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if (res.status === 200) {
|
// if (res.status === 200) {
|
||||||
this.calendar = res.data || []
|
// this.calendar = res.data || []
|
||||||
// 计算当前日及后面4天
|
// // 计算当前日及后面4天
|
||||||
this.currentWeek = this.computeCurrentWeekFromCalendar()
|
// this.currentWeek = this.computeCurrentWeekFromCalendar()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 calendar 数据计算:今天 + 接下来4天(共5天)
|
* 根据 calendar 数据计算:今天 + 接下来4天(共5天)
|
||||||
@@ -322,6 +322,19 @@ export default {
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
this.detail = res.data
|
this.detail = res.data
|
||||||
this.detail.packageDetails = this.detail.packageDetails.filter(e => e.title !== '')
|
this.detail.packageDetails = this.detail.packageDetails.filter(e => e.title !== '')
|
||||||
|
const inventoryList = Array.isArray(res.data.inventoryStatus) ? res.data.inventoryStatus : []
|
||||||
|
const todayStr = this.formatYMD(new Date())
|
||||||
|
const futureList = inventoryList.filter(item => item.date >= todayStr)
|
||||||
|
const limitedList = (futureList.length ? futureList : inventoryList).slice(0, 5)
|
||||||
|
this.currentWeek = limitedList.map((item, index) => {
|
||||||
|
const dateStr = item.date
|
||||||
|
return {
|
||||||
|
date: dateStr,
|
||||||
|
week: this.getWeekLabel(dateStr),
|
||||||
|
status: this.mapInventoryStatus(item.inventoryStatus),
|
||||||
|
monthDay: index === 0 ? '今日' : this.getMonthDay(dateStr)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -362,25 +375,22 @@ export default {
|
|||||||
* @returns {string} 预约状态文本:可约、已约、不可约
|
* @returns {string} 预约状态文本:可约、已约、不可约
|
||||||
*/
|
*/
|
||||||
findDateStatus(dateStr) {
|
findDateStatus(dateStr) {
|
||||||
// 在calendar数组中查找匹配的日期
|
|
||||||
const matchedDate = this.calendar.find(item => item.date === dateStr)
|
const matchedDate = this.calendar.find(item => item.date === dateStr)
|
||||||
console.log('未找到匹配日期:', matchedDate)
|
console.log('未找到匹配日期:', matchedDate)
|
||||||
// 如果找到匹配的日期,根据inventoryStatus返回对应文本
|
|
||||||
if (matchedDate) {
|
if (matchedDate) {
|
||||||
switch (matchedDate.inventoryStatus) {
|
return this.mapInventoryStatus(matchedDate.inventoryStatus)
|
||||||
|
}
|
||||||
|
return '不可订'
|
||||||
|
},
|
||||||
|
mapInventoryStatus(status) {
|
||||||
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return '可订'
|
return '可订'
|
||||||
case 1:
|
case 1:
|
||||||
return '不可订'
|
|
||||||
case 2:
|
case 2:
|
||||||
return '不可订'
|
|
||||||
default:
|
default:
|
||||||
return '不可订'
|
return '不可订'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 如果没有找到匹配的日期,返回不可约
|
|
||||||
return '不可订'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,8 +19,16 @@
|
|||||||
<swiper-item v-for="(item, index) in traveItems" :key="index" >
|
<swiper-item v-for="(item, index) in traveItems" :key="index" >
|
||||||
<view class="trave-item v12-mr-3 v12-mt-3" @click="toStore(item)">
|
<view class="trave-item v12-mr-3 v12-mt-3" @click="toStore(item)">
|
||||||
<view class="trave-item">
|
<view class="trave-item">
|
||||||
<image class="trave-item" :src="item.cover"></image>
|
<image class="trave-item" :src="item.cover" v-if="item.coverType === 1"></image>
|
||||||
<!-- <video class="trave-item" :src="item.cover" :show-fullscreen-btn="false" :show-center-play-btn="flase" :show-play-btn="false" v-if="item.coverType === 2"></video> -->
|
<video
|
||||||
|
class="trave-item"
|
||||||
|
:src="item.cover"
|
||||||
|
:show-fullscreen-btn="false"
|
||||||
|
:show-center-play-btn="false"
|
||||||
|
:show-play-btn="false"
|
||||||
|
:poster="item.cover + '?vframe/jpg/offset/1'"
|
||||||
|
v-if="item.coverType === 2"
|
||||||
|
></video>
|
||||||
</view>
|
</view>
|
||||||
<view class="trave-btn">
|
<view class="trave-btn">
|
||||||
<text>旅居预约</text>
|
<text>旅居预约</text>
|
||||||
|
|||||||
@@ -52,7 +52,10 @@ export default {
|
|||||||
this.isOpen = !this.isOpen
|
this.isOpen = !this.isOpen
|
||||||
},
|
},
|
||||||
goGoods() {
|
goGoods() {
|
||||||
uni.navigateTo({url: '/pages/home/landMark'})
|
this.$yrouter.switchTab({
|
||||||
|
path: '/pages/home/index',
|
||||||
|
query: {},
|
||||||
|
})
|
||||||
// this.$global.navToGoods(this.data.productId)
|
// this.$global.navToGoods(this.data.productId)
|
||||||
},
|
},
|
||||||
selectCoupon() {
|
selectCoupon() {
|
||||||
|
|||||||
@@ -234,111 +234,6 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
//获取当前定位地址
|
|
||||||
getCurAddress() {
|
|
||||||
var that = this;
|
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
|
||||||
title: '定位中...'
|
|
||||||
});
|
|
||||||
//this.getLocation();
|
|
||||||
uni.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: function (res) {
|
|
||||||
let latitude = res.latitude;
|
|
||||||
let longitude = res.longitude;
|
|
||||||
|
|
||||||
console.log('latitude:' + latitude + 'longitude:' + longitude)
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
|
||||||
{
|
|
||||||
//callbackName: 'QQmap',
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.addressText =
|
|
||||||
json.result.ad_info.province + " " + json.result.ad_info.city + " " + json.result.ad_info.district;
|
|
||||||
that.address.province = json.result.ad_info.province;
|
|
||||||
that.address.city = json.result.ad_info.city;
|
|
||||||
that.address.district = json.result.ad_info.district;
|
|
||||||
that.$set(that.userAddress, 'detail', json.result.formatted_addresses.recommend);
|
|
||||||
//that.userAddress.detail = json.result.formatted_addresses.recommend;
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
|
|
||||||
//设置city_id
|
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
|
||||||
if (pIdx > -1) {
|
|
||||||
var citys = that.district[pIdx].c;
|
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
|
||||||
if (cIdx > -1) {
|
|
||||||
var city = citys[cIdx];
|
|
||||||
that.address.city_id = city.v;
|
|
||||||
console.log('city_id:' + city.v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
// Failed.
|
|
||||||
console.log('地址解析失败:' + JSON.stringify(err));
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.request({
|
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
|
||||||
success: function (res) {
|
|
||||||
// console.log('res:'+JSON.stringify(res.data));
|
|
||||||
uni.hideLoading();
|
|
||||||
that.addressText =
|
|
||||||
res.data.result.ad_info.province + " " + res.data.result.ad_info.city + " " + res.data.result.ad_info.district;
|
|
||||||
that.address.province = res.data.result.ad_info.province;
|
|
||||||
that.address.city = res.data.result.ad_info.city;
|
|
||||||
that.address.district = res.data.result.ad_info.district;
|
|
||||||
//that.userAddress.detail = res.data.result.formatted_addresses.recommend;
|
|
||||||
that.$set(that.userAddress, 'detail', res.data.result.formatted_addresses.recommend);
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
//设置city_id
|
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
|
||||||
if (pIdx > -1) {
|
|
||||||
var citys = that.district[pIdx].c;
|
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
|
||||||
if (cIdx > -1) {
|
|
||||||
var city = citys[cIdx];
|
|
||||||
that.address.city_id = city.v;
|
|
||||||
console.log('city_id:' + city.v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('地址解析失败');
|
|
||||||
uni.hideLoading();
|
|
||||||
},
|
|
||||||
complete: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
// uni.showToast({
|
|
||||||
// title:'城市定位失败:'+JSON.stringify(res),
|
|
||||||
// icon:'none',
|
|
||||||
// duration:2000
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getCityList: function () {
|
getCityList: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
class="cover-swiper"
|
class="cover-swiper"
|
||||||
>
|
>
|
||||||
<swiper-item v-for="(item, i) in list" :key="i" class="cover-swiper-item" :class="{'n-actived' : currentIndex !== i}">
|
<swiper-item v-for="(item, i) in list" :key="i" class="cover-swiper-item" :class="{'n-actived' : currentIndex !== i}">
|
||||||
<view class="cover-item" >
|
<view class="cover-item" :class="{'ios-cover': isIOS}">
|
||||||
<view class="img-wrap">
|
<view class="img-wrap">
|
||||||
<view class="pro-img-wrap " :style="{
|
<view class="pro-img-wrap " :style="{
|
||||||
left: (item.productImageX*2 || 0) + 'rpx',
|
left: (item.productImageX*2 || 0) + 'rpx',
|
||||||
@@ -26,6 +26,16 @@
|
|||||||
}">
|
}">
|
||||||
<image :src="product.image" class="pro-cover-image" mode="widthFix|heightFix" />
|
<image :src="product.image" class="pro-cover-image" mode="widthFix|heightFix" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="good-story"
|
||||||
|
|
||||||
|
v-if="product.productStory && item.isShowProductStory"
|
||||||
|
:style="{
|
||||||
|
right: (item.productStoryX*2 || 0) + 'rpx',
|
||||||
|
top: (item.productStoryY*2 || 0) + 'rpx'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<view v-for="(line, j) in product.productStory.split('/n')" :key="j">{{ line }}</view>
|
||||||
|
</view>
|
||||||
<image :src="item.cover" class="cover-image" mode="widthFix" />
|
<image :src="item.cover" class="cover-image" mode="widthFix" />
|
||||||
<!-- <view class="message-text" :style="{top: currentIndex !== index ? '260rpx' : '220rpx'}">{{ message }}</view> -->
|
<!-- <view class="message-text" :style="{top: currentIndex !== index ? '260rpx' : '220rpx'}">{{ message }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
@@ -69,9 +79,15 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
productStory: '源自云南的宣威火腿月饼,/n以匠心手作,外皮酥香,/n内馅甜咸交融。/n每一口,都是月圆情浓的/n团圆滋味,载着滇地独特的/n饮食文化记忆。',
|
||||||
currentIndex: this.index
|
currentIndex: this.index
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
isIOS() {
|
||||||
|
return uni.getSystemInfoSync().osName === 'ios'
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
index(val) {
|
index(val) {
|
||||||
this.currentIndex = val
|
this.currentIndex = val
|
||||||
@@ -186,4 +202,16 @@ export default {
|
|||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.good-story{
|
||||||
|
position: absolute;
|
||||||
|
color: #fff;
|
||||||
|
height: 320rpx;
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
color: #ffefd2;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
.ios-cover{
|
||||||
|
zoom: 1.01
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="dialog-conent" v-show="isLogin">
|
<view class="dialog-conent" v-show="isLogin">
|
||||||
<view class="gift-card-modal" >
|
<view class="gift-card-modal" :class="{'ios-cover': isIOS}">
|
||||||
<image class="bg-image" :src="!card.isBlind ? card.cover : card.blindBoxImage" mode="widthFix" lazy-load="false"></image>
|
<image class="bg-image" :src="!card.isBlind ? card.cover : card.blindBoxImage" mode="widthFix" lazy-load="false"></image>
|
||||||
<view v-if="card.isBlind !== 1" class="image-wrap" :style="{
|
<view v-if="card.isBlind !== 1" class="image-wrap" :style="{
|
||||||
top: card.productImageY*2 + 'rpx',
|
top: card.productImageY*2 + 'rpx',
|
||||||
@@ -13,6 +13,16 @@
|
|||||||
|
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
class="good-story"
|
||||||
|
v-if="card.isBlind !== 1 && card.giftProducts[0].productStory && card.isShowProductStory"
|
||||||
|
:style="{
|
||||||
|
right: (card.productStoryX*2 || 0) + 'rpx',
|
||||||
|
top: (card.productStoryY*2 || 0) + 'rpx'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<view v-for="(line, j) in card.giftProducts[0].productStory.split('/n')" :key="j">{{ line }}</view>
|
||||||
|
</view>
|
||||||
<view class="wrap-box">
|
<view class="wrap-box">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -21,33 +31,33 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!isTravelGroup">
|
<view v-if="!isTravelGroup" style="margin-top: 200rpx;">
|
||||||
<view class="blind-box" v-if="card.isBlind">
|
<view class="blind-box" v-if="card.isBlind">
|
||||||
<u-icon :name="webUrl + '/orderIcon/礼物.png'" size="30" ></u-icon>
|
<u-icon :name="webUrl + '/orderIcon/礼物.png'" size="30" ></u-icon>
|
||||||
<text class="v12-font-30 v12-dark-text v12-font-bold v12-ml-2">您收到一份来自朋友的神秘礼物</text>
|
<text class="v12-font-30 v12-dark-text v12-font-bold v12-ml-2">您收到一份来自朋友的神秘礼物</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-wrap">
|
<view class="btn-wrap" style="margin-top: 0rpx;">
|
||||||
<button v-if="!isReceive && myGift.isCurrentUser !== 1" class="share-btn v12-white-text v12-primary" @click="setAddress(0)">
|
<button v-if="!isReceive && myGift.isCurrentUser !== 1" class="share-btn v12-white-text v12-primary" @click="setAddress(0)">
|
||||||
填写地址并收下
|
填写地址并收下
|
||||||
</button>
|
</button>
|
||||||
<button v-if="card.canTransfer !== 0 && !isReceive && myGift.isCurrentUser !== 1" open-type="share" class="share-btn v12-white v12-primary-text v12-d-flex" >
|
<button v-if="card.canTransfer !== 0 && !isReceive && myGift.isCurrentUser !== 1" open-type="share" class="share-btn share-btn-second v12-white v12-primary-text v12-d-flex" >
|
||||||
点击转赠给好友
|
点击转赠给好友
|
||||||
<u-icon :name="webUrl + '/icon/share.png'" ></u-icon>
|
<u-icon :name="webUrl + '/icon/share.png'" ></u-icon>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="myGift.isCurrentUser === 1 && !card.isBlind" @click="toOrder" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:200rpx;">
|
<!-- <view v-if="myGift.isCurrentUser === 1 && !card.isBlind" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:200rpx;">
|
||||||
<view class="address-btn v12-white-text v12-primary">
|
|
||||||
您已领取礼包
|
|
||||||
</view>
|
|
||||||
<view class="info-btn v12-text-center v12-font-32 v12-mt-3">查看礼包详情>></view>
|
|
||||||
</view>
|
|
||||||
<view v-if="myGift.isCurrentUser === 1 && card.isBlind" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:200rpx;">
|
|
||||||
<view style="width: fit-content;" class="address-btn v12-white-text v12-primary" @click="toOrder">
|
<view style="width: fit-content;" class="address-btn v12-white-text v12-primary" @click="toOrder">
|
||||||
您已领取礼包,去看看>>
|
您已领取礼包,去看看>>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-btn v12-text-center v12-font-32 v12-mt-3" @click.stop="searchGift">我也要送礼</view>
|
<view class="info-btn v12-text-center v12-font-32 v12-mt-3" @click.stop="searchGift">我也要送礼</view>
|
||||||
|
</view> -->
|
||||||
|
<view v-if="myGift.isCurrentUser === 1" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:60rpx;">
|
||||||
|
<view style="width: 380rpx" class="address-btn v12-white-text v12-primary" @click="toOrder">
|
||||||
|
您已领取礼包,去看看>>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isReceive && myGift.isCurrentUser !== 1" @click="toHome" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:200rpx;">
|
<view style="width: 380rpx" class="info-btn v12-text-center v12-font-32 v12-mt-3" @click.stop="searchGift">我也要送礼</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="isReceive && myGift.isCurrentUser !== 1" @click="toHome" style="z-index: 10; display: flex;flex-direction: column;align-items: center;margin-top:60rpx;">
|
||||||
<view class="address-btn v12-white-text v12-primary">
|
<view class="address-btn v12-white-text v12-primary">
|
||||||
礼包已被领取
|
礼包已被领取
|
||||||
</view>
|
</view>
|
||||||
@@ -59,7 +69,7 @@
|
|||||||
<button class="share-btn v12-white-text v12-primary" @click="setShowAddressForm(true)">
|
<button class="share-btn v12-white-text v12-primary" @click="setShowAddressForm(true)">
|
||||||
填写信息并收下
|
填写信息并收下
|
||||||
</button>
|
</button>
|
||||||
<button v-if="card.canTransfer !== 0" open-type="share" class="share-btn v12-white v12-primary-text v12-d-flex" >
|
<button v-if="card.canTransfer !== 0" open-type="share" class="share-btn share-btn-second v12-white v12-primary-text v12-d-flex" >
|
||||||
点击转赠给好友
|
点击转赠给好友
|
||||||
<u-icon :name="webUrl + '/icon/share.png'" ></u-icon>
|
<u-icon :name="webUrl + '/icon/share.png'" ></u-icon>
|
||||||
</button>
|
</button>
|
||||||
@@ -131,6 +141,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
productStory: '源自云南的宣威火腿月饼,/n以匠心手作,外皮酥香,/n内馅甜咸交融。/n每一口,都是月圆情浓的/n团圆滋味,载着滇地独特的/n饮食文化记忆。',
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
// 组件数据
|
// 组件数据
|
||||||
giftNotice: '',
|
giftNotice: '',
|
||||||
@@ -146,6 +157,9 @@ export default {
|
|||||||
const isReceiveNum = this.card.giftProducts && this.card.giftProducts.filter(e => e.isReceive === 1).length
|
const isReceiveNum = this.card.giftProducts && this.card.giftProducts.filter(e => e.isReceive === 1).length
|
||||||
return gitfNum === isReceiveNum
|
return gitfNum === isReceiveNum
|
||||||
},
|
},
|
||||||
|
isIOS() {
|
||||||
|
return uni.getSystemInfoSync().osName === 'ios'
|
||||||
|
},
|
||||||
isLogin() {
|
isLogin() {
|
||||||
return !!cookie.get('login_status');
|
return !!cookie.get('login_status');
|
||||||
},
|
},
|
||||||
@@ -393,11 +407,13 @@ export default {
|
|||||||
z-index: 999;
|
z-index: 999;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border: 1rpx solid #C52733 ;
|
border: 1rpx solid #C52733 ;
|
||||||
margin-left: 10rpx;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
}
|
}
|
||||||
|
.share-btn-second{
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
.share-btn::before{
|
.share-btn::before{
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
@@ -439,4 +455,16 @@ export default {
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
.good-story{
|
||||||
|
position: absolute;
|
||||||
|
color: #fff;
|
||||||
|
height: 320rpx;
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
color: #ffefd2;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
.ios-cover{
|
||||||
|
zoom: 1.01
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -290,6 +290,34 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
|
||||||
|
if (!productInfo || !productInfo.productStory) {
|
||||||
|
return {
|
||||||
|
coverList,
|
||||||
|
template: defaultTemplate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const list = coverList && coverList.length ? [...coverList] : []
|
||||||
|
if (!list.length) {
|
||||||
|
return {
|
||||||
|
coverList: list,
|
||||||
|
template: defaultTemplate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const storyIndex = list.findIndex(item => item && item.isShowProductStory)
|
||||||
|
if (storyIndex === -1) {
|
||||||
|
return {
|
||||||
|
coverList: list,
|
||||||
|
template: defaultTemplate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const storyCover = list.splice(storyIndex, 1)[0]
|
||||||
|
list.unshift(storyCover)
|
||||||
|
return {
|
||||||
|
coverList: list,
|
||||||
|
template: storyCover
|
||||||
|
}
|
||||||
|
},
|
||||||
// 团购价计算
|
// 团购价计算
|
||||||
computedTravelGroupPrice(useDefaultCouponId) {
|
computedTravelGroupPrice(useDefaultCouponId) {
|
||||||
const params = {
|
const params = {
|
||||||
@@ -345,16 +373,21 @@ export default {
|
|||||||
}
|
}
|
||||||
getGiftCardResend(params).then(res => {
|
getGiftCardResend(params).then(res => {
|
||||||
this.isPayOk = false
|
this.isPayOk = false
|
||||||
this.coverList = [...res.data.giftCardTemplates, res.data.specialGiftCardTemplate]
|
const temp = res.data.giftCardTemplates.filter(e => e.isTravelGroup === 0)
|
||||||
this.cartId = res.data.cartInfo[0].id
|
const hasSpecial = res.data.giftCardTemplates.map(e => e.id).includes(res.data.specialGiftCardTemplate.id)
|
||||||
|
const initialCoverList = hasSpecial ? [...temp] : [...temp, res.data.specialGiftCardTemplate]
|
||||||
|
const goodsInfo = res.data.cartInfo[0]
|
||||||
|
const { coverList, template } = this.adjustCoverListForProductStory(initialCoverList, goodsInfo && goodsInfo.productInfo, res.data.specialGiftCardTemplate)
|
||||||
|
this.coverList = coverList
|
||||||
|
this.cartId = goodsInfo.id
|
||||||
this.giftNotice = res.data.giftCardGiftNotice
|
this.giftNotice = res.data.giftCardGiftNotice
|
||||||
this.orderKey = res.data.orderKey
|
this.orderKey = res.data.orderKey
|
||||||
this.goodsInfo = res.data.cartInfo[0]
|
this.goodsInfo = goodsInfo
|
||||||
this.templateId = res.data.specialGiftCardTemplate.id
|
this.templateId = template.id
|
||||||
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
|
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
|
||||||
console.log(this.defaultIndex, 'defaultIndex');
|
console.log(this.defaultIndex, 'defaultIndex');
|
||||||
this.selectedCover = res.data.specialGiftCardTemplate.cover
|
this.selectedCover = template.cover
|
||||||
this.giftImage = res.data.specialGiftCardTemplate.image
|
this.giftImage = template.image
|
||||||
this.couponId = ''
|
this.couponId = ''
|
||||||
this.computedPrice(this.goodsInfo.cartNum)
|
this.computedPrice(this.goodsInfo.cartNum)
|
||||||
})
|
})
|
||||||
@@ -423,13 +456,17 @@ export default {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
getGiftCardSendOrderConfirm(params).then(res => {
|
getGiftCardSendOrderConfirm(params).then(res => {
|
||||||
const temp = this.isGroupBuy ? res.data.giftCardTemplates : res.data.giftCardTemplates.filter(e => e.isTravelGroup === 0)
|
const temp = this.isGroupBuy ? res.data.giftCardTemplates : res.data.giftCardTemplates.filter(e => e.isTravelGroup === 0)
|
||||||
this.coverList = res.data.giftCardTemplates.map(e => e.id).includes(res.data.specialGiftCardTemplate.id) ? [...temp] : [...temp, res.data.specialGiftCardTemplate]
|
const hasSpecial = res.data.giftCardTemplates.map(e => e.id).includes(res.data.specialGiftCardTemplate.id)
|
||||||
|
const initialCoverList = hasSpecial ? [...temp] : [...temp, res.data.specialGiftCardTemplate]
|
||||||
|
const goodsInfo = res.data.cartInfo[0]
|
||||||
|
const { coverList, template } = this.adjustCoverListForProductStory(initialCoverList, goodsInfo && goodsInfo.productInfo, res.data.specialGiftCardTemplate)
|
||||||
|
this.coverList = coverList
|
||||||
this.giftNotice = res.data.giftCardGiftNotice
|
this.giftNotice = res.data.giftCardGiftNotice
|
||||||
this.orderKey = res.data.orderKey
|
this.orderKey = res.data.orderKey
|
||||||
this.goodsInfo = res.data.cartInfo[0]
|
this.goodsInfo = goodsInfo
|
||||||
this.templateId = res.data.specialGiftCardTemplate.id
|
this.templateId = template.id
|
||||||
this.selectedCover = res.data.specialGiftCardTemplate.cover
|
this.selectedCover = template.cover
|
||||||
this.giftImage = res.data.specialGiftCardTemplate.image
|
this.giftImage = template.image
|
||||||
this.blindImage = res.data.giftCardBlindBoxShareImage
|
this.blindImage = res.data.giftCardBlindBoxShareImage
|
||||||
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
|
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
|
||||||
// if(!this.couponId) {
|
// if(!this.couponId) {
|
||||||
|
|||||||
+33
-5
@@ -20,11 +20,39 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getCurAddress(latitude, longitude) {
|
getCurAddress(latitude, longitude, cb) {
|
||||||
return uni.request({
|
const postStr = {
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude +
|
lon: longitude,
|
||||||
'&key=' + config.key
|
lat: latitude,
|
||||||
});
|
ver: 1 // 接口版本号
|
||||||
|
}
|
||||||
|
const encodedPostStr = encodeURIComponent(JSON.stringify(postStr))
|
||||||
|
|
||||||
|
uni.request({
|
||||||
|
url: `https://api.tianditu.gov.cn/geocoder?postStr=${encodedPostStr}&type=geocode&tk=${config.key}`,
|
||||||
|
method: 'GET',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.status === '0') { // 请求成功[6](@ref)
|
||||||
|
const result = res.data.result;
|
||||||
|
// 从返回数据中提取省市区信息[1,6](@ref)
|
||||||
|
const addressComponent = result.addressComponent;
|
||||||
|
const province = addressComponent.province; // 省份
|
||||||
|
const city = addressComponent.city; // 城市
|
||||||
|
const county = addressComponent.county; // 区县
|
||||||
|
const formattedAddress = result.formatted_address; // 完整地址
|
||||||
|
cb && cb({
|
||||||
|
province,
|
||||||
|
city,
|
||||||
|
county,
|
||||||
|
formattedAddress
|
||||||
|
})
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getLocationSetting(cb) {
|
getLocationSetting(cb) {
|
||||||
|
|||||||
+1
-1
@@ -2,6 +2,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
//key: 'LBZBZ-XAJRO-HKYWF-SOACS-HSTYQ-ZUF44'
|
//key: 'LBZBZ-XAJRO-HKYWF-SOACS-HSTYQ-ZUF44'
|
||||||
key: 'J2WBZ-WS366-SL2SI-M35IG-IU7OH-4YFKF'
|
key: '653f4f2f787ee9d156ab24c663868938'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,8 +40,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
fetchSpecialty
|
fetchSpecialty
|
||||||
} from "@/api/shop";
|
} from "@/api/shop"
|
||||||
import config from '@/utils/mapConfig';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -53,12 +52,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
let memCityName = uni.getStorageSync("cityName")
|
const memCityName = uni.getStorageSync("cityName")
|
||||||
if (memCityName.length) {
|
if (memCityName.length) {
|
||||||
this.cityName = memCityName;
|
this.cityName = memCityName
|
||||||
this.page = 1;
|
this.page = 1
|
||||||
this.list = [];
|
this.list = []
|
||||||
this.fetchList(this.cityName);
|
this.fetchList(this.cityName)
|
||||||
uni.removeStorageSync("cityName")
|
uni.removeStorageSync("cityName")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -89,67 +88,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
|
||||||
//获取当前定位地址
|
|
||||||
getCurAddress() {
|
|
||||||
var that = this;
|
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
|
||||||
title: '定位中...'
|
|
||||||
});
|
|
||||||
|
|
||||||
uni.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: function (res) {
|
|
||||||
let latitude = res.latitude;
|
|
||||||
let longitude = res.longitude;
|
|
||||||
|
|
||||||
console.log('latitude:' + latitude + 'longitude:' + longitude)
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' +
|
|
||||||
config.key, {
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
that.cityName = json.result.ad_info.city;
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
}).catch(err => {
|
|
||||||
// Failed.
|
|
||||||
console.log('地址解析失败:' + JSON.stringify(err));
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.request({
|
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude +
|
|
||||||
'&key=' + config.key,
|
|
||||||
success: function (res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.cityName = res.data.result.ad_info.city;
|
|
||||||
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('地址解析失败');
|
|
||||||
uni.hideLoading();
|
|
||||||
},
|
|
||||||
complete: function () {
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user