合并代码
This commit is contained in:
parent
933dc40ea2
commit
9f02c72dbd
|
@ -97,6 +97,7 @@ const intergral = {
|
|||
return util.request({
|
||||
url: `/coreplay/app/scrollinfo/buyScroll`,
|
||||
method: 'POST',
|
||||
query: param.query,
|
||||
data: param.data,
|
||||
})
|
||||
},
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,15 +53,15 @@
|
|||
}
|
||||
|
||||
// 购买卷轴
|
||||
function buyScroll(item) {
|
||||
//
|
||||
util.alert({
|
||||
content: '确认购买卷轴',
|
||||
}).then(rs => {
|
||||
function buyScroll(secondPassword) {
|
||||
api.intergral.buyScroll({
|
||||
query: {
|
||||
// 二级密码
|
||||
secondPassword: secondPassword,
|
||||
},
|
||||
data: {
|
||||
// 卷轴id
|
||||
scrollConfigId: item.scrollConfigInfoId,
|
||||
scrollConfigId: scrollItem.value.scrollConfigInfoId,
|
||||
// 付款类型
|
||||
payType: 1,
|
||||
}
|
||||
|
@ -69,7 +76,16 @@
|
|||
showCancel: false,
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击卷轴购买
|
||||
* @param {Object} item
|
||||
*/
|
||||
function handleItem(item) {
|
||||
scrollItem.value = item
|
||||
//
|
||||
proxy.$refs.payPwdRef.open()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -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">
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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()],
|
||||
|
|
Loading…
Reference in New Issue