diff --git a/app.json b/app.json index db3718c..0fec271 100644 --- a/app.json +++ b/app.json @@ -135,6 +135,12 @@ "pages/activity/redlist/index", "pages/activity/subway/index", "pages/activity/tenscenic/index", + "pages/activity/huawei/index", + "pages/activity/huawei/form/index", + "pages/activity/huawei/result/index", + "pages/activity/huawei/upload/index", + "pages/activity/huawei/uploadres/index", + "pages/activity/huawei/list/index", "pages/kj/index", "pages/kj/his/index", "pages/kj/info/index", diff --git a/pages/activity/huawei/form/index.js b/pages/activity/huawei/form/index.js new file mode 100644 index 0000000..194363b --- /dev/null +++ b/pages/activity/huawei/form/index.js @@ -0,0 +1,162 @@ +// pages/activity/huawei/form/index.js +import commonApi from "../../../../utils/https/common" +import userApi from "../../../../utils/https/user" +Page({ + + /** + * 页面的初始数据 + */ + data: { + multiArray:[], + multiIndex:[], + areaList:[], + info:{}, + brands:[], + brandIndex:-1, + id:null, + info:{} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + commonApi.user_post('actonline/act_online/getActDetail',{ + id:options.id + }).then(res=>{ + this.setData({ + info:res.data + }) + }) + commonApi.user_post('actonline/act_online/getMobileBrand',{}).then(res=>{ + let brands = [] + for(let i in res.data){ + brands.push({ + name:res.data[i], + id:i + }) + } + this.setData({ + brands:brands, + id:options.id + }) + }) + }, + changeBrand:function(e){ + this.setData({ + brandIndex:e.detail.value + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + changeName:function(e){ + let info = this.data.info + info.name = e.detail.value + this.setData({ + info:info + }) + }, + changeTel:function(e){ + let info = this.data.info + info.mobile = e.detail.value + this.setData({ + info:info + }) + }, + changeCard:function(e){ + let info = this.data.info + info.card_number = e.detail.value + this.setData({ + info:info + }) + }, + submit:function(e){ + let info = this.data.info; + + if(!info.name){ + wx.showToast({ + title: '请输入姓名', + icon:'none' + }) + return; + } + if(info.mobile.length!=11){ + wx.showToast({ + title: '请输入正确的手机号', + icon:'none' + }) + return; + } + if(info.card_number.length!=18){ + wx.showToast({ + title: '请输入正确的身份证号码', + icon:'none' + }) + return; + } + if(this.data.brandIndex==-1){ + wx.showToast({ + title: '请选择手机品牌', + icon:'none' + }) + return; + } + info.id = this.data.id + info.mobile_type = Number(this.data.brands[this.data.brandIndex].id) + commonApi.user_post("actonline/act_online/actSign",info).then(res=>{ + if(res.code==1){ + wx.navigateTo({ + url: '../result/index?id='+this.data.id, + }) + } + }) + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/form/index.json b/pages/activity/huawei/form/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/form/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/form/index.wxml b/pages/activity/huawei/form/index.wxml new file mode 100644 index 0000000..314aa69 --- /dev/null +++ b/pages/activity/huawei/form/index.wxml @@ -0,0 +1,29 @@ + + + + + + + 姓名 + + + + 联系方式 + + + + 身份证 + + + + 手机品牌 + + + {{brandIndex==-1?'请选择':brands[brandIndex].name}} + + + + + + + \ No newline at end of file diff --git a/pages/activity/huawei/form/index.wxss b/pages/activity/huawei/form/index.wxss new file mode 100644 index 0000000..cacec9b --- /dev/null +++ b/pages/activity/huawei/form/index.wxss @@ -0,0 +1,72 @@ +/* pages/activity/huawei/form/index.wxss */ +.topimg { + display: block; + width: 100%; +} +page { + background: #003323; +} +.input-box { + margin: 0 42rpx; + position: relative; + z-index: 1; + margin-top: -130rpx; + background: white; + border-radius: 16rpx; + font-size: 31rpx; + padding: 30rpx 52rpx; +} +.input-box image { + display: block; + width: 264rpx; + height: 68rpx; +} +.input-box image.submit-btn { + display: block; + width: 561rpx; + height: 104rpx; + margin: 0 auto; + margin-top: 35rpx; +} +.input-box input { + display: block; + padding: 10rpx 30rpx; + width: 420rpx; + height: 71rpx; + line-height: 71rpx; + background: #FFFFFF; + border: 1rpx solid #CCCCCC; + border-radius: 10rpx; + box-sizing: border-box; + color: #333; + font-size: 32rpx; + font-weight: 500; + flex-shrink: 0; +} +.input-item { + display: flex; + align-items: center; + justify-content: space-between; + font-weight: 500; + font-size: 32rpx; + color: #333333; + margin-top: 45rpx; + margin-bottom: 45rpx; +} +.picker { + padding: 0 30rpx; + width: 420rpx; + height: 71rpx; + line-height: 71rpx; + background: #FFFFFF; + border: 1rpx solid #CCCCCC; + border-radius: 10rpx; + box-sizing: border-box; + color: #333; + font-size: 32rpx; + font-weight: 500; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; +} \ No newline at end of file diff --git a/pages/activity/huawei/index.js b/pages/activity/huawei/index.js new file mode 100644 index 0000000..20e1d98 --- /dev/null +++ b/pages/activity/huawei/index.js @@ -0,0 +1,107 @@ +// pages/activity/huawei/index.js +const sys = wx.getSystemInfoSync(),rect = wx.getMenuButtonBoundingClientRect(); +let height = sys.screenHeight - (rect.top - sys.statusBarHeight) * 2 - rect.height - sys.statusBarHeight; +import commonApi from "../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + height:height, + isReg:false, + id:null, + info:{}, + showRuleFlag:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // 判断是否报名 + this.setData({ + id:options.id + }) + commonApi.user_post("actonline/act_online/isSign",{id:options.id}).then(res=>{ + this.setData({ + isReg:res.data + }) + }) + commonApi.user_post("actonline/act_online/getActDetail",{ + id:options.id + }).then(res=>{ + if(res.data){ + for(let i in res.data){ + if(i.indexOf('time')!=-1 && res.data[i]){ + res.data[i] = res.data[i].replace(/-/g,'.') + res.data[i] = res.data[i].substr(0,res.data[i].length-3) + } + } + this.setData({ + info:res.data + }) + } + }) + }, + showRule:function(){ + this.setData({ + showRuleFlag:!this.data.showRuleFlag + }) + }, + gotoPath:function(e){ + let path = e.currentTarget.dataset.path; + wx.navigateTo({ + url: path + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/index.json b/pages/activity/huawei/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/index.wxml b/pages/activity/huawei/index.wxml new file mode 100644 index 0000000..3d0a1ba --- /dev/null +++ b/pages/activity/huawei/index.wxml @@ -0,0 +1,20 @@ + + + + + 规则 + 线上报名时间:{{info.sign_begin_time}} - {{info.sign_end_time}} + 线上投票时间:{{info.begin_time}} - {{info.end_time}} + + + + {{info.sub_title}} + + + + + + • 活动规则 • + + + \ No newline at end of file diff --git a/pages/activity/huawei/index.wxss b/pages/activity/huawei/index.wxss new file mode 100644 index 0000000..9ca2b36 --- /dev/null +++ b/pages/activity/huawei/index.wxss @@ -0,0 +1,71 @@ +/* pages/activity/huawei/index.wxss */ +.info-box { + position: absolute; + left: 0; + right: 0; + bottom: 0; + background: url(https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/huawei/bg.png); + background-size: 100% 100%; + background-repeat: no-repeat; + display: flex; + flex-direction: column; + justify-content: flex-end; + align-items: center; +} +.bg { + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; +} +.btnimg { + display: block; + width: 558rpx; + height: 104rpx; + margin-bottom: 23rpx; +} +.bottomtext { + color: #fff; + text-align: center; + font-size: 24rpx; + margin-bottom: 45rpx; +} +.rule-btn { + font-size: 27rpx; + color: #fff; + font-weight: 500; + width: 73rpx; + height: 73rpx; + border: 1rpx solid; + border-radius: 50%; + position: absolute; + right: 30rpx; + top: 30rpx; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; +} +.tiptext { + color: #fff; + font-size: 25rpx; + margin-top: 20rpx; +} +.rule-box { + height: 50%; + overflow-y: auto; + font-size: 27rpx; + color: #010101; + padding: 0 50rpx; + width: 500rpx; + padding-bottom: 30rpx; + line-height: 46rpx; +} +.rule-title { + text-align: center; + font-size: 32rpx; + color: #000; + font-weight: 500; + line-height: 100rpx; +} \ No newline at end of file diff --git a/pages/activity/huawei/list/index.js b/pages/activity/huawei/list/index.js new file mode 100644 index 0000000..75f924f --- /dev/null +++ b/pages/activity/huawei/list/index.js @@ -0,0 +1,200 @@ +// pages/activity/huawei/list/index.js +import commonApi from "../../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:null, + types:[], + typeIndex:0, + list:[], + detail:{}, + showRuleFlag:false, + user_id:null, + isReg:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id:options.id + }) + if(options.user_id){ + let user_id = wx.getStorageSync('jstrip_userid'); + if(user_id!=options.user_id){ + this.setData({ + user_id:options.user_id + }) + } + + } + commonApi.user_post("actonline/act_online/isSign",{id:options.id}).then(res=>{ + if(res.code==1){ + this.setData({ + isReg:res.data + }) + } + }) + commonApi.user_post("actonline/act_online/getActDetail",{id:options.id}).then(res=>{ + this.setData({ + detail:res.data + }) + }) + commonApi.user_post("actonline/act_online/getActTypeList",{ + act_id:this.data.id + }).then(res=>{ + this.setData({ + types:res.data + }) + if(res.data.length>0){ + this.getList() + } + + }) + }, + showRule:function(){ + this.setData({ + showRuleFlag:!this.data.showRuleFlag + }) + }, + reUpload:function(){ + let that = this; + wx.showModal({ + title:"提示", + content:"一个分类的作品多次提交,平台只保留最近上传的作品。", + cancelText:"否", + confirmText:"是", + success:function(res){ + if(res.confirm){ + that.gotoUpload() + } + } + }) + }, + changeType:function(e){ + this.setData({ + typeIndex:e.currentTarget.dataset.type, + list:[] + }) + this.getList() + }, + getList:function(){ + commonApi.user_post("actonline/act_online/myWork",{ + type_id:this.data.types[this.data.typeIndex].id, + id:this.data.id, + page:1, + limit:100, + user_id:this.data.user_id || null + }).then(res=>{ + if(this.data.user_id && res.data.data[0].status!=1){ + res.data.data = [] + } + this.setData({ + list:res.data.data + }) + + this.onShareAppMessage() + }) + }, + gotoUpload:function(){ + if(this.data.isReg){ + wx.navigateTo({ + url: '../upload/index?id='+this.data.id + }) + } + else { + wx.navigateTo({ + url: '../index?id='+this.data.id + }) + } + }, + vote:function(e){ + let that = this + commonApi.user_post("actonline/act_online/vote",{ + id:this.data.list[0].id + }).then(res=>{ + if(res.code==1){ + wx.showToast({ + title: '投票成功', + icon:'success' + }) + let list = this.data.list; + list[0].votes = Number(list[0].votes) + 1; + } + else if(res.code==-1){ + wx.showModal({ + title:"提示", + content:res.msg, + confirmText:"关闭", + cancelText:"前往报名", + success:function(res){ + if(!res.confirm){ + wx.navigateTo({ + url: '/pages/activity/huawei/index?id='+that.data.id + }) + } + } + }) + } + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + if(this.data.list.length>0){ + return { + title:"帮我投一票吧~", + path:"/pages/activity/huawei/list/index?id="+this.data.id+"&user_id="+this.data.list[0].user.id, + imageUrl:this.data.list[0].img + } + } + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/list/index.json b/pages/activity/huawei/list/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/list/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/list/index.wxml b/pages/activity/huawei/list/index.wxml new file mode 100644 index 0000000..e176f74 --- /dev/null +++ b/pages/activity/huawei/list/index.wxml @@ -0,0 +1,42 @@ + + + + {{item.title}} + + + {{list[0].title}} + + + {{list[0].user.nickname}} + 作品id:{{list[0].id}} + + + 作品id:{{list[0].id}} + 作品状态: + {{list[0].status_text}} + + 拒绝理由:{{list[0].refund_msg}} + + + 当前得票:{{list[0].votes}} + 投票 + + + {{list[0].desc}} + + 规则 + + + + + + 您还未上传作品,快去上传吧! + + + + + + • 活动规则 • + + + \ No newline at end of file diff --git a/pages/activity/huawei/list/index.wxss b/pages/activity/huawei/list/index.wxss new file mode 100644 index 0000000..6ceb225 --- /dev/null +++ b/pages/activity/huawei/list/index.wxss @@ -0,0 +1,163 @@ +/* pages/activity/huawei/list/index.wxss */ +.tabs { + display: flex; + align-items: center; + flex-wrap: nowrap; + overflow-x: auto; + margin: 0 27rpx; + height: 92rpx; + border-bottom: 1rpx solid #cccccc; + color: #666; + font-size: 31rpx; + padding: 0 28rpx; +} +.tab { + margin-right: 140rpx; + position: relative; + line-height: 92rpx; + flex-shrink: 0; +} +.tab:last-child { + margin-right: 0; +} +.tab.active { + color: #000; + font-weight: 500; +} +.tab.active::after { + content: "1"; + font-size: 0; + display: block; + position: absolute; + width: 60rpx; + left: 50%; + margin-left: -30rpx; + bottom: 0; + height: 7rpx; + background: linear-gradient(0deg, rgba(251, 197, 34, 0.93), rgba(255, 252, 0, 0.93)); + border-radius: 3rpx; +} +.title { + text-align: center; + padding: 39rpx 30rpx; + margin-top: 12rpx; + font-size: 36rpx; + color: #333; + font-weight: bold; +} +.mainimg { + display: block; + margin: 0 auto; + width: 625rpx; + border: 13rpx solid #FEE5C6; + margin-bottom: 50rpx; +} +.content { + margin: 0 52rpx; + padding-bottom: 30rpx; + font-size: 27rpx; + color: #333333; +} +.emptyimg { + display: block; + margin: 91rpx auto; + width: 414rpx; + height: 193rpx; +} +.tip1 { + text-align: center; + font-size: 35rpx; + color: #000000; +} +.btnimg { + width: 558rpx; + margin: 0 auto; + margin-top: 86rpx; + display: block; +} +.work-tips-my { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 31rpx; + color: #666; + margin: 0 53rpx; + padding: 20rpx 0; +} +.work-tips-my view { + flex: 1; +} +.work-tips-my .status { + color: #CC0000; +} +.work-tips-my .status.active { + color: #169900; +} +.count-num { + color: #333; + font-size: 31rpx; + font-weight: 500; +} +.rule-btn { + width: 143rpx; + position: fixed; + text-align: center; + line-height: 66rpx; + background: #FFFC00; + border-top-left-radius: 33rpx; + border-bottom-left-radius: 33rpx; + font-size: 31rpx; + color: #333333; + padding-right: 10rpx; + right: 0; + bottom: 246rpx; +} +.rule-box { + height: 50%; + overflow-y: auto; + font-size: 27rpx; + color: #010101; + padding: 0 50rpx; + width: 500rpx; + padding-bottom: 30rpx; + line-height: 46rpx; +} +.rule-title { + text-align: center; + font-size: 32rpx; + color: #000; + font-weight: 500; + line-height: 100rpx; +} +.vote-box { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 53rpx; + padding-bottom: 50rpx; +} +.vote-btn { + width: 175rpx; + line-height: 64rpx; + background: linear-gradient(0deg, rgba(251, 197, 34, 0.93), rgba(255, 252, 0, 0.93)); + border-radius: 32rpx; + text-align: center; + color: #333333; + font-size: 31rpx; + font-weight: 500; +} +.work-tips-my image { + display: block; + width: 53rpx; + height: 53rpx; + border-radius: 50%; +} +.work-tips-my view.nickname { + font-size: 28rpx; + margin: 0 20rpx; +} +.refund-msg { + color: #CC0000; + margin: 30rpx 53rpx; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/pages/activity/huawei/result/index.js b/pages/activity/huawei/result/index.js new file mode 100644 index 0000000..11a206b --- /dev/null +++ b/pages/activity/huawei/result/index.js @@ -0,0 +1,73 @@ +// pages/activity/huawei/result/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id:options.id + }) + }, + upload:function(e){ + wx.navigateTo({ + url: '../upload/index?id='+this.data.id + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/result/index.json b/pages/activity/huawei/result/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/result/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/result/index.wxml b/pages/activity/huawei/result/index.wxml new file mode 100644 index 0000000..513b922 --- /dev/null +++ b/pages/activity/huawei/result/index.wxml @@ -0,0 +1,7 @@ + + + +恭喜您已报名成功! +点击下方按钮开始进行作品上传 + + diff --git a/pages/activity/huawei/result/index.wxss b/pages/activity/huawei/result/index.wxss new file mode 100644 index 0000000..8961d11 --- /dev/null +++ b/pages/activity/huawei/result/index.wxss @@ -0,0 +1,30 @@ +/* pages/activity/huawei/result/index.wxss */ +.logo { + margin: 64rpx auto; + width: 415rpx; + height: 393rpx; + display: block; +} +page { + text-align: center; + color: #666666; + font-size: 28rpx; +} +.uploadimg { + display: block; + width: 558rpx; + height: 104rpx; + margin: 0 auto; +} +.arrowimg { + display: block; + margin: 35rpx auto; + width: 42rpx; + height: 58rpx; +} +.text { + font-size: 45rpx; + font-weight: 500; + color: #000000; + margin-bottom: 20rpx; +} \ No newline at end of file diff --git a/pages/activity/huawei/upload/index.js b/pages/activity/huawei/upload/index.js new file mode 100644 index 0000000..b638fdc --- /dev/null +++ b/pages/activity/huawei/upload/index.js @@ -0,0 +1,234 @@ +// pages/activity/huawei/upload/index.js +import commonApi from "../../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:null, + types:[], + typeIndex:-1, + title:"", + img:null, + desc:"", + date:null, + address:"" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id:options.id + }) + commonApi.user_post('actonline/act_online/getActTypeList',{ + act_id:options.id + }).then(res=>{ + this.setData({ + types:res.data + }) + }) + }, + changeType:function(e){ + this.setData({ + typeIndex:e.detail.value + }) + }, + changeTitle:function(e){ + this.setData({ + title:e.detail.value + }) + }, + changeContent:function(e){ + this.setData({ + desc:e.detail.value + }) + }, + uploadImg:function(){ + let that = this; + wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success (res) { + // tempFilePath可以作为img标签的src属性显示图片 + const tempFilePaths = res.tempFilePaths[0] + if(tempFilePaths.substr(tempFilePaths.length-4,4)=='.gif'){ + wx.showToast({ + title: '图片格式错误', + icon:'none' + }) + return; + } + wx.showLoading({ + title: '图片上传中,请稍后' + }) + wx.uploadFile({ + url: 'https://api.cloud.sz-trip.com/api/pbservice.other/upload', //这里是上传的服务器地址 + filePath: tempFilePaths, + header:{ + token: wx.getStorageSync('jstrip_token'), + }, + name: "file", + success: function (res) { + var res = JSON.parse(res.data); + let img = res.data.url; + that.setData({ + img:img + }) + wx.hideLoading(); + }, + fail:function(res){ + wx.hideLoading(); + } + }) + } + }) + }, + bindDateChange:function(e){ + this.setData({ + date:e.detail.value + }) + }, + changeAddress:function(e){ + this.setData({ + address:e.detail.value + }) + }, + submit:function(){ + if(!this.data.title){ + wx.showToast({ + title: '请输入作品标题', + icon:'none' + }) + return; + } + if(this.getCNLen(this.data.title)>30){ + wx.showToast({ + title: '作品标题过长', + icon:'none' + }) + return; + } + if(this.data.typeIndex==-1){ + wx.showToast({ + title: '请选择分类', + icon:'none' + }) + return; + } + if(!this.data.date){ + wx.showToast({ + title: '请选择拍摄时间', + icon:'none' + }) + return; + } + if(!this.data.address){ + wx.showToast({ + title: '请输入您所上传照片的拍摄地点', + icon:'none' + }) + return; + } + if(!this.data.img){ + wx.showToast({ + title: '请上传图片', + icon:'none' + }) + return; + } + if(!this.data.desc){ + wx.showToast({ + title: '请输入作品描述', + icon:'none' + }) + return; + } + if(this.getCNLen(this.data.desc)>600){ + wx.showToast({ + title: '作品描述过长', + icon:'none' + }) + return; + } + commonApi.user_post("actonline/act_online/uploadWork",{ + title:this.data.title, + img:this.data.img, + desc:this.data.desc, + type_id:this.data.types[this.data.typeIndex].id, + id:this.data.id, + shot_time:this.data.date, + shot_address:this.data.address + }).then(res=>{ + if(res.code==1){ + wx.navigateTo({ + url: '../uploadres/index?id='+this.data.id + }) + } + }) + + }, + getCNLen:function(str){ + var len = 0; + for (var i=0; i127 || str.charCodeAt(i)==94) { + len += 2; + } else { + len ++; + } + } + return len; + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/upload/index.json b/pages/activity/huawei/upload/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/upload/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/upload/index.wxml b/pages/activity/huawei/upload/index.wxml new file mode 100644 index 0000000..634134f --- /dev/null +++ b/pages/activity/huawei/upload/index.wxml @@ -0,0 +1,38 @@ + + + + + + 作品标题 + + + + 选择分类 + + + {{typeIndex==-1?'请选择':types[typeIndex].title}} + + + + + + 拍摄时间 + + + {{!date?'请选择':date}} + + + + + + 拍摄地点 + + + +上传图片 + + +作品描述 + + +一个分类的作品多次提交,平台只保留最近上传的作品 \ No newline at end of file diff --git a/pages/activity/huawei/upload/index.wxss b/pages/activity/huawei/upload/index.wxss new file mode 100644 index 0000000..7eb9cd8 --- /dev/null +++ b/pages/activity/huawei/upload/index.wxss @@ -0,0 +1,112 @@ +/* pages/activity/huawei/upload/index.wxss */ +.topimg { + display: block; + width: 100%; +} +page { + background: #F7F7F7; +} +.input-box { + margin: 0 24rpx; + margin-top: -60rpx; + position: relative; + z-index: 1; + border-radius: 7rpx; + background: white; + padding: 32rpx 28rpx; + font-size: 31rpx; + color: #333333; +} +.input-item { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 24rpx; + margin-bottom: 27rpx; +} +.input-box text { + margin-right: 20rpx; + flex-shrink: 0; + font-size: 31rpx; +} +.input-box input { + width: 483rpx; + height: 80rpx; + line-height: 80rpx; + box-sizing: border-box; + display: block; + padding: 0 15rpx; + border: 1rpx solid #CCCCCC; + border-radius: 4rpx; +} +.input-box .input-item:last-child{ + margin-bottom: 0; +} +.picker { + display: flex; + width: 483rpx; + height: 80rpx; + box-sizing: border-box; + padding-left: 15rpx; + border: 1rpx solid #CCCCCC; + border-radius: 4rpx; + align-items: center; + justify-content: space-between; +} +.picker .iconfont { + width: 80rpx; + text-align: center; + line-height: 80rpx; + border-left: 1rpx solid #CCCCCC; + flex-shrink: 0; +} +.picker .areatext { + flex: 1; +} +.tip1 { + font-size: 36rpx; + padding-left: 52rpx; + margin-top: 46rpx; + margin-bottom: 26rpx; + position: relative; + line-height: 33rpx; +} +.tip1::before { + content:"1"; + font-size: 0; + position: absolute; + width: 10rpx; + height: 33rpx; + left: 24rpx; + top: 0; + background: linear-gradient(0deg, rgba(251, 197, 34, 0.93), rgba(255, 252, 0, 0.93)); +} +.uploadimg { + display: block; + margin-left: 24rpx; + width: 249rpx; + height: 191rpx; + margin-bottom: 50rpx; +} +.textarea { + font-size: 24rpx; + margin: 24rpx; + padding: 20rpx 30rpx; + border-radius: 7rpx; + background: white; + display: block; + height: 230rpx; + width: 640rpx; +} +.uploadbtn { + display: block; + margin: 40rpx auto; + width: 558rpx; + height: 104rpx; +} +.tip2 { + text-align: center; + font-size: 24rpx; + color: #b2b2b2; + padding-bottom: 40rpx; +} \ No newline at end of file diff --git a/pages/activity/huawei/uploadres/index.js b/pages/activity/huawei/uploadres/index.js new file mode 100644 index 0000000..4fd04e0 --- /dev/null +++ b/pages/activity/huawei/uploadres/index.js @@ -0,0 +1,78 @@ +// pages/activity/huawei/uploadres/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id:options.id + }) + }, + gotoPath:function(e){ + wx.navigateTo({ + url: e.currentTarget.dataset.path, + }) + }, + backhome:function(){ + wx.switchTab({ + url: '/pages/index/index' + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/activity/huawei/uploadres/index.json b/pages/activity/huawei/uploadres/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/huawei/uploadres/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/huawei/uploadres/index.wxml b/pages/activity/huawei/uploadres/index.wxml new file mode 100644 index 0000000..e9f1645 --- /dev/null +++ b/pages/activity/huawei/uploadres/index.wxml @@ -0,0 +1,8 @@ + + + +恭喜您的作品已上传完成! + + +通过第一轮评审的摄影作品将在9月1号后 +进行线上展示,请注意查看平台通知 \ No newline at end of file diff --git a/pages/activity/huawei/uploadres/index.wxss b/pages/activity/huawei/uploadres/index.wxss new file mode 100644 index 0000000..3c5cf0f --- /dev/null +++ b/pages/activity/huawei/uploadres/index.wxss @@ -0,0 +1,26 @@ +/* pages/activity/huawei/uploadres/index.wxss */ +.logo { + display: block; + margin: 64rpx auto; + width: 414rpx; + height: 393rpx; +} +.tip1 { + font-size: 45rpx; + color: #000000; + font-weight: 500; + margin-bottom: 90rpx; + text-align: center; +} +.btnimg { + display: block; + margin: 24rpx auto; + width: 558rpx; + height: 104rpx; +} +.tip2 { + text-align: center; + font-size: 28rpx; + color: #666; + margin-bottom: 20rpx; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index da9e62d..2cdd269 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -337,6 +337,7 @@ Page({ else { let page = item.tdata.split("/"); page = page[page.length-1].split("?") + console.log(page[0]) let url = this.data.urltopage[page[0]]; console.log(url) if(url && url.indexOf('map')!=-1){ diff --git a/project.config.json b/project.config.json index 65cd319..2786333 100644 --- a/project.config.json +++ b/project.config.json @@ -23,7 +23,7 @@ "compileHotReLoad": false, "useMultiFrameRuntime": true, "useApiHook": true, - "useApiHostProcess": false, + "useApiHostProcess": true, "babelSetting": { "ignore": [], "disablePlugins": [], diff --git a/project.private.config.json b/project.private.config.json index a74e354..cf3236c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -13,15 +13,15 @@ "miniprogram": { "list": [ { - "name": "pages/activity/tenscenic/index", - "pathName": "pages/activity/tenscenic/index", - "query": "id=5442&retailId=17020017459&skuid=1209&gid=3841", + "name": "pages/activity/huawei/upload/index", + "pathName": "pages/activity/huawei/upload/index", + "query": "id=6", "scene": null }, { - "name": "pages/info/sceneProductInfo/index", - "pathName": "pages/info/sceneProductInfo/index", - "query": "id=4400", + "name": "pages/activity/huawei/list/index", + "pathName": "pages/activity/huawei/list/index", + "query": "id=6&user_id=18", "scene": null }, { diff --git a/utils/https.js b/utils/https.js index b5c6f07..0beebeb 100644 --- a/utils/https.js +++ b/utils/https.js @@ -145,11 +145,21 @@ function user_post(url,data={}){ return; } else if (res.data.code != 1 && res.data.msg) { - wx.showToast({ - title: res.data.msg==='身份证号码错误'?'身份证和姓名不匹配':res.data.msg, - icon: "none", - duration:2000 - }) + if(url.indexOf('actonline/act_online/vote')!=-1 && res.data.code==0){ + wx.showToast({ + title: res.data.msg, + icon: "none", + duration:2000 + }) + } + else if(url.indexOf('actonline/act_online/vote')==-1){ + wx.showToast({ + title: res.data.msg==='身份证号码错误'?'身份证和姓名不匹配':res.data.msg, + icon: "none", + duration:2000 + }) + } + } if(res.statusCode == 200){ if(url.indexOf('order/create')!=-1 && res.data.code==1 && res.data.data){