敢为人鲜小程序前端代码仓库
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.

281 lines
5.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
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
3 months ago
3 months ago
3 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.$store.commit('setPayOrderProduct', [
  133. this.productDetail
  134. ])
  135. // this.$utils.navigateTo('/pages_order/order/receiveGift?id=1894006757315850241')
  136. this.$utils.navigateTo('/pages_order/order/createOrder?type=give')
  137. },
  138. // 获取商品
  139. getRiceProductDetail() {
  140. this.$api('getRiceProductDetail', {
  141. id: this.id
  142. }, res => {
  143. if (res.code == 200) {
  144. res.result.num = 1
  145. this.productDetail = res.result
  146. }
  147. })
  148. },
  149. // 联系客服
  150. service() {
  151. this.$refs.customerServicePopup.open()
  152. },
  153. }
  154. }
  155. </script>
  156. <style scoped lang="scss">
  157. .page {
  158. .swipe {}
  159. // 商品标题
  160. .info {
  161. padding: 20rpx;
  162. background-color: #fff;
  163. display: flex;
  164. flex-direction: column;
  165. gap: 14rpx;
  166. .title {
  167. font-size: 36rpx;
  168. font-weight: 900;
  169. }
  170. }
  171. // 服务 & 参数
  172. .server,
  173. .params {
  174. background: white;
  175. display: flex;
  176. justify-content: space-between;
  177. flex-wrap: wrap;
  178. padding: 30rpx 20rpx;
  179. box-sizing: border-box;
  180. .setver-main,
  181. .params-main {
  182. display: flex;
  183. flex-wrap: wrap;
  184. width: 90%;
  185. font-size: 32rpx;
  186. .title {
  187. color: #7C7C7C;
  188. margin-right: 20rpx;
  189. }
  190. }
  191. .server-arraw {
  192. display: flex;
  193. justify-content: flex-end;
  194. text-align: right;
  195. }
  196. }
  197. // 价格
  198. .price {
  199. display: flex;
  200. align-items: center;
  201. color: #f40;
  202. font-size: 30rpx;
  203. align-items: flex-end;
  204. .money {
  205. font-size: 30rpx;
  206. .unit {
  207. font-size: 24rpx;
  208. }
  209. }
  210. .price-imgs {
  211. display: flex;
  212. flex-wrap: wrap;
  213. .price-img {
  214. width: 80rpx;
  215. height: 30rpx;
  216. margin-left: 10rpx;
  217. }
  218. }
  219. }
  220. .oldPrice{
  221. color: #999;
  222. font-size: 24rpx;
  223. text-decoration: line-through;
  224. }
  225. // 商品详情
  226. .item-line {
  227. display: flex;
  228. background: white;
  229. box-sizing: border-box;
  230. font-size: 34rpx;
  231. padding: 20rpx;
  232. }
  233. .item-line .before {
  234. content: "";
  235. width: 8rpx;
  236. height: 30rpx;
  237. background: $uni-color;
  238. border-radius: 4rpx;
  239. margin-right: 10rpx;
  240. margin-top: 15rpx;
  241. }
  242. .item-line .label {
  243. display: flex;
  244. align-items: center;
  245. width: 152rpx;
  246. height: 60rpx;
  247. }
  248. }
  249. </style>