index.vue 7.8 KB

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