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,983 +1,997 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Descripttion:
|
|
3
|
-
* @version:
|
|
4
|
-
* @Author: conlinchen
|
|
5
|
-
* @Date: 2021-10-28 15:32:24
|
|
6
|
-
* @LastEditors: conlinchen
|
|
7
|
-
* @LastEditTime: 2021-11-18 19:52:02
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { getGoodsList, requestChangeShow, requestChangePrice, getSearchList } from '../common/api/liveGoodsList'
|
|
11
|
-
import { teaFormatItem } from '../common/utils/liveGoods'
|
|
12
|
-
const computedBehavior = require('miniprogram-computed').behavior
|
|
13
|
-
|
|
14
|
-
let activityCountdownTimer = null // 活动倒计时计时器
|
|
15
|
-
let hadActivity = false
|
|
16
|
-
let activityList = [] // 参与活动的商品
|
|
17
|
-
|
|
18
|
-
// 预热模块
|
|
19
|
-
let preheatTimer = null // 预热倒计时计时器
|
|
20
|
-
let hadPreheat = false
|
|
21
|
-
let preheatList = [] // 参与活动的商品
|
|
22
|
-
|
|
23
|
-
let hasActivity = false // 是否有参与活动的商品
|
|
24
|
-
let hasPreheat = false // 是否有参与预热的商品
|
|
25
|
-
|
|
26
|
-
Component({
|
|
27
|
-
behaviors: [computedBehavior],
|
|
28
|
-
properties: {
|
|
29
|
-
isGrayGoodsPreheat: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
value: false,
|
|
32
|
-
},
|
|
33
|
-
sensorReportParams: {
|
|
34
|
-
type: Object,
|
|
35
|
-
value: {},
|
|
36
|
-
},
|
|
37
|
-
aliveInfo: {
|
|
38
|
-
type: Object,
|
|
39
|
-
value: {
|
|
40
|
-
alive_id: 'l_61c2a4dae4b0ad9a9d6887dc',
|
|
41
|
-
alive_state: 2,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
ENV_NAME: {
|
|
45
|
-
type: String,
|
|
46
|
-
value: '',
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
type: Object,
|
|
82
|
-
value: {},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
case '
|
|
194
|
-
type = '
|
|
195
|
-
marketInfo =
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
break
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
//
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
case '
|
|
275
|
-
marketInfo.map((
|
|
276
|
-
for (let index = 0; index < goodsInfo.length; index++) {
|
|
277
|
-
if (id === goodsInfo[index].id) {
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
//
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
if (type === '
|
|
400
|
-
if (this.data.
|
|
401
|
-
this.showToast('
|
|
402
|
-
this.setData({
|
|
403
|
-
|
|
404
|
-
})
|
|
405
|
-
return
|
|
406
|
-
} else {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
this.
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
} else {
|
|
510
|
-
this.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
this.
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
})
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
)
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
this.
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
})
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
)
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}
|
|
883
|
-
},
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
}
|
|
934
|
-
},
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: conlinchen
|
|
5
|
+
* @Date: 2021-10-28 15:32:24
|
|
6
|
+
* @LastEditors: conlinchen
|
|
7
|
+
* @LastEditTime: 2021-11-18 19:52:02
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { getGoodsList, requestChangeShow, requestChangePrice, getSearchList } from '../common/api/liveGoodsList'
|
|
11
|
+
import { teaFormatItem } from '../common/utils/liveGoods'
|
|
12
|
+
const computedBehavior = require('miniprogram-computed').behavior
|
|
13
|
+
|
|
14
|
+
let activityCountdownTimer = null // 活动倒计时计时器
|
|
15
|
+
let hadActivity = false
|
|
16
|
+
let activityList = [] // 参与活动的商品
|
|
17
|
+
|
|
18
|
+
// 预热模块
|
|
19
|
+
let preheatTimer = null // 预热倒计时计时器
|
|
20
|
+
let hadPreheat = false
|
|
21
|
+
let preheatList = [] // 参与活动的商品
|
|
22
|
+
|
|
23
|
+
let hasActivity = false // 是否有参与活动的商品
|
|
24
|
+
let hasPreheat = false // 是否有参与预热的商品
|
|
25
|
+
|
|
26
|
+
Component({
|
|
27
|
+
behaviors: [computedBehavior],
|
|
28
|
+
properties: {
|
|
29
|
+
isGrayGoodsPreheat: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
value: false,
|
|
32
|
+
},
|
|
33
|
+
sensorReportParams: {
|
|
34
|
+
type: Object,
|
|
35
|
+
value: {},
|
|
36
|
+
},
|
|
37
|
+
aliveInfo: {
|
|
38
|
+
type: Object,
|
|
39
|
+
value: {
|
|
40
|
+
alive_id: 'l_61c2a4dae4b0ad9a9d6887dc',
|
|
41
|
+
alive_state: 2,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
ENV_NAME: {
|
|
45
|
+
type: String,
|
|
46
|
+
value: '',
|
|
47
|
+
},
|
|
48
|
+
// 热卖配置
|
|
49
|
+
hotSalesConf: {
|
|
50
|
+
type: Object,
|
|
51
|
+
value: {
|
|
52
|
+
is_show_stock: 0, // 显示库存开关
|
|
53
|
+
is_hot_sales_on: 0, // 商品热卖开关
|
|
54
|
+
hot_conf: {
|
|
55
|
+
sales: 30, // 热卖销量
|
|
56
|
+
stock: 10, // 热卖库存
|
|
57
|
+
all_sales: 100, // 历史销量
|
|
58
|
+
barrage_switch: 0, // 购物车上面的弹幕
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
showList: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
value: false,
|
|
65
|
+
observer(newVal) {
|
|
66
|
+
this.setData({
|
|
67
|
+
refreshing: newVal,
|
|
68
|
+
})
|
|
69
|
+
console.log(newVal)
|
|
70
|
+
|
|
71
|
+
newVal && this.onLoad()
|
|
72
|
+
if (!newVal) {
|
|
73
|
+
clearInterval(activityCountdownTimer)
|
|
74
|
+
activityCountdownTimer = null
|
|
75
|
+
clearInterval(preheatTimer)
|
|
76
|
+
preheatTimer = null
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
changState: {
|
|
81
|
+
type: Object,
|
|
82
|
+
value: {},
|
|
83
|
+
},
|
|
84
|
+
aliveConf: {
|
|
85
|
+
//is_takegoods: 是否开启直播带货,0-关闭 1-开启
|
|
86
|
+
type: Object,
|
|
87
|
+
value: {},
|
|
88
|
+
},
|
|
89
|
+
isFullScreen: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
value: false,
|
|
92
|
+
},
|
|
93
|
+
// im实时同步的带货消息
|
|
94
|
+
msgGoodsData: {
|
|
95
|
+
type: Object,
|
|
96
|
+
value: {},
|
|
97
|
+
observer(newVal) {
|
|
98
|
+
this.handlerListInfo(newVal)
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
isManage: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
value: false,
|
|
104
|
+
},
|
|
105
|
+
sendingGoodId: {
|
|
106
|
+
type: String,
|
|
107
|
+
value: '',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
data: {
|
|
111
|
+
goodsInfo: [],
|
|
112
|
+
page_size: 5,
|
|
113
|
+
page_index: 1,
|
|
114
|
+
total: 0,
|
|
115
|
+
refreshing: false,
|
|
116
|
+
finishedTxt: '加载中',
|
|
117
|
+
finished: false,
|
|
118
|
+
sendingIndex: -1,
|
|
119
|
+
sending: false,
|
|
120
|
+
selectGoods: [], // 多选列表
|
|
121
|
+
is_jurisdiction: false, // 操作权限
|
|
122
|
+
isSplitSelect: false, // 当前是否是单独勾选
|
|
123
|
+
selectGoodsIndexArr: [], // 当前已经选中的商品索引数组
|
|
124
|
+
is_show_now: 0, //当前已展示的数量
|
|
125
|
+
is_hide_now: 0, // 当前已隐藏的数量
|
|
126
|
+
isDisabled: false, // 复选框是否禁用
|
|
127
|
+
selectId: '', // 当前点击那一项的goodsId
|
|
128
|
+
goodsSwitch: 0, // 带货开关
|
|
129
|
+
goodsSwitchOld: -1, // 带货开关旧值,用于区分im上面switch是否是打开还是普通增删改
|
|
130
|
+
isBatchOperation: false, // 是否批量操作中
|
|
131
|
+
price_show_num: 0, // 价格已显示数量
|
|
132
|
+
price_hide_num: 0, // 价格已隐藏数量
|
|
133
|
+
changeStateLoading: false, // 商品状态更改中
|
|
134
|
+
searchStatus: false, // 是否是搜索状态
|
|
135
|
+
allSearchList: [], // 所有搜索商品列表
|
|
136
|
+
},
|
|
137
|
+
lifetimes: {
|
|
138
|
+
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
139
|
+
attached: function () {
|
|
140
|
+
this.setData({
|
|
141
|
+
goodsSwitch: this.data.aliveConf.is_takegoods,
|
|
142
|
+
goodsSwitchOld: this.data.aliveConf.is_takegoods,
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
moved: function () {},
|
|
146
|
+
detached: function () {},
|
|
147
|
+
},
|
|
148
|
+
methods: {
|
|
149
|
+
switchBatchOperation() {
|
|
150
|
+
this.setData({
|
|
151
|
+
isBatchOperation: !this.data.isBatchOperation,
|
|
152
|
+
selectGoods: [],
|
|
153
|
+
selectGoodsIndexArr: [],
|
|
154
|
+
})
|
|
155
|
+
},
|
|
156
|
+
// "sync_goods":{
|
|
157
|
+
// "switch":0,//开关:0关1开
|
|
158
|
+
// //带货配置列表-最多六条
|
|
159
|
+
// "conf_list":[],
|
|
160
|
+
// "update_list":[],
|
|
161
|
+
// //移除资源id
|
|
162
|
+
// "batch_del":["p_63845d8be4b07b05581ebf47"],
|
|
163
|
+
// //批量显示隐藏
|
|
164
|
+
// "batch_switch":[]
|
|
165
|
+
// }
|
|
166
|
+
/**
|
|
167
|
+
* 带货/优惠券实时同步
|
|
168
|
+
* @param {object} msgData im消息体
|
|
169
|
+
* @param {string} type 消息类型:带货goods、优惠券coupon
|
|
170
|
+
*/
|
|
171
|
+
handlerListInfo(msgData) {
|
|
172
|
+
let type = '',
|
|
173
|
+
marketInfo = []
|
|
174
|
+
// 遍历获取操作类型
|
|
175
|
+
for (let key in msgData) {
|
|
176
|
+
switch (key) {
|
|
177
|
+
// 带货开关操作
|
|
178
|
+
case 'switch':
|
|
179
|
+
type = 'goodsSwitch'
|
|
180
|
+
marketInfo = Number(msgData[key])
|
|
181
|
+
break
|
|
182
|
+
// 新增操作
|
|
183
|
+
case 'conf_list':
|
|
184
|
+
type = 'goodsConfList'
|
|
185
|
+
marketInfo = msgData[key]
|
|
186
|
+
break
|
|
187
|
+
// 修改操作
|
|
188
|
+
case 'update_list':
|
|
189
|
+
type = 'goodsUpdateList'
|
|
190
|
+
marketInfo = msgData[key]
|
|
191
|
+
break
|
|
192
|
+
// 删除操作
|
|
193
|
+
case 'batch_del':
|
|
194
|
+
type = 'goodsDelList'
|
|
195
|
+
marketInfo = msgData[key]
|
|
196
|
+
break
|
|
197
|
+
// 显隐操作
|
|
198
|
+
case 'batch_switch':
|
|
199
|
+
type = 'goodsBatchSwitchList'
|
|
200
|
+
marketInfo = msgData[key]
|
|
201
|
+
break
|
|
202
|
+
// 售罄/取消售罄操作
|
|
203
|
+
case 'is_sell_out':
|
|
204
|
+
type = 'goodsIsSellOut'
|
|
205
|
+
marketInfo = msgData.goods_info
|
|
206
|
+
break
|
|
207
|
+
case 'is_preheat':
|
|
208
|
+
type = 'is_preheat'
|
|
209
|
+
marketInfo = {
|
|
210
|
+
is_preheat: msgData[key],
|
|
211
|
+
resource_ids: msgData.goods_info?.resource_ids || [],
|
|
212
|
+
}
|
|
213
|
+
break
|
|
214
|
+
default:
|
|
215
|
+
break
|
|
216
|
+
}
|
|
217
|
+
console.log('[teacherGoodList] 带货实时同步im: ', type, marketInfo)
|
|
218
|
+
if (marketInfo?.length > 0 || ['goodsSwitch', 'goodsIsSellOut', 'is_preheat'].includes(type)) {
|
|
219
|
+
this.changeGoodsList(type, marketInfo)
|
|
220
|
+
type = ''
|
|
221
|
+
marketInfo = []
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
// 处理实时同步的带货逻辑
|
|
226
|
+
changeGoodsList(type, marketInfo) {
|
|
227
|
+
let goodsInfo = this.data.goodsInfo,
|
|
228
|
+
delIndex = -1, // 删除数据的当前下标
|
|
229
|
+
selectGoods = this.data.selectGoods, // 批量隐藏数组id
|
|
230
|
+
selectGoodsIndexArr = this.data.selectGoodsIndexArr, // 批量隐藏数组索引
|
|
231
|
+
total = this.data.total, // 管理商品总数
|
|
232
|
+
isHasGoods = false // 是否已有这个商品
|
|
233
|
+
switch (type) {
|
|
234
|
+
// 售罄/取消售罄操作
|
|
235
|
+
case 'goodsIsSellOut':
|
|
236
|
+
goodsInfo.some((item, index) => {
|
|
237
|
+
if (item.id === marketInfo.resource_id) {
|
|
238
|
+
goodsInfo[index].is_sell_out = +marketInfo.is_sell_out
|
|
239
|
+
return true
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
this.formatData(goodsInfo)
|
|
243
|
+
break
|
|
244
|
+
// 带货和优惠券开关操作
|
|
245
|
+
case 'goodsSwitch':
|
|
246
|
+
if ([0, 1].includes(marketInfo)) this.setData({ goodsSwitch: marketInfo })
|
|
247
|
+
break
|
|
248
|
+
case 'goodsConfList':
|
|
249
|
+
// 如果已经加载完了,可以拼接数据
|
|
250
|
+
// 由于看不出为何触发了两次,做id过滤
|
|
251
|
+
if (this.data.finished || this.data.finishedTxt === 'no-data') {
|
|
252
|
+
marketInfo.map((item) => {
|
|
253
|
+
for (let index = 0; index < goodsInfo.length; index++) {
|
|
254
|
+
if (item.id === goodsInfo[index].id) {
|
|
255
|
+
isHasGoods = true
|
|
256
|
+
break
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (!isHasGoods) {
|
|
260
|
+
// 管理商品需要增加
|
|
261
|
+
total++
|
|
262
|
+
this.formatData([item])
|
|
263
|
+
}
|
|
264
|
+
isHasGoods = false
|
|
265
|
+
})
|
|
266
|
+
this.setData({
|
|
267
|
+
finished: true,
|
|
268
|
+
finishedTxt: '没有更多了',
|
|
269
|
+
is_jurisdiction: this.data.goodsInfo[0] ? this.data.goodsInfo[0].teacher_auth == 2 : false,
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
break
|
|
273
|
+
case 'goodsUpdateList':
|
|
274
|
+
case 'goodsBatchSwitchList':
|
|
275
|
+
marketInfo.map((item) => {
|
|
276
|
+
for (let index = 0; index < goodsInfo.length; index++) {
|
|
277
|
+
if (item.id === goodsInfo[index].id) {
|
|
278
|
+
// 遍历插入相应的修改值
|
|
279
|
+
for (let key in item) {
|
|
280
|
+
goodsInfo[index][key] = item[key]
|
|
281
|
+
}
|
|
282
|
+
break
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
this.formatData(goodsInfo, true)
|
|
287
|
+
break
|
|
288
|
+
case 'goodsDelList':
|
|
289
|
+
marketInfo.map((id) => {
|
|
290
|
+
for (let index = 0; index < goodsInfo.length; index++) {
|
|
291
|
+
if (id === goodsInfo[index].id) {
|
|
292
|
+
// 删除操作,获取下标
|
|
293
|
+
goodsInfo.splice(index, 1)
|
|
294
|
+
delIndex = index
|
|
295
|
+
index--
|
|
296
|
+
// 管理商品需要减少
|
|
297
|
+
total--
|
|
298
|
+
}
|
|
299
|
+
// 删除后,后面的数据都要权重+1显示
|
|
300
|
+
if (delIndex > -1 && index >= delIndex) {
|
|
301
|
+
goodsInfo[index].order_weight--
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// 重置删除下标
|
|
305
|
+
delIndex = -1
|
|
306
|
+
|
|
307
|
+
// 此处处理批量显隐的,删掉了,需要把选择的也删掉
|
|
308
|
+
if (selectGoodsIndexArr.length > 0) {
|
|
309
|
+
for (let index = 0; index < selectGoodsIndexArr.length; index++) {
|
|
310
|
+
if (id === selectGoodsIndexArr[index]) {
|
|
311
|
+
// 删除操作,获取下标
|
|
312
|
+
selectGoodsIndexArr.splice(index, 1)
|
|
313
|
+
selectGoods.splice(index, 1)
|
|
314
|
+
index--
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
this.formatData(goodsInfo, true)
|
|
320
|
+
if (this.data.goodsInfo.length === 0) {
|
|
321
|
+
// 确保第一页没有了数据
|
|
322
|
+
this._freshing = true
|
|
323
|
+
this.setData({
|
|
324
|
+
finished: false,
|
|
325
|
+
page_index: 1,
|
|
326
|
+
})
|
|
327
|
+
this.getGoodsList()
|
|
328
|
+
}
|
|
329
|
+
break
|
|
330
|
+
case 'is_preheat':
|
|
331
|
+
// 预热
|
|
332
|
+
marketInfo.resource_ids.forEach((id) => {
|
|
333
|
+
this.data.goodsInfo.forEach((item) => {
|
|
334
|
+
if (item.id === id) {
|
|
335
|
+
item.is_preheat = +marketInfo.is_preheat
|
|
336
|
+
}
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
this.setData({
|
|
340
|
+
goodsInfo: this.data.goodsInfo,
|
|
341
|
+
})
|
|
342
|
+
break
|
|
343
|
+
default:
|
|
344
|
+
break
|
|
345
|
+
}
|
|
346
|
+
this.setData(
|
|
347
|
+
{
|
|
348
|
+
total,
|
|
349
|
+
selectGoods,
|
|
350
|
+
selectGoodsIndexArr,
|
|
351
|
+
},
|
|
352
|
+
() => {
|
|
353
|
+
if (!this.data.total) this.triggerEvent('isNullDate')
|
|
354
|
+
},
|
|
355
|
+
)
|
|
356
|
+
},
|
|
357
|
+
// 管理商品多选
|
|
358
|
+
onChange(e) {
|
|
359
|
+
// this.setData({
|
|
360
|
+
// selectGoods:e.detail
|
|
361
|
+
// })
|
|
362
|
+
let tempGoodsArr = []
|
|
363
|
+
e.detail.forEach((item) => {
|
|
364
|
+
for (let index = 0; index < this.data.goodsInfo.length; index++) {
|
|
365
|
+
if (item === this.data.goodsInfo[index].id) {
|
|
366
|
+
tempGoodsArr.push(this.data.goodsInfo[index])
|
|
367
|
+
break
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
})
|
|
371
|
+
this.setData({
|
|
372
|
+
selectGoods: tempGoodsArr,
|
|
373
|
+
selectGoodsIndexArr: e.detail,
|
|
374
|
+
})
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
// 显示隐藏
|
|
378
|
+
// 商品显隐操作
|
|
379
|
+
changeShowType(e) {
|
|
380
|
+
let { type } = e.target.dataset
|
|
381
|
+
// 未选择商品
|
|
382
|
+
if (!this.data.selectGoods.length) {
|
|
383
|
+
this.showToast('请先选择商品')
|
|
384
|
+
return
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// 商品是否已是对应的显隐状态
|
|
388
|
+
this.data.selectGoods.forEach((item) => {
|
|
389
|
+
if (item.is_display_package && type === 'show') {
|
|
390
|
+
this.setData({
|
|
391
|
+
is_show_now: this.data.is_show_now + 1,
|
|
392
|
+
})
|
|
393
|
+
} else if (!item.is_display_package && type === 'hide') {
|
|
394
|
+
this.setData({
|
|
395
|
+
is_hide_now: this.data.is_hide_now + 1,
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
})
|
|
399
|
+
if (type === 'show') {
|
|
400
|
+
if (this.data.is_show_now === this.data.selectGoods.length) {
|
|
401
|
+
this.showToast('当前选择的商品已显示')
|
|
402
|
+
this.setData({
|
|
403
|
+
is_show_now: 0,
|
|
404
|
+
})
|
|
405
|
+
return
|
|
406
|
+
} else {
|
|
407
|
+
this.requestChangeShow(1)
|
|
408
|
+
return
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// 隐藏商品确认弹窗
|
|
413
|
+
if (type === 'hide') {
|
|
414
|
+
if (this.data.is_hide_now === this.data.selectGoods.length) {
|
|
415
|
+
this.showToast('当前选择的商品已隐藏')
|
|
416
|
+
this.setData({
|
|
417
|
+
is_hide_now: 0,
|
|
418
|
+
})
|
|
419
|
+
return
|
|
420
|
+
} else {
|
|
421
|
+
wx.showModal({
|
|
422
|
+
title: `确认隐藏${
|
|
423
|
+
this.data.is_hide_now
|
|
424
|
+
? this.data.selectGoods.length - this.data.is_hide_now
|
|
425
|
+
: this.data.selectGoods.length
|
|
426
|
+
}个商品吗`,
|
|
427
|
+
content: '用户端商品列表不展示已隐藏商品,讲师仍可通过讲解发送商品',
|
|
428
|
+
confirmText: '确认',
|
|
429
|
+
cancelText: '取消',
|
|
430
|
+
confirmColor: '#1472FF',
|
|
431
|
+
success: (res) => {
|
|
432
|
+
if (res.confirm) {
|
|
433
|
+
this.requestChangeShow(0)
|
|
434
|
+
} else if (res.cancel) {
|
|
435
|
+
this.setData({
|
|
436
|
+
is_hide_now: 0,
|
|
437
|
+
})
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
})
|
|
441
|
+
return
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
// 商品显隐请求
|
|
447
|
+
requestChangeShow(state) {
|
|
448
|
+
const tempSelectGoodsArr = this.data.selectGoods.map((item) => ({
|
|
449
|
+
id: item.id,
|
|
450
|
+
type: item.true_type,
|
|
451
|
+
}))
|
|
452
|
+
const loginData = wx.getStorageSync('login_data')
|
|
453
|
+
let params = {
|
|
454
|
+
alive_id: this.data.aliveInfo.alive_id,
|
|
455
|
+
app_id: this.data.aliveInfo.app_id,
|
|
456
|
+
resource_ids: tempSelectGoodsArr,
|
|
457
|
+
is_display_package: state,
|
|
458
|
+
token: loginData.token,
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
requestChangeShow(params, false).then((res) => {
|
|
462
|
+
let { code } = res.data
|
|
463
|
+
if (code === 0) {
|
|
464
|
+
// let temp = `marketResource.courseList[${this.data.selectIndex}].is_display_package`
|
|
465
|
+
// 操作成功之后,要把当前选中的商品改变状态
|
|
466
|
+
let temp = ''
|
|
467
|
+
this.data.selectGoodsIndexArr.forEach((item) => {
|
|
468
|
+
for (let index = 0; index < this.data.goodsInfo.length; index++) {
|
|
469
|
+
if (item === this.data.goodsInfo[index].id) {
|
|
470
|
+
temp = `goodsInfo[${index}].is_display_package`
|
|
471
|
+
break
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
this.setData({
|
|
475
|
+
[temp]: state,
|
|
476
|
+
})
|
|
477
|
+
})
|
|
478
|
+
this.setData({
|
|
479
|
+
selectGoodsIndexArr: [],
|
|
480
|
+
selectGoods: [],
|
|
481
|
+
is_hide_now: 0,
|
|
482
|
+
is_show_now: 0,
|
|
483
|
+
})
|
|
484
|
+
this.showToast('操作成功')
|
|
485
|
+
} else {
|
|
486
|
+
this.setData({
|
|
487
|
+
is_hide_now: 0,
|
|
488
|
+
is_show_now: 0,
|
|
489
|
+
})
|
|
490
|
+
this.showToast('操作失败')
|
|
491
|
+
}
|
|
492
|
+
})
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
// 商品预热/开价操作前校验
|
|
496
|
+
changeHidePrice(e) {
|
|
497
|
+
let { type } = e.target.dataset
|
|
498
|
+
// 未选择商品
|
|
499
|
+
if (!this.data.selectGoods.length) {
|
|
500
|
+
this.showToast('请先选择商品')
|
|
501
|
+
return
|
|
502
|
+
}
|
|
503
|
+
// 商品价格状态是否已是对应的显隐状态
|
|
504
|
+
this.data.selectGoods.forEach((item) => {
|
|
505
|
+
if (!item.is_preheat && type === 'show') {
|
|
506
|
+
this.setData({
|
|
507
|
+
price_show_num: this.data.price_show_num + 1,
|
|
508
|
+
})
|
|
509
|
+
} else if (item.is_preheat && type === 'hide') {
|
|
510
|
+
this.setData({
|
|
511
|
+
price_hide_num: this.data.price_hide_num + 1,
|
|
512
|
+
})
|
|
513
|
+
}
|
|
514
|
+
})
|
|
515
|
+
|
|
516
|
+
if (type === 'show') {
|
|
517
|
+
if (this.data.price_show_num === this.data.selectGoods.length) {
|
|
518
|
+
this.showToast('当前选择的商品已开价')
|
|
519
|
+
this.setData({
|
|
520
|
+
price_show_num: 0,
|
|
521
|
+
})
|
|
522
|
+
return
|
|
523
|
+
} else {
|
|
524
|
+
this.changePriceShow(false, 0)
|
|
525
|
+
return
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (type === 'hide') {
|
|
530
|
+
if (this.data.price_hide_num === this.data.selectGoods.length) {
|
|
531
|
+
this.showToast('当前选择的商品已预热')
|
|
532
|
+
this.setData({
|
|
533
|
+
price_hide_num: 0,
|
|
534
|
+
})
|
|
535
|
+
return
|
|
536
|
+
} else {
|
|
537
|
+
this.changePriceShow(
|
|
538
|
+
true,
|
|
539
|
+
1,
|
|
540
|
+
this.data.price_hide_num
|
|
541
|
+
? this.data.selectGoods.length - this.data.price_hide_num
|
|
542
|
+
: this.data.selectGoods.length,
|
|
543
|
+
)
|
|
544
|
+
return
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
|
|
549
|
+
// 商品设置预热/取消预热 useCheck-检查是否讲解过
|
|
550
|
+
async changePriceShow(useCheck = true, isPreheat) {
|
|
551
|
+
if (this.data.changeStateLoading) return this.showToast('状态更改中,请稍后')
|
|
552
|
+
const { alive_id, app_id } = this.data.aliveInfo
|
|
553
|
+
const tempSelectGoodsArr = this.data.selectGoods.map((item) => String(item.id))
|
|
554
|
+
const params = {
|
|
555
|
+
alive_id,
|
|
556
|
+
app_id,
|
|
557
|
+
resource_ids: tempSelectGoodsArr,
|
|
558
|
+
is_preheat: isPreheat,
|
|
559
|
+
token: wx.getStorageSync('login_data').token,
|
|
560
|
+
is_check: useCheck ? 1 : 0,
|
|
561
|
+
}
|
|
562
|
+
this.setData({
|
|
563
|
+
changeStateLoading: true,
|
|
564
|
+
})
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
const res = await requestChangePrice(params, false)
|
|
568
|
+
const {
|
|
569
|
+
data: { code, data, msg },
|
|
570
|
+
} = res
|
|
571
|
+
|
|
572
|
+
if (code !== 0) {
|
|
573
|
+
throw new Error(msg || '操作失败')
|
|
574
|
+
}
|
|
575
|
+
if (!useCheck) {
|
|
576
|
+
let temp = ''
|
|
577
|
+
this.data.selectGoodsIndexArr.forEach((item) => {
|
|
578
|
+
for (let index = 0; index < this.data.goodsInfo.length; index++) {
|
|
579
|
+
if (item === this.data.goodsInfo[index].id) {
|
|
580
|
+
temp = `goodsInfo[${index}].is_preheat`
|
|
581
|
+
break
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
this.setData({
|
|
585
|
+
[temp]: isPreheat,
|
|
586
|
+
})
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
this.showToast('操作成功')
|
|
590
|
+
this.resetPriceState()
|
|
591
|
+
return
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
const modalConfig =
|
|
595
|
+
data?.length > 0
|
|
596
|
+
? {
|
|
597
|
+
title: '商品状态提示',
|
|
598
|
+
content: `其中含${data.length}个商品有讲解记录,预热后讨论区历史推送卡片价格不会同步变更`,
|
|
599
|
+
confirmText: '知道了',
|
|
600
|
+
cancelText: '取消预热',
|
|
601
|
+
}
|
|
602
|
+
: {
|
|
603
|
+
title: `确认预热${
|
|
604
|
+
this.data.price_hide_num
|
|
605
|
+
? this.data.selectGoods.length - this.data.price_hide_num
|
|
606
|
+
: this.data.selectGoods.length
|
|
607
|
+
}个商品吗`,
|
|
608
|
+
content: '商品开启预热后,用户端会隐藏商品价格且期间不支持购买',
|
|
609
|
+
confirmText: '确认',
|
|
610
|
+
cancelText: '取消',
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const isConfirm = await this.showConfirmModal(modalConfig)
|
|
614
|
+
if (isConfirm) {
|
|
615
|
+
this.setData({ changeStateLoading: false }, () => this.changePriceShow(false, isPreheat))
|
|
616
|
+
} else {
|
|
617
|
+
this.resetPriceState()
|
|
618
|
+
}
|
|
619
|
+
} catch (err) {
|
|
620
|
+
this.showToast(err)
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
|
|
624
|
+
resetPriceState() {
|
|
625
|
+
this.setData({
|
|
626
|
+
changeStateLoading: false,
|
|
627
|
+
price_hide_num: 0,
|
|
628
|
+
price_show_num: 0,
|
|
629
|
+
selectGoodsIndexArr: [],
|
|
630
|
+
selectGoods: [],
|
|
631
|
+
})
|
|
632
|
+
},
|
|
633
|
+
|
|
634
|
+
// 确认弹窗
|
|
635
|
+
showConfirmModal(options) {
|
|
636
|
+
return new Promise((resolve) => {
|
|
637
|
+
wx.showModal({
|
|
638
|
+
...options,
|
|
639
|
+
confirmColor: '#1472FF',
|
|
640
|
+
success: (res) => resolve(res.confirm),
|
|
641
|
+
fail: () => resolve(false),
|
|
642
|
+
})
|
|
643
|
+
})
|
|
644
|
+
},
|
|
645
|
+
|
|
646
|
+
// 商品总活动倒计时
|
|
647
|
+
startActivityCountdown(list) {
|
|
648
|
+
clearInterval(activityCountdownTimer)
|
|
649
|
+
activityCountdownTimer = setInterval(() => {
|
|
650
|
+
hadActivity = false
|
|
651
|
+
list.forEach((i) => {
|
|
652
|
+
let targetDate = new Date(i.time.replace(/-/g, '/')).getTime() - new Date().getTime()
|
|
653
|
+
if (targetDate <= 0) return
|
|
654
|
+
hadActivity = true
|
|
655
|
+
let temp = `goodsInfo[${i.index}].activityCountdown`
|
|
656
|
+
this.setData({
|
|
657
|
+
[temp]: targetDate,
|
|
658
|
+
})
|
|
659
|
+
})
|
|
660
|
+
if (!hadActivity) {
|
|
661
|
+
clearInterval(activityCountdownTimer)
|
|
662
|
+
activityCountdownTimer = null
|
|
663
|
+
}
|
|
664
|
+
}, 1000)
|
|
665
|
+
},
|
|
666
|
+
// 预热倒计时
|
|
667
|
+
startPreheatCountdown(list) {
|
|
668
|
+
clearInterval(preheatTimer)
|
|
669
|
+
preheatTimer = setInterval(() => {
|
|
670
|
+
hadPreheat = false
|
|
671
|
+
list.forEach((i) => {
|
|
672
|
+
let targetDate = new Date(i.time.replace(/-/g, '/')).getTime() - new Date().getTime()
|
|
673
|
+
if (targetDate <= 0) {
|
|
674
|
+
activityList.push({
|
|
675
|
+
time: this.data.goodsInfo[i.index].end_at,
|
|
676
|
+
index: i.index,
|
|
677
|
+
})
|
|
678
|
+
this.setData({
|
|
679
|
+
[`goodsInfo[${i.index}].preheatTime`]: 0,
|
|
680
|
+
})
|
|
681
|
+
return
|
|
682
|
+
}
|
|
683
|
+
hadPreheat = true
|
|
684
|
+
let temp = `goodsInfo[${i.index}].preheatTime`
|
|
685
|
+
this.setData({
|
|
686
|
+
[temp]: targetDate,
|
|
687
|
+
})
|
|
688
|
+
})
|
|
689
|
+
if (!hadPreheat) {
|
|
690
|
+
clearInterval(preheatTimer)
|
|
691
|
+
preheatTimer = null
|
|
692
|
+
}
|
|
693
|
+
}, 1000)
|
|
694
|
+
},
|
|
695
|
+
onLoad() {
|
|
696
|
+
if (!this.data.aliveConf.is_takegoods) {
|
|
697
|
+
this.setData({
|
|
698
|
+
refreshing: false,
|
|
699
|
+
})
|
|
700
|
+
return
|
|
701
|
+
}
|
|
702
|
+
if (this._freshing) return
|
|
703
|
+
this._freshing = true
|
|
704
|
+
this.setData({
|
|
705
|
+
finished: false,
|
|
706
|
+
page_index: 1,
|
|
707
|
+
})
|
|
708
|
+
this.getGoodsList()
|
|
709
|
+
},
|
|
710
|
+
onScrolltolower() {
|
|
711
|
+
if (
|
|
712
|
+
this.scrolling ||
|
|
713
|
+
this.data.finishedTxt === 'no-data' ||
|
|
714
|
+
!this.data.aliveConf.is_takegoods ||
|
|
715
|
+
this.data.finished
|
|
716
|
+
) {
|
|
717
|
+
return
|
|
718
|
+
}
|
|
719
|
+
this.scrolling = true
|
|
720
|
+
this.setData({
|
|
721
|
+
finishedTxt: this.data.finished ? '没有更多了' : '加载中',
|
|
722
|
+
})
|
|
723
|
+
if (this.data.finished || this._freshing) {
|
|
724
|
+
return
|
|
725
|
+
}
|
|
726
|
+
this.getGoodsList()
|
|
727
|
+
},
|
|
728
|
+
getGoodsList() {
|
|
729
|
+
let params = {
|
|
730
|
+
alive_id: this.data.aliveInfo.alive_id,
|
|
731
|
+
type: 1,
|
|
732
|
+
page_size: this.data.page_size,
|
|
733
|
+
page: this.data.page_index,
|
|
734
|
+
port: 2,
|
|
735
|
+
}
|
|
736
|
+
getGoodsList(params).then((res) => {
|
|
737
|
+
let { data, code } = res.data
|
|
738
|
+
if (code === 0) {
|
|
739
|
+
var total = data[0] ? data[0].total : this.data.total
|
|
740
|
+
var finishedTxt = '加载中'
|
|
741
|
+
var finished = false
|
|
742
|
+
let is_jurisdiction = data[0] ? data[0].teacher_auth == 2 : false
|
|
743
|
+
|
|
744
|
+
if (this._freshing) {
|
|
745
|
+
//下拉加载直接赋值
|
|
746
|
+
this.formatData(data, true)
|
|
747
|
+
} else {
|
|
748
|
+
this.formatData(data)
|
|
749
|
+
}
|
|
750
|
+
// 下拉加载,且数据返回空
|
|
751
|
+
if (this._freshing && data.length === 0) {
|
|
752
|
+
finishedTxt = 'no-data'
|
|
753
|
+
} else if (this.data.goodsInfo.length >= total || data.length === 0) {
|
|
754
|
+
// 获取到所有数据
|
|
755
|
+
finished = true // 没有更多了
|
|
756
|
+
finishedTxt = '没有更多了'
|
|
757
|
+
this.setData({ finishedTxt })
|
|
758
|
+
} else {
|
|
759
|
+
finishedTxt = '加载中'
|
|
760
|
+
}
|
|
761
|
+
this.setData({
|
|
762
|
+
refreshing: false,
|
|
763
|
+
page_index: this.data.page_index + 1,
|
|
764
|
+
finishedTxt,
|
|
765
|
+
finished,
|
|
766
|
+
total,
|
|
767
|
+
is_jurisdiction,
|
|
768
|
+
})
|
|
769
|
+
this._freshing = false
|
|
770
|
+
this.scrolling = false
|
|
771
|
+
}
|
|
772
|
+
})
|
|
773
|
+
},
|
|
774
|
+
formatData(data, refreshing = false) {
|
|
775
|
+
let goodsInfo = this.data.goodsInfo
|
|
776
|
+
data.forEach((item, index) => {
|
|
777
|
+
teaFormatItem(item)
|
|
778
|
+
if (!refreshing && item.id) {
|
|
779
|
+
goodsInfo.push(item)
|
|
780
|
+
}
|
|
781
|
+
})
|
|
782
|
+
if (refreshing) {
|
|
783
|
+
//下拉刷新的时候直接赋值
|
|
784
|
+
goodsInfo = JSON.parse(JSON.stringify(data))
|
|
785
|
+
}
|
|
786
|
+
this.setData(
|
|
787
|
+
{
|
|
788
|
+
goodsInfo,
|
|
789
|
+
},
|
|
790
|
+
() => {
|
|
791
|
+
this.getActivityStatus(this.data.goodsInfo)
|
|
792
|
+
},
|
|
793
|
+
)
|
|
794
|
+
},
|
|
795
|
+
getActivityStatus(data) {
|
|
796
|
+
activityList = []
|
|
797
|
+
preheatList = []
|
|
798
|
+
data.forEach((item, index) => {
|
|
799
|
+
if (item.is_activity && item.end_at) {
|
|
800
|
+
hasActivity = true
|
|
801
|
+
item.activityCountdown = 0
|
|
802
|
+
activityList.push({
|
|
803
|
+
time: item.end_at,
|
|
804
|
+
index,
|
|
805
|
+
})
|
|
806
|
+
}
|
|
807
|
+
// this.data.isSeckill && this.data.preheating
|
|
808
|
+
if (item.activity_type === 8 && item.sec_kill_is_preheat === 1) {
|
|
809
|
+
//预热开始时间
|
|
810
|
+
let startTime = (item.start_at && new Date(item.start_at.replace(/-/g, '/'))) || new Date()
|
|
811
|
+
let times = startTime.getTime() - item.sec_kill_preheat_time * 1000
|
|
812
|
+
let preHeatTime = new Date(times) || new Date()
|
|
813
|
+
|
|
814
|
+
let startTime2 = (item.start_at && new Date(item.start_at.replace(/-/g, '/'))) || new Date()
|
|
815
|
+
let nowTime = new Date().getTime()
|
|
816
|
+
let preheating = nowTime > preHeatTime.getTime() && startTime2.getTime() > nowTime
|
|
817
|
+
|
|
818
|
+
if (preheating) {
|
|
819
|
+
hasPreheat = true
|
|
820
|
+
item.preheatTime = 0
|
|
821
|
+
preheatList.push({
|
|
822
|
+
time: item.start_at,
|
|
823
|
+
index,
|
|
824
|
+
})
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
})
|
|
828
|
+
if (hasActivity) this.startActivityCountdown(activityList) //活动倒计时
|
|
829
|
+
if (hasPreheat) this.startPreheatCountdown(preheatList) // 预热倒计时
|
|
830
|
+
},
|
|
831
|
+
closePop() {
|
|
832
|
+
this.triggerEvent('closePop')
|
|
833
|
+
},
|
|
834
|
+
preventScroll() {
|
|
835
|
+
return
|
|
836
|
+
},
|
|
837
|
+
changeGoodsState(e) {
|
|
838
|
+
const { index, type, state } = e.detail
|
|
839
|
+
const goods = this.data.goodsInfo[index]
|
|
840
|
+
|
|
841
|
+
goods[type] = state
|
|
842
|
+
|
|
843
|
+
this.setData({
|
|
844
|
+
[`goodsInfo[${index}]`]: goods,
|
|
845
|
+
})
|
|
846
|
+
},
|
|
847
|
+
sendGoodsCard(e) {
|
|
848
|
+
console.log('npm', e)
|
|
849
|
+
let dataset = e.detail.datas
|
|
850
|
+
this.setData({
|
|
851
|
+
sending: true,
|
|
852
|
+
sendingIndex: dataset['index'],
|
|
853
|
+
})
|
|
854
|
+
// 触发父组件的send
|
|
855
|
+
this.triggerEvent('sendGoodsCard', {
|
|
856
|
+
datas: dataset,
|
|
857
|
+
})
|
|
858
|
+
this.searchBack()
|
|
859
|
+
},
|
|
860
|
+
clear() {
|
|
861
|
+
this.setData({
|
|
862
|
+
goodsInfo: [],
|
|
863
|
+
finishedTxt: 'no-data',
|
|
864
|
+
})
|
|
865
|
+
},
|
|
866
|
+
setIsTakeGoods(value) {
|
|
867
|
+
this.setData({
|
|
868
|
+
['aliveConf.is_takegoods']: value,
|
|
869
|
+
})
|
|
870
|
+
},
|
|
871
|
+
deleteGood(id) {
|
|
872
|
+
let deleteGoodIndex
|
|
873
|
+
if (!this.data.goodsInfo) return
|
|
874
|
+
this.data.goodsInfo.forEach((goods, index) => {
|
|
875
|
+
if (goods.id === id) {
|
|
876
|
+
deleteGoodIndex = index
|
|
877
|
+
}
|
|
878
|
+
})
|
|
879
|
+
deleteGoodIndex !== undefined && this.data.goodsInfo.splice(deleteGoodIndex, 1)
|
|
880
|
+
this.setData({
|
|
881
|
+
goodsInfo: this.data.goodsInfo,
|
|
882
|
+
})
|
|
883
|
+
},
|
|
884
|
+
selectToast(e) {
|
|
885
|
+
let tempItemIndex = e.currentTarget.dataset.item
|
|
886
|
+
this.setData({
|
|
887
|
+
selectId: this.data.goodsInfo[tempItemIndex].id,
|
|
888
|
+
})
|
|
889
|
+
if (
|
|
890
|
+
this.data.selectGoodsIndexArr.length >= 10 &&
|
|
891
|
+
this.data.selectGoodsIndexArr.indexOf(this.data.selectId) === -1
|
|
892
|
+
) {
|
|
893
|
+
this.showToast('批量操作最多支持10条')
|
|
894
|
+
} else {
|
|
895
|
+
return
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
showToast(title = '') {
|
|
899
|
+
wx.showToast({
|
|
900
|
+
title,
|
|
901
|
+
icon: 'none',
|
|
902
|
+
duration: 1000,
|
|
903
|
+
})
|
|
904
|
+
},
|
|
905
|
+
toSearch() {
|
|
906
|
+
getSearchList({
|
|
907
|
+
app_id: this.data.aliveInfo.app_id,
|
|
908
|
+
alive_id: this.data.aliveInfo.alive_id,
|
|
909
|
+
user_id: this.data.aliveInfo.user_id,
|
|
910
|
+
port: 1,
|
|
911
|
+
})
|
|
912
|
+
.then((res) => {
|
|
913
|
+
if (res.data.code === 0) {
|
|
914
|
+
this.setData({
|
|
915
|
+
allSearchList: res.data.data || [],
|
|
916
|
+
searchStatus: true,
|
|
917
|
+
})
|
|
918
|
+
}
|
|
919
|
+
})
|
|
920
|
+
.catch((err) => {
|
|
921
|
+
console.error('获取搜索列表异常', err)
|
|
922
|
+
wx.showToast({
|
|
923
|
+
title: '获取搜索列表异常',
|
|
924
|
+
icon: 'none',
|
|
925
|
+
duration: 2000,
|
|
926
|
+
})
|
|
927
|
+
})
|
|
928
|
+
},
|
|
929
|
+
searchBack() {
|
|
930
|
+
this.setData({
|
|
931
|
+
searchStatus: false,
|
|
932
|
+
allSearchList: [],
|
|
933
|
+
})
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
observers: {
|
|
937
|
+
// 监听点击发送事件
|
|
938
|
+
'changState.time': function (newVal) {
|
|
939
|
+
// 处理成功回调,主要用于变更按钮发送状态
|
|
940
|
+
console.log('changState', newVal, this.properties.changState)
|
|
941
|
+
let state = this.properties.changState
|
|
942
|
+
if (state && state.index != -1) {
|
|
943
|
+
this.setData({
|
|
944
|
+
sending: false,
|
|
945
|
+
sendingIndex: state.index,
|
|
946
|
+
})
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
total: function (newVal) {
|
|
950
|
+
this.triggerEvent('totalChange', newVal)
|
|
951
|
+
},
|
|
952
|
+
isManage: function (newVal) {
|
|
953
|
+
this.setData({
|
|
954
|
+
isBatchOperation: false,
|
|
955
|
+
selectGoods: [],
|
|
956
|
+
})
|
|
957
|
+
},
|
|
958
|
+
is_jurisdiction: function (newVal) {
|
|
959
|
+
this.triggerEvent('jurisdictionChange', newVal)
|
|
960
|
+
},
|
|
961
|
+
goodsSwitch: function (newVal) {
|
|
962
|
+
if (this.data.goodsSwitchOld === 0 && newVal === 1 && this.data.showList) {
|
|
963
|
+
this._freshing = true
|
|
964
|
+
this.setData({
|
|
965
|
+
finished: false,
|
|
966
|
+
page_index: 1,
|
|
967
|
+
})
|
|
968
|
+
this.getGoodsList()
|
|
969
|
+
} else if (newVal === 0) {
|
|
970
|
+
this.triggerEvent('closePopup')
|
|
971
|
+
this.triggerEvent('isNullDate')
|
|
972
|
+
this.setData({
|
|
973
|
+
goodsInfo: [],
|
|
974
|
+
page_size: 5,
|
|
975
|
+
page_index: 1,
|
|
976
|
+
total: 0,
|
|
977
|
+
refreshing: false,
|
|
978
|
+
finished: false,
|
|
979
|
+
sendingIndex: -1,
|
|
980
|
+
sending: false,
|
|
981
|
+
selectGoods: [], // 多选列表
|
|
982
|
+
is_jurisdiction: false, // 操作权限
|
|
983
|
+
isSplitSelect: false, // 当前是否是单独勾选
|
|
984
|
+
selectGoodsIndexArr: [], // 当前已经选中的商品索引数组
|
|
985
|
+
is_show_now: 0, //当前已展示的数量
|
|
986
|
+
is_hide_now: 0, // 当前已隐藏的数量
|
|
987
|
+
isDisabled: false, // 复选框是否禁用
|
|
988
|
+
selectId: '', // 当前点击那一项的goodsId
|
|
989
|
+
})
|
|
990
|
+
}
|
|
991
|
+
// 设置一下本次更改的开关值
|
|
992
|
+
this.setData({
|
|
993
|
+
goodsSwitchOld: newVal,
|
|
994
|
+
})
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
|
+
})
|