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
style="
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 15rpx; padding: 0 15rpx;
"> "
>
<Text class="grid-text">商品库存有限,请尽快下单哦</Text> <Text class="grid-text">商品库存有限,请尽快下单哦</Text>
<Text @click="edit" v-if="editType == false" class="grid-text_r">编辑</Text> <Text @click="edit" v-if="editType == false" class="grid-text_r"
<Text @click="edit" v-if="editType == true" class="grid-text_r">完成</Text> >编辑</Text
>
<Text @click="edit" v-if="editType == true" class="grid-text_r"
>完成</Text
>
</view> </view>
<view style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"></view> <view
<u-empty v-if="list.length == 0" text="购物车还是空的哦" mode="car"></u-empty> style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"
></view>
<view v-if="list.length > 0" style=" <u-empty
v-if="list.length == 0"
text="购物车还是空的哦"
mode="car"
></u-empty>
<view
v-if="list.length > 0"
style="
height: calc(100vh - 60px); height: calc(100vh - 60px);
width: calc(100vw); width: calc(100vw);
overflow: hidden; overflow: hidden;
padding-top: 10px; 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"> <scroll-view
<view style="padding: 0 12px 12px 12px; border-bottom: 1rpx solid #f5f5f5;width: 100%;"> :scroll-y="true"
<u-checkbox-group @change="mch_SelectAll(c.checked,i)"> :enable-back-to-top="true"
<u-checkbox v-model="c.checked" shape="circle" :active-color="mc">{{c.name}}</u-checkbox> :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> </u-checkbox-group>
</view> </view>
<view class="cartList_item" v-for="(item, index) in c.goods_list" :key="index" :name="item.name"> <view
<u-checkbox-group v-if='item.new_status==0 || editType==true' @change="clickcheckbox(item.checked, item.attrs.price, index,i)"> class="cartList_item"
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox> 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> </u-checkbox-group>
<Text v-if='item.new_status!=0 && editType==false' style='color: #a0a09d;width: 22px;'>失效</Text> <Text
<image :src="item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic" mode="aspectFill" style=" 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; width: 150rpx;
height: 150rpx; height: 150rpx;
margin-left: 30rpx; margin-left: 30rpx;
border-radius: 5px; border-radius: 5px;
" /> "
<view style=" />
<view
style="
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
width: 460rpx; width: 460rpx;
height: 150rpx; height: 150rpx;
margin-left: 20rpx; margin-left: 20rpx;
"> "
<Text style=" >
<Text
style="
font-size: 28rpx; font-size: 28rpx;
width: 460rpx; width: 460rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
">{{ item.goods.name }}</Text> "
<view style=" >{{ item.goods.name }}</Text
>
<view
style="
width: 460rpx; width: 460rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
"> "
>
<view v-for="(attr, inde2x) in item.attrs.attr" :key="inde2x"> <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> </view>
<view style=" <view
style="
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; 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> --> <!-- <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">
<view class="item_input_l" :style="{ <view
class="item_input_l"
:style="{
color: item.num == 1 ? '#E2E2E2' : '#9B9B9B', color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
}" }"
@click="reduce(i,index, item.attrs.price)">-</view> @click="reduce(i, index, item.attrs.price)"
<input type="number" class="item_input_c" :value="item.num" @blur='inputblur(i,index, item.num,item.attrs.price,$event)' >-</view
@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> <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> </view>
</view> </view>
</view> </view>
</template>
</scroll-view> </scroll-view>
</view> </view>
<view class="box_bottom">
<view class="box_bottom" >
<div style="margin-left: 30rpx;"> <div style="margin-left: 30rpx;">
<u-checkbox-group @change="SelectAll"> <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> </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>
<div class="bottom_btn" v-if="!editType"> <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, backgroundColor: mc,
height: '80rpx', height: '80rpx',
color: '#FFF', color: '#FFF',
fontSize: '14px', fontSize: '14px',
}">去结算({{ checkCount }}) }"
>去结算({{ checkCount }})
</u-button> </u-button>
</div> </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, backgroundColor: secondary,
height: '80rpx', height: '80rpx',
color: '#FFF', color: '#FFF',
fontSize: '14px', fontSize: '14px',
marginRight: '12px', marginRight: '12px',
}">删除 }"
>删除
</u-button> </u-button>
</view> </view>
...@@ -118,8 +235,8 @@ ...@@ -118,8 +235,8 @@
</div> </div>
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
export default { export default {
data() { data() {
return { return {
isloading: true, isloading: true,
...@@ -149,11 +266,11 @@ ...@@ -149,11 +266,11 @@
this.navHeight = this.$navHeight - 2; this.navHeight = this.$navHeight - 2;
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
this.cstyle = uni.getStorageSync("basedata") ? this.cstyle = uni.getStorageSync("basedata")
uni.getStorageSync("basedata").cat_style : []; ? uni.getStorageSync("basedata").cat_style
: [];
if (this.cstyle.cat_style == "4") { if (this.cstyle.cat_style == "4") {
} }
}, },
mounted() { mounted() {
...@@ -161,10 +278,11 @@ ...@@ -161,10 +278,11 @@
let c = this.$uiConfig.is_bang ? 80 : 52; let c = this.$uiConfig.is_bang ? 80 : 52;
this.bottommargin = c - 2 + "px"; this.bottommargin = c - 2 + "px";
this.listbottom = c + 44 + "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 u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ? let pages = wx.getStorageSync("basedata")
wx.getStorageSync("basedata").bar_title : []; ? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => { pages.forEach((x) => {
if (x.value == u) { if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
...@@ -178,14 +296,15 @@ ...@@ -178,14 +296,15 @@
methods: { methods: {
goHome() { goHome() {
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/main" url: "/pages/index/main",
}); });
}, },
init() { init() {
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
let h = this.apiheader(); let h = this.apiheader();
this.request({ this.request(
{
url: "", url: "",
header: h, header: h,
data: { data: {
...@@ -202,7 +321,7 @@ ...@@ -202,7 +321,7 @@
x.checked = false; x.checked = false;
x.goods_list.forEach((j) => { x.goods_list.forEach((j) => {
j.checked = false; j.checked = false;
}) });
}); });
this.list = list; this.list = list;
} else { } else {
...@@ -218,7 +337,8 @@ ...@@ -218,7 +337,8 @@
this.TotalPrice += price * this.list[i].goods_list[index].num; this.TotalPrice += price * this.list[i].goods_list[index].num;
let goods_list_all = true; //判断该商场是否全选 let goods_list_all = true; //判断该商场是否全选
this.list[i].goods_list.forEach((x) => { this.list[i].goods_list.forEach((x) => {
if (this.editType == false) { //编辑的时候不判断 if (this.editType == false) {
//编辑的时候不判断
if (x.checked == false && x.new_status == 0) { if (x.checked == false && x.new_status == 0) {
goods_list_all = false; goods_list_all = false;
} }
...@@ -227,7 +347,6 @@ ...@@ -227,7 +347,6 @@
goods_list_all = false; goods_list_all = false;
} }
} }
}); });
if (goods_list_all == true) { if (goods_list_all == true) {
this.list[i].checked = true; this.list[i].checked = true;
...@@ -235,9 +354,9 @@ ...@@ -235,9 +354,9 @@
let list_all = true; //判断所有商场是否全选 let list_all = true; //判断所有商场是否全选
this.list.forEach((x) => { this.list.forEach((x) => {
if (x.checked == false) { if (x.checked == false) {
list_all = false list_all = false;
} }
}) });
if (list_all == true) { if (list_all == true) {
this.allchecked = true; this.allchecked = true;
} }
...@@ -271,15 +390,14 @@ ...@@ -271,15 +390,14 @@
} }
}, },
mch_SelectAll(checked, i) { mch_SelectAll(checked, i) {
if (checked == true) { if (checked == true) {
let add_cartlist = []; let add_cartlist = [];
let new_statusnum = 0 let new_statusnum = 0;
this.list[i].goods_list.forEach((x) => { this.list[i].goods_list.forEach((x) => {
if (x.new_status == 0) { if (x.new_status == 0) {
this.TotalPrice += x.attrs.price * x.num; this.TotalPrice += x.attrs.price * x.num;
x.checked = true; x.checked = true;
new_statusnum++ new_statusnum++;
} }
//编辑时候的商城全选 //编辑时候的商城全选
...@@ -302,36 +420,34 @@ ...@@ -302,36 +420,34 @@
add_cartlist.push(obj); 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; //判断所有商场是否全选 let list_all = true; //判断所有商场是否全选
this.list.forEach((x) => { this.list.forEach((x) => {
if (x.checked == false) { if (x.checked == false) {
list_all = false list_all = false;
} }
}) });
if (list_all == true) { if (list_all == true) {
this.allchecked = true; this.allchecked = true;
} }
this.checkCount += new_statusnum; this.checkCount += new_statusnum;
} else { } else {
let new_statusnum = 0 let new_statusnum = 0;
this.list[i].goods_list.forEach((x) => { this.list[i].goods_list.forEach((x) => {
if (x.new_status == 0) { if (x.new_status == 0) {
x.checked = false; x.checked = false;
this.TotalPrice -= x.attrs.price * x.num; this.TotalPrice -= x.attrs.price * x.num;
new_statusnum++ new_statusnum++;
} }
//编辑时候的商城全选 //编辑时候的商城全选
this.cart_id_list.forEach((z, m) => { this.cart_id_list.forEach((z, m) => {
if (x.id == z.id) { if (x.id == z.id) {
this.cart_id_list.splice(m, 1) this.cart_id_list.splice(m, 1);
} }
}); });
}) });
this.allchecked = false; this.allchecked = false;
this.checkCount -= new_statusnum; this.checkCount -= new_statusnum;
} }
...@@ -348,7 +464,7 @@ ...@@ -348,7 +464,7 @@
if (j.new_status == 0) { if (j.new_status == 0) {
j.checked = true; j.checked = true;
this.checkCount++; this.checkCount++;
this.TotalPrice += j.attrs.price * j.num this.TotalPrice += j.attrs.price * j.num;
} }
//编辑的时候 //编辑的时候
...@@ -358,10 +474,8 @@ ...@@ -358,10 +474,8 @@
id: j.id, id: j.id,
}); });
} }
})
}); });
});
} else { } else {
this.checkCount = 0; this.checkCount = 0;
this.TotalPrice = 0; this.TotalPrice = 0;
...@@ -370,21 +484,20 @@ ...@@ -370,21 +484,20 @@
x.checked = false; x.checked = false;
x.goods_list.forEach((j) => { x.goods_list.forEach((j) => {
j.checked = false; j.checked = false;
})
}); });
});
} }
}, },
inputblur(i, index, num, price, e) { inputblur(i, index, num, price, e) {
let value = Number(e.target.value) let value = Number(e.target.value);
if (value == 0) { if (value == 0) {
this.list[i].goods_list[index].num = 1; this.list[i].goods_list[index].num = 1;
this.TotalPrice += price * 1; this.TotalPrice += price * 1;
} }
}, },
onKeyInput(i, index, num, price, e) { //输入的数量 onKeyInput(i, index, num, price, e) {
let value = Number(e.target.value) //输入的数量
let value = Number(e.target.value);
this.list[i].goods_list[index].num = value; this.list[i].goods_list[index].num = value;
if (this.list[i].goods_list[index].checked == true) { if (this.list[i].goods_list[index].checked == true) {
...@@ -421,18 +534,18 @@ ...@@ -421,18 +534,18 @@
list.forEach((x) => { list.forEach((x) => {
x.checked = false; x.checked = false;
x.goods_list.forEach((j) => { x.goods_list.forEach((j) => {
j.checked = false j.checked = false;
}) });
}); });
}, },
delete_btn() { delete_btn() {
if (this.cart_id_list.length > 0) { if (this.cart_id_list.length > 0) {
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
let h = this.apiheader(); let h = this.apiheader();
h["content-type"] = "application/x-www-form-urlencoded"; h["content-type"] = "application/x-www-form-urlencoded";
this.request({ this.request(
{
url: "", url: "",
method: "POST", method: "POST",
header: h, header: h,
...@@ -462,8 +575,21 @@ ...@@ -462,8 +575,21 @@
}, },
settlement() { settlement() {
if (this.checkCount > 0) { if (this.checkCount > 0) {
let goods = []; let forms = {
this.list.forEach((x) => { 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) { if (x.checked) {
let g = { let g = {
id: x.goods_id, id: x.goods_id,
...@@ -478,12 +604,15 @@ ...@@ -478,12 +604,15 @@
attr_group_id: x.attr_group_id, attr_group_id: x.attr_group_id,
}); });
}); });
goods.push(g); good.goods_list.push(g);
} }
}); });
forms.list.push(good);
});
uni.navigateTo({ uni.navigateTo({
url: "/pages/order-submit/order-submit?goods=" + url:
encodeURIComponent(JSON.stringify(goods)) "/pages/order-submit/order-submit?formData=" +
encodeURIComponent(JSON.stringify(forms)),
}); });
} else { } else {
uni.showToast({ uni.showToast({
...@@ -495,49 +624,49 @@ ...@@ -495,49 +624,49 @@
} }
}, },
}, },
}; };
</script> </script>
<style> <style>
.cartStyle { .cartStyle {
height: 100%; height: 100%;
position: relative; position: relative;
font-family: "oswald"; font-family: "oswald";
} }
.cartStyle .u-checkbox__label { .cartStyle .u-checkbox__label {
margin-left: 12px; margin-left: 12px;
} }
.cartStyle .grid-text { .cartStyle .grid-text {
font-size: 24rpx; font-size: 24rpx;
margin-top: 4rpx; margin-top: 4rpx;
color: #939393; color: #939393;
} }
.cartStyle .grid-text_r { .cartStyle .grid-text_r {
margin-top: 4rpx; margin-top: 4rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.cartStyle .cartList { .cartStyle .cartList {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
overflow-y: hidden; overflow-y: hidden;
} }
.cartStyle .cartList .cartList_item { .cartStyle .cartList .cartList_item {
width: 100%; width: 100%;
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
border-bottom: 1rpx solid #f5f5f5; border-bottom: 1rpx solid #f5f5f5;
} }
.cartList .cartList_item .item_input { .cartList .cartList_item .item_input {
width: 200rpx; width: 200rpx;
height: 60rpx; height: 60rpx;
background: #f7f7f7; background: #f7f7f7;
...@@ -545,26 +674,26 @@ ...@@ -545,26 +674,26 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.cartList .item_input .item_input_l, .cartList .item_input .item_input_l,
.item_input_r { .item_input_r {
width: 50rpx; width: 50rpx;
height: 60rpx; height: 60rpx;
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.cartStyle .item_input .item_input_c { .cartStyle .item_input .item_input_c {
text-align: center; text-align: center;
width: 50rpx; width: 50rpx;
height: 60rpx; height: 60rpx;
font-size: 20rpx; font-size: 20rpx;
} }
.cartStyle .box_bottom { .cartStyle .box_bottom {
width: 100%; width: 100%;
height: 50px; height: 50px;
position: absolute; position: absolute;
...@@ -577,17 +706,17 @@ ...@@ -577,17 +706,17 @@
justify-content: space-between; justify-content: space-between;
border-top: 1rpx solid #f5f5f5; border-top: 1rpx solid #f5f5f5;
z-index: 999; z-index: 999;
} }
.cartStyle .bottom_btn { .cartStyle .bottom_btn {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 250rpx; width: 250rpx;
height: 50px; height: 50px;
} }
.cartStyle .Deletestyle { .cartStyle .Deletestyle {
margin-right: 40rpx; 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"
: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=" style="
height: calc(100vh - 50px); height: calc(100vh - 50px);
width: calc(100vw); width: calc(100vw);
overflow: hidden; overflow: hidden;
padding-top: 10px; padding-top: 10px;
"> "
>
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
:enable-back-to-top="true" :enable-back-to-top="true"
:enable-flex="true" :enable-flex="true"
@scrolltolower="lower" @scrolltolower="lower"
:style="{ height: '100%' }"> :style="{ height: '100%' }"
>
<view class="orderList"> <view class="orderList">
<view class="listBox" v-for="(item, index) in g" :key="index"> <view class="listBox" v-for="(item, index) in g" :key="index">
<view class="listBox_t"> <view class="listBox_t">
<Text >订单号:{{item.order_no}}</Text> <Text>订单号:{{ item.order_no }}</Text>
<Text>{{item.status_text}}</Text> <Text>{{ item.status_text }}</Text>
</view> </view>
<view class="listBox_c"> <view class="listBox_c">
<template v-if="item.detail.length == 1"> <template v-if="item.detail.length == 1">
<view v-for="(cx, ci) in item.detail" :key="ci" class="box_bottom"> <view
<image :src="cx.goods_info.pic_url" style="width: 75px; height: 75px" /> v-for="(cx, ci) in item.detail"
<view style="width: calc(100% - 85px);height: 75px;display: flex;flex-direction: column;margin-left: 10px;justify-content: space-between;"> :key="ci"
<Text class='topic_cont_text' >{{cx.goods_info.name}}</Text> class="box_bottom"
<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" > <image
<Text style='color: #A0A09D;font-size: 24rpx;margin-right: 5rpx;'>规格:{{attr.attr_name}}</Text> :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> </view>
<view style="width: 100%;display: flex;flex-direction: row;align-items:center;justify-content: space-between;"> <view
<Text style='color: #A0A09D;font-size: 24rpx;'>X{{cx.num}}</Text> style="
<Text style='font-size: 24rpx;'>{{cx.total_price}}</Text> 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> </view>
</view> </view>
...@@ -43,7 +100,7 @@ ...@@ -43,7 +100,7 @@
<template v-else> <template v-else>
<view class="goodboxmore"> <view class="goodboxmore">
<view class="good-list"> <view class="good-list">
<view style="white-space: nowrap"> <view style="white-space: nowrap;">
<image <image
v-for="(y, yi) in item.detail" v-for="(y, yi) in item.detail"
:key="yi" :key="yi"
...@@ -63,13 +120,18 @@ ...@@ -63,13 +120,18 @@
</view> </view>
</view> </view>
</template> </template>
<Text style='font-size: 32rpx;text-align: right;width: 100%;'>合计:¥{{item.total_price}} <Text style="font-size: 32rpx; text-align: right; width: 100%;"
<Text v-if='item.express_price!=0' style='font-size: 20rpx;color: #A0A09D;'>(含运费 ¥{{item.express_price}})</Text> >合计:¥{{ item.total_price }}
<Text
v-if="item.express_price != 0"
style="font-size: 20rpx; color: #a0a09d;"
>(含运费 ¥{{ item.express_price }})</Text
>
</Text> </Text>
<!-- TODO 样式结构修改--> <!-- TODO 样式结构修改-->
<view class="handle"> <view class="handle">
<view class="handle_item" @click="cancel(item,index)"> <view class="handle_item" @click="cancel(item, index)">
<Text>取消</Text> <Text>取消</Text>
</view> </view>
<view class="handle_item"> <view class="handle_item">
...@@ -84,16 +146,15 @@ ...@@ -84,16 +146,15 @@
v-if="isover" v-if="isover"
:margin-top="20" :margin-top="20"
:margin-bottom="20" :margin-bottom="20"
bg-color='#f3f4f6' bg-color="#f3f4f6"
>没有更多订单了</u-divider> >没有更多订单了</u-divider
>
</scroll-view> </scroll-view>
</view> </view>
<!-- 加载中 --> <!-- 加载中 -->
<view class="loading" v-if="loading"> <view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-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> </view>
<!-- 取消提示 --> <!-- 取消提示 -->
<u-modal <u-modal
...@@ -104,45 +165,55 @@ ...@@ -104,45 +165,55 @@
@confirm="confirm" @confirm="confirm"
></u-modal> ></u-modal>
<u-toast ref="uToast" /> <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> </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: [
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待收货" },
{ name: "待评价" },
{ name: "已完成" },
{ name: "已取消" }
],
mainColor: "", mainColor: "",
contentHeight:0, contentHeight: 0,
page:1, page: 1,
page_count:1, page_count: 1,
g:[], g: [],
loading:false, loading: false,
showModal:false, showModal: false,
item:'', item: "",
index:0, index: 0,
goodData:[], goodData: [],
showGoodList:false, showGoodList: false,
isover:false isover: false,
}; };
}, },
created(){ created() {
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route; let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title ? wx.getStorageSync("basedata").bar_title
: []; : [];
...@@ -155,34 +226,34 @@ ...@@ -155,34 +226,34 @@
title: this.pageTitle, title: this.pageTitle,
}); });
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) {
//option为object类型,会序列化上个页面传递的参数
this.current = option.status; this.current = option.status;
this.loading = true; this.loading = true;
this.init() this.init();
}, },
methods: { methods: {
change(index){ change(index) {
this.current = index; this.current = index;
this.page= 1; this.page = 1;
this.g = []; this.g = [];
this.loading = true; this.loading = true;
this.init() this.init();
}, },
init(){ init() {
this.isover = false; this.isover = false;
let h=this.apiheader() let h = this.apiheader();
this.request( this.request(
{ {
url: "", url: "",
header:h, header: h,
data: { data: {
r: "api/order/list", r: "api/order/list",
status:this.current, status: this.current,
page: this.page, page: this.page,
}
}, },
res => { },
(res) => {
this.loading = false; this.loading = false;
this.g = this.g.concat(res.data.list); this.g = this.g.concat(res.data.list);
this.page_count = res.data.pagination.page_count; this.page_count = res.data.pagination.page_count;
...@@ -191,25 +262,22 @@ ...@@ -191,25 +262,22 @@
} }
} }
); );
}, },
lower(e) { lower(e) {
if (this.page < this.page_count) { if (this.page < this.page_count) {
this.page++; this.page++;
this.init(); this.init();
} else { } else {
this.isover = true; this.isover = true;
} }
}, },
cancel(e,index){ cancel(e, index) {
this.showModal=true; this.showModal = true;
this.index=index; this.index = index;
this.item = e; this.item = e;
}, },
confirm(){ confirm() {
this.showModal = false this.showModal = false;
let h = this.apiheader(); let h = this.apiheader();
// h['content-type']='application/x-www-form-urlencoded' // h['content-type']='application/x-www-form-urlencoded'
this.request( this.request(
...@@ -219,42 +287,41 @@ ...@@ -219,42 +287,41 @@
header: h, header: h,
data: { data: {
r: "api/order/cancel", r: "api/order/cancel",
id: this.item.id id: this.item.id,
} },
}, },
res => { (res) => {
this.$refs.uToast.show({title: res.msg,}) this.$refs.uToast.show({ title: res.msg });
this.g.splice(this.index,1) this.g.splice(this.index, 1);
} }
); );
}, },
closeGoodListHandler(){ closeGoodListHandler() {
this.goodData=[] this.goodData = [];
this.showGoodList=false this.showGoodList = false;
}, },
showGoodListHandler(i){ showGoodListHandler(i) {
this.goodData=this.g[i].detail this.goodData = this.g[i].detail;
console.log(this.goodData) console.log(this.goodData);
this.showGoodList=true 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;
...@@ -263,8 +330,8 @@ ...@@ -263,8 +330,8 @@
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;
...@@ -272,38 +339,37 @@ ...@@ -272,38 +339,37 @@
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;
...@@ -315,48 +381,48 @@ ...@@ -315,48 +381,48 @@
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;
...@@ -365,5 +431,5 @@ ...@@ -365,5 +431,5 @@
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/ display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/ -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 2; /** 显示的行数 **/ -webkit-line-clamp: 2; /** 显示的行数 **/
} }
</style> </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