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

227 lines
4.2 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 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" @addCart="addCart"/>
  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. id : 0,
  81. }
  82. },
  83. onLoad(args) {
  84. if(args.id) {
  85. this.id = args.id
  86. this.getProductDetail(args.id)
  87. }
  88. },
  89. methods: {
  90. // 获取商品详情
  91. getProductDetail(id) {
  92. this.$api('getProductDetail', {
  93. productId: id
  94. }, res => {
  95. if(res.code == 200) {
  96. this.productDetail = res.result
  97. }
  98. })
  99. },
  100. addCart(){
  101. this.$api('addCart', {
  102. shopId : this.id,
  103. num : 1,
  104. }).then(res => {
  105. if(res.code == 200){
  106. uni.showToast({
  107. title: '加入成功',
  108. icon: 'none'
  109. })
  110. }
  111. })
  112. },
  113. // 联系客服
  114. share() {
  115. var that = this
  116. that.$refs.customerServicePopup.open();
  117. },
  118. // 选择完成规格立即租赁下单
  119. submit() {
  120. // that.$refs.submitUnitSelect.open();
  121. // 检查库存
  122. if(this.productDetail.num <= 0) {
  123. uni.showToast({
  124. title: '库存不足,无法下单',
  125. icon: 'none'
  126. });
  127. return;
  128. }
  129. this.$store.commit('setPayOrderProduct', [
  130. this.productDetail
  131. ])
  132. this.$utils.navigateTo('/pages_order/order/createOrder')
  133. },
  134. }
  135. }
  136. </script>
  137. <style scoped lang="scss">
  138. .page {
  139. .swipe {}
  140. .info {
  141. padding: 30rpx;
  142. background-color: #fff;
  143. .title {
  144. font-size: 34rpx;
  145. font-weight: 900;
  146. }
  147. .info-line {
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. margin-top: 30rpx;
  152. .price {
  153. font-size: 28rpx;
  154. color: $uni-color;
  155. text {
  156. font-size: 34rpx;
  157. }
  158. }
  159. .num {
  160. font-size: 24rpx;
  161. image {
  162. width: 24rpx;
  163. height: 24rpx;
  164. }
  165. }
  166. }
  167. .tips {
  168. display: flex;
  169. font-size: 20rpx;
  170. margin-top: 30rpx;
  171. .tip {
  172. margin-right: 40rpx;
  173. }
  174. }
  175. }
  176. .info-unit {
  177. margin-top: 20rpx;
  178. padding: 30rpx;
  179. background-color: #fff;
  180. /deep/ text {
  181. font-size: 26rpx;
  182. }
  183. /deep/ .text {
  184. color: #7C7C7C;
  185. margin-right: 20rpx;
  186. font-size: 26rpx;
  187. }
  188. }
  189. .content {
  190. background-color: #fff;
  191. margin-top: 20rpx;
  192. .title {
  193. padding: 30rpx;
  194. }
  195. }
  196. }
  197. </style>