productDetails.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <!-- pages/home/productDetails -->
  3. <view>
  4. <u-navbar placeholder leftIconSize="22px" @leftClick="leftClick">
  5. <view class="u-nav-slot" slot="center">
  6. <view>
  7. <u-search v-model="keyword" height="60rpx" placeholder="请输入药品" borderColor="#4CAF50" bgColor="#fff"
  8. :showAction="false"></u-search>
  9. </view>
  10. </view>
  11. </u-navbar>
  12. <view style="width: 100%;">
  13. <u-swiper :list="list1" height="200" @change="e => currentNum = e.current" :autoplay="false"
  14. indicatorStyle="right: 20px" indicator circular radius="0">
  15. <view slot="indicator" class="indicator-num">
  16. <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list1.length }}</text>
  17. </view>
  18. </u-swiper>
  19. </view>
  20. <view class="card_box_shop">
  21. <view class="space_between">
  22. <view class="same_row_in">
  23. <view class="title_money">¥{{money}}</view>
  24. <view class="box_specific">{{specification}}</view>
  25. </view>
  26. <view class="card_share"><u-icon size="25" name="share-square"></u-icon></view>
  27. </view>
  28. <view class="card_box_drug">{{title}}</view>
  29. </view>
  30. <view class="card_introduce">
  31. <view class="box_book">说明书</view>
  32. <view class="instruction">
  33. <view class="item_introduce" v-for="(item,index) in explainList" :key="index">
  34. <view class="name_key">{{item.type}}</view>
  35. <view class="name_value">{{item.title}}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="card_bottom_purchase bottomFit">
  40. <view class="space_between box_bottom_fit">
  41. <view class="same_row_in">
  42. <view class="up_and_down">
  43. <u-icon name="bag-fill" size="30"></u-icon>
  44. <view class="secondary_font">店铺</view>
  45. </view>
  46. <view class="up_and_down" style="margin-left: 20rpx;">
  47. <u-icon name="shopping-cart" size="30"></u-icon>
  48. <view class="secondary_font">购物车</view>
  49. </view>
  50. </view>
  51. <view class="same_row_in">
  52. <view class="shopping_cart">加入购物车</view>
  53. <view class="immediately">立即购买</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. keyword: '',
  64. list1: [
  65. "/static/image/swiper1.png",
  66. "/static/image/swiper2.png",
  67. "/static/image/swiper3.png",
  68. ],
  69. currentNum: 0,
  70. money: 45,
  71. specification: '0.3g*24粒',
  72. title: '[芬必得]布洛芬缓释胶囊',
  73. explainList: [{
  74. type: '药品通用名称:',
  75. title: '布洛芬缓释胶囊'
  76. }, {
  77. type: '品牌:',
  78. title: '芬必得'
  79. }]
  80. }
  81. },
  82. methods: {
  83. leftClick() {
  84. uni.navigateBack({
  85. delta: 1
  86. });
  87. },
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. .u-nav-slot {
  93. width: 75%;
  94. // width: calc(100% - 100rpx);
  95. display: flex;
  96. justify-content: flex-start;
  97. // margin-left: 70rpx;
  98. }
  99. ::v-deep .u-navbar__content {
  100. justify-content: flex-end;
  101. }
  102. .indicator-num {
  103. padding: 4rpx 16rpx;
  104. background-color: rgba(0, 0, 0, .4);
  105. border-radius: 30rpx;
  106. }
  107. .indicator-num__text {
  108. color: #fff;
  109. }
  110. .card_box_shop {
  111. background-color: #fff;
  112. margin: 20rpx;
  113. padding: 20rpx;
  114. border-top-right-radius: 20rpx;
  115. border-top-left-radius: 20rpx;
  116. }
  117. .title_money {
  118. font-size: 36rpx;
  119. color: #fa3534;
  120. }
  121. .box_specific {
  122. color: #909399;
  123. font-size: 28rpx;
  124. margin-left: 10rpx;
  125. }
  126. .card_share {
  127. padding: 4rpx 20rpx;
  128. border: 1rpx solid $u-border-color;
  129. border-radius: 30rpx;
  130. }
  131. .card_box_drug {
  132. font-size: 32rpx;
  133. }
  134. .card_bottom_purchase {
  135. position: fixed;
  136. bottom: 0;
  137. left: 0;
  138. right: 0;
  139. padding: 20rpx 20rpx 0rpx 20rpx;
  140. background-color: #fff;
  141. }
  142. .box_bottom_fit {
  143. /*#ifdef H5*/
  144. margin-bottom: 20rpx;
  145. /*#endif*/
  146. }
  147. .shopping_cart {
  148. padding: 14rpx 20rpx;
  149. border-radius: 40rpx;
  150. font-size: 30rpx;
  151. color: #fff;
  152. background-color: #FFD037;
  153. }
  154. .immediately {
  155. padding: 14rpx 20rpx;
  156. border-radius: 40rpx;
  157. font-size: 30rpx;
  158. color: #fff;
  159. background-color: #F93D3D;
  160. margin-left: 20rpx;
  161. }
  162. .secondary_font {
  163. font-size: 28rpx;
  164. }
  165. .card_introduce {
  166. background-color: #fff;
  167. margin: 20rpx;
  168. padding: 20rpx;
  169. border-radius: 20rpx;
  170. }
  171. .box_book {
  172. font-size: 30rpx;
  173. font-weight: bold;
  174. }
  175. .item_introduce {
  176. display: flex;
  177. justify-content: space-between;
  178. margin-top: 10rpx;
  179. }
  180. .name_key {
  181. flex: none;
  182. width: 150rpx;
  183. font-size: 28rpx;
  184. color: $u-info;
  185. }
  186. .name_value {
  187. flex: 1;
  188. font-size: 28rpx;
  189. }
  190. </style>