index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <gracePage :customHeader="false">
  3. <view class="container" slot="gBody">
  4. <swiper class="cover" @change="change" :circular="swiper.circular">
  5. <swiper-item v-for="(v, k) in fetch.info.pic_bg" :key="k">
  6. <view class="default">
  7. <image :src="v" mode="widthFix" style="height:auto;"></image>
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. <view class="btn-ctrls">
  12. <view class="btn-wrapper space-between" v-if="fetch.button" :style="fetch.button.bgcolor">
  13. <view class="button primary big" :style="fetch.button.color" v-if="fetch.button.name && fetch.button.name[0]" @click="goView">{{fetch.button.name[0]}}</view>
  14. <block v-if="fetch.button.name && fetch.button.name[1]">
  15. <text class="spliter"></text>
  16. <view class="button primary big" :style="fetch.button.color" @click="goRanking">{{fetch.button.name[1]}}</view>
  17. </block>
  18. </view>
  19. <view class='dots'>
  20. <text :class="swiper.index == k ? 'cur' : ''" v-for="(v, k) in fetch.items" :key="k"></text>
  21. </view>
  22. </view>
  23. <view v-if="buyState">
  24. <buy :id="id" :bgcolor="fetch.button.bgcolor" :color="fetch.button.color" @hideBuy="hideBuy" @view="view"></buy>
  25. </view>
  26. <view v-if="rankingState">
  27. <ranking :id="id" :bgcolor="fetch.button.bgcolor" :color="fetch.button.color" @hideRanking="hideRanking"></ranking>
  28. </view>
  29. </view>
  30. </gracePage>
  31. </template>
  32. <script>
  33. import buy from "@/pages/dream/buy.vue";
  34. import ranking from "@/pages/dream/ranking.vue";
  35. export default{
  36. data() {
  37. return {
  38. id : 0,
  39. swiper : {
  40. index : 0,
  41. circular : true,
  42. },
  43. fetch: {
  44. page_id : 0,
  45. is_buy : false,
  46. info : {},
  47. button : {}
  48. },
  49. buyState : false,
  50. rankingState : false,
  51. }
  52. },
  53. onLoad(option) {
  54. this.id = option.id;
  55. this.getData();
  56. },
  57. // 重新加载
  58. onPullDownRefresh: function() {
  59. this.getData();
  60. },
  61. methods:{
  62. change : function(e) {
  63. this.swiper.index = e.detail.current;
  64. },
  65. getData : function() {
  66. this.Dever.get(this, 'app/collection/?l=api.getInfo', {id:this.id});
  67. },
  68. goView : function() {
  69. //是否购买
  70. if (!this.fetch.is_buy) {
  71. this.buyState = true;
  72. } else {
  73. this.view();
  74. }
  75. },
  76. view : function() {
  77. this.Dever.location('dream/view?id='+this.id+'&page_id='+this.fetch.page_id+'&index=0');
  78. },
  79. hideBuy : function() {
  80. this.buyState = false;
  81. },
  82. hideRanking : function() {
  83. this.rankingState = false;
  84. },
  85. goRanking : function() {
  86. this.rankingState = true;
  87. }
  88. },
  89. components:{
  90. buy,ranking
  91. }
  92. }
  93. </script>
  94. <style>
  95. .container {
  96. position: absolute;
  97. height: 100%;
  98. width: 100%;
  99. left: 0;
  100. top: 0;
  101. overflow: hidden;
  102. }
  103. .btn-wrapper {
  104. justify-content: space-around;
  105. width: 100%;
  106. }
  107. .button {
  108. height: 80rpx;
  109. border: 1rpx solid #cc1619;
  110. color: #cc1619;
  111. font-size: 30rpx;
  112. min-width: 300rpx;
  113. border-radius: 40rpx;
  114. text-align: center;
  115. line-height: 80rpx;
  116. display: block;
  117. position: relative;
  118. }
  119. .button>button{
  120. position: absolute;
  121. width: 100%;
  122. height: 100%;
  123. left: 0;
  124. top: 0;
  125. opacity: 0;
  126. }
  127. .button.big {
  128. width: 630rpx;
  129. }
  130. .button.primary {
  131. background-color: #cc1619;
  132. color: #fff;
  133. }
  134. .button.blk {
  135. background-color: #000;
  136. color: #fff;
  137. border-color: #000;
  138. }
  139. .cover {
  140. width: 750rpx;
  141. height: 100%;
  142. }
  143. swiper-item>view{
  144. height: 100%;
  145. }
  146. swiper-item image{
  147. width: 750rpx;
  148. height: 100%;
  149. }
  150. .btn-ctrls {
  151. position: absolute;
  152. bottom: 40rpx;
  153. left: 200rpx;
  154. right: 200rpx;
  155. }
  156. .btn-ctrls .btn-wrapper {
  157. margin-top: 20rpx;
  158. width: 350rpx;
  159. display: flex;
  160. align-items: center;
  161. border-radius: 5rpx;
  162. background-color: #000;
  163. }
  164. .btn-ctrls .btn-wrapper .button{
  165. border-radius: 0;
  166. min-width: 100rpx;
  167. background-color: transparent;
  168. border: 0;
  169. flex: 1;
  170. }
  171. .btn-ctrls .btn-wrapper .spliter{
  172. flex-shrink: 0;
  173. width: 1rpx;
  174. background: #fff;
  175. height: 40rpx;
  176. color: #333;
  177. }
  178. .btn-ctrls .btn-wrapper .button.small{
  179. min-width: 150rpx;
  180. }
  181. .btn-ctrls .btn-wrapper .button.big{
  182. width: 420rpx;
  183. }
  184. .btn-ctrls .dots{
  185. display: flex;
  186. justify-content: center;
  187. margin-top: 20rpx;
  188. }
  189. .btn-ctrls .dots text{
  190. display: block;
  191. width: 16rpx;
  192. height: 8rpx;
  193. background: rgba(255, 255, 255, 0.5);
  194. border-radius: 8rpx;
  195. margin: 0 5rpx;
  196. }
  197. .btn-ctrls .dots text.cur{
  198. background-color: rgba(255, 255, 255, 1);
  199. }
  200. .btn-ctrls .scorelist{
  201. text-align: center;
  202. }
  203. .btn-ctrls .scorelist navigator{
  204. display: inline-block;
  205. font-size: 26rpx;
  206. color: #FFFFFF;
  207. text-decoration: underline;
  208. }
  209. .space-between{
  210. justify-content: space-between;
  211. }
  212. .btn-wrapper{
  213. display: flex;
  214. }
  215. .ios-pay{
  216. display: none;
  217. }
  218. .pulloff{
  219. position: fixed;
  220. width: 100%;
  221. height: 100%;
  222. top: 0;
  223. left: 0;
  224. z-index: 20;
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. }
  229. .pulloff>view{
  230. background-color: rgba(0, 0, 0, 0.65);
  231. padding: 53rpx 53rpx 53rpx 74rpx;
  232. border-radius: 10rpx;
  233. text-align: center;
  234. }
  235. .pulloff>view text{
  236. color: #fff;
  237. font-size: 30rpx;
  238. line-height: 53rpx;
  239. }
  240. .preselltip .layer{
  241. border-radius: 5rpx;
  242. padding:70rpx 40rpx;
  243. }
  244. .preselltip .layer .tit{
  245. font-size: 24rpx;
  246. text-align: center;
  247. margin: 16rpx 0 80rpx;
  248. }
  249. .preselltip .layer .btn-wrapper{
  250. position: absolute;
  251. bottom: 0;
  252. left: 0;
  253. }
  254. .preselltip .layer .btn-wrapper .button{
  255. width: 100%;
  256. border-radius: 0 0 5rpx 5rpx;
  257. }
  258. .recharge-layer{
  259. padding: 50rpx 55rpx 62rpx;
  260. background-color: #fff;
  261. position: absolute;
  262. bottom: 0;
  263. left: 0;
  264. right: 0;
  265. transform: translateY(100%);
  266. transition-property: transform;
  267. transition-duration: 0.3s;
  268. transition-timing-function: ease-in;
  269. }
  270. .recharge-layer.slidein{
  271. transform: translateY(0);
  272. }
  273. .recharge-layer .tit{
  274. font-weight: bolder;
  275. font-size: 36rpx;
  276. margin: 0 0 40rpx;
  277. }
  278. .recharge-layer .msg{
  279. font-size: 22rpx;
  280. line-height: 36rpx;
  281. width: 640rpx;
  282. margin: 0 auto 47rpx;
  283. }
  284. .recharge-layer input{
  285. width: 640rpx;
  286. height: 88rpx;
  287. border: 1rpx solid #EEEEEE;
  288. border-radius: 5rpx;
  289. box-sizing: border-box;
  290. padding: 0 25rpx;
  291. font-size: 24rpx;
  292. }
  293. .recharge-layer .errtip {
  294. color: #d1171a;
  295. font-size: 24rpx;
  296. margin: 21rpx 0 0;
  297. height: 34rpx;
  298. }
  299. .recharge-layer .btn-wrapper{
  300. display: flex;
  301. justify-content: space-between;
  302. padding-top: 20rpx;
  303. }
  304. .recharge-layer .btn-wrapper .button{
  305. border: 0;
  306. min-width: 0;
  307. border-radius: 5rpx;
  308. box-sizing: border-box;
  309. color: #999999;
  310. width: 284rpx;
  311. }
  312. .recharge-layer .btn-wrapper .button.primary{
  313. border:0;
  314. color: #fff;
  315. }
  316. .recharge-layer .btn-wrapper .button.cancel{
  317. border:0;
  318. background-color: #CCCCCC;
  319. color: #fff;
  320. }
  321. .recharge-mask{
  322. position: fixed;
  323. width: 100%;
  324. height: 100%;
  325. background: rgba(0, 0, 0, 0.5);
  326. left: 0;
  327. top: 0;
  328. display: none;
  329. }
  330. </style>