Commit d69e5f3a authored by 贾慧斌's avatar 贾慧斌

fix: uniapp 转换脚本开发

parent a8684eeb
......@@ -21,3 +21,4 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*
/source
<template>
<div id="app" ref="rootApp">
<cr-nav-bar v-if="header" :title="title" left-text="" @click-left="backFun" />
<div class="app">
<keep-alive :max="15" :include="keepAliveMap">
<router-view />
</keep-alive>
</div>
<cr-tabbar
v-if="tabBar"
v-model="router"
inactive-color="#000"
class="tab-bar"
@change="handleTabBar"
>
<cr-tabbar-item :icon="homeIcon">精选</cr-tabbar-item>
<cr-tabbar-item :icon="memberIcon">会员</cr-tabbar-item>
<cr-tabbar-item :badge="cartCount || undefined" :icon="cartIcon">购物车</cr-tabbar-item>
<cr-tabbar-item :icon="userIcon">我的</cr-tabbar-item>
</cr-tabbar>
<div v-if="loading" class="loading-container">
<cr-loading class="loading" size="24px">加载中...</cr-loading>
</div>
<net-error />
<LoginAuthorize />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import NetError from '@/components/NetError';
import LoginAuthorize from '@/components/loginAuthorize/index.vue';
import localStorage from '@/service/localStorage.service';
import TMDConfig from '@/customize/tmd-config';
import {
mapGetters as ShopCartMapGetters,
mapActions as ShopCartMapActions
} from '@/views/shopCart/shopCartModules.js';
const homeSelected = 'https://img.lkbang.net/home-cur.47903e4ae9d08c4e.47903e4a.png';
const homeIcon = 'https://img.lkbang.net/home.7d4f65b0d01fba.7d4f65b0.png';
const cartSelected = 'https://img.lkbang.net/cart-cur.08b92b167a8592.08b92b16.png';
const cartIcon = 'https://img.lkbang.net/cart.4040b7d6f3c3a5a.4040b7d6.png';
const userSelected = 'https://img.lkbang.net/user-cur.e46c0ec5a4b27d16a.e46c0ec5.png';
const userIcon = 'https://img.lkbang.net/user.27bd25d441abd27.27bd25d4.png';
const memberIconSelected = 'https://img.lkbang.net/member_incon_selected.a48af1f5.png';
const memberIcon = 'https://img.lkbang.net/member_icon.b566de02.png';
/**
* vuex管理登陆状态,具体可以参考官方登陆模板示例
*/
import { mapMutations, mapActions } from "vuex";
import request from "./utils/request";
import SMSdk from "./utils/shumei";
import { onLaunchSubmit } from "@/utils/subscribe";
import cfg from "@/config/index";
import appIdMap from "@/config/appId.config";
import config from "@/config/config.json";
import { saTrackEvent } from "@/utils/sa.js";
import { param2Obj } from "@/utils/index";
import { uploadSMDeviceID } from "@/api/home.api";
export default {
name: 'App',
components: {
NetError,
LoginAuthorize
},
data() {
return {
router: 0,
configTmd: ''
};
},
computed: {
...ShopCartMapGetters(['cartCount']),
...mapGetters(['title', 'header', 'loading', 'tabBar', 'routeIdx', 'keepAliveMap']),
homeIcon() {
return this.routeIdx === 0 ? homeSelected : homeIcon;
},
memberIcon() {
return this.routeIdx === 1 ? memberIconSelected : memberIcon;
globalData: {
...config
},
cartIcon() {
return this.routeIdx === 2 ? cartSelected : cartIcon;
methods: {
...mapMutations(["login"]),
...mapActions({
setGDTVID: "setGDTVID"
})
},
userIcon() {
return this.routeIdx === 3 ? userSelected : userIcon;
SMSdk,
onLaunch: async function() {
let appId;
const smDeviceId = await SMSdk.SMSdk.getDeviceId();
console.log("smDeviceId = ", smDeviceId);
uni.setStorageSync("smDeviceId", smDeviceId || "");
if (smDeviceId) {
const [shumeiKey] = await uploadSMDeviceID({
shumeiDeviceId: smDeviceId
});
console.log("shumeiKey after kdsp redis = ", shumeiKey);
if (shumeiKey) {
uni.setStorageSync("shumeiKey", shumeiKey);
}
},
watch: {
header: {
immediate: true,
handler(val, oldVal) {
if (val !== oldVal) {
document.body.className = val ? 'has-header' : '';
}
// #ifdef MP-ALIPAY
appId = uni.getAppIdSync().appId;
// #endif
// #ifndef MP-ALIPAY
const accountInfo = uni.getAccountInfoSync();
appId = accountInfo.miniProgram.appId;
// #endif
const tenantBasicInfo = appIdMap[appId] || {};
uni.setStorageSync("appId", appId);
uni.setStorageSync("tenantId", tenantBasicInfo.tenantId || 560761);
uni.setStorageSync("tenantBasicInfo", tenantBasicInfo);
tenantBasicInfo.vccChannel && uni.setStorageSync("vccChannel", tenantBasicInfo.vccChannel);
this.$ry?.init(cfg.REYUN_APP_KEY);
// todo
if (appId === "wxe16bf9293671506c" && process.env.NODE_ENV === "production") {
//wxe16bf9293671506c 测试环境appid
let [data] = await request.get("https://talos.xyqb.com/api/kdsp/miniapp/getData");
uni.setStorageSync("url", data);
} else {
uni.removeStorageSync("url");
}
let userInfo = uni.getStorageSync("userInfo") || "";
if (userInfo?.id) {
//更新登陆状态
uni.getStorage({
key: "userInfo",
success: res => {
this.login(res.data);
}
},
routeIdx: {
immediate: true,
handler(val) {
console.log('val====', val);
this.router = val;
});
}
// #ifdef MP-WEIXIN
onLaunchSubmit();
// #endif
},
tabBar: {
immediate: true,
handler(val, oldVal) {
if (val !== oldVal) {
document.body.className = val ? 'has-tab-bar' : '';
onShow: function(option) {
// #ifdef MP-WEIXIN
// 存储腾讯广告id
const { query } = option;
if (query && query.gdt_vid) {
// store存储gdt_vid以便后续登录拿到openid后使用
this.setGDTVID(query.gdt_vid);
}
//新版本更新
if (uni.canIUse("getUpdateManager")) {
//判断当前微信版本是否支持版本更新
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
if (res.hasUpdate) {
// 请求完新版本信息的回调
updateManager.onUpdateReady(function() {
uni.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?",
success: function(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
},
created() {
const config = new TMDConfig();
this.configTmd = config;
},
async mounted() {
if (localStorage.get('vccToken') && location.pathname !== '/login') {
this.queryCartCount();
}
if (localStorage.get('vccChannel') == 161085) {
this.$nextTick(() => {
// document.getElementById('#app').innerHTML = '';
this.$refs.rootApp.innerHTML =
'<div class="cr-image" style="width: 100%; height: 100%;"><img src="https://img.lkbang.net/error.19ace11d.png" style="display: block; margin: 0 auto; width: 80%; height: auto; margin-top: 20px;" class="cr-image--img" ></div>';
});
});
updateManager.onUpdateFailed(function() {
uni.showModal({
// 新的版本下载失败
title: "已经有新版本了哟~",
content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~"
});
});
}
},
methods: {
...ShopCartMapActions(['queryCartCount']),
backFun() {
this.$router.go(-1);
},
handleTabBar(idx) {
console.log('idx', idx);
const channelId = localStorage.get('vccChannel');
// console.log(location.href,"location.href",location.origin)
switch (idx) {
case 0:
this.$router.replace({ name: 'Home' });
break;
case 1:
this.$router.replace({ name: 'Member' });
// window.location.href = 'https://www.baidu.com';
break;
case 2:
if (channelId == this.configTmd.channelId.id && localStorage.get('vccPhone')) {
// console.log('jinlaile');
// 第三方进来
localStorage.get('vccToken')
? this.$router.replace({ name: 'Cart' })
: this.$router.replace({ name: 'LoginMiddle', query: { backUrl: location.href } });
} else {
// 之前逻辑
localStorage.get('vccToken')
? this.$router.replace({ name: 'Cart' })
: this.$router.replace({ name: 'Login', query: { backUrl: location.href } });
}
break;
case 3:
if (channelId == this.configTmd.channelId.id && localStorage.get('vccPhone')) {
// 第三方进来
localStorage.get('vccToken')
? this.$router.replace({ name: 'User' })
: this.$router.replace({ name: 'LoginMiddle', query: { backUrl: location.href } });
});
} else {
// 之前逻辑
this.$router.replace({ name: 'User' });
}
break;
uni.showModal({
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
title: "提示",
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
});
}
// #endif
uni.onAppShow(obj => {
const TPL_TITLE = "tplTitle";
const tplTitle = param2Obj(obj.path)[TPL_TITLE] || obj.query[TPL_TITLE];
if ((obj.scene === 1014 || obj.scene === 1107) && tplTitle) {
saTrackEvent("MINI_SubscribeMessageCardBtnClick", {
cards_name: tplTitle
});
}
});
},
onHide: function() {
console.log("App Hide");
}
};
</script>
<style lang="less">
@import './style/index';
.app {
user-select: none;
<style lang="scss">
@import "@/style/icon.scss";
@import "@/style/uni-ui.scss";
page {
background: $page-color-base;
height: 100%;
min-height: 100%;
position: relative;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.loading-container {
/* #ifdef MP-ALIPAY */
/* width: 100%;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
display: flex;
justify-content: center;
align-items: center;
.loading {
padding: 6px;
border-radius: 6px;
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
@{deep} .cr-loading--text {
color: #fff;
}
}
bottom: 0; */
/* #endif */
}
.tab-bar {
position: relative;
padding-top: 10px !important;
view,
scroll-view,
swiper,
swiper-item,
cover-view,
cover-image,
icon,
text,
rich-text,
progress,
button,
checkbox,
form,
input,
label,
radio,
slider,
switch,
textarea,
navigator,
audio,
camera,
image,
video {
box-sizing: border-box;
z-index: 11;
height: calc(@tab-bar-height + constant(safe-area-inset-bottom));
height: calc(@tab-bar-height + env(safe-area-inset-bottom));
align-items: flex-start !important;
.cr-icon {
display: block;
height: 24px;
}
/* 骨架屏替代方案 */
.Skeleton {
background: #f3f3f3;
padding: 20rpx 0;
border-radius: 8rpx;
}
/* 图片载入替代方案 */
.image-wrapper {
font-size: 0;
background: #f3f3f3;
border-radius: 4px;
image {
width: 100%;
height: 100%;
transition: 0.6s;
opacity: 0;
&.loaded {
opacity: 1;
}
.cr-info--badge {
padding: 0 4px;
}
&:before {
content: '';
}
.clamp {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
.common-hover {
background: #f5f5f5;
}
/*边框*/
.b-b:after,
.b-t:after {
position: absolute;
z-index: 3;
left: 0;
top: 0;
width: 100%;
height: 1px;
-webkit-transform: scaleY(0.5);
right: 0;
height: 0;
content: "";
transform: scaleY(0.5);
background-color: rgba(0, 0, 0, 0.33);
border-bottom: 1px solid $border-color-base;
}
.b-b:after {
bottom: 0;
}
.b-t:after {
top: 0;
}
/* button样式改写 */
uni-button,
button {
height: 80rpx;
line-height: 80rpx;
font-size: $font-lg + 2rpx;
font-weight: normal;
&.no-border:before,
&.no-border:after {
border: 0;
}
}
uni-button[type="default"],
button[type="default"] {
color: $font-color-dark;
}
/* input 样式 */
.placeholder {
font-size: 28rpx;
line-height: 40rpx;
color: #999999;
}
button::after {
display: none;
}
/* requestRevokeTest test */
</style>
......@@ -19,7 +19,7 @@ export const actAndCpn = data => {
return http.post(`${yxmGwHost}/api/kdsp/sku-info/detail/actAndCpn`, data);
};
// 详情图片, 通过
// 详情图片
export const getDetailPic = url => {
return http.get(url, { strategy: 'default', hideLoading: 1, skip: 1, hideToast: 1 });
};
......
......@@ -8,7 +8,7 @@
<div v-if="headerType === 'center'" class="Hl-header-center">{{ title }}</div>
<cr-image
v-if="headerType === 'image'"
src="https://img.lkbang.net/icon-recommend.465d832f185840eaa.465d832f.png"
:src="'https://img.lkbang.net/icon-recommend.465d832f185840eaa.465d832f.png' | imogr"
width="4.53rem"
height="0.96rem"
class="Hl-header-image"
......@@ -23,9 +23,8 @@
>
<div class="Hl-container-item-img">
<cr-image
v-imogr
class="Hlc-item-img"
:src="item.goods.goodsImage | Img2Thumb"
:src="item.goods.goodsOrgImage | imogr({ w: 173, h: 173 })"
lazy-load
fit="contain"
/>
......@@ -53,7 +52,7 @@
}"
{{ item.goods.discountShow.discountPrice }}</span
>
<img :src="item.goods.discountShow.icon" />
<img :src="item.goods.discountShow.icon | imogr" />
</div>
</div>
<!-- 加入购物车 -->
......@@ -348,9 +347,9 @@ export default {
border: 1px solid @border-red;
font-size: 10px;
color: @red;
border-radius: 5px;
border-radius: 3px;
padding: 2px 5px;
margin: 2px 2px 2px 0;
margin-right: 3px;
}
}
}
......
......@@ -54,7 +54,6 @@
>
<img :src="item.goods.discountShow.icon" />
</div>
<!-- <span v-if="item.goods.goodsPrice">¥{{ item.goods.goodsPrice }}</span> -->
</div>
<div class="goods-item-info-count-left-bottom">
<span>已售{{ item.goods.saleCount }}</span>
......@@ -229,7 +228,7 @@ export default {
}
}
&-info {
height: 100%;
min-height: 116px;
padding: 0 5px 5px;
box-sizing: border-box;
width: calc(100% - 110px);
......@@ -271,7 +270,7 @@ export default {
display: flex;
align-items: center;
border: 1px solid @border-red;
font-size: 8px;
font-size: 12px;
color: @red;
border-radius: 3px;
padding: 1px 3px;
......
......@@ -7,7 +7,7 @@
closeable
position="bottom"
>
<img v-imogr src="https://img.lkbang.net/tenant/yxm-logo.5h67.png" alt="" class="img" />
<img :src="'https://img.lkbang.net/tenant/yxm-logo.5h67.png' | imogr" alt="" class="img" />
<p class="yxm">羊小咩</p>
<div class="checkbox-content">
<cr-checkbox v-model="checked" icon-size="14px" shape="round" class="agreement">
......
......@@ -2,7 +2,7 @@
* @Description:
* @Date: 2021-03-31 19:59:12
* @LastEditors: gzw
* @LastEditTime: 2023-05-06 20:05:02
* @LastEditTime: 2023-05-09 11:33:27
*/
const envName = 'yxm';
const protocol = window.location.protocol;
......@@ -15,7 +15,7 @@ const kdspHost = `https://kdsp-api-${envName}.liangkebang.net`;
const kdspOpHost = `https://kdsp-operation-${envName}.liangkebang.net`;
const VCC_CHANNEL = '';
const TERMINAL = 'H5';
const VERSION = '8.9.40';
const VERSION = '8.9.80';
const SOBOT_URL =
'https://kdspstatic.91xr.cn/kdsp/mine/service/customer-service/customer-service-prod.html';
const nectarHost = `https://nectar-${envName}.liangkebang.net/`;
......
......@@ -2,7 +2,7 @@
* @Description: 根据图片来源匹配压缩
* @Date: 2021-04-26 17:47:15
* @LastEditors: gzw
* @LastEditTime: 2023-05-06 17:59:13
* @LastEditTime: 2023-05-08 19:54:55
*/
import localStorage from '@/service/localStorage.service';
const CAN_USE_WEBP = 'checkWebp';
......
// 3 main.js导入router.js并挂载
import {router,RouterMount} from './router/index';
import Vue from 'vue';
import { init as sentryInit } from '@sentry/vue';
import App from './App.vue';
import router from './router';
import store from './store';
import Bridge from '@qg/js-bridge';
// import '@/service/svg.service';
import { shuMeiInit, getSmDeviceId } from '@/service/shumei.service';
import '@/service/cherryUI.service';
import './style/index.less';
import '@/assets/svg/index';
import './style/operator.less';
import saService from '@/service/sa.service';
import lazyload from '@qg/cherry-ui/src/lazyload/index';
import { getToKen } from '@/service/userInfo.service';
import { imgMogrVue, checkWebp } from '@/filters/img2Thumb.filter';
import { replaceFavicon } from '@/service/utils.service';
import { getPublicConfig } from '@/customize';
const publicConfig = getPublicConfig();
// #ifdef H5
RouterMount(app,router,'#app')
// #endif
Vue.prototype.$track = saService;
Vue.prototype.$config = publicConfig;
Vue.prototype.$bridge = new Bridge();
Vue.use(lazyload);
Vue.use(imgMogrVue);
// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
\ No newline at end of file
getToKen();
Vue.config.productionTip = false;
replaceFavicon(publicConfig.faviconPath);
// eslint-disable-next-line prettier/prettier
(async () => {
await checkWebp();
shuMeiInit();
getSmDeviceId();
// console.log(getSmDeviceId);
})();
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
sentryInit({
Vue,
attachProps: true, // 允许Sentry上报Vue组件Props
logErrors: true, // 引入Sentry SDK后,默认不会将报错打印到控制台,将logErrors设为true强制将报错打印到控制台
dsn: 'https://0810381ba85d4b2788ddafa29078851c@sentry.q-gp.com/4',
release: 'bmall-ui@1.0.0',
tracesSampleRate: 0.5, // 上报频率, 1最大, 0最小, 建议验证设置为1, 项目运行根据情况降低频率
environment: process.env.NODE_ENV
});
}
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app');
......@@ -52,8 +52,9 @@ export default {
openNewUrl(data) {
locationHrefPatch(data.newUrl, this.$router);
},
shopCarAddGoodsNotification() {
this.queryCartCount();
shopCarAddGoodsNotification(data) {
// this.queryCartCount();
this.$store.dispatch('shopCart/saveCartCount', data.count);
},
getShuMeiId() {}
}
......
{
"pages": [
{
"path": "pages/home",
"style": {
"navigationBarTitleText": "",
"mp-alipay": {
"allowsBounceVertical": "NO"
}
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
......
......@@ -45,8 +45,7 @@
@click="handleToDetailsTrack(item, 'CategoryBrandClick', i)"
>
<cr-image
v-imogr="{ w: 48, h: 48 }"
:src="item.img | Img2Thumb"
:src="item.img | imogr({ w: 48, h: 48 })"
fit="contain"
class="category-box--brands--item__img"
/>
......
......@@ -51,7 +51,8 @@
</cr-swipe-item>
</cr-swipe>
<LoginPopup />
<loginGuide v-if="!userInfo.phoneNumber" />
<loginGuide v-if="!hasLogin" />
<transition name="fade">
<Skeleton v-if="skeletonStatus" />
</transition>
......@@ -67,6 +68,7 @@ import historyRecordMixins from '@/mixins/historyRecord.mixins';
import mxBll from './mixin/mxBll';
import { Img2Thumb } from '@/filters/img2Thumb.filter';
import Skeleton from './components/Skeleton.vue';
import { mapGetters as homeMapGetters } from 'vuex';
export default {
name: 'Home',
......@@ -94,6 +96,7 @@ export default {
};
},
computed: {
...homeMapGetters(['hasLogin']),
specialCol() {
return this.$refs.specialCol;
},
......
......@@ -2,7 +2,7 @@
<div class="container">
<div class="loginContent">
<div class="login-title" />
<img v-imogr src="https://img.lkbang.net/tenant/yxm-logo.5h67.png" alt="" class="img" />
<img :src="'https://img.lkbang.net/tenant/yxm-logo.5h67.png' | imogr" alt="" class="img" />
<p class="yxm">羊小咩</p>
<p class="life">美好生活更从容</p>
<div class="login">
......
......@@ -67,28 +67,7 @@ export default {
return {
show: false,
reasonType: '',
reasonList: [
// {
// cancelReasonType: 1,
// cancelReason: '收货地址填错了'
// },
// {
// cancelReasonType: 2,
// cancelReason: '忘记支付密码/余额不足'
// },
// {
// cancelReasonType: 3,
// cancelReason: '无法正常支付'
// },
// {
// cancelReasonType: 4,
// cancelReason: '不想买了'
// },
// {
// cancelReasonType: 5,
// cancelReason: '其他原因'
// }
],
reasonList: [],
iconAndTips: {
imageUrl: refundImageUrl,
amount: 222,
......@@ -115,9 +94,6 @@ export default {
this.$emit(EVENT_INPUT, val);
}
},
mounted() {
// this.getReasonList();
},
methods: {
handleConfirm() {
this.$emit(EVENT_INPUT, false);
......@@ -153,20 +129,8 @@ export default {
agreeContract: true
});
if (res) {
// if (this.orderInfo.skuList[0].skuSource === 2) {
// this.$router.push({
// path: '/refundKepler',
// query: { orderNo: this.orderInfo.orderNo, refundAmount: this.orderInfo.totalFee }
// });
// } else {
// this.$toast('已取消');
// }
this.isSuccess = true;
this.iconAndTips = res.iconAndTips;
// this.$toast('已取消');
// this.$emit(EVENT_INPUT, false);
// this.$emit(EVENT_COMPLETE);
// this.$emit('refresh');
}
},
// 未付款 用户订单取消接口【未付款】
......@@ -268,12 +232,12 @@ export default {
}
.yuan_detail {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #323233;
line-height: 20px;
line-height: 24px;
margin-top: 12px;
white-space: pre-line;
margin-bottom: 24px;
}
.Cp__button {
......
......@@ -11,8 +11,7 @@
"
>
<cr-image
v-imogr
:src="it.imageUrl | replaceUrl"
:src="it.imageUrl | replaceUrl | imogr({ w: 85, h: 85 })"
width="2.266667rem"
height="2.266667rem"
class="Ol__body-img"
......
<template>
<div v-if="item.skuId" class="confirm-goods" :class="className">
<cr-image
v-imogr="{ w: 85, h: 85 }"
class="confirm-goods__left"
:src="item.skuImg | imogr({ w: 85, h: 85 })"
width="85px"
......@@ -23,8 +22,8 @@
</div>
<div class="Cg-middle__stepper">
<div v-if="item.activityCanBuyCount || item.commonLimitCount" class="Cg-middle__warn">
<img v-if="item.newComersLabel" :src="item.newComersLabel.icon" />
<img v-if="showActivityIcon" :src="showActivityIcon" />
<img v-if="item.newComersLabel" :src="item.newComersLabel.icon | imogr" />
<img v-if="showActivityIcon" :src="showActivityIcon | imogr" />
<span>限购{{ item.activityCanBuyCount || item.commonLimitCount }}件</span>
</div>
......
......@@ -28,11 +28,10 @@
>
<template #thumb>
<cr-image
v-imogr="{ w: 30, h: 30 }"
round
height="0.8rem"
width="0.8rem"
:src="`${item.userImageUrl}`"
:src="item.userImageUrl | imogr({ w: 30, h: 30 })"
alt=""
class="user-info__thumb"
/>
......@@ -87,8 +86,7 @@
{{ item.images.length }}<cr-icon type="arrow" size="15px" />
</span>
<img
v-imogr="{ w: 105, h: 105 }"
:src="changeUrl(img)"
:src="changeUrl(img) | imogr({ w: 105, h: 105 })"
width="100%"
height="100%"
/>
......@@ -175,7 +173,6 @@ export default {
this.pageNo = 1;
this.finished = false;
this.orderList = [];
this.getOrderInfo(true);
},
beforeRead(index, file) {
this.orderList[index].resourceList.push(file);
......
......@@ -20,16 +20,16 @@
</span>
<cr-image
v-if="activityInfo.priceIcon"
v-imogr
:src="activityInfo.priceIcon"
height="0.373rem"
width="auto"
:src="activityInfo.priceIcon | imogr"
height="14px"
:width="calImgSizeByRatio(14, activityInfo.priceIconRate) + 'px'"
fit="contain"
/>
<cr-icon
v-if="activityInfo.priceIcon && activityInfo.actDesc"
type="info-o"
size="0.426rem"
color="#999"
color="rgba(255,255,255,0.65)"
@click="showPopup"
/>
</div>
......@@ -40,12 +40,17 @@
<div v-else class="priceInfo__activity">
<div class="priceInfo__activity__icon">
<cr-image
v-imogr
:src="activityInfo.actIcon"
:height="activityInfo.activityType === 9 ? '0.96rem' : '0.5867rem'"
width="auto"
:src="activityInfo.actIcon | imogr"
:height="activityIconSize.height"
:width="activityIconSize.width"
fit="contain"
/>
<cr-icon
v-if="activityInfo.actDesc"
type="info-o"
color="rgba(255,255,255,0.65)"
@click="showPopup"
/>
<cr-icon v-if="activityInfo.actDesc" type="info-o" color="#999" @click="showPopup" />
</div>
<div v-if="showCountDown" class="priceInfo__activity__info counter">
<svg-icon icon-class="shijian" />
......@@ -86,10 +91,17 @@ export default {
}
return style;
},
activityIconSize() {
const h = this.activityInfo.activityType === 9 ? '36' : '22';
return {
height: `${h}px`,
width: `${this.calImgSizeByRatio(h, this.activityInfo.actIconRate)}px`
};
},
showCountDown() {
return (
this.activityInfo.activityType === 11 &&
this.activityInfo.activityTimeInfo.endTime < 86400000
this.activityInfo.activityTimeInfo.endTime - this.activityInfo.activityTimeInfo.startTime <
86400000
);
},
countTime() {
......@@ -118,6 +130,13 @@ export default {
...mapActions(['setPopupState']),
showPopup() {
this.setPopupState({ type: 'rule', title: '活动规则' });
},
calImgSizeByRatio(size, aspectRatio, calH) {
if (calH) {
return size / aspectRatio;
} else {
return size * aspectRatio;
}
}
}
};
......@@ -178,7 +197,7 @@ export default {
}
&__discountPrice {
display: flex;
align-items: baseline;
align-items: center;
span {
color: #ed7d08;
font-weight: 500;
......
......@@ -7,7 +7,7 @@
@click="toDetail(item.goods, index)"
>
<div class="Hl-container-item-img">
<cr-image v-imogr class="Hlc-item-img" :src="item.goods.goodsImage" />
<cr-image class="Hlc-item-img" :src="item.goods.goodsImage | imogr({ w: 173, h: 173 })" />
</div>
<div class="Hlc-item-title">
<span>{{ item.goods.goodsName }}</span>
......
......@@ -19,8 +19,7 @@
>
<div class="comment__user">
<cr-image
v-imogr
:src="item.userImageUrl"
:src="item.userImageUrl | imogr"
round
width="0.8rem"
height="0.8rem"
......@@ -36,10 +35,9 @@
<cr-image
v-for="(it, k) in item.images"
:key="k"
v-imogr="{ w: 80, h: 80 }"
width="2.13rem"
height="2.13rem"
:src="it"
:src="it | imogr({ w: 80, h: 80 })"
/>
</div>
</div>
......
......@@ -41,11 +41,10 @@
</cr-popup>
<cr-image
v-if="selectedSku.imageUrl"
v-imogr="{ w: 150, h: 150 }"
class="add-cart-img"
:class="{ animate: startAnimate }"
round
:src="selectedSku.imageUrl"
:src="selectedSku.imageUrl | imogr({ w: 150, h: 150 })"
width="4rem"
height="4rem"
/>
......
......@@ -4,12 +4,11 @@
<cr-image
v-for="(item, index) in detailImgList"
:key="index"
v-imogr="{ w: 396 }"
lazy-load
class="good__detailImg__img"
width="100%"
height="auto"
:src="item | imageMogr4Operation"
:src="item | imogr({ w: 375 })"
/>
</div>
</template>
......
......@@ -16,7 +16,7 @@
</div>
<div class="discountBar__right">
<span>{{ discountBarInfo.rightTitle }}</span>
<cr-icon type="arrow" color="#fff" size="0.213rem" />
<svg-icon icon-class="arrow-linear-gradient" />
</div>
</div>
</template>
......@@ -80,20 +80,18 @@ export default {
display: flex;
align-items: center;
background: linear-gradient(270deg, fade(#ff5d00, 10%) 0%, fade(#ff1900, 10%) 100%);
.text-size(12px);
padding: 1px @padding-unit;
padding: 4px 3px 3px;
border-radius: @border-radius-max;
color: @red;
.cr-icon {
border-radius: @border-radius-max;
background: linear-gradient(270deg, #ff5d00 0%, #ff1900 100%);
span {
font-size: 12px;
font-weight: 500;
}
.svg-icon {
font-size: 12px;
margin-left: 2px;
text-align: center;
font-size: 8px !important;
width: 20px !important;
height: 20px !important;
line-height: 20px;
transform: scale(0.7);
margin-top: -1px;
transform: scale(0.8);
}
}
}
......
......@@ -17,18 +17,19 @@
fit="contain"
/> -->
<cr-swipe v-if="renderSwipe" class="good__swiper" @change="onChange">
<cr-swipe class="good__swiper" @change="onChange">
<cr-swipe-item v-for="(item, index) in swiperImgList" :key="index" class="good__swiper__item">
<cr-image
v-imogr="{ w: 375, h: 375 }"
:src="item"
:src="item | imogr({ w: 375, h: 375 })"
width="10rem"
height="10rem"
fit="contain"
/>
</cr-swipe-item>
<template #indicator>
<div class="good__swiper__indicator">{{ current }} / {{ swiperImgList.length }}</div>
<div v-if="swiperImgList.length > 1" class="good__swiper__indicator">
{{ current }} / {{ swiperImgList.length }}
</div>
</template>
</cr-swipe>
</div>
......@@ -40,26 +41,12 @@ export default {
name: 'GoodSwiper',
data() {
return {
current: 1,
renderSwipe: false
current: 1
};
},
computed: {
...mapGetters(['swiperImgList'])
},
watch: {
swiperImgList: {
handler(val, oldVal) {
if (val[0] !== oldVal[0]) {
const imgFirst = new Image();
imgFirst.src = val[0];
imgFirst.onload = () => {
this.renderSwipe = true;
};
}
}
}
},
methods: {
onChange(index) {
this.current = index + 1;
......
<template>
<div class="Hl-container-item">
<div class="Hlc-item-img">
<cr-image v-imogr="{ w: 120, h: 120 }" :src="goods.goodsImage" />
<cr-image :src="goods.goodsImage | imogr({ w: 120, h: 120 })" />
</div>
<div class="Hlc-item-info">
<div class="Hlc-item-info-title">
......@@ -32,7 +32,7 @@ export default {
width: 120px;
height: 120px;
border-radius: 6px;
margin-right: 5px;
margin-right: 8px;
opacity: 0.5;
}
.Hlc-item-info {
......@@ -63,11 +63,9 @@ export default {
&-bottom {
position: absolute;
bottom: 5px;
display: flex;
width: 100%;
&-des {
.text-size(13);
width: 90%;
color: @black;
// overflow: hidden;
// text-overflow: ellipsis;
......
......@@ -2,8 +2,7 @@
<div v-if="maxMemberInfo.title" class="good__maxMemberInfo">
<div class="maxMemberInfo__container" :style="style">
<cr-image
v-imogr="{ h: 16 }"
:src="maxMemberInfo.icon"
:src="maxMemberInfo.icon | imogr({ h: 16 })"
width="auto"
height="0.426rem"
class="maxMemberInfo__icon"
......
......@@ -26,7 +26,7 @@
>
<div class="popPromotion__head">
<div class="popPromotion__title">可领优惠券</div>
<div class="popPromotion__right" @click="batchPick">一键领取</div>
<div v-if="canBatchPick" class="popPromotion__right" @click="batchPick">一键领取</div>
</div>
<div class="popPromotion__list">
<coupon-card :coupon-list="activityAndCoupon.coupons" @pickupCoupon="pickup" />
......@@ -52,7 +52,10 @@ export default {
userInfo: state => {
return (state && state.pay.userInfo) || {};
}
})
}),
canBatchPick() {
return this.activityAndCoupon.coupons.some(item => !item.pickupAble);
}
},
methods: {
...mapActions(['pickupCoupon']),
......
<template>
<div class="goods-popup-selected">
<cr-image v-imogr="{ w: 100, h: 100 }" :src="info.imageUrl" width="2.67rem" height="2.67rem" />
<cr-image :src="info.imageUrl | imogr({ w: 100, h: 100 })" width="2.67rem" height="2.67rem" />
<div class="Gp-selected-right">
<div class="Gps-right-header">
<div class="Gpsr-header-price">
......
<template>
<div class="skeleton">
<cr-image
v-imogr="{ w: 375, h: 375 }"
class="skeleton__img"
:src="query.goodsOrgImage"
width="10rem"
height="10rem"
error-icon="photo-o"
/>
<div class="skeleton__body">
<div class="skeleton__base">
<cr-row>
......@@ -88,12 +80,12 @@ export default {
border-radius: 4px;
}
.skeleton {
position: absolute;
position: relative;
z-index: 999;
top: 0;
left: 0;
right: 0;
bottom: 0;
// top: 0;
// left: 0;
// right: 0;
// bottom: 0;
height: 100%;
width: 100%;
background-color: #f7f8fa;
......
......@@ -3,8 +3,7 @@
<h4 @touchstart="touchstart" @touchend="touchend">
<cr-image
v-if="title.skuIcon"
v-imogr="{ h: 27 }"
:src="title.skuIcon"
:src="title.skuIcon | imogr({ h: 27 })"
width="auto"
height="0.426rem"
/>
......
<template>
<div class="good" :class="{ stopScroll: goodsStatus === 0 }">
<template v-if="goodsStatus !== 41">
<good-nav />
<!-- <good-nav /> -->
<good-swiper />
<template v-if="goodsStatus !== 0">
<div class="good__body">
<div class="good__base">
<template v-if="!hidePrice">
......@@ -27,6 +28,10 @@
<common-popup />
<goods-action v-if="!hidePrice" />
</template>
<transition name="fade">
<skeleton v-if="goodsStatus === 0" />
</transition>
</template>
<div class="good__body">
<div class="good__base"><empty-good v-if="goodsStatus === 41" /></div>
<goods-card
......@@ -35,15 +40,15 @@
header-type="image"
/>
</div>
<transition name="fade">
<skeleton v-if="goodsStatus === 0" />
</transition>
<!-- <transition name="fade"> -->
<!-- <skeleton v-if="goodsStatus === 0" /> -->
<!-- </transition> -->
</div>
</template>
<script>
import { mapActions, mapGetters, mapState } from './store';
import { jumpTargetPlatformPage } from '@/service/yxmLogin.service';
import goodNav from './components/goodNav.vue';
// import goodNav from './components/goodNav.vue';
import goodSwiper from './components/goodSwiper.vue';
import activityPrice from './components/activityPrice.vue';
import discountBar from './components/discountBar.vue';
......@@ -64,7 +69,7 @@ export default {
// eslint-disable-next-line vue/name-property-casing
name: 'goodDetail',
components: {
goodNav,
// goodNav,
goodSwiper,
activityPrice,
discountBar,
......@@ -144,7 +149,7 @@ export default {
.good {
position: relative;
padding-bottom: 60px;
&.stopscroll {
&.stopScroll {
height: 100vh;
overflow: hidden;
padding-bottom: 0;
......
......@@ -52,7 +52,15 @@ export const state = {
};
export const getters = {
swiperImgList: state => state.detail.imageList || [],
swiperImgList: state => {
if (state.detail.imageList) {
return state.detail.imageList;
}
if (state.query.goodsOrgImage) {
return [state.query.goodsOrgImage];
}
return [];
},
priceInfo: state => {
const { salePrice, saleCount } = state.detail || {};
return { salePrice, saleCount };
......@@ -168,25 +176,25 @@ export const actions = {
console.log(error);
}
},
async pickupCoupon({ state, dispatch }, index) {
async pickupCoupon({ state, commit }, index) {
let couponPickupList = [];
const coupons = state.activityAndCoupon?.coupons || [];
if (!index && index !== 0) {
couponPickupList = coupons.map(item => {
const { id, couponCategory, receiverLimitCount } = item;
const { id, couponCategory } = item;
return {
couponId: id,
couponType: couponCategory,
pickupNum: receiverLimitCount
pickupNum: 1
};
});
} else {
const { id, couponCategory, receiverLimitCount } = coupons[index];
const { id, couponCategory } = coupons[index];
couponPickupList = [
{
couponId: id,
couponType: couponCategory,
pickupNum: receiverLimitCount
pickupNum: 1
}
];
}
......@@ -200,7 +208,12 @@ export const actions = {
systemSendCoupon: true
});
if (res) {
dispatch('getActivityAndCoupon');
state.activityAndCoupon.coupons = coupons.map(item => {
item.pickupAble = true;
return item;
});
commit('SET_ACT_AND_CPN', state.activityAndCoupon);
// dispatch('getActivityAndCoupon');
Vue.prototype.$toast('领取成功!');
}
},
......@@ -323,6 +336,9 @@ export const mutations = {
Vue.set(state, 'skuNum', skuNum);
},
SET_SIMILARITY_LIST(state, list) {
if (list.length % 2 !== 0) {
list.length = list.length - 1;
}
Vue.set(state, 'similarityList', list);
}
};
......@@ -91,11 +91,12 @@ export default {
this.layoutType = type;
this.$emit(CHANGE_LIST_TYPE, type);
},
// 清空数据
clearInputText() {
this.keyWords = '';
},
resetSearch() {
this.clearInputText();
// this.clearInputText();
this.$emit(CLEAR_EVENT);
},
searchEnterEvent() {
......
......@@ -39,6 +39,7 @@ export default {
height: 60px;
position: fixed;
bottom: 0;
left: 0;
z-index: 2;
align-items: center;
background-color: #fff;
......
......@@ -4,7 +4,7 @@
<span class="empty-text">购物车空空如也~</span>
</div>
</template>
<style lang="less">
<style lang="less" scoped>
.empty {
text-align: center;
height: 211px;
......
......@@ -29,7 +29,7 @@ export default {
}
};
</script>
<style lang="less">
<style lang="less" scoped>
.activity {
display: flex;
font-size: 12px;
......
......@@ -4,8 +4,7 @@
<div class="good-radio-click" @click="changeSelectStatus" />
<div class="good-image">
<cr-image
v-imogr="{ w: 208, h: 208 }"
:src="value.skuImg"
:src="value.skuImg | imogr({ w: 208, h: 208 })"
lazy-load
width="104"
height="104"
......@@ -95,10 +94,11 @@ export default {
this.$emit('getPosition', this.idx, this.index);
},
stopPropagation() {
if (this.count === this.value.commonLimitCount) {
this.$toast(`您当前购买的商品限购${this.value.commonLimitCount}件`);
return;
}
// if (this.count === this.value.commonLimitCount) {
// this.$toast(`您当前购买的商品限购${this.value.commonLimitCount}件`);
// return;
// }
},
...mapActions({
selectCartGood: 'select_cart_good',
......@@ -187,11 +187,11 @@ export default {
bottom: 0;
left: 0;
font-size: 10px;
width: 100px;
width: 100%;
text-align: center;
background: rgba(0, 0, 0, 0.6);
padding: 4px 0;
border-radius: 0px 0px 8px 8px;
// border-radius: 0px 0px 8px 8px;
color: #fff;
}
}
......
......@@ -103,6 +103,10 @@ export default {
value = this.max * scale;
}
} else if (type === 'plus') {
if (value >= this.max) {
this.$toast(`您当前购买的商品限购${this.max}件`);
return;
}
this.changeType = 'ADD_NUM';
value += step;
if (value > this.max * scale) {
......
......@@ -27,7 +27,7 @@ export default {
}
};
</script>
<style lang="less">
<style lang="less" scoped>
.tagList {
display: flex;
flex-wrap: wrap;
......
......@@ -49,7 +49,7 @@ export default {
}
};
</script>
<style lang="less">
<style lang="less" scoped>
.good-title {
width: 100%;
font-size: 13px;
......
......@@ -40,7 +40,7 @@ export default {
}
};
</script>
<style lang="less">
<style lang="less" scoped>
.manage {
width: 100%;
height: 100%;
......
......@@ -148,7 +148,7 @@ export default {
let haveNewUserProduct = false;
const arr = this.selectedList;
for (let i = 0; i < arr.length; i++) {
if (arr[i].product && arr[i].product.activityType && arr[i].product.activityType == 8) {
if (arr[i].product && arr[i].product.userType && arr[i].product.userType == 9) {
haveNewUserProduct = true;
break;
} else {
......
......@@ -32,6 +32,7 @@
v-if="goodsList.length"
header-type="image"
class="shopping-list--goods"
:class="{ noLogin: !isLogin }"
:goods-list.sync="goodsList"
/>
</cr-pull-refresh>
......@@ -67,6 +68,7 @@ import localStorage from '@/service/localStorage.service';
import ScrollView from '@/components/scrollView';
import PageWrapper from '../../components/base/PageWrapper.vue';
import historyRecordMixins from '@/mixins/historyRecord.mixins';
export default {
name: 'Cart',
provide() {
......@@ -122,6 +124,9 @@ export default {
...mapState(['activityInfo']),
validCount() {
return this.cartList.length;
},
isLogin: function() {
return localStorage.get('vccToken');
}
},
watch: {
......@@ -139,6 +144,8 @@ export default {
},
mounted() {
this.loadData();
},
activated() {
this.initMethods();
},
deactivated() {
......@@ -242,6 +249,12 @@ export default {
::v-deep .cr-pull-refresh {
height: auto;
}
::v-deep .cr-pull-refresh__head {
color: #333333;
}
::v-deep .cr-pull-refresh__head .cr-loading {
margin-right: 4px;
}
.shopping {
width: 100%;
height: 100%;
......@@ -318,4 +331,7 @@ export default {
top: 75px;
}
}
.onLogin {
padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
</style>
......@@ -77,7 +77,7 @@ const mutations = {
localStorage.set('userInfo', provider);
},
[types.CHANGE_TOKEN](state, token) {
state.hasLogin = true;
state.hasLogin = !!token;
state.vccToken = token;
localStorage.set('vccToken', token);
},
......
......@@ -124,8 +124,9 @@ const shopCart = {
},
update_cart_list({ commit, dispatch }, data) {
let goods = [];
if (data && data.cartInfoList) {
goods = [...goods, ...data.cartInfoList];
if (data && (data.cartInfoList || data.addCartMore30CartInfoList)) {
goods = data.cartInfoList && [...goods, ...data.cartInfoList];
goods = data.addCartMore30CartInfoList && [...goods, ...data.addCartMore30CartInfoList];
console.log(goods, 'goods');
const timeArray = goods.map(item => {
return item.skus.map(it => {
......@@ -182,12 +183,16 @@ const shopCart = {
dispatch('good_fee');
}
},
count_down({ state, commit }) {
count_down({ state, commit, dispatch }) {
const timer = setInterval(() => {
const timeArray = state.timeArray.map(it => {
return it.map(i => {
if (i > 0) {
i = i - 1000;
i = i - 1000 >= 0 ? i - 1000 : 0;
if (i === 0) {
dispatch('clear_timer');
dispatch('query_cart_list');
}
}
return i;
});
......@@ -368,7 +373,7 @@ const shopCart = {
skuName: item.skuName,
commonLimitCount: item.commonLimitCount,
count: item.count,
activityType: item.activityType
userType: item.activityShowInfo?.userType || null
}
};
selectedGoods.push(good);
......
<template>
<jhb id="app" ref="rootApp">
<cr-nav-bar v-if="header" :title="title" left-text="" @click-left="backFun" />
<jhb class="app">
<keep-alive :max="15" :include="keepAliveMap">
<router-view />
</keep-alive>
</jhb>
<cr-tabbar
v-if="tabBar"
v-model="router"
inactive-color="#000"
class="tab-bar"
@change="handleTabBar"
>
<cr-tabbar-item :icon="homeIcon">精选</cr-tabbar-item>
<cr-tabbar-item :icon="memberIcon">会员</cr-tabbar-item>
<cr-tabbar-item :badge="cartCount || undefined" :icon="cartIcon">购物车</cr-tabbar-item>
<cr-tabbar-item :icon="userIcon">我的</cr-tabbar-item>
</cr-tabbar>
<jhb v-if="loading" class="loading-container">
<cr-loading class="loading" size="24px">加载中...</cr-loading>
</jhb>
<net-error />
<LoginAuthorize />
</jhb>
</template>
<script>
import { mapGetters } from 'vuex';
import NetError from '@/components/NetError';
import LoginAuthorize from '@/components/loginAuthorize/index.vue';
import localStorage from '@/service/localStorage.service';
import TMDConfig from '@/customize/tmd-config';
import {
mapGetters as ShopCartMapGetters,
mapActions as ShopCartMapActions
} from '@/views/shopCart/shopCartModules.js';
const homeSelected = 'https://img.lkbang.net/home-cur.47903e4ae9d08c4e.47903e4a.png';
const homeIcon = 'https://img.lkbang.net/home.7d4f65b0d01fba.7d4f65b0.png';
const cartSelected = 'https://img.lkbang.net/cart-cur.08b92b167a8592.08b92b16.png';
const cartIcon = 'https://img.lkbang.net/cart.4040b7d6f3c3a5a.4040b7d6.png';
const userSelected = 'https://img.lkbang.net/user-cur.e46c0ec5a4b27d16a.e46c0ec5.png';
const userIcon = 'https://img.lkbang.net/user.27bd25d441abd27.27bd25d4.png';
const memberIconSelected = 'https://img.lkbang.net/member_incon_selected.a48af1f5.png';
const memberIcon = 'https://img.lkbang.net/member_icon.b566de02.png';
export default {
name: 'App',
components: {
NetError,
LoginAuthorize
},
data() {
return {
router: 0,
configTmd: ''
};
},
computed: {
...ShopCartMapGetters(['cartCount']),
...mapGetters(['title', 'header', 'loading', 'tabBar', 'routeIdx', 'keepAliveMap']),
homeIcon() {
return this.routeIdx === 0 ? homeSelected : homeIcon;
},
memberIcon() {
return this.routeIdx === 1 ? memberIconSelected : memberIcon;
},
cartIcon() {
return this.routeIdx === 2 ? cartSelected : cartIcon;
},
userIcon() {
return this.routeIdx === 3 ? userSelected : userIcon;
}
},
watch: {
header: {
immediate: true,
handler(val, oldVal) {
if (val !== oldVal) {
document.body.className = val ? 'has-header' : '';
}
}
},
routeIdx: {
immediate: true,
handler(val) {
console.log('val====', val);
this.router = val;
}
},
tabBar: {
immediate: true,
handler(val, oldVal) {
if (val !== oldVal) {
document.body.className = val ? 'has-tab-bar' : '';
}
}
}
},
created() {
const config = new TMDConfig();
this.configTmd = config;
},
async mounted() {
if (localStorage.get('vccToken') && location.pathname !== '/login') {
this.queryCartCount();
}
if (localStorage.get('vccChannel') == 161085) {
this.$nextTick(() => {
// document.getElementById('#app').innerHTML = '';
this.$refs.rootApp.innerHTML =
'<jhb class="cr-image" style="width: 100%; height: 100%;"><img src="https://img.lkbang.net/error.19ace11d.png" style="display: block; margin: 0 auto; width: 80%; height: auto; margin-top: 20px;" class="cr-image--img" ></jhb>';
});
}
},
methods: {
...ShopCartMapActions(['queryCartCount']),
backFun() {
this.$router.go(-1);
},
handleTabBar(idx) {
console.log('idx', idx);
const channelId = localStorage.get('vccChannel');
// console.log(location.href,"location.href",location.origin)
switch (idx) {
case 0:
this.$router.replace({ name: 'Home' });
break;
case 1:
this.$router.replace({ name: 'Member' });
// window.location.href = 'https://www.baidu.com';
break;
case 2:
if (channelId == this.configTmd.channelId.id && localStorage.get('vccPhone')) {
// console.log('jinlaile');
// 第三方进来
localStorage.get('vccToken')
? this.$router.replace({ name: 'Cart' })
: this.$router.replace({ name: 'LoginMiddle', query: { backUrl: location.href } });
} else {
// 之前逻辑
localStorage.get('vccToken')
? this.$router.replace({ name: 'Cart' })
: this.$router.replace({ name: 'Login', query: { backUrl: location.href } });
}
break;
case 3:
if (channelId == this.configTmd.channelId.id && localStorage.get('vccPhone')) {
// 第三方进来
localStorage.get('vccToken')
? this.$router.replace({ name: 'User' })
: this.$router.replace({ name: 'LoginMiddle', query: { backUrl: location.href } });
} else {
// 之前逻辑
this.$router.replace({ name: 'User' });
}
break;
}
}
}
};
</script>
<style lang="less">
@import './style/index';
.app {
user-select: none;
height: 100%;
min-height: 100%;
position: relative;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.loading-container {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
display: flex;
justify-content: center;
align-items: center;
.loading {
padding: 6px;
border-radius: 6px;
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
@{deep} .cr-loading--text {
color: #fff;
}
}
}
.tab-bar {
position: relative;
padding-top: 10px !important;
box-sizing: border-box;
z-index: 11;
height: calc(@tab-bar-height + constant(safe-area-inset-bottom));
height: calc(@tab-bar-height + env(safe-area-inset-bottom));
align-items: flex-start !important;
.cr-icon {
display: block;
height: 24px;
}
.cr-info--badge {
padding: 0 4px;
}
&:before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: rgba(0, 0, 0, 0.33);
}
}
</style>
......@@ -130,23 +130,11 @@ async function renameFolder(oldName, newName) {
return makeDir(tempPath);
})
// 复制 source 下所有文件到 temp
await copyDir(sourcePath, tempPath);
await copyDir(sourcePath, tempPath,{ exclude: 'App.vue' });
// 调整pages 目录
await renameFolder(tempPath+'/views', tempPath+'/pages')
// await copyDir(sourcePath+'/views/', tempPath, {
// prefix:'pages'
// });
// await copyFolder(sourcePath, tempPath+"/", '', ['views'])
//
// await copyFolder(sourcePath+'/views', tempPath, 'pages')
// await copyFolder(sourcePath, tempPath);
// // 替换 temp 下所有文件的文本
// await replaceFiles(tempPath, map);
// // 复制 temp 文件夹到 src
// await copyTempToSrc(tempPath, sourcePath);
// // 删除 temp 目录
// await deleteFolder(tempPath);
// copy temp 文件到 src
await copyDir(tempPath, './src');
// 删除 temp 目录
await deleteFolder(tempPath);
})();
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