index.vue 11 KB

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