index.vue 7.7 KB

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