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

240 lines
4.2 KiB

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