index.vue 7.6 KB

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