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