新增规格接口

master
chen 2022-02-24 11:21:51 +08:00
parent 2b7618a36e
commit 268fbd85f7
21 changed files with 482 additions and 398 deletions

View File

@ -2,13 +2,13 @@
<view v-if="visible">
<!-- 用户信息授权 -->
<view v-if="userInfo_mobile" @touchmove.stop.prevent="moveHandle" :class="isAnimation==2?'card-box-userinfo':''" class="auth-box">
<view :class="isAnimation==1?'card-box-userinfo':''">
<view :class="isAnimation==1?'card-box-userinfo':''" class="userinfo-box">
<view class="auth-top">
<image :src="appletImg" mode=""></image>
<image :src="appletImg" mode="" lazy-load class="auth-img"></image>
<view class="auth-top-content">
<view>恒美植发客服代表提醒您</view>
<view>您当前是游客身份</view>
<view>是否选择授权登录</view>
<view class="userinfo-info">恒美植发客服代表提醒您</view>
<view class="userinfo-info">您当前是游客身份</view>
<view class="userinfo-info">是否选择授权登录</view>
</view>
</view>
<view class="auth-center">申请 获取你的昵称头像地区及性别</view>
@ -220,14 +220,14 @@
}
</script>
<style>
<style scoped>
.auth-box {position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;z-index: 3;}
.auth-box > view {background-color: #FFFFFF;border-radius: 10rpx;padding: 30rpx;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.5);margin: 0 100rpx;}
.auth-box .userinfo-box{background-color: #FFFFFF;border-radius: 10rpx;padding: 30rpx;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.5);margin: 0 100rpx;}
.auth-top {display: flex;}
.auth-top image {width: 96rpx;height: 96rpx;flex-shrink: 0;}
.auth-top .auth-img {width: 96rpx;height: 96rpx;flex-shrink: 0;}
.auth-top-content {margin-left: 20rpx;}
.auth-top-content view {font-size: 28rpx;margin-top: 20rpx;color: #999999;}
.auth-top-content view:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
.auth-top-content .userinfo-info {font-size: 28rpx;margin-top: 20rpx;color: #999999;}
.auth-top-content .userinfo-info:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
.auth-center {font-size: 28rpx;margin: 30rpx 0;border-bottom: 1rpx solid #F5F5F5;border-top: 1rpx solid #F5F5F5;padding: 20rpx 0;}
.auth-bottom {display: flex;justify-content: center;align-items: center;font-size: 24rpx;}
.btn {padding: 12rpx 40rpx;border-radius: 4rpx;}

View File

@ -9,7 +9,7 @@
</view>
</view>
<view v-else :style="{paddingTop: statusBarHeight +'px'}" class="pad-zy30">
<slot></slot>
<slot name="content"></slot>
</view>
</view>
</template>

View File

@ -3,31 +3,31 @@
<!-- 底部按钮 -->
<view class="bottom-nav-box display-between-center">
<button type="default" @tap="immediatelyBuy"></button>
<button type="default" @tap="showFrame=true"></button>
<button type="default" @tap="addCartEv"></button>
</view>
<!-- 底部按钮弹框 -->
<view v-show="showFrame" class="frame-box" @tap="showFrame=false">
<view @tap.stop="showFrame=true">
<view @tap.stop="showFrame=true" class="item-box">
<view class="frame-top">
<image :src="shopImg" mode="aspectFill" lazy-load></image>
<view>
<image class="frame-img" :src="shopImg" mode="aspectFill" lazy-load></image>
<view class="frame-content">
<!-- 商品标题 -->
<view class="clips2 frame-title">{{detailObj.detail.name}}</view>
<!-- 商品价格 -->
<view class="frame-price">
<!-- 折扣价 -->
<view>{{discountPrice}}</view>
<view class="discount-box">{{discountPrice}}</view>
<!-- 原价 -->
<view style="text-decoration: line-through;">{{originalPrice}}</view>
<view class="original-box">{{originalPrice}}</view>
</view>
</view>
</view>
<!-- 商品尺寸规格 -->
<view class="frame-color-box">
<!-- 颜色 -->
<drop-down></drop-down>
<!-- <drop-down></drop-down> -->
<!-- 尺寸 -->
<drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down>
<!-- <drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down> -->
</view>
<!-- 商品库存 -->
<view class="frame-stock">库存{{detailObj.detail.stock}}</view>
@ -38,7 +38,7 @@
<button @tap="deladdEvent(0)" :disabled="buyNum==1" class="item-btn display-center-center">-</button>
<!-- 输入框 -->
<view class="input-box display-center-center">
<input type="text" v-model="buyNum" />
<input class="input" type="text" v-model="buyNum" />
</view>
<!-- -->
<button @tap="deladdEvent(1)" class="item-btn display-center-center">+</button>
@ -46,8 +46,8 @@
</view>
<!-- 立即购买加入购物车按钮 -->
<view class="frame-btn-box">
<button type="default" @tap="immediatelyBuy"></button>
<button type="default" @tap="addCartEv"></button>
<button class="btn" type="default" @tap="immediatelyBuy"></button>
<button class="btn" type="default" @tap="addCartEv"></button>
</view>
</view>
</view>
@ -92,9 +92,9 @@
};
},
mounted() {
//
//
this.originalPrice = this.detailObj.detail.original_price;
//
//
this.discountPrice = this.detailObj.detail.price;
//
this.shopImg = this.$http + this.detailObj.detail.cover;
@ -156,7 +156,7 @@
}
</script>
<style>
<style scoped>
.display-center-center {display: flex;justify-content: center;align-items: center;}
.display-between-center{display: flex;justify-content: space-between;align-items: center;}
.bottom-nav-box{position: fixed;bottom: 0;left: 0;right: 0;padding: 20rpx 40rpx;background-color: #FFFFFF;}
@ -173,23 +173,23 @@
button:last-child{border: 1rpx solid #000000;background-color: #000000;}
.frame-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background-color: rgba(0,0,0,.5);z-index: 12;}
.frame-box > view{background-color: #FFFFFF;position: absolute;bottom: 0;left: 0;right: 0;padding: 30rpx;}
.frame-box .item-box{background-color: #FFFFFF;position: absolute;bottom: 0;left: 0;right: 0;padding: 30rpx;}
.frame-top {display: flex;justify-content: space-between;}
.frame-top image {width: 223rpx;height: 223rpx;border-radius: 20rpx;flex-shrink: 0;margin-right: 30rpx;margin-top: -80rpx;}
.frame-top > view{width: 100%;display: flex;justify-content: space-between;flex-direction: column;}
.frame-top .frame-img {width: 223rpx;height: 223rpx;border-radius: 20rpx;flex-shrink: 0;margin-right: 30rpx;margin-top: -80rpx;}
.frame-top .frame-content{width: 100%;display: flex;justify-content: space-between;flex-direction: column;}
.frame-title{font-size: 36rpx;color: #000000;line-height: 50rpx;}
.frame-price{display: flex;align-items: center;}
.frame-price view:first-child{font-size: 40rpx;margin-right: 10rpx;}
.frame-price view:last-child{font-size: 28rpx;color: #868695;}
.frame-price .discount-box{font-size: 40rpx;margin-right: 10rpx;}
.frame-price .original-box{font-size: 28rpx;color: #868695;text-decoration: line-through;}
.frame-color-box{margin-top: 20rpx;}
.frame-btn-box{display: flex;align-items: center;justify-content: space-around;margin-top: 100rpx;}
.frame-btn-box button{height: 80rpx;line-height: 80rpx!important;border-radius: 20rpx;}
.frame-btn-box .btn{height: 80rpx;line-height: 80rpx!important;border-radius: 20rpx;}
.frame-stock{font-size: 24rpx;color: #000000;text-align: right;}
/* 加减按钮 */
.frame-add-del{display: flex;justify-content: flex-end;}
.add-del-box{width: 180rpx;margin-top: 20rpx;}
.input-box {width: 78rpx;height: 40rpx;font-size: 24rpx; border-radius: 16rpx;margin: 0 6rpx; border: 1rpx solid #000000;overflow: hidden;}
input {text-align: center;}
.input-box .input {text-align: center;}
.item-btn {width: 40rpx;height: 40rpx;border-radius: 12rpx;background-color: #000000!important;border: 1rpx solid #000000!important; color: #FFFFFF;padding: 0rpx;}
</style>

View File

@ -6,8 +6,8 @@
<i class="icon icon-next colpeili flexs" style="transition: all .3s;" :style="{transform: `rotate(${showFrame ? '0' : '90'}deg)`}"></i>
<view v-if="showFrame" class="drop animated " :class="showFrame?'fadeIn':'fadeOut'">
<view class="item-title" :class="activeItem==index?'itemActive':'itemMo'"
@tap.stop="chooseItem(index,item.id,item.childrenTitle)" v-for="(item,index) in dropObj.childrenList" :key="index">
<view class="clips1">{{item.childrenTitle}}</view>
@tap.stop="chooseItem(index,item.id,item.title,dropObj.title)" v-for="(item,index) in dropObj.children" :key="index">
<view class="clips1">{{item.title}}</view>
</view>
</view>
</view>
@ -23,7 +23,7 @@
default:()=>{
return {
title:'颜色',
childrenList:[
children:[
{
id:1,
childrenTitle:'粉色'
@ -45,7 +45,7 @@
};
},
mounted() {
if(this.dropObj.childrenList.length){
if(this.dropObj.children.length){
this.activeText = `请选择${this.dropObj.title}`;
} else {
this.activeText = `暂无可选项`;
@ -53,14 +53,14 @@
},
methods:{
//
chooseItem(index,id,title){
chooseItem(index,id,title,mainTitle){
//
this.activeItem = index;
//
this.activeText = title;
//
this.showFrame = false;
this.$emit('chooseItem',{id:id,title:title})
this.$emit('chooseItem',{id:id,title:title,mainTitle:mainTitle})
},
//
tuneUpEv(){

View File

@ -8,7 +8,7 @@
<!-- 后台动态改变的icon与标题 start -->
<!-- tab-图标列表 -->
<view class="item-box" :style="{marginBottom: marginBottomNum +'px'}">
<view @tap="choosefoot(index)"
<view @tap="choosefoot(index)" class="foot-icon"
:style="{width: 100 / imgList.length +'%'}"
:class="index == isIcon ? 'centerBox' : ''"
v-for="(itemi,index) in imgList" :key="index">
@ -174,7 +174,7 @@
/* 图标-文字外框样式 start */
.item-box{display: flex;justify-content: space-around;align-items: center;}
.item-box>view{text-align: center;box-sizing: border-box;}
.item-box .foot-icon,.item-box .foot-title{text-align: center;box-sizing: border-box;}
/* 图标-文字外框样式 end */
/* 突出的图标样式 start */

View File

@ -1,7 +1,7 @@
<template>
<view class="nothing">
<view class="nothing-box">
<image :src="imgSrc" mode="aspectFill"></image>
<image class="nothing-img" :src="imgSrc" mode="aspectFill" lazy-load></image>
<view class="nothing-con">{{content}}</view>
</view>
</view>
@ -31,6 +31,6 @@
<style scoped>
.nothing{position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;}
.nothing-box{display: flex;justify-content: center;flex-direction: column;align-items: center;}
.nothing-box>image{width: 474rpx;height: 273rpx;}
.nothing-box .nothing-img{width: 474rpx;height: 273rpx;}
.nothing-con{font-size: 24rpx;font-family: PingFang SC;font-weight: 500;line-height: 33rpx;color: #333333;text-align: center;}
</style>

View File

@ -14,7 +14,7 @@
props:{
totalPrice:{
type:String,
default: '0'
default: "0.00"
}
},
data() {

View File

@ -19,7 +19,7 @@
color: titleColor,
justifyContent: ifCenter ? 'center' : '',
padding: ifCenter ? '0px' : `${ifReturn ? '0 38' : '0 15'}px`}">
<view :class="['','clips1','clips2'][clipNumber]" :style="{maxWidth: ifCenter ? '360rpx' : '70%'}">{{navBarTitle}}</view>
<view class="title-box" :class="['','clips1','clips2'][clipNumber]" :style="{maxWidth: ifCenter ? '360rpx' : '70%'}">{{navBarTitle}}</view>
</view>
</view>
<!-- 头部状态栏 end -->
@ -144,5 +144,5 @@
font-size: 36rpx;font-weight: bold;
display: flex;
}
.tab-title view{margin-top: -4rpx;}
.tab-title .title-box{margin-top: -4rpx;}
</style>

View File

@ -377,7 +377,6 @@ const tools = {
}
},
loginEv(){//执行登录事件
let that = this;
uni.login({
provider: 'weixin',
success: (res)=> {
@ -385,7 +384,7 @@ const tools = {
let code = res.code;
let obj = uni.getStorageSync('params')
var params = {
invite_code: uni.getStorageSync('is_active')=='' ? uni.getStorageSync('invite_code') : '',
invite_code: uni.getStorageSync('is_active')!='' ? uni.getStorageSync('invite_code') : '',
code:code,
nickname: obj.nickname || '',
avatar: obj.avatarUrl || '',

View File

@ -8,7 +8,9 @@
:navBarTitle="'登录'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<rich-text :nodes="content"></rich-text>
</view>
</container-subgroup>
</view>
</template>

View File

@ -8,6 +8,7 @@
:navBarTitle="'登录'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">{{appletName}}</view>
@ -29,6 +30,7 @@
</view>
</view>
</view>
</view>
</container-subgroup>
</view>
</template>

View File

@ -9,7 +9,9 @@
:fromWhere="1"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<cart></cart>
</view>
</container-subgroup>
</view>
</template>

View File

@ -8,6 +8,7 @@
:navBarTitle="'分类'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<view class="pad30 sort-box mar-x20" style="margin-left: -30rpx;margin-right: -30rpx;" :style="{top: statusBarHeight+'px'}">
<view class="col0 fon38 disjbac fon50">
<view>分类筛选</view>
@ -66,6 +67,7 @@
</view>
<!-- 全局客服 -->
<public-customer :nbottom="520"></public-customer>
</view>
</container-subgroup>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='1'></foot-tab>
@ -215,6 +217,7 @@
this.screenList[mainIndex].childrenList.forEach((item,index)=>{
item.isCheck = false;
})
console.log(this.screenList);
// id
this.categoryId = this.screenList[0].childrenList[childrenIndex].id;
//

View File

@ -8,6 +8,7 @@
:navBarTitle="'个人中心'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<view class="disjcac fc">
<image class="mar-sx20" :src="userInfo.headimgurl" mode="aspectFill" style="width: 224rpx;height: 224rpx;border-radius: 60rpx;"></image>
<view class="fon36 bold">{{userInfo.nickname}}</view>
@ -35,6 +36,7 @@
</view>
<!-- 功能列表 -->
<function-list :list="funcList"></function-list>
</view>
</container-subgroup>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='2'></foot-tab>

View File

@ -4,6 +4,7 @@
<status-nav :navBarTitle="'分销中心'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<!-- 标题 -->
<view class="fon30 col0 mar-s30 mar-x10 tcenter">我的佣金</view>
<!-- 佣金 -->
@ -42,6 +43,7 @@
</view>
<!-- 暂无 -->
<pitera v-if="total==dataList.length"></pitera>
</view>
</container-subgroup>
<!-- 提现弹框 -->
<view v-show="showwithdrawal" :style="{top: statusBarHeight+'px'}" @tap="showwithdrawal=false" class="withdrawal-box">

View File

@ -4,6 +4,7 @@
<status-nav :navBarTitle="'确认订单'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<view class="bacf6 fon30 col3 radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">配送方式</view>
<view class="disac">
@ -47,11 +48,9 @@
<view class="bold">订单信息</view>
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
<image @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
<view class="width100 disjb fw" style="height: 166rpx;">
<view>
<view class="width100 disjb fc" style="height: 166rpx;">
<view @tap="goShopDetail(item.id)" class="fon30 col3 bold clips2">{{item.title}}</view>
<!-- <view class="order-sy">{{item.sku_name}}</view> -->
</view>
<view class="disjbac mar-s10 width100">
<view class="order-item-price">{{item.price}}</view>
<view class="fon30 col6">x{{item.num}}</view>
@ -73,6 +72,7 @@
<view class="bold">快递费用</view>
<view class="colf8 bold">{{expressInfo.default_price}}</view>
</view>
</view>
</container-subgroup>
<!-- 底部导航 -->
<payment :totalPrice="totalPrice" @immediatePayment="goPayment"></payment>

View File

@ -5,6 +5,7 @@
<!-- 容器 -->
<view class="pad-x140">
<container-subgroup>
<view slot="content">
<view v-if="loading">
<view @tap="goBack(index)" v-for="(item,index) in dataList" :key="index" class="bacf6 radius20 pad30 mar-s30">
<view class="pad-y20 disjbac">
@ -25,6 +26,7 @@
<view @tap.stop="obtainLngLat" class="posixzy address_add" :style="{backgroundColor:publicColor}" style="bottom: 20rpx;">新增地址</view>
<nothing-page v-if="dataList.length==0" :content="'暂无可用地址'"></nothing-page>
</view>
</view>
</container-subgroup>
</view>
<!-- 添加地址修改地址 -->

View File

@ -4,6 +4,7 @@
<status-nav :navBarTitle="'关于我们'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<!-- 地图 -->
<view class="radius30" style="overflow: hidden;border: 2rpx solid #8c8c9b;">
<map :latitude="lat" :longitude="lng" :enable-scroll="enableScroll" :enable-zoom="enableZoom" scale="11" style="height: 390rpx;width: 100%;"></map>
@ -13,6 +14,7 @@
<!-- 关于佩丽 -->
<view class="fon48 col0 mar-sx50">关于佩丽</view>
<rich-text :nodes="richText" class="fon30 colpeili line-h50"></rich-text>
</view>
</container-subgroup>
</view>
</template>

View File

@ -4,6 +4,7 @@
<status-nav :navBarTitle="'免责声明'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<rich-text :nodes="disclaimerRich" class="fon24 colpeili line-h46"></rich-text>
<!-- 标题 -->
<!-- <view class="fon30 col0 mar-sx30 tcenter">责任条款</view> -->
@ -16,6 +17,7 @@
<view class="mar-sx30">本网站图片文字之类版权申明因为网站可以由注册用户自行上传图片或文字本网站无法鉴别所上传图片或文字的知识版权如果侵犯请及时通知我们本网站将在第一时间及时删除</view>
<view class="mar-sx30">凡以任何方式登录本网站或直接间接使用本网站资料者视为自愿接受本网站声明的约束</view>
</view> -->
</view>
</container-subgroup>
</view>
</template>

View File

@ -4,6 +4,7 @@
<status-nav :navBarTitle="'订单详情'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<!-- 订单类型 -->
<block v-if="loading">
<view class="bacf6 radius20 mar-s20 fon30 line-h50 pad30">
@ -107,6 +108,7 @@
<view @tap="againBuy" v-if="orderInfo.status=='completed' || orderInfo.status=='closed'" class="order-btn" style="background-color: #f83030;color: #FFFFFF;"></view>
</view>
</block>
</view>
</container-subgroup>
</view>
</template>

View File

@ -5,6 +5,7 @@
<!-- 容器 -->
<view class="pad-x140" style="background-color: #fafafa;">
<container-subgroup>
<view slot="content">
<view style="margin: 0 -30rpx;">
<swiper-pu v-if="cateCurrent==0" :isplay="isAutoPlay" :browseP="true" :bannerList="bannerList" :newHeight="swiperHeight" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
</view>
@ -12,7 +13,7 @@
<view class="mar-s30 mar-x20 fon36 bold clips2 line-h50">{{detailObj.name}}</view>
<!-- 描述 -->
<view class="colpeili fon30 clips3 line-h50">{{detailObj.subtitle}}</view>
<view class="disac mar-s20">
<view class="disac mar-s20 mar-x50">
<!-- 是否限时优惠 -->
<view v-if="detailObj.tag!=''" class="fon24 colf pad-zy10 pad-s10 pad-x20 activity-img"></view>
<!-- 价格 -->
@ -21,22 +22,31 @@
<view class="fon30 colpeili" style="text-decoration: line-through;">{{originalPrice}}</view>
</view>
</view>
<view v-for="(item,index) in specList" :key="index">
<drop-down :dropObj="item" @chooseItem="chooseItem"></drop-down>
</view>
<!-- 颜色 -->
<view class="mar-s50"><drop-down></drop-down></view>
<!-- 尺寸 -->
<drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down>
<view style="background-color: #FFFFFF;margin: 0 -30rpx;">
<!-- <drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down> -->
<view class="pad-zy30" style="background-color: #FFFFFF;margin: 0 -30rpx;">
<!-- 作品介绍 -->
<view class="mar-s100 mar-x30 fon36 bold col0 tcenter pad-s50">作品介绍</view>
<!-- 富文本 -->
<rich-text :nodes="shopRich"></rich-text>
</view>
</view>
</container-subgroup>
</view>
<!-- 底部导航 -->
<view v-if="shopDetail!=''">
<bottom-nav :detailObj="shopDetail"></bottom-nav>
<!-- 底部按钮 -->
<view class="bottom-nav-box display-between-center">
<button type="default" @tap="immediatelyBuy"></button>
<button type="default" @tap="addCart"></button>
</view>
<!-- <view v-if="shopDetail!=''">
<bottom-nav :detailObj="shopDetail"></bottom-nav>
</view> -->
<!-- 全局客服 -->
<public-customer
:nbottom="180"
@ -67,6 +77,7 @@
return {
swiperHeight:uni.getSystemInfoSync().windowWidth,
cateCurrent:0,
specList:[],//
dropObj:{
title:'尺寸',
childrenList:[
@ -90,6 +101,9 @@
buyNum:1,//
csNum:0,//,
isAutoPlay:false,
specIdList:[],//id
specCehckList:[],//
transmitData:[],//
}
},
onShareAppMessage(res) {
@ -115,6 +129,19 @@
this.checkDetail(options.id);
},
methods: {
//
specsEv(id){
this.$requst.post('/api/spu/spec',{id}).then(res=>{
if(res.code==0){
this.specList = res.data.spec;
this.specCehckList = res.data.sku_list;
} else {
this.$toolAll.tools.showToast(res.msg);
}
}).catch(err=>{
this.$toolAll.tools.showToast(err.msg);
})
},
//
checkDetail(id){
this.$requst.post('/api/spu/detail',{id}).then(res=>{
@ -122,8 +149,9 @@
//
this.detailObj = res.data.detail;
this.shopDetail = res.data;
//
//
this.specsEv(id);
// start
//
let arrImg = this.detailObj.images.split(',')
arrImg.forEach(item=>{
@ -145,6 +173,7 @@
poster:'',
}
}
// end
//
// this.originalPrice = this.$toolAll.tools.changeNum(this.detailObj.original_price);
this.originalPrice = this.detailObj.original_price;
@ -162,24 +191,59 @@
},
//
chooseItem(e){
this.log(e);
let specIndex = this.specList.findIndex(item=>item.title==e.mainTitle);
this.specIdList[specIndex*1] = e.id;
let specStr = this.specIdList.join('_');
this.transmitData = this.specCehckList.filter(item=>item.indexes==specStr);
console.log(this.transmitData);
},
addCart(){//
//
immediatelyBuy(){
//
this.addCart(1);
},
addCart(index=0){//
if(this.transmitData.length){
if(this.csNum==0){
this.csNum++;
if(index==0){
this.$toolAll.tools.showToast('正在加入购物车...');
this.$requst.post('order/shopping-cart-add',{sku_id:this.skuDetail.id,num:this.buyNum}).then(res=>{
}
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.transmitData[0].id,num:1}).then(res=>{
if(res.code==0) {
if(index==1){
setTimeout(()=>{
uni.navigateTo({
url:'/pages/tabbar/cart/cart'
})
},500)
} else {
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
this.cartNumEv();
this.csNum = 0;
}
}
})
}
} else {
this.$toolAll.tools.showToast('请选择商品参数')
}
},
}
}
</script>
<style>
.display-between-center{display: flex;justify-content: space-between;align-items: center;}
.bottom-nav-box{position: fixed;bottom: 0;left: 0;right: 0;padding: 20rpx 40rpx;background-color: #FFFFFF;}
button{
width: 310rpx;
height: 100rpx;
line-height: 100rpx!important;
border-radius: 30rpx;
font-size: 36rpx;
border: 1rpx solid #FFFFFF;
color: #FFFFFF!important;
}
button:first-child{border: 1rpx solid #f81c1c;background-color: #f81c1c;}
button:last-child{border: 1rpx solid #000000;background-color: #000000;}
</style>