|
@@ -9,7 +9,7 @@ Page({
|
|
|
data: {
|
|
|
"content": {
|
|
|
"title": "",
|
|
|
- "sat_sharematerial_classid": 9999 + wx.getStorageSync('userMsg').userid,
|
|
|
+ "sat_sharematerial_classid": '9999' + wx.getStorageSync('userMsg').userid,
|
|
|
"notes": "",
|
|
|
"tag": [],
|
|
|
"type": 1, //1图片2视频3图文
|
|
@@ -63,7 +63,7 @@ Page({
|
|
|
},
|
|
|
submit() {
|
|
|
let content = this.data.content;
|
|
|
- if (content.title == '' || content.sat_sharematerial_classid == 9999) return wx.showToast({
|
|
|
+ if (content.title == '' || content.sat_sharematerial_classid == '9999' + wx.getStorageSync('userMsg').userid) return wx.showToast({
|
|
|
title: '请检查素材标题或所属分类',
|
|
|
icon: "none"
|
|
|
});
|
|
@@ -89,49 +89,31 @@ Page({
|
|
|
"method": "insertOrUpdate",
|
|
|
content: content
|
|
|
}).then(res => {
|
|
|
- if (res.msg != '成功') {
|
|
|
- wx.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
+ this.setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
this.setData({
|
|
|
detailsData: res.data
|
|
|
})
|
|
|
- _Http.basic({
|
|
|
- "classname": "webmanage.saletool.sharematerial.sharematerial",
|
|
|
- "method": "audit",
|
|
|
- "content": {
|
|
|
- "sat_sharematerialid": res.data.sat_sharematerialid,
|
|
|
- "type": 1
|
|
|
- }
|
|
|
- }).then(s => {
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: "保存失败,请重新尝试",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- wx.showToast({
|
|
|
- title: "保存成功",
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- "detailsData.status": "审核"
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- let pages = getCurrentPages();
|
|
|
- let prevPage = pages[pages.length - 2];
|
|
|
- prevPage.getList(true);
|
|
|
- wx.navigateBack({
|
|
|
- delta: 0,
|
|
|
- })
|
|
|
- }, 300)
|
|
|
+
|
|
|
+ wx.showToast({
|
|
|
+ title: "保存成功",
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ "detailsData.status": "审核"
|
|
|
})
|
|
|
+ setTimeout(() => {
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[pages.length - 2];
|
|
|
+ prevPage.getList(true);
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 0,
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
})
|
|
|
},
|
|
|
openSelect() {
|
|
@@ -273,7 +255,8 @@ Page({
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
onUnload() {
|
|
|
- if (this.data.detailsData.status != '新建') return;
|
|
|
+ console.log(this.data.detailsData.sat_sharematerial_classid)
|
|
|
+ if (this.data.detailsData.sat_sharematerial_classid != '9999' + wx.getStorageSync('userMsg').userid) return;
|
|
|
_Http.basic({
|
|
|
"classname": "webmanage.saletool.sharematerial.sharematerial",
|
|
|
"method": "delete",
|