details - 副本.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view class="container">
  3. <!--header-->
  4. <view class="tui-header-box" :style="{ height: height + 'px', background: '#C74547', color:'#ffffff'}">
  5. <view class="tui-header" :style="{ paddingTop: top + 'px', opacity: 1.024 }">资讯</view>
  6. <view class="tui-header-icon-left" :style="{ marginTop: top + 'px' }">
  7. <view class="tui-icon-box" :style="{ backgroundColor: 'rgba(0, 0, 0, 0)' }" @tap="back">
  8. <tui-icon name="arrowleft" :size="30" :color="opcity >= 1 ? '#fff' : '#fff'"></tui-icon>
  9. </view>
  10. </view>
  11. <view class="tui-header-icon-right" :style="{ marginTop: top + 'px' }">
  12. <view class="tui-icon-box tui-icon-ml" :style="{backgroundColor: 'rgba(0, 0, 0, 0)'}" @click="popup">
  13. <tui-icon name="share" :size="20" :color="opcity >= 1 ? '#fff' : '#fff'"></tui-icon>
  14. </view>
  15. </view>
  16. </view>
  17. <!--header-->
  18. <view class="tui-center" :style="{ marginTop: height + 'px' }">
  19. <view class="tui-pro-time" style="width: 100%;padding: 10px 0;">
  20. <text style="float: left;margin-left: 50px;">2020.7.29</text>
  21. <text style="float: right;margin-right: 50px;">229 人看过</text>
  22. </view>
  23. <view class="tui-pro-content">
  24. <view class="tui-pro-tit">【本溪历史的今天】7月29日</view>
  25. <view>
  26. <view class="tui-pro-price">
  27. <text class="tui-sale-price">我们每天都会这样子复制粘贴然后进行测</br>试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!--底部分享弹窗-->
  33. <tui-bottom-popup :show="popupShow" @close="popup">
  34. <view class="tui-share">
  35. <view class="tui-share-title">分享到</view>
  36. <scroll-view scroll-x style="padding-right:20rpx">
  37. <view class="tui-share-top">
  38. <view class="tui-share-item" :class="[shareList[0].share.length-1===index?'tui-item-last':'']" v-for="(item,index) in shareList[0].share"
  39. :key="index" @tap="popup">
  40. <view class="tui-share-icon" hover-class="tui-hover" :hover-stay-time="150">
  41. <tui-icon :name="item.icon" :color="item.color" :size="item.size?item.size:36"></tui-icon>
  42. </view>
  43. <view class="tui-share-text">{{item.name}}</view>
  44. </view>
  45. <view class="tui-empty">!</view>
  46. </view>
  47. </scroll-view>
  48. <scroll-view scroll-x class="tui-mt">
  49. <view class="tui-share-bottom">
  50. <view class="tui-share-item" :class="[shareList[1].operate.length-1===index?'tui-item-last':'']" v-for="(item,index) in shareList[1].operate"
  51. :key="index" @tap="popup">
  52. <view class="tui-share-icon" hover-class="tui-hover" :hover-stay-time="150">
  53. <tui-icon :name="item.icon" color="#404040" :size="item.size" :bold="index===2"></tui-icon>
  54. </view>
  55. <view class="tui-share-text">{{item.name}}</view>
  56. </view>
  57. </view>
  58. </scroll-view>
  59. <view class="tui-btn-cancle" @tap="popup">取消</view>
  60. </view>
  61. </tui-bottom-popup>
  62. <!--底部分享弹窗-->
  63. </view>
  64. </template>
  65. <script>
  66. import tuiButton from "@/components/thorui/tui-button/tui-button"
  67. import tuiIcon from "@/components/thorui/tui-icon/tui-icon"
  68. import tuiBadge from "@/components/thorui/tui-badge/tui-badge"
  69. import tuiTag from "@/components/thorui/tui-tag/tui-tag"
  70. import tuiNomore from "@/components/thorui/tui-nomore/tui-nomore"
  71. import tuiTopDropdown from "@/components/thorui/tui-top-dropdown/tui-top-dropdown"
  72. import tuiBottomPopup from "@/components/thorui/tui-bottom-popup/tui-bottom-popup"
  73. import tuiNumberbox from "@/components/thorui/tui-numberbox/tui-numberbox"
  74. export default {
  75. components:{
  76. tuiButton,
  77. tuiIcon,
  78. tuiBadge,
  79. tuiTag,
  80. tuiNomore,
  81. tuiTopDropdown,
  82. tuiBottomPopup,
  83. tuiNumberbox
  84. },
  85. data() {
  86. return {
  87. height: 64, //header高度
  88. top: 26, //标题图标距离顶部距离
  89. scrollH: 0, //滚动总高度
  90. opcity: 0,
  91. iconOpcity: 0.5,
  92. bannerIndex: 0,
  93. shareList: [{
  94. share: [{
  95. name: "QQ",
  96. icon: "qq",
  97. color: "#07BDFD",
  98. size: 34
  99. }, {
  100. name: "微信",
  101. icon: "wechat",
  102. color: "#80D640"
  103. }, {
  104. name: "朋友圈",
  105. icon: "moments",
  106. color: "#80D640",
  107. size: 32
  108. }, {
  109. name: "支付宝",
  110. icon: "alipay",
  111. color: "#00AAEE"
  112. }, {
  113. name: "新浪微博",
  114. icon: "sina",
  115. color: "#F9C718"
  116. }, {
  117. name: "小程序",
  118. icon: "applets",
  119. color: "#2BA348"
  120. }, {
  121. name: "钉钉",
  122. icon: "dingtalk",
  123. color: "#2DA0F1"
  124. }, {
  125. name: "浏览器打开",
  126. icon: "explore-fill",
  127. color: "#1695F7"
  128. }, {
  129. name: "邮件",
  130. icon: "mail-fill",
  131. color: "#2868E5"
  132. }]
  133. }, {
  134. operate: [{
  135. name: "投诉",
  136. icon: "warning",
  137. size: 30
  138. }, {
  139. name: "复制链接",
  140. icon: "link",
  141. size: 28
  142. }, {
  143. name: "刷新",
  144. icon: "refresh",
  145. size: 30
  146. }, {
  147. name: "搜索内容",
  148. icon: "search-2",
  149. size: 28
  150. }]
  151. }],
  152. menuShow: false,
  153. popupShow: false,
  154. value: 1,
  155. collected: false
  156. };
  157. },
  158. onLoad: function(options) {
  159. let obj = {};
  160. // #ifdef MP-WEIXIN
  161. obj = wx.getMenuButtonBoundingClientRect();
  162. // #endif
  163. // #ifdef MP-BAIDU
  164. obj = swan.getMenuButtonBoundingClientRect();
  165. // #endif
  166. // #ifdef MP-ALIPAY
  167. my.hideAddToDesktopMenu();
  168. // #endif
  169. setTimeout(() => {
  170. uni.getSystemInfo({
  171. success: res => {
  172. this.width = obj.left || res.windowWidth;
  173. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44;
  174. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6;
  175. this.scrollH = res.windowWidth;
  176. }
  177. });
  178. }, 0);
  179. },
  180. methods: {
  181. popup: function() {
  182. this.popupShow = !this.popupShow
  183. },
  184. back: function() {
  185. uni.navigateBack();
  186. },
  187. },
  188. onPageScroll(e) {
  189. let scroll = e.scrollTop <= 0 ? 0 : e.scrollTop;
  190. let opcity = scroll / this.scrollH;
  191. if (this.opcity >= 1 && opcity >= 1) {
  192. return;
  193. }
  194. this.opcity = opcity;
  195. this.iconOpcity = 0.5 * (1 - opcity < 0 ? 0 : 1 - opcity);
  196. }
  197. };
  198. </script>
  199. <style>
  200. page {
  201. background-color: #f7f7f7;
  202. }
  203. .container {
  204. width: 100%;
  205. }
  206. .tui-header-box {
  207. width: 100%;
  208. left: 0;
  209. top: 0;
  210. z-index: 995;
  211. position: fixed;
  212. top: 0;
  213. }
  214. .tui-header {
  215. width: 100%;
  216. font-size: 18px;
  217. line-height: 18px;
  218. font-weight: 500;
  219. height: 32px;
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. }
  224. .tui-header-icon-left {
  225. position: fixed;
  226. top: 0;
  227. left: 10px;
  228. display: flex;
  229. align-items: flex-start;
  230. justify-content: space-between;
  231. height: 32px;
  232. transform: translateZ(0);
  233. z-index: 9999;
  234. }
  235. .tui-header-icon-right {
  236. position: fixed;
  237. top: 0;
  238. right: 10px;
  239. display: flex;
  240. align-items: flex-start;
  241. justify-content: space-between;
  242. height: 32px;
  243. transform: translateZ(0);
  244. z-index: 9999;
  245. }
  246. .tui-header-icon-left .tui-badge {
  247. background: #e41f19 !important;
  248. position: absolute;
  249. right: -4px;
  250. }
  251. .tui-header-icon-right .tui-badge {
  252. background: #e41f19 !important;
  253. position: absolute;
  254. right: -4px;
  255. }
  256. .tui-icon-ml {
  257. margin-left: 20rpx;
  258. }
  259. .tui-icon-box {
  260. position: relative;
  261. height: 20px !important;
  262. width: 20px !important;
  263. padding: 6px !important;
  264. border-radius: 50%;
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. }
  269. .tui-banner-swiper {
  270. position: relative;
  271. }
  272. .tui-banner-tag {
  273. position: absolute;
  274. color: #fff;
  275. bottom: 30rpx;
  276. right: 0;
  277. }
  278. .tui-slide-image {
  279. width: 100%;
  280. display: block;
  281. }
  282. /*内容*/
  283. .tui-center {
  284. width: 100%;
  285. height: 100%;
  286. background: #fff;
  287. }
  288. .tui-pro-price {
  289. padding-top: 18rpx;
  290. }
  291. .tui-sale-price {
  292. font-size: 26rpx;
  293. font-weight: 500;
  294. color: #b5b5b5;
  295. }
  296. .tui-pro-content {
  297. width: 100%;
  298. display: flex;
  299. flex-direction: column;
  300. justify-content: space-between;
  301. box-sizing: border-box;
  302. padding: 20rpx;
  303. }
  304. .tui-pro-tit {
  305. color: #2e2e2e;
  306. font-size: 34rpx;
  307. word-break: break-all;
  308. overflow: hidden;
  309. text-overflow: ellipsis;
  310. display: -webkit-box;
  311. -webkit-box-orient: vertical;
  312. -webkit-line-clamp: 2;
  313. }
  314. /*内容日期浏览*/
  315. .tui-pro-time {
  316. font-size: 26rpx;
  317. font-weight: 500;
  318. color: #b5b5b5;
  319. }
  320. /*header 下拉选择*/
  321. .top-dropdown {
  322. margin-top: 360rpx;
  323. padding: 0 40rpx;
  324. box-sizing: border-box;
  325. }
  326. .tui-share-box {
  327. padding: 0 50rpx;
  328. box-sizing: border-box;
  329. }
  330. .tui-drop-input-box {
  331. padding: 50rpx;
  332. box-sizing: border-box;
  333. }
  334. .tui-animation {
  335. display: inline-block;
  336. transform: rotate(0deg);
  337. transition: all 0.2s;
  338. }
  339. .tui-animation-show {
  340. transform: rotate(180deg);
  341. }
  342. .tui-selected-list {
  343. background-color: #fff;
  344. border-radius: 20rpx;
  345. overflow: hidden;
  346. transform: translateZ(0);
  347. }
  348. .tui-dropdown-scroll {
  349. height: 400rpx;
  350. }
  351. .tui-cell-class {
  352. display: flex;
  353. align-items: center;
  354. padding: 26rpx 30rpx !important;
  355. }
  356. .tui-ml-20 {
  357. margin-left: 20rpx;
  358. }
  359. .tui-share {
  360. background: #e8e8e8;
  361. position: relative;
  362. padding-bottom: env(safe-area-inset-bottom);
  363. }
  364. .tui-share-title {
  365. font-size: 26rpx;
  366. color: #7E7E7E;
  367. text-align: center;
  368. line-height: 26rpx;
  369. padding: 20rpx 0 50rpx 0;
  370. }
  371. .tui-share-top,
  372. .tui-share-bottom {
  373. min-width: 101%;
  374. padding: 0 20rpx 0 30rpx;
  375. white-space: nowrap;
  376. }
  377. .tui-mt {
  378. margin-top: 30rpx;
  379. padding-bottom: 150rpx;
  380. }
  381. .tui-share-item {
  382. width: 126rpx;
  383. display: inline-block;
  384. margin-right: 24rpx;
  385. text-align: center;
  386. }
  387. .tui-item-last {
  388. margin: 0;
  389. }
  390. .tui-empty {
  391. display: inline-block;
  392. width: 30rpx;
  393. visibility: hidden;
  394. }
  395. .tui-share-icon {
  396. display: flex;
  397. align-items: center;
  398. justify-content: center;
  399. background: #fafafa;
  400. height: 126rpx;
  401. width: 126rpx;
  402. border-radius: 32rpx;
  403. }
  404. .tui-share-text {
  405. font-size: 24rpx;
  406. color: #7E7E7E;
  407. line-height: 24rpx;
  408. padding: 20rpx 0;
  409. white-space: nowrap;
  410. }
  411. .tui-btn-cancle {
  412. width: 100%;
  413. height: 100rpx;
  414. position: absolute;
  415. left: 0;
  416. bottom: 0;
  417. background: #f6f6f6;
  418. font-size: 36rpx;
  419. color: #3e3e3e;
  420. display: flex;
  421. align-items: center;
  422. justify-content: center;
  423. padding-bottom: env(safe-area-inset-bottom);
  424. }
  425. .tui-hover {
  426. background: rgba(0, 0, 0, 0.2)
  427. }
  428. </style>