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

232 lines
4.3 KiB

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