index.vue 6.6 KB

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