Skip to content

Commit

Permalink
end
Browse files Browse the repository at this point in the history
  • Loading branch information
Sssitmonkey committed Jul 17, 2020
1 parent 0d0e7e7 commit 0e8145f
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 276 deletions.
4 changes: 1 addition & 3 deletions App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ export default {
}
},
onLaunch: async function(options) {
// 原生底部导航,自定义底部导航切换。
if (options.query.mode === 'save') {
//截图模式
uni.setStorageSync('screenShot', true);
uni.setStorageSync('shop_id', options.query.shop_id);
}
// 自定义底部导航,控制显示隐藏。
this.init(options)
.then(res => {
this.autoLogin(res[2].data);
Expand Down
70 changes: 0 additions & 70 deletions README.md

This file was deleted.

6 changes: 3 additions & 3 deletions common/request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default function api(url, data = {}) {
request.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
if (api.auth) {
let token = uni.getStorageSync('token');
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
cancel('token 不存在'); // 接收一个参数,会传给catch((err) => {}) err.errMsg === 'token 不存在'
if (!token) {
store.commit('LOGIN_TIP', true)
store.commit('OUT_LOGIN');
store.commit('OUT_LOGIN');
throw('暂未登录,已阻止此次API请求~');
}
}
if (uni.getStorageSync('token')) {
Expand Down
7 changes: 4 additions & 3 deletions common/store/modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const actions = {
api('init').then(res => {
commit('INIT_DATA', res.data);
uni.setStorageSync('sysInfo', res.data.info);
uni.setStorageSync('shareInfo', res.data.share);
uni.setStorageSync('shareInfo', res.data.share);
console.log(res,'init');
resolve(res)
}).catch(e => {
reject(e)
Expand Down Expand Up @@ -64,9 +65,9 @@ const actions = {
});
}
api('template', params).then(res => {

uni.setStorageSync('templateData', res.data);
commit('TEMPLATE_DATA', res.data);
commit('TEMPLATE_DATA', res.data);
console.log(res,'template');
resolve(res)
}).catch(e => {
reject(e)
Expand Down
8 changes: 6 additions & 2 deletions components/shopro-float-btn/shopro-float-btn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
props: {},
computed: {
...mapState({
template: state => state.init.templateData.floatButton
template: state => state.init.templateData['float-button']
}),
floatData() {
if (this.template) {
Expand All @@ -62,7 +62,11 @@ export default {
}
}
},
created() {},
created() {
// setInterval(function(){
// console.log(this.template,123)
// }, 100);
},
methods: {
hideModal() {
this.showModal = false;
Expand Down
6 changes: 3 additions & 3 deletions components/shopro-mini-card/shopro-mini-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<view class="y-start">
<view class="goods-title more-t">{{ detail.title }}</view>
<slot name="tipTag"></slot>
<view class="size-tip">{{ detail.goods_sku_text }}</view>
<view class="size-tip">{{ detail.goods_sku_text ? detail.goods_sku_text : ''}}</view>
<slot name="goodsBottom">
<view class="price">¥{{ detail.price }}</view>
</slot>
Expand All @@ -16,7 +16,7 @@
<view class="y-start">
<view class="goods-title more-t">{{ detail.title }}</view>
<slot name="tipTag"></slot>
<view class="size-tip">{{ sku.goods_sku_text }}</view>
<view class="size-tip">{{ sku.goods_sku_text ? sku.goods_sku_text: ''}}</view>
<slot name="goodsBottom">
<view class="price">¥{{ detail.price }}</view>
</slot>
Expand All @@ -38,7 +38,7 @@
<image class="goods-img" :src="detail.goods_image" mode=""></image>
<view class="y-start">
<view class="goods-title more-t">{{ detail.goods_title }}</view>
<view class="size-tip">{{ detail.goods_sku_text }}</view>
<view class="size-tip">{{ detail.goods_sku_text ? detail.goods_sku_text : ''}}</view>
<view class="order-goods flex align-center justify-between">
<text class="order-price">¥{{ detail.goods_price }}</text>
<text class="order-num">x{{ detail.goods_num }}</text>
Expand Down
4 changes: 2 additions & 2 deletions components/shopro-notice-modal/shopro-notice-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export default {
},
computed: {
...mapState({
templateData: state => state.init?.templateData,
templateData: state => state.init.templateData.popup,
showLoginTip: state => state.user.showLoginTip
}),
popupData() {
if (this.templateData) {
return this.templateData?.popup[0]?.content;
return this.templateData[0].content;
}
},
currentPath() {
Expand Down
2 changes: 1 addition & 1 deletion components/shopro-tabbar/shopro-tabbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
cartNum: state => state.cart.cartNum
}),
tabbarData() {
if (this.templateData.length) {
if (this.templateData) {
return this.templateData[0].content;
}
},
Expand Down
Loading

0 comments on commit 0e8145f

Please sign in to comment.