登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
我知道了
查看详情
登录
注册
Gitee 接口下线公告:检查是否已Star和列出指定Star仓库用户等4个接口将在7月3日下线
代码拉取完成,页面将自动刷新
开源项目
>
微信开发
>
微信小程序/小游戏
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
19
Star
355
Fork
102
程序员阿鑫
/
微信报修小程序V4.1
代码
Issues
8
Pull Requests
0
Wiki
统计
流水线
服务
Gitee Pages
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
资讯详情
待办的
#I85GQ7
将军
创建于
2023-10-04 22:37
资讯详情 ``` // pages/schoolinfo/info_detail.js const app = getApp() const db = wx.cloud.database() // const util = require("../../utils/util"); Page({ /** * 页面的初始数据 */ data: { list: [], realName: "", cardCur:0, InputBottom: 0, userisRoot:true }, //获取角色权限 // userRoot:function(e){ // var localopenid = wx.getStorageSync("openid"); // db.collection('c_role').where({openid:localopenid,role:'超级管理员',using:true}).get().then(res=>{ // console.log(res) // if(res.data.length>0){ // this.setData({ // userisRoot:true // }) // } // }) // }, showModalView(e) { const { id, index } = e.currentTarget.dataset; // console.log(id, index) this.setData({ id: id, index: index, modalName: e.currentTarget.dataset.target }) // console.log(this.data.nowOrderData) }, getUserRole(openid) { var that = this; // console.log(openid); db.collection('c_role').where({openid:openid,role:'超级管理员',using:true}).get().then(res=>{ console.log(res) if(res.data.length>0){ wx.setStorageSync('admin',res.data); // that.userroot = true; this.setData({ userroot:true, isAdmin:true }) } }) }, /** * 个人中心权限标志 */ // userRoot:function(e){ // var localopenid = wx.getStorageSync("openid"); // db.collection('c_role').where({openid : localopenid}).get({ // success:res=>{ // let role = res.data[0].role; // if(role == "超级管理员"){ // this.setData({ // userroot:true // }) // } // } // }) // }, //获取id getOpenid() { wx.cloud.callFunction({ name: 'login' }).then(res => { this.setData({ openid: res.result.openid }) }).catch(err => { console.log(err); }) }, getData(){ let phone = wx.getStorageSync('phone'); let logo = wx.getStorageSync('logo'); let realName = wx.getStorageSync('realName'); this.setData({ phone: phone, logo: logo, realName: realName }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.getData(); this.getOpenid(); this.getUserRole(); let phone = wx.getStorageSync('phone'); let logo = wx.getStorageSync('logo'); let name = wx.getStorageSync('realName'); if(!phone && !logo ){ wx.showToast({ title: '登录态失效,请先登录', }) wx.switchTab({ url: '/pages/index/index', }) }else{ this.setData({ phone,logo,name, }) this.data.info_id = options.info_id this.getData(this.data.info_id) this.getDetail(this.data.info_id) this.getComment(this.data.info_id) this.addView(this.data.info_id) } }, addView(id){ wx.cloud.callFunction({ name:'getCampusInfo', data:{ action:'viewinfo', info_id: this.data.info_id } }).then(res=>{ }) }, cardSwiper(e) { this.setData({ cardCur: e.detail.current }) }, getDetail(id){ wx.showLoading({ title: '加载中', }) db.collection('s_info').doc(id).get().then(res=>{ console.log(res) wx.hideLoading() this.setData({ info:res.data }) }) }, InputFocus(e) { this.setData({ InputBottom: e.detail.height }) }, InputBlur(e) { this.setData({ InputBottom: 0 }) }, inputComment(e){ this.data.comment = e.detail.value }, postComment() { let neirong = this.data.comment if (!neirong) { wx.showToast({ icon: 'error', title: '请输入评论内容' }) } else { wx.showLoading({ title: '校验信息中', icon: 'none' }) wx.cloud.callFunction({ name: 'msgSC', data: { des: this.data.comment } }).then(res => { console.log("检查", res) if (res.result.code == "200") { wx.cloud.callFunction({ name: 'getCampusInfo', data: { action: 'addcomment', comment: this.data.comment, info_id: this.data.info_id, // nick_name: wx.getStorageSync('userInfo').nickName, // avatar_url: wx.getStorageSync('userInfo').avatarUrl, _createTime: new Date().getTime(), realName: this.data.name, logo: this.data.logo, phone: this.data.phone, } }).then(res => { console.log(res) if (res.result.errMsg == 'collection.add:ok') { wx.hideLoading() wx.showToast({ title: '发表成功', }) this.hideModal(); this.getComment(this.data.info_id) } }) } else { wx.showToast({ title: '包含敏感信息', icon: 'error' }) } }) } }, getComment(id){ wx.cloud.callFunction({ name:'getCampusInfo', data:{ action:'getcomment', info_id: id } }).then(res=>{ console.log(res) this.setData({ commentInfo: res.result.data, comment:'' }) }) }, makePhoneCall(){ wx.makePhoneCall({ phoneNumber: this.data.info.phone, }) }, deleteComment(e){ console.log(e) let _this = this wx.showModal({ title: '提示', content: '是否删除当前评论?', success (res) { if (res.confirm) { console.log('用户点击确定') wx.cloud.callFunction({ name:'getCampusInfo', data:{ action: 'deletecomment', comment_id : e.currentTarget.dataset.comment_id } }).then(res=>{ console.log(res) if(res.result.errMsg == 'document.remove:ok'){ wx.showToast({ title: '删除成功', }) _this.getComment(_this.data.info_id) } }) } else if (res.cancel) { console.log('用户点击取消') } } }) }, showModal(e) { console.log(e) this.setData({ modalName: 'Image', url: e.currentTarget.dataset.url }) }, hideModal(e) { this.setData({ modalName: null, url:'' }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } }) ```
资讯详情 ``` // pages/schoolinfo/info_detail.js const app = getApp() const db = wx.cloud.database() // const util = require("../../utils/util"); Page({ /** * 页面的初始数据 */ data: { list: [], realName: "", cardCur:0, InputBottom: 0, userisRoot:true }, //获取角色权限 // userRoot:function(e){ // var localopenid = wx.getStorageSync("openid"); // db.collection('c_role').where({openid:localopenid,role:'超级管理员',using:true}).get().then(res=>{ // console.log(res) // if(res.data.length>0){ // this.setData({ // userisRoot:true // }) // } // }) // }, showModalView(e) { const { id, index } = e.currentTarget.dataset; // console.log(id, index) this.setData({ id: id, index: index, modalName: e.currentTarget.dataset.target }) // console.log(this.data.nowOrderData) }, getUserRole(openid) { var that = this; // console.log(openid); db.collection('c_role').where({openid:openid,role:'超级管理员',using:true}).get().then(res=>{ console.log(res) if(res.data.length>0){ wx.setStorageSync('admin',res.data); // that.userroot = true; this.setData({ userroot:true, isAdmin:true }) } }) }, /** * 个人中心权限标志 */ // userRoot:function(e){ // var localopenid = wx.getStorageSync("openid"); // db.collection('c_role').where({openid : localopenid}).get({ // success:res=>{ // let role = res.data[0].role; // if(role == "超级管理员"){ // this.setData({ // userroot:true // }) // } // } // }) // }, //获取id getOpenid() { wx.cloud.callFunction({ name: 'login' }).then(res => { this.setData({ openid: res.result.openid }) }).catch(err => { console.log(err); }) }, getData(){ let phone = wx.getStorageSync('phone'); let logo = wx.getStorageSync('logo'); let realName = wx.getStorageSync('realName'); this.setData({ phone: phone, logo: logo, realName: realName }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.getData(); this.getOpenid(); this.getUserRole(); let phone = wx.getStorageSync('phone'); let logo = wx.getStorageSync('logo'); let name = wx.getStorageSync('realName'); if(!phone && !logo ){ wx.showToast({ title: '登录态失效,请先登录', }) wx.switchTab({ url: '/pages/index/index', }) }else{ this.setData({ phone,logo,name, }) this.data.info_id = options.info_id this.getData(this.data.info_id) this.getDetail(this.data.info_id) this.getComment(this.data.info_id) this.addView(this.data.info_id) } }, addView(id){ wx.cloud.callFunction({ name:'getCampusInfo', data:{ action:'viewinfo', info_id: this.data.info_id } }).then(res=>{ }) }, cardSwiper(e) { this.setData({ cardCur: e.detail.current }) }, getDetail(id){ wx.showLoading({ title: '加载中', }) db.collection('s_info').doc(id).get().then(res=>{ console.log(res) wx.hideLoading() this.setData({ info:res.data }) }) }, InputFocus(e) { this.setData({ InputBottom: e.detail.height }) }, InputBlur(e) { this.setData({ InputBottom: 0 }) }, inputComment(e){ this.data.comment = e.detail.value }, postComment() { let neirong = this.data.comment if (!neirong) { wx.showToast({ icon: 'error', title: '请输入评论内容' }) } else { wx.showLoading({ title: '校验信息中', icon: 'none' }) wx.cloud.callFunction({ name: 'msgSC', data: { des: this.data.comment } }).then(res => { console.log("检查", res) if (res.result.code == "200") { wx.cloud.callFunction({ name: 'getCampusInfo', data: { action: 'addcomment', comment: this.data.comment, info_id: this.data.info_id, // nick_name: wx.getStorageSync('userInfo').nickName, // avatar_url: wx.getStorageSync('userInfo').avatarUrl, _createTime: new Date().getTime(), realName: this.data.name, logo: this.data.logo, phone: this.data.phone, } }).then(res => { console.log(res) if (res.result.errMsg == 'collection.add:ok') { wx.hideLoading() wx.showToast({ title: '发表成功', }) this.hideModal(); this.getComment(this.data.info_id) } }) } else { wx.showToast({ title: '包含敏感信息', icon: 'error' }) } }) } }, getComment(id){ wx.cloud.callFunction({ name:'getCampusInfo', data:{ action:'getcomment', info_id: id } }).then(res=>{ console.log(res) this.setData({ commentInfo: res.result.data, comment:'' }) }) }, makePhoneCall(){ wx.makePhoneCall({ phoneNumber: this.data.info.phone, }) }, deleteComment(e){ console.log(e) let _this = this wx.showModal({ title: '提示', content: '是否删除当前评论?', success (res) { if (res.confirm) { console.log('用户点击确定') wx.cloud.callFunction({ name:'getCampusInfo', data:{ action: 'deletecomment', comment_id : e.currentTarget.dataset.comment_id } }).then(res=>{ console.log(res) if(res.result.errMsg == 'document.remove:ok'){ wx.showToast({ title: '删除成功', }) _this.getComment(_this.data.info_id) } }) } else if (res.cancel) { console.log('用户点击取消') } } }) }, showModal(e) { console.log(e) this.setData({ modalName: 'Image', url: e.currentTarget.dataset.url }) }, hideModal(e) { this.setData({ modalName: null, url:'' }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } }) ```
评论 (
0
)
将军
创建了
任务
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
master
cxyax
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
JavaScript
1
https://gitee.com/cxyax/WeChatComputer-roomMaintenance.git
git@gitee.com:cxyax/WeChatComputer-roomMaintenance.git
cxyax
WeChatComputer-roomMaintenance
微信报修小程序V4.1
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册