目錄
安裝sass/sass-loader
首頁(vue-setup)
使用git本地提交
同步遠程git庫
-
安裝sass/sass-loader
-
#安裝sass npm i sass -D#安裝sass-loader npm i sass-loader@10.1.1 -D
-
-
首頁(vue-setup)
-
<template><view class="u-wrap"><!-- 輪播圖 --><swiper class="wiper-contain" circular :indicator-color="indicatorColor" :indicator-dots="indicatorDots":autoplay="autoplay" :interval="interval" :duration="duration"><swiper-item v-for="(item,index) in swiperList"><image class="imgs" :src="item.image"></image></swiper-item></swiper><!-- 搜索框 --><view class="tab-strickt"><u-search style="flex-grow: 1;margin-top: 10px;" bg-color="#FFF" :show-action="true" action-text="搜索" :animation="true"></u-search></view><!-- 瀑布流 --><u-waterfall v-model="flowList" ref="uWaterfall1"><template v-slot:left="{leftList}"><view class="demo-warter-left" v-for="(item, index) in leftList" :key="index"><!-- 警告:微信小程序中需要hx2.8.11版本才支持在template中結合其他組件,比如下方的lazy-load組件 --><u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load><view class="demo-title">{{item.title}}</view><view class="demo-price">{{item.price}}元</view><view class="demo-tag"><view class="demo-tag-owner">自營</view><view class="demo-tag-text">放心購</view></view><view class="demo-shop">{{item.shop}}</view><u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close"@click="remove(item.id)"></u-icon></view></template><template v-slot:right="{rightList}"><view class="demo-warter-right" v-for="(item, index) in rightList" :key="index"><u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load><view class="demo-title">{{item.title}}</view><view class="demo-price">{{item.price}}元</view><view class="demo-tag"><view class="demo-tag-owner">自營</view><view class="demo-tag-text">放心購</view></view><view class="demo-shop">{{item.shop}}</view><u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close"@click="remove(item.id)"></u-icon></view></template></u-waterfall><u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="addRandomData"></u-loadmore></view> </template><script setup>import {ref} from 'vue';const indicatorDots = ref(true)const autoplay = ref(true)const interval = ref(5000)const duration = ref(2000)const indicatorColor = ref("#FFF")//輪播圖const swiperList = ref([{image: '/static/home/swiper/1.jpg',title: '昨夜星辰昨夜風,畫樓西畔桂堂東'},{image: '/static/home/swiper/2.jpg',title: '身無彩鳳雙飛翼,心有靈犀一點通'},{image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',title: '誰念西風獨自涼,蕭蕭黃葉閉疏窗,沉思往事立殘陽'}])//瀑布流const flowList = ref([{price: 35,title: '北國風光,千里冰封,萬里雪飄',shop: '李白杜甫白居易旗艦店',image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',},{price: 75,title: '望長城內外,惟余莽莽',shop: '李白杜甫白居易旗艦店',image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg',},{price: 385,title: '大河上下,頓失滔滔',shop: '李白杜甫白居易旗艦店',image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',},{price: 784,title: '欲與天公試比高',shop: '李白杜甫白居易旗艦店',image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg',},{price: 7891,title: '須晴日,看紅裝素裹,分外妖嬈',shop: '李白杜甫白居易旗艦店',image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg',},{price: 2341,shop: '李白杜甫白居易旗艦店',title: '江山如此多嬌,引無數英雄競折腰',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg',},{price: 661,shop: '李白杜甫白居易旗艦店',title: '惜秦皇漢武,略輸文采',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23344_s.jpg',},{price: 1654,title: '唐宗宋祖,稍遜風騷',shop: '李白杜甫白居易旗艦店',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg',},{price: 1678,title: '一代天驕,成吉思汗',shop: '李白杜甫白居易旗艦店',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg',},{price: 924,title: '只識彎弓射大雕',shop: '李白杜甫白居易旗艦店',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg',},{price: 8243,title: '俱往矣,數風流人物,還看今朝',shop: '李白杜甫白居易旗艦店',image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg',}]) </script><style lang="scss">.wiper-contain {height: 180px;.item {height: 180px;}.imgs {height: 180px;width: 100%;}}.tab-strickt {position: sticky;z-index: 99;top: 0;left: 0;display: flex;align-items: center;background-color: #f2f2f2;}.demo-warter-left {border-radius: 8px;margin: 5px 0px 5px 5px;background-color: #ffffff;padding: 8px;position: relative;}.demo-warter-right {border-radius: 8px;margin: 5px 5px 0px 5px;background-color: #ffffff;padding: 8px;position: relative;}.u-close {position: absolute;top: 32rpx;right: 32rpx;}.demo-image {width: 100%;border-radius: 4px;}.demo-title {font-size: 30rpx;margin-top: 5px;color: $u-main-color;}.demo-tag {display: flex;margin-top: 5px;}.demo-tag-owner {background-color: $u-type-error;color: #FFFFFF;display: flex;align-items: center;padding: 4rpx 14rpx;border-radius: 50rpx;font-size: 20rpx;line-height: 1;}.demo-tag-text {border: 1px solid $u-type-primary;color: $u-type-primary;margin-left: 10px;border-radius: 50rpx;line-height: 1;padding: 4rpx 14rpx;display: flex;align-items: center;border-radius: 50rpx;font-size: 20rpx;}.demo-price {font-size: 30rpx;color: $u-type-error;margin-top: 5px;}.demo-shop {font-size: 22rpx;color: $u-tips-color;margin-top: 5px;} </style>
-
-
使用git本地提交
-
#創建的vue項目 cd shop-wx#初始化git git init#添加文件到暫存區 git add .#本地提交 git commit -m "init shop-wx"
-
-
同步遠程git庫
- https://gitee.com/cloud2023_1/shop-wx.git
-
#同步代碼到遠程庫 git remote add origin https://gitee.com/cloud2023_1/shop-wx.git#將提交的代碼同步到主分支 git push -u origin master