fromdao251122

This commit is contained in:
众产-王坤 2025-11-22 01:24:46 +08:00
parent c8741c9253
commit b045a8d3db
43 changed files with 1008 additions and 518 deletions

View File

@ -52,6 +52,7 @@
app.globalData.errdata = app.getstorage('err');
if (!(app.globalData.errdata instanceof Array))
app.globalData.errdata = [];
app.globalData.mqfunc = [];
app.globalData.srv = 't';
app.globalData.jsnajax = 'z/?func=ambap/';
@ -119,6 +120,23 @@
app.removestorage('err');
}
}, 1000);
setInterval(async () => {
if (app.globalData.mqfunc.length > 0) {
console.log(app.globalData.mqfunc);
var ret = await app.callfunc({
func: app.globalData.mqfunc[0].func,
data: app.globalData.mqfunc[0].data,
loadhide: true,
});
var name = app.globalData.mqfunc[0].name;
for (var i = app.globalData.mqfunc.length - 1; i >= 0; i--) {
if (app.globalData.mqfunc[i].name == name) {
app.globalData.mqfunc[i].callback(ret);
app.globalData.mqfunc.splice(i, 1);
}
}
}
}, 200);
setInterval(() => {
getnewnotice();
}, 120000); //2notice

View File

@ -1,5 +1,5 @@
<template>
<view class="_dbg" @tap.stop="showdbglist" v-if="bshow && me.id>0">
<view class="_dbg" @tap.stop="showdbglist" v-if="bshow && me.id>0 && me.dbg">
<view class="_dbgbg">
</view>
<view class="_dbgtxt">

View File

@ -77,7 +77,7 @@
headerheight,
footerheight
} = await this.com_gethdft();
this.top = (headerheight + 40) + 'px';
this.top = (headerheight + 60) + 'px';
if (res.height) {
this.height = res.height;
} else {

View File

@ -9,7 +9,7 @@
<view v-else-if="item.type == 'audio'" style="padding:1em;">
<ciy-audio :src="file_stor(item.content)"></ciy-audio>
</view>
<view v-else v-html="item.content" style="width:100%;position: relative;padding:0 0.5em;"></view>
<view v-else v-html="item.content" style="width:100%;position: relative;" :style="{padding:padding}"></view>
</template>
</template>
@ -19,6 +19,10 @@
md: {
type: String,
default: ''
},
padding: {
type: String,
default: '0 0.5em'
}
},
data() {
@ -68,43 +72,59 @@
}
var cr = mds[m].substring(1, 2).toLowerCase();
if (mds[m].substring(0, 5) == '#####') {
if (mds[m].substring(5, 6) == '1')
oladd(4, titnum);
if (mds[m].substring(5, 6) == '.')
html += '<h5 class="md-h5">' + olnum(4, titnum, '、') + convertcode(mds[m].substring(6)) + '</h5>';
else if (mds[m].substring(5, 6) == ':')
html += '<div class="md-content">' + olnum(4, titnum, ' ') + convertcode(mds[m].substring(6)) + '</div>';
else
html += '<h5 class="md-h5">' + convertcode(mds[m].substring(5)) + '</h5>';
} else if (mds[m].substring(0, 4) == '####') {
if (mds[m].substring(4, 5) == '1')
oladd(3, titnum);
if (mds[m].substring(4, 5) == '.')
html += '<h4 class="md-h4">' + olnum(3, titnum, '、') + convertcode(mds[m].substring(5)) + '</h4>';
else if (mds[m].substring(4, 5) == ':')
html += '<div class="md-content">' + olnum(3, titnum, ' ') + convertcode(mds[m].substring(5)) + '</div>';
else
html += '<h4 class="md-h4">' + convertcode(mds[m].substring(4)) + '</h4>';
} else if (mds[m].substring(0, 3) == '###') {
if (mds[m].substring(3, 4) == '1')
oladd(2, titnum);
if (mds[m].substring(3, 4) == '.')
html += '<h3 class="md-h3">' + olnum(2, titnum, '、') + convertcode(mds[m].substring(4)) + '</h3>';
else if (mds[m].substring(3, 4) == ':')
html += '<div class="md-content">' + olnum(2, titnum, ' ') + convertcode(mds[m].substring(4)) + '</div>';
else
html += '<h3 class="md-h3">' + convertcode(mds[m].substring(3)) + '</h3>';
} else if (mds[m].substring(0, 2) == '##') {
if (mds[m].substring(2, 3) == '1')
oladd(1, titnum);
if (mds[m].substring(2, 3) == '.')
html += '<h2 class="md-h2">' + olnum(1, titnum, '、') + convertcode(mds[m].substring(3)) + '</h2>';
else if (mds[m].substring(2, 3) == ':')
html += '<div class="md-content">' + olnum(1, titnum, ' ') + convertcode(mds[m].substring(3)) + '</div>';
else
html += '<h2 class="md-h2">' + convertcode(mds[m].substring(2)) + '</h2>';
} else if (cr == 'c')
html += '<h1 class="md-h1" style="text-align:center;">' + convertcode(mds[m].substring(2)) +
'</h1>';
else if (cr == 'r')
html += '<h1 class="md-h1" style="text-align:right;">' + convertcode(mds[m].substring(2)) +
'</h1>';
else if (cr == '1')
html += '<h1 class="md-h1">' + olnum(0, titnum, '、') + convertcode(mds[m].substring(2)) + '</h1>';
else
html += '<h1 class="md-h1">' + convertcode(mds[m].substring(1)) + '</h1>';
} else {
oladd(0, titnum);
if (cr == 'c')
html += '<h1 class="md-h1" style="text-align:center;">' + convertcode(mds[m].substring(2)) +
'</h1>';
else if (cr == 'r')
html += '<h1 class="md-h1" style="text-align:right;">' + convertcode(mds[m].substring(2)) +
'</h1>';
else if (cr == '.')
html += '<h1 class="md-h1">' + olnum(0, titnum, '、') + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == ':')
html += '<div class="md-content">' + olnum(0, titnum, ' ') + convertcode(mds[m].substring(2)) + '</div>';
else
html += '<h1 class="md-h1">' + convertcode(mds[m].substring(1)) + '</h1>';
}
} else if (mds[m][0] == '@') { //cr
var cr = mds[m].substring(1, 2).toLowerCase();
if (cr == 'c')
html += '<div class="md-content" style="text-align:center;">' + convertcode(mds[m].substring(2)) + '</div>';
else if (cr == 'r')
html += '<div class="md-content" style="text-align:right;margin-right:1em;">' + convertcode(mds[m].substring(2)) + '</div>';
else if (mds[m][1] == '1') {
else if (mds[m][1] == '.') {
if (!isol) {
isol = true;
html += '<ol>';
@ -176,10 +196,13 @@
}
return htmls;
function olnum(idx, olnum, end) {
function oladd(idx, olnum) {
olnum[idx]++;
for (var i = idx + 1; i < olnum.length; i++)
olnum[i] = 0;
}
function olnum(idx, olnum, end) {
for (var i = 0; i <= idx; i++) {
if (olnum[i] == 0)
continue;

View File

@ -0,0 +1,43 @@
<template>
<view v-for="(item,index) in sem" :key="index" class="flex1" @tap="clkitem(index)">
<view :class="numclass">
<ciy-shownum :value="item.num" :unit="item.unit"></ciy-shownum>
</view>
<view :class="nameclass">{{item.name}}</view>
</view>
</template>
<script>
export default {
emits: ['change', 'update:modelValue'],
props: {
sem: {
type: [Array],
default: []
},
numclass: {
type: [String],
default: 'txt-lgg'
},
nameclass: {
type: [String],
default: 'txt-sm py2'
},
},
data() {
return {};
},
watch: {},
computed: {},
mounted() {},
methods: {
clkitem(idx) {
if (this.sem[idx].url)
this.gourl(this.sem[idx].url);
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,77 @@
<template>
<text :style="ciystyle" v-if="user>0">
<text style="font-size:0.7em;" v-if="!usrinfo" @tap.stop="getname">No.</text>
<text @tap.stop="getname">{{showtxt}}</text>
<button class="btn def smm" style="margin-left:1em;" @tap.stop="showinfo">成员详情</button>
</text>
<text :style="ciystyle" v-else>
<text style="color:var(--bg6)">暂无</text>
</text>
</template>
<style scoped>
</style>
<script>
//
export default {
props: {
user: {
type: [String, Number],
default: 0
},
ciystyle: {
type: [String, Object],
default: ''
},
},
data() {
return {
usrinfo: null
};
},
watch: {},
computed: {
showtxt() {
if (this.usrinfo)
return this.usrinfo.name;
return this.user;
},
},
mounted() {
this.usrinfo = this.getstorage('d' + this.user);
if (!this.usrinfo)
this.getuserinfo();
},
methods: {
async getuserinfo() {
if (this.usrinfo) {
if (this.usrinfo._times > this.tostamp())
return;
}
const app = getApp();
app.globalData.mqfunc.push({
name: 'userinfo_' + this.user,
func: 'dao.userinfo_get',
data: {
id: this.user,
},
callback: retjson => {
if (retjson.code != 1)
return;
retjson.user._times = this.tostamp() + 60;
this.setstorage('d' + this.user, retjson.user);
this.usrinfo = retjson.user;
}
});
},
async getname() {
this.getuserinfo();
},
async showinfo() {
await this.getuserinfo();
this.gourl('/pages/me/user_show', '', this.usrinfo, 'userinfo');
},
}
}
</script>

View File

@ -2,12 +2,12 @@
<ciy-header title="广场" mode="scroll"></ciy-header>
<view v-if="init.code != 1">
<view class="px4 py4">
<view style="height:12em;width:100%;" class="ciy-skeleton"></view>
<view style="height:2em;width:60%;" class="ciy-skeleton"></view>
<view style="height:1em;width:40%;margin-left:1em;" class="ciy-skeleton"></view>
<view style="height:3em;width:70%;" class="ciy-skeleton"></view>
<view style="height:3em;width:70%;" class="ciy-skeleton"></view>
<view style="height:3em;width:70%;" class="ciy-skeleton"></view>
<view style="height:12rem;width:100%;" class="ciy-skeleton"></view>
<view style="height:2rem;width:60%;" class="ciy-skeleton"></view>
<view style="height:1rem;width:40%;margin-left:1rem;" class="ciy-skeleton"></view>
<view style="height:3rem;width:70%;" class="ciy-skeleton"></view>
<view style="height:3rem;width:70%;" class="ciy-skeleton"></view>
<view style="height:3rem;width:70%;" class="ciy-skeleton"></view>
</view>
</view>
<view v-else>

View File

@ -2,16 +2,16 @@
<ciy-header title="我的" mode="scroll"></ciy-header>
<view class="topbg"></view>
<view :style="{height:header_statusbar_height+'px'}"></view>
<view style="padding-top:1em;">
<view style="padding-top:1rem;">
<view class="avartop">
<image :src="file_stor(me.icon?me.icon:'/img/face.png')" mode="scaleToFill" />
</view>
</view>
<view class="maincard" style="margin-top: -2.5em;">
<view class="maincard" style="margin-top: -2.5rem;">
<view class="flex flex-center">
<view class="nick" @tap="gourl" data-url="$/pages/me/user_info">{{me.id>0?(me.name?me.name:'游客'):'登录/注册'}}</view>
<view class="icon zy" style="margin-left:1em;" v-if="showbalance" @tap="getbalance(2)"></view>
<view class="icon by" style="margin-left:1em;" v-else @tap="getbalance(1)"></view>
<view class="icon zy" style="margin-left:1rem;" v-if="showbalance" @tap="getbalance(2)"></view>
<view class="icon by" style="margin-left:1rem;" v-else @tap="getbalance(1)"></view>
</view>
<view class="abs r0 t0" style="opacity: 0;" @tap="gourl" data-url="/pages/demo/index">Demo</view>
<view class="abs r1 b1 txt-smmm" @tap="copyboard('E' + me.eid)" v-if="me.id>0">E{{me.eid}}</view>
@ -21,15 +21,14 @@
<ciy-shownum speed="80" :value="me.mymoney" unit=",100,2|万,1000000,2|亿,10000000000,2"></ciy-shownum>
</view>
<view class="num" v-else>---</view>
<view class="tit">账户余额</view>
<view class="tit">可消费余额</view>
</view>
<view>
<view class="num" v-if="showbalance">
<ciy-shownum :value="me.mybondmoney<0?-me.mybondmoney:me.mybondmoney" unit=",100,2|万,1000000,2|亿,10000000000,2"></ciy-shownum>
<ciy-shownum :value="me.mycashmoney" unit=",100,2|万,1000000,2|亿,10000000000,2"></ciy-shownum>
</view>
<view class="num" v-else>---</view>
<view class="tit" v-if="me.mybondmoney<0">信用额度</view>
<view class="tit" v-else>保证金</view>
<view class="tit">可提现余额</view>
</view>
<view>
<view class="num" v-if="showbalance">
@ -85,10 +84,6 @@
<view class="icon" :style="{backgroundImage:svg2bg(svg.v3)}"></view>
<view class="name">收支明细</view>
</view>
<view class="grid">
<view class="icon" :style="{backgroundImage:svg2bg(svg.v4)}"></view>
<view class="name">保证金</view>
</view>
</view>
<view class="ciy-grid">
<view class="grid">
@ -109,10 +104,10 @@
</view>
</view>
</view>
<view class="bg5" style="height:0.3em;"></view>
<view class="bg5" style="height:0.3rem;"></view>
<ciy-swipelist v-if="me.id>0" title="众识码" data-url="$/pages/me/safe_ccub" @tap="gourl" :right="tocciy(me.cciy)" more></ciy-swipelist>
<ciy-swipelist v-if="me.id>0" title="实名认证" data-url="$/pages/me/safe_real" @tap="gourl" :right="tomsk(me.truename, '#***')" more></ciy-swipelist>
<view class="bg5" style="height:0.3em;"></view>
<view class="bg5" style="height:0.3rem;"></view>
<ciy-swipelist v-if="me.id>0" title="个人信息" @tap="gourl" data-url="$/pages/me/user_info" more></ciy-swipelist>
<ciy-swipelist v-if="me.id>0" title="收款银行" @tap="gourl" data-url="$/pages/me/user_bank" :right="me.bankaccount?'已设置':'未设置'" more></ciy-swipelist>
<ciy-swipelist v-if="me.id>0" title="收货地址" @tap="gourl" data-url="$/pages/me/user_shipaddr" more></ciy-swipelist>
@ -128,7 +123,7 @@
</ciy-swipelist>
<ciy-swipelist title="关于我们" @tap="gourl" data-url="/pages/pub/paper?id=1" right="众产" more></ciy-swipelist>
<ciy-swipelist title="软件版本" @tap="upver" :right="version" more></ciy-swipelist>
<view class="bg5" v-if="me.id>0" style="height:0.5em;"></view>
<view class="bg5" v-if="me.id>0" style="height:0.5rem;"></view>
<ciy-swipelist v-if="me.id>0" title="重新登录" @tap="relogin" more></ciy-swipelist>
<ciy-tabbar ref="tabbar"></ciy-tabbar>
</template>
@ -239,7 +234,7 @@
</script>
<style>
.topbg {
height: 10em;
height: 10rem;
overflow: hidden;
position: absolute;
top: 0;
@ -249,8 +244,8 @@
.topbg::before {
content: '';
left: -5em;
right: -5em;
left: -5rem;
right: -5rem;
border-radius: 0 0 100vw 100vw;
height: 100%;
background: linear-gradient(60deg, var(--e-userbg1), var(--e-userbg2));
@ -263,9 +258,9 @@
.avartop {
position: relative;
display: flex;
margin: 0 0 0 1.5em;
width: 5em;
height: 5em;
margin: 0 0 0 1.5rem;
width: 5rem;
height: 5rem;
border-radius: 50%;
background: var(--bg2);
border: 2px solid var(--bg1);
@ -282,29 +277,29 @@
position: relative;
background: var(--bg1);
color: var(--txt6);
padding: 0.5em;
margin: 0 1em 1em 1em;
border-radius: 0.3em;
padding: 0.5rem;
margin: 0 1rem 1rem 1rem;
border-radius: 0.3rem;
box-shadow: 0 4px 8px var(--bg6);
}
.maincard .nick {
font-size: 1.2em;
font-size: 1.2rem;
font-weight: bold;
padding-left: 4.5em;
padding-left: 4.5rem;
}
.expdate {
display: block;
padding-left: 1em;
margin-top: -1em;
margin-bottom: 1em;
font-size: 0.9em;
padding-left: 1rem;
margin-top: -1rem;
margin-bottom: 1rem;
font-size: 0.9rem;
color: var(--succ5);
}
.caption {
font-size: 1.2em;
font-size: 1.2rem;
font-weight: bold;
padding: 1em 0;
}
@ -321,12 +316,12 @@
padding: 1em 0;
text-align: center;
border: 1px solid var(--bg4);
border-radius: 1em;
border-radius: 1rem;
}
.userpay>.item>.price {
display: block;
font-size: 1.2em;
font-size: 1.2rem;
font-weight: bold;
color: var(--man5);
}
@ -338,13 +333,13 @@
.userpay>.item>.recommend {
position: absolute;
top: -0.5em;
right: 0.5em;
padding: 0.2em 0.8em;
font-size: 0.8em;
top: -0.5rem;
right: 0.5rem;
padding: 0.2rem 0.8rem;
font-size: 0.8rem;
color: var(--dagt);
background: var(--dag5);
border-radius: 1em;
border-radius: 1rem;
}
.cgrid {
@ -355,30 +350,30 @@
.cgrid .item {
width: 48%;
margin-bottom: 1em;
padding: 1em;
margin-bottom: 1rem;
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
background: var(--bg3);
border-radius: 1em;
border-radius: 1rem;
}
.cgrid .icon {
width: 2em;
height: 2em;
margin-bottom: 0.5em;
width: 2rem;
height: 2rem;
margin-bottom: 0.5rem;
border-radius: 50%;
background: linear-gradient(-25deg, #1890ff, #c0e1ff);
display: flex;
justify-content: center;
align-items: center;
font-size: 1.5em;
font-size: 1.5rem;
}
.icon {
width: 1.5em;
height: 1.5em;
width: 1.5rem;
height: 1.5rem;
}
.icon.by {
@ -390,8 +385,8 @@
}
.usrnum {
padding-top: 1em;
padding-bottom: 0.5em;
padding-top: 1rem;
padding-bottom: 0.5rem;
display: flex;
}
@ -403,10 +398,10 @@
.usrnum .num {
height: 2.5rem;
padding-top: 0.2rem;
font-size: 1.3em;
font-size: 1.3rem;
}
.usrnum .tit {
font-size: 0.9em;
font-size: 0.9rem;
}
</style>

View File

@ -25,6 +25,7 @@
<view class="ciy-form-bottom">
<button class="btn lg cc" @tap="paynow">立即充值</button>
</view>
<view class="ciy-tip">充值资金仅可用于本平台指定服务不可提现不可转让平台不提供资金保管或理财服务</view>
</view>
<view class="ciy-hr"></view>
<ciy-swipelist title="充值记录" @tap="gourl" data-url="cashin_lst" more></ciy-swipelist>

View File

@ -159,12 +159,12 @@
this._loading = false;
if (retjson.code != 1)
return this.alert(retjson.errmsg);
this.init.cashs.splice(idx, 1);
wx.requestMerchant({
wx.requestMerchantTransfer({
mchId: retjson.transfer.mchid,
appId: retjson.transfer.appid,
package: retjson.transfer.package_info,
success: (res) => {
success: res => {
this.init.cashs.splice(idx, 1);
console.log('success Transfer:', res);
},
fail: (res) => {

View File

@ -3,7 +3,7 @@
<view v-if="init.code != 1" class="px4 py4">
<view style="height:60vw;width:100%;" class="ciy-skeleton"></view>
</view>
<view v-else-if="me.cciy" class="txt-center py4">
<view v-else-if="me.cciy.length > 10" class="txt-center py4">
您已申请成功
<view @tap="copyboard(me.cciy)" class="txt-lgg py4">{{me.cciy}}</view>
</view>

View File

@ -88,13 +88,13 @@
async getinit() {
await this.getauth('info');
var app = getApp();
this.inputtype = 2;
var retjson = await this.callfunc({
func: 'me.safe_real_init'
});
this.init = retjson;
if (retjson.code != 1)
return this.alert(retjson.errmsg);
this.inputtype = retjson.inputtype;
if (retjson.data && retjson.data.auditstatus == 100 && !this.me.truename) {
this.me.truename = retjson.data.name;
this.me.idid = retjson.data.idid;
@ -109,6 +109,13 @@
this.getrefsSync('cameraocr').Step(1);
}, 500);
}
this.editdata.name = this.me.truename;
this.editdata.idid = this.me.idid;
if (this.inputtype == 1) {
setTimeout(() => {
this.getrefsSync('cameraocr').Step(1);
}, 500);
}
setTimeout(() => {
this.getrefsSync('cameraocr').Step(1);
}, 500);
@ -156,7 +163,7 @@
if (retjson.code != 1)
return this.alert(retjson.errmsg);
this.editdata.name = retjson.ai.name;
this.editdata.idno = retjson.ai.idno;
this.editdata.idid = retjson.ai.idno;
},
async chgvoice(e) {
//@change

View File

@ -70,7 +70,7 @@
opn.imgwidth = 400;
opn.imgheight = 400;
opn.zipjpg = 70;
this.me.icon = await this.file_upload1(e.detail.avatarUrl, opn);
this.editdata.icon = await this.file_upload1(e.detail.avatarUrl, opn);
},
async submit() {
if (!this.editdata.name)

View File

@ -655,7 +655,7 @@ export default {
},
opn: {}, //页面传参
me: {},
g: {}, //本地与dydict整合onshow更新本地同时合并dydict。
//g: {}, //本地与dydict整合onshow更新本地同时合并dydict。
};
},
created() {}, //全局混入的 created 钩子被调用
@ -684,14 +684,22 @@ export default {
this.jsnurl = app.globalData.jsnurl;
//this.constant = {maxtimes: 9999999999999};
this.me = this.getme();
if (app.globalData.ciy_page_g)
this.g = app.globalData.ciy_page_g;
else
this.g = this.getstorage('g', {});
// if (app.globalData.ciy_page_g)
// this.g = app.globalData.ciy_page_g;
// else
// this.g = this.getstorage('g', {});
uni.hideTabBar({
fail: res => {}
});
},
computed: {
g() {
if (app.globalData.ciy_page_g)
return app.globalData.ciy_page_g;
else
return this.getstorage('g', {});
}
},
onShow() {
this.settheme();
this.setfont();
@ -1266,7 +1274,7 @@ export default {
return '.' + m2;
},
tocciy(cciy) {
if (!cciy) //cciy必须为字符串否则js无法处理
if (!cciy || cciy == '0') //cciy必须为字符串否则js无法处理
return '';
return 'cx' + cciy.substring(0, 1) + '...' + cciy.substring(cciy.length - 6);
},
@ -1519,7 +1527,6 @@ export default {
} else {
theme = this.getstorage('_theme');
if (!theme) {
var app = getApp();
if (app.globalData._sysinfo.theme == 'dark')
theme = 'dark';
}
@ -1647,7 +1654,7 @@ export default {
if (type == 'info' && !this.me.name) {
this.alert('请先填写个人信息').then(() => {
uni.redirectTo({
url: 'user_info'
url: '/pages/me/user_info'
});
});
return;
@ -1655,7 +1662,7 @@ export default {
if (type == 'real' && !this.me.truename) {
this.alert('请进行实名认证').then(() => {
uni.redirectTo({
url: 'safe_real'
url: '/pages/me/safe_real'
});
});
return;
@ -1663,7 +1670,7 @@ export default {
if (type == 'bank' && !this.me.bankname) {
this.alert('请填写银行信息').then(() => {
uni.redirectTo({
url: 'user_bank'
url: '/pages/me/user_bank'
});
});
return;

View File

@ -162,6 +162,7 @@ body,
view,
text {
box-sizing: border-box;
/* font-size: clamp(14px, 4vw, 40px); */
font-size-adjust: ex-height 0.53;
}
@ -241,10 +242,10 @@ text {
/*列表页*/
.ciy-list {
position: relative;
margin: 1em;
padding: 0.8em;
margin: 1rem;
padding: 0.8rem;
background: var(--bg1);
border-radius: 0.5em;
border-radius: 0.5rem;
overflow: hidden;
transition: transform ease-in 0.5s;
}
@ -255,14 +256,14 @@ text {
}
.ciy-list .l0 {
font-size: 0.8em;
padding-right: 6em;
font-size: 0.8rem;
padding-right: 6rem;
color: var(--txt1);
}
.ciy-list .l1 {
font-size: 1.2em;
padding: 0.3em 1.5em 0.3em 0.5em;
font-size: 1.2rem;
padding: 0.3em 1.5em 0.3em 0.5rem;
}
.ciy-list .l2 {
@ -273,10 +274,10 @@ text {
.ciy-list .l2>label {
color: var(--txt9);
min-width: 5em;
min-width: 5rem;
flex-shrink: 0;
white-space: nowrap;
padding-right: 1em;
padding-right: 1rem;
}
.ciy-list .l2>view {
@ -286,82 +287,82 @@ text {
}
.ciy-list .l3 {
font-size: 0.9em;
padding: 0.3em 1.3em;
font-size: 0.9rem;
padding: 0.3em 1.3rem;
color: var(--txt3);
}
.ciy-list .rtz {
position: absolute;
top: 1em;
right: -2.5em;
height: 2em;
line-height: 2em;
width: 9em;
top: 1rem;
right: -2.5rem;
height: 2rem;
line-height: 2rem;
width: 9rem;
text-align: center;
transform: rotate(45deg);
}
.ciy-list .rt {
position: absolute;
top: 0.8em;
right: 0.8em;
top: 0.8rem;
right: 0.8rem;
text-align: right;
font-size: 0.9em;
font-size: 0.9rem;
}
.ciy-list .rb {
text-align: right;
font-size: 0.9em;
font-size: 0.9rem;
}
.ciy-list .lb {
position: absolute;
bottom: 0.9em;
left: 1.2em;
font-size: 0.9em;
bottom: 0.9rem;
left: 1.2rem;
font-size: 0.9rem;
}
.ciy-list .dot {
position: absolute;
bottom: 0.5em;
right: 1em;
padding: 1em;
width: 1.3em;
height: 1.3em;
bottom: 0.5rem;
right: 1rem;
padding: 1rem;
width: 1.3rem;
height: 1.3rem;
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUwOS4xMDAyMzQyNiA1MTJtLTE1My4yNzMzMzEzNCAwYTE1My4yNzMzMzEzNiAxNTMuMjczMzMxMzYgMCAxIDAgMzA2LjU0NjY2MjcgMCAxNTMuMjczMzMxMzYgMTUzLjI3MzMzMTM2IDAgMSAwLTMwNi41NDY2NjI3IDBaIiBmaWxsPSIjNzA3MDcwIj48L3BhdGg+PHBhdGggZD0iTTc4OS43NjE4NDA4MiA1MTJtLTkxLjQ2MTE4MTY0IDBhOTEuNDYxMTgxNjQgOTEuNDYxMTgxNjQgMCAxIDAgMTgyLjkyMjM2MzI5IDAgOTEuNDYxMTgxNjQgOTEuNDYxMTgxNjQgMCAxIDAtMTgyLjkyMjM2MzI5IDBaIiBmaWxsPSIjNzA3MDcwIj48L3BhdGg+PHBhdGggZD0iTTIzNC4yMzgxNTkxOCA1MTJtLTkxLjQ2MTE4MTY0IDBhOTEuNDYxMTgxNjQgOTEuNDYxMTgxNjQgMCAxIDAgMTgyLjkyMjM2MzI4IDAgOTEuNDYxMTgxNjQgOTEuNDYxMTgxNjQgMCAxIDAtMTgyLjkyMjM2MzI4IDBaIiBmaWxsPSIjNzA3MDcwIj48L3BhdGg+PC9zdmc+");
}
.ciy-add {
position: fixed;
bottom: 1em;
right: 1em;
width: 4em;
height: 4em;
bottom: 1rem;
right: 1rem;
width: 4rem;
height: 4rem;
opacity: 0.95;
z-index: 10;
border-radius: 2em;
border-radius: 2rem;
background: linear-gradient(90deg, #8568f7, #4981ff);
}
.ciy-add::after {
content: ' ';
position: absolute;
margin: 1em;
width: 2em;
height: 2em;
margin: 1rem;
width: 2rem;
height: 2rem;
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkyNS42OTYgMzg0cTE5LjQ1NiAwIDM3LjM3NiA3LjY4dDMwLjcyIDIwLjQ4IDIwLjQ4IDMwLjcyIDcuNjggMzcuMzc2cTAgMjAuNDgtNy42OCAzNy44ODh0LTIwLjQ4IDMwLjIwOC0zMC43MiAyMC40OC0zNy4zNzYgNy42OGwtMjg3Ljc0NCAwIDAgMjg3Ljc0NHEwIDIwLjQ4LTcuNjggMzcuODg4dC0yMC40OCAzMC4yMDgtMzAuNzIgMjAuNDgtMzcuMzc2IDcuNjhxLTIwLjQ4IDAtMzcuODg4LTcuNjh0LTMwLjIwOC0yMC40OC0yMC40OC0zMC4yMDgtNy42OC0zNy44ODhsMC0yODcuNzQ0LTI4Ny43NDQgMHEtMjAuNDggMC0zNy44ODgtNy42OHQtMzAuMjA4LTIwLjQ4LTIwLjQ4LTMwLjIwOC03LjY4LTM3Ljg4OHEwLTE5LjQ1NiA3LjY4LTM3LjM3NnQyMC40OC0zMC43MiAzMC4yMDgtMjAuNDggMzcuODg4LTcuNjhsMjg3Ljc0NCAwIDAtMjg3Ljc0NHEwLTE5LjQ1NiA3LjY4LTM3LjM3NnQyMC40OC0zMC43MiAzMC4yMDgtMjAuNDggMzcuODg4LTcuNjhxMzkuOTM2IDAgNjguMDk2IDI4LjE2dDI4LjE2IDY4LjA5NmwwIDI4Ny43NDQgMjg3Ljc0NCAweiIgZGF0YS1zcG0tYW5jaG9yLWlkPSJhMzEzeC5zZWFyY2hfaW5kZXguMC5pNi41NTEwM2E4MW5Iald1ViIgZmlsbD0iI2ZmZmZmZiI+PC9wYXRoPjwvc3ZnPg==");
}
.ciy-close {
position: absolute;
font-size: 2em;
font-size: 2rem;
color: var(--dagt);
line-height: 0.9em;
line-height: 0.9rem;
background: var(--dag5);
width: 1em;
height: 1em;
width: 1rem;
height: 1rem;
text-align: center;
border-radius: 50%;
}
@ -372,9 +373,9 @@ text {
border: 1px solid var(--man6);
position: relative;
display: inline-block;
padding: 0.5em 0.8em;
font-size: 1em;
line-height: 1em;
padding: 0.5em 0.8rem;
font-size: 1rem;
line-height: 1rem;
margin: 2px;
text-align: center;
white-space: nowrap;
@ -382,19 +383,19 @@ text {
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
border-radius: 0.7em;
border-radius: 0.7rem;
}
.btn::after {
content: "Loading...";
position: absolute;
bottom: 0;
right: 0.3em;
right: 0.3rem;
width: auto;
height: auto;
top: auto;
left: auto;
font-size: 1em;
font-size: 1rem;
transform-origin: right bottom;
opacity: 0;
transform: scale(0.8);
@ -414,35 +415,35 @@ text {
}
.btn.lg {
font-size: 1.3em;
padding-left: 1.5em;
padding-right: 1.5em;
font-size: 1.3rem;
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.btn.lgg {
font-size: 1.5em;
padding: 0.7em 1.5em;
font-size: 1.5rem;
padding: 0.7em 1.5rem;
}
.btn.sm {
font-size: 0.8em;
font-size: 0.8rem;
}
.btn.smm {
font-size: 0.7em;
font-size: 0.7rem;
}
.btn.xs {
font-size: 0.7em;
padding: 0.2em 0.8em;
font-size: 0.7rem;
padding: 0.2em 0.8rem;
}
.btn.sq {
border-radius: 0.3em;
border-radius: 0.3rem;
}
.btn.cc {
border-radius: 1.5em;
border-radius: 1.5rem;
}
.btn.long {
@ -484,16 +485,16 @@ text {
/*说明块*/
.ciy-tip {
background: var(--warn4);
margin: 0.5em;
padding: 0.5em;
margin: 0.5rem;
padding: 0.5rem;
border: 1px solid var(--warn5);
border-radius: 0.3em;
border-radius: 0.3rem;
color: var(--txt8);
}
/*断行*/
.ciy-height {
height: 0.3em;
height: 0.3rem;
}
@ -516,8 +517,8 @@ text {
.ciy-grid .grid {
width: 25%;
text-align: center;
padding-top: 0.8em;
padding-bottom: 0.2em;
padding-top: 0.8rem;
padding-bottom: 0.2rem;
}
.ciy-grid.grid3 .grid {
@ -531,12 +532,12 @@ text {
.ciy-grid .name {
padding: 0.5em 0;
color: var(--txt7);
font-size: 0.9em;
font-size: 0.9rem;
}
.ciy-grid .icon {
width: 2em;
height: 2em;
width: 2rem;
height: 2rem;
display: block;
position: relative;
margin: 0 auto;
@ -550,7 +551,7 @@ text {
.ciy-grid .title {
width: 100%;
margin: 1em 0 0 0.5em;
margin: 1em 0 0 0.5rem;
font-weight: bolder;
text-shadow: 0 0 2px var(--bg2);
letter-spacing: 2px;
@ -561,8 +562,8 @@ text {
.ciy-title {
display: flex;
align-items: center;
padding: 0.8em 1em;
font-size: 1.1em;
padding: 0.8em 1rem;
font-size: 1.1rem;
position: relative;
font-weight: bolder;
color: var(--txt9);
@ -570,10 +571,10 @@ text {
.ciy-title.mk::before {
content: "";
width: 0.4em;
height: 1.5em;
margin-right: 0.3em;
border-radius: 0.3em;
width: 0.4rem;
height: 1.5rem;
margin-right: 0.3rem;
border-radius: 0.3rem;
vertical-align: middle;
background: linear-gradient(-60deg, var(--man4), var(--man7));
}
@ -585,7 +586,7 @@ text {
}
.ciy-title .right {
font-size: 0.9em;
font-size: 0.9rem;
font-weight: normal;
color: var(--txt5);
}
@ -593,8 +594,8 @@ text {
.ciy-caption {
display: flex;
align-items: center;
padding: 0.8em 1em;
font-size: 1.1em;
padding: 0.8em 1rem;
font-size: 1.1rem;
position: relative;
font-weight: bolder;
background: var(--bg2);
@ -605,10 +606,10 @@ text {
.ciy-caption.mk::before {
content: "";
width: 0.3em;
height: 1.5em;
margin-right: 0.3em;
border-radius: 0.3em;
width: 0.3rem;
height: 1.5rem;
margin-right: 0.3rem;
border-radius: 0.3rem;
vertical-align: middle;
background: var(--man5);
}
@ -619,7 +620,7 @@ text {
}
.ciy-caption .right {
font-size: 0.9em;
font-size: 0.9rem;
font-weight: normal;
color: var(--txt5);
}
@ -627,17 +628,17 @@ text {
.ciy-caption .sub {
position: absolute;
bottom: 0;
left: 3em;
font-size: 0.7em;
left: 3rem;
font-size: 0.7rem;
font-weight: normal;
color: var(--txt1);
}
/*卡片块*/
.ciy-card {
margin: 0.5em;
margin: 0.5rem;
border: 1px solid var(--bg6);
border-radius: 0.3em;
border-radius: 0.3rem;
box-shadow: 0 0 6px var(--bg6);
background: var(--bg2);
position: relative;
@ -645,46 +646,46 @@ text {
.ciy-card>.title {
border-radius: 0.3em 0.3em 0 0;
padding-left: 1em;
height: 2.5em;
line-height: 2.5em;
padding-left: 1rem;
height: 2.5rem;
line-height: 2.5rem;
background: var(--bg4);
font-weight: bold;
}
.ciy-card>.title.mk::before {
content: "";
width: 0.2em;
width: 0.2rem;
display: inline-block;
border-radius: 0.2em;
margin-right: 0.4em;
border-radius: 0.2rem;
margin-right: 0.4rem;
vertical-align: middle;
height: 1.5em;
height: 1.5rem;
background: var(--man5);
}
.ciy-card .right {
position: absolute;
height: 2.5em;
line-height: 2.5em;
padding-right: 1em;
height: 2.5rem;
line-height: 2.5rem;
padding-right: 1rem;
color: var(--txt5);
top: 0;
right: 0;
}
.ciy-card>.content {
padding: 1em;
padding: 1rem;
}
.ciy-card>.content>view {
line-height: 1.5em;
margin-bottom: 0.5em;
line-height: 1.5rem;
margin-bottom: 0.5rem;
}
.ciy-load {
padding: 3em 0 8em 3em;
line-height: 2em;
padding: 3em 0 8em 3rem;
line-height: 2rem;
background: linear-gradient(180deg, var(--bg5), transparent);
}
@ -693,8 +694,8 @@ text {
background: linear-gradient(45deg, var(--bg4) 25%, var(--bg1) 50%, var(--bg4) 75%);
background-size: 200% 100%;
animation: skeleton 3s linear infinite;
border-radius: 0.3em;
margin-bottom: 1em;
border-radius: 0.3rem;
margin-bottom: 1rem;
}
@keyframes skeleton {
@ -710,11 +711,11 @@ text {
.code,
.kbd {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
padding: 0.1em 0.4em 0 0.4em;
margin: 0 0.2em;
font-size: 0.9em;
line-height: 1.3em;
border-radius: 0.2em;
padding: 0.1em 0.4em 0 0.4rem;
margin: 0 0.2rem;
font-size: 0.9rem;
line-height: 1.3rem;
border-radius: 0.2rem;
display: inline-block;
vertical-align: baseline;
}
@ -736,9 +737,9 @@ text {
.ciy-form-group {
background: var(--bg2);
margin: 1em;
margin: 1rem;
overflow: hidden;
border-radius: 0.5em;
border-radius: 0.5rem;
position: relative;
border: 1px solid var(--bg4);
border-bottom: 2px solid var(--bg6);
@ -750,7 +751,7 @@ text {
bottom: 0;
left: 0;
right: 0;
padding: 1em;
padding: 1rem;
z-index: 40;
text-align: center;
background: var(--bg1);
@ -770,7 +771,7 @@ text {
position: relative;
align-items: center;
border-bottom: 1px solid var(--bg5);
min-height: 4em;
min-height: 4rem;
}
.ciy-form>view {
@ -779,15 +780,15 @@ text {
}
.ciy-form>view:last-child {
margin-right: 1em;
margin-right: 1rem;
}
.ciy-form>label {
margin: 0 1em;
margin: 0 1rem;
flex-shrink: 0;
white-space: nowrap;
align-self: flex-start;
line-height: 4em;
line-height: 4rem;
}
.ciy-form>label.imp {
@ -797,10 +798,10 @@ text {
.ciy-form>label.imp::before {
content: '';
position: absolute;
left: 0.3em;
top: 0.8em;
width: 0.4em;
height: 0.4em;
left: 0.3rem;
top: 0.8rem;
width: 0.4rem;
height: 0.4rem;
background: var(--dag5);
border-radius: 50%;
}
@ -810,7 +811,7 @@ text {
.char4 label.imp::before,
.char5 label.imp::before,
.char6 label.imp::before {
right: -0.5em;
right: -0.5rem;
left: auto;
}
@ -824,50 +825,50 @@ text {
}
.char2 label {
min-width: 2em;
min-width: 2rem;
}
.char3 label {
min-width: 3em;
min-width: 3rem;
}
.char4 label {
min-width: 4em;
min-width: 4rem;
}
.char5 label {
min-width: 5em;
min-width: 5rem;
}
.char6 label {
min-width: 6em;
min-width: 6rem;
}
.ciy-form.v {
flex-direction: column;
align-items: flex-start;
padding-top: 0.5em;
padding-bottom: 0.5em;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.ciy-form.v>view {
text-align: left;
margin: 0 0.5em;
margin: 0 0.5rem;
width: calc(100% - 1em);
}
.ciy-form.v>label {
height: 2em;
line-height: 2em;
height: 2rem;
line-height: 2rem;
}
.ciy-waterfall {
column-count: 2;
column-gap: 0.5em;
column-gap: 0.5rem;
}
.ciy-waterfall .itmcont {
margin-bottom: 0.5em;
margin-bottom: 0.5rem;
width: 100%;
break-inside: avoid;
}
@ -879,46 +880,46 @@ text {
.md-h1 {
font-weight: bold;
font-size: 1.2em;
line-height: 1.5em;
font-size: 1.2rem;
line-height: 1.5rem;
text-align: left;
padding: 0.5em 0 0.5em 0.5em;
padding: 0.5em 0 0.5em 0.5rem;
}
.md-h2 {
font-weight: bold;
font-size: 1.1em;
line-height: 1.8em;
padding: 0.5em 0 0.5em 0.5em;
font-size: 1.1rem;
line-height: 1.8rem;
padding: 0.5em 0 0.5em 0.5rem;
}
.md-h3,
.md-h4,
.md-h5 {
font-weight: bold;
font-size: 1em;
line-height: 1.5em;
padding: 0.5em 0 0.5em 0.5em;
font-size: 1rem;
line-height: 1.5rem;
padding: 0.5em 0 0.5em 0.5rem;
}
.md-content {
font-size: 1em;
text-indent: 1em;
line-height: 2em;
font-size: 1rem;
text-indent: 1rem;
line-height: 2rem;
white-space: pre-wrap;
}
.md-code {
text-indent: 0;
padding: 0.2em 0.4em;
font-size: 0.9em;
line-height: 1em;
margin: 0 0.2em;
padding: 0.2em 0.4rem;
font-size: 0.9rem;
line-height: 1rem;
margin: 0 0.2rem;
display: inline-block;
white-space: nowrap;
color: #ffffff;
background: linear-gradient(340deg, var(--man5), var(--man7));
border-radius: 0.2em;
border-radius: 0.2rem;
}
.txt-smmm.txt-smmm.txt-smmm {
@ -1234,57 +1235,57 @@ text {
}
.t1.t1.t1 {
top: 0.5em;
top: 0.5rem;
}
.l1.l1.l1 {
left: 0.5em;
left: 0.5rem;
}
.r1.r1.r1 {
right: 0.5em;
right: 0.5rem;
}
.b1.b1.b1 {
bottom: 0.5em;
bottom: 0.5rem;
}
.t2.t2.t2 {
top: 1em;
top: 1rem;
}
.l2.l2.l2 {
left: 1em;
left: 1rem;
}
.r2.r2.r2 {
right: 1em;
right: 1rem;
}
.b2.b2.b2 {
bottom: 1em;
bottom: 1rem;
}
.lh1.lh1.lh1 {
line-height: 1em;
line-height: 1rem;
}
.lh2.lh2.lh2 {
line-height: 1.5em;
line-height: 1.5rem;
}
.lh3.lh3.lh3 {
line-height: 2em;
line-height: 2rem;
}
.lh4.lh4.lh4 {
line-height: 2.5em;
line-height: 2.5rem;
}
.ti1.ti1.ti1 {
text-indent: 1em;
text-indent: 1rem;
}
.ti2.ti2.ti2 {
text-indent: 2em;
text-indent: 2rem;
}

View File

@ -95,13 +95,8 @@ class cash_out_apply {
if ($row['cashstatus'] != 10)
continue;
if ($act == 2) { //退余额
$updata = array();
$updata['mycashmoney'] = array('mycashmoney+' . $row['cashmoney']);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $row['vuser']);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新账户失败:' . $db->error);
}
\web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现审核拒绝');
}
$id = $row['id'];
$updata = array();
if ($act == 1) {

View File

@ -62,6 +62,7 @@
dom: '.table'
, url: 'list'
, pagecount: 10
, chkbox: true
, fn_beforedata: function (json) {
ciyfn.fillsearch({
searchdom: '.search'

View File

@ -100,12 +100,7 @@ class cash_out_inv {
if ($row['cashstatus'] != 30)
continue;
if ($act == 2) { //退余额
$updata = array();
$updata['mycashmoney'] = array('mycashmoney+' . $row['cashmoney']);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $row['vuser']);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新账户失败:' . $db->error);
\web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现发票拒绝');
}
$id = $row['id'];
$updata = array();

View File

@ -103,11 +103,7 @@ class cash_out_transfer {
$db->begin();
if ($auditstatus == 90) { //退余额
$updata = array();
$updata['mycashmoney'] = array('mycashmoney+' . $row['cashmoney']);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $row['vuser']);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新账户失败:' . $db->error);
\web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现支付拒绝');
}
$id = $row['id'];
$updata = array();

View File

@ -76,28 +76,6 @@
</div>
</div>
</div>
<div id="alert_tixian" style="display:none;">
<div class="char6 row">
<div class="ciy-form col-24 col-sm-24">
<label class="lang imp">提现金额</label>
<div>
<input type="text" name="money" style="width:6em;text-align: right;" />
</div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label class="lang imp">提现方式</label>
<div>
<ciy-radio com="cashtype" />
</div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label class="lang">事由</label>
<div>
<input type="text" name="memo" style="width:100%;" />
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/jscss/ciy.js"></script>
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
<script type="text/javascript" src="/jscss/ciycmp2.js"></script>
@ -131,8 +109,6 @@
var html = '';
html += `<a class="lang btn def" onclick="menubtn(this, 'view')">查看</a>`;
html += `<a class="lang btn" onclick="menubtn(this, 'edit')">修改</a>`;
if (data['certs'].indexOf('b') > -1)
html += `<a class="lang btn" onclick="menubtn(this, 'tixian')">预提现</a>`;
return html;
}
}
@ -152,29 +128,6 @@
if (btn == 'edit') {
edit(id);
}
if (btn == 'tixian') {
ciyfn.alert({
title: '预提现'
, width: 'pc'
, content: document.getElementById("alert_tixian").innerHTML
//, noparent:true
, fn_showed: function (doc, dom) {
ciycmp({ dom: $5('[com=cashtype]', dom), range: [{ id: 1, name: '线上微信'}, {id: 2, name: '线下转账' }] });
}
, cb: function (opn) {
if (opn.btn == "关闭")
return opn.close();
opn.inputs.id = id;
if (ciyfn.throttle(opn.dombtn)) return;
ciyfn.callfunc('tixian', opn.inputs, function (json) {
table.updateline(json);
opn.close();
ciyfn.toast('提交成功');
});
},
btns: ["提交", "*关闭"]
});
}
}
function getdata(id, act, cb) {

View File

@ -151,50 +151,6 @@ class user {
$ret['data'] = $datarow;
return succjson($ret);
}
public static function json_tixian() {
global $db;
$rsuser = verifyfast();
//if (nopower($db, $rsuser['id'], 'p u'))
// return errjson('您未被授权操作');
$post = new \ciy\post();
$id = $post->getint('id');
$cashtype = $post->getint('cashtype');
$mmoney = $post->getfloat('money') * 100;
$memo = $post->get('memo');
if (empty($memo))
return errjson('请填写事由');
$csql = new \ciy\sql('ap_user');
$csql->where('id', $id);
$datarow = $db->getone($csql);
if (!is_array($datarow))
return errjson('数据不存在');
try {
$db->begin();
$updata = array();
$updata['mycashmoney'] = array('mycashmoney-' . $mmoney);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $id);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新失败:' . $db->error);
$updata = array();
$updata['cashstatus'] = $cashtype == 1 ? 20 : 100;
$updata['vuser'] = $id;
$updata['cashtype'] = $cashtype == 1 ? 2 : 1;
$updata['cashmoney'] = $mmoney;
$updata['addtimes'] = time();
$updata['cashtimes'] = time();
$updata['cashno'] = $memo;
$csql = new \ciy\sql('ap_fina_cash');
if ($db->insert($csql, $updata) === false)
throw new \Exception('新增失败:' . $db->error);
$db->commit();
} catch (\Exception $ex) {
$db->rollback();
savelogfile('err_db', $ex->getMessage());
return errjson($ex->getMessage());
}
return succjson();
}
public static function json_exportxls() {
global $db;
$rsuser = verifyfast();

View File

@ -147,50 +147,6 @@ class user_service {
$ret['data'] = $datarow;
return succjson($ret);
}
public static function json_tixian() {
global $db;
$rsuser = verifyfast();
//if (nopower($db, $rsuser['id'], 'p u'))
// return errjson('您未被授权操作');
$post = new \ciy\post();
$id = $post->getint('id');
$cashtype = $post->getint('cashtype');
$mmoney = $post->getfloat('money') * 100;
$memo = $post->get('memo');
if (empty($memo))
return errjson('请填写事由');
$csql = new \ciy\sql('ap_user');
$csql->where('id', $id);
$datarow = $db->getone($csql);
if (!is_array($datarow))
return errjson('数据不存在');
try {
$db->begin();
$updata = array();
$updata['mycashmoney'] = array('mycashmoney-' . $mmoney);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $id);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新失败:' . $db->error);
$updata = array();
$updata['cashstatus'] = $cashtype == 1 ? 20 : 100;
$updata['vuser'] = $id;
$updata['cashtype'] = $cashtype == 1 ? 2 : 1;
$updata['cashmoney'] = $mmoney;
$updata['addtimes'] = time();
$updata['cashtimes'] = time();
$updata['cashno'] = $memo;
$csql = new \ciy\sql('ap_fina_cash');
if ($db->insert($csql, $updata) === false)
throw new \Exception('新增失败:' . $db->error);
$db->commit();
} catch (\Exception $ex) {
$db->rollback();
savelogfile('err_db', $ex->getMessage());
return errjson($ex->getMessage());
}
return succjson();
}
public static function json_exportxls() {
global $db;
$rsuser = verifyfast();

View File

@ -136,7 +136,7 @@
, fn_showed: function (doc, dom) {
var dat = jsndat.data;
var path = ciyfn.makeuploadpath('cemap_bill', ciyfn.getstorage(ciy_vars.tokenfield));
ciycmp({ dom: $5('[com=cpath]', dom), value: dat.cpath, range: table.once.zc_cemap_pbill });
ciycmp({ dom: $5('[com=cpath]', dom), value: dat.cpath, range: table.json.zc_cemap_pbill });
$5('[name=name]', dom).val(dat.name);
ciycmp({ dom: $5('[com=url]', dom), value: dat.url, path: path });
ciycmp({ dom: $5('[com=w]', dom), value: dat.w });

View File

@ -35,7 +35,7 @@ class bill {
$csql->limit($pageno, $pagecount);
$mainrowcount = $post->getint('count');
$rows = $db->get($csql, $mainrowcount);
$ret = array('where' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows);
$ret = array('searchwhere' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows);
if ($post->getbool('field')) {
$field = array();
$fshow = $db->getfield($field, 'zc_cemap_bill');
@ -48,13 +48,13 @@ class bill {
$ret['fshow'] = $fshow;
}
if ($post->getbool('once')) {
$ret['once'] = array();
$ret['once'] = true;
$input = array();
$input[] = array('type' => 'input', 'form' => 'cpath', 'name' => '路径', 'prop' => ' style="width:8em;"');
$input[] = array('type' => 'input', 'form' => 'name', 'name' => '名称', 'prop' => ' style="width:8em;"');
$ret['once']['input'] = $input;
$ret['searchinput'] = $input;
$csql = (new \ciy\sql('zc_cemap_pbill'))->column('id,name,upid');
$ret['once']['zc_cemap_pbill'] = $db->get($csql);
$ret['zc_cemap_pbill'] = $db->get($csql);
}
return succjson($ret);
}

View File

@ -483,13 +483,13 @@
</form>
<div id="alert_bind" style="display:none;">
<div class="char4 row">
<div class="form-group col-24 col-sm-24">
<div class="ciy-form col-24 col-sm-24">
<label>绑定</label>
<div>
<ciy-select com="bind"></ciy-select>
</div>
</div>
<div class="form-group col-24 col-sm-24">
<div class="ciy-form col-24 col-sm-24">
<label>名称</label>
<div>
<input type="text" name="name" style="width:100%;" />

View File

@ -211,7 +211,7 @@
//, noparent:true
, fn_showed: function (doc, dom) {
var dat = jsndat.data;
ciycmp({ dom: $5('[com=cpath]', dom), value: dat.cpath, range: table.once.zc_cemap_pglb });
ciycmp({ dom: $5('[com=cpath]', dom), value: dat.cpath, range: table.json.zc_cemap_pglb });
$5('[name=name]', dom).val(dat.name);
ciycmp({ dom: $5('[com=url]', dom), value: dat.url, path: 'glb', stor: Glob.stor });
}

View File

@ -35,7 +35,7 @@ class glb {
$csql->limit($pageno, $pagecount);
$mainrowcount = $post->getint('count');
$rows = $db->get($csql, $mainrowcount);
$ret = array('where' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows);
$ret = array('searchwhere' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows);
if ($post->getbool('field')) {
$field = array();
$fshow = $db->getfield($field, 'zc_cemap_glb');
@ -49,13 +49,13 @@ class glb {
$ret['fshow'] = $fshow;
}
if ($post->getbool('once')) {
$ret['once'] = array();
$ret['once'] = true;
$input = array();
$input[] = array('type' => 'input', 'form' => 'cpath', 'name' => '路径', 'prop' => ' style="width:8em;"');
$input[] = array('type' => 'input', 'form' => 'name', 'name' => '名称', 'prop' => ' style="width:8em;"');
$ret['once']['input'] = $input;
$ret['searchinput'] = $input;
$csql = (new \ciy\sql('zc_cemap_pglb'))->column('id,name,upid');
$ret['once']['zc_cemap_pglb'] = $db->get($csql);
$ret['zc_cemap_pglb'] = $db->get($csql);
}
return succjson($ret);
}

View File

@ -20,12 +20,12 @@ class pathbill {
$ret['fshow'] = $fshow;
}
if ($post->getbool('once')) {
$ret['once'] = array();
$ret['once'] = true;
$input = array();
$input[] = array(
'type' => 'input', 'form' => 'name', 'name' => '分类名称', 'prop' => ' style="width:8em;"'
);
$ret['once']['input'] = $input;
$ret['searchinput'] = $input;
}
return succjson($ret);
}

View File

@ -20,12 +20,12 @@ class pathglb {
$ret['fshow'] = $fshow;
}
if ($post->getbool('once')) {
$ret['once'] = array();
$ret['once'] = true;
$input = array();
$input[] = array(
'type' => 'input', 'form' => 'name', 'name' => '分类名称', 'prop' => ' style="width:8em;"'
);
$ret['once']['input'] = $input;
$ret['searchinput'] = $input;
}
return succjson($ret);
}

View File

@ -428,6 +428,7 @@
|| data.COLUMN_NAME == 'ip') {
spset.noup = 'no';
}
if (data.COLUMN_NAME == table.json.dbsaas.saasfield) {
spset.noup = 'saas';
}

View File

@ -784,9 +784,8 @@ if($hasedit){
$codex .= "\n ciycmp({ dom: $5('[com={$col}]', dom), value: dat.{$col}, path: ciyfn.makeuploadpath('{$fld['set']['savepath']}', ciyfn.getstorage(ciy_vars.tokenfield)) });";
} else if ($cate == 'FILEMD') {
$codex .= "\n var path = ciyfn.makeuploadpath('{$fld['set']['savepath']}', ciyfn.getstorage(ciy_vars.tokenfield));";
$codex .= "\n path = path.replace(/{Y}/g, new Date().getFullYear()).replace(/{m}/g, ciyfn.topad0(new Date().getMonth() + 1, 2)).replace(/{d}/g, ciyfn.topad0(new Date().getDate(), 2));";
$codex .= "\n ciyfn.ajax({";
$codex .= "\n url: ciyfn.file_stor('/' + path + '/' + dat.id + '_' + dat.{$col} + '.txt')";
$codex .= "\n url: ciyfn.file_stor('/md/{$fld['set']['savepath']}/' + dat.id + '_' + dat.{$col} + '.txt')";
$codex .= "\n , method: 'GET'";
$codex .= "\n , success: function (res) {";
$codex .= "\n ciycmp({ dom: $5('[com={$col}]', dom), value: res, path: path });";

View File

@ -591,7 +591,7 @@ function code_pc_php($post) {
foreach ($flds as $fld) {
$col = $fld['col'];
if ($fld['cate'] == 'FILEMD'){
$codex .= "\n if (storsave('/{Y}/{m}{d}/{$fld['set']['savepath']}/' . \$id . '_' . \${$col} . '.txt', \${$col}_text) === false)";
$codex .= "\n if (storsave('/md/{$fld['set']['savepath']}/' . \$id . '_' . \${$col} . '.txt', \${$col}_text) === false)";
$codex .= "\n return errjson('写入失败');";
}
}

285
web/ambap/ciyai.php Normal file
View File

@ -0,0 +1,285 @@
<?php
namespace web\ambap;
class ciyai {
public static function json_rawai($param = null, $debug = false, $tabpre = 'zc_') {
global $db;
$post = new \ciy\post($param);
$aikey = $post->getint('aikey');
$aikeyrow = null;
if ($aikey > 0) {
$csql = new \ciy\sql($tabpre.'ai_key');
$csql->where('id', $aikey);
$aikeyrow = $db->getone($csql);
if (!is_array($aikeyrow))
return errjson('AI Key不存在');
}
if (!is_array($aikeyrow)) {
$csql = new \ciy\sql($tabpre.'ai_key');
$csql->where('id', 1);
$aikeyrow = $db->getone($csql);
if (!is_array($aikeyrow))
return errjson('AI Key未设置');
}
$system = $post->get('system');
$chat = $post->get('chat');
if (empty($chat))
return errjson('请输入聊天内容');
$openai = new \ciy\openai($aikeyrow);
$openai->debug($debug);
$openai->setparam($post->get('aiprange'));
$openai->newsystem($system);
$retai = $openai->completion($chat, strpos($chat . $system, 'JSON') !== false);
if (is_string($retai))
return errjson($retai);
$ret['ai'] = $retai;
return succjson($ret);
}
public static function json_aidecision($param = null, $debug = false, $tabpre = 'zc_') {
global $db;
set_time_limit(0);
$timespan = time();
$post = new \ciy\post($param);
$id = $post->getint('id');
$csql = new \ciy\sql($tabpre.'ai_decision');
$csql->where('id', $id);
$decisionrow = $db->getone($csql);
if (!is_array($decisionrow))
return errjson('AI决策单元不存在');
$csql = new \ciy\sql($tabpre.'ai_key');
$csql->where('id', $decisionrow['aikey']);
$aikeyrow = $db->getone($csql);
if (!is_array($aikeyrow))
return errjson('AI Key未设置');
$funcdatarows = null;
if (!empty($decisionrow['funcids'])) {
$csql = new \ciy\sql($tabpre.'ai_funcdata');
$csql->where('id in', trim($decisionrow['funcids'], ','));
$funcdatarows = $db->get($csql);
}
if (strpos($decisionrow['sysprompt'] . $decisionrow['roleprompt'], '{{know.') === false) {
$csql = new \ciy\sql($tabpre.'ai_knowcata');
$knowcatarows = $db->get($csql);
if (count($knowcatarows) > 0) {
if ($funcdatarows == null)
$funcdatarows = array();
$descs = '';
foreach ($knowcatarows as $knowcatarow) {
$descs .= "\n{知识库ID:" . $knowcatarow['id'] . ", " . $knowcatarow['name'] . ',' . $knowcatarow['aiguide'] . '}';
}
$funcdatarows[] = array(
'id' => 0,
'name' => 'know',
'funcname' => 'know',
'descs' => '如果需要补充学习专业知识库信息,调用该函数。知识库列表有,' . $descs,
'paramjson' => '*ID=准确的知识库ID',
'funcparam' => ''
);
}
}
$csql = new \ciy\sql($tabpre.'ai_key');
$csql->where('id', $decisionrow['aikey']);
$aikeyrow = $db->getone($csql);
if (!is_array($aikeyrow))
return errjson('AI Key不存在');
$system = preg_replace_callback('/\{\{([^}]+)\}\}/', function ($matches) use ($db, $post, $tabpre) {
$key = $matches[1];
if (substr($key, 0, 5) == 'know.') {
$knowcataname = substr($key, 5);
$csql = new \ciy\sql($tabpre.'ai_knowcata');
$csql->where('name', $knowcataname);
$knowcatarow = $db->getone($csql);
if (!is_array($knowcatarow))
return '';
$csql = new \ciy\sql($tabpre.'ai_knowledge');
$csql->where('cataid', $knowcatarow['id']);
$knowrows = $db->get($csql);
$knowstr = '';
foreach ($knowrows as $knowrow) {
$knowstr .= $knowrow['content'] . "\n";
}
return $knowstr;
}
$val = $post->get($key);
if (is_array($val))
$val = json_encode($val, JSON_UNESCAPED_UNICODE);
return $val . '';
}, $decisionrow['sysprompt']);
$roleprompt = preg_replace_callback('/\{\{([^}]+)\}\}/', function ($matches) use ($db, $post, $tabpre) {
$key = $matches[1];
if (substr($key, 0, 5) == 'know.') {
$knowcataname = substr($key, 5);
$csql = new \ciy\sql($tabpre.'ai_knowcata');
$csql->where('name', $knowcataname);
$knowcatarow = $db->getone($csql);
if (!is_array($knowcatarow))
return '';
$csql = new \ciy\sql($tabpre.'ai_knowledge');
$csql->where('cataid', $knowcatarow['id']);
$knowrows = $db->get($csql);
$knowstr = '';
foreach ($knowrows as $knowrow) {
$knowstr .= $knowrow['content'] . "\n";
}
return $knowstr;
}
$val = $post->get($key);
if (is_array($val))
$val = json_encode($val, JSON_UNESCAPED_UNICODE);
return $val . '';
}, $decisionrow['roleprompt']);
$openai = new \ciy\openai($aikeyrow);
$openai->debug($debug);
$openai->setparam($decisionrow['aiprange']);
$openai->newsystem($system);
$retai = $openai->completion($roleprompt, strpos($roleprompt . $system, 'JSON') !== false, $funcdatarows, function ($funcarray) use ($funcdatarows) {
$funcdatarow = ccode($funcdatarows, substr($funcarray['name'], 1), 'id', null);
if (!is_array($funcdatarow))
return 'ERR未定义函数:' . $funcarray['name'];
$funcname = $funcdatarow['funcname'];
if (substr($funcname, 0, 4) != 'http') {
if ($funcname[0] != '\\')
$funcname = '\\web\\admin\\aifunc\\' . $funcname;
if (!class_exists($funcname))
return 'ERR无效类:' . $funcname;
if (!method_exists($funcname, 'main'))
return 'ERR无效函数:' . $funcname . '::main';
$funcname .= '::main';
$arguments = json_decode($funcarray['arguments'], true);
$funcparams = getstrparam($funcdatarow['funcparam'], "\n");
foreach ($funcparams as $key => $val) {
$arguments[$key] = $val;
}
return call_user_func($funcname, $arguments);
}
//远程调用url
$http = new \ciy\http();
$http->request($funcname, $funcarray['arguments']);
$datastr = $http->get_data();
return json_decode($datastr, true);
});
if (is_string($retai))
return errjson('AI识别失败: ' . $retai);
$decci = 0;
$aichat = json_encode($openai->messages, JSON_UNESCAPED_UNICODE);
$resulttxt = json_encode($retai, JSON_UNESCAPED_UNICODE);
if ($decisionrow['aicalkey'] > 0 && !empty($decisionrow['calprompt'])) {
$post->post['result.ai'] = $aichat;
$post->post['result.data'] = $resulttxt;
$csql = new \ciy\sql($tabpre.'ai_key');
$csql->where('id', $decisionrow['aicalkey']);
$aikeyrow = $db->getone($csql);
if (!is_array($aikeyrow))
return errjson('AI Key不存在');
$calprompt = preg_replace_callback('/\{\{([^}]+)\}\}/', function ($matches) use ($db, $post, $tabpre) {
$key = $matches[1];
if (substr($key, 0, 5) == 'know.') {
$knowcataname = substr($key, 5);
$csql = new \ciy\sql($tabpre.'ai_knowcata');
$csql->where('name', $knowcataname);
$knowcatarow = $db->getone($csql);
if (!is_array($knowcatarow))
return '';
$csql = new \ciy\sql($tabpre.'ai_knowledge');
$csql->where('cataid', $knowcatarow['id']);
$knowrows = $db->get($csql);
$knowstr = '';
foreach ($knowrows as $knowrow) {
$knowstr .= $knowrow['content'] . "\n";
}
return $knowstr;
}
$val = $post->get($key);
if (is_array($val))
$val = json_encode($val, JSON_UNESCAPED_UNICODE);
return $val . '';
}, $decisionrow['calprompt']);
$openai = new \ciy\openai($aikeyrow);
$openai->debug($debug);
$openai->setparam($decisionrow['aicalprange']);
$openai->newsystem();
$retcalai = $openai->completion($calprompt, true);
$decci = (int)$retcalai['confidence'];
} else if ($decisionrow['aicalkey'] == 0 && !empty($decisionrow['aicalfunc'])) {
$funcname = $decisionrow['aicalfunc'];
if ($funcname[0] != '\\')
$funcname = '\\web\\admin\\aifunc\\' . $funcname;
if (!class_exists($funcname))
return errjson('无效类:' . $funcname);
if (!method_exists($funcname, 'main'))
return errjson('无效函数:' . $funcname . '::main');
$funcname .= '::main';
$decci = call_user_func($funcname, $retai, $decisionrow['calprompt']);
}
$ret['version'] = $decisionrow['version'];
$ret['sec'] = time() - $timespan + 1; //用时
$ret['ci'] = $decci; //置信度
$ret['ai'] = $retai; //结果
if ($post->get('_more') == 'ok') {
$ret['messages'] = $openai->messages; //交互过程
$ret['roleprompt'] = $roleprompt; //提示词
$ret['system'] = $system; //角色描述
}
return succjson($ret);
}
public static function multiparam($input, $sep) {
$len = strlen($input);
$ips = array();
$i = 0;
$inMultiline = false;
$currentParam = '';
$currentValue = '';
while ($i < $len) {
if (!$inMultiline) {
$paramStart = $i;
while ($i < $len && $input[$i] !== $sep) {
if ($input[$i] === "\n")
return '参数格式不合法';
$i++;
}
if ($i == $len)
return '参数格式不合法,应用' . $sep . '号分隔';
$currentParam = trim(substr($input, $paramStart, $i - $paramStart));
if (empty($currentParam))
return '参数没有参数名';
$i++;
if ($i < $len && $input[$i] === '`') {
$inMultiline = true;
$i++;
$currentValue = '';
} else {
$valueStart = $i;
while ($i < $len && $input[$i] !== "\n")
$i++;
$currentValue = trim(substr($input, $valueStart, $i - $valueStart));
$ips[] = $currentParam . $sep . $currentValue;
$i++;
}
} else {
$valueStart = $i;
while ($i < $len && $input[$i] !== '`')
$i++;
$currentValue .= trim(substr($input, $valueStart, $i - $valueStart));
if ($i < $len && $input[$i] === '`') {
$ips[] = $currentParam . $sep . $currentValue;
$inMultiline = false;
$i++;
if ($i < $len && $input[$i] === "\n") {
$i++;
}
} else {
$ips[] = $currentParam . $sep . $currentValue;
break;
}
}
}
if (count($ips) == 0)
return '参数都不符合条件';
return $ips;
}
}

View File

@ -127,7 +127,7 @@ function gettoken($db, $id) {
$csql->where('id', $id);
$tokenrow = $db->getone($csql);
if (!is_array($tokenrow))
return array();
return '获取数据库token失败:' . $id;
$cfgtoken = str_replace('{PATH_ROOT}', PATH_ROOT, $tokenrow['cfgtoken']);
$cfg = getstrparam($cfgtoken, "\n");
$cfg['accesstoken'] = $tokenrow['accesstoken'];

View File

@ -133,14 +133,13 @@ class login {
$post = new \ciy\post();
$code = $post->get('code');
$upid = $post->getint('upid');
$wxcfg = gettoken($db, 1);
$wxpay = new \ciy\wxfunc($wxcfg);
$ret = $wxpay->code2Session($code);
if (!is_array($ret))
return errjson($ret);
$weixinapi = new \web\api\weixin(1);
$wxret = $weixinapi->call('https://api.weixin.qq.com/sns/jscode2session?grant_type=authorization_code&appid={appid}&secret={appsecret}&js_code=' . $code);
if (is_string($wxret))
return errjson($wxret);
$openid = $ret['openid'];
$sskey = $ret['session_key'];
$openid = $wxret['openid'];
$sskey = $wxret['session_key'];
$csql = new \ciy\sql('ap_user');
$csql->where('wxminaid', $openid);
$rsuser = $db->getone($csql);
@ -151,8 +150,8 @@ class login {
$userid = $rsuser['id'];
if ($rsuser['upid'] == 0 && $upid > 0 && $upid != $userid)
$rsuser['upid'] = $upid;
if (isset($ret['unionid']))
$rsuser['wxunionid'] = $ret['unionid'];
if (isset($wxret['unionid']))
$rsuser['wxunionid'] = $wxret['unionid'];
$rsuser['wxminakey'] = $sskey;
$rsuser['wxminaid'] = $openid;
$rsuser['trytime'] = 0;
@ -168,11 +167,11 @@ class login {
$newpnt = 1000; //注册赠送积分
$rsuser = array();
$rsuser['upid'] = $upid;
if (isset($ret['unionid']))
$rsuser['wxunionid'] = $ret['unionid'];
if (isset($wxret['unionid']))
$rsuser['wxunionid'] = $wxret['unionid'];
$rsuser['icon'] = '';
$rsuser['certs'] = '';
$rsuser['name'] = ':' . substr($openid, -6);
$rsuser['name'] = '';
$rsuser['mobile'] = '';
$rsuser['stpstatus'] = 10;
$rsuser['userlevel'] = 10;
@ -368,12 +367,13 @@ class login {
$ret['me']['mypnt'] = $userrow['mypnt'];
$ret['me']['certs'] = $userrow['certs'];
$ret['me']['needpass'] = empty($userrow['password']);
$csql = new \ciy\sql('zc_debug_user');
$csql->where('targettype', 21);
$csql->where('isuse', 1);
$csql->where('user', $userrow['mobile']);
$ret['me']['dbg'] = is_array($db->getone($csql));
if (!empty($userrow['mobile'])) {
$csql = new \ciy\sql('zc_debug_user');
$csql->where('targettype', 21);
$csql->where('isuse', 1);
$csql->where('user', $userrow['mobile']);
$ret['me']['dbg'] = is_array($db->getone($csql));
}
$csql = new \ciy\sql('ap_usr_ext');
$csql->where('id', $userrow['id']);
$extrow = $db->getone($csql);

View File

@ -122,19 +122,15 @@ class me {
$param['openid'] = $rsuser['wxminaid'];
$param['notify_url'] = $_token['maindomain'] . 'wxpay.transfer';
$param['transfer_remark'] = '佣金奖励';
$param['transfer_amount'] = $cashmoney;
$param['transfer_amount'] = toint($cashmoney);
$param['transfer_scene_report_infos'] = array();
$param['transfer_scene_report_infos'][] = array('info_type' => '岗位类型', 'info_content' => '采集员');
$param['transfer_scene_report_infos'][] = array('info_type' => '报酬说明', 'info_content' => '用户主动申请提现');
$wxcfg = gettoken($db, 1);
$wxpay = new \ciy\wxfunc($wxcfg);
$rettransfer = $wxpay->transfer($param);
if (is_string($rettransfer))
return errjson($rettransfer);
$rettransfer['mchid'] = $wxpay->mchid;
$rettransfer['appid'] = $wxpay->appid;
$ret['transfer'] = $rettransfer;
$weixinapi = new \web\api\weixin(1);
$wxret = $weixinapi->transfer($param);
if (is_string($wxret))
return errjson($wxret);
$ret['transfer'] = $wxret;
return succjson($ret);
}
private static function caltax($money) {
@ -195,12 +191,7 @@ class me {
}
try {
$db->begin();
$updata = array();
$updata['mycashmoney'] = array('mycashmoney-' . $cash);
$csql = new \ciy\sql('ap_user');
$csql->where('id', $rsuser['id']);
if ($db->update($csql, $updata) === false)
throw new \Exception('更新账户失败:' . $db->error);
\web\cdao::usercashoe($db, 11, $rsuser['id'], -$cash, '提现');
$updata = array();
$updata['cashstatus'] = 10;
$updata['cashmoney'] = $cash;
@ -361,9 +352,8 @@ class me {
$param['amount']['total'] = (int)$money;
$param['payer'] = array();
$param['payer']['openid'] = $rsuser['wxminaid'];
$wxcfg = gettoken($db, 1);
$wxpay = new \ciy\wxfunc($wxcfg);
$retpay = $wxpay->pay($param);
$weixinapi = new \web\api\weixin(1);
$retpay = $weixinapi->pay($param);
if (is_string($retpay))
return errjson($retpay);
$retpay['orderid'] = $orderid;
@ -440,9 +430,8 @@ class me {
$param['amount']['total'] = (int)$payprice;
$param['payer'] = array();
$param['payer']['openid'] = $rsuser['wxminaid'];
$wxcfg = gettoken($db, 1);
$wxpay = new \ciy\wxfunc($wxcfg);
$retpay = $wxpay->pay($param);
$weixinapi = new \web\api\weixin(1);
$retpay = $weixinapi->pay($param);
if (is_string($retpay))
return errjson($retpay);
$retpay['orderid'] = $orderid;
@ -514,6 +503,11 @@ class me {
return errjson('新增失败:' . $db->error);
return succjson();
}
public static function json_user_show_more() {
global $db;
$ret['data'] = null;
return succjson($ret);
}
public static function json_safe_real_init() {
global $db;
$rsuser = verifyfast();
@ -521,6 +515,7 @@ class me {
$csql->where('vuser', $rsuser['id']);
$csql->order('id desc');
$ret['data'] = $db->getone($csql);
$ret['inputtype'] = 1;
return succjson($ret);
}
public static function json_safe_real_submit() {
@ -774,40 +769,25 @@ class me {
return succjson();
}
public static function json_share_qrcode_get() {
global $db;
$rsuser = verifyfast();
$filename = '/xcxqrcode/' . $rsuser['id'] . '.jpg';
$ret['qrcode'] = $filename;
$filename = PATH_WEB . 'ud' . $filename;
if (file_exists($filename))
return succjson($ret);
$wxcfg = gettoken($db, 1);
$wx = new \ciy\wxfunc($wxcfg);
if ($wxcfg['exptimes'] < time()) {
$access = $wx->getaccess();
if (is_string($access))
return errjson($access);
settoken($db, 1, $access);
$wx->accesstoken = $access['accesstoken'];
}
$param = array();
$param['scene'] = 'upid=' . $rsuser['id'] . '&carduser=' . $rsuser['id'];
$param['page'] = 'pages/main/index';
$param['check_path'] = true;
$param['env_version'] = 'release';
$param['width'] = 1280;
$retwx = $wx->getwxacodeunlimit($param);
if (@$retwx[0] == '{') {
$json = json_decode($retwx, true);
if ($json === null)
return errjson('微信服务器无法连接getwxacodeunlimit');
if (isset($json['errmsg']))
return errjson($json['errmsg']);
return errjson('生成二维码失败');
}
$weixinapi = new \web\api\weixin(1);
$wxret = $weixinapi->call('https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={accesstoken}', $param, true);
if (is_string($wxret))
return errjson($wxret);
dirmake(dirname($filename));
$fp = fopen($filename, 'w');
fwrite($fp, $retwx);
fwrite($fp, $wxret['bin']);
fclose($fp);
return succjson($ret);
}
@ -1029,13 +1009,12 @@ class me {
$param['amount']['total'] = (int)$money;
$param['payer'] = array();
$param['payer']['openid'] = $rsuser['wxminaid'];
$wxcfg = gettoken($db, 1);
$wxpay = new \ciy\wxfunc($wxcfg);
$ret = $wxpay->pay($param);
if (is_string($ret))
return errjson($ret);
$ret['orderid'] = $orderid;
return succjson($ret);
$weixinapi = new \web\api\weixin(1);
$retpay = $weixinapi->pay($param);
if (is_string($retpay))
return errjson($retpay);
$retpay['orderid'] = $orderid;
return succjson($retpay);
}
public static function json_me_balance_get() {
global $db;

View File

@ -57,6 +57,15 @@ class wxpay {
throw new \Exception('更新ap_cash_in失败:' . $db->error);
//sendusermsg($db, $orderrow['userid'], '集市通知', '买家已付款,请及时处理', '/work/ec/order_detail?id=' . $noid);
$updata = array();
$updata['cashietype'] = 10;
$updata['iemoney'] = $inmoney;
$updata['vuser'] = $userid;
$updata['name'] = '在线充值';
$updata['addtimes'] = tostamp();
$csql = new \ciy\sql('ap_cash_ie');
if ($db->insert($csql, $updata) === false)
throw new \Exception('新建消费收支失败:' . $db->error);
$updata = array();
$updata['mymoney'] = array('mymoney+' . $inmoney);
$updata['myinvmoney'] = array('myinvmoney+' . $inmoney);

View File

@ -3,7 +3,26 @@
namespace web\api;
class thirdapi {
static function checkbadword($wordstr, $strict = 1) {
static function checkbadword_wx($content, $rsuser) {
$post = array();
$post['content'] = $content;
$post['version'] = 2;
$post['scene'] = 4;
$post['openid'] = $rsuser['wxminaid'];
$weixinapi = new \web\api\weixin(1);
//https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/sec-center/sec-check/msgSecCheck.html
$wxret = $weixinapi->call('https://api.weixin.qq.com/wxa/msg_sec_check?access_token={accesstoken}', $post);
if (is_string($wxret))
return errjson($wxret);
$json['code'] = 1;
if ($wxret['result']['suggest'] == 'pass')
return true;
$wxret['user'] = $rsuser;
savelogfile('wx_badword', json_encode($wxret));
return '有违禁词,不能发布';
}
static function checkbadword_luckycola($wordstr, $strict = 1) {
return true;
$http = new \ciy\http();
$post = array();
$post['ColaKey'] = 'V0txKKBrP8xzyN1761587699258qq6ro7N0sC'; //2025-12-27 1:54:59 https://luckycola.com.cn/public/dist/#/userCenter

158
web/api/weixin.php Normal file
View File

@ -0,0 +1,158 @@
<?php
namespace web\api;
class weixin {
public $tokenid;
public $token;
function __construct($tokenid) {
global $db;
$this->token = null;
$ret = gettoken($db, $tokenid);
if (is_string($ret))
return $this->err($ret);
$this->tokenid = $tokenid;
$this->token = $ret;
}
function err($ret, $log = '') {
savelogfile('WXPAY', $ret . $log);
return $ret;
}
public function call($url, $post = null, $isbinary = false) {
if (!$this->token)
return 'token不存在';
if (strpos($url, '{accesstoken}') !== false) {
$ret = $this->getaccesstoken();
if (is_string($ret))
return $ret;
$url = str_replace('{accesstoken}', $ret['accesstoken'], $url);
}
if (strpos($url, '{appid}') !== false)
$url = str_replace('{appid}', $this->token['appid'], $url);
if (strpos($url, '{appsecret}') !== false)
$url = str_replace('{appsecret}', $this->token['appsecret'], $url);
$http = new \ciy\http();
$http->set_headeronce('Content-Type', 'application/json');
$http->set_headeronce('Accept', 'application/json');
if (is_array($post))
$post = json_encode($post, JSON_UNESCAPED_UNICODE);
$http->request($url, $post);
$statcode = $http->get_statcode();
if ($statcode != 200 && $statcode != 204)
return $this->err('微信服务器无法连接,错误码:' . $statcode);
$result = $http->get_data();
if ($isbinary) {
if (@$result[0] != '{')
return array('bin' => $result);
}
$json = json_decode($result, true);
if ($json === null)
return $this->err('微信服务器返回数据失败', $result);
if (isset($json['errcode']) && $json['errcode'] != 0)
return $this->err('微信服务器返回错误:' . @$json['errmsg']);
return $json;
}
public function refund($param) { //退款
$result = $this->certcall('https://api.mch.weixin.qq.com', '/v3/refund/domestic/refunds', $param);
if (is_string($result))
return $result;
return $result;
}
public function transfer($param) { //提现
$param['appid'] = $this->token['appid'];
$result = $this->certcall('https://api.mch.weixin.qq.com', '/v3/fund-app/mch-transfer/transfer-bills', $param);
if (is_string($result))
return $result;
$result['mchid'] = $this->token['mchid'];
$result['appid'] = $this->token['appid'];
return $result;
}
public function pay($param) { //支付
$param['appid'] = $this->token['appid'];
$param['mchid'] = $this->token['mchid'];
$result = $this->certcall('https://api.mch.weixin.qq.com', '/v3/pay/transactions/jsapi', $param);
if (is_string($result))
return $result;
$timestamp = time() . '';
$nonce = uniqid() . uniqid();
$pkey = openssl_pkey_get_private(file_get_contents($this->token['pem_path']));
$message = $this->token['appid'] . "\n" . $timestamp . "\n" . $nonce . "\nprepay_id=" . $result['prepay_id'] . "\n";
openssl_sign($message, $raw_sign, $pkey, 'sha256WithRSAEncryption');
$sign = base64_encode($raw_sign);
$ret['appId'] = $this->token['appid'];
$ret['timeStamp'] = $timestamp;
$ret['nonceStr'] = $nonce;
$ret['package'] = 'prepay_id=' . $result['prepay_id'];
$ret['signType'] = 'RSA';
$ret['paySign'] = $sign;
return $ret;
}
private function certcall($domain, $url, $post) {
if (!file_exists($this->token['pem_path']))
return $this->err('证书文件不存在', $this->token['pem_path']);
$timestamp = time() . '';
$nonce = uniqid() . uniqid();
$post = json_encode($post, JSON_UNESCAPED_UNICODE);
$message = "POST\n" . $url . "\n" . $timestamp . "\n" . $nonce . "\n" . $post . "\n";
$pkey = openssl_pkey_get_private(file_get_contents($this->token['pem_path']));
openssl_sign($message, $raw_sign, $pkey, 'sha256WithRSAEncryption');
$sign = base64_encode($raw_sign);
$token = 'mchid="' . $this->token['mchid'] . '",nonce_str="' . $nonce . '",timestamp="' . $timestamp . '",serial_no="' . $this->token['pem_no'] . '",signature="' . $sign . '"';
$http = new \ciy\http();
$http->set_headeronce('Content-Type', 'application/json');
$http->set_headeronce('Accept', 'application/json');
$http->set_headeronce('Authorization', 'WECHATPAY2-SHA256-RSA2048 ' . $token);
$http->request($domain . $url, $post);
$statcode = $http->get_statcode();
if ($statcode == 200 || $statcode == 204) {
$result = $http->get_data();
$json = json_decode($result, true);
if ($json === null)
return array('code' => 1);
if (isset($json['message']))
return $this->err('微信服务器返回错误:' . $json['message']);
$json['code'] = 1;
return $json;
} else {
$res['errmsg'] = 1;
$result = $http->get_data();
$json = json_decode($result, true);
if ($json === null)
return $this->err('微信服务器无法连接pay', $result);
if (isset($json['message']))
return $this->err('微信服务器返回错误:' . $json['message']);
return $this->err('微信服务器返回json:' . $result);
}
}
private function getaccesstoken() {
global $db;
if ($this->token['exptimes'] > time())
return array('accesstoken' => $this->token['accesstoken']);
$http = new \ciy\http();
$http->set_headeronce('Content-Type', 'application/json');
$http->set_headeronce('Accept', 'application/json');
$http->request('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->token['appid'] . '&secret=' . $this->token['appsecret']);
$result = $http->get_data();
$json = json_decode($result, true);
if ($json === null)
return $this->err('微信服务器无法连接token', $result);
if (toint(@$json['errcode']) != 0)
return $this->err($json['errmsg']);
$accesstoken = @$json['access_token'];
if (empty($accesstoken))
return $this->err('微信token授权失败', $result);
$exptimes = time() + toint($json['expires_in']);
$updata = array();
$updata['accesstoken'] = $accesstoken;
$updata['exptimes'] = $exptimes;
$ret = settoken($db, $this->tokenid, $updata);
if (is_string($ret))
return $this->err($ret);
return array('accesstoken' => $accesstoken);
}
}

View File

@ -40,33 +40,50 @@ ciyfn.markdown = function (markdown) {
}
var cr = mds[m].substring(1, 2).toLowerCase();
if (mds[m].substring(0, 5) == '#####') {
if (mds[m].substring(5, 6) == '1')
oladd(4, titnum);
if (mds[m].substring(5, 6) == '.')
html += '<h5 class="md-h5">' + olnum(4, titnum, '、') + convertcode(mds[m].substring(6)) + '</h5>';
else if (mds[m].substring(5, 6) == ':')
html += '<div class="md-content">' + olnum(4, titnum, ' ') + convertcode(mds[m].substring(6)) + '</div>';
else
html += '<h5 class="md-h5">' + convertcode(mds[m].substring(5)) + '</h5>';
} else if (mds[m].substring(0, 4) == '####') {
if (mds[m].substring(4, 5) == '1')
oladd(3, titnum);
if (mds[m].substring(4, 5) == '.')
html += '<h4 class="md-h4">' + olnum(3, titnum, '、') + convertcode(mds[m].substring(5)) + '</h4>';
else if (mds[m].substring(4, 5) == ':')
html += '<div class="md-content">' + olnum(3, titnum, ' ') + convertcode(mds[m].substring(5)) + '</div>';
else
html += '<h4 class="md-h4">' + convertcode(mds[m].substring(4)) + '</h4>';
} else if (mds[m].substring(0, 3) == '###') {
if (mds[m].substring(3, 4) == '1')
oladd(2, titnum);
if (mds[m].substring(3, 4) == '.')
html += '<h3 class="md-h3">' + olnum(2, titnum, '、') + convertcode(mds[m].substring(4)) + '</h3>';
else if (mds[m].substring(3, 4) == ':')
html += '<div class="md-content">' + olnum(2, titnum, ' ') + convertcode(mds[m].substring(4)) + '</div>';
else
html += '<h3 class="md-h3">' + convertcode(mds[m].substring(3)) + '</h3>';
} else if (mds[m].substring(0, 2) == '##') {
if (mds[m].substring(2, 3) == '1')
oladd(1, titnum);
if (mds[m].substring(2, 3) == '.')
html += '<h2 class="md-h2">' + olnum(1, titnum, '、') + convertcode(mds[m].substring(3)) + '</h2>';
else if (mds[m].substring(2, 3) == ':')
html += '<div class="md-content">' + olnum(1, titnum, ' ') + convertcode(mds[m].substring(3)) + '</div>';
else
html += '<h2 class="md-h2">' + convertcode(mds[m].substring(2)) + '</h2>';
} else if (cr == 'c')
html += '<h1 class="md-h1" style="text-align:center;">' + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == 'r')
html += '<h1 class="md-h1" style="text-align:right;">' + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == '1')
html += '<h1 class="md-h1">' + olnum(0, titnum, '、') + convertcode(mds[m].substring(2)) + '</h1>';
else
html += '<h1 class="md-h1">' + convertcode(mds[m].substr(1)) + '</h1>';
} else {
oladd(0, titnum);
if (cr == 'c')
html += '<h1 class="md-h1" style="text-align:center;">' + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == 'r')
html += '<h1 class="md-h1" style="text-align:right;">' + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == '.')
html += '<h1 class="md-h1">' + olnum(0, titnum, '、') + convertcode(mds[m].substring(2)) + '</h1>';
else if (cr == ':')
html += '<div class="md-content">' + olnum(0, titnum, ' ') + convertcode(mds[m].substring(2)) + '</div>';
else
html += '<h1 class="md-h1">' + convertcode(mds[m].substr(1)) + '</h1>';
}
} else if (mds[m][0] == '@') {//c居中r靠右
if (ispvs == 2)
html += '</table>';
@ -76,7 +93,7 @@ ciyfn.markdown = function (markdown) {
html += '<div class="md-content" style="text-align:center;">' + convertcode(mds[m].substring(2)) + '</div>';
else if (cr == 'r')
html += '<div class="md-content" style="text-align:right;margin-right:1em;">' + convertcode(mds[m].substring(2)) + '</div>';
else if (cr == '1') {
else if (cr == '.') {
if (!isol) {
isol = true;
html += '<ol>';
@ -155,11 +172,12 @@ ciyfn.markdown = function (markdown) {
html += '</ol>';
}
return html;
function olnum(idx, olnum, end) {
console.log(idx, olnum, end);
function oladd(idx, olnum) {
olnum[idx]++;
for (var i = idx + 1; i < olnum.length; i++)
olnum[i] = 0;
}
function olnum(idx, olnum, end) {
for (var i = 0; i <= idx; i++) {
if (olnum[i] == 0)
continue;
@ -754,7 +772,7 @@ ciycmpfunc.ciymap = function (opn) {
opn.initevent = opn.initevent || opn.dom.hasattr('initevent');
opn.bet = toint(opn.bet || opn.dom.attr('bet') || 10000000);
opn.mapkey = opn.mapkey || opn.dom.hasattr('mapkey');
if(opn.bet < 1)
if (opn.bet < 1)
opn.bet = 1;
var html = '';
html += '<input type="hidden" name="' + (opn.name == 'loc' ? 'lat' : opn.name + '_lat') + '"/>';
@ -767,7 +785,7 @@ ciycmpfunc.ciymap = function (opn) {
var showbtndom = opn.dom.children(2);
var showspandom = opn.dom.children(3);
function caldectoint(dec) {
if(opn.bet <= 1)
if (opn.bet <= 1)
return dec;
return toint(dec * opn.bet);
}
@ -1074,7 +1092,7 @@ ciycmpfunc.ciymarkdown = function (opn) {
</div>
<div class="col-12" style="padding-left: 4px;max-width:${opn.width};">
<div class="lang mdedit_retit">预览区</div>
<div class="mdedit_review" style="background:${opn.reviewbg};"></div>
<div class="mdedit_review" style="padding:0 0.5em;background:${opn.reviewbg};"></div>
</div>
</div>
<div style="padding-left: 0.5em;">

View File

@ -2201,7 +2201,6 @@ textarea.tran:focus, select.tran:focus, input.tran:focus {
}
.md-content {
font-size: 1.1em;
text-indent: 1em;
padding: 0.3em 0;
line-height: 2em;

View File

@ -13,7 +13,6 @@ class pdo {
function __construct($conn, $pf = null) {
$this->isconnected = false;
$this->error = '';
$this->conn = $conn;
$this->pf = $pf;
$this->conn = $conn;
}

View File

@ -1,5 +1,5 @@
<?php
//过时
namespace ciy;
class wxfunc {