Commit b226e22f by 匡雅琴

Merge branch 'v1.0.0' of http://192.168.3.233:8090/saas/mini-program/zhwy into v1.0.0

2 parents 57f40c71 560ff6d7
Showing 65 changed files with 4170 additions and 85 deletions
...@@ -8,4 +8,11 @@ module.exports = { ...@@ -8,4 +8,11 @@ module.exports = {
zoneType //专区类型(1发现频道,2商城专区) zoneType //专区类型(1发现频道,2商城专区)
}) })
}, },
/*获取商户详情 */
getMerchantDetail(data) {
return api.post({
method: 'scrm.api.carlife.merchant.detail',
...data
})
}
} }
\ No newline at end of file \ No newline at end of file
import api from '../request/http' import api from '../request/http'
const carlife = 'scrm.api.carlife.weapp.'
module.exports = { module.exports = {
/**获取集团或者门店详细信息 */ /**获取集团或者门店详细信息 */
getMerchantDetail(data) { getMerchantDetail(data) {
...@@ -8,8 +8,8 @@ module.exports = { ...@@ -8,8 +8,8 @@ module.exports = {
...data ...data
}) })
}, },
/**获取当前用户的收货地址列表 */ /**获取当前用户的收货地址列表 */
getUserAddressList(data) { getUserAddressList(data) {
return api.post({ return api.post({
method: `scrm.api.carlife.weapp.userAddress.list`, method: `scrm.api.carlife.weapp.userAddress.list`,
...data ...data
...@@ -69,5 +69,56 @@ module.exports = { ...@@ -69,5 +69,56 @@ module.exports = {
method: 'scrm.api.shopmall.weapp.order.statis', method: 'scrm.api.shopmall.weapp.order.statis',
...data ...data
}) })
} },
/** 获取当前用户的车辆列表 */
getUserCarList(data) {
return api.post(
{
method: `${carlife}userCar.list`,
...data
},
true
)
},
/** 获取用户车辆 */
getUserCar(carId) {
return api.post({
method: `${carlife}userCar.getById`,
carId
})
},
/**新增用户车辆 */
addUserCar(data) {
return api.post({
method: `${carlife}userCar.add`,
...data
})
},
/** 更新用户车辆 */
updateUserCar(data) {
return api.post({
method: `${carlife}userCar.update`,
...data
})
},
/** 获取车品牌列表 */
getCarBrandList() {
return api.post({
method: 'scrm.api.carlife.common.getOnlyCarBrandList'
})
},
/** 获取车系列表 */
getCarSeriesList(data) {
return api.post({
method: 'scrm.api.carlife.common.getCarSeriesList',
...data
})
},
/** 获取车型 */
getCarTypeList(carSeriesId) {
return api.post({
method: 'scrm.api.carlife.common.getCarTypeList',
carSeriesId
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -195,4 +195,10 @@ module.exports = { ...@@ -195,4 +195,10 @@ module.exports = {
id id
}) })
}, },
removeBuuCar(data) {
return api.post({
method: "scrm.api.shopmall.weapp.shoppingcart.delete.batch",
...data,
});
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -23,6 +23,7 @@ App({ ...@@ -23,6 +23,7 @@ App({
storage: new utils.cache.Storage(), storage: new utils.cache.Storage(),
}; };
// 存储设备信息 // 存储设备信息
console.log(wx.p);
utils.cache.storageApi.setSystem_info(); utils.cache.storageApi.setSystem_info();
}, },
/**页面不存在时触发 */ /**页面不存在时触发 */
......
...@@ -64,6 +64,13 @@ ...@@ -64,6 +64,13 @@
] ]
}, },
{ {
"root": "packageMall",
"pages": [
"pages/shoppingCart/shoppingCart",
"pages/pay/pay"
]
},
{
"root": "packageMine", "root": "packageMine",
"pages": [ "pages": [
"pages/setting/index", "pages/setting/index",
...@@ -81,7 +88,19 @@ ...@@ -81,7 +88,19 @@
"pages/coupon/center/center", "pages/coupon/center/center",
"pages/coupon/detail/detail", "pages/coupon/detail/detail",
"pages/coupon/recommend/recommend", "pages/coupon/recommend/recommend",
"pages/coupon/usedDetail/usedDetail" "pages/coupon/usedDetail/usedDetail",
"pages/device/index/index",
"pages/device/list/list",
"pages/device/tachograph/tachograph",
"pages/vehicleInfo/index/index",
"pages/vehicleInfo/carBrandList/carBrandList"
]
},
{
"root": "packageDiscovery",
"pages": [
"pages/pay/index",
"pages/PayResult/payResult"
] ]
} }
], ],
...@@ -90,7 +109,9 @@ ...@@ -90,7 +109,9 @@
"glsx-image": "/components/image/index", "glsx-image": "/components/image/index",
"authorize": "/components/Authorize/Authorize", "authorize": "/components/Authorize/Authorize",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"goods-action": "/components/GoodsAction/GoodsAction" "goods-action": "/components/GoodsAction/GoodsAction",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"stepper": "/components/Stepper/Stepper"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
...@@ -5,7 +5,7 @@ page { ...@@ -5,7 +5,7 @@ page {
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
--themeColor: #3772EC; --themeColor: #3772EC;
--btnColor: #3772EC; --btnColor: #EC3C1F;
--borderRadius: 8rpx; --borderRadius: 8rpx;
--margin: 32rpx; --margin: 32rpx;
/* 兼容 IOS<11.2 先constant再env */ /* 兼容 IOS<11.2 先constant再env */
......
// components/Stepper/Stepper.js
Component({
/**
* 组件的属性列表
*/
properties: {
count: Number,
min: {
type: Number,
value: 1
},
max: {
type: Number,
value: 99,
observer(n) {
if (n && this.data.count > n) {
this.setData({ count: n })
this.triggerEvent('change', Number(n))
}
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail
let {
max,
} = this.data
if (value > max) value = max
this.setData({ count: value })
},
tap() { },
blur(e) {
let { value } = e.detail
let {
min,
} = this.data
if (value < min) value = min
this.setData({ count: value })
this.triggerEvent('change', Number(value))
},
change(e) {
let {
add
} = e.currentTarget.dataset
let num = add ? 1 : -1
let {
count,
min,
max
} = this.data
if (count == min && !add) return
if (count == max && add) return
count += num
this.triggerEvent('change', Number(count))
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="stepper-box">
<view class="minus count-box text-center {{count == min?'opacity':''}}" catchtap="change"></view>
<input class="num count-box text-center" type="number" catchinput="input" value="{{count}}" catchblur="blur" catchtap="tap" />
<view class="add count-box text-center {{count == max?'opacity':''}}" catchtap="change" data-add>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Stepper/Stepper.wxss */
@import '/style/common.wxss';
.stepper-box {
display: flex;
align-items: center;
}
.stepper-box .count-box {
width: 52rpx;
height: 52rpx;
background: #F0F0F0;
margin-left: 7rpx;
font-size: 26rpx;
text-align: center;
color: #323233;
font-weight: normal;
position: relative;
}
.stepper-box .count-box.opacity::after ,.stepper-box .count-box.opacity::before{
opacity: .25;
}
.stepper-box .minus {
border-radius: 7rpx 0 0 7rpx;
background: transparent;
}
.stepper-box .num {
width: 59rpx;
}
.stepper-box .add {
border-radius: 0 7rpx 7rpx 0;
background: transparent;
}
.stepper-box .add::before,
.stepper-box .add::after,
.stepper-box .minus::after {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
content: '';
background-color: #2C2C2C;
border-radius: 2rpx;
}
.stepper-box .add::before,.stepper-box .minus::after {
width: 25rpx;
height: 2rpx;
}
.stepper-box .add::after{
width: 2rpx;
height: 25rpx;
}
\ No newline at end of file \ No newline at end of file
module.exports = Behavior({
data: {
devList: [{
order: 0,
appId: 'wx0c181d09a93d5982',
path: 'pages/tab/ctrl',
text: '智能香氛等离子健康舒适系统'
}, {
order:1,
appId: 'wx9e9c52dfbcc5c8a0',
path: 'pages/lamplight/lamplight',
text: '豪车智控氛围灯'
},{
order:2,
appId:'wx51feceda9f533228',
path:'pages/home/index',
text:'小云记录仪'
},{
order: 3,
appId:'wx0c17d7f15dad5e6d',
path:'pages/index/index',
text:'智能车钥匙'
},{
order: 4,
text:'行车记录仪'
}]
},
methods:{
jumpDev(e) {
let {item} = e.currentTarget.dataset
if(item.appId)
wx.navigateToMiniProgram(item)
else {
wx.p.router.go('/packageShopmall/packageMine/pages/device/tachograph/tachograph', {
notIntercept: true
})
}
}
}
})
\ No newline at end of file \ No newline at end of file
...@@ -2,10 +2,12 @@ import kfMixin from './kfMixin' ...@@ -2,10 +2,12 @@ import kfMixin from './kfMixin'
import orderMixin from './orderMixin' import orderMixin from './orderMixin'
import afterSaleMixin from './afterSaleMixin' import afterSaleMixin from './afterSaleMixin'
import countdownMixin from './countdownMixin' import countdownMixin from './countdownMixin'
import devMixin from './devMixin'
module.exports = { module.exports = {
kfMixin, kfMixin,
orderMixin, orderMixin,
afterSaleMixin, afterSaleMixin,
countdownMixin countdownMixin,
devMixin
} }
import {
shopmallApi
} from '~/api/api'
Page({
/**
* 页面的初始数据
*/
data: {
count: 5,
payStatus: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options,123355);
wx.$api.showLoading('加载中')
if (options && options.orderCode) {
this.checkPay(options.orderCode)
this.query = JSON.parse(options.query)
this.ids = JSON.parse(options.ids)
this.orderCode = options.orderCode
this.buyType = options.buyType
}
},
// 查询支付状态
checkPay(orderCode) {
this.inval = setInterval(() => {
this.checkOrderDetail(orderCode)
}, 1000)
},
countdown() {
this.timer = setInterval(() => {
let { count } = this.data
if (count == 0) {
clearInterval(this.timer)
this.toOrder()
return
}
this.setData({
count: --count
})
}, 1 * 1000)
},
pay() {
let _this = this
wx.$api.showLoading('加载中')
shopmallApi
.createOrder(this.query)
.then(data => {
if (data.code == -1) {
wx.hideLoading()
wx.showToast({
title: data.message,
icon: 'error'
})
return
}
if(this.buyType!='pay'){
this.removeCar(this.ids)
}
let subOrderCode = data.subOrderDTOS[0].subOrderCode
wx.hideLoading()
wx.navigateToMiniProgram({
appId: 'wx06d1198e751435d1',
path: `packagesPayment/pages/payment/index?orderCode=${subOrderCode}`,
envVersion: 'trial',
success(res) {
_this.checkPay(_this.orderCode)
}
})
})
},
// 查询订单详情
checkOrderDetail(orderCode) {
shopmallApi.orderDetailInfo({ orderCode }).then(res => {
if (res && res.payStatus && res.payStatus > 1) {
clearInterval(this.inval)
this.countdown()
wx.hideLoading();
this.setData({
payStatus: res.payStatus == 2 ? 1 : 2,
giveIntegral: res.giveIntegral
})
}
})
},
// 支付前移除购物车
removeCar(ids) {
shopmallApi
.removeBuuCar({
ids
})
.then(data => { })
},
toCar() {
wx.$router.reLaunch('/packageShopmall/packageMall/pages/shoppingCart/shoppingCart')
// wx.$router.go('/packageShopmall/packageMall/pages/shoppingCart/shoppingCart')
},
toOrder() {
wx.$router.reLaunch('/packageShopmall/packageMine/pages/order/index/index')
},
onUnload(){
clearInterval(this.timer)
clearInterval(this.inval)
},
onHide() {
clearInterval(this.timer)
clearInterval(this.inval)
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText":" "
}
\ No newline at end of file \ No newline at end of file
page {
background: white;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 80rpx;
}
.status_icon {
width: 88rpx;
height: 88rpx;
}
.status_text {
font-weight: 600;
font-size: 40rpx;
color: #1B233D;
margin-top: 24rpx;
}
.tips {
font-weight: 400;
font-size: 24rpx;
color: #7A8299;
margin-top: 12rpx;
}
.success_banner {
margin-top: 64rpx;
margin-bottom: 82rpx;
position: relative;
.banner {
width: 750rpx;
height: 328rpx;
}
.successText {
width: 750rpx;
font-weight: 500;
font-size: 32rpx;
color: #1F1F1F;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
.max {
font-weight: 600;
font-size: 56rpx;
color: #FC5B32;
margin: 0 4rpx;
}
}
.successTip {
width: 750rpx;
text-align: center;
font-weight: 400;
font-size: 24rpx;
color: #AD8C76;
position: absolute;
left: 50%;
bottom: 88rpx;
transform: translate(-50%, 0);
}
}
.btn {
width: 402rpx;
height: 80rpx;
background: #FC5B32;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
}
.small_tip {
font-weight: 400;
font-size: 22rpx;
color: #B9BABB;
margin-top: 16rpx;
}
.btn_group{
display: flex;
align-items: center;
justify-content: space-between;
width: 750rpx;
box-sizing: border-box;
padding: 0 40rpx;
margin-top: 128rpx;
}
.fail{
padding-top: 208rpx;
.btn_w{
width: 324rpx;
}
.car{
background: white;
border: 1rpx solid #FC5B32;
color: #FC5B32;
}
}
<view class="container {{payStatus==2?'fail':''}}">
<!-- 支付成功 -->
<block wx:if="{{payStatus==1}}">
<glsx-image class="status_icon" webp src="glsx/equity/return_success.png"></glsx-image>
<view class="status_text">支付成功</view>
<view class="tips">您的订单已支付成功,请耐心等待商品发货!</view>
<view class="success_banner">
<glsx-image class="banner" webp src="glsx/discover/version/3_14_0/order_result_bg.png"></glsx-image>
<view class="successText">
<text>恭喜获得</text>
<text class="max">+{{giveIntegral}}</text>
<text>养车积分</text>
</view>
<view class="successTip">积分已到账,可前往「我的积分」查看</view>
</view>
<view bind:tap="toOrder" class="btn flex_cc">查看订单</view>
<view class="small_tip">{{count}}秒后自动跳转到订单详情页面</view>
</block>
<!-- 支付失败 -->
<block wx:if="{{payStatus==2}}">
<glsx-image class="status_icon" webp src="glsx/equity/return_fail.png"></glsx-image>
<view class="status_text">支付失败</view>
<view class="tips">支付遇到问题,请尝试重新支付。</view>
<view class="btn_group">
<view bind:tap="toCar" class="btn btn_w car flex_cc">返回购物车</view>
<view bind:tap="pay" class="btn btn_w flex_cc">重新支付</view>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
Component({
properties: {
show: {
type: Boolean,
observer: function (n) {
console.log(n)
if (n) setTimeout(() => {}, 0.5 * 1000)
}
},
only: {
type: Boolean,
value: true
},
couponData: {
type: Object,
observer(n) {
if (n.length)
this.setData({
noData: true
})
return n
}
},
order: {
type: Number
},
defaultData: String
},
observers: {
couponData: function (newVal) {
return newVal
}
},
/**
* 组件的初始数据
*/
data: {
noData: false,
},
/**
* 组件的方法列表
*/
methods: {
getCoupon(e) {
let merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
let { item } = e.currentTarget.dataset
wx.p.wxApi.showLoading('领取中...')
wx.p.api.shopmallApi
.getCoupon({
couponIdList: [item.couponId],
receiveWay: 1,
receiveSource: 3,
merchantId: Number(merchantId)
})
.then(({ code, data, message }) => {
wx.hideLoading()
if (code == '0') {
wx.showToast({
title: '领取成功',
icon: 'none'
})
let thisPage = wx.p.router.getPageInstance()
if (thisPage.getCouponList) thisPage.getCouponList()
}
})
},
// 更换优惠券
selectCoupon(e) {
let { index } = e.currentTarget.dataset
for (let i = 0; i < this.data.couponData.length; i++) {
if (index == i) {
this.data.couponData[i].isChecked = !this.data.couponData[i].isChecked
} else {
this.data.couponData[i].isChecked = false
}
this.setData({
couponData: this.data.couponData
})
}
},
//确认
confirm() {
this.triggerEvent('click', this.data.couponData)
this.setData({
couponData: this.data.couponData
})
}
},
lifetimes: {
attached() {}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<popup title="选择优惠券" show="{{show}}" only="{{only}}" bindconfirm="confirm" height="75%">
<view class="coupon-box">
<view class="box">
<scroll-view style="height:100%;" scroll-y>
<block wx:if="{{noData}}">
<view class="coupon-wrap" wx:for="{{couponData}}" wx:key="index">
<view class="left_text_one left_text_two {{item.denomination.length>4?'text-36':'text-48'}}">
<text class="price_icon">¥</text>
<text>{{(item.denomination)/100}}</text>
</view>
<view class="main_box">
<view class="title_text">{{item.couponName}}</view>
<view class="h4_text mt4" wx:if="{{item.useBarriers == 1}}">无限制</view>
<view class="h4_text" wx:if="{{item.useBarriers == 2}}">满减</view>
<!-- 未领取,effectiveType == 1,就显示effectiveDays有效,effectiveType == 2 显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text mt8" wx:if="{{item.couponStatus == 0&&item.effectiveType == 1}}">领取后{{item.effectiveDays}}天内有效</view>
<view class="h4_text mt8" wx:if="{{item.couponStatus == 0&&item.effectiveType == 2}}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text mt8" wx:if="{{item.couponStatus == 0&&item.effectiveType == 3}}">无期限</view>
<!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text mt8" wx:if="{{item.couponStatus == 1&&item.effectiveType == 1||item.couponStatus == 1&&item.effectiveType == 2 }}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text mt8" wx:if="{{item.couponStatus == 1&&item.effectiveType == 3}}">无期限</view>
</view>
<block wx:if="{{item.couponStatus == 0}}">
<view class="box_btn box_btn_color" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view>
<view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view>
<view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view>
<view class="already" wx:if="{{item.couponStatus == 1}}">
<glsx-image webp src="discover/coupons/been.png" />
</view>
</block>
<block wx:else>
<view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked&&!item.userDisable}}" bindtap="selectCoupon">
<glsx-image webp src="discover/coupons/select.png" />
</view>
<view class="noSelect" data-item="{{item}}" data-index="{{index}}" wx:if="{{!item.isChecked&&!item.userDisable}}" bindtap="selectCoupon"></view>
</block>
</view>
</block>
<!-- <block>
<view class="dissatisfy">以下不满足使用条件</view>
<view class="coupon-wrap gray" >
<view class="left_icon_box">
<view class="left_text_one left_text_two">
<text class="price_icon">¥</text>
<text>50</text>
</view>
<view class="left_text_five left_text_three">满99可用</view>
</view>
<view class="main_box">
<view class="title_text">优惠券名称</view>
<view class="h4_text">满300减50,仅限会场商品</view>
<view class="h4_text mt8">无限期</view>
</view>
<view class="circle-gray"></view>
<view class="reason">不可用原因:仅可购买XXX商品A</view>
</view>
</block> -->
</scroll-view>
</view>
</view>
<view wx:if="{{!noData}}" class="no_data">
<glsx-image webp class="nodata_bg" src="discover/coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
/* components/CarBrands/CarBrands.wxss */
.coupon-box {
margin: 0 40rpx;
}
.coupon-wrap {
width: 100%;
height: 156rpx;
background-image:url(https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/mine/coupon/coupon_bg.png);
background-repeat: no-repeat;
background-size: 100%;
box-sizing: border-box;
position: relative;
padding: 24rpx 32rpx;
display: flex;
align-items: center;
margin-top: 20rpx;
border-radius: 8rpx;
}
.gray {
width: 686rpx;
height: 196rpx;
background: rgba(201, 202, 204, 0.1) !important;
border-radius: 8rpx;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
min-width:118rpx;
text-align: left;
font-weight: 600;
color: #FC5B32;
z-index: 2;
}
.text-36 {
font-size: 36rpx;
}
.text-48 {
font-size: 48rpx;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_four {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.left_text_three {
font-size: 28rpx;
margin-top: 6rpx;
width: 156rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
}
.left_text_five {
font-size: 28rpx;
color: #FFFFFF;
z-index: 2;
}
.anText {
font-size: 70rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
color: #FFF;
opacity: 0.45;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
margin-bottom: 7rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 132rpx;
height: 50rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 50rpx;
}
.box_btn_color {
background: var(--btnColor);
color: #FFFFFF;
}
.box_btn_color_grey {
background: #B1B1B3;
}
.title_text {
font-weight: 600;
font-size: 28rpx;
color: #FC5B32;
width: 440rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.box_btn_color_been {
font-size: 28rpx;
font-weight: 400;
color: #FC5B32;
line-height: 40rpx;
white-space: nowrap;
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
}
.h4_text {
font-weight: 400;
font-size: 20rpx;
color: #D83C14;
}
.mt4{
margin-top:4rpx;
}
.mt8{
margin-top:8rpx;
}
.y-center {
display: flex;
align-items: center;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
.already {
width: 75rpx;
height: 74rpx;
position: absolute;
bottom: 0;
right: 0;
z-index: 99;
}
.dissatisfy {
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
margin-top: 32rpx;
}
.circle-gray {
width: 40rpx;
height: 40rpx;
background: #E3E3E6;
border: 2rpx solid rgba(177, 177, 179, 1);
border-radius: 50%;
}
.reason {
width: 686rpx;
height: 60rpx;
background: rgba(253, 194, 62, 0.06);
font-size: 24rpx;
font-weight: 400;
color: #F13C3D;
line-height: 60rpx;
padding: 0 20rpx;
box-sizing: border-box;
position: absolute;
bottom: -60rpx;
left: 0;
}
.reason::before {
content: '!';
width: 28rpx;
height: 28rpx;
border: 1rpx solid #F13C3D;
color: #F13C3D;
box-sizing: border-box;
border-radius: 50%;
display: inline-block;
text-align: center;
line-height: 24rpx;
margin-right: 12rpx;
}
.circle-selected {
width: 40rpx;
height: 40rpx;
}
.noSelect {
width: 40rpx;
height: 40rpx;
background: #ffffff;
border: 2rpx solid rgba(177, 177, 179, 1);
border-radius: 50%;
}
.box {
height: 55vh;
overflow-y: scroll;
padding-bottom: 50rpx;
}
.box_btn_color_been_gray {
font-size: 28rpx;
font-weight: 400;
color: #B1B1B3;
line-height: 40rpx;
white-space: nowrap;
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
}
\ No newline at end of file \ No newline at end of file
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer(n) {
this.setData({
close: !n
})
}
},
specificationDetailList: {
type: Object,
observer(n) {
}
},
showName: String,
skuData: {
type: Object,
observer(n) {
this.setDefaultSku(n)
}
},
isActivity: Boolean,
},
/**
* 组件的初始数据
*/
data: {
goodsNumber: 1
},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setDefaultSku(skuData) {
console.log(this.data)
let {
specificationDetailList
} = this.data
let {
specificationList
} = skuData
let defaultGoods = specificationDetailList.specificationData.split('&')
specificationList.map(e => {
defaultGoods.map(i => {
let [key, value] = i.split('-')
if (key == e.specificationName) {
e.specificationValueList.map(c => {
if (c.specificationValue == value) c.active = true
})
}
})
})
specificationDetailList.retailPrice = wx.p.format.centsToyuan(specificationDetailList.retailPrice)
this.setData({
skuObj: skuData,
goodsInfo: specificationDetailList,
goodsNumber:specificationDetailList.goodsNumber
})
},
choose(e) {
let {
ind,
index
} = e.currentTarget.dataset
let {
skuObj: {
specificationList,
id,
specificationExtraList
},
isActivity
} = this.data
let activeList = []
if (specificationList[index].specificationValueList[ind].active) return
specificationList[index].specificationValueList.map(i => (i.active = false))
specificationList[index].specificationValueList[ind].active = true
specificationList.map(i => {
i.specificationValueList.map(c => {
if (c.active) activeList.push(`${i.specificationName}-${c.specificationValue}`)
})
})
let specificationData = activeList.join('&')
this.setData({
[`skuObj.specificationList[${index}]`]: specificationList[index]
})
if (isActivity) {
specificationExtraList.map((i, i_index) => {
if (i.specificationData == specificationData) {
let retailPrice = i.retailPrice
if (i_index != 0) retailPrice = wx.p.format.centsToyuan(i.retailPrice)
this.setData({
goodsInfo: {
retailPrice,
stock: i.stock,
specificationData,
specificationKey: i.specificationKey
}
})
}
})
} else {
wx.p.api.shopmallApi
.getGoodsSpecificationExtra({
goodsId: id,
specificationData
})
.then(data => {
data.retailPrice = wx.p.format.centsToyuan(data.retailPrice)
this.setData({
goodsInfo: data
})
console.log(this.data.goodsInfo)
})
}
this.setData({
goodsNumber: 1
})
const thisPage = wx.p.router.getPageInstance()
thisPage.setData({
activeSku: specificationData
})
},
changeCount(e) {
let goodsNumber = e.detail
this.setData({
goodsNumber
})
},
closeSku() {
let thisPage = wx.p.router.getPageInstance()
let {
showName
} = this.data
this.setData({
close: true
})
setTimeout(() => {
thisPage.setData({
[showName]: false
})
}, 0.5 * 1000)
console.log(thisPage)
thisPage.checkAll()
},
click(e) {
let {
goodsInfo: {
stock
}
} = this.data
let _this = this
if (stock === 0) return
let thisPage = wx.p.router.getPageInstance()
let {
goodsList,
currentIndex
} = thisPage.data
let updates = ['goodsInfo.specificationKey', 'goodsNumber', 'goodsInfo.specificationData']
updates.forEach(key => {
let attr = key.split('.').pop()
goodsList[currentIndex][attr] = _this.redeceData(this.data, key)
})
thisPage.setData({
goodsList
})
this.closeSku()
},
redeceData(obj, rest) {
return rest.split('.').reduce((newObj, key) => newObj[key], obj)
},
},
lifetimes: {
// attached() {
// this.setData({
// isFullSucreen: wx.p.wxApi.isFullSucreen()
// })
// }
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="sku" catchtouchmove="noScroll" hidden="{{!show}}">
<view class="sku-bg" bindtap="closeSku"></view>
<view class="sku-box isFullSucreen {{close?'close':''}}">
<scroll-view class="sku-content" scroll-y>
<view class="view">
<view class="goods-box">
<view class="preview">
<image webp src="{{skuObj.goodsImage || skuObj.activityImg}}"></image>
</view>
<view class="goods-info">
<view class="price">
<text class="unit">¥</text>{{goodsInfo.retailPrice}}
</view>
<view class="count">
<block wx:if="{{goodsInfo.stock}}">
有货(库存{{goodsInfo.stock}})
</block>
<block wx:else>无货</block>
</view>
<view class="active text-hide">已选:{{goodsInfo.specificationData}}</view>
</view>
</view>
<view class="sku-list">
<block wx:for="{{skuObj.specificationList}}" wx:key="index">
<view class="sku-title">{{item.specificationName}}</view>
<view class="sku-item">
<block wx:for="{{item.specificationValueList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item text-center {{i.active?'active':''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-index="{{index}}"
data-ind="{{ind}}">{{i.specificationValue}}</view>
</block>
</view>
</block>
<view class="sku-title">
数量
<stepper count="{{goodsNumber}}" max="{{goodsInfo.stock}}" bindchange="changeCount"></stepper>
</view>
<view class="sku-title">
发货
<view class="value">快递:{{skuObj.expressFee||'免运费(请以提交订单时为准)'}}</view>
</view>
</view>
</view>
</scroll-view>
<view class="sku-btn-box">
<view class="sku-btn">
<view class="pay text-center {{goodsInfo.stock === 0?'disabled':''}} " bindtap="click" >确定</view>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Sku/Sku.wxss */
@import '/style/common.wxss';
.sku {
position: fixed;
left: 0;
bottom: 0;
right: 0;
top: 0;
z-index: 9;
}
.sku-bg {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
}
.sku-box {
position: absolute;
width: 100%;
height: 76%;
background: #FFFFFF;
border-radius: 16rpx 16rpx 0 0;
left: 0;
animation: show-sku-box .5s forwards;
z-index: 2;
}
.sku-box.close {
animation: hide-popup-box .5s forwards;
}
.sku-box.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
@keyframes show-sku-box {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
@keyframes hide-popup-box {
0% {
bottom: 0;
}
100% {
bottom: -100%;
}
}
.sku-content {
box-sizing: border-box;
height: calc(100% - 100rpx);
}
.sku-content .view {
padding: 0 40rpx;
}
.sku-content .goods-box {
display: flex;
align-items: center;
position: sticky;
background-color: #fff;
z-index: 2;
top: 0;
padding-bottom: 18rpx;
}
.sku-content .goods-box .preview {
width: 180rpx;
height: 180rpx;
border-radius: 4rpx;
margin-right: 40rpx;
overflow: hidden;
margin-top: 40rpx;
}
.sku-content .goods-box .goods-info {
width: calc(100% - 220rpx);
}
.sku-content .goods-box .price {
color: var(--btnColor);
font-size: 64rpx;
margin-bottom: 10rpx;
}
.sku-content .goods-box .price .unit {
font-size: 40rpx;
}
.sku-content .goods-box .count {
color: #B9BABB;
font-size: 20rpx;
margin-bottom: var(--borderRadius);
}
.sku-content .goods-box .active {
font-size: 20rpx;
color: #707071;
}
.sku-box .sku-list {
padding-bottom: 40rpx;
}
.sku-box .sku-title {
color: #2D2D2E;
font-weight: 500;
padding-top: var(--margin);
display: flex;
align-items: center;
justify-content: space-between;
}
.sku-title .value {
color: #565759;
font-weight: normal;
}
.sku-box .sku-item {
display: flex;
flex-wrap: wrap;
}
.sku-box .sku-item .item {
height: 52rpx;
background: #F7F8FA;
padding: 0 20rpx;
margin: 20rpx 20rpx 0 0;
font-size: 24rpx;
color: #656566;
border: 2rpx solid #F7F8FA;
box-sizing: border-box;
border-radius: 4rpx;
}
.sku-box .sku-item .item.active {
border-color: rgb(252, 91, 50);
color: rgb(252, 91, 50);
background-color: rgba(252, 91, 50, .06);
}
.sku-btn-box {
height: 100rpx;
padding: 10rpx var(--margin);
}
.sku-btn {
border-radius: var(--borderRadius);
display: flex;
overflow: hidden;
}
.sku-btn .join,
.sku-btn .pay {
flex: 1;
height: 80rpx;
color: #fff;
}
.sku-btn .join {
background-color: #FDC23E;
}
.sku-btn .pay {
background-color: var(--btnColor);
}
.disabled{
background-color: #B1B1B3 !important;
/* border-color: #B1B1B3 !important; */
color: #000000!important;
}
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "确认订单",
"usingComponents": {
"discovery-sku":"./components/Sku/Sku",
"discoupon-goods":"./components/CouponGoods/CouponGoods"
}
}
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "确认订单"
}
\ No newline at end of file \ No newline at end of file
<view class="layout" style="padding-bottom:{{padding_bottom }}px">
<view class="box">
<block wx:if="{{addressFlag}}">
<block wx:if="{{shopFlag && shopCartFlag}}">
<view class="address-box" bindtap="jump">
<block wx:if="{{contactInfo.contactAddress}}">
<view class="left">
<view class="top">
<view class="name text-hide">{{contactInfo.contactName}}</view>
<block wx:if="{{isDefault}}">
<view class="default text-center">默认地址</view>
</block>
<view class="phone">{{contactInfo.contactPhone}}</view>
</view>
<view class="bottom text-hide">{{contactInfo.contactAddress}}</view>
</view>
</block>
<block wx:else>
选择收货地址
</block>
<view class="right text-center">
<view class="sprite-icon icon-mine-arrow"></view>
</view>
</view>
</block>
</block>
<view class="content-box">
<view class="merchantName text-hide">
{{merchantName}}
</view>
<block wx:for="{{goodsList}}" wx:key="index">
<view class="item">
<view class="content">
<view class="goods-info">
<view class="preview">
<image webp src="{{item.goodsImage}}"></image>
</view>
<view class="text">
<view class="name">
<view class="text-hide">
{{item.goodsName}}
</view>
<view class="text-hide description">{{item.specificationData || ''}}</view>
</view>
<view class="price-box">
<view class="price">
<text class="unit">¥</text>{{item.retailPrice}}
</view>
<view wx:if="{{!isPay}}">
x{{item.goodsNumber}}
</view>
<stepper wx:if="{{isPay}}" count="{{item.goodsNumber}}" max="{{item.stock}}" data-id="{{isActivity?item.goodsId:item.id}}" bindchange="changeCount" data-index="{{index}}"></stepper>
</view>
</view>
</view>
</view>
</view>
</block>
</view>
<block wx:if="{{expressFee != null}}">
<view class="tips" wx:if="{{shopFlag}}">
运费:
<view class="price">¥{{expressFee}}</view>
</view>
</block>
<block wx:if="{{!isActivity}}">
<block wx:if="{{orderCouponDTO}}">
<view class="tips discounts" bindtap="showCouponFun">
优惠:
<block wx:if="{{orderCouponDTO.isChecked}}">
<view class="selected">已选一张</view>
<view class="price">-¥{{(orderCouponDTO.denomination)/100}}</view>
</block>
<block wx:else>
<view>不使用优惠券</view>
</block>
</view>
</block>
</block>
</view>
</view>
<coupon-goods show="{{showCoupon}}" order="{{1}}" couponData="{{userCouponDTOS}}" bindclick="changeCoupon"></coupon-goods>
<block wx:if="{{addressFlag}}">
<goods-action bindready="goodsActionReady" custom>
<view class="goods-action">
<view class="left">
<view class="radio">
共{{goodsNumber}}件,合计:
</view>
<view class="total">
<view class="price">
<text class="unit">¥</text>{{money|| 0}}
</view>
</view>
</view>
<view class="btn text-center" bindtap="checkOut">结算({{goodsList.length}})</view>
</view>
</goods-action>
</block>
<!-- 支付成功 -->
<view wx:if="{{showSuccessModal}}" class="modal-container flex_ccc">
<view class="modal-body">
<glsx-image src="equity/return_success.png" class="icon"></glsx-image>
<view class="text">支付成功</view>
<view class="btn flex_ccc" catch:tap="closeSuccessModal">我知道了</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/pay/pay.wxss */
@import "../shoppingCart/shoppingCart.wxss";
.address-box {
padding: var(--margin) 20rpx;
height: 164rpx;
background-color: #fff;
border-radius: var(--borderRadius);
box-sizing: border-box;
margin-bottom: 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.address-box .left {
width: 580rpx;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
padding-left: 8rpx;
}
.address-box .left .top {
display: flex;
align-items: center;
}
.address-box .default {
width: 120rpx;
height: 40rpx;
font-size: 24rpx;
color: #fff;
background-color: var(--themeColor);
border-radius: 4rpx;
margin: 0 20rpx;
flex-shrink: 0;
}
.address-box .bottom{
color: #B1B1B3;
}
.address-box .phone {
margin-left: auto;
}
.address-box .right {
width: calc(100% - 580rpx);
justify-content: flex-end;
}
.address-box .right .icon {
width: 16rpx;
height: 28rpx;
}
.content-box{
padding-left: 24rpx;
background-color: #fff;
border-radius: 8px;
}
.merchantName{
display: flex;
height: 82rpx;
align-items: center;
padding-right: 24rpx;
border-bottom: 2rpx solid #EFF0F2;
}
.box .item .content .goods-info {
width: 100%;
}
.text .description {
font-size: 24rpx;
margin-top: 4rpx;
color: #B1B1B3;
}
.tips {
box-sizing: border-box;
height: 100rpx;
padding: 0 var(--margin);
border-radius: var(--borderRadius);
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #666;
background-color: #fff;
}
.tips .price {
font-size: 36rpx;
color: var(--btnColor);
font-weight: 500;
}
.goods-action .left {
display: flex;
align-items: center;
justify-content: space-between;
width: calc(100% - 360rpx);
font-size: 24rpx;
}
.goods-action .left .total{
width: auto;
}
.discounts {
margin-top: 24rpx;
position:relative;
}
.discounts .selected {
height: 40rpx;
background: rgba(252, 91, 50, 0.12);
border-radius: 4rpx;
font-size: 24rpx;
font-weight: 500;
color: #FC5B32;
line-height: 40rpx;
padding:0 20rpx;
position:absolute;
left:104rpx;
top: 50%;
transform: translate(0, -50%);
}
/*支付成功*/
.modal-container{
background: rgba(0,0,0,0.8000);
z-index: 9999;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.modal-body{
width: 83%;
height: 364rpx;
background: #FFFFFF;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.modal-body .icon{
width: 100rpx;
height: 100rpx;
margin-top: 48rpx;
}
.modal-body .text{
font-size: 32rpx;
font-weight: 500;
color: #2D2D2E;
margin-top: 24rpx;
}
.modal-body .btn{
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1rpx;
border-top: 1rpx solid #e5e5e5;
height: 98rpx;
font-size: 32rpx;
font-weight: 500;
color: #FC5B32;
}
.flex_ccc{
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
Page({
/**
* 页面的初始数据
*/
data: {
goodsList: [],
chooseIndex: null
},
goodsActionReady(e) {
this.setData({
padding_bottom: e.detail
})
},
jump() {
let pageList = getCurrentPages()
if (pageList.at(-2)?.route == 'pages/tab/shopMall/index') wx.p.router.back(pre => {
pre.changeTabBar({
detail: 2
})
})
else wx.p.router.reLaunch('/pages/tab/shopMall/index')
},
changeCount(e) {
console.log(e)
let count = e.detail
let {
index,
item,
ind
} = e.currentTarget.dataset
if (item.goodsNumber == count) return
let {
chooseIndex
} = this.data
this.setData({
[`goodsList[${index}].list[${ind}].goodsNumber`]: count
})
if (chooseIndex == index) this.cheackAll(index)
wx.p.wxApi.showLoading('正在加载...')
let params = {
id: item.id,
goodsId: item.goodsId,
goodsNumber: count
}
if (item.specificationKey) params.specificationKey = item.specificationKey
params.cartType = item.cartType
wx.p.api.shopmallApi.updateShoppingcart(params).then(res => {
wx.hideLoading()
})
},
choose(e) {
let {
index,
ind
} = e.currentTarget.dataset
let {
goodsList,
chooseIndex
} = this.data
if (chooseIndex != null && chooseIndex != index) return
if (goodsList[index].list[ind].showDel) {
this.hide(e)
return
}
this.setData({
[`goodsList[${index}].list[${ind}].active`]: !goodsList[index].list[ind].active
})
this.cheackAll(index)
},
cheackAll(index) {
let count = 0
let sum = 0
let {
goodsList
} = this.data
let allActive = true
try {
goodsList[index].list.map(e => {
if (!e.active) throw false
})
} catch (error) {
allActive = error
}
goodsList[index].list.map(e => {
if (e.active) {
count += e.goodsNumber
sum += e.retailPrice * e.goodsNumber
}
})
this.setData({
[`goodsList[${index}].active`]: allActive,
count,
sum: sum == 0 ? 0 : Number(sum).toFixed(2),
chooseIndex: count == 0 ? null : index
})
},
chooseAll(e) {
let {
index
} = e.currentTarget.dataset
let {
goodsList,
chooseIndex
} = this.data
if (chooseIndex != null && chooseIndex != index) return
let all = true
try {
goodsList[index].list.map(i => {
if (!i.active) throw false
})
} catch (error) {
goodsList[index].list.map(i => (i.active = true))
all = error
}
if (all) goodsList[index].list.map(i => (i.active = false))
this.setData({
goodsList
})
this.cheackAll(index)
},
checkOut() {
let {
chooseIndex,
goodsList
} = this.data
let {
list,
payeeMerchantName,
platform,
upgrade,
payeeMerchantId,
carOwner
} = goodsList[chooseIndex]
let data = []
list.map(e => (e.active ? data.push(e) : ''))
if (carOwner) {
let showAddr = 0
data.forEach(el=>{
if(el.deliveryType==2){
showAddr = 1
}
})
wx.p.router.go('/packageDiscovery/pages/pay/index', {
goodsList: data,
merchantName: payeeMerchantName,
merchantId: payeeMerchantId,
isCarOwner:true,
showAddr,
discoverGoodsSource:1,
deliveryType:0
})
} else {
wx.p.router.go('/packageMall/pages/pay/pay', {
goodsList: data,
merchantName: payeeMerchantName,
platformShop: platform || false,
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// wx.p.router.getData(page => {
// this.getShoppingcartList()
// })
this.getShoppingcartList()
},
getShoppingcartList() {
wx.p.wxApi.showLoading('加载中...')
let para = {
cartType: 0
}
wx.p.api.shopmallApi
.getShoppingcartList(para)
.then(data => {
// 拆分各个平台的商品
let upgradeGoods = [], ownGoods = [], yzhGoods = [], _tempArr = [],carOwnerGoods = []
data.map(e => {
// e.list.map(i => (i.retailPrice = Number(i.retailPrice).toFixed(2)))
let upgradeItem = {
payeeMerchantId: e.payeeMerchantId,
payeeMerchantName: '嘀加智享',
upgrade: true,
platform: false,
list: []
}, ownItem = {
payeeMerchantId: e.payeeMerchantId,
payeeMerchantName: e.payeeMerchantName,
upgrade: false,
platform: false,
list: []
}, yzhItem = {
payeeMerchantId: e.payeeMerchantId,
payeeMerchantName: e.payeeMerchantName,
upgrade: false,
platform: true,
list: []
},carOwnerItem = {
payeeMerchantId: e.payeeMerchantId,
payeeMerchantName: '嘀加智享',
carOwner: true,
platform: false,
list: []
}
e.list.map(i => {
i.retailPrice = Number(i.retailPrice).toFixed(2)
if (i.cartType == 3) {
i.upgrade = true
upgradeItem.list.push(i)
} else if (i.cartType == 2) {
i.platform = true
yzhItem.list.push(i)
} else if (i.cartType == 1) {
ownItem.list.push(i)
}else if(i.cartType == 4){
if(i.goodsSource==1){
i.carOwner = true
i.retailPrice = i.activityPrice
carOwnerItem.list.push(i)
}else if(i.goodsSource==2){
ownItem.list.push(i)
}
}
})
if (upgradeItem.list.length) upgradeGoods.push(upgradeItem)
if (yzhItem.list.length) yzhGoods.push(yzhItem)
if (ownItem.list.length) ownGoods.push(ownItem)
if (carOwnerItem.list.length) carOwnerGoods.push(carOwnerItem)
})
_tempArr = [...ownGoods,...carOwnerGoods, ...upgradeGoods, ...yzhGoods]
this.setData({
goodsList: _tempArr,
shoppingcartFlag: true,
count: 0,
sum: 0,
chooseIndex: null
}, () => { })
wx.hideLoading()
})
.catch(() => {
this.setData({
shoppingcartFlag: true
})
})
},
del(e) {
wx.p.wxApi.showLoading('请稍后...')
let {
id, item
} = e.target.dataset
let para = {
cartType: item.cartType,
id
}
wx.p.api.shopmallApi.delShoppingcart(para).then(res => {
wx.p.wxApi.showToast('删除成功')
wx.$Track.setTrack({
id,
type: '购物车移除商品'
},
7
)
setTimeout(() => {
this.getShoppingcartList()
}, 1.5 * 1000)
})
},
hide(e) {
let {
goodsList
} = this.data
let {
index,
ind
} = e.currentTarget.dataset
if (goodsList[index].list[ind].showDel)
this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: false
})
},
start(e) {
let cell = e.changedTouches[0]
this.startX = cell.clientX
this.startY = cell.clientY
},
move(e) {
let {
startX,
startY
} = this
let {
index,
ind
} = e.currentTarget.dataset
let {
clientX,
clientY
} = e.changedTouches[0]
let X = clientX - startX
let Y = clientY - startY
let angle = (360 * Math.atan(Y / X)) / (2 * Math.PI)
let result = clientX < startX
if (Math.abs(angle) > 30) return
this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: result
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "购物车"
}
\ No newline at end of file \ No newline at end of file
<view class="layout" style="padding-bottom:{{padding_bottom }}px">
<block wx:if="{{shoppingcartFlag}}">
<block wx:if="{{!goodsList.length}}">
<view class="nothing-box">
<view class="nothing">
<view class="icon">
<image webp src="{{IMGURL}}mall/shoppingcart.png?v={{img_version}}" />
</view>
购物车还是空的
<view class="btn text-center" bindtap="jump">随便看看</view>
</view>
</view>
</block>
<block wx:else>
<view class="box">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="item-box {{chooseIndex != null && chooseIndex != index?'disabled':''}}">
<view class="top" catchtap="chooseAll" data-index="{{index}}" >
<view class="icon text-center">
<icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#FC5B32':'#B1B1B3'}}" size="20">
</icon>
</view>
<view class="name text-hide">
{{item.payeeMerchantName}}
</view>
</view>
<view class="list">
<block wx:for="{{item.list}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="item {{i.showDel?'touch-move-active':''}}" data-index="{{index}}" data-ind="{{ind}}"
bindtouchstart="start" bindtouchmove="move">
<view class="content" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}">
<view class="icon">
<icon type="{{i.active?'success':'circle'}}" color="{{i.active?'#FC5B32':'#B1B1B3'}}" size="20">
</icon>
</view>
<view class="goods-info">
<view class="preview">
<image webp src="{{i.goodsImage}}"></image>
</view>
<view class="text">
<view class="text-hide">{{i.goodsName}}</view>
<view class="specification" wx:if="{{i.specificationData}}">{{i.specificationData}}</view>
<view class="price-box">
<view wx:if="{{i.carOwner}}" class="price">
<text class="unit">¥</text>{{i.activityPrice || 0}}
</view>
<view wx:else class="price">
<text class="unit">¥</text>{{i.retailPrice || 0}}
</view>
<stepper count="{{i.goodsNumber}}" max="{{i.goodsStock}}" catchchange="changeCount"
data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}"></stepper>
</view>
</view>
</view>
</view>
<view class="del text-center" catchtap="del" data-item="{{i}}" data-id="{{i.id}}">删除</view>
</view>
</block>
</view>
</view>
</block>
</view>
</block>
</block>
</view>
<block wx:if="{{goodsList.length}}">
<goods-action bindready="goodsActionReady" custom>
<view class="goods-action">
<view class="total">合计:
<view class="price">
<text class="unit">¥</text>{{sum||0}}
</view>
</view>
<view class="btn text-center" bindtap="checkOut">结算({{count||0}})</view>
</view>
</goods-action>
</block>
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/shoppingCart/shoppingCart.wxss */
.nothing-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: #fff;
}
.nothing {
padding-top: 140rpx;
text-align: center;
color: #B1B1B3;
}
.nothing .icon {
margin: 0 auto 8rpx;
width: 322rpx;
height: 320rpx;
}
.nothing .btn {
margin: 64rpx auto 0;
width: 332rpx;
height: 88rpx;
border-radius: 8rpx;
border: 2rpx solid #B1B1B3;
color: #656566;
font-size: 32rpx;
}
.box {
padding: 24rpx var(--margin);
}
.item-box {
margin-bottom: 24rpx;
background: #FFFFFF;
border-radius: 8rpx;
padding-left: 24rpx;
}
.item-box.disabled {
opacity: .5;
}
.item-box .top {
height: 80rpx;
display: flex;
align-items: center;
padding-right: 24rpx;
}
.item-box .top .icon {
margin-right: 18rpx;
}
.item-box .top .name {
width: calc(100% - 50rpx);
}
.item-box .list {
border-top: 2rpx solid #EFF0F2;
}
.box .item {
width: 100%;
height: 208rpx;
background: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 24rpx;
overflow: hidden;
display: flex;
justify-content: space-between;
position: relative;
}
.box .item .content {
width: 100%;
padding-right: 24rpx;
box-sizing: border-box;
transition: all .5s;
transform: translateX(112rpx);
margin-left: -112rpx;
position: relative;
display: flex;
align-items: center;
}
.box .item .content .icon,
.box .item .content .goods-info .preview {
margin-right: 20rpx;
}
.box .item .content .goods-info {
width: calc(100% - 60rpx);
display: flex;
align-items: center;
}
.box .item .content .goods-info .preview {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
overflow: hidden;
}
.box .item .content .goods-info .text {
width: calc(100% - 180rpx);
height: 160rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box .item .content .goods-info .text .price-box {
display: flex;
align-items: baseline;
justify-content: space-between;
}
.box .item .content .goods-info .text .price-box .price {
color: var(--btnColor);
font-size: 36rpx;
display: flex;
align-items: baseline;
font-weight: 500;
}
.box .item .content .goods-info .text .price-box .price .unit {
font-size: 24rpx;
}
.box .item .del {
width: 112rpx;
height: 100%;
background: var(--themeColor);
transform: translateX(112rpx);
transition: all .5s;
color: #fff;
}
.box .touch-move-active .content,
.box .touch-move-active .del {
transform: translateX(0);
}
.goods-action {
padding: 10rpx var(--margin);
box-sizing: border-box;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.goods-action .btn {
width: 332rpx;
height: 80rpx;
color: #FFFFFF;
background: var(--btnColor);
border-radius: var(--borderRadius);
font-weight: 500;
}
.goods-action .total {
width: calc(100% - 360rpx);
font-size: 24rpx;
display: flex;
align-items: baseline;
}
.goods-action .total .price {
color: var(--btnColor);
font-size: 40rpx;
display: flex;
align-items: baseline;
font-weight: 500;
}
.goods-action .total .price .unit {
font-size: 24rpx;
}
.specification {
font-size: 24rpx;
color: #B1B1B3;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/device/index/index.js
import { mineApi } from '~/api/api'
Page({
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.router.getData(res => {
console.log(res)
if (res.name == '特惠加油') {
this.setData({
isGas: true
})
wx.setNavigationBarTitle({ title: '特惠加油' })
}
})
mineApi.getAppQrcode().then(data => {
this.setData({
src: data
})
})
},
save() {
let { unauthorized, src } = this.data
if (unauthorized) {
this.setData({
showAuth: true
})
return
}
wx.getImageInfo({
src
})
.then(res => {
wx.saveImageToPhotosAlbum({
filePath: res.path
}).then(() => {
wx.$api.showToast('保存成功')
})
})
.catch(() => {
wx.hideLoading()
wx.$api.showToast('图片保存失败,请重试')
})
},
authSuccess() {
this.setData({
unauthorized: false
})
},
authFail() {
this.setData({
unauthorized: true
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"usingComponents": {},
"navigationBarTitleText": "我的设备"
}
\ No newline at end of file \ No newline at end of file
<view class="ctn">
<view class="top-box">
<view class="iconTitle">请扫描以下二维码下载</view>
<view class="text">“智享车生活”{{isGas?'App劲享加油优惠':'App管理设备'}}</view>
<view class="icon">
<image webp src="{{src}}"></image>
</view>
<glsx-image src="mine/equipmentIcon.png" class="equipmentIcon"></glsx-image>
</view>
<view class="default-btn" bindtap="save">保存</view>
</view>
<authorize scopeType="writePhotosAlbum" bindsuccess="authSuccess" bindfail="authFail" show="{{showAuth}}"></authorize>
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/device/index/index.wxss */
page {
background-image: linear-gradient(180deg, #2A69FF 0%, #629DFF 100%);
}
.ctn {
display: flex;
flex-direction: column;
align-items: center;
font-weight: 500;
font-size: 36rpx;
color: #202848;
line-height: 56rpx;
font-family: PingFangSC-Medium;
}
.ctn .top-box {
width: calc(100% - 64rpx);
height: 80%;
background: #FFFFFF;
background-image: linear-gradient(0deg, rgba(244,247,252,0.00) 89%, #EAF0FC 100%);
border: 6rpx solid #FFFFFF;
border-radius: 32rpx;
margin: 40rpx 32rpx 0;
display: flex;
flex-direction: column;
align-items: center;
}
.icon {
width: 292rpx;
height: 292rpx;
background-image: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #ECF1FB 80%);
box-shadow: inset 0 2rpx 6rpx 0 rgba(255,255,255,0.50);
border-radius: 16rpx;
padding: 28rpx;
margin: 40rpx 0 48rpx;
}
.equipmentIcon {
width: 390rpx;
height: 368rpx;
margin-bottom: 10rpx;
}
.iconTitle {
margin-top: 80rpx;
}
.default-btn {
margin-top: 60rpx;
background: #FFFFFF;
border-radius: 8rpx;
font-size: 28rpx;
color: #23272F;
line-height: 40rpx;
font-family: PingFangSC-Regular;
}
\ No newline at end of file \ No newline at end of file
const navStyle = 'background-color: transparent;'
import { devMixin } from '~/mixins/index'
Page({
behaviors: [devMixin],
/**
* 页面的初始数据
*/
data: {
navStyle: 'background-color: transparent;'
},
navbarReady(e) {
console.log(e)
let {
height
} = e.detail
this.setData({
top: height
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(wx.getStorageSync('device_info')){
const devList = wx.getStorageSync('device_info')
this.setData({devList})
}
this.getUserCarList()
},
init(){
this.getUserCarList()
},
getUserCarList() {
wx.p.api.mineApi.getUserCarList().then(({
code,
data
}) => {
this.setData({
carFlag: true
})
if (code == '0') {
let carInfo = null
data.map(e => {
if (e.carTypeName) carInfo = e
})
this.setData({
carInfo
})
}
})
},
setUp(e) {
const {index} = e.currentTarget.dataset
const {devList} = this.data
const selectItem = devList[index]
console.log(selectItem)
devList.splice(index,1)
devList.unshift(selectItem)
wx.setStorageSync('device_info', devList)
this.setData({
devList
})
},
goto(e) {
let {
url,
item,
name
} = e.currentTarget.dataset
let path = 'index'
if (name) path = name
console.log(`/packageMine/pages/${url}/${path}/${path}`);
wx.p.router.go(`/packageMine/pages/${url}/${path}/${path}`, item)
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageShopmall/packageMine/pages/device/list/list.wxss */
.layout {
position: relative;
.bg {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 400rpx;
}
.header {
box-sizing: border-box;
margin: 16rpx 20rpx 0 20rpx;
background-image: linear-gradient(180deg, #F4F7FF 0%, #FFFFFF 100%);
border: 2rpx solid #FFFFFF;
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx;
.row {
box-sizing: border-box;
padding: 28rpx 32rpx 0 32rpx;
&-title {
font-weight: 500;
font-size: 32rpx;
color: #0A0D14;
}
&-btn {
font-weight: 400;
font-size: 24rpx;
color: #858A94;
}
.icon {
width: 28rpx;
height: 28rpx;
margin-left: auto;
}
}
.cell {
box-sizing: border-box;
padding: 24rpx 0 36rpx 32rpx;
display: flex;
&-icon {
width: 84rpx;
height: 84rpx;
margin-right: 20rpx;
}
&-right {
.right-up {
display: flex;
align-items: center;
.box-text {
width: 40rpx;
height: 40rpx;
background: #2A69FF;
border-radius: 4rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.bold-text {
font-weight: 500;
font-size: 28rpx;
color: #0A0D14;
margin-left: 8rpx;
}
}
.right-down {
margin-top: 16rpx;
font-weight: 400;
font-size: 24rpx;
color: #3F444D;
.bold-text {
font-weight: 600;
font-size: 24rpx;
color: #3F444D;
}
}
}
}
}
.box {
padding: 20rpx;
.item {
height: 152rpx;
padding: 16rpx 24rpx;
box-sizing: border-box;
background: #FFFFFF;
border-radius: 16rpx;
margin-bottom: 20rpx;
font-size: 26rpx;
color: #0A0D14;
position: relative;
.top-icon {
width: 48rpx;
height: 48rpx;
position: absolute;
right: 36rpx;
top: 52rpx;
}
.icon {
width: 120rpx;
height: 120rpx;
margin-right: 12rpx;
}
}
}
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.icon-mine-arrow {
transform: translateY(8rpx);
margin-left: 6rpx;
}
\ No newline at end of file \ No newline at end of file
<navigation-bar navStyle="{{navStyle}}" showBack page-title="管理智能汽车" bindnavbarReady="navbarReady">
管理智能汽车
</navigation-bar>
<view class="layout" style="padding-top:{{top}}px;">
<glsx-image class="bg" src="mine/dev-bg.webp"></glsx-image>
<view wx:if="{{carInfo}}" class="header">
<view class="row flex_scb">
<view class="row-title">我的车辆</view>
<view class="row-btn flex_scb" bindtap="goto" data-url="vehicleInfo" data-item="{{carInfo}}">
管理
<view class="icon">
<glsx-image src="mine/mine-arrow.png"></glsx-image>
</view>
</view>
</view>
<view class="cell">
<glsx-image class="cell-icon" webp src="mine/carPicture.png"></glsx-image>
<view class="cell-right">
<view class="right-up">
<view class="box-text flex_cc">{{carInfo.platPrefix}}</view>
<view class="bold-text">{{carInfo.platNumber}}</view>
</view>
<view class="right-down">
<text class="blod-text">{{carInfo.brandName}} ·</text>
<text>{{carInfo.seriseName}}{{carInfo.carTypeName}}</text>
</view>
</view>
</view>
</view>
<view class="box">
<block wx:for="{{devList}}" wx:key="index">
<view class="item flex" bindtap="jumpDev" data-item="{{item}}">
<glsx-image src="mine/dev-{{item.order}}.png" class="icon" />
<view class="top-icon" catchtap='setUp' data-index="{{index}}">
<glsx-image src="mine/top.png" class="top" />
</view>
{{item.text}}
</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '../../../../config'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: IMG_URL,
},
setCopyData(e) {
const text = e.currentTarget.dataset.title;
wx.$api.setCopyData(text, () => {
wx.$api.showToast('复制成功')
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "下载智享车生活"
}
\ No newline at end of file \ No newline at end of file
/* packageShopmall/packageMine/pages/device/tachograph/tachograph.wxss */
.page {
position: absolute;
top: 0rpx;
left: 0rpx;
width: 100%;
min-height: 100%;
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/mine/tachograph-bg.png);
background-size: 100% 100%;
.page-head {
display: flex;
align-items: center;
margin: 140rpx 60rpx 28rpx;
.icon {
width: 144rpx;
height: 144rpx;
}
.head-content {
margin-left: 10rpx;
&-title {
font-weight: 700;
font-size: 50rpx;
color: #171D2D;
.clone-btn {
margin-left: 10rpx;
font-weight: 400;
font-size: 24rpx;
color: #388BFB;
vertical-align: middle;
display: inline-block;
width: 128rpx;
text-align: center;
height: 44rpx;
line-height: 44rpx;
background: #BFE1FE;
border-radius: 22rpx;
}
}
&-desc {
opacity: 0.39;
font-size: 28rpx;
color: #171D2D;
}
}
}
.page-main {
&-border {
width: 686rpx;
height: 584.08rpx;
margin: 0 auto;
&.ios {
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/mine/tachograph-ios.png);
background-size: 100% 100%;
}
&.android {
position: relative;
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/mine/tachograph-android.png);
background-size: 100% 100%;
.qrcode {
position: absolute;
width: 214rpx;
height: 214rpx;
left: 236rpx;
bottom: 136rpx;
border-radius: 40rpx;
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageShopmall/packageMine/pages/device/tachograph/tachograph.wxml-->
<view class="page">
<view class="page-head">
<view class="head-icon">
<glsx-image class="icon" src="mine/tachograph-icon.png"></glsx-image>
</view>
<view class="head-content">
<view class="head-content-title">
<text>智享车生活</text>
<text class="clone-btn" bind:tap="setCopyData" data-title="智享车生活">点击复制</text>
</view>
<view class="head-content-desc">开启车家互联新生活</view>
</view>
</view>
<view class="page-main">
<view class="page-main-border ios"></view>
<view class="page-main-border android">
<image class="qrcode" show-menu-by-longpress="{{true}}" src="{{IMGURL}}mine/deviceQrcode.png"></image>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
Page({
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let data = wx.p.storage.get('scrm_shopmall_car_brand_list')
if (data) {
this.formatData(data)
} else {
wx.p.api.mineApi.getCarBrandList().then(data => {
wx.p.storage.set('scrm_shopmall_car_brand_list', data)
this.formatData(data)
})
}
},
formatData(data) {
let letterList = Array.from(new Set([...data.map(e => e.letter)]))
let brandList = letterList.map(e => {
let list = []
data.map(i => {
if (e === i.letter) {
list.push(i)
}
})
return {
letter: e,
list
}
})
this.setCarData(brandList)
},
setCarData(brandList) {
wx.p.wxApi.showLoading('加载中...')
let count = 0
let settime = setInterval(() => {
if (null != brandList[count].list && brandList[count].list.length > 0) {
this.setData({
[`brandList[${count}]`]: brandList[count]
})
}
count++
if (count >= brandList.length) {
clearInterval(settime)
this.getLetter()
}
}, 10)
},
getLetter() {
wx.hideLoading()
let { brandList, letter } = this.data
let arr = []
if (brandList.length > 0) {
brandList.forEach(e => {
arr.push(e.letter)
})
this.setData({
arr,
letter,
flag: true
})
}
setTimeout(() => {
this.getSideBarInfo()
}, 500)
},
getSideBarInfo() {
let _this = this
wx.p.wxApi.getViewInfo('#letter-A', res => {
wx.p.wxApi.getViewInfo('#side-bar', _res => {
_this.setData({
letterHeight: res.height,
toTop: res.height + _res.top,
height: _res.bottom
})
})
})
},
showChilds(e) {
let { index, ind } = e.currentTarget.dataset
let brandList = this.data.brandList[index].list[ind]
this.setData({
[`brandList[${index}].list[${ind}].active`]: !brandList.active
})
},
showCarSeriesList(e) {
let { item, that } = e.currentTarget.dataset
this.chooseData = {
brandName: item.name,
brandId: item.id,
brandChildName: that.name,
brandChildId: that.id
}
wx.p.wxApi.showLoading('加载中...')
wx.p.api.mineApi
.getCarSeriesList({
brandId: item.id,
childBrandId: that.id
})
.then(data => {
this.setData({
carSeriesList: data
})
wx.hideLoading()
})
},
cancel() {
this.setData({
carSeriesList: []
})
},
toggle(e) {
console.log(e)
let { index, id } = e.currentTarget.dataset
let { carSeriesList } = this.data
if (carSeriesList[index].active) {
this.setData({
[`carSeriesList[${index}].active`]: false
})
return
}
wx.p.wxApi.showLoading('加载中...')
wx.p.api.mineApi.getCarTypeList(id).then(data => {
this.setData({
[`carSeriesList[${index}].list`]: data,
[`carSeriesList[${index}].active`]: data ? true : false
})
wx.hideLoading()
})
},
choose(e) {
let { item, that } = e.currentTarget.dataset
this.chooseData = {
...this.chooseData,
seriseName: item.name,
seriseId: item.id,
carTypeName: that.name,
carTypeId: that.id
}
wx.$router.back(page => {
let { obj } = page.data
obj = {
...obj,
...this.chooseData
}
console.log(this.chooseData)
page.setData({
obj
})
})
},
noScroll() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
start(e) {
let { letter } = e.target.dataset
this.setData({
showTip: true,
letter
})
},
move(e) {
let { letterHeight, showTip, height, toTop, arr } = this.data
let { y, num, isNum } = this
if (showTip) {
y = e.touches[0].clientY
num = Math.ceil((y - toTop) / letterHeight)
if (num < 0) num = 0
if (y < height && isNum != num) {
clearTimeout(this.time)
isNum = num
this.time = setTimeout(() => {
this.setData({
letter: arr[num]
})
}, 1000 / 60)
}
}
},
end(e) {
clearTimeout(this.time)
this.setData({
showTip: false
})
}
})
{
"navigationBarTitleText": "品牌车型"
}
\ No newline at end of file \ No newline at end of file
<view class="car-brands-box">
<view class="car-brands">
<scroll-view style="height:100%;" scroll-y scroll-into-view="{{letter}}">
<block wx:if="{{flag}}">
<block wx:if="{{brandList.length > 0}}">
<block wx:for="{{brandList}}" wx:key="index">
<view id="{{item.letter}}">
<view class="title y-center">{{item.letter}}</view>
<view class="box">
<block wx:for="{{item.list}}" wx:for-item="i" wx:key="ind" wx:for-index="ind">
<view class="brands" catchtap="showChilds" data-index='{{index}}' data-ind='{{ind}}'>
<view class="list y-center">
{{i.name}}
</view>
<block wx:if="{{i.active && i.childs}}">
<block wx:for="{{i.childs}}" wx:key="cind" wx:for-item="c" wx:for-index="cind">
<view class="list y-center child" catchtap="showCarSeriesList" data-item="{{i}}"
data-that="{{c}}">
{{c.name}}
</view>
</block>
</block>
</view>
</block>
</view>
</view>
</block>
</block>
<block wx:else>
<view class="nothing">暂无数据</view>
</block>
</block>
</scroll-view>
<view class="side-bar" id="side-bar">
<block wx:for="{{brandList}}" wx:key="index">
<view data-letter="{{item.letter}}" class="view {{item.active?'active':''}}" capture-catch:touchstart="start"
id="letter-{{item.letter}}" data-index="{{index}}" capture-catch:touchmove="move"
capture-catch:touchend="end">{{item.letter}}
</view>
</block>
</view>
<!-- 提示 -->
<view class='tips' hidden='{{!showTip}}'>{{letter}}</view>
</view>
<!-- 车系车型 -->
<block wx:if="{{carSeriesList.length}}">
<view class="car-type-box">
<view class="bg" bindtap="cancel" catchtouchmove="noScroll"></view>
<view class="brands-box">
<block wx:for="{{carSeriesList}}" wx:key="index">
<view class="title y-center" bindtap="toggle" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}
</view>
<view class="box" hidden="{{!item.active}}">
<block wx:for="{{item.list}}" wx:for-item="i" wx:key="id">
<view class="brands-list y-center" bindtap="choose" data-item="{{item}}" data-that="{{i}}">{{i.name}}
</view>
</block>
</view>
</block>
</view>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
/* components/CarBrands/CarBrands.wxss */
page{
background: white;
}
.y-center {
display: flex;
align-items: center;
transform: translateY(0);
}
.car-brands-box {
width: 100%;
height: 100vh;
}
.car-brands {
height: 100%;
position: relative;
}
.car-brands .title {
position: sticky;
top: 0;
z-index: 2;
background: #F7F8FA;
font-size: 24rpx;
color: #969799;
padding-left: 32rpx;
height: 64rpx;
line-height: 64rpx;
}
.list {
height: 88rpx;
padding-left: 32rpx;
font-weight: 500;
}
.child {
font-weight: normal;
padding-left: 82rpx;
font-size: 28rpx;
color: #888888;
position: relative;
animation: show-child .25s forwards;
}
@keyframes show-child {
0% {
height: 0;
}
100% {
height: 88rpx;
}
}
.side-bar {
z-index: 999;
position: fixed;
top: 50%;
transform: translateY(-50%);
font-size: 24rpx;
color: #4c4c4c;
width: 10%;
opacity: 0;
animation: show-side-bar .5s forwards;
}
@keyframes show-side-bar {
0% {
opacity: 0;
right: -100%;
}
100% {
opacity: 1;
right: 0;
}
}
.side-bar .view {
width: 100%;
text-align: center;
}
.tips {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 140rpx;
height: 140rpx;
border-radius: 50%;
color: #fff;
background: rgba(153, 153, 153, 0.7);
z-index: 9999;
font-size: 60rpx;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
.car-type-box {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
font-size: 28rpx;
color: #333;
z-index: 9999;
}
.car-type-box .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.car-type-box .brands-box {
position: absolute;
top: 0;
right: 0;
width: 60.5%;
height: 100%;
overflow-y: scroll;
background: #fff;
-webkit-overflow-scrolling: touch;
animation: move 0.4s;
box-sizing: border-box;
padding-bottom: 40rpx;
}
.car-type-box .title {
width: 100%;
height: 64rpx;
box-sizing: border-box;
padding-left: 32rpx;
color: #969799;
background: #F7F8FA;
top: 0;
}
.car-type-box .brands-box .brands-list {
width: 100%;
box-sizing: border-box;
padding-left: 32rpx;
border-bottom: 1rpx solid #e9e9e9;
animation: show-car-type .25s forwards;
}
@keyframes show-car-type{
0%{
min-height: 0;
opacity: 0;
}
100%{
min-height: 100rpx;
opacity: 1;
}
}
@keyframes move {
from {
right: -60.5%;
}
to {
right: 0;
}
}
\ No newline at end of file \ No newline at end of file
Page({
/**
* 页面的初始数据
*/
data: {
platNumberList: []
},
/**车牌 */
chooseLicensePlate() {
wx.chooseLicensePlate().then(res => {
let plateNumbers = res.plateNumber.split('')
let platPrefix = plateNumbers[0]
let platNumber = res.plateNumber.substring(1, res.plateNumber.length)
console.log(res, platPrefix, platNumber)
this.setData({
'obj.platPrefix': platPrefix,
'obj.platNumber': platNumber,
platNumberList: platNumber.split('')
})
})
},
input(e) {
this.setData({
'obj.chassisCode': e.detail.value
})
},
chooseCarBrand(e) {
wx.p.router.go('/packageMine/pages/vehicleInfo/carBrandList/carBrandList')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.router.getData(carInfo => {
if (carInfo.carId) {
wx.p.wxApi.showLoading('加载中...')
wx.setNavigationBarTitle({
title: '编辑爱车'
})
this.carId = carInfo.carId
wx.p.api.mineApi.getUserCar(carInfo.carId).then(data => {
console.log(data)
this.setData({
obj: data || carInfo,
isEdit: true,
platNumberList: data.platNumber.split('')
})
wx.hideLoading()
})
}
})
},
confirm() {
let { obj, isEdit } = this.data
console.log(obj)
let target = 'addUserCar'
if (isEdit) target = 'updateUserCar'
if (!obj.platNumber) {
wx.p.wxApi.showToast('请选择车牌号码')
return
}
if (!obj.platPrefix) {
let [platPrefix] = obj.platNumber.split('')
obj.platPrefix = platPrefix
obj.platNumber = obj.platNumber.split(platPrefix)[1]
}
if (!obj.carTypeName) {
wx.p.wxApi.showToast('请选择品牌车型')
return
}
wx.p.wxApi.showLoading()
wx.p.api.mineApi[target](obj).then(() => {
wx.hideLoading()
wx.p.wxApi.showToast(isEdit ? '车辆编辑成功' : '车辆添加成功')
setTimeout(() => {
wx.p.router.back(page => {
try {
page.init()
} catch (error) {
page.onShow()
}
})
}, 1.5 * 1000)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"navigationBarTitleText": "添加爱车"
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="content">
<view class="form-row">
<view class="label">
品牌车型 <text class="required">必填</text>
</view>
<view class="value" bindtap="chooseCarBrand">
<view class="form-arrow-row {{!obj.carTypeName?'placeholder-style':''}} text-hide">
<block wx:if="{{obj.carTypeName}}">{{obj.brandName}}{{obj.seriseName}}{{obj.carTypeName}}</block>
<block wx:else>请选择</block>
</view>
<view class="arrow">
<view class="sprite-icon icon-mine-arrow"></view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="form-row">
<view class="label">
车辆号码<text class="required">必填</text>
</view>
<view class="value {{!obj.platNumber?'placeholder-style':''}}" bindtap="chooseLicensePlate">
<!-- <block wx:if="{{obj.platNumber}}">{{obj.platPrefix || ''}}{{obj.platNumber}}</block>
<block wx:else>请选择</block> -->
<view class="plat-num-box">
<view class="plat-num-item">{{!obj.platNumber ? '京' : obj.platPrefix}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[0]}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[1]}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[2]}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[3]}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[4]}}</view>
<view class="plat-num-item">{{!obj.platNumber ? '' : platNumberList[5]}}</view>
<view class="plat-num-item {{platNumberList.length <= 6 ? 'plat-num-placeholder' : ''}}">{{platNumberList.length <= 6 ? '新能源' : platNumberList[6]}}</view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="form-row">
<view class="label">
车架号码
</view>
<view class="value">
<input bindinput="input" value="{{obj.chassisCode}}" placeholder="请填写您的车架号" maxlength="17" placeholder-class="placeholder-style"></input>
</view>
</view>
</view>
</view>
<view class="default-btn" bindtap="confirm">{{isEdit?'保存':'添加'}}</view>
<glsx-privacy appletName="车生活助手"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
.layout {
/* margin: var(--margin);
background: #fff;
border-radius: var(--borderRadius);
padding: 0 var(--margin); */
margin: 20rpx 32rpx;
}
.layout .content {
background: #FFFFFF;
padding: 32rpx 20rpx;
margin-bottom: 20rpx;
border-radius: 8rpx;
}
.form-row {
/* padding: 30rpx 0 16rpx; */
border-bottom: 2rpx solid #E3E3E6;
}
.form-row:last-child {
border-bottom: none;
}
.form-row .label {
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: 500;
margin-bottom: 32rpx;
}
.form-row .value {
position: relative;
/* width: calc(100% - 192rpx); */
}
.form-row .form-arrow-row {
width: calc(100% - 50rpx);
}
.form-row .arrow {
position: absolute;
top: 0;
right: 0;
width: 36rpx;
height: 36rpx;
}
.form-row .arrow image {
width: 36rpx;
height: 36rpx;
}
.form-row .required {
font-size: 24rpx;
color: #F13C3D;
background: rgba(241, 60, 61, 0.1);
border-radius: 4rpx;
padding: 0 8rpx;
margin-left: 12rpx;
}
.form-row .plat-num-box {
display: flex;
justify-content: space-between;
}
.form-row .plat-num-item {
box-sizing: border-box;
flex-shrink: 0;
text-align: center;
width: 60rpx;
height: 80rpx;
padding: 20rpx 16rpx;
background: rgba(50, 127, 250, 0.1);
border-radius: 8rpx;
border: 2rpx solid rgba(50, 127, 250, 0.15);
margin-right: 20rpx;
}
.form-row .plat-num-item:last-child {
background: #F3FFE7;
border: 2rpx solid #E0F8C9;
margin-right: 0;
}
.form-row .plat-num-placeholder {
font-size: 18rpx;
line-height: 40rpx;
padding: 20rpx 0;
color: #B1B1B3;
}
.placeholder-style {
color: #B1B1B3;
}
.default-btn {
margin: 348rpx auto 0;
background: #2A69FF;
}
\ No newline at end of file \ No newline at end of file
...@@ -33,14 +33,14 @@ Page({ ...@@ -33,14 +33,14 @@ Page({
wx.p.router.jumpH5(`https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/hmd/${name}.html`, true) wx.p.router.jumpH5(`https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/hmd/${name}.html`, true)
}, },
async onLoad() { async onLoad() {
wx.p.wxApi.showLoading() // wx.p.wxApi.showLoading()
const { // const {
data, // data,
code // code
} = await wx.p.api.userApi.login() // } = await wx.p.api.userApi.login()
if (code == '0') this.customerLoginCallBack(data) // if (code == '0') this.customerLoginCallBack(data)
if (data) this.sessionId = data.sessionId // if (data) this.sessionId = data.sessionId
wx.hideLoading() // wx.hideLoading()
}, },
input(e) { input(e) {
const { const {
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<view class="content" style="margin-top: {{navHeight}}px;"> <view class="content" style="margin-top: {{navHeight}}px;">
<block wx:if="{{loginType==0}}"> <block wx:if="{{loginType==0}}">
<view class="h1"> <view class="h1">
欢迎使用 欢迎回来
<view class="logo"> <view class="logo">
<glsx-image src="login/logo.png"></glsx-image> <glsx-image src="login/login-logo.png"></glsx-image>
</view> </view>
</view> </view>
<view class="wx-box"> <view class="wx-box">
...@@ -65,4 +65,4 @@ ...@@ -65,4 +65,4 @@
</view> </view>
</view> </view>
</view> </view>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="车生活助手"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
.h1 .logo { .h1 .logo {
width: 402rpx; width: 570rpx;
height: 144rpx; height: 144rpx;
margin: 44rpx auto 0; margin: 44rpx auto 0;
} }
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
.wx-auth-button { .wx-auth-button {
width: 590rpx !important; width: 590rpx !important;
height: 96rpx; height: 96rpx;
background: var(--btnColor); background: #3772EC;
border-radius: 16rpx; border-radius: 16rpx;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
} }
.tips .check.true { .tips .check.true {
border-color: var(--btnColor); border-color: #3772EC;
} }
.tips .check .icon { .tips .check .icon {
...@@ -193,11 +193,11 @@ ...@@ -193,11 +193,11 @@
margin-left: auto; margin-left: auto;
padding: 8rpx 16rpx !important; padding: 8rpx 16rpx !important;
width: fit-content !important; width: fit-content !important;
background-color: #AA656B; background-color: #3772EC;
} }
.code-btn[disabled]:not([type]) { .code-btn[disabled]:not([type]) {
background-color: #8A8C90; background-color: #87AAF4;
color: #fff; color: #fff;
} }
......
// pages/tab/mine/index.js import { IMG_URL } from '../../../config'
import { devMixin } from '~/mixins/index'
Page({ Page({
behaviors: [devMixin],
/**
* 页面的初始数据
*/
data: { data: {
IMGURL: IMG_URL,
toolList: [{ toolList: [{
text: '购物车', text: '购物车',
icon: 'myShopping', icon: 'myShopping',
url: '/packageMall/pages/shoppingCart/shoppingCart' url: '/packageMall/pages/shoppingCart/shoppingCart'
}, },
{ {
text: '地址管理', text: '地址管理',
icon: 'myAddress', icon: 'myAddress',
url: '/packageMine/pages/address/index/index' url: '/packageMine/pages/address/index/index'
}, },
], ],
vipType: { vipType: {
1: 'gold_vip_bg', 1: 'gold_vip_bg',
...@@ -32,10 +31,30 @@ Page({ ...@@ -32,10 +31,30 @@ Page({
3: 'card_date', 3: 'card_date',
} }
}, },
// 获取用户车辆信息
/** getUserCarList() {
* 生命周期函数--监听页面加载 let {
*/ userInfo
} = this.data
if (!userInfo) return
wx.p.api.mineApi.getUserCarList().then(({
code,
data
}) => {
this.setData({
carFlag: true
})
if (code == '0') {
let carInfo = null
data.map(e => {
if (e.carTypeName) carInfo = e
})
this.setData({
carInfo
})
}
})
},
onLoad(options) { onLoad(options) {
this.getMemberCardData() this.getMemberCardData()
}, },
...@@ -123,57 +142,22 @@ Page({ ...@@ -123,57 +142,22 @@ Page({
}, },
// 开通会员页面 // 开通会员页面
toBuyMember() { toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open',{ wx.p.router.go('/packageEquity/pages/open/open', {
notIntercept: true notIntercept: true
}) })
}, },
/** jumpDevList() {
* 生命周期函数--监听页面初次渲染完成 wx.p.router.go('/packageMine/pages/device/list/list', {
*/ notIntercept: true
onReady() { })
}, },
/**
* 生命周期函数--监听页面显示
*/
onShow() { onShow() {
this.getOrderNumberList() this.getOrderNumberList()
this.toCheckMember() this.toCheckMember()
this.getUserCarList()
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -370,4 +370,213 @@ page { ...@@ -370,4 +370,213 @@ page {
font-size: 24rpx; font-size: 24rpx;
color: #0A0D14; color: #0A0D14;
letter-spacing: 0; letter-spacing: 0;
}
// 我的爱车
.car-box {
background-color: #fff;
/* box-shadow: 0 4rpx 16rpx 0 rgba(0, 0, 0, 0.1); */
border-radius: 16rpx;
min-height: 222rpx;
}
.car-box.GH {
height: 388rpx;
}
.my-car {
height: 270rpx;
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: 20rpx 24rpx;
}
.car-info .bottm {
display: flex;
justify-content: center;
}
.car-info .btn {
width: 378rpx;
height: 100rpx;
background: #F5F8FF;
border-radius: 50px;
margin-top: 16rpx;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #2A69FF;
display: flex;
align-items: center;
justify-content: center;
line-height: 40rpx;
}
.car-info .btn .btn-icon {
width: 40rpx;
height: 40rpx;
margin-right: 24rpx;
}
.car-info {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: var(--margin);
font-size: var(--margin);
color: #656566;
}
.car-info .icon-mine-arrow {
transform: translateY(8rpx);
margin-left: 6rpx;
}
.car-info .title {
font-weight: 500;
display: flex;
justify-content: space-between;
align-items: center;
font-family: PingFangSC-Medium;
font-size: 32rpx;
color: #0A0D14;
}
.car-info .title .edit {
font-size: 24rpx;
font-weight: normal;
color: #858A94;
display: flex;
align-items: center;
}
.car-info .title .edit .arrow {
width: 8rpx;
height: 14rpx;
margin-left: 10rpx;
}
.car-info .btnBox {
display: flex;
margin-top: 24rpx;
align-items: center;
.left-wrap {
.logo {
width: 84rpx;
height: 84rpx;
margin-bottom: 16rpx;
}
.row {
display: flex;
.name {
width: 98rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: 600;
font-size: 24rpx;
color: #3F444D;
}
}
}
.right-wrap-panel {
width: 100%;
border-left: 2rpx solid #efefef;
box-sizing: border-box;
padding-left: 20rpx;
margin-left: 30rpx;
overflow: hidden;
.scroll_widget {
width: calc(100% - 20rpx);
height: 120rpx;
overflow: hidden;
vertical-align: top;
white-space: nowrap;
.device {
display: inline-block;
.wrapper2 {
display: flex;
align-items: center;
}
.icon {
width: 120rpx;
height: 120rpx;
}
.text {
width: 184rpx;
height: 72rpx;
font-weight: 400;
font-size: 26rpx;
color: #0A0D14;
white-space: pre-wrap;
}
}
}
}
}
.car-info .btnBox .leftIcon {
width: 84rpx;
height: 84rpx;
}
.car-info .btnBox .rightBox {
margin-left: 20rpx;
}
.car-info .btnBox .plate-name {
width: 40rpx;
height: 40rpx;
background: #2A69FF;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
margin-right: 8rpx;
display: inline-block;
line-height: 40rpx;
text-align: center;
}
.car-info .btnBox .plate-number {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #0A0D14;
}
.car-info .btnBox .car-brand {
font-size: 24rpx;
max-width: 542rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 15rpx;
color: #3F444D;
}
.car-info .btnBox .car-brand .brand-name {
font-family: PingFangSC-S0pxibold;
font-weight: 600;
font-size: 24rpx;
color: #3F444D;
}
.car-info {
.icon {
width: 28rpx;
height: 28rpx;
margin-left: auto;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -53,6 +53,68 @@ ...@@ -53,6 +53,68 @@
</view> </view>
</view> </view>
</block> </block>
<!-- 我的爱车 -->
<view class="car-box box">
<block wx:if="{{!carInfo}}">
<view class="car-info">
<view class="title">
我的智能汽车
<view class="edit" bindtap="jumpDevList" data-url="vehicleInfo" data-item="{{carInfo}}">
管理
<view class="icon">
<glsx-image src="mine/mine-arrow.png"></glsx-image>
</view>
</view>
</view>
<view class="bottm">
<view class="btn" bindtap="goto" data-url="vehicleInfo">
<view class="btn-icon">
<image webp src="{{IMGURL}}mine/addTo.png?v={{img_version}}"></image>
</view>
添加爱车 享受服务
</view>
</view>
</view>
</block>
<block wx:else>
<view class="car-info">
<view class="title">
我的智能汽车
<view class="edit" bindtap="jumpDevList" data-url="vehicleInfo" data-item="{{carInfo}}">
管理
<view class="icon">
<glsx-image src="mine/mine-arrow.png"></glsx-image>
</view>
</view>
</view>
<view class="btnBox">
<view bindtap="goto" data-url="vehicleInfo" data-item="{{carInfo}}" class="left-wrap">
<image class="logo" webp src="{{IMGURL}}mine/carPicture.png?v={{img_version}}"></image>
<view class="row">
<view class="name">{{carInfo.brandName}}</view>
<view class="icon">
<glsx-image src="mine/mine-arrow.png"></glsx-image>
</view>
</view>
</view>
<view class="right-wrap-panel">
<view class="scroll_widget">
<scroll-view scroll-x="{{true}}">
<block wx:for="{{devList}}" wx:key="index" style="height:120rpx;width:100%">
<view bindtap="jumpDev" data-item="{{item}}" class="device">
<view class="wrapper2">
<glsx-image src="mine/dev-{{index}}.png" class="icon" />
<view class="text">{{item.text}}</view>
</view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</view>
</block>
</view>
<!-- 我的券包 --> <!-- 我的券包 -->
<view class="coupon-box box flex" bindtap="jump" data-url="/packageMine/pages/coupon/index/index"> <view class="coupon-box box flex" bindtap="jump" data-url="/packageMine/pages/coupon/index/index">
我的卡券 我的卡券
......
/**app.wxss**/
.sticky {
position: sticky;
top: 0;
left: 0;
z-index: 2;
background-color: #fff;
}
.flex {
display: flex;
align-items: center;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.isFullSucreen {
padding-bottom: var(--constantSafeAreaInsetBottom) !important;
padding-bottom: var(--envSafeAreaInsetBottom) !important;
}
.isFullSucreen-bottom {
bottom: var(--constantSafeAreaInsetBottom) !important;
bottom: var(--envSafeAreaInsetBottom) !important;
}
.isFullSucreen-padding-bottom {
padding-bottom: var(--constantSafeAreaInsetBottom) !important;
padding-bottom: var(--envSafeAreaInsetBottom) !important;
}
.default-btn {
width: 686rpx;
height: 88rpx;
background: var(--btnColor);
border-radius: var(--borderRadius);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--margin);
}
/* .list-nothing {
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 28rpx;
color: #C1C2C3;
} */
.list-nothing {
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 24rpx;
color: #858A94;
}
.list-nothing.to-bottom::after {
content: '- 到 底 了 -'
}
.list-nothing .icon {
width: 320rpx;
height: 320rpx;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: 24rpx;
height: 100%;
}
.flex_sc {
display: flex;
align-items: center;
}
.store-btn-disabled {
background-image: none;
background: #CCCED1 !important;
color: #fff !important;
}
.store-btn-disabled::after {
border: none;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
@keyframes show-box {
0% {
opacity: 0;
transform: scale(2.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes show-box-inset{
0% {
opacity: 0;
transform: scale(.1);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes show-box-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(https://img02.glsx.com.cn/weapp/resource/dj-shopmall-test/sprite-1650770528010.png);background-size: 376rpx 364rpx;}
.icon-address-edit { width: 32rpx; height: 32rpx; background-position: -46rpx -328rpx;}
.icon-back { width: 36rpx; height: 36rpx; background-position: -336rpx -50rpx;}
.icon-clear { width: 36rpx; height: 36rpx; background-position: -336rpx -96rpx;}
.icon-goods-eye { width: 24rpx; height: 24rpx; background-position: -212rpx -328rpx;}
.icon-goods-home { width: 40rpx; height: 40rpx; background-position: -58rpx -270rpx;}
.icon-goods-share { width: 48rpx; height: 48rpx; background-position: -270rpx -66rpx;}
.icon-goods-shopping { width: 40rpx; height: 40rpx; background-position: -108rpx -270rpx;}
.icon-goods-text { width: 32rpx; height: 32rpx; background-position: -88rpx -328rpx;}
.icon-goods-time { width: 32rpx; height: 32rpx; background-position: -130rpx -328rpx;}
.icon-home-coupon { width: 80rpx; height: 80rpx; background-position: 0rpx 0rpx;}
.icon-home-daijia { width: 80rpx; height: 80rpx; background-position: -90rpx 0rpx;}
.icon-home-gps { width: 80rpx; height: 80rpx; background-position: 0rpx -90rpx;}
.icon-home-navigation { width: 80rpx; height: 80rpx; background-position: -90rpx -90rpx;}
.icon-home-newCars { width: 80rpx; height: 80rpx; background-position: -180rpx 0rpx;}
.icon-home-notice { width: 30rpx; height: 28rpx; background-position: -172rpx -328rpx;}
.icon-home-reservation { width: 80rpx; height: 80rpx; background-position: -180rpx -90rpx;}
.icon-home-road { width: 80rpx; height: 80rpx; background-position: 0rpx -180rpx;}
.icon-home-shopmall { width: 80rpx; height: 80rpx; background-position: -90rpx -180rpx;}
.icon-home-tips-0 { width: 36rpx; height: 36rpx; background-position: -336rpx -142rpx;}
.icon-home-tips-1 { width: 36rpx; height: 36rpx; background-position: -336rpx -188rpx;}
.icon-home-tips-2 { width: 36rpx; height: 36rpx; background-position: -336rpx -234rpx;}
.icon-home { width: 36rpx; height: 36rpx; background-position: -336rpx -280rpx;}
.icon-location { width: 36rpx; height: 36rpx; background-position: 0rpx -328rpx;}
.icon-min-gps { width: 56rpx; height: 56rpx; background-position: -180rpx -180rpx;}
.icon-mine-add { width: 48rpx; height: 48rpx; background-position: -270rpx -124rpx;}
.icon-mine-address { width: 40rpx; height: 40rpx; background-position: -158rpx -270rpx;}
.icon-mine-arrow { width: 8rpx; height: 14rpx; background-position: -270rpx -240rpx;}
.icon-mine-gh-gps { width: 48rpx; height: 48rpx; background-position: -270rpx -182rpx;}
.icon-mine-gh-phone { width: 48rpx; height: 48rpx; background-position: 0rpx -270rpx;}
.icon-mine-order { width: 40rpx; height: 40rpx; background-position: -208rpx -270rpx;}
.icon-mine-phone { width: 56rpx; height: 56rpx; background-position: -270rpx 0rpx;}
.icon-mine-reservation { width: 40rpx; height: 40rpx; background-position: -258rpx -270rpx;}
.icon-mine-setting { width: 40rpx; height: 40rpx; background-position: -336rpx 0rpx;}
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,8 @@ export const STORAGE_OBJECTkEY = { ...@@ -11,7 +11,8 @@ export const STORAGE_OBJECTkEY = {
sessionId: 'sessionId', sessionId: 'sessionId',
bindInfo:'bindInfo', bindInfo:'bindInfo',
unauthorized:'unauthorized', unauthorized:'unauthorized',
wx_user_info:'wx_user_info' wx_user_info:'wx_user_info',
srcm_shopmall_brand_list: 'srcm_shopmall_brand_list',
} }
export default{ export default{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!