弹出进度条
javascript
wx.showLoading({
title: '正在加载',
})
关闭提示
javascript
wx.hideLoading()
消息提示
javascript
wx.showToast({
title: '不能分享文件夹,请选择单个文件进行分享!',
})
弹出框
javascript
wx.showModal({
title: '提示',
content: '不能分享文件夹,请选择单个文件进行分享!',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
应用代码
javascript
share(record) {
console.log("record====", record)
if (record.type == 1) {
wx.showToast({
title: '不能分享文件夹,请选择单个文件进行分享!',
})
return false;
}
let data = {
"docId": record.id,
"fileId": record.fileId,
"code": getShareToken(12),
"userId": wx.getStorageSync('userId'),
"openShare":1,
"wantPassword":0,
"pwCode": getShareToken(6),
"openDays":0,
"days":1,
"openTimes":0,
"times": 1,
"canComment": 1
}
wx.showLoading({
title: '正在加载',
})
let url = config.apiUrl + "/business/lzShare/add";
util.httpPost(url, data).then((res) => {
wx.hideLoading()
this.setData({
showShare: true
})
})
},