建材商城系统20241014
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

210 lines
3.9 KiB

7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="swipe">
  5. <uv-swiper :list="productDetail.image.split(',')" indicator height="350rpx"></uv-swiper>
  6. </view>
  7. <view class="info">
  8. <view class="title">
  9. {{ productDetail.name }}
  10. </view>
  11. <view class="info-line">
  12. <view class="price">
  13. <text>{{ productDetail.price }}</text>
  14. </view>
  15. <!-- <view class="num">
  16. 已售1000+
  17. <image src="../static/product/like.png" mode=""></image>
  18. </view> -->
  19. </view>
  20. <!-- <view class="tips">
  21. <view class="tip">
  22. 专业设备
  23. </view>
  24. <view class="tip">
  25. 科学流程
  26. </view>
  27. <view class="tip">
  28. 质量保证
  29. </view>
  30. </view> -->
  31. </view>
  32. <view class="info-unit">
  33. <uv-cell title="免费上门退·7天无理由退货·快递发货" isLink>
  34. <template #icon>
  35. <text class="text">服务</text>
  36. </template>
  37. </uv-cell>
  38. <uv-cell title="请选择规格" isLink>
  39. <template #icon>
  40. <text class="text">参数</text>
  41. </template>
  42. </uv-cell>
  43. <uv-cell>
  44. <template #icon>
  45. <text>品牌适应人群</text>
  46. </template>
  47. </uv-cell>
  48. </view>
  49. <view class="content">
  50. <view class="title">
  51. 商品详情
  52. </view>
  53. <uv-parse :content="productDetail.details"></uv-parse>
  54. </view>
  55. <!-- 分享和租赁按钮 -->
  56. <submit @submit="submit" />
  57. <!-- 选择规格 -->
  58. <!-- <submitUnitSelect ref="submitUnitSelect" /> -->
  59. <!-- 联系客服弹框 -->
  60. <customerServicePopup ref="customerServicePopup" />
  61. </view>
  62. </template>
  63. <script>
  64. import submit from '../components/product/submit.vue'
  65. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  66. import customerServicePopup from "@/components/config/customerServicePopup.vue";
  67. export default {
  68. components: {
  69. submit,
  70. customerServicePopup,
  71. submitUnitSelect
  72. },
  73. data() {
  74. return {
  75. productDetail: {
  76. image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png',
  77. content: '',
  78. }
  79. }
  80. },
  81. onLoad(args) {
  82. console.log(args);
  83. if(args.id) {
  84. this.getProductDetail(args.id)
  85. }
  86. },
  87. methods: {
  88. // 获取商品详情
  89. getProductDetail(id) {
  90. this.$api('getProductDetail', {
  91. productId: id
  92. }, res => {
  93. if(res.code == 200) {
  94. this.productDetail = res.result
  95. }
  96. })
  97. },
  98. // 联系客服
  99. share() {
  100. var that = this
  101. that.$refs.customerServicePopup.open();
  102. },
  103. // 选择完成规格立即租赁下单
  104. submit() {
  105. // that.$refs.submitUnitSelect.open();
  106. // 检查库存
  107. if(this.productDetail.num <= 0) {
  108. uni.showToast({
  109. title: '库存不足,无法下单',
  110. icon: 'none'
  111. });
  112. return;
  113. }
  114. this.$store.commit('setPayOrderProduct', [
  115. this.productDetail
  116. ])
  117. this.$utils.navigateTo('/pages_order/order/createOrder')
  118. },
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .page {
  124. .swipe {}
  125. .info {
  126. padding: 30rpx;
  127. background-color: #fff;
  128. .title {
  129. font-size: 34rpx;
  130. font-weight: 900;
  131. }
  132. .info-line {
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. margin-top: 30rpx;
  137. .price {
  138. font-size: 28rpx;
  139. color: $uni-color;
  140. text {
  141. font-size: 34rpx;
  142. }
  143. }
  144. .num {
  145. font-size: 24rpx;
  146. image {
  147. width: 24rpx;
  148. height: 24rpx;
  149. }
  150. }
  151. }
  152. .tips {
  153. display: flex;
  154. font-size: 20rpx;
  155. margin-top: 30rpx;
  156. .tip {
  157. margin-right: 40rpx;
  158. }
  159. }
  160. }
  161. .info-unit {
  162. margin-top: 20rpx;
  163. padding: 30rpx;
  164. background-color: #fff;
  165. /deep/ text {
  166. font-size: 26rpx;
  167. }
  168. /deep/ .text {
  169. color: #7C7C7C;
  170. margin-right: 20rpx;
  171. font-size: 26rpx;
  172. }
  173. }
  174. .content {
  175. background-color: #fff;
  176. margin-top: 20rpx;
  177. .title {
  178. padding: 30rpx;
  179. }
  180. }
  181. }
  182. </style>