index.vue 11 KB

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