合并代码

This commit is contained in:
sx 2025-02-04 13:45:10 +08:00
parent 933dc40ea2
commit 9f02c72dbd
7 changed files with 64 additions and 38 deletions

View File

@ -97,6 +97,7 @@ const intergral = {
return util.request({
url: `/coreplay/app/scrollinfo/buyScroll`,
method: 'POST',
query: param.query,
data: param.data,
})
},

View File

@ -1477,7 +1477,7 @@ const util = {
reslove(rs.data)
const userinfo = rs.data
// 如果开启了青少年模式
if (userinfo.teenTime) getTeenMode(userinfo.teenTime)
if (userinfo.teenTime) util.getTeenMode(userinfo.teenTime)
// 提交
store.commit('setState', {
key: 'userinfo',
@ -1501,10 +1501,11 @@ const util = {
// 当前小时
const currentHour = currentDate.getHours()
// 大于八点 小于22点 当前时间小于设定时间
const result = currentHour >= 8 && currentHour < 22 && currentDate.valueOf() < new Date(teenTime).valueOf()
const result = currentHour >= 6 && currentHour < 22 && currentDate.valueOf() < new Date(teenTime).valueOf()
// 锁定
function lock() {
console.log('lock')
uni.reLaunch({
url: '/pages/login/lock'
})
@ -1512,6 +1513,7 @@ const util = {
// 结果
if (result) {
console.log('time', new Date(teenTime).valueOf() - currentDate.valueOf())
// 设置定时器
setTimeout(() => {
lock()

View File

@ -2,7 +2,6 @@
/**
* 卷轴商城
*/
// import intergralApi from '@/api/intergral.js';
import api from '@/api/index.js'
import {
useStore,
@ -11,16 +10,24 @@
ref,
reactive,
computed,
getCurrentInstance
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util';
//
import payPwd from '@/components/mine/payPwd'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const dataList = ref([])
//
const scrollItem = ref({})
//
const userinfo = computed(() => {
let result = store.state.userinfo
@ -46,31 +53,40 @@
}
//
function buyScroll(item) {
//
util.alert({
content: '确认购买卷轴',
function buyScroll(secondPassword) {
api.intergral.buyScroll({
query: {
//
secondPassword: secondPassword,
},
data: {
// id
scrollConfigId: scrollItem.value.scrollConfigInfoId,
//
payType: 1,
}
}).then(rs => {
api.intergral.buyScroll({
data: {
// id
scrollConfigId: item.scrollConfigInfoId,
//
payType: 1,
}
}).then(rs => {
if (rs.code === 200) {
util.alert('购买成功')
// util.getUserinfo()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
if (rs.code === 200) {
util.alert('购买成功')
// util.getUserinfo()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 点击卷轴购买
* @param {Object} item
*/
function handleItem(item) {
scrollItem.value = item
//
proxy.$refs.payPwdRef.open()
}
</script>
<template>
@ -79,7 +95,7 @@
<view class="board rows oh mt20 mlr30 plr30 cfff f32 br20">
<image class="image" src="/static/integral.png" mode="aspectFit" />
<view class="f1">我的卷轴</view>
<uni-icons type="right" color="#fff" size="40rpx" />
<uni-icons type="right" color="#fff" size="40rpx" />
</view>
</navigator>
@ -94,7 +110,7 @@
</view>
<view class="rows mt40">
<view class="f44">{{item.scrollSeedMoney}}积分</view>
<view class="btn black f1 ml45" @click="buyScroll(item)">{{item.price}}购买</view>
<view class="btn black f1 ml45" @click="handleItem(item)">{{item.price}}购买</view>
</view>
</view>
@ -102,6 +118,9 @@
<view class="fill" style="height: 60rpx;"></view>
</view>
<!-- 购买卷轴 -->
<payPwd ref="payPwdRef" @confirm="buyScroll" />
</template>
<style lang="scss">

View File

@ -38,7 +38,7 @@
// md5
data.userPassword = CryptoJS.MD5(data.userPassword).toString();
api.login.validateUserPassWord({
api.mine.checkSecondLevelCipher({
data,
}).then(rs => {
if (rs.code === 200) {
@ -58,7 +58,7 @@
api.mine.updateUserInfo({
data: {
userId: userinfo.value.userId,
youth: '0',
teen
}
}).then(rs => {
if (rs.code == 200) {

View File

@ -12,10 +12,7 @@
// vuex
const store = useStore()
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
const userinfo = computed(() => store.state.userinfo)
//
function handleUpdate() {
@ -45,7 +42,7 @@
</view>
</view>
<view class="btn pro black mtb30 mlr60" v-if="userinfo.youth == 1">已开启青少年模式</view>
<view class="btn pro black mtb30 mlr60" v-if="userinfo.teenTime">已开启青少年模式</view>
<view class="btn pro black mtb30 mlr60" v-else @click="handleUpdate">开启青少年模式</view>
<view class="fill" style="height: 30rpx;"></view>

View File

@ -88,7 +88,7 @@
type: 1,
success: rs => {
item.image = rs.value
console.log('spec',form.spec)
console.log('spec', form.spec)
}
})
}
@ -118,10 +118,16 @@
data,
}).then(rs => {
if (rs.code == 200) {
util.alert({
content: '商品发布成功,请等待后台审核',
showCancel: false,
}).then(() => {
uni.navigateBack()
})
return
}
util.alert({
content: rs.content,
content: rs.msg,
showCancel: false,
})
})
@ -196,7 +202,8 @@
<view class="line rows ptb20">
<view class="title w150">库存</view>
<view class="col f1">
<input type="text" v-model="item.stock" placeholder="输入库存" placeholder-class="placeholderStyle" />
<input type="text" v-model="item.stock" placeholder="输入库存"
placeholder-class="placeholderStyle" />
</view>
</view>
</view>

View File

@ -5,8 +5,8 @@ import uni from '@dcloudio/vite-plugin-uni';
//
// let target = 'http://91f.xyz:8080'
// let target = 'http://192.168.31.41:8080'
let target = 'http://192.168.31.61:8080'
let target = 'http://192.168.31.41:8080'
// let target = 'http://192.168.31.61:8080'
export default defineConfig({
plugins: [uni()],