建材商城系统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.

213 lines
3.9 KiB

8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 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. <kefu/>
  62. </view>
  63. </template>
  64. <script>
  65. import submit from '../components/product/submit.vue'
  66. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  67. import customerServicePopup from "@/components/config/customerServicePopup.vue";
  68. export default {
  69. components: {
  70. submit,
  71. customerServicePopup,
  72. submitUnitSelect
  73. },
  74. data() {
  75. return {
  76. productDetail: {
  77. image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png',
  78. content: '',
  79. }
  80. }
  81. },
  82. onLoad(args) {
  83. console.log(args);
  84. if(args.id) {
  85. this.getProductDetail(args.id)
  86. }
  87. },
  88. methods: {
  89. // 获取商品详情
  90. getProductDetail(id) {
  91. this.$api('getProductDetail', {
  92. productId: id
  93. }, res => {
  94. if(res.code == 200) {
  95. this.productDetail = res.result
  96. }
  97. })
  98. },
  99. // 联系客服
  100. share() {
  101. var that = this
  102. that.$refs.customerServicePopup.open();
  103. },
  104. // 选择完成规格立即租赁下单
  105. submit() {
  106. // that.$refs.submitUnitSelect.open();
  107. // 检查库存
  108. if(this.productDetail.num <= 0) {
  109. uni.showToast({
  110. title: '库存不足,无法下单',
  111. icon: 'none'
  112. });
  113. return;
  114. }
  115. this.$store.commit('setPayOrderProduct', [
  116. this.productDetail
  117. ])
  118. this.$utils.navigateTo('/pages_order/order/createOrder')
  119. },
  120. }
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .page {
  125. .swipe {}
  126. .info {
  127. padding: 30rpx;
  128. background-color: #fff;
  129. .title {
  130. font-size: 34rpx;
  131. font-weight: 900;
  132. }
  133. .info-line {
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: center;
  137. margin-top: 30rpx;
  138. .price {
  139. font-size: 28rpx;
  140. color: $uni-color;
  141. text {
  142. font-size: 34rpx;
  143. }
  144. }
  145. .num {
  146. font-size: 24rpx;
  147. image {
  148. width: 24rpx;
  149. height: 24rpx;
  150. }
  151. }
  152. }
  153. .tips {
  154. display: flex;
  155. font-size: 20rpx;
  156. margin-top: 30rpx;
  157. .tip {
  158. margin-right: 40rpx;
  159. }
  160. }
  161. }
  162. .info-unit {
  163. margin-top: 20rpx;
  164. padding: 30rpx;
  165. background-color: #fff;
  166. /deep/ text {
  167. font-size: 26rpx;
  168. }
  169. /deep/ .text {
  170. color: #7C7C7C;
  171. margin-right: 20rpx;
  172. font-size: 26rpx;
  173. }
  174. }
  175. .content {
  176. background-color: #fff;
  177. margin-top: 20rpx;
  178. .title {
  179. padding: 30rpx;
  180. }
  181. }
  182. }
  183. </style>