detail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <scroll-view scroll-y="true" class="scroll-view">
  6. <view class="list-scroll-view">
  7. <view class="one_1">
  8. </view>
  9. <view class="one_2">
  10. <text class="money_1" v-if="infospecs.leader_price"><text>团长价¥</text>{{infospecs.leader_price||0}}</text>
  11. <text class="money" v-if="infospecs.price"><text>特价¥</text>{{infospecs.price||0}}</text>
  12. <text class="money" v-if="!infospecs.price&&!infospecs.leader_price"><text>¥</text>{{infospecs.sell_money||0}}</text>
  13. <text class="money"><text>¥</text>{{infospecs.flow_money||0}}</text>
  14. </view>
  15. <view class="one_3" v-if="discount">
  16. <text v-if="discount.full_decrement&&discount.full_decrement.length>0" class="act" v-for="(item,index) in discount.full_decrement" :key="index">{{item}}</text>
  17. <text v-if="discount.full_fold&&discount.full_decrement.length>0" class="act" v-for="(item,index) in discount.full_fold" :key="index">{{item}}</text>
  18. </view>
  19. <view class="one_4">
  20. <text class="num">已售{{info.goods.sell_num||0}}件</text>
  21. </view>
  22. <view class="one_5">
  23. 5
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. <view class="two">
  29. <uni-goods-nav :options="options" :button-group="buttonGroup" @click="toNavleft" @buttonClick="toNavright" />
  30. </view>
  31. </view>
  32. </mobile-frame>
  33. </template>
  34. <script>
  35. export default {
  36. components: {},
  37. data() {
  38. return {
  39. // 底部菜单
  40. options: [{
  41. icon: 'shop',
  42. text: '店铺',
  43. type: 'shop',
  44. route: 'pagesHome/shop/index',
  45. },
  46. {
  47. icon: 'cart',
  48. text: '购物车',
  49. type: 'market',
  50. route: 'pages/market/index',
  51. },
  52. ],
  53. buttonGroup: [{
  54. text: '加入购物车',
  55. backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
  56. color: '#fff',
  57. type: '0'
  58. },
  59. {
  60. text: '立即购买',
  61. backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
  62. color: '#fff',
  63. type: '1'
  64. }
  65. ],
  66. // one_2
  67. // 商品价格
  68. infospecs: {},
  69. // one_3
  70. discount: {
  71. full_decrement: [
  72. '测试一'
  73. ]
  74. }
  75. };
  76. },
  77. onLoad: function(e) {
  78. },
  79. onShow: function() {
  80. },
  81. onUnload: function() {
  82. },
  83. methods: {
  84. // 店铺,购物车
  85. toNavleft(e) {
  86. const that = this;
  87. if (e.content.type == 'shop') {
  88. that.toShop();
  89. } else if (e.content.type == 'market') {
  90. let obj = {
  91. route: e.content.route
  92. }
  93. that.toPath(obj)
  94. }
  95. },
  96. // 加入购物车,立即购买
  97. toNavright(e) {
  98. const that = this;
  99. that.$set(that, `popupShow`, '1');
  100. that.$set(that, `btn_type`, e.content.type);
  101. that.$refs.specShow.open();
  102. },
  103. },
  104. }
  105. </script>
  106. <style lang="scss">
  107. .main {
  108. display: flex;
  109. flex-direction: column;
  110. width: 100vw;
  111. height: 100vh;
  112. .one {
  113. position: relative;
  114. flex-grow: 1;
  115. .one_2 {
  116. border-bottom: 0.5vw solid var(--f9Color);
  117. padding: 2vw;
  118. .money_1 {
  119. color: #23B67A;
  120. font-size: 20px;
  121. padding: 0 1vw 0 0;
  122. font-weight: bold;
  123. text {
  124. font-size: 14px;
  125. }
  126. }
  127. .money {
  128. font-size: 20px;
  129. padding: 0 1vw 0 0;
  130. color: #ff0000;
  131. font-weight: bold;
  132. text {
  133. font-size: 14px;
  134. }
  135. }
  136. .money:last-child {
  137. font-size: 16px;
  138. color: #858585;
  139. text-decoration: line-through;
  140. }
  141. }
  142. .one_3 {
  143. display: flex;
  144. flex-wrap: wrap;
  145. padding: 1vw;
  146. border-bottom: 0.5vw solid var(--f9Color);
  147. .act {
  148. font-size: 12px;
  149. border: 1px solid var(--fFB1Color);
  150. margin: 0 1vw 1vw 0;
  151. color: var(--fFB1Color);
  152. border-radius: 6px;
  153. padding: 0 1vw;
  154. }
  155. .num {
  156. font-size: 12px;
  157. color: #858585;
  158. }
  159. }
  160. .one_4 {
  161. display: flex;
  162. flex-wrap: wrap;
  163. padding: 1vw;
  164. border-bottom: 0.5vw solid var(--f9Color);
  165. .num {
  166. font-size: 12px;
  167. color: #858585;
  168. }
  169. }
  170. }
  171. .two {
  172. width: 100vw;
  173. height: 8vh;
  174. overflow: hidden;
  175. }
  176. }
  177. .scroll-view {
  178. position: absolute;
  179. top: 0;
  180. left: 0;
  181. right: 0;
  182. bottom: 0;
  183. .list-scroll-view {
  184. display: flex;
  185. flex-direction: column;
  186. }
  187. }
  188. </style>