index.vue 11 KB

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