Activitydetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <home-base :show="!special || !special['activity/detail'+activity_id] || special['activity/detail'+activity_id]['editablePage']['editable_page_theme_config']['if_show_footer']==1" style="position: absolute;top:0;right:0;left:0;bottom:0"><view style="height:100%" class="scroll-view-wrapper div distributor-activity-list">
  3. <special-index v-show="special && special['activity/detail'+activity_id]" :page-path="'activity/detail'" :item-id="activity_id"></special-index>
  4. <view class="scroll-view-wrapper scroll-view div" v-show="!special || !special['activity/detail'+activity_id]">
  5. <view class="scroll-view-wrapper scroll-view div main-content">
  6. <view class="div common-header-wrap">
  7. <view :style="'height:'+navHeight+'px'"></view>
  8. <view class="common-header-holder"></view>
  9. <view class="common-header-fixed">
  10. <title-header />
  11. <uni-nav-bar title="活动详情" class="common-header" left-icon="back" @clickLeft="goBack()">
  12. </uni-nav-bar>
  13. </view>
  14. </view>
  15. <view class="div brand_detail_banner" v-if="activity">
  16. <view class="div wqvue-image img">
  17. <image mode="aspectFit" class="img" style="min-width: 1px; width: 100%; height: auto; transform: none; left: 0px; top: 0px; position: relative; vertical-align: top;" :src="activity.activity_banner_mobile_url" />
  18. </view>
  19. <view class="div brand_detail_info">
  20. <view class="div detail_info_other">
  21. <text class="span info_other_title">{{activity.activity_title}}</text>
  22. </view>
  23. <view class="div detail_info_all">
  24. {{activity.activity_desc}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="scroll-view div ping_list" style="position:relative">
  29. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div row_list" @scrolltolower="loadMore" scroll-y="true">
  30. <view class="div" v-if="activitydetail_list">
  31. <view @click="goGoodsDetail(item)" class="div item" v-for="item in activitydetail_list" :key="item.goods_id">
  32. <view class="div cover bg_stamp">
  33. <view class="div wqvue-image img">
  34. <image mode="aspectFit" class="img" :src="item.goods_image_url" style="border-radius:.4rem;min-width: 1px; width: 100%; height: auto; transform: none; left: 0px; top: 0px; position: relative; vertical-align: top;" />
  35. </view>
  36. <!---->
  37. </view>
  38. <view class="div info">
  39. <view class="div name">
  40. <view class="div tag_container">
  41. </view>{{item.goods_name}}
  42. </view>
  43. <view class="div tags">
  44. <text class="span span">{{item.store_name}}</text>
  45. </view>
  46. <view class="div price">
  47. <text class="span span">¥<text class="span em">{{parseFloat(item.goods_price)}}</text></text>
  48. <text class="span del" v-if="item.goods_marketprice">¥{{parseFloat(item.goods_marketprice)}}</text>
  49. </view>
  50. <view class="div btn">
  51. 去购买
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </scroll-view>
  57. </view>
  58. </view>
  59. <empty-record v-if='activitydetail_list && !activitydetail_list.length'></empty-record>
  60. </view>
  61. </view></home-base>
  62. </template>
  63. <script>
  64. import {getFontSize} from '@/util/common'
  65. import TitleHeader from '../../TitleHeader'
  66. import { urlencode } from '@/util/common'
  67. import HomeBase from '../HomeBase'
  68. import { mapState } from 'vuex'
  69. import EmptyRecord from '../../EmptyRecord'
  70. import SpecialIndex from '../special/Index'
  71. import { getActivityDetail } from '../../../api/homeActivity'
  72. export default {
  73. name:'HomeDocument',
  74. components:{
  75. TitleHeader,
  76. HomeBase,
  77. EmptyRecord,
  78. SpecialIndex
  79. },
  80. mounted(){
  81. // #ifdef MP-WEIXIN
  82. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  83. // #endif
  84. },
  85. data(){
  86. return {
  87. navHeight: 0,
  88. activity_id: 0,
  89. activity: false,
  90. activitydetail_list: false,
  91. params: { 'page': 0, 'per_page': 10 },
  92. loading: false, // 是否加载更多
  93. isMore: true // 是否有更多
  94. }
  95. },
  96. onLoad: function (option) {
  97. this.activity_id=option.activity_id
  98. this.loadMore()
  99. },
  100. computed:{
  101. fontSize(){
  102. return getFontSize()
  103. },
  104. ...mapState({
  105. special: state => state.home.special
  106. })
  107. },
  108. methods:{
  109. goBack(){uni.navigateBack({delta:1})},
  110. loadMore () {
  111. if (this.loading) {
  112. return
  113. }
  114. this.loading = true
  115. this.params.page = ++this.params.page
  116. if (this.isMore) {
  117. this.getActivityList(true)
  118. }
  119. },
  120. getActivityList () {
  121. uni.showLoading({ title: '加载中' })
  122. getActivityDetail(Object.assign({ activity_id: this.activity_id }, this.params)).then(res => {
  123. this.activity = res.result.activity
  124. uni.hideLoading()
  125. if (res.result.hasmore) {
  126. this.isMore = true
  127. } else {
  128. this.isMore = false
  129. }
  130. if (this.activitydetail_list) {
  131. this.activitydetail_list = this.activitydetail_list.concat(res.result.activitydetail_list)
  132. } else {
  133. this.activitydetail_list = res.result.activitydetail_list
  134. }
  135. this.loading = false
  136. }).catch(error => {
  137. uni.hideLoading()
  138. uni.showToast({icon:'none',title: error.message})
  139. this.loading = false
  140. })
  141. },
  142. goGoodsDetail (item) {
  143. uni.navigateTo({ url: '/pages/home/goodsdetail/Goodsdetail'+'?'+urlencode( { 'goods_id': item.goods_id } )})
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .scroll-view-wrapper{display: flex;flex-direction: column;}
  150. .scroll-view{flex:1}
  151. .main-content{background: #fff}
  152. .common-header-wrap .common-header{
  153. box-shadow: unset;
  154. }
  155. .brand_detail_banner {
  156. position: relative;
  157. min-height: 11.25rem;
  158. margin-bottom: .5rem
  159. }
  160. .brand_detail_banner .timer {
  161. position: absolute;
  162. top: 0;
  163. left: 0;
  164. height: 1rem;
  165. padding: 0 .4rem;
  166. background: hsla(0,0%,100%,.5);
  167. border-radius: 0 0 .5rem;
  168. font-size:$fontSize;
  169. font-family: PingFangSC-Regular;
  170. font-weight: 400;
  171. color: #e43f42;
  172. line-height: 1rem;
  173. text-align: center;
  174. z-index: 2
  175. }
  176. .brand_detail_banner .img {
  177. width: 100%;
  178. height: 6rem
  179. }
  180. .brand_detail_info {
  181. position: relative;
  182. background-color: #fff;
  183. box-shadow: 0 .25rem .75rem 0 rgba(0,0,0,.05);
  184. border-radius: .4rem;
  185. width: 17.25rem;
  186. min-height: 4.75rem;
  187. margin: -10px auto 0;
  188. padding: .5rem;
  189. bottom: 1rem;
  190. box-sizing: border-box
  191. }
  192. .brand_detail_info .detail_info_other {
  193. text-align: center;
  194. }
  195. .brand_detail_info .detail_info_other .info_other_title {
  196. font-family: PingFang-SC-Bold;
  197. font-size:$h1;
  198. color: #333;
  199. font-weight: 700;
  200. max-width: 5.75rem;
  201. overflow: hidden
  202. }
  203. .brand_detail_info .detail_info_other .info_other_mark {
  204. font-family: PingFang-SC-Medium;
  205. font-size:$fontSize;
  206. max-width: 4rem;
  207. overflow: hidden;
  208. color: #333
  209. }
  210. .brand_detail_info .detail_info_all {
  211. font-family: PingFang-SC-Regular;
  212. font-size:$fontSize;
  213. color: #999;
  214. padding: .5rem .25rem 0
  215. }
  216. .ping_list {
  217. margin-top: .5rem
  218. }
  219. .row_list .item {
  220. position: relative;
  221. margin: 0 .5rem;
  222. height: 6.75rem;
  223. overflow: hidden;
  224. padding-bottom: .6rem;
  225. border-bottom: 1px solid #f7f7f7
  226. }
  227. .row_list .cover {
  228. position: absolute;
  229. top: 0;
  230. left: 0;
  231. width: 6.75rem;
  232. height: 6.75rem
  233. }
  234. .row_list .cover .img {
  235. display: block;
  236. width: 6.75rem;
  237. height: 6.75rem;
  238. border-radius: .25rem 0 0 .25rem
  239. }
  240. .row_list .info {
  241. position: relative;
  242. margin-left: 7.5rem;
  243. padding-top: .5rem;
  244. height: 6.75rem;
  245. box-sizing: border-box
  246. }
  247. .row_list .name {
  248. margin: 0 0 .3rem;
  249. color: #333;
  250. font-family: PingFangSC-Semibold;
  251. font-size:$subFontSize;
  252. white-space: normal;
  253. overflow: hidden;
  254. text-overflow: ellipsis;
  255. display: -webkit-box;
  256. -webkit-line-clamp: 2;
  257. -webkit-box-orient: vertical;
  258. word-break: break-all
  259. }
  260. .row_list .tag_container {
  261. display: inline-block;
  262. margin-bottom: -2px
  263. }
  264. .row_list .sale_icon {
  265. float: left;
  266. width: 28px;
  267. height: 14px;
  268. margin-right: 3px
  269. }
  270. .row_list .ziying_tag {
  271. float: left;
  272. width: 24px;
  273. height: 14px;
  274. margin-right: 3px
  275. }
  276. .row_list .logistics_tag {
  277. float: left;
  278. width: 49px;
  279. height: 14px;
  280. margin-right: 3px
  281. }
  282. .row_list .tags {
  283. margin-bottom: .2rem;
  284. height: .7rem;
  285. white-space: nowrap;
  286. overflow: hidden;
  287. display: -webkit-box;
  288. display: -webkit-flex;
  289. display: flex
  290. }
  291. .row_list .tags,.row_list .tags .span {
  292. -webkit-box-align: center;
  293. -webkit-align-items: center;
  294. align-items: center
  295. }
  296. .row_list .tags .span {
  297. display: -webkit-inline-box;
  298. display: -webkit-inline-flex;
  299. display: inline-flex;
  300. padding: 0 .3rem;
  301. font-family: PingFangSC-Regular;
  302. font-size:$h6;
  303. color: #f43638;
  304. border: 1px solid #ffcccd;
  305. border-radius: 4px;
  306. box-sizing: border-box;
  307. height: .6rem
  308. }
  309. .row_list .tags .span:not(:last-child) {
  310. margin-right: .25rem
  311. }
  312. .row_list .tags .span_android {
  313. line-height: normal;
  314. padding: .05rem .3rem
  315. }
  316. .row_list .price {
  317. position: absolute;
  318. bottom: .45rem;
  319. left: 0;
  320. color: #ff4142;
  321. font-size:$fontSize;
  322. display: -webkit-box;
  323. display: -webkit-flex;
  324. display: flex;
  325. -webkit-box-pack: start;
  326. -webkit-justify-content: flex-start;
  327. justify-content: flex-start;
  328. -webkit-box-align: center;
  329. -webkit-align-items: center;
  330. align-items: center;
  331. -webkit-flex-wrap: wrap;
  332. flex-wrap: wrap;
  333. height: 1.1rem;
  334. overflow: hidden
  335. }
  336. .row_list .price .fxprice {
  337. margin-left: .25rem
  338. }
  339. .row_list .price .span {
  340. height: 1.1rem;
  341. line-height: 1.1rem;
  342. margin-right: .25rem;
  343. font-size:$subFontSize;
  344. font-family: JDZH-Regular
  345. }
  346. .row_list .price .span .em {
  347. font-size: 1.1rem
  348. }
  349. .row_list .price .span .normal {
  350. font-size:$subFontSize
  351. }
  352. .row_list .price .del {
  353. color: #999;
  354. text-decoration: line-through
  355. }
  356. .row_list .desc {
  357. position: absolute;
  358. bottom: .6rem;
  359. left: 0;
  360. color: #999;
  361. font-size:$fontSize
  362. }
  363. .row_list .desc .del {
  364. text-decoration: line-through
  365. }
  366. .row_list .btn {
  367. position: absolute;
  368. bottom: .45rem;
  369. right: .5rem;
  370. width: 3.25rem;
  371. height: 1.5rem;
  372. line-height: 1.5rem;
  373. color: #fff;
  374. font-size:$subFontSize;
  375. text-align: center;
  376. border-radius: .25rem;
  377. background:$primaryGradualColor;
  378. box-shadow: 0 .15rem .3rem $subColor
  379. }
  380. .row_list+.ping_floortit {
  381. margin-top: -.75rem
  382. }
  383. </style>