珠宝小程序前端代码
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.

190 lines
3.5 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="swipe">
  6. <uv-swiper :list="productDetail.image
  7. && productDetail.image.split(',')" indicator height="520rpx"></uv-swiper>
  8. </view>
  9. <!-- 商品标题 -->
  10. <view class="info">
  11. <view class="title">
  12. {{ productDetail.title }}
  13. </view>
  14. </view>
  15. <!-- 服务 -->
  16. <view class="server">
  17. <view class="setver-main">
  18. <view class="title">服务</view>
  19. <view class="descript">
  20. 免费上门退·7天无理由退货·快递发货
  21. </view>
  22. </view>
  23. <view class="server-arraw">
  24. <uv-icon name="arrow-right"></uv-icon>
  25. </view>
  26. </view>
  27. <!-- 参数 -->
  28. <view v-if="productDetail.sku" class="params">
  29. <view class="params-main">
  30. <view class="title">参数</view>
  31. <view class="descript">
  32. {{ productDetail.sku }}
  33. </view>
  34. </view>
  35. <view class="server-arraw">
  36. <uv-icon name="arrow-right"></uv-icon>
  37. </view>
  38. </view>
  39. <!-- 商品详情 -->
  40. <view class="item-line">
  41. <view class="before"></view>
  42. <view class="label">商品详情</view>
  43. </view>
  44. <uv-parse :content="productDetail.details"></uv-parse>
  45. <!-- 分享和购买按钮 -->
  46. <submit @service="service" @submit="submit" :detail="productDetail" />
  47. <!-- 联系客服 -->
  48. <customerServicePopup ref="customerServicePopup" />
  49. </view>
  50. </template>
  51. <script>
  52. import submit from '../components/product/submit.vue'
  53. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  54. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  55. export default {
  56. components: {
  57. submit,
  58. submitUnitSelect,
  59. customerServicePopup
  60. },
  61. data() {
  62. return {
  63. productDetail: {
  64. image: '',
  65. details: '',
  66. },
  67. id: 0,
  68. }
  69. },
  70. onLoad(args) {
  71. this.id = args.id
  72. },
  73. onShow() {
  74. this.getRiceProductDetail()
  75. },
  76. methods: {
  77. // 分享商品
  78. share() {
  79. },
  80. // 立即下单
  81. submit() {
  82. this.$store.commit('setPayOrderProduct', [
  83. this.productDetail
  84. ])
  85. this.$utils.navigateTo('/pages_order/order/createOrder')
  86. },
  87. // 获取商品
  88. getRiceProductDetail() {
  89. this.$api('getRiceProductDetail', {
  90. id: this.id
  91. }, res => {
  92. if (res.code == 200) {
  93. res.result.num = 1
  94. this.productDetail = res.result
  95. }
  96. })
  97. },
  98. // 联系客服
  99. service() {
  100. this.$refs.customerServicePopup.open()
  101. },
  102. }
  103. }
  104. </script>
  105. <style scoped lang="scss">
  106. .page {
  107. .swipe {}
  108. // 商品标题
  109. .info {
  110. padding: 20rpx;
  111. background-color: #fff;
  112. .title {
  113. font-size: 36rpx;
  114. font-weight: 900;
  115. }
  116. }
  117. // 服务 & 参数
  118. .server,
  119. .params {
  120. background: white;
  121. display: flex;
  122. justify-content: space-between;
  123. flex-wrap: wrap;
  124. padding: 30rpx 20rpx;
  125. box-sizing: border-box;
  126. .setver-main,
  127. .params-main {
  128. display: flex;
  129. flex-wrap: wrap;
  130. width: 90%;
  131. font-size: 32rpx;
  132. .title {
  133. color: #7C7C7C;
  134. margin-right: 20rpx;
  135. }
  136. }
  137. .server-arraw {
  138. display: flex;
  139. justify-content: flex-end;
  140. text-align: right;
  141. }
  142. }
  143. // 商品详情
  144. .item-line {
  145. display: flex;
  146. background: white;
  147. box-sizing: border-box;
  148. font-size: 34rpx;
  149. padding: 20rpx;
  150. }
  151. .item-line .before {
  152. content: "";
  153. width: 8rpx;
  154. height: 30rpx;
  155. background: $uni-color;
  156. border-radius: 4rpx;
  157. margin-right: 10rpx;
  158. margin-top: 15rpx;
  159. }
  160. .item-line .label {
  161. display: flex;
  162. align-items: center;
  163. width: 152rpx;
  164. height: 60rpx;
  165. }
  166. }
  167. </style>