提交 cb8d2c4c 编写于 作者: DCloud_JSON's avatar DCloud_JSON

兼容vue3...待续未完成

上级 b3950100
...@@ -322,7 +322,6 @@ export default async function() { ...@@ -322,7 +322,6 @@ export default async function() {
url == '/pages/ucenter/login-page/index/index' && url == '/pages/ucenter/login-page/index/index' &&
!inLoginPage !inLoginPage
) { ) {
// console.log(9527777,login);
//一键登录(univerify)、账号(username)、验证码登录(短信smsCode) //一键登录(univerify)、账号(username)、验证码登录(短信smsCode)
if (login[0] == 'username') { if (login[0] == 'username') {
e.url = "/pages/ucenter/login-page/pwd-login/pwd-login" e.url = "/pages/ucenter/login-page/pwd-login/pwd-login"
...@@ -343,7 +342,7 @@ export default async function() { ...@@ -343,7 +342,7 @@ export default async function() {
} }
return url != item return url != item
}) })
// console.log(pass) console.log({pass})
} }
if (visitor&&!inLoginPage) { if (visitor&&!inLoginPage) {
pass = visitor.some((item) => { pass = visitor.some((item) => {
...@@ -352,7 +351,7 @@ export default async function() { ...@@ -352,7 +351,7 @@ export default async function() {
} }
return url == item return url == item
}) })
console.log(pass) console.log({pass})
} }
if (!pass && (token == '' || tokenExpired)) { if (!pass && (token == '' || tokenExpired)) {
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
} }
</script> </script>
<style> <style lang="scss" scoped>
@import '@/common/all-flex.css';
.root{ .root{
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
} }
break; break;
default: default:
console.log(9527, err); console.log(err);
break; break;
} }
} }
......
...@@ -117,7 +117,8 @@ ...@@ -117,7 +117,8 @@
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
@import '@/common/all-flex.css';
.short-code-btn { .short-code-btn {
width: 200rpx; width: 200rpx;
height: 85rpx; height: 85rpx;
......
...@@ -82,13 +82,8 @@ ...@@ -82,13 +82,8 @@
cdbRef = this.$refs.udb cdbRef = this.$refs.udb
}, },
async onShow() { async onShow() {
console.log(999,getApp().globalData.searchText);
this.keyword = getApp().globalData.searchText this.keyword = getApp().globalData.searchText
getApp().globalData.searchText = '' getApp().globalData.searchText = ''
//这里仅演示如何,在onShow生命周期获取设备位置,并在设备或者应用没有权限时自动引导。设置完毕自动重新获取。 //这里仅演示如何,在onShow生命周期获取设备位置,并在设备或者应用没有权限时自动引导。设置完毕自动重新获取。
//你可以基于他做自己的业务,比如:根据距离由近到远排序列表数据等 //你可以基于他做自己的业务,比如:根据距离由近到远排序列表数据等
// uni.showLoading({ // uni.showLoading({
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
}) })
}, },
setNickname(nickname) { setNickname(nickname) {
console.log(9527, nickname); console.log(nickname);
if (nickname) { if (nickname) {
usersTable.where('_id==$env.uid').update({ usersTable.where('_id==$env.uid').update({
nickname nickname
......
...@@ -97,6 +97,12 @@ export default { ...@@ -97,6 +97,12 @@ export default {
default() { default() {
return [] return []
} }
},
modelValue: {
type: [Array, Object],
default() {
return []
}
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
...@@ -174,34 +180,26 @@ export default { ...@@ -174,34 +180,26 @@ export default {
returnType: { returnType: {
type: String, type: String,
default: 'array' default: 'array'
},
sizeType:{
type: Array,
default(){
return ['original','compressed']
}
} }
}, },
watch: { watch: {
value: { value: {
handler(newVal) { handler(newVal) {
let newFils = [] this.setValue(newVal)
let newData = [].concat(newVal || [])
newData.forEach(v => {
const files = this.files.find(i => i.url === v.url)
const reg = /cloud:\/\/([\w.]+\/?)\S*/
if (!v.path) {
v.path = v.url
}
if (reg.test(v.url)) {
this.getTempFileURL(v, v.url)
}
newFils.push(files ? files : v)
})
let data = null
if (this.returnType === 'object') {
data = this.backObject(newFils)[0]
} else {
data = this.backObject(newFils)
}
this.formItem && this.formItem.setValue(data)
this.files = newFils
}, },
immediate: true immediate: true
},
modelValue:{
handler(newVal) {
this.setValue(newVal)
},
immediate: true
} }
}, },
data() { data() {
...@@ -261,7 +259,30 @@ export default { ...@@ -261,7 +259,30 @@ export default {
} }
} }
}, },
methods: { methods: {
setValue(newVal){
let newFils = []
let newData = [].concat(newVal || [])
newData.forEach(v => {
const files = this.files.find(i => i.url === v.url)
const reg = /cloud:\/\/([\w.]+\/?)\S*/
if (!v.path) {
v.path = v.url
}
if (reg.test(v.url)) {
this.getTempFileURL(v, v.url)
}
newFils.push(files ? files : v)
})
let data = null
if (this.returnType === 'object') {
data = this.backObject(newFils)[0]
} else {
data = this.backObject(newFils)
}
this.formItem && this.formItem.setValue(data)
this.files = newFils
},
/** /**
* 获取父元素实例 * 获取父元素实例
*/ */
...@@ -301,7 +322,7 @@ export default { ...@@ -301,7 +322,7 @@ export default {
* 选择文件 * 选择文件
*/ */
choose() { choose() {
if (this.disabled) return if (this.disabled) return
if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType === 'array') { if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType === 'array') {
uni.showToast({ uni.showToast({
...@@ -330,7 +351,8 @@ export default { ...@@ -330,7 +351,8 @@ export default {
uniCloud uniCloud
.chooseAndUploadFile({ .chooseAndUploadFile({
type: this.fileMediatype, type: this.fileMediatype,
compressed: false, compressed: false,
sizeType:this.sizeType,
// TODO 如果为空,video 有问题 // TODO 如果为空,video 有问题
extension: this.extname.length > 0 ? this.extname : undefined, extension: this.extname.length > 0 ? this.extname : undefined,
count: this.limitLength - this.files.length, //默认9 count: this.limitLength - this.files.length, //默认9
......
...@@ -16,10 +16,10 @@ export default async (param,callback) => { ...@@ -16,10 +16,10 @@ export default async (param,callback) => {
if (typeof(menus[e]['share']) == 'string') { if (typeof(menus[e]['share']) == 'string') {
eval(menus[e]['share']+'()') eval(menus[e]['share']+'()')
} else { } else {
console.log(9527,{ // console.log(123456,{
...param.content, // ...param.content,
...menus[e].share, // ...menus[e].share,
}); // });
uni.share({ uni.share({
...param.content, ...param.content,
...menus[e].share, ...menus[e].share,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册