[fix]修改数据地址

main
huyuanxiang 2 years ago
parent 17f2b5dfeb
commit 316035ddda

@ -1,6 +1,6 @@
const isPro = true const isPro = false
export default { export default {
imgUrl: 'http://47.100.35.222:8080/jeecg-boot/sys/common/static/', imgUrl: 'http://store-admin.nhet.cloud:8080/jeecg-boot/sys/common/static/',
apiUrl: isPro ? 'http://47.100.35.222:8080/jeecg-boot' : 'http://47.100.35.222:8080/jeecg-boot', apiUrl: isPro ? 'http://store-admin.nhet.cloud:8080/jeecg-boot' : 'http://store-admin.nhet.cloud:8080/jeecg-boot',
isPro isPro
} }

@ -5,7 +5,8 @@
<view class="top" @tap="jumpDetails(item)"> <view class="top" @tap="jumpDetails(item)">
<image class="cover" lazy-load="true" :src="item.url" mode="scaleToFill"></image> <image class="cover" lazy-load="true" :src="item.url" mode="scaleToFill"></image>
</view> </view>
<view class="bottom padding-lr-sm" > <!-- class padding-lr-sm -->
<view class="bottom " >
<!-- <view v-if="item.goodsName" class="text-xs good_skuSubTitle" style="color: #009125;"> <!-- <view v-if="item.goodsName" class="text-xs good_skuSubTitle" style="color: #009125;">
{{item.goodsName}} {{item.goodsName}}
</view> --> </view> -->
@ -24,8 +25,8 @@
</view> --> </view> -->
</view> </view>
<view class="goumai margin-top-xs flex justify-between align-center"> <view class="goumai margin-top-xs flex justify-between align-center">
<view class="g_left price" v-if="hasToken"> <view class="g_left price" v-if="item.price">
<text v-if="item.price" class="text1 text-bold text-sm"> {{item.price}} </text> <text class="text1 text-bold text-sm"> {{item.price}} </text>
<text style="color: #222">/{{ item.unit}}</text> <text style="color: #222">/{{ item.unit}}</text>
<!-- <text v-if="item.skuItem.dashPrice" class="text2 text-xs"> {{item.skuItem.dashPrice.text}}</text> --> <!-- <text v-if="item.skuItem.dashPrice" class="text2 text-xs"> {{item.skuItem.dashPrice.text}}</text> -->

@ -224,6 +224,8 @@
width: 65%; width: 65%;
color: #999; color: #999;
font-size: 24upx; font-size: 24upx;
line-height: 1;
overflow: hidden;
} }
.cell image { .cell image {

@ -18,7 +18,7 @@
<view class="text-gray text-sm padding-top-xs"> <view class="text-gray text-sm padding-top-xs">
{{goods.category}} {{goods.category}}
</view> </view>
<view class="goods_price" v-if="hasToken"> <view class="goods_price" v-if="goods.price > 0">
<text class="money text-lg">¥{{goods.price}}</text> <text class="money text-lg">¥{{goods.price}}</text>
<text>/{{ goods.unit }}</text> <text>/{{ goods.unit }}</text>
<text class="h_money">{{goodsData.hprice}}</text> <text class="h_money">{{goodsData.hprice}}</text>
@ -633,7 +633,7 @@
this.showModal = false this.showModal = false
}, },
openSku() { openSku() {
if (!this.hasToken) { if (this.goods.price === 0) {
this.$toast('请联系客服人员询价') this.$toast('请联系客服人员询价')
return return
} }

@ -368,8 +368,8 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
} }
.lists .top .sku { .lists .top .sku {
height: 40upx; // height: 40upx;
line-height: 40upx; // line-height: 40upx;
font-size: 24upx; font-size: 24upx;
border-radius: 8upx; border-radius: 8upx;
padding: 0 10upx; padding: 0 10upx;

@ -4,11 +4,12 @@
* request('接口名称',{key:value},'请求方式(默认为GET)') * request('接口名称',{key:value},'请求方式(默认为GET)')
* .then(res=>{console.log(res)}) * .then(res=>{console.log(res)})
*/ */
import { getToken, removeToken } from "./auth"; import {getToken} from "./auth";
import CONFIG from '@/config' import CONFIG from '@/config'
export const baseUrl = CONFIG.apiUrl export const baseUrl = CONFIG.apiUrl
const whitePath = ['/pages/login/index1'] const whitePath = ['/pages/login/index1']
async function request(mehtod, params, type = 'GET') { async function request(method, params, type = 'GET') {
//创建一个名为request请求的方法函数 //创建一个名为request请求的方法函数
const token = getToken() const token = getToken()
// if (!token) { // if (!token) {
@ -25,15 +26,15 @@ async function request(mehtod, params, type = 'GET') {
"Content-Type": "application/json; charset=UTF-8" "Content-Type": "application/json; charset=UTF-8"
}; };
let http = { let http = {
url: baseUrl + mehtod, url: baseUrl + method,
data: params, data: params,
method: type.toUpperCase(), method: type.toUpperCase(),
header: header header: header
}; };
let promise = new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request(http).then(res => { uni.request(http).then(res => {
let newdata = res[1].data; // if (newdata.code == 403) { let newData = res[1].data; // if (newdata.code == 403) {
if (newdata == -1) { if (newData == -1) {
//如果错误码为 -1 提示 //如果错误码为 -1 提示
uni.showToast({ uni.showToast({
title: res[1].data.msg, title: res[1].data.msg,
@ -42,15 +43,14 @@ async function request(mehtod, params, type = 'GET') {
} }
resolve(res[1].data); resolve(res[1].data);
}).catch(err => { }).catch(err => {
if (err.statusCode === 401) { if (err.statusCode === 401) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/login/index1?status=' + 1 url: '/pages/login/index1?status=' + 1
}) })
} }
reject(err); reject(err);
console.log(err); console.log(err);
}); });
}); });
return promise;
} }
export default request export default request

Loading…
Cancel
Save