index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <!-- 废弃页面 -->
  3. <view class="main">
  4. <navbar :config="config" backColor="#666"></navbar>
  5. <view id="page-top">
  6. <div class="banner"></div>
  7. <div class="price-box">
  8. <text v-if="goodsType == 1" class="integral">
  9. <text class="iconfont2 integral-icon">&#xe669;</text>
  10. <text class="integral-num">100</text>
  11. </text>
  12. <text v-if="goodsType == 3" class="new-price">
  13. <text class="company">¥</text>
  14. <text class="integer">269.</text>
  15. <text class="float">00</text>
  16. </text>
  17. <text v-if="goodsType == 2" class="tip">免费领</text>
  18. <text class="old-price">¥ 298.00</text>
  19. <text v-if="goodsType == 3" class="discount">4.0折</text>
  20. </div>
  21. <view class="title-box">
  22. <image src="/static/common/tag1.png" mode="aspectFit"></image>
  23. <text class="title">复合调味料/三烤竹盐复合调味料/竹 盐古味五味/竹盐古味香辣/富硒竹盐</text>
  24. <view class="buyed">
  25. 已售
  26. <text>23</text>
  27. 件,仅剩
  28. <text>87</text>
  29. </view>
  30. </view>
  31. <view class="discount-notice">
  32. <view class="tag"><text>首单优惠</text></view>
  33. <view class="content">满500元减50元</view>
  34. </view>
  35. <view class="split"></view>
  36. <view class="shop-box">
  37. <image class="avatar"></image>
  38. <view class="right">
  39. <view class="title">岭南置业店</view>
  40. <view class="addr">湖北武汉市江岸区湖北武汉市江岸区</view>
  41. </view>
  42. <text class="right-icon iconfont">&#xe6c7;</text>
  43. </view>
  44. <view class="split"></view>
  45. </view>
  46. <view class="tab-box" :style="`top: calc(${statusBarHeight}px + 44px)`">
  47. <view v-for="(item, index) in tabList" :key="index" class="tab" :class="tabActiveIndex == index ? 'active' : ''" @click="tabClick(index)">{{ item.text }}</view>
  48. </view>
  49. <view>
  50. <view v-show="tabActiveIndex == 0">
  51. <image
  52. style="width: 500rpx;display: block;margin: 150rpx auto;"
  53. mode="widthFix"
  54. src="https://img1.baidu.com/it/u=2629574589,3187499507&fm=253&fmt=auto&app=138&f=JPEG?w=545&h=500"
  55. ></image>
  56. <image
  57. style="width: 500rpx;display: block;margin: 150rpx auto;"
  58. mode="widthFix"
  59. src="https://img2.baidu.com/it/u=1496534469,791535097&fm=253&fmt=auto&app=138&f=JPEG?w=366&h=500"
  60. ></image>
  61. <image
  62. style="width: 500rpx;display: block;margin: 150rpx auto;"
  63. mode="widthFix"
  64. src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.benlailife.com%2FProductImages%2F000%2F000%2F036%2F648%2Fbig%2Fc77f0865-632f-4120-ba69-fd80a81da655.jpg&refer=http%3A%2F%2Fimage.benlailife.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1660444536&t=a102caf3ecd390e19d131c6f69657603"
  65. ></image>
  66. </view>
  67. <view v-show="tabActiveIndex == 1">
  68. <view class="comment-list">
  69. <view class="item" v-for="(item,index) in 5" :key="index">
  70. <image class="avatar"></image>
  71. <view class="content">
  72. <view class="title">某人</view>
  73. <view class="star-box">
  74. <text v-for="item in 5" :key="item" class="iconfont2 star" :class="item < 6?'active':''">&#xe60f;</text>
  75. </view>
  76. <view class="desc">默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评默认好评</view>
  77. </view>
  78. <view class="time">2022-07-05</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="seat"></view>
  84. <view class="bottom-box">
  85. <view class="box">
  86. <view class="iconfont2">&#xe684;</view>
  87. <text class="tip">分享</text>
  88. </view>
  89. <view class="box">
  90. <view class="iconfont2">&#xe6bf;</view>
  91. <text class="tip">收藏</text>
  92. </view>
  93. <!-- 带积分、免费领、礼包不能加入“购物车” -->
  94. <view class="box">
  95. <view class="iconfont2">&#xe600;</view>
  96. <text class="tip">购物车</text>
  97. </view>
  98. <button class="btn add-cart">加入购物车</button>
  99. <button @click="submit()" class="btn buy">立即购买</button>
  100. </view>
  101. <!-- 服务体系礼包才有的弹窗 -->
  102. <uni-popup class="tip-popup" ref="submitPopup" type="center" :mask-click="false">
  103. <view class="content-box">
  104. <view class="title">请确认所属区域</view>
  105. <view class="content">
  106. <view class="check-tip">请选择</view>
  107. <view class="check-input">
  108. <input placeholder="请选择所属地区" />
  109. <text class="iconfont2">&#xe65f;</text>
  110. </view>
  111. <view class="tip" style="width: 416rpx;">
  112. 注意:请认证选择所属区域,选择 和自身属地收益相关
  113. </view>
  114. <view class="btn-box">
  115. <button @click="closePopup()">取消</button>
  116. <button @click="closePopup()">继续购买</button>
  117. </view>
  118. </view>
  119. </view>
  120. </uni-popup>
  121. </view>
  122. </template>
  123. <script>
  124. export default {
  125. data() {
  126. return {
  127. //手机状态栏高度
  128. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  129. config: {
  130. back: true,
  131. title: '商品详情',
  132. color: '#1a1a1a',
  133. backgroundColor: [1, '#fff'],
  134. statusBarFontColor: 'black'
  135. },
  136. tabList: [
  137. {
  138. text: '商品详情'
  139. },
  140. {
  141. text: '用户评论(198)'
  142. }
  143. ],
  144. tabActiveIndex: 0,
  145. goodsType: 3, //商品类型 1 积分 2免费领 3 现金
  146. };
  147. },
  148. mounted() {},
  149. methods: {
  150. tabClick(index) {
  151. let that = this;
  152. this.tabActiveIndex = index;
  153. // this.$nextTick(function() {
  154. // const query = uni.createSelectorQuery().in(that);
  155. // query.select('#page-top').boundingClientRect(data => {
  156. // uni.pageScrollTo({
  157. // scrollTop: data.height,
  158. // duration: 300
  159. // })
  160. // }).exec();
  161. // });
  162. },
  163. submit(){
  164. this.$refs.submitPopup.open();
  165. },
  166. closePopup(){
  167. this.$refs.submitPopup.close();
  168. }
  169. }
  170. };
  171. </script>
  172. <style lang="scss" scoped>
  173. .main {
  174. .split {
  175. width: 100%;
  176. height: 8rpx;
  177. background: #f5f5f5;
  178. }
  179. .banner {
  180. width: 100%;
  181. height: 620rpx;
  182. background-image: url('/static/freeCollection/banner.png');
  183. background-size: 100% 100%;
  184. }
  185. .price-box {
  186. width: 100%;
  187. height: 99rpx;
  188. background: linear-gradient(90deg, #20a733, #0a824b);
  189. border-radius: 20rpx 20rpx 0px 0px;
  190. margin-top: -25rpx;
  191. padding: 0 30rpx;
  192. display: flex;
  193. align-items: center;
  194. box-sizing: border-box;
  195. .tip {
  196. font-size: 36rpx;
  197. font-family: PingFang SC, PingFang SC-Medium;
  198. font-weight: 500;
  199. text-align: left;
  200. color: #ffffff;
  201. line-height: 24rpx;
  202. }
  203. .integral {
  204. vertical-align: middle;
  205. .integral-icon {
  206. font-size: 50rpx;
  207. color: white;
  208. vertical-align: middle;
  209. }
  210. .integral-num {
  211. font-size: 30rpx;
  212. font-family: PingFang SC, PingFang SC-Medium;
  213. font-weight: 500;
  214. text-align: left;
  215. color: white;
  216. line-height: 24rpx;
  217. margin: 0 10rpx 0 0;
  218. vertical-align: middle;
  219. }
  220. }
  221. .new-price {
  222. font-family: PingFang SC, PingFang SC-Medium;
  223. font-weight: bold;
  224. text-align: left;
  225. color: white;
  226. line-height: 24rpx;
  227. .company {
  228. font-size: 20rpx;
  229. font-weight: 300;
  230. margin-right: 5rpx;
  231. }
  232. .integer {
  233. font-size: 38rpx;
  234. }
  235. .float {
  236. font-size: 20rpx;
  237. font-weight: 400;
  238. }
  239. }
  240. .old-price {
  241. font-size: 24rpx;
  242. font-family: PingFang SC, PingFang SC-Regular;
  243. font-weight: 400;
  244. text-decoration: line-through;
  245. text-align: left;
  246. color: #ffffff;
  247. line-height: 24rpx;
  248. margin-left: 19rpx;
  249. text-decoration: line-through;
  250. }
  251. .discount {
  252. font-size: 24rpx;
  253. font-family: PingFang SC, PingFang SC-Regular;
  254. font-weight: 400;
  255. text-align: left;
  256. color: #ffffff;
  257. line-height: 24rpx;
  258. margin-left: 20rpx;
  259. }
  260. }
  261. .title-box {
  262. padding: 26rpx 30rpx 40rpx 30rpx;
  263. box-sizing: border-box;
  264. image {
  265. width: 102rpx;
  266. height: 30rpx;
  267. margin-right: 20rpx;
  268. vertical-align: middle;
  269. }
  270. .title {
  271. vertical-align: middle;
  272. font-size: 35rpx;
  273. font-family: PingFang SC, PingFang SC-Bold;
  274. font-weight: 700;
  275. text-align: left;
  276. color: #1a1a1a;
  277. line-height: 50rpx;
  278. }
  279. .buyed {
  280. font-size: 24rpx;
  281. font-family: PingFang SC, PingFang SC-Medium;
  282. font-weight: 500;
  283. text-align: left;
  284. color: #999999;
  285. margin-top: 18rpx;
  286. line-height: 1;
  287. text {
  288. color: #ff0000;
  289. }
  290. }
  291. }
  292. .discount-notice {
  293. height: 84rpx;
  294. width: 690rpx;
  295. margin: 0 auto 40rpx auto;
  296. background: #fff6ee;
  297. border-radius: 10rpx;
  298. padding: 0 20rpx;
  299. display: flex;
  300. align-items: center;
  301. box-sizing: border-box;
  302. .tag {
  303. height: 45rpx;
  304. width: 120rpx;
  305. border: 1px solid #ff0000;
  306. border-radius: 24rpx;
  307. text-align: center;
  308. text {
  309. font-size: 24rpx;
  310. font-family: PingFang SC, PingFang SC-Medium;
  311. font-weight: 500;
  312. text-align: left;
  313. color: #ff0000;
  314. line-height: 45rpx;
  315. }
  316. }
  317. .content {
  318. font-size: 24rpx;
  319. font-family: PingFang SC, PingFang SC-Bold;
  320. font-weight: 700;
  321. text-align: left;
  322. color: #ca7e57;
  323. line-height: 84rpx;
  324. margin-left: 13rpx;
  325. }
  326. }
  327. .shop-box {
  328. padding: 35rpx 30rpx;
  329. display: flex;
  330. align-items: center;
  331. .avatar {
  332. width: 104rpx;
  333. height: 104rpx;
  334. border-radius: 50%;
  335. margin-right: 25rpx;
  336. background-color: #f5f5f5;
  337. }
  338. .right {
  339. .title {
  340. font-size: 28rpx;
  341. font-family: PingFang SC, PingFang SC-Bold;
  342. font-weight: 700;
  343. text-align: left;
  344. color: #1a1a1a;
  345. overflow: hidden;
  346. white-space: nowrap;
  347. text-overflow: ellipsis;
  348. width: 540rpx;
  349. }
  350. .addr {
  351. font-size: 24rpx;
  352. font-family: PingFang SC, PingFang SC-Bold;
  353. font-weight: 700;
  354. text-align: left;
  355. color: #999999;
  356. line-height: 30rpx;
  357. margin-top: 5rpx;
  358. overflow: hidden;
  359. white-space: nowrap;
  360. text-overflow: ellipsis;
  361. width: 540rpx;
  362. }
  363. }
  364. .right-icon {
  365. color: #000000;
  366. width: 15rpx;
  367. font-weight: bold;
  368. }
  369. }
  370. .comment-list{
  371. box-sizing: border-box;
  372. padding: 20rpx 30rpx;
  373. .item{
  374. box-sizing: border-box;
  375. padding: 27rpx 0;
  376. border-top: 1px solid #f5f5f5;
  377. &:first-child{
  378. border-top: none;
  379. }
  380. .avatar{
  381. width: 83rpx;
  382. height: 83rpx;
  383. background: #f5f5f5;
  384. border-radius: 50%;
  385. vertical-align: top;
  386. }
  387. .content{
  388. width: 420rpx;
  389. display: inline-block;
  390. margin-left: 18rpx;
  391. .title{
  392. font-size: 28rpx;
  393. font-family: PingFang SC, PingFang SC-Regular;
  394. font-weight: 400;
  395. text-align: left;
  396. color: #1a1a1a;
  397. margin-bottom: 11rpx;
  398. }
  399. .star-box{
  400. margin-bottom: 15rpx;
  401. .star{
  402. font-size: 35rpx;
  403. margin-right: 11.5rpx;
  404. color: #B3B3B3;
  405. &.active{
  406. color: #FFC336;
  407. }
  408. }
  409. }
  410. .desc{
  411. font-size: 28rpx;
  412. font-family: PingFang SC, PingFang SC-Medium;
  413. font-weight: 500;
  414. text-align: left;
  415. color: #999999;
  416. }
  417. }
  418. .time{
  419. display: inline-block;
  420. vertical-align: top;
  421. font-size: 24rpx;
  422. font-family: PingFang SC, PingFang SC-Medium;
  423. font-weight: 500;
  424. text-align: left;
  425. color: #808080;
  426. margin-left: 30rpx;
  427. }
  428. }
  429. }
  430. .seat{
  431. height: 148rpx;
  432. width: 100%;
  433. padding-bottom: constant(safe-area-inset-bottom);
  434. padding-bottom: env(safe-area-inset-bottom);
  435. }
  436. .bottom-box {
  437. position: fixed;
  438. left: 0;
  439. bottom: 0;
  440. z-index: 100;
  441. display: flex;
  442. align-items: center;
  443. padding: 30rpx;
  444. box-sizing: border-box;
  445. width: 100%;
  446. height: 148rpx;
  447. padding: 0 30rpx 0 36rpx;
  448. padding-bottom: constant(safe-area-inset-bottom);
  449. padding-bottom: env(safe-area-inset-bottom);
  450. background-color: white;
  451. border-top: 1px solid #f5f5f5;
  452. .box{
  453. text-align: center;
  454. margin-right: 23rpx;
  455. line-height: 45rpx;
  456. &:nth-child(2){
  457. .iconfont2{
  458. font-size: 35rpx;
  459. }
  460. }
  461. .iconfont2{
  462. font-size: 45rpx;
  463. color: #999999;
  464. }
  465. .tip{
  466. font-size: 28rpx;
  467. font-family: PingFang SC, PingFang SC-Regular;
  468. font-weight: 400;
  469. text-align: left;
  470. color: #1a1a1a;
  471. margin-top: 4rpx;
  472. }
  473. }
  474. .btn{
  475. height: 80rpx;
  476. border-radius: 40rpx;
  477. text-align: center;
  478. padding: 0 30rpx;
  479. font-size: 32rpx;
  480. font-family: PingFang SC, PingFang SC-Regular;
  481. font-weight: 400;
  482. text-align: center;
  483. color: #ffffff;
  484. line-height: 80rpx;
  485. &.add-cart{
  486. background-color: #f8a764;
  487. margin-right: 13rpx;
  488. }
  489. &.buy{
  490. background-color: #0b844a;
  491. }
  492. }
  493. }
  494. .tip-popup{
  495. .check-tip{
  496. font-size: 28rpx;
  497. font-family: PingFang SC, PingFang SC-Regular;
  498. font-weight: 400;
  499. text-align: left;
  500. color: #1a1a1a;
  501. margin-bottom: 20rpx;
  502. padding: 0 30rpx;
  503. }
  504. }
  505. .check-input{
  506. display: flex;
  507. justify-content: space-between;
  508. align-items: center;
  509. background: #ffffff;
  510. border-radius: 10px;
  511. width: 390rpx;
  512. height: 70rpx;
  513. border: 1px solid #cccccc;
  514. margin: 0 30rpx;
  515. padding: 0 21rpx;
  516. margin-bottom: 25rpx;
  517. input{
  518. text-align: left;
  519. }
  520. }
  521. }
  522. </style>