合并代码

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() {
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 = {
/**
* 果树列表
* @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

View File

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

View File

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

View File

@ -19,10 +19,21 @@
const task = computed(() => {
return store.state.task
})
//
const config = computed(() => {
return store.state.config
})
//
const progress = computed(() => {
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
})

View File

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

View File

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

View File

@ -14,7 +14,10 @@
import {
onLoad
} 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 store = useStore()
const userinfo = computed(() => {
@ -29,30 +32,69 @@
//
function buyDurianList() {
durianlApi.buyDurianList({}).then(rs => {
api.durian.buyDurianList({}).then(rs => {
if (rs.code == 200) {
treeData.value = rs.data.dataList
treeData.value = rs.data.dataList.map(item => {
item.formatHash = formatStr(item.treeHash)
return item
})
return
}
util.alert({
content: rs.msg,
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>
<template>
<view class="appbw">
<!-- -->
<view class="list mlr40">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index">
<image class="wh180" src="/static/tree.png" mode="aspectFit" />
<view class="col f1 ml30 c333 f26">
<view class="txt">每日可释放{{item.release}}</view>
<!-- <view class="txt mtb5">当前可释放{{item.released}}</view> -->
<view class="txt">当前级别{{item.treeName}}</view>
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index"
@click="handleDetail(item)">
<image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" />
<view class="col f1 ml30 mtb30 c333 f26">
<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 File

@ -163,8 +163,11 @@
return
}
//
api.durian.consume({
data: {
//
userId: userinfo.value.id,
// id
targetUserId: form.targetUserId,
//

View File

@ -18,16 +18,15 @@
} from 'vuex'
//
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'
const store = useStore()
//
const scrollLog = reactive({
data: [],
pageNum: 1,
pageSize: 30,
pageSize: 20,
total: 0,
})
// id
@ -69,11 +68,11 @@
//
function getList() {
durian.getMyFruitLog({
api.durian.getLog({
query: {
durianTreeInfoId: id.value,
pageNum: scrollLog.pageNum,
pageSize: scrollLog.pageSize,
userId: userinfo.value.userId,
}
}).then(rs => {
if (rs.code == 200) {
@ -102,16 +101,19 @@
<view class="li" v-for="(item,index) in scrollLog.data" :key="index">
<view class="item rows ptb30 plr20 bfff">
<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>
<view class="change fs0 c333 f36" v-if="Number(item.scroll) != 0">
<text v-if="Number(item.scroll) > 0">+</text>
<text>{{item.scroll}}</text>
<text>{{item.releaseCount}}</text>
</view>
</view>
</view>
</view>
<!-- 填充 -->
<view class="fill"></view>
</view>
</template>

View File

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

View File

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

View File

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

View File

@ -161,6 +161,17 @@ reset_password
//注册
register
榴莲果交易类型id
1 兑换榴莲果树
2 商城评论
3 查看他人评论
4 查看视频分析
5 兑换视频展播量
6 推广他人视频
7 申请完播量
8 挂卖榴莲果
9 挂买榴莲果
10 用户互转
区分商家认证
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,
},
// 各种变量配置
config: {
"DAY_POINTS_RELEASE": 0.3, //每日积分释放
"TASK_READING_SECOND": 300, //任务读秒
"EFFECTIVE_SECONDS": 300, //有效读秒
"EFFECTIVE_VIDEO_TIME": 20 //有效视频时间
},
},
mutations: {

View File

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

View File

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