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

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