index.vue 7.5 KB

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