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.

268 lines
6.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <view class="app">
  3. <view class="menu-item">
  4. <text class="menu-txt" @click="toStoreProduct">云仓备货</text>
  5. <text class="menu-txt" style="border-left-width: 0rpx;">云仓提货</text>
  6. </view>
  7. <swiper class="swiper" indicator-active-color="white" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
  8. <swiper-item v-for="(item,index) in swipeImgs" :key=index>
  9. <view class="swiper-item uni-bg-red">
  10. <image class="swiper-img swiper-img-tt" :src="item"></image>
  11. </view>
  12. </swiper-item>
  13. <!-- <swiper-item>
  14. <view class="swiper-item uni-bg-green">
  15. <image class="swiper-img" src="/static/shop/rem.jpg"></image>
  16. </view>
  17. </swiper-item>
  18. <swiper-item>
  19. <view class="swiper-item uni-bg-blue">
  20. <image class="swiper-img" src="/static/shop/b7f2be6053cc88b4.jpg"></image>
  21. </view>
  22. </swiper-item> -->
  23. </swiper>
  24. <view class="product-section">
  25. <text class="prduct-title">轻未来超纤维阻燃粉轻未来超纤维阻燃粉轻未来超纤维阻燃粉</text>
  26. <view class="product-des">
  27. <view class="product-price">
  28. <text class="product-price-sale">5999</text>
  29. <text class="product-price-show">6999</text>
  30. </view>
  31. <text class="product-number">库存2000</text>
  32. </view>
  33. </view>
  34. <view class="separator-section"></view>
  35. <view class="product-detail">
  36. <text class="product-detail-title">产品描述</text>
  37. <view class="product-detail-wrap">
  38. <text class="product-detail-txt">理想是未来事物的美好想象和希望也比喻对某事物榛于最完善境界的观念是人们在实践过程中形成的有实现可能性的对未来社会和自身发展的向往和追求价值观是基于人的一定的思维感官之上而作出的认知理解判断或抉择也就是认定事物判定是非的一种思维或取向本产本具有良好疗效</text>
  39. </view>
  40. <image class="product-detail-img" src="/static/shop/677088217d8a00aa.jpg"></image>
  41. </view>
  42. <!-- <view class="shop-list">
  43. <view class="shop-item">
  44. <view class="shop-item-left">
  45. <text class="shop-item-left-title">通知 | 关于轻未来超轻维阻燃粉外包装升级通知</text>
  46. <text class="shop-item-left-time">2021年4月23日</text>
  47. </view>
  48. <image src="/static/shop/677088217d8a00aa.jpg" class="shop-item-img">
  49. </image>
  50. </view>
  51. <view class="shop-item">
  52. <view class="shop-item-left">
  53. <text class="shop-item-left-title">通知 | 关于轻未来超轻维阻燃粉外包装升级通知</text>
  54. <text class="shop-item-left-time">2021年4月23日</text>
  55. </view>
  56. <image src="/static/shop/677088217d8a00aa.jpg" class="shop-item-img">
  57. </image>
  58. </view>
  59. <view class="shop-item">
  60. <view class="shop-item-left">
  61. <text class="shop-item-left-title">通知 | 关于轻未来超轻维阻燃粉外包装升级通知</text>
  62. <text class="shop-item-left-time">2021年4月23日</text>
  63. </view>
  64. <image src="/static/shop/677088217d8a00aa.jpg" class="shop-item-img">
  65. </image>
  66. </view>
  67. </view> -->
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. components: {
  73. },
  74. data() {
  75. return {
  76. navList: [],//导航列表
  77. advertList: [],//广告列表
  78. hotList: [],//热门推荐
  79. indicatorDots: true,
  80. autoplay: true,
  81. interval: 2000,
  82. duration: 500,
  83. swipeImgs:['/static/shop/677088217d8a00aa.jpg','/static/shop/rem.jpg','/static/shop/b7f2be6053cc88b4.jpg']
  84. }
  85. },
  86. computed: {
  87. changeIndicatorDots(e) {
  88. this.indicatorDots = !this.indicatorDots
  89. },
  90. changeAutoplay(e) {
  91. this.autoplay = !this.autoplay
  92. },
  93. intervalChange(e) {
  94. this.interval = e.target.value
  95. },
  96. durationChange(e) {
  97. this.duration = e.target.value
  98. },
  99. midAdvert(){
  100. if(this.advertList.length === 0) return {};
  101. const res = this.advertList.filter(item=> item.advert_type === 'middle');
  102. return res.length > 0 ? res[0]: {};
  103. },
  104. carousel(){
  105. return this.advertList.filter(item=> item.advert_type === 'carousel');
  106. }
  107. },
  108. onLoad() {
  109. this.loadAdvert();
  110. this.loadNavList();
  111. setTimeout(()=>{
  112. //this.navTo('/pages/address/list')
  113. }, 1000)
  114. },
  115. methods: {
  116. toStoreProduct(){
  117. this.navTo(`/pages/yunProduct/storeProduct`)
  118. },
  119. //加载广告 缓存10分钟
  120. async loadAdvert(){
  121. const res = await this.$request('advert', 'getAdvertList', {}, {
  122. cache: 10*60
  123. });
  124. this.advertList = res.data;
  125. this.log(res);
  126. },
  127. //加载导航 缓存1小时
  128. async loadNavList(){
  129. const res = await this.$request('advert', 'getNavList', {}, {
  130. cache: 60*60*0,
  131. });
  132. this.navList = res.data;
  133. },
  134. }
  135. }
  136. </script>
  137. <style>
  138. page{
  139. background-color: white;
  140. }
  141. </style>
  142. <style scoped lang="scss">
  143. /* 分类 */
  144. .swiper{
  145. height: 750rpx;
  146. }
  147. .swiper-item{
  148. }
  149. .swiper-img{
  150. width: 100%;
  151. height: 750rpx;
  152. }
  153. .menu-item{
  154. display: flex;
  155. flex-direction: row;
  156. align-items: center;
  157. background-color: white;
  158. }
  159. .menu-txt{
  160. height: 90rpx;
  161. line-height: 90rpx;
  162. text-align: center;
  163. flex: 1;
  164. font-size: 18px;
  165. font-weight: 500;
  166. color: #EDAF8B;
  167. border: 1px solid #EDAF8B;
  168. }
  169. .product-section{
  170. margin: 36rpx 64rpx 30rpx 40rpx;
  171. }
  172. .prduct-title{
  173. font-size: 18px;
  174. font-weight: bold;
  175. color: #333333;
  176. line-height: 50rpx;
  177. // line-height: 48px;
  178. }
  179. .product-des{
  180. margin: 30rpx 0rpx;
  181. display: flex;
  182. flex-direction: row;
  183. justify-content: space-between;
  184. align-items: flex-end;
  185. }
  186. .product-price-sale{
  187. font-size: 28px;
  188. font-weight: bold;
  189. color: #EDAF8B;
  190. }
  191. .product-price-show{
  192. font-size: 13px;
  193. font-weight: 500;
  194. text-decoration: line-through;
  195. color: #999999;
  196. }
  197. .product-number{
  198. font-size: 13px;
  199. font-weight: 500;
  200. color: #999999;
  201. }
  202. .separator-section{
  203. background-color: $separatorColor;
  204. height: 20rpx;
  205. }
  206. .product-detail{
  207. margin: 60rpx 40rpx 10rpx;
  208. }
  209. .product-detail-title{
  210. display: block;
  211. font-size: 18px;
  212. font-weight: bold;
  213. color: #333333;
  214. }
  215. .product-detail-wrap{
  216. margin: 30rpx 0rpx;
  217. }
  218. .product-detail-txt{
  219. line-height: 30rpx;
  220. font-size: 13px;
  221. // font-weight: 500;
  222. color: #999999;
  223. }
  224. .product-detail-img{
  225. width: 100%;
  226. height: 600rpx;
  227. border-radius: 10rpx;
  228. }
  229. </style>