合并代码

This commit is contained in:
sx 2025-01-05 15:43:14 +08:00
parent 1323d54c75
commit 4bc0294829
17 changed files with 268 additions and 196 deletions

View File

@ -44,7 +44,13 @@
// //
getConfig() { getConfig() {
api.getConfig().then(rs => { api.getConfig().then(rs => {
if(rs.code == 200) {
store.commit('setState', {
key: 'config',
value: rs.data
})
return
}
}) })
} }
} }

View File

@ -3,6 +3,28 @@ import util from '@/common/js/util.js'
// 卷轴积分 // 卷轴积分
export const durian = { export const durian = {
/**
* 果树列表
* @param {Object} param
*/
durianList(param) {
return util.request({
url: `/coreplay/duriantreeinfo/tree-list`,
method: 'GET',
query: param.query,
})
},
/**
* 榴莲果释放明细
* @param {Object} param
*/
getLog(param) {
return util.request({
url: `/coreplay/durianfruitdetail/getDetailInfoByTreeId`,
method: 'GET',
query: param.query,
})
},
/** /**
* 果树列表 * 果树列表
* @param {Object} param * @param {Object} param

View File

@ -46,9 +46,9 @@ const api = {
*/ */
getArticle(param) { getArticle(param) {
return util.request({ return util.request({
url: '/home/getArticle', url: '/user/protocol/inquire',
query: param.query, path: param.path,
method: 'POST', method: 'GET',
}) })
}, },

View File

@ -1728,9 +1728,7 @@ const util = {
uni.setClipboardData({ uni.setClipboardData({
data: text, data: text,
success: () => { success: () => {
util.alert({ util.alert('文本已复制到剪贴板')
title: '文本已复制到剪贴板',
})
} }
}); });
}, },

View File

@ -19,10 +19,21 @@
const task = computed(() => { const task = computed(() => {
return store.state.task return store.state.task
}) })
//
const config = computed(() => {
return store.state.config
})
// //
const progress = computed(() => { const progress = computed(() => {
let result = task.value.viewingDuration let result = task.value.viewingDuration
result = (Number(result) % 300) / 3 //
const option = {
//
0: config.value.TASK_READING_SECOND,
//
1: config.value.EFFECTIVE_SECONDS,
}
result = (Number(result) % Number(option[task.value.taskType])) / 3
return result return result
}) })

View File

@ -37,7 +37,7 @@
<uni-icons type="circle" size="40rpx" color="#99" v-else /> <uni-icons type="circle" size="40rpx" color="#99" v-else />
</view> </view>
<text>已阅读并同意</text> <text>已阅读并同意</text>
<text class="mlr10 c333" @click="article(1)">服务协议</text> <text class="mlr10 c333" @click="article(3)">用户协议</text>
<text></text> <text></text>
<text class="mlr10 c333" @click="article(1)">隐私政策</text> <text class="mlr10 c333" @click="article(1)">隐私政策</text>
</view> </view>

View File

@ -15,7 +15,9 @@
import api from '@/api'; import api from '@/api';
// //
const wrap = reactive({}) const wrap = reactive({
content: ``
})
// id // id
const wrapId = ref('') const wrapId = ref('')
@ -28,9 +30,7 @@
// //
function getDetail() { function getDetail() {
api.getArticle({ api.getArticle({
query: { path: [wrapId.value]
id: wrapId.value
}
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
Object.assign(wrap, rs.data) Object.assign(wrap, rs.data)
@ -50,7 +50,7 @@
<view class="title mt30 tac c333 f40">{{wrap.name}}</view> <view class="title mt30 tac c333 f40">{{wrap.name}}</view>
<view class="main mt30 mlr30"> <view class="main mt30 mlr30">
<rich-text :nodes="wrap.context" /> <rich-text :nodes="wrap.content" />
</view> </view>
<view class="fill" style="height: 30rpx;"></view> <view class="fill" style="height: 30rpx;"></view>

View File

@ -14,7 +14,10 @@
import { import {
onLoad onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import durianlApi from '@/api/durian.js'; //
import util from '@/common/js/util';
//
import api from '@/api/index.js';
const treeData = ref([]) const treeData = ref([])
const store = useStore() const store = useStore()
const userinfo = computed(() => { const userinfo = computed(() => {
@ -29,30 +32,69 @@
// //
function buyDurianList() { function buyDurianList() {
durianlApi.buyDurianList({}).then(rs => { api.durian.buyDurianList({}).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
treeData.value = rs.data.dataList treeData.value = rs.data.dataList.map(item => {
item.formatHash = formatStr(item.treeHash)
return item
})
return return
} }
util.alert({ util.alert({
content: rs.msg, content: rs.msg,
showCancel: false showCancel: false
}) })
}) })
} }
/**
* 处理字符串
* @param {Object} str
*/
function formatStr(str) {
// 6
if (str.length <= 6) return str
return str.slice(0, 3) + '***' + str.slice(-3); //
}
/**
* 跳转详情
* @param {Object} item
*/
function handleDetail(item) {
uni.navigateTo({
url: util.setUrl('/pages/index/durianLog', {
id: item.durianTreeId,
})
})
}
/**
* 复制
* @param {Object} ev 需要复制的码
*/
function handleCopy(ev) {
util.copyText(ev)
}
</script> </script>
<template> <template>
<view class="appbw"> <view class="appbw">
<!-- --> <!-- -->
<view class="list mlr40"> <view class="list mlr40">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index"> <view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index"
<image class="wh180" src="/static/tree.png" mode="aspectFit" /> @click="handleDetail(item)">
<view class="col f1 ml30 c333 f26"> <image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" />
<view class="txt">每日可释放{{item.release}}</view>
<!-- <view class="txt mtb5">当前可释放{{item.released}}</view> --> <view class="col f1 ml30 mtb30 c333 f26">
<view class="txt">当前级别{{item.treeName}}</view> <view class="txt mtb10">每日可释放{{item.release}}</view>
<view class="txt mtb10">剩余可释放{{item.remainFruitCount}}</view>
<view class="txt mtb10">当前级别{{item.treeName}}</view>
<view class="txt mtb10" @click.stop="util.copyText(item.treeHash)">
<text>哈希值 {{item.formatHash}}</text>
<image class="wh20 ml10" src="/static/copy.png" mode="aspectFit" />
</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -163,20 +163,23 @@
return return
} }
//
api.durian.consume({ api.durian.consume({
data: { data: {
// id //
targetUserId: form.targetUserId, userId: userinfo.value.id,
// // id
transactionType: 10, targetUserId: form.targetUserId,
// //
fruitAmount: form.fruitAmount, transactionType: 10,
// //
name: `${form.first}${form.name}`, fruitAmount: form.fruitAmount,
// //
account: form.account, name: `${form.first}${form.name}`,
// //
secondPassword: ev account: form.account,
//
secondPassword: ev
} }
}).then(rs => { }).then(rs => {
if (rs.code === 200) { if (rs.code === 200) {

View File

@ -18,16 +18,15 @@
} from 'vuex' } from 'vuex'
// //
import apex from '/components/header/apex' import apex from '/components/header/apex'
import durian from '@/api/durian.js'; import api from '@/api/index.js';
// //
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
const store = useStore() const store = useStore()
// //
const scrollLog = reactive({ const scrollLog = reactive({
data: [], data: [],
pageNum: 1, pageNum: 1,
pageSize: 30, pageSize: 20,
total: 0, total: 0,
}) })
// id // id
@ -69,11 +68,11 @@
// //
function getList() { function getList() {
durian.getMyFruitLog({ api.durian.getLog({
query: { query: {
durianTreeInfoId: id.value,
pageNum: scrollLog.pageNum, pageNum: scrollLog.pageNum,
pageSize: scrollLog.pageSize, pageSize: scrollLog.pageSize,
userId: userinfo.value.userId,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
@ -102,16 +101,19 @@
<view class="li" v-for="(item,index) in scrollLog.data" :key="index"> <view class="li" v-for="(item,index) in scrollLog.data" :key="index">
<view class="item rows ptb30 plr20 bfff"> <view class="item rows ptb30 plr20 bfff">
<view class="col oh f1"> <view class="col oh f1">
<view class="c333 f36">{{item.context}}</view> <view class="c333 f36">榴莲果树产出</view>
<view class="mt20 c666 f28">{{item.createTime}}</view> <view class="mt20 c666 f28">{{item.createTime}}</view>
</view> </view>
<view class="change fs0 c333 f36" v-if="Number(item.scroll) != 0"> <view class="change fs0 c333 f36" v-if="Number(item.scroll) != 0">
<text v-if="Number(item.scroll) > 0">+</text> <text v-if="Number(item.scroll) > 0">+</text>
<text>{{item.scroll}}</text> <text>{{item.releaseCount}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 填充 -->
<view class="fill"></view>
</view> </view>
</template> </template>

View File

@ -54,10 +54,6 @@
const oclockWindow = ref(false) const oclockWindow = ref(false)
// 有效读秒 // 有效读秒
const readSecond = reactive({ const readSecond = reactive({
// 单个视频最大
max: 20,
// 总数最大
totalMax: 300,
// 定时器 // 定时器
timer: null, timer: null,
}) })
@ -144,6 +140,10 @@
const currentVideoRef = computed(() => { const currentVideoRef = computed(() => {
return proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]] return proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]]
}) })
// 系统配置
const config = computed(() => {
return uni.$store.state.config
})
// 加载完成之后 // 加载完成之后
onLoad(() => { onLoad(() => {
@ -411,7 +411,7 @@
// 开启计时器 // 开启计时器
readSecond.timer = setInterval(() => { readSecond.timer = setInterval(() => {
// 当前视频有效读秒 小于等于 最大有效读秒限制(视频最大时长-2s,设置的有效读秒上限) // 当前视频有效读秒 小于等于 最大有效读秒限制(视频最大时长-2s,设置的有效读秒上限)
if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, 20)) { if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, config.value.EFFECTIVE_VIDEO_TIME)) {
// 增加这条视频的有效读秒 // 增加这条视频的有效读秒
item.readSecond++ item.readSecond++
} else { } else {

View File

@ -9,27 +9,31 @@
import { import {
useStore useStore
} from 'vuex' } from 'vuex'
import {
onReady,
} from '@dcloudio/uni-app'
// api // api
import api from '@/api/index.js' import api from '@/api/index.js'
// util // util
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
// //
import CryptoJS from 'crypto-js'; import CryptoJS from 'crypto-js';
//
import codeInput from '@/components/mine/codeInput.vue'
const { const {
proxy proxy
} = getCurrentInstance() } = getCurrentInstance()
// //
const store = useStore() const store = useStore()
// set check // set rePwd check
const mode = ref('set') const mode = ref('set')
// //
const form = reactive({ const form = reactive({
pwd: '', pwd: '',
rePwd: '', rePwd: '',
}) })
// //
const passwordArr = reactive([]) const formKey = reactive('pwd')
const AffirmStatus = ref(1)
// //
const userinfo = computed(() => { const userinfo = computed(() => {
let result = store.state.userinfo let result = store.state.userinfo
@ -37,18 +41,42 @@
return result return result
}) })
onReady(() => {
proxy.$refs.CodeKeyboard.show();
})
//
function handleNext() {
const data = {
...form
}
//
if (!form.pwd) {
util.alert('二级密码不能为空')
}
mode.value = 'rePwd'
}
// //
function handleSubmit() { function handleSubmit() {
const data = { const data = {
...form ...form
} }
console.log('data', data)
return
// //
if (!data.pwd) { if (!data.pwd) {
util.alert('二级密码不能为空') util.alert('二级密码不能为空')
return
} }
if (data.pwd !== data.rePwd) { if (data.pwd !== data.rePwd) {
util.alert('两次输入密码不一致') util.alert({
content: '两次输入密码不一致',
showCancel: false
})
mode.value = 'set'
return
} }
// //
data.pwd = CryptoJS.MD5(data.pwd).toString() data.pwd = CryptoJS.MD5(data.pwd).toString()
@ -68,7 +96,7 @@
} }
util.alert({ util.alert({
content: rs.msg, content: rs.msg,
showCanecl: false, showCancel: false,
}) })
}) })
} }
@ -100,44 +128,29 @@
} }
util.alert({ util.alert({
content: rs.msg, content: rs.msg,
showCanecl: false, showCancel: false,
}) })
}) })
} }
/**
* 唤起键盘
*/
function onPayUp() {
proxy.$refs.CodeKeyboard.show();
}
/** /**
* 支付键盘回调 * 支付键盘回调
* @param {Object} val * @param {Object} val
*/ */
function KeyInfo(val) { function KeyInfo(val) {
console.log('val', val) if (form[formKey.value].length >= 6) return
if (val.index >= 6) {
return
}
// //
if (val.keyCode === 8) { if (val.keyCode === 8) {
// //
passwordArr.splice(val.index + 1, 1) form[formKey.value] = form[formKey.value].slice(0, -1)
// passwordArr.splice(val.index + 1, 1)
} }
// . // .
else if (val.keyCode == 190) { else if (val.keyCode == 190) {
// . // .
} else { } else {
passwordArr.push(val.key); form[formKey.value] += val.key
} // passwordArr.push(val.key);
// 6
if (passwordArr.length === 6) {
passwordArr = [];
AffirmStatus.value = AffirmStatus.value + 1;
} }
} }
</script> </script>
@ -147,18 +160,21 @@
<view class="container ver mt10p" v-if="mode === 'set'"> <view class="container ver mt10p" v-if="mode === 'set'">
<view class="title c333 f54">设置二级密码</view> <view class="title c333 f54">设置二级密码</view>
<view class="content mt50 c666 f32">请设置六位数字的二级密码</view> <view class="content mt50 c666 f32">请设置六位数字的二级密码</view>
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.pwd" :focus="true" placeholder="六位数字密码" /> <view class="pwd">
</view> <codeInput v-model:modelValue="form.pwd" />
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.rePwd" placeholder="再次输入密码" />
</view> </view>
<!-- <view class="pwd rows mt50 ptb10 plr30" @click="onPayUp"> <view class="btn lg black mtb50 plr50" @click="handleSubmit">下一步</view>
<view class="item fmid" v-for="(item,index) in 6" :key="index"> </view>
<text v-if="passwordArr[index] != null"></text>
</view> <view class="container ver mt10p" v-if="mode === 'rePwd'">
</view> --> <view class="title c333 f54">确认二级密码</view>
<view class="content mt50 c666 f32">请再次输入刚才设置的二级密码</view>
<view class="pwd">
<codeInput v-model:modelValue="form.repwd" />
</view>
<view class="btn lg black mtb50 plr50" @click="handleSubmit">确认</view> <view class="btn lg black mtb50 plr50" @click="handleSubmit">确认</view>
</view> </view>
@ -178,14 +194,4 @@
</template> </template>
<style lang="scss"> <style lang="scss">
.pwd {
.item {
margin: 0 10rpx;
width: 70rpx;
height: 80rpx;
background-color: #f4f4f4;
border-radius: 10rpx;
}
}
</style> </style>

View File

@ -208,17 +208,17 @@
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
<view class="line rows"> <view class="line rows" @click="link('/pages/mine/setting/feedback')">
<view class="">意见反馈</view> <view class="">意见反馈</view>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
<view class="line rows"> <view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 2,}))">
<view class="">关于我们</view> <view class="">关于我们</view>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
<view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 6,}))"> <view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 3,}))">
<view class="">用户协议</view> <view class="">用户协议</view>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
@ -238,12 +238,7 @@
<!-- 切换账号 退出登录 --> <!-- 切换账号 退出登录 -->
<view class="mtb30 c999"> <view class="mtb30 c999">
<view class="mtb5"> <view @click="logOff" class="btn">退出登录</view>
<view @click="link('/pages/mine/switch-accounts/index')" class="btn">切换账号</view>
</view>
<view class="mtb5">
<view @click="logOff" class="btn">退出登录</view>
</view>
</view> </view>
<view class="fill" style="height: 30rpx;"></view> <view class="fill" style="height: 30rpx;"></view>

View File

@ -161,6 +161,17 @@ reset_password
//注册 //注册
register register
榴莲果交易类型id
1 兑换榴莲果树
2 商城评论
3 查看他人评论
4 查看视频分析
5 兑换视频展播量
6 推广他人视频
7 申请完播量
8 挂卖榴莲果
9 挂买榴莲果
10 用户互转
区分商家认证 区分商家认证
isShop isShop
@ -355,15 +366,3 @@ call_type 通话类型 2为视频1是音频
选择视频截帧 选择视频截帧
榴莲果交易类型id
1 兑换榴莲果树
2 商城评论
3 查看他人评论
4 查看视频分析
5 兑换视频展播量
6 推广他人视频
7 申请完播量
8 挂卖榴莲果
9 挂买榴莲果
10 用户互转

View File

@ -24,6 +24,13 @@ export default createStore({
//有效时长 //有效时长
viewingDuration: 0, viewingDuration: 0,
}, },
// 各种变量配置
config: {
"DAY_POINTS_RELEASE": 0.3, //每日积分释放
"TASK_READING_SECOND": 300, //任务读秒
"EFFECTIVE_SECONDS": 300, //有效读秒
"EFFECTIVE_VIDEO_TIME": 20 //有效视频时间
},
}, },
mutations: { mutations: {

View File

@ -1,10 +1,8 @@
<template> <template>
<view class="page-total" v-show="isShow"> <view class="page-total" v-show="isShow">
<view class="key-list"> <view class="key-list">
<view class="list" v-for="(item,index) in keyList" <view class="list" v-for="(item,index) in keyList" :class="{'special':item.keyCode==190||item.keyCode==8}"
:class="{'special':item.keyCode==190||item.keyCode==8}" @click="onKeyList(item,index)" :key="item.keyCode">
@click="onKeyList(item,index)"
:key="item.keyCode">
<text>{{item.key}}</text> <text>{{item.key}}</text>
</view> </view>
</view> </view>
@ -16,71 +14,69 @@
data() { data() {
return { return {
isShow: false, isShow: false,
keyList: [ keyList: [{
{ key: 1,
key: 1, en: '',
en: '', keyCode: 49,
keyCode: 49, }, {
},{ key: 2,
key: 2, en: 'ABC',
en: 'ABC', keyCode: 50,
keyCode: 50, }, {
},{ key: 3,
key: 3, en: 'ABC',
en: 'ABC', keyCode: 51,
keyCode: 51, }, {
},{ key: 4,
key: 4, en: 'ABC',
en: 'ABC', keyCode: 52,
keyCode: 52, }, {
},{ key: 5,
key: 5, en: 'ABC',
en: 'ABC', keyCode: 53,
keyCode: 53, }, {
},{ key: 6,
key: 6, en: 'ABC',
en: 'ABC', keyCode: 54,
keyCode: 54, }, {
},{ key: 7,
key: 7, en: 'ABC',
en: 'ABC', keyCode: 55,
keyCode: 55, }, {
},{ key: 8,
key: 8, en: 'ABC',
en: 'ABC', keyCode: 56,
keyCode: 56, }, {
},{ key: 9,
key: 9, en: 'ABC',
en: 'ABC', keyCode: 57,
keyCode: 57, }, {
},{ key: '',
key: '', en: 'ABC',
en: 'ABC', keyCode: 190,
keyCode: 190, }, {
},{ key: 0,
key: 0, en: 'ABC',
en: 'ABC', keyCode: 48,
keyCode: 48, }, {
},{ key: 'del',
key: 'del', en: 'DEL',
en: 'DEL', keyCode: 8,
keyCode: 8, }, ],
},
],
keyIndex: -1, keyIndex: -1,
}; };
}, },
props:{ props: {
passwrdType: { passwrdType: {
type: String, type: String,
default: 'pay' default: 'pay'
} }
}, },
methods:{ methods: {
show(){ show() {
this.isShow = true; this.isShow = true;
}, },
hide(){ hide() {
this.isShow = false; this.isShow = false;
}, },
/** /**
@ -88,23 +84,8 @@
* @param {Object} item * @param {Object} item
* @param {Number} index * @param {Number} index
*/ */
onKeyList(item,index){ onKeyList(item, index) {
let KeyInfo = item; this.$emit('KeyInfo', item);
//
if(KeyInfo.keyCode === 8 && this.keyIndex > -1){
this.keyIndex--;
}
//
if(KeyInfo.keyCode != 8){
if(this.passwrdType == 'pay' && this.keyIndex >= 5){
console.log('支付键盘');
this.keyIndex = -1;
return;
}
this.keyIndex++;
}
KeyInfo.index = this.keyIndex;
this.$emit('KeyInfo',KeyInfo);
} }
} }
} }

View File

@ -15,11 +15,11 @@ export default defineConfig({
changeOrigin: true, changeOrigin: true,
}, },
"/user": { "/user": {
target: "http://192.168.1.241:8080", target: "http://192.168.1.235:8080",
changeOrigin: true, changeOrigin: true,
}, },
"/coreplay": { "/coreplay": {
target: "http://192.168.1.241:8080", target: "http://192.168.1.235:8080",
changeOrigin: true, changeOrigin: true,
}, },
"/file": { "/file": {
@ -27,7 +27,7 @@ export default defineConfig({
changeOrigin: true, changeOrigin: true,
}, },
"/video": { "/video": {
target: "http://192.168.1.241:8080", target: "http://192.168.1.235:8080",
changeOrigin: true, changeOrigin: true,
}, },
} }