goodDetail.vue 6.0 KB

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