index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="content">
  3. <view class="store-header">
  4. <view class="home-store">
  5. <view class="store-logo"><image src="/static/logo.jpg"></image></view>
  6. <view class="store-info">
  7. <view class="name">桃奢妍商业广场</view>
  8. <view class="desc">广东省/广州市/增城区</view>
  9. </view>
  10. <view class="store-kf" @click="kfPop">联系客服</view>
  11. </view>
  12. <view class="store-address">
  13. <view class="address-info">
  14. <image src="/static/image/location.svg"></image>
  15. <view class="address">天乐社区服务中心蜀山新产业园区海亮九玺海亮九玺南区</view>
  16. </view>
  17. <view class="store-time">营业 08:00–22:30</view>
  18. </view>
  19. </view>
  20. <scroll-view class="home-goods" scroll-y scroll-with-animation>
  21. <view class="goods-title">
  22. <view class="title-left">
  23. <text>HOT DEALS</text>
  24. <view class="name">正在抢购</view>
  25. </view>
  26. <view class="title-more">全部商品 <image src="/static/image/right.svg"></image> </view>
  27. </view>
  28. <view class="goods-list">
  29. <view class="list-item" v-for="(item,index) in 10" :key="index" @click="toDetail(index)">
  30. <view class="image">
  31. <image src="https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260727/2e9fd491e2def96b0dd0677f43d7a31913cf959e.png"></image>
  32. <text>2.7折</text>
  33. </view>
  34. <view class="info">
  35. <view class="title">赫莲娜/HR黑绷带50ml小露珠200ml两件套 线下兑换券</view>
  36. <view class="tags"></view>
  37. <view class="tags">已售0</view>
  38. <view class="price-btn">
  39. <view class="price">¥799.00</view>
  40. <view class="price-line">¥2,999.00</view>
  41. <view class="buy-btn">立即抢购</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </scroll-view>
  47. <halfLogin ref="loginCom"></halfLogin>
  48. <kfService ref="kfService"></kfService>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. title: 'Hello'
  56. }
  57. },
  58. onLoad() {
  59. },
  60. methods: {
  61. test(){
  62. this.$refs.loginCom.open();
  63. },
  64. toDetail(id){
  65. const isLogin = uni.getStorageSync("user_token");
  66. if (!isLogin) {
  67. this.$refs.loginCom.open();
  68. return ;
  69. }
  70. uni.navigateTo({
  71. url:`/pages/goods/detail?id=${id}`
  72. })
  73. },
  74. kfPop(){
  75. this.$refs.kfService.open();
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .content{
  82. position: fixed;
  83. z-index: 1;
  84. top: 0;
  85. left: 0;
  86. bottom: 0;
  87. right: 0;
  88. background-color: #ededed;
  89. display: flex;
  90. flex-direction: column;
  91. }
  92. .home-store{
  93. background-color: $main-color;
  94. padding: 20rpx;
  95. display: flex;
  96. align-items: center;
  97. gap: 20rpx;
  98. image {
  99. width: 92rpx;
  100. height: 92rpx;
  101. border: 2rpx solid #fff;
  102. border-radius: 20rpx;
  103. }
  104. .store-info{
  105. flex: 1;
  106. .name {
  107. color: #fff;
  108. font-weight: bold;
  109. font-size: 32rpx;
  110. }
  111. .desc {
  112. color: $main-sub-color;
  113. font-size: 28rpx;
  114. margin-top: 10rpx;
  115. }
  116. }
  117. .store-kf{
  118. background-color: #fff;
  119. color: $main-color;
  120. font-size: 24rpx;
  121. padding: 20rpx 30rpx;
  122. border-radius: 40rpx;
  123. }
  124. }
  125. .store-address {
  126. display: flex;
  127. align-self: center;
  128. width: calc(100% - 40rpx);
  129. margin: 0 auto;
  130. box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05);
  131. background-color: #fff;
  132. border-bottom-right-radius:20rpx;
  133. border-bottom-left-radius:20rpx;
  134. padding: 20rpx 20rpx;
  135. gap: 20rpx;
  136. color: #475569;
  137. .address-info {
  138. flex: 1 1 0%;
  139. display: flex;
  140. align-items: center;
  141. gap: 10rpx;
  142. overflow: hidden;
  143. image {
  144. width: 40rpx;
  145. height: 40rpx;
  146. }
  147. .address{
  148. flex: 1;
  149. overflow: hidden;
  150. text-overflow: ellipsis;
  151. white-space: nowrap;
  152. }
  153. }
  154. .store-time{
  155. color: #94a3b8;
  156. }
  157. }
  158. .home-goods{
  159. height: 0;
  160. flex: 1;
  161. width: 95%;
  162. margin: 20rpx auto;
  163. .list-item{
  164. display: flex;
  165. align-items: center;
  166. gap: 20rpx;
  167. background-color: #fff;
  168. padding: 20rpx;
  169. margin-top: 20rpx;
  170. border-radius: 20rpx;
  171. .info{
  172. flex: 1 1 0%;
  173. overflow: hidden;
  174. .title{
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. font-size: 32rpx;
  179. color: #333;
  180. font-weight: 900;
  181. }
  182. .tags {
  183. color: #94a3b8;
  184. font-size: 24rpx;
  185. margin: 10rpx 0;
  186. }
  187. .price-btn{
  188. display: flex;
  189. align-items: center;
  190. gap: 20rpx;
  191. align-items: flex-end;
  192. .price{
  193. font-size: 30rpx;
  194. color: $main-color;
  195. font-weight: 900;
  196. }
  197. .price-line {
  198. color: #999999;font-size: 24rpx;text-decoration-line: line-through;
  199. }
  200. .buy-btn{
  201. margin-left: auto;
  202. margin-right: 0;
  203. background-color: $main-color;
  204. color: #fff;
  205. border-radius: 30rpx;
  206. font-size: 28rpx;
  207. padding: 10rpx 20rpx;
  208. }
  209. }
  210. }
  211. .image {
  212. height: 180rpx;
  213. overflow: hidden;display: flex;align-items: center;min-width: 180rpx;
  214. position: relative;
  215. text {
  216. background-color: $main-color;
  217. color: #fff;
  218. position: absolute;
  219. top: 10rpx;
  220. left: 10rpx;
  221. font-size: 24rpx;
  222. border-radius: 30rpx;
  223. padding: 10rpx 15rpx;
  224. }
  225. image {
  226. width: 180rpx;
  227. border-radius: 10upx;
  228. height: 100%;
  229. }
  230. }
  231. }
  232. .goods-title{
  233. display: flex;
  234. align-items: center;
  235. justify-content: space-between;
  236. .title-left{
  237. .name {
  238. font-size: 34rpx;
  239. color: #333;
  240. font-weight: 900;
  241. }
  242. text {
  243. color: $main-color;
  244. font-weight: 700;
  245. font-size: 24rpx;
  246. }
  247. }
  248. .title-more{
  249. display: flex;
  250. align-items: center;
  251. color: #94a3b8;
  252. font-size: 28rpx;
  253. image {
  254. width: 28rpx;
  255. height: 28rpx;
  256. }
  257. }
  258. }
  259. }
  260. </style>