index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <gracePage :customHeader="false">
  3. <view class="container" slot="gBody">
  4. <ourLoading isFullScreen :active="pageLoading" :text="pageLoadingText" />
  5. <view class="wrap2" @click="showBuy">
  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" @hideInfo="hideInfo"></info>
  40. </view>
  41. <view class="mask buy-layer" v-if="inviteState">
  42. <view class="buytip-layer layer " catchtap="handleStop">
  43. <view class="buy-tit">邀请你</view>
  44. <text class="p">222</text>
  45. <view class="btn-wrapper ">
  46. <view class="button cancel" @click="hideInvite">取消
  47. </view>
  48. <view class="button primary" :style="fetch.button.bgcolor" @click="hideInvite">确认
  49. <button formType="submit"></button>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </gracePage>
  56. </template>
  57. <script>
  58. import buy from "@/pages/dream/buy.vue";
  59. import ranking from "@/pages/dream/ranking.vue";
  60. import info from "@/pages/dream/info.vue";
  61. export default{
  62. data() {
  63. return {
  64. id : 0,
  65. swiper : {
  66. index : 0,
  67. circular : true,
  68. },
  69. fetch: {
  70. is_buy : false,
  71. info : {},
  72. button : {},
  73. code : '',
  74. },
  75. buyState : false,
  76. rankingState : false,
  77. infoState : false,
  78. inviteState : true,
  79. }
  80. },
  81. onLoad(option) {
  82. this.id = option.id;
  83. this.Dever.login = 'user/login?id=' + this.id;
  84. this.Dever.checkLogin();
  85. this.getData();
  86. },
  87. // 重新加载
  88. onPullDownRefresh: function() {
  89. this.getData();
  90. },
  91. methods:{
  92. change : function(e) {
  93. this.swiper.index = e.detail.current;
  94. },
  95. getData : function() {
  96. this.Dever.get(this, 'app/collection/?l=api.getInfo', {id:this.id}, function(t) {
  97. uni.setNavigationBarTitle({
  98. title:t.info.name
  99. });
  100. });
  101. },
  102. goView : function() {
  103. //是否购买
  104. if (!this.fetch.is_buy) {
  105. this.showBuy();
  106. } else {
  107. this.view();
  108. }
  109. },
  110. view : function() {
  111. this.Dever.location('dream/view?code='+this.fetch.code + '&name=' + this.fetch.info.name);
  112. },
  113. showInvite : function() {
  114. this.inviteState = true;
  115. },
  116. hideInvite : function() {
  117. this.inviteState = false;
  118. },
  119. showBuy : function() {
  120. this.buyState = true;
  121. },
  122. hideBuy : function() {
  123. this.buyState = false;
  124. },
  125. hideRanking : function() {
  126. this.rankingState = false;
  127. },
  128. goRanking : function() {
  129. this.rankingState = true;
  130. },
  131. goInfo : function() {
  132. this.infoState = true;
  133. },
  134. hideInfo : function() {
  135. this.infoState = false;
  136. },
  137. share : function() {
  138. //从后端获取分享链接需要的加密参数
  139. }
  140. },
  141. components:{
  142. buy,ranking,info
  143. }
  144. }
  145. </script>
  146. <style>
  147. .btn-title {
  148. text-align: center;
  149. font-size: 24rpx;
  150. font-weight: bold;
  151. }
  152. .btn-title .grace-title-text {
  153. border-bottom: 1px solid #bababa;
  154. color:#F5F6F8;
  155. }
  156. .wrap2{
  157. width:220rpx;
  158. position: absolute;
  159. right: 20rpx;
  160. top: 20rpx;
  161. z-index: 10;
  162. }
  163. .demo2{line-height:66rpx; display:block; width:100%; text-align:center; font-size:28rpx;}
  164. .container {
  165. position: absolute;
  166. height: 100%;
  167. width: 100%;
  168. left: 0;
  169. top: 0;
  170. overflow: hidden;
  171. }
  172. .btn-wrapper {
  173. justify-content: space-around;
  174. width: 100%;
  175. }
  176. .button {
  177. height: 80rpx;
  178. border: 1rpx solid #cc1619;
  179. color: #cc1619;
  180. font-size: 30rpx;
  181. min-width: 300rpx;
  182. border-radius: 40rpx;
  183. text-align: center;
  184. line-height: 80rpx;
  185. display: block;
  186. position: relative;
  187. }
  188. .button>button{
  189. position: absolute;
  190. width: 100%;
  191. height: 100%;
  192. left: 0;
  193. top: 0;
  194. opacity: 0;
  195. }
  196. .button.big {
  197. width: 630rpx;
  198. }
  199. .button.primary {
  200. background-color: #cc1619;
  201. color: #fff;
  202. }
  203. .button.blk {
  204. background-color: #000;
  205. color: #fff;
  206. border-color: #000;
  207. }
  208. .cover {
  209. width: 750rpx;
  210. height: 100%;
  211. }
  212. swiper-item>view{
  213. height: 100%;
  214. }
  215. swiper-item image{
  216. width: 750rpx;
  217. height: 100%;
  218. }
  219. .btn-ctrls {
  220. position: absolute;
  221. bottom: 40rpx;
  222. left: 200rpx;
  223. right: 200rpx;
  224. }
  225. .btn-ctrls .btn-wrapper {
  226. margin-top: 20rpx;
  227. width: 350rpx;
  228. display: flex;
  229. align-items: center;
  230. border-radius: 5rpx;
  231. background-color: #000;
  232. }
  233. .btn-ctrls .btn-wrapper .button{
  234. border-radius: 0;
  235. min-width: 100rpx;
  236. background-color: transparent;
  237. border: 0;
  238. flex: 1;
  239. }
  240. .btn-ctrls .btn-wrapper .spliter{
  241. flex-shrink: 0;
  242. width: 1rpx;
  243. background: #fff;
  244. height: 40rpx;
  245. color: #333;
  246. }
  247. .btn-ctrls .btn-wrapper .button.small{
  248. min-width: 150rpx;
  249. }
  250. .btn-ctrls .btn-wrapper .button.big{
  251. width: 420rpx;
  252. }
  253. .btn-ctrls .dots{
  254. display: flex;
  255. justify-content: center;
  256. margin-top: 20rpx;
  257. }
  258. .btn-ctrls .dots text{
  259. display: block;
  260. width: 16rpx;
  261. height: 8rpx;
  262. background: rgba(255, 255, 255, 0.5);
  263. border-radius: 8rpx;
  264. margin: 0 5rpx;
  265. }
  266. .btn-ctrls .dots text.cur{
  267. background-color: rgba(255, 255, 255, 1);
  268. }
  269. .btn-ctrls .scorelist{
  270. text-align: center;
  271. }
  272. .btn-ctrls .scorelist navigator{
  273. display: inline-block;
  274. font-size: 26rpx;
  275. color: #FFFFFF;
  276. text-decoration: underline;
  277. }
  278. .space-between{
  279. justify-content: space-between;
  280. }
  281. .btn-wrapper{
  282. display: flex;
  283. }
  284. .ios-pay{
  285. display: none;
  286. }
  287. .pulloff{
  288. position: fixed;
  289. width: 100%;
  290. height: 100%;
  291. top: 0;
  292. left: 0;
  293. z-index: 20;
  294. display: flex;
  295. align-items: center;
  296. justify-content: center;
  297. }
  298. .pulloff>view{
  299. background-color: rgba(0, 0, 0, 0.65);
  300. padding: 53rpx 53rpx 53rpx 74rpx;
  301. border-radius: 10rpx;
  302. text-align: center;
  303. }
  304. .pulloff>view text{
  305. color: #fff;
  306. font-size: 30rpx;
  307. line-height: 53rpx;
  308. }
  309. .preselltip .layer{
  310. border-radius: 5rpx;
  311. padding:70rpx 40rpx;
  312. }
  313. .preselltip .layer .tit{
  314. font-size: 24rpx;
  315. text-align: center;
  316. margin: 16rpx 0 80rpx;
  317. }
  318. .preselltip .layer .btn-wrapper{
  319. position: absolute;
  320. bottom: 0;
  321. left: 0;
  322. }
  323. .preselltip .layer .btn-wrapper .button{
  324. width: 100%;
  325. border-radius: 0 0 5rpx 5rpx;
  326. }
  327. .recharge-layer{
  328. padding: 50rpx 55rpx 62rpx;
  329. background-color: #fff;
  330. position: absolute;
  331. bottom: 0;
  332. left: 0;
  333. right: 0;
  334. transform: translateY(100%);
  335. transition-property: transform;
  336. transition-duration: 0.3s;
  337. transition-timing-function: ease-in;
  338. }
  339. .recharge-layer.slidein{
  340. transform: translateY(0);
  341. }
  342. .recharge-layer .tit{
  343. font-weight: bolder;
  344. font-size: 36rpx;
  345. margin: 0 0 40rpx;
  346. }
  347. .recharge-layer .msg{
  348. font-size: 22rpx;
  349. line-height: 36rpx;
  350. width: 640rpx;
  351. margin: 0 auto 47rpx;
  352. }
  353. .recharge-layer input{
  354. width: 640rpx;
  355. height: 88rpx;
  356. border: 1rpx solid #EEEEEE;
  357. border-radius: 5rpx;
  358. box-sizing: border-box;
  359. padding: 0 25rpx;
  360. font-size: 24rpx;
  361. }
  362. .recharge-layer .errtip {
  363. color: #d1171a;
  364. font-size: 24rpx;
  365. margin: 21rpx 0 0;
  366. height: 34rpx;
  367. }
  368. .recharge-layer .btn-wrapper{
  369. display: flex;
  370. justify-content: space-between;
  371. padding-top: 20rpx;
  372. }
  373. .recharge-layer .btn-wrapper .button{
  374. border: 0;
  375. min-width: 0;
  376. border-radius: 5rpx;
  377. box-sizing: border-box;
  378. color: #999999;
  379. width: 284rpx;
  380. }
  381. .recharge-layer .btn-wrapper .button.primary{
  382. border:0;
  383. color: #fff;
  384. }
  385. .recharge-layer .btn-wrapper .button.cancel{
  386. border:0;
  387. background-color: #CCCCCC;
  388. color: #fff;
  389. }
  390. .recharge-mask{
  391. position: fixed;
  392. width: 100%;
  393. height: 100%;
  394. background: rgba(0, 0, 0, 0.5);
  395. left: 0;
  396. top: 0;
  397. display: none;
  398. }
  399. .mask {
  400. position: fixed;
  401. left: 0;
  402. top: 0;
  403. right: 0;
  404. bottom: 0;
  405. background: rgba(0, 0, 0, 0.5);
  406. }
  407. .mask .layer {
  408. width: 570rpx;
  409. box-sizing: border-box;
  410. padding: 70rpx 60rpx;
  411. background: #fff;
  412. border-radius: 10rpx;
  413. position: absolute;
  414. top: 50%;
  415. left: 50%;
  416. transform: translate(-50%,-50%);
  417. }
  418. .mask .layer .tit {
  419. text-align: center;
  420. font-size: 40rpx;
  421. margin: 16rpx 0 60rpx;
  422. }
  423. .mask .layer input {
  424. border-radius: 10rpx;
  425. border: 1rpx solid #999;
  426. height: 88rpx;
  427. line-height: 88rpx;
  428. padding: 0 28rpx;
  429. box-sizing: border-box;
  430. font-size: 24rpx;
  431. }
  432. .mask .layer .errtip {
  433. color: #d1171a;
  434. text-align: center;
  435. font-size: 24rpx;
  436. margin: 21rpx 0;
  437. height: 34rpx;
  438. }
  439. .mask .layer .btn-wrapper {
  440. padding-top: 30rpx;
  441. }
  442. .buytip{
  443. font-size: 24rpx;
  444. color: #999999;
  445. text-decoration: underline;
  446. padding-bottom: 40rpx;
  447. }
  448. .p{
  449. font-size: 24rpx;
  450. text-align: justify;
  451. line-height: 40rpx;
  452. margin-bottom: 12rpx;
  453. display: block;
  454. box-sizing: border-box;
  455. }
  456. .buy-tit{
  457. font-size: 40rpx;
  458. /* font-weight: bolder; */
  459. text-align: center;
  460. margin-bottom: 40rpx;
  461. }
  462. .mask .buytip-layer{
  463. padding: 60rpx;
  464. }
  465. .buy-layer .btn-wrapper{
  466. display: flex;
  467. justify-content: space-between;
  468. padding-top: 20rpx;
  469. }
  470. .buy-layer .btn-wrapper .button{
  471. border: 0;
  472. min-width: 0;
  473. box-sizing: border-box;
  474. color: #999999;
  475. width: 200rpx;
  476. border-radius: 5rpx;
  477. }
  478. .buy-layer .btn-wrapper .button.primary{
  479. border:0;
  480. color: #fff;
  481. }
  482. .buy-layer .btn-wrapper .button.cancel{
  483. border:0;
  484. background-color: #CCCCCC;
  485. color: #fff;
  486. }
  487. </style>