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

268 lines
5.2 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 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 class="price">
  15. <view class="money">
  16. <text>{{ productDetail.price }}</text>
  17. <text class="unit">/元每件</text>
  18. </view>
  19. <view class="oldPrice">
  20. <text>{{ productDetail.oldPrice }}</text>
  21. <text class="unit">/</text>
  22. </view>
  23. </view>
  24. <view class="price">
  25. <view class="money">
  26. <text>{{ productDetail.goldPrice }}</text>
  27. <text class="unit">/元每件</text>
  28. </view>
  29. <view class="price-imgs">
  30. <image :src="configList.vip_money_one" mode="aspectFill"
  31. class="price-img"></image>
  32. </view>
  33. </view>
  34. <view class="price">
  35. <view class="money">
  36. <text>{{ productDetail.silverPrice }}</text>
  37. <text class="unit">/元每件</text>
  38. </view>
  39. <view class="price-imgs">
  40. <image :src="configList.vip_money_two" mode="aspectFill" class="price-img">
  41. </image>
  42. </view>
  43. </view>
  44. <view class="price">
  45. <view class="money">
  46. <text>{{ productDetail.diamondPrice }}</text>
  47. <text class="unit">/元每件</text>
  48. </view>
  49. <view class="price-imgs">
  50. <image :src="configList.vip_money_three" mode="aspectFill" class="price-img">
  51. </image>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 服务 -->
  56. <view class="server">
  57. <view class="setver-main">
  58. <view class="title">服务</view>
  59. <view class="descript">
  60. 免费上门退·7天无理由退货·快递发货
  61. </view>
  62. </view>
  63. <view class="server-arraw">
  64. <uv-icon name="arrow-right"></uv-icon>
  65. </view>
  66. </view>
  67. <!-- 参数 -->
  68. <view v-if="productDetail.sku" class="params">
  69. <view class="params-main">
  70. <view class="title">参数</view>
  71. <view class="descript">
  72. {{ productDetail.sku }}
  73. </view>
  74. </view>
  75. <view class="server-arraw">
  76. <uv-icon name="arrow-right"></uv-icon>
  77. </view>
  78. </view>
  79. <!-- 商品详情 -->
  80. <view class="item-line">
  81. <view class="before"></view>
  82. <view class="label">商品详情</view>
  83. </view>
  84. <uv-parse :content="productDetail.details"></uv-parse>
  85. <!-- 分享和购买按钮 -->
  86. <submit @service="service" @submit="submit" :detail="productDetail" />
  87. <!-- 联系客服 -->
  88. <customerServicePopup ref="customerServicePopup" />
  89. </view>
  90. </template>
  91. <script>
  92. import submit from '../components/product/submit.vue'
  93. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  94. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  95. export default {
  96. components: {
  97. submit,
  98. submitUnitSelect,
  99. customerServicePopup
  100. },
  101. data() {
  102. return {
  103. productDetail: {
  104. image: '',
  105. details: '',
  106. },
  107. id: 0,
  108. }
  109. },
  110. onLoad(args) {
  111. this.id = args.id
  112. },
  113. onShow() {
  114. this.getRiceProductDetail()
  115. },
  116. methods: {
  117. // 分享商品
  118. share() {
  119. },
  120. // 立即下单
  121. submit() {
  122. this.$store.commit('setPayOrderProduct', [
  123. this.productDetail
  124. ])
  125. this.$utils.navigateTo('/pages_order/order/createOrder')
  126. },
  127. // 获取商品
  128. getRiceProductDetail() {
  129. this.$api('getRiceProductDetail', {
  130. id: this.id
  131. }, res => {
  132. if (res.code == 200) {
  133. res.result.num = 1
  134. this.productDetail = res.result
  135. }
  136. })
  137. },
  138. // 联系客服
  139. service() {
  140. this.$refs.customerServicePopup.open()
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped lang="scss">
  146. .page {
  147. .swipe {}
  148. // 商品标题
  149. .info {
  150. padding: 20rpx;
  151. background-color: #fff;
  152. display: flex;
  153. flex-direction: column;
  154. gap: 14rpx;
  155. .title {
  156. font-size: 36rpx;
  157. font-weight: 900;
  158. }
  159. }
  160. // 服务 & 参数
  161. .server,
  162. .params {
  163. background: white;
  164. display: flex;
  165. justify-content: space-between;
  166. flex-wrap: wrap;
  167. padding: 30rpx 20rpx;
  168. box-sizing: border-box;
  169. .setver-main,
  170. .params-main {
  171. display: flex;
  172. flex-wrap: wrap;
  173. width: 90%;
  174. font-size: 32rpx;
  175. .title {
  176. color: #7C7C7C;
  177. margin-right: 20rpx;
  178. }
  179. }
  180. .server-arraw {
  181. display: flex;
  182. justify-content: flex-end;
  183. text-align: right;
  184. }
  185. }
  186. // 价格
  187. .price {
  188. display: flex;
  189. align-items: center;
  190. color: #f40;
  191. font-size: 30rpx;
  192. align-items: flex-end;
  193. .money {
  194. font-size: 30rpx;
  195. .unit {
  196. font-size: 24rpx;
  197. }
  198. }
  199. .price-imgs {
  200. display: flex;
  201. flex-wrap: wrap;
  202. .price-img {
  203. width: 80rpx;
  204. height: 30rpx;
  205. margin-left: 10rpx;
  206. }
  207. }
  208. }
  209. .oldPrice{
  210. color: #999;
  211. font-size: 24rpx;
  212. text-decoration: line-through;
  213. }
  214. // 商品详情
  215. .item-line {
  216. display: flex;
  217. background: white;
  218. box-sizing: border-box;
  219. font-size: 34rpx;
  220. padding: 20rpx;
  221. }
  222. .item-line .before {
  223. content: "";
  224. width: 8rpx;
  225. height: 30rpx;
  226. background: $uni-color;
  227. border-radius: 4rpx;
  228. margin-right: 10rpx;
  229. margin-top: 15rpx;
  230. }
  231. .item-line .label {
  232. display: flex;
  233. align-items: center;
  234. width: 152rpx;
  235. height: 60rpx;
  236. }
  237. }
  238. </style>