admin
2020-12-25 aead169b4c9ecba0c630a1edd686c22375302d61
'消息完善'
13个文件已修改
282 ■■■■ 已修改文件
.tea/entryFiles-development/index$.web.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.tea/entryFiles-development/index$.worker.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/activity-detail/activity-detail.axml 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/activity-detail/activity-detail.js 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/goods/goods.axml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/goods/goods.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/msg-record/msg-record.axml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/msg-record/msg-record.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/msg-record/msg-record.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rewards/rewards.axml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rewards/rewards.js 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
util/api.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.tea/entryFiles-development/index$.web.js
@@ -30,7 +30,7 @@
require('../../pages/activity-detail/activity-detail?hash=3ff7dd30a3ea0de70909d48b0b8ce5bda62ef62e');
require('../../pages/assist-process/assist-process?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
require('../../pages/lucky-coupon/lucky-coupon?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
require('../../pages/msg-record/msg-record?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d');
require('../../pages/msg-record/msg-record?hash=428ae1fc7930c1018c56f69f43d3453112ebabbd');
require('../../pages/assist-friends/assist-friends?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d');
require('../../pages/msg-setting/msg-setting?hash=5f504890acbcf3bad0486fc198ac7448dd406718');
require('../../pages/lucky-record/lucky-record?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
.tea/entryFiles-development/index$.worker.js
@@ -61,7 +61,7 @@
require('../../pages/activity-detail/activity-detail?hash=3ff7dd30a3ea0de70909d48b0b8ce5bda62ef62e');
require('../../pages/assist-process/assist-process?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
require('../../pages/lucky-coupon/lucky-coupon?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
require('../../pages/msg-record/msg-record?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d');
require('../../pages/msg-record/msg-record?hash=428ae1fc7930c1018c56f69f43d3453112ebabbd');
require('../../pages/assist-friends/assist-friends?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d');
require('../../pages/msg-setting/msg-setting?hash=5f504890acbcf3bad0486fc198ac7448dd406718');
require('../../pages/lucky-record/lucky-record?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567');
app.js
@@ -1,6 +1,7 @@
var help = require('/util/help.js');
var api = require('./util/api.js');
const user = require('./util/user.js');
var $this;
App({
  themeColor: "#0080FF",
  appKey: '1000001',
@@ -8,16 +9,17 @@
  logined: false,
  baseUrl: 'http://192.168.3.122:8083',
  onLaunch(options) {
    $this = this;
    // 第一次打开
    // options.query == {number:1}
    console.info('App onLaunch');
    my.hideFavoriteMenu();
    api.getConfig({
      success: function (res) {
        if (res.code == 0) {
          $this.shareInfo = res.data.shareInfo;
          //保存参数
          help.cacheConfig(res.data);
        }
@@ -28,7 +30,8 @@
  //全局分享函数
  onShareAppMessage(obj) {
    return $this.shareInfo;
  },
  onShow(options) {
pages/activity-detail/activity-detail.axml
@@ -86,7 +86,7 @@
          </view>
        </view>
        <view style="display:flex;  justify-content: space-between;margin:60rpx 0 40rpx 0;">
          <button type="ghost" open-type="{{!logined?'getAuthorize':'share'}}" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' hover-class="btn-ghost-hover" onTap="onAssistClick" style="width:238rpx;">
          <button type="ghost" open-type="{{!logined?'getAuthorize':'share'}}" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' hover-class="btn-ghost-hover"  style="width:238rpx;">
    好友助力
          </button>
          <button a:if="{{!logined}}" open-type="getAuthorize" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' type="primary" class="btn-primary" hover-class="btn-primary-hover" style="width:392rpx;">
@@ -221,4 +221,46 @@
      </view>
    </view>
  </modal>
   <modal show="{{showDrawnModal}}" zIndex="100" onModalClose="onCloseDialog1" class="dialog" advice="{{true}}">
    <view >
      <image class="title" mode="scaleToFill" src="/image/reward_dialog_title.png"/>
      <view class="content">
        <view style="font-size:24rpx;">
        {{award.title}}
        </view>
        <image class="icon" src="/image/reward_dialog_icon.png"/>
        <view style="font-size:30rpx;margin-top:10rpx;">
        {{award.award.title}}
        </view>
        <view class="btn" onTap="onRecieveAward">
                领
        </view>
        <view style="font-size:18rpx;margin-top:32rpx;">
                 {{award.desc}}
        </view>
      </view>
    </view>
  </modal>
  <modal show="{{showOutDateModal}}" zIndex="100" onModalClose="onCloseDialog2" class="dialog-outdate" advice="{{true}}">
    <view >
      <image class="title" mode="scaleToFill" src="/image/reward_outdate_dialog_title.png"/>
      <view class="content">
        <view style="font-size:24rpx;">
         {{award.title}}
        </view>
        <image class="icon" src="/image/reward_outdate_dialog_icon.png"/>
        <view class="reward">
          <image mode="scaleToFill" src="{{award.award.typeIcon}}"/>
          <text number-of-lines="2"> {{award.award.title}}</text>
        </view>
        <view class="btn" onTap="onOutDateDetailClick">
                查看详情
        </view>
        <view style="font-size:18rpx;margin-top:40rpx;line-height:28rpx;">
              {{award.desc}}
        </view>
      </view>
    </view>
  </modal>
</view>
pages/activity-detail/activity-detail.js
@@ -12,6 +12,7 @@
      mm: "00",
      ss: "00"
    },
    leftTimeMS: 0,
    checkFollow: false,
    showFollow: false,
@@ -28,6 +29,12 @@
    //参与条件查看更多
    joinShowMore: true,
    //中奖弹框
    showDrawnModal:false,
    //过期未领弹框
    showOutDateModal:false,
    //开奖条件查看更多
    openShowMore: true,
    //奖品列表最大数量
@@ -39,10 +46,16 @@
    drawnAnouncementDesc: [],
  },
  onShareAppMessage() {
  onShareAppMessage(obj) {
    console.log('onShareAppMessage');
    var shareData = $this.data.activity.shareInfo;
    return shareData;
    if (obj.from == 'menu') {//菜单分享
      var shareData = $this.data.activity.shareInfo;
      return shareData;
    } else {//助力
      var shareData = $this.data.activity.assistShareInfo;
      return shareData;
    }
  },
  onLoad(query) {
    $this = this;
@@ -50,13 +63,21 @@
    help.setPageNavBar("抽奖详情");
    $this.setData({
      joinInfo: query.joinInfo,
      logined:getApp().logined
      logined: getApp().logined
    });
    $this.refreshDetailInfo(query.id);
  },
  refreshDetailInfo(id) {
    if (id == null) {
      id = $this.data.activity.activity.id;
    }
    api.getActivityDetail({
      showErrorToast: true,
      showLoading: true,
      id: query.id,
      id: id,
      success: function (res) {
        if (res.code != 0) {
          return;
@@ -101,6 +122,11 @@
          });
        }
        //首次请求需要获取中奖结果
        if (!$this.data.activity) {
          $this.requestRecieveAwardNotify(id);
        }
        $this.setData({
          activity: data
@@ -168,6 +194,7 @@
        my.showToast({
          content: '登录成功'
        })
        $this.refreshDetailInfo(null);
      }, fail(e) {
        my.showToast({
          content: '登录失败'
@@ -181,8 +208,6 @@
      content: '授权失败'
    });
  },
  closeMianZeModal() {
    this.setData({
      showMianZeModal: false
@@ -408,6 +433,7 @@
            activity: activity
          });
          $this.refreshDetailInfo(null);
        }
      }
    })
@@ -432,7 +458,57 @@
      },
    });
  }
  },
  //获取奖项通知
  requestRecieveAwardNotify() {
    api.getRecieveAwardNotify({
      success: function (res) {
        if (res.code == 0) {
          if (res.data.type == 1)//领奖
          {
            $this.setData({
              award: res.data,
              showDrawnModal: true
            });
          } else if (res.data.type == 2)//过期
          {
            $this.setData({
              award: res.data,
              showOutDateModal: true
            });
          }
        }
      }
    });
  },
  //领奖
  onRecieveAward() {
    api.recieveAward({
      showLoading: true,
      showErrorToast: true,
      activityId: $this.data.award.activityId,
      success: function (res) {
        if (res.code == 0) {
          my.showToast({
            content: res.msg
          });
        } else {
          my.showToast({
            content: res.msg
          });
        }
      }
    });
  },
  onOutDateDetailClick() {
    api.setDrawnNotifyRead({
      id: $this.data.award.id,
      success: function (res) {
      }
    });
  },
pages/goods/goods.axml
@@ -1,4 +1,4 @@
<view class="page">
  <!-- <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.choiceness/bc.template.choiceness" name="block-choiceness" onError="bcError" ext="{{pluginOptions: {pageSize:20,relationId:'123123'}}}" /> -->
  <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.etaoMarketing/bc.template.rebate.search" name="block-etao-searchbox" onError="bcError" />
  <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.materiel/bc.template.materiel" name="block-materiel" onError="bcError"  ext="{{ pluginOptions: pluginOptions, loadMoreTime }}"/>
</view>
pages/goods/goods.js
@@ -1,12 +1,16 @@
import { loadBC } from 'miniapp-bc-user'
Page({
  data: {},
  data: {
    pluginOptions: {
      relationId: '513796574' // 如果插件有 pluginOptions
    }
  },
  onLoad() { },
  async onReady() {
    try {
      await loadBC();
      this.setData({ showComponent: true })
    } catch (e) {
    } catch (e) {
      console.log(e);
    }
  },
@@ -17,6 +21,7 @@
  // 每日精选插件
  // 监听页面滚动到底部,加载更多
  onReachBottom() {
    console.log("到达底部");
    this.setData({
      loadMoreTime: (this.data.loadMoreTime || 0) + 1
    })
pages/msg-record/msg-record.axml
@@ -19,7 +19,7 @@
          <view class="title">
          {{content.title}}
          </view>
          <rich-text class="content" nodes=" {{item.content}}" onTap="tap"></rich-text>
          <rich-text class="content" nodes=" {{content.content}}" onTap="tap"></rich-text>
        </flex>
      </view>
    </view>
pages/msg-record/msg-record.js
@@ -16,6 +16,7 @@
  onLoad() {
    help.setPageNavBar("消息记录");
    $this = this;
     this.requestUserMsgList(1, true);
  },
  onPullDownRefresh() {
    console.log('onPullDownRefresh', new Date());
@@ -33,9 +34,9 @@
  convertToRichText(list, callback) {
    for (var i = 0; i < list.length; i++) {
      for (var j = 0; j < list[i].contentList.length; j++) {
        help.loadRichTextNode(list[i].contentList[j].content, function (res) {
        help.loadRichTextNode(list[i].contentList[j].content.replace('#theme',getApp().themeColor), function (res) {
          list[i].contentList[j].content = res;
          if (i == list.length - 1 && j == list[i].contentList.length) {
          if (i == list.length - 1 && j == list[i].contentList.length-1) {
            callback(list);
          }
        });
@@ -83,8 +84,10 @@
        console.log(res)
        if (res.code == 0) {
          var list = res.data.data;
          console.log("数据:"+ list.length);
          //数据预处理
          $this.convertToRichText(list, function (list) {
            console.log("富文本转换完成")
            //设置列表数据
            if (list != null && list.length > 0) {
              var totalList = $this.data.list.concat(list);
pages/msg-record/msg-record.json
@@ -1,6 +1,7 @@
{
  "usingComponents": {
    "flex": "mini-ali-ui/es/flex/index",
    "flex-item": "mini-ali-ui/es/flex/flex-item/index"
    "flex-item": "mini-ali-ui/es/flex/flex-item/index",
    "footer": "mini-ali-ui/es/footer/index"
  }
}
pages/rewards/rewards.axml
@@ -16,17 +16,17 @@
      <image class="title" mode="scaleToFill" src="/image/reward_dialog_title.png"/>
      <view class="content">
        <view style="font-size:24rpx;">
        活动期号:NO.12378947
        {{award.title}}
        </view>
        <image class="icon" src="/image/reward_dialog_icon.png"/>
        <view style="font-size:30rpx;margin-top:10rpx;">
        大额现金红包100
        {{award.award.title}}
        </view>
        <view class="btn" onTap="onRecieveAward">
                领
        </view>
        <view style="font-size:18rpx;margin-top:32rpx;">
                未领取,可在"我的-全部抽奖"中查看
                 {{award.desc}}
        </view>
      </view>
    </view>
@@ -36,18 +36,18 @@
      <image class="title" mode="scaleToFill" src="/image/reward_outdate_dialog_title.png"/>
      <view class="content">
        <view style="font-size:24rpx;">
        活动期号:NO.12378947
         {{award.title}}
        </view>
        <image class="icon" src="/image/reward_outdate_dialog_icon.png"/>
        <view class="reward">
          <image mode="scaleToFill" src="/image/portrait-test.jpg"/>
          <text number-of-lines="2">大额现金红包大额现金红包大额现红包10000</text>
          <image mode="scaleToFill" src="{{award.award.typeIcon}}"/>
          <text number-of-lines="2"> {{award.award.title}}</text>
        </view>
        <view class="btn" onTap="onDetail">
        <view class="btn" onTap="onOutDateDetailClick">
                查看详情
        </view>
        <view style="font-size:18rpx;margin-top:40rpx;line-height:28rpx;">
               注:中奖日起7天内未领取奖品,将会把对应奖品原路退回赞助商,切记中奖后按时领取奖品。
              {{award.desc}}
        </view>
      </view>
    </view>
pages/rewards/rewards.js
@@ -28,7 +28,13 @@
    $this = this;
    $this.requestNotice();
    $this.requestActivity(1, true);
    //延时请求
    setTimeout(() => {
      $this.requestRecieveAwardNotify();
    }, 1000);
  },
  //请求活动
  requestActivity(page, first) {
    $this.setData({
@@ -95,13 +101,65 @@
          $this.setData({
            notice: res.data,
            showNotice: true,
            noticeMode: res.data.link?'link':'closable'
            noticeMode: res.data.link ? 'link' : 'closable'
          })
        }
      }
    });
  },
  //获取奖项通知
  requestRecieveAwardNotify() {
    api.getRecieveAwardNotify({
      success: function (res) {
        if (res.code == 0) {
          if (res.data.type == 1)//领奖
          {
            $this.setData({
              award: res.data,
              showDrawnModal: true
            });
          } else if (res.data.type == 2)//过期
          {
            $this.setData({
              award: res.data,
              showOutDateModal: true
            });
          }
        }
      }
    });
  },
  //领奖
  onRecieveAward() {
    api.recieveAward({
      showLoading: true,
      showErrorToast: true,
      activityId: $this.data.award.activityId,
      success: function (res) {
        if (res.code == 0) {
          my.showToast({
            content: res.msg
          });
        } else {
          my.showToast({
            content: res.msg
          });
        }
      }
    });
  },
  onOutDateDetailClick() {
    api.setDrawnNotifyRead({
      id: $this.data.award.id,
      success: function (res) {
      }
    });
  },
  //下拉刷新
  onPullDownRefresh() {
    this.requestActivity(1, false);
@@ -150,12 +208,10 @@
      showOutDateModal: false
    });
  },
  onRecieveAward() {
    my.showToast({
      content: "领奖"
    });
  },
  onNoticeClick() {
    if (this.data.noticeMode == 'closable') {
util/api.js
@@ -53,6 +53,32 @@
  getRecommendActivity(obj) {
    this.commonRequest("/api/client/activity/getRecommendActivity", obj);
  },
  /**
   * 获取未显示的领奖通知
   * @param {*} obj
   */
  getRecieveAwardNotify(obj) {
    if (obj.activityId) {
      obj.data = { activityId: obj.activityId };
    }
    this.commonRequest("/api/client/activity/awards/getRecieveAwardNotify", obj);
  },
  setDrawnNotifyRead(obj) {
    obj.id = { id: obj.id };
    this.commonRequest("/api/client/activity/awards/setDrawnNotifyRead", obj);
  },
  /**
   * 领取奖励
   * @param {*} obj
   */
  recieveAward(obj) {
    this.commonRequest("/api/client/activity/awards/recieveAward", obj);
  },
  /**
   * 获取活动详情
   * @param {*} obj