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 {
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
}
*{
html,body{
font-family: "oswald" !important;
}
swiper{
......
......@@ -147,6 +147,20 @@ export default {
g: {},
skuObj: null,
notStockGood: [],
forms:{
list: [
{
mch_id: 0,
goods_list: [],
distance: 0,
remark: "",
order_form: [],
use_integral: 0,
user_coupon_id: 0,
},
],
address_id: 0,
}
};
},
mounted() {
......@@ -224,7 +238,6 @@ export default {
},
buy() {
if (this.skuObj && this.skuObj.id) {
let goods = [];
let g = {
id: this.skuObj.goods_id,
num: this.gc,
......@@ -238,12 +251,11 @@ export default {
attr_group_id: x.attr_group_id,
});
});
goods.push(g);
console.log(goods);
this.forms.list[0].goods_list.push(g)
this.forms.list[0].mch_id=this.g.mch_id
uni.navigateTo({
url:
"/pages/order-submit/order-submit?goods=" +
encodeURIComponent(JSON.stringify(goods)),
"/pages/order-submit/order-submit?formData=" + encodeURIComponent(JSON.stringify(this.forms)),
complete(res) {
console.log(res);
},
......
......@@ -10,41 +10,49 @@
style="width: 100%; height: 100%;"
/>
</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="price" :style="{ color: mainColor }">{{
cx.price_content
}}</view>
<view class="sell">{{ cx.sales }}</view>
<view class="cart" @click.stop="showSkuHandler(cx)">
<view class="sell" v-if="setting.is_show_sales_num=='1'">{{ cx.sales }}</view>
<view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" />
</view>
</view>
</view>
</u-col>
</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>
</template>
<script>
import goodSku from '../goods/goodsku'
import goodSku from "../goods/goodsku";
export default {
components:{
goodSku
components: {
goodSku,
},
props: ["list"],
data() {
return {
g: [],
showSku:false,
sku:{},
mainColor:""
showSku: false,
sku: {},
mainColor: "",
setting:{}
};
},
mounted() {
this.g = this.list;
this.mainColor = this.$uiConfig.mainColor;
this.initConfig()
},
watch: {
list: {
......@@ -52,19 +60,22 @@ export default {
immediate: true,
handler: function (newVal, oldVal) {
this.g = newVal;
}
},
},
},
methods: {
initConfig() {
this.setting = uni.getStorageSync("basedata").mall.setting
},
clickHandler(url) {
uni.navigateTo({
url: url,
});
},
showSkuHandler(g){
this.sku=g
this.showSku=true
}
showSkuHandler(g) {
this.sku = g;
this.showSku = true;
},
},
};
</script>
......
......@@ -3,8 +3,15 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [{
"path": "pages/order/index/index"
},
{
"path": "pages/index/index"
},
{
"path": "pages/order-submit/order-submit"
},
{
"path": "pages/search/search"
},
......@@ -46,10 +53,6 @@
},
{
"path": "pages/order/index"
},
{
"path": "pages/order/index/index"
}
],
"globalStyle": {
......
<template>
<div class="cartStyle" v-if="!isloading" :style="{'height':contentHeight}">
<view style="
<div class="cartStyle" v-if="!isloading" :style="{ height: contentHeight }">
<view
style="
display: flex;
flex-direction: row;
align-items: center;
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 @click="edit" v-if="editType == false" class="grid-text_r"
>编辑</Text
>
<Text @click="edit" v-if="editType == true" class="grid-text_r"
>完成</Text
>
</view>
<view style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"></view>
<u-empty v-if="list.length == 0" text="购物车还是空的哦" mode="car"></u-empty>
<view v-if="list.length > 0" style="
<view
style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"
></view>
<u-empty
v-if="list.length == 0"
text="购物车还是空的哦"
mode="car"
></u-empty>
<view
v-if="list.length > 0"
style="
height: calc(100vh - 60px);
width: calc(100vw);
overflow: hidden;
padding-top: 10px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%' }">
<view class="cartList" :style="{ 'margin-bottom': listbottom }" v-if="list.length > 0" v-for="(c, i) in list" :key="i">
<view style="padding: 0 12px 12px 12px; border-bottom: 1rpx solid #f5f5f5;width: 100%;">
<u-checkbox-group @change="mch_SelectAll(c.checked,i)">
<u-checkbox v-model="c.checked" shape="circle" :active-color="mc">{{c.name}}</u-checkbox>
"
>
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
:style="{ height: '100%' }"
>
<template v-if="list.length > 0">
<view
class="cartList"
:style="{ 'margin-bottom': listbottom }"
v-for="(c, i) in list"
:key="i"
>
<view
style="
padding: 0 12px 12px 12px;
border-bottom: 1rpx solid #f5f5f5;
width: 100%;
"
>
<u-checkbox-group @change="mch_SelectAll(c.checked, i)">
<u-checkbox
v-model="c.checked"
shape="circle"
:active-color="mc"
>{{ c.name }}</u-checkbox
>
</u-checkbox-group>
</view>
<view class="cartList_item" v-for="(item, index) in c.goods_list" :key="index" :name="item.name">
<u-checkbox-group v-if='item.new_status==0 || editType==true' @change="clickcheckbox(item.checked, item.attrs.price, index,i)">
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox>
<view
class="cartList_item"
v-for="(item, index) in c.goods_list"
:key="index"
:name="item.name"
>
<u-checkbox-group
v-if="item.new_status == 0 || editType == true"
@change="
clickcheckbox(item.checked, item.attrs.price, index, i)
"
>
<u-checkbox
v-model="item.checked"
shape="circle"
:active-color="mc"
></u-checkbox>
</u-checkbox-group>
<Text v-if='item.new_status!=0 && editType==false' style='color: #a0a09d;width: 22px;'>失效</Text>
<image :src="item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic" mode="aspectFill" style="
<Text
v-if="item.new_status != 0 && editType == false"
style="color: #a0a09d; width: 22px;"
>失效</Text
>
<image
:src="
item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic
"
mode="aspectFill"
style="
width: 150rpx;
height: 150rpx;
margin-left: 30rpx;
border-radius: 5px;
" />
<view style="
"
/>
<view
style="
display: flex;
flex-direction: column;
justify-content: space-between;
width: 460rpx;
height: 150rpx;
margin-left: 20rpx;
">
<Text style="
"
>
<Text
style="
font-size: 28rpx;
width: 460rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
">{{ item.goods.name }}</Text>
<view style="
"
>{{ item.goods.name }}</Text
>
<view
style="
width: 460rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
">
"
>
<view v-for="(attr, inde2x) in item.attrs.attr" :key="inde2x">
<Text style="color: #a0a09d; font-size: 24rpx; margin-right: 5rpx;">{{ attr.attr_group_name }}:{{ attr.attr_name }}</Text>
<Text
style="
color: #a0a09d;
font-size: 24rpx;
margin-right: 5rpx;
"
>{{ attr.attr_group_name }}:{{ attr.attr_name }}</Text
>
</view>
</view>
<view style="
<view
style="
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
">
<Text style="font-size: 30rpx;" :style="{ color: mc }">¥<Text style="40rpx">{{ item.attrs.price }}</Text></Text>
"
>
<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> -->
<view class="item_input">
<view class="item_input_l" :style="{
<view
class="item_input_l"
:style="{
color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
}"
@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)'
@input='onKeyInput(i,index, item.num,item.attrs.price,$event)' />
<view class="item_input_r" style="color: #9b9b9b;" @click="plus(i,index, item.attrs.price)">+</view>
@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)
"
@input="
onKeyInput(i, index, item.num, item.attrs.price, $event)
"
/>
<view
class="item_input_r"
style="color: #9b9b9b;"
@click="plus(i, index, item.attrs.price)"
>+</view
>
</view>
</view>
</view>
</view>
</view>
</template>
</scroll-view>
</view>
<view class="box_bottom" >
<view class="box_bottom">
<div style="margin-left: 30rpx;">
<u-checkbox-group @change="SelectAll">
<u-checkbox v-model="allchecked" shape="circle" :active-color="mc">全选</u-checkbox>
<u-checkbox v-model="allchecked" shape="circle" :active-color="mc"
>全选</u-checkbox
>
</u-checkbox-group>
<Text style="font-size: 30rpx;" :style="{ color: mc }" v-if="editType == false">¥{{ TotalPrice }}</Text>
<Text
style="font-size: 30rpx;"
:style="{ color: mc }"
v-if="editType == false"
>¥{{ TotalPrice }}</Text
>
</div>
<div class="bottom_btn" v-if="!editType">
<u-button size="80" :ripple="true" shape="circle" @click="settlement" :custom-style="{
<u-button
size="80"
:ripple="true"
shape="circle"
@click="settlement"
:custom-style="{
backgroundColor: mc,
height: '80rpx',
color: '#FFF',
fontSize: '14px',
}">去结算({{ checkCount }})
}"
>去结算({{ checkCount }})
</u-button>
</div>
<u-button v-if="editType" size="80" :ripple="true" shape="circle" @click="delete_btn" :custom-style="{
<u-button
v-if="editType"
size="80"
:ripple="true"
shape="circle"
@click="delete_btn"
:custom-style="{
backgroundColor: secondary,
height: '80rpx',
color: '#FFF',
fontSize: '14px',
marginRight: '12px',
}">删除
}"
>删除
</u-button>
</view>
......@@ -118,8 +235,8 @@
</div>
</template>
<script>
import tabbars from "@/components/tabbar/index";
export default {
import tabbars from "@/components/tabbar/index";
export default {
data() {
return {
isloading: true,
......@@ -149,11 +266,11 @@
this.navHeight = this.$navHeight - 2;
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.cstyle = uni.getStorageSync("basedata") ?
uni.getStorageSync("basedata").cat_style : [];
this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style
: [];
if (this.cstyle.cat_style == "4") {
}
},
mounted() {
......@@ -161,10 +278,11 @@
let c = this.$uiConfig.is_bang ? 80 : 52;
this.bottommargin = c - 2 + "px";
this.listbottom = c + 44 + "px";
this.contentHeight = this.$utils.calcContentHeight(c-42) + 'px';
this.contentHeight = this.$utils.calcContentHeight(c - 42) + "px";
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title : [];
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
......@@ -178,14 +296,15 @@
methods: {
goHome() {
uni.redirectTo({
url: "/pages/index/main"
url: "/pages/index/main",
});
},
init() {
uni.showNavigationBarLoading();
let h = this.apiheader();
this.request({
this.request(
{
url: "",
header: h,
data: {
......@@ -202,7 +321,7 @@
x.checked = false;
x.goods_list.forEach((j) => {
j.checked = false;
})
});
});
this.list = list;
} else {
......@@ -218,7 +337,8 @@
this.TotalPrice += price * this.list[i].goods_list[index].num;
let goods_list_all = true; //判断该商场是否全选
this.list[i].goods_list.forEach((x) => {
if (this.editType == false) { //编辑的时候不判断
if (this.editType == false) {
//编辑的时候不判断
if (x.checked == false && x.new_status == 0) {
goods_list_all = false;
}
......@@ -227,7 +347,6 @@
goods_list_all = false;
}
}
});
if (goods_list_all == true) {
this.list[i].checked = true;
......@@ -235,9 +354,9 @@
let list_all = true; //判断所有商场是否全选
this.list.forEach((x) => {
if (x.checked == false) {
list_all = false
list_all = false;
}
})
});
if (list_all == true) {
this.allchecked = true;
}
......@@ -271,15 +390,14 @@
}
},
mch_SelectAll(checked, i) {
if (checked == true) {
let add_cartlist = [];
let new_statusnum = 0
let new_statusnum = 0;
this.list[i].goods_list.forEach((x) => {
if (x.new_status == 0) {
this.TotalPrice += x.attrs.price * x.num;
x.checked = true;
new_statusnum++
new_statusnum++;
}
//编辑时候的商城全选
......@@ -302,36 +420,34 @@
add_cartlist.push(obj);
}
}
})
this.cart_id_list = this.cart_id_list.concat(add_cartlist)
});
this.cart_id_list = this.cart_id_list.concat(add_cartlist);
let list_all = true; //判断所有商场是否全选
this.list.forEach((x) => {
if (x.checked == false) {
list_all = false
list_all = false;
}
})
});
if (list_all == true) {
this.allchecked = true;
}
this.checkCount += new_statusnum;
} else {
let new_statusnum = 0
let new_statusnum = 0;
this.list[i].goods_list.forEach((x) => {
if (x.new_status == 0) {
x.checked = false;
this.TotalPrice -= x.attrs.price * x.num;
new_statusnum++
new_statusnum++;
}
//编辑时候的商城全选
this.cart_id_list.forEach((z, m) => {
if (x.id == z.id) {
this.cart_id_list.splice(m, 1)
this.cart_id_list.splice(m, 1);
}
});
})
});
this.allchecked = false;
this.checkCount -= new_statusnum;
}
......@@ -348,7 +464,7 @@
if (j.new_status == 0) {
j.checked = true;
this.checkCount++;
this.TotalPrice += j.attrs.price * j.num
this.TotalPrice += j.attrs.price * j.num;
}
//编辑的时候
......@@ -358,10 +474,8 @@
id: j.id,
});
}
})
});
});
} else {
this.checkCount = 0;
this.TotalPrice = 0;
......@@ -370,21 +484,20 @@
x.checked = false;
x.goods_list.forEach((j) => {
j.checked = false;
})
});
});
}
},
inputblur(i, index, num, price, e) {
let value = Number(e.target.value)
let value = Number(e.target.value);
if (value == 0) {
this.list[i].goods_list[index].num = 1;
this.TotalPrice += price * 1;
}
},
onKeyInput(i, index, num, price, e) { //输入的数量
let value = Number(e.target.value)
onKeyInput(i, index, num, price, e) {
//输入的数量
let value = Number(e.target.value);
this.list[i].goods_list[index].num = value;
if (this.list[i].goods_list[index].checked == true) {
......@@ -421,18 +534,18 @@
list.forEach((x) => {
x.checked = false;
x.goods_list.forEach((j) => {
j.checked = false
})
j.checked = false;
});
});
},
delete_btn() {
if (this.cart_id_list.length > 0) {
uni.showNavigationBarLoading();
let h = this.apiheader();
h["content-type"] = "application/x-www-form-urlencoded";
this.request({
this.request(
{
url: "",
method: "POST",
header: h,
......@@ -462,8 +575,21 @@
},
settlement() {
if (this.checkCount > 0) {
let goods = [];
this.list.forEach((x) => {
let forms = {
list: [],
address_id: 0,
};
this.list.forEach((y) => {
let good = {
mch_id: y.mch_id,
goods_list: [],
distance: 0,
remark: "",
order_form: [],
use_integral: 0,
user_coupon_id: 0,
};
y.goods_list.forEach((x) => {
if (x.checked) {
let g = {
id: x.goods_id,
......@@ -478,12 +604,15 @@
attr_group_id: x.attr_group_id,
});
});
goods.push(g);
good.goods_list.push(g);
}
});
forms.list.push(good);
});
uni.navigateTo({
url: "/pages/order-submit/order-submit?goods=" +
encodeURIComponent(JSON.stringify(goods))
url:
"/pages/order-submit/order-submit?formData=" +
encodeURIComponent(JSON.stringify(forms)),
});
} else {
uni.showToast({
......@@ -495,49 +624,49 @@
}
},
},
};
};
</script>
<style>
.cartStyle {
.cartStyle {
height: 100%;
position: relative;
font-family: "oswald";
}
}
.cartStyle .u-checkbox__label {
.cartStyle .u-checkbox__label {
margin-left: 12px;
}
}
.cartStyle .grid-text {
.cartStyle .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: #939393;
}
}
.cartStyle .grid-text_r {
.cartStyle .grid-text_r {
margin-top: 4rpx;
margin-right: 10rpx;
}
}
.cartStyle .cartList {
.cartStyle .cartList {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: hidden;
}
}
.cartStyle .cartList .cartList_item {
.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 {
.cartList .cartList_item .item_input {
width: 200rpx;
height: 60rpx;
background: #f7f7f7;
......@@ -545,26 +674,26 @@
flex-direction: row;
align-items: center;
justify-content: space-between;
}
}
.cartList .item_input .item_input_l,
.item_input_r {
.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 {
.cartStyle .item_input .item_input_c {
text-align: center;
width: 50rpx;
height: 60rpx;
font-size: 20rpx;
}
}
.cartStyle .box_bottom {
.cartStyle .box_bottom {
width: 100%;
height: 50px;
position: absolute;
......@@ -577,17 +706,17 @@
justify-content: space-between;
border-top: 1rpx solid #f5f5f5;
z-index: 999;
}
}
.cartStyle .bottom_btn {
.cartStyle .bottom_btn {
display: flex;
align-items: center;
justify-content: center;
width: 250rpx;
height: 50px;
}
}
.cartStyle .Deletestyle {
.cartStyle .Deletestyle {
margin-right: 40rpx;
}
}
</style>
......@@ -11,6 +11,7 @@
:border-radius="0"
@click="previewImage"
></u-swiper>
<!-- TODO 分销价格未做 is_share_price -->
</view>
<view class="g-info">
<view class="g-name u-skeleton-rect">{{ g.name }}</view>
......@@ -24,9 +25,11 @@
: g.price_min + "-" + g.price_max
}}</text>
</view>
<!-- TODO is_common_user_member_price 普通用户会员价 -->
<!-- TODO is_member_user_member_price 会员用户会员价 -->
<view class="sell u-skeleton-rect">
<text class="oprice">{{ g.original_price }}</text>
<text>已售出{{ g.sales }}{{ g.unit }}</text>
<text class="oprice" v-if="setting.is_underline_price=='1'">{{ g.original_price }}</text>
<text v-if="setting.is_sales=='1'">已售出{{ g.sales }}{{ g.unit }}</text>
</view>
</view>
<view class="right u-skeleton-rect">
......@@ -91,7 +94,7 @@
</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="content">
{{ g.express == "" ? "免运费" : g.express }}
......@@ -120,7 +123,7 @@
<view
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>
......@@ -168,7 +171,8 @@
</view>
<u-skeleton
:loading="loading"
v-if="loading"
:loading="true"
:animation="true"
bgColor="#FFF"
></u-skeleton>
......@@ -211,7 +215,7 @@ export default {
data() {
return {
id: 0,
loading: false,
loading: true,
g: {},
imgs: [],
mc: "",
......@@ -226,6 +230,7 @@ export default {
currentSku: {},
isExsitGoods: true,
pageTitle: "商品详情",
setting:{}
};
},
components: {
......@@ -240,6 +245,7 @@ export default {
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.initPage();
this.setting = uni.getStorageSync("basedata").mall.setting
},
methods: {
initPage() {
......
......@@ -267,7 +267,7 @@ export default {
if (option.goods) {
this.formData.list[0].goods_list = JSON.parse(decodeURIComponent(option.goods));
} else if (option.formData) {
this.formData = JSON.parse(option.formData);
this.formData = JSON.parse(decodeURIComponent(option.formData));
} else {
uni.redirectTo({
url: '/pages/index/index'
......
<template>
<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-empty v-if="g.length==0" text="暂无相关订单" mode="order"></u-empty>
<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-empty v-if="g.length == 0" text="暂无相关订单" mode="order"></u-empty>
<view v-if="g.length > 0"
<view
v-if="g.length > 0"
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding-top: 10px;
">
"
>
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
:style="{ height: '100%' }"
>
<view class="orderList">
<view class="listBox" v-for="(item, index) in g" :key="index">
<view class="listBox_t">
<Text >订单号:{{item.order_no}}</Text>
<Text>{{item.status_text}}</Text>
<Text>订单号:{{ item.order_no }}</Text>
<Text>{{ item.status_text }}</Text>
</view>
<view class="listBox_c">
<template v-if="item.detail.length == 1">
<view v-for="(cx, ci) in item.detail" :key="ci" class="box_bottom">
<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;">
<Text class='topic_cont_text' >{{cx.goods_info.name}}</Text>
<view style='width: calc(100% - 85px);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'>
<view v-for="(attr, index2) in cx.goods_info.attr_list" :key="index2" >
<Text style='color: #A0A09D;font-size: 24rpx;margin-right: 5rpx;'>规格:{{attr.attr_name}}</Text>
<view
v-for="(cx, ci) in item.detail"
:key="ci"
class="box_bottom"
>
<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;
"
>
<Text class="topic_cont_text">{{
cx.goods_info.name
}}</Text>
<view
style="
width: calc(100% - 85px);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>
<view
v-for="(attr, index2) in cx.goods_info.attr_list"
:key="index2"
>
<Text
style="
color: #a0a09d;
font-size: 24rpx;
margin-right: 5rpx;
"
>规格:{{ attr.attr_name }}</Text
>
</view>
</view>
<view style="width: 100%;display: flex;flex-direction: row;align-items:center;justify-content: space-between;">
<Text style='color: #A0A09D;font-size: 24rpx;'>X{{cx.num}}</Text>
<Text style='font-size: 24rpx;'>{{cx.total_price}}</Text>
<view
style="
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
"
>
<Text style="color: #a0a09d; font-size: 24rpx;"
>X{{ cx.num }}</Text
>
<Text style="font-size: 24rpx;"
>{{ cx.total_price }}</Text
>
</view>
</view>
</view>
......@@ -43,7 +100,7 @@
<template v-else>
<view class="goodboxmore">
<view class="good-list">
<view style="white-space: nowrap">
<view style="white-space: nowrap;">
<image
v-for="(y, yi) in item.detail"
:key="yi"
......@@ -63,13 +120,18 @@
</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 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)">
<view class="handle_item" @click="cancel(item, index)">
<Text>取消</Text>
</view>
<view class="handle_item">
......@@ -84,16 +146,15 @@
v-if="isover"
:margin-top="20"
:margin-bottom="20"
bg-color='#f3f4f6'
>没有更多订单了</u-divider>
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>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-modal
......@@ -104,45 +165,55 @@
@confirm="confirm"
></u-modal>
<u-toast ref="uToast" />
<good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list>
<good-list
:list="goodData"
v-if="showGoodList"
@close="closeGoodListHandler"
></good-list>
</view>
</template>
<script>
import goodList from '@/components/goods/order-good-list2'
import goodList from "@/components/goods/order-good-list2";
export default {
components:{
goodList
export default {
components: {
goodList,
},
data() {
return {
pageTitle:'我的订单',
pageTitle: "我的订单",
current: 0,
list: [{name: '全部'}, {name: '待付款'},{name: '待发货'},{name: '待收货'},{name: '待评价'},],
list: [
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待收货" },
{ name: "待评价" },
{ name: "已完成" },
{ name: "已取消" }
],
mainColor: "",
contentHeight:0,
page:1,
page_count:1,
g:[],
loading:false,
showModal:false,
item:'',
index:0,
goodData:[],
showGoodList:false,
isover:false
contentHeight: 0,
page: 1,
page_count: 1,
g: [],
loading: false,
showModal: false,
item: "",
index: 0,
goodData: [],
showGoodList: false,
isover: false,
};
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
......@@ -155,34 +226,34 @@
title: this.pageTitle,
});
},
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
onLoad: function (option) {
//option为object类型,会序列化上个页面传递的参数
this.current = option.status;
this.loading = true;
this.init()
this.init();
},
methods: {
change(index){
change(index) {
this.current = index;
this.page= 1;
this.page = 1;
this.g = [];
this.loading = true;
this.init()
this.init();
},
init(){
init() {
this.isover = false;
let h=this.apiheader()
let h = this.apiheader();
this.request(
{
url: "",
header:h,
header: h,
data: {
r: "api/order/list",
status:this.current,
status: this.current,
page: this.page,
}
},
res => {
},
(res) => {
this.loading = false;
this.g = this.g.concat(res.data.list);
this.page_count = res.data.pagination.page_count;
......@@ -191,25 +262,22 @@
}
}
);
},
lower(e) {
if (this.page < this.page_count) {
this.page++;
this.init();
} else {
this.isover = true;
}
},
cancel(e,index){
this.showModal=true;
this.index=index;
cancel(e, index) {
this.showModal = true;
this.index = index;
this.item = e;
},
confirm(){
this.showModal = false
confirm() {
this.showModal = false;
let h = this.apiheader();
// h['content-type']='application/x-www-form-urlencoded'
this.request(
......@@ -219,42 +287,41 @@
header: h,
data: {
r: "api/order/cancel",
id: this.item.id
}
id: this.item.id,
},
},
res => {
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() {
this.goodData = [];
this.showGoodList = false;
},
showGoodListHandler(i){
this.goodData=this.g[i].detail
console.log(this.goodData)
this.showGoodList=true
showGoodListHandler(i) {
this.goodData = this.g[i].detail;
console.log(this.goodData);
this.showGoodList = true;
},
}
};
},
};
</script>
<style>
.orderindexStyle{
.orderindexStyle {
width: 100%;
height: 100%;
background: #f3f4f6;
}
.orderindexStyle .orderList{
}
.orderindexStyle .orderList {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.orderList .listBox{
}
.orderList .listBox {
width: 94%;
background: #fff;
border-radius: 10rpx;
......@@ -263,8 +330,8 @@
align-items: center;
padding: 20rpx;
margin-bottom: 30rpx;
}
.orderList .listBox .listBox_t{
}
.orderList .listBox .listBox_t {
width: 100%;
display: flex;
flex-direction: row;
......@@ -272,38 +339,37 @@
justify-content: space-between;
font-size: 24rpx;
margin: 10rpx 0;
}
.orderList .listBox .listBox_c{
}
.orderList .listBox .listBox_c {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.orderList .listBox .box_bottom{
}
.orderList .listBox .box_bottom {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
margin-bottom: 18rpx;
}
.orderList .handle{
}
.orderList .handle {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
margin-top: 10rpx;
}
.orderList .handle_item{
padding:0 24rpx;
}
.orderList .handle_item {
padding: 0 24rpx;
border: 1px solid #c8c9cc;
margin-left: 20rpx;
height: 50rpx;
border-radius: 25rpx;
line-height: 50rpx;
}
.orderindexStyle .loading{
}
.orderindexStyle .loading {
width: 200rpx;
height: 200rpx;
background: #000000;
......@@ -315,48 +381,48 @@
justify-content: center;
position: fixed;
left: 50%;
top:30%;
top: 30%;
margin-left: -100rpx;
z-index: 999;
}
.listBox_c .goodboxmore {
}
.listBox_c .goodboxmore {
margin-bottom: 20px;
display: flex;
width: 100%;
}
.listBox_c .goodboxmore .good-list {
}
.listBox_c .goodboxmore .good-list {
display: flex;
flex: 1;
overflow-x: auto;
}
.listBox_c .goodboxmore .good-list .item {
}
.listBox_c .goodboxmore .good-list .item {
width: 70px;
height: 70px;
border-radius: 5px;
margin-right: 10px;
}
.listBox_c .goodboxmore .infos {
}
.listBox_c .goodboxmore .infos {
display: flex;
width: 80px;
}
.listBox_c .goodboxmore .infos .text {
}
.listBox_c .goodboxmore .infos .text {
text-align: center;
font-size: 13px;
width: 57px;
margin-right: 5px;
line-height: 70px;
}
.listBox_c .left{
}
.listBox_c .left {
flex: 1;
color: #232323;
font-size: 16px;
flex: 1;
font-family: "oswald";
}
.listBox_c .small {
}
.listBox_c .small {
font-size: 13px;
}
.listBox_c .topic_cont_text{
}
.listBox_c .topic_cont_text {
font-size: 26rpx;
max-height: 70rpx;
overflow: hidden;
......@@ -365,5 +431,5 @@
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 2; /** 显示的行数 **/
}
}
</style>
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