index.vue 6.2 KB

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