Init project

This commit is contained in:
lifizer
2023-09-20 21:49:33 +08:00
parent 85a5989c96
commit c9ceac9f37
710 changed files with 125705 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
export default {
data() {
return {
disabled: false,
text: "获取验证码"
};
},
methods: {
sendCode() {
if (this.disabled) return;
this.disabled = true;
let n = 60;
this.text = "剩余 " + n + "s";
const run = setInterval(() => {
n = n - 1;
if (n < 0) {
clearInterval(run);
}
this.text = "剩余 " + n + "s";
if (this.text < "剩余 " + 0 + "s") {
this.disabled = false;
this.text = "重新获取";
}
}, 1000);
}
}
};
+46
View File
@@ -0,0 +1,46 @@
//封装下拉刷新混入对象
export default ({ getPageData}) => {
return {
data() {
return {
mescroll: null, //mescroll实例对象
};
},
//注册滚动到底部的事件,用于上拉加载
onReachBottom() {
this.mescroll && this.mescroll.onReachBottom();
},
//注册列表滚动事件,用于下拉刷新
onPageScroll(e) {
this.mescroll && this.mescroll.onPageScroll(e);
},
methods: {
// mescroll组件初始化的回调,可获取到mescroll对象
mescrollInit(mescroll) {
this.mescroll = mescroll;
this.mescrollInitByRef(); // 兼容字节跳动小程序
},
// 以ref的方式初始化mescroll对象 (兼容字节跳动小程序: http://www.mescroll.com/qa.html?v=20200107#q26)
mescrollInitByRef() {
if(!this.mescroll || !this.mescroll.resetUpScroll){
let mescrollRef = this.$refs.mescrollRef;
if(mescrollRef) this.mescroll = mescrollRef.mescroll
}
},
/*下拉刷新的回调, 有三种处理方式: */
downCallback(mescroll){
// 第2种: 下拉刷新和上拉加载调同样的接口, 那以上请求可删, 直接用mescroll.resetUpScroll()代替
mescroll.resetUpScroll(); // 重置列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
},
/*上拉加载的回调*/
upCallback(mescroll) {
getPageData.call(this,mescroll)
}
},
mounted() {
this.mescrollInitByRef(); // 兼容字节跳动小程序, 避免未设置@init或@init此时未能取到ref的情况
}
};
};
+34
View File
@@ -0,0 +1,34 @@
export default{
data(){
return {
//设置默认的分享参数
share:{
title:'云南香道滇官方商城',
path:'/pages/Loading/index',
imageUrl:'http://admin-api.xdd618.com/file/pic/20210617211221217375.jpg',
desc:'',
content:''
}
}
},
onShareAppMessage(res) {
return {
title:this.share.title,
path:this.share.path,
imageUrl:this.share.imageUrl,
desc:this.share.desc,
content:this.share.content,
success(res){
uni.showToast({
title:'分享成功'
})
},
fail(res){
uni.showToast({
title:'分享失败',
icon:'none'
})
}
}
}
}