index.vue 6.6 KB

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