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

207 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
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
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. onShareAppMessage(res) {
  81. return {
  82. title: this.productDetail.waresTitle,
  83. path: '/pages_order/product/productDetail?id=' + this.id
  84. }
  85. },
  86. methods: {
  87. // 分享商品
  88. share() {
  89. },
  90. // 选择完成规格立即租赁下单
  91. submit() {
  92. },
  93. getData() {
  94. this.$api('queryWaresById', {
  95. waresId: this.productId
  96. },
  97. res => {
  98. if (res.code == 200) {
  99. console.log(res);
  100. this.productDetail = res.result
  101. }
  102. })
  103. },
  104. // 添加收藏
  105. addCollection(){
  106. this.$api('addCollection', {
  107. itemId : this.productDetail.id,
  108. collectionType : 6,
  109. }, res => {
  110. if(res.code == 200){
  111. this.getData()
  112. uni.showToast({
  113. title: res.message,
  114. icon:'none'
  115. })
  116. }
  117. })
  118. },
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .page {
  124. .swipe {}
  125. .info {
  126. padding: 30rpx;
  127. background-color: #fff;
  128. .title {
  129. font-size: 34rpx;
  130. font-weight: 900;
  131. }
  132. .info-line {
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. margin-top: 30rpx;
  137. .price {
  138. font-size: 28rpx;
  139. color: $uni-color;
  140. text {
  141. font-size: 34rpx;
  142. }
  143. }
  144. .num {
  145. font-size: 24rpx;
  146. image {
  147. width: 24rpx;
  148. height: 24rpx;
  149. }
  150. }
  151. }
  152. .tips {
  153. display: flex;
  154. font-size: 20rpx;
  155. margin-top: 30rpx;
  156. .tip {
  157. margin-right: 40rpx;
  158. }
  159. }
  160. }
  161. .info-unit {
  162. margin-top: 20rpx;
  163. padding: 30rpx;
  164. background-color: #fff;
  165. /deep/ text {
  166. font-size: 26rpx;
  167. }
  168. /deep/ .text {
  169. color: #7C7C7C;
  170. margin-right: 20rpx;
  171. font-size: 26rpx;
  172. }
  173. }
  174. .content {
  175. background-color: #fff;
  176. margin-top: 20rpx;
  177. .title {
  178. padding: 30rpx;
  179. }
  180. }
  181. }
  182. </style>