first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/pages/index/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/pages/index/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
836fd049-8b4d-4fbe-910c-22c11cb43893
|
||||
208
衣莎项目/源码/YiShaXiYi/pages/index/index.js
Normal file
208
衣莎项目/源码/YiShaXiYi/pages/index/index.js
Normal file
@@ -0,0 +1,208 @@
|
||||
// pages/index/index.js
|
||||
const app = getApp();
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
const model = app.loadModel("index")
|
||||
const util = app.loadUtils("util")
|
||||
const http = app.loadHttp()
|
||||
const api = app.loadApi()
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
system: app.globalData.system, //设备相关信息
|
||||
pageTitle: "伊莎洗衣", //头部标题
|
||||
isLocation: true, //是否显示定位
|
||||
titleColor: { //头部背景和文字颜色
|
||||
bColor: "#1dbf53",
|
||||
tColor: "#ffffff"
|
||||
},
|
||||
swiperList: [{
|
||||
id: 0,
|
||||
type: 'image',
|
||||
url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg'
|
||||
}],
|
||||
brandImg: [{
|
||||
imgUrl: "/static/img/icon/xy.png",
|
||||
title: "洗衣"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/xx.png",
|
||||
title: "洗鞋"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/xjf.png",
|
||||
title: "洗家纺"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/xscp.png",
|
||||
title: "奢侈品养护"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/xjz.png",
|
||||
title: "家政服务"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/xrzq.png",
|
||||
title: "新人专区"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/hyzx.png",
|
||||
title: "会员专享"
|
||||
}, {
|
||||
imgUrl: "/static/img/icon/cz.png",
|
||||
title: "在线充值"
|
||||
}],
|
||||
currentSwiper: 0,
|
||||
cityInfo: {
|
||||
city: "定位中",
|
||||
location: ""
|
||||
},//最新门店
|
||||
isVideo: false,//弹出video
|
||||
preferential: ['', ''],//每周特惠
|
||||
newsData: ['', '', ''],//新闻列表
|
||||
},
|
||||
ready() {
|
||||
// this.add()
|
||||
model.storage.deleteStorage('nearestStore')
|
||||
Promise.all([this.storeMenu(), this.benefitProduct(), this.getBanner(), this.getNews()])
|
||||
.then(res => {
|
||||
app.globalData.showSkeleton = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
swiperChange: function (e) {
|
||||
this.setData({
|
||||
currentSwiper: e.detail.current
|
||||
})
|
||||
},
|
||||
// 显示
|
||||
// disVideo() {
|
||||
// this.setData({
|
||||
// isVideo: !this.data.isVideo
|
||||
// })
|
||||
// },
|
||||
// 授权和获取用户当前经纬度,并展示最近门店
|
||||
async add() {
|
||||
// 判断本地是否有最近门店,只在第一次进小程序请求后端获取最近门店
|
||||
let storageAdd = await model.storage.getSetting("nearestStore")
|
||||
let cityInfo = {}
|
||||
if (!!storageAdd) {
|
||||
cityInfo = {
|
||||
city: storageAdd.name.substring(0, 4),
|
||||
location: "/pages/nearbyStore/nearbyStore"
|
||||
}
|
||||
this.setData({
|
||||
cityInfo: cityInfo
|
||||
})
|
||||
return
|
||||
}
|
||||
let res = await model.getauth.userLocation()
|
||||
cityInfo = {
|
||||
city: res.name.substring(0, 4),
|
||||
location: "/pages/nearbyStore/nearbyStore"
|
||||
}
|
||||
this.setData({
|
||||
cityInfo: cityInfo
|
||||
})
|
||||
},
|
||||
// 首页banner获取
|
||||
async getBanner() {
|
||||
let res = await http.http.request1({ url: `${http.api.banner}`, method: "GET" })
|
||||
this.setData({
|
||||
swiperList: res.data.data
|
||||
})
|
||||
},
|
||||
// 获取金刚区icon和跳转url
|
||||
async storeMenu() {
|
||||
let data = {}
|
||||
if (app.globalData.userInfo.group_type !== ''
|
||||
&& app.globalData.userInfo.group_type == 39
|
||||
&& app.globalData.userInfo.group_type !== void 0
|
||||
) {
|
||||
data.group_type = app.globalData.userInfo.group_type
|
||||
}
|
||||
let res = await http.http.request1({ url: `${http.api.storeMenu}`, method: "POST", data: data })
|
||||
this.setData({
|
||||
brandImg: res.data.data
|
||||
})
|
||||
},
|
||||
// 金刚区跳转
|
||||
async goDiamondInfo(e) {
|
||||
let url = e.currentTarget.dataset.url
|
||||
let name = e.currentTarget.dataset.name
|
||||
if (!url) {
|
||||
wx.showToast({
|
||||
title: '敬请期待',
|
||||
icon: 'none',
|
||||
duration: 1200
|
||||
})
|
||||
return
|
||||
}
|
||||
if (name !== '家政' && name !== '会员专享') {
|
||||
let isLogin = await util.isLoginJump()
|
||||
if (isLogin == 1) return;
|
||||
}
|
||||
if ((name == '洗衣' || name == '洗鞋' || name == '洗家纺' || name == '奢侈品养护') && app.globalData.userInfo.group_type == 39) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/auth/auth?index=6&group_type=' + app.globalData.userInfo.group_type
|
||||
})
|
||||
return
|
||||
}
|
||||
// 洗衣价目表
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
// 每周特惠
|
||||
async benefitProduct() {
|
||||
let res = await http.http.request1({ url: `${http.api.benefitProduct}`, method: "POST" })
|
||||
this.setData({
|
||||
preferential: res.data.data
|
||||
})
|
||||
},
|
||||
// 每周特惠点击商品进入商品详情
|
||||
goShopInfo(e) {
|
||||
let id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: "/mall/index/shopInfo/shopInfo?id=" + id
|
||||
})
|
||||
},
|
||||
// 点击更多
|
||||
shopMore(e) {
|
||||
let url = e.currentTarget.dataset.url
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
// 获取新闻列表
|
||||
async getNews() {
|
||||
let data = {
|
||||
type: 1,
|
||||
page: 1,
|
||||
limit: 3
|
||||
}
|
||||
let res = await http.http.request1({ url: `${http.api.news}`, method: "GET", data: data })
|
||||
this.setData({
|
||||
newsData: res.data.data.list
|
||||
})
|
||||
},
|
||||
// 轮播图跳转
|
||||
goUrl(e) {
|
||||
let url = e.currentTarget.dataset.url
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
imgerr(e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
onPageScroll: function () {
|
||||
console.log(1);
|
||||
}
|
||||
})
|
||||
5
衣莎项目/源码/YiShaXiYi/pages/index/index.json
Normal file
5
衣莎项目/源码/YiShaXiYi/pages/index/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTextStyle": "black",
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
97
衣莎项目/源码/YiShaXiYi/pages/index/index.wxml
Normal file
97
衣莎项目/源码/YiShaXiYi/pages/index/index.wxml
Normal file
@@ -0,0 +1,97 @@
|
||||
<!-- 头部导航 -->
|
||||
<nav-bar class="skeleton-rect" isLocation="{{isLocation}}" pageTitle="{{pageTitle}}" system="{{system}}" cityInfo="{{cityInfo}}" titleColor="{{titleColor}}"></nav-bar>
|
||||
<!-- pages/index/index.wxml -->
|
||||
<view class="index">
|
||||
<view class="pd30 mt20">
|
||||
<view class="swp skeleton-rect">
|
||||
<swiper class="screen-swiper" circular="true" autoplay="true" interval="5000" duration="500" bindchange="swiperChange">
|
||||
<swiper-item class="swiper-item-index" wx:for="{{swiperList}}" wx:key data-url="{{item.href}}" bind:tap="goUrl">
|
||||
<image src="{{item.image}}" mode="aspectFill" class="swp-img" binderror="imgerr"></image>
|
||||
<!-- <video src="{{item.url}}" autoplay loop muted show-play-btn="{{false}}" controls="{{false}}" objectFit="cover" wx:if="{{item.type=='video'}}"></video> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 重置小圆点的样式 -->
|
||||
<view class="dots">
|
||||
<block wx:for="{{swiperList}}" wx:key>
|
||||
<view class="dot {{index == currentSwiper ? ' active' : ''}}"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classification pd30">
|
||||
<view class="class_list">
|
||||
<view class="class_row" wx:for="{{brandImg}}" wx:key="index" data-name="{{item.name}}" data-url="{{item.href}}" bind:tap="goDiamondInfo">
|
||||
<view class="class_img">
|
||||
<image class="skeleton-rect" src="{{item.logo}}" />
|
||||
</view>
|
||||
<view class="class_p">
|
||||
<span class="skeleton-rect">{{item.name}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="head" wx:if="{{preferential.length > 0}}">
|
||||
<view class="head_title">
|
||||
<view class="head_l">
|
||||
<view class="head_ll flex-con2 skeleton-rect">每周特惠</view>
|
||||
<view class="head_lr flex-con2 skeleton-rect" data-url="/mall/auth/auth?index=1" bind:tap="shopMore">
|
||||
<view class="flex1">更多</view>
|
||||
<view class="head_rimg">
|
||||
<image src="/static/img/icon/right-r.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="head_con">
|
||||
<view class="shop_key">
|
||||
<view class="shop_row skeleton-rect" wx:for="{{preferential}}" wx:key="index" data-id="{{item.id}}" bind:tap="goShopInfo">
|
||||
<view class="shop_img">
|
||||
<image src="{{item.image}}" />
|
||||
</view>
|
||||
<view class="shop_name">{{item.name}}</view>
|
||||
<view class="shop_pri">{{item.price}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my_video">
|
||||
<video object-fit="cover" class="ys_video" src="http://static.geekhelp.cn/ysvideo.mp4" controls></video>
|
||||
</view>
|
||||
<view class="head">
|
||||
<view class="head_title">
|
||||
<view class="head_l">
|
||||
<view class="head_ll flex-con2 skeleton-rect">品牌合作</view>
|
||||
<view class="head_lr flex-con2 skeleton-rect" data-url="/pages/brandList/brandList" bind:tap="shopMore">
|
||||
<view class="flex1">更多</view>
|
||||
<view class="head_rimg">
|
||||
<image src="/static/img/icon/right-r.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="head_con">
|
||||
<navigator wx:for="{{newsData}}" class="know pd30" wx:key url="/pages/brandList/brandInfo/brandInfo?id={{item.id}}">
|
||||
<view class="know_row dis-flex">
|
||||
<view class="know_row_img">
|
||||
<image class="skeleton-rect" src="{{item.images}}" />
|
||||
</view>
|
||||
<view class="flex1 dis-flex1 ml20 skeleton-rect">
|
||||
<view class="flex1 know_row_text">{{item.title}}</view>
|
||||
<view class="know_row_time">{{item.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 视频播放弹出层 -->
|
||||
<view catchtouchmove='{{ isVideo }}' wx:if="{{ isVideo }}" class="tips_video flex-con3">
|
||||
<view class="video_cen">
|
||||
<video id="myVideo" autoplay src="https://www.yishaxiyi.com/assets/video/0300200100561DC1C1FB5B28D342A6E3821DFE-7BD7-264D-DABE-A4532876567C.mp4" enable-danmu danmu-btn controls></video>
|
||||
<image bind:tap="disVideo" src="/static/img/icon/colse_tips.png" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- toasta提示 -->
|
||||
<i-toast id="toast" />
|
||||
317
衣莎项目/源码/YiShaXiYi/pages/index/index.wxss
Normal file
317
衣莎项目/源码/YiShaXiYi/pages/index/index.wxss
Normal file
@@ -0,0 +1,317 @@
|
||||
@import "../../css/_main.wxss";
|
||||
|
||||
/* pages/index/index.wxss */
|
||||
|
||||
|
||||
page {
|
||||
background: #f5f5f5 !important;
|
||||
}
|
||||
|
||||
.swp {
|
||||
height: 270rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.swp .screen-swiper {
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/*用来包裹所有的小圆点 */
|
||||
|
||||
.dots {
|
||||
width: 100%;
|
||||
height: 6rpx;
|
||||
flex-direction: row;
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*未选中时的小圆点样式 */
|
||||
|
||||
.dot {
|
||||
margin: 0 5rpx;
|
||||
width: 15rpx;
|
||||
height: 6rpx;
|
||||
background-color: #d9d9d9;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
/*选中以后的小圆点样式 */
|
||||
|
||||
.active {
|
||||
width: 31rpx;
|
||||
height: 6rpx;
|
||||
background-color: #6f6f6f;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
swiper {
|
||||
height: 270rpx !important;
|
||||
}
|
||||
|
||||
.tower-swiper .tower-item {
|
||||
transform: scale(calc(0.5 + var(--index) / 10));
|
||||
margin-left: calc(var(--left) * 100rpx - 150rpx);
|
||||
z-index: var(--index);
|
||||
}
|
||||
|
||||
.swiper-item-index{
|
||||
border-radius: 10rpx;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.swp-img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
/* border-radius: 10rpx; */
|
||||
}
|
||||
|
||||
/* 分类 */
|
||||
|
||||
.classification {
|
||||
width: 100%;
|
||||
padding: 30rpx 0rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.class_row {
|
||||
width: 25%;
|
||||
/* height: 100rpx; */
|
||||
text-align: center;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.class_row:nth-child(n+5) {
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
|
||||
.class_img image {
|
||||
height: 88rpx;
|
||||
width: 88rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.class_p {
|
||||
font-family: 'PingFang-SC-Medium';
|
||||
margin-top: 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.head {
|
||||
width: 100%;
|
||||
padding: 30rpx 30rpx;
|
||||
/* background-color: #ffffff; */
|
||||
}
|
||||
|
||||
.head_title {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.head_l {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.head_ll {
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.head_lr {
|
||||
text-align: right;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.head_rimg {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.head_rimg image {
|
||||
width: 9rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
/* 品牌合作start */
|
||||
|
||||
.head_con {
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.know {
|
||||
display: block;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.know:nth-child(1) {
|
||||
border-top-left-radius: 10rpx;
|
||||
border-top-right-radius: 10rpx;
|
||||
}
|
||||
|
||||
.know:last-child {
|
||||
border-bottom-right-radius: 10rpx;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
}
|
||||
|
||||
.know_row {
|
||||
padding: 30rpx 0;
|
||||
height: 140rpx;
|
||||
border-bottom: 2rpx solid #ebebeb;
|
||||
box-sizing: initial;
|
||||
}
|
||||
|
||||
.know:last-child .know_row {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.know_row_img {
|
||||
width: 255rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 15rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.know_row_img image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.know_row_text {
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
line-height: 36rpx;
|
||||
color: #333;
|
||||
display: -webkit-box !important;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.know_row_time {
|
||||
text-align: right;
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
line-height: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 品牌合作end */
|
||||
|
||||
.shop_key {
|
||||
background: #fff;
|
||||
overflow-x: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 34rpx 0 15rpx 0;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.shop_row {
|
||||
margin-left: 30rpx;
|
||||
text-align: center;
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
.shop_row:last-child {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.shop_img {
|
||||
width: 180rpx;
|
||||
height: 160rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.shop_img image {
|
||||
width: 180rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.shop_name {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.shop_pri {
|
||||
font-size: 26rpx;
|
||||
color: #ff2b19;
|
||||
}
|
||||
|
||||
.know image {
|
||||
height: 140rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.my_video {
|
||||
padding: 0 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ys_video {
|
||||
width: 100% !important;
|
||||
height: 314rpx;
|
||||
}
|
||||
|
||||
.my_video image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.tips_video {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
|
||||
.video_cen {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.video_cen video {
|
||||
width: 620rpx;
|
||||
height: 400rpx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.video_cen image {
|
||||
width: 69rpx;
|
||||
height: 69rpx;
|
||||
display: block;
|
||||
margin: 20rpx auto 0;
|
||||
}
|
||||
Reference in New Issue
Block a user