合并代码

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({ return util.request({
url: `/coreplay/app/scrollinfo/buyScroll`, url: `/coreplay/app/scrollinfo/buyScroll`,
method: 'POST', method: 'POST',
query: param.query,
data: param.data, data: param.data,
}) })
}, },

View File

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

View File

@ -2,7 +2,6 @@
/** /**
* 卷轴商城 * 卷轴商城
*/ */
// import intergralApi from '@/api/intergral.js';
import api from '@/api/index.js' import api from '@/api/index.js'
import { import {
useStore, useStore,
@ -11,16 +10,24 @@
ref, ref,
reactive, reactive,
computed, computed,
getCurrentInstance
} from 'vue' } from 'vue'
import { import {
onLoad, onLoad,
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
//
import payPwd from '@/components/mine/payPwd'
const {
proxy
} = getCurrentInstance()
// //
const store = useStore() const store = useStore()
// //
const dataList = ref([]) const dataList = ref([])
//
const scrollItem = ref({})
// //
const userinfo = computed(() => { const userinfo = computed(() => {
let result = store.state.userinfo let result = store.state.userinfo
@ -46,15 +53,15 @@
} }
// //
function buyScroll(item) { function buyScroll(secondPassword) {
//
util.alert({
content: '确认购买卷轴',
}).then(rs => {
api.intergral.buyScroll({ api.intergral.buyScroll({
query: {
//
secondPassword: secondPassword,
},
data: { data: {
// id // id
scrollConfigId: item.scrollConfigInfoId, scrollConfigId: scrollItem.value.scrollConfigInfoId,
// //
payType: 1, payType: 1,
} }
@ -69,7 +76,16 @@
showCancel: false, showCancel: false,
}) })
}) })
}) }
/**
* 点击卷轴购买
* @param {Object} item
*/
function handleItem(item) {
scrollItem.value = item
//
proxy.$refs.payPwdRef.open()
} }
</script> </script>
@ -94,7 +110,7 @@
</view> </view>
<view class="rows mt40"> <view class="rows mt40">
<view class="f44">{{item.scrollSeedMoney}}积分</view> <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>
</view> </view>
@ -102,6 +118,9 @@
<view class="fill" style="height: 60rpx;"></view> <view class="fill" style="height: 60rpx;"></view>
</view> </view>
<!-- 购买卷轴 -->
<payPwd ref="payPwdRef" @confirm="buyScroll" />
</template> </template>
<style lang="scss"> <style lang="scss">

View File

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

View File

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

View File

@ -118,10 +118,16 @@
data, data,
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
util.alert({
content: '商品发布成功,请等待后台审核',
showCancel: false,
}).then(() => {
uni.navigateBack()
})
return return
} }
util.alert({ util.alert({
content: rs.content, content: rs.msg,
showCancel: false, showCancel: false,
}) })
}) })
@ -196,7 +202,8 @@
<view class="line rows ptb20"> <view class="line rows ptb20">
<view class="title w150">库存</view> <view class="title w150">库存</view>
<view class="col f1"> <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>
</view> </view>

View File

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