合并代码
This commit is contained in:
parent
06f743bb30
commit
2bb07b4957
|
@ -70,7 +70,8 @@ const video = {
|
|||
*/
|
||||
setLabel(param) {
|
||||
return util.request({
|
||||
url: `/video/api/saveTags`,
|
||||
url: `/video/tag/add`,
|
||||
// url: `/video/api/saveTags`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
load: true,
|
||||
|
@ -472,8 +473,8 @@ const video = {
|
|||
*/
|
||||
setAlarm(param) {
|
||||
return util.request({
|
||||
url: `/home/setAlarm`,
|
||||
query: param.query,
|
||||
url: `/video/clock/setAlarm`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
})
|
||||
},
|
||||
|
@ -483,7 +484,19 @@ const video = {
|
|||
*/
|
||||
getAlarm() {
|
||||
return util.request({
|
||||
url: `/home/getAlarm`,
|
||||
url: `/video/clock/selectAlarm`,
|
||||
method: 'GET',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除闹铃
|
||||
* @param {Object} param
|
||||
*/
|
||||
delAlarm(param) {
|
||||
return util.request({
|
||||
url: `/video/clock/delAlarm`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
const config = {
|
||||
// 接口域名
|
||||
// #ifdef H5
|
||||
host: 'h5api',
|
||||
host: 'http://localhost:5173',
|
||||
// host: 'h5api',
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
host: 'http://91f.xyz:8080',
|
||||
// host: 'http://192.168.0.110:8080',
|
||||
// host: 'http://192.168.0.105:8080',
|
||||
// host: 'http://192.168.0.100:8080',
|
||||
// host: 'http://192.168.0.114:8080',
|
||||
// #endif
|
||||
// 支付方式配置
|
||||
|
|
|
@ -135,6 +135,9 @@ const util = {
|
|||
//
|
||||
reject(res)
|
||||
},
|
||||
complete(rs) {
|
||||
console.log('upload complete',rs)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
|
@ -28,9 +28,11 @@
|
|||
const typeList = reactive([{
|
||||
name: '倒计时闹钟',
|
||||
key: 'countDown',
|
||||
type: '2',
|
||||
}, {
|
||||
name: '时间闹钟',
|
||||
key: 'time',
|
||||
type: '1',
|
||||
}, ])
|
||||
const typeIndex = ref(0)
|
||||
// 小时
|
||||
|
@ -44,6 +46,7 @@
|
|||
// 闹铃时间
|
||||
const alarm = computed(() => {
|
||||
let result = uni.$store.state.alarmTime
|
||||
if (result) result = util.formatTime('yyyy-MM-dd HH:mm:ss', result)
|
||||
return result
|
||||
})
|
||||
// 获取年月日
|
||||
|
@ -84,11 +87,14 @@
|
|||
// 获取设置的倒计时
|
||||
function getAlarm() {
|
||||
api.video.getAlarm().then(rs => {
|
||||
console.log('getAlarm', rs)
|
||||
if (rs.code == 200) {
|
||||
const result = rs.data
|
||||
if (!result) return
|
||||
const findIndex = typeList.findIndex(item => item.type == result.type)
|
||||
if (findIndex != -1) typeIndex.value = findIndex
|
||||
// 结束时间
|
||||
setTime(result.endTime)
|
||||
setTime(result.timestamp)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
@ -204,24 +210,29 @@
|
|||
endTime = util.strtotime(`+${hour[hourIndex.value]} hour`, new Date().getTime())
|
||||
endTime = util.strtotime(`+${minute[minuteIndex.value]} minute`, endTime)
|
||||
endTime = new Date(endTime).setSeconds(0)
|
||||
endTime = util.formatTime('yyyy-MM-dd HH:mm:ss', endTime)
|
||||
// endTime = util.formatTime('yyyy-MM-dd HH:mm:ss', endTime)
|
||||
} else if (type.key == 'time') {
|
||||
// 时间闹钟
|
||||
endTime += ` ${util.toTwo(hour[hourIndex.value])}:${util.toTwo(minute[minuteIndex.value])}:00`
|
||||
// 当前时间
|
||||
const currentTime = new Date(util.formatTime('yyyy-MM-dd HH:mm:ss')).valueOf()
|
||||
// 闹钟时间
|
||||
const alarmTime = new Date(endTime).valueOf()
|
||||
endTime = new Date(endTime).valueOf()
|
||||
|
||||
// 如果闹钟时间小于当前时间
|
||||
if (alarmTime < currentTime) {
|
||||
if (endTime < currentTime) {
|
||||
util.alert('设置闹钟时间应大于当前时间')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 闹钟
|
||||
api.video.setAlarm({
|
||||
query: {
|
||||
endTime,
|
||||
data: {
|
||||
// 类型
|
||||
type: type.type,
|
||||
// 时间
|
||||
timestamp: endTime,
|
||||
}
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
|
@ -240,6 +251,30 @@
|
|||
})
|
||||
}
|
||||
|
||||
// 关闭闹钟
|
||||
function handleClose() {
|
||||
util.alert({
|
||||
content: '确定关闭闹钟提醒?',
|
||||
success: (rs) => {
|
||||
if(!rs.confirm) return
|
||||
api.video.delAlarm({}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
uni.$store.commit('setState', {
|
||||
key: 'alarmTime',
|
||||
value: '',
|
||||
})
|
||||
close()
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: rs.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
defineExpose({
|
||||
open,
|
||||
|
@ -256,7 +291,8 @@
|
|||
|
||||
<!-- 标题 -->
|
||||
<view class="title mtb40">
|
||||
<picker class="df fdr jcc aic" :range="typeList" @change="handleType" :value="typeIndex" range-key="name">
|
||||
<picker class="df fdr jcc aic" :range="typeList" @change="handleType" :value="typeIndex"
|
||||
range-key="name">
|
||||
<text class="tac f40">{{typeList[typeIndex].name}}</text>
|
||||
<uni-icons type="right" color="#999" size="32rpx" />
|
||||
</picker>
|
||||
|
@ -271,7 +307,8 @@
|
|||
<view class="oclock">
|
||||
<!-- 选择器 -->
|
||||
<view class="f1">
|
||||
<picker-view v-if="visible" class="select f1" :value="[hourIndex]" indicator-class="option active" indicator-style="height: 56rpx;" @change="handleHour">
|
||||
<picker-view v-if="visible" class="select f1" :value="[hourIndex]"
|
||||
indicator-class="option active" indicator-style="height: 56rpx;" @change="handleHour">
|
||||
<picker-view-column>
|
||||
<view v-for="(item,index) in hour" :key="index" class="option fdr aic jcc">
|
||||
<text class="text">{{item}}</text>
|
||||
|
@ -286,7 +323,8 @@
|
|||
</view>
|
||||
|
||||
<view class="f1">
|
||||
<picker-view v-if="visible" class="select f1" :value="[minuteIndex]" indicator-class="option active" indicator-style="height: 56rpx;" @change="handleMinute">
|
||||
<picker-view v-if="visible" class="select f1" :value="[minuteIndex]"
|
||||
indicator-class="option active" indicator-style="height: 56rpx;" @change="handleMinute">
|
||||
<picker-view-column>
|
||||
<view v-for="(item,index) in minute" :key="index" class="option fdr aic jcc">
|
||||
<text class="text">{{item}}</text>
|
||||
|
@ -306,8 +344,8 @@
|
|||
<view class="button jcc confirm mtb10" @click="handleSubmit">
|
||||
<text class="text">确认</text>
|
||||
</view>
|
||||
<view class="button jcc cancel mtb10" @click="close()">
|
||||
<text class="text">关闭</text>
|
||||
<view class="button jcc cancel mtb10" @click="handleClose" v-if="alarm">
|
||||
<text class="text">关闭闹钟</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -508,7 +508,8 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="product mtb20" v-if="userinfo.isShop == 1" @click="$refs.productRef.open()">
|
||||
<template v-if="userinfo.isShop == 1">
|
||||
<view class="product mtb20" @click="$refs.productRef.open()">
|
||||
<view class="key">添加商品链接</view>
|
||||
|
||||
<view class="main mtb20 ptb20 tac br20" v-if="!form.productId">点击选择</view>
|
||||
|
@ -534,6 +535,7 @@
|
|||
<input type="text" v-model="form.popupTime" class="input" />
|
||||
<view>秒展示</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="fill" style="height: 150rpx;"></view>
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import {
|
|||
import uni from '@dcloudio/vite-plugin-uni';
|
||||
|
||||
//
|
||||
let target = 'http://91f.xyz:8080'
|
||||
// let target = 'http://91f.xyz:8080'
|
||||
// let target = 'http://192.168.0.110:8080'
|
||||
// let target = 'http://192.168.0.105:8080'
|
||||
let target = 'http://192.168.0.100:8080'
|
||||
// let target = 'http://192.168.0.114:8080'
|
||||
|
||||
export default defineConfig({
|
||||
|
|
Loading…
Reference in New Issue