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

fix: uniapp 转换脚本开发

parent a8684eeb
...@@ -21,3 +21,4 @@ yarn-error.log* ...@@ -21,3 +21,4 @@ yarn-error.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw* *.sw*
/source
This diff is collapsed.
...@@ -19,7 +19,7 @@ export const actAndCpn = data => { ...@@ -19,7 +19,7 @@ export const actAndCpn = data => {
return http.post(`${yxmGwHost}/api/kdsp/sku-info/detail/actAndCpn`, data); return http.post(`${yxmGwHost}/api/kdsp/sku-info/detail/actAndCpn`, data);
}; };
// 详情图片, 通过 // 详情图片
export const getDetailPic = url => { export const getDetailPic = url => {
return http.get(url, { strategy: 'default', hideLoading: 1, skip: 1, hideToast: 1 }); return http.get(url, { strategy: 'default', hideLoading: 1, skip: 1, hideToast: 1 });
}; };
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div v-if="headerType === 'center'" class="Hl-header-center">{{ title }}</div> <div v-if="headerType === 'center'" class="Hl-header-center">{{ title }}</div>
<cr-image <cr-image
v-if="headerType === '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" width="4.53rem"
height="0.96rem" height="0.96rem"
class="Hl-header-image" class="Hl-header-image"
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
> >
<div class="Hl-container-item-img"> <div class="Hl-container-item-img">
<cr-image <cr-image
v-imogr
class="Hlc-item-img" class="Hlc-item-img"
:src="item.goods.goodsImage | Img2Thumb" :src="item.goods.goodsOrgImage | imogr({ w: 173, h: 173 })"
lazy-load lazy-load
fit="contain" fit="contain"
/> />
...@@ -53,7 +52,7 @@ ...@@ -53,7 +52,7 @@
}" }"
{{ item.goods.discountShow.discountPrice }}</span {{ item.goods.discountShow.discountPrice }}</span
> >
<img :src="item.goods.discountShow.icon" /> <img :src="item.goods.discountShow.icon | imogr" />
</div> </div>
</div> </div>
<!-- 加入购物车 --> <!-- 加入购物车 -->
...@@ -348,9 +347,9 @@ export default { ...@@ -348,9 +347,9 @@ export default {
border: 1px solid @border-red; border: 1px solid @border-red;
font-size: 10px; font-size: 10px;
color: @red; color: @red;
border-radius: 5px; border-radius: 3px;
padding: 2px 5px; padding: 2px 5px;
margin: 2px 2px 2px 0; margin-right: 3px;
} }
} }
} }
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
> >
<img :src="item.goods.discountShow.icon" /> <img :src="item.goods.discountShow.icon" />
</div> </div>
<!-- <span v-if="item.goods.goodsPrice">¥{{ item.goods.goodsPrice }}</span> -->
</div> </div>
<div class="goods-item-info-count-left-bottom"> <div class="goods-item-info-count-left-bottom">
<span>已售{{ item.goods.saleCount }}</span> <span>已售{{ item.goods.saleCount }}</span>
...@@ -229,7 +228,7 @@ export default { ...@@ -229,7 +228,7 @@ export default {
} }
} }
&-info { &-info {
height: 100%; min-height: 116px;
padding: 0 5px 5px; padding: 0 5px 5px;
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 110px); width: calc(100% - 110px);
...@@ -271,7 +270,7 @@ export default { ...@@ -271,7 +270,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
border: 1px solid @border-red; border: 1px solid @border-red;
font-size: 8px; font-size: 12px;
color: @red; color: @red;
border-radius: 3px; border-radius: 3px;
padding: 1px 3px; padding: 1px 3px;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
closeable closeable
position="bottom" 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> <p class="yxm">羊小咩</p>
<div class="checkbox-content"> <div class="checkbox-content">
<cr-checkbox v-model="checked" icon-size="14px" shape="round" class="agreement"> <cr-checkbox v-model="checked" icon-size="14px" shape="round" class="agreement">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Date: 2021-03-31 19:59:12 * @Date: 2021-03-31 19:59:12
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2023-05-06 20:05:02 * @LastEditTime: 2023-05-09 11:33:27
*/ */
const envName = 'yxm'; const envName = 'yxm';
const protocol = window.location.protocol; const protocol = window.location.protocol;
...@@ -15,7 +15,7 @@ const kdspHost = `https://kdsp-api-${envName}.liangkebang.net`; ...@@ -15,7 +15,7 @@ const kdspHost = `https://kdsp-api-${envName}.liangkebang.net`;
const kdspOpHost = `https://kdsp-operation-${envName}.liangkebang.net`; const kdspOpHost = `https://kdsp-operation-${envName}.liangkebang.net`;
const VCC_CHANNEL = ''; const VCC_CHANNEL = '';
const TERMINAL = 'H5'; const TERMINAL = 'H5';
const VERSION = '8.9.40'; const VERSION = '8.9.80';
const SOBOT_URL = const SOBOT_URL =
'https://kdspstatic.91xr.cn/kdsp/mine/service/customer-service/customer-service-prod.html'; 'https://kdspstatic.91xr.cn/kdsp/mine/service/customer-service/customer-service-prod.html';
const nectarHost = `https://nectar-${envName}.liangkebang.net/`; const nectarHost = `https://nectar-${envName}.liangkebang.net/`;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: 根据图片来源匹配压缩 * @Description: 根据图片来源匹配压缩
* @Date: 2021-04-26 17:47:15 * @Date: 2021-04-26 17:47:15
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2023-05-06 17:59:13 * @LastEditTime: 2023-05-08 19:54:55
*/ */
import localStorage from '@/service/localStorage.service'; import localStorage from '@/service/localStorage.service';
const CAN_USE_WEBP = 'checkWebp'; const CAN_USE_WEBP = 'checkWebp';
......
// 3 main.js导入router.js并挂载 import Vue from 'vue';
import {router,RouterMount} from './router/index'; 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 Vue.prototype.$track = saService;
RouterMount(app,router,'#app') Vue.prototype.$config = publicConfig;
// #endif Vue.prototype.$bridge = new Bridge();
Vue.use(lazyload);
Vue.use(imgMogrVue);
// #ifndef H5 getToKen();
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif Vue.config.productionTip = false;
\ No newline at end of file
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 { ...@@ -52,8 +52,9 @@ export default {
openNewUrl(data) { openNewUrl(data) {
locationHrefPatch(data.newUrl, this.$router); locationHrefPatch(data.newUrl, this.$router);
}, },
shopCarAddGoodsNotification() { shopCarAddGoodsNotification(data) {
this.queryCartCount(); // this.queryCartCount();
this.$store.dispatch('shopCart/saveCartCount', data.count);
}, },
getShuMeiId() {} getShuMeiId() {}
} }
......
{ {
"pages": [
{
"path": "pages/home",
"style": {
"navigationBarTitleText": "",
"mp-alipay": {
"allowsBounceVertical": "NO"
}
}
}
],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",
......
...@@ -45,8 +45,7 @@ ...@@ -45,8 +45,7 @@
@click="handleToDetailsTrack(item, 'CategoryBrandClick', i)" @click="handleToDetailsTrack(item, 'CategoryBrandClick', i)"
> >
<cr-image <cr-image
v-imogr="{ w: 48, h: 48 }" :src="item.img | imogr({ w: 48, h: 48 })"
:src="item.img | Img2Thumb"
fit="contain" fit="contain"
class="category-box--brands--item__img" class="category-box--brands--item__img"
/> />
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
</cr-swipe-item> </cr-swipe-item>
</cr-swipe> </cr-swipe>
<LoginPopup /> <LoginPopup />
<loginGuide v-if="!userInfo.phoneNumber" />
<loginGuide v-if="!hasLogin" />
<transition name="fade"> <transition name="fade">
<Skeleton v-if="skeletonStatus" /> <Skeleton v-if="skeletonStatus" />
</transition> </transition>
...@@ -67,6 +68,7 @@ import historyRecordMixins from '@/mixins/historyRecord.mixins'; ...@@ -67,6 +68,7 @@ import historyRecordMixins from '@/mixins/historyRecord.mixins';
import mxBll from './mixin/mxBll'; import mxBll from './mixin/mxBll';
import { Img2Thumb } from '@/filters/img2Thumb.filter'; import { Img2Thumb } from '@/filters/img2Thumb.filter';
import Skeleton from './components/Skeleton.vue'; import Skeleton from './components/Skeleton.vue';
import { mapGetters as homeMapGetters } from 'vuex';
export default { export default {
name: 'Home', name: 'Home',
...@@ -94,6 +96,7 @@ export default { ...@@ -94,6 +96,7 @@ export default {
}; };
}, },
computed: { computed: {
...homeMapGetters(['hasLogin']),
specialCol() { specialCol() {
return this.$refs.specialCol; return this.$refs.specialCol;
}, },
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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