景徳镇旅游微信小程序
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.

210 lines
3.7 KiB

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
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 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
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
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
  1. <template>
  2. <view class="page">
  3. <navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="swipe">
  5. <uv-swiper :list="productDetail.waresImage &&
  6. productDetail.waresImage.split(',')" indicator height="420rpx"></uv-swiper>
  7. </view>
  8. <view class="info">
  9. <view class="title">
  10. {{productDetail.waresTitle}}
  11. </view>
  12. <view class="info-line">
  13. <view class="price">
  14. <text>{{productDetail.waresPrice}}</text>
  15. </view>
  16. <view class="num">
  17. {{productDetail.waresSales}}
  18. <image src="../static/product/like.png" mode=""></image>
  19. </view>
  20. </view>
  21. <view class="tips">
  22. <view class="tip">
  23. 专业设备
  24. </view>
  25. <view class="tip">
  26. 科学流程
  27. </view>
  28. <view class="tip">
  29. 质量保证
  30. </view>
  31. </view>
  32. </view>
  33. <view class="info-unit">
  34. <uv-cell title="服务" isLink>
  35. <template #icon>
  36. <text class="text">免费上门退·7天无理由退货·快递发货</text>
  37. </template>
  38. </uv-cell>
  39. <uv-cell title="参数" isLink>
  40. <template #icon>
  41. <text class="text">品牌适应人群</text>
  42. </template>
  43. </uv-cell>
  44. </view>
  45. <view class="content">
  46. <view class="title">
  47. 详情
  48. </view>
  49. <uv-parse :content="productDetail.content"></uv-parse>
  50. </view>
  51. <!-- 分享和租赁按钮 -->
  52. <submit
  53. :detail="productDetail"
  54. @collect="addCollection"
  55. @submit="$refs.submitUnitSelect.open()" @share="share" />
  56. <!-- 选择规格 -->
  57. <submitUnitSelect ref="submitUnitSelect" :detail="productDetail"/>
  58. </view>
  59. </template>
  60. <script>
  61. import submit from '../components/product/submit.vue'
  62. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  63. export default {
  64. components: {
  65. submit,
  66. submitUnitSelect
  67. },
  68. data() {
  69. return {
  70. productDetail: {},
  71. productId : 0,
  72. }
  73. },
  74. onLoad(args) {
  75. this.productId = args.id
  76. },
  77. onShow() {
  78. this.getData()
  79. },
  80. onPullDownRefresh() {
  81. this.getData()
  82. },
  83. onShareAppMessage(res) {
  84. return {
  85. title: this.productDetail.waresTitle,
  86. path: '/pages_order/product/productDetail?id=' + this.id
  87. }
  88. },
  89. methods: {
  90. // 分享商品
  91. share() {
  92. },
  93. // 选择完成规格立即租赁下单
  94. submit() {
  95. },
  96. getData() {
  97. this.$api('queryWaresById', {
  98. waresId: this.productId
  99. },
  100. res => {
  101. uni.stopPullDownRefresh()
  102. if (res.code == 200) {
  103. this.productDetail = res.result
  104. }
  105. })
  106. },
  107. // 添加收藏
  108. addCollection(){
  109. this.$api('addCollection', {
  110. itemId : this.productDetail.id,
  111. collectionType : 6,
  112. }, res => {
  113. if(res.code == 200){
  114. this.getData()
  115. uni.showToast({
  116. title: res.message,
  117. icon:'none'
  118. })
  119. }
  120. })
  121. },
  122. }
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .page {
  127. .swipe {}
  128. .info {
  129. padding: 30rpx;
  130. background-color: #fff;
  131. .title {
  132. font-size: 34rpx;
  133. font-weight: 900;
  134. }
  135. .info-line {
  136. display: flex;
  137. justify-content: space-between;
  138. align-items: center;
  139. margin-top: 30rpx;
  140. .price {
  141. font-size: 28rpx;
  142. color: $uni-color;
  143. text {
  144. font-size: 34rpx;
  145. }
  146. }
  147. .num {
  148. font-size: 24rpx;
  149. image {
  150. width: 24rpx;
  151. height: 24rpx;
  152. }
  153. }
  154. }
  155. .tips {
  156. display: flex;
  157. font-size: 20rpx;
  158. margin-top: 30rpx;
  159. .tip {
  160. margin-right: 40rpx;
  161. }
  162. }
  163. }
  164. .info-unit {
  165. margin-top: 20rpx;
  166. padding: 30rpx;
  167. background-color: #fff;
  168. /deep/ text {
  169. font-size: 26rpx;
  170. }
  171. /deep/ .text {
  172. color: #7C7C7C;
  173. margin-right: 20rpx;
  174. font-size: 26rpx;
  175. }
  176. }
  177. .content {
  178. background-color: #fff;
  179. margin-top: 20rpx;
  180. .title {
  181. padding: 30rpx;
  182. }
  183. }
  184. }
  185. </style>