完成订单详情
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<!-- 金刚区 -->
|
||||
<diamond :district='hometoplist.district'></diamond>
|
||||
<!-- 今日上线 -->
|
||||
<todaylist :todayList='hometoplist.todayProInfo' :salesList="hometoplist.hotRanking" ></todaylist>
|
||||
<todaylist :todayList='hometoplist.todayProInfo' :salesList="hometoplist.hotRanking"></todaylist>
|
||||
<!-- 类目 -->
|
||||
<view :style="{'top':store.height+'px'}" class="fourcontent" id="fourcontent">
|
||||
<view class="flex-between" style="flex-wrap: inherit;">
|
||||
@@ -25,10 +25,10 @@
|
||||
</view>
|
||||
<view class="componentsclass" v-if="showproductlist">
|
||||
<AreaSelect v-if="viewHistoryindex == 0" @updateValue="openproductlist" />
|
||||
<grouping v-if="viewHistoryindex == 1 || viewHistoryindex == 2 || viewHistoryindex == 3"
|
||||
<grouping v-if="viewHistoryindex == 1 || viewHistoryindex == 2 || viewHistoryindex == 3"
|
||||
@grouping="openproductlist" />
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<!-- 首页抢购区域 -->
|
||||
<view class="fivecontent">
|
||||
@@ -164,6 +164,9 @@
|
||||
APIhomehomePageUp,
|
||||
APIhome
|
||||
} from "@/common/api/index/index.js"
|
||||
import {
|
||||
APIgeocodelocation
|
||||
} from "@/common/api/api.js"
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
@@ -203,16 +206,16 @@
|
||||
const refbannervo = ref(null);
|
||||
//数据
|
||||
const hometoplist = reactive({
|
||||
|
||||
|
||||
})
|
||||
// 首页上面数据
|
||||
const hometop = async () => {
|
||||
try {
|
||||
let res = await APIhomehomePageUp()
|
||||
Object.assign(hometoplist, res)
|
||||
hometoplist.freeBannerList.forEach((item, index) => {
|
||||
advertisementStyle.value.push(getStyle(index))
|
||||
})
|
||||
hometoplist.freeBannerList.forEach((item, index) => {
|
||||
advertisementStyle.value.push(getStyle(index))
|
||||
})
|
||||
// 数据加载完后获取dom 高度
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().select('#fourcontent');
|
||||
@@ -231,7 +234,7 @@
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
name:'1'
|
||||
name: '1'
|
||||
})
|
||||
// 使用 reactive 创建响应式对象
|
||||
const timeData = ref({});
|
||||
@@ -334,10 +337,9 @@
|
||||
isSticky.value = res.scrollTop > elementTop.value ? true : false
|
||||
uni.$u.debounce(store.scrollTop = res.scrollTop, 500)
|
||||
});
|
||||
onShow(() => {})
|
||||
onMounted(async () => {
|
||||
onShow(async () => {
|
||||
await proxy.$onLaunched;
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
if (uni.cache.get('shopId')) {
|
||||
showindex.value = 'shopIndex'
|
||||
await storeuser.actionsAPIuser()
|
||||
} else {
|
||||
@@ -346,6 +348,56 @@
|
||||
showindex.value = 'index'
|
||||
// 获取初始定位高度
|
||||
}
|
||||
})
|
||||
onMounted(async () => {
|
||||
try {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: async (res) => {
|
||||
let successres = await APIgeocodelocation({
|
||||
lng: res.longitude,
|
||||
lat: res.latitude,
|
||||
})
|
||||
if (successres) {
|
||||
let datastorage = {
|
||||
country: successres.addressComponent.country, // "中国"
|
||||
province: successres.addressComponent
|
||||
.province, //province: "陕西省"
|
||||
address: successres.addressComponent.city, //district: "西安市"
|
||||
district: successres.addressComponent.district, //district: "未央区"
|
||||
lng: res.longitude,
|
||||
lat: res.latitude,
|
||||
}
|
||||
uni.cache.set('getLocationstorage', datastorage);
|
||||
// 登录
|
||||
proxy.$isResolve()
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
} catch (error) {
|
||||
try {
|
||||
let successres = await APIgeocodelocation({
|
||||
lng: '',
|
||||
lat: '',
|
||||
})
|
||||
if (successres) {
|
||||
let datastorage = {
|
||||
country: successres.addressComponent.country, // "中国"
|
||||
province: successres.addressComponent
|
||||
.province, //province: "陕西省"
|
||||
address: successres.addressComponent.city, //district: "西安市"
|
||||
district: successres.addressComponent.district, //district: "未央区"
|
||||
lng: res.longitude,
|
||||
lat: res.latitude,
|
||||
}
|
||||
uni.cache.set('getLocationstorage', datastorage);
|
||||
proxy.$isResolve()
|
||||
}
|
||||
} catch (error) {
|
||||
proxy.$isResolve()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
|
||||
Reference in New Issue
Block a user