update
This commit is contained in:
parent
ddcdb963a9
commit
47678edb02
|
|
@ -54,7 +54,7 @@
|
||||||
app.globalData.errdata = [];
|
app.globalData.errdata = [];
|
||||||
|
|
||||||
app.globalData.srv = 't';
|
app.globalData.srv = 't';
|
||||||
app.globalData.jsnajax = 'z/?func=amb/';
|
app.globalData.jsnajax = 'z/?func=ambap/';
|
||||||
app.globalData.jsnurl = {};
|
app.globalData.jsnurl = {};
|
||||||
app.globalData.jsnurl.t = 'https://ciyon.ciy.cn/';
|
app.globalData.jsnurl.t = 'https://ciyon.ciy.cn/';
|
||||||
app.globalData.demourl = 'https://i.qiboc.cn/app.goc'; //原型图地址
|
app.globalData.demourl = 'https://i.qiboc.cn/app.goc'; //原型图地址
|
||||||
|
|
|
||||||
|
|
@ -1,451 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="_vphoto" :class="{left}">
|
|
||||||
qrcode,上面扫码,和上一次相同,忽略,不同event
|
|
||||||
<input type="hidden" :maxlength="-1" :name="name" :value="tvalue.value" style="display:none;" />
|
|
||||||
<view class="_btn" @tap="photo_select" v-if="tvalue.imgs.length < num">
|
|
||||||
<view class="_icon _photo"></view>
|
|
||||||
</view>
|
|
||||||
<view class="_pimg" v-for="(item,index) in tvalue.imgs" :key="index" :style="{'width':showwh}">
|
|
||||||
<view class="_del" :data-idx="index" @tap="photo_delone"></view>
|
|
||||||
<image v-if="isimg(item)" :src="file_stor(item, '?50')" @tap="preview(index)" mode="widthFix"></image>
|
|
||||||
<view class="_video" v-else-if="isvideo(item)">AV</view>
|
|
||||||
<view class="_file" v-else>{{file_ext(item)}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="_tip">{{tip}}</view>
|
|
||||||
<canvas type="2d" id="canvas" :style="{'width':cvwidth+'px','height':cvheight+'px','top':-cvheight+'px'}" style="position:fixed;z-index:-999;left:100vw;"></canvas>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
behaviors: ['uni://form-field-group'],
|
|
||||||
emits: ['change', 'update:modelValue'],
|
|
||||||
props: {
|
|
||||||
name: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
modelValue: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
initevent: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
left: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
action: { //设置 work.t work httpxxx
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
sourcetype: {
|
|
||||||
type: String,
|
|
||||||
default: 'camera,album,message'
|
|
||||||
},
|
|
||||||
filetype: {
|
|
||||||
type: String,
|
|
||||||
default: 'image' //all image video
|
|
||||||
},
|
|
||||||
ext: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
num: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
stor: {
|
|
||||||
type: String,
|
|
||||||
default: '/'
|
|
||||||
},
|
|
||||||
imgwidth: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
imgheight: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
maxkb: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
zipjpg: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
waterfont: {
|
|
||||||
type: String,
|
|
||||||
default: '28px Arial'
|
|
||||||
},
|
|
||||||
watertext: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
showwh: {
|
|
||||||
type: String,
|
|
||||||
default: '4em'
|
|
||||||
},
|
|
||||||
path: {
|
|
||||||
type: String,
|
|
||||||
default: 'nopath'
|
|
||||||
},
|
|
||||||
saas: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tip: '',
|
|
||||||
updatevalue: false,
|
|
||||||
val: '',
|
|
||||||
cvwidth: 0,
|
|
||||||
cvheight: 0
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
value: {
|
|
||||||
async handler(newD, oldD) {
|
|
||||||
this.val = newD;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
modelValue: {
|
|
||||||
async handler(newD, oldD) {
|
|
||||||
if (this.updatevalue) {
|
|
||||||
this.updatevalue = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.val = newD;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
tvalue() {
|
|
||||||
var v = this.val;
|
|
||||||
var ret = {};
|
|
||||||
ret.value = v;
|
|
||||||
var pimgs = v.split('~');
|
|
||||||
ret.imgs = [];
|
|
||||||
for (var i in pimgs) {
|
|
||||||
if (!pimgs[i])
|
|
||||||
continue;
|
|
||||||
ret.imgs.push(pimgs[i]);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.initevent) {
|
|
||||||
this.$emit('change', {
|
|
||||||
name: this.name,
|
|
||||||
from: 'init',
|
|
||||||
value: this.tvalue.value
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
preview(idx) {
|
|
||||||
var imgs = [...this.tvalue.imgs];
|
|
||||||
for (var i in imgs) {
|
|
||||||
imgs[i] = this.file_stor(imgs[i]);
|
|
||||||
}
|
|
||||||
uni.previewImage({
|
|
||||||
current: idx,
|
|
||||||
indicator: 'default',
|
|
||||||
urls: imgs
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async photo_select(b) {
|
|
||||||
if (this.tip)
|
|
||||||
return this.toast(this.lang('upload.uploadingmsg'));
|
|
||||||
|
|
||||||
var items = [];
|
|
||||||
var sourcetypes = this.sourcetype.split(',');
|
|
||||||
if (sourcetypes.includes('camera')) {
|
|
||||||
items.push({
|
|
||||||
url: 'camera',
|
|
||||||
name: this.lang('upload.menu_camera')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (sourcetypes.includes('album')) {
|
|
||||||
items.push({
|
|
||||||
url: 'album',
|
|
||||||
name: this.lang('upload.menu_album')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (sourcetypes.includes('message')) {
|
|
||||||
items.push({
|
|
||||||
url: 'message',
|
|
||||||
name: this.lang('upload.menu_message')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var item = await this.popmenu({
|
|
||||||
items,
|
|
||||||
one: true
|
|
||||||
});
|
|
||||||
if (item.url == 'camera')
|
|
||||||
this.vcamera();
|
|
||||||
if (item.url == 'album')
|
|
||||||
this.valbum();
|
|
||||||
if (item.url == 'message')
|
|
||||||
this.vmessage();
|
|
||||||
},
|
|
||||||
photo_delone(b) {
|
|
||||||
if (this.tip)
|
|
||||||
return this.toast(this.lang('upload.uploading'));
|
|
||||||
var imgs = [...this.tvalue.imgs];
|
|
||||||
imgs.splice(b.currentTarget.dataset.idx, 1);
|
|
||||||
this.val = imgs.join('~');
|
|
||||||
this.updatevalue = true;
|
|
||||||
this.$emit('update:modelValue', this.val);
|
|
||||||
this.$emit('change', {
|
|
||||||
name: this.name,
|
|
||||||
from: 'del',
|
|
||||||
value: this.val
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addfile(url, from) {
|
|
||||||
var imgs = [url, ...this.tvalue.imgs];
|
|
||||||
this.val = imgs.join('~');
|
|
||||||
if (!from)
|
|
||||||
return;
|
|
||||||
this.updatevalue = true;
|
|
||||||
this.$emit('update:modelValue', this.val);
|
|
||||||
this.$emit('change', {
|
|
||||||
name: this.name,
|
|
||||||
from: from,
|
|
||||||
value: this.val
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async vcamera(b) {
|
|
||||||
if (!uni.chooseMedia) {
|
|
||||||
return this.vh5();
|
|
||||||
}
|
|
||||||
var count = this.toint(this.num) - this.tvalue.imgs.length;
|
|
||||||
if (count <= 0)
|
|
||||||
return this.toast(this.lang('upload.maxmsg').replace('{n}', this.num));
|
|
||||||
var opt = {};
|
|
||||||
opt.count = 1;
|
|
||||||
if (this.filetype == 'all') {
|
|
||||||
opt.mediaType = ['mix'];
|
|
||||||
}
|
|
||||||
if (this.filetype == 'image') {
|
|
||||||
opt.mediaType = ['image'];
|
|
||||||
}
|
|
||||||
if (this.filetype == 'video') {
|
|
||||||
opt.mediaType = ['video'];
|
|
||||||
}
|
|
||||||
opt.sizeType = ['original', 'compressed'];
|
|
||||||
opt.sourceType = ['camera'];
|
|
||||||
opt.maxDuration = 60;
|
|
||||||
var [err, retchoose] = await this.go(uni.chooseMedia(opt));
|
|
||||||
if (err)
|
|
||||||
return console.warn('chooseMedia', err);
|
|
||||||
this.upfiles(retchoose.tempFiles, 'camera');
|
|
||||||
},
|
|
||||||
async valbum(b) {
|
|
||||||
if (!uni.chooseMedia) {
|
|
||||||
return this.vh5();
|
|
||||||
}
|
|
||||||
var count = this.toint(this.num) - this.tvalue.imgs.length;
|
|
||||||
if (count <= 0)
|
|
||||||
return this.toast(this.lang('upload.maxmsg').replace('{n}', this.num));
|
|
||||||
var opt = {};
|
|
||||||
opt.count = count;
|
|
||||||
if (this.filetype == 'all') {
|
|
||||||
opt.mediaType = ['mix'];
|
|
||||||
}
|
|
||||||
if (this.filetype == 'image') {
|
|
||||||
opt.mediaType = ['image'];
|
|
||||||
}
|
|
||||||
if (this.filetype == 'video') {
|
|
||||||
opt.mediaType = ['video'];
|
|
||||||
}
|
|
||||||
opt.sizeType = ['original', 'compressed'];
|
|
||||||
opt.sourceType = ['album'];
|
|
||||||
var [err, retchoose] = await this.go(uni.chooseMedia(opt));
|
|
||||||
if (err)
|
|
||||||
return console.warn('chooseMedia', err);
|
|
||||||
this.upfiles(retchoose.tempFiles, 'album');
|
|
||||||
},
|
|
||||||
async vmessage(b) {
|
|
||||||
if (!uni.chooseMessageFile) {
|
|
||||||
return this.vh5();
|
|
||||||
}
|
|
||||||
var count = this.toint(this.num) - this.tvalue.imgs.length;
|
|
||||||
if (count <= 0)
|
|
||||||
return this.toast(this.lang('upload.maxmsg').replace('{n}', this.num));
|
|
||||||
var opt = {};
|
|
||||||
opt.count = count;
|
|
||||||
if (this.filetype == 'all') {
|
|
||||||
if (this.ext) {
|
|
||||||
opt.type = 'file';
|
|
||||||
opt.extension = this.ext.split(',');
|
|
||||||
} else {
|
|
||||||
opt.type = 'all';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.filetype == 'image') {
|
|
||||||
opt.type = 'image';
|
|
||||||
}
|
|
||||||
if (this.filetype == 'video') {
|
|
||||||
opt.type = 'video';
|
|
||||||
}
|
|
||||||
var [err, retchoose] = await this.go(uni.chooseMessageFile(opt));
|
|
||||||
if (err)
|
|
||||||
return console.warn('chooseMessageFile', err);
|
|
||||||
this.upfiles(retchoose.tempFiles, 'message');
|
|
||||||
},
|
|
||||||
async vh5(b) {
|
|
||||||
var count = this.toint(this.num) - this.tvalue.imgs.length;
|
|
||||||
if (count <= 0)
|
|
||||||
return this.toast(this.lang('upload.maxmsg').replace('{n}', this.num));
|
|
||||||
var opt = {};
|
|
||||||
opt.count = count;
|
|
||||||
opt.sizeType = ['original', 'compressed'];
|
|
||||||
opt.sourceType = ['camera', 'album'];
|
|
||||||
var [err, retchoose] = await this.go(uni.chooseImage(opt));
|
|
||||||
if (err)
|
|
||||||
return console.warn('chooseImage', err);
|
|
||||||
await this.upfiles(retchoose.tempFiles, 'h5');
|
|
||||||
},
|
|
||||||
async upfiles(temps, from) {
|
|
||||||
var thos = this;
|
|
||||||
var app = getApp();
|
|
||||||
this.upcount = temps.length;
|
|
||||||
this.tip = this.lang('upload.tip') + ' 0/' + this.upcount;
|
|
||||||
this.upidx = 0;
|
|
||||||
var now = new Date();
|
|
||||||
var path = now.getFullYear() + '/' + ('0' + (now.getMonth() + 1)).slice(-2) + ('0' + now.getDate()).slice(-2) + '/' + this.path;
|
|
||||||
if (this.saas) {
|
|
||||||
var saasid = this.toint(this.saas.substring(1));
|
|
||||||
path = this.saas.substring(0, 1) + this.toint(saasid / 1000) + '/' + saasid + '/' + path;
|
|
||||||
}
|
|
||||||
var opn = {};
|
|
||||||
opn.canvasid = 'canvas';
|
|
||||||
opn.post = {
|
|
||||||
from: from
|
|
||||||
};
|
|
||||||
opn.path = path;
|
|
||||||
opn.stor = this.stor;
|
|
||||||
opn.action = this.action;
|
|
||||||
if (opn.action.substring(0, 4) != 'http') {
|
|
||||||
var uus = opn.action.split('.');
|
|
||||||
if (uus.length == 1)
|
|
||||||
uus[1] = this.srv;
|
|
||||||
opn.action = app.globalData.jsnurl[uus[1]] + 'z/?func=' + uus[0] + '/upload.';
|
|
||||||
}
|
|
||||||
opn.maxkb = this.toint(this.maxkb);
|
|
||||||
opn.imgwidth = this.toint(this.imgwidth);
|
|
||||||
opn.imgheight = this.toint(this.imgheight);
|
|
||||||
opn.zipjpg = this.tofloat(this.zipjpg);
|
|
||||||
opn.watertext = this.watertext;
|
|
||||||
await this.file_uploads(temps, opn, {
|
|
||||||
success(url, file) {
|
|
||||||
thos.upidx++;
|
|
||||||
thos.tip = thos.lang('upload.tip') + ' ' + thos.upidx + '/' + thos.upcount;
|
|
||||||
if (thos.upidx == thos.upcount) {
|
|
||||||
thos.tip = '';
|
|
||||||
thos.addfile(url, from);
|
|
||||||
} else {
|
|
||||||
thos.addfile(url);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail(err, gf, al) {
|
|
||||||
console.warn(err, gf, al);
|
|
||||||
thos.upidx++;
|
|
||||||
thos.tip = '';
|
|
||||||
return thos.alert('Upload Fail:' + err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
._vphoto ._photo {
|
|
||||||
background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zycgd2lkdGg9JzIwMCcgaGVpZ2h0PScyMDAnPjxwYXRoIGQ9J00xMjUuOTUyIDIzNC40OTZoMTY2LjkxMmMyMS41MDQgMCAyOS42OTYtNDguMTI4IDU0LjI3Mi03MS42OCA3LjE2OC03LjE2OCAyOC42NzItMTIuMjg4IDM2Ljg2NC0xMi4yODhoMjc4LjUyOGM4LjE5MiAwIDI5LjY5NiAxMS4yNjQgMzYuODY0IDI1LjYgMTMuMzEyIDI0LjU3NiAxMi4yODggNTguMzY4IDI1LjYgNTguMzY4aDE4MS4yNDhjNDYuMDggMCA4My45NjggMzcuODg4IDgzLjk2OCA4My45Njh2NDc0LjExMmMwIDQ2LjA4LTM3Ljg4OCA4My45NjgtODMuOTY4IDgzLjk2OEgxMjUuOTUyYy00Ni4wOCAwLTgzLjk2OC0zNy44ODgtODMuOTY4LTgzLjk2OFYzMTcuNDRjMS4wMjQtNDYuMDggMzcuODg4LTgyLjk0NCA4My45NjgtODIuOTQ0eicgZmlsbD0nIzNFQkRGRic+PC9wYXRoPjxwYXRoIGQ9J002MzQuODggMjc1LjQ1NmgxNC4zMzZjMTEuMjY0IDAgMjAuNDggOS4yMTYgMjAuNDggMjAuNDhzLTkuMjE2IDIwLjQ4LTIwLjQ4IDIwLjQ4SDYzNC44OGMtMTEuMjY0IDAtMjAuNDgtOS4yMTYtMjAuNDgtMjAuNDggMC0xMC4yNCA5LjIxNi0yMC40OCAyMC40OC0yMC40OHpNNzMyLjE2IDI3NS40NTZoMTY2LjkxMmMxMS4yNjQgMCAyMC40OCA5LjIxNiAyMC40OCAyMC40OHMtOS4yMTYgMjAuNDgtMjAuNDggMjAuNDhINzMyLjE2Yy0xMS4yNjQgMC0yMC40OC05LjIxNi0yMC40OC0yMC40OCAwLTEwLjI0IDkuMjE2LTIwLjQ4IDIwLjQ4LTIwLjQ4eicgZmlsbD0nI0ZGRkZGRic+PC9wYXRoPjxwYXRoIGQ9J001MzAuNDMyIDM1OS40MjRjMTIyLjg4IDAgMjIzLjIzMiA5OS4zMjggMjIzLjIzMiAyMjMuMjMyIDAgMTIyLjg4LTk5LjMyOCAyMjMuMjMyLTIyMy4yMzIgMjIzLjIzMi0xMjIuODggMC0yMjMuMjMyLTk5LjMyOC0yMjMuMjMyLTIyMy4yMzIgMC0xMjIuODggMTAwLjM1Mi0yMjMuMjMyIDIyMy4yMzItMjIzLjIzMnonIGZpbGw9JyNBMkRFRkQnPjwvcGF0aD48L3N2Zz4=");
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto {
|
|
||||||
margin: 0.5em auto 0 auto;
|
|
||||||
padding: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto.left {
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._tip {
|
|
||||||
position: absolute;
|
|
||||||
top: 0.1em;
|
|
||||||
left: 0.2em;
|
|
||||||
line-height: 1em;
|
|
||||||
font-size: 0.7em;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto>._btn {
|
|
||||||
padding: 0.5em;
|
|
||||||
width: 3em;
|
|
||||||
height: 3em;
|
|
||||||
margin: 0 0.5em 0.5em 0;
|
|
||||||
border: 1px solid #cccccc;
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 0.3em;
|
|
||||||
background: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._icon {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._pimg {
|
|
||||||
margin: 0 0.5em 0.5em 0;
|
|
||||||
background: #ffffff;
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid #ffffff;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._pimg ._video,
|
|
||||||
._vphoto ._pimg ._file {
|
|
||||||
margin: 1.2em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._pimg image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
._vphoto ._pimg ._del {
|
|
||||||
background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PHBhdGggZD0nTTUxMiAzMC4xMTc2NDdhNDgxLjg4MjM1MyA0ODEuODgyMzUzIDAgMSAwIDQ4MS44ODIzNTMgNDgxLjg4MjM1MyA0ODEuODgyMzUzIDQ4MS44ODIzNTMgMCAwIDAtNDgxLjg4MjM1My00ODEuODgyMzUzeicgZmlsbD0nI0ZENDgzNyc+PC9wYXRoPjxwYXRoIGQ9J003MDUuMTc0NTg4IDY1Ny43MDkxNzZhMzMuOTcyNzA2IDMzLjk3MjcwNiAwIDEgMS00OC4xODgyMzUgNDcuODI2ODI0TDUxMiA1NjAuMDA3NTI5bC0xNDUuMjI3Mjk0IDE0NS44ODk4ODNhMzMuOTcyNzA2IDMzLjk3MjcwNiAwIDEgMS00OC4xODgyMzUtNDcuODI2ODI0bDE0NS40MDgtMTQ1Ljc2OTQxMkwzMTguNzY1MTc2IDM2Ni4yMzA1ODhhMzMuOTcyNzA2IDMzLjk3MjcwNiAwIDAgMSA0OC4xODgyMzYtNDcuODI2ODIzTDUxMiA0NjMuOTkyNDcxbDE0NS4yMjcyOTQtMTQ1LjcwOTE3N2EzMy45NzI3MDYgMzMuOTcyNzA2IDAgMSAxIDQ4LjE4ODIzNSA0Ny44MjY4MjRMNTU5Ljc2NjU4OCA1MTJ6JyBmaWxsPScjRkZGRkZGJz48L3BhdGg+PC9zdmc+");
|
|
||||||
width: 1.2em;
|
|
||||||
height: 1.2em;
|
|
||||||
position: absolute;
|
|
||||||
top: -0.3em;
|
|
||||||
right: -0.3em;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
action: { //设置 work.t work httpxxx
|
action: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,79 +12,79 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>v-model绑定</label>
|
<label>v-model绑定</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload v-model="formvalue" path="demo" num="5" name="ciy1" action="amb" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload v-model="formvalue" path="demo" num="5" name="ciy1" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>value绑定</label>
|
<label>value绑定</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload left :value="formvalue" path="demo" name="ciy2" action="amb" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload left :value="formvalue" path="demo" name="ciy2" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>只能拍照</label>
|
<label>只能拍照</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy3" path="demo" action="amb" num="9" imgwidth="1000" sourcetype="camera" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy3" path="demo" num="9" imgwidth="1000" sourcetype="camera" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>上传文档</label>
|
<label>上传文档</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy4" path="demo" action="amb" num="20" filetype="all" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy4" path="demo" num="20" filetype="all" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>方形头像</label>
|
<label>方形头像</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy5" path="demo" action="amb" showwh="100%" imgwidth="1000" imgheight="1000" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy5" path="demo" showwh="100%" imgwidth="1000" imgheight="1000" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>限制大小</label>
|
<label>限制大小</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy6" path="demo" action="amb" maxkb="200" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy6" path="demo" maxkb="200" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>图像压缩</label>
|
<label>图像压缩</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy7" path="demo" action="amb" zipjpg="0.6" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy7" path="demo" zipjpg="0.6" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>右下文字</label>
|
<label>右下文字</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy8" path="demo" action="amb" zipjpg="0.6" watertext="水电费|第二行" waterfont="36px Arial" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy8" path="demo" zipjpg="0.6" watertext="水电费|第二行" waterfont="36px Arial" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>满屏水印</label>
|
<label>满屏水印</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy9" path="demo" action="amb" zipjpg="0.6" watertext="众产(杭州)科技有限公司" waterfont="36px Arial" watertype="full" waterpadding="10" waterangle="20" wateralpha="0.8" watercolors="#ff0000,#00ff00" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy9" path="demo" zipjpg="0.6" watertext="众产(杭州)科技有限公司" waterfont="36px Arial" watertype="full" waterpadding="10" waterangle="20" wateralpha="0.8" watercolors="#ff0000,#00ff00" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>上传到云</label>
|
<label>上传到云</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy10" path="demo" action="amb" stor="A" zipjpg="0.6" imgwidth="1000" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy10" path="demo" stor="A" zipjpg="0.6" imgwidth="1000" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>SaaS上传</label>
|
<label>SaaS上传</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload left name="ciy11" saas="s10224" path="demo" action="amb" stor="/" zipjpg="0.6" imgwidth="1000" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload left name="ciy11" saas="s10224" path="demo" stor="/" zipjpg="0.6" imgwidth="1000" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>固定比例拍照</label>
|
<label>固定比例拍照</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy12" path="demo" action="amb" cammaskpng="/img/maskcamera.png" camheight="70" imgwidth="1000" sourcetype="rehcam" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy12" path="demo" cammaskpng="/img/maskcamera.png" camheight="70" imgwidth="1000" sourcetype="rehcam" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>自定比例拍照</label>
|
<label>自定比例拍照</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload name="ciy13" path="demo" action="amb" imgwidth="1000" sourcetype="rehcam,album" @change="chglog('change', $event)"></ciy-upload>
|
<ciy-upload name="ciy13" path="demo" imgwidth="1000" sourcetype="rehcam,album" @change="chglog('change', $event)"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,13 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>文档</label>
|
<label>文档</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload num="5" filetype="all" imgwidth="1000" sourcetype="album,message" path="demo" action="amb" name="downurl" v-model="init.data.downurl"></ciy-upload>
|
<ciy-upload num="5" filetype="all" imgwidth="1000" sourcetype="album,message" path="demo" name="downurl" v-model="init.data.downurl"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>头像</label>
|
<label>头像</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload imgwidth="600" imgheight="600" path="demo" action="amb" name="avar" v-model="init.data.avar"></ciy-upload>
|
<ciy-upload imgwidth="600" imgheight="600" path="demo" name="avar" v-model="init.data.avar"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>活动花絮</label>
|
<label>活动花絮</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload num="9" imgwidth="1920" zipjpg="0.8" path="demo" action="amb" name="imgs" v-model="init.data.imgs"></ciy-upload>
|
<ciy-upload num="9" imgwidth="1920" zipjpg="0.8" path="demo" name="imgs" v-model="init.data.imgs"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>头像</label>
|
<label>头像</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload left v-model="me.icon" path="icon" action="amb" name="icon" imgwidth="400" imgheight="400" camheight="100" sourcetype="rehcam,album,message"></ciy-upload>
|
<ciy-upload left v-model="me.icon" path="icon" name="icon" imgwidth="400" imgheight="400" camheight="100" sourcetype="rehcam,album,message"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view>
|
<view>
|
||||||
|
|
@ -69,7 +69,6 @@
|
||||||
};
|
};
|
||||||
opn.path = 'icon';
|
opn.path = 'icon';
|
||||||
opn.stor = app.globalData.storselect;
|
opn.stor = app.globalData.storselect;
|
||||||
opn.action = 'amb';
|
|
||||||
opn.maxkb = 0;
|
opn.maxkb = 0;
|
||||||
opn.imgwidth = 400;
|
opn.imgwidth = 400;
|
||||||
opn.imgheight = 400;
|
opn.imgheight = 400;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>图片截图</label>
|
<label>图片截图</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload left num="8" path="problem" action="amb" name="imgs" imgwidth="1600" sourcetype="camera,album,message"></ciy-upload>
|
<ciy-upload left num="8" path="problem" name="imgs" imgwidth="1600" sourcetype="camera,album,message"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@
|
||||||
var opn = {};
|
var opn = {};
|
||||||
opn.basepath = 'idcard';
|
opn.basepath = 'idcard';
|
||||||
opn.stor = '/';
|
opn.stor = '/';
|
||||||
opn.action = 'amb';
|
|
||||||
e.detail.value.idcard1 = await this.file_upload1(this.idimg, opn);
|
e.detail.value.idcard1 = await this.file_upload1(this.idimg, opn);
|
||||||
}
|
}
|
||||||
var retjson = await this.callajax({
|
var retjson = await this.callajax({
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
<label>图片截图</label>
|
<label>图片截图</label>
|
||||||
<view>
|
<view>
|
||||||
<ciy-upload left num="8" path="suggest" action="amb" name="imgs" imgwidth="1600" sourcetype="camera,album,message"></ciy-upload>
|
<ciy-upload left num="8" path="suggest" name="imgs" imgwidth="1600" sourcetype="camera,album,message"></ciy-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ciy-form">
|
<view class="ciy-form">
|
||||||
|
|
|
||||||
|
|
@ -2183,11 +2183,15 @@ export default {
|
||||||
}
|
}
|
||||||
opn.path = path;
|
opn.path = path;
|
||||||
}
|
}
|
||||||
if (opn.action.substring(0, 4) != 'http') {
|
if (opn.action) {
|
||||||
var uus = opn.action.split('.');
|
if (opn.action.substring(0, 4) != 'http') {
|
||||||
if (uus.length == 1)
|
var uus = opn.action.split('.');
|
||||||
uus[1] = this.srv;
|
if (uus.length == 1)
|
||||||
opn.action = app.globalData.jsnurl[uus[1]] + 'z/?func=' + uus[0] + '/upload.';
|
uus[1] = this.srv;
|
||||||
|
opn.action = app.globalData.jsnurl[uus[1]] + 'z/?func=' + uus[0] + '/upload.';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
opn.action = app.globalData.jsnurl[app.globalData.srv] + app.globalData.jsnajax + 'upload.';
|
||||||
}
|
}
|
||||||
if (typeof(fn.fail) != 'function')
|
if (typeof(fn.fail) != 'function')
|
||||||
fn.fail = () => {};
|
fn.fail = () => {};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class aiapi {
|
class aiapi {
|
||||||
public static function json_rawai($param = null, $debug = false) {
|
public static function json_rawai($param = null, $debug = false) {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace web\amb\demo;
|
namespace web\ambap\demo;
|
||||||
|
|
||||||
class demo {
|
class demo {
|
||||||
static function setwhere($db, $post) {
|
static function setwhere($db, $post) {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class index {
|
class index {
|
||||||
public static function json_init() {
|
public static function json_init() {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class login {
|
class login {
|
||||||
public static function json_uperr() {
|
public static function json_uperr() {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class me {
|
class me {
|
||||||
public static function json_invoicetitle_get() {
|
public static function json_invoicetitle_get() {
|
||||||
|
|
@ -424,11 +424,11 @@ class me {
|
||||||
if (is_array($extrow))
|
if (is_array($extrow))
|
||||||
if ($db->update($csql, $updata) === false)
|
if ($db->update($csql, $updata) === false)
|
||||||
return errjson('更新失败:' . $db->error);
|
return errjson('更新失败:' . $db->error);
|
||||||
else {
|
else {
|
||||||
$updata['id'] = $rsuser['id'];
|
$updata['id'] = $rsuser['id'];
|
||||||
if ($db->insert($csql, $updata) === false)
|
if ($db->insert($csql, $updata) === false)
|
||||||
return errjson('新增失败:' . $db->error);
|
return errjson('新增失败:' . $db->error);
|
||||||
}
|
}
|
||||||
return succjson();
|
return succjson();
|
||||||
}
|
}
|
||||||
public static function json_cashout_get() {
|
public static function json_cashout_get() {
|
||||||
|
|
@ -479,11 +479,11 @@ class me {
|
||||||
return errjson('需填开票金额');
|
return errjson('需填开票金额');
|
||||||
if ($rsuser['myinvmoney'] < $money)
|
if ($rsuser['myinvmoney'] < $money)
|
||||||
return errjson('可开票金额不足');
|
return errjson('可开票金额不足');
|
||||||
$csql = new \ciy\sql('ap_usr_invoicetitle');
|
$csql = new \ciy\sql('ap_usr_invoicetitle');
|
||||||
$csql->where('id', $invtit);
|
$csql->where('id', $invtit);
|
||||||
$invoicerow = $db->getone($csql);
|
$invoicerow = $db->getone($csql);
|
||||||
if (!is_array($invoicerow))
|
if (!is_array($invoicerow))
|
||||||
return errjson('开票抬头不存在');
|
return errjson('开票抬头不存在');
|
||||||
try {
|
try {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$updata = array();
|
$updata = array();
|
||||||
|
|
@ -748,13 +748,13 @@ class me {
|
||||||
$csql = new \ciy\sql('ap_usr_ext');
|
$csql = new \ciy\sql('ap_usr_ext');
|
||||||
$csql->where('id', $rsuser['id']);
|
$csql->where('id', $rsuser['id']);
|
||||||
$extrow = $db->getone($csql);
|
$extrow = $db->getone($csql);
|
||||||
if (is_array($extrow))
|
if (is_array($extrow)) {
|
||||||
if ($db->update($csql, $updata) === false)
|
if ($db->update($csql, $updata) === false)
|
||||||
return errjson('更新失败:' . $db->error);
|
return errjson('ext更新失败:' . $db->error);
|
||||||
else {
|
} else {
|
||||||
$updata['id'] = $rsuser['id'];
|
$updata['id'] = $rsuser['id'];
|
||||||
if ($db->insert($csql, $updata) === false)
|
if ($db->insert($csql, $updata) === false)
|
||||||
return errjson('更新失败:' . $db->error);
|
return errjson('ext新增失败:' . $db->error);
|
||||||
}
|
}
|
||||||
return succjson();
|
return succjson();
|
||||||
}
|
}
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* Version: 0.1.2
|
* Version: 0.1.2
|
||||||
====================================================================================*/
|
====================================================================================*/
|
||||||
|
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class upload {
|
class upload {
|
||||||
public static function json_upload() {
|
public static function json_upload() {
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
//http://expo.local.ciy.cn/ajax/amb/wxpay.pay_pnt
|
//http://expo.local.ciy.cn/ajax/amb/wxpay.pay_pnt
|
||||||
//http://expo.local.ciy.cn/ajax/amb/wxpay.transfer
|
//http://expo.local.ciy.cn/ajax/amb/wxpay.transfer
|
||||||
namespace web\amb;
|
namespace web\ambap;
|
||||||
|
|
||||||
class wxpay_pnt {
|
class wxpay_pnt {
|
||||||
public static function json_transfer() {
|
public static function json_transfer() {
|
||||||
Loading…
Reference in New Issue
Block a user