// 1 ano atrás
pai
commit
343a067bbd

+ 2 - 4
component/yeyouzi-cropper/yeyouzi-cropper.js

@@ -601,7 +601,6 @@ Component({
                     img.src = that.data.img.path
                     img.onload = () => {
                         ctx.drawImage(img, 0, 0, that.data.img.width, that.data.img.height, -(that.data.cutImg.x + canvas.width / 2), -(that.data.cutImg.y + canvas.height / 2), that.data.img.width, that.data.img.height)
-
                         wx.canvasToTempFilePath({
                             canvas: canvas,
                             success(img) {
@@ -611,10 +610,10 @@ Component({
                                     success: (res) => {},
                                 })
                             },
-                            fail() {
+                            fail(res) {
+                                console.log(res, '裁剪失败');
                                 wx.hideLoading({
                                     success: (res) => {
-                                        console.log(res);
                                         wx.showToast({
                                             title: '裁剪失败',
                                             icon: 'error'
@@ -626,7 +625,6 @@ Component({
                                 })
                             }
                         })
-
                     }
                 })
 

+ 3 - 3
component/yeyouzi-cropper/yeyouzi-cropper.wxml

@@ -23,13 +23,13 @@
         </view>
 
         <view class="btnContainer">
-            <text style="color: #fff;font-size: 24px;" bindtap="_cancelCut">×</text>
+            <text style="color: #fff;font-size: 34rpx;" bindtap="_cancelCut">取消</text>
             <!--    <text style="color: #fff;font-size: 16px;text-align:center;align-self: center;" bindtap="_imgRestore">还原</text> -->
-            <text style="color: #fff;font-size: 24px;" bindtap="_confirmCut">✓</text>
+            <text style="color: #fff;font-size: 34rpx;" bindtap="_confirmCut">裁剪</text>
         </view>
 
     </view>
 
-    <canvas type="2d" id="imgCanvas" style="width: 0;height: 0;"></canvas>
+    <canvas type="2d" id="imgCanvas"class='imgCanvas'></canvas>
 
 </view>

+ 47 - 39
component/yeyouzi-cropper/yeyouzi-cropper.wxss

@@ -1,51 +1,59 @@
 /* components/yeyouzi-cropper/yeyouzi-cropper.wxss */
-.Container{
-  opacity: 0;
-  z-index: -9999;
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  height: 100%;
-  position: fixed;
-  left: 0;
-  top: 0;
+.Container {
+    opacity: 0;
+    z-index: -9999;
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    left: 0;
+    top: 0;
 }
 
-.Container-show{
-  position: fixed;
-  left: 0;
-  top: 0;
-  background:#000;
-  display: flex;
-  width: 100%;
-  height: 100%;
-  flex-direction: column;
-  opacity: 1;
-  z-index: 999;
+.Container-show {
+    position: fixed;
+    left: 0;
+    top: 0;
+    background: #000;
+    display: flex;
+    width: 100%;
+    height: 100%;
+    flex-direction: column;
+    opacity: 1;
+    z-index: 999;
 }
 
-.imgContainer{
-  height: 100%;
-  width: 100%;
-  position: relative;
+.imgContainer {
+    height: 100%;
+    width: 100%;
+    position: relative;
 }
 
-.settingContainer{
-  background: #000;
-  padding: 10px 0;
-  z-index: 10000;
+.settingContainer {
+    background: #000;
+    padding: 40rpx 0;
+    z-index: 10000;
 }
 
-.rotateContainer{
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  padding: 0 20px;
+.rotateContainer {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    padding: 0 40rpx;
+    margin-bottom: 20rpx;
 }
 
-.btnContainer{
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  padding: 20px;
+.btnContainer {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    padding: 40rpx;
+}
+
+.imgCanvas {
+    position: absolute;
+    top: -9999px;
+    width: 600rpx;
+    height: 600rpx;
 }

+ 0 - 6
pages/activityDet/index.js

@@ -30,8 +30,6 @@ Page({
         // 此id保存模板使用
         id: '',
         greeting: [],
-        // 是否更改过头像
-        changeAvatarFlag: false,
         greetingCard: null,
         userAudioState: false,
         // 当前音频播放时长
@@ -96,12 +94,8 @@ Page({
         })
     },
     async changeAvatar(e) {
-        /*    const {
-               avatarUrl
-           } = e.detail */
         let res = await this.uploadFile(e)
         this.setData({
-            changeAvatarFlag: true,
             avatar: res
         })
     },

+ 18 - 16
pages/activityDet/index.less

@@ -21,21 +21,30 @@
             display: flex;
             align-items: center;
             z-index: 3;
+            right: 0px;
 
             .text {
                 min-width: 80rpx;
                 color: white;
                 padding: 0rpx 4rpx;
                 z-index: 0rpx;
-                border: 2rpx dashed white;
+                border-bottom: 2rpx solid white;
+                // background-color: #00000040;
             }
 
             image {
                 width: 22rpx;
-                height: 26rpx;
-                margin-left: 8rpx;
+                height: 24rpx;
                 z-index: 1;
             }
+
+            .editBtn {
+                text-align: center;
+                background-color: white;
+                border-radius: 50%;
+                margin-left: 6rpx;
+                padding: 2rpx 12rpx;
+            }
         }
 
         .avatar {
@@ -45,15 +54,6 @@
             align-items: center;
             justify-content: flex-end;
             z-index: 3;
-
-            .tips {
-                width: 150rpx;
-                font-size: 24rpx;
-                padding: 4rpx 20rpx;
-                border-radius: 50rpx;
-                color: white;
-                background-color: rgba(0, 0, 0, 0.4);
-            }
         }
 
         .avatarImg {
@@ -122,7 +122,8 @@
             font-weight: bold;
 
             .countBox {
-                padding: 10rpx;
+                width: 12rpx;
+                padding:6rpx 10rpx;
                 border-radius: 10rpx;
                 margin: 0rpx 4rpx;
                 color: white;
@@ -158,16 +159,17 @@
 
     .blessing {
         margin-top: 30rpx;
-        font-size: 36rpx;
+        font-size: 32rpx;
 
         .content {
-            height: 38rpx;
+            height: 66rpx;
             width: 600rpx;
             text-align: center;
-            margin: 20rpx auto 0rpx;
+            margin: 0rpx auto;
         }
 
         .content:first-child {
+            font-size: 28rpx;
             opacity: .7;
         }
     }

+ 9 - 5
pages/activityDet/index.wxml

@@ -2,21 +2,25 @@
     <view class="header" wx:if="{{state!='after'||!greetingCard.cardUrl}}">
         <image src="{{configure.bgImg}}" class="templateImg" />
         <view class="toBox"
-            style="top:{{configure.templateBase.fromTop}}rpx;left: {{configure.templateBase.fromLeft}}rpx;">
+            style="top:{{configure.templateBase.fromTop}}rpx;left: {{configure.templateBase.fromLeft}}rpx;justify-content: {{configure.fromTextAlign}};">
             <input value="{{configure.fromText}}" disabled="{{state=='process'}}" class="text" maxlength='8'
                 style="color:{{configure.fromColor}};font-size: {{configure.fromFontSize}}rpx;border-color: {{configure.fromColor}}60;width: {{fromWidth}}rpx;"
                 bindinput="bindKeyInput" data-type='from' />
-            <image src="/static/image/edit_new.png" wx:if="{{state!='process'}}" />
+            <view class="editBtn">
+                <image src="/static/image/edit_new.png" wx:if="{{state!='process'}}" />
+            </view>
         </view>
-        <view class="toBox" style="top:{{configure.templateBase.toTop}}rpx;left: {{configure.templateBase.toLeft}}rpx;">
+        <view class="toBox"
+            style="top:{{configure.templateBase.toTop}}rpx;left: {{configure.templateBase.toLeft}}rpx;justify-content: {{configure.toTextAlign}};">
             <input value="{{configure.toText}}" disabled="{{state=='process'}}" class="text" maxlength='8'
                 style="color:{{configure.toColor}};font-size: {{configure.toFontSize}}rpx;border-color: {{configure.toColor}}60;width: {{toWidth}}rpx;"
                 bindinput="bindKeyInput" data-type='to' />
-            <image src="/static/image/edit_new.png" wx:if="{{state!='process'}}" />
+            <view class="editBtn">
+                <image src="/static/image/edit_new.png" wx:if="{{state!='process'}}" />
+            </view>
         </view>
         <view class="avatar" bindtap="showActionSheet" wx:if="{{state!='process'}}"
             style="top:{{configure.templateBase.photoTop}}rpx;left: {{configure.templateBase.photoLeft}}rpx;width: {{configure.templateBase.photoWidth}}rpx;height:{{configure.templateBase.photoHeight}}rpx">
-            <view class="tips" wx:if="{{!changeAvatarFlag}}">点击更换图片</view>
         </view>
         <image class="avatarImg"
             style="top:{{configure.templateBase.photoTop}}rpx;left: {{configure.templateBase.photoLeft}}rpx;width: {{configure.templateBase.photoWidth}}rpx;height:{{configure.templateBase.photoHeight}}rpx"

+ 16 - 15
pages/activityDet/index.wxss

@@ -20,20 +20,27 @@
   display: flex;
   align-items: center;
   z-index: 3;
+  right: 0px;
 }
 .activityDet .header .toBox .text {
   min-width: 80rpx;
   color: white;
   padding: 0rpx 4rpx;
   z-index: 0rpx;
-  border: 2rpx dashed white;
+  border-bottom: 2rpx solid white;
 }
 .activityDet .header .toBox image {
   width: 22rpx;
-  height: 26rpx;
-  margin-left: 8rpx;
+  height: 24rpx;
   z-index: 1;
 }
+.activityDet .header .toBox .editBtn {
+  text-align: center;
+  background-color: white;
+  border-radius: 50%;
+  margin-left: 6rpx;
+  padding: 2rpx 12rpx;
+}
 .activityDet .header .avatar {
   position: absolute;
   display: flex;
@@ -42,14 +49,6 @@
   justify-content: flex-end;
   z-index: 3;
 }
-.activityDet .header .avatar .tips {
-  width: 150rpx;
-  font-size: 24rpx;
-  padding: 4rpx 20rpx;
-  border-radius: 50rpx;
-  color: white;
-  background-color: rgba(0, 0, 0, 0.4);
-}
 .activityDet .header .avatarImg {
   position: absolute;
   display: block;
@@ -109,7 +108,8 @@
   font-weight: bold;
 }
 .activityDet .btnsBox .countDown .countBox {
-  padding: 10rpx;
+  width: 12rpx;
+  padding: 6rpx 10rpx;
   border-radius: 10rpx;
   margin: 0rpx 4rpx;
   color: white;
@@ -139,15 +139,16 @@
 }
 .activityDet .blessing {
   margin-top: 30rpx;
-  font-size: 36rpx;
+  font-size: 32rpx;
 }
 .activityDet .blessing .content {
-  height: 38rpx;
+  height: 66rpx;
   width: 600rpx;
   text-align: center;
-  margin: 20rpx auto 0rpx;
+  margin: 0rpx auto;
 }
 .activityDet .blessing .content:first-child {
+  font-size: 28rpx;
   opacity: 0.7;
 }
 .activityDet .mask {

+ 1 - 1
pages/activityList/index.json

@@ -1,4 +1,4 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText": "贺卡"
+    "navigationBarTitleText": "音乐贺卡制作"
 }

+ 16 - 14
pages/activityList/index.wxml

@@ -1,17 +1,19 @@
 <view class="aDet" style="background-color: {{banner.bgColor}};">
-  <image src="{{banner.icon}}" class="headImg" />
-  <view class="body">
-    <view class="template" style="background-image:url({{item.bgImg}}) ;" wx:for="{{cardActivityList}}" wx:key="id">
-      <image src="{{item.templateList[item.currentIndex].demoImg}}" class="content" />
-      <view class="btns">
-        <image src="http://reader-wx.ai160.com/images/reader/card/change.png" class="changeBtn" data-index='{{index}}'
-          data-item='{{item}}' bindtap="changeTemplate" />
-        <image src="http://reader-wx.ai160.com/images/reader/card/record_blessings2.png" class="recording"
-          data-index='{{index}}' bindtap="toRecording" />
-      </view>
+    <image src="{{banner.icon}}" class="headImg" />
+    <view class="body">
+        <view class="template" style="background-image:url({{item.bgImg}}) ;" wx:for="{{cardActivityList}}" wx:key="id">
+            <image src="{{item.templateList[item.currentIndex].demoImg}}" class="content" data-index='{{index}}'
+                bindtap="toRecording" />
+            <view class="btns">
+                <image src="http://reader-wx.ai160.com/images/reader/card/change.png" class="changeBtn"
+                    data-index='{{index}}' data-item='{{item}}' bindtap="changeTemplate" />
+                <image src="http://reader-wx.ai160.com/images/reader/card/record_blessings2.png" class="recording"
+                    data-index='{{index}}' bindtap="toRecording" />
+            </view>
+        </view>
+    </view>
+    <view class="footerBox">
+        <image src="http://reader-wx.ai160.com/images/reader/card/my_card.png" class="goGreeting"
+            bindtap="jumpMyGreeing" />
     </view>
-  </view>
-  <view class="footerBox">
-    <image src="http://reader-wx.ai160.com/images/reader/card/my_card.png" class="goGreeting" bindtap="jumpMyGreeing" />
-  </view>
 </view>

+ 3 - 4
pages/greeting/index.js

@@ -75,14 +75,12 @@ Page({
         })
         if (this.data.userId) {
             let firstCard = this.data.list.length > 0 ? this.data.list[0] : ''
-            console.log(firstCard);
             list = list.filter(item => {
                 return item.id != firstCard.id
             })
         }
         list = [...this.data.list, ...list]
         let isMy = false
-        console.log(list);
         if (list.length > 0) {
             isMy = list[0].uid == wx.getStorageSync('uid')
         }
@@ -203,7 +201,7 @@ Page({
             })
             resolve({
                 title,
-                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}`,
+                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}&cardId=${cardReadId}`,
                 imageUrl
             })
         })
@@ -212,6 +210,7 @@ Page({
         target,
         from,
     }) {
+        console.log(target.dataset.item);
         if (from == 'button') {
             const promise = new Promise(resolve => {
                 this.createActivityImg(target.dataset.item.cardUrl, target.dataset.item.id).then(res => {
@@ -223,7 +222,7 @@ Page({
             })
             return {
                 title: '',
-                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}`,
+                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}&cardId=${target.dataset.item.id}`,
                 imageUrl: target.dataset.img,
                 promise
             }

+ 1 - 1
pages/greeting/index.json

@@ -1,5 +1,5 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText": "我的贺卡",
+    "navigationBarTitleText": "贺卡",
     "enablePullDownRefresh": false
 }

+ 4 - 5
pages/index/index.js

@@ -257,10 +257,12 @@ Page({
         }, 2800)
     },
     onLoad: function (options) {
+        console.log('onload时间');
         if (wx.getStorageSync('uid')) {
             this.setData({
                 isLogin: true
             })
+            this.showPage()
         }
         //网络原因,还没有拿到登陆数据,这里调用全局的callback
         getApp().callBack = (res) => {
@@ -342,7 +344,6 @@ Page({
         this.setData({
             iphoneType: options.type || ''
         })
-        console.log('onload', options);
 
         if (options.tabbarIndx) {
             this.updateData(options.tabbarIndx);
@@ -403,6 +404,7 @@ Page({
     },
     onShow: function () {
         let grade = wx.getStorageSync('grade');
+        console.log(grade, this.data.myIndex);
         this.setData({
             gradeActivity: grade
         })
@@ -413,9 +415,7 @@ Page({
         wx.setNavigationBarTitle({
             title: '朗读小咖秀'
         })
-        console.log('页面返回页面返回', this.data.fromLoginIndex)
         if (this.data.fromLoginIndex || this.data.fromLoginIndex == 0) {
-            console.log('页面返回页面返回', this.data.fromLoginIndex)
             let index = this.data.fromLoginIndex;
             let userInfo = wx.getStorageSync('user');
             this.setData({
@@ -451,6 +451,7 @@ Page({
     // 推荐页信息 获取消息和手动推荐内容
     // 获取热门作品 算法出来的
     getHotRecommend: function () {
+        console.log('触发了');
         let grade = wx.getStorageSync('grade')
         let pageNo = this.data.recommendPageNo;
         let pageSize = this.data.recommendPageSize;
@@ -593,7 +594,6 @@ Page({
                 })
             }
             if (this.data.myIndex === 0) {
-                console.log('首页加载第二页')
                 this.setData({
                     recommendPageNo: this.data.recommendPageNo + 1
                 }, () => {
@@ -621,7 +621,6 @@ Page({
             })
         }
         if (this.data.myIndex === 0) {
-            console.log('首页加载第二页')
             this.setData({
                 recommendPageNo: this.data.recommendPageNo + 1
             }, () => {

+ 1 - 1
project.private.config.json

@@ -13,7 +13,7 @@
                 {
                     "name": "",
                     "pathName": "pages/greeting/index",
-                    "query": "uid=9db2bedb2b9b47c5b0358bb9bec39145&cardId=1673425305206207",
+                    "query": "uid=9db2bedb2b9b47c5b0358bb9bec39145&cardId=1673601638964582",
                     "launchMode": "default",
                     "scene": null
                 }