添加:立即进货 - 商品选择、多规格商品选择、数量变更及总数量和中金额计算
This commit is contained in:
parent
975ae30432
commit
7c4c64edaa
|
|
@ -169,7 +169,7 @@ export default {
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor', 'shopToken', 'shopIsLogin', 'shopMerId'])
|
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor', 'shopIsLogin', 'shopMerId'])
|
||||||
},
|
},
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
this.is_sys = options.is_sys;
|
this.is_sys = options.is_sys;
|
||||||
|
|
@ -177,22 +177,13 @@ export default {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.is_sys == 1 ? '平台管理' : (this.is_sys == 2 ? '酒道馆管理' : '商家管理')
|
title: this.is_sys == 1 ? '平台管理' : (this.is_sys == 2 ? '酒道馆管理' : '商家管理')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
console.log("商户登录相关")
|
|
||||||
console.log({
|
|
||||||
shopIsLogin: this.shopIsLogin,
|
|
||||||
shopToken: this.shopToken
|
|
||||||
|
|
||||||
})
|
|
||||||
// 登录后操作
|
// 登录后操作
|
||||||
if(this.is_sys == 1 || this.shopIsLogin){
|
if(this.is_sys == 1 || this.shopIsLogin){
|
||||||
this.getStoreList({is_sys: this.is_sys});
|
this.getStoreList({is_sys: this.is_sys, appoint_mer_id: this.shopMerId || ''});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getStoreList: function(data) {
|
getStoreList: function(data) {
|
||||||
data.appoint_mer_id = this.shopMerId || '';
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.shopList.getStoreList(data)
|
this.$refs.shopList.getStoreList(data)
|
||||||
});
|
});
|
||||||
|
|
@ -323,7 +314,7 @@ export default {
|
||||||
'time': data.exp,
|
'time': data.exp,
|
||||||
'shop_mer_id': data.mer_id,
|
'shop_mer_id': data.mer_id,
|
||||||
});
|
});
|
||||||
this.getStoreList({is_sys: this.is_sys});
|
this.getStoreList({is_sys: this.is_sys, appoint_mer_id: data.mer_id || ''});
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$util.Tips({ title: err });
|
this.$util.Tips({ title: err });
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<view class="search-content">
|
<view class="search-content">
|
||||||
<view class="search-main">
|
<view class="search-main">
|
||||||
<input class="search-input" type="text" placeholder="请输入商品名称...">
|
<input class="search-input" type="text" placeholder="请输入商品名称...">
|
||||||
<view class="search-btn">搜索</view>
|
<view class="search-btn" @click="getGoodsList(1)">搜索</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!--顶部提示-->
|
<!--顶部提示-->
|
||||||
|
|
@ -24,22 +24,32 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="buy">
|
<view class="buy">
|
||||||
<view class="left">
|
<view class="left" @click="changeBatchType(item.product_id)">
|
||||||
<template v-if="item.is_batch == 1">
|
<template v-if="item.is_batch == 1">
|
||||||
<view v-if="index / 2 == 0" class="buy-unit">按{{ item.batch_unit }}购买</view>
|
<view v-if="(batch_list[item.product_id] || 0) == 1" class="buy-unit">按{{ item.batch_unit }}购买</view>
|
||||||
<view v-else class="buy-unit">按{{ item.unit_name }}购买</view>
|
<view v-else class="buy-unit">按{{ item.unit_name }}购买</view>
|
||||||
<text class="iconfont icon-jiantou_shangxiaqiehuan_o"></text>
|
<text class="iconfont icon-jiantou_shangxiaqiehuan_o"></text>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<text v-if="index / 2 == 0" class="iconfont icon-gengduozhankai1"></text>
|
<text v-if="!buyList[item.product_id]" @click="buyFlowAddBuyNum('add', item)" class="iconfont icon-gengduozhankai1"></text>
|
||||||
<view v-else class="buy-num">
|
<view v-else class="buy-num">
|
||||||
<view class="num-change">
|
<view class="num-change">
|
||||||
<text class="iconfont icon-shangpinshuliang-jian"></text>
|
<text class="iconfont icon-shangpinshuliang-jian" @click="buyFlowAddBuyNum('reduce', item)"></text>
|
||||||
<input class="num-input" type='number' />
|
<input
|
||||||
<text class="iconfont icon-shangpinshuliang-jia"></text>
|
:value="buyList[item.product_id] ? buyList[item.product_id].total_num : 0"
|
||||||
|
class="num-input"
|
||||||
|
type='number'
|
||||||
|
@click="buyFlowAddBuyNum('click', item)"
|
||||||
|
:disabled="Object.values(item.attrValue).length > 1"
|
||||||
|
@input="buyFlowInputBuyNum($event, item.attrValue[0])"
|
||||||
|
/>
|
||||||
|
<text class="iconfont icon-shangpinshuliang-jia" @click="buyFlowAddBuyNum('add', item)" ></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="unit"> 箱 共12瓶</view>
|
<view v-if="(batch_list[item.product_id] || 0) == 1" class="unit">
|
||||||
|
{{ item.batch_unit }} 共{{ (buyList[item.product_id].total_num || 0) * (buyList[item.product_id].batch_num || 1) }}{{ item.unit_name }}
|
||||||
|
</view>
|
||||||
|
<view v-else class="unit">{{ item.unit_name }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -49,10 +59,10 @@
|
||||||
<view class="settlement">
|
<view class="settlement">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<text class="iconfont icon-gouwuche-mendian">
|
<text class="iconfont icon-gouwuche-mendian">
|
||||||
<text class="total-num">99+</text>
|
<text class="total-num" v-if="totalNum > 0">{{ totalNum > 99 ? '99+' : totalNum }}</text>
|
||||||
</text>
|
</text>
|
||||||
<view class="total">
|
<view class="total">
|
||||||
合计:<text class="total-price">¥54288.00</text>
|
合计:<text class="total-price">¥{{ totalPrice }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="settlement-btn">立即结算</view>
|
<view class="settlement-btn">立即结算</view>
|
||||||
|
|
@ -60,6 +70,69 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 授权登录 -->
|
<!-- 授权登录 -->
|
||||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
|
||||||
|
<!--多规格商品选择弹框-->
|
||||||
|
<uni-popup ref="moreSpecsSelect" type="bottom" :is-mask-click="false">
|
||||||
|
<view class="more-spec-content">
|
||||||
|
<!--顶部商品信息-->
|
||||||
|
<view class="goods-info">
|
||||||
|
<view class="image">
|
||||||
|
<image class="goods-image" :src="currentGoods.selected.image"></image>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="title">{{ currentGoods.store_name }}</view>
|
||||||
|
<view class="price">
|
||||||
|
<text class="price-icon">¥</text>
|
||||||
|
{{ currentGoods.selected.price || '' }}
|
||||||
|
</view>
|
||||||
|
<view v-if="(batch_list[currentGoods.product_id] || 0) == 1" class="stock">
|
||||||
|
库存:{{ Math.floor((currentGoods.selected.stock || 0) / currentGoods.batch_num) }}
|
||||||
|
</view>
|
||||||
|
<view v-else class="stock">库存:{{ currentGoods.selected.stock || '' }}</view>
|
||||||
|
</view>
|
||||||
|
<text class="iconfont icon-cha2 close-btn" @click="closeMoreSpecsSelect"></text>
|
||||||
|
</view>
|
||||||
|
<!--规格-->
|
||||||
|
<view class="goods-spec">
|
||||||
|
<view class="spec-block" v-for="(item,index) in currentGoods.attr" :key="index">
|
||||||
|
<view class="spec-title">{{ item.attr_name || '' }}</view>
|
||||||
|
<view class="spec-list">
|
||||||
|
<view
|
||||||
|
v-for="(specItem,specIndex) in item.attr_values"
|
||||||
|
:key="specIndex"
|
||||||
|
:class="['spec-list-tag',{'spec-list-tag-active': Object.values(currentGoods.selected_spec).includes(specItem)}]"
|
||||||
|
@click="buyFlowChangeSpec(item.attr_name, specItem)"
|
||||||
|
>
|
||||||
|
{{ specItem || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!--数量变更-->
|
||||||
|
<view class="bottom-content">
|
||||||
|
<!--操作按钮-->
|
||||||
|
<view class="num-change">
|
||||||
|
<text class="iconfont icon-shangpinshuliang-jian" @click="buyFlowChangeNum('reduce', currentGoods.selected)"></text>
|
||||||
|
<input
|
||||||
|
:value="buyList[currentGoods.selected.product_id] ? (buyList[currentGoods.selected.product_id].specs ? (buyList[currentGoods.selected.product_id].specs[currentGoods.selected.unique].cart_num || 0) : 0) : 0"
|
||||||
|
class="num-input"
|
||||||
|
type='number'
|
||||||
|
@input="buyFlowInputBuyNum($event, currentGoods.selected)"
|
||||||
|
/>
|
||||||
|
<text class="iconfont icon-shangpinshuliang-jia" @click="buyFlowChangeNum('add', currentGoods.selected)"></text>
|
||||||
|
</view>
|
||||||
|
<!--单位-->
|
||||||
|
<view v-if="(batch_list[currentGoods.product_id] || 0) == 1" class="unit">
|
||||||
|
{{ currentGoods.batch_unit }} 共{{ (buyList[currentGoods.selected.product_id] ? (buyList[currentGoods.selected.product_id].specs ? (buyList[currentGoods.selected.product_id].specs[currentGoods.selected.unique].cart_num || 0) : 0) : 0) * (buyList[currentGoods.product_id].batch_num || 1) }}{{ currentGoods.unit_name }}
|
||||||
|
</view>
|
||||||
|
<view v-else class="unit">{{ currentGoods.unit_name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -75,10 +148,13 @@ export default {
|
||||||
authorize,
|
authorize,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
|
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor','shopToken', 'shopIsLogin', 'shopMerId'])
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 登录相关
|
||||||
|
isAuto: false, //没有授权的不会自动授权
|
||||||
|
isShowAuth: false,//是否隐藏授权
|
||||||
// 商品列表相关
|
// 商品列表相关
|
||||||
list: [],
|
list: [],
|
||||||
search:{
|
search:{
|
||||||
|
|
@ -86,20 +162,55 @@ export default {
|
||||||
store_name: '',
|
store_name: '',
|
||||||
},
|
},
|
||||||
// 购买选中商品相关
|
// 购买选中商品相关
|
||||||
buy_list: {},
|
totalNum: 0,
|
||||||
|
totalPrice: 0.00,
|
||||||
|
buyList: {},
|
||||||
|
batch_list: {},
|
||||||
|
currentGoods: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 判断:是否登录
|
// 判断:是否登录
|
||||||
if (!this.isLogin) this.isAuto = this.isShowAuth = true;// 未登录 授权登录
|
if (!this.isLogin) {
|
||||||
|
this.isAuto = true;
|
||||||
|
this.isShowAuth = true;// 未登录 授权登录
|
||||||
|
}
|
||||||
else this.init();// 已登录 获取信息
|
else this.init();// 已登录 获取信息
|
||||||
},
|
},
|
||||||
// 滚动到底部
|
watch: {
|
||||||
onReachBottom() {
|
// 多规格 选中规格改变
|
||||||
this.getGoodsList();
|
'currentGoods.selected_spec': {
|
||||||
|
handler() {
|
||||||
|
let good = Object.assign({}, this.currentGoods)
|
||||||
|
let defaultName = Object.values(good.selected_spec).join(',');
|
||||||
|
// 赋值
|
||||||
|
this.currentGoods.selected = good.attrValue[defaultName] || {};
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
// 计算总数
|
||||||
|
'buyList': {
|
||||||
|
handler() {
|
||||||
|
let totalNum = 0;
|
||||||
|
let totalPrice = 0.00;
|
||||||
|
Object.values(this.buyList).forEach(item => {
|
||||||
|
totalNum += item.total_num;
|
||||||
|
Object.values(item.specs).forEach(value => {
|
||||||
|
let price = value.price * value.cart_num;
|
||||||
|
let currentBatchType = this.batch_list[value.product_id] || 0;
|
||||||
|
// 判断:如果是批量购买 当前价格需要乘以每批的数量
|
||||||
|
if(currentBatchType == 1) price = price * item.batch_num;
|
||||||
|
|
||||||
|
totalPrice += price;
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 赋值
|
||||||
|
this.totalNum = totalNum;
|
||||||
|
this.totalPrice = totalPrice;
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 授权回调
|
// 授权回调
|
||||||
|
|
@ -115,6 +226,28 @@ export default {
|
||||||
},
|
},
|
||||||
// 授权成功 初始化
|
// 授权成功 初始化
|
||||||
init () {
|
init () {
|
||||||
|
// 判断:商户是否登录
|
||||||
|
if(!this.shopIsLogin){
|
||||||
|
uni.showModal({
|
||||||
|
title: '未登录',
|
||||||
|
content: '请先登录酒道馆账号!',
|
||||||
|
confirmText: '去登录',
|
||||||
|
cancelText: '返回首页',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/admin/business/index?is_sys=2'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 商户已经登录 进行后续操作
|
||||||
this.getGoodsList();
|
this.getGoodsList();
|
||||||
},
|
},
|
||||||
// 供应商商品列表
|
// 供应商商品列表
|
||||||
|
|
@ -134,10 +267,141 @@ export default {
|
||||||
this.$util.Tips({title: err});
|
this.$util.Tips({title: err});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 输入购买数量
|
||||||
|
buyFlowInputBuyNum(event, spec){
|
||||||
|
// 指定数量
|
||||||
|
spec.input_num = Number(event.detail.value || event.target.value);
|
||||||
|
|
||||||
|
this.buyFlowChangeNum('input', spec);
|
||||||
|
},
|
||||||
|
// 购买流程 - 添加购买数量
|
||||||
|
buyFlowAddBuyNum(type, item){
|
||||||
|
let isMoreSpecs = Object.values(item.attrValue).length || 0;
|
||||||
|
let good = Object.assign({}, item);
|
||||||
|
if(Number(isMoreSpecs) > 1){
|
||||||
|
// 多规格 初始化选中项
|
||||||
|
let selected_spec = {};
|
||||||
|
Object.values(good.attr).forEach((val,index) => {
|
||||||
|
selected_spec[val.attr_name] = (val.attr_values ? val.attr_values[0] : '');
|
||||||
|
})
|
||||||
|
// 赋值
|
||||||
|
good.selected_spec = selected_spec;
|
||||||
|
this.currentGoods = Object.assign({}, good);
|
||||||
|
this.$refs.moreSpecsSelect.open('bottom');
|
||||||
}
|
}
|
||||||
|
else if(['add', 'reduce', 'input'].includes(type)){
|
||||||
|
// 单规格
|
||||||
|
good.selected_spec = {};
|
||||||
|
this.currentGoods = Object.assign({}, good);
|
||||||
|
let spec = item.attrValue[0];
|
||||||
|
this.buyFlowChangeNum(type, spec)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 购买流程 - 数量改变(添加 || 减少)
|
||||||
|
buyFlowChangeNum(type, spec){
|
||||||
|
let currentProduct = this.buyList[spec.product_id] || {};
|
||||||
|
if(Object.values(currentProduct).length > 0){
|
||||||
|
// 商品已经存在
|
||||||
|
let currentSpec = currentProduct.specs[spec.unique] || {};
|
||||||
|
if(Object.values(currentSpec).length <= 0) {
|
||||||
|
if(type === 'reduce') return false;
|
||||||
|
spec.cart_num = 0;
|
||||||
|
currentSpec = spec;
|
||||||
|
}
|
||||||
|
// 记录变更前数量
|
||||||
|
let oldNum = currentSpec.cart_num || 0;
|
||||||
|
// 数量变更
|
||||||
|
if(type === 'add') currentSpec.cart_num += 1;
|
||||||
|
else if(type === 'reduce') currentSpec.cart_num -= 1;
|
||||||
|
else if(type === 'input') currentSpec.cart_num = spec.input_num || 0;
|
||||||
|
// 计算变更数量
|
||||||
|
let currentNum = currentSpec.cart_num || 0;
|
||||||
|
let changeNum = Number(oldNum) - Number(currentNum);
|
||||||
|
// 判断:购买数量是否已经为0 是则删除
|
||||||
|
if(currentSpec.cart_num <= 0) delete currentProduct.specs[spec.unique];
|
||||||
|
else currentProduct.specs[spec.unique] = currentSpec;
|
||||||
|
// 判断:当前商品不存在任何购买规格
|
||||||
|
if(Object.values(currentProduct.specs).length <= 0){
|
||||||
|
this.$set(this.buyList, spec.product_id, {});
|
||||||
|
delete this.buyList[spec.product_id];
|
||||||
|
}else{
|
||||||
|
currentProduct.total_num -= changeNum;
|
||||||
|
this.$set(this.buyList, spec.product_id, currentProduct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// 商品不存在
|
||||||
|
if(type === 'add') spec.cart_num = 1;
|
||||||
|
else if(type === 'reduce') return false;
|
||||||
|
else if(type === 'input') spec.cart_num = spec.input_num || 0;
|
||||||
|
// 初始化
|
||||||
|
this.$set(this.buyList, spec.product_id, {
|
||||||
|
// 购买单位类型
|
||||||
|
is_batch: this.currentGoods.is_batch,// 是否支持按照批次购买
|
||||||
|
batch_num: this.currentGoods.batch_num,// 一批等于多少件
|
||||||
|
batch_unit: this.currentGoods.batch_unit,// 一批次的单位
|
||||||
|
// 其他信息
|
||||||
|
product_id: spec.product_id,
|
||||||
|
total_num: spec.cart_num,
|
||||||
|
store_name: this.currentGoods.store_name,
|
||||||
|
specs: {
|
||||||
|
[spec.unique]: spec,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
|
// 购买流程 - 多规格弹框关闭
|
||||||
|
closeMoreSpecsSelect(){
|
||||||
|
this.$refs.moreSpecsSelect.close();
|
||||||
|
},
|
||||||
|
// 购买流程 - 多规格切换
|
||||||
|
buyFlowChangeSpec(attrName, specItem){
|
||||||
|
this.currentGoods.selected_spec[attrName] = specItem;
|
||||||
|
},
|
||||||
|
// 购买流程 - 切换购买单位
|
||||||
|
changeBatchType(productId){
|
||||||
|
let currentBatchType = this.batch_list[productId] || 0;
|
||||||
|
this.batch_list[productId] = currentBatchType == 0 ? 1 : 0;
|
||||||
|
|
||||||
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 购物车 - 获取已存在列表
|
||||||
|
cartGetList(){},
|
||||||
|
// 购物车 - 购物车总数
|
||||||
|
cartGetCount(){},
|
||||||
|
// 购物车 - 提交购物车
|
||||||
|
cartSubmitEdit(){},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// cart_num: 10
|
||||||
|
// is_new: 0
|
||||||
|
// product_attr_unique: "598aa5ec4390"
|
||||||
|
// product_id: "247"
|
||||||
|
// product_type: 0
|
||||||
|
// spread_id: ""
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// cart_num: 8
|
||||||
|
// is_new: 0
|
||||||
|
// product_attr_unique: "53cd849c89f0"
|
||||||
|
// product_id: "248"
|
||||||
|
// product_type: 0
|
||||||
|
// spread_id: ""
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 滚动到底部
|
||||||
|
onReachBottom() {
|
||||||
|
this.getGoodsList();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -146,7 +410,7 @@ export default {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #f6f6f6;
|
background-color: #f6f6f6;
|
||||||
|
// 主要内容
|
||||||
.main-content{
|
.main-content{
|
||||||
padding-bottom: 150rpx;
|
padding-bottom: 150rpx;
|
||||||
// 搜索
|
// 搜索
|
||||||
|
|
@ -378,5 +642,150 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 多规格选择弹框
|
||||||
|
.more-spec-content{
|
||||||
|
height: 80vh;
|
||||||
|
width: 100vw;
|
||||||
|
border-top-left-radius: 30rpx;
|
||||||
|
border-top-right-radius: 30rpx;
|
||||||
|
background: #f6f6f6;
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.goods-info{
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
.image{
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
.goods-image{
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info{
|
||||||
|
width: calc(100% - (120rpx + 60rpx));
|
||||||
|
padding-left: 15rpx;
|
||||||
|
.title{
|
||||||
|
font-size: 32rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
.price{
|
||||||
|
.price-icon{
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
color: #d14e42;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 40rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
.stock{
|
||||||
|
color: #a8a8a8;
|
||||||
|
font-size: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.close-btn{
|
||||||
|
width: 60rpx;
|
||||||
|
text-align: right;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
font-size: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-spec{
|
||||||
|
max-height: calc(100% - 70rpx - 30rpx - 120rpx - 20rpx);
|
||||||
|
overflow: auto;
|
||||||
|
.spec-block{
|
||||||
|
.spec-title{
|
||||||
|
width: 100%;
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
color: #a8a8a8;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.spec-list{
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
.spec-list-tag{
|
||||||
|
border: 2rpx solid #a6a6a6;
|
||||||
|
height: 45rpx;
|
||||||
|
line-height: 45rpx;
|
||||||
|
padding: 0 15rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
.spec-list-tag-active{
|
||||||
|
background: #e93423;
|
||||||
|
color: #f3f3f3;
|
||||||
|
border-color: #e93423;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-content{
|
||||||
|
--border-color-: #000000;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
.num-change{
|
||||||
|
border: 2rpx solid var(--border-color-);
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
padding: 0 15rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
.iconfont{
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
width: 70rpx;
|
||||||
|
}
|
||||||
|
.icon-shangpinshuliang-jian{
|
||||||
|
padding-right: 15rpx;
|
||||||
|
}
|
||||||
|
.icon-shangpinshuliang-jia{
|
||||||
|
padding-left: 15rpx;
|
||||||
|
}
|
||||||
|
.num-input{
|
||||||
|
border-left: 2rpx solid var(--border-color-);
|
||||||
|
border-right: 2rpx solid var(--border-color-);
|
||||||
|
width: 150rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.unit{
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export default {
|
||||||
keyColor: state => state.app.keyColor,
|
keyColor: state => state.app.keyColor,
|
||||||
// 商户登录相关
|
// 商户登录相关
|
||||||
shopToken: state => state.app.shopToken,
|
shopToken: state => state.app.shopToken,
|
||||||
shopIsLogin: state => !!state.app.shopToken,
|
shopIsLogin: state => !!state.app.shopToken && state.app.shopToken !== 'null',
|
||||||
shopMerId: state => state.app.shopMerId,
|
shopMerId: state => state.app.shopMerId,
|
||||||
};
|
};
|
||||||
// export default {
|
// export default {
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ const mutations = {
|
||||||
uni.removeStorageSync('auth_token');
|
uni.removeStorageSync('auth_token');
|
||||||
},
|
},
|
||||||
SHOP_LOGIN(state, opt) {
|
SHOP_LOGIN(state, opt) {
|
||||||
state.shopToken = opt.token;
|
|
||||||
Cache.set('SHOP_LOGIN_STATUS_TOKEN', opt.token, opt.time);
|
Cache.set('SHOP_LOGIN_STATUS_TOKEN', opt.token, opt.time);
|
||||||
Cache.set('SHOP_MER_ID', opt.shop_mer_id);
|
Cache.set('SHOP_MER_ID', opt.shop_mer_id);
|
||||||
|
state.shopToken = opt.token;
|
||||||
},
|
},
|
||||||
SETUID(state,val){
|
SETUID(state,val){
|
||||||
state.uid = val;
|
state.uid = val;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue