xiaoe_mp_npm 1.1.21 → 1.1.22-test02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +10 -10
- package/.eslintrc.js +102 -102
- package/.gitlab-ci.yml +44 -44
- package/.prettierrc.js +34 -34
- package/.vscode/extensions.json +4 -4
- package/.vscode/settings.json +9 -9
- package/LICENSE +21 -21
- package/README.md +134 -134
- package/gulpfile.js +26 -26
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.js +181 -181
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +25 -25
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.js +253 -253
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.less +255 -255
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.wxml +122 -122
- package/miniprogram_dist/CollectionAddress/index.js +288 -288
- package/miniprogram_dist/CollectionAddress/index.json +13 -13
- package/miniprogram_dist/CollectionAddress/index.less +4 -4
- package/miniprogram_dist/CollectionAddress/index.wxml +93 -93
- package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.json +10 -10
- package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.less +123 -123
- package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.wxml +51 -51
- package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.js +168 -168
- package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.json +7 -7
- package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.less +95 -95
- package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.wxml +36 -36
- package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.js +160 -160
- package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.json +4 -4
- package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.less +79 -79
- package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.wxml +33 -33
- package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.js +115 -115
- package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.json +5 -5
- package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.less +20 -20
- package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.wxml +9 -9
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.js +1819 -1819
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.json +27 -27
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.scss +44 -44
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.wxml +225 -225
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.js +129 -129
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.json +8 -8
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.scss +58 -58
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxml +25 -25
- package/miniprogram_dist/GoodsItem/index.js +180 -21
- package/miniprogram_dist/GoodsItem/index.scss +822 -627
- package/miniprogram_dist/GoodsItem/index.wxml +145 -108
- package/miniprogram_dist/GoodsItem/index.wxs +40 -40
- package/miniprogram_dist/GoodsItem/index.wxss +1149 -461
- package/miniprogram_dist/LiveGoodsList/Header/index.js +65 -65
- package/miniprogram_dist/LiveGoodsList/Header/index.json +6 -6
- package/miniprogram_dist/LiveGoodsList/Header/index.less +45 -45
- package/miniprogram_dist/LiveGoodsList/Header/index.scss +157 -137
- package/miniprogram_dist/LiveGoodsList/Header/index.wxml +39 -36
- package/miniprogram_dist/LiveGoodsList/Header/index.wxss +88 -12
- package/miniprogram_dist/LiveGoodsList/README.md +9 -9
- package/miniprogram_dist/LiveGoodsList/index.js +29 -10
- package/miniprogram_dist/LiveGoodsList/index.less +53 -53
- package/miniprogram_dist/LiveGoodsList/index.scss +173 -173
- package/miniprogram_dist/LiveGoodsList/index.wxml +9 -1
- package/miniprogram_dist/MatchList/index.js +445 -441
- package/miniprogram_dist/MatchList/index.json +5 -5
- package/miniprogram_dist/MatchList/index.scss +175 -175
- package/miniprogram_dist/MatchList/index.wxml +98 -97
- package/miniprogram_dist/MemberIntegralMultiplierBar/index.js +196 -196
- package/miniprogram_dist/MemberIntegralMultiplierBar/index.json +7 -7
- package/miniprogram_dist/MemberIntegralMultiplierBar/index.scss +67 -67
- package/miniprogram_dist/MemberIntegralMultiplierBar/index.wxml +8 -8
- package/miniprogram_dist/MemberIntegralMultiplierPopup/index.js +54 -54
- package/miniprogram_dist/MemberIntegralMultiplierPopup/index.json +7 -7
- package/miniprogram_dist/MemberIntegralMultiplierPopup/index.scss +86 -86
- package/miniprogram_dist/MemberIntegralMultiplierPopup/index.wxml +48 -48
- package/miniprogram_dist/MemberIntegralMultiplierPopup/popup-service.js +18 -18
- package/miniprogram_dist/MsgBubble/index.js +312 -0
- package/miniprogram_dist/MsgBubble/index.json +7 -0
- package/miniprogram_dist/MsgBubble/index.scss +81 -0
- package/miniprogram_dist/MsgBubble/index.wxml +19 -0
- package/miniprogram_dist/MsgBubble/index.wxss +202 -0
- package/miniprogram_dist/ShoppingCartBubble/index.js +336 -156
- package/miniprogram_dist/ShoppingCartBubble/index.scss +94 -55
- package/miniprogram_dist/ShoppingCartBubble/index.wxml +14 -11
- package/miniprogram_dist/ShoppingCartBubble/index.wxss +196 -40
- package/miniprogram_dist/Task/TaskBubble/index.json +3 -3
- package/miniprogram_dist/Task/TaskBubble/index.scss +125 -125
- package/miniprogram_dist/Task/TaskBubble/index.wxml +22 -22
- package/miniprogram_dist/Task/TaskIcon/index.js +29 -29
- package/miniprogram_dist/Task/TaskIcon/index.json +4 -4
- package/miniprogram_dist/Task/TaskIcon/index.scss +70 -70
- package/miniprogram_dist/Task/TaskIcon/index.wxml +5 -5
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.js +52 -52
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.json +6 -6
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.scss +39 -39
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxml +23 -23
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +578 -578
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.json +10 -10
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +245 -245
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +145 -145
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxs +7 -7
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +298 -298
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.json +7 -7
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +66 -66
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +41 -41
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.js +129 -129
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.json +13 -13
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.scss +90 -90
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.wxml +69 -69
- package/miniprogram_dist/Task/TaskPopup/index.js +174 -174
- package/miniprogram_dist/Task/TaskPopup/index.json +7 -7
- package/miniprogram_dist/Task/TaskPopup/index.scss +166 -166
- package/miniprogram_dist/Task/TaskPopup/index.wxml +87 -87
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.js +131 -131
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.json +5 -5
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.scss +191 -191
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxml +64 -64
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxs +78 -78
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.js +40 -40
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.json +5 -5
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.scss +6 -6
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxml +1 -1
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -50
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -623
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -183
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -216
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -3563
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -2364
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -209
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -269
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -1276
- package/miniprogram_dist/Task/TaskQuizPopup/index.js +246 -246
- package/miniprogram_dist/Task/TaskQuizPopup/index.json +7 -7
- package/miniprogram_dist/Task/TaskQuizPopup/index.scss +158 -158
- package/miniprogram_dist/Task/TaskQuizPopup/index.wxml +99 -99
- package/miniprogram_dist/Task/common/task.js +55 -55
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.js +74 -74
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.json +5 -5
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.scss +107 -107
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxml +27 -27
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.js +68 -68
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.json +6 -6
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.scss +123 -123
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxml +81 -81
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxs +48 -48
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.js +44 -44
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.json +6 -6
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.scss +106 -106
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.wxml +38 -38
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.wxs +48 -48
- package/miniprogram_dist/Task/taskReceivePopup/index.js +47 -47
- package/miniprogram_dist/Task/taskReceivePopup/index.json +13 -13
- package/miniprogram_dist/Task/taskReceivePopup/index.wxml +32 -32
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.js +106 -106
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.json +7 -7
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.scss +60 -60
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.wxml +23 -23
- package/miniprogram_dist/TeacherGoodsList/index.js +997 -983
- package/miniprogram_dist/TeacherGoodsList/index.json +10 -10
- package/miniprogram_dist/TeacherGoodsList/index.scss +178 -178
- package/miniprogram_dist/TeacherGoodsList/index.wxml +146 -144
- package/miniprogram_dist/common/api/liveGoodsList.js +181 -167
- package/miniprogram_dist/common/assets/images/coupon/emptypage.svg +49 -49
- package/miniprogram_dist/common/assets/images/coupon/failed.svg +5 -5
- package/miniprogram_dist/common/assets/images/coupon/up.svg +21 -21
- package/miniprogram_dist/common/assets/images/pay/loading.svg +3 -3
- package/miniprogram_dist/common/assets/images/recommend.svg +6 -6
- package/miniprogram_dist/common/assets/images/refresh.svg +10 -10
- package/miniprogram_dist/common/assets/images/refresh_white.svg +3 -3
- package/miniprogram_dist/common/assets/images/wechat.svg +4 -4
- package/miniprogram_dist/common/css/index.less +2 -2
- package/miniprogram_dist/common/css/theme.less +19 -19
- package/miniprogram_dist/common/libs/dataUp/sensorUp.js +91 -91
- package/miniprogram_dist/common/libs/playerHttp.js +58 -58
- package/miniprogram_dist/common/libs/playerRequestUrl.js +39 -39
- package/miniprogram_dist/common/transaction/parameter/channel-info.js +36 -36
- package/miniprogram_dist/common/transaction/parameter/delivery-info.js +26 -26
- package/miniprogram_dist/common/transaction/parameter/misc-parameter.js +21 -21
- package/miniprogram_dist/common/utils/currency.js +52 -52
- package/miniprogram_dist/common/utils/getInfoCollectionData.js +59 -59
- package/miniprogram_dist/common/utils/image-cdn-slim/constant.js +8 -8
- package/miniprogram_dist/common/utils/image-cdn-slim/index.js +7 -7
- package/miniprogram_dist/common/utils/image-cdn-slim/utils.js +156 -156
- package/miniprogram_dist/common/utils/index.js +86 -86
- package/miniprogram_dist/common/utils/liveGoods.js +217 -217
- package/miniprogram_dist/common/utils/specialList.js +5 -5
- package/miniprogram_dist/common/utils/tool.js +72 -72
- package/miniprogram_dist/common/wxs/filter.wxs +29 -29
- package/miniprogram_dist/index.js +6 -6
- package/miniprogram_dist/index.js.map +1 -1
- package/miniprogram_dist/lib.js.map +1 -1
- package/package.json +78 -78
- package/project.config.json +79 -79
- package/src/AliveInvite/LiveRoomVertical/components/friends/friends.js +181 -181
- package/src/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +25 -25
- package/src/AliveInvite/LiveRoomVertical/components/friends/friends.wxss +97 -97
- package/src/AliveInvite/LiveRoomVertical/index.js +253 -253
- package/src/AliveInvite/LiveRoomVertical/index.less +255 -255
- package/src/AliveInvite/LiveRoomVertical/index.wxml +122 -122
- package/src/AliveInvite/LiveRoomVertical/index.wxss +252 -252
- package/src/CollectionAddress/index.js +288 -288
- package/src/CollectionAddress/index.json +13 -13
- package/src/CollectionAddress/index.less +4 -4
- package/src/CollectionAddress/index.wxml +93 -93
- package/src/CollectionAddress/index.wxss +5 -5
- package/src/ConfirmOrder/components/AddressEdit/index.json +10 -10
- package/src/ConfirmOrder/components/AddressEdit/index.less +123 -123
- package/src/ConfirmOrder/components/AddressEdit/index.wxml +51 -51
- package/src/ConfirmOrder/components/AddressEdit/index.wxss +120 -120
- package/src/ConfirmOrder/components/AddressManage/index.js +168 -168
- package/src/ConfirmOrder/components/AddressManage/index.json +7 -7
- package/src/ConfirmOrder/components/AddressManage/index.less +95 -95
- package/src/ConfirmOrder/components/AddressManage/index.wxml +36 -36
- package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
- package/src/ConfirmOrder/components/AddressSelect/index.js +160 -160
- package/src/ConfirmOrder/components/AddressSelect/index.json +4 -4
- package/src/ConfirmOrder/components/AddressSelect/index.less +79 -79
- package/src/ConfirmOrder/components/AddressSelect/index.wxml +33 -33
- package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
- package/src/ConfirmOrder/components/ChoosePicker/index.js +115 -115
- package/src/ConfirmOrder/components/ChoosePicker/index.json +5 -5
- package/src/ConfirmOrder/components/ChoosePicker/index.less +20 -20
- package/src/ConfirmOrder/components/ChoosePicker/index.wxml +9 -9
- package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.js +1819 -1819
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.json +27 -27
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.scss +44 -44
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxml +225 -225
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxss +37 -37
- package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.js +129 -129
- package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.json +8 -8
- package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.scss +58 -58
- package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxml +25 -25
- package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxss +1 -1
- package/src/ConfirmOrder/components/GoodsInfo/index.wxss +1 -1
- package/src/ConfirmOrder/components/IntegralSelect/index.wxss +218 -218
- package/src/ConfirmOrder/components/Invoice/index.wxss +93 -93
- package/src/ConfirmOrder/components/LeaveWord/index.wxss +1 -1
- package/src/ConfirmOrder/components/OrderBubble/index.wxss +1 -1
- package/src/ConfirmOrder/components/PayBar/index.wxss +1 -1
- package/src/ConfirmOrder/components/PayDetail/index.wxss +78 -78
- package/src/ConfirmOrder/components/SvipSelect/SvipSelect.wxss +266 -266
- package/src/CopGoodsCard/index.wxss +1 -1
- package/src/CouponList/components/CouponItem/index.wxss +1 -1
- package/src/CouponList/components/couponIcon/index.wxss +1 -1
- package/src/CouponList/stuCouponPopup/index.wxss +1 -1
- package/src/CouponReceivePopup/index.wxss +1 -1
- package/src/CustomPopup/index.wxss +37 -37
- package/src/GoodsBubble/index.wxss +1 -1
- package/src/GoodsItem/index.js +180 -21
- package/src/GoodsItem/index.scss +822 -627
- package/src/GoodsItem/index.wxml +145 -108
- package/src/GoodsItem/index.wxs +40 -40
- package/src/GoodsItem/index.wxss +1 -1
- package/src/GoodsRecommend/index.wxss +537 -537
- package/src/LevelMemberBar/index.wxss +1 -1
- package/src/LiveGoodsList/Header/index.js +65 -65
- package/src/LiveGoodsList/Header/index.json +6 -6
- package/src/LiveGoodsList/Header/index.less +45 -45
- package/src/LiveGoodsList/Header/index.scss +157 -137
- package/src/LiveGoodsList/Header/index.wxml +39 -36
- package/src/LiveGoodsList/Header/index.wxss +1 -1
- package/src/LiveGoodsList/README.md +9 -9
- package/src/LiveGoodsList/index.js +29 -10
- package/src/LiveGoodsList/index.less +53 -53
- package/src/LiveGoodsList/index.scss +173 -173
- package/src/LiveGoodsList/index.wxml +9 -1
- package/src/LiveGoodsList/index.wxss +1 -1
- package/src/MatchList/index.js +445 -441
- package/src/MatchList/index.json +5 -5
- package/src/MatchList/index.scss +175 -175
- package/src/MatchList/index.wxml +98 -97
- package/src/MatchList/index.wxss +1 -1
- package/src/MemberIntegralMultiplierBar/index.js +196 -196
- package/src/MemberIntegralMultiplierBar/index.json +7 -7
- package/src/MemberIntegralMultiplierBar/index.scss +67 -67
- package/src/MemberIntegralMultiplierBar/index.wxml +8 -8
- package/src/MemberIntegralMultiplierBar/index.wxss +1 -1
- package/src/MemberIntegralMultiplierPopup/index.js +54 -54
- package/src/MemberIntegralMultiplierPopup/index.json +7 -7
- package/src/MemberIntegralMultiplierPopup/index.scss +86 -86
- package/src/MemberIntegralMultiplierPopup/index.wxml +48 -48
- package/src/MemberIntegralMultiplierPopup/index.wxss +1 -1
- package/src/MemberIntegralMultiplierPopup/popup-service.js +18 -18
- package/src/MsgBubble/index.js +312 -0
- package/src/MsgBubble/index.json +7 -0
- package/src/MsgBubble/index.scss +81 -0
- package/src/MsgBubble/index.wxml +19 -0
- package/src/MsgBubble/index.wxss +1 -0
- package/src/PayModule/button/index.wxss +58 -58
- package/src/ShoppingCartBubble/index.js +336 -156
- package/src/ShoppingCartBubble/index.scss +94 -55
- package/src/ShoppingCartBubble/index.wxml +14 -11
- package/src/ShoppingCartBubble/index.wxss +1 -1
- package/src/Task/TaskBubble/index.json +3 -3
- package/src/Task/TaskBubble/index.scss +125 -125
- package/src/Task/TaskBubble/index.wxml +22 -22
- package/src/Task/TaskBubble/index.wxss +289 -289
- package/src/Task/TaskIcon/index.js +29 -29
- package/src/Task/TaskIcon/index.json +4 -4
- package/src/Task/TaskIcon/index.scss +70 -70
- package/src/Task/TaskIcon/index.wxml +5 -5
- package/src/Task/TaskIcon/index.wxss +130 -130
- package/src/Task/TaskPopup/component/RewardList/index.js +52 -52
- package/src/Task/TaskPopup/component/RewardList/index.json +6 -6
- package/src/Task/TaskPopup/component/RewardList/index.scss +39 -39
- package/src/Task/TaskPopup/component/RewardList/index.wxml +23 -23
- package/src/Task/TaskPopup/component/RewardList/index.wxss +18 -18
- package/src/Task/TaskPopup/component/TaskItem/index.js +578 -578
- package/src/Task/TaskPopup/component/TaskItem/index.json +10 -10
- package/src/Task/TaskPopup/component/TaskItem/index.scss +245 -245
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +145 -145
- package/src/Task/TaskPopup/component/TaskItem/index.wxs +7 -7
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -1
- package/src/Task/TaskPopup/component/TaskList/index.js +298 -298
- package/src/Task/TaskPopup/component/TaskList/index.json +7 -7
- package/src/Task/TaskPopup/component/TaskList/index.scss +66 -66
- package/src/Task/TaskPopup/component/TaskList/index.wxml +41 -41
- package/src/Task/TaskPopup/component/TaskList/index.wxss +118 -118
- package/src/Task/TaskPopup/component/TaskType/index.js +129 -129
- package/src/Task/TaskPopup/component/TaskType/index.json +13 -13
- package/src/Task/TaskPopup/component/TaskType/index.scss +90 -90
- package/src/Task/TaskPopup/component/TaskType/index.wxml +69 -69
- package/src/Task/TaskPopup/component/TaskType/index.wxss +1 -1
- package/src/Task/TaskPopup/index.js +174 -174
- package/src/Task/TaskPopup/index.json +7 -7
- package/src/Task/TaskPopup/index.scss +166 -166
- package/src/Task/TaskPopup/index.wxml +87 -87
- package/src/Task/TaskPopup/index.wxss +490 -490
- package/src/Task/TaskQuizPopup/components/quizContent/index.js +131 -131
- package/src/Task/TaskQuizPopup/components/quizContent/index.json +5 -5
- package/src/Task/TaskQuizPopup/components/quizContent/index.scss +191 -191
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxml +64 -64
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxs +78 -78
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxss +521 -521
- package/src/Task/TaskQuizPopup/components/quizRichText/index.js +40 -40
- package/src/Task/TaskQuizPopup/components/quizRichText/index.json +5 -5
- package/src/Task/TaskQuizPopup/components/quizRichText/index.scss +6 -6
- package/src/Task/TaskQuizPopup/components/quizRichText/index.wxml +1 -1
- package/src/Task/TaskQuizPopup/components/quizRichText/index.wxss +298 -298
- package/src/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -50
- package/src/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -623
- package/src/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -183
- package/src/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -216
- package/src/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -3563
- package/src/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -2364
- package/src/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -209
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -269
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -1276
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxss +316 -316
- package/src/Task/TaskQuizPopup/index.js +246 -246
- package/src/Task/TaskQuizPopup/index.json +7 -7
- package/src/Task/TaskQuizPopup/index.scss +158 -158
- package/src/Task/TaskQuizPopup/index.wxml +99 -99
- package/src/Task/TaskQuizPopup/index.wxss +478 -478
- package/src/Task/common/task.js +55 -55
- package/src/Task/taskQuizRemindPopup/index.js +74 -74
- package/src/Task/taskQuizRemindPopup/index.json +5 -5
- package/src/Task/taskQuizRemindPopup/index.scss +107 -107
- package/src/Task/taskQuizRemindPopup/index.wxml +27 -27
- package/src/Task/taskQuizRemindPopup/index.wxss +286 -286
- package/src/Task/taskReceivePopup/coupon/index.js +68 -68
- package/src/Task/taskReceivePopup/coupon/index.json +6 -6
- package/src/Task/taskReceivePopup/coupon/index.scss +123 -123
- package/src/Task/taskReceivePopup/coupon/index.wxml +81 -81
- package/src/Task/taskReceivePopup/coupon/index.wxs +48 -48
- package/src/Task/taskReceivePopup/coupon/index.wxss +274 -274
- package/src/Task/taskReceivePopup/customPrizes/index.js +44 -44
- package/src/Task/taskReceivePopup/customPrizes/index.json +6 -6
- package/src/Task/taskReceivePopup/customPrizes/index.scss +106 -106
- package/src/Task/taskReceivePopup/customPrizes/index.wxml +38 -38
- package/src/Task/taskReceivePopup/customPrizes/index.wxs +48 -48
- package/src/Task/taskReceivePopup/customPrizes/index.wxss +220 -220
- package/src/Task/taskReceivePopup/index.js +47 -47
- package/src/Task/taskReceivePopup/index.json +13 -13
- package/src/Task/taskReceivePopup/index.wxml +32 -32
- package/src/Task/taskReceivePopup/index.wxss +1 -1
- package/src/Task/taskReceivePopup/integral/index.js +106 -106
- package/src/Task/taskReceivePopup/integral/index.json +7 -7
- package/src/Task/taskReceivePopup/integral/index.scss +60 -60
- package/src/Task/taskReceivePopup/integral/index.wxml +23 -23
- package/src/Task/taskReceivePopup/integral/index.wxss +94 -94
- package/src/TeacherGoodsList/index.js +997 -983
- package/src/TeacherGoodsList/index.json +10 -10
- package/src/TeacherGoodsList/index.scss +178 -178
- package/src/TeacherGoodsList/index.wxml +146 -144
- package/src/TeacherGoodsList/index.wxss +1 -1
- package/src/common/api/liveGoodsList.js +181 -167
- package/src/common/assets/copy.wxss +3 -3
- package/src/common/assets/images/coupon/emptypage.svg +49 -49
- package/src/common/assets/images/coupon/failed.svg +5 -5
- package/src/common/assets/images/coupon/up.svg +21 -21
- package/src/common/assets/images/pay/loading.svg +3 -3
- package/src/common/assets/images/recommend.svg +6 -6
- package/src/common/assets/images/refresh.svg +10 -10
- package/src/common/assets/images/refresh_white.svg +3 -3
- package/src/common/assets/images/wechat.svg +4 -4
- package/src/common/css/index.less +2 -2
- package/src/common/css/theme.less +19 -19
- package/src/common/css/theme.wxss +16 -16
- package/src/common/libs/dataUp/sensorUp.js +91 -91
- package/src/common/libs/playerHttp.js +58 -58
- package/src/common/libs/playerRequestUrl.js +39 -39
- package/src/common/transaction/parameter/channel-info.js +36 -36
- package/src/common/transaction/parameter/delivery-info.js +26 -26
- package/src/common/transaction/parameter/misc-parameter.js +21 -21
- package/src/common/utils/currency.js +52 -52
- package/src/common/utils/getInfoCollectionData.js +59 -59
- package/src/common/utils/image-cdn-slim/constant.js +8 -8
- package/src/common/utils/image-cdn-slim/index.js +7 -7
- package/src/common/utils/image-cdn-slim/utils.js +156 -156
- package/src/common/utils/index.js +86 -86
- package/src/common/utils/liveGoods.js +217 -217
- package/src/common/utils/specialList.js +5 -5
- package/src/common/utils/tool.js +72 -72
- package/src/common/wxs/filter.wxs +29 -29
- package/src/coupon/components/CouponItem/index.wxss +821 -821
- package/src/coupon/components/CouponSelect/index.wxss +1132 -1132
- package/src/coupon/index.wxss +216 -216
- package/src/index.js +23 -23
- package/src/lib.ts +5 -5
- package/src/project.config.json +68 -68
- package/src/utils.js +5 -5
- package/tsconfig.json +25 -25
|
@@ -1,578 +1,578 @@
|
|
|
1
|
-
import taskBehavior from '../../../common/task'
|
|
2
|
-
const computedBehavior = require('miniprogram-computed').behavior
|
|
3
|
-
|
|
4
|
-
const getHoursMinutes = (minutes) => {
|
|
5
|
-
const hours = Math.floor(minutes / 60)
|
|
6
|
-
const remainingMinutes = minutes % 60
|
|
7
|
-
return `${hours > 0 ? hours + '小时' : ''}${remainingMinutes > 0 ? remainingMinutes + '分钟' : ''}`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const task_config = {
|
|
11
|
-
1: {
|
|
12
|
-
1: {
|
|
13
|
-
taskBelongType: 1,
|
|
14
|
-
taskBtnText: '去观看',
|
|
15
|
-
event: 'view',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
2: {
|
|
19
|
-
1: {
|
|
20
|
-
taskBelongType: 2,
|
|
21
|
-
taskBtnText: '去评论',
|
|
22
|
-
handle: 'toComment',
|
|
23
|
-
event: 'input',
|
|
24
|
-
},
|
|
25
|
-
2: {
|
|
26
|
-
taskBelongType: 3,
|
|
27
|
-
taskBtnText: '去转发',
|
|
28
|
-
handle: 'toShare',
|
|
29
|
-
event: 'share',
|
|
30
|
-
},
|
|
31
|
-
21: {
|
|
32
|
-
taskBelongType: 22,
|
|
33
|
-
taskBtnText: '去转发',
|
|
34
|
-
handle: 'toShare',
|
|
35
|
-
event: 'share',
|
|
36
|
-
},
|
|
37
|
-
22: {
|
|
38
|
-
taskBelongType: 23,
|
|
39
|
-
taskBtnText: '去转发',
|
|
40
|
-
handle: 'toShare',
|
|
41
|
-
event: 'share',
|
|
42
|
-
},
|
|
43
|
-
3: {
|
|
44
|
-
taskBelongType: 4,
|
|
45
|
-
taskBtnText: '去点赞',
|
|
46
|
-
event: 'like',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
3: {
|
|
50
|
-
4: {
|
|
51
|
-
taskBelongType: 5,
|
|
52
|
-
taskBtnText: '去下单',
|
|
53
|
-
handle: 'toGoods',
|
|
54
|
-
event: 'order',
|
|
55
|
-
},
|
|
56
|
-
5: {
|
|
57
|
-
taskBelongType: 6,
|
|
58
|
-
taskBtnText: '去消费',
|
|
59
|
-
handle: 'toGoods',
|
|
60
|
-
event: 'consumption',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
4: {
|
|
64
|
-
6: {
|
|
65
|
-
taskBelongType: 7,
|
|
66
|
-
taskBtnText: '去打赏',
|
|
67
|
-
handle: 'toGive',
|
|
68
|
-
event: 'give',
|
|
69
|
-
},
|
|
70
|
-
7: {
|
|
71
|
-
taskBelongType: 8,
|
|
72
|
-
taskBtnText: '去投票',
|
|
73
|
-
event: 'vote',
|
|
74
|
-
},
|
|
75
|
-
8: {
|
|
76
|
-
taskBelongType: 9,
|
|
77
|
-
taskBtnText: '去完成',
|
|
78
|
-
event: 'questionnaire',
|
|
79
|
-
},
|
|
80
|
-
9: {
|
|
81
|
-
taskBelongType: 10,
|
|
82
|
-
taskBtnText: '去签到',
|
|
83
|
-
handle: 'toSign',
|
|
84
|
-
event: 'sign',
|
|
85
|
-
},
|
|
86
|
-
10: {
|
|
87
|
-
taskBelongType: 11,
|
|
88
|
-
taskBtnText: '去答题',
|
|
89
|
-
handle: 'toQuiz',
|
|
90
|
-
event: 'quiz',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const list_type_config = {
|
|
96
|
-
reward: {
|
|
97
|
-
btnText: '去使用',
|
|
98
|
-
btnClick: 'reward',
|
|
99
|
-
},
|
|
100
|
-
error: {
|
|
101
|
-
btnText: '领奖励',
|
|
102
|
-
btnClick: 'toRetry',
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const TASK_TYPE_MAP = {
|
|
107
|
-
TASK_VIEW: 1,
|
|
108
|
-
TASK_COMMENTS: 2,
|
|
109
|
-
TASK_SHARE: 3,
|
|
110
|
-
TASK_LIKE: 4,
|
|
111
|
-
TASK_ORDER_COUNT: 5,
|
|
112
|
-
TASK_ORDER_MONEY: 6,
|
|
113
|
-
TASK_REWORD: 7,
|
|
114
|
-
TASK_VOTE: 8,
|
|
115
|
-
TASK_COMPLATE: 9,
|
|
116
|
-
TASK_SIGNIN: 10,
|
|
117
|
-
TASK_QUIZ: 11,
|
|
118
|
-
TASK_SHARE_OTHER: 22,
|
|
119
|
-
TASK_SHARE_NEW: 23,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
Component({
|
|
123
|
-
behaviors: [computedBehavior, taskBehavior],
|
|
124
|
-
properties: {
|
|
125
|
-
// 任务详情数据
|
|
126
|
-
// id 直播间任务ID
|
|
127
|
-
// task_module 任务种类 1组合任务
|
|
128
|
-
// is_show_answer c端是否展示答案解析,0不展示,1展示
|
|
129
|
-
// task_type 任务类型:1=观看任务,2=互动任务,3=消费任务,4=活跃任务
|
|
130
|
-
// task_condition 直播任务条件:观看任务时填写具体分钟值,互动任务时:1-评论 2-分享 3-点赞,消费任务时:4-下单笔数 5-消费金额,活跃任务时:6-打赏 7-投票 8-问卷 9-签到 10-答题任务
|
|
131
|
-
// state 任务状态:1-正常,2-已停止
|
|
132
|
-
// reward_type 奖励类型:0=无奖励,1=积分,2=优惠券,3=红包,4=课程/商品,5=自定义奖品
|
|
133
|
-
// reward_type 奖励类型:1=积分,2=优惠券,3=红包,4=课程/商品,5=自定义奖品
|
|
134
|
-
// reward_frequency 满足奖励所需频次,消费任务时:满足多少笔、或多少金额 ;答题任务时,答对多少题
|
|
135
|
-
// finish_frequency 已经完成奖励频次,消费任务时:满足多少笔、多少金额单位分
|
|
136
|
-
// reward_value 奖励值:积分数值、优惠券码、红包、商品、自定义奖品等。如果奖品存在多个字段,存储成json格式)
|
|
137
|
-
// start_at 任务开始时间
|
|
138
|
-
// end_at任务结束时间
|
|
139
|
-
// join_state 参与状态:0=未参与,1=参与中,2=已完成
|
|
140
|
-
// reward_state 奖励状态:1-待发放,2-发放成功,3-发放失败
|
|
141
|
-
// qs_is_pass 答题任务时,true-满足条件,false-不满足条件
|
|
142
|
-
taskItem: {
|
|
143
|
-
type: Object,
|
|
144
|
-
value: () => {
|
|
145
|
-
return {}
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
isRadius: {
|
|
149
|
-
type: Boolean,
|
|
150
|
-
value: false,
|
|
151
|
-
},
|
|
152
|
-
listType: {
|
|
153
|
-
type: String,
|
|
154
|
-
value: 'task',
|
|
155
|
-
},
|
|
156
|
-
itemIndex: {
|
|
157
|
-
type: Number,
|
|
158
|
-
value: 0,
|
|
159
|
-
},
|
|
160
|
-
isMb: {
|
|
161
|
-
type: Boolean,
|
|
162
|
-
value: false,
|
|
163
|
-
},
|
|
164
|
-
viewingInProgress: {
|
|
165
|
-
type: Array,
|
|
166
|
-
value: () => {
|
|
167
|
-
return []
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
teamId: {
|
|
171
|
-
type: String,
|
|
172
|
-
value: '',
|
|
173
|
-
},
|
|
174
|
-
// 任务下标 组合顺序任务需要用到
|
|
175
|
-
taskIdx: {
|
|
176
|
-
type: Number,
|
|
177
|
-
value: 0,
|
|
178
|
-
},
|
|
179
|
-
// 任务长度
|
|
180
|
-
taskLength: {
|
|
181
|
-
type: Number,
|
|
182
|
-
value: 0,
|
|
183
|
-
},
|
|
184
|
-
// 顺序组合任务
|
|
185
|
-
isInOrder: {
|
|
186
|
-
type: Boolean,
|
|
187
|
-
default: false,
|
|
188
|
-
},
|
|
189
|
-
//是否新商户
|
|
190
|
-
isNewChants: {
|
|
191
|
-
type: Number,
|
|
192
|
-
value: 0,
|
|
193
|
-
},
|
|
194
|
-
roomInfo: {
|
|
195
|
-
type: Object,
|
|
196
|
-
value: () => {
|
|
197
|
-
return {}
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
data: {
|
|
202
|
-
activeNames: ['1'],
|
|
203
|
-
taskBelongType: null, // 任务类型归属 1-观看 2-评论 3-转发 4-点赞
|
|
204
|
-
ButtonText: '', //新商户提现按钮文案
|
|
205
|
-
unableBtn: false, // 新商户提现按钮是否禁用
|
|
206
|
-
},
|
|
207
|
-
watch: {
|
|
208
|
-
taskItem: function (newVal) {
|
|
209
|
-
const { task_type, task_condition } = newVal
|
|
210
|
-
const { taskBelongType } = this.getTaskConfig(task_type, task_condition)
|
|
211
|
-
this.setData({
|
|
212
|
-
taskBelongType,
|
|
213
|
-
})
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
computed: {
|
|
217
|
-
// 是否是正在开始的拉新任务
|
|
218
|
-
isSharingTaskStatus({ isInOrder, taskItem }) {
|
|
219
|
-
const { task_module, join_state, progress, state, task_condition, task_type } = taskItem
|
|
220
|
-
if (state === 2 || join_state !== 1 || task_type !== 2 || ![21, 22].includes(+task_condition)) return false
|
|
221
|
-
if ((task_module === 1 && progress === 0 && isInOrder) || join_state === 2) return false
|
|
222
|
-
return true
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
// 是否展示奖励
|
|
226
|
-
isShowReward(data) {
|
|
227
|
-
const { listType, taskItem, isQuizTask } = data
|
|
228
|
-
// 组合任务 判断是否有奖励 reward_type和reward_value不能为0
|
|
229
|
-
if (data.isCombination) {
|
|
230
|
-
if (taskItem.reward_type === 0 && Number(taskItem.reward_value) === 0) {
|
|
231
|
-
return false
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return listType === 'task' || listType === 'error'
|
|
235
|
-
},
|
|
236
|
-
// 是否展示提现按钮
|
|
237
|
-
isShowButton(data) {
|
|
238
|
-
const { listType, taskItem, isNewChants } = data
|
|
239
|
-
const { reward_type } = taskItem
|
|
240
|
-
return listType === 'reward' && reward_type === 3 && isNewChants === 1
|
|
241
|
-
},
|
|
242
|
-
// 是否是答题任务
|
|
243
|
-
isQuizTask(data) {
|
|
244
|
-
const { taskItem } = data
|
|
245
|
-
return taskItem.task_type === 4 && taskItem.task_condition === '10'
|
|
246
|
-
},
|
|
247
|
-
// 未完成及已提交状态
|
|
248
|
-
getFailStatus(data) {
|
|
249
|
-
// 组合任务 子任务状态判断 progress=0未开启 join_state=0未参与
|
|
250
|
-
const { taskItem, isQuizTask, isInOrder } = data
|
|
251
|
-
return (
|
|
252
|
-
(isQuizTask && taskItem.join_state === 2 && !taskItem.qs_is_pass) ||
|
|
253
|
-
(taskItem.join_state === 0 && taskItem.state === 2) ||
|
|
254
|
-
(isInOrder && taskItem.progress === 0 && taskItem.join_state !== 0)
|
|
255
|
-
)
|
|
256
|
-
},
|
|
257
|
-
// 展示答题任务中,说明模块, 答题任务&&(任务结束||参与了)&&(任务结束&&没参与————这个有单独的提示)
|
|
258
|
-
showAnswerTaskIntroduce(data) {
|
|
259
|
-
const { taskItem, isQuizTask } = data
|
|
260
|
-
return (
|
|
261
|
-
isQuizTask &&
|
|
262
|
-
(taskItem.state === 2 || taskItem.join_state === 2) &&
|
|
263
|
-
!(taskItem.state === 2 && taskItem.join_state === 0)
|
|
264
|
-
)
|
|
265
|
-
},
|
|
266
|
-
// 组合任务
|
|
267
|
-
isCombination(data) {
|
|
268
|
-
return data.taskItem.task_module === 1
|
|
269
|
-
},
|
|
270
|
-
/**
|
|
271
|
-
* 任务标题
|
|
272
|
-
* num 需要完成的次数 如果没有reward_frequency默认就是1
|
|
273
|
-
*/
|
|
274
|
-
taskTitle(data) {
|
|
275
|
-
const { taskItem, listType } = data
|
|
276
|
-
const num = data.isCombination ? taskItem.reward_frequency : 1
|
|
277
|
-
const { task_condition, reward_frequency } = taskItem
|
|
278
|
-
|
|
279
|
-
let titleObj = {
|
|
280
|
-
[TASK_TYPE_MAP.TASK_VIEW]: `观看时长${getHoursMinutes(task_condition)}`,
|
|
281
|
-
[TASK_TYPE_MAP.TASK_COMMENTS]: `评论${num}次`,
|
|
282
|
-
[TASK_TYPE_MAP.TASK_SHARE]: `转发${num}次`,
|
|
283
|
-
[TASK_TYPE_MAP.TASK_LIKE]: `点赞${num}次`,
|
|
284
|
-
[TASK_TYPE_MAP.TASK_ORDER_COUNT]: `成功消费 ${reward_frequency} 笔订单数`,
|
|
285
|
-
[TASK_TYPE_MAP.TASK_ORDER_MONEY]: `成功消费 ${(reward_frequency / 100).toFixed(2)} 元`,
|
|
286
|
-
[TASK_TYPE_MAP.TASK_REWORD]: `打赏${num}次`,
|
|
287
|
-
[TASK_TYPE_MAP.TASK_VOTE]: `投票${num}次`,
|
|
288
|
-
[TASK_TYPE_MAP.TASK_COMPLATE]: `完成问卷${num}次`,
|
|
289
|
-
[TASK_TYPE_MAP.TASK_SIGNIN]: `签到${num}次`,
|
|
290
|
-
[TASK_TYPE_MAP.TASK_QUIZ]: `完成答题,并答对${reward_frequency}题`,
|
|
291
|
-
[TASK_TYPE_MAP.TASK_SHARE_OTHER]: '转发直播间',
|
|
292
|
-
[TASK_TYPE_MAP.TASK_SHARE_NEW]: '转发直播间(新用户)',
|
|
293
|
-
}
|
|
294
|
-
let res = titleObj[data.taskBelongType]
|
|
295
|
-
if (listType === 'reward' && data.isCombination) {
|
|
296
|
-
// 主任务
|
|
297
|
-
if (taskItem.task_is_major === 0) {
|
|
298
|
-
return `完成任务 ${taskItem.task_title}`
|
|
299
|
-
} else {
|
|
300
|
-
return `${taskItem.task_major_title}-${res}`
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return res
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
// 超时未完成
|
|
307
|
-
isShowTimeOver(data) {
|
|
308
|
-
const { isInOrder, taskItem } = data
|
|
309
|
-
if (isInOrder) {
|
|
310
|
-
// unDone 标志直接未完成
|
|
311
|
-
return taskItem?.unDone || (taskItem.join_state !== 2 && taskItem.state === 2)
|
|
312
|
-
} else {
|
|
313
|
-
return taskItem.join_state === 0 && taskItem.state === 2
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
|
|
317
|
-
// 组合顺序任务 展示文案 ‘需要完成上一个’
|
|
318
|
-
isShowCompletePrevious(data) {
|
|
319
|
-
const { isInOrder, taskItem } = data
|
|
320
|
-
if (!isInOrder) return
|
|
321
|
-
const { progress, state } = taskItem
|
|
322
|
-
// 如果上一个任务已经结束就无需展示
|
|
323
|
-
if (state === 2) return
|
|
324
|
-
if (data.listType === 'task' && progress === 0) {
|
|
325
|
-
return true
|
|
326
|
-
}
|
|
327
|
-
return false
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
// 是否展示 子任务还需要多少次才完成
|
|
331
|
-
isShowMultipleTask(data) {
|
|
332
|
-
const { reward_frequency, task_progress, finish_frequency, task_module, join_state, state } = data.taskItem
|
|
333
|
-
if (data.listType !== 'task' || task_module !== 1 || join_state === 2 || state === 2) return false
|
|
334
|
-
// 正在进行的观看任务
|
|
335
|
-
if (data.taskBelongType === 1) {
|
|
336
|
-
if (data.taskItem.progress === 1 || !data.isInOrder) return true
|
|
337
|
-
} else {
|
|
338
|
-
// 有奖励的子任务
|
|
339
|
-
if (reward_frequency !== 0 && (task_progress !== reward_frequency || Number(finish_frequency) === 0)) {
|
|
340
|
-
return true
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return false
|
|
344
|
-
},
|
|
345
|
-
// 任务奖励异常文案
|
|
346
|
-
rewardErrorDesc(data) {
|
|
347
|
-
const REWARD_SEND_FAIL_MAP = {
|
|
348
|
-
GoodsSendErr_1: '商品已下架,无法获取奖励',
|
|
349
|
-
GoodsSendErr_2: '商品已被删除,无法获取奖励',
|
|
350
|
-
// GoodsSendErr_3: "用户在黑名单,无法获取奖励",
|
|
351
|
-
GoodsSendErr_4: '已拥有该课程权益,无需重复发放奖励',
|
|
352
|
-
// GoodsSendErr_5: "用户在圈子黑名单,无法获取奖",
|
|
353
|
-
CouponSendErr_6: '由于优惠券被删除,无法获取奖励。请联系商家处理',
|
|
354
|
-
CouponSendErr_7: '领取优惠券操作频繁,无法获取奖励',
|
|
355
|
-
CouponSendErr_101: '用户完成任务时,由于优惠券库存为0,无法获取奖励。请联系商家处理',
|
|
356
|
-
CouponSendErr_102: '该优惠券领取已达上限,具体详情请咨询商家',
|
|
357
|
-
CouponSendErr_103: '优惠券被操作作废或停止,无法获取奖励。请联系商家处理',
|
|
358
|
-
CouponSendErr_104: '优惠券已过期,无法获取奖励。请联系用户处理',
|
|
359
|
-
RedPacketErr_10230008: '红包已抢完',
|
|
360
|
-
RedPacketErr_10230011: '红包领取失败,该环境无法领取微信红包',
|
|
361
|
-
RedPacketErr_10230035: '红包过期',
|
|
362
|
-
RedPacketErr_10230040: '领取红包入账异常',
|
|
363
|
-
UnknownSendErr: '奖励发放失败',
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
const { reward_send_fail_reason } = data.taskItem
|
|
367
|
-
return (
|
|
368
|
-
REWARD_SEND_FAIL_MAP[reward_send_fail_reason] || reward_send_fail_reason || '奖品异常,无法领取,请联系商家处理'
|
|
369
|
-
)
|
|
370
|
-
},
|
|
371
|
-
// 组合子任务 需多少次才完成
|
|
372
|
-
childTaskContent(data) {
|
|
373
|
-
let time = data.taskItem.reward_frequency
|
|
374
|
-
let getResidueTime = ''
|
|
375
|
-
|
|
376
|
-
if (data.taskBelongType !== 1) {
|
|
377
|
-
const { reward_frequency, task_progress } = data.taskItem
|
|
378
|
-
time = reward_frequency - task_progress
|
|
379
|
-
if (time === 0) return
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// 观看任务不需要判断进度 看时间即可
|
|
383
|
-
if (data.taskBelongType === 1) {
|
|
384
|
-
if (data.viewingInProgress.length) {
|
|
385
|
-
const obj = data.viewingInProgress.find((item) => item.id === data.taskItem.id)
|
|
386
|
-
if (!obj) return
|
|
387
|
-
getResidueTime =
|
|
388
|
-
obj.residue_time && obj.residue_time > 60
|
|
389
|
-
? '再观看 ' + Math.floor(obj.residue_time / 60) + '分钟 ' + '完成任务'
|
|
390
|
-
: '即将获得奖励'
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
let titleObj = {
|
|
394
|
-
[TASK_TYPE_MAP.TASK_VIEW]: getResidueTime,
|
|
395
|
-
[TASK_TYPE_MAP.TASK_COMMENTS]: `再评论${time}次 完成任务`,
|
|
396
|
-
[TASK_TYPE_MAP.TASK_SHARE]: `再转发${time}次 完成任务`,
|
|
397
|
-
[TASK_TYPE_MAP.TASK_LIKE]: `再点赞${time}次 完成任务`,
|
|
398
|
-
[TASK_TYPE_MAP.TASK_VOTE]: `再参与投票${time}次 完成任务`,
|
|
399
|
-
[TASK_TYPE_MAP.TASK_COMPLATE]: `再参与问卷${time}次 完成任务`,
|
|
400
|
-
[TASK_TYPE_MAP.TASK_SIGNIN]: `再参与签到${time}次 完成任务`,
|
|
401
|
-
}
|
|
402
|
-
return titleObj[data.taskBelongType]
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
// 任务按钮
|
|
406
|
-
btnText(data) {
|
|
407
|
-
if (data.listType !== 'task') {
|
|
408
|
-
return list_type_config[data.listType]?.btnText
|
|
409
|
-
} else {
|
|
410
|
-
// 正常任务列表
|
|
411
|
-
const { join_state, state, task_type, task_condition, qs_is_pass } = data.taskItem
|
|
412
|
-
// 答题任务&&已参与&&没满足条件
|
|
413
|
-
if (data.isQuizTask && join_state === 2 && !qs_is_pass) {
|
|
414
|
-
//已提交
|
|
415
|
-
return '已提交'
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// 组合顺序任务 按顺序未解锁到的任务为 待完成状态
|
|
419
|
-
if (data.isInOrder && data.taskItem.progress === 0 && join_state !== 0) {
|
|
420
|
-
if (data.taskItem?.unDone) return '未完成'
|
|
421
|
-
return '待完成'
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if (join_state === 2) return '已完成'
|
|
425
|
-
if (state === 2) return '未完成'
|
|
426
|
-
if (join_state === 0) return '未开始'
|
|
427
|
-
|
|
428
|
-
return task_config[task_type][task_type === 1 ? 1 : task_condition]?.taskBtnText || '去参与'
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
|
|
432
|
-
// 任务完成剩余条件
|
|
433
|
-
residueCondition(data) {
|
|
434
|
-
const { join_state, state, task_type, task_condition, reward_value, reward_type, id, task_module } = data.taskItem
|
|
435
|
-
if (join_state !== 1 || state === 2) return ''
|
|
436
|
-
|
|
437
|
-
if (task_type === 1) {
|
|
438
|
-
if (data.isCombination) return false
|
|
439
|
-
// 观看任务
|
|
440
|
-
if (data.viewingInProgress.length) {
|
|
441
|
-
const { residue_time } = data.viewingInProgress.find((item) => item.id === id)
|
|
442
|
-
return residue_time && residue_time > 60
|
|
443
|
-
? '再观看 ' + Math.floor(residue_time / 60) + '分钟 ' + '获得奖励'
|
|
444
|
-
: '即将获得奖励'
|
|
445
|
-
}
|
|
446
|
-
} else if (task_type === 3 && task_condition === '4') {
|
|
447
|
-
// 下单笔数
|
|
448
|
-
const { reward_frequency, finish_frequency } = data.taskItem
|
|
449
|
-
return reward_frequency && finish_frequency ? `再下${reward_frequency - finish_frequency}单 获得奖励` : ''
|
|
450
|
-
} else if (task_type === 3 && task_condition === '5') {
|
|
451
|
-
// 消费金额
|
|
452
|
-
const { reward_frequency, finish_frequency } = data.taskItem
|
|
453
|
-
return reward_frequency && finish_frequency
|
|
454
|
-
? `再消费${((reward_frequency - finish_frequency) / 100).toFixed(2)}元 获得奖励`
|
|
455
|
-
: ''
|
|
456
|
-
} else {
|
|
457
|
-
return ''
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
// 红包奖励剩余个数
|
|
462
|
-
redEnvelopeNum(data) {
|
|
463
|
-
const { join_state, state, reward_value, reward_type, reward_pay_type, team_pay_config } = data.taskItem
|
|
464
|
-
if (join_state !== 1 || state === 2 || reward_type !== 3 || (join_state === 0 && state === 2)) {
|
|
465
|
-
return ''
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
if (reward_pay_type === 0) {
|
|
469
|
-
return reward_value.remain_nums ? `领取名额还剩 ${reward_value.remain_nums}个` : '领取名额还剩 0个,无法领取'
|
|
470
|
-
} else if (reward_pay_type === 10 && team_pay_config) {
|
|
471
|
-
const storeList = JSON.parse(team_pay_config)
|
|
472
|
-
const storeItem = storeList.find((item) => item.team_id === data.teamId)
|
|
473
|
-
if (storeItem) {
|
|
474
|
-
return storeItem.limit_person ? `领取名额还剩 ${storeItem.limit_person}个` : '领取名额还剩 0个,无法领取'
|
|
475
|
-
} else {
|
|
476
|
-
return ''
|
|
477
|
-
}
|
|
478
|
-
} else {
|
|
479
|
-
return ''
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
lifetimes: {
|
|
484
|
-
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
485
|
-
moved: function () {},
|
|
486
|
-
detached: function () {},
|
|
487
|
-
},
|
|
488
|
-
methods: {
|
|
489
|
-
// 新版商户提现按钮文案
|
|
490
|
-
withdrawBtnText(taskItem) {
|
|
491
|
-
const { reward_value } = taskItem
|
|
492
|
-
let unableBtn = true,
|
|
493
|
-
ButtonText = '超时未提现'
|
|
494
|
-
switch (reward_value.pay_state) {
|
|
495
|
-
case 0:
|
|
496
|
-
case 2:
|
|
497
|
-
case 11:
|
|
498
|
-
ButtonText = '立即领取'
|
|
499
|
-
unableBtn = false
|
|
500
|
-
break
|
|
501
|
-
case 5:
|
|
502
|
-
ButtonText = '已领取'
|
|
503
|
-
break
|
|
504
|
-
case 10:
|
|
505
|
-
ButtonText = '超时未领取'
|
|
506
|
-
break
|
|
507
|
-
default:
|
|
508
|
-
break
|
|
509
|
-
}
|
|
510
|
-
this.setData({
|
|
511
|
-
unableBtn,
|
|
512
|
-
})
|
|
513
|
-
return ButtonText
|
|
514
|
-
},
|
|
515
|
-
// 打开答题任务答案解析
|
|
516
|
-
handleAnswerAnalysis() {
|
|
517
|
-
this.triggerEvent('btnClick', {
|
|
518
|
-
type: 'quizAnalysis',
|
|
519
|
-
taskItem: this.data.taskItem,
|
|
520
|
-
})
|
|
521
|
-
},
|
|
522
|
-
getHoursMinutes(minutes) {
|
|
523
|
-
const hours = Math.floor(minutes / 60)
|
|
524
|
-
const remainingMinutes = minutes % 60
|
|
525
|
-
return `${hours > 0 ? hours + '小时' : ''}${remainingMinutes > 0 ? remainingMinutes + '分钟' : ''}`
|
|
526
|
-
},
|
|
527
|
-
btnClick() {
|
|
528
|
-
const { reward_type, task_type, task_condition, reward_value, id } = this.data.taskItem
|
|
529
|
-
if (this.data.listType === 'task') {
|
|
530
|
-
if (['已完成', '未开始', '未完成', '已提交'].includes(this.data.btnText)) return
|
|
531
|
-
if (this.data.btnText === '待完成') {
|
|
532
|
-
wx.showToast({
|
|
533
|
-
title: '需完成上一个任务后才可解锁',
|
|
534
|
-
icon: 'none',
|
|
535
|
-
})
|
|
536
|
-
return
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
const { handle } = this.getTaskConfig(task_type, task_condition)
|
|
540
|
-
if (handle) {
|
|
541
|
-
this.triggerEvent('btnClick', {
|
|
542
|
-
type: handle,
|
|
543
|
-
taskItem: this.data.taskItem,
|
|
544
|
-
})
|
|
545
|
-
} else {
|
|
546
|
-
this.triggerEvent('btnClick', {
|
|
547
|
-
type: 'closePopup',
|
|
548
|
-
})
|
|
549
|
-
}
|
|
550
|
-
} else {
|
|
551
|
-
const { event } = this.getTaskConfig(task_type, task_condition)
|
|
552
|
-
this.triggerEvent('btnClick', {
|
|
553
|
-
type: list_type_config[this.data.listType]?.btnClick,
|
|
554
|
-
reward_type,
|
|
555
|
-
taskBelongType: event,
|
|
556
|
-
reward_value,
|
|
557
|
-
id,
|
|
558
|
-
})
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
getTaskConfig(task_type, task_condition) {
|
|
562
|
-
if (task_type === 1) task_condition = 1
|
|
563
|
-
return task_config[task_type][task_condition]
|
|
564
|
-
},
|
|
565
|
-
successWithDraw() {
|
|
566
|
-
this.triggerEvent('successWithDraw')
|
|
567
|
-
},
|
|
568
|
-
},
|
|
569
|
-
observers: {
|
|
570
|
-
isShowButton: function (isShowButton) {
|
|
571
|
-
if (isShowButton) {
|
|
572
|
-
this.setData({
|
|
573
|
-
ButtonText: this.withdrawBtnText(this.data.taskItem),
|
|
574
|
-
})
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
})
|
|
1
|
+
import taskBehavior from '../../../common/task'
|
|
2
|
+
const computedBehavior = require('miniprogram-computed').behavior
|
|
3
|
+
|
|
4
|
+
const getHoursMinutes = (minutes) => {
|
|
5
|
+
const hours = Math.floor(minutes / 60)
|
|
6
|
+
const remainingMinutes = minutes % 60
|
|
7
|
+
return `${hours > 0 ? hours + '小时' : ''}${remainingMinutes > 0 ? remainingMinutes + '分钟' : ''}`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const task_config = {
|
|
11
|
+
1: {
|
|
12
|
+
1: {
|
|
13
|
+
taskBelongType: 1,
|
|
14
|
+
taskBtnText: '去观看',
|
|
15
|
+
event: 'view',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
2: {
|
|
19
|
+
1: {
|
|
20
|
+
taskBelongType: 2,
|
|
21
|
+
taskBtnText: '去评论',
|
|
22
|
+
handle: 'toComment',
|
|
23
|
+
event: 'input',
|
|
24
|
+
},
|
|
25
|
+
2: {
|
|
26
|
+
taskBelongType: 3,
|
|
27
|
+
taskBtnText: '去转发',
|
|
28
|
+
handle: 'toShare',
|
|
29
|
+
event: 'share',
|
|
30
|
+
},
|
|
31
|
+
21: {
|
|
32
|
+
taskBelongType: 22,
|
|
33
|
+
taskBtnText: '去转发',
|
|
34
|
+
handle: 'toShare',
|
|
35
|
+
event: 'share',
|
|
36
|
+
},
|
|
37
|
+
22: {
|
|
38
|
+
taskBelongType: 23,
|
|
39
|
+
taskBtnText: '去转发',
|
|
40
|
+
handle: 'toShare',
|
|
41
|
+
event: 'share',
|
|
42
|
+
},
|
|
43
|
+
3: {
|
|
44
|
+
taskBelongType: 4,
|
|
45
|
+
taskBtnText: '去点赞',
|
|
46
|
+
event: 'like',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
3: {
|
|
50
|
+
4: {
|
|
51
|
+
taskBelongType: 5,
|
|
52
|
+
taskBtnText: '去下单',
|
|
53
|
+
handle: 'toGoods',
|
|
54
|
+
event: 'order',
|
|
55
|
+
},
|
|
56
|
+
5: {
|
|
57
|
+
taskBelongType: 6,
|
|
58
|
+
taskBtnText: '去消费',
|
|
59
|
+
handle: 'toGoods',
|
|
60
|
+
event: 'consumption',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
4: {
|
|
64
|
+
6: {
|
|
65
|
+
taskBelongType: 7,
|
|
66
|
+
taskBtnText: '去打赏',
|
|
67
|
+
handle: 'toGive',
|
|
68
|
+
event: 'give',
|
|
69
|
+
},
|
|
70
|
+
7: {
|
|
71
|
+
taskBelongType: 8,
|
|
72
|
+
taskBtnText: '去投票',
|
|
73
|
+
event: 'vote',
|
|
74
|
+
},
|
|
75
|
+
8: {
|
|
76
|
+
taskBelongType: 9,
|
|
77
|
+
taskBtnText: '去完成',
|
|
78
|
+
event: 'questionnaire',
|
|
79
|
+
},
|
|
80
|
+
9: {
|
|
81
|
+
taskBelongType: 10,
|
|
82
|
+
taskBtnText: '去签到',
|
|
83
|
+
handle: 'toSign',
|
|
84
|
+
event: 'sign',
|
|
85
|
+
},
|
|
86
|
+
10: {
|
|
87
|
+
taskBelongType: 11,
|
|
88
|
+
taskBtnText: '去答题',
|
|
89
|
+
handle: 'toQuiz',
|
|
90
|
+
event: 'quiz',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const list_type_config = {
|
|
96
|
+
reward: {
|
|
97
|
+
btnText: '去使用',
|
|
98
|
+
btnClick: 'reward',
|
|
99
|
+
},
|
|
100
|
+
error: {
|
|
101
|
+
btnText: '领奖励',
|
|
102
|
+
btnClick: 'toRetry',
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const TASK_TYPE_MAP = {
|
|
107
|
+
TASK_VIEW: 1,
|
|
108
|
+
TASK_COMMENTS: 2,
|
|
109
|
+
TASK_SHARE: 3,
|
|
110
|
+
TASK_LIKE: 4,
|
|
111
|
+
TASK_ORDER_COUNT: 5,
|
|
112
|
+
TASK_ORDER_MONEY: 6,
|
|
113
|
+
TASK_REWORD: 7,
|
|
114
|
+
TASK_VOTE: 8,
|
|
115
|
+
TASK_COMPLATE: 9,
|
|
116
|
+
TASK_SIGNIN: 10,
|
|
117
|
+
TASK_QUIZ: 11,
|
|
118
|
+
TASK_SHARE_OTHER: 22,
|
|
119
|
+
TASK_SHARE_NEW: 23,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
Component({
|
|
123
|
+
behaviors: [computedBehavior, taskBehavior],
|
|
124
|
+
properties: {
|
|
125
|
+
// 任务详情数据
|
|
126
|
+
// id 直播间任务ID
|
|
127
|
+
// task_module 任务种类 1组合任务
|
|
128
|
+
// is_show_answer c端是否展示答案解析,0不展示,1展示
|
|
129
|
+
// task_type 任务类型:1=观看任务,2=互动任务,3=消费任务,4=活跃任务
|
|
130
|
+
// task_condition 直播任务条件:观看任务时填写具体分钟值,互动任务时:1-评论 2-分享 3-点赞,消费任务时:4-下单笔数 5-消费金额,活跃任务时:6-打赏 7-投票 8-问卷 9-签到 10-答题任务
|
|
131
|
+
// state 任务状态:1-正常,2-已停止
|
|
132
|
+
// reward_type 奖励类型:0=无奖励,1=积分,2=优惠券,3=红包,4=课程/商品,5=自定义奖品
|
|
133
|
+
// reward_type 奖励类型:1=积分,2=优惠券,3=红包,4=课程/商品,5=自定义奖品
|
|
134
|
+
// reward_frequency 满足奖励所需频次,消费任务时:满足多少笔、或多少金额 ;答题任务时,答对多少题
|
|
135
|
+
// finish_frequency 已经完成奖励频次,消费任务时:满足多少笔、多少金额单位分
|
|
136
|
+
// reward_value 奖励值:积分数值、优惠券码、红包、商品、自定义奖品等。如果奖品存在多个字段,存储成json格式)
|
|
137
|
+
// start_at 任务开始时间
|
|
138
|
+
// end_at任务结束时间
|
|
139
|
+
// join_state 参与状态:0=未参与,1=参与中,2=已完成
|
|
140
|
+
// reward_state 奖励状态:1-待发放,2-发放成功,3-发放失败
|
|
141
|
+
// qs_is_pass 答题任务时,true-满足条件,false-不满足条件
|
|
142
|
+
taskItem: {
|
|
143
|
+
type: Object,
|
|
144
|
+
value: () => {
|
|
145
|
+
return {}
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
isRadius: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
value: false,
|
|
151
|
+
},
|
|
152
|
+
listType: {
|
|
153
|
+
type: String,
|
|
154
|
+
value: 'task',
|
|
155
|
+
},
|
|
156
|
+
itemIndex: {
|
|
157
|
+
type: Number,
|
|
158
|
+
value: 0,
|
|
159
|
+
},
|
|
160
|
+
isMb: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
value: false,
|
|
163
|
+
},
|
|
164
|
+
viewingInProgress: {
|
|
165
|
+
type: Array,
|
|
166
|
+
value: () => {
|
|
167
|
+
return []
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
teamId: {
|
|
171
|
+
type: String,
|
|
172
|
+
value: '',
|
|
173
|
+
},
|
|
174
|
+
// 任务下标 组合顺序任务需要用到
|
|
175
|
+
taskIdx: {
|
|
176
|
+
type: Number,
|
|
177
|
+
value: 0,
|
|
178
|
+
},
|
|
179
|
+
// 任务长度
|
|
180
|
+
taskLength: {
|
|
181
|
+
type: Number,
|
|
182
|
+
value: 0,
|
|
183
|
+
},
|
|
184
|
+
// 顺序组合任务
|
|
185
|
+
isInOrder: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: false,
|
|
188
|
+
},
|
|
189
|
+
//是否新商户
|
|
190
|
+
isNewChants: {
|
|
191
|
+
type: Number,
|
|
192
|
+
value: 0,
|
|
193
|
+
},
|
|
194
|
+
roomInfo: {
|
|
195
|
+
type: Object,
|
|
196
|
+
value: () => {
|
|
197
|
+
return {}
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
data: {
|
|
202
|
+
activeNames: ['1'],
|
|
203
|
+
taskBelongType: null, // 任务类型归属 1-观看 2-评论 3-转发 4-点赞
|
|
204
|
+
ButtonText: '', //新商户提现按钮文案
|
|
205
|
+
unableBtn: false, // 新商户提现按钮是否禁用
|
|
206
|
+
},
|
|
207
|
+
watch: {
|
|
208
|
+
taskItem: function (newVal) {
|
|
209
|
+
const { task_type, task_condition } = newVal
|
|
210
|
+
const { taskBelongType } = this.getTaskConfig(task_type, task_condition)
|
|
211
|
+
this.setData({
|
|
212
|
+
taskBelongType,
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
computed: {
|
|
217
|
+
// 是否是正在开始的拉新任务
|
|
218
|
+
isSharingTaskStatus({ isInOrder, taskItem }) {
|
|
219
|
+
const { task_module, join_state, progress, state, task_condition, task_type } = taskItem
|
|
220
|
+
if (state === 2 || join_state !== 1 || task_type !== 2 || ![21, 22].includes(+task_condition)) return false
|
|
221
|
+
if ((task_module === 1 && progress === 0 && isInOrder) || join_state === 2) return false
|
|
222
|
+
return true
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
// 是否展示奖励
|
|
226
|
+
isShowReward(data) {
|
|
227
|
+
const { listType, taskItem, isQuizTask } = data
|
|
228
|
+
// 组合任务 判断是否有奖励 reward_type和reward_value不能为0
|
|
229
|
+
if (data.isCombination) {
|
|
230
|
+
if (taskItem.reward_type === 0 && Number(taskItem.reward_value) === 0) {
|
|
231
|
+
return false
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return listType === 'task' || listType === 'error'
|
|
235
|
+
},
|
|
236
|
+
// 是否展示提现按钮
|
|
237
|
+
isShowButton(data) {
|
|
238
|
+
const { listType, taskItem, isNewChants } = data
|
|
239
|
+
const { reward_type } = taskItem
|
|
240
|
+
return listType === 'reward' && reward_type === 3 && isNewChants === 1
|
|
241
|
+
},
|
|
242
|
+
// 是否是答题任务
|
|
243
|
+
isQuizTask(data) {
|
|
244
|
+
const { taskItem } = data
|
|
245
|
+
return taskItem.task_type === 4 && taskItem.task_condition === '10'
|
|
246
|
+
},
|
|
247
|
+
// 未完成及已提交状态
|
|
248
|
+
getFailStatus(data) {
|
|
249
|
+
// 组合任务 子任务状态判断 progress=0未开启 join_state=0未参与
|
|
250
|
+
const { taskItem, isQuizTask, isInOrder } = data
|
|
251
|
+
return (
|
|
252
|
+
(isQuizTask && taskItem.join_state === 2 && !taskItem.qs_is_pass) ||
|
|
253
|
+
(taskItem.join_state === 0 && taskItem.state === 2) ||
|
|
254
|
+
(isInOrder && taskItem.progress === 0 && taskItem.join_state !== 0)
|
|
255
|
+
)
|
|
256
|
+
},
|
|
257
|
+
// 展示答题任务中,说明模块, 答题任务&&(任务结束||参与了)&&(任务结束&&没参与————这个有单独的提示)
|
|
258
|
+
showAnswerTaskIntroduce(data) {
|
|
259
|
+
const { taskItem, isQuizTask } = data
|
|
260
|
+
return (
|
|
261
|
+
isQuizTask &&
|
|
262
|
+
(taskItem.state === 2 || taskItem.join_state === 2) &&
|
|
263
|
+
!(taskItem.state === 2 && taskItem.join_state === 0)
|
|
264
|
+
)
|
|
265
|
+
},
|
|
266
|
+
// 组合任务
|
|
267
|
+
isCombination(data) {
|
|
268
|
+
return data.taskItem.task_module === 1
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* 任务标题
|
|
272
|
+
* num 需要完成的次数 如果没有reward_frequency默认就是1
|
|
273
|
+
*/
|
|
274
|
+
taskTitle(data) {
|
|
275
|
+
const { taskItem, listType } = data
|
|
276
|
+
const num = data.isCombination ? taskItem.reward_frequency : 1
|
|
277
|
+
const { task_condition, reward_frequency } = taskItem
|
|
278
|
+
|
|
279
|
+
let titleObj = {
|
|
280
|
+
[TASK_TYPE_MAP.TASK_VIEW]: `观看时长${getHoursMinutes(task_condition)}`,
|
|
281
|
+
[TASK_TYPE_MAP.TASK_COMMENTS]: `评论${num}次`,
|
|
282
|
+
[TASK_TYPE_MAP.TASK_SHARE]: `转发${num}次`,
|
|
283
|
+
[TASK_TYPE_MAP.TASK_LIKE]: `点赞${num}次`,
|
|
284
|
+
[TASK_TYPE_MAP.TASK_ORDER_COUNT]: `成功消费 ${reward_frequency} 笔订单数`,
|
|
285
|
+
[TASK_TYPE_MAP.TASK_ORDER_MONEY]: `成功消费 ${(reward_frequency / 100).toFixed(2)} 元`,
|
|
286
|
+
[TASK_TYPE_MAP.TASK_REWORD]: `打赏${num}次`,
|
|
287
|
+
[TASK_TYPE_MAP.TASK_VOTE]: `投票${num}次`,
|
|
288
|
+
[TASK_TYPE_MAP.TASK_COMPLATE]: `完成问卷${num}次`,
|
|
289
|
+
[TASK_TYPE_MAP.TASK_SIGNIN]: `签到${num}次`,
|
|
290
|
+
[TASK_TYPE_MAP.TASK_QUIZ]: `完成答题,并答对${reward_frequency}题`,
|
|
291
|
+
[TASK_TYPE_MAP.TASK_SHARE_OTHER]: '转发直播间',
|
|
292
|
+
[TASK_TYPE_MAP.TASK_SHARE_NEW]: '转发直播间(新用户)',
|
|
293
|
+
}
|
|
294
|
+
let res = titleObj[data.taskBelongType]
|
|
295
|
+
if (listType === 'reward' && data.isCombination) {
|
|
296
|
+
// 主任务
|
|
297
|
+
if (taskItem.task_is_major === 0) {
|
|
298
|
+
return `完成任务 ${taskItem.task_title}`
|
|
299
|
+
} else {
|
|
300
|
+
return `${taskItem.task_major_title}-${res}`
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return res
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
// 超时未完成
|
|
307
|
+
isShowTimeOver(data) {
|
|
308
|
+
const { isInOrder, taskItem } = data
|
|
309
|
+
if (isInOrder) {
|
|
310
|
+
// unDone 标志直接未完成
|
|
311
|
+
return taskItem?.unDone || (taskItem.join_state !== 2 && taskItem.state === 2)
|
|
312
|
+
} else {
|
|
313
|
+
return taskItem.join_state === 0 && taskItem.state === 2
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
// 组合顺序任务 展示文案 ‘需要完成上一个’
|
|
318
|
+
isShowCompletePrevious(data) {
|
|
319
|
+
const { isInOrder, taskItem } = data
|
|
320
|
+
if (!isInOrder) return
|
|
321
|
+
const { progress, state } = taskItem
|
|
322
|
+
// 如果上一个任务已经结束就无需展示
|
|
323
|
+
if (state === 2) return
|
|
324
|
+
if (data.listType === 'task' && progress === 0) {
|
|
325
|
+
return true
|
|
326
|
+
}
|
|
327
|
+
return false
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
// 是否展示 子任务还需要多少次才完成
|
|
331
|
+
isShowMultipleTask(data) {
|
|
332
|
+
const { reward_frequency, task_progress, finish_frequency, task_module, join_state, state } = data.taskItem
|
|
333
|
+
if (data.listType !== 'task' || task_module !== 1 || join_state === 2 || state === 2) return false
|
|
334
|
+
// 正在进行的观看任务
|
|
335
|
+
if (data.taskBelongType === 1) {
|
|
336
|
+
if (data.taskItem.progress === 1 || !data.isInOrder) return true
|
|
337
|
+
} else {
|
|
338
|
+
// 有奖励的子任务
|
|
339
|
+
if (reward_frequency !== 0 && (task_progress !== reward_frequency || Number(finish_frequency) === 0)) {
|
|
340
|
+
return true
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return false
|
|
344
|
+
},
|
|
345
|
+
// 任务奖励异常文案
|
|
346
|
+
rewardErrorDesc(data) {
|
|
347
|
+
const REWARD_SEND_FAIL_MAP = {
|
|
348
|
+
GoodsSendErr_1: '商品已下架,无法获取奖励',
|
|
349
|
+
GoodsSendErr_2: '商品已被删除,无法获取奖励',
|
|
350
|
+
// GoodsSendErr_3: "用户在黑名单,无法获取奖励",
|
|
351
|
+
GoodsSendErr_4: '已拥有该课程权益,无需重复发放奖励',
|
|
352
|
+
// GoodsSendErr_5: "用户在圈子黑名单,无法获取奖",
|
|
353
|
+
CouponSendErr_6: '由于优惠券被删除,无法获取奖励。请联系商家处理',
|
|
354
|
+
CouponSendErr_7: '领取优惠券操作频繁,无法获取奖励',
|
|
355
|
+
CouponSendErr_101: '用户完成任务时,由于优惠券库存为0,无法获取奖励。请联系商家处理',
|
|
356
|
+
CouponSendErr_102: '该优惠券领取已达上限,具体详情请咨询商家',
|
|
357
|
+
CouponSendErr_103: '优惠券被操作作废或停止,无法获取奖励。请联系商家处理',
|
|
358
|
+
CouponSendErr_104: '优惠券已过期,无法获取奖励。请联系用户处理',
|
|
359
|
+
RedPacketErr_10230008: '红包已抢完',
|
|
360
|
+
RedPacketErr_10230011: '红包领取失败,该环境无法领取微信红包',
|
|
361
|
+
RedPacketErr_10230035: '红包过期',
|
|
362
|
+
RedPacketErr_10230040: '领取红包入账异常',
|
|
363
|
+
UnknownSendErr: '奖励发放失败',
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const { reward_send_fail_reason } = data.taskItem
|
|
367
|
+
return (
|
|
368
|
+
REWARD_SEND_FAIL_MAP[reward_send_fail_reason] || reward_send_fail_reason || '奖品异常,无法领取,请联系商家处理'
|
|
369
|
+
)
|
|
370
|
+
},
|
|
371
|
+
// 组合子任务 需多少次才完成
|
|
372
|
+
childTaskContent(data) {
|
|
373
|
+
let time = data.taskItem.reward_frequency
|
|
374
|
+
let getResidueTime = ''
|
|
375
|
+
|
|
376
|
+
if (data.taskBelongType !== 1) {
|
|
377
|
+
const { reward_frequency, task_progress } = data.taskItem
|
|
378
|
+
time = reward_frequency - task_progress
|
|
379
|
+
if (time === 0) return
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// 观看任务不需要判断进度 看时间即可
|
|
383
|
+
if (data.taskBelongType === 1) {
|
|
384
|
+
if (data.viewingInProgress.length) {
|
|
385
|
+
const obj = data.viewingInProgress.find((item) => item.id === data.taskItem.id)
|
|
386
|
+
if (!obj) return
|
|
387
|
+
getResidueTime =
|
|
388
|
+
obj.residue_time && obj.residue_time > 60
|
|
389
|
+
? '再观看 ' + Math.floor(obj.residue_time / 60) + '分钟 ' + '完成任务'
|
|
390
|
+
: '即将获得奖励'
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
let titleObj = {
|
|
394
|
+
[TASK_TYPE_MAP.TASK_VIEW]: getResidueTime,
|
|
395
|
+
[TASK_TYPE_MAP.TASK_COMMENTS]: `再评论${time}次 完成任务`,
|
|
396
|
+
[TASK_TYPE_MAP.TASK_SHARE]: `再转发${time}次 完成任务`,
|
|
397
|
+
[TASK_TYPE_MAP.TASK_LIKE]: `再点赞${time}次 完成任务`,
|
|
398
|
+
[TASK_TYPE_MAP.TASK_VOTE]: `再参与投票${time}次 完成任务`,
|
|
399
|
+
[TASK_TYPE_MAP.TASK_COMPLATE]: `再参与问卷${time}次 完成任务`,
|
|
400
|
+
[TASK_TYPE_MAP.TASK_SIGNIN]: `再参与签到${time}次 完成任务`,
|
|
401
|
+
}
|
|
402
|
+
return titleObj[data.taskBelongType]
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
// 任务按钮
|
|
406
|
+
btnText(data) {
|
|
407
|
+
if (data.listType !== 'task') {
|
|
408
|
+
return list_type_config[data.listType]?.btnText
|
|
409
|
+
} else {
|
|
410
|
+
// 正常任务列表
|
|
411
|
+
const { join_state, state, task_type, task_condition, qs_is_pass } = data.taskItem
|
|
412
|
+
// 答题任务&&已参与&&没满足条件
|
|
413
|
+
if (data.isQuizTask && join_state === 2 && !qs_is_pass) {
|
|
414
|
+
//已提交
|
|
415
|
+
return '已提交'
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// 组合顺序任务 按顺序未解锁到的任务为 待完成状态
|
|
419
|
+
if (data.isInOrder && data.taskItem.progress === 0 && join_state !== 0) {
|
|
420
|
+
if (data.taskItem?.unDone) return '未完成'
|
|
421
|
+
return '待完成'
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (join_state === 2) return '已完成'
|
|
425
|
+
if (state === 2) return '未完成'
|
|
426
|
+
if (join_state === 0) return '未开始'
|
|
427
|
+
|
|
428
|
+
return task_config[task_type][task_type === 1 ? 1 : task_condition]?.taskBtnText || '去参与'
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
// 任务完成剩余条件
|
|
433
|
+
residueCondition(data) {
|
|
434
|
+
const { join_state, state, task_type, task_condition, reward_value, reward_type, id, task_module } = data.taskItem
|
|
435
|
+
if (join_state !== 1 || state === 2) return ''
|
|
436
|
+
|
|
437
|
+
if (task_type === 1) {
|
|
438
|
+
if (data.isCombination) return false
|
|
439
|
+
// 观看任务
|
|
440
|
+
if (data.viewingInProgress.length) {
|
|
441
|
+
const { residue_time } = data.viewingInProgress.find((item) => item.id === id)
|
|
442
|
+
return residue_time && residue_time > 60
|
|
443
|
+
? '再观看 ' + Math.floor(residue_time / 60) + '分钟 ' + '获得奖励'
|
|
444
|
+
: '即将获得奖励'
|
|
445
|
+
}
|
|
446
|
+
} else if (task_type === 3 && task_condition === '4') {
|
|
447
|
+
// 下单笔数
|
|
448
|
+
const { reward_frequency, finish_frequency } = data.taskItem
|
|
449
|
+
return reward_frequency && finish_frequency ? `再下${reward_frequency - finish_frequency}单 获得奖励` : ''
|
|
450
|
+
} else if (task_type === 3 && task_condition === '5') {
|
|
451
|
+
// 消费金额
|
|
452
|
+
const { reward_frequency, finish_frequency } = data.taskItem
|
|
453
|
+
return reward_frequency && finish_frequency
|
|
454
|
+
? `再消费${((reward_frequency - finish_frequency) / 100).toFixed(2)}元 获得奖励`
|
|
455
|
+
: ''
|
|
456
|
+
} else {
|
|
457
|
+
return ''
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
// 红包奖励剩余个数
|
|
462
|
+
redEnvelopeNum(data) {
|
|
463
|
+
const { join_state, state, reward_value, reward_type, reward_pay_type, team_pay_config } = data.taskItem
|
|
464
|
+
if (join_state !== 1 || state === 2 || reward_type !== 3 || (join_state === 0 && state === 2)) {
|
|
465
|
+
return ''
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (reward_pay_type === 0) {
|
|
469
|
+
return reward_value.remain_nums ? `领取名额还剩 ${reward_value.remain_nums}个` : '领取名额还剩 0个,无法领取'
|
|
470
|
+
} else if (reward_pay_type === 10 && team_pay_config) {
|
|
471
|
+
const storeList = JSON.parse(team_pay_config)
|
|
472
|
+
const storeItem = storeList.find((item) => item.team_id === data.teamId)
|
|
473
|
+
if (storeItem) {
|
|
474
|
+
return storeItem.limit_person ? `领取名额还剩 ${storeItem.limit_person}个` : '领取名额还剩 0个,无法领取'
|
|
475
|
+
} else {
|
|
476
|
+
return ''
|
|
477
|
+
}
|
|
478
|
+
} else {
|
|
479
|
+
return ''
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
lifetimes: {
|
|
484
|
+
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
485
|
+
moved: function () {},
|
|
486
|
+
detached: function () {},
|
|
487
|
+
},
|
|
488
|
+
methods: {
|
|
489
|
+
// 新版商户提现按钮文案
|
|
490
|
+
withdrawBtnText(taskItem) {
|
|
491
|
+
const { reward_value } = taskItem
|
|
492
|
+
let unableBtn = true,
|
|
493
|
+
ButtonText = '超时未提现'
|
|
494
|
+
switch (reward_value.pay_state) {
|
|
495
|
+
case 0:
|
|
496
|
+
case 2:
|
|
497
|
+
case 11:
|
|
498
|
+
ButtonText = '立即领取'
|
|
499
|
+
unableBtn = false
|
|
500
|
+
break
|
|
501
|
+
case 5:
|
|
502
|
+
ButtonText = '已领取'
|
|
503
|
+
break
|
|
504
|
+
case 10:
|
|
505
|
+
ButtonText = '超时未领取'
|
|
506
|
+
break
|
|
507
|
+
default:
|
|
508
|
+
break
|
|
509
|
+
}
|
|
510
|
+
this.setData({
|
|
511
|
+
unableBtn,
|
|
512
|
+
})
|
|
513
|
+
return ButtonText
|
|
514
|
+
},
|
|
515
|
+
// 打开答题任务答案解析
|
|
516
|
+
handleAnswerAnalysis() {
|
|
517
|
+
this.triggerEvent('btnClick', {
|
|
518
|
+
type: 'quizAnalysis',
|
|
519
|
+
taskItem: this.data.taskItem,
|
|
520
|
+
})
|
|
521
|
+
},
|
|
522
|
+
getHoursMinutes(minutes) {
|
|
523
|
+
const hours = Math.floor(minutes / 60)
|
|
524
|
+
const remainingMinutes = minutes % 60
|
|
525
|
+
return `${hours > 0 ? hours + '小时' : ''}${remainingMinutes > 0 ? remainingMinutes + '分钟' : ''}`
|
|
526
|
+
},
|
|
527
|
+
btnClick() {
|
|
528
|
+
const { reward_type, task_type, task_condition, reward_value, id } = this.data.taskItem
|
|
529
|
+
if (this.data.listType === 'task') {
|
|
530
|
+
if (['已完成', '未开始', '未完成', '已提交'].includes(this.data.btnText)) return
|
|
531
|
+
if (this.data.btnText === '待完成') {
|
|
532
|
+
wx.showToast({
|
|
533
|
+
title: '需完成上一个任务后才可解锁',
|
|
534
|
+
icon: 'none',
|
|
535
|
+
})
|
|
536
|
+
return
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const { handle } = this.getTaskConfig(task_type, task_condition)
|
|
540
|
+
if (handle) {
|
|
541
|
+
this.triggerEvent('btnClick', {
|
|
542
|
+
type: handle,
|
|
543
|
+
taskItem: this.data.taskItem,
|
|
544
|
+
})
|
|
545
|
+
} else {
|
|
546
|
+
this.triggerEvent('btnClick', {
|
|
547
|
+
type: 'closePopup',
|
|
548
|
+
})
|
|
549
|
+
}
|
|
550
|
+
} else {
|
|
551
|
+
const { event } = this.getTaskConfig(task_type, task_condition)
|
|
552
|
+
this.triggerEvent('btnClick', {
|
|
553
|
+
type: list_type_config[this.data.listType]?.btnClick,
|
|
554
|
+
reward_type,
|
|
555
|
+
taskBelongType: event,
|
|
556
|
+
reward_value,
|
|
557
|
+
id,
|
|
558
|
+
})
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
getTaskConfig(task_type, task_condition) {
|
|
562
|
+
if (task_type === 1) task_condition = 1
|
|
563
|
+
return task_config[task_type][task_condition]
|
|
564
|
+
},
|
|
565
|
+
successWithDraw() {
|
|
566
|
+
this.triggerEvent('successWithDraw')
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
observers: {
|
|
570
|
+
isShowButton: function (isShowButton) {
|
|
571
|
+
if (isShowButton) {
|
|
572
|
+
this.setData({
|
|
573
|
+
ButtonText: this.withdrawBtnText(this.data.taskItem),
|
|
574
|
+
})
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
})
|