Merge branch 'dev' into test
This commit is contained in:
@@ -817,7 +817,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goRoom() {
|
goRoom() {
|
||||||
console.log(this.systemStore);
|
console.log(this.storeInfo);
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: this.id,
|
goodsId: this.id,
|
||||||
goodsName: this.attr.productSelect.store_name,
|
goodsName: this.attr.productSelect.store_name,
|
||||||
@@ -826,7 +826,8 @@ export default {
|
|||||||
seckillId: this.activityId,
|
seckillId: this.activityId,
|
||||||
cover: this.attr.productSelect.image,
|
cover: this.attr.productSelect.image,
|
||||||
goodsData: '',
|
goodsData: '',
|
||||||
seckillData: ''
|
seckillData: '',
|
||||||
|
isNegotiable: this.storeInfo.isNegotiable
|
||||||
}
|
}
|
||||||
const name = this.storeInfo.merName
|
const name = this.storeInfo.merName
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -37,9 +37,12 @@
|
|||||||
{{ wsJson(item.msg_content).skuStr }}
|
{{ wsJson(item.msg_content).skuStr }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="price v12-primary-text v12-font-24">
|
<view class="price v12-primary-text v12-font-24" v-if="wsJson(item.msg_content).isNegotiable !== 1">
|
||||||
¥{{ wsJson(item.msg_content).price }}
|
¥{{ wsJson(item.msg_content).price }}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="price v12-primary-text v12-font-24" v-else>
|
||||||
|
价格面议
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,9 +63,12 @@
|
|||||||
{{ params.skuStr }}
|
{{ params.skuStr }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="price v12-primary-text v12-font-24">
|
<view class="price v12-primary-text v12-font-24" v-if="params.isNegotiable !== 1">
|
||||||
¥{{ params.price }}
|
¥{{ params.price }}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="price v12-primary-text v12-font-24" v-else>
|
||||||
|
价格面议
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+21
-10
@@ -63,7 +63,7 @@ const defaultOpt = {login: true};
|
|||||||
function baseRequest(options) {
|
function baseRequest(options) {
|
||||||
|
|
||||||
// 从缓存中获取 token 防止 token 失效后还会继续请求的情况
|
// 从缓存中获取 token 防止 token 失效后还会继续请求的情况
|
||||||
const token = cookie.get('login_status');
|
const token = cookie.get('login_status')
|
||||||
|
|
||||||
// 合并传参过来的 headers
|
// 合并传参过来的 headers
|
||||||
// 如果接口需要登录,携带 token 去请求
|
// 如果接口需要登录,携带 token 去请求
|
||||||
@@ -85,28 +85,39 @@ function baseRequest(options) {
|
|||||||
|
|
||||||
// 发起请求
|
// 发起请求
|
||||||
return http[options.method](url, _params).then(res => {
|
return http[options.method](url, _params).then(res => {
|
||||||
const resData = res.data || {};
|
const resData = res.data || {}
|
||||||
// AI对话某个请求返回为空需要处理这种情况
|
// AI对话某个请求返回为空需要处理这种情况
|
||||||
if (['get', 'GET'].includes(options.method) && _params.params.isNoNeedPublicErrorNotification === 1) {
|
if (['get', 'GET'].includes(options.method) && _params.params.isNoNeedPublicErrorNotification === 1) {
|
||||||
console.log('----')
|
console.log('----')
|
||||||
if (resData.status === 500) {
|
if (resData.status === 500) {
|
||||||
return Promise.reject({msg: resData.msg, res, data});
|
return Promise.reject({msg: resData.msg, res, data})
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve({})
|
return Promise.resolve({})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
return Promise.reject({msg: "请求失败", res, resData});
|
return Promise.reject({msg: "请求失败", res, resData})
|
||||||
}
|
}
|
||||||
if (resData.status === 401) {
|
if (resData.status === 401) {
|
||||||
handleLoginFailure();
|
const whiteApiList = ['guide/status', 'cart/count', 'product/hasFavorite']
|
||||||
return Promise.reject({msg: '未登录', res, resData, toLogin: true});
|
let flag = false
|
||||||
|
whiteApiList.map(item => {
|
||||||
|
if (options.url.indexOf(item) > -1) {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (flag) {
|
||||||
|
return Promise.resolve(resData, res)
|
||||||
|
} else {
|
||||||
|
handleLoginFailure();
|
||||||
|
return Promise.reject({msg: '未登录', res, resData, toLogin: true})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ([ 403].indexOf(resData.status) !== -1) {
|
if ([ 403].indexOf(resData.status) !== -1) {
|
||||||
handleLoginFailure();
|
handleLoginFailure();
|
||||||
return Promise.reject({msg: res.data.msg, res, resData, toLogin: true});
|
return Promise.reject({msg: res.data.msg, res, resData, toLogin: true})
|
||||||
} else if (resData.status === 200) {
|
} else if (resData.status === 200) {
|
||||||
return Promise.resolve(resData, res);
|
return Promise.resolve(resData, res)
|
||||||
} else {
|
} else {
|
||||||
// 埋点数据推送、获取店铺分享图片
|
// 埋点数据推送、获取店铺分享图片
|
||||||
if (url.indexOf('api/systemStats/push') < 0 && url.indexOf('api/hotelMain/shareImage') < 0) {
|
if (url.indexOf('api/systemStats/push') < 0 && url.indexOf('api/hotelMain/shareImage') < 0) {
|
||||||
@@ -118,9 +129,9 @@ function baseRequest(options) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject({msg: resData.msg, res, data});
|
return Promise.reject({msg: resData.msg, res, data})
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user