inline_shop_details.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view>
  3. <!-- 线上订货详情页 -->
  4. <view class="demo-warter">
  5. <u-swiper height="750" :list="goodsDetails.imageList" image="image"></u-swiper>
  6. <view class="demo-info">
  7. <view class="demo-title">
  8. {{goodsDetails.title}}
  9. </view>
  10. <!-- <view class="demo-price">
  11. {{goodsDetails.price}}元
  12. </view> -->
  13. <!-- <view class="demo-tag">
  14. <view class="demo-tag-owner">
  15. 自营
  16. </view>
  17. <view class="demo-tag-text">
  18. 放心购
  19. </view>
  20. </view> -->
  21. <view class="demo-shop">
  22. 库存:{{goodsDetails.count}}
  23. </view>
  24. <view class="demo-count">
  25. <view class="demo-count-seleced">
  26. 已选:{{selectedCount}}
  27. </view>
  28. <view class="demo-count-box">
  29. <u-number-box v-model="selectedCount" :min="1" @change="selectedCountChange"></u-number-box>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <u-sticky :enable="tabEnable" :offset-top="tabOffset">
  35. <u-tabs class="tabCustomStyle" :list="tabList" :is-scroll="false" :current="tabCurrent" @change="tabChange"
  36. :bg-color="tabBg"></u-tabs>
  37. </u-sticky>
  38. <!-- 这里装商品和详情的内容 -->
  39. <view style="height: 750px;"></view>
  40. <view class="navigation">
  41. <!-- <view class="left">
  42. <view class="item">
  43. <u-icon name="server-fill" :size="40" :color="$u.color['contentColor']"></u-icon>
  44. <view class="text u-line-1">客服</view>
  45. </view>
  46. <view class="item">
  47. <u-icon name="home" :size="40" :color="$u.color['contentColor']"></u-icon>
  48. <view class="text u-line-1">店铺</view>
  49. </view>
  50. <view class="item car">
  51. <u-badge class="car-num" :count="9" type="error" :offset="[-3, -6]"></u-badge>
  52. <u-icon name="shopping-cart" :size="40" :color="$u.color['contentColor']"></u-icon>
  53. <view class="text u-line-1">购物车</view>
  54. </view>
  55. </view> -->
  56. <view class="right">
  57. <view class="cart btn u-line-1" @click="inShopcar">加入购物车</view>
  58. <view class="buy btn u-line-1">立即购买</view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. goodsDetails: {
  68. price: 35,
  69. title: '175/70R14 88T XL SH08 BGSL',
  70. count: '100',
  71. image: 'https://img12.360buyimg.com/n7/jfs/t16642/126/2693663818/450163/6879e8ce/5b06d93bN6305bd94.png',
  72. imageList: [{
  73. price: 35,
  74. title: '175/70R14 88T XL SH08 BGSL',
  75. count: '100',
  76. image: 'https://img12.360buyimg.com/n7/jfs/t16642/126/2693663818/450163/6879e8ce/5b06d93bN6305bd94.png',
  77. }, {
  78. price: 35,
  79. title: '175/70R14 88T XL SH08 BGSL',
  80. count: '100',
  81. image: 'https://img12.360buyimg.com/n7/jfs/t1/47645/22/6120/140457/5d3d17deEec9f8e8d/3687ff03ca89b48c.jpg',
  82. }],
  83. },
  84. selectedCount: 0, //选中的商品数量
  85. tabList: [{
  86. name: '商品'
  87. }, {
  88. name: '详情'
  89. }],
  90. tabCurrent: 0,
  91. tabBg: "#ffffff",
  92. tabEnable: false,
  93. tabOffset: 0
  94. }
  95. },
  96. methods: {
  97. selectedCountChange: function() {},
  98. tabChange: function(params) {
  99. this.tabCurrent = params
  100. console.log(params)
  101. },
  102. inShopcar(){
  103. this.$u.route({
  104. url: 'pages/home/shopping/shopping_car',
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .demo-warter {
  112. border-radius: 8px;
  113. background-color: #ffffff;
  114. position: relative;
  115. }
  116. .demo-info {
  117. margin: 5px;
  118. padding: 8px;
  119. }
  120. .u-close {
  121. position: absolute;
  122. top: 32rpx;
  123. right: 32rpx;
  124. }
  125. .demo-image {
  126. width: 100%;
  127. border-radius: 4px;
  128. }
  129. .demo-title {
  130. font-size: 30rpx;
  131. margin-top: 5px;
  132. color: $u-main-color;
  133. }
  134. .demo-tag {
  135. display: flex;
  136. margin-top: 5px;
  137. }
  138. .demo-tag-owner {
  139. background-color: $u-type-error;
  140. color: #FFFFFF;
  141. display: flex;
  142. align-items: center;
  143. padding: 4rpx 14rpx;
  144. border-radius: 50rpx;
  145. font-size: 20rpx;
  146. line-height: 1;
  147. }
  148. .demo-tag-text {
  149. border: 1px solid $u-type-primary;
  150. color: $u-type-primary;
  151. margin-left: 10px;
  152. border-radius: 50rpx;
  153. line-height: 1;
  154. padding: 4rpx 14rpx;
  155. display: flex;
  156. align-items: center;
  157. border-radius: 50rpx;
  158. font-size: 20rpx;
  159. }
  160. .demo-price {
  161. font-size: 30rpx;
  162. color: $u-type-error;
  163. margin-top: 5px;
  164. }
  165. .demo-shop {
  166. font-size: 22rpx;
  167. color: $u-tips-color;
  168. margin-top: 5px;
  169. }
  170. .demo-count {
  171. display: flex;
  172. font-size: 22rpx;
  173. margin-top: 5px;
  174. justify-content: space-between;
  175. font-weight: 600;
  176. }
  177. .tabCustomStyle {
  178. border-top: 8rpx solid #EFEFEF;
  179. border-bottom: 8rpx solid #EFEFEF;
  180. }
  181. /* 底部提交栏目 */
  182. .navigation {
  183. display: flex;
  184. width: 100%;
  185. margin-top: 100rpx;
  186. border: solid 2rpx #f2f2f2;
  187. background-color: #ffffff;
  188. padding: 16rpx 26rpx;
  189. position: fixed;
  190. bottom: 0;
  191. z-index: 100;
  192. .left {
  193. display: flex;
  194. font-size: 20rpx;
  195. .item {
  196. margin: 0 30rpx;
  197. &.car {
  198. text-align: center;
  199. position: relative;
  200. .car-num {
  201. position: absolute;
  202. top: -10rpx;
  203. right: -10rpx;
  204. }
  205. }
  206. }
  207. }
  208. .right {
  209. display: flex;
  210. font-size: 28rpx;
  211. align-items: center;
  212. width: 100%;
  213. .btn {
  214. line-height: 66rpx;
  215. padding: 0 30rpx;
  216. border-radius: 36rpx;
  217. color: #ffffff;
  218. text-align: center;
  219. }
  220. .cart {
  221. background-color: #ed3f14;
  222. width: 50%;
  223. margin-right: 30rpx;
  224. }
  225. .buy {
  226. width: 50%;
  227. background-color: #ff7900;
  228. }
  229. }
  230. }
  231. </style>