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

217 lines
3.9 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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. :collectonFlag="collectonFlag"
  55. @collect="addCollection"
  56. @submit="$refs.submitUnitSelect.open()" @share="share" />
  57. <!-- 选择规格 -->
  58. <submitUnitSelect ref="submitUnitSelect" :detail="productDetail"/>
  59. </view>
  60. </template>
  61. <script>
  62. import submit from '../components/product/submit.vue'
  63. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  64. export default {
  65. components: {
  66. submit,
  67. submitUnitSelect
  68. },
  69. data() {
  70. return {
  71. productDetail: {},
  72. productId : 0,
  73. collectonFlag : false,
  74. }
  75. },
  76. onLoad(args) {
  77. this.productId = args.id
  78. },
  79. onShow() {
  80. this.getData()
  81. },
  82. onPullDownRefresh() {
  83. this.getData()
  84. },
  85. onShareAppMessage(res) {
  86. return {
  87. title: this.productDetail.waresTitle,
  88. path: '/pages_order/product/productDetail?id=' + this.id
  89. }
  90. },
  91. methods: {
  92. // 分享商品
  93. share() {
  94. },
  95. // 选择完成规格立即租赁下单
  96. submit() {
  97. },
  98. getData() {
  99. let data = {
  100. waresId: this.productId
  101. }
  102. if(uni.getStorageSync('token')){
  103. data.token = uni.getStorageSync('token')
  104. }
  105. this.$api('queryWaresById', data,
  106. res => {
  107. uni.stopPullDownRefresh()
  108. if (res.code == 200) {
  109. this.productDetail = res.result.travelWares
  110. this.collectonFlag = res.result.collectonFlag
  111. }
  112. })
  113. },
  114. // 添加收藏
  115. addCollection(){
  116. this.$api('addCollection', {
  117. itemId : this.productDetail.id,
  118. collectionType : 6,
  119. }, res => {
  120. if(res.code == 200){
  121. this.getData()
  122. uni.showToast({
  123. title: res.message,
  124. icon:'none'
  125. })
  126. }
  127. })
  128. },
  129. }
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. .page {
  134. .swipe {}
  135. .info {
  136. padding: 30rpx;
  137. background-color: #fff;
  138. .title {
  139. font-size: 34rpx;
  140. font-weight: 900;
  141. }
  142. .info-line {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. margin-top: 30rpx;
  147. .price {
  148. font-size: 28rpx;
  149. color: $uni-color;
  150. text {
  151. font-size: 34rpx;
  152. }
  153. }
  154. .num {
  155. font-size: 24rpx;
  156. image {
  157. width: 24rpx;
  158. height: 24rpx;
  159. }
  160. }
  161. }
  162. .tips {
  163. display: flex;
  164. font-size: 20rpx;
  165. margin-top: 30rpx;
  166. .tip {
  167. margin-right: 40rpx;
  168. }
  169. }
  170. }
  171. .info-unit {
  172. margin-top: 20rpx;
  173. padding: 30rpx;
  174. background-color: #fff;
  175. /deep/ text {
  176. font-size: 26rpx;
  177. }
  178. /deep/ .text {
  179. color: #7C7C7C;
  180. margin-right: 20rpx;
  181. font-size: 26rpx;
  182. }
  183. }
  184. .content {
  185. background-color: #fff;
  186. margin-top: 20rpx;
  187. .title {
  188. padding: 30rpx;
  189. }
  190. }
  191. }
  192. </style>