index.vue 7.6 KB

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