Commit 7fba2e1e73106a6cd68597d42e64deda0aca93c9

Authored by 夏洋涛
1 parent aa2980c5
Exists in master

feat:添加页面

README.md
1 1 # 计划管家sxhClockIn
2 2 已引入vant weapp https://vant-contrib.gitee.io/vant-weapp/#/home 完成开发步骤后可直接使用
  3 +- AppID:wx186236fdcd93edcc
  4 +- AppSecret:45e0877c1844a1a33ec393c60cf64b3f
3 5 ## 开发步骤
4 6 - 克隆
5 7 - 打开微信开发者工具
... ...
app.json
... ... @@ -2,6 +2,7 @@
2 2 "pages": [
3 3 "pages/index/index",
4 4 "pages/index/rank/rank",
  5 + "pages/index/achievement/achievement",
5 6 "pages/index/punchDetail/punchDetail",
6 7 "pages/index/newPunch/newPunch",
7 8 "pages/login/codeLogin/codeLogin",
... ...
img/_check_in4.jpg

106 KB

img/_check_in4.png 0 → 100644

106 KB

img/_check_in5.png 0 → 100644

79 KB

img/_index2.jpg

129 KB

img/_index2.png 0 → 100644

129 KB

pages/index/achievement/achievement.js 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +// pages/index/achievement/achievement.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + },
  9 +
  10 + /**
  11 + * 生命周期函数--监听页面加载
  12 + */
  13 + onLoad(options) {
  14 +
  15 + },
  16 + // 统一返回
  17 + handleBack() {
  18 + wx.navigateBack()
  19 + },
  20 + /**
  21 + * 用户点击右上角分享
  22 + */
  23 + onShareAppMessage() {
  24 +
  25 + }
  26 +})
0 27 \ No newline at end of file
... ...
pages/index/achievement/achievement.json 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +{
  2 + "usingComponents": {
  3 + "van-icon": "@vant/weapp/icon/index"
  4 + },
  5 + "navigationStyle": "custom"
  6 +}
0 7 \ No newline at end of file
... ...
pages/index/achievement/achievement.wxml 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +<!--pages/index/achievement/achievement.wxml-->
  2 +<view class="punch_detail">
  3 + <!-- 顶部统一返回 -->
  4 + <view class="navigation_back" bindtap="handleBack">
  5 + <van-icon name="arrow-left" />
  6 + </view>
  7 + <image class="temporary" src="/img/_check_in5.png" mode="widthFix" alt="" />
  8 +
  9 +</view>
0 10 \ No newline at end of file
... ...
pages/index/achievement/achievement.wxss 0 → 100644
... ... @@ -0,0 +1 @@
  1 +/* pages/index/achievement/achievement.wxss */
... ...
pages/index/index.js
... ... @@ -5,6 +5,7 @@ import request from &#39;../../api/request.js&#39;
5 5 Page({
6 6 data: {
7 7 showAdd: false, //新建打卡
  8 + tabindex: 1,
8 9 // bannerList: [], // 轮播图
9 10 },
10 11 /**
... ... @@ -13,12 +14,27 @@ Page({
13 14 onLoad: function (options) {
14 15 // this.getBannerList() //获取banner
15 16 },
  17 + onShow:function (options) {
  18 + this.setData({
  19 + showAdd:false
  20 + })
  21 + },
16 22 // 排行榜
17 23 handleRank(){
18 24 wx.navigateTo({
19 25 url: '/pages/index/rank/rank',
20 26 })
21 27 },
  28 + handleTab1() {
  29 + this.setData({
  30 + tabindex: 1
  31 + })
  32 + },
  33 + handleTab2() {
  34 + this.setData({
  35 + tabindex: 2
  36 + })
  37 + },
22 38 handleAdd() {
23 39 this.setData({
24 40 showAdd: true
... ... @@ -29,6 +45,12 @@ Page({
29 45 showAdd: false
30 46 })
31 47 },
  48 + // 打卡成果
  49 + handleAchievement(){
  50 + wx.navigateTo({
  51 + url: '/pages/index/achievement/achievement',
  52 + })
  53 + },
32 54 // 去打卡
33 55 handleDetail(){
34 56 wx.navigateTo({
... ...
pages/index/index.wxml
1 1 <view class="main">
2   - <image class="temporary" src="/img/_index1.png" mode="widthFix" alt="" />
  2 + <image class="temporary" hidden="{{tabindex==2}}" src="/img/_index1.png" mode="widthFix" alt="" />
  3 + <image class="temporary" hidden="{{tabindex==1}}" src="/img/_index2.png" mode="widthFix" alt="" />
3 4 <!-- 排行榜 -->
4 5 <text class="temporary_box" style="width: 370rpx;height: 100rpx;position: absolute;top: 192rpx;left: 20rpx;" bindtap="handleRank"></text>
  6 + <!-- 两个tab -->
  7 + <text class="temporary_box" style="width: 160rpx;height: 80rpx;position: absolute;top: 300rpx;left: 32rpx;" bindtap="handleTab1"></text>
  8 + <text class="temporary_box" style="width: 160rpx;height: 80rpx;position: absolute;top: 300rpx;left: 200rpx;" bindtap="handleTab2"></text>
  9 + <!-- 打卡成果 -->
  10 + <text class="temporary_box" style="width: 350rpx;height: 100rpx;position: absolute;top: 1000rpx;left: 20rpx;" bindtap="handleAchievement"></text>
5 11 <!-- 去打卡 -->
6   - <text class="temporary_box" style="width: 370rpx;height: 100rpx;position: absolute;top: 1000rpx;right: 20rpx;" bindtap="handleDetail"></text>
  12 + <text class="temporary_box" style="width: 350rpx;height: 100rpx;position: absolute;top: 1000rpx;right: 20rpx;" bindtap="handleDetail"></text>
7 13 <!-- 新建打卡 -->
8 14 <text class="temporary_box" style="width: 120rpx;height: 120rpx;position: absolute;top: 1200rpx;right: 20rpx;" bindtap="handleAdd"></text>
9 15 <van-popup show="{{ showAdd }}" position="bottom" custom-style="height: 80%;" bind:close="closeAdd">
10   - <image class="temporary" src="/img/_index2.png" mode="widthFix" alt="" />
  16 + <image class="temporary" src="/img/_index3.png" mode="widthFix" alt="" />
11 17 <!-- 自定义模板 -->
12   - <text class="temporary_box" style="width: 180rpx;height: 220rpx;position: absolute;top: 364rpx;left: 20rpx;" bindtap="handleNewPunch"></text>
  18 + <text class="temporary_box" style="width: 180rpx;height: 220rpx;position: absolute;top: 364rpx;left: 20rpx;" bindtap="handleNewPunch"></text>
13 19 </van-popup>
  20 +
14 21 </view>
15 22 \ No newline at end of file
... ...
pages/index/punchDetail/punchDetail.js
... ... @@ -7,6 +7,7 @@ Page({
7 7 data: {
8 8 showEdit: false, //确认打卡
9 9 Clocked: false, //已打卡状态,只是为了演示用
  10 + showSuccess:false
10 11 },
11 12  
12 13 /**
... ... @@ -15,6 +16,12 @@ Page({
15 16 onLoad(options) {
16 17  
17 18 },
  19 + // 打卡成果
  20 + handleAchievement(){
  21 + wx.navigateTo({
  22 + url: '/pages/index/achievement/achievement',
  23 + })
  24 + },
18 25 // 打开打卡信息填写
19 26 handleEdit() {
20 27 console.log(111)
... ... @@ -33,6 +40,12 @@ Page({
33 40 this.setData({
34 41 Clocked: true,
35 42 showEdit: false,
  43 + showSuccess:true
  44 + })
  45 + },
  46 + colseSuccess(){
  47 + this.setData({
  48 + showSuccess:false
36 49 })
37 50 },
38 51 handleBack() {
... ...
pages/index/punchDetail/punchDetail.wxml
... ... @@ -8,9 +8,19 @@
8 8 <image class="temporary" wx:if="{{Clocked}}" src="/img/_check_in3.png" mode="widthFix" alt="" />
9 9 <!-- 未打卡 -->
10 10 <image class="temporary" wx:else src="/img/_check_in1.png" mode="widthFix" alt="" />
  11 + <!-- 我的成果 -->
  12 + <text class="temporary_box" wx:if="{{!Clocked}}" style="width: 308rpx;height: 100rpx;position: absolute;top: 1412rpx;left: 32rpx;" bindtap="handleAchievement"></text>
  13 + <!-- 立即打卡 -->
11 14 <text class="temporary_box" wx:if="{{!Clocked}}" style="width: 308rpx;height: 100rpx;position: absolute;top: 1412rpx;right: 32rpx;" bindtap="handleEdit"></text>
  15 +
  16 + <!-- 立即打卡 -->
12 17 <van-popup show="{{ showEdit }}" position="bottom" custom-style="height: 80%;" bind:close="closeEdit">
13 18 <image class="temporary" src="/img/_check_in2.png" mode="widthFix" alt="" />
14 19 <text class="temporary_box" style="width: 700rpx;height: 100rpx;position: absolute;top: 1452rpx;right: 32rpx;" bindtap="handleSubmit"></text>
15 20 </van-popup>
  21 + <!-- 打卡成果 -->
  22 + <van-popup show="{{ showSuccess }}" custom-style="width:80%;height: 80%;" bind:close="colseSuccess">
  23 + <image class="temporary" src="/img/_check_in4.png" mode="widthFix" alt="" />
  24 + <text class="temporary_box" style="width: 200rpx;height: 60rpx;position: absolute;top: 800rpx;left: 200rpx;" bindtap="colseSuccess"></text>
  25 + </van-popup>
16 26 </view>
17 27 \ No newline at end of file
... ...
pages/login/codeLogin/codeLogin.js
... ... @@ -76,7 +76,7 @@ Page({
76 76 "session_key": this.data.session_key,
77 77 "iv": this.data.iv,
78 78 },
79   - }).then(res => {
  79 + }).then(res => {
80 80 if (res.success) {
81 81 if (res.data) {
82 82 this.setData({
... ... @@ -97,50 +97,9 @@ Page({
97 97 loginSuccess() {
98 98 if (this.data.path) {
99 99 // 获取三位一体的数据
100   - if (this.data.path == 'trinity') {
101   - let userInfo = wx.getStorageSync('userInfo');
102   - wx.showLoading({
103   - title: '加载中...',
104   - mask: true
105   - })
106   - wx.request({
107   - url: api + 'h5/MyVoluntary/GetTrinity',
108   - data: {
109   - userId: userInfo.id
110   - },
111   - method: "GET",
112   - header: {
113   - 'content-type': 'application/json'
114   - },
115   - success: function (res) {
116   - wx.hideLoading()
117   - if (res.data.success) {
118   - if (res.data.data) {
119   - wx.setStorageSync('trinity_id', res.data.data.id)
120   - wx.redirectTo({
121   - url: '/pages/trinity/recommend/recommend?id=' + res.data.data.id
122   - })
123   - } else {
124   - wx.setStorageSync('trinity_id', null)
125   - wx.redirectTo({
126   - url: '/pages/trinity/trinity'
127   - })
128   - }
129   - }
130   - }
131   - })
132   -
133   - } else if (this.data.path == 'riskSetting') {
134   - wx.redirectTo({
135   - url: '/pages/OrdinaryVolunteer/riskSetting/riskSetting'
136   - })
137   -
138   - } else {
139   - wx.redirectTo({
140   - url: this.data.path,
141   - })
142   - }
143   -
  100 + wx.redirectTo({
  101 + url: this.data.path,
  102 + })
144 103 } else {
145 104 wx.switchTab({
146 105 url: '/pages/index/index'
... ... @@ -156,19 +115,12 @@ Page({
156 115 // PhoneName: '13355752969'
157 116 PhoneName: this.data.phone
158 117 },
159   - }).then((res) => {
  118 + }).then((res) => {
160 119 if (res.success) {
161 120 if (res.data) {
162   - if (res.data.userName && res.data.graduateSchool) {
163   - wx.setStorageSync('userInfo', res.data)
164   - wx.setStorageSync('showModal', '')
165   - app.globalData.userInfo = res.data;
166   - } else {
167   - wx.setStorageSync('userInfo', res.data)
168   - that.setData({
169   - modelShow: true
170   - })
171   - }
  121 + wx.setStorageSync('userInfo', res.data)
  122 + wx.setStorageSync('showModal', '')
  123 +
172 124 }
173 125 }
174 126 })
... ... @@ -180,7 +132,7 @@ Page({
180 132 data: {
181 133 code: this.data.loginCode
182 134 },
183   - }).then(res2 => {
  135 + }).then(res2 => {
184 136 // console.log(res2.data);
185 137 this.setData({
186 138 session_key: JSON.parse(res2.data).session_key
... ...
pages/login/codeLogin/codeLogin.wxml
... ... @@ -34,5 +34,4 @@
34 34 <navigator url="../policy/policy"><text class="blue">《升学汇隐私政策》</text></navigator>
35 35 </view>
36 36 </view>
37   -</block>
38   -<PerfectInfo show="{{modelShow}}" bind:loginSuccess="loginSuccess"/>
39 37 \ No newline at end of file
  38 +</block>
40 39 \ No newline at end of file
... ...
pages/mine/index.js
... ... @@ -14,6 +14,12 @@ Page({
14 14 url: '/pages/mine/record/record',
15 15 })
16 16 },
  17 +// 退出登录
  18 + handleLoginOut(){
  19 + wx.navigateTo({
  20 + url: '/pages/login/codeLogin/codeLogin',
  21 + })
  22 + },
17 23 /**
18 24 * 用户点击右上角分享
19 25 */
... ...
pages/mine/index.wxml
... ... @@ -2,5 +2,7 @@
2 2 <image class="temporary" src="../../img/_mine.png" mode="widthFix" alt="" />
3 3 <!-- 打卡记录 -->
4 4 <text class="temporary_box" style="width: 340rpx;height: 160rpx;position: absolute;top: 340rpx;left: 32rpx;" bindtap="handleRecord"></text>
  5 + <!-- 退出登录 -->
  6 + <text class="temporary_box" style="width: 340rpx;height: 160rpx;position: absolute;top: 340rpx;right: 32rpx;" bindtap="handleLoginOut"></text>
5 7  
6 8 </view>
... ...
pages/mine/record/record.js
... ... @@ -24,6 +24,18 @@ Page({
24 24 tabindex: 2
25 25 })
26 26 },
  27 + // 打卡成果
  28 + handleAchievement(){
  29 + wx.navigateTo({
  30 + url: '/pages/index/achievement/achievement',
  31 + })
  32 + },
  33 + // 去打卡
  34 + handleDetail(){
  35 + wx.navigateTo({
  36 + url: '/pages/index/punchDetail/punchDetail',
  37 + })
  38 + },
27 39 // 统一返回
28 40 handleBack() {
29 41 wx.navigateBack()
... ...
pages/mine/record/record.wxml
... ... @@ -7,6 +7,12 @@
7 7 <!-- 两个tab -->
8 8 <text class="temporary_box" style="width: 320rpx;height: 80rpx;position: absolute;top: 160rpx;left: 32rpx;" bindtap="handleTab1"></text>
9 9 <text class="temporary_box" style="width: 320rpx;height: 80rpx;position: absolute;top: 160rpx;right: 32rpx;" bindtap="handleTab2"></text>
  10 + <!-- 打卡成果 -->
  11 + <text class="temporary_box" wx:if="{{tabindex==1}}" style="width: 700rpx;height: 100rpx;position: absolute;top: 988rpx;left: 32rpx;" bindtap="handleAchievement"></text>
  12 + <!-- 打卡成果 -->
  13 + <text class="temporary_box" wx:if="{{tabindex==2}}" style="width: 350rpx;height: 100rpx;position: absolute;top: 920rpx;left: 20rpx;" bindtap="handleAchievement"></text>
  14 + <!-- 去打卡 -->
  15 + <text class="temporary_box" wx:if="{{tabindex==2}}" style="width: 350rpx;height: 100rpx;position: absolute;top: 920rpx;right: 20rpx;" bindtap="handleDetail"></text>
10 16  
11 17 <image class="temporary" hidden="{{tabindex==2}}" src="/img/_my_punch1.png" mode="widthFix" alt="" />
12 18 <image class="temporary" hidden="{{tabindex==1}}" src="/img/_my_punch2.png" mode="widthFix" alt="" />
... ...
project.config.json
... ... @@ -50,8 +50,8 @@
50 50 },
51 51 "compileType": "miniprogram",
52 52 "libVersion": "2.23.2",
53   - "appid": "wxd055a716238e1bd7",
54   - "projectname": "%E5%8D%87%E5%AD%A6%E6%B1%87",
  53 + "appid": "wx186236fdcd93edcc",
  54 + "projectname": "计划管家",
55 55 "simulatorType": "wechat",
56 56 "simulatorPluginLibVersion": {},
57 57 "condition": {},
... ...