瑶都万能墙
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.

261 lines
4.8 KiB

1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="page">
  3. <!-- <navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" /> -->
  4. <view class="swipe">
  5. <uv-swiper
  6. :list="detail.image && detail.image.split(',')"
  7. indicator
  8. height="550rpx"></uv-swiper>
  9. </view>
  10. <view class="info">
  11. <view class="title">
  12. {{ detail.name }}
  13. </view>
  14. <view class="nameSub">
  15. {{ detail.nameSub }}
  16. </view>
  17. <view class="info-line">
  18. <view class="price"
  19. v-if="isProductPrice(detail)">
  20. 现价<text>
  21. {{
  22. detail.price
  23. }}
  24. </text>
  25. </view>
  26. <view class="oldPrice"
  27. v-if="isProductPrice(detail)">
  28. 原价<text>
  29. {{
  30. detail.oldPrice
  31. }}
  32. </text>
  33. </view>
  34. <!-- <view class="num">
  35. 已售{{ detail.soldNum || 0 }}+
  36. <image src="../static/product/like.png" mode=""></image>
  37. </view> -->
  38. </view>
  39. <view class="favorable" v-if="detail.points
  40. && isProductPoint(detail)">
  41. <view class="t">
  42. 积分兑换
  43. </view>
  44. <view class="p">
  45. {{ detail.points }}
  46. </view>
  47. </view>
  48. <!-- <view class="tips">
  49. <view class="tip">
  50. 专业设备
  51. </view>
  52. <view class="tip">
  53. 科学流程
  54. </view>
  55. <view class="tip">
  56. 质量保证
  57. </view>
  58. </view> -->
  59. </view>
  60. <!-- <view class="info-unit">
  61. <uv-cell>
  62. <template #icon>
  63. <text>{{ detail.nameSub }}</text>
  64. <text>上门取件·送货上门</text>
  65. </template>
  66. </uv-cell>
  67. </view> -->
  68. <view class="content">
  69. <view class="title">
  70. 商品详情
  71. </view>
  72. <image
  73. v-for="(item,index) in detail.imageDetails && detail.imageDetails.split(',')"
  74. :src="item"
  75. :key="index"
  76. style="width: 100%;"
  77. mode="widthFix"></image>
  78. </view>
  79. <!-- 分享和租赁按钮 -->
  80. <submit
  81. :detail="detail"
  82. @submit="handleSubmit"
  83. @share="share"/>
  84. <!-- 选择规格 -->
  85. <submitUnitSelect ref="submitUnitSelect"
  86. v-if="detail.id"
  87. :detail="detail"/>
  88. </view>
  89. </template>
  90. <script>
  91. import submit from '../components/product/submit.vue'
  92. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  93. import productMixins from '@/mixins/product.js'
  94. export default {
  95. mixins : [productMixins],
  96. components : {
  97. submit,
  98. submitUnitSelect,
  99. },
  100. data() {
  101. return {
  102. detail : {},
  103. id : 0,
  104. }
  105. },
  106. onLoad(args) {
  107. this.id = args.id
  108. this.getData()
  109. // 设置分享路径
  110. this.share.path = '/pages_order/product/productDetail?id=' + this.id
  111. },
  112. onPullDownRefresh() {
  113. this.getData()
  114. },
  115. methods: {
  116. // 分享商品
  117. share(){
  118. },
  119. // 选择完成规格立即租赁下单
  120. submit(){
  121. },
  122. handleSubmit(){
  123. this.$refs.submitUnitSelect.open()
  124. // uni.showModal({
  125. // title: '您有自己的桌布吗?',
  126. // cancelText: '我没有',
  127. // confirmText: '我有',
  128. // success(r) {
  129. // if(r.confirm){
  130. // }else{
  131. // }
  132. // }
  133. // })
  134. },
  135. getData(){
  136. this.$api('getShopPingDetail', {
  137. id : this.id
  138. }, res => {
  139. uni.stopPullDownRefresh()
  140. if(res.code == 200){
  141. this.detail = res.result
  142. // 设置分享信息
  143. this.share.title = res.result.name
  144. this.share.imageUrl = this.$utils.getImageOne(res.result.image)
  145. }
  146. })
  147. },
  148. }
  149. }
  150. </script>
  151. <style scoped lang="scss">
  152. .page{
  153. padding-bottom: 100rpx;
  154. .swipe{
  155. }
  156. .info{
  157. padding: 30rpx;
  158. background-color: #fff;
  159. .title{
  160. font-size: 34rpx;
  161. font-weight: 900;
  162. }
  163. .nameSub{
  164. font-size: 30rpx;
  165. margin-top: 10rpx;
  166. }
  167. .info-line{
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. margin-top: 20rpx;
  172. .price{
  173. font-size: 28rpx;
  174. color: $uni-price-color;
  175. text{
  176. font-size: 34rpx;
  177. }
  178. }
  179. .oldPrice{
  180. margin: 0 auto 0 10rpx;
  181. font-size: 24rpx;
  182. color: #888;
  183. font-weight: 500;
  184. text-decoration : line-through;
  185. }
  186. .num{
  187. font-size: 24rpx;
  188. image{
  189. width: 24rpx;
  190. height: 24rpx;
  191. }
  192. }
  193. }
  194. .favorable{
  195. display: flex;
  196. // background-image: url(/static/image/product/favorable.png);
  197. background-size: 100% 100%;
  198. width: fit-content;
  199. font-size: 22rpx;
  200. margin-top: 6rpx;
  201. border-radius: 10rpx;
  202. overflow: hidden;
  203. background-color: #ff000011;
  204. .t{
  205. padding: 5rpx 10rpx;
  206. }
  207. .p{
  208. padding: 5rpx 10rpx;
  209. color: #fff;
  210. background-color: #F03F25;
  211. height: 100%;
  212. }
  213. }
  214. .tips{
  215. display: flex;
  216. font-size: 20rpx;
  217. margin-top: 30rpx;
  218. .tip{
  219. margin-right: 40rpx;
  220. }
  221. }
  222. }
  223. .info-unit{
  224. margin-top: 20rpx;
  225. padding: 30rpx;
  226. background-color: #fff;
  227. /deep/ text{
  228. font-size: 26rpx;
  229. }
  230. /deep/ .text{
  231. color: #7C7C7C;
  232. margin-right: 20rpx;
  233. font-size: 26rpx;
  234. }
  235. }
  236. .content{
  237. background-color: #fff;
  238. margin-top: 20rpx;
  239. .title{
  240. padding: 30rpx;
  241. }
  242. }
  243. }
  244. </style>