From 4efbfcca65ae6db417bf3f1f7e5aa4e063ef2441 Mon Sep 17 00:00:00 2001 From: wwl Date: Mon, 8 Apr 2024 19:35:11 +0800 Subject: [PATCH] fix bug --- .env copy.production | 15 ++++ .env.development | 6 +- .env.development.bak | 15 ++++ .env.production | 6 +- .env.production.bak | 15 ++++ config/test.js | 81 +++++++++++++++++++++ src/api/req.js | 1 + src/subpage/pages/trade/invoice-record.js | 14 ++-- src/subpage/pages/trade/invoice-record.scss | 11 +++ 9 files changed, 153 insertions(+), 11 deletions(-) create mode 100755 .env copy.production create mode 100755 .env.development.bak create mode 100755 .env.production.bak create mode 100755 config/test.js diff --git a/.env copy.production b/.env copy.production new file mode 100755 index 0000000..008f505 --- /dev/null +++ b/.env copy.production @@ -0,0 +1,15 @@ +APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp +APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws +APP_COMPANY_ID=1 +APP_PLATFORM=standard +APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/ +APP_HOME_PAGE=/pages/index +APP_TRACK=youshu +APP_YOUSHU_TOKEN=bi281e87ab2424481a +# APP_ID=wx3e1c17c88abf3e45 +APP_ID=wx72e9e1a93420862c +APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe +APP_MAP_NAME=BIRKENSTOCK门店定位 +APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop +APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets +APP_DIANWU_URL= diff --git a/.env.development b/.env.development index 008f505..133da8c 100755 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ -APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp -APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws +APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp +APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws APP_COMPANY_ID=1 APP_PLATFORM=standard -APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/ +APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/ APP_HOME_PAGE=/pages/index APP_TRACK=youshu APP_YOUSHU_TOKEN=bi281e87ab2424481a diff --git a/.env.development.bak b/.env.development.bak new file mode 100755 index 0000000..19ff852 --- /dev/null +++ b/.env.development.bak @@ -0,0 +1,15 @@ +APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp +APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws +APP_COMPANY_ID=1 +APP_PLATFORM=standard +APP_CUSTOM_SERVER=http://47.103.169.154:8081/ +APP_HOME_PAGE=/pages/index +APP_TRACK=youshu +APP_YOUSHU_TOKEN=bi281e87ab2424481a +# APP_ID=wx3e1c17c88abf3e45 +APP_ID=wx55ff808ba0e28b1d +APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe +APP_MAP_NAME=oneX新零售门店定位 +APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop +APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets +APP_DIANWU_URL= diff --git a/.env.production b/.env.production index 008f505..133da8c 100755 --- a/.env.production +++ b/.env.production @@ -1,8 +1,8 @@ -APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp -APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws +APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp +APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws APP_COMPANY_ID=1 APP_PLATFORM=standard -APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/ +APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/ APP_HOME_PAGE=/pages/index APP_TRACK=youshu APP_YOUSHU_TOKEN=bi281e87ab2424481a diff --git a/.env.production.bak b/.env.production.bak new file mode 100755 index 0000000..19ff852 --- /dev/null +++ b/.env.production.bak @@ -0,0 +1,15 @@ +APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp +APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws +APP_COMPANY_ID=1 +APP_PLATFORM=standard +APP_CUSTOM_SERVER=http://47.103.169.154:8081/ +APP_HOME_PAGE=/pages/index +APP_TRACK=youshu +APP_YOUSHU_TOKEN=bi281e87ab2424481a +# APP_ID=wx3e1c17c88abf3e45 +APP_ID=wx55ff808ba0e28b1d +APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe +APP_MAP_NAME=oneX新零售门店定位 +APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop +APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets +APP_DIANWU_URL= diff --git a/config/test.js b/config/test.js new file mode 100755 index 0000000..86f801d --- /dev/null +++ b/config/test.js @@ -0,0 +1,81 @@ +/* eslint-disable import/no-commonjs */ +const path = require('path') + +module.exports = { + env: { + NODE_ENV: '"production"' + }, + h5: process.env.APP_CDN + ? { + output: { + filename: 'js/[name].[hash:8].js', + chunkFilename: 'js/[name].[chunkhash:8].js' + }, + miniCssExtractPluginOption: { + filename: 'css/[name].[hash:8].css', + chunkFilename: 'css/[id].[hash:8].css' + }, + webpackChain(chain) { + // const pkg = require(path.resolve(__dirname, '../package.json')) + // const { publicPath, bucket: CDNBucket, path: CDNPath } = pkg.cdn + const publicPath = process.env.APP_PUBLIC_PATH + const CDNPath = process.env.APP_CDN_PATH + + let plugin = {} + if (process.env.APP_CDN == 'aws') { + plugin = { + 'asw-s3': { + plugin: require('webpack-s3-plugin'), + args: [ + { + exclude: /.*\.html$/, + s3Options: { + accessKeyId: process.env.APP_CDN_KEY, + secretAccessKey: process.env.APP_CDN_SCERET, + region: process.env.APP_CDN_REGION, + ACL: '' + }, + s3UploadOptions: { + Bucket: process.env.APP_CDN_BUCKET + }, + basePath: CDNPath + // cdnizerOptions: { + // defaultCDNBase: 'http://asdf.ca' + // } + } + ] + } + } + } + + chain.output + .publicPath(`${publicPath}/${CDNPath}/`) + + chain.merge({ + plugin + // plugin: { + // 'qn-webpack': { + // plugin: require('qn-webpack'), + // args: [{ + // accessKey: process.env.CDN_ACCESS_KEY, + // secretKey: process.env.CDN_SECRET_KEY, + // bucket: CDNBucket, + // path: CDNPath, + // exclude: /(?:manifest\.json|\.map)$/ + // }] + // } + // } + }) + } + } + : { + output: { + filename: 'js/[name].[hash:8].js', + chunkFilename: 'js/[name].[chunkhash:8].js' + }, + miniCssExtractPluginOption: { + filename: 'css/[name].[hash:8].css', + chunkFilename: 'css/[id].[hash:8].css' + } + } +} diff --git a/src/api/req.js b/src/api/req.js index 01e125f..6c90ce9 100755 --- a/src/api/req.js +++ b/src/api/req.js @@ -333,6 +333,7 @@ class API { } catch (e) { // console.log(5); console.log(e) + Taro.hideLoading() } if (showLoading) { diff --git a/src/subpage/pages/trade/invoice-record.js b/src/subpage/pages/trade/invoice-record.js index 0598801..76fe639 100755 --- a/src/subpage/pages/trade/invoice-record.js +++ b/src/subpage/pages/trade/invoice-record.js @@ -18,7 +18,8 @@ export default class InvoiceList extends Component { this.state = { ...this.state, - list: [] + list: [], + isLoading: true } } @@ -71,7 +72,8 @@ export default class InvoiceList extends Component { log.debug('[trade list] list fetched and processed: ', nList) this.setState({ - list: [...this.state.list, ...nList] + list: [...this.state.list, ...nList], + isLoading: false }) return { total } @@ -146,12 +148,12 @@ export default class InvoiceList extends Component { } render () { - const { list, page } = this.state + const { list, page, isLoading } = this.state return ( - {list.map((item, idx) => { + {list?.length ? list.map((item, idx) => { return ( this.goDetail(item)} key={`invoice_item_${idx}`}> 商品名称:{item.order?.title} @@ -173,7 +175,9 @@ export default class InvoiceList extends Component { ) - })} + }) : !isLoading && + 您的发票记录为空 + } {page.isLoading && 正在加载...} diff --git a/src/subpage/pages/trade/invoice-record.scss b/src/subpage/pages/trade/invoice-record.scss index 52787d2..0fc376e 100755 --- a/src/subpage/pages/trade/invoice-record.scss +++ b/src/subpage/pages/trade/invoice-record.scss @@ -7,6 +7,17 @@ @include page-scroll(var(--nav-height), 10px); padding-top: 20px; padding-bottom: 50px; + .sp-note { + .sp-image { + margin-top: 400px; + } + &__text { + margin-top: 24px; + font-weight: bold; + font-size: 40px; + color: #000; + } + } } } .invoice-item {