goodDetail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="d-content">
  3. <!-- 01. 轮播区 -->
  4. <view class="swiper-area w-full">
  5. <swiper class="h-full pos-r" indicator-dots circular="true" duration="400">
  6. <swiper-item v-for="(item, index) in swiperDatas" :key="index">
  7. <view class="wh-full"><image :src="item.url" class="wh-full loaded" lazy-load="true" mode="aspectFill"></image></view>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <view class="d-content">
  12. <!-- 02. 商品数据区 -->
  13. <view class="goods-area bg-main padding">
  14. <view class="price-box dflex-b">
  15. <view>
  16. <text class="price fwb fs-big">{{ goods.price / 100 || '100' }}</text>
  17. </view>
  18. <view class="dflex fs-sm ft-dark">
  19. <view class="margin-right-sm dflex" @click="">
  20. <uni-icons type="headphones" size="24" color="#999"></uni-icons>
  21. </view>
  22. <view class="margin-right-sm dflex">
  23. <uni-icons type="heart" size="24" color="#999"></uni-icons>
  24. </view>
  25. <view class="margin-right-sm dflex" @click="">
  26. <uni-icons type="redo" size="24" color="#999"></uni-icons>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- <view class="coupon">
  31. <view class="mj-tag">
  32. <view class="mj-icon padding-lr-xs">
  33. <u-icon name="rmb-circle" color="#FFF"></u-icon>
  34. </view>
  35. <text class="padding-lr-xs">优惠满减</text>
  36. </view>
  37. <text class="coupon-name">满30减20</text>
  38. </view> -->
  39. <view class="title fs">商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
  40. <view class="sale">月销量:236</view>
  41. </view>
  42. <!-- 06. 详情区 -->
  43. <view class="gap"></view>
  44. <view class="spec-cell">
  45. <u-cell title="已选" isLink clickable @click="clickSpec" :border="false">
  46. <text slot="value" class="u-slot-value">{{specValue}}</text>
  47. </u-cell>
  48. </view>
  49. <view class="gap"></view>
  50. <view class="spec-cell">
  51. <u-cell title="发货" isLink clickable :border="false">
  52. <text slot="value" class="u-slot-value">预计5天内发货</text>
  53. </u-cell>
  54. </view>
  55. <view class="gap"></view>
  56. <view class="detail-area bg-main">
  57. <view class="d-header padding dflex-c"><text>图文详情</text></view>
  58. <rich-text class="pro-detail" :nodes="html_nodes"></rich-text>
  59. </view>
  60. </view>
  61. <my-gap :height="130" bg="#f5f5f5" />
  62. <!-- 07. 操作区 -->
  63. <view class="cart-bottom padding-sm dflex-b">
  64. <view class="go-cart dflex-c">加入购物车</view>
  65. <view class="go-buy dflex-c">立即购买</view>
  66. </view>
  67. <!-- 置顶 -->
  68. <use-totop ref="usetop" bottom="120"></use-totop>
  69. <specPopup ref="specPopup"></specPopup>
  70. </view>
  71. </template>
  72. <script>
  73. import specPopup from '@/components/specPopup.vue'
  74. export default {
  75. components:{specPopup},
  76. data() {
  77. return {
  78. specValue:'1包,番茄味',
  79. // 商品ID
  80. id: 0,
  81. // 商品数据
  82. goods: {},
  83. // 轮播图
  84. swiperDatas: [{
  85. url:'../../static/banner1.jpg'
  86. }],
  87. // SKU
  88. sku: {},
  89. // 商品详情
  90. html_nodes: '',
  91. // 收藏
  92. favorite: false,
  93. scrollTop: 0
  94. }
  95. },
  96. methods: {
  97. clickSpec(){
  98. this.$refs.specPopup.open();
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .d-content{
  105. background: $page-color-base;
  106. width: 100%;
  107. }
  108. .fixed-top {
  109. bottom: 230rpx;
  110. }
  111. /* 01. 轮播区 */
  112. .swiper-area {
  113. height: 500rpx;
  114. z-index: -1;
  115. width: 100%;
  116. }
  117. /* 02. 商品数据区 */
  118. .goods-area {
  119. // margin-top: 720rpx;
  120. .price-box {
  121. display: flex;
  122. align-items: baseline;
  123. }
  124. .title {
  125. color: $font-color-dark;
  126. // height: 46rpx;
  127. // line-height: 46rpx;
  128. font-weight: 700;
  129. }
  130. }
  131. /* 06. 详情区 */
  132. .detail-area {
  133. .d-header {
  134. font-size: $font-base + 2upx;
  135. color: $font-color-dark;
  136. position: relative;
  137. text {
  138. padding: 0 20rpx;
  139. background: #fff;
  140. position: relative;
  141. z-index: 1;
  142. }
  143. &:after {
  144. position: absolute;
  145. left: 50%;
  146. top: 50%;
  147. transform: translateX(-50%);
  148. width: 300rpx;
  149. height: 0;
  150. content: '';
  151. border-bottom: 1px solid #ccc;
  152. }
  153. }
  154. /* 产品详情 */
  155. .pro-detail {
  156. width: 100%;
  157. overflow: hidden;
  158. -webkit-touch-callout: none;
  159. img {
  160. width: 100%;
  161. max-width: 100%;
  162. overflow: hidden;
  163. }
  164. }
  165. }
  166. /* 优惠券区 */
  167. .coupon-area {
  168. max-height: 60vh;
  169. min-height: 30vh;
  170. .coupon-item {
  171. margin-bottom: 20rpx;
  172. &:last-child {
  173. margin-bottom: 0;
  174. }
  175. .content {
  176. &:after {
  177. position: absolute;
  178. left: 0;
  179. bottom: 0;
  180. content: '';
  181. width: 100%;
  182. height: 0;
  183. border-bottom: 1px dashed #f3f3f3;
  184. transform: scaleY(50%);
  185. }
  186. }
  187. .circle {
  188. position: absolute;
  189. bottom: -10rpx;
  190. z-index: 10;
  191. width: 20rpx;
  192. height: 20rpx;
  193. background: #f5f5f5;
  194. border-radius: 50%;
  195. &.r {
  196. right: -6rpx;
  197. }
  198. &.l {
  199. left: -6rpx;
  200. }
  201. }
  202. }
  203. }
  204. .sale{
  205. color: #999;
  206. font-size: 12px;
  207. padding-top: 10upx;
  208. }
  209. .spec-cell{
  210. background: #FFF;
  211. }
  212. .u-slot-value{
  213. font-size: 12px;
  214. }
  215. .cart-bottom{
  216. width: 100%;
  217. position: fixed;
  218. left: 0;
  219. bottom: 0;
  220. height: 130rpx;
  221. box-sizing: border-box;
  222. background-color: #FFF;
  223. z-index: 10;
  224. box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
  225. .go-cart{
  226. height: 100%;
  227. box-sizing: border-box;
  228. border: solid 1px #FF0000;
  229. font-size: 14px;
  230. color: #FF0000;
  231. border-radius: 5px;
  232. width: 48%;
  233. }
  234. .go-buy{
  235. height: 100%;
  236. width: 48%;
  237. background-color: #FF0000;
  238. color: #FFF;
  239. border-radius: 5px;
  240. font-size: 14px;
  241. }
  242. }
  243. </style>