Commit 8016a70e authored by zhangjianguo's avatar zhangjianguo

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

parents f92a566c a6040332
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
font-family: "oswald"; font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf"); src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
} }
*{ html,body{
font-family: "oswald" !important; font-family: "oswald" !important;
} }
swiper{ swiper{
......
...@@ -147,6 +147,20 @@ export default { ...@@ -147,6 +147,20 @@ export default {
g: {}, g: {},
skuObj: null, skuObj: null,
notStockGood: [], notStockGood: [],
forms:{
list: [
{
mch_id: 0,
goods_list: [],
distance: 0,
remark: "",
order_form: [],
use_integral: 0,
user_coupon_id: 0,
},
],
address_id: 0,
}
}; };
}, },
mounted() { mounted() {
...@@ -224,7 +238,6 @@ export default { ...@@ -224,7 +238,6 @@ export default {
}, },
buy() { buy() {
if (this.skuObj && this.skuObj.id) { if (this.skuObj && this.skuObj.id) {
let goods = [];
let g = { let g = {
id: this.skuObj.goods_id, id: this.skuObj.goods_id,
num: this.gc, num: this.gc,
...@@ -238,12 +251,11 @@ export default { ...@@ -238,12 +251,11 @@ export default {
attr_group_id: x.attr_group_id, attr_group_id: x.attr_group_id,
}); });
}); });
goods.push(g); this.forms.list[0].goods_list.push(g)
console.log(goods); this.forms.list[0].mch_id=this.g.mch_id
uni.navigateTo({ uni.navigateTo({
url: url:
"/pages/order-submit/order-submit?goods=" + "/pages/order-submit/order-submit?formData=" + encodeURIComponent(JSON.stringify(this.forms)),
encodeURIComponent(JSON.stringify(goods)),
complete(res) { complete(res) {
console.log(res); console.log(res);
}, },
......
...@@ -10,41 +10,49 @@ ...@@ -10,41 +10,49 @@
style="width: 100%; height: 100%;" style="width: 100%; height: 100%;"
/> />
</view> </view>
<view class="good-name">{{ cx.name }}</view> <view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.name }}</view>
<view class="good-info"> <view class="good-info">
<view class="price" :style="{ color: mainColor }">{{ <view class="price" :style="{ color: mainColor }">{{
cx.price_content cx.price_content
}}</view> }}</view>
<view class="sell">{{ cx.sales }}</view> <view class="sell" v-if="setting.is_show_sales_num=='1'">{{ cx.sales }}</view>
<view class="cart" @click.stop="showSkuHandler(cx)"> <view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" /> <u-icon name="cart-o" size="40" :color="mainColor" />
</view> </view>
</view> </view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku> <good-sku
v-if="showSku"
:option-type="2"
borderRadius="20"
v-model="showSku"
:good="sku"
></good-sku>
</view> </view>
</template> </template>
<script> <script>
import goodSku from '../goods/goodsku' import goodSku from "../goods/goodsku";
export default { export default {
components:{ components: {
goodSku goodSku,
}, },
props: ["list"], props: ["list"],
data() { data() {
return { return {
g: [], g: [],
showSku:false, showSku: false,
sku:{}, sku: {},
mainColor:"" mainColor: "",
setting:{}
}; };
}, },
mounted() { mounted() {
this.g = this.list; this.g = this.list;
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.initConfig()
}, },
watch: { watch: {
list: { list: {
...@@ -52,19 +60,22 @@ export default { ...@@ -52,19 +60,22 @@ export default {
immediate: true, immediate: true,
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
this.g = newVal; this.g = newVal;
} },
}, },
}, },
methods: { methods: {
initConfig() {
this.setting = uni.getStorageSync("basedata").mall.setting
},
clickHandler(url) { clickHandler(url) {
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
}); });
}, },
showSkuHandler(g){ showSkuHandler(g) {
this.sku=g this.sku = g;
this.showSku=true this.showSku = true;
} },
}, },
}; };
</script> </script>
......
...@@ -3,8 +3,15 @@ ...@@ -3,8 +3,15 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [{ "pages": [{
"path": "pages/order/index/index"
},
{
"path": "pages/index/index" "path": "pages/index/index"
}, },
{
"path": "pages/order-submit/order-submit"
},
{ {
"path": "pages/search/search" "path": "pages/search/search"
}, },
...@@ -46,10 +53,6 @@ ...@@ -46,10 +53,6 @@
}, },
{ {
"path": "pages/order/index" "path": "pages/order/index"
},
{
"path": "pages/order/index/index"
} }
], ],
"globalStyle": { "globalStyle": {
......
<template> <template>
<div class="cartStyle" v-if="!isloading" :style="{'height':contentHeight}"> <div class="cartStyle" v-if="!isloading" :style="{ height: contentHeight }">
<view style=" <view
display: flex; style="
flex-direction: row; display: flex;
align-items: center; flex-direction: row;
justify-content: space-between; align-items: center;
padding: 0 15rpx; justify-content: space-between;
"> padding: 0 15rpx;
<Text class="grid-text">商品库存有限,请尽快下单哦</Text> "
<Text @click="edit" v-if="editType == false" class="grid-text_r">编辑</Text> >
<Text @click="edit" v-if="editType == true" class="grid-text_r">完成</Text> <Text class="grid-text">商品库存有限,请尽快下单哦</Text>
</view> <Text @click="edit" v-if="editType == false" class="grid-text_r"
<view style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"></view> >编辑</Text
<u-empty v-if="list.length == 0" text="购物车还是空的哦" mode="car"></u-empty> >
<Text @click="edit" v-if="editType == true" class="grid-text_r"
<view v-if="list.length > 0" style=" >完成</Text
height: calc(100vh - 60px); >
width: calc(100vw); </view>
overflow: hidden; <view
padding-top: 10px; style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"
"> ></view>
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%' }"> <u-empty
<view class="cartList" :style="{ 'margin-bottom': listbottom }" v-if="list.length > 0" v-for="(c, i) in list" :key="i"> v-if="list.length == 0"
<view style="padding: 0 12px 12px 12px; border-bottom: 1rpx solid #f5f5f5;width: 100%;"> text="购物车还是空的哦"
<u-checkbox-group @change="mch_SelectAll(c.checked,i)"> mode="car"
<u-checkbox v-model="c.checked" shape="circle" :active-color="mc">{{c.name}}</u-checkbox> ></u-empty>
</u-checkbox-group>
</view> <view
<view class="cartList_item" v-for="(item, index) in c.goods_list" :key="index" :name="item.name"> v-if="list.length > 0"
<u-checkbox-group v-if='item.new_status==0 || editType==true' @change="clickcheckbox(item.checked, item.attrs.price, index,i)"> style="
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox> height: calc(100vh - 60px);
</u-checkbox-group> width: calc(100vw);
<Text v-if='item.new_status!=0 && editType==false' style='color: #a0a09d;width: 22px;'>失效</Text> overflow: hidden;
<image :src="item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic" mode="aspectFill" style=" padding-top: 10px;
width: 150rpx; "
height: 150rpx; >
margin-left: 30rpx; <scroll-view
border-radius: 5px; :scroll-y="true"
" /> :enable-back-to-top="true"
<view style=" :enable-flex="true"
display: flex; :style="{ height: '100%' }"
flex-direction: column; >
justify-content: space-between; <template v-if="list.length > 0">
width: 460rpx; <view
height: 150rpx; class="cartList"
margin-left: 20rpx; :style="{ 'margin-bottom': listbottom }"
"> v-for="(c, i) in list"
<Text style=" :key="i"
font-size: 28rpx; >
width: 460rpx; <view
overflow: hidden; style="
white-space: nowrap; padding: 0 12px 12px 12px;
text-overflow: ellipsis; border-bottom: 1rpx solid #f5f5f5;
">{{ item.goods.name }}</Text> width: 100%;
<view style=" "
width: 460rpx; >
overflow: hidden; <u-checkbox-group @change="mch_SelectAll(c.checked, i)">
white-space: nowrap; <u-checkbox
text-overflow: ellipsis; v-model="c.checked"
"> shape="circle"
<view v-for="(attr, inde2x) in item.attrs.attr" :key="inde2x"> :active-color="mc"
<Text style="color: #a0a09d; font-size: 24rpx; margin-right: 5rpx;">{{ attr.attr_group_name }}:{{ attr.attr_name }}</Text> >{{ c.name }}</u-checkbox
</view> >
</view> </u-checkbox-group>
<view style=" </view>
display: flex; <view
flex-direction: row; class="cartList_item"
align-items: center; v-for="(item, index) in c.goods_list"
justify-content: space-between; :key="index"
"> :name="item.name"
<Text style="font-size: 30rpx;" :style="{ color: mc }">¥<Text style="40rpx">{{ item.attrs.price }}</Text></Text> >
<!-- <u-number-box :value="item.num" :min="1" :max='100' :input-width="100" @change="valChange(i,index, item.num,item.attrs.price,$event)"></u-number-box> --> <u-checkbox-group
<view class="item_input"> v-if="item.new_status == 0 || editType == true"
<view class="item_input_l" :style="{ @change="
color: item.num == 1 ? '#E2E2E2' : '#9B9B9B', clickcheckbox(item.checked, item.attrs.price, index, i)
}" "
@click="reduce(i,index, item.attrs.price)">-</view> >
<input type="number" class="item_input_c" :value="item.num" @blur='inputblur(i,index, item.num,item.attrs.price,$event)' <u-checkbox
@input='onKeyInput(i,index, item.num,item.attrs.price,$event)' /> v-model="item.checked"
<view class="item_input_r" style="color: #9b9b9b;" @click="plus(i,index, item.attrs.price)">+</view> shape="circle"
</view> :active-color="mc"
</view> ></u-checkbox>
</view> </u-checkbox-group>
</view> <Text
</view> v-if="item.new_status != 0 && editType == false"
</scroll-view> style="color: #a0a09d; width: 22px;"
</view> >失效</Text
>
<image
<view class="box_bottom" > :src="
<div style="margin-left: 30rpx;"> item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic
<u-checkbox-group @change="SelectAll"> "
<u-checkbox v-model="allchecked" shape="circle" :active-color="mc">全选</u-checkbox> mode="aspectFill"
</u-checkbox-group> style="
<Text style="font-size: 30rpx;" :style="{ color: mc }" v-if="editType == false">¥{{ TotalPrice }}</Text> width: 150rpx;
</div> height: 150rpx;
<div class="bottom_btn" v-if="!editType"> margin-left: 30rpx;
<u-button size="80" :ripple="true" shape="circle" @click="settlement" :custom-style="{ border-radius: 5px;
backgroundColor: mc, "
height: '80rpx', />
color: '#FFF', <view
fontSize: '14px', style="
}">去结算({{ checkCount }}) display: flex;
</u-button> flex-direction: column;
</div> justify-content: space-between;
<u-button v-if="editType" size="80" :ripple="true" shape="circle" @click="delete_btn" :custom-style="{ width: 460rpx;
backgroundColor: secondary, height: 150rpx;
height: '80rpx', margin-left: 20rpx;
color: '#FFF', "
fontSize: '14px', >
marginRight: '12px', <Text
}">删除 style="
</u-button> font-size: 28rpx;
</view> width: 460rpx;
overflow: hidden;
<tabbars></tabbars> white-space: nowrap;
</div> text-overflow: ellipsis;
</template> "
<script> >{{ item.goods.name }}</Text
import tabbars from "@/components/tabbar/index"; >
export default { <view
data() { style="
return { width: 460rpx;
isloading: true, overflow: hidden;
pageTitle: "购物车", white-space: nowrap;
navHeight: 0, text-overflow: ellipsis;
contentHeight: 0, "
cstyle: {}, >
<view v-for="(attr, inde2x) in item.attrs.attr" :key="inde2x">
allchecked: false, <Text
TotalPrice: 0, //总价格 style="
bottommargin: 0, color: #a0a09d;
listbottom: 0, font-size: 24rpx;
editType: false, margin-right: 5rpx;
list: [], "
>{{ attr.attr_group_name }}:{{ attr.attr_name }}</Text
cart_id_list: [], >
mc: "", </view>
secondary: "", </view>
checkCount: 0, <view
}; style="
}, display: flex;
created() {}, flex-direction: row;
components: { align-items: center;
tabbars, justify-content: space-between;
}, "
onLoad() { >
this.navHeight = this.$navHeight - 2; <Text style="font-size: 30rpx;" :style="{ color: mc }"
this.mc = this.$uiConfig.mainColor; >¥<Text style="40rpx">{{ item.attrs.price }}</Text></Text
this.secondary = this.$uiConfig.secondary; >
this.cstyle = uni.getStorageSync("basedata") ? <!-- <u-number-box :value="item.num" :min="1" :max='100' :input-width="100" @change="valChange(i,index, item.num,item.attrs.price,$event)"></u-number-box> -->
uni.getStorageSync("basedata").cat_style : []; <view class="item_input">
<view
if (this.cstyle.cat_style == "4") { class="item_input_l"
:style="{
} color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
}, }"
mounted() { @click="reduce(i, index, item.attrs.price)"
let currentPages = getCurrentPages(); >-</view
let c = this.$uiConfig.is_bang ? 80 : 52; >
this.bottommargin = c - 2 + "px"; <input
this.listbottom = c + 44 + "px"; type="number"
this.contentHeight = this.$utils.calcContentHeight(c-42) + 'px'; class="item_input_c"
let u = "/" + currentPages[currentPages.length - 1].route; :value="item.num"
let pages = wx.getStorageSync("basedata") ? @blur="
wx.getStorageSync("basedata").bar_title : []; inputblur(i, index, item.num, item.attrs.price, $event)
pages.forEach((x) => { "
if (x.value == u) { @input="
this.pageTitle = x.new_name ? x.new_name : x.name; onKeyInput(i, index, item.num, item.attrs.price, $event)
} "
}); />
uni.setNavigationBarTitle({ <view
title: this.pageTitle, class="item_input_r"
}); style="color: #9b9b9b;"
this.init(); @click="plus(i, index, item.attrs.price)"
}, >+</view
methods: { >
goHome() { </view>
uni.redirectTo({ </view>
url: "/pages/index/main" </view>
}); </view>
}, </view>
init() { </template>
uni.showNavigationBarLoading(); </scroll-view>
let h = this.apiheader(); </view>
this.request({ <view class="box_bottom">
url: "", <div style="margin-left: 30rpx;">
header: h, <u-checkbox-group @change="SelectAll">
data: { <u-checkbox v-model="allchecked" shape="circle" :active-color="mc"
r: "api/cart/list", >全选</u-checkbox
}, >
}, </u-checkbox-group>
<Text
(res) => { style="font-size: 30rpx;"
uni.hideNavigationBarLoading(); :style="{ color: mc }"
this.isloading = false; v-if="editType == false"
if (res.data.list.length > 0) { >¥{{ TotalPrice }}</Text
let list = res.data.list; >
list.forEach((x) => { </div>
x.checked = false; <div class="bottom_btn" v-if="!editType">
x.goods_list.forEach((j) => { <u-button
j.checked = false; size="80"
}) :ripple="true"
}); shape="circle"
this.list = list; @click="settlement"
} else { :custom-style="{
this.list = []; backgroundColor: mc,
} height: '80rpx',
} color: '#FFF',
); fontSize: '14px',
}, }"
>去结算({{ checkCount }})
clickcheckbox(checked, price, index, i) { </u-button>
if (checked == true) { </div>
this.checkCount += 1; <u-button
this.TotalPrice += price * this.list[i].goods_list[index].num; v-if="editType"
let goods_list_all = true; //判断该商场是否全选 size="80"
this.list[i].goods_list.forEach((x) => { :ripple="true"
if (this.editType == false) { //编辑的时候不判断 shape="circle"
if (x.checked == false && x.new_status == 0) { @click="delete_btn"
goods_list_all = false; :custom-style="{
} backgroundColor: secondary,
} else { height: '80rpx',
if (x.checked == false) { color: '#FFF',
goods_list_all = false; fontSize: '14px',
} marginRight: '12px',
} }"
>删除
}); </u-button>
if (goods_list_all == true) { </view>
this.list[i].checked = true;
} <tabbars></tabbars>
let list_all = true; //判断所有商场是否全选 </div>
this.list.forEach((x) => { </template>
if (x.checked == false) { <script>
list_all = false import tabbars from "@/components/tabbar/index";
} export default {
}) data() {
if (list_all == true) { return {
this.allchecked = true; isloading: true,
} pageTitle: "购物车",
if (this.editType == true) { navHeight: 0,
let obj = { contentHeight: 0,
mch_id: 0, cstyle: {},
id: this.list[i].goods_list[index].id,
}; allchecked: false,
this.cart_id_list.push(obj); TotalPrice: 0, //总价格
} bottommargin: 0,
} else { listbottom: 0,
this.TotalPrice -= price * this.list[i].goods_list[index].num; editType: false,
this.checkCount -= 1; list: [],
this.allchecked = false;
let goods_list_all = true; //判断该商场是否全选 cart_id_list: [],
this.list[i].goods_list.forEach((x) => { mc: "",
if (x.checked == false) { secondary: "",
goods_list_all = false; checkCount: 0,
} };
}); },
if (goods_list_all == false) { created() {},
this.list[i].checked = false; components: {
} tabbars,
if (this.editType == true) { },
this.cart_id_list.forEach((x, j) => { onLoad() {
if (x.id == this.list[i].goods_list[index].id) { this.navHeight = this.$navHeight - 2;
this.cart_id_list.splice(j, 1); this.mc = this.$uiConfig.mainColor;
} this.secondary = this.$uiConfig.secondary;
}); this.cstyle = uni.getStorageSync("basedata")
} ? uni.getStorageSync("basedata").cat_style
} : [];
},
mch_SelectAll(checked, i) { if (this.cstyle.cat_style == "4") {
}
if (checked == true) { },
let add_cartlist = []; mounted() {
let new_statusnum = 0 let currentPages = getCurrentPages();
this.list[i].goods_list.forEach((x) => { let c = this.$uiConfig.is_bang ? 80 : 52;
if (x.new_status == 0) { this.bottommargin = c - 2 + "px";
this.TotalPrice += x.attrs.price * x.num; this.listbottom = c + 44 + "px";
x.checked = true; this.contentHeight = this.$utils.calcContentHeight(c - 42) + "px";
new_statusnum++ let u = "/" + currentPages[currentPages.length - 1].route;
} let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
//编辑时候的商城全选 : [];
if (this.editType == true) { pages.forEach((x) => {
if (this.cart_id_list.length > 0) { if (x.value == u) {
this.cart_id_list.forEach((z) => { this.pageTitle = x.new_name ? x.new_name : x.name;
if (x.id != z.id) { }
let obj = { });
mch_id: 0, uni.setNavigationBarTitle({
id: x.id, title: this.pageTitle,
}; });
add_cartlist.push(obj); this.init();
} },
}); methods: {
} else { goHome() {
let obj = { uni.redirectTo({
mch_id: 0, url: "/pages/index/main",
id: x.id, });
}; },
add_cartlist.push(obj); init() {
} uni.showNavigationBarLoading();
} let h = this.apiheader();
}) this.request(
this.cart_id_list = this.cart_id_list.concat(add_cartlist) {
let list_all = true; //判断所有商场是否全选 url: "",
this.list.forEach((x) => { header: h,
if (x.checked == false) { data: {
list_all = false r: "api/cart/list",
} },
}) },
if (list_all == true) {
this.allchecked = true; (res) => {
} uni.hideNavigationBarLoading();
this.checkCount += new_statusnum; this.isloading = false;
if (res.data.list.length > 0) {
} else { let list = res.data.list;
let new_statusnum = 0 list.forEach((x) => {
this.list[i].goods_list.forEach((x) => { x.checked = false;
if (x.new_status == 0) { x.goods_list.forEach((j) => {
x.checked = false; j.checked = false;
this.TotalPrice -= x.attrs.price * x.num; });
});
new_statusnum++ this.list = list;
} } else {
//编辑时候的商城全选 this.list = [];
this.cart_id_list.forEach((z, m) => { }
if (x.id == z.id) { }
this.cart_id_list.splice(m, 1) );
} },
});
}) clickcheckbox(checked, price, index, i) {
this.allchecked = false; if (checked == true) {
this.checkCount -= new_statusnum; this.checkCount += 1;
} this.TotalPrice += price * this.list[i].goods_list[index].num;
}, let goods_list_all = true; //判断该商场是否全选
SelectAll() { this.list[i].goods_list.forEach((x) => {
let list = this.list; if (this.editType == false) {
if (this.allchecked == true) { //编辑的时候不判断
this.checkCount = 0; if (x.checked == false && x.new_status == 0) {
this.TotalPrice = 0; goods_list_all = false;
this.cart_id_list = []; }
list.forEach((x) => { } else {
x.checked = true; if (x.checked == false) {
x.goods_list.forEach((j) => { goods_list_all = false;
if (j.new_status == 0) { }
j.checked = true; }
this.checkCount++; });
this.TotalPrice += j.attrs.price * j.num if (goods_list_all == true) {
} this.list[i].checked = true;
}
//编辑的时候 let list_all = true; //判断所有商场是否全选
if (this.editType == true) { this.list.forEach((x) => {
this.cart_id_list.push({ if (x.checked == false) {
mch_id: 0, list_all = false;
id: j.id, }
}); });
} if (list_all == true) {
}) this.allchecked = true;
}); }
if (this.editType == true) {
let obj = {
} else { mch_id: 0,
this.checkCount = 0; id: this.list[i].goods_list[index].id,
this.TotalPrice = 0; };
this.cart_id_list = []; this.cart_id_list.push(obj);
list.forEach((x) => { }
x.checked = false; } else {
x.goods_list.forEach((j) => { this.TotalPrice -= price * this.list[i].goods_list[index].num;
j.checked = false; this.checkCount -= 1;
}) this.allchecked = false;
}); let goods_list_all = true; //判断该商场是否全选
this.list[i].goods_list.forEach((x) => {
} if (x.checked == false) {
}, goods_list_all = false;
inputblur(i, index, num, price, e) { }
let value = Number(e.target.value) });
if (value == 0) { if (goods_list_all == false) {
this.list[i].goods_list[index].num = 1; this.list[i].checked = false;
this.TotalPrice += price * 1; }
} if (this.editType == true) {
this.cart_id_list.forEach((x, j) => {
}, if (x.id == this.list[i].goods_list[index].id) {
onKeyInput(i, index, num, price, e) { //输入的数量 this.cart_id_list.splice(j, 1);
let value = Number(e.target.value) }
this.list[i].goods_list[index].num = value; });
}
if (this.list[i].goods_list[index].checked == true) { }
if (value > num) { },
this.TotalPrice += price * (value - num); mch_SelectAll(checked, i) {
} else if (value < num) { if (checked == true) {
this.TotalPrice -= price * (num - value); let add_cartlist = [];
} let new_statusnum = 0;
} this.list[i].goods_list.forEach((x) => {
}, if (x.new_status == 0) {
reduce(i, index, price) { this.TotalPrice += x.attrs.price * x.num;
//减 x.checked = true;
if (this.list[i].goods_list[index].num > 1) { new_statusnum++;
this.list[i].goods_list[index].num -= 1; }
if (this.list[i].goods_list[index].checked == true) {
this.TotalPrice -= price * 1; //编辑时候的商城全选
} if (this.editType == true) {
} if (this.cart_id_list.length > 0) {
}, this.cart_id_list.forEach((z) => {
plus(i, index, price) { if (x.id != z.id) {
//加 let obj = {
this.list[i].goods_list[index].num += 1; mch_id: 0,
if (this.list[i].goods_list[index].checked == true) { id: x.id,
this.TotalPrice += price * 1; };
} add_cartlist.push(obj);
}, }
edit() { });
this.editType = !this.editType; } else {
this.allchecked = false; let obj = {
this.TotalPrice = 0; mch_id: 0,
this.checkCount = 0; id: x.id,
this.cart_id_list = []; };
let list = this.list; add_cartlist.push(obj);
list.forEach((x) => { }
x.checked = false; }
x.goods_list.forEach((j) => { });
j.checked = false this.cart_id_list = this.cart_id_list.concat(add_cartlist);
}) let list_all = true; //判断所有商场是否全选
}); this.list.forEach((x) => {
}, if (x.checked == false) {
delete_btn() { list_all = false;
}
if (this.cart_id_list.length > 0) { });
uni.showNavigationBarLoading(); if (list_all == true) {
let h = this.apiheader(); this.allchecked = true;
h["content-type"] = "application/x-www-form-urlencoded"; }
this.checkCount += new_statusnum;
this.request({ } else {
url: "", let new_statusnum = 0;
method: "POST", this.list[i].goods_list.forEach((x) => {
header: h, if (x.new_status == 0) {
data: { x.checked = false;
r: "api/cart/delete", this.TotalPrice -= x.attrs.price * x.num;
cart_id_list: JSON.stringify(this.cart_id_list),
}, new_statusnum++;
}, }
//编辑时候的商城全选
(res) => { this.cart_id_list.forEach((z, m) => {
this.init(); if (x.id == z.id) {
this.TotalPrice = 0; this.cart_id_list.splice(m, 1);
this.editType = false; }
this.allchecked = false; });
this.checkCount = 0; });
uni.hideNavigationBarLoading(); this.allchecked = false;
} this.checkCount -= new_statusnum;
); }
} else { },
uni.showToast({ SelectAll() {
title: "请选择需要删除的商品", let list = this.list;
position: "bottom", if (this.allchecked == true) {
icon: "none", this.checkCount = 0;
duration: 2000, this.TotalPrice = 0;
}); this.cart_id_list = [];
} list.forEach((x) => {
}, x.checked = true;
settlement() { x.goods_list.forEach((j) => {
if (this.checkCount > 0) { if (j.new_status == 0) {
let goods = []; j.checked = true;
this.list.forEach((x) => { this.checkCount++;
if (x.checked) { this.TotalPrice += j.attrs.price * j.num;
let g = { }
id: x.goods_id,
num: x.num, //编辑的时候
cart_id: x.id, if (this.editType == true) {
goods_attr_id: x.attr_id, this.cart_id_list.push({
attr: [], mch_id: 0,
}; id: j.id,
x.attrs.attr.forEach((x) => { });
g.attr.push({ }
attr_id: x.attr_id, });
attr_group_id: x.attr_group_id, });
}); } else {
}); this.checkCount = 0;
goods.push(g); this.TotalPrice = 0;
} this.cart_id_list = [];
}); list.forEach((x) => {
uni.navigateTo({ x.checked = false;
url: "/pages/order-submit/order-submit?goods=" + x.goods_list.forEach((j) => {
encodeURIComponent(JSON.stringify(goods)) j.checked = false;
}); });
} else { });
uni.showToast({ }
title: "请选择购买商品", },
position: "bottom", inputblur(i, index, num, price, e) {
icon: "none", let value = Number(e.target.value);
duration: 2000, if (value == 0) {
}); this.list[i].goods_list[index].num = 1;
} this.TotalPrice += price * 1;
}, }
}, },
}; onKeyInput(i, index, num, price, e) {
</script> //输入的数量
let value = Number(e.target.value);
<style> this.list[i].goods_list[index].num = value;
.cartStyle {
height: 100%; if (this.list[i].goods_list[index].checked == true) {
position: relative; if (value > num) {
font-family: "oswald"; this.TotalPrice += price * (value - num);
} } else if (value < num) {
this.TotalPrice -= price * (num - value);
.cartStyle .u-checkbox__label { }
margin-left: 12px; }
} },
reduce(i, index, price) {
.cartStyle .grid-text { //减
font-size: 24rpx; if (this.list[i].goods_list[index].num > 1) {
margin-top: 4rpx; this.list[i].goods_list[index].num -= 1;
color: #939393; if (this.list[i].goods_list[index].checked == true) {
} this.TotalPrice -= price * 1;
}
.cartStyle .grid-text_r { }
margin-top: 4rpx; },
margin-right: 10rpx; plus(i, index, price) {
} //加
this.list[i].goods_list[index].num += 1;
.cartStyle .cartList { if (this.list[i].goods_list[index].checked == true) {
width: 100%; this.TotalPrice += price * 1;
display: flex; }
flex-direction: column; },
align-items: center; edit() {
overflow-y: hidden; this.editType = !this.editType;
} this.allchecked = false;
this.TotalPrice = 0;
.cartStyle .cartList .cartList_item { this.checkCount = 0;
width: 100%; this.cart_id_list = [];
padding: 40rpx 30rpx; let list = this.list;
display: flex; list.forEach((x) => {
flex-direction: row; x.checked = false;
align-items: center; x.goods_list.forEach((j) => {
border-bottom: 1rpx solid #f5f5f5; j.checked = false;
} });
});
.cartList .cartList_item .item_input { },
width: 200rpx; delete_btn() {
height: 60rpx; if (this.cart_id_list.length > 0) {
background: #f7f7f7; uni.showNavigationBarLoading();
display: flex; let h = this.apiheader();
flex-direction: row; h["content-type"] = "application/x-www-form-urlencoded";
align-items: center;
justify-content: space-between; this.request(
} {
url: "",
.cartList .item_input .item_input_l, method: "POST",
.item_input_r { header: h,
width: 50rpx; data: {
height: 60rpx; r: "api/cart/delete",
font-size: 28rpx; cart_id_list: JSON.stringify(this.cart_id_list),
display: flex; },
align-items: center; },
justify-content: center;
} (res) => {
this.init();
.cartStyle .item_input .item_input_c { this.TotalPrice = 0;
text-align: center; this.editType = false;
width: 50rpx; this.allchecked = false;
height: 60rpx; this.checkCount = 0;
font-size: 20rpx; uni.hideNavigationBarLoading();
} }
);
.cartStyle .box_bottom { } else {
width: 100%; uni.showToast({
height: 50px; title: "请选择需要删除的商品",
position: absolute; position: "bottom",
background: #fff; icon: "none",
left: 0; duration: 2000,
bottom: 0; });
display: flex; }
flex-direction: row; },
align-items: center; settlement() {
justify-content: space-between; if (this.checkCount > 0) {
border-top: 1rpx solid #f5f5f5; let forms = {
z-index: 999; list: [],
} address_id: 0,
};
.cartStyle .bottom_btn { this.list.forEach((y) => {
display: flex; let good = {
align-items: center; mch_id: y.mch_id,
justify-content: center; goods_list: [],
width: 250rpx; distance: 0,
height: 50px; remark: "",
} order_form: [],
use_integral: 0,
.cartStyle .Deletestyle { user_coupon_id: 0,
margin-right: 40rpx; };
} y.goods_list.forEach((x) => {
if (x.checked) {
let g = {
id: x.goods_id,
num: x.num,
cart_id: x.id,
goods_attr_id: x.attr_id,
attr: [],
};
x.attrs.attr.forEach((x) => {
g.attr.push({
attr_id: x.attr_id,
attr_group_id: x.attr_group_id,
});
});
good.goods_list.push(g);
}
});
forms.list.push(good);
});
uni.navigateTo({
url:
"/pages/order-submit/order-submit?formData=" +
encodeURIComponent(JSON.stringify(forms)),
});
} else {
uni.showToast({
title: "请选择购买商品",
position: "bottom",
icon: "none",
duration: 2000,
});
}
},
},
};
</script>
<style>
.cartStyle {
height: 100%;
position: relative;
font-family: "oswald";
}
.cartStyle .u-checkbox__label {
margin-left: 12px;
}
.cartStyle .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: #939393;
}
.cartStyle .grid-text_r {
margin-top: 4rpx;
margin-right: 10rpx;
}
.cartStyle .cartList {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: hidden;
}
.cartStyle .cartList .cartList_item {
width: 100%;
padding: 40rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1rpx solid #f5f5f5;
}
.cartList .cartList_item .item_input {
width: 200rpx;
height: 60rpx;
background: #f7f7f7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.cartList .item_input .item_input_l,
.item_input_r {
width: 50rpx;
height: 60rpx;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.cartStyle .item_input .item_input_c {
text-align: center;
width: 50rpx;
height: 60rpx;
font-size: 20rpx;
}
.cartStyle .box_bottom {
width: 100%;
height: 50px;
position: absolute;
background: #fff;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #f5f5f5;
z-index: 999;
}
.cartStyle .bottom_btn {
display: flex;
align-items: center;
justify-content: center;
width: 250rpx;
height: 50px;
}
.cartStyle .Deletestyle {
margin-right: 40rpx;
}
</style> </style>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
:border-radius="0" :border-radius="0"
@click="previewImage" @click="previewImage"
></u-swiper> ></u-swiper>
<!-- TODO 分销价格未做 is_share_price -->
</view> </view>
<view class="g-info"> <view class="g-info">
<view class="g-name u-skeleton-rect">{{ g.name }}</view> <view class="g-name u-skeleton-rect">{{ g.name }}</view>
...@@ -24,9 +25,11 @@ ...@@ -24,9 +25,11 @@
: g.price_min + "-" + g.price_max : g.price_min + "-" + g.price_max
}}</text> }}</text>
</view> </view>
<!-- TODO is_common_user_member_price 普通用户会员价 -->
<!-- TODO is_member_user_member_price 会员用户会员价 -->
<view class="sell u-skeleton-rect"> <view class="sell u-skeleton-rect">
<text class="oprice">{{ g.original_price }}</text> <text class="oprice" v-if="setting.is_underline_price=='1'">{{ g.original_price }}</text>
<text>已售出{{ g.sales }}{{ g.unit }}</text> <text v-if="setting.is_sales=='1'">已售出{{ g.sales }}{{ g.unit }}</text>
</view> </view>
</view> </view>
<view class="right u-skeleton-rect"> <view class="right u-skeleton-rect">
...@@ -91,7 +94,7 @@ ...@@ -91,7 +94,7 @@
</view> </view>
</view> </view>
<view class="sku-box u-skeleton-rect"> <view class="sku-box u-skeleton-rect" v-if="setting.is_express=='1'">
<view class="label">快递</view> <view class="label">快递</view>
<view class="content"> <view class="content">
{{ g.express == "" ? "免运费" : g.express }} {{ g.express == "" ? "免运费" : g.express }}
...@@ -120,7 +123,7 @@ ...@@ -120,7 +123,7 @@
<view <view
class="sku-box u-skeleton-rect" class="sku-box u-skeleton-rect"
v-if="comments.comments.length == 0" v-if="comments.comments.length == 0 && setting.is_comment=='1'"
> >
<view class="label">暂无评论信息</view> <view class="label">暂无评论信息</view>
</view> </view>
...@@ -168,7 +171,8 @@ ...@@ -168,7 +171,8 @@
</view> </view>
<u-skeleton <u-skeleton
:loading="loading" v-if="loading"
:loading="true"
:animation="true" :animation="true"
bgColor="#FFF" bgColor="#FFF"
></u-skeleton> ></u-skeleton>
...@@ -211,7 +215,7 @@ export default { ...@@ -211,7 +215,7 @@ export default {
data() { data() {
return { return {
id: 0, id: 0,
loading: false, loading: true,
g: {}, g: {},
imgs: [], imgs: [],
mc: "", mc: "",
...@@ -226,6 +230,7 @@ export default { ...@@ -226,6 +230,7 @@ export default {
currentSku: {}, currentSku: {},
isExsitGoods: true, isExsitGoods: true,
pageTitle: "商品详情", pageTitle: "商品详情",
setting:{}
}; };
}, },
components: { components: {
...@@ -240,6 +245,7 @@ export default { ...@@ -240,6 +245,7 @@ export default {
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
this.initPage(); this.initPage();
this.setting = uni.getStorageSync("basedata").mall.setting
}, },
methods: { methods: {
initPage() { initPage() {
......
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
if (option.goods) { if (option.goods) {
this.formData.list[0].goods_list = JSON.parse(decodeURIComponent(option.goods)); this.formData.list[0].goods_list = JSON.parse(decodeURIComponent(option.goods));
} else if (option.formData) { } else if (option.formData) {
this.formData = JSON.parse(option.formData); this.formData = JSON.parse(decodeURIComponent(option.formData));
} else { } else {
uni.redirectTo({ uni.redirectTo({
url: '/pages/index/index' url: '/pages/index/index'
......
<template> <template>
<view class="orderindexStyle" :style="{'height':contentHeight}"> <view class="orderindexStyle" :style="{ height: contentHeight }">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mainColor' bg-color='#f3f4f6'></u-tabs> <u-tabs
<u-empty v-if="g.length==0" text="暂无相关订单" mode="order"></u-empty> :list="list"
:is-scroll="false"
<view v-if="g.length > 0" :current="current"
style=" @change="change"
height: calc(100vh - 50px); :active-color="mainColor"
width: calc(100vw); bg-color="#f3f4f6"
overflow: hidden; ></u-tabs>
padding-top: 10px; <u-empty v-if="g.length == 0" text="暂无相关订单" mode="order"></u-empty>
">
<scroll-view <view
:scroll-y="true" v-if="g.length > 0"
:enable-back-to-top="true" style="
:enable-flex="true" height: calc(100vh - 50px);
@scrolltolower="lower" width: calc(100vw);
:style="{ height: '100%' }"> overflow: hidden;
<view class="orderList"> padding-top: 10px;
<view class="listBox" v-for="(item, index) in g" :key="index"> "
<view class="listBox_t"> >
<Text >订单号:{{item.order_no}}</Text> <scroll-view
<Text>{{item.status_text}}</Text> :scroll-y="true"
</view> :enable-back-to-top="true"
<view class="listBox_c"> :enable-flex="true"
<template v-if="item.detail.length == 1"> @scrolltolower="lower"
<view v-for="(cx, ci) in item.detail" :key="ci" class="box_bottom"> :style="{ height: '100%' }"
<image :src="cx.goods_info.pic_url" style="width: 75px; height: 75px" /> >
<view style="width: calc(100% - 85px);height: 75px;display: flex;flex-direction: column;margin-left: 10px;justify-content: space-between;"> <view class="orderList">
<Text class='topic_cont_text' >{{cx.goods_info.name}}</Text> <view class="listBox" v-for="(item, index) in g" :key="index">
<view style='width: calc(100% - 85px);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'> <view class="listBox_t">
<view v-for="(attr, index2) in cx.goods_info.attr_list" :key="index2" > <Text>订单号:{{ item.order_no }}</Text>
<Text style='color: #A0A09D;font-size: 24rpx;margin-right: 5rpx;'>规格:{{attr.attr_name}}</Text> <Text>{{ item.status_text }}</Text>
</view> </view>
</view> <view class="listBox_c">
<view style="width: 100%;display: flex;flex-direction: row;align-items:center;justify-content: space-between;"> <template v-if="item.detail.length == 1">
<Text style='color: #A0A09D;font-size: 24rpx;'>X{{cx.num}}</Text> <view
<Text style='font-size: 24rpx;'>{{cx.total_price}}</Text> v-for="(cx, ci) in item.detail"
</view> :key="ci"
</view> class="box_bottom"
</view> >
</template> <image
<template v-else> :src="cx.goods_info.pic_url"
<view class="goodboxmore"> style="width: 75px; height: 75px;"
<view class="good-list"> />
<view style="white-space: nowrap"> <view
<image style="
v-for="(y, yi) in item.detail" width: calc(100% - 85px);
:key="yi" height: 75px;
:src="y.goods_info.pic_url" display: flex;
mode="aspectFill" flex-direction: column;
class="item" margin-left: 10px;
/> justify-content: space-between;
</view> "
</view> >
<view class="infos"> <Text class="topic_cont_text">{{
<view class="text">{{ item.detail.length }}</view> cx.goods_info.name
<u-icon }}</Text>
name="ellipsis" <view
size="36" style="
@click="showGoodListHandler(index)" width: calc(100% - 85px);
></u-icon> overflow: hidden;
</view> white-space: nowrap;
</view> text-overflow: ellipsis;
</template> "
<Text style='font-size: 32rpx;text-align: right;width: 100%;'>合计:¥{{item.total_price}} >
<Text v-if='item.express_price!=0' style='font-size: 20rpx;color: #A0A09D;'>(含运费 ¥{{item.express_price}})</Text> <view
</Text> v-for="(attr, index2) in cx.goods_info.attr_list"
:key="index2"
<!-- TODO 样式结构修改--> >
<view class="handle"> <Text
<view class="handle_item" @click="cancel(item,index)"> style="
<Text>取消</Text> color: #a0a09d;
</view> font-size: 24rpx;
<view class="handle_item"> margin-right: 5rpx;
<Text>付款</Text> "
</view> >规格:{{ attr.attr_name }}</Text
</view> >
</view> </view>
</view> </view>
</view> <view
<u-divider style="
contentPosition="center" width: 100%;
v-if="isover" display: flex;
:margin-top="20" flex-direction: row;
:margin-bottom="20" align-items: center;
bg-color='#f3f4f6' justify-content: space-between;
>没有更多订单了</u-divider> "
>
</scroll-view> <Text style="color: #a0a09d; font-size: 24rpx;"
>X{{ cx.num }}</Text
</view> >
<!-- 加载中 --> <Text style="font-size: 24rpx;"
<view class="loading" v-if="loading"> >{{ cx.total_price }}</Text
<u-loading mode="flower" size="48">></u-loading> >
<Text style='color: #fff;margin-top: 10rpx;'>加载中...</Text> </view>
</view> </view>
<!-- 取消提示 --> </view>
<u-modal </template>
v-model="showModal" <template v-else>
content="是否取消订单?" <view class="goodboxmore">
:show-cancel-button="true" <view class="good-list">
:show-title="false" <view style="white-space: nowrap;">
@confirm="confirm" <image
></u-modal> v-for="(y, yi) in item.detail"
<u-toast ref="uToast" /> :key="yi"
<good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list> :src="y.goods_info.pic_url"
mode="aspectFill"
</view> class="item"
/>
</view>
</view>
<view class="infos">
<view class="text">{{ item.detail.length }}</view>
<u-icon
name="ellipsis"
size="36"
@click="showGoodListHandler(index)"
></u-icon>
</view>
</view>
</template>
<Text style="font-size: 32rpx; text-align: right; width: 100%;"
>合计:¥{{ item.total_price }}
<Text
v-if="item.express_price != 0"
style="font-size: 20rpx; color: #a0a09d;"
>(含运费 ¥{{ item.express_price }})</Text
>
</Text>
<!-- TODO 样式结构修改-->
<view class="handle">
<view class="handle_item" @click="cancel(item, index)">
<Text>取消</Text>
</view>
<view class="handle_item">
<Text>付款</Text>
</view>
</view>
</view>
</view>
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
>没有更多订单了</u-divider
>
</scroll-view>
</view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-modal
v-model="showModal"
content="是否取消订单?"
:show-cancel-button="true"
:show-title="false"
@confirm="confirm"
></u-modal>
<u-toast ref="uToast" />
<good-list
:list="goodData"
v-if="showGoodList"
@close="closeGoodListHandler"
></good-list>
</view>
</template> </template>
<script> <script>
import goodList from '@/components/goods/order-good-list2' import goodList from "@/components/goods/order-good-list2";
export default { export default {
components:{ components: {
goodList goodList,
}, },
data() { data() {
return { return {
pageTitle:'我的订单', pageTitle: "我的订单",
current: 0, current: 0,
list: [{name: '全部'}, {name: '待付款'},{name: '待发货'},{name: '待收货'},{name: '待评价'},], list: [
mainColor: "", { name: "全部" },
contentHeight:0, { name: "待付款" },
page:1, { name: "待发货" },
page_count:1, { name: "待收货" },
g:[], { name: "待评价" },
loading:false, { name: "已完成" },
showModal:false, { name: "已取消" }
item:'', ],
index:0, mainColor: "",
goodData:[], contentHeight: 0,
showGoodList:false, page: 1,
isover:false page_count: 1,
}; g: [],
}, loading: false,
created(){ showModal: false,
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; item: "",
this.mainColor = this.$uiConfig.mainColor; index: 0,
goodData: [],
}, showGoodList: false,
mounted() { isover: false,
let currentPages = getCurrentPages(); };
let u = "/" + currentPages[currentPages.length-1].route; },
let pages = wx.getStorageSync("basedata") created() {
? wx.getStorageSync("basedata").bar_title this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
: []; this.mainColor = this.$uiConfig.mainColor;
pages.forEach((x) => { },
if (x.value == u) { mounted() {
this.pageTitle = x.new_name ? x.new_name : x.name; let currentPages = getCurrentPages();
} let u = "/" + currentPages[currentPages.length - 1].route;
}); let pages = wx.getStorageSync("basedata")
uni.setNavigationBarTitle({ ? wx.getStorageSync("basedata").bar_title
title: this.pageTitle, : [];
}); pages.forEach((x) => {
}, if (x.value == u) {
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 this.pageTitle = x.new_name ? x.new_name : x.name;
this.current = option.status; }
this.loading = true; });
this.init() uni.setNavigationBarTitle({
}, title: this.pageTitle,
methods: { });
change(index){ },
this.current = index; onLoad: function (option) {
this.page= 1; //option为object类型,会序列化上个页面传递的参数
this.g = []; this.current = option.status;
this.loading = true; this.loading = true;
this.init() this.init();
}, },
init(){ methods: {
this.isover = false; change(index) {
let h=this.apiheader() this.current = index;
this.request( this.page = 1;
{ this.g = [];
url: "", this.loading = true;
header:h, this.init();
data: { },
r: "api/order/list", init() {
status:this.current, this.isover = false;
page: this.page, let h = this.apiheader();
this.request(
} {
}, url: "",
res => { header: h,
this.loading = false; data: {
this.g = this.g.concat(res.data.list); r: "api/order/list",
this.page_count = res.data.pagination.page_count; status: this.current,
if (this.page_count == 1) { page: this.page,
this.isover = true; },
} },
} (res) => {
); this.loading = false;
this.g = this.g.concat(res.data.list);
}, this.page_count = res.data.pagination.page_count;
lower(e) { if (this.page_count == 1) {
if (this.page < this.page_count) { this.isover = true;
}
this.page++; }
this.init(); );
},
} else { lower(e) {
this.isover = true; if (this.page < this.page_count) {
} this.page++;
}, this.init();
cancel(e,index){ } else {
this.showModal=true; this.isover = true;
this.index=index; }
this.item = e; },
}, cancel(e, index) {
confirm(){ this.showModal = true;
this.showModal = false this.index = index;
let h = this.apiheader(); this.item = e;
// h['content-type']='application/x-www-form-urlencoded' },
this.request( confirm() {
{ this.showModal = false;
url: "", let h = this.apiheader();
// method: "POST", // h['content-type']='application/x-www-form-urlencoded'
header: h, this.request(
data: { {
r: "api/order/cancel", url: "",
id: this.item.id // method: "POST",
} header: h,
}, data: {
r: "api/order/cancel",
res => { id: this.item.id,
this.$refs.uToast.show({title: res.msg,}) },
this.g.splice(this.index,1) },
} (res) => {
); this.$refs.uToast.show({ title: res.msg });
}, this.g.splice(this.index, 1);
closeGoodListHandler(){ }
this.goodData=[] );
this.showGoodList=false },
}, closeGoodListHandler() {
showGoodListHandler(i){ this.goodData = [];
this.goodData=this.g[i].detail this.showGoodList = false;
console.log(this.goodData) },
this.showGoodList=true showGoodListHandler(i) {
}, this.goodData = this.g[i].detail;
} console.log(this.goodData);
}; this.showGoodList = true;
},
},
};
</script> </script>
<style> <style>
.orderindexStyle{ .orderindexStyle {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f3f4f6; background: #f3f4f6;
} }
.orderindexStyle .orderList{ .orderindexStyle .orderList {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.orderList .listBox{ .orderList .listBox {
width: 94%; width: 94%;
background: #fff; background: #fff;
border-radius: 10rpx; border-radius: 10rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 20rpx; padding: 20rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.orderList .listBox .listBox_t{ .orderList .listBox .listBox_t {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
margin: 10rpx 0; margin: 10rpx 0;
} }
.orderList .listBox .listBox_c{ .orderList .listBox .listBox_c {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
}
} .orderList .listBox .box_bottom {
.orderList .listBox .box_bottom{ display: flex;
display: flex; flex-direction: row;
flex-direction: row; align-items: center;
align-items: center; width: 100%;
width: 100%; margin-bottom: 18rpx;
margin-bottom: 18rpx; }
} .orderList .handle {
.orderList .handle{ width: 100%;
width: 100%; display: flex;
display: flex; flex-direction: row;
flex-direction: row; align-items: center;
align-items: center; justify-content: flex-end;
justify-content: flex-end; margin-top: 10rpx;
margin-top: 10rpx; }
} .orderList .handle_item {
.orderList .handle_item{ padding: 0 24rpx;
padding:0 24rpx; border: 1px solid #c8c9cc;
border: 1px solid #c8c9cc; margin-left: 20rpx;
margin-left: 20rpx; height: 50rpx;
height: 50rpx; border-radius: 25rpx;
border-radius: 25rpx; line-height: 50rpx;
line-height: 50rpx; }
} .orderindexStyle .loading {
.orderindexStyle .loading{ width: 200rpx;
width: 200rpx; height: 200rpx;
height: 200rpx; background: #000000;
background: #000000; opacity: 0.7;
opacity: 0.7; border-radius: 10rpx;
border-radius: 10rpx; display: flex;
display: flex; flex-direction: column;
flex-direction: column; align-items: center;
align-items: center; justify-content: center;
justify-content: center; position: fixed;
position: fixed; left: 50%;
left: 50%; top: 30%;
top:30%; margin-left: -100rpx;
margin-left: -100rpx; z-index: 999;
z-index: 999; }
} .listBox_c .goodboxmore {
.listBox_c .goodboxmore { margin-bottom: 20px;
margin-bottom: 20px; display: flex;
display: flex; width: 100%;
width: 100%; }
} .listBox_c .goodboxmore .good-list {
.listBox_c .goodboxmore .good-list { display: flex;
display: flex; flex: 1;
flex: 1; overflow-x: auto;
overflow-x: auto; }
} .listBox_c .goodboxmore .good-list .item {
.listBox_c .goodboxmore .good-list .item { width: 70px;
width: 70px; height: 70px;
height: 70px; border-radius: 5px;
border-radius: 5px; margin-right: 10px;
margin-right: 10px; }
} .listBox_c .goodboxmore .infos {
.listBox_c .goodboxmore .infos { display: flex;
display: flex; width: 80px;
width: 80px; }
} .listBox_c .goodboxmore .infos .text {
.listBox_c .goodboxmore .infos .text { text-align: center;
text-align: center; font-size: 13px;
font-size: 13px; width: 57px;
width: 57px; margin-right: 5px;
margin-right: 5px; line-height: 70px;
line-height: 70px; }
} .listBox_c .left {
.listBox_c .left{ flex: 1;
flex: 1; color: #232323;
color: #232323; font-size: 16px;
font-size: 16px; flex: 1;
flex: 1; font-family: "oswald";
font-family: "oswald"; }
} .listBox_c .small {
.listBox_c .small { font-size: 13px;
font-size: 13px; }
} .listBox_c .topic_cont_text {
.listBox_c .topic_cont_text{ font-size: 26rpx;
font-size: 26rpx; max-height: 70rpx;
max-height: 70rpx; overflow: hidden;
overflow: hidden; word-break: break-all; /* break-all(允许在单词内换行。) */
word-break: break-all; /* break-all(允许在单词内换行。) */ text-overflow: ellipsis; /* 超出部分省略号 */
text-overflow: ellipsis; /* 超出部分省略号 */ display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/ -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/ -webkit-line-clamp: 2; /** 显示的行数 **/
-webkit-line-clamp: 2; /** 显示的行数 **/ }
} </style>
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment