bayi 1 年間 前
コミット
af113a1d75
4 ファイル変更26 行追加18 行削除
  1. 1 1
      app.json
  2. 7 2
      components/activityList/index.js
  3. 2 2
      components/activityList/index.wxml
  4. 16 13
      pages/aiAvatar/index.js

+ 1 - 1
app.json

@@ -1,6 +1,5 @@
 {
     "pages": [
-        "pages/aiAvatar/index",
         "pages/index/index",
         "pages/activity/index",
         "pages/message/index",
@@ -25,6 +24,7 @@
         "pages/notice/index",
         "pages/friend/index",
         "pages/invite/index",
+        "pages/aiAvatar/index",
         "pages/searchFriend/index"
     ],
     "tabBar": {

+ 7 - 2
components/activityList/index.js

@@ -27,7 +27,7 @@ Component({
      */
     data: {
         //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,7年包红包8,次数红包,9邀新
-        type: '4',
+        type: '',
         activityList: [],
         isIos: app.globalData.isIOS,
         dsqList: []
@@ -115,7 +115,7 @@ Component({
         activityEvent({
             currentTarget
         }) {
-            //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,9:邀新
+            //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,9:邀新,10ai头像
             let {
                 type,
                 id,
@@ -142,6 +142,11 @@ Component({
                     url: "/pages/invite/index",
                 })
             }
+            if (type == 10) {
+                wx.navigateTo({
+                    url: "/pages/aiAvatar/index",
+                })
+            }
         },
         drawVoucher({
             currentTarget

+ 2 - 2
components/activityList/index.wxml

@@ -2,11 +2,11 @@
 <view class="activityList">
     <block wx:for="{{activityList}}" wx:key="id">
         <!-- 邀新活动 -->
-        <view class="newActivityBox" data-info="{{item}}" bindtap="activityEvent" wx:if="{{item.type==9}}">
+        <view class="newActivityBox" data-info="{{item}}" bindtap="activityEvent" wx:if="{{item.bannerType==6}}">
             <image src="{{item.icon}}" class="cover" />
             <view class="footer">
                 <view class="row">
-                    <view class="title">邀新奖励</view>
+                    <view class="title">{{item.title}}</view>
                     <view class="btn">
                         立即参与
                     </view>

+ 16 - 13
pages/aiAvatar/index.js

@@ -21,6 +21,9 @@ Page({
                 active: res.loras[0] ? res.loras[0].lora_id : ''
             })
         })
+        userEvent({
+            action: 'AI_LOGIN'
+        })
     },
     async selectTemplate({
         currentTarget
@@ -34,10 +37,10 @@ Page({
         if (this.data.original) {
             this.createAiImg()
         }
-        /*   await userEvent({
-              action: "style",
-              id: currentTarget.dataset.name
-          }) */
+        await userEvent({
+            action: "AI_STYLE",
+            targetContent: currentTarget.dataset.name
+        })
     },
     uploadImg() {
         if (this.data.loading) {
@@ -65,9 +68,9 @@ Page({
                                     original: base64Str
                                 })
                                 this.createAiImg()
-                                /* userEvent({
-                                    action: "photo"
-                                }) */
+                                userEvent({
+                                    action: "AI_PHOTO"
+                                })
                             },
                             fail: err => {
                                 console.log(err)
@@ -167,16 +170,16 @@ Page({
                     confirmText: '我知道了',
                     showCancel: false,
                 })
-                /*   await userEvent({
-                      action: 'save'
-                  }) */
+                await userEvent({
+                    action: 'AI_SAVE'
+                })
             }
         })
     },
     onShareAppMessage() {
-        /* userEvent({
-            action: 'share'
-        }) */
+        userEvent({
+            action: 'AI_SHARE'
+        })
         return {
             title: '玩转AI头像',
             path: '/pages/index/index',