Browse Source

首页轮播

master
jiazhipeng 1 year ago
parent
commit
17cc91b879
  1. 7
      pages/index/index.js
  2. 6
      pages/index/index.wxml
  3. 2
      pages/order/pay/index.wxml
  4. 4
      pages/user/service/index.wxss
  5. 41
      pages/user/service/info/index.js
  6. 15
      pages/user/service/info/index.wxml
  7. 6
      pages/user/service/info/index.wxss
  8. 21
      project.private.config.json

7
pages/index/index.js

@ -10,6 +10,7 @@ import https from "../../utils/https.js"
Page({ Page({
data: { data: {
bannerInterver: 1000*60,
banner: [], banner: [],
xiaobanner: [], xiaobanner: [],
height: 0, height: 0,
@ -73,6 +74,8 @@ Page({
imageSourceList:imageSource, imageSourceList:imageSource,
}, },
onLoad: function(options) { onLoad: function(options) {
console.log('onload')
wx.getLocation({type: 'gcj02'}) wx.getLocation({type: 'gcj02'})
console.log('options',options) console.log('options',options)
@ -247,7 +250,8 @@ Page({
}, },
changeBannerIndex: function(e) { changeBannerIndex: function(e) {
this.setData({ this.setData({
activeBannerIndex: e.detail.current activeBannerIndex: e.detail.current,
bannerInterver: 5000
}) })
}, },
changeSmBannerIndex: function(e) { changeSmBannerIndex: function(e) {
@ -983,6 +987,7 @@ Page({
util.pagePoint(e, type) util.pagePoint(e, type)
}, },
onShow: function() { onShow: function() {
if (app.globalData.loadIndexSeason) { if (app.globalData.loadIndexSeason) {
this.getIndexSeason() this.getIndexSeason()
} else { } else {

6
pages/index/index.wxml

@ -26,7 +26,7 @@
</navigator> </navigator>
</view> </view>
<view style="position:relative;z-index: 1;"> <view style="position:relative;z-index: 1;">
<swiper class="swiper" autoplay="{{true}}" interval="{{5000}}" duration="{{300}}" bindchange="changeBannerIndex" circular> <swiper class="swiper" autoplay="{{true}}" interval="{{bannerInterver}}" duration="{{300}}" bindchange="changeBannerIndex" circular>
<block wx:for="{{banner}}" wx:key="index"> <block wx:for="{{banner}}" wx:key="index">
<swiper-item bindtap="bannerClick" data-item="{{item}}"> <swiper-item bindtap="bannerClick" data-item="{{item}}">
<image src="{{item.head_img}}" mode="scaleToFill"></image> <image src="{{item.head_img}}" mode="scaleToFill"></image>
@ -160,7 +160,7 @@
<view class="xsth-left" style="display: flex;"> <view class="xsth-left" style="display: flex;">
<image mode="heightFix" style="height:100rpx" src="{{indexSeason.xpth}}"></image> <image mode="heightFix" style="height:100rpx" src="{{indexSeason.xpth}}"></image>
</view> </view>
<view class="time-box" style="z-index: 9;flex-shrink: 0;"> <view class="time-box" style="z-index: 2;flex-shrink: 0;">
倒计时 倒计时
<view class="xsth-time" style="margin-left: 20rpx;">{{djs.h}}</view> <view class="xsth-time" style="margin-left: 20rpx;">{{djs.h}}</view>
<text>:</text> <text>:</text>
@ -504,7 +504,7 @@
<view wx:else> <view wx:else>
<image class="top-bg-img" src="{{indexSeason.topBac}}" mode="widthFix"></image> <image class="top-bg-img" src="{{indexSeason.topBac}}" mode="widthFix"></image>
<view style="position:relative;z-index: 1;"> <view style="position:relative;z-index: 1;">
<swiper class="swiper" autoplay="{{true}}" interval="{{5000}}" duration="{{300}}" bindchange="changeBannerIndex" circular> <swiper class="swiper" autoplay="{{true}}" interval="{{bannerInterver}}" duration="{{300}}" bindchange="changeBannerIndex" circular>
<block wx:for="{{banner}}" wx:key="*this"> <block wx:for="{{banner}}" wx:key="*this">
<swiper-item bindtap="bannerClick" data-item="{{item}}"> <swiper-item bindtap="bannerClick" data-item="{{item}}">
<image src="{{item.head_img}}" mode="scaleToFill"></image> <image src="{{item.head_img}}" mode="scaleToFill"></image>

2
pages/order/pay/index.wxml

@ -77,7 +77,7 @@
<view wx:for="{{info.order_product_list}}"> <view wx:for="{{info.order_product_list}}">
<view style="text-align: left;padding: 0 40rpx 20rpx;" wx:if="{{item.needTip}}"> <view style="text-align: left;padding: 0 40rpx 20rpx;" wx:if="{{item.needTip}}">
<view>{{item.sku_name}}</view> <view>{{item.sku_name}}</view>
<view>可用时间:{{item.sku_model.expired_range_start}}至{{item.sku_model.expired_range_end}}</view> <view wx:if="{{item.sku_model.expired_range_start&&item.sku_model.expired_range_end}}">可用时间:{{item.sku_model.expired_range_start}}至{{item.sku_model.expired_range_end}}</view>
</view> </view>
</view> </view>
</view> </view>

4
pages/user/service/index.wxss

@ -99,7 +99,9 @@
} }
.more-btn { .more-btn {
text-align: center; text-align: center;
width: 300rpx; min-width: 300rpx;
width: fit-content;
padding: 0 40rpx;
line-height: 60rpx; line-height: 60rpx;
background: rgba(11, 137, 142, 0); background: rgba(11, 137, 142, 0);
border: 1rpx solid #D8D8D8; border: 1rpx solid #D8D8D8;

41
pages/user/service/info/index.js

@ -9,7 +9,10 @@ Page({
*/ */
data: { data: {
info:null, info:null,
linkData:[] linkData:[],
phoneList: ["0512-66555111","17625172834","18114363097","13245079618"],
showPhoneMask: false
}, },
/** /**
@ -91,20 +94,32 @@ Page({
id: this.data.info.id id: this.data.info.id
} }
},1) },1)
wx.showModal({ // wx.showModal({
title: '提示', // title: '提示',
content: '呼叫人工客服\n0512-66555111', // content: '呼叫人工客服\n0512-66555111',
confirmColor:"#0B898E", // confirmColor:"#0B898E",
success (res) { // success (res) {
if (res.confirm) { // if (res.confirm) {
wx.makePhoneCall({ // wx.makePhoneCall({
phoneNumber: '0512-66555111', // phoneNumber: '0512-66555111',
}) // })
} else if (res.cancel) { // } else if (res.cancel) {
} // }
} // }
// })
this.setData({showPhoneMask: true})
},
callPhone (e) {
let item = e.currentTarget.dataset.item;
wx.makePhoneCall({
phoneNumber: item,
}) })
}, },
closePhoneMask () {
this.setData({showPhoneMask: false})
},
zan:function(){ zan:function(){
let info = this.data.info; let info = this.data.info;
commonApi.user_post("ics/useful",{ commonApi.user_post("ics/useful",{

15
pages/user/service/info/index.wxml

@ -18,4 +18,19 @@
<view class="iconfont icon-you"></view> <view class="iconfont icon-you"></view>
</navigator> </navigator>
<navigator url="list/index?typeid={{typeId}}" class="more-btn" bindtap="showService">没找到想要的答案?一键呼唤<text>人工客服</text></navigator> <navigator url="list/index?typeid={{typeId}}" class="more-btn" bindtap="showService">没找到想要的答案?一键呼唤<text>人工客服</text></navigator>
</view>
<view class="mask" wx:if="{{showPhoneMask}}">
<view class="mask-bg" bindtap="closePhoneMask"></view>
<view class="mask-content" style="text-align:center;width:70%;border-radius:10rpx">
<view class="num-pay-top" style="font-weight: bold;padding: 30rpx 60rpx;font-size: 30rpx;">
<view style="padding-bottom: 20rpx;">热线电话</view>
<view style="padding-bottom:20rpx;border-bottom: 2rpx solid #ccc;">点击号码拨打</view>
<view >
<view class="phone-item" wx:for="{{phoneList}}" bindtap="callPhone" data-item="{{item}}">{{item}}</view>
</view>
</view>
</view>
</view> </view>

6
pages/user/service/info/index.wxss

@ -64,4 +64,10 @@ page {
} }
.icon-zan.zhuan { .icon-zan.zhuan {
transform: rotate(180deg); transform: rotate(180deg);
}
.phone-item{
height: 100rpx;
line-height: 100rpx;
color: #409EFF;
border-bottom: 2rpx solid #ccc;
} }

21
project.private.config.json

@ -6,6 +6,20 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "首页",
"pathName": "subPackages/indexGQ/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/user/order/showOrderInfo/index",
"pathName": "pages/user/order/showOrderInfo/index",
"query": "id=46022501041743498343",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/pbService/web/index", "name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index", "pathName": "pages/pbService/web/index",
@ -41,13 +55,6 @@
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{
"name": "首页",
"pathName": "pages/list/six/index",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "景点购物车5447", "name": "景点购物车5447",
"pathName": "pages/info/sceneProductInfoNew/index", "pathName": "pages/info/sceneProductInfoNew/index",

Loading…
Cancel
Save