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

275 lines
5.3 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
3 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
3 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 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
  87. @service="service"
  88. @toSend="toSend"
  89. @submit="submit"
  90. :detail="productDetail" />
  91. <!-- 联系客服 -->
  92. <customerServicePopup ref="customerServicePopup" />
  93. </view>
  94. </template>
  95. <script>
  96. import submit from '../components/product/submit.vue'
  97. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  98. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  99. export default {
  100. components: {
  101. submit,
  102. submitUnitSelect,
  103. customerServicePopup
  104. },
  105. data() {
  106. return {
  107. productDetail: {
  108. image: '',
  109. details: '',
  110. },
  111. id: 0,
  112. }
  113. },
  114. onLoad(args) {
  115. this.id = args.id
  116. },
  117. onShow() {
  118. this.getRiceProductDetail()
  119. },
  120. methods: {
  121. // 分享商品
  122. share() {
  123. },
  124. // 立即下单
  125. submit() {
  126. this.$store.commit('setPayOrderProduct', [
  127. this.productDetail
  128. ])
  129. this.$utils.navigateTo('/pages_order/order/createOrder')
  130. },
  131. toSend(){
  132. this.$utils.navigateTo('/pages_order/order/instantGift')
  133. },
  134. // 获取商品
  135. getRiceProductDetail() {
  136. this.$api('getRiceProductDetail', {
  137. id: this.id
  138. }, res => {
  139. if (res.code == 200) {
  140. res.result.num = 1
  141. this.productDetail = res.result
  142. }
  143. })
  144. },
  145. // 联系客服
  146. service() {
  147. this.$refs.customerServicePopup.open()
  148. },
  149. }
  150. }
  151. </script>
  152. <style scoped lang="scss">
  153. .page {
  154. .swipe {}
  155. // 商品标题
  156. .info {
  157. padding: 20rpx;
  158. background-color: #fff;
  159. display: flex;
  160. flex-direction: column;
  161. gap: 14rpx;
  162. .title {
  163. font-size: 36rpx;
  164. font-weight: 900;
  165. }
  166. }
  167. // 服务 & 参数
  168. .server,
  169. .params {
  170. background: white;
  171. display: flex;
  172. justify-content: space-between;
  173. flex-wrap: wrap;
  174. padding: 30rpx 20rpx;
  175. box-sizing: border-box;
  176. .setver-main,
  177. .params-main {
  178. display: flex;
  179. flex-wrap: wrap;
  180. width: 90%;
  181. font-size: 32rpx;
  182. .title {
  183. color: #7C7C7C;
  184. margin-right: 20rpx;
  185. }
  186. }
  187. .server-arraw {
  188. display: flex;
  189. justify-content: flex-end;
  190. text-align: right;
  191. }
  192. }
  193. // 价格
  194. .price {
  195. display: flex;
  196. align-items: center;
  197. color: #f40;
  198. font-size: 30rpx;
  199. align-items: flex-end;
  200. .money {
  201. font-size: 30rpx;
  202. .unit {
  203. font-size: 24rpx;
  204. }
  205. }
  206. .price-imgs {
  207. display: flex;
  208. flex-wrap: wrap;
  209. .price-img {
  210. width: 80rpx;
  211. height: 30rpx;
  212. margin-left: 10rpx;
  213. }
  214. }
  215. }
  216. .oldPrice{
  217. color: #999;
  218. font-size: 24rpx;
  219. text-decoration: line-through;
  220. }
  221. // 商品详情
  222. .item-line {
  223. display: flex;
  224. background: white;
  225. box-sizing: border-box;
  226. font-size: 34rpx;
  227. padding: 20rpx;
  228. }
  229. .item-line .before {
  230. content: "";
  231. width: 8rpx;
  232. height: 30rpx;
  233. background: $uni-color;
  234. border-radius: 4rpx;
  235. margin-right: 10rpx;
  236. margin-top: 15rpx;
  237. }
  238. .item-line .label {
  239. display: flex;
  240. align-items: center;
  241. width: 152rpx;
  242. height: 60rpx;
  243. }
  244. }
  245. </style>