var o = require("../../utils/requestApi.js"), e = require("../../utils/util.js"), n = getApp();
Page({
data: {
userInfo: {},
hasUserInfo: !1,
openid: "",
showMyContribute: !1
},
onLoad: function(o) {
var e = this;
n.globalData.userInfo ? e.setData({
userInfo: n.globalData.userInfo,
hasUserInfo: !0
}) : n.userInfoReadyCallback = function(o) {
console.log(o.userInfo), e.setData({
userInfo: o.userInfo,
hasUserInfo: !0
});
};
},
onReady: function() {},
onShow: function() {},
onHide: function() {},
onUnload: function() {},
onPullDownRefresh: function() {},
onReachBottom: function() {},
onShareAppMessage: function() {
return {
title: "土味情话合集",
path: "/pages/index/index",
imageUrl: "../../resource/img/xindong.jpg"
};
},
getUserInfo: function(o) {
var e = this;
console.log(o), n.globalData.userInfo = o.detail.userInfo, e.setData({
userInfo: o.detail.userInfo,
hasUserInfo: !0
});
},
bindFormSubmit: function(e) {
console.log(e);
var n = this;
wx.showLoading({
title: "提交中...",
mask: !0
}), n.getOpenid().then(function() {
e.detail.value.status = 0, e.detail.value.noticeStatus = 0, e.detail.value.formId = e.detail.formId;
var t = {
contribute: e.detail.value,
userInfo: n.data.userInfo,
openid: n.data.openid
};
console.log(t), o.addContribute(t).then(function(o) {
wx.hideLoading(), !0 === o.result ? wx.showModal({
title: "提交成功",
content: "后台已经收到您上传的内容了,收录成功后才会显示哦。",
cancelText: "返回首页",
cancelColor: "#4377e4",
confirmText: "提交记录",
confirmColor: "#4377e4",
success: function(o) {
o.cancel && wx.navigateBack(), o.confirm && n.showMyContribute();
}
}) : wx.showModal({
title: "提示",
content: o.msg,
showCancel: !1,
confirmText: "我知道了",
confirmColor: "#4377e4"
});
});
});
},
showMyContribute: function() {
var n = this;
wx.showLoading({
mask: !0
}), n.getOpenid().then(function() {
var t = {
openid: n.data.openid
};
o.getContributeByOpenid(t).then(function(o) {
if (wx.hideLoading(), !0 === o.result) {
for (var t in o.obj) o.obj[t].createdAt = e.formatTime(new Date(o.obj[t].createdAt));
n.setData({
contributeList: o.obj,
showMyContribute: !0
});
}
});
});
},
closeMyContribute: function() {
this.setData({
showMyContribute: !1
});
},
getOpenid: function() {
var e = this;
return new Promise(function(n) {
e.data.openid ? n() : wx.login({
success: function(t) {
t.code ? o.wxUserLogin({
code: t.code
}).then(function(o) {
!0 === o.result ? (e.setData({
openid: o.obj
}), n()) : console.log("登录失败" + o.msg);
}) : console.log("登录失败" + t.errMsg);
}
});
});
}
});
stbomei
- 粉丝: 44
- 资源: 1180
最新资源
- 基于CNN卷积神经网络的网络入侵检测python源码+全部数据(高分毕业设计)
- 2-菜单栏系统状态监视工具Stats v2.11.9,支持监测内存、硬盘、网络等状态
- 火焰烟雾检测测试视频,fire-detect-video
- SAM实验.........
- boost序列化x86和x64兼容
- 脉振方波高频注入代码+增强型滑膜esmo代码,永磁同步电机高频注入程序 资料为C代码一份,大厂代码,可运行,经典流传; 配套一篇代码对应的说明文档,详细算法说明; 脉振方波注入方法相对于脉振正弦信号注
- SQLite数据库浏览器可视化工具-v3.13.1-win32
- 2024年福建省村级(居委会)行政区划shp数据集
- 基于pytorch实现minist手写数字识别源码+数据集(高分项目).zip
- 数字图像处理系统的Python实现:集成功能模块及人脸识别
- 编程直接实现HTML网页燃放烟花效果的代码
- 基于机器学习CNN卷积神经网络的网络入侵检测python源码+文档说明+全部数据
- 基于深度学习的VVC帧内编码中快速QTMT编码单元划分方法
- 15款L1218L1258L1259L3218L3219L3251L3253L3255L3256L3258L3266L3267L3268L3269L5298清零软 图解
- comsol枝晶生长 模型包括:典型,形状成核,随机成核,均匀沉积,雪花晶形成过程 适用于电池,电化学沉积,催化的模拟学习
- 基于javaweb实现的SQL基于JSP的学生信息管理系统源码+数据库.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈