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

264 lines
4.8 KiB

1 year ago
8 months ago
1 year ago
8 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
8 months ago
1 year ago
11 months ago
8 months ago
1 year ago
8 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months 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. :pay="pay"
  83. @submit="handleSubmit"
  84. @share="share"/>
  85. <!-- 选择规格 -->
  86. <submitUnitSelect ref="submitUnitSelect"
  87. v-if="detail.id"
  88. :detail="detail"/>
  89. </view>
  90. </template>
  91. <script>
  92. import submit from '../components/product/submit.vue'
  93. import submitUnitSelect from '../components/product/submitUnitSelect.vue'
  94. import productMixins from '@/mixins/product.js'
  95. export default {
  96. mixins : [productMixins],
  97. components : {
  98. submit,
  99. submitUnitSelect,
  100. },
  101. data() {
  102. return {
  103. detail : {},
  104. id : 0,
  105. pay : 'N',
  106. }
  107. },
  108. onLoad(args) {
  109. this.id = args.id
  110. this.pay = args.pay
  111. this.getData()
  112. // 设置分享路径
  113. this.share.path = '/pages_order/product/productDetail?id=' + this.id
  114. },
  115. onPullDownRefresh() {
  116. this.getData()
  117. },
  118. methods: {
  119. // 分享商品
  120. share(){
  121. },
  122. // 选择完成规格立即租赁下单
  123. submit(){
  124. },
  125. handleSubmit(){
  126. this.$refs.submitUnitSelect.open()
  127. // uni.showModal({
  128. // title: '您有自己的桌布吗?',
  129. // cancelText: '我没有',
  130. // confirmText: '我有',
  131. // success(r) {
  132. // if(r.confirm){
  133. // }else{
  134. // }
  135. // }
  136. // })
  137. },
  138. getData(){
  139. this.$api('getShopPingDetail', {
  140. id : this.id
  141. }, res => {
  142. uni.stopPullDownRefresh()
  143. if(res.code == 200){
  144. this.detail = res.result
  145. // 设置分享信息
  146. this.share.title = res.result.name
  147. this.share.imageUrl = this.$utils.getImageOne(res.result.image)
  148. }
  149. })
  150. },
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .page{
  156. padding-bottom: 100rpx;
  157. .swipe{
  158. }
  159. .info{
  160. padding: 30rpx;
  161. background-color: #fff;
  162. .title{
  163. font-size: 34rpx;
  164. font-weight: 900;
  165. }
  166. .nameSub{
  167. font-size: 30rpx;
  168. margin-top: 10rpx;
  169. }
  170. .info-line{
  171. display: flex;
  172. justify-content: space-between;
  173. align-items: center;
  174. margin-top: 20rpx;
  175. .price{
  176. font-size: 28rpx;
  177. color: $uni-price-color;
  178. text{
  179. font-size: 34rpx;
  180. }
  181. }
  182. .oldPrice{
  183. margin: 0 auto 0 10rpx;
  184. font-size: 24rpx;
  185. color: #888;
  186. font-weight: 500;
  187. text-decoration : line-through;
  188. }
  189. .num{
  190. font-size: 24rpx;
  191. image{
  192. width: 24rpx;
  193. height: 24rpx;
  194. }
  195. }
  196. }
  197. .favorable{
  198. display: flex;
  199. // background-image: url(/static/image/product/favorable.png);
  200. background-size: 100% 100%;
  201. width: fit-content;
  202. font-size: 22rpx;
  203. margin-top: 6rpx;
  204. border-radius: 10rpx;
  205. overflow: hidden;
  206. background-color: #ff000011;
  207. .t{
  208. padding: 5rpx 10rpx;
  209. }
  210. .p{
  211. padding: 5rpx 10rpx;
  212. color: #fff;
  213. background-color: #F03F25;
  214. height: 100%;
  215. }
  216. }
  217. .tips{
  218. display: flex;
  219. font-size: 20rpx;
  220. margin-top: 30rpx;
  221. .tip{
  222. margin-right: 40rpx;
  223. }
  224. }
  225. }
  226. .info-unit{
  227. margin-top: 20rpx;
  228. padding: 30rpx;
  229. background-color: #fff;
  230. /deep/ text{
  231. font-size: 26rpx;
  232. }
  233. /deep/ .text{
  234. color: #7C7C7C;
  235. margin-right: 20rpx;
  236. font-size: 26rpx;
  237. }
  238. }
  239. .content{
  240. background-color: #fff;
  241. margin-top: 20rpx;
  242. .title{
  243. padding: 30rpx;
  244. }
  245. }
  246. }
  247. </style>