goodList.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404
  1. <template>
  2. <view class="goodList" :style="[bgRadius]">
  3. <common-wrapper :config="configData">
  4. <!-- Header Section -->
  5. <view
  6. class="header-box"
  7. :style="[headerBoxStyle]"
  8. v-if="headerText || headerImg"
  9. >
  10. <view
  11. class="title-text"
  12. v-if="headerType == 0"
  13. :style="[titleTextStyle]"
  14. >
  15. {{ headerText }}
  16. </view>
  17. <view class="title-img" v-else :style="[titleImgBoxStyle]">
  18. <image
  19. :src="headerImg"
  20. mode="widthFix"
  21. :style="[titleImgStyle]"
  22. v-if="headerImg"
  23. ></image>
  24. </view>
  25. </view>
  26. <view v-if="tempArr.length > 0" class="list">
  27. <!-- 单列 -->
  28. <view v-if="styleConfig == 0">
  29. <view
  30. class="w-full flex justify-between item bg--w111-fff p-20"
  31. :style="[bgColor, bgRadius]"
  32. v-for="(item, index) in tempArr"
  33. :key="index"
  34. @tap="goDetail(item)"
  35. >
  36. <easy-loadimage
  37. :image-src="item.image"
  38. width="224rpx"
  39. height="224rpx"
  40. :borderRadius="imgStyle"
  41. ></easy-loadimage>
  42. <view class="flex-1 flex-col justify-between pl-20">
  43. <view
  44. class="w-full fs-28 h-80 lh-40rpx line2"
  45. v-if="checkboxInfo.includes(0)"
  46. :style="[productStyle]"
  47. >
  48. <text v-if="item.brand_name" class="brand-tag">{{
  49. item.brand_name
  50. }}</text>
  51. {{ item.store_name }}
  52. </view>
  53. <view
  54. class="flex items-end flex-wrap mt-8 w-full"
  55. v-if="
  56. checkboxInfo.includes(1) &&
  57. item.label_list &&
  58. item.label_list.length
  59. "
  60. >
  61. <BaseTag
  62. :text="label.name"
  63. :color="label.font_color"
  64. :background="label.bg_color"
  65. :borderColor="label.border_color"
  66. :circle="label.border_color ? true : false"
  67. :imgSrc="label.image"
  68. v-for="(label, idx) in item.label_list"
  69. :key="idx"
  70. ></BaseTag>
  71. </view>
  72. <view class="flex-between-center" v-if="onlyShowPrice">
  73. <baseMoney
  74. :money="item.price"
  75. symbolSize="24"
  76. integerSize="40"
  77. decimalSize="24"
  78. weight
  79. :color="priceColor"
  80. ></baseMoney>
  81. <view @tap.stop="addCartChange(item, index)" v-if="!showBtn">
  82. <view
  83. class="w-96 h-56 rd-28rpx flex-center fs-24 text--w111-fff"
  84. v-if="btnStyle == 0"
  85. :style="[btnBgColor]"
  86. >{{ $t(`购买`) }}</view
  87. >
  88. <view
  89. class="rd-24rpx w-44 h-44"
  90. :style="[btnTextColor]"
  91. v-else-if="btnStyle == 1"
  92. >
  93. <view class="flex-center cart-btn">
  94. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  95. </view>
  96. </view>
  97. <view
  98. class="rd-24rpx w-44 h-44"
  99. :style="[btnTextColor]"
  100. v-else
  101. >
  102. <view class="flex-center cart-btn">
  103. <text class="iconfont icon-ic_ShoppingCart1 fs-26"></text>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <view v-else>
  109. <view class="flex-y-center mt-4 pb-10">
  110. <baseMoney
  111. :money="item.price"
  112. symbolSize="24"
  113. integerSize="40"
  114. decimalSize="24"
  115. weight
  116. :color="priceColor"
  117. v-if="checkboxInfo.includes(2)"
  118. ></baseMoney>
  119. <view
  120. class="flex h-26 lh-28rpx rd-14rpx bg--w111-F7E9CD fs-22 ml-8"
  121. v-if="
  122. Number(item.vip_price) > 0 && checkboxInfo.includes(5)
  123. "
  124. >
  125. <text
  126. class="inline-block h-26 lh-28rpx svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8"
  127. >SVIP</text
  128. >
  129. <text class="px-8 fs-22 SemiBold"
  130. >{{ $t(`¥`) }}{{ item.vip_price }}</text
  131. >
  132. </view>
  133. </view>
  134. <view class="flex justify-between items-end relative">
  135. <view class="flex-y-center">
  136. <text
  137. class="fs-22"
  138. v-if="checkboxInfo.includes(3)"
  139. :style="[uniStyle]"
  140. >{{ $t(`已售`) }}{{ item.sales
  141. }}{{ item.unit_name }}</text
  142. >
  143. <text
  144. class="fs-22 text--w111-999 pl-16"
  145. v-if="checkboxInfo.includes(4)"
  146. >评分{{ item.star || 0 }}</text
  147. >
  148. </view>
  149. <view
  150. class="absolute right-0 bottom-0"
  151. @tap.stop="addCartChange(item, index)"
  152. v-if="!showBtn"
  153. >
  154. <view
  155. class="w-96 h-56 rd-28rpx flex-center fs-24 text--w111-fff"
  156. v-if="btnStyle == 0"
  157. :style="[btnBgColor]"
  158. >{{ $t(`购买`) }}</view
  159. >
  160. <view
  161. class="rd-24rpx w-44 h-44"
  162. :style="[btnTextColor]"
  163. v-else-if="btnStyle == 1"
  164. >
  165. <view class="flex-center cart-btn">
  166. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  167. </view>
  168. </view>
  169. <view
  170. class="rd-24rpx w-44 h-44"
  171. :style="[btnTextColor]"
  172. v-else
  173. >
  174. <view class="flex-center cart-btn">
  175. <text
  176. class="iconfont icon-ic_ShoppingCart1 fs-26"
  177. ></text>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. </view>
  186. <!-- 两列瀑布流 -->
  187. <view class="wf-page" v-if="goodStyleConfig == 1">
  188. <!-- left -->
  189. <view class="item-box">
  190. <view id="left" v-if="leftList.length">
  191. <view
  192. v-for="(item, index) in leftList"
  193. :key="index"
  194. class="wf-item"
  195. @tap="goDetail(item)"
  196. :style="[bgColor, bgRadius]"
  197. >
  198. <view class="pictrue">
  199. <easy-loadimage
  200. mode="widthFix"
  201. :image-src="item.image"
  202. width="100%"
  203. height="346rpx"
  204. :borderRadius="imgStyle"
  205. ></easy-loadimage>
  206. </view>
  207. <view class="info_box" :style="[bgRadius2]">
  208. <view
  209. class="w-full line2 fs-28 text--w111-333 lh-40rpx"
  210. v-if="checkboxInfo.includes(0)"
  211. :style="[productStyle]"
  212. >
  213. <text v-if="item.brand_name" class="brand-tag">{{
  214. item.brand_name
  215. }}</text>
  216. {{ item.store_name }}
  217. </view>
  218. <view
  219. class="flex items-end flex-wrap mt-8 w-full"
  220. v-if="
  221. checkboxInfo.includes(1) &&
  222. item.label_list &&
  223. item.label_list.length
  224. "
  225. >
  226. <BaseTag
  227. :text="label.name"
  228. :color="label.font_color"
  229. :background="label.bg_color"
  230. :borderColor="label.border_color"
  231. :circle="label.border_color ? true : false"
  232. :imgSrc="label.image"
  233. v-for="(label, idx) in item.label_list"
  234. :key="idx"
  235. ></BaseTag>
  236. </view>
  237. <view class="flex-between-center mt-20" v-if="onlyShowPrice">
  238. <baseMoney
  239. :money="item.price"
  240. symbolSize="24"
  241. integerSize="40"
  242. decimalSize="24"
  243. weight
  244. :color="priceColor"
  245. ></baseMoney>
  246. <view
  247. @tap.stop="addCartChange(item, index)"
  248. v-if="!showBtn"
  249. >
  250. <view
  251. class="rd-24rpx w-44 h-44"
  252. :style="[btnTextColor]"
  253. v-if="btnStyle == 0"
  254. >
  255. <view class="flex-center cart-btn">
  256. <text
  257. class="iconfont icon-ic_increase-2 fs-26"
  258. ></text>
  259. </view>
  260. </view>
  261. <view
  262. class="rd-24rpx w-44 h-44"
  263. :style="[btnTextColor]"
  264. v-else
  265. >
  266. <view class="flex-center cart-btn">
  267. <text
  268. class="iconfont icon-ic_ShoppingCart1 fs-26"
  269. ></text>
  270. </view>
  271. </view>
  272. </view>
  273. </view>
  274. <view v-else>
  275. <view class="flex-y-center flex-no-wrap mt-8">
  276. <baseMoney
  277. :money="item.price"
  278. symbolSize="24"
  279. integerSize="40"
  280. decimalSize="24"
  281. weight
  282. :color="priceColor"
  283. v-if="checkboxInfo.includes(2)"
  284. ></baseMoney>
  285. <view
  286. class="inline-block white-nowrap h-26 lh-28rpx rd-14rpx bg--w111-F7E9CD fs-22 ml-8"
  287. v-if="
  288. Number(item.vip_price) > 0 && checkboxInfo.includes(5)
  289. "
  290. >
  291. <text
  292. class="inline-block h-26 lh-28rpx svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8"
  293. >SVIP</text
  294. >
  295. <text class="px-8 fs-22 SemiBold"
  296. >{{ $t(`¥`) }}{{ item.vip_price }}</text
  297. >
  298. </view>
  299. </view>
  300. <view class="flex-between-center mt-20">
  301. <text
  302. class="fs-22"
  303. v-if="checkboxInfo.includes(3)"
  304. :style="[uniStyle]"
  305. >{{ $t(`已售`) }}{{ item.sales
  306. }}{{ item.unit_name }}</text
  307. >
  308. <view
  309. @tap.stop="addCartChange(item, index)"
  310. v-if="!showBtn"
  311. >
  312. <view
  313. class="rd-24rpx w-44 h-44"
  314. :style="[btnTextColor]"
  315. v-if="btnStyle == 0"
  316. >
  317. <view class="flex-center cart-btn">
  318. <text
  319. class="iconfont icon-ic_increase-2 fs-26"
  320. ></text>
  321. </view>
  322. </view>
  323. <view
  324. class="rd-24rpx w-44 h-44"
  325. :style="[btnTextColor]"
  326. v-else
  327. >
  328. <view class="flex-center cart-btn">
  329. <text
  330. class="iconfont icon-ic_ShoppingCart1 fs-26"
  331. ></text>
  332. </view>
  333. </view>
  334. </view>
  335. </view>
  336. </view>
  337. </view>
  338. </view>
  339. </view>
  340. </view>
  341. <!-- right -->
  342. <view class="item-box">
  343. <view id="right" v-if="rightList.length">
  344. <view
  345. v-for="(item, index) in rightList"
  346. :key="index"
  347. class="wf-item"
  348. @tap="goDetail(item)"
  349. :style="[bgColor, bgRadius]"
  350. >
  351. <view class="pictrue">
  352. <easy-loadimage
  353. mode="widthFix"
  354. :image-src="item.image"
  355. width="100%"
  356. height="346rpx"
  357. :borderRadius="imgStyle"
  358. ></easy-loadimage>
  359. </view>
  360. <view class="info_box" :style="[bgRadius2]">
  361. <view
  362. class="w-full line2 fs-28 text--w111-333 lh-40rpx"
  363. v-if="checkboxInfo.includes(0)"
  364. :style="[productStyle]"
  365. >
  366. <text v-if="item.brand_name" class="brand-tag">{{
  367. item.brand_name
  368. }}</text>
  369. {{ item.store_name }}
  370. </view>
  371. <view
  372. class="flex items-end flex-wrap mt-8 w-full"
  373. v-if="
  374. checkboxInfo.includes(1) &&
  375. item.label_list &&
  376. item.label_list.length
  377. "
  378. >
  379. <BaseTag
  380. :text="label.name"
  381. :color="label.font_color"
  382. :background="label.bg_color"
  383. :borderColor="label.border_color"
  384. :circle="label.border_color ? true : false"
  385. :imgSrc="label.image"
  386. v-for="(label, idx) in item.label_list"
  387. :key="idx"
  388. ></BaseTag>
  389. </view>
  390. <view class="flex-between-center mt-20" v-if="onlyShowPrice">
  391. <baseMoney
  392. :money="item.price"
  393. symbolSize="24"
  394. integerSize="40"
  395. decimalSize="24"
  396. weight
  397. :color="priceColor"
  398. ></baseMoney>
  399. <view
  400. @tap.stop="addCartChange(item, index)"
  401. v-if="!showBtn"
  402. >
  403. <view
  404. class="rd-24rpx w-44 h-44"
  405. :style="[btnTextColor]"
  406. v-if="btnStyle == 0"
  407. >
  408. <view class="flex-center cart-btn">
  409. <text
  410. class="iconfont icon-ic_increase-2 fs-26"
  411. ></text>
  412. </view>
  413. </view>
  414. <view
  415. class="rd-24rpx w-44 h-44"
  416. :style="[btnTextColor]"
  417. v-else
  418. >
  419. <view class="flex-center cart-btn">
  420. <text
  421. class="iconfont icon-ic_ShoppingCart1 fs-26"
  422. ></text>
  423. </view>
  424. </view>
  425. </view>
  426. </view>
  427. <view v-else>
  428. <view class="flex-y-center mt-8">
  429. <baseMoney
  430. :money="item.price"
  431. symbolSize="24"
  432. integerSize="40"
  433. decimalSize="24"
  434. weight
  435. :color="priceColor"
  436. v-if="checkboxInfo.includes(2)"
  437. ></baseMoney>
  438. <view
  439. class="flex h-26 lh-28rpx rd-14rpx bg--w111-F7E9CD fs-22 ml-8"
  440. v-if="
  441. Number(item.vip_price) > 0 && checkboxInfo.includes(5)
  442. "
  443. >
  444. <text
  445. class="inline-block h-26 lh-28rpx svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8"
  446. >SVIP</text
  447. >
  448. <text class="px-8 fs-22 SemiBold"
  449. >{{ $t(`¥`) }}{{ item.vip_price }}</text
  450. >
  451. </view>
  452. </view>
  453. <view class="flex-between-center mt-20">
  454. <text
  455. class="fs-22"
  456. v-if="checkboxInfo.includes(3)"
  457. :style="[uniStyle]"
  458. >{{ $t(`已售`) }}{{ item.sales
  459. }}{{ item.unit_name }}</text
  460. >
  461. <view
  462. @tap.stop="addCartChange(item, index)"
  463. v-if="!showBtn"
  464. >
  465. <view
  466. class="rd-24rpx w-44 h-44"
  467. :style="[btnTextColor]"
  468. v-if="btnStyle == 0"
  469. >
  470. <view class="flex-center cart-btn">
  471. <text
  472. class="iconfont icon-ic_increase-2 fs-26"
  473. ></text>
  474. </view>
  475. </view>
  476. <view
  477. class="rd-24rpx w-44 h-44"
  478. :style="[btnTextColor]"
  479. v-else
  480. >
  481. <view class="flex-center cart-btn">
  482. <text
  483. class="iconfont icon-ic_ShoppingCart1 fs-26"
  484. ></text>
  485. </view>
  486. </view>
  487. </view>
  488. </view>
  489. </view>
  490. </view>
  491. </view>
  492. </view>
  493. </view>
  494. </view>
  495. <!-- 两列展示(横向) -->
  496. <view
  497. class="pt-32 pr-24 pb-32 pl-24 bg--w111-fff"
  498. :style="[bgRadius, bgColor]"
  499. v-if="goodStyleConfig == 3"
  500. >
  501. <view class="grid-column-2 grid-gap-20rpx">
  502. <view
  503. class="flex"
  504. v-for="(item, index) in tempArr"
  505. :key="index"
  506. @tap="goDetail(item)"
  507. :style="[bgRadius]"
  508. >
  509. <easy-loadimage
  510. mode="widthFix"
  511. :image-src="item.image"
  512. width="144rpx"
  513. height="144rpx"
  514. :borderRadius="imgStyle"
  515. ></easy-loadimage>
  516. <view class="flex-1 pl-20">
  517. <view
  518. class="w-full fs-26 h-72 lh-36rpx line2 mb-20"
  519. v-if="checkboxInfo.includes(0)"
  520. :style="[productStyle]"
  521. >
  522. <text v-if="item.brand_name" class="brand-tag">{{
  523. item.brand_name
  524. }}</text>
  525. {{ item.store_name }}
  526. </view>
  527. <baseMoney
  528. :money="item.price"
  529. symbolSize="24"
  530. integerSize="40"
  531. decimalSize="24"
  532. weight
  533. :color="priceColor"
  534. v-if="checkboxInfo.includes(2)"
  535. ></baseMoney>
  536. </view>
  537. </view>
  538. </view>
  539. </view>
  540. <!-- 三列 -->
  541. <view
  542. class="pt-32 pr-24 pb-32 pl-24 bg--w111-fff"
  543. :style="[bgColor, bgRadius]"
  544. v-if="goodStyleConfig == 2"
  545. >
  546. <view class="grid-column-3 grid-gap-20rpx">
  547. <view
  548. v-for="(item, index) in tempArr"
  549. :key="index"
  550. @tap="goDetail(item)"
  551. :style="[bgRadius]"
  552. >
  553. <easy-loadimage
  554. mode="widthFix"
  555. :image-src="item.image"
  556. width="100%"
  557. height="210rpx"
  558. :borderRadius="imgStyle"
  559. ></easy-loadimage>
  560. <view
  561. class="w-full fs-28 h-80 lh-40rpx line2 mt-20"
  562. v-if="checkboxInfo.includes(0)"
  563. :style="[productStyle]"
  564. >
  565. <text v-if="item.brand_name" class="brand-tag">{{
  566. item.brand_name
  567. }}</text>
  568. {{ item.store_name }}
  569. </view>
  570. <view class="flex-between-center mt-14">
  571. <baseMoney
  572. :money="item.price"
  573. symbolSize="24"
  574. integerSize="40"
  575. decimalSize="24"
  576. weight
  577. :color="priceColor"
  578. v-if="checkboxInfo.includes(2)"
  579. ></baseMoney>
  580. <view @tap.stop="addCartChange(item, index)" v-if="!showBtn">
  581. <view
  582. class="rd-24rpx w-44 h-44"
  583. :style="[btnTextColor]"
  584. v-if="btnStyle == 0"
  585. >
  586. <view class="flex-center cart-btn">
  587. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  588. </view>
  589. </view>
  590. <view
  591. class="rd-24rpx w-44 h-44"
  592. :style="[btnTextColor]"
  593. v-else
  594. >
  595. <view class="flex-center cart-btn">
  596. <text class="iconfont icon-ic_ShoppingCart1 fs-26"></text>
  597. </view>
  598. </view>
  599. </view>
  600. </view>
  601. </view>
  602. </view>
  603. </view>
  604. <!-- 大图展示 -->
  605. <view v-if="goodStyleConfig == 4">
  606. <view
  607. class="w-full bg--w111-fff item"
  608. :style="[bgColor, bgRadius]"
  609. v-for="(item, index) in tempArr"
  610. :key="index"
  611. @tap="goDetail(item)"
  612. >
  613. <easy-loadimage
  614. mode="widthFix"
  615. :image-src="item.image"
  616. width="100%"
  617. height="360rpx"
  618. :borderRadius="imgStyle"
  619. ></easy-loadimage>
  620. <view class="p-24">
  621. <view
  622. class="w-full line1 fs-28 text--w111-333 lh-40rpx"
  623. v-if="checkboxInfo.includes(0)"
  624. :style="[productStyle]"
  625. >
  626. <text v-if="item.brand_name" class="brand-tag">{{
  627. item.brand_name
  628. }}</text>
  629. {{ item.store_name }}
  630. </view>
  631. <view
  632. class="flex items-end flex-wrap mt-8 w-full"
  633. v-if="
  634. checkboxInfo.includes(1) &&
  635. item.label_list &&
  636. item.label_list.length
  637. "
  638. >
  639. <BaseTag
  640. :text="label.name"
  641. :color="label.font_color"
  642. :background="label.bg_color"
  643. :borderColor="label.border_color"
  644. :circle="label.border_color ? true : false"
  645. :imgSrc="label.image"
  646. v-for="(label, idx) in item.label_list"
  647. :key="idx"
  648. ></BaseTag>
  649. </view>
  650. <view class="flex-between-center" v-if="onlyShowPrice">
  651. <baseMoney
  652. :money="item.price"
  653. symbolSize="24"
  654. integerSize="40"
  655. decimalSize="24"
  656. weight
  657. :color="priceColor"
  658. ></baseMoney>
  659. <view @tap.stop="addCartChange(item, index)" v-if="!showBtn">
  660. <view
  661. class="w-96 h-56 rd-28rpx flex-center fs-24 text--w111-fff"
  662. v-if="btnStyle == 0"
  663. :style="[btnBgColor]"
  664. >{{ $t(`购买`) }}</view
  665. >
  666. <view
  667. class="rd-24rpx w-44 h-44"
  668. :style="[btnTextColor]"
  669. v-else-if="btnStyle == 1"
  670. >
  671. <view class="flex-center cart-btn">
  672. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  673. </view>
  674. </view>
  675. <view
  676. class="rd-24rpx w-44 h-44"
  677. :style="[btnTextColor]"
  678. v-else
  679. >
  680. <view class="flex-center cart-btn">
  681. <text class="iconfont icon-ic_ShoppingCart1 fs-26"></text>
  682. </view>
  683. </view>
  684. </view>
  685. </view>
  686. <view v-else>
  687. <view class="flex-y-center mt-8">
  688. <baseMoney
  689. :money="item.price"
  690. symbolSize="24"
  691. integerSize="40"
  692. decimalSize="24"
  693. weight
  694. :color="priceColor"
  695. v-if="checkboxInfo.includes(2)"
  696. ></baseMoney>
  697. <view
  698. class="flex h-26 lh-28rpx rd-14rpx bg--w111-F7E9CD fs-22 ml-8"
  699. v-if="
  700. Number(item.vip_price) > 0 && checkboxInfo.includes(5)
  701. "
  702. >
  703. <text
  704. class="inline-block h-26 lh-28rpx svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8"
  705. >SVIP</text
  706. >
  707. <text class="px-8 fs-22 SemiBold"
  708. >{{ $t(`¥`) }}{{ item.vip_price }}</text
  709. >
  710. </view>
  711. </view>
  712. <view class="flex justify-between items-end">
  713. <view class="flex-y-center">
  714. <text
  715. class="fs-22 text--w111-999"
  716. v-if="checkboxInfo.includes(3)"
  717. :style="[uniStyle]"
  718. >{{ $t(`已售`) }}{{ item.sales
  719. }}{{ item.unit_name }}</text
  720. >
  721. <text
  722. class="fs-22 text--w111-999 pl-16"
  723. v-if="checkboxInfo.includes(4)"
  724. >{{ $t(`评分`) }}{{ item.star || 0 }}</text
  725. >
  726. </view>
  727. <view @tap.stop="addCartChange(item, index)" v-if="!showBtn">
  728. <view
  729. class="w-96 h-56 rd-28rpx flex-center fs-24 text--w111-fff"
  730. v-if="btnStyle == 0"
  731. :style="[btnBgColor]"
  732. >{{ $t(`购买`) }}</view
  733. >
  734. <view
  735. class="rd-24rpx w-44 h-44"
  736. :style="[btnTextColor]"
  737. v-else-if="btnStyle == 1"
  738. >
  739. <view class="flex-center cart-btn">
  740. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  741. </view>
  742. </view>
  743. <view
  744. class="rd-24rpx w-44 h-44"
  745. :style="[btnTextColor]"
  746. v-else
  747. >
  748. <view class="flex-center cart-btn">
  749. <text
  750. class="iconfont icon-ic_ShoppingCart1 fs-26"
  751. ></text>
  752. </view>
  753. </view>
  754. </view>
  755. </view>
  756. </view>
  757. </view>
  758. </view>
  759. </view>
  760. <!-- 横向滑动 -->
  761. <view
  762. class="pt-32 pb-32 pl-24 bg--w111-fff"
  763. :style="[bgRadius, bgColor]"
  764. v-if="goodStyleConfig == 5"
  765. >
  766. <scroll-view
  767. scroll-x="true"
  768. show-scrollbar="false"
  769. class="white-nowrap vertical-middle w-full"
  770. >
  771. <view
  772. class="inline-block mr-20"
  773. v-for="(item, index) in tempArr"
  774. :key="index"
  775. @tap="goDetail(item)"
  776. :style="[bgRadius]"
  777. >
  778. <easy-loadimage
  779. mode="widthFix"
  780. :image-src="item.image"
  781. width="200rpx"
  782. height="200rpx"
  783. :borderRadius="imgStyle"
  784. ></easy-loadimage>
  785. <view
  786. class="w-200 fs-28 h-80 lh-40rpx line2 break_word mt-20"
  787. v-if="checkboxInfo.includes(0)"
  788. :style="[productStyle]"
  789. >
  790. <text v-if="item.brand_name" class="brand-tag">{{
  791. item.brand_name
  792. }}</text>
  793. {{ item.store_name }}
  794. </view>
  795. <view class="flex-between-center mt-8">
  796. <baseMoney
  797. :money="item.price"
  798. symbolSize="24"
  799. integerSize="40"
  800. decimalSize="24"
  801. weight
  802. :color="priceColor"
  803. v-if="checkboxInfo.includes(2)"
  804. ></baseMoney>
  805. <view @tap.stop="addCartChange(item, index)" v-if="!showBtn">
  806. <view
  807. class="rd-24rpx w-44 h-44"
  808. :style="[btnTextColor]"
  809. v-if="btnStyle == 0"
  810. >
  811. <view class="flex-center cart-btn">
  812. <text class="iconfont icon-ic_increase-2 fs-26"></text>
  813. </view>
  814. </view>
  815. <view
  816. class="rd-24rpx w-44 h-44"
  817. :style="[btnTextColor]"
  818. v-else
  819. >
  820. <view class="flex-center cart-btn">
  821. <text class="iconfont icon-ic_ShoppingCart1 fs-26"></text>
  822. </view>
  823. </view>
  824. </view>
  825. </view>
  826. </view>
  827. </scroll-view>
  828. </view>
  829. </view>
  830. </common-wrapper>
  831. <productWindow
  832. :attr="attr"
  833. :isShow="1"
  834. :iSplus="1"
  835. :iScart="1"
  836. :fangda="false"
  837. type="2"
  838. :limitNum="storeInfo.limit_num"
  839. :minQty="storeInfo.min_qty"
  840. :unitName="storeInfo.unit_name"
  841. @myevent="onMyEvent"
  842. @ChangeAttr="ChangeAttr"
  843. @ChangeCartNum="ChangeCartNumDuo"
  844. @attrVal="attrVal"
  845. @iptCartNum="iptCartNum"
  846. @goCat="goCatNum"
  847. id="product-window"
  848. ></productWindow>
  849. </view>
  850. </template>
  851. <script>
  852. import { getProductslist, getAttr } from "@/api/store.js";
  853. import skuSelect from "@/mixins/skuSelect.js";
  854. import { toLogin } from "@/libs/login.js";
  855. import { mapGetters, mapState } from "vuex";
  856. import { getCartCounts } from "@/api/order.js";
  857. import { goShopDetail } from "@/libs/order.js";
  858. import productWindow from "@/components/productWindow";
  859. import commonWrapper from "./commonWrapper.vue";
  860. export default {
  861. name: "goodList",
  862. components: {
  863. productWindow,
  864. commonWrapper,
  865. },
  866. props: {
  867. dataConfig: {
  868. type: Object,
  869. default: () => {},
  870. },
  871. list: {
  872. type: Array,
  873. default: () => [],
  874. },
  875. isSortType: {
  876. type: String | Number,
  877. default: 0,
  878. },
  879. },
  880. mixins: [skuSelect],
  881. data() {
  882. return {
  883. tempArr: [],
  884. type: 0,
  885. attr: {
  886. cartAttr: false,
  887. productAttr: [],
  888. productSelect: {},
  889. },
  890. id: 0,
  891. productValue: [],
  892. attrValue: "", //已选属性
  893. storeName: "", //多属性产品名称
  894. storeInfo: {},
  895. allList: [], // 全部列表
  896. leftList: [], // 左边列表
  897. rightList: [], // 右边列表
  898. mark: 0, // 列表标记
  899. boxHeight: [], // 下标0和1分别为左列和右列高度
  900. };
  901. },
  902. watch: {
  903. list: {
  904. handler(val) {
  905. if (val && val.length) this.tempArr = val;
  906. },
  907. deep: true,
  908. },
  909. // 监听列表数据变化
  910. tempArr: {
  911. handler(nVal, oVal) {
  912. // 如果数据为空或新的列表数据少于旧的列表数据(通常为下拉刷新或切换排序或使用筛选器),初始化变量
  913. if (
  914. !this.tempArr.length ||
  915. (this.tempArr.length === this.updateNum &&
  916. this.tempArr.length <= this.allList.length)
  917. ) {
  918. this.allList = [];
  919. this.leftList = [];
  920. this.rightList = [];
  921. this.boxHeight = [];
  922. this.mark = 0;
  923. }
  924. // 如果列表有值,调用waterfall方法
  925. if (this.tempArr.length) {
  926. this.allList = this.tempArr;
  927. this.leftList = [];
  928. this.rightList = [];
  929. this.boxHeight = [];
  930. this.allList.forEach((v, i) => {
  931. if (
  932. this.allList.length < 3 ||
  933. (this.allList.length <= 7 && this.allList.length - i > 1) ||
  934. (this.allList.length > 7 && this.allList.length - i > 2)
  935. ) {
  936. if (i % 2) {
  937. this.rightList.push(v);
  938. } else {
  939. this.leftList.push(v);
  940. }
  941. }
  942. });
  943. if (this.allList.length < 3) {
  944. this.mark = this.allList.length + 1;
  945. } else if (this.allList.length <= 7) {
  946. this.mark = this.allList.length - 1;
  947. } else {
  948. this.mark = this.allList.length - 2;
  949. }
  950. if (this.mark < this.allList.length) {
  951. this.waterFall();
  952. }
  953. }
  954. },
  955. immediate: true,
  956. deep: true,
  957. },
  958. // 监听标记,当标记发生变化,则执行下一个item排序
  959. mark() {
  960. const len = this.allList.length;
  961. if (this.mark < len && this.mark !== 0 && this.boxHeight.length) {
  962. this.waterFall();
  963. }
  964. },
  965. dataConfig() {
  966. this.productslist();
  967. },
  968. },
  969. computed: {
  970. ...mapState({
  971. cartNum: (state) => state.indexData.cartNum,
  972. }),
  973. ...mapGetters(["isLogin", "uid", "cartNum"]),
  974. showHeader() {
  975. // You might want to control visibility based on config, but admin doesn't seem to have a global 'show header' switch for this component,
  976. // it just has header settings. Assuming always show if configured.
  977. return true;
  978. },
  979. headerType() {
  980. return this.dataConfig.headerType ? this.dataConfig.headerType.tabVal : 0;
  981. },
  982. headerText() {
  983. return this.dataConfig.headerText ? this.dataConfig.headerText.value : "";
  984. },
  985. headerImg() {
  986. return this.dataConfig.headerImg ? this.dataConfig.headerImg.url : "";
  987. },
  988. headerBoxStyle() {
  989. const alignMap = ["left", "center", "right"];
  990. const align = this.dataConfig.headerAlign
  991. ? alignMap[this.dataConfig.headerAlign.tabVal]
  992. : "left";
  993. return {
  994. "text-align": align,
  995. "margin-bottom": "20rpx",
  996. padding: "0 20rpx",
  997. };
  998. },
  999. titleTextStyle() {
  1000. const alignMap = ["left", "center", "right"];
  1001. const align = this.dataConfig.headerAlign
  1002. ? alignMap[this.dataConfig.headerAlign.tabVal]
  1003. : "left";
  1004. const color =
  1005. this.dataConfig.headerColor &&
  1006. this.dataConfig.headerColor.color &&
  1007. this.dataConfig.headerColor.color[0]
  1008. ? this.dataConfig.headerColor.color[0].item
  1009. : "#333";
  1010. const fontSize = this.dataConfig.headerFontSize
  1011. ? this.dataConfig.headerFontSize.val * 2 + "rpx"
  1012. : "32rpx";
  1013. const fontWeight =
  1014. this.dataConfig.headerTextConfig &&
  1015. this.dataConfig.headerTextConfig.tabVal == 0
  1016. ? "bold"
  1017. : "normal";
  1018. const fontStyle =
  1019. this.dataConfig.headerTextConfig &&
  1020. this.dataConfig.headerTextConfig.tabVal == 2
  1021. ? "italic"
  1022. : "normal";
  1023. return {
  1024. color: color,
  1025. "font-size": fontSize,
  1026. "font-weight": fontWeight,
  1027. "font-style": fontStyle,
  1028. "text-align": align,
  1029. };
  1030. },
  1031. titleImgBoxStyle() {
  1032. const alignMap = ["left", "center", "right"];
  1033. const align = this.dataConfig.headerAlign
  1034. ? alignMap[this.dataConfig.headerAlign.tabVal]
  1035. : "left";
  1036. return {
  1037. "text-align": align,
  1038. };
  1039. },
  1040. titleImgStyle() {
  1041. return {
  1042. height: "auto",
  1043. display: "inline-block", // inline-block allows text-align on parent to work
  1044. };
  1045. },
  1046. configData() {
  1047. return {
  1048. ...this.dataConfig,
  1049. };
  1050. },
  1051. bgRadius() {
  1052. let borderRadius = `${this.dataConfig.fillet.val * 2}rpx`;
  1053. if (this.dataConfig.fillet.type) {
  1054. borderRadius = `${this.dataConfig.fillet.valList[0].val * 2}rpx ${
  1055. this.dataConfig.fillet.valList[1].val * 2
  1056. }rpx ${this.dataConfig.fillet.valList[3].val * 2}rpx ${
  1057. this.dataConfig.fillet.valList[2].val * 2
  1058. }rpx`;
  1059. }
  1060. return {
  1061. borderRadius: borderRadius,
  1062. };
  1063. },
  1064. bgRadius2() {
  1065. let borderRadius = `0 0 ${this.dataConfig.fillet.val * 2}rpx ${
  1066. this.dataConfig.fillet.val * 2
  1067. }rpx`;
  1068. if (this.dataConfig.fillet.type) {
  1069. borderRadius = `0 0 ${this.dataConfig.fillet.valList[3].val * 2}rpx ${
  1070. this.dataConfig.fillet.valList[2].val * 2
  1071. }rpx`;
  1072. }
  1073. return {
  1074. borderRadius: borderRadius,
  1075. };
  1076. },
  1077. bgColor() {
  1078. const bgColorLeft =
  1079. this.dataConfig.moduleColor && this.dataConfig.moduleColor.color
  1080. ? this.dataConfig.moduleColor.color[0].item
  1081. : "#F5F5F5";
  1082. const bgColorRight =
  1083. this.dataConfig.moduleColor && this.dataConfig.moduleColor.color
  1084. ? this.dataConfig.moduleColor.color[1].item
  1085. : "#F5F5F5";
  1086. return {
  1087. background: `linear-gradient(90deg,${bgColorLeft} 0%,${bgColorRight} 100%)`,
  1088. };
  1089. },
  1090. styleConfig() {
  1091. return this.dataConfig.styleConfig.tabVal;
  1092. },
  1093. /*商品图片圆角样式*/
  1094. imgStyle() {
  1095. let borderRadius = `${this.dataConfig.filletImg.val * 2}rpx`;
  1096. if (this.dataConfig.styleConfig.tabVal == 1) {
  1097. borderRadius = `${this.dataConfig.filletImg.val * 2}rpx ${
  1098. this.dataConfig.filletImg.val * 2
  1099. }rpx 0 0`;
  1100. }
  1101. if (this.dataConfig.filletImg.type) {
  1102. borderRadius = `${this.dataConfig.filletImg.valList[0].val * 2}rpx ${
  1103. this.dataConfig.filletImg.valList[1].val * 2
  1104. }rpx ${this.dataConfig.filletImg.valList[3].val * 2}rpx ${
  1105. this.dataConfig.filletImg.valList[2].val * 2
  1106. }rpx`;
  1107. if (this.dataConfig.styleConfig.tabVal == 1) {
  1108. borderRadius = `${this.dataConfig.filletImg.valList[0].val * 2}rpx ${
  1109. this.dataConfig.filletImg.valList[1].val * 2
  1110. }rpx 0 0`;
  1111. }
  1112. }
  1113. let imgRadius = `${this.dataConfig.fillet.val * 2}rpx ${
  1114. this.dataConfig.fillet.val * 2
  1115. }rpx 0 0`;
  1116. if (this.dataConfig.fillet.type) {
  1117. imgRadius = `${this.dataConfig.fillet.valList[0].val * 2}rpx ${
  1118. this.dataConfig.fillet.valList[1].val * 2
  1119. }rpx 0 0`;
  1120. }
  1121. return this.dataConfig.name == "promotionList" ? imgRadius : borderRadius;
  1122. },
  1123. /*商品名称样式*/
  1124. productStyle() {
  1125. return {
  1126. color: this.dataConfig.goodsNameColor.color[0].item,
  1127. fontWeight: this.dataConfig.goodsName.tabVal ? "normal" : "bold",
  1128. };
  1129. },
  1130. /* 展示信息 */
  1131. checkboxInfo() {
  1132. return this.dataConfig.checkboxInfo.type;
  1133. },
  1134. /* 价格颜色 */
  1135. priceColor() {
  1136. return this.dataConfig.toneCartConfig.tabVal
  1137. ? this.dataConfig.goodsPriceColor.color[0].item
  1138. : "var(--view-theme)";
  1139. },
  1140. /* 划线价颜色 */
  1141. otPriceColor() {
  1142. return this.dataConfig.goodsPriceColor.color[0].item;
  1143. },
  1144. btnStyle() {
  1145. return this.dataConfig.bntStyleConfig.tabVal;
  1146. },
  1147. showBtn() {
  1148. return this.dataConfig.cartConfig.tabVal;
  1149. },
  1150. /* 按钮颜色 */
  1151. btnBgColor() {
  1152. return {
  1153. background: this.dataConfig.toneConfig.tabVal
  1154. ? `linear-gradient(90deg,${this.dataConfig.bntBgColor.color[0].item} 0%,${this.dataConfig.bntBgColor.color[1].item} 100%)`
  1155. : "linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%)",
  1156. };
  1157. },
  1158. btnTextColor() {
  1159. return {
  1160. color: "#FFFFFF",
  1161. background: this.dataConfig.toneCartConfig.tabVal
  1162. ? `linear-gradient(90deg, ${this.dataConfig.bntBgColor.color[0].item} 0%, ${this.dataConfig.bntBgColor.color[1].item} 100%)`
  1163. : "linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%)",
  1164. };
  1165. },
  1166. uniStyle() {
  1167. return {
  1168. color: this.dataConfig.toneConfig.tabVal
  1169. ? this.dataConfig.soldNumColor.color[0].item || "#999"
  1170. : "#999",
  1171. };
  1172. },
  1173. /*商品数量*/
  1174. numberConfig() {
  1175. return this.dataConfig.numberConfig.val;
  1176. },
  1177. /*商品模板*/
  1178. goodStyleConfig() {
  1179. return this.dataConfig.styleConfig.tabVal;
  1180. },
  1181. /*检索条件 0综合 1销量 2价格*/
  1182. goodsSort() {
  1183. return this.dataConfig.goodsSort.tabVal;
  1184. },
  1185. /*按照什么方式选择商品 1 指定商品 3指定分类 4 商品标签 */
  1186. typeConfig() {
  1187. return this.dataConfig.typeConfig.activeValue;
  1188. },
  1189. bntConfig() {
  1190. return this.dataConfig.bntConfig.tabVal;
  1191. },
  1192. onlyShowPrice() {
  1193. if (
  1194. this.checkboxInfo.toString() == "0,2" ||
  1195. this.checkboxInfo.toString() == "2,0" ||
  1196. this.checkboxInfo.toString() == "2"
  1197. ) {
  1198. return true;
  1199. } else {
  1200. return false;
  1201. }
  1202. },
  1203. },
  1204. created() {
  1205. // #ifndef APP-PLUS
  1206. // this.$eventHub.$on('product_video_observe', () => {
  1207. // this.observeVideo();
  1208. // });
  1209. // #endif
  1210. },
  1211. mounted() {
  1212. this.productslist();
  1213. },
  1214. methods: {
  1215. observeVideo() {
  1216. let observer = uni.createIntersectionObserver(this, { observeAll: true });
  1217. observer.relativeToViewport().observe(".video", (res) => {
  1218. if (res.intersectionRatio) {
  1219. uni.createVideoContext(res.id, this).play();
  1220. } else {
  1221. uni.createVideoContext(res.id, this).pause();
  1222. }
  1223. });
  1224. },
  1225. productslist() {
  1226. if (this.list && this.list.length) {
  1227. this.tempArr = this.list;
  1228. return;
  1229. }
  1230. let limit = this.$config.LIMIT;
  1231. let data = {};
  1232. if (this.typeConfig == 1) {
  1233. const goodsList = this.dataConfig.goodsList.list || [];
  1234. const ids = goodsList.map(item => item.id).filter(Boolean).join(',');
  1235. if (ids) {
  1236. data = { ids };
  1237. } else {
  1238. this.tempArr = [];
  1239. return;
  1240. }
  1241. } else if (this.typeConfig == 3) {
  1242. data = {
  1243. priceOrder: this.goodsSort == 2 ? "desc" : "",
  1244. salesOrder: this.goodsSort == 1 ? "desc" : "",
  1245. cate_id: this.dataConfig.classList.classVal
  1246. ? this.dataConfig.classList.classVal.join(",")
  1247. : "",
  1248. limit: this.numberConfig,
  1249. };
  1250. } else if (this.typeConfig == 4) {
  1251. data = {
  1252. priceOrder: this.goodsSort == 2 ? "desc" : "",
  1253. salesOrder: this.goodsSort == 1 ? "desc" : "",
  1254. store_label_id: this.dataConfig.goodsLabel.activeValue
  1255. ? this.dataConfig.goodsLabel.activeValue.join(",")
  1256. : "",
  1257. limit: this.numberConfig,
  1258. };
  1259. }
  1260. getProductslist(data).then((res) => {
  1261. this.tempArr = res.data;
  1262. });
  1263. },
  1264. goDetail(item) {
  1265. goShopDetail(item, this.$store.state.app.uid).then((res) => {
  1266. uni.navigateTo({
  1267. url: `/pages/goods_details/index?id=${item.id}`,
  1268. });
  1269. });
  1270. },
  1271. // 商品详情接口;
  1272. getAttrs(id) {
  1273. let that = this;
  1274. getAttr(id, 0).then((res) => {
  1275. that.$set(that.attr, "productAttr", res.data.productAttr);
  1276. that.$set(that, "productValue", res.data.productValue);
  1277. that.$set(that, "storeInfo", res.data.storeInfo);
  1278. that.DefaultSelect();
  1279. });
  1280. },
  1281. addCartChange(item, index) {
  1282. if (this.bntConfig == 1) {
  1283. if (item.spec_type) {
  1284. this.goCartDuo(item);
  1285. } else {
  1286. this.goCartDan(item, index);
  1287. }
  1288. } else {
  1289. this.goDetail(item);
  1290. }
  1291. },
  1292. getCartNum() {
  1293. let that = this;
  1294. getCartCounts().then((res) => {
  1295. this.$store.commit("indexData/setCartNum", res.data.count);
  1296. });
  1297. },
  1298. // 瀑布流排序
  1299. waterFall() {
  1300. const i = this.mark;
  1301. if (i == 0) {
  1302. // 初始化,从左边开始插入
  1303. this.leftList.push(this.allList[i]);
  1304. // 更新左边列表高度
  1305. this.getViewHeight(0);
  1306. } else if (i == 1) {
  1307. // 第二个item插入,默认为右边插入
  1308. this.rightList.push(this.allList[i]);
  1309. // 更新右边列表高度
  1310. this.getViewHeight(1);
  1311. } else {
  1312. // 根据左右列表高度判断下一个item应该插入哪边
  1313. if (!this.boxHeight.length) {
  1314. this.rightList.length < this.leftList.length
  1315. ? this.rightList.push(this.allList[i])
  1316. : this.leftList.push(this.allList[i]);
  1317. } else {
  1318. const leftOrRight = this.boxHeight[0] > this.boxHeight[1] ? 1 : 0;
  1319. if (leftOrRight) {
  1320. this.rightList.push(this.allList[i]);
  1321. } else {
  1322. this.leftList.push(this.allList[i]);
  1323. }
  1324. }
  1325. // 更新插入列表高度
  1326. this.getViewHeight();
  1327. }
  1328. },
  1329. // 获取列表高度
  1330. getViewHeight() {
  1331. // 使用nextTick,确保页面更新结束后,再请求高度
  1332. this.$nextTick(() => {
  1333. setTimeout(() => {
  1334. uni
  1335. .createSelectorQuery()
  1336. .in(this)
  1337. .select("#right")
  1338. .boundingClientRect((res) => {
  1339. res ? (this.boxHeight[1] = res.height) : "";
  1340. uni
  1341. .createSelectorQuery()
  1342. .in(this)
  1343. .select("#left")
  1344. .boundingClientRect((res) => {
  1345. res ? (this.boxHeight[0] = res.height) : "";
  1346. this.mark = this.mark + 1;
  1347. })
  1348. .exec();
  1349. })
  1350. .exec();
  1351. }, 100);
  1352. });
  1353. },
  1354. },
  1355. };
  1356. </script>
  1357. <style lang="scss">
  1358. $page-padding: 10px;
  1359. $grid-gap: 10px;
  1360. .wf-page {
  1361. display: flex;
  1362. flex-wrap: wrap;
  1363. justify-content: space-between;
  1364. .item-box {
  1365. width: 48.5%;
  1366. margin-bottom: 20rpx;
  1367. }
  1368. }
  1369. .wf-item {
  1370. width: 100%;
  1371. margin-bottom: 20rpx;
  1372. }
  1373. .wf-page1 .wf-item {
  1374. margin-top: 20rpx;
  1375. border-radius: 20rpx;
  1376. padding-bottom: 0;
  1377. }
  1378. .item ~ .item {
  1379. margin-top: 20rpx;
  1380. }
  1381. .info_box {
  1382. padding: 16rpx 20rpx;
  1383. border-radius: 0 0 20rpx 20rpx;
  1384. }
  1385. .bg--w111-484643 {
  1386. background: linear-gradient(90deg, #484643 0%, #1f1b17 100%);
  1387. }
  1388. .text--w111-FDDAA4 {
  1389. color: #fddaa4;
  1390. }
  1391. .svip_rd {
  1392. border-radius: 14rpx 0 8rpx 14rpx;
  1393. }
  1394. .cart-btn {
  1395. // background:rgba(255,255,255,0.9);
  1396. width: 100%;
  1397. height: 100%;
  1398. }
  1399. </style>