master
王文杰 8 months ago
parent 9abd719f11
commit d405d00dd3

@ -1,8 +1,18 @@
<!--
* @Author: 王文杰
* @Date: 2024-01-04 12:54:56
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-08 12:02:09
* @FilePath: /app-nx-personal/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts"> <script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { updateManager } from '@/utils/index'
onLaunch(() => { onLaunch(() => {
console.log('App Launch') console.log('App Launch')
updateManager()
}) })
onShow(() => { onShow(() => {
console.log('App Show') console.log('App Show')

@ -309,7 +309,6 @@ page {
border-bottom: 2rpx solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.list { .list {
padding: 0 20rpx;
background-color: #fff; background-color: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;

@ -90,9 +90,7 @@ const selectLDate = (val) => {
if(val.desc=='今天' || val==1) { if(val.desc=='今天' || val==1) {
const nowH = new Date().getHours() const nowH = new Date().getHours()
console.log(nowH) console.log(nowH)
debugger
if (nowH <= 10) { if (nowH <= 10) {
debugger
timeList = t timeList = t
} else if (nowH <= 12) { } else if (nowH <= 12) {
t[0].disabled = true t[0].disabled = true
@ -122,9 +120,9 @@ const selectLDate = (val) => {
} }
console.log('最终的时间列表', timeList) console.log('最终的时间列表', timeList)
} else { } else {
timeList = t; timeList = t
} }
sRightDate.value = ''; sRightDate.value = ''
} }
// //
@ -136,7 +134,6 @@ onReady(async () => {
const hide = () => { const hide = () => {
popup.value?.close?.() popup.value?.close?.()
} }
</script> </script>
<template> <template>
<uni-popup ref="popup" type="bottom"> <uni-popup ref="popup" type="bottom">
@ -161,9 +158,9 @@ const hide = ()=> {
:key="index" :key="index"
class="rBox" class="rBox"
> >
{{ item.time }}{{ item.disabled ? ' (超出配送时间)' : '' }} {{ item.time }}{{ item.disabled ? ' (超出回收时间)' : '' }}
</view> </view>
<view v-if="timeList.length<1" class="empty f28 text-center" style="color: #999; margin-top: 40rpx"> <view v-if="!timeList.length" class="empty f28 text-center" style="color: #999; margin-top: 40rpx">
今天没有时间了,看看明天吧 今天没有时间了,看看明天吧
</view> </view>
</view> </view>

@ -13,20 +13,20 @@ const memberStore = useMemberStore()
// //
const bannerList = ref<BannerItem[]>([ const bannerList = ref<BannerItem[]>([
{ {
id: '24', id: '1',
imgUrl: '/static/images/banner1.jpg', imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1013001', hrefUrl: '1013001',
type: '1', type: '1',
}, },
{ {
id: '22', id: '2',
imgUrl: '/static/images/banner1.jpg', imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1019000', hrefUrl: '1019000',
type: '1', type: '1',
}, },
{ {
hrefUrl: '1005000', hrefUrl: '1005000',
id: '321', id: '3',
imgUrl: '/static/images/banner3.jpg', imgUrl: '/static/images/banner3.jpg',
type: '1', type: '1',
}, },

@ -147,30 +147,29 @@ const getMemberProfileData = async () => {
</view> --> </view> -->
<view class="list"> <view class="list">
<navigator class="loation item arrow" url="/pages/orderList/list" hover-class="none">
<uni-icons type="cart" color="#3775F6" size="20"></uni-icons>
<view class="label"> 我的订单 </view>
</navigator>
<navigator class="loation item arrow" url="/pages/serviceSite/serviceSite" hover-class="none">
<uni-icons type="shop" color="#3775F6" size="20"></uni-icons>
<view class="label"> 服务站 </view>
</navigator>
<button hover-class="none" class="item arrow" open-type="contact"> <button hover-class="none" class="item arrow" open-type="contact">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons> <uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
<view class="label"> 联系我们 </view> <view class="label"> 联系我们 </view>
</button> </button>
<navigator class="loation item arrow" url="/pagesMember/address/address" hover-class="none">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<view class="label"> 地址 </view>
</navigator>
<navigator <navigator
class="settings item arrow" class="settings item arrow"
url="/pagesMember/settings/settings" url="/pagesMember/settings/settings"
hover-class="none" hover-class="none">
>
<uni-icons type="settings" color="#3775F6" size="20"></uni-icons> <uni-icons type="settings" color="#3775F6" size="20"></uni-icons>
<view class="label"> 设置 </view> <view class="label"> 设置 </view>
</navigator> </navigator>
<navigator class="loation item arrow" url="/pagesMember/address/address" hover-class="none">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<view class="label"> 地址 </view>
</navigator>
<navigator class="loation item arrow" url="/pages/serviceSite/serviceSite" hover-class="none">
<uni-icons type="shop" color="#3775F6" size="20"></uni-icons>
<view class="label"> 服务站 </view>
</navigator>
<navigator class="loation item arrow" url="/pages/orderList/list" hover-class="none">
<uni-icons type="cart" color="#3775F6" size="20"></uni-icons>
<view class="label"> 我的订单 </view>
</navigator>
</view> </view>
</view> </view>
</template> </template>

@ -4,20 +4,20 @@ import { onLoad, onReady } from '@dcloudio/uni-app'
import { getSiteDetailAPI } from '@/services/site' import { getSiteDetailAPI } from '@/services/site'
const bannerList = [ const bannerList = [
{ {
hrefUrl: '1005000', id: '1',
id: '25',
imgUrl: '/static/images/banner1.jpg', imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1013001',
type: '1', type: '1',
}, },
{ {
hrefUrl: '1005000', id: '2',
id: '21', imgUrl: '/static/images/banner1.jpg',
imgUrl: '/static/images/banner2.jpg', hrefUrl: '1019000',
type: '1', type: '1',
}, },
{ {
hrefUrl: '1005000', hrefUrl: '1005000',
id: '321', id: '3',
imgUrl: '/static/images/banner3.jpg', imgUrl: '/static/images/banner3.jpg',
type: '1', type: '1',
}, },

@ -11,8 +11,8 @@
* 4. token * 4. token
*/ */
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const baseURL = 'http://192.168.0.166:8808/api' // const baseURL = 'http://192.168.0.166:8808/api'
// const baseURL = 'http://222.71.165.188:8808/api' const baseURL = 'http://222.71.165.188:8808/api'
// 添加拦截器 // 添加拦截器
const httpInterceptor = { const httpInterceptor = {
// 拦截前触发 // 拦截前触发

@ -1,3 +1,11 @@
/*
* @Author:
* @Date: 2024-01-04 12:54:56
* @LastEditors:
* @LastEditTime: 2024-03-08 12:02:52
* @FilePath: /app-nx-personal/src/utils/index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/** /**
* *
* @param date * @param date
@ -21,3 +29,40 @@ export const formatDate = (date: Date, format = 'YYYY-MM-DD HH:mm:ss') => {
.replace('mm', minutes) .replace('mm', minutes)
.replace('ss', seconds) .replace('ss', seconds)
} }
/**
*
*
* @return {[type]} [return description]
*/
export const updateManager = () => {
const updateManager = uni.getUpdateManager() // 小程序版本更新管理器
updateManager.onCheckForUpdate((res) => {
// 检测新版本后的回调
if (res.hasUpdate) {
// 如果有新版本提醒并进行强制升级
uni.showModal({
content: '新版本已经准备好,是否重启应用?',
showCancel: false,
confirmText: '确定',
success: (res) => {
if (res.confirm) {
updateManager.onUpdateReady((res) => {
// 新版本下载完成的回调
updateManager.applyUpdate() // 强制当前小程序应用上新版本并重启
})
updateManager.onUpdateFailed((res) => {
// 新版本下载失败的回调
// 新版本下载失败,提示用户删除后通过冷启动重新打开
uni.showModal({
content: '下载失败,请删除当前小程序后重新打开',
showCancel: false,
confirmText: '知道了',
})
})
}
},
})
}
})
}

Loading…
Cancel
Save