Commit f7f9d850 by 李伟康

提交代码

1 parent 9fc9342c
...@@ -67,10 +67,6 @@ module.exports = { ...@@ -67,10 +67,6 @@ module.exports = {
}, },
true true
) )
},
/**获取图片版本号 */
getImgVersion() {
return api.getMock()
} }
} }
} }
{ {
"pages": ["pages/tab/index/index", "pages/tab/mall/mall", "pages/tab/mine/mine", "pages/webView/webView"], "pages": ["pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView"],
"requiredPrivateInfos": ["getLocation"], "requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
...@@ -12,22 +12,21 @@ ...@@ -12,22 +12,21 @@
"selectedColor": "#FC5B32", "selectedColor": "#FC5B32",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [{
{
"pagePath": "pages/tab/index/index", "pagePath": "pages/tab/index/index",
"text": "首页", "text": "拓客户",
"iconPath": "images/home.png", "iconPath": "images/home.png",
"selectedIconPath": "images/home_active.png" "selectedIconPath": "images/home_active.png"
}, },
{ {
"pagePath": "pages/tab/mall/mall", "pagePath": "pages/tab/output/output",
"text": "商城", "text": "看产值",
"iconPath": "images/mall.png", "iconPath": "images/mall.png",
"selectedIconPath": "images/mall_active.png" "selectedIconPath": "images/mall_active.png"
}, },
{ {
"pagePath": "pages/tab/mine/mine", "pagePath": "pages/tab/mine/mine",
"text": "我的", "text": "个人中心",
"iconPath": "images/mine.png", "iconPath": "images/mine.png",
"selectedIconPath": "images/mine_active.png" "selectedIconPath": "images/mine_active.png"
} }
...@@ -35,7 +34,7 @@ ...@@ -35,7 +34,7 @@
}, },
"subpackages": [], "subpackages": [],
"usingComponents": { "usingComponents": {
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
...@@ -48,4 +47,4 @@ ...@@ -48,4 +47,4 @@
} }
}, },
"plugins": {} "plugins": {}
} }
\ No newline at end of file \ No newline at end of file
@import "/common.wxss"; @import "/common.wxss";
@import "/sprite.wxss";
page { page {
background-color: #F7F7F7; background-color: #F7F7F7;
......
const app = getApp()
import { indexApi, mineApi, carlifeApi } from '~/api/api'
import { kfMixin } from '../../../mixins/index'
import { getUserInfo, isMember } from '~/utils/cache/userInfo'
import { getSessionId, setNavigationBarTitleText } from '~/utils/cache/storageApi'
const navStyle = 'background-color: transparent;' const navStyle = 'background-color: transparent;'
const _utilList_ = [
{
name: '汇划算商城',
h5: '111',
icon: 'shopmall'
},
{
name: '门店卡券',
url: 'packageIndex.storeCoupons',
icon: 'coupon'
},
{
name: '服务网点',
url: 'packageIndex.reservation.merchantList',
icon: 'navigation'
},
{
name: '爱车保镖',
url: 'packageIndex.gps.index',
icon: 'gps'
}
]
Page({ Page({
behaviors: [kfMixin], // behaviors: [kfMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tab: [],
navStyle, navStyle,
goodsIndex: 0,
tipsList: ['品质无忧', '服务保障', '省时省心']
},
//获取顾问列表
getConsultantList() {
},
showFlex() {
this.setData({
widgetStatus: !this.data.widgetStatus
})
},
onPageScroll({ scrollTop }) {
let scrollTop_num = scrollTop / 100
if (scrollTop_num > 0 && scrollTop_num <= 1 && this.data.navStyle != 'background-color:#FC5B32;')
this.setData({
navStyle: `background-color:#FC5B32;`
})
if (scrollTop_num == 0)
this.setData({
navStyle
})
},
changePage(e) {
this.setData({
bannerIndex: e.detail.current
})
},
jumpGoods(e) {
let { id, url, link } = e.currentTarget.dataset
if (id) {
wx.$router.go('packageMall.detail', {
id,
isActivity: false,
notIntercept: true
})
} else if (url) {
wx.$router.go(url, { notIntercept: true })
} else {
if (!link) return
if (link) wx.$router.jumpH5(link)
}
},
search(e) {
let value = e.detail
wx.$router.go('search', value)
},
jump(e) {
let { url, item } = e.currentTarget.dataset
if (url) wx.$router.go(`${this.rootName}.${url}`, { notIntercept: true })
if (item) {
wx.$Track.setTrack({
url: item.h5 || item.url,
targetTitle: item.name
})
if (item.h5) {
wx.$router.jumpH5(item.h5)
} else {
if (item.url) wx.$router.go(item.url, item)
}
}
},
/**v2.8.0更换跳转权益页面 */
async jumpEquity() {
// wx.$router.go('packageEquity.allEquity')
try {
let memberType = 1,
str = ''
//
let sid = await getSessionId()
console.log(sid)
if (!sid) {
str = `?memberType=${memberType}` + `&item=${null}` + `&getPackage=${true}`
wx.navigateTo({
url: '/packageEquity/pages/open/open' + str
})
wx.$eventbus.on('REFRESHINDEX', () => {
this.getHomeData(true)
})
return
}
wx.$util.showLoading()
isMember(true, (e, data) => {
wx.hideLoading()
if (data) {
memberType = data.cardType == 2 ? 6 : 4
}
str = `?memberType=${memberType}` + `&item=${null}` + `&getPackage=${true}`
wx.navigateTo({
url: '/packageEquity/pages/open/open' + str
})
})
} catch (error) {
wx.$util.showToast(error)
wx.$router.go('packageEquity.allEquity')
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
LOGIN(e) {
let { data } = e.detail
this.setData({
userInfo: data.isLogin == 'Y' ? data : {},
isLogin: data.isLogin == 'Y'
})
if (data.isLogin == 'Y') this.getHomeData()
},
SETDATA(data) {
this.setData({
userInfo: data.isLogin == 'Y' ? data : {},
isLogin: data.isLogin == 'Y',
showLogin: data.isLogin != 'Y'
})
},
onLoad: function (options) { onLoad: function (options) {
// console.log(test)
console.log(wx.$storage.get('super'))
this.setData({
utilList: [..._utilList_],
'skeletonData.utilList': true,
isLogin: false
})
let data = getUserInfo()
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
if (data) {
if (data.isLogin == 'Y') {
if (storeCode == data.sapCode) {
this.SETDATA(data)
this.getHomeData()
}
if (!storeCode)
getApp()
.login()
.then(({ data }) => {
this.SETDATA(data)
this.getHomeData()
})
}
} else {
this.getHomeData()
// this.setData({
// showLogin: true
// })
}
},
getHomeData(isOff) {
// wx.$util.showLoading()
this.getHomeConfig()
this.getActivityList()
if (isOff) {
wx.$eventbus.off('REFRESHINDEX')
}
// this.getLiveList()
},
getHomeConfig() {
indexApi.getHomeConfig().then(data => {
console.log('getHomeConfig', data)
let { img_version, IMGURL } = this.data
let bannerList = [
{
bannerImg: `${IMGURL}home/0.jpg?v=${img_version}`,
url: 'packageIndex.cgacarCommon.aboutUs'
}
]
let customerlist = []
if (data.customerServerName && data.customerServerOrCode) {
customerlist.push({
staffName: data.customerServerName,
qrCode: data.customerServerOrCode,
thumbAvatar: data.customerServerAvatar
})
}
if (data.bannerList && data.bannerList.length) bannerList.push(...data.bannerList)
let utilList = [..._utilList_]
if (data.clueList && data.clueList.length) {
/**clueId 1:救援服务,2:维保预约,3:新车频道 */
const clueList = {
1: {
name: '救援服务',
url: 'packageEquity.road.index',
icon: 'road',
notIntercept: true
},
2: {
name: '维保预约',
url: 'packageIndex.reservation.index',
icon: 'reservation'
},
3: {
name: '新车频道',
url: 'packageIndex.newCars.index',
icon: 'newCars'
}
}
data.clueList.map(e => {
utilList.push(clueList[e.clueId])
})
}
this.setData({
merchantName: data.merchantName,
noticeContent: data.noticeContent,
bannerList,
bannerIndex: 0,
customerlist,
utilList,
'skeletonData.homeConfig': true
})
console.log('data.merchantName', data.merchantName)
setNavigationBarTitleText(data.merchantName)
this.getBizjiaUrl()
this.filterKfList(data)
wx.hideLoading()
})
},
getBizjiaUrl() {
carlifeApi
.getBizjiaUrl()
.then(res => {
console.log(res)
this.setData({
'utilList[0].h5': res
})
})
.catch(error => {
console.log(error)
})
},
changeTab(e) {
this.setData({
goodsIndex: e.detail
})
},
getClassifyList(list) {
indexApi.getClassifyList().then(data => {
let tab = []
let classifyList = []
if (list.length) {
data.unshift({
classifyName: '秒杀',
goodsList: list
})
}
data.map(e => {
e.goodsList &&
e.goodsList.length &&
e.goodsList.map(i => {
i &&
i.length &&
i.map(c => {
c.goods.goodsStatistics = c.goodsStatistics
c.goods.id = c.goodsId
})
})
if (e.goodsList && e.goodsList.length) {
e.count = 0
classifyList.push(e)
tab.push(e.classifyName)
}
})
this.setData({
goodsFlag: true,
classifyList,
tab,
'skeletonData.goods': true,
hideSkeleton: true
})
})
},
getActivityList() {
indexApi
.getActivityList({
currentPage: 1,
type: 2
})
.then(data => {
this.getClassifyList(data.list)
})
},
getLiveList() {
indexApi.getLiveList().then(data => {
this.setData({
liveList: data.list
})
})
},
intoLiveRoom(e) {
console.log(e)
let {
item: { roomId }
} = e.currentTarget.dataset
let customParams = encodeURIComponent(JSON.stringify())
wx.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}` //&customParams=${customParams}
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -344,8 +25,6 @@ Page({ ...@@ -344,8 +25,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let userInfo = getUserInfo()
if (!this.data.hideSkeleton && userInfo?.isLogin == 'Y') this.getHomeData()
}, },
/** /**
...@@ -362,7 +41,6 @@ Page({ ...@@ -362,7 +41,6 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.getHomeData()
}, },
/** /**
...@@ -373,34 +51,5 @@ Page({ ...@@ -373,34 +51,5 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
let path = this.route
if (merchantId) path = `${path}?merchantId=${merchantId}&storeCode=${storeCode || ''}`
return {
path
}
},
/**图片加载完成 */
imgSuccess(e) {
let { name } = e.currentTarget.dataset
this.setData({
[`skeletonData.${name}`]: true
})
},
pageRefresh() {
this.setData({
showMerchant: false
})
// wx.$util.showLoading()
},
/**切换门店 */
marchantSwitch() {
wx.$router.intercept().then(res => {
if (!res)
this.setData({
showMerchant: true
})
})
} }
}) })
/* pages/tab/index/index.wxss */
// @import "index.skeleton.wxss";
page {
background-color: #fff;
height: 101%;
.logo {
position: absolute;
width: 218rpx;
height: 50rpx;
top: 50%;
left: 26rpx;
}
}
.flex {
display: flex;
align-items: center;
}
.merchant-switch {
position: absolute;
width: 128rpx;
height: 36rpx;
background: rgb(255, 255, 255, .2);
border-radius: 4rpx;
font-size: 22rpx;
color: #FFFFFF;
top: 50%;
left: 256rpx;
justify-content: center;
.icon {
margin-left: 4rpx;
width: 16rpx;
height: 16rpx;
}
}
// .merchant-switch
.layout {
padding-bottom: 40rpx;
position: relative;
}
.bg-box {
width: 100%;
height: 446rpx;
overflow: hidden;
position: absolute;
left: 0;
}
.bg-box .merchant-name {
font-size: 28rpx;
color: #FFFFFF;
position: absolute;
left: 32rpx;
}
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
.banner {
padding: 60rpx 32rpx 12rpx;
position: relative;
height: 300rpx;
overflow: hidden;
position: relative;
border-radius: 16rpx;
}
.banner .swiper {
height: 100%;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
position: relative;
transform: translateY(0);
}
.banner .swiper.border {
border: 16rpx solid #fff;
box-sizing: border-box;
background: #D6D6D6;
height: 300rpx;
}
.banner .swiper .logo {
left: 50%;
}
.banner .swiper-item,
.banner .banner-img {
border-radius: 16rpx;
overflow: hidden;
}
.banner .banner-dots {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 44rpx;
left: 0;
}
.banner .banner-dots .dots {
width: 12rpx;
height: 4rpx;
margin: 0 6rpx;
background-color: rgba(255, 255, 255, .3);
transition: all .5s;
}
.banner .banner-dots .dots.active {
background-color: #fff;
}
.marquee {
color: #414142;
height: 74rpx;
}
.util-box {
display: grid;
align-items: center;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx 0;
padding-bottom: 48rpx;
}
.util-box .item {
display: flex;
align-items: center;
flex-direction: column;
font-size: 24rpx;
color: #282829;
}
.util-box .item .sprite-icon {
margin-bottom: 12rpx;
}
.tips-box {
justify-content: center;
margin-bottom: 32rpx;
color: rgba(33, 33, 33, .6);
font-size: 24rpx;
}
.tips-box .item {
margin: 0 20rpx;
}
.tips-box .sprite-icon {
margin-right: 10rpx;
}
.equity-banner {
height: 230rpx;
margin: 0 32rpx 24rpx;
border-radius: 8rpx;
overflow: hidden;
}
.activity-box,
.goods-box .goods-content .goods-item {
padding: 32rpx 32rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.goods-box .goods-content .goods {
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.live-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 22rpx;
padding: 20rpx 0;
}
.live-item .live-preview {
position: relative;
width: 332rpx;
height: 168rpx;
border-radius: var(--borderRadius);
overflow: hidden;
}
.live-item .live-preview .tips {
position: absolute;
left: 0;
top: 0;
height: 24rpx;
display: flex;
align-items: center;
color: #FFFFFF;
border-radius: 0 0 8rpx 0;
overflow: hidden;
}
.live-item .live-preview .tips .value {
height: 24rpx;
font-size: 20rpx;
padding: 0 8rpx;
background: rgba(0, 0, 0, .59);
}
.live-item .live-preview .tips .label {
width: 64rpx;
font-size: 20rpx;
height: 100%;
}
.live-item .live-preview .in-live .label {
font-size: 16rpx;
background-color: var(--themeColor);
}
.live-item .live-preview .prediction .label {
background-color: var(--btnColor);
}
.live-item .live-preview .in-live .label image {
width: 10rpx;
height: 10rpx;
margin-right: 6rpx;
}
.live-item .live-info {
display: flex;
align-items: center;
margin-top: 20rpx;
}
.live-item .live-info .icon {
width: 48rpx;
height: 48rpx;
overflow: hidden;
border-radius: 100%;
margin-right: 24rpx;
}
.live-item .live-info .live-title {
width: 258rpx;
}
.goods-box,
.goods-box .goods-content .goods-item {
animation: show-box-opacity .5s forwards;
position: relative;
}
.anchor {
position: absolute;
}
.goods-box .goods-content {
/* min-height: 1254rpx; */
padding-bottom: 60rpx;
}
.goods-box .goods-content .page {
display: flex;
}
.goods-box .goods-content swiper {
height: 1104rpx;
}
.goods-box .btn {
margin: 60rpx auto 0;
border: 2rpx solid #979797;
border-radius: 4rpx;
width: 182rpx;
height: 54rpx;
font-size: 24rpx;
color: #656566;
}
.goods-box .btn .icon-mine-arrow {
margin-left: 12rpx;
}
.nothing {
flex-direction: column;
font-size: 28rpx;
color: #C1C2C3;
}
.nothing .icon {
width: 320rpx;
height: 320rpx;
margin-bottom: 8rpx;
}
.widget-box {
position: fixed;
right: 40rpx;
bottom: 232rpx;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: flex-end;
}
.widget {
height: 140rpx;
width: 112rpx;
box-sizing: border-box;
}
.widget-box .open {
position: relative;
z-index: 2;
}
/* @keyframes move {
0% {
transform: translateX(320rpx);
}
100% {
transform: translateX(80rpx);
}
} */
.widget .icon {
width: 100%;
height: 200%;
position: relative;
}
.online-text {
position: absolute;
top: 74rpx;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 28rpx;
font-size: 20rpx;
}
.widget-box .flex-box {
position: relative;
display: flex;
border-radius: var(--borderRadius);
padding: 10rpx 20rpx 10rpx 100rpx;
/* background: linear-gradient(201deg, #7BA6FF 0%, #1C72FB 100%); */
box-sizing: border-box;
animation: showFlex .5s forwards;
font-size: 20rpx;
justify-content: space-between;
width: 320rpx;
}
.widget-box .flex-box .view {
opacity: 0;
animation: showView .1s forwards .5s;
}
@keyframes showFlex {
0% {
right: -1000%;
}
100% {
right: 0;
}
}
@keyframes showView {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.close-icon {
width: 48rpx;
height: 48rpx;
position: absolute;
right: 90rpx;
top: 260rpx;
}
.close-icon image {
width: 48rpx;
height: 48rpx;
}
.model .bgkf {
width: 602rpx;
height: 862rpx;
position: absolute;
top: 328rpx;
left: 50%;
transform: translateX(-50%);
z-index: 99999;
}
.model .qr-box {
height: 686rpx;
width: 418rpx;
bottom: 96rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
}
.model .bgkf .icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.model .bgkf .icon image {
border-radius: 50%;
}
.userinfo-wrap {
position: absolute;
top: 0rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
flex-direction: column
}
.qr-box .text {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.qr-box .name {
font-size: 28rpx;
font-weight: 400;
color: #282829;
line-height: 40rpx;
margin: 8rpx 0 0 0;
text-align: center;
}
.qr-box .qr-icon {
width: 418rpx;
height: 492rpx;
margin-top: 50rpx;
position: relative;
}
.qr-box .qr-code {
width: 220rpx;
height: 220rpx;
margin-top: 104rpx;
}
.kf-text {
width: 348rpx;
height: 112rpx;
position: absolute;
z-index: 999998;
margin-top: 30rpx;
}
.kf-text image {
widows: 100%;
height: 100%;
}
\ No newline at end of file \ No newline at end of file
<!--
此文件为开发者工具生成,生成时间: 2022/5/27 下午4:06:14
使用方法:
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxml 引入模板
```
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}" />
```
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
-->
<template name="skeleton">
<view class="sk-container">
<view is="components/NavigationBar/NavigationBar">
<view class="NavigationBar--navigation-bar" id="b58dacbb--navigation-bar" style="padding-top:44px;height:44px;background-color: transparent;">
<view class="NavigationBar--navigation-bar-box" style="font-size:16px;">
<view class="NavigationBar--navigation-bar-titleText" style="width:187px;padding:0 7px;">
<view class="logo y-center" hidden="{{skeletonData.logo}}">
<image webp="true" data-name="logo" class="sk-image"></image>
</view>
</view>
</view>
</view>
</view>
<view class="layout" style="top:{{navHeight}}px">
<view class="bg-box" style="height:{{270 + navHeight * 2}}rpx;top:-{{navHeight}}px" hidden="{{skeletonData.bg}}">
<view class="bg">
<image webp="true" data-name="bg" class="sk-image"></image>
</view>
</view>
<view class="banner" hidden="{{skeletonData.homeConfig}}">
<swiper autoplay="false" circular="true" class="swiper" interval="5000" current="0"></swiper>
<view class="banner-dots">
<view class="dots"></view>
<view class="dots"></view>
<view class="dots active"></view>
<view class="dots"></view>
<view class="dots"></view>
</view>
</view>
<view class="tips-box flex" hidden="{{skeletonData.utilList}}">
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-0 sk-image"></view>
品质无忧
</view>
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-1 sk-image"></view>
服务保障
</view>
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-2 sk-image"></view>
省时省心
</view>
</view>
<view class="util-box" hidden="{{skeletonData.utilList}}">
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-shopmall sk-image"></view>
汇划算商城
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-coupon sk-image"></view>
门店卡券
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-navigation sk-image"></view>
服务网点
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-gps sk-image"></view>
爱车保镖
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-road sk-image"></view>
救援服务
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-reservation sk-image"></view>
维保预约
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-newCars sk-image"></view>
新车频道
</view>
</view>
<view class="equity-banner x-center" hidden="{{skeletonData.equity}}">
<image webp="true" data-name="equity" class="sk-image"></image>
</view>
<view class="goods-box" hidden="{{skeletonData.goods}}">
<view class="sticky" style="top:88px;">
<view is="components/Tab/Tab">
<scroll-view enable-flex="true" scroll-with-animation="true" scroll-x="true" class="Tab--tab-box Tab--left" scroll-into-view="true">
<view class="Tab--tab Tab--active" data-count="0" id="9dff8c7d--to-0">
<view class="Tab--text sk-transparent sk-text-14-2857-28 sk-text">秒杀</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="1" id="9dff8c7d--to-1">
<view class="Tab--text sk-transparent sk-text-14-2857-764 sk-text">新品驾到</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="2" id="9dff8c7d--to-2">
<view class="Tab--text sk-transparent sk-text-14-2857-318 sk-text">智能硬件</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="3" id="9dff8c7d--to-3">
<view class="Tab--text sk-transparent sk-text-14-2857-940 sk-text">导航车机</view>
<view class="Tab--line"></view>
</view>
</scroll-view>
</view>
</view>
<view class="goods-content activity-box">
<view is="components/Activity/Activity">
<view class="Activity--item Activity--activity" data-id="109">
<view class="Activity--img">
<image webp="true" class="sk-image"></image>
</view>
</view>
</view>
<view is="components/Activity/Activity">
<view class="Activity--item Activity--activity" data-id="108">
<view class="Activity--img">
<image webp="true" class="sk-image"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
/*
此文件为开发者工具生成,生成时间: 2022/5/27 下午4:06:14
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
*/
.sk-transparent {
color: transparent !important;
}
.sk-text-14-2857-847 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text {
background-origin: content-box !important;
background-clip: content-box !important;
background-color: transparent !important;
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-28 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-764 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-318 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-940 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-image {
background: #EFEFEF !important;
}
.sk-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: transparent;
}
.sk-container .equity-banner{
position: absolute;
width: calc(100% - 64rpx);
margin: 0;
top: 846rpx;
}
.sk-container .goods-box {
position: absolute;
top: 1100rpx;
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/index.wxss */
@import "index.skeleton.wxss";
page {
background-color: #fff;
height: 101%;
}
.flex {
display: flex;
align-items: center;
}
.logo {
position: absolute;
width: 218rpx;
height: 50rpx;
top: 50%;
left: 26rpx;
}
.merchant-switch {
position: absolute;
width: 128rpx;
height: 36rpx;
background: rgb(255, 255, 255, .2);
border-radius: 4rpx;
font-size: 22rpx;
color: #FFFFFF;
top: 50%;
left: 256rpx;
justify-content: center;
}
.merchant-switch .icon {
margin-left: 4rpx;
width: 16rpx;
height: 16rpx;
}
.layout {
padding-bottom: 40rpx;
position: relative;
}
.bg-box {
width: 100%;
height: 446rpx;
overflow: hidden;
position: absolute;
left: 0;
}
.bg-box .merchant-name {
font-size: 28rpx;
color: #FFFFFF;
position: absolute;
left: 32rpx;
}
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
.banner {
padding: 60rpx 32rpx 12rpx;
position: relative;
height: 300rpx;
overflow: hidden;
position: relative;
border-radius: 16rpx;
}
.banner .swiper {
height: 100%;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
position: relative;
transform: translateY(0);
}
.banner .swiper.border {
border: 16rpx solid #fff;
box-sizing: border-box;
background: #D6D6D6;
height: 300rpx;
}
.banner .swiper .logo {
left: 50%;
}
.banner .swiper-item,
.banner .banner-img {
border-radius: 16rpx;
overflow: hidden;
}
.banner .banner-dots {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 44rpx;
left: 0;
}
.banner .banner-dots .dots {
width: 12rpx;
height: 4rpx;
margin: 0 6rpx;
background-color: rgba(255, 255, 255, .3);
transition: all .5s;
}
.banner .banner-dots .dots.active {
background-color: #fff;
}
.marquee {
color: #414142;
height: 74rpx;
}
.util-box {
display: grid;
align-items: center;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx 0;
padding-bottom: 48rpx;
}
.util-box .item {
display: flex;
align-items: center;
flex-direction: column;
font-size: 24rpx;
color: #282829;
}
.util-box .item .sprite-icon {
margin-bottom: 12rpx;
}
.tips-box {
justify-content: center;
margin-bottom: 32rpx;
color: rgba(33, 33, 33, .6);
font-size: 24rpx;
}
.tips-box .item {
margin: 0 20rpx;
}
.tips-box .sprite-icon {
margin-right: 10rpx;
}
.equity-banner {
height: 230rpx;
margin: 0 32rpx 24rpx;
border-radius: 8rpx;
overflow: hidden;
}
.activity-box,
.goods-box .goods-content .goods-item {
padding: 32rpx 32rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.goods-box .goods-content .goods {
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.live-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 22rpx;
padding: 20rpx 0;
}
.live-item .live-preview {
position: relative;
width: 332rpx;
height: 168rpx;
border-radius: var(--borderRadius);
overflow: hidden;
}
.live-item .live-preview .tips {
position: absolute;
left: 0;
top: 0;
height: 24rpx;
display: flex;
align-items: center;
color: #FFFFFF;
border-radius: 0 0 8rpx 0;
overflow: hidden;
}
.live-item .live-preview .tips .value {
height: 24rpx;
font-size: 20rpx;
padding: 0 8rpx;
background: rgba(0, 0, 0, .59);
}
.live-item .live-preview .tips .label {
width: 64rpx;
font-size: 20rpx;
height: 100%;
}
.live-item .live-preview .in-live .label {
font-size: 16rpx;
background-color: var(--themeColor);
}
.live-item .live-preview .prediction .label {
background-color: var(--btnColor);
}
.live-item .live-preview .in-live .label image {
width: 10rpx;
height: 10rpx;
margin-right: 6rpx;
}
.live-item .live-info {
display: flex;
align-items: center;
margin-top: 20rpx;
}
.live-item .live-info .icon {
width: 48rpx;
height: 48rpx;
overflow: hidden;
border-radius: 100%;
margin-right: 24rpx;
}
.live-item .live-info .live-title {
width: 258rpx;
}
.goods-box,
.goods-box .goods-content .goods-item {
animation: show-box-opacity .5s forwards;
position: relative;
}
.anchor {
position: absolute;
}
.goods-box .goods-content {
/* min-height: 1254rpx; */
padding-bottom: 60rpx;
}
.goods-box .goods-content .page {
display: flex;
}
.goods-box .goods-content swiper {
height: 1104rpx;
}
.goods-box .btn {
margin: 60rpx auto 0;
border: 2rpx solid #979797;
border-radius: 4rpx;
width: 182rpx;
height: 54rpx;
font-size: 24rpx;
color: #656566;
}
.goods-box .btn .icon-mine-arrow {
margin-left: 12rpx;
}
.nothing {
flex-direction: column;
font-size: 28rpx;
color: #C1C2C3;
}
.nothing .icon {
width: 320rpx;
height: 320rpx;
margin-bottom: 8rpx;
}
.widget-box {
position: fixed;
right: 40rpx;
bottom: 232rpx;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: flex-end;
}
.widget {
height: 140rpx;
width: 112rpx;
box-sizing: border-box;
}
.widget-box .open {
position: relative;
z-index: 2;
}
/* @keyframes move {
0% {
transform: translateX(320rpx);
}
100% {
transform: translateX(80rpx);
}
} */
.widget .icon {
width: 100%;
height: 200%;
position: relative;
}
.online-text {
position: absolute;
top: 74rpx;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 28rpx;
font-size: 20rpx;
}
.widget-box .flex-box {
position: relative;
display: flex;
border-radius: var(--borderRadius);
padding: 10rpx 20rpx 10rpx 100rpx;
/* background: linear-gradient(201deg, #7BA6FF 0%, #1C72FB 100%); */
box-sizing: border-box;
animation: showFlex .5s forwards;
font-size: 20rpx;
justify-content: space-between;
width: 320rpx;
}
.widget-box .flex-box .view {
opacity: 0;
animation: showView .1s forwards .5s;
}
@keyframes showFlex {
0% {
right: -1000%;
}
100% {
right: 0;
}
}
@keyframes showView {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.close-icon {
width: 48rpx;
height: 48rpx;
position: absolute;
right: 90rpx;
top: 260rpx;
}
.close-icon image {
width: 48rpx;
height: 48rpx;
}
.model .bgkf {
width: 602rpx;
height: 862rpx;
position: absolute;
top: 328rpx;
left: 50%;
transform: translateX(-50%);
z-index: 99999;
}
.model .qr-box {
height: 686rpx;
width: 418rpx;
bottom: 96rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
}
.model .bgkf .icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.model .bgkf .icon image {
border-radius: 50%;
}
.userinfo-wrap {
position: absolute;
top: 0rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
flex-direction: column
}
.qr-box .text {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.qr-box .name {
font-size: 28rpx;
font-weight: 400;
color: #282829;
line-height: 40rpx;
margin: 8rpx 0 0 0;
text-align: center;
}
.qr-box .qr-icon {
width: 418rpx;
height: 492rpx;
margin-top: 50rpx;
position: relative;
}
.qr-box .qr-code {
width: 220rpx;
height: 220rpx;
margin-top: 104rpx;
}
.kf-text {
width: 348rpx;
height: 112rpx;
position: absolute;
z-index: 999998;
margin-top: 30rpx;
}
.kf-text image {
widows: 100%;
height: 100%;
}
\ No newline at end of file \ No newline at end of file
// pages/tab/mall/mall.js
import { discoveryApi, shopmallApi, carlifeApi } from '../../../api/api'
import { goShoppingCart } from '~/utils/routerApi'
const tab = [
{
zoneName: '汇划算商城',
isCustomer: true
},
{
zoneName: '门店自营',
id: ''
}
]
Page({
/**
* 页面的初始数据
*/
data: {
tagIndex: 0,
flag: true,
tabList: []
},
goShoppingCart() {
goShoppingCart()
},
tabclick(e) {
let { index } = e.detail
let { tagIndex, tabList } = this.data
if (index == tagIndex) return
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false
})
if (!tabList[index].isCustomer) this.getGoodsList(tabList[index].id)
else
this.setData({
goodsFlag: true
})
},
search(e) {
let value = e.detail
let { goodsList } = this.data
wx.$router.go('search', {
value,
goodsList
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
jump() {
wx.$router.intercept().then(response => {
if (response) return
carlifeApi.getBizjiaUrl().then(res => {
if (res) wx.$router.jumpH5(res)
})
})
},
getZoneInfo(sapCode) {
discoveryApi.getZoneInfo(2).then(data => {
let { img_version, IMGURL, tabList } = this.data
tab[0].zoneImg = `${IMGURL}mall/shop-banner.png?v=${img_version}`
tab[1].zoneImg = `${IMGURL}mall/default-banner.png?v=${img_version}`
tabList.push(...tab)
data.map(e => tabList.push(e))
this.setData({
goodsFlag: true,
flag: true,
tabList,
sapCode
})
})
},
getGoodsList(zoneId) {
wx.$util.showLoading('加载中...')
let params = {}
if (zoneId) params.zoneId = zoneId
shopmallApi.getGoodsList(params).then(({ list }) => {
this.setData({
goodsList: list,
goodsFlag: true
})
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let { tabList, tagIndex, sapCode } = this.data
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
if (storeCode != sapCode) {
this.setData({
tabList: [],
tagIndex: 0,
flag: false,
goodsList: [],
goodsFlag: false
})
this.getZoneInfo(storeCode)
return
}
if (tagIndex != 0) {
this.setData({
goodsList: [],
goodsFlag: false
})
this.getGoodsList(tabList[tagIndex].id)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
let path = this.route
if (merchantId) path = `${path}?merchantId=${merchantId}&storeCode=${storeCode || ''}`
return {
path
}
}
})
<search-box search-type="2" bindsearch="search"></search-box>
<block wx:if="{{flag}}">
<block wx:if="{{tabList.length}}">
<tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="52" bindclick="tabclick">
<view class="tab-view-box" slot="content">
<block wx:if='{{goodsFlag}}'>
<view class="box">
<view class="banner">
<image webp src="{{tabList[tagIndex].zoneImg}}"></image>
</view>
<block wx:if="{{tabList[tagIndex].zoneName}}">
<view class="title">
{{tabList[tagIndex].zoneName}}
<block wx:if="{{!tabList[tagIndex].isCustomer}}">
<view class="sprite-icon icon-goods-shopping" bindtap="goShoppingCart"></view>
</block>
</view>
</block>
<block wx:if="{{tabList[tagIndex].isCustomer}}">
<image webp src="{{IMGURL}}mall/shopmall-banner.png?v={{img_version}}" mode="widthFix" bindtap="jump"></image>
</block>
<block wx:else>
<view class="goods-box">
<block wx:if="{{goodsList.length}}">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="item">
<goods item="{{item}}"></goods>
</view>
</block>
</block>
<block wx:else>
<view class="list-nothing flex">
<view class="icon">
<image webp src="{{IMGURL}}mall/goods-nothing.png?v={{img_version}}"></image>
</view>
暂无相关商品
</view>
</block>
</view>
</block>
</view>
</block>
</view>
</tab-view>
</block>
<block wx:else>
<view class="list-nothing flex">
<view class="icon">
<image webp src="{{IMGURL}}mall/goods-nothing.png?v={{img_version}}"></image>
</view>
暂无相关商品
</view>
</block>
</block>
<login show="{{showLogin}}"></login>
\ No newline at end of file \ No newline at end of file
/* pages/tab/mall/mall.wxss */
.tab-view-box {
padding: 16rpx var(--margin);
}
.tab-view-box .banner {
height: 220rpx;
border-radius: 8rpx;
overflow: hidden;
}
.tab-view-box .title {
display: flex;
justify-content: space-between;
height: 80rpx;
align-items: center;
border-bottom: 2rpx solid #EFF0F2;
}
.tab-view-box .title .icon {
width: 40rpx;
height: 40rpx;
}
.tab-view-box .goods-box {
padding: 18rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.tab-view-box .goods-box .item{
width: 252rpx;
margin-bottom: 18rpx;
}
.list-nothing{
flex-direction: column;
}
\ No newline at end of file \ No newline at end of file
// pages/tab/mine/mine.js // pages/tab/mine/mine.js
const navStyle = 'background-color: transparent;'
import { ssoApi, mineApi, couponsApi, indexApi, boutiquecouponApi } from '../../../api/api'
import mapApi from '~/utils/mapapi/mapapi'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
utilList: [
{
text: '我的订单',
url: 'order'
},
{
text: '我的地址',
url: 'address'
},
{
text: '我的预约',
url: 'reservation'
},
// {
// text: '精品交付单',
// url: 'boutiquePages'
// },
{
text: '协议内容',
icon: 'order',
url: 'mineAgree',
notIntercept: true
},
{
text: '设置',
url: 'setting'
}
],
navStyle,
carList: []
},
/**授权用户头像昵称 */
showAuthModal() {
this.setData({
showAuth: true
})
},
authSuccess(e) {
let { data } = e.detail
/**调取后端接口储存用户头像昵称 */
if (data) {
ssoApi
.authUserInfo({
...data
})
.then(({ code }) => {
if (code == '0') {
getApp()
.login()
.then(({ data }) => {
this.setData({
userInfo: data
})
})
}
})
}
},
onPageScroll({ scrollTop }) {
if (scrollTop >= 38 && this.data.navStyle)
this.setData({
navStyle: ''
})
if (scrollTop < 38 && !this.data.navStyle)
this.setData({
navStyle
})
},
navbarReady(e) {
let { height } = e.detail
this.setData({
user_box_style: `padding-top:${height + 20}px`
})
},
goto(e) {
let { url, item, name } = e.currentTarget.dataset
let path = 'index'
if (name) path = name
wx.$router.go(`${this.rootName}.${url}.${path}`, item)
},
jump(e) {
const { item } = e.currentTarget.dataset
if (item.h5) {
wx.$router.jumpH5(item.h5)
} else {
wx.$router.go(`${this.rootName}.${item.url}.index`, { notIntercept: item.notIntercept || false })
}
},
init() {
this.getGHUserCarList()
},
phoneCall(e) {
let { phone } = e.currentTarget.dataset
wx.$util.phoneCall(phone)
},
getUserCouponList() {
couponsApi.getCouponNum().then(res => {
this.setData({
total: res.total
})
})
},
getBoutiquecouponList() {
boutiquecouponApi
.getBoutiquecouponList({
pageNum: 1,
pageSize: 999999,
usedFlag: 'N'
})
.then(data => {
this.setData({
gitTotal: data.total
})
})
},
getUserCarList() {
mineApi
.getUserCarList()
.then(data => {
let carInfo = null
data.map(e => {
if (e.carTypeName) carInfo = e
})
this.setData({
carInfo,
carFlag: true
})
})
.catch(() => {
this.setData({
carFlag: true
})
})
},
//获取当前用户顾问配置
getConsultantInfo() {
let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
}
let data = {
merchantId: merchantId
}
mineApi.getConsultantInfo(data).then(({ code, data }) => {
if (code == '0') {
this.setData({
consultant: data
})
}
})
},
//服务顾问
goCounselor() {
wx.$router.go('packageMine.counselor.index')
},
//打开服务顾问
openConsultant() {
wx.$router.go('packageMine.counselor.index')
},
getGHUserCarList() {
mineApi.getGHUserCarList().then(({ code, data }) => {
this.setData({
carFlag: true
})
if (code == '0') {
let { vehs } = data
if (vehs.length) {
let platPrefix = vehs[0].platNo.split('')[0]
vehs[0].platNumber = vehs[0].platNo.replace(platPrefix, '')
vehs[0].platPrefix = platPrefix
this.setData({
carList: vehs
})
}
}
})
},
login() {
this.setData({
showLogin: true
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -203,20 +18,6 @@ Page({ ...@@ -203,20 +18,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let { sapCode } = this.data
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
if (sapCode != storeCode) {
this.setData({
merchantDetail: null,
sapCode: storeCode
})
if (!wx.$isGroup) this.getMerchantDetail(storeCode)
}
if (!wx.$authStatus) {
this.getUserCouponList()
this.getConsultantInfo()
this.getBoutiquecouponList()
}
}, },
/** /**
...@@ -233,8 +34,6 @@ Page({ ...@@ -233,8 +34,6 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
if (wx.$authStatus) return
this.getGHUserCarList()
}, },
/** /**
...@@ -246,44 +45,5 @@ Page({ ...@@ -246,44 +45,5 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
let storeCode = wx.$storage.get('srcm_shopmall_store_code')
let path = this.route
if (merchantId) path = `${path}?merchantId=${merchantId}&storeCode=${storeCode || ''}`
return {
path
}
},
getMerchantDetail(storeCode) {
indexApi
.getGHStoreList({
storeCode
})
.then(data => {
if (data.length)
this.setData({
merchantDetail: data[0]
})
})
}, },
openLocation(e) {
let { item } = e.currentTarget.dataset
if (item.location.latitude == '0.0') {
mapApi.geocoder(item.address).then(({ location }) => {
wx.openLocation({
latitude: Number(location.lat),
longitude: Number(location.lng),
name: item.storeName,
address: item.address
})
})
return
}
wx.openLocation({
latitude: Number(item.location.latitude),
longitude: Number(item.location.longitude),
name: item.storeName,
address: item.address
})
}
}) })
File mode changed
/* pages/tab/mine/mine.wxss */
.layout {
padding-bottom: 60rpx;
}
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
}
.box {
margin: var(--margin);
}
.user-box {
position: relative;
height: 516rpx;
box-sizing: border-box;
padding-left: var(--margin);
background: linear-gradient(180deg, #EDF2FA 0%, #FFFFFF 100%);
}
.user-box .coupon-info {
position: absolute;
bottom: 40rpx;
left: 0;
width: 100%;
font-size: 48rpx;
text-align: center;
font-weight: 500;
}
.user-box .coupon-info .item{
flex: 1;
justify-content: center;
flex-direction: column;
align-items: center;
}
.user-box .coupon-info view {
font-size: 32rpx;
margin-top: 8rpx;
font-weight: normal;
}
.user-info {
display: flex;
align-items: center;
position: relative;
}
.user-info .auth-button {
position: absolute;
width: calc(100% + 32rpx);
height: 100%;
opacity: 0;
left: -32rpx;
padding: 0;
}
.avatar {
width: 108rpx;
height: 108rpx;
overflow: hidden;
border-radius: 100%;
margin-right: 16rpx;
}
.info.auth {
font-size: 32rpx;
}
.user-info .nickName {
display: flex;
align-items: center;
font-size: 32rpx;
}
.user-info .vip {
margin-left: 8rpx;
width: 80rpx;
height: 28rpx;
border: 2rpx solid #FC5B32;
color: #FC5B32;
border-radius: 16rpx;
font-size: 20rpx;
}
.user-info .phone {
margin-top: 4rpx;
}
.car-box {
background-color: #fff;
/* box-shadow: 0 4rpx 16rpx 0 rgba(0, 0, 0, 0.1); */
border-radius: var(--borderRadius);
/* height: 222rpx; */
}
.car-box.GH {
padding: 34rpx 40rpx 34rpx 24rpx;
/* height: 388rpx; */
/* height: 253rpx; */
}
.my-car {
/* height: 270rpx; */
/* height: 135rpx; */
/* background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(252, 91, 50, 0.06) 100%); */
border-radius: 8rpx;
box-sizing: border-box;
padding-top: 24rpx;
}
.add-car {
width: 100%;
height: 100%;
flex-direction: column;
font-size: 36rpx;
color: #C9CACC;
}
.add-car .btn {
width: 132rpx;
height: 50rpx;
color: #fff;
background-color: var(--btnColor);
box-shadow: 0 4rpx 12rpx 4rpx rgba(252, 91, 50, 0.1);
border-radius: 25rpx;
margin-top: 26rpx;
font-size: 24rpx;
padding-left: 8rpx;
}
.add-car .btn .sprite-icon{
margin-right: 8rpx;
}
.car-info {
width: 100%;
/* height: 100%; */
box-sizing: border-box;
/* padding: 34rpx 40rpx 34rpx 24rpx; */
font-size: var(--margin);
color: #656566;
}
.car-info .title {
font-weight: 500;
font-size: 36rpx;
display: flex;
justify-content: space-between;
align-items: center;
color: #282829;
}
.car-info .title .edit {
font-size: 24rpx;
font-weight: normal;
color: #656566;
display: flex;
align-items: center;
/* margin-right: 16rpx; */
}
.car-info .title .edit .icon-mine-arrow {
margin-left: 10rpx;
}
.car-info .plate-number {
margin: 22rpx 0 8rpx;
}
.car-info .car-brand {
font-size: 24rpx;
}
.merchant-box {
background-color: #fff;
box-sizing: border-box;
padding: var(--margin) 24rpx;
color: #656566;
font-size: 24rpx;
position: relative;
border-radius: 8rpx;
}
.merchant-box .title {
display: flex;
align-items: center;
justify-content: space-between;
color: #FC5B32;
}
.merchant-box .title .name {
font-size: 36rpx;
font-weight: 500;
color: #282829;
}
.merchant-box .address {
margin: 24rpx 0 8rpx;
}
.merchant-box .btn {
position: absolute;
bottom: var(--margin);
right: 24rpx;
width: 128rpx;
height: 50rpx;
background-color: var(--btnColor);
border-radius: 25rpx;
color: #fff;
}
.merchant-box .serve-item {
display: flex;
margin-top: 30rpx;
}
.merchant-box .serve-item .item {
margin-right: 28rpx;
width: 132rpx;
height: 50rpx;
padding-left: 8rpx;
background: #FC5B32;
box-shadow: 0px 4rpx 12rpx 4rpx rgba(252, 91, 50, 0.1);
border-radius: 25rpx;
color: #fff;
font-size: 24rpx;
box-sizing: border-box;
}
.merchant-box .serve-item .item .icon {
width: 48rpx;
height: 48rpx;
}
.user-items {
background-color: #fff;
margin-top: 20rpx;
border-radius: 8rpx;
}
.user-items .item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 28rpx;
height: 88rpx;
font-size: 28rpx;
}
.user-items .item .label {
display: flex;
align-items: center;
}
.user-items .item .icon {
margin-right: 20rpx;
}
.user-items .item .arrow {
width: 8rpx;
height: 14rpx;
}
.auth-phone-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 2;
}
.auth-phone-bg {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
}
.merchant-box .counselor {
margin-top: 24rpx;
width: 638rpx;
height: 88rpx;
background: linear-gradient(180deg, rgba(252, 91, 50, 0.06) 0%, rgba(252, 91, 50, 0.06) 100%);
border-radius: 8rpx;
padding: 0 16rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.counselor .userInfo {
display: flex;
align-items: center;
}
.userInfo .counselor-avatar {
width: 56rpx;
height: 56rpx;
border-radius: 50%;
margin-right: 12rpx;
}
.userInfo .counselor-avatar image{
border-radius: 50%;
}
.counselor .userInfo .user-phone {
display:flex;
align-items: center;
margin-right: 28rpx;
width: 132rpx;
height: 50rpx;
padding-left: 8rpx;
background: #FC5B32;
box-shadow: 0px 4rpx 12rpx 4rpx rgba(252, 91, 50, 0.1);
border-radius: 25rpx;
color: #fff;
font-size: 24rpx;
box-sizing: border-box;
}
.counselor .userInfo .icon {
width: 48rpx;
height: 48rpx;
}
.item-counselor {
width: 250rpx;
height: 50rpx;
border-radius: 25rpx;
border: 1px solid rgba(177,177,179, 0.29);
color: #656566;
font-size: 28rpx;
}
.item-counselor .icon{
width:30rpx;
height:32rpx;
margin:0 10rpx 0 24rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/tab/output/output.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"navigationBarTitleText": "商城" "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/output.wxss */
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/output.wxml-->
<text>pages/tab/output/output.wxml</text>
{ {
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": false,
"urlCheck": false, "urlCheck": false,
"lazyloadPlaceholderEnable": true "lazyloadPlaceholderEnable": true
}, },
......
import { secretKey, pathEnum, domain, index, sign } from './http.js' import {
secretKey,
pathEnum,
domain,
index,
sign
} from './http.js'
// import util from '../util' // import util from '../util'
import { getSessionId } from '~/utils/cache/storageApi' import {
getSessionId
} from '~/utils/cache/storageApi'
let INTERRUPT = false let INTERRUPT = false
/**接口 */ /**接口 */
class Request { class Request {
...@@ -10,18 +18,15 @@ class Request { ...@@ -10,18 +18,15 @@ class Request {
post(params, returnAll = false) { post(params, returnAll = false) {
return this.request('POST', params, returnAll) return this.request('POST', params, returnAll)
} }
reportTrack(params) {
return this.request('POST', params, true)
}
request(RequestMethods, params, returnAll) { request(RequestMethods, params, returnAll) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.showNavigationBarLoading() wx.showNavigationBarLoading()
let header = let header =
RequestMethods === 'POST' RequestMethods === 'POST' ?
? { {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} } :
: {} {}
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id') const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) header.merchantId = merchantId if (merchantId) header.merchantId = merchantId
let projectName = this.getRopProject(params.method) let projectName = this.getRopProject(params.method)
...@@ -38,33 +43,14 @@ class Request { ...@@ -38,33 +43,14 @@ class Request {
success(response) { success(response) {
/**业务代码 */ /**业务代码 */
let { let {
data: { code, message }, data: {
code,
message
},
data data
} = response } = response
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
wx.hideLoading() //重新登录
const thisPage = wx.$router.getPageInstance()
if (thisPage && thisPage.pageRefresh) thisPage.pageRefresh()
if (!wx.$authStatus) {
if (INTERRUPT) return
INTERRUPT = true
// wx.showLoading()
getApp()
.login()
.then(() => {
if (thisPage.init && thisPage.data.userInfo) thisPage.init()
if (thisPage.loginCallBack && thisPage.data.userInfo) thisPage.loginCallBack(thisPage.data.userInfo)
if (thisPage.onRoute) thisPage.onRoute()
thisPage.onLoad()
thisPage.onShow()
INTERRUPT = false
})
.catch(error => {
wx.hideLoading()
console.log('error', error)
})
// .finally(() => {})
}
} else { } else {
if (returnAll) { if (returnAll) {
resolve(data) resolve(data)
...@@ -125,22 +111,5 @@ class Request { ...@@ -125,22 +111,5 @@ class Request {
const projectName = method.split('.')[2] const projectName = method.split('.')[2]
return projectName return projectName
} }
getMock() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/config'
if (index == 3) url = 'https://oss-config.test.glsx.com.cn/mock/6274e3050da5034a58680aa6/config'
return new Promise(resolve => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
...@@ -175,7 +175,7 @@ class TRACK { ...@@ -175,7 +175,7 @@ class TRACK {
jsonList: prepare_data jsonList: prepare_data
} }
if (prepare_data && prepare_data.length) if (prepare_data && prepare_data.length)
api.reportTrack(data).then(({ code, data, message }) => { api.post(data,true).then(({ code, data, message }) => {
if (code == 0 && data) { if (code == 0 && data) {
$Storage.set('prepare_data', []) $Storage.set('prepare_data', [])
console.log('---------------- 埋点定时推送成功 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', prepare_data) console.log('---------------- 埋点定时推送成功 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', prepare_data)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!