未登录

This commit is contained in:
THK3121 2023-09-13 18:34:11 +08:00
parent ae3c054e5a
commit 8781beeff8
3 changed files with 487 additions and 333 deletions

View File

@ -28,7 +28,8 @@
<view class='bottom flex'> <view class='bottom flex'>
<text class='item' @click='close'>随便逛逛</text> <text class='item' @click='close'>随便逛逛</text>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<button class="item grant" hover-class="none" @tap="getUserProfile"><text class="text">去授权</text></button> <button class="item grant" hover-class="none" @tap="getUserProfile"><text
class="text">去授权</text></button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<button class="item grant" @tap="toWecahtAuth"> <button class="item grant" @tap="toWecahtAuth">
@ -55,12 +56,22 @@
getLogo, getLogo,
commonAuth commonAuth
} from '../api/public'; } from '../api/public';
import { LOGO_URL, USER_INFO, EXPIRES_TIME } from '../config/cache'; import {
import { mapGetters } from 'vuex'; LOGO_URL,
USER_INFO,
EXPIRES_TIME
} from '../config/cache';
import {
mapGetters
} from 'vuex';
import Routine from '../libs/routine'; import Routine from '../libs/routine';
import { configMap } from '@/utils/index'; import {
configMap
} from '@/utils/index';
import Auth from '../libs/wechat'; import Auth from '../libs/wechat';
import { toLogin } from '../libs/login'; import {
toLogin
} from '../libs/login';
// #ifdef MP // #ifdef MP
import editUserModal from '@/components/eidtUserModal/index.vue' import editUserModal from '@/components/eidtUserModal/index.vue'
// #endif // #endif
@ -198,7 +209,10 @@
if (res.data.status == 200) { if (res.data.status == 200) {
let time = res.data.result.expires_time - Cache.time(); let time = res.data.result.expires_time - Cache.time();
self.$store.commit('UPDATE_USERINFO', res.data.result.user); self.$store.commit('UPDATE_USERINFO', res.data.result.user);
self.$store.commit('LOGIN', { token: res.data.result.token, time: time }); self.$store.commit('LOGIN', {
token: res.data.result.token,
time: time
});
self.$store.commit('SETUID', res.data.result.user.uid); self.$store.commit('SETUID', res.data.result.user.uid);
Cache.set(EXPIRES_TIME, res.data.result.expires_time, time); Cache.set(EXPIRES_TIME, res.data.result.expires_time, time);
Cache.set(USER_INFO, res.data.result.user, time); Cache.set(USER_INFO, res.data.result.user, time);

View File

@ -256,6 +256,71 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 多规格购物车 -->
<view class="" style="z-index: 9999;">
<u-popup :show="showcartpop" @close="closecartpop" @open="opencartpop">
<view class="sku">
<view class="sku_head">
<view class="sku_head_l">
<u--image :showLoading="true" src="/static/images/BG.png" width="200.09rpx"
height="200.09rpx"></u--image>
</view>
<view class="sku_head_r">
<view class="sku_goods_tit">
fsdfsdfsdfffffffff
</view>
<view class="">
<view class="sku_goods_price">
79.00
</view>
<view class="sku_goods_num">
库存:999
</view>
</view>
</view>
</view>
<view class="sku_size">
<view class="">
尺码
</view>
<view class="">
<text>大号</text>
</view>
</view>
<view class="sku_num">
<view class="">
数量
</view>
<view class="">
<u-number-box v-model="skuNumber" @change="valChange"></u-number-box>
</view>
</view>
<view class="skuaddcart">
加入购物车
</view>
</view>
</u-popup>
</view>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse">
</authorize>
<view class="" :style="`height:${appInfo.bottom}px;background-color:white`"> <view class="" :style="`height:${appInfo.bottom}px;background-color:white`">
</view> </view>
</view> </view>
@ -285,17 +350,26 @@
import { import {
postCartAdd, postCartAdd,
} from '@/api/store.js'; } from '@/api/store.js';
import authorize from '@/components/Authorize';
import {
mapGetters
} from "vuex";
export default { export default {
components: {
authorize,
},
data() { data() {
let src = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/13'; let src = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/13';
return { return {
skuNumber: 0,
showcartpop: false,
trnList: [], trnList: [],
act_cart: false, act_cart: false,
appInfo: {}, appInfo: {},
pocls: "", pocls: "",
type: "", type: "",
act_swiper: "", act_swiper: "",
current: 1, current: 3,
goodsNum: 0, goodsNum: 0,
goodsList: [], goodsList: [],
isEmpty: false, isEmpty: false,
@ -316,6 +390,7 @@
page_num: 1, page_num: 1,
act_img: "", act_img: "",
cartTagInfo: {}, cartTagInfo: {},
isAuto: false,
actList: [{ actList: [{
tit: '综合', tit: '综合',
act: "", act: "",
@ -332,9 +407,14 @@
}], }],
status: "loadmore", status: "loadmore",
flag: false, flag: false,
isShowAuth: false, //
} }
}, },
computed: {
...mapGetters(['isLogin', 'viewColor', 'uid']),
},
// ...mapGetters(['isLogin', 'viewColor', 'uid']),
onLoad(e) { onLoad(e) {
// this.cartFn() // this.cartFn()
this.appInfo = this.$appInfo.safeAreaInsets this.appInfo = this.$appInfo.safeAreaInsets
@ -434,6 +514,23 @@
// }, // },
methods: { methods: {
valChange(e) {
this.valChange = e
},
closecartpop() {
this.showcartpop = false
},
opencartpop() {
this.showcartpop = true
},
//
authColse: function(e) {
this.isShowAuth = e;
},
onLoadFun() {
this.isShowAuth = false;
},
clickSwiperFn(i) { clickSwiperFn(i) {
// console.log(i) // console.log(i)
this.current = i this.current = i
@ -528,6 +625,14 @@
}, },
addcart(item, i) { addcart(item, i) {
// this.showcartpop = true
// return
// console.log(this.isLogin)
if (!this.isLogin) {
this.isAuto = true;
this.isShowAuth = true
return
}
let data = { let data = {
cart_num: 1, cart_num: 1,
@ -635,6 +740,39 @@
} }
} }
.sku {
padding: 20rpx;
.sku_head {
display: flex;
.sku_head_r {
margin-left: 20rpx;
display: flex;
justify-content: space-between;
flex-direction: column;
}
// justify-content;
}
.sku_num {
display: flex;
justify-content: space-between;
}
.skuaddcart {
width: 50vw;
background-color: #FEAB00;
margin: 0 auto;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: white;
border-radius: 80rpx;
}
}
.flags { .flags {
background-color: red; background-color: red;
z-index: 99999999; z-index: 99999999;
@ -958,7 +1096,7 @@
.card { .card {
width: 720rpx; width: 720rpx;
z-index: 999999; z-index: 99;
// margin:auto; // margin:auto;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);

View File

@ -319,6 +319,8 @@
}, },
onLoad(options) { onLoad(options) {
// uni.hideTabBar() // uni.hideTabBar()
// console.log(this.isLogin, "sdfsdkfhjsdhgfsdf")
// return
this.id = options.id; this.id = options.id;
this.type = options.gtype this.type = options.gtype