1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

支付宝小程序、微信小程序输出到不同dist目录;一些小调整

This commit is contained in:
程序员小墨 2022-11-27 00:30:25 +08:00
parent 070cb9a997
commit 286b244457
6 changed files with 26 additions and 17 deletions

View File

@ -283,7 +283,7 @@ cd ../
##### 配置业务域名 ##### 配置业务域名
修改 `miniprogram/src/app.js` 文件 1.修改 `miniprogram/src/app.js` 文件
```javascript ```javascript
App.use(setGlobalDataPlugin, { App.use(setGlobalDataPlugin, {
@ -293,7 +293,13 @@ App.use(setGlobalDataPlugin, {
}) })
``` ```
同时记得在[微信小程序后台](https://mp.weixin.qq.com/)填写小程序的**服务器域名**→**request合法域名**(注意不是业务域名)。 2.配置服务域名
- 小程序:在[微信小程序后台](https://mp.weixin.qq.com/) - 左侧最下方**开发** - **开发管理** - 右侧上方**开发设置** - **服务器域名** 添加 `https://` 开头的**request合法域名**
- 小程序测试号:在[微信小程序后台](https://mp.weixin.qq.com/) - **服务器域名** 添加 `https://` 开头的**request合法域名**(注意不是业务域名)
- 支付宝沙箱应用:在[支付宝开放平台](https://open.alipay.com/develop/sandbox/app) - 左侧**沙箱应用** - **服务端域名白名单** 添加 `https://` 开头的**httpRequest接口请求域名白名单**
##### 配置微信小程序appid ##### 配置微信小程序appid

View File

@ -8,13 +8,13 @@ const config = {
828: 1.81 / 2 828: 1.81 / 2
}, },
sourceRoot: 'src', sourceRoot: 'src',
outputRoot: 'dist', outputRoot: `dist/${process.env.TARO_ENV}`,
plugins: [], plugins: [],
defineConstants: { defineConstants: {
}, },
copy: { copy: {
patterns: [ patterns: [
{ from: 'src/image/', to: 'dist/image/', ignore: ['*.js'] }, // 指定需要 copy 的目录 { from: 'src/image/', to: `dist/${process.env.TARO_ENV}/image/`, ignore: ['*.js'] }, // 指定需要 copy 的目录
], ],
options: { options: {
} }

View File

@ -1,5 +1,5 @@
{ {
"miniprogramRoot": "dist/", "miniprogramRoot": "dist/weapp/",
"projectname": "epp", "projectname": "epp",
"description": "基于微服务的社区疫情防控系统", "description": "基于微服务的社区疫情防控系统",
"appid": "wxa70348746d2b562f", "appid": "wxa70348746d2b562f",
@ -18,7 +18,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.27.1", "libVersion": "2.27.1",
"srcMiniprogramRoot": "dist/", "srcMiniprogramRoot": "dist/weapp/",
"packOptions": { "packOptions": {
"ignore": [], "ignore": [],
"include": [] "include": []

View File

@ -16,6 +16,7 @@
} }
.inputText { .inputText {
width: 95%;
border-bottom: solid 1px; border-bottom: solid 1px;
margin-bottom: 50px; margin-bottom: 50px;
} }

View File

@ -15,7 +15,7 @@
#myQrcode { #myQrcode {
display: block; display: block;
margin: 0 auto; margin: 30px auto;
} }
#show-text { #show-text {

View File

@ -2,7 +2,7 @@
<view id="codeView" :style="{ display: isShow }"> <view id="codeView" :style="{ display: isShow }">
<view id="user-text"><text>{{ userText }}</text></view> <view id="user-text"><text>{{ userText }}</text></view>
<view id="time-text"><text>{{ time }}</text></view> <view id="time-text"><text>{{ time }}</text></view>
<canvas type="2d" style="width: 70vw; height: 70vw;" id="myQrcode"></canvas> <canvas type="2d" style="width: 250px; height: 250px;" id="myQrcode"></canvas>
<view id="show-text"><text :style="{ color: showTextColor }">{{ showText }}</text></view> <view id="show-text"><text :style="{ color: showTextColor }">{{ showText }}</text></view>
<view id="small-text"><text>下拉可刷新</text></view> <view id="small-text"><text>下拉可刷新</text></view>
</view> </view>
@ -40,6 +40,7 @@ export default {
console.log('onHide') console.log('onHide')
clearInterval(this.timeInterval); clearInterval(this.timeInterval);
this.isShow = 'none' this.isShow = 'none'
this.time = ''
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -47,6 +48,7 @@ export default {
Taro.showNavigationBarLoading(); Taro.showNavigationBarLoading();
clearInterval(this.timeInterval); clearInterval(this.timeInterval);
this.isShow = 'none' this.isShow = 'none'
this.time = ''
this.userInfo = Taro.getStorageSync("userInfo"); this.userInfo = Taro.getStorageSync("userInfo");
if (!this.userInfo) { if (!this.userInfo) {
Taro.redirectTo({ Taro.redirectTo({
@ -112,7 +114,7 @@ export default {
canvas: canvas, canvas: canvas,
canvasId: 'myQrcode', canvasId: 'myQrcode',
width: 260, width: 260,
padding: 30, padding: 0,
background: '#ffffff', background: '#ffffff',
foreground: foreground, foreground: foreground,
text: text, text: text,