Commit a4621c31 authored by Mac's avatar Mac

1

parent 336da235
......@@ -32,14 +32,15 @@
></u-rate>
<text class="good-rb-text">{{cx.course_score!=null &&cx.course_score>0?cx.course_score.toFixed(1):'5.0'}}</text>
</view>
<view class="good-rb-box" v-if="cx.is_pay==false">
<view class="good-rb-box" v-if="cx.is_pay==false && cx.price!=0">
<text style="font-size: 10px;color: #999999;text-decoration:line-through;margin-right: 2px;margin-top: 2px;">{{cx.original_price}}</text>
<text :style="{'font-size': '11px','color': pricecolor,'margin-top':'2px'}">¥</text>
<text :style="{'font-size': '16px','color': pricecolor}">{{cx.price.split('.')[0]}}</text>
</view>
<view class="good-rb-box" v-if="cx.is_pay==true">
<view class="good-rb-box" v-if="cx.is_pay==true&& cx.price!=0">
<text :style="{'font-size': '14px','color': pricecolor}">已购买</text>
</view>
<view v-if="cx.price==0" style="font-size: 12px;color: #999999;">免费</view>
</view>
</view>
</view>
......
......@@ -9,39 +9,31 @@
padding: 0 15rpx;
"
>
<Text class="grid-text">商品库存有限,请尽快下单哦</Text>
<Text class="grid-text" v-if='IsEducation!=1'>商品库存有限,请尽快下单哦</Text>
<Text class="grid-text" v-if='IsEducation==1'>{{list[0].GoodsList.length}}个课程</Text>
<Text @click="edit" v-if="editType == false && list[0].GoodsList.length>0" 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="emptyshow == true" text="购物车还是空的哦" mode="car"></u-empty>
<view
v-if="list.length > 0"
style="
height: calc(100vh - 60px-30px-35px-20px);
width: calc(100vw);
overflow: hidden;
padding-top: 10px;
"
>
<view v-if="list.length > 0" style="height: calc(100vh - 60px-30px-35px-20px);width: calc(100vw);overflow: hidden;padding-top: 10px;">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%' }">
<template v-if="list.length > 0 && emptyshow==false">
<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%;
"
>
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.MallName }}</u-checkbox>
</u-checkbox-group>
</view>
<view class="cartList_item" v-for="(item, index) in c.GoodsList" :key="index" :name="item.GoodsName" >
<!-- <view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && editType == true) || (item.InventoryNum!=0&&editType == false)"> -->
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && item.InventoryNum!=0) || (editType == true)">
<view class="cartList_item" v-for="(item, index) in c.GoodsList" :key="index" >
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && item.InventoryNum!=0 && IsEducation!=1) || (editType == true&& IsEducation!=1)">
<u-checkbox-group @change="clickcheckbox(item.checked, item.Price, index, i)">
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox>
</u-checkbox-group>
</view>
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && IsEducation==1) || (editType == true)">
<u-checkbox-group @change="clickcheckbox(item.checked, item.Price, index, i)">
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox>
</u-checkbox-group>
......@@ -50,47 +42,31 @@
<view class="invalid" :style="{ background: mc }" v-if="item.GoodsStatus != 1 && editType == false">
<Text style="color: #fff; width: 22px;font-size: 20rpx;">失效</Text>
</view>
<view class="invalid" :style="{ background: mc }" v-if="item.InventoryNum == 0 && editType == false">
<view class="invalid" :style="{ background: mc }" v-if="item.InventoryNum == 0 && editType == false && IsEducation!=1">
<Text style="color: #fff; width: 22px;font-size: 20rpx;">售馨</Text>
</view>
<image
:src="item.CoverImage"
v-if='IsEducation!=1'
mode="aspectFill"
style="
width: 150rpx;
height: 150rpx;
margin-left: 30rpx;
border-radius: 5px;
"
style="width: 150rpx;height: 150rpx;margin-left: 30rpx;border-radius: 5px;"
@click="clickHandler(item.GoodsId)"
/>
<view
style="
display: flex;
flex-direction: column;
justify-content: space-between;
width: 440rpx;
height: 150rpx;
margin-left: 20rpx;
"
>
<view
style="
font-size: 26rpx;
width: 440rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>
<image
:src="item.CoverImage"
v-if='IsEducation==1'
mode="aspectFill"
style="width: 116px;height: 64px;margin-left: 30rpx;border-radius: 5px;box-shadow:0 4px 10px 1px #D2D2D2;"
@click="clickHandler(item.GoodsId)"
/>
<view class="item-r" :style="{'width':IsEducation!=1?'440rpx':item_r,'height':IsEducation!=1?'150rpx':'65px', }">
<view :class="IsEducation!=1?'item-r-n':'item-r-n2'">
<view v-if="item.MarketingLogo.iswords && item.MarketingLogo.iswords==1&& item.MarketingLogo.words!=''" class="Logo" :style=
"{color: item.MarketingLogo.wordsColor,
background:item.MarketingLogo.wordsBack ,}">
"{color: item.MarketingLogo.wordsColor,background:item.MarketingLogo.wordsBack ,}">
{{item.MarketingLogo.words}}
</view>
<image
v-if="item.MarketingLogo.iswords&&item.MarketingLogo.iswords==2&& item.MarketingLogo.ico!=''"
mode="heightFix"
......@@ -99,75 +75,39 @@
/>
{{ item.GoodsName}}
</view>
<view
style="
width: 440rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>
<view style="width: 440rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" v-if="IsEducation!=1">
<Text v-for="(attr, inde2x) in item.SpecificationList" :key="inde2x"
style="
color: #a0a09d;
font-size: 20rpx;
margin-right: 5rpx;
"
>
style="color: #a0a09d;font-size: 20rpx;margin-right: 5rpx;">
{{ attr}}
</Text>
</view>
<view
style="
max-width: 440rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-top: 2px;
"
<view style="max-width: 440rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin-top: 2px;"
@click.native.stop="goUrl(item.FreeShippingUrl)"
v-if="item.FreeShippingName !=null && (item.FreeShippingFullMoneyPinkage>0 || item.FreeShippingFullNumPinkage>0)"
>
<view style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;">
<Text style="
font-size: 20rpx;
margin-right: 5rpx;
">
{{item.FreeShippingName !=null ?item.FreeShippingName+':':''}}
<text v-if="item.FreeShippingFullMoneyPinkage==0 && item.FreeShippingFullNumPinkage>0">{{item.FreeShippingFullNumPinkage}}件包邮</text>
<text v-if="item.FreeShippingFullMoneyPinkage>0 && item.FreeShippingFullNumPinkage==0">{{item.FreeShippingFullMoneyPinkage}}元包邮</text>
</Text>
</view>
v-if="item.FreeShippingName !=null&&IsEducation!=1 && (item.FreeShippingFullMoneyPinkage>0 || item.FreeShippingFullNumPinkage>0)" >
<view style="color: #FF4048;background: #fdf6ec;padding: 0 5px;display: inline-block;">
<Text style="font-size: 20rpx;margin-right: 5rpx;">
{{item.FreeShippingName !=null ?item.FreeShippingName+':':''}}
<text v-if="item.FreeShippingFullMoneyPinkage==0 && item.FreeShippingFullNumPinkage>0">{{item.FreeShippingFullNumPinkage}}件包邮</text>
<text v-if="item.FreeShippingFullMoneyPinkage>0 && item.FreeShippingFullNumPinkage==0">{{item.FreeShippingFullMoneyPinkage}}元包邮</text>
</Text>
</view>
</view>
<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.Price }}</Text>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;" >
<Text style="font-size: 30rpx;" :style="{ color: pricecolor }">
<Text style="40rpx">{{ item.Price }}</Text>
</Text>
<u-number-box
<u-number-box v-if='IsEducation!=1'
v-model="item.Number"
:min="1"
:max="item.InventoryNum"
@change="valChange(i, index, item.Number, item.Price, $event)"
></u-number-box>
</view>
<Text v-if="item.GoodsStatus != 1 && editType == false" style="font-size: 20rpx;color:#a0a09d ;">失效原因:商品下架或者库存不足</Text>
</view>
<Text v-if="item.GoodsStatus != 1 && editType == false&&IsEducation!=1" style="font-size: 20rpx;color:#a0a09d ;">失效原因:商品下架或者库存不足</Text>
<Text v-if="item.GoodsStatus != 1 && editType == false&&IsEducation==1" style="font-size: 20rpx;color:#a0a09d ;">失效原因:课程下架</Text>
</view>
</view>
</view>
</template>
</scroll-view>
......@@ -179,7 +119,7 @@
<u-checkbox-group @change="SelectAll">
<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: pricecolor }" v-if="editType == false">¥{{ TotalPrice }}</Text>
</div>
<div class="bottom_btn" v-if="!editType">
<u-button
......@@ -241,6 +181,7 @@ export default {
cart_id_list: [],
mc: '',
pricecolor:'',
secondary: '',
checkCount: 0,
msg: {
......@@ -249,7 +190,9 @@ export default {
Name: ''
},
u:{},
showAuth:false
showAuth:false,
IsEducation:0,//1是0否是网课模式
item_r:0,//课程模式下的宽度
};
},
created() {},
......@@ -261,13 +204,25 @@ export default {
this.navHeight = this.$navHeight - 2;
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor;
this.cstyle = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').cat_style : [];
this.IsEducation = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation :0;
let windowWidth = this.$utils.SystemInfo().windowWidth;
this.item_r = (windowWidth - 5-40-116-15-10)+'px'
if (this.cstyle.cat_style == '4') {
}
},
onShow(){
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
}else{
this.init();
}
},
mounted() {
let currentPages = getCurrentPages();
......@@ -285,16 +240,7 @@ export default {
uni.setNavigationBarTitle({
title: this.pageTitle
});
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
}else{
this.init();
}
},
methods: {
......@@ -315,6 +261,10 @@ export default {
init() {
uni.showNavigationBarLoading();
this.isloading=true;
this.IsEducation=1
if(this.IsEducation==1){
this.msg.GoodsClassify=2
}
this.request2(
{
url: '/api/AppletOrder/GetGoodsShoppingCartPageList',
......@@ -351,32 +301,7 @@ export default {
uni.hideNavigationBarLoading();
}
);
// this.request(
// {
// url: '',
// header: h,
// data: {
// r: 'api/cart/list'
// }
// },
// res => {
// uni.hideNavigationBarLoading();
// this.isloading = false;
// if (res.data.list.length > 0) {
// let list = res.data.list;
// list.forEach(x => {
// x.checked = false;
// x.goods_list.forEach(j => {
// j.checked = false;
// });
// });
// this.list = list;
// } else {
// this.list = [];
// }
// }
// );
},
clickcheckbox(checked, price, index, i) {
......@@ -440,6 +365,7 @@ export default {
this.TotalPrice = parseFloat(this.TotalPrice.toFixed(2));
},
mch_SelectAll(checked, i) {
console.log(checked,'checked')
if (checked == true) {
let add_cartlist = [];
let new_statusnum = 0;
......@@ -602,26 +528,7 @@ export default {
}
);
// this.request(
// {
// url: '',
// method: 'POST',
// header: h,
// data: {
// r: 'api/cart/delete',
// cart_id_list: JSON.stringify(this.cart_id_list)
// }
// },
// res => {
// this.init();
// this.TotalPrice = 0;
// this.editType = false;
// this.allchecked = false;
// this.checkCount = 0;
// uni.hideNavigationBarLoading();
// }
// );
} else {
uni.showToast({
title: '请选择需要删除的商品',
......@@ -661,9 +568,16 @@ export default {
forms=good;
console.log("forms",forms)
});
uni.navigateTo({
url: '/pages/order-submit/order-submit?formData=' + encodeURIComponent(JSON.stringify(forms))+'&IsFormShoppingCart=1&ShoppingCartIdList='+JSON.stringify(ShoppingCartIdList)
});
if(this.IsEducation!=1){
uni.navigateTo({
url: '/pages/order-submit/order-submit?formData=' + encodeURIComponent(JSON.stringify(forms))+'&IsFormShoppingCart=1&ShoppingCartIdList='+JSON.stringify(ShoppingCartIdList)
});
}else if(this.IsEducation==1){
uni.navigateTo({
url: '/pages/school/course-submit?DetailList=' + encodeURIComponent(JSON.stringify(forms.DetailList))+'&IsFormShoppingCart=1&ShoppingCartIdList='+JSON.stringify(ShoppingCartIdList)
});
}
} else {
uni.showToast({
title: '请选择购买商品',
......@@ -795,4 +709,20 @@ export default {
margin-right: 5rpx;
border-radius: 4px;
}
.cartStyle .item-r{
display: flex;flex-direction: column;justify-content: space-between;width: 440rpx;height: 150rpx;margin-left: 20rpx;
}
.cartStyle .item-r-n{
font-size: 26rpx;width: 440rpx;
overflow: hidden; white-space: nowrap;text-overflow: ellipsis;
}
.cartStyle .item-r-n2{
font-size: 26rpx;width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>
......@@ -95,13 +95,13 @@
</view>
</view>
<view class="filed" style="margin-top: 20px;" >
<view class="left">优惠</view>
<view class="left">优惠券优惠</view>
<view class="right">
<text class="price" :style="{ color: pricecolor }">-{{ couponPrice.toFixed(2) }}</text>
</view>
</view>
<view class="filed" style="margin-top: 20px;" >
<view class="left">课程卡优惠</view>
<view class="left">学习卡优惠</view>
<view class="right">
<text class="price" :style="{ color: pricecolor }">-{{ EducationMoney.toFixed(2) }}</text>
</view>
......@@ -264,6 +264,12 @@
if (option.DetailList) {
this.formdata.DetailList = JSON.parse(decodeURIComponent(option.DetailList));
}
if (option.IsFormShoppingCart) {
this.IsFormShoppingCart = option.IsFormShoppingCart;
}
if (option.ShoppingCartIdList) {
this.ShoppingCartIdList = JSON.parse(option.ShoppingCartIdList);
}
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor;
......
......@@ -2,20 +2,18 @@
<view class="courseContent">
<view class="course-top">
<!-- <video id="myVideo" :src="selectcourse.FilePath"
@error="videoErrorCallback" controls></video> -->
<video id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20181126-lite.m4v"
@error="videoErrorCallback" controls duration='70'></video>
<video id="myVideo" v-if="selectcourse.Type==1" :src="selectcourse.FilePath"
@error="videoErrorCallback" controls duration='selectcourse.VideoTime'></video>
</view>
<view class="course-t">
<view class="course-t-item">
<button open-type="share" class="course-t-item">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fengx.png" class="share-icon" />
<text>分享</text>
</view>
</button>
<view class="course-t-item" @click="setFavorite">
<u-icon :name="favorite ? 'like' : 'like-o'" size="44" :color="favorite ? mc : '#333'"></u-icon>
<!-- <u-icon name="like-o" size="44" style='margin-bottom: 12rpx;'></u-icon> -->
<u-icon :name="favorite ? 'like' : 'like-o'" size="44" :color="favorite ? pricecolor : '#333'"></u-icon>
<text>收藏</text>
</view>
<view class="course-t-item">
......
......@@ -63,7 +63,7 @@
</view>
<view class="g-price-box">
<view class="left">
<view class="price u-skeleton-rect" >
<view class="price u-skeleton-rect" v-if=" g.price!=0" >
<text class="small" :style="{ color: pricecolor }">¥</text>
<text
class="numfont" :style="{ color: pricecolor }"
......@@ -185,22 +185,26 @@
</view>
<view class="actionsheet" >
<view style="display: flex;flex-direction: row;align-items: center;">
<view class="price-btn " :style="{ color: pricecolor }" >
<view class="price-btn " :style="{ color: pricecolor }" v-if="g.price!=0">
<text style="font-size: 11px;" ></text>
<text style="font-family: oswald; font-weight: unset;font-size: 20px;">{{ g.price }}</text>
</view>
<view class="price-btn " v-if="g.price==0">免费课程</view>
</view>
<view style="display: flex;flex-direction: row;align-items: center;font-size: 14px;">
<view style="width: 22px; margin: auto;margin-right: 15px;" @click="setFavorite"><u-icon :name="g.favorite ? 'like' : 'like-o'" size="44" :color="g.favorite ? mc : '#333'"></u-icon></view>
<view class="gwuche" :style="{'border':'1px solid'+mc}" @click="joinCar()">
<view style="width: 22px; margin: auto;margin-right: 15px;" @click="setFavorite"><u-icon :name="g.favorite ? 'like' : 'like-o'" size="44" :color="g.favorite ? pricecolor : '#333'"></u-icon></view>
<view class="gwuche" :style="{'border':'1px solid'+mc}" @click="joinCar()" v-if="g.price!=0 && g.is_pay==false && g.is_orders==false">
<text :style="{color:mc}">加入购物车</text>
</view>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==true'>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==true && g.price!=0'>
<text style="color: #fff;" >去支付</text>
</view>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==false' @click="goSettlement">
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==false && g.price!=0' @click="goSettlement">
<text style="color: #fff;" >立即购买</text>
</view>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.price==0||g.is_pay==true' >
<text style="color: #fff;" >学习中心</text>
</view>
</view>
</view>
......@@ -549,7 +553,6 @@ export default {
icon: 'success',
duration: 2000
});
this.popupClose();
}
);
},
......
......@@ -3,7 +3,7 @@ export default {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com"
Vue.prototype.host2 = "http://192.168.1.9:8088"
Vue.prototype.host2 = "http://192.168.1.5:8088"
// Vue.prototype.host2 = "http://192.168.1.21"
// Vue.prototype.host2 = "http://192.168.1.27:8200"
Vue.prototype.request = function(param, success, failed) {
......
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