app-diy-goods-list.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <template>
  2. <view class="app-goods-list">
  3. <view class="goods-list" :class="listClass" v-if="newData.length > 0">
  4. <!-- 列表模式 -->
  5. <template v-if="listStyle === -1">
  6. <block v-for="(goods, index) in newData" :key="index">
  7. <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`, overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]" class="goods-item app-list-mode dir-left-nowrap" @click="jump(goods)"
  8. :class="goodsStyle === 3 ? 'no-border' : goodsStyle === 2 ? 'border' : ''">
  9. <!-- 售罄 -->
  10. <view :style="[{'border-radius': `${lisRadius}`}]" class="out-dialog" v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
  11. <image :style="[{'border-radius': `${lisRadius}`}]" :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  12. </view>
  13. <view class="box-grow-0">
  14. <app-image
  15. v-if="sign === 'advance'"
  16. :borderRadius="lisRadius"
  17. :img-src="goods.goods.goodsWarehouse.cover_pic"
  18. width="220rpx"
  19. height="220rpx"
  20. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  21. ></app-image>
  22. <div v-else-if="sign === 'composition'" style="width: 328rpx;height: 100%">
  23. <app-diy-composition-image
  24. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  25. :image-list="goods.cover_pic_list"></app-diy-composition-image>
  26. </div>
  27. <app-image
  28. v-else
  29. :borderRadius="lisRadius"
  30. :img-src="goods.cover_pic"
  31. width="220rpx"
  32. height="220rpx"
  33. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  34. ></app-image>
  35. </view>
  36. <!-- 角标 -->
  37. <view class="goods-tag" v-if="showGoodsTag">
  38. <app-image :img-src="goodsTagPicUrl" width="64rpx" height="64rpx"></app-image>
  39. </view>
  40. <view class="right box-grow-1 dir-top-nowrap main-between"
  41. :style="{
  42. padding: sign === 'advance' || sign=== 'composition' || (sign === 'flash-sale' && (goods.vip_card_appoint.discount && (goods.level_show == 1 && goods.is_negotiable != 1))) ? `10rpx 24rpx 6rpx 20rpx` : '28rpx 24rpx 24rpx 20rpx',
  43. height: sign === 'composition' ? '165rpx' : '220rpx',
  44. }">
  45. <view class="box-grow-0 name "
  46. :class="(sign === 'advance' || sign === 'miaosha') || goods.vip_card_appoint.discount || (goods.level_show == 1 && goods.is_negotiable != 1) ? 't-omit name-one' : 't-omit-two name-two'">
  47. <text class="dir-tag-def"
  48. v-if="tag && sign === 'advance' || sign === 'pick'|| sign === 'miaosha'"
  49. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '"
  50. >
  51. {{goods.people_num ? goods.people_num : ''}}{{tag}}
  52. </text>
  53. <text class="dir-tag-def"
  54. v-if="tag && sign !== 'advance' && sign !== 'pick' && sign !== 'miaosha' && ((sign == 'pintuan' && goods.people_num) || sign != 'pintuan')"
  55. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '"
  56. >
  57. {{goods.people_num ? goods.people_num : ''}}{{tag}}
  58. </text>
  59. <!-- 商品名字 -->
  60. <text v-if="sign === 'advance'">
  61. {{showGoodsName ? goods.goods.goodsWarehouse.name : ''}}
  62. </text>
  63. <text v-else>{{showGoodsName ? goods.name : ''}}</text>
  64. </view>
  65. <view class=" dir-top-nowrap main-right box-grow-1">
  66. <template v-if="sign === 'flash-sale'">
  67. <view class="dir-left-nowrap main-between" style="margin-bottom: 10rpx">
  68. <view
  69. :class="theme + '-m-back flash-sale ' + theme "
  70. v-if="goods.discount_type == 1"
  71. >{{goods.min_discount}}折</view>
  72. <view
  73. :class="theme + '-m-back flash-sale ' + theme"
  74. v-if="goods.discount_type == 2"
  75. >减{{goods.min_discount}}元</view>
  76. <view v-if="showProgressBar" style="font-size: 20rpx;color: #999999;">{{goods.sales}}</view>
  77. </view>
  78. <view class="app-percentage" v-if="showProgressBar" :class="theme + '-m-back-l ' +theme" style="width: 445rpx;margin-bottom: 10rpx">
  79. <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
  80. </view>
  81. </template>
  82. <view class="dir-left-nowrap cross-bottom">
  83. <view class="box-grow-1" :class="theme + '-m-text ' + theme">
  84. <!-- 时间 -->
  85. <template v-if="showTimer && sign !== 'flash-sale'">
  86. <app-goods-timer
  87. v-if="sign === 'advance'"
  88. :list-style="listStyle"
  89. :theme="theme"
  90. :start-date-time="goods.start_prepayment_at"
  91. :end-date-time="goods.end_prepayment_at"
  92. :sign="sign"
  93. :page-hide="pageHide"
  94. ></app-goods-timer>
  95. <app-goods-timer
  96. v-else
  97. :list-style="listStyle"
  98. :start-date-time="goods.start_time"
  99. :end-date-time="goods.end_time"
  100. :sign="sign"
  101. :page-hide="pageHide"
  102. :theme="theme"
  103. ></app-goods-timer>
  104. </template>
  105. <!-- #ifndef MP-ALIPAY -->
  106. <text v-if="sign === 'advance'" class="des-price"
  107. style="margin-top: 5rpx"
  108. :class="theme + '-m-text ' + theme + '-m-border ' + theme">
  109. 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
  110. </text>
  111. <!-- #endif -->
  112. <!-- #ifdef MP-ALIPAY -->
  113. <text v-if="sign === 'advance'" class="des-price" style="margin: 5rpx 0"
  114. :class="theme + '-m-text ' + theme + '-m-border ' + theme">
  115. 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
  116. </text>
  117. <!-- #endif -->
  118. <text class="tag" v-else-if="sign === 'pick'">
  119. {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
  120. </text>
  121. <template v-if="goods.is_level == 1 && goods.is_negotiable != 1">
  122. <app-member-price :price="goods.level_price"></app-member-price>
  123. </template>
  124. <!-- #ifndef MP-ALIPAY -->
  125. <app-sup-vip
  126. :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  127. v-if="goods.vip_card_appoint.discount"
  128. :discount="goods.vip_card_appoint.discount"
  129. ></app-sup-vip>
  130. <!-- #endif -->
  131. <!-- #ifdef MP-ALIPAY -->
  132. <app-sup-vip
  133. margin="4rpx 0"
  134. :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  135. v-if=" goods.vip_card_appoint.discount"
  136. :discount="goods.vip_card_appoint.discount"
  137. ></app-sup-vip>
  138. <!-- #endif -->
  139. <template v-if="sign === 'advance'">
  140. <view class="dir-left-nowrap main-left cross-center">
  141. <view class="goods-price ">¥{{showGoodsPrice ? goods.goods.price :''}}
  142. </view>
  143. <view class="original-price" style="margin-left: 10upx;"
  144. v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
  145. ¥{{goods.goods.goodsWarehouse.original_price}}
  146. </view>
  147. </view>
  148. </template>
  149. <view v-else
  150. :class="sign === 'miaosha'|| (sign === 'flash-sale' && showProgressBar) || goods.vip_card_appoint.discount || (goods.is_level == 1 && goods.is_negotiable != 1) ? 'dir-left-nowrap main-left cross-center' : 'dir-top-nowrap'">
  151. <view class="goods-price ">{{showGoodsPrice ?
  152. goods.price_content :
  153. ''}}
  154. </view>
  155. <view class="dir-left-nowrap">
  156. <view class="original-price" style="margin-left: 10upx;"
  157. v-if="isShowOriginalPrice(goods)">
  158. ¥{{goods.original_price}}
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <!--购物车-->
  164. <view v-if="showBuyBtn && goods.is_negotiable != 1" :style="btnStyle" :class="[buyBtnClass, 'box-grow-0', 'buy-btn', 'main-center', 'cross-center']">{{buyBtnText}}</view>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. </block>
  170. </template>
  171. <!-- 一行一个 -->
  172. <template v-else-if="listStyle === 1">
  173. <block v-for="(goods, index) in newData" :key="index">
  174. <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`,overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]"
  175. class="goods-item app-column-1" :class="[goodsClass, index !== newData.length - 1 ? 'app-column-1-mar' : '']" @click="jump(goods)">
  176. <view style="position: relative;">
  177. <view class="out-dialog"
  178. :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
  179. v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
  180. <image v-if="coverPicHeight == '468rpx'"
  181. :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
  182. :src="appSetting.is_use_stock == '1' ? appImg.rate_out : appSetting.sell_out_other_pic"></image>
  183. <image v-else
  184. :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
  185. :src="appSetting.is_use_stock == '1' ? appImg.one_out : appSetting.sell_out_pic"></image>
  186. </view>
  187. <view>
  188. <app-image :borderRadius="imgRadius" v-if="sign === 'advance'"
  189. :img-src="goods.goods.goodsWarehouse.cover_pic"
  190. width="100%"
  191. :height="coverPicHeight"
  192. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  193. ></app-image>
  194. <div v-else-if="sign === 'composition'" style="width: 100%;height: 336rpx">
  195. <app-diy-composition-image
  196. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  197. :image-list="goods.cover_pic_list"></app-diy-composition-image>
  198. </div>
  199. <app-image :borderRadius="imgRadius" v-else
  200. :img-src="goods.cover_pic"
  201. width="100%"
  202. :height="coverPicHeight"
  203. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  204. ></app-image>
  205. </view>
  206. <view class="goods-tag" v-if="showGoodsTag">
  207. <app-image :img-src="goodsTagPicUrl"
  208. width="64rpx"
  209. height="64rpx"
  210. >
  211. </app-image>
  212. </view>
  213. <view class="box-grow-0 timer" v-if="showTimer">
  214. <template v-if="sign === 'advance'">
  215. <app-goods-timer
  216. :list-style="listStyle"
  217. :start-date-time="goods.start_prepayment_at"
  218. :end-date-time="goods.end_prepayment_at"
  219. :sign="sign" :page-hide="pageHide"
  220. :theme="theme"
  221. ></app-goods-timer>
  222. </template>
  223. <template v-else>
  224. <app-goods-timer
  225. :list-style="listStyle"
  226. :start-date-time="goods.start_time"
  227. :end-date-time="goods.end_time"
  228. :sign="sign" :page-hide="pageHide"
  229. :theme="theme"
  230. ></app-goods-timer>
  231. </template>
  232. </view>
  233. </view>
  234. <view class="goods-name t-omit" v-if="showGoodsName" :class="theme">
  235. <template v-if="sign === 'advance'">
  236. <text>{{showGoodsName ? goods.goods.goodsWarehouse.name : ''}}</text>
  237. </template>
  238. <template v-if="sign === 'pick' || sign === 'gift' || sign === 'exchange' || sign == 'wholesale'">
  239. <text class="tag-pick"
  240. :class="theme + '-m-text ' + theme + '-m-back-o ' + theme">
  241. {{tag}}
  242. </text>
  243. <text>{{showGoodsName ? goods.name : ''}}</text>
  244. </template>
  245. <template v-else-if="sign === 'composition'">
  246. <text class="tag-pick"
  247. :class="theme + '-m-text ' + theme + '-m-back-o ' + theme">
  248. {{goods.tag}}
  249. </text>
  250. <text>{{showGoodsName ? goods.name : ''}}</text>
  251. </template>
  252. <template v-else>
  253. <text class="tag"
  254. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-border '"
  255. v-if="tag && sign == 'pintuan' && goods.people_num">
  256. {{goods.people_num ? goods.people_num : ''}}{{tag}}
  257. </text>
  258. <text>{{showGoodsName ? goods.name : ''}}</text>
  259. </template>
  260. </view>
  261. <template v-if="sign === 'advance'">
  262. <text class="des-price" :class="theme + '-m-text ' + theme + '-m-border ' + theme"
  263. style="margin-left: 24rpx;margin-top: 15rpx;">
  264. 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
  265. </text>
  266. </template>
  267. <template v-if="sign === 'flash-sale'">
  268. <view class="dir-top-nowrap" style="margin-bottom: 10rpx;padding:0 24rpx;">
  269. <view :class="showProgressBar ? 'flash-sale-dis' : ''">
  270. <view class="flash-sale" :class="theme + '-m-back ' + theme"
  271. v-if="goods.discount_type == 1">{{goods.min_discount}}折</view>
  272. <view class="flash-sale" :class="theme + '-m-back ' + theme"
  273. v-if="goods.discount_type == 2">减{{goods.min_discount}}元</view>
  274. </view>
  275. <view v-if="showProgressBar" class="app-percentage" style="width: 660rpx" :class="theme + '-m-back-l ' +theme">
  276. <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
  277. </view>
  278. <view v-if="sign === 'flash-sale' && showProgressBar" style="font-size: 20rpx;color: #999999;">{{goods.sales}}</view>
  279. </view>
  280. </template>
  281. <template v-if="sign === 'pick'">
  282. <text class="des-price" style="margin-left: 24rpx;margin-top: 15rpx;"
  283. :class="theme + '-m-text ' + theme + '-m-border ' + theme">
  284. {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
  285. </text>
  286. </template>
  287. <view class="price dir-left-nowrap cross-center"
  288. :style="{marginTop: sign === 'advance' ? '0rpx' : '16rpx'}">
  289. <view class="box-grow-1 t-omit" :class="theme + '-m-text ' + theme">
  290. <view v-if="sign === 'advance'" class="dir-left-nowrap cross-center"
  291. :class="textStyle === 2 ? 'main-center' : ''">
  292. <view v-if="goods.goods.is_level == 1">
  293. <app-member-price :price="goods.level_price"></app-member-price>
  294. </view>
  295. <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  296. margin='0 0 0 12rpx' v-if="goods.vip_card_appoint.discount"
  297. :discount="goods.vip_card_appoint.discount"></app-sup-vip>
  298. </view>
  299. <template v-if="sign === 'advance'">
  300. <view :class="{'dir-left-nowrap': goods.goods.is_level == 1}"
  301. v-if="showGoodsPrice">
  302. <view class="dir-left-nowrap cross-center"
  303. :class="{'main-center' :textStyle == 2}">
  304. <view style="font-size: 22rpx;height: 22rpx;line-height: 22rpx">
  305. {{showGoodsPrice ? `¥${goods.goods.price}` : ''}}
  306. </view>
  307. </view>
  308. <view class="original-price"
  309. style="font-size: 17rpx;height:17rpx;line-height: 17rpx;"
  310. v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
  311. ¥{{goods.goods.goodsWarehouse.original_price}}
  312. </view>
  313. </view>
  314. </template>
  315. <template v-else>
  316. <view class="dir-left-nowrap cross-center"
  317. :class="textStyle === 2 ? 'main-center' : ''">
  318. <view>{{showGoodsPrice ? goods.price_content :
  319. ''}}
  320. </view>
  321. <view class="member-price"
  322. v-if="goods.is_level == 1 && goods.is_negotiable != 1 && sign !== 'pick'">
  323. <app-member-price margin=""
  324. :price="goods.level_price"></app-member-price>
  325. </view>
  326. <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  327. margin='0 0 0 12rpx'
  328. v-if="goods.vip_card_appoint.discount"
  329. :discount="goods.vip_card_appoint.discount"></app-sup-vip>
  330. </view>
  331. <view class="original-price"
  332. v-if="isShowOriginalPrice(goods)">
  333. ¥{{goods.original_price}}
  334. </view>
  335. </template>
  336. </view>
  337. <template v-if="showBuyBtn && goods.is_negotiable != 1 && textStyle !== 2">
  338. <view class="box-grow-0 buy-btn main-center cross-center" :style="btnStyle" :class="buyBtnClass">
  339. {{buyBtnText}}
  340. </view>
  341. </template>
  342. </view>
  343. </view>
  344. </block>
  345. </template>
  346. <!-- 一行两个 -->
  347. <template v-else-if="listStyle === 2">
  348. <block v-for="(goods, index) in newData" :key="index">
  349. <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`, overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]"
  350. class="box-grow-0 dir-top-nowrap goods-item app-column-2" :class="goodsClass"
  351. @click="jump(goods)">
  352. <view style="position: relative;">
  353. <view :style="[{'border-radius': `${imgRadius}`}]" class="out-dialog"
  354. v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
  355. <image :style="[{'border-radius': `${imgRadius}`}]"
  356. :src="appSetting.is_use_stock == '1' ? appImg.book_out : appSetting.sell_out_pic"></image>
  357. </view>
  358. <view class="box-grow-0">
  359. <template v-if="sign === 'advance'">
  360. <app-image :borderRadius="imgRadius"
  361. :img-src="goods.goods.goodsWarehouse.cover_pic"
  362. width="100%"
  363. height="342rpx"
  364. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  365. ></app-image>
  366. </template>
  367. <div v-else-if="sign === 'composition'" style="width: 100%;height: 164rpx">
  368. <app-diy-composition-image
  369. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
  370. :image-list="goods.cover_pic_list"></app-diy-composition-image>
  371. </div>
  372. <template v-else>
  373. <app-image :borderRadius="imgRadius" :img-src="goods.cover_pic" width="100%"
  374. height="342rpx"
  375. :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"></app-image>
  376. </template>
  377. </view>
  378. <view class="goods-tag" v-if="showGoodsTag">
  379. <app-image :img-src="goodsTagPicUrl" width="64rpx"
  380. height="64rpx"></app-image>
  381. </view>
  382. <view class="box-grow-0 timer" v-if="showTimer">
  383. <template v-if="sign === 'advance'">
  384. <app-goods-timer :list-style="listStyle"
  385. :start-date-time="goods.start_prepayment_at"
  386. :end-date-time="goods.end_prepayment_at"
  387. :sign="sign" :page-hide="pageHide"
  388. :theme="theme"
  389. ></app-goods-timer>
  390. </template>
  391. <template v-else>
  392. <app-goods-timer :list-style="listStyle" :start-date-time="goods.start_time"
  393. :end-date-time="goods.end_time"
  394. :sign="sign" :page-hide="pageHide"
  395. :theme="theme"
  396. ></app-goods-timer>
  397. </template>
  398. </view>
  399. </view>
  400. <view class="box-grow-1 dir-top-nowrap main-between" :class="theme">
  401. <view class="box-grow-0 goods-name t-omit-two" v-if="showGoodsName" :class="theme">
  402. <template
  403. v-if="sign !== 'advance' && sign !== 'pick' && sign !== 'gift' && sign !== 'exchange' && sign !== 'composition' && sign != 'wholesale'">
  404. <text class="tag"
  405. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-border '"
  406. v-if="tag && ((sign === 'pintuan' && goods.people_num) || sign !== 'pintuan')">
  407. {{goods.people_num ? goods.people_num : ''}}{{tag}}
  408. </text>
  409. </template>
  410. <template v-if="sign === 'pick' || sign === `gift` || sign === 'exchange' || sign === 'wholesale'">
  411. <text class="dir-tag-def"
  412. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '">
  413. {{tag}}
  414. </text>
  415. </template>
  416. <template v-if="sign === 'composition'">
  417. <text class="dir-tag-def"
  418. :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '">
  419. {{goods.tag}}
  420. </text>
  421. </template>
  422. <text v-if="sign === 'advance'">{{showGoodsName ?
  423. goods.goods.goodsWarehouse.name : ''}}
  424. </text>
  425. <text v-else>{{showGoodsName ? goods.name : ''}}</text>
  426. </view>
  427. <view v-if="sign === 'advance'">
  428. <text class="des-price" style="margin-left: 24rpx;"
  429. :class="theme + '-m-text ' + theme + '-m-border ' + theme">
  430. 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
  431. </text>
  432. </view>
  433. <view v-if="sign === 'pick'">
  434. <text class="des-price" style="margin-left: 24rpx;"
  435. :class="theme + '-m-text ' + theme + '-m-border ' + theme">
  436. {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
  437. </text>
  438. </view>
  439. <template v-if="sign === 'flash-sale'">
  440. <view :class="showProgressBar ? 'flash-sale-dis' : ''" style="margin-left: 24rpx;">
  441. <view class="flash-sale" v-if="goods.discount_type === 1" :class="theme + '-m-back ' + theme">{{goods.min_discount}}折</view>
  442. <view class="flash-sale" v-if="goods.discount_type === 2" :class="theme + '-m-back ' + theme">减{{goods.min_discount}}元</view>
  443. </view>
  444. <view v-if="showProgressBar" class="app-percentage" style="width: 296rpx;margin-left: 24rpx;" :class="theme + '-m-back-l ' +theme">
  445. <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
  446. </view>
  447. <text v-if="showProgressBar" style="font-size: 20rpx; color: #999;margin-top: 10rpx;padding-left: 24rpx">{{goods.sales}}</text>
  448. </template>
  449. <view :class="textStyle === 2 ? 'main-center' : 'dir-left-nowrap'"
  450. style="height: 15px;padding-left: 24rpx;"
  451. v-if="sign === 'advance' && goods.goods.is_level == 1 && goods.is_negotiable != 1">
  452. <view class="member-price">
  453. <app-member-price :price="goods.level_price"></app-member-price>
  454. </view>
  455. </view>
  456. <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  457. style="padding-left: 24rpx;"
  458. :class="textStyle === 2 ? 'main-center' : ''" margin="4rpx 0"
  459. v-if="goods.vip_card_appoint.discount && sign === 'advance'"
  460. :discount="goods.vip_card_appoint.discount"></app-sup-vip>
  461. <view class="box-grow-0 price dir-left-nowrap cross-bottom main-between"
  462. :style="{marginTop: sign === 'advance' ? '0rpx' : '16rpx'}">
  463. <template v-if="sign === 'advance'">
  464. <view :class="textStyle === 2 ? 'main-center advance-center' : ''"
  465. style="width: 100%" v-if="showGoodsPrice">
  466. <view class="dir-top-nowrap main-right cross-top"
  467. :class="theme + '-m-text ' + theme">
  468. <text class="t-omit"
  469. style="font-size: 22rpx;height: 22rpx; line-height: 22rpx">
  470. {{showGoodsPrice ? `¥${goods.goods.price}` : ''}}
  471. </text>
  472. <text class="original-price"
  473. style="font-size: 17rpx;height: 22rpx; line-height: 22rpx"
  474. v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
  475. ¥{{goods.goods.goodsWarehouse.original_price}}
  476. </text>
  477. </view>
  478. </view>
  479. </template>
  480. <template v-else>
  481. <view class="box-grow-1" :class="theme + '-m-text ' + theme">
  482. <view class="member-price" :class="textStyle === 2 ? 'main-center' : ''"
  483. v-if="goods.is_level == 1 && goods.is_negotiable != 1 && sign !== 'pick'">
  484. <app-member-price :price="goods.level_price"></app-member-price>
  485. </view>
  486. <view v-if="goods.vip_card_appoint.discount" :class="textStyle === 2 ? 'main-center' : ''">
  487. <app-sup-vip
  488. :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
  489. :margin="textStyle === 2 ? '0':'8rpx 0 0'"
  490. :discount="goods.vip_card_appoint.discount"
  491. ></app-sup-vip>
  492. </view>
  493. <view class="t-omit">
  494. {{showGoodsPrice ? goods.price_content : ''}}
  495. </view>
  496. <view class="original-price"
  497. v-if="isShowOriginalPrice(goods)">
  498. ¥{{goods.original_price}}
  499. </view>
  500. </view>
  501. </template>
  502. <view v-if="showBuyBtn && goods.is_negotiable != 1 && textStyle !== 2" class="box-grow-0 buy-btn main-center cross-center" :style="btnStyle" :class="buyBtnClass">
  503. {{buyBtnText}}
  504. </view>
  505. </view>
  506. </view>
  507. </view>
  508. </block>
  509. </template>
  510. </view>
  511. </view>
  512. </template>
  513. <script>
  514. import { mapGetters, mapState } from "vuex";
  515. import appPrice from "../../page-component/goods/app-price.vue";
  516. import appGoodsTimer from "./app-goods-timer.vue";
  517. import appDiyCompositionImage from '../app-diy-goods-list/app-diy-composition-image';
  518. export default {
  519. name: "app-diy-goods-list",
  520. components: {
  521. 'app-price': appPrice,
  522. 'app-goods-timer': appGoodsTimer,
  523. appDiyCompositionImage
  524. },
  525. props: {
  526. list: {
  527. type: Array,
  528. default() {
  529. return [];
  530. }
  531. },
  532. goodsStyle: {
  533. type: Number,
  534. default() {
  535. return 1;
  536. }
  537. },
  538. textStyle: {
  539. type: Number,
  540. default() {
  541. return 1;
  542. }
  543. },
  544. listStyle: {
  545. type: Number,
  546. default() {
  547. return -1;
  548. }
  549. },
  550. showBuyBtn: {
  551. type: Boolean,
  552. default() {
  553. return false;
  554. }
  555. },
  556. buyBtnText: {
  557. type: String,
  558. default() {
  559. return '';
  560. }
  561. },
  562. buyBtnStyle: {
  563. type: Number,
  564. default() {
  565. return 1;
  566. }
  567. },
  568. fill: {
  569. type: Number,
  570. default() {
  571. return 1;
  572. }
  573. },
  574. showGoodsName: {
  575. type: Boolean,
  576. default() {
  577. return true;
  578. }
  579. },
  580. showGoodsPrice: {
  581. type: Boolean,
  582. default() {
  583. return true;
  584. }
  585. },
  586. showGoodsTag: {
  587. type: Boolean,
  588. default() {
  589. return true;
  590. }
  591. },
  592. goodsCoverProportion: {
  593. type: String,
  594. default() {
  595. return '1-1';
  596. }
  597. },
  598. customizeGoodsTag: {
  599. type: Boolean,
  600. default() {
  601. return false;
  602. }
  603. },
  604. goodsTagPicUrl: String,
  605. sign: String,
  606. buttonColor: {
  607. type: String,
  608. default() {
  609. return '';
  610. }
  611. },
  612. //是否显示划线价
  613. isUnderLinePrice: {
  614. type: Boolean,
  615. default() {
  616. return true;
  617. }
  618. },
  619. pageHide: Boolean,
  620. theme: String,
  621. showProgressBar: {
  622. type: Boolean,
  623. default() {
  624. return false;
  625. }
  626. }
  627. },
  628. data() {
  629. return {
  630. imgRadius: '16rpx 16rpx 0 0',
  631. lisRadius: '16rpx'
  632. };
  633. },
  634. computed: {
  635. ...mapState({
  636. appImg: state => state.mallConfig.__wxapp_img.mall,
  637. appSetting: state => state.mallConfig.mall.setting
  638. }),
  639. ...mapGetters('mallConfig',{
  640. vip: 'getVip',
  641. getVideo: 'getVideo'
  642. }),
  643. newData() {
  644. return this.list;
  645. },
  646. listClass() {
  647. switch (this.listStyle) {
  648. case 2:
  649. return `dir-left-wrap column-2 main-between `;
  650. default:
  651. return ``;
  652. }
  653. },
  654. buyBtnClass() {
  655. let buyBtnClass = ``;
  656. if (this.buyBtnStyle === 2 || this.buyBtnStyle === 4) {
  657. buyBtnClass += `buy-btn-border `;
  658. }
  659. if (this.buyBtnStyle === 4 || this.buyBtnStyle === 3) {
  660. buyBtnClass += `buy-btn-radius`;
  661. }
  662. return buyBtnClass;
  663. },
  664. btnStyle() {
  665. let btnStyle = ``;
  666. if (this.buyBtnStyle === 1 || this.buyBtnStyle === 3) {
  667. btnStyle += `background-color: ${this.buttonColor};color: #ffffff;`;
  668. } else {
  669. btnStyle += `border-color: ${this.buttonColor};color: ${this.buttonColor};`;
  670. }
  671. return btnStyle;
  672. },
  673. coverPicHeight() {
  674. if (this.goodsCoverProportion === '1-1') {
  675. return `702rpx`;
  676. } else {
  677. return `468rpx`;
  678. }
  679. },
  680. goodsClass() {
  681. let goodsClass = ``;
  682. if (this.goodsStyle === 2) {
  683. goodsClass += `border ${this.theme} `;
  684. }
  685. if (this.textStyle === 2) {
  686. goodsClass += `text-center ${this.theme} `;
  687. }
  688. return goodsClass;
  689. },
  690. tag() {
  691. let tag = '';
  692. switch (this.sign) {
  693. case 'miaosha':
  694. tag = '秒杀';
  695. break;
  696. case 'bargain':
  697. tag = '砍价';
  698. break;
  699. case 'pintuan':
  700. tag = '人团';
  701. break;
  702. case 'advance':
  703. tag = '预售';
  704. break;
  705. case 'pick':
  706. tag = 'N元任选';
  707. break;
  708. case 'composition':
  709. tag = '套餐组合';
  710. break;
  711. case 'gift':
  712. tag = '社交送礼';
  713. break;
  714. case 'flash-sale':
  715. tag = '限时抢购';
  716. break;
  717. case 'wholesale':
  718. tag = '商品批发';
  719. break;
  720. case 'exchange':
  721. tag = '礼品卡';
  722. break;
  723. default:
  724. tag = null;
  725. break;
  726. }
  727. return tag;
  728. },
  729. showTimer() {
  730. if (!(this.sign === 'miaosha' || this.sign === 'bargain' || this.sign === 'lottery' || this.sign === 'advance' || this.sign === 'flash-sale')) return false;
  731. return true;
  732. },
  733. },
  734. methods: {
  735. jump(data) {
  736. // #ifndef MP-BAIDU
  737. if (data.video_url && this.getVideo == 1 && data.sign !== 'lottery' && data.sign !== 'bargain' && data.sign !== 'wholesale') {
  738. let id = data.id;
  739. if (data.sign === 'advance') {
  740. id = data.goods_id;
  741. }
  742. if (data.sign === 'gift') {
  743. id = id + '&is_share=1';
  744. }
  745. uni.navigateTo({
  746. url: `/pages/goods/video?goods_id=${id}&sign=${data.sign}`
  747. });
  748. } else {
  749. uni.navigateTo({
  750. url: data.page_url
  751. });
  752. }
  753. // #endif
  754. // #ifdef MP-BAIDU
  755. uni.navigateTo({
  756. url: data.page_url
  757. });
  758. // #endif
  759. },
  760. isShowOriginalPrice(goods) {
  761. return this.isUnderLinePrice && goods.original_price && this.showGoodsPrice && goods.is_negotiable !== 1;
  762. },
  763. }
  764. }
  765. </script>
  766. <style scoped lang="scss">
  767. .advance-member {
  768. margin-right: #{12rpx};
  769. }
  770. .advance-center .original-price {
  771. width: 100%;
  772. text-align: center;
  773. }
  774. .app-goods-list {
  775. %background-image {
  776. background-repeat: no-repeat;
  777. background-size: cover;
  778. background-position: center;
  779. }
  780. .goods-list {
  781. padding: #{24rpx 24rpx 24rpx 24rpx};
  782. font-size: $uni-font-size-general-one;
  783. .border {
  784. border: #{1rpx} solid #e2e2e2;
  785. }
  786. .goods-item {
  787. position: relative;
  788. .app-button-icon {
  789. width: #{45rpx};
  790. height: #{45rpx};
  791. display: block;
  792. @extend %background-image;
  793. }
  794. .app-button-icon-cart {
  795. background-image: url('../../../static/image/icon/cats.png');
  796. }
  797. .app-button-icon-add {
  798. background-image: url('../../../static/image/icon/add-to.png');
  799. }
  800. .buy-btn {
  801. height: #{48rpx};
  802. padding: 0 #{20rpx};
  803. }
  804. .buy-btn-radius {
  805. border-radius: #{24rpx};
  806. }
  807. .buy-btn-border {
  808. border: #{1rpx} solid;
  809. }
  810. .goods-tag {
  811. position: absolute;
  812. left: 0;
  813. top: 0;
  814. z-index: 10;
  815. width: #{64rpx};
  816. height: #{64rpx};
  817. }
  818. .original-price {
  819. font-size: $uni-font-size-weak-two;
  820. color: $uni-general-color-two;
  821. text-decoration: line-through;
  822. }
  823. .tag {
  824. padding: 0 #{10rpx};
  825. margin-right: #{8rpx};
  826. font-size: #{20rpx};
  827. line-height: 1;
  828. border-radius: #{28rpx};
  829. border: #{1rpx} solid;
  830. transform: rotateZ(360deg);
  831. }
  832. .timer {
  833. width: 100%;
  834. }
  835. .pintuan-tag {
  836. font-size: $uni-font-size-weak-two;
  837. margin: #{16rpx} #{12rpx} 0 0;
  838. padding: 0 #{24rpx};
  839. .people {
  840. width: #{70rpx};
  841. text-align: center;
  842. border: #{1rpx} solid;
  843. border-radius: #{2rpx};
  844. padding: #{2rpx} 0;
  845. }
  846. }
  847. }
  848. .app-list-mode {
  849. margin-bottom: #{32rpx};
  850. position: relative;
  851. border-radius: #{16rpx};
  852. .name {
  853. font-size: #{28rpx};
  854. color: #353535;
  855. line-height: 38upx;
  856. }
  857. .right {
  858. height: #{220rpx};
  859. }
  860. &:last-child {
  861. margin-bottom: 0;
  862. }
  863. .pintuan-tag {
  864. padding: 0;
  865. }
  866. .out-dialog {
  867. width: #{220rpx};
  868. height: 100%;
  869. position: absolute;
  870. z-index: 11;
  871. top: 0;
  872. left: 0;
  873. background-color: rgba(0,0,0,.5);
  874. image {
  875. width: #{220rpx};
  876. height: #{220rpx};
  877. }
  878. }
  879. }
  880. .app-column-1 {
  881. padding-bottom: #{24rpx};
  882. border-radius: #{16rpx};
  883. .out-dialog {
  884. width: 100%;
  885. height: #{702rpx};
  886. z-index: 11;
  887. position: absolute;
  888. top: 0;
  889. left: 0;
  890. background-color: rgba(0,0,0,.5);
  891. image {
  892. width: #{702rpx};
  893. height: #{702rpx};
  894. }
  895. }
  896. .goods-name {
  897. margin-top: #{28rpx};
  898. padding: 0 #{24rpx};
  899. font-size: #{28rpx};
  900. color: #353535;
  901. line-height: 38upx;
  902. }
  903. .price {
  904. margin-top: #{16rpx};
  905. padding: 0 #{24rpx};
  906. max-width: #{702rpx};
  907. .member-price {
  908. margin-left: #{10rpx};
  909. }
  910. }
  911. .timer {
  912. position: absolute;
  913. left: 0;
  914. bottom: 0;
  915. z-index: 10;
  916. }
  917. .pintuan-tag {
  918. margin: 0;
  919. padding-left: 0;
  920. }
  921. }
  922. .app-column-1-mar {
  923. margin-bottom: #{24rpx};
  924. }
  925. &.column-2 {
  926. padding: #{24rpx} #{23rpx} 0 #{23rpx};
  927. .app-column-2 {
  928. margin-bottom: #{24rpx};
  929. padding-bottom: #{24rpx};
  930. border-radius: #{16rpx};
  931. width: #{346rpx};
  932. .out-dialog {
  933. width: 100%;
  934. height: #{342rpx};
  935. position: absolute;
  936. z-index: 11;
  937. top: 0;
  938. left: 0;
  939. background-color: rgba(0,0,0,.5);
  940. image {
  941. width: #{342rpx};
  942. height: #{342rpx};
  943. }
  944. }
  945. .goods-name {
  946. font-size: #{28rpx};
  947. color: #353535;
  948. margin-top: #{24rpx};
  949. padding: 0 #{24rpx};
  950. width: #{344rpx};
  951. line-height: 38upx;
  952. }
  953. .price {
  954. margin-top: #{16rpx};
  955. padding: 0 #{24rpx};
  956. max-width: #{344rpx};
  957. }
  958. .pintuan-tag ~ .price {
  959. margin-top: #{16rpx};
  960. }
  961. .timer {
  962. position: absolute;
  963. left: 0;
  964. bottom: 0;
  965. z-index: 10;
  966. }
  967. }
  968. }
  969. }
  970. }
  971. .des-price {
  972. display: inline-block;
  973. padding: #{0rpx 4rpx};
  974. border: #{1rpx} solid;
  975. border-radius: #{8rpx};
  976. font-size: #{20rpx};
  977. line-height: 1.2;
  978. transform: rotateZ(360deg);
  979. }
  980. .dir-tag-def {
  981. padding: 0 #{10rpx};
  982. margin-right: #{8rpx};
  983. font-size: $uni-font-size-weak-two;
  984. border-radius: #{28rpx};
  985. }
  986. .seheight {
  987. height: #{110rpx};
  988. width: #{430rpx};
  989. }
  990. .default-text {
  991. color: #666666;
  992. }
  993. .tag-pick {
  994. padding: 0 #{10rpx};
  995. margin-right: #{8rpx};
  996. font-size: $uni-font-size-weak-two;
  997. border-radius: #{28rpx};
  998. }
  999. .goods-price {
  1000. font-size: #{30upx};
  1001. line-height: 1.1;
  1002. }
  1003. .app-percentage {
  1004. height: #{20rpx};
  1005. border-radius: #{12rpx};
  1006. overflow: hidden;
  1007. >view {
  1008. height: #{20rpx};
  1009. border-radius: #{12rpx};
  1010. }
  1011. }
  1012. .flash-sale {
  1013. padding: 5upx 10upx;
  1014. font-size: 20upx;
  1015. color: #fff;
  1016. line-height: 1;
  1017. border-radius: 14upx;
  1018. margin-right: 10upx;
  1019. display: inline-block;
  1020. }
  1021. .flash-sale-dis {
  1022. margin-bottom: 10upx;
  1023. }
  1024. </style>