chengjunhui vor 1 Monat
Ursprung
Commit
695bf9933d
4 geänderte Dateien mit 48 neuen und 21 gelöschten Zeilen
  1. BIN
      assets/images/icon_1.png
  2. 38 19
      invitationCode/index.js
  3. 2 1
      pages/checkin/index.wxml
  4. 8 1
      pages/checkin/index.wxss

BIN
assets/images/icon_1.png


+ 38 - 19
invitationCode/index.js

@@ -20,7 +20,7 @@ Page({
 	/**
 	 * 生命周期函数--监听页面加载
 	 */
-	onLoad: function(options) {
+	onLoad: function (options) {
 		let that = this;
 		const user = wx.getStorageSync("USER");
 		this.setData({
@@ -31,20 +31,39 @@ Page({
 		})
 		this.getCode();
 		wx.setNavigationBarTitle({
-		  title: options.inviteCode ? '他/她的邀请码' : '我的邀请码'
+			title: options.inviteCode ? '他/她的邀请码' : '我的邀请码'
 		});
 	},
 	downloadQR() {
 		const that = this;
 		wx.getSetting({ //获取权限
 			success(res) {
+				console.log(res);
 				if (res.authSetting["scope.writePhotosAlbum"]) {
 					that.sendCode();
+				} else if (res.authSetting["scope.writePhotosAlbum"] == false) {
+					wx.showToast({
+						title: '请先授权相册',
+						icon: 'none'
+					})
+					wx.openSetting({
+						scope: "scope.writePhotosAlbum",
+						success() {
+							that.sendCode();
+						}
+					});
 				} else {
 					wx.authorize({
 						scope: "scope.writePhotosAlbum",
 						success() {
 							that.sendCode();
+						},
+						fail(e) {
+							console.log('未授权相册', e);
+							wx.showToast({
+								title: '请先授权相册',
+								icon: 'none'
+							})
 						}
 					});
 				}
@@ -87,49 +106,49 @@ Page({
 	/**
 	 * 生命周期函数--监听页面初次渲染完成
 	 */
-	onReady: function() {
+	onReady: function () {
 
 	},
 
 	/**
 	 * 生命周期函数--监听页面显示
 	 */
-	onShow: function() {
+	onShow: function () {
 
 	},
 
 	/**
 	 * 生命周期函数--监听页面隐藏
 	 */
-	onHide: function() {
+	onHide: function () {
 
 	},
 
 	/**
 	 * 生命周期函数--监听页面卸载
 	 */
-	onUnload: function() {
+	onUnload: function () {
 
 	},
 
 	/**
 	 * 页面相关事件处理函数--监听用户下拉动作
 	 */
-	onPullDownRefresh: function() {
-		
+	onPullDownRefresh: function () {
+
 	},
 
 	/**
 	 * 页面上拉触底事件的处理函数
 	 */
-	onReachBottom: function() {
+	onReachBottom: function () {
 
 	},
 
 	/**
 	 * 用户点击右上角分享
 	 */
-	onShareAppMessage: function() {
+	onShareAppMessage: function () {
 		this.addScore();
 		return {
 			title: '青雲慧小程序-邀请码分享',
@@ -137,17 +156,17 @@ Page({
 		}
 	},
 	//统计积分(每日小程序分享)
-	addScore: function() {
-		if(!util.getUserId()){
-			return ;
+	addScore: function () {
+		if (!util.getUserId()) {
+			return;
 		}
 		wx.showLoading({
 			title: '努力加载中...',
 		})
 		app._post_form('scoreStu/share', "", {
 			stuId: util.getUserId()
-		}, function(res) {
-			if (res.code === 0) {}
+		}, function (res) {
+			if (res.code === 0) { }
 		})
 	},
 	getCode() {
@@ -156,9 +175,9 @@ Page({
 			title: '努力加载中...',
 		})
 		app._post_form('create/wxaqrcode', '', {
-				inviteCode: that.data.inviteCode
-			},
-			function(res) {
+			inviteCode: that.data.inviteCode
+		},
+			function (res) {
 				if (res.code == 0) {
 					that.setData({
 						invitationCodeImg: res.data
@@ -169,7 +188,7 @@ Page({
 	copyText() {
 		wx.setClipboardData({
 			data: this.data.inviteCode || '',
-			success: function(res) {
+			success: function (res) {
 				wx.showToast({
 					title: '已复制邀请码',
 					icon: 'none'

+ 2 - 1
pages/checkin/index.wxml

@@ -30,7 +30,8 @@
     <view class="calendar-grid">
       <view class="calendar-day {{item.isEmpty ? 'empty' : ''}} {{item.isToday && !item.isChecked ? 'today' : ''}} {{item.isChecked ? 'checked' : ''}}" wx:for="{{calendarDays}}" wx:key="index">
         <view class="day-number" wx:if="{{!item.isEmpty}}">{{item.day}}</view>
-        <view class="check-dot" wx:if="{{item.isChecked && !item.isEmpty}}">√</view>
+        <!--<view class="check-dot" wx:if="{{item.isChecked && !item.isEmpty}}">√</view>-->
+        <image class="day-image" src="/assets/images/icon_1.png" mode="" lazy-load="false" wx:if="{{item.isChecked && !item.isEmpty}}"></image>
       </view>
     </view>
          <!-- 签到按钮 -->

+ 8 - 1
pages/checkin/index.wxss

@@ -173,7 +173,14 @@
   text-align: center;
 }
 
-.calendar-day.today .check-dot {
+.day-image{
+  width: 22rpx;
+  height: 22rpx;
+  position: absolute;
+  bottom: 0rpx;
+}
+
+.calendar-day.today .day-image {
   display: none;
 }