index.vue 7.0 KB

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