当前位置: 首页 > news >正文

商品首页(sass+git本地初始化)

目录

安装sass/sass-loader

首页(vue-setup)

使用git本地提交

同步远程git库


  1. 安装sass/sass-loader

    1. #安装sass
      npm i sass -D#安装sass-loader
      npm i sass-loader@10.1.1 -D
  2. 首页(vue-setup)

    1. <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>
  3. 使用git本地提交

    1. #创建的vue项目
      cd shop-wx#初始化git
      git init#添加文件到暂存区
      git add .#本地提交
      git commit -m "init shop-wx"
      
  4. 同步远程git库

    1. https://gitee.com/cloud2023_1/shop-wx.git
    2. #同步代码到远程库
      git remote add origin https://gitee.com/cloud2023_1/shop-wx.git#将提交的代码同步到主分支
      git push -u origin master

http://www.lryc.cn/news/121173.html

相关文章:

  • Games101学习笔记 - MVP矩阵
  • 从零开始搭建个人博客网站(hexo框架)
  • vue的proxy代理详解
  • 计算机网络 ARP协议 IP地址简述
  • 2021年03月 Python(一级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • 机器学习实战4-数据预处理
  • 项目管理师基础之项目管理计划和项目文件
  • 【单片机】DS2431,STM32,EEPROM读取与写入
  • c++11 标准模板(STL)(std::basic_stringbuf)(一)
  • flutter开发实战-WidgetsBinding监听页面前台后台退出状态
  • 父进程等待子进程退出 / 僵尸进程孤儿进程
  • 【LeetCode 75】第二十六题(394)字符串解码
  • UNIX网络编程——TCP协议API 基础demo服务器代码
  • [保研/考研机试] KY163 素数判定 哈尔滨工业大学复试上机题 C++实现
  • iOS_crash文件的获取及符号化(解析)
  • STM32定时器TIM控制
  • 网络请求中,token和cookie有什么区别
  • Javaweb_xml
  • http相关知识点
  • 【SA8295P 源码分析】68 - Android 侧用户层 输入子系统获取 /dev/input/event0 节点数据 代码流程分析
  • 走出迷宫(多组输入bfs)
  • Linux系统编程-终端、进程组、会话
  • Linux部分文件操作记录
  • Android系统-进程-Binder2-Java层
  • 体渲染原理及WebGL实现【Volume Rendering】
  • VUE3组件
  • 【iOS】autoreleasepool
  • 0基础学习VR全景平台篇 第80篇:Insta360 影石如何直播推流
  • 大语言模型之三 InstructGPT训练过程
  • ChatGPT在自动化报告和数据分析中的应用如何?