goodDetail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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. onLoad(e) {
  111. console.log('eeeeeeeeeeeee============', e)
  112. },
  113. methods: {
  114. clickSpec(){
  115. this.$refs.specPopup.open();
  116. }
  117. }
  118. }
  119. </script>
  120. <style scoped lang="scss">
  121. .d-content{
  122. background: $page-color-base;
  123. width: 100%;
  124. }
  125. .fixed-top {
  126. bottom: 230rpx;
  127. }
  128. /* 01. 轮播区 */
  129. .swiper-area {
  130. height: 500rpx;
  131. z-index: -1;
  132. width: 100%;
  133. }
  134. /* 02. 商品数据区 */
  135. .goods-area {
  136. // margin-top: 720rpx;
  137. .price-box {
  138. display: flex;
  139. align-items: baseline;
  140. }
  141. .title {
  142. color: $font-color-dark;
  143. // height: 46rpx;
  144. // line-height: 46rpx;
  145. font-weight: 700;
  146. }
  147. }
  148. /* 06. 详情区 */
  149. .detail-area {
  150. .d-header {
  151. font-size: $font-base + 2upx;
  152. color: $font-color-dark;
  153. position: relative;
  154. text {
  155. padding: 0 20rpx;
  156. background: #fff;
  157. position: relative;
  158. z-index: 1;
  159. }
  160. &:after {
  161. position: absolute;
  162. left: 50%;
  163. top: 50%;
  164. transform: translateX(-50%);
  165. width: 300rpx;
  166. height: 0;
  167. content: '';
  168. border-bottom: 1px solid #ccc;
  169. }
  170. }
  171. /* 产品详情 */
  172. .pro-detail {
  173. width: 100%;
  174. overflow: hidden;
  175. -webkit-touch-callout: none;
  176. img {
  177. width: 100%;
  178. max-width: 100%;
  179. overflow: hidden;
  180. }
  181. }
  182. }
  183. /* 优惠券区 */
  184. .coupon-area {
  185. max-height: 60vh;
  186. min-height: 30vh;
  187. .coupon-item {
  188. margin-bottom: 20rpx;
  189. &:last-child {
  190. margin-bottom: 0;
  191. }
  192. .content {
  193. &:after {
  194. position: absolute;
  195. left: 0;
  196. bottom: 0;
  197. content: '';
  198. width: 100%;
  199. height: 0;
  200. border-bottom: 1px dashed #f3f3f3;
  201. transform: scaleY(50%);
  202. }
  203. }
  204. .circle {
  205. position: absolute;
  206. bottom: -10rpx;
  207. z-index: 10;
  208. width: 20rpx;
  209. height: 20rpx;
  210. background: #f5f5f5;
  211. border-radius: 50%;
  212. &.r {
  213. right: -6rpx;
  214. }
  215. &.l {
  216. left: -6rpx;
  217. }
  218. }
  219. }
  220. }
  221. .sale{
  222. color: #999;
  223. font-size: 12px;
  224. padding-top: 10upx;
  225. }
  226. .spec-cell{
  227. background: #FFF;
  228. }
  229. .u-slot-value{
  230. font-size: 12px;
  231. }
  232. .cart-bottom{
  233. width: 100%;
  234. position: fixed;
  235. left: 0;
  236. bottom: 0;
  237. height: 130rpx;
  238. box-sizing: border-box;
  239. background-color: #FFF;
  240. z-index: 10;
  241. box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
  242. .go-cart{
  243. height: 80%;
  244. box-sizing: border-box;
  245. border: solid 1px #FF0000;
  246. font-size: 14px;
  247. color: #FF0000;
  248. border-radius: 50upx;
  249. margin: 0 10px;
  250. width: 45%;
  251. }
  252. .go-buy{
  253. height: 80%;
  254. width: 45%;
  255. background-color: #FF0000;
  256. color: #FFF;
  257. border-radius: 50upx;
  258. font-size: 14px;
  259. }
  260. }
  261. .container {
  262. display: flex;
  263. // justify-content: space-between;
  264. margin: 10px 0; /* 添加一些外边距以便查看 */
  265. }
  266. </style>