index.vue 8.0 KB

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