buyagain.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="container all-type-list-wrapper">
  3. <buyagain-list
  4. ref="productList"
  5. @operationConfim="hanldOperationConfim"
  6. @goCartPage="hanldToCartPage"
  7. ></buyagain-list>
  8. <!-- 选择规格弹窗 -->
  9. <cm-unit-popup
  10. v-if="popupShow"
  11. :popupShow="popupShow"
  12. :skuProduct="handleData"
  13. @skuClick="handleSkuClick"
  14. ></cm-unit-popup>
  15. </view>
  16. </template>
  17. <script>
  18. import buyagainList from './components/buyagainList'
  19. import cmUnitPopup from './components/cm-unit-popup.vue'
  20. export default {
  21. components: {
  22. buyagainList,
  23. cmUnitPopup
  24. },
  25. data() {
  26. return {
  27. isIphoneX: this.$store.state.isIphoneX,
  28. handleData: {},
  29. serviceProviderId: 0,
  30. clubId: 0,
  31. popupShow:false
  32. }
  33. },
  34. onLoad() {},
  35. methods: {
  36. async initData(data) {
  37. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  38. const userInfo = await this.$api.getStorage()
  39. this.clubId = clubInfo.clubId
  40. this.serviceProviderId = userInfo.serviceProviderId
  41. this.getClubProductNum()
  42. },
  43. hanldOperationConfim(data) {
  44. //显示选择数量确认弹窗
  45. this.handleData = data
  46. this.popupShow = true
  47. },
  48. handleSkuClick(sku) {
  49. this.handleData.price = sku.price
  50. },
  51. hanldToCartPage() {
  52. this.$api.navigateTo('/pages/seller/cart/cart')
  53. },
  54. getClubProductNum() {
  55. this.SellerService.GetSellerProductNum({
  56. clubId: this.clubId,
  57. serviceProviderId: this.serviceProviderId
  58. }).then(response => {
  59. this.$refs.productList.cartQuantity = response.data
  60. })
  61. }
  62. },
  63. onShow() {
  64. this.initData()
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. page {
  70. background: $sub-bg-color;
  71. .all-type-list-wrapper {
  72. display: flex;
  73. flex-direction: column;
  74. }
  75. }
  76. /* 加入购物模态层*/
  77. @keyframes showPopup {
  78. 0% {
  79. opacity: 0;
  80. }
  81. 100% {
  82. opacity: 1;
  83. }
  84. }
  85. @keyframes hidePopup {
  86. 0% {
  87. opacity: 1;
  88. }
  89. 100% {
  90. opacity: 0;
  91. }
  92. }
  93. @keyframes showLayer {
  94. 0% {
  95. transform: translateY(0);
  96. }
  97. 100% {
  98. transform: translateY(-100%);
  99. }
  100. }
  101. @keyframes hideLayer {
  102. 0% {
  103. transform: translateY(-100%);
  104. }
  105. 100% {
  106. transform: translateY(0);
  107. }
  108. }
  109. @keyframes showAmnation {
  110. 0% {
  111. top: -12rpx;
  112. opacity: 0;
  113. }
  114. 50% {
  115. top: -60rpx;
  116. opacity: 1;
  117. }
  118. 100% {
  119. top: -100rpx;
  120. opacity: 0;
  121. }
  122. }
  123. @keyframes hideAmnation {
  124. 0% {
  125. top: -100rpx;
  126. opacity: 0;
  127. }
  128. 100% {
  129. top: -12rpx;
  130. opacity: 0;
  131. }
  132. }
  133. .popup {
  134. position: fixed;
  135. top: 0;
  136. width: 100%;
  137. height: 100%;
  138. z-index: 999;
  139. display: none;
  140. .mask {
  141. position: fixed;
  142. top: 0;
  143. width: 100%;
  144. height: 100%;
  145. z-index: 21;
  146. background-color: rgba(0, 0, 0, 0.6);
  147. }
  148. .layer {
  149. position: fixed;
  150. z-index: 22;
  151. bottom: -294rpx;
  152. width: 702rpx;
  153. padding: 24rpx 24rpx 36rpx 24rpx;
  154. height: 260rpx;
  155. border-radius: 20rpx 20rpx 0 0;
  156. background-color: #fff;
  157. display: flex;
  158. flex-wrap: wrap;
  159. align-content: space-between;
  160. .content {
  161. width: 100%;
  162. }
  163. .btn {
  164. width: 100%;
  165. height: 88rpx;
  166. display: flex;
  167. .button {
  168. width: 702rpx;
  169. height: 88rpx;
  170. color: #fff;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. font-size: $font-size-28;
  175. border-radius: 44rpx;
  176. background: $btn-confirm;
  177. }
  178. }
  179. }
  180. &.show {
  181. display: block;
  182. .mask {
  183. animation: showPopup 0.2s linear both;
  184. }
  185. .layer {
  186. animation: showLayer 0.2s linear both;
  187. }
  188. }
  189. &.hide {
  190. display: block;
  191. .mask {
  192. animation: hidePopup 0.2s linear both;
  193. }
  194. .layer {
  195. animation: hideLayer 0.2s linear both;
  196. }
  197. }
  198. &.none {
  199. display: none;
  200. }
  201. &.service {
  202. .row {
  203. margin: 30upx 0;
  204. .title {
  205. font-size: 30upx;
  206. margin: 10upx 0;
  207. }
  208. .description {
  209. font-size: 28upx;
  210. color: #999;
  211. }
  212. }
  213. }
  214. .layer-smimg {
  215. width: 114rpx;
  216. height: 114rpx;
  217. float: left;
  218. border-radius: 10rpx;
  219. margin-right: 24rpx;
  220. image {
  221. width: 114rpx;
  222. height: 114rpx;
  223. border-radius: 10rpx;
  224. }
  225. }
  226. .layer-nunbox {
  227. justify-content: space-between;
  228. align-items: center;
  229. width: 536rpx;
  230. height: 88rpx;
  231. padding: 13rpx 0 0 0;
  232. float: left;
  233. .layer-nunbox-t {
  234. width: 100%;
  235. height: 44rpx;
  236. position: relative;
  237. display: flex;
  238. .layer-nunbox-text {
  239. line-height: 44rpx;
  240. font-size: $font-size-28;
  241. }
  242. .number-box {
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. border: 2rpx solid #ffe6dc;
  247. border-radius: 30rpx;
  248. height: 48rpx;
  249. margin-left: 20rpx;
  250. .iconfont {
  251. font-size: $font-size-24;
  252. padding: 0 18rpx;
  253. color: #999999;
  254. text-align: center;
  255. line-height: 48rpx;
  256. font-weight: bold;
  257. background: #fef6f3;
  258. &.icon-jianhao {
  259. border-radius: 30rpx 0 0 30rpx;
  260. }
  261. &.icon-jiahao {
  262. border-radius: 0 30rpx 30rpx 0;
  263. }
  264. }
  265. .btn-input {
  266. width: 62rpx;
  267. height: 48rpx;
  268. line-height: 48rpx;
  269. background: #ffffff;
  270. border-radius: 4rpx;
  271. text-align: center;
  272. font-size: $font-size-28;
  273. }
  274. }
  275. .product-step {
  276. position: absolute;
  277. left: 45rpx;
  278. bottom: 0;
  279. height: 44rpx;
  280. background: #ffffff;
  281. }
  282. }
  283. .layer-nunbox-b {
  284. width: 100%;
  285. height: 44rpx;
  286. margin-top: 13rpx;
  287. }
  288. .text {
  289. line-height: 44rpx;
  290. font-size: $font-size-28;
  291. .p {
  292. color: #ff2a2a;
  293. }
  294. .p:first-child {
  295. margin-left: 30rpx;
  296. }
  297. .p.sm {
  298. font-size: $font-size-24;
  299. }
  300. }
  301. }
  302. }
  303. </style>