真食物配套的电商小程序.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1109 lines
33 KiB

<template>
<view class="shoppingCart">
<view class="header" :style="'height: ' + CustomBar + 'px'">
<view class="top-nav-box acea-row row-between-wrapper" :style="'width:' + CustomBarLeft + 'px;padding-top:' + StatusBar + 'px;height:' + CustomBar + 'px'">
<image v-if="hasReturnPath" class="backImg" src="@/static/images/back-btn.png" mode="" @click="returnPath"></image>
<view v-else class=""></view>
<view class="tab-title" v-if="$store.getters.token||userInfo.uid">购物车</view>
<view v-if="cartList.length > 0" :class="'manage-text ' + (footerswitch?'inManage':'')" @click="manage">{{ footerswitch ? '退出' : '管理' }}</view>
</view>
</view>
<view :style="[{height:CustomBar + 'px'}]"></view>
<!-- <view> -->
<view v-if="$store.getters.token||userInfo.uid">
<!-- <view class="labelNav acea-row row-around row-middle">
<view class="item">
<text class="iconfont icon-xuanzhong"></text>100%正品保证
</view>
<view class="item">
<text class="iconfont icon-xuanzhong"></text>所有商品精挑细选
</view>
<view class="item">
<text class="iconfont icon-xuanzhong"></text>售后无忧
</view>
</view> -->
<!-- <view class="nav acea-row row-between-wrapper">
<view>
购物数量
<text class="num font-color-red">{{ count }}</text>
</view>
<view v-if="cartList.valid.length > 0" class="administrate acea-row row-center-wrapper" @click="manage">
{{ footerswitch ? '取消' : '管理' }}</view>
</view> -->
<view v-if="dataList.length > 0">
<!-- <view v-if="validList.length > 0 || cartList.invalid.length > 0"> -->
<view class="list">
<view class="item" v-for="(item, brandIndex) in dataList" :key="brandIndex">
<!-- <view class="item acea-row row-between-wrapper" v-for="(item, cartListValidIndex) in validList" :key="cartListValidIndex"> -->
<view class="top acea-row row-middle">
<view>
<!-- <checkbox-group> -->
<checkbox-group @change="itemAllchecked(brandIndex)">
<label class="well-check">
<checkbox :checked="item.checked"></checkbox>
</label>
</checkbox-group>
</view>
<view class="logo-box">
<image :src="item.brand.pic" mode=""></image>
</view>
<view class="brand">{{item.brand.brandName}}</view>
</view>
<view class="goodsItem acea-row row-between-wrapper" v-for="(goodsItem, goodsIndex) in item.validProductList" :key="goodsIndex">
<view class="select-btn">
<view class="checkbox-wrapper">
<checkbox-group @change="switchSelect(brandIndex, goodsIndex)">
<label class="well-check">
<checkbox value :checked="goodsItem.checked"></checkbox>
</label>
</checkbox-group>
</view>
</view>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue" @click="goGoodsCon(goodsItem)">
<image :src="goodsItem.productInfo.attrInfo.image" v-if="goodsItem.productInfo.attrInfo" />
<image :src="goodsItem.productInfo.image" v-else />
</view>
<view class="text">
<view class="line1">{{ goodsItem.productInfo.storeName }}</view>
<view class="acea-row">
<view class="infor" v-if="goodsItem.productInfo.attrInfo">{{ goodsItem.productInfo.attrInfo.sku }}</view>
</view>
<view class="money">¥{{ goodsItem.truePrice }}</view>
</view>
<view class="carnum acea-row row-center-wrapper">
<view class="reduce" :class="goodsItem.cartNum <= 1 ? 'on' : ''"
@click.prevent="reduce(brandIndex, goodsIndex)">-</view>
<view class="num">{{ goodsItem.cartNum }}</view>
<view class="plus" v-if="goodsItem.attrInfo"
:class="goodsItem.cartNum >= goodsItem.attrInfo.stock ? 'on' : ''"
@click.prevent="plus(brandIndex, goodsIndex)">+</view>
<view class="plus" v-else
:class="goodsItem.cartNum >= goodsItem.stock ? 'on' : ''"
@click.prevent="plus(brandIndex, goodsIndex)">+</view>
<!-- <view class="reduce" :class="validList[cartListValidIndex].cartNum <= 1 ? 'on' : ''"
@click.prevent="reduce(cartListValidIndex)">-</view>
<view class="num">{{ goodsItem.cartNum }}</view>
<view class="plus" v-if="validList[cartListValidIndex].attrInfo"
:class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].attrInfo.stock ? 'on' : ''"
@click.prevent="plus(cartListValidIndex)">+</view>
<view class="plus" v-else
:class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].stock ? 'on' : ''"
@click.prevent="plus(cartListValidIndex)">+</view> -->
</view>
</view>
</view>
</view>
</view>
<!-- <view class="add-on-item">
<view class="title">商品凑单</view>
<scroll-view scroll-x="true" class="scroll-box">
<view class="scroll">
<view v-for="(item,index) in 4" :key="index">
<view class="item">
<image class="add-img" src="../../../static/images/add-btn.png" mode=""></image>
<image class="img" src="" mode=""></image>
<view class="goodsName more-t">LA PRAIRIE莱珀妮鱼子眼部紧颜液眼精华 20ml参天眼药水Beauteye
玫瑰滴眼液 12ml</view>
<view class="price">¥104.00</view>
</view>
</view>
</view>
</scroll-view>
</view> -->
</view>
<!--购物车暂无商品-->
<view class="noCart" v-if="cartList.length === 0 && invalidProductList.length === 0">
<!-- <view class="noCart" v-if="cartList.valid.length === 0 && cartList.invalid.length === 0"> -->
<view class="">购物车竟然是空的</view>
<view class="tip">去挑选满意的商品吧</view>
<view class="btn-box acea-row row-center">
<view class="btn" @click="$yrouter.reLaunch('/pages/home/index')">前往首页</view>
<view class="btn" @click="$yrouter.push('/pages/shop/GoodSearch/index')">去搜索</view>
</view>
<!-- <view class="pictrue">
<image :src="`${$VUE_APP_RESOURCES_URL}/images/noCart.png`" />
</view> -->
</view>
<view class="invalidGoods" v-if="invalidProductList.length > 0">
<!-- <view class="invalidGoods" v-if="cartList.invalid.length > 0"> -->
<view class="goodsNav acea-row row-between-wrapper">
<view @click="goodsOpen">
<text class="iconfont" :class="goodsHidden === true ? 'icon-xiangyou' : 'icon-xiangxia'"></text>失效商品
</view>
<view class="del" @click="delInvalidGoods">
<text class="iconfont icon-shanchu1"></text>清空
</view>
</view>
<view class="goodsList" :hidden="goodsHidden">
<view v-for="(item, cartListinvalidIndex) in invalidProductList" :key="cartListinvalidIndex">
<view @click="goGoodsCon(item)" class="item acea-row row-between-wrapper" v-if="item.productInfo">
<view class="invalid acea-row row-center-wrapper">失效</view>
<view class="pictrue">
<image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
<image :src="item.productInfo.image" v-else />
</view>
<view class="text acea-row row-column-between">
<view class="line1">{{ item.productInfo.storeName }}</view>
<view class="infor line1" v-if="item.productInfo.attrInfo">属性:{{ item.productInfo.attrInfo.sku }}
</view>
<view class="acea-row row-between-wrapper">
<view class="end">该商品已下架</view>
</view>
</view>
</view>
</view>
</view>
</view>
<Recommend></Recommend>
<view style="height:112rpx" v-if="cartList.length > 0"></view>
<!-- <view :class="{'footer acea-row row-between-wrapper':true,'footer-h5':isH5}" v-if="cartList.valid.length > 0"> -->
<view class="footer acea-row row-between-wrapper" v-if="cartList.length > 0" :style="addBottom?'':'bottom: 98rpx;'">
<!-- <view> -->
<!-- <view class="select-btn">
<view class="checkbox-wrapper"> -->
<checkbox-group @change="allChecked">
<label class="well-check">
<checkbox value="allSelect" :checked="isAllSelect && cartCount > 0"></checkbox>
<text class="checkAll">全选</text>
</label>
</checkbox-group>
<!-- </view>
</view> -->
<!-- </view> -->
<view class="money acea-row row-middle" v-if="footerswitch === false">
<text>合计</text>
<view class="price">
<text class="font-color-red">¥{{ countmoney }}</text>
<view class="count acea-row">
<view class="">共{{ cartCount }}件</view>
<!-- <view class="font-color-red">已优惠{{'39.90'}}元</view> -->
</view>
</view>
</view>
<view v-if="!footerswitch" class="placeOrder bg-color-red" @click="placeOrder">下单结算</view>
<view class="button acea-row row-middle" v-else>
<view class="bnt cart-color" @click="collectAll">收藏</view>
<view class="bnt" @click="delgoods">删除</view>
</view>
</view>
</view>
<view class="no-token" v-else>
<image class="no-cart" src="../../../static/images/no-cart.png" mode=""></image>
<view class="text">请登录后查看</view>
<button class="cu-btn author-btn phone-btn" open-type="getPhoneNumber" @getphonenumber="phoneLogin">使用手机号登录</button>
<button class="cu-btn author-btn acea-row row-center-wrapper" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">
<image src="../../../static/images/wx-logo.png" mode=""></image>
<text>使用微信登录</text>
</button>
<button class="cu-btn author-btn acea-row row-center-wrapper" v-else @getuserinfo="getUserInfoBtn" open-type="getUserInfo">
<image src="../../../static/images/wx-logo.png" mode=""></image>
<text>使用微信登录</text>
</button>
</view>
<!-- <Authorization v-else /> -->
<Tabbar :pagePath="pagePath" bgcolor="#F1F1F1"></Tabbar>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import Tabbar from '@/components/Tabbar';
import Authorization from "@/pages/authorization/index";
import {
mapGetters
} from "vuex";
import {
getCartList,
postCartDel,
changeCartNum,
getCartCount
} from "@/api/store";
import {
postCollectAll,
wxappAuth,
getUserInfo
} from "@/api/user";
import { login, getProvider } from '@/utils'
import {
mul,
add
} from "@/utils/bc";
import dayjs from 'dayjs';
import cookie from "@/utils/store/cookie";
import store from '@/store';
const CHECKED_IDS = "cart_checked";
export default {
name: "ShoppingCart",
components: {
Recommend,
Authorization,
Tabbar
},
props: {},
data: function () {
return {
StatusBar: this.StatusBar,
CustomBar: this.CustomBar,
CustomBarLeft: this.CustomBarLeft,
addBottom: this.addBottom,
pagePath: '',
canIUseGetUserProfile: false,
hasReturnPath: false,
cartList: [],
invalidProductList: [],
// cartList: {
// invalid: [],
// valid: []
// },
dataList: [],
isH5: false,
validList: [],
isAllSelect: false,
cartCount: 0,
countmoney: 0,
goodsHidden: true,
footerswitch: false,
count: 0,
checkedIds: [],
loaded: false
};
},
computed: mapGetters(["userInfo", "token"]),
// watch: {
// $yroute(n) {
// if (n.name === "ShoppingCart") {
// this.carnum();
// this.countMoney();
// this.getCartList();
// this.gainCount();
// this.goodsHidden = true;
// this.footerswitch = false;
// }
// },
// cartList(list) {
// this.validList = list.valid;
// }
// },
watch: {
// userInfo(user) {
// if (user.uid) {
// this.carnum();
// this.countMoney();
// this.getCartList();
// this.gainCount();
// }
// },
// token(token) {
// if (this.userInfo.uid) {
// this.carnum();
// this.countMoney();
// this.getCartList();
// this.gainCount();
// }
// },
cartList(list) {
// this.validList = list.valid;
this.dataList = list;
}
},
onLoad() {
uni.hideTabBar();
let pages = getCurrentPages();
this.pagePath = '/' + pages[pages.length - 1].route;
if (wx.getUserProfile) {
this.canIUseGetUserProfile = true
}
},
onShow: function () {
// #ifdef H5
this.isH5 = true
// #endif
console.log(this.userInfo)
if (this.userInfo.uid) {
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
}
this.hasReturnPath = uni.getStorageSync('pathToCart')?true:false;
},
methods: {
goPage() {
this.$yrouter.push('/pages/shop/GoodSearch/index');
this.$yrouter.reLaunch({path: "/pages/home/index"});
},
goGoodsCon(item) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {
id: item.productId
}
});
},
returnPath() {
let url = uni.getStorageSync('pathToCart');
uni.removeStorageSync('pathToCart')
uni.redirectTo({
url
})
},
getCartList: function () {
let that = this;
getCartList().then(res => {
that.cartList = res.data.cartList;
that.invalidProductList = res.data.invalidProductList;
let checkedIds = cookie.get(CHECKED_IDS) || [];
if (!Array.isArray(checkedIds)) checkedIds = [];
// this.cartList.valid.forEach(cart => {
// if (checkedIds.indexOf(cart.id) !== -1) cart.checked = true;
// });
let allLength = 0;
this.cartList.forEach(brand => {
brand.validProductList.forEach(val => {
if (checkedIds.indexOf(val.id) !== -1) val.checked = true;
})
brand.checked = brand.validProductList.every(res => {
return res.checked === true
})
allLength += brand.validProductList.length;
})
if (checkedIds.length) {
that.checkedIds = checkedIds;
that.isAllSelect = checkedIds.length === allLength;
// that.isAllSelect = checkedIds.length === this.cartList.valid.length;
that.carnum();
that.countMoney();
}
this.loaded = true;
});
},
//删除商品;
delgoods: function () {
let that = this,
id = [],
valid = [],
list = that.cartList;
list.forEach(item => {
item.validProductList.forEach(val => {
if (val.checked === true) {
id.push(val.id);
}
})
});
// list.forEach(function (val) {
// if (val.checked === true) {
// id.push(val.id);
// }
// });
if (id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
return;
}
postCartDel(id).then(function () {
list.forEach(function (val, i) {
if (val.checked === false || val.checked === undefined)
valid.push(list[i]);
});
that.$set(that.cartList, "valid", valid);
that.carnum();
that.countMoney();
that.gainCount();
that.getCartList();
});
},
// //获取数量
gainCount: function () {
let that = this;
getCartCount().then(res => {
that.count = res.data.count;
});
},
//清除失效产品;
delInvalidGoods: function () {
let that = this,
id = [],
list = that.invalidProductList;
list.forEach(function (val) {
id.push(val.id);
});
postCartDel(id).then(function () {
list.splice(0, list.length);
that.gainCount();
that.getCartList();
});
},
//批量收藏;
collectAll: function () {
let that = this,
data = {
id: [],
category: ""
},
list = that.cartList.valid;
list.forEach(function (val) {
if (val.checked === true) {
data.id.push(val.product_id);
data.category = val.type;
}
});
if (data.id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
return;
}
postCollectAll(data).then(function () {
uni.showToast({
title: "收藏成功!",
icon: "none",
duration: 2000
});
});
},
//立即下单;
placeOrder: function () {
let that = this,
list = that.cartList,
id = [];
list.forEach(item => {
item.validProductList.forEach(val => {
if (val.checked === true) {
id.push(val.id);
}
})
});
// list.forEach(function (val) {
// if (val.checked === true) {
// id.push(val.id);
// }
// });
if (id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
return;
}
this.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: id.join(",")
}
});
},
manage: function () {
console.log('safsafsaf')
let that = this;
that.footerswitch = !that.footerswitch;
},
goodsOpen: function () {
let that = this;
that.goodsHidden = !that.goodsHidden;
},
//加
plus(brandIndex, index) {
let that = this;
let list = that.cartList[brandIndex].validProductList[index];
list.cartNum++;
if (list.attrInfo) {
if (list.cartNum >= list.attrInfo.stock) {
that.$set(list, "cart_num", list.attrInfo.stock);
}
} else {
if (list.cartNum >= list.stock) {
that.$set(list, "cart_num", list.stock);
}
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
//减
reduce(brandIndex, index) {
let that = this;
let list = that.cartList[brandIndex].validProductList[index];
if (list.cartNum <= 1) {
uni.showToast({
title: "已经是底线啦!",
icon: "none",
duration: 2000
});
return;
}
list.cartNum--;
if (list.cartNum < 1) {
that.$set(list, "cart_num", 1);
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
syncCartNum(cart) {
if (!cart.sync) {
changeCartNum(cart.id, Math.max(cart.cartNum, 1) || 1)
.then(res => {
this.getCartList();
this.gainCount();
})
.catch(error => {
this.gainCount();
uni.showToast({
title: error.response.data.msg,
icon: "none",
duration: 2000
});
});
}
},
itemAllchecked(index) {
let cart = this.cartList[index];
cart.checked = !cart.checked;
// cart.isShowPinkagePrice = cart.checked;
this.cartList[index].validProductList.forEach(val => {
val.checked = cart.checked;
// this.cartList.valid.forEach(con => {
// if(con.id == val.id) {
// con.checked = val.checked
// }
// })
let i = this.checkedIds.indexOf(val.id);
if (i !== -1) this.checkedIds.splice(i, 1);
if (val.checked) {
this.checkedIds.push(val.id);
}
})
this.isAllSelect = this.cartList.every(item => {
return item.validProductList.every(val => {
return val.checked === true
})
})
// this.isAllSelect = this.cartList.valid.every(val => {
// return val.checked === true
// })
if(cart.reservePrice) {
let num = this.getItemPinkagePrice(cart);
// cart.pinkagePrice = sub(cart.reservePrice,num);
}
this.$set(this, "cartList", this.cartList);
this.$set(this, "isAllSelect", this.isAllSelect);
cookie.set(CHECKED_IDS, this.checkedIds);
this.carnum();
this.countMoney();
},
//单选
switchSelect(brandIndex, index) {
let that = this,
cart = that.cartList[brandIndex].validProductList[index],
i = this.checkedIds.indexOf(cart.id);
cart.checked = !cart.checked;
if (i !== -1) this.checkedIds.splice(i, 1);
if (cart.checked) {
this.checkedIds.push(cart.id);
}
this.cartList[brandIndex].checked = this.cartList[brandIndex].validProductList.every(val => {
return val.checked === true
})
this.isAllSelect = this.cartList.every(item => {
return item.checked === true
// item.validProductList.every(val => {
// return val.checked === true
// })
})
// let len = that.cartList.valid.length;
// let selectnum = [];
// for (let i = 0; i < len; i++) {
// if (that.cartList.valid[i].checked === true) {
// selectnum.push(true);
// }
// }
// that.isAllSelect = selectnum.length === len;
that.$set(that, "cartList", that.cartList);
that.$set(that, "isAllSelect", that.isAllSelect);
cookie.set(CHECKED_IDS, that.checkedIds);
that.carnum();
that.gainCount();
that.countMoney();
},
//全选
allChecked(e) {
console.log(e);
let that = this;
let selectAllStatus = e.mp.detail.value[0] == "allSelect" ? true : false;
console.log(selectAllStatus);
// let selectAllStatus = that.isAllSelect;
let checkedIds = [];
// for (let i = 0; i < array.length; i++) {
// array[i].checked = selectAllStatus;
// checked.push()
// }
this.cartList.forEach(cart => {
cart.checked = selectAllStatus;
cart.validProductList.forEach(val => {
val.checked = selectAllStatus;
if (selectAllStatus) {
checkedIds.push(val.id);
}
})
});
// that.cartList.valid.forEach(cart => {
// cart.checked = selectAllStatus;
// if (selectAllStatus) {
// checkedIds.push(cart.id);
// }
// });
// let cartList = {
// ...that.cartList
// };
// that.cartList = [];
// that.cartList = cartList;
console.log(this.cartList);
// this.$set(this, "cartList", this.cartList);
this.$set(this, "isAllSelect", selectAllStatus);
this.checkedIds = checkedIds;
cookie.set(CHECKED_IDS, checkedIds);
that.carnum();
that.countMoney();
this.$forceUpdate();
},
//数量
carnum: function () {
let that = this;
var carnum = 0;
// var array = that.cartList.valid;
// console.log('thiscartList', this.cartList);
this.cartList.forEach(item => {
item.validProductList.forEach(val => {
if(val.checked === true) {
carnum += parseInt(val.cartNum);
}
})
})
// for (let i = 0; i < array.length; i++) {
// if (array[i].checked === true) {
// carnum += parseInt(array[i].cartNum);
// }
// }
that.$set(that, "cartCount", carnum);
},
//总共价钱;
countMoney: function () {
let that = this;
let carmoney = 0;
// let array = that.cartList.valid;
this.cartList.forEach(item => {
item.validProductList.forEach(val => {
if(val.checked === true) {
carmoney = add(carmoney, mul(val.cartNum, val.truePrice));
}
})
})
// for (let i = 0; i < array.length; i++) {
// if (array[i].checked === true) {
// carmoney = add(carmoney, mul(array[i].cartNum, array[i].truePrice));
// }
// }
that.countmoney = carmoney;
},
// 登录
getUserInfoBtn(data) {
console.log(data)
console.log('getUserInfoBtn')
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
uni.showToast({
title: '取消授权',
icon: 'none',
duration: 2000,
})
return
}
uni.showLoading({
title: '登录中',
})
login()
.then(e => {
uni.hideLoading()
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
// console.log('重定向')
// this.$yrouter.reLaunch({
// path: cookie.get('redirect').replace(/\ /g, ''),
// })
})
.catch(error => {
uni.hideLoading()
console.log(error)
uni.showToast({
title: error,
icon: 'none',
duration: 2000,
})
})
},
// 申请获取用户信息
getUserInfoProfile(data) {
console.log('getUserInfoProfile')
wx.getUserProfile({
lang: 'zh_CN',
desc: '需要获取您的信息用来展示',
success: res => {
console.log('用户信息',res)
uni.showLoading({
title: '登录中',
})
login(res)
.then(e => {
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
// console.log('重定向')
// this.$yrouter.reLaunch({
// path: cookie.get('redirect').replace(/\ /g, ''),
// })
})
.catch(error => {
console.log(error)
uni.showToast({
title: error,
icon: 'none',
duration: 2000,
})
})
},
})
},
// 微信用户手机号登录
phoneLogin(e) {
console.log('用户微信手机号登录')
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
console.log(e.mp.detail)
getProvider()
.then(provider => {
console.log('当前的环境商',provider)
if (!provider) {
reject()
}
// uni登录
uni.login({
provider: provider,
success: async loginRes => {
console.log(loginRes)
let code = loginRes.code // 获取开发code
cookie.set('wxLoginCode', loginRes.code)
wxappAuth({
encryptedData: e.mp.detail.encryptedData,
iv: e.mp.detail.iv,
code: code,
spread: cookie.get('spread'),
})
.then( res => {
console.log('登录成功,开始处理登录信息保存,并获取用户详情')
uni.hideLoading()
store.commit('login', res.data.token, dayjs(res.data.expires_time))
store.dispatch('userInfo', true)
getUserInfo()
.then(user => {
console.log('获取用户信息成功')
uni.setStorageSync('uid', user.data.uid)
store.dispatch('setUserInfo', user.data)
this.$emit('success', this.$store.getters.token,"this.$store.getters.token")
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
// this.$yrouter.reLaunch({
// path: cookie.get('redirect').replace(/\ /g, ''),
// })
})
.catch(error => {
console.log('获取用户信息失败')
})
})
.catch(error => {
console.log(error)
console.log('登录接口调用失败')
})
}
})
})
.catch(err => {})
} else {
uni.showToast({
title: '已拒绝授权',
icon: 'none',
duration: 2000,
})
}
},
}
};
</script>
<style lang="less" scoped>
.shoppingCart .header {
position: fixed;
left: 0;
top: 0;
z-index: 100;
background: #F1F1F1;
width: 750rpx;
.backImg {
height: 62rpx;
width: 62rpx;
margin-left: 26rpx;
}
.tab-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: #2DB5AE;
line-height: 42rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.manage-text {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #2DB5AE;
line-height: 42rpx;
padding-right: 14rpx;
}
.inManage {
color: #EC3A5B;
}
}
.no-token {
padding-top: 200rpx;
font-size: 34rpx;
font-weight: 600;
color: #3A3A3C;
line-height: 48rpx;
text-align: center;
.no-cart {
width: 446rpx;
height: 422rpx;
margin: 0rpx auto 24rpx;
}
.text {
padding-bottom: 40rpx;
}
.author-btn {
width: 520rpx;
height: 70rpx;
background: #FFFFFF;
border-radius: 16rpx;
border: 2rpx solid #2EB5AE;
font-size: 26rpx;
font-weight: 600;
color: #2DB5AE;
line-height: 66rpx;
text-align: center;
margin-bottom: 20rpx;
image {
width: 38rpx;
height: 38rpx;
margin-right: 16rpx;
}
}
.phone-btn {
background: #2DB5AE;
color: #F5F6F8;
}
}
.noCart {
.tip {
font-size: 26rpx;
font-weight: 500;
color: #3A3A3C;
line-height: 38rpx;
}
.btn-box {
padding: 20rpx 0rpx;
.btn {
width: 254rpx;
height: 70rpx;
background: #2DB5AE;
border-radius: 16rpx;
font-size: 26rpx;
color: #F5F6F8;
line-height: 70rpx;
margin: 0rpx 10rpx;
}
}
}
.list {
.item {
.top {
padding-bottom: 20rpx;
.logo-box {
margin-left: 8rpx;
width: 46rpx;
height: 46rpx;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0,0,0,0.15);
border-radius: 50%;
padding: 2rpx;
background: linear-gradient(135deg, rgba(57, 211, 150, 1), rgba(27, 141, 204, 1));
image {
width: 100%;
height: 100%;
background-color: #F1F1F1;
border-radius: 50%;
}
}
.brand {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 600;
color: #3A3A3C;
line-height: 38rpx;
padding-left: 16rpx;
}
}
.goodsItem {
margin-bottom: 20rpx;
}
.goodsItem:last-child {
margin-bottom: 0rpx;
}
}
}
.add-on-item {
.title {
padding: 18rpx 0rpx 20rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 600;
color: #3A3A3C;
line-height: 42rpx;
text-align: center;
}
.scroll-box {
width: 100%;
overflow:hidden;
white-space:nowrap;
.scroll {
display: flex;
flex-wrap: nowrap;
padding-left: 32rpx;
.item {
width: 208rpx;
height: 318rpx;
background: #F5F6F8;
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0,0,0,0.15);
border-radius: 16rpx;
margin-right: 14rpx;
margin-bottom: 20rpx;
position: relative;
.add-img {
width: 40rpx;
height: 40rpx;
position: absolute;
top: 12rpx;
right: 12rpx;
}
.img {
width: 208rpx;
height: 200rpx;
border-radius: 16rpx 16rpx 0rpx 0rpx;
background-color: #FFFFFF;
}
.goodsName {
margin: 12rpx 10rpx 6rpx;
height: 54rpx;
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: #3A3A3C;
line-height: 26rpx;
white-space: normal;
}
.price {
font-size: 26rpx;
font-family: Futura;
font-weight: 600;
color: #3A3A3C;
line-height: 36rpx;
text-align: center;
}
}
}
}
}
.shoppingCart .footer {
.money {
.price {
padding-left: 16rpx;
font-size: 34rpx;
font-family: Futura;
font-weight: 600;
color: #2DB5AE;
line-height: 42rpx;
.count {
font-size: 20rpx;
font-family: PingFangTC;
font-weight: 600;
color: #999999;
line-height: 24rpx;
view:first-child {
padding-right: 16rpx;
}
}
}
}
.button {
.bnt:first-child {
background: #FFFFFF;
}
}
}
// .footer-h5 {
// bottom: 50px
// }
// .shoppingCart{
// position: relative;
// .list{
// margin-top: 150rpx;
// padding-top: 15rpx;
// }
// }
</style>