// 1 éve
szülő
commit
f0e9a87f93

+ 0 - 6
pages/activityDet/index.js

@@ -18,8 +18,6 @@ Page({
         state: 'before',
         tens: 3,
         bits: 0,
-        fromWidth: 100,
-        toWidth: 100,
         configure: {},
         avatar: '',
         // 本地录音地址
@@ -45,8 +43,6 @@ Page({
         this.setData({
             configure,
             avatar: configure.photoText,
-            fromWidth: configure.fromText.length * configure.fromFontSize,
-            toWidth: configure.toText.length * configure.toFontSize,
             id: options.id,
             greeting: configure.greeting.split('\n'),
             tens: configure.bgMusicLength[0],
@@ -235,12 +231,10 @@ Page({
     bindKeyInput(e) {
         if (e.currentTarget.dataset.type == 'from') {
             this.setData({
-                fromWidth: e.detail.value.length * this.data.configure.fromFontSize,
                 'configure.fromText': e.detail.value
             })
         } else if (e.currentTarget.dataset.type == 'to') {
             this.setData({
-                toWidth: e.detail.value.length * this.data.configure.toFontSize,
                 'configure.toText': e.detail.value
             })
         }

+ 0 - 1
pages/activityDet/index.less

@@ -21,7 +21,6 @@
             display: flex;
             align-items: center;
             z-index: 3;
-            right: 0px;
 
             .text {
                 min-width: 80rpx;

+ 4 - 5
pages/activityDet/index.wxml

@@ -2,18 +2,17 @@
     <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;justify-content: {{configure.fromTextAlign}};">
+            style="top:{{configure.templateBase.fromTop}}rpx;left: {{configure.templateBase.fromLeft}}rpx;">
             <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;"
+                style="color:{{configure.fromColor}};font-size: {{configure.fromFontSize}}rpx;border-color: {{state=='before'?configure.fromColor+'60':'transparent'}};width: {{configure.templateBase.fromWidth}}rpx; text-align: {{configure.fromTextAlign}};"
                 bindinput="bindKeyInput" data-type='from' />
             <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;justify-content: {{configure.toTextAlign}};">
+        <view class="toBox" style="top:{{configure.templateBase.toTop}}rpx;left: {{configure.templateBase.toLeft}}rpx;">
             <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;"
+                style="color:{{configure.toColor}};font-size: {{configure.toFontSize}}rpx;border-color: {{state=='before'?configure.toColor+'60':'transparent'}};width: {{configure.templateBase.toWidth}}rpx;text-align:{{configure.toTextAlign}};"
                 bindinput="bindKeyInput" data-type='to' />
             <view class="editBtn">
                 <image src="/static/image/edit_new.png" wx:if="{{state!='process'}}" />

+ 0 - 1
pages/activityDet/index.wxss

@@ -20,7 +20,6 @@
   display: flex;
   align-items: center;
   z-index: 3;
-  right: 0px;
 }
 .activityDet .header .toBox .text {
   min-width: 80rpx;

+ 13 - 8
pages/greeting/index.js

@@ -170,7 +170,7 @@ Page({
         await actionRecord({
             action: 'NEW_YEAR_ACTIVITY_PLAY_TOO',
         })
-        wx.navigateTo({
+        wx.redirectTo({
             url: '/pages/activityList/index',
         })
     }, // 设置时间文案
@@ -194,15 +194,20 @@ Page({
             [label]: t,
         })
     },
-    createActivityImg(imageUrl, cardReadId) {
+    jumpIndex() {
+        wx.redirectTo({
+            url: '/pages/index/index',
+        })
+    },
+    createActivityImg(shareInfo) {
         return new Promise(async (resolve, reject) => {
             let title = await getShareText({
-                cardReadId
+                cardReadId: shareInfo.id
             })
             resolve({
                 title,
-                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}&cardId=${cardReadId}`,
-                imageUrl
+                path: `/pages/greeting/index?uid=${shareInfo.uid}&cardId=${shareInfo.id}`,
+                imageUrl: shareInfo.cardUrl
             })
         })
     },
@@ -210,10 +215,10 @@ Page({
         target,
         from,
     }) {
-        console.log(target.dataset.item);
+        let shareInfo = target.dataset.item
         if (from == 'button') {
             const promise = new Promise(resolve => {
-                this.createActivityImg(target.dataset.item.cardUrl, target.dataset.item.id).then(res => {
+                this.createActivityImg(shareInfo).then(res => {
                     resolve(res)
                 })
             })
@@ -222,7 +227,7 @@ Page({
             })
             return {
                 title: '',
-                path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}&cardId=${target.dataset.item.id}`,
+                path: `/pages/greeting/index?uid=${shareInfo.uid}&cardId=${shareInfo.id}`,
                 imageUrl: target.dataset.img,
                 promise
             }

+ 123 - 108
pages/greeting/index.less

@@ -1,123 +1,138 @@
 .greetingBox {
-  width: 100vw;
-  min-height: 100vh;
-  padding: 26rpx 20rpx;
-  background-color: #fcd9927c;
-  box-sizing: border-box;
-
-  .template {
-    width: 100%;
-    padding: 20rpx 31rpx;
-    margin-bottom: 40rpx;
+    width: 100vw;
+    min-height: 100vh;
+    padding: 26rpx 20rpx;
+    background-color: #fcd9927c;
     box-sizing: border-box;
-    background-color: white;
-    border-radius: 20rpx;
-    box-shadow: 0 2rpx 24rpx 0 rgba(252, 216, 146, 0.51);
-
-    .header {
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-
-      .left {
-        .title {
-          font-size: 34rpx;
-          font-weight: bold;
-        }
 
-        .time {
-          font-size: 24rpx;
-          color: #666;
+    .template {
+        width: 100%;
+        padding: 20rpx 31rpx;
+        margin-bottom: 40rpx;
+        box-sizing: border-box;
+        background-color: white;
+        border-radius: 20rpx;
+        box-shadow: 0 2rpx 24rpx 0 rgba(252, 216, 146, 0.51);
+
+        .header {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .left {
+                .title {
+                    font-size: 34rpx;
+                    font-weight: bold;
+                }
+
+                .time {
+                    font-size: 24rpx;
+                    color: #666;
+                }
+            }
+
+            .right {
+                text-align: center;
+
+                .delete {
+                    width: 24rpx;
+                    height: 32rpx;
+                }
+
+                .text {
+                    font-size: 24rpx;
+                }
+            }
         }
-      }
-
-      .right {
-        text-align: center;
 
-        .delete {
-          width: 24rpx;
-          height: 32rpx;
+        .body {
+            position: relative;
+            margin: 24rpx 0rpx;
+            width: 650rpx;
+            height: 520rpx;
+            background-size: 100% 100%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            background-color: #D8D8D8;
+
+            .playBtn {
+                width: 84rpx;
+                height: 84rpx;
+            }
+
+            .progressBox {
+                position: absolute;
+                bottom: 0px;
+                left: 0px;
+                padding: 12rpx 40rpx;
+                box-sizing: border-box;
+                width: 100%;
+                background-color: rgba(0, 0, 0, 0.5);
+                z-index: 2;
+                display: flex;
+                align-items: center;
+                color: white;
+                font-size: 24rpx;
+
+                .progress {
+                    flex: 1;
+                    margin: 0px 30rpx;
+                    border-radius: 25rpx;
+                    overflow: hidden;
+                }
+            }
         }
 
-        .text {
-          font-size: 24rpx;
+        .footer {
+            .countBox {
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+
+                .box {
+                    display: flex;
+                    align-items: center;
+
+                    .icon {
+                        width: 34rpx;
+                        height: 34rpx;
+                    }
+
+                    .num {
+                        margin-left: 4rpx;
+                        font-size: 28rpx;
+                        color: #666;
+                    }
+                }
+            }
+
+            .handle {
+                display: flex;
+                justify-content: space-between;
+                justify-content: center;
+                margin-top: 28rpx;
+
+                .btn {
+                    width: 294rpx;
+                    height: 86rpx;
+                }
+            }
         }
-      }
     }
 
-    .body {
-      position: relative;
-      margin: 24rpx 0rpx;
-      width: 650rpx;
-      height: 520rpx;
-      background-size: 100% 100%;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      background-color: #D8D8D8;
-
-      .playBtn {
-        width: 84rpx;
-        height: 84rpx;
-      }
-
-      .progressBox {
-        position: absolute;
-        bottom: 0px;
-        left: 0px;
-        padding: 12rpx 40rpx;
-        box-sizing: border-box;
+    .footerBox {
         width: 100%;
-        background-color: rgba(0, 0, 0, 0.5);
-        z-index: 2;
-        display: flex;
-        align-items: center;
-        color: white;
-        font-size: 24rpx;
-
-        .progress {
-          flex: 1;
-          margin: 0px 30rpx;
-          border-radius: 25rpx;
-          overflow: hidden;
-        }
-      }
-    }
-
-    .footer {
-      .countBox {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-
-        .box {
-          display: flex;
-          align-items: center;
-
-          .icon {
-            width: 34rpx;
-            height: 34rpx;
-          }
-
-          .num {
-            margin-left: 4rpx;
-            font-size: 28rpx;
-            color: #666;
-          }
-        }
-      }
-
-      .handle {
-        display: flex;
-        justify-content: space-between;
-        justify-content: center;
-        margin-top: 28rpx;
+        position: fixed;
+        left: 0px;
+        bottom: 0px;
+        padding: 20rpx 0rpx;
+        text-align: center;
+        background-color: white;
 
-        .btn {
-          width: 294rpx;
-          height: 86rpx;
+        image {
+            width: 535rpx;
+            height: 88rpx;
         }
-      }
     }
-  }
 }

+ 3 - 0
pages/greeting/index.wxml

@@ -43,4 +43,7 @@
       </view>
     </view>
   </view>
+  <view class="footerBox" wx:if="{{!isMy}}">
+      <image src="http://reader-wx.ai160.com/images/reader/card/callback.png" bindtap="jumpIndex"/>
+  </view>
 </view>

+ 13 - 0
pages/greeting/index.wxss

@@ -100,3 +100,16 @@
   width: 294rpx;
   height: 86rpx;
 }
+.greetingBox .footerBox {
+  width: 100%;
+  position: fixed;
+  left: 0px;
+  bottom: 0px;
+  padding: 20rpx 0rpx;
+  text-align: center;
+  background-color: white;
+}
+.greetingBox .footerBox image {
+  width: 535rpx;
+  height: 88rpx;
+}