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

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