Commit 8cd15b73 authored by zhangjianguo's avatar zhangjianguo

解决冲突

parents d638243e 66a45744
<template> <template>
<div class="auth-page"> <div class="auth-page">
<u-popup v-model="showDialog" mode="center" custom-style="padding:0;background:none;"> <u-popup v-model="showDialog" mode="center" :mask-close-able="false" custom-style="padding:0;background:none;">
<img :src="pageinfo.pic_url" mode="widthFix" /> <img :src="pageinfo.pic_url" mode="widthFix" />
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="getUserInfo"></button> <button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="getUserInfo"></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button> <button :style="cancelStyle" class="hotsopt" @click="close"></button>
...@@ -28,6 +28,7 @@ export default { ...@@ -28,6 +28,7 @@ export default {
methods: { methods: {
getUserInfo(e) { getUserInfo(e) {
var that = this; var that = this;
that.showDialog=true;
uni.getProvider({ uni.getProvider({
service: 'oauth', service: 'oauth',
success: function(res) { success: function(res) {
...@@ -70,6 +71,7 @@ export default { ...@@ -70,6 +71,7 @@ export default {
}); });
}, },
close() { close() {
this.showDialog=false;
this.$emit('gbAuth'); this.$emit('gbAuth');
}, },
//调用获取code //调用获取code
......
<template> <template>
<view <view class="actionsheet" :style="{ 'padding-bottom': bian ? '28px' : '0px' }">
class="actionsheet"
:style="{ 'padding-bottom': bian ? '28px' : '0px' }"
>
<view class="item" style="width:36px;" @click="goCart"> <view class="item" style="width:36px;" @click="goCart">
<view style="width: 22px; margin: auto;"> <view style="width: 22px; margin: auto;"><u-icon name="cart-o" size="44" :color="mc"></u-icon></view>
<u-icon name="cart-o" size="44" :color="mc"></u-icon> <text class="text" :style="{ color: mc }">购物车</text>
</view>
<text class="text" :style="{'color':mc}">购物车</text>
</view> </view>
<view class="item"> <view class="item">
<view style="width: 22px; margin: auto;"> <view style="width: 22px; margin: auto;"><u-icon name="chat-o" size="44" color="#333"></u-icon></view>
<u-icon name="chat-o" size="44" color="#333"></u-icon>
</view>
<text class="text">客服</text> <text class="text">客服</text>
<button <button open-type="contact" :send-message-title="goodName" :send-message-path="path" :send-message-img="g.coverPic" :show-message-card="true">0</button>
open-type="contact"
:send-message-title="goodName"
:send-message-path="path"
:send-message-img="g.coverPic"
:show-message-card="true"
>
0
</button>
</view> </view>
<view class="item" @click="setFavorite"> <view class="item" @click="setFavorite">
<view style="width: 22px; margin: auto;"> <view style="width: 22px; margin: auto;"><u-icon :name="favorStatus ? 'like' : 'like-o'" size="44" :color="favorStatus ? mc : '#333'"></u-icon></view>
<u-icon
:name="favorStatus ? 'like' : 'like-o'"
size="44"
:color="favorStatus ? mc : '#333'"
></u-icon>
</view>
<text class="text">收藏</text> <text class="text">收藏</text>
</view> </view>
<view class="item2"> <view class="item2">
<view style="flex: 1;"> <view style="flex: 1;"><u-button @click="joinCar" :ripple="true" :hair-line="false" :custom-style="btn1">加入购物车</u-button></view>
<u-button <view style="flex: 1;"><u-button @click="buy" :ripple="true" :hair-line="false" :custom-style="btn2">立即购买</u-button></view>
@click="joinCar"
:ripple="true"
:hair-line="false"
:custom-style="btn1"
>加入购物车</u-button
>
</view>
<view style="flex: 1;">
<u-button
@click="buy"
:ripple="true"
:hair-line="false"
:custom-style="btn2"
>立即购买</u-button
>
</view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "../../components/auth/index.vue";
export default { export default {
props: ["coverPic", "goodName", "favorite", "goodId"], props: ['coverPic', 'goodName', 'favorite', 'goodId'],
data() { data() {
return { return {
mc: "", mc: '',
fu: "", fu: '',
bian: false, bian: false,
btn1: { btn1: {
flex: 1, flex: 1,
height: "100%", height: '100%',
borderRadius: "40px 0 0 40px", borderRadius: '40px 0 0 40px',
border: "none", border: 'none',
color: "#FFF", color: '#FFF',
fontSize: "13px", fontSize: '13px',
width: "100%", width: '100%'
}, },
btn2: { btn2: {
flex: 1, flex: 1,
height: "100%", height: '100%',
borderRadius: "0 40px 40px 0", borderRadius: '0 40px 40px 0',
border: "none", border: 'none',
color: "#FFF", color: '#FFF',
fontSize: "13px", fontSize: '13px',
width: "100%", width: '100%'
}, },
path: "", path: '',
favorStatus: false, favorStatus: false,
//是否显示登陆
showAuth: false,
u: {}
}; };
}, },
components: {
auth
},
mounted() { mounted() {
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.fu = this.$uiConfig.secondary; this.fu = this.$uiConfig.secondary;
...@@ -94,38 +65,63 @@ export default { ...@@ -94,38 +65,63 @@ export default {
this.btn1.background = this.fu; this.btn1.background = this.fu;
this.btn2.background = this.mc; this.btn2.background = this.mc;
let t = getCurrentPages(); let t = getCurrentPages();
this.path = "/" + t[t.length - 1].route; this.path = '/' + t[t.length - 1].route;
//console.log(t[t.length - 1]); //console.log(t[t.length - 1]);
this.favorStatus = this.favorite; this.favorStatus = this.favorite;
}, },
methods: { methods: {
goCart(){ goCart() {
uni.redirectTo({ uni.redirectTo({
url: '/pages/cart/cart' url: '/pages/cart/cart'
}); });
}, },
setFavorite() { setFavorite() {
let h=this.apiheader() this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
this.request2( this.request2(
{ {
url: '/api/AppletUser/SetUserCollectionInfo', url: '/api/AppletUser/SetUserCollectionInfo',
data: { data: {
GoodsId:this.goodId GoodsId: this.goodId
} }
}, },
(res) => { res => {
this.favorStatus = !this.favorStatus; this.favorStatus = !this.favorStatus;
} }
); );
}
}, },
joinCar() { joinCar() {
this.$emit("join-car"); this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
this.$emit('join-car');
}
}, },
buy() { buy() {
this.$emit("buy"); this.$emit('buy');
}, },
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
this.showAuth = false;
}, },
//关闭登录窗口
gbAuth(){
this.showAuth=false;
}
}
}; };
</script> </script>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
:safeAreaInsetBottom="true" :safeAreaInsetBottom="true"
@close="popupClose" @close="popupClose"
:z-index="9999" :z-index="9999"
close-icon="cross" close-icon="close"
> >
<view class="goodsku"> <view class="goodsku">
<view class="goods"> <view class="goods">
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
</view> </view>
<view class="amount">库存 {{ goodamount }} {{ g.unit }}</view> <view class="amount">库存 {{ goodamount }} {{ g.unit }}</view>
<view class="sku">{{ skuObj ? '已选择' : '选择' }} {{ sku }}</view> <view class="sku">{{ skuObj ? '已选择' : '选择' }} {{ sku }}</view>
<view class="sku_close">
<u-icon name="cross" color="#9F9F9F" @click="cloGood()" size="40"/>
</view>
</view> </view>
</view> </view>
<view class="sku-box"> <view class="sku-box">
...@@ -138,7 +141,6 @@ export default { ...@@ -138,7 +141,6 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log("good",this.good)
this.request2( this.request2(
{ {
url: '/api/AppletGoods/GetAppletGoodsInfo', url: '/api/AppletGoods/GetAppletGoodsInfo',
...@@ -147,7 +149,6 @@ export default { ...@@ -147,7 +149,6 @@ export default {
} }
}, },
res => { res => {
console.log(res, 'resssssss');
this.g = res.data.goods; this.g = res.data.goods;
this.goodimage = this.g.cover_pic; this.goodimage = this.g.cover_pic;
...@@ -195,7 +196,6 @@ export default { ...@@ -195,7 +196,6 @@ export default {
}, },
methods: { methods: {
joinCar() { joinCar() {
console.log(this.skuObj,'skuObjj');
if (this.skuObj && this.skuObj.id) { if (this.skuObj && this.skuObj.id) {
this.request2( this.request2(
{ {
...@@ -225,24 +225,38 @@ export default { ...@@ -225,24 +225,38 @@ export default {
} }
}, },
buy() { buy() {
let ShoppingCartIdList=[];
if (this.skuObj && this.skuObj.id) { if (this.skuObj && this.skuObj.id) {
let good = {
DetailList: [],
Use_Integral: 0,
User_Coupon_Id: 0,
DeliveryMethod:0,
AddressId:0,
};
let g = { let g = {
id: this.skuObj.goods_id, GoodsId: this.skuObj.goods_id,
num: this.gc, Number: this.gc,
cart_id: 0, SpecificationSort: this.skuObj.sign_id,
goods_attr_id: this.skuObj.id,
attr: []
}; };
this.skuObj.attr_list.forEach(x => { good.DetailList.push(g);
g.attr.push({ // let g = {
attr_id: x.attr_id, // id: this.skuObj.goods_id,
attr_group_id: x.attr_group_id // num: this.gc,
}); // cart_id: 0,
}); // goods_attr_id: this.skuObj.id,
this.forms.list[0].goods_list.push(g); // attr: []
this.forms.list[0].mch_id = this.g.mch_id; // };
// this.skuObj.attr_list.forEach(x => {
// g.attr.push({
// attr_id: x.attr_id,
// attr_group_id: x.attr_group_id
// });
// });
// this.forms.list[0].goods_list.push(g);
// this.forms.list[0].mch_id = this.g.mch_id;
uni.navigateTo({ uni.navigateTo({
url: '/pages/order-submit/order-submit?formData=' + encodeURIComponent(JSON.stringify(this.forms)), url: '/pages/order-submit/order-submit?formData=' + encodeURIComponent(JSON.stringify(good))+'&IsFormShoppingCart=2&ShoppingCartIdList='+JSON.stringify(ShoppingCartIdList),
complete(res) { complete(res) {
console.log(res); console.log(res);
} }
...@@ -256,7 +270,8 @@ export default { ...@@ -256,7 +270,8 @@ export default {
}); });
} }
}, },
close() { //关闭弹窗
cloGood() {
this.popupClose(); this.popupClose();
}, },
clickSkuItemHandler(index, groupRow) { clickSkuItemHandler(index, groupRow) {
...@@ -406,6 +421,12 @@ export default { ...@@ -406,6 +421,12 @@ export default {
margin-left: 15px; margin-left: 15px;
flex: 1; flex: 1;
width: 1px; width: 1px;
position: relative;
}
.goodsku .chosen-info .sku_close{
position: absolute;
right: 4px;
top: 5px;
} }
.goodsku .goods .chosen-info .price { .goodsku .goods .chosen-info .price {
font-size: 24px; font-size: 24px;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<img :src="u.avatarUrl" /> <img :src="u.avatarUrl" />
<div class="text">{{u.nickName}}</div> <div class="text">{{u.nickName}}</div>
</div> </div>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</div> </div>
</template> </template>
...@@ -35,6 +35,10 @@ export default { ...@@ -35,6 +35,10 @@ export default {
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false this.showAuth=false
},
//关闭登录窗口
gbAuth(){
this.showAuth=false;
} }
} }
}; };
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
@confirm="confirm" @confirm="confirm"
></u-modal> ></u-modal>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view> </view>
</template> </template>
...@@ -167,8 +167,9 @@ export default { ...@@ -167,8 +167,9 @@ export default {
this.showAuth = false; this.showAuth = false;
this.init(); this.init();
}, },
goback(){ //关闭登录窗口
uni.navigateBack() gbAuth(){
this.showAuth=false;
}, },
isdefault(item) { isdefault(item) {
//设置默认地址 //设置默认地址
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</view> </view>
<!-- 取消提示 --> <!-- 取消提示 -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view> </view>
</template> </template>
...@@ -193,8 +193,9 @@ export default { ...@@ -193,8 +193,9 @@ export default {
this.showAuth=false; this.showAuth=false;
this.init(); this.init();
}, },
goback(){ //关闭登录窗口
uni.navigateBack() gbAuth(){
this.showAuth=false;
}, },
godetails(item){ godetails(item){
if(this.msg.UseState ==0){ if(this.msg.UseState ==0){
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</view> </view>
</template> </template>
<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>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view> </view>
</template> </template>
...@@ -174,7 +174,6 @@ ...@@ -174,7 +174,6 @@
res => { res => {
uni.hideLoading(); uni.hideLoading();
if(res.resultCode==1){ if(res.resultCode==1){
this.goodslist = this.goodslist.concat(res.data.pageData); this.goodslist = this.goodslist.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if (this.page_count == 1) { if (this.page_count == 1) {
...@@ -199,8 +198,9 @@ ...@@ -199,8 +198,9 @@
this.showAuth=false; this.showAuth=false;
this.init(); this.init();
}, },
goback(){ //关闭登录窗口
uni.navigateBack() gbAuth(){
this.showAuth=false;
}, },
clickHandler(cx) { clickHandler(cx) {
uni.navigateTo({ uni.navigateTo({
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</scroll-view> </scroll-view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
<view class="loading" v-show="loading"> <view class="loading" v-show="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>
...@@ -255,8 +255,9 @@ ...@@ -255,8 +255,9 @@
this.showAuth=false; this.showAuth=false;
this.init(); //成功之后调取接口 this.init(); //成功之后调取接口
}, },
goback(){ //关闭登录窗口
uni.navigateBack() gbAuth(){
this.showAuth=false;
}, },
change(index) { change(index) {
this.current = index; this.current = index;
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<view class="label">选择</view> <view class="label">选择</view>
<view class="content"> <view class="content">
<view class="sku-chosen" @click="chosenSku"> <view class="sku-chosen" @click="chosenSku">
<view class="sku">{{ currentSku ? "已" : "" }}选择 {{ sku }} </view> <view class="sku">{{ currentSku.attr_list.length>0 ? "已" : "请" }}选择 {{ sku }} </view>
<view class="arrow"> <view class="arrow">
<u-icon name="arrow" :size="32" color="#111"></u-icon> <u-icon name="arrow" :size="32" color="#111"></u-icon>
</view> </view>
......
...@@ -221,7 +221,7 @@ export default { ...@@ -221,7 +221,7 @@ export default {
goodData: [], goodData: [],
showGoodList: false, showGoodList: false,
DetailList: [], DetailList: [],
IsFormShoppingCart: 1, IsFormShoppingCart: 2,
adressInfo: {}, adressInfo: {},
payInfo: { payInfo: {
OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc', OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc',
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
OrderPayType: 1, OrderPayType: 1,
GoodsName: '' GoodsName: ''
}, },
ShoppingCartIdList: [6, 5] ShoppingCartIdList: []
}; };
}, },
onLoad(option) { onLoad(option) {
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<!-- 取消提示 --> <!-- 取消提示 -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view> </view>
</template> </template>
...@@ -173,9 +173,10 @@ export default { ...@@ -173,9 +173,10 @@ export default {
this.showAuth=false; this.showAuth=false;
this.init(); this.init();
}, },
goback(){ //关闭登录窗口
uni.navigateBack() gbAuth(){
}, this.showAuth=false;
}
}, },
}; };
</script> </script>
......
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