feat(global): fix error when build with app-plus
This commit is contained in:
parent
e89e3ac5e8
commit
ee473854f9
6
App.vue
6
App.vue
|
@ -7,9 +7,7 @@
|
||||||
-->
|
-->
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function (options) {
|
||||||
let url = window.location.href.split('/#/')[1].split('?')[0]
|
|
||||||
|
|
||||||
// 分享注册
|
// 分享注册
|
||||||
const whiteList = [
|
const whiteList = [
|
||||||
// 'pages/shareRegist/index',
|
// 'pages/shareRegist/index',
|
||||||
|
@ -21,7 +19,7 @@ export default {
|
||||||
// 'pages/shareArea/hiOrder',
|
// 'pages/shareArea/hiOrder',
|
||||||
// 'pages/pay/hiPay'
|
// 'pages/pay/hiPay'
|
||||||
]
|
]
|
||||||
if (whiteList.indexOf(url) !== -1) {
|
if (whiteList.indexOf(options.path) !== -1) {
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('GetInfo')
|
this.$store.dispatch('GetInfo')
|
||||||
this.$store.dispatch('getCarLength')
|
this.$store.dispatch('getCarLength')
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="quan"
|
<view class="quan"
|
||||||
@click.stop="goCart">
|
@click.stop="goCart">
|
||||||
<img :src="smallCarLength>0?img1:img2"
|
<image :src="smallCarLength>0?img1:img2"
|
||||||
alt="">
|
alt="">
|
||||||
|
|
||||||
<view class="qiu"
|
<view class="qiu"
|
||||||
v-show="smallCarLength > 0">{{ smallCarLength }}</view>
|
v-show="smallCarLength > 0">{{ smallCarLength }}</view>
|
||||||
|
|
||||||
|
@ -37,8 +38,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
downShow: false,
|
downShow: false,
|
||||||
img1: require('@/static/images/cartBall1.png'),
|
img1: require('static/images/cartBall1.png'),
|
||||||
img2: require('@/static/images/cartBall.png'),
|
img2: require('static/images/cartBall.png'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -108,7 +109,7 @@ export default {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
img {
|
image {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -10,11 +10,28 @@ const TokenKey = 'Admin-Token'
|
||||||
const TokenMi = 'Mi-token'
|
const TokenMi = 'Mi-token'
|
||||||
|
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
return Cookies.get(TokenKey)
|
let cookie = ''
|
||||||
|
// #ifdef H5
|
||||||
|
cookie = Cookies.get(TokenKey)
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
cookie = uni.getStorageSync(TokenKey)
|
||||||
|
// #endif
|
||||||
|
return cookie
|
||||||
}
|
}
|
||||||
export function setToken(token, expires) {
|
export function setToken(token, expires) {
|
||||||
return Cookies.set(TokenKey, token)
|
// #ifdef H5
|
||||||
|
Cookies.set(TokenKey, token)
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
uni.setStorageSync(TokenKey, token)
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
export function removeToken() {
|
export function removeToken() {
|
||||||
return Cookies.remove(TokenKey)
|
// #ifdef H5
|
||||||
|
Cookies.remove(TokenKey)
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
uni.removeStorageSync(TokenKey)
|
||||||
|
// #endif
|
||||||
}
|
}
|
|
@ -8,17 +8,17 @@ import { getToken, removeToken } from '@/config/auth.js'
|
||||||
module.exports = (vm) => {
|
module.exports = (vm) => {
|
||||||
// 初始化请求配置
|
// 初始化请求配置
|
||||||
uni.$u.http.setConfig((config) => {
|
uni.$u.http.setConfig((config) => {
|
||||||
// config.baseURL = 'https://p1.hzs413.com/inter-api';
|
config.baseURL = 'http://localhost:8080'
|
||||||
// 192.168.0.100:8080
|
// 192.168.0.100:8080
|
||||||
|
|
||||||
//#ifdef DEV_SERVER
|
//#ifdef DEV_SERVER
|
||||||
console.log('DEV_SERVER')
|
console.log('DEV_SERVER')
|
||||||
config.baseURL = '/prod-api';
|
// config.baseURL = '/prod-api';
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#ifdef QA_SERVER
|
//#ifdef QA_SERVER
|
||||||
console.log('QA_SERVER')
|
console.log('QA_SERVER')
|
||||||
config.baseURL = '/prod-api';
|
// config.baseURL = '/prod-api';
|
||||||
//#endif
|
//#endif
|
||||||
config.timeout = 30000;
|
config.timeout = 30000;
|
||||||
return config
|
return config
|
||||||
|
@ -48,17 +48,7 @@ module.exports = (vm) => {
|
||||||
// 响应拦截
|
// 响应拦截
|
||||||
uni.$u.http.interceptors.response.use((response) => {
|
uni.$u.http.interceptors.response.use((response) => {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
// uni.$u.toast(data.msg)
|
|
||||||
// if (data.code == 200) {
|
|
||||||
// return data;
|
|
||||||
// } else {
|
|
||||||
// token过期,清除token重新获取
|
|
||||||
if (data.code == 400 || data.code == 401 || data.code == 402) {
|
if (data.code == 400 || data.code == 401 || data.code == 402) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '登录超时',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 1500,
|
|
||||||
// })
|
|
||||||
removeToken();
|
removeToken();
|
||||||
// 跳转到登录
|
// 跳转到登录
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -8,24 +8,24 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<script>
|
<!-- <script>
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||||
CSS.supports('top: constant(a)'))
|
CSS.supports('top: constant(a)'))
|
||||||
document.write(
|
document.write(
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||||
</script>
|
</script> -->
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--preload-links-->
|
<!--preload-links-->
|
||||||
<!--app-context-->
|
<!--app-context-->
|
||||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.css"/>
|
<link rel="stylesheet" href="<%= BASE_URL %>static/index.css"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0 viewport-fit=cover"/>
|
||||||
<script src="https://bd-qd.oss-cn-beijing.aliyuncs.com/test_01/language/zh-CN.js"></script>
|
<script src="https://bd-qd.oss-cn-beijing.aliyuncs.com/test_01/language/zh-CN.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"><!--app-html--></div>
|
<div id="app"><!--app-html--></div>
|
||||||
<script type="module" src="/main.js"></script>
|
<script type="module" src="/main.js"></script>
|
||||||
<script type="module" src="static/cdn/echarts.min.js"></script>
|
<!-- <script type="module" src="static/cdn/echarts.min.js"></script> -->
|
||||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
14
main.js
14
main.js
|
@ -19,10 +19,10 @@ import store from '@/store/index.js'
|
||||||
import Vue2OrgTree from 'vue-tree-color'
|
import Vue2OrgTree from 'vue-tree-color'
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
Vue.prototype.$echarts = echarts;
|
Vue.prototype.$echarts = echarts;
|
||||||
|
import 'static/styles/index.css'
|
||||||
Vue.use(Vue2OrgTree)
|
Vue.use(Vue2OrgTree)
|
||||||
import axios from 'axios';
|
// import { saveAs } from 'file-saver';
|
||||||
import { saveAs } from 'file-saver';
|
// window.wx = {}
|
||||||
window.wx = {}
|
|
||||||
|
|
||||||
/*底部数据*/
|
/*底部数据*/
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const app = new Vue({
|
||||||
Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp']
|
Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp']
|
||||||
|
|
||||||
|
|
||||||
// 复制
|
// // 复制
|
||||||
import VueClipboard from 'vue-clipboard2'
|
import VueClipboard from 'vue-clipboard2'
|
||||||
Vue.use(VueClipboard)
|
Vue.use(VueClipboard)
|
||||||
|
|
||||||
|
@ -50,14 +50,14 @@ Vue.filter('numberToCurrency', numberToCurrencyNo)
|
||||||
Vue.filter('toThousandthAndKeepDecimal', toThousandthAndKeepDecimal)
|
Vue.filter('toThousandthAndKeepDecimal', toThousandthAndKeepDecimal)
|
||||||
// 配置全局过滤器,实现数字千分位格式
|
// 配置全局过滤器,实现数字千分位格式
|
||||||
Vue.filter('isLocal', isLocal)
|
Vue.filter('isLocal', isLocal)
|
||||||
import i18n from '@/util/i18n/index'
|
// import i18n from '@/util/i18n/index'
|
||||||
Vue.prototype._i18n = i18n
|
// Vue.prototype._i18n = i18n
|
||||||
|
|
||||||
// #ifdef VUE3
|
// #ifdef VUE3
|
||||||
import { createSSRApp } from 'vue'
|
import { createSSRApp } from 'vue'
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
app.use(i18n)
|
// app.use(i18n)
|
||||||
return {
|
return {
|
||||||
app,
|
app,
|
||||||
store
|
store
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
safeAreaTop: 0,
|
||||||
|
safeAreaBottom: 0,
|
||||||
|
safeAreaLeft: 0,
|
||||||
|
safeAreaRight: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const {top, bottom, left, right} = uni.getSystemInfoSync().safeAreaInsets
|
||||||
|
this.safeAreaTop = top
|
||||||
|
this.safeAreaBottom = bottom
|
||||||
|
this.safeAreaLeft = left
|
||||||
|
this.safeAreaRight = right
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,8 +15,9 @@
|
||||||
"glob": "^11.0.1",
|
"glob": "^11.0.1",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"qrcodejs2": "0.0.2",
|
"qrcodejs2": "^0.0.2",
|
||||||
"swiper": "^3.4.2",
|
"swiper": "^3.4.2",
|
||||||
|
"uqrcodejs": "^4.0.7",
|
||||||
"vue-clipboard2": "^0.3.3",
|
"vue-clipboard2": "^0.3.3",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.2.2",
|
||||||
"vue-tree-color": "^2.3.2",
|
"vue-tree-color": "^2.3.2",
|
||||||
|
@ -3915,7 +3916,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/qrcodejs2": {
|
"node_modules/qrcodejs2": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
|
||||||
"integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA==",
|
"integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
@ -5101,6 +5102,12 @@
|
||||||
"yarn": "*"
|
"yarn": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/uqrcodejs": {
|
||||||
|
"version": "4.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/uqrcodejs/-/uqrcodejs-4.0.7.tgz",
|
||||||
|
"integrity": "sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==",
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
"node_modules/uri-js": {
|
"node_modules/uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
"glob": "^11.0.1",
|
"glob": "^11.0.1",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"qrcodejs2": "0.0.2",
|
"qrcodejs2": "^0.0.2",
|
||||||
"swiper": "^3.4.2",
|
"swiper": "^3.4.2",
|
||||||
|
"uqrcodejs": "^4.0.7",
|
||||||
"vue-clipboard2": "^0.3.3",
|
"vue-clipboard2": "^0.3.3",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.2.2",
|
||||||
"vue-tree-color": "^2.3.2",
|
"vue-tree-color": "^2.3.2",
|
||||||
|
|
10
pages.json
10
pages.json
|
@ -5,7 +5,6 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页",
|
||||||
"navigationBarBackgroundColor": "#fff",
|
"navigationBarBackgroundColor": "#fff",
|
||||||
// "enablePullDownRefresh": true,
|
|
||||||
"navigationBarHidden": true,
|
"navigationBarHidden": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
@ -174,13 +173,6 @@
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/email/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "公告列表",
|
|
||||||
"navigationBarBackgroundColor": "#fff"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/shoppingCar/index",
|
"path": "pages/shoppingCar/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -228,7 +220,7 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "会员专区",
|
"navigationBarTitleText": "会员专区",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": false
|
"titleNView": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,40 +5,33 @@
|
||||||
* @Date: 2022-11-21 15:11:22
|
* @Date: 2022-11-21 15:11:22
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view :class="userInfo.skin ? 'content1' : 'content'">
|
<view
|
||||||
<view class="content_a">
|
:class="userInfo.skin ? 'content1' : 'content'"
|
||||||
<!-- 商品专区入口 先别删 -->
|
>
|
||||||
<!-- <view @tap="goSpecialArea">会员专区</view> -->
|
<view
|
||||||
<view :class="userInfo.skin ? 'index-top1' : 'index-top'">
|
class="content_a"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="userInfo.skin ? 'index-top1' : 'index-top'"
|
||||||
|
:style="{
|
||||||
|
paddingTop: safeAreaTop + 'rpx',
|
||||||
|
}"
|
||||||
|
>
|
||||||
<view class="index_t">
|
<view class="index_t">
|
||||||
<view class="index-left">
|
<view class="index-left">
|
||||||
<view class="english">GLOBALIZATION</view>
|
<view class="english">GLOBALIZATION</view>
|
||||||
<view class="text">{{ '全球一体化' }}</view>
|
<view class="text">{{ '全球一体化' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="index-right">
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
class="changeLanguages"
|
v-if="!isEmpty(goodsList.advertBannerList)"
|
||||||
v-if="isEmpty(getLanguageList) == false"
|
class="banner"
|
||||||
|
:style="{
|
||||||
|
paddingTop: 140 + safeAreaTop + 'rpx'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<picker
|
|
||||||
:range="getLanguageList"
|
|
||||||
:value="index"
|
|
||||||
range-key="label"
|
|
||||||
@change="bindPickerChange"
|
|
||||||
>
|
|
||||||
<view class="select-text">
|
|
||||||
<view class="texts">{{ getLanguageList[index].label }}</view>
|
|
||||||
<view class="">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="banner" v-if="isEmpty(goodsList.advertBannerList) == false">
|
|
||||||
<view class="uni-margin-wrap">
|
<view class="uni-margin-wrap">
|
||||||
<swiper
|
<swiper
|
||||||
class="swiper"
|
class="swiper"
|
||||||
|
@ -102,28 +95,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods_content">
|
<view class="goods_content">
|
||||||
<!-- banner图!-->
|
|
||||||
<!-- <view class="goods-lists"-->
|
|
||||||
<!-- v-if="isEmpty(goodsList.waresCoverInfoList)==false">-->
|
|
||||||
<!-- <view class="uni-margin-wrap"-->
|
|
||||||
<!-- v-if="goodsList.waresCoverInfoList[0]">-->
|
|
||||||
<!-- <swiper class="swiper swiper-s"-->
|
|
||||||
<!-- circular-->
|
|
||||||
<!-- :indicator-dots="indicatorDots"-->
|
|
||||||
<!-- :autoplay="autoplay"-->
|
|
||||||
<!-- :interval="interval"-->
|
|
||||||
<!-- :duration="duration">-->
|
|
||||||
<!-- <swiper-item v-for="item in goodsList.waresCoverInfoList[0].coverList">-->
|
|
||||||
<!-- <view class="swiper-items uni-bg-red">-->
|
|
||||||
<!-- <image :src="item"></image>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </swiper-item>-->
|
|
||||||
<!-- </swiper>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<view
|
<view
|
||||||
class="goods-center-lists"
|
class="goods-center-lists"
|
||||||
v-for="item in goodsList.waresVoList"
|
v-for="(item, idx) in goodsList.waresVoList"
|
||||||
|
:key="idx"
|
||||||
@click="goDetails(item)"
|
@click="goDetails(item)"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
|
@ -214,8 +190,10 @@ import clTabbar from "@/components/cl-tabbar.vue";
|
||||||
import noticePopup from "@/components/noticePopup.vue";
|
import noticePopup from "@/components/noticePopup.vue";
|
||||||
import getTree from "@/components/getTree.vue";
|
import getTree from "@/components/getTree.vue";
|
||||||
import znNewsPopup from "@/components/znNewsPopup.vue";
|
import znNewsPopup from "@/components/znNewsPopup.vue";
|
||||||
|
import deviceSafeArea from '@/mixins/deviceSafeArea.js'
|
||||||
// import directrankPopup from "@/components/directrankPopup.vue";
|
// import directrankPopup from "@/components/directrankPopup.vue";
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [deviceSafeArea],
|
||||||
components: {
|
components: {
|
||||||
noticePopup,
|
noticePopup,
|
||||||
znNewsPopup,
|
znNewsPopup,
|
||||||
|
@ -437,10 +415,8 @@ export default {
|
||||||
uni.getStorageSync("showInfo") == undefined ||
|
uni.getStorageSync("showInfo") == undefined ||
|
||||||
uni.getStorageSync("showInfo") == 0
|
uni.getStorageSync("showInfo") == 0
|
||||||
) {
|
) {
|
||||||
this.getRepurchase();
|
|
||||||
}
|
}
|
||||||
this.getGoodsInfo();
|
this.getGoodsInfo();
|
||||||
// this.getLanguage();
|
|
||||||
this.getService();
|
this.getService();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -454,23 +430,6 @@ export default {
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getRepurchase() {
|
|
||||||
// api.index_repurchase().then((res) => {
|
|
||||||
// if (res.msg) {
|
|
||||||
// uni.showModal({
|
|
||||||
// title: "提示",
|
|
||||||
// content: res.msg,
|
|
||||||
// showCancel: false,
|
|
||||||
// confirmColor: "#f82c1a",
|
|
||||||
// success: function (res) {
|
|
||||||
// if (res.confirm) {
|
|
||||||
// uni.setStorageSync("showInfo", 1);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
// index_repurchase
|
// index_repurchase
|
||||||
goAreaUrl() {
|
goAreaUrl() {
|
||||||
ban.agreementName().then((res) => {
|
ban.agreementName().then((res) => {
|
||||||
|
@ -581,12 +540,6 @@ export default {
|
||||||
this.goodsList = res.data;
|
this.goodsList = res.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
bindPickerChange(e) {
|
|
||||||
this.index = e.detail.value;
|
|
||||||
uni.setStorageSync("lang", this.getLanguageList[e.detail.value].field);
|
|
||||||
this.$i18n.locale = this.getLanguageList[e.detail.value].field;
|
|
||||||
window.location.reload();
|
|
||||||
},
|
|
||||||
goUrl(item) {
|
goUrl(item) {
|
||||||
ban.agreementName().then((res) => {
|
ban.agreementName().then((res) => {
|
||||||
if (res.data == 0) {
|
if (res.data == 0) {
|
||||||
|
@ -680,29 +633,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goSpecialArea() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/index/specialArea/index",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getLanguage() {
|
|
||||||
api.getLanguages().then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
res.data.forEach((item, index) => {
|
|
||||||
if (item.field == uni.getStorageSync("lang")) {
|
|
||||||
this.index = index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (
|
|
||||||
uni.getStorageSync("lang") == undefined ||
|
|
||||||
uni.getStorageSync("lang") == "undefined"
|
|
||||||
) {
|
|
||||||
uni.setStorageSync("lang", "zh-CN");
|
|
||||||
}
|
|
||||||
this.getLanguageList = res.data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -989,7 +919,6 @@ header {
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
padding: 140rpx 0 0 0;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -1055,6 +984,8 @@ page {
|
||||||
.index-top1 {
|
.index-top1 {
|
||||||
background: url("~@/static/images/tBgd.jpg") no-repeat;
|
background: url("~@/static/images/tBgd.jpg") no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
|
padding-top: constant(safe-area-inset-top);
|
||||||
|
padding-top: env(safe-area-inset-top);
|
||||||
// padding: 30rpx 20rpx; // height: 100rpx;
|
// padding: 30rpx 20rpx; // height: 100rpx;
|
||||||
// background-color: #fff;
|
// background-color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -125,8 +125,8 @@ export default {
|
||||||
changeFlag: true,
|
changeFlag: true,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: '',
|
username: 'CN123456789',
|
||||||
password: '',
|
password: '111111',
|
||||||
code: '',
|
code: '',
|
||||||
uuid: '',
|
uuid: '',
|
||||||
},
|
},
|
||||||
|
@ -166,8 +166,8 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toLogin() {
|
toLogin() {
|
||||||
|
this.isLoading = true
|
||||||
api.login(this.loginForm).then((res) => {
|
api.login(this.loginForm).then((res) => {
|
||||||
this.isLoading = false
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.msg,
|
// title: res.msg,
|
||||||
|
@ -182,6 +182,8 @@ export default {
|
||||||
setToken(res.data.access_token)
|
setToken(res.data.access_token)
|
||||||
this.getUseInfo()
|
this.getUseInfo()
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
urlToBase64(url) {
|
urlToBase64(url) {
|
||||||
|
@ -198,7 +200,9 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUseInfo() {
|
getUseInfo() {
|
||||||
|
|
||||||
store.dispatch('GetInfo').then((res) => {
|
store.dispatch('GetInfo').then((res) => {
|
||||||
|
|
||||||
uni.switchTab({ url: '/pages/index/index' })
|
uni.switchTab({ url: '/pages/index/index' })
|
||||||
// 目前强制跳首页
|
// 目前强制跳首页
|
||||||
// if (res.data.loginType == 1) {
|
// if (res.data.loginType == 1) {
|
||||||
|
@ -213,6 +217,8 @@ export default {
|
||||||
// uni.switchTab({ url: '/pages/index/index' })
|
// uni.switchTab({ url: '/pages/index/index' })
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.$u.toast(err)
|
||||||
})
|
})
|
||||||
// api.getInfo().then((res) => {
|
// api.getInfo().then((res) => {
|
||||||
// uni.setStorage('User', res.data)
|
// uni.setStorage('User', res.data)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -102,7 +102,7 @@
|
||||||
<img
|
<img
|
||||||
class="kong"
|
class="kong"
|
||||||
v-show="shopCarList.length == 0"
|
v-show="shopCarList.length == 0"
|
||||||
src="@/static/images/kong.png"
|
src="static/images/kong.png"
|
||||||
alt=""
|
alt=""
|
||||||
/></view>
|
/></view>
|
||||||
<view class="zhan"></view>
|
<view class="zhan"></view>
|
||||||
|
|
|
@ -85,10 +85,10 @@
|
||||||
</view>
|
</view>
|
||||||
<img @click.stop="addCar(item)"
|
<img @click.stop="addCar(item)"
|
||||||
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea != 31"
|
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea != 31"
|
||||||
src="@/static/images/cart.png" alt="" />
|
src="static/images/cart.png" alt="" />
|
||||||
<img @click.stop="addCar(item)"
|
<img @click.stop="addCar(item)"
|
||||||
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea == 31&&userInfo.isMakerSpace == 0"
|
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea == 31&&userInfo.isMakerSpace == 0"
|
||||||
src="@/static/images/cart.png" alt="" />
|
src="static/images/cart.png" alt="" />
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="pv" v-show="specialArea == 31"> 统一零售价:{{ item.retailPrice| numberToCurrency | isLocal}} </view> -->
|
<!-- <view class="pv" v-show="specialArea == 31"> 统一零售价:{{ item.retailPrice| numberToCurrency | isLocal}} </view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,6 @@
|
||||||
|
body {
|
||||||
|
padding-top: env(safe-area-inset-top);
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
padding-left: env(safe-area-inset-left);
|
||||||
|
padding-right: env(safe-area-inset-right);
|
||||||
|
}
|
|
@ -58,6 +58,7 @@ const actions = {
|
||||||
GetInfo({ commit, state }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo().then(res => {
|
getInfo().then(res => {
|
||||||
|
// uni.$u.toast(res)
|
||||||
if (res) {
|
if (res) {
|
||||||
commit('SET_USER', res.data)
|
commit('SET_USER', res.data)
|
||||||
uni.setStorageSync("User", res.data);
|
uni.setStorageSync("User", res.data);
|
||||||
|
|
|
@ -316,7 +316,7 @@ export default {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: href,
|
url: href,
|
||||||
fail() {
|
fail() {
|
||||||
wx.switchTab({
|
uni.switchTab({
|
||||||
url: href
|
url: href
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue